From 5406b17601b3fab108cdce7f83987335f4db50bf Mon Sep 17 00:00:00 2001 From: Lombiq Date: Sun, 13 Dec 2015 22:21:02 +0100 Subject: [PATCH] Converting all files stored as CRLF in git to be stored as LF LF is the git default and all new files are stored as such. Old files from the hg to git conversion however were moved over as CRLF. --- CREDITS.txt | 578 +- ClickToBuild.cmd | 58 +- DeleteModuleBinaries.cmd | 8 +- LICENSE.txt | 18 +- Orchard.proj | 916 +- build.cmd | 2 +- lib/aspnetmvc/System.Web.Helpers.xml | 1676 +- lib/aspnetmvc/System.Web.Mvc.xml | 22968 +++--- lib/aspnetmvc/System.Web.Razor.xml | 11482 +-- .../System.Web.WebPages.Deployment.xml | 118 +- lib/aspnetmvc/System.Web.WebPages.Razor.xml | 582 +- lib/aspnetmvc/System.Web.WebPages.xml | 5410 +- .../System.Net.Http.Formatting.xml | 4186 +- lib/aspnetwebapi/System.Web.Http.WebHost.xml | 268 +- lib/aspnetwebapi/System.Web.Http.xml | 13326 ++-- lib/autofac/Autofac.Configuration.xml | 2546 +- lib/autofac/Autofac.XML | 13846 ++-- lib/autofac/License.txt | 52 +- lib/dlr/LICENSE.APACHE.html | 428 +- lib/dlr/LICENSE.CPL.txt | 172 +- lib/dlr/LICENSE.Ruby.txt | 116 +- lib/dlr/README.txt | 98 +- lib/dotnetzip/Ionic.Zip.xml | 36264 ++++----- lib/dotnetzip/License.txt | 66 +- lib/fluentpath/license.txt | 44 +- lib/html5shim/html5.js | 4 +- lib/htmlagilitypack/HtmlAgilityPack.XML | 4860 +- lib/imageresizer/license.txt | 44 +- lib/jquery-utils/jquery.utils.js | 5554 +- lib/jquery-utils/ui.timepickr.js | 774 +- lib/log4net/log4net.xml | 63628 ++++++++-------- lib/lucene.net/Lucene.Net.xml | 55066 ++++++------- lib/moq/Moq.xml | 6628 +- lib/msbuild/MSBuild.Community.Tasks.Targets | 232 +- lib/msdeploy/TBEX.xml | 150 +- lib/msdeploy/manifest.xml | 24 +- lib/msdeploy/parameters.xml | 130 +- lib/newtonsoft.json/Newtonsoft.Json.xml | 17554 ++--- lib/newtonsoft.json/license.txt | 34 +- .../DetachedCriteriaAdapter.cs | 560 +- .../orchard-customizations.txt | 8 +- lib/nhibernate/Iesi.Collections.xml | 1082 +- lib/nuget/COPYRIGHT.txt | 26 +- lib/nuget/CREDITS.txt | 28 +- lib/nuget/LICENSE.txt | 354 +- lib/nunit/NUnitFitTests.html | 554 +- lib/nunit/NUnitTests.config | 168 +- lib/nunit/NUnitTests.nunit | 28 +- lib/nunit/agent.conf | 6 +- lib/nunit/agent.log.conf | 36 +- lib/nunit/clr.bat | 190 +- lib/nunit/launcher.log.conf | 36 +- lib/nunit/license.txt | 30 +- lib/nunit/nunit-agent.exe.config | 172 +- lib/nunit/nunit-console-x86.exe.config | 188 +- lib/nunit/nunit-console.exe.config | 188 +- lib/nunit/nunit-x86.exe.config | 204 +- lib/nunit/nunit.exe.config | 204 +- lib/nunit/pnunit-agent.exe.config | 172 +- lib/nunit/pnunit-launcher.exe.config | 172 +- lib/nunit/runFile.exe.config | 86 +- lib/nunit/runpnunit.bat | 2 +- lib/nunit/test.conf | 46 +- lib/specflow/LICENSE.txt | 62 +- lib/specflow/TechTalk.SpecFlow.targets | 130 +- lib/specflow/TechTalk.SpecFlow.tasks | 34 +- lib/specflow/changelog.txt | 822 +- lib/sqlce/EULA_ENU.rtf | 1554 +- lib/sqlce/ReadmeSSCE_ENU.htm | 1062 +- .../Microsoft.VC90.CRT.manifest | 10 +- .../Microsoft.VC90.CRT.manifest | 10 +- lib/wcat/doc/readme.txt | 74 +- lib/wcat/report.xsl | 3572 +- lib/wcat/samples/scripts/home.ubr | 132 +- lib/wcat/samples/scripts/settings.ubr | 204 +- lib/wcat/samples/src/precomp.h | 28 +- lib/wcat/samples/src/viewstate.c | 372 +- lib/wcat/samples/src/viewstate.def | 14 +- lib/wcat/samples/src/wcat.h | 18 +- lib/wcat/wcat.wsf | 2268 +- ....ApplicationServer.Caching.AzureCommon.xml | 52 +- ...osoft.ApplicationServer.Caching.Client.xml | 2088 +- ...crosoft.ApplicationServer.Caching.Core.xml | 2414 +- .../Microsoft.WindowsAzure.Diagnostics.xml | 4412 +- src/Orchard.4.5.resharper | 178 +- src/Orchard.5.0.ReSharper | 214 +- src/Orchard.Azure.Tests/App.config | 24 +- .../AzureVirtualEnvironmentTest.cs | 132 +- .../AzureShellSettingsManagerTests.cs | 202 +- .../Media/AzureBlobStorageProviderTests.cs | 594 +- .../Orchard.Azure.Tests.csproj | 270 +- .../Orchard.Azure.Tests.sln | 64 +- .../Properties/AssemblyInfo.cs | 72 +- src/Orchard.Azure/Orchard.Azure.5.0.ReSharper | 214 +- .../Orchard.Azure.CloudService.ccproj | 256 +- .../Orchard.Azure.CloudService/Properties.txt | 2 +- .../ServiceDefinition.csdef | 84 +- .../Orchard.Azure.Web/Config/Host.config | 46 +- .../Config/HostComponents.config | 220 +- .../Config/log4net.Debug.config | 6 +- .../Config/log4net.Release.config | 6 +- .../Orchard.Azure.Web/Config/log4net.config | 40 +- .../Orchard.Azure.Web/Global.asax | 2 +- .../Orchard.Azure.Web/Global.asax.cs | 112 +- .../Orchard.Azure.Web.csproj | 1220 +- .../Properties/AssemblyInfo.cs | 70 +- .../Orchard.Azure.Web/Refresh.html | 30 +- .../Orchard.Azure.Web/Web.Debug.config | 6 +- .../Orchard.Azure.Web/Web.Release.config | 20 +- .../Orchard.Azure.Web/Web.config | 424 +- src/Orchard.Azure/Orchard.Azure.sln | 1058 +- src/Orchard.Core.Tests/Body/BodyPartTests.cs | 216 +- .../Common/BbcodeFilterTests.cs | 120 +- .../Providers/CommonPartProviderTests.cs | 932 +- .../Feeds/Controllers/FeedControllerTests.cs | 396 +- .../Orchard.Core.Tests.csproj | 346 +- .../Properties/AssemblyInfo.cs | 68 +- .../Scheduling/ScheduledTaskExecutorTests.cs | 256 +- .../Scheduling/ScheduledTaskManagerTests.cs | 338 +- .../Metadata/ContentDefinitionManagerTests.cs | 646 +- src/Orchard.Profile/Go.cmd | 6 +- src/Orchard.Profile/Initialize.cmd | 8 +- src/Orchard.Profile/Orchard.Profile.csproj | 268 +- .../Properties/AssemblyInfo.cs | 68 +- src/Orchard.Profile/Readme.txt | 78 +- src/Orchard.Profile/Scripts/dashboard.txt | 140 +- src/Orchard.Profile/Scripts/homepage.txt | 126 +- src/Orchard.Profile/Scripts/scenario.txt | 132 +- src/Orchard.Profile/Tests/HttpClient.cs | 140 +- src/Orchard.Profile/Tests/Profiling.feature | 58 +- .../Tests/Profiling.feature.cs | 292 +- src/Orchard.Profile/_environment.cmd | 10 +- .../profiling-setup-commands.txt | 2 +- src/Orchard.Profile/report.xsl | 3572 +- src/Orchard.Profile/settings.txt | 208 +- src/Orchard.Specs/Admin.feature | 16 +- src/Orchard.Specs/Admin.feature.cs | 174 +- src/Orchard.Specs/App.Config | 6 +- src/Orchard.Specs/Bindings/BindingBase.cs | 58 +- src/Orchard.Specs/Bindings/CommandLine.cs | 66 +- src/Orchard.Specs/Bindings/ContentRights.cs | 146 +- .../Bindings/HtmlNodeExtensions.cs | 20 +- .../Bindings/OrchardSiteFactory.cs | 240 +- src/Orchard.Specs/Bindings/SanityCheck.cs | 80 +- src/Orchard.Specs/Bindings/Settings.cs | 78 +- .../Bindings/UsersPermissionsAndRoles.cs | 148 +- src/Orchard.Specs/Bindings/WebAppHosting.cs | 894 +- src/Orchard.Specs/Blogs.feature | 586 +- src/Orchard.Specs/Blogs.feature.cs | 1656 +- src/Orchard.Specs/Comments.feature | 146 +- src/Orchard.Specs/Comments.feature.cs | 452 +- src/Orchard.Specs/ContentRights.feature | 192 +- src/Orchard.Specs/ContentRights.feature.cs | 666 +- src/Orchard.Specs/ContentTypes.feature | 158 +- src/Orchard.Specs/ContentTypes.feature.cs | 562 +- .../Hosting/ExtensionDeploymentOptions.cs | 28 +- .../Hosting/HostingTraceListener.cs | 48 +- src/Orchard.Specs/Hosting/MessageSink.cs | 26 +- .../Orchard.Web/Config/Diagnostics.config | 76 +- .../Hosting/Orchard.Web/Config/Host.config | 50 +- .../Hosting/Orchard.Web/Config/Sites.config | 38 +- .../Hosting/Orchard.Web/Core/Web.config | 52 +- .../Hosting/Orchard.Web/Global.asax.cs | 144 +- .../Hosting/Orchard.Web/Themes/Web.config | 44 +- .../Hosting/Orchard.Web/Web.config | 446 +- src/Orchard.Specs/Hosting/RequestDetails.cs | 50 +- .../Hosting/RequestExtensions.cs | 398 +- .../Hosting/SerializableDelegate.cs | 204 +- .../Hosting/Simple.Web/Global.asax.cs | 34 +- .../Simple.Web/HelloYetAgainHandler.cs | 38 +- .../Hosting/Simple.Web/Simple/Cookie-Set.aspx | 6 +- .../Simple.Web/Simple/Cookie-Show.aspx | 16 +- .../Hosting/Simple.Web/Simple/Page.aspx | 34 +- .../Hosting/Simple.Web/Simple/Redir.aspx | 8 +- .../Hosting/Simple.Web/Simple/Results.aspx | 14 +- .../Hosting/Simple.Web/Web.config | 438 +- ...leDynamicCompilation.HostComponents.config | 202 +- ...ceDynamicCompilation.HostComponents.config | 214 +- ...TraceEnabledDataServicesProviderFactory.cs | 40 +- src/Orchard.Specs/Hosting/WebHost.cs | 602 +- src/Orchard.Specs/Hosting/WebHostAgent.cs | 28 +- src/Orchard.Specs/Lists.feature | 70 +- src/Orchard.Specs/Lists.feature.cs | 296 +- src/Orchard.Specs/Media.feature | 62 +- src/Orchard.Specs/Media.feature.cs | 244 +- src/Orchard.Specs/Modules.feature | 44 +- src/Orchard.Specs/Modules.feature.cs | 250 +- src/Orchard.Specs/MultiTenancy.feature | 402 +- src/Orchard.Specs/MultiTenancy.feature.cs | 1240 +- src/Orchard.Specs/Orchard.Specs.csproj | 1022 +- src/Orchard.Specs/Pages.feature | 108 +- src/Orchard.Specs/Pages.feature.cs | 350 +- src/Orchard.Specs/PermissionModel.feature | 58 +- src/Orchard.Specs/PermissionModel.feature.cs | 272 +- src/Orchard.Specs/Properties/AssemblyInfo.cs | 68 +- src/Orchard.Specs/Setup.feature | 110 +- src/Orchard.Specs/Setup.feature.cs | 460 +- src/Orchard.Specs/SiteCompilation.feature | 48 +- src/Orchard.Specs/SiteCompilation.feature.cs | 262 +- src/Orchard.Specs/Tags.feature | 60 +- src/Orchard.Specs/Tags.feature.cs | 296 +- src/Orchard.Specs/Users.feature | 640 +- src/Orchard.Specs/Users.feature.cs | 1780 +- src/Orchard.Specs/UsingSpecFlow.feature | 20 +- src/Orchard.Specs/UsingSpecFlow.feature.cs | 182 +- src/Orchard.Specs/Util/PathExtensions.cs | 114 +- src/Orchard.Specs/WebHosting.feature | 122 +- src/Orchard.Specs/WebHosting.feature.cs | 504 +- src/Orchard.Specs/Widgets.feature | 132 +- src/Orchard.Specs/Widgets.feature.cs | 480 +- .../Autoroute/DefaultSlugServiceTests.cs | 152 +- .../Commands/CodeGenerationCommandsTests.cs | 148 +- .../Comments/Services/CommentServiceTests.cs | 438 +- .../DatabaseEnabledTestsBase.cs | 166 +- .../Email/EmailChannelTests.cs | 94 +- .../Services/ImportExportServiceTests.cs | 230 +- .../Indexing/IndexingTaskExecutorTests.cs | 616 +- .../Indexing/LuceneIndexProviderTests.cs | 652 +- .../Indexing/LuceneSearchBuilderTests.cs | 1502 +- .../Media/Extensions/LongExtensionsTests.cs | 156 +- .../Media/Extensions/MediaHelpersTests.cs | 44 +- .../Media/Services/MediaServiceTests.cs | 644 +- .../Migrations/SchemaCommandGeneratorTests.cs | 578 +- .../Orchard.Tests.Modules.csproj | 704 +- .../Packaging/Migrations.cs.txt | 18 +- .../Services/FileBasedProjectSystemTests.cs | 214 +- .../Packaging/Services/FolderUpdaterTests.cs | 106 +- .../Packaging/Services/Hello.World.csproj.txt | 252 +- .../Packaging/Services/PackageBuilderTests.cs | 170 +- .../Services/PackageInstallerTests.cs | 362 +- .../Properties/AssemblyInfo.cs | 68 +- .../RecipeHandlers/ModuleRecipeHandlerTest.cs | 506 +- .../RecipeHandlers/ThemeRecipeHandlerTest.cs | 388 +- .../Services/FoldersData/Sample1/Module.txt | 16 +- .../Sample1/Recipes/cms.recipe.xml | 92 +- .../Recipes/Services/RecipeManagerTests.cs | 432 +- .../Roles/Controllers/AdminControllerTests.cs | 8 +- .../Roles/Services/RoleServiceTests.cs | 216 +- .../Scripting.Dlr/EvaluatorTests.cs | 100 +- .../Scripting.Dlr/ScriptingTests.cs | 206 +- .../Scripting/EvaluatorTests.cs | 56 +- .../Scripting/EvaluatorTestsBase.cs | 1050 +- .../Scripting/ParserTests.cs | 686 +- .../Scripting/SimpleScriptingTests.cs | 50 +- .../Scripting/TokenizerTests.cs | 168 +- .../Blueprint/ShellDescriptorManagerTests.cs | 334 +- .../Tags/Services/TagsServiceTests.cs | 570 +- .../Themes/Services/ThemeServiceTests.cs | 562 +- .../Controllers/AccountControllerTests.cs | 752 +- .../Users/Services/MembershipServiceTests.cs | 302 +- .../Users/Services/UserServiceTests.cs | 284 +- .../Users/ShellSettingsUtility.cs | 48 +- src/Orchard.Tests.Modules/Values.cs | 80 +- .../Warmup/WarmupUpdaterTests.cs | 754 +- .../Warmup/WebDownloaderTests.cs | 74 +- .../Widgets/RuleEngine/UrlRuleProviderTest.cs | 172 +- .../Widgets/Services/WidgetsServiceTest.cs | 556 +- .../Widgets/WidgetsTests.cs | 116 +- .../XmlRpc/Controllers/HomeControllerTests.cs | 98 +- .../Controllers/LiveWriterControllerTests.cs | 116 +- .../XmlRpc/Services/XmlRpcReaderTests.cs | 232 +- .../XmlRpc/Services/XmlRpcWriterTests.cs | 132 +- src/Orchard.Tests/App.config | 70 +- src/Orchard.Tests/Caching/CacheScopeTests.cs | 88 +- src/Orchard.Tests/Caching/CacheTests.cs | 268 +- .../Caching/ClockCachingTests.cs | 166 +- .../CommandHandlerDescriptorBuilderTests.cs | 154 +- .../Commands/CommandHandlerTests.cs | 478 +- .../Commands/CommandManagerTests.cs | 94 +- src/Orchard.Tests/ContainerTestBase.cs | 66 +- .../ContentManagement/ContentIdentityTests.cs | 140 +- .../ContentManagement/ContentQueryTests.cs | 1230 +- .../DefaultContentManagerTests.cs | 1524 +- .../FieldStorageProviderSelectorTests.cs | 162 +- .../InfosetFieldStorageProviderTests.cs | 252 +- .../DynamicContentItemTests.cs | 228 +- .../DynamicContentQueryTests.cs | 508 +- .../Handlers/AlphaPartHandler.cs | 24 +- .../Handlers/BetaPartHandler.cs | 20 +- .../Handlers/ContentHandlerTests.cs | 104 +- .../ContentPartDriverCoordinatorTests.cs | 230 +- .../Handlers/DeltaPartHandler.cs | 26 +- .../Handlers/EpsilonPartHandler.cs | 24 +- .../Handlers/FlavoredPartHandler.cs | 26 +- .../Handlers/GammaPartHandler.cs | 26 +- .../Handlers/LambdaPartHandler.cs | 28 +- .../Handlers/ModelBuilderTests.cs | 74 +- .../ContentManagement/HqlExpressionTests.cs | 2086 +- .../ImportContentSessionTests.cs | 368 +- .../ContentTypeDefinitionBuilderTests.cs | 254 +- .../Services/ContentDefinitionReaderTests.cs | 114 +- .../Services/ContentDefinitionWriterTests.cs | 110 +- .../ContentManagement/Models/AlphaPart.cs | 10 +- .../ContentManagement/Models/BetaPart.cs | 10 +- .../ContentManagement/Models/DeltaPart.cs | 14 +- .../ContentManagement/Models/EpsilonPart.cs | 12 +- .../ContentManagement/Models/FlavoredPart.cs | 12 +- .../ContentManagement/Models/GammaPart.cs | 14 +- .../ContentManagement/Models/LambdaPart.cs | 12 +- .../ContentManagement/Models/Phi.cs | 20 +- .../ContentManagement/Models/StyledHandler.cs | 30 +- .../ContentManagement/Models/StyledPart.cs | 12 +- .../ContentManagement/Records/DeltaRecord.cs | 12 +- .../Records/EpsilonRecord.cs | 12 +- .../ContentManagement/Records/GammaRecord.cs | 12 +- .../ContentManagement/Records/LambdaRecord.cs | 36 +- .../ContentManagement/Records/MegaRecord.cs | 22 +- src/Orchard.Tests/Data/Bags/SettingsTests.cs | 324 +- .../Builders/SessionFactoryBuilderTests.cs | 94 +- src/Orchard.Tests/Data/ProviderUtilities.cs | 262 +- src/Orchard.Tests/Data/ProvidersTests.cs | 122 +- src/Orchard.Tests/Data/RepositoryTests.cs | 412 +- src/Orchard.Tests/Data/StubLocator.cs | 40 +- .../DataMigration/DataMigrationTests.cs | 1042 +- .../DataMigration/SchemaBuilderTests.cs | 486 +- .../Utilities/NullInterpreter.cs | 64 +- src/Orchard.Tests/DataUtility.cs | 166 +- src/Orchard.Tests/DatabaseEnabledTestsBase.cs | 156 +- .../DisplayManagement/ArgsUtility.cs | 60 +- .../DisplayManagement/CompositeTests.cs | 152 +- .../DefaultDisplayManagerTests.cs | 744 +- .../BasicShapeTemplateHarvesterTests.cs | 242 +- .../DefaultShapeTableManagerTests.cs | 590 +- .../Descriptors/InMemoryWebSiteFolder.cs | 102 +- .../Descriptors/PlacementFileParserTests.cs | 184 +- .../ShapeAttributeBindingStrategyTests.cs | 238 +- .../StylesheetBindingStrategyTests.cs | 348 +- .../DisplayManagement/NilTests.cs | 94 +- .../DisplayManagement/ShapeFactoryTests.cs | 162 +- .../DisplayManagement/ShapeHelperTests.cs | 122 +- .../DisplayManagement/SubsystemTests.cs | 186 +- .../DisplayManagement/ZoneHoldingTests.cs | 184 +- .../Environment/AutofacUtil/AutofacTests.cs | 74 +- .../DynamicProxy2/DynamicProxyTests.cs | 282 +- .../DefaultShellDescriptorCacheTests.cs | 196 +- .../DefaultTenantManagerTests.cs | 260 +- .../DefaultCompositionStrategyTests.cs | 644 +- .../Environment/DefaultOrchardHostTests.cs | 514 +- .../Environment/DefaultOrchardShellTests.cs | 184 +- .../DefaultWorkContextAccessorTests.cs | 360 +- .../Extensions/ExtensionFoldersTests.cs | 198 +- .../ExtensionLoaderCoordinatorTests.cs | 1060 +- .../Extensions/ExtensionManagerTests.cs | 1238 +- .../Extensions/ExtensionTypes/StubTypes.cs | 26 +- .../Extensions/FoldersData/Sample1/Module.txt | 16 +- .../Extensions/FoldersData/Sample2/Two.txt | 2 +- .../Extensions/FoldersData/Sample3/Module.txt | 4 +- .../Extensions/FoldersData/Sample4/Module.txt | 4 +- .../Extensions/FoldersData/Sample5/Module.txt | 6 +- .../Extensions/FoldersData/Sample6/Module.txt | 4 +- .../Extensions/FoldersData/Sample7/Module.txt | 2 +- .../Features/FeatureManagerTests.cs | 386 +- .../Loaders/DynamicExtensionLoaderTests.cs | 324 +- .../Environment/OrchardStarterTests.cs | 90 +- .../Environment/RunningShellTableTests.cs | 578 +- .../DefaultShellContainerFactoryTests.cs | 702 +- .../DefaultShellContextFactoryTests.cs | 190 +- .../State/DefaultProcessingEngineTests.cs | 224 +- .../Environment/StubHostEnvironment.cs | 16 +- .../TestDependencies/TestDependency.cs | 48 +- .../Environment/Utility/Build.cs | 98 +- .../Environment/WarmUp/WarmUpUtilityTests.cs | 56 +- src/Orchard.Tests/Events/EventTests.cs | 562 +- src/Orchard.Tests/EventsTests.cs | 150 +- src/Orchard.Tests/FakeTests.cs | 56 +- .../FileSystems/AppData/AppDataFolderTests.cs | 228 +- .../AssemblyProbingFolderTests.cs | 138 +- .../Dependencies/DependenciesFolderTests.cs | 282 +- .../LockFile/LockFileManagerTests.cs | 446 +- .../DefaultVirtualPathProviderTests.cs | 106 +- src/Orchard.Tests/FluentDbTests.cs | 190 +- src/Orchard.Tests/LinqToNHibernateTests.cs | 82 +- .../Localization/CultureManagerTests.cs | 222 +- .../Localization/NullLocalizerTests.cs | 50 +- .../Logging/LoggingModuleTests.cs | 198 +- .../Logging/OrchardFileAppenderTests.cs | 118 +- .../Messaging/MessagingChannelStub.cs | 34 +- .../Mvc/Html/HtmlHelperExtensionsTests.cs | 454 +- .../Mvc/OrchardControllerFactoryTests.cs | 322 +- .../Mvc/RouteCollectionPublisherTests.cs | 218 +- .../Mvc/Routes/ShellRouteTests.cs | 576 +- .../StandardExtensionRouteProviderTests.cs | 126 +- .../Mvc/Routes/UrlPrefixTests.cs | 142 +- .../Orchard.Framework.Tests.csproj | 802 +- src/Orchard.Tests/Properties/AssemblyInfo.cs | 74 +- src/Orchard.Tests/Records/BarRecord.cs | 12 +- src/Orchard.Tests/Records/BigRecord.cs | 22 +- src/Orchard.Tests/Records/FooRecord.cs | 16 +- .../Security/DefaultEncryptionServiceTests.cs | 174 +- src/Orchard.Tests/Services/ClockTests.cs | 76 +- .../Services/JsonConverterTests.cs | 94 +- .../Storage/FileSystemStorageProviderTests.cs | 720 +- .../Stubs/InMemoryWebSiteFolder.cs | 112 +- src/Orchard.Tests/Stubs/StubAppDataFolder.cs | 244 +- src/Orchard.Tests/Stubs/StubCacheManager.cs | 98 +- src/Orchard.Tests/Stubs/StubClock.cs | 60 +- .../Stubs/StubContainerProvider.cs | 36 +- .../Stubs/StubExtensionManager.cs | 48 +- src/Orchard.Tests/Stubs/StubFileSystem.cs | 800 +- src/Orchard.Tests/Stubs/StubHttpContext.cs | 204 +- .../Stubs/StubHttpContextAccessor.cs | 44 +- .../Stubs/StubReportsCoordinator.cs | 26 +- .../Stubs/StubVirtualPathMonitor.cs | 26 +- .../Stubs/StubVirtualPathProvider.cs | 242 +- src/Orchard.Tests/Stubs/StubWebSiteFolder.cs | 108 +- .../Stubs/StubWorkContextAccessor.cs | 310 +- .../Tasks/SweepGeneratorTests.cs | 110 +- .../Time/TimeZoneSelectorTests.cs | 170 +- .../UI/Admin/AdminAuthorizationFilterTests.cs | 228 +- .../UI/Admin/AdminThemeSelectorTests.cs | 116 +- .../UI/Navigation/MenuFilterTests.cs | 292 +- .../UI/Navigation/MenuItemComparerTests.cs | 168 +- .../UI/Navigation/NavigationManagerTests.cs | 312 +- .../UI/Navigation/PositionComparerTests.cs | 310 +- src/Orchard.Tests/UI/Notify/NotifierTests.cs | 46 +- .../UI/Notify/NotifyFilterTests.cs | 36 +- .../UI/Resources/ResourceManagerTests.cs | 266 +- src/Orchard.Tests/UI/ShapeTests.cs | 278 +- .../Utility/ContainerExtensions.cs | 162 +- .../Extensions/HttpRequestExtensionsTests.cs | 156 +- .../RouteValueDictionaryExtensionsTests.cs | 68 +- .../Extensions/StringExtensionsTests.cs | 604 +- src/Orchard.Tests/Utility/ReflectOnTests.cs | 124 +- src/Orchard.Tests/Utility/ReflectTests.cs | 92 +- .../Orchard.WarmupStarter.csproj | 110 +- .../Properties/AssemblyInfo.cs | 78 +- src/Orchard.WarmupStarter/Starter.cs | 210 +- src/Orchard.WarmupStarter/WarmupHttpModule.cs | 316 +- src/Orchard.WarmupStarter/WarmupUtility.cs | 140 +- .../Orchard.Web.Tests.csproj | 256 +- .../Properties/AssemblyInfo.cs | 74 +- src/Orchard.Web.Tests/Routes/RouteTests.cs | 72 +- src/Orchard.Web.Tests/Stubs/StubContext.cs | 28 +- src/Orchard.Web.Tests/Stubs/StubRequest.cs | 36 +- src/Orchard.Web/Config/Host.config | 28 +- .../Config/HostComponents.Debug.config | 6 +- .../Config/HostComponents.Release.config | 22 +- src/Orchard.Web/Config/HostComponents.config | 220 +- src/Orchard.Web/Config/log4net.Debug.config | 6 +- src/Orchard.Web/Config/log4net.Release.config | 40 +- src/Orchard.Web/Config/log4net.config | 176 +- .../Common/Controllers/ErrorController.cs | 22 +- .../Common/DateEditor/DateEditorDriver.cs | 190 +- .../Common/DateEditor/DateEditorHandler.cs | 54 +- .../Common/DateEditor/DateEditorSettings.cs | 60 +- .../Common/DateEditor/DateEditorViewModel.cs | 14 +- .../Core/Common/Drivers/BodyPartDriver.cs | 278 +- .../Core/Common/Drivers/CommonPartDriver.cs | 252 +- .../Core/Common/Drivers/IdentityPartDriver.cs | 66 +- .../Core/Common/Drivers/TextFieldDriver.cs | 196 +- .../Core/Common/Fields/TextField.cs | 22 +- .../Core/Common/Handlers/BodyPartHandler.cs | 32 +- .../Core/Common/Handlers/CommonPartHandler.cs | 352 +- .../Common/Handlers/IdentityPartHandler.cs | 64 +- src/Orchard.Web/Core/Common/Migrations.cs | 220 +- .../Core/Common/Models/BodyPart.cs | 30 +- .../Core/Common/Models/BodyPartRecord.cs | 20 +- .../Core/Common/Models/CommonPart.cs | 156 +- .../Core/Common/Models/CommonPartRecord.cs | 22 +- .../Common/Models/CommonPartVersionRecord.cs | 18 +- .../Core/Common/Models/IdentityPart.cs | 20 +- .../Core/Common/Models/IdentityPartRecord.cs | 12 +- src/Orchard.Web/Core/Common/Module.txt | 20 +- .../Common/OwnerEditor/OwnerEditorDriver.cs | 154 +- .../Common/OwnerEditor/OwnerEditorSettings.cs | 72 +- .../OwnerEditor/OwnerEditorViewModel.cs | 16 +- src/Orchard.Web/Core/Common/Placement.info | 74 +- .../Core/Common/ResourceManifest.cs | 20 +- src/Orchard.Web/Core/Common/Routes.cs | 70 +- .../Core/Common/Services/BbcodeFilter.cs | 202 +- .../Core/Common/Services/CommonService.cs | 36 +- .../Core/Common/Services/ICommonService.cs | 12 +- .../Services/IdentifierResolverSelector.cs | 78 +- .../Core/Common/Services/TextFieldFilter.cs | 38 +- .../Core/Common/Services/XmlRpcHandler.cs | 176 +- .../Core/Common/Settings/BodySettings.cs | 142 +- .../Core/Common/Settings/TextFieldSettings.cs | 22 +- .../Settings/TextFieldSettingsEvents.cs | 80 +- src/Orchard.Web/Core/Common/Shapes.cs | 84 +- src/Orchard.Web/Core/Common/Styles/Web.config | 32 +- .../Core/Common/Utilities/LazyField.cs | 78 +- .../Common/ViewModels/BodyEditorViewModel.cs | 38 +- .../ViewModels/ContainerEditorViewModel.cs | 10 +- .../ViewModels/TextFieldDriverViewModel.cs | 22 +- .../TextFieldSettingsEventsViewModel.cs | 12 +- .../Common/Views/Body-Textarea.Editor.cshtml | 24 +- .../Core/Common/Views/Body.Editor.cshtml | 34 +- .../Common/Views/CommonMetadataOwner.cshtml | 26 +- .../BodyPartSettings.cshtml | 10 +- .../BodyTypePartSettings.cshtml | 10 +- .../DateEditorSettings.cshtml | 16 +- .../OwnerEditorSettings.cshtml | 18 +- .../TextFieldSettingsEventsViewModel.cshtml | 40 +- .../Fields.Common.Text.Edit.cshtml | 30 +- .../EditorTemplates/Parts.Common.Body.cshtml | 12 +- .../Parts.Common.Container.cshtml | 8 +- .../Common/Views/Fields.Common.Text.cshtml | 12 +- .../Views/Parts.Common.Body.Summary.cshtml | 16 +- .../Views/Parts.Common.Date.Edit.cshtml | 10 +- .../Parts.Common.Metadata.SummaryAdmin.cshtml | 22 +- .../Views/Parts.Common.Owner.Edit.cshtml | 18 +- .../Containers/Controllers/ItemController.cs | 130 +- .../Drivers/ContainablePartDriver.cs | 200 +- .../Containers/Drivers/ContainerPartDriver.cs | 338 +- .../Drivers/ContainerWidgetPartDriver.cs | 230 +- .../Drivers/CustomPropertiesDriver.cs | 114 +- .../Extensions/ContentQueryExtensions.cs | 172 +- .../Handlers/ContainablePartHandler.cs | 68 +- .../Handlers/ContainerPartHandler.cs | 150 +- src/Orchard.Web/Core/Containers/Migrations.cs | 252 +- .../Core/Containers/Models/ContainablePart.cs | 28 +- .../Core/Containers/Models/ContainerPart.cs | 190 +- .../Containers/Models/ContainerWidgetPart.cs | 34 +- .../Containers/Models/CustomPropertiesPart.cs | 32 +- src/Orchard.Web/Core/Containers/Module.txt | 20 +- .../Core/Containers/Placement.info | 32 +- .../Containers/Settings/ContainerSettings.cs | 294 +- .../ViewModels/ContainableViewModel.cs | 20 +- .../ViewModels/ContainerViewModel.cs | 64 +- .../ViewModels/ContainerWidgetViewModel.cs | 18 +- .../ContainerPartSettings.cshtml | 16 +- .../Views/EditorTemplates/Containable.cshtml | 28 +- .../Views/EditorTemplates/Container.cshtml | 110 +- .../EditorTemplates/ContainerWidget.cshtml | 112 +- .../EditorTemplates/CustomProperties.cshtml | 24 +- .../Views/Parts.Container.Contained.cshtml | 4 +- .../Views/Parts.ContainerWidget.cshtml | 10 +- src/Orchard.Web/Core/Contents/AdminMenu.cs | 88 +- .../Core/Contents/ControlWrapper.cs | 36 +- .../Contents/Controllers/AdminController.cs | 952 +- .../Contents/Controllers/ItemController.cs | 134 +- .../Core/Contents/Drivers/ContentsDriver.cs | 66 +- .../Core/Contents/DynamicPermissions.cs | 166 +- .../Contents/Extensions/MetaDataExtensions.cs | 60 +- .../Core/Contents/Handlers/ContentsHandler.cs | 80 +- src/Orchard.Web/Core/Contents/Module.txt | 34 +- src/Orchard.Web/Core/Contents/Permissions.cs | 148 +- src/Orchard.Web/Core/Contents/Placement.info | 34 +- .../Security/AuthorizationEventHandler.cs | 144 +- .../Contents/Settings/ContentPartSettings.cs | 18 +- .../Contents/Settings/ContentTypeSettings.cs | 46 +- src/Orchard.Web/Core/Contents/Shapes.cs | 94 +- .../Core/Contents/Styles/Web.config | 32 +- .../Contents/Styles/menu.content-admin.css | 30 +- .../ViewModels/ListContentTypesViewModel.cs | 14 +- .../ViewModels/ListContentsViewModel.cs | 130 +- .../ViewModels/PublishContentViewModel.cs | 54 +- .../Views/Admin/CreatableTypeList.cshtml | 8 +- .../Core/Contents/Views/Admin/Create.cshtml | 28 +- .../Core/Contents/Views/Admin/Edit.cshtml | 28 +- .../Core/Contents/Views/Admin/List.cshtml | 136 +- .../Views/Content.ControlWrapper.cshtml | 28 +- .../Core/Contents/Views/Content.Edit.cshtml | 48 +- .../Views/Content.PublishButton.cshtml | 16 +- .../Contents/Views/Content.SaveButton.cshtml | 22 +- .../Contents/Views/Content.Summary.cshtml | 38 +- .../Views/Content.SummaryAdmin.cshtml | 60 +- .../Core/Contents/Views/Content.cshtml | 56 +- .../Core/Contents/Views/Item/Display.cshtml | 10 +- .../Core/Contents/Views/Item/Preview.cshtml | 10 +- .../Parts.Contents.Clone.SummaryAdmin.cshtml | 18 +- ...Parts.Contents.Publish.SummaryAdmin.cshtml | 80 +- src/Orchard.Web/Core/Dashboard/AdminMenu.cs | 36 +- .../Dashboard/Controllers/AdminController.cs | 18 +- src/Orchard.Web/Core/Dashboard/Module.txt | 18 +- src/Orchard.Web/Core/Dashboard/Routes.cs | 64 +- .../Services/CompilationErrorBanner.cs | 48 +- .../Core/Dashboard/Views/Admin/Index.cshtml | 74 +- .../Core/Dashboard/styles/Web.config | 32 +- .../Dashboard/styles/menu.dashboard-admin.css | 10 +- .../Core/Feeds/Controllers/FeedController.cs | 120 +- src/Orchard.Web/Core/Feeds/IFeedBuilder.cs | 22 +- .../Core/Feeds/IFeedBuilderProvider.cs | 24 +- .../Core/Feeds/IFeedItemBuilder.cs | 16 +- src/Orchard.Web/Core/Feeds/IFeedManager.cs | 28 +- src/Orchard.Web/Core/Feeds/IFeedQuery.cs | 12 +- .../Core/Feeds/IFeedQueryProvider.cs | 24 +- .../Core/Feeds/Models/FeedContext.cs | 34 +- src/Orchard.Web/Core/Feeds/Models/FeedItem.cs | 44 +- .../Core/Feeds/Models/FeedResponse.cs | 42 +- src/Orchard.Web/Core/Feeds/Module.txt | 18 +- src/Orchard.Web/Core/Feeds/Rss/Routes.cs | 68 +- .../Core/Feeds/Rss/RssFeedBuilder.cs | 106 +- src/Orchard.Web/Core/Feeds/Rss/RssResult.cs | 44 +- .../Core/Feeds/Services/FeedFilter.cs | 70 +- .../Core/Feeds/Services/FeedManager.cs | 126 +- .../CorePartsFeedItemBuilder.cs | 162 +- .../Feeds/StandardBuilders/ItemInspector.cs | 146 +- .../StandardQueries/ContainerFeedQuery.cs | 182 +- src/Orchard.Web/Core/Navigation/AdminMenu.cs | 72 +- .../Core/Navigation/Commands/MenuCommands.cs | 180 +- .../Navigation/Controllers/AdminController.cs | 510 +- .../Navigation/Drivers/AdminMenuPartDriver.cs | 198 +- .../Navigation/Drivers/MenuItemPartDriver.cs | 106 +- .../Core/Navigation/Drivers/MenuPartDriver.cs | 238 +- .../Drivers/MenuWidgetPartDriver.cs | 442 +- .../Drivers/ShapeMenuItemPartDriver.cs | 104 +- .../Handlers/AdminMenuPartHandler.cs | 36 +- .../Core/Navigation/Handlers/MenuHandler.cs | 60 +- .../Handlers/MenuItemPartHandler.cs | 18 +- .../Navigation/Handlers/MenuPartHandler.cs | 112 +- .../Handlers/MenuWidgetPartHandler.cs | 18 +- src/Orchard.Web/Core/Navigation/Migrations.cs | 360 +- .../Core/Navigation/Models/AdminMenuPart.cs | 44 +- .../Navigation/Models/AdminMenuPartRecord.cs | 24 +- .../Core/Navigation/Models/MenuItemPart.cs | 20 +- .../Core/Navigation/Models/MenuPart.cs | 52 +- .../Core/Navigation/Models/MenuPartRecord.cs | 24 +- .../Core/Navigation/Models/MenuWidgetPart.cs | 80 +- .../Navigation/Models/ShapeMenuItemPart.cs | 24 +- src/Orchard.Web/Core/Navigation/Module.txt | 20 +- .../Core/Navigation/Permissions.cs | 52 +- .../Core/Navigation/Placement.info | 14 +- .../Core/Navigation/Scripts/Web.config | 32 +- .../Scripts/jquery.mjs.nestedSortable.js | 798 +- .../Navigation/Scripts/navigation-admin.js | 156 +- .../Services/AdminMenuNavigationProvider.cs | 72 +- .../Navigation/Services/DefaultMenuManager.cs | 54 +- .../Services/DefaultMenuProvider.cs | 80 +- .../Core/Navigation/Services/IMenuManager.cs | 36 +- .../Core/Navigation/Services/IMenuService.cs | 30 +- .../Navigation/Services/MainMenuService.cs | 136 +- .../Navigation/Services/NavigationManager.cs | 590 +- .../Settings/AdminMenuPartTypeSettings.cs | 70 +- .../Core/Navigation/Styles/Web.config | 32 +- .../Styles/menu.navigation-admin.css | 10 +- .../Navigation/Styles/navigation-admin.css | 366 +- .../ViewModels/CreateMenuItemViewModel.cs | 12 +- .../Navigation/ViewModels/MenuItemEntry.cs | 28 +- .../ViewModels/MenuPartViewModel.cs | 24 +- .../ViewModels/MenuWidgetViewModel.cs | 30 +- .../NavigationManagementViewModel.cs | 38 +- .../Views/Admin/CreateMenuItem.cshtml | 12 +- .../Core/Navigation/Views/Admin/Index.cshtml | 292 +- .../Navigation/Views/Content-Menu.Edit.cshtml | 48 +- .../AdminMenuPartTypeSettings.cshtml | 10 +- .../Parts.MenuItem.Edit.cshtml | 16 +- .../Parts.MenuWidget.Edit.cshtml | 100 +- .../Parts.Navigation.AdminMenu.Edit.cshtml | 36 +- .../Parts.Navigation.Menu.Edit.cshtml | 70 +- .../Parts.ShapeMenuItemPart.Edit.cshtml | 16 +- .../Navigation/Views/Menu.DeleteButton.cshtml | 28 +- .../Core/Navigation/Views/Menu.Edit.cshtml | 50 +- .../Navigation/Views/MenuItem.Edit.cshtml | 16 +- .../Views/MenuItemLink-HtmlMenuItem.cshtml | 2 +- .../Views/MenuItemLink-ShapeMenuItem.cshtml | 6 +- src/Orchard.Web/Core/Orchard.Core.csproj | 1232 +- .../Core/Properties/AssemblyInfo.cs | 70 +- src/Orchard.Web/Core/Reports/AdminMenu.cs | 32 +- .../Reports/Controllers/AdminController.cs | 82 +- src/Orchard.Web/Core/Reports/Module.txt | 18 +- src/Orchard.Web/Core/Reports/Routes.cs | 64 +- .../Core/Reports/Styles/Web.config | 32 +- .../Reports/Styles/menu.reports-admin.css | 10 +- .../ViewModels/DisplayReportViewModel.cs | 12 +- .../ViewModels/ReportsAdminIndexViewModel.cs | 14 +- .../Core/Reports/Views/Admin/Display.cshtml | 76 +- .../Core/Reports/Views/Admin/Index.cshtml | 76 +- src/Orchard.Web/Core/Scheduling/Migrations.cs | 38 +- .../Scheduling/Models/ScheduledTaskRecord.cs | 20 +- .../Core/Scheduling/Models/Task.cs | 80 +- src/Orchard.Web/Core/Scheduling/Module.txt | 18 +- .../Services/ScheduledTaskExecutor.cs | 156 +- .../Services/ScheduledTaskManager.cs | 144 +- src/Orchard.Web/Core/Settings/AdminMenu.cs | 76 +- .../Settings/Commands/SiteSettingsCommands.cs | 108 +- .../Settings/Controllers/AdminController.cs | 270 +- .../Records/ShellDescriptorRecord.cs | 40 +- .../Descriptor/Records/ShellFeatureRecord.cs | 12 +- .../Records/ShellParameterRecord.cs | 16 +- .../Descriptor/ShellDescriptorManager.cs | 192 +- .../Drivers/SiteSettingsPartDriver.cs | 274 +- .../Handlers/SiteSettingsPartHandler.cs | 22 +- .../Metadata/ContentDefinitionManager.cs | 604 +- .../Records/ContentFieldDefinitionRecord.cs | 12 +- .../Records/ContentPartDefinitionRecord.cs | 40 +- .../ContentPartFieldDefinitionRecord.cs | 20 +- .../Records/ContentTypeDefinitionRecord.cs | 42 +- .../ContentTypePartDefinitionRecord.cs | 20 +- src/Orchard.Web/Core/Settings/Migrations.cs | 228 +- .../Core/Settings/Models/SiteSettingsPart.cs | 156 +- src/Orchard.Web/Core/Settings/Module.txt | 18 +- src/Orchard.Web/Core/Settings/Placement.info | 4 +- .../Core/Settings/ResourceManifest.cs | 18 +- src/Orchard.Web/Core/Settings/Routes.cs | 114 +- .../Core/Settings/Services/SiteService.cs | 92 +- .../State/Records/ShellFeatureStateRecord.cs | 20 +- .../State/Records/ShellStateRecord.cs | 42 +- .../Core/Settings/State/ShellStateManager.cs | 164 +- .../Core/Settings/Styles/Web.config | 32 +- .../Core/Settings/Styles/admin.css | 36 +- .../Settings/Styles/menu.settings-admin.css | 10 +- .../Core/Settings/Tokens/SettingsTokens.cs | 198 +- .../ViewModels/SiteCulturesViewModel.cs | 16 +- .../ViewModels/SiteSettingsPartViewModel.cs | 158 +- .../Core/Settings/Views/Admin/Culture.cshtml | 40 +- .../Core/Settings/Views/Admin/Index.cshtml | 22 +- .../DisplayTemplates/RemovableCulture.cshtml | 12 +- .../Parts.Settings.SiteSettingsPart.cshtml | 172 +- src/Orchard.Web/Core/Shapes/CoreShapes.cs | 1626 +- src/Orchard.Web/Core/Shapes/DateTimeShapes.cs | 146 +- src/Orchard.Web/Core/Shapes/Module.txt | 18 +- .../Core/Shapes/ResourceManifest.cs | 38 +- .../Core/Shapes/Scripts/Web.config | 32 +- src/Orchard.Web/Core/Shapes/Scripts/base.js | 708 +- src/Orchard.Web/Core/Shapes/Scripts/html5.js | 4 +- .../Core/Shapes/Scripts/jquery.switchable.js | 62 +- src/Orchard.Web/Core/Shapes/Styles/Web.config | 32 +- .../Core/Shapes/Styles/jquery.switchable.css | 94 +- .../Core/Shapes/Styles/special.css | 76 +- .../Core/Shapes/Views/Breadcrumb.cshtml | 34 +- .../Core/Shapes/Views/Document.cshtml | 52 +- .../Core/Shapes/Views/ErrorPage.cshtml | 20 +- .../Core/Shapes/Views/HeadPreload.cshtml | 2 +- .../Core/Shapes/Views/Header.cshtml | 4 +- .../Core/Shapes/Views/Layout.cshtml | 64 +- .../Core/Shapes/Views/LocalMenu.cshtml | 18 +- .../Core/Shapes/Views/LocalMenuItem.cshtml | 42 +- src/Orchard.Web/Core/Shapes/Views/Menu.cshtml | 32 +- .../Core/Shapes/Views/MenuItem.cshtml | 74 +- .../Core/Shapes/Views/MenuItemLink.cshtml | 2 +- .../Core/Shapes/Views/Message.cshtml | 12 +- .../Core/Shapes/Views/NotFound.cshtml | 16 +- src/Orchard.Web/Core/Shapes/Views/User.cshtml | 32 +- .../Core/Title/Drivers/TitlePartDriver.cs | 110 +- .../Core/Title/Handlers/TitlePartHandler.cs | 46 +- src/Orchard.Web/Core/Title/Migrations.cs | 54 +- .../Core/Title/Models/TitlePart.cs | 24 +- .../Core/Title/Models/TitlePartRecord.cs | 18 +- src/Orchard.Web/Core/Title/Module.txt | 18 +- src/Orchard.Web/Core/Title/Placement.info | 28 +- .../Parts.Title.TitlePart.cshtml | 14 +- .../Core/Title/Views/Parts.Title.cshtml | 8 +- .../Title/Views/Parts.Title_Summary.cshtml | 10 +- .../Views/Parts.Title_SummaryAdmin.cshtml | 10 +- .../Core/XmlRpc/Controllers/HomeController.cs | 144 +- .../Controllers/LiveWriterController.cs | 110 +- src/Orchard.Web/Core/XmlRpc/IXmlRpcDriver.cs | 8 +- src/Orchard.Web/Core/XmlRpc/IXmlRpcHandler.cs | 14 +- .../Core/XmlRpc/Models/ModelBinderProvider.cs | 68 +- .../Core/XmlRpc/Models/XRpcArray.cs | 36 +- .../Core/XmlRpc/Models/XRpcData.cs | 102 +- .../Core/XmlRpc/Models/XRpcMethodCall.cs | 18 +- .../Core/XmlRpc/Models/XRpcMethodResponse.cs | 28 +- .../Core/XmlRpc/Models/XRpcStruct.cs | 50 +- src/Orchard.Web/Core/XmlRpc/Module.txt | 18 +- .../Core/XmlRpc/Services/IXmlRpcReader.cs | 74 +- .../Core/XmlRpc/Services/IXmlRpcWriter.cs | 74 +- .../Core/XmlRpc/Services/XmlRpcReader.cs | 250 +- .../Core/XmlRpc/Services/XmlRpcWriter.cs | 224 +- src/Orchard.Web/Core/XmlRpc/XmlRpcContext.cs | 26 +- src/Orchard.Web/Global.asax | 2 +- src/Orchard.Web/Global.asax.cs | 126 +- src/Orchard.Web/Media/web.config | 50 +- src/Orchard.Web/Modules/Lucene/Lucene.csproj | 252 +- .../Lucene/Models/LuceneDocumentIndex.cs | 260 +- .../Modules/Lucene/Models/LuceneSearchHit.cs | 86 +- src/Orchard.Web/Modules/Lucene/Module.txt | 20 +- .../Modules/Lucene/Properties/AssemblyInfo.cs | 70 +- .../Lucene/Services/LuceneIndexProvider.cs | 394 +- .../Lucene/Services/LuceneSearchBuilder.cs | 874 +- .../Modules/Lucene/Services/SearchBits.cs | 84 +- .../Modules/Markdown/Content/Web.config | 32 +- .../Modules/Markdown/Markdown.csproj | 376 +- src/Orchard.Web/Modules/Markdown/Module.txt | 18 +- .../Markdown/Properties/AssemblyInfo.cs | 62 +- .../Modules/Markdown/ResourceManifest.cs | 38 +- .../Markdown/Scripts/Markdown.Converter.js | 3036 +- .../Scripts/Markdown.Converter.min.js | 6 +- .../Markdown/Scripts/Markdown.Editor.js | 4476 +- .../Markdown/Scripts/Markdown.Editor.min.js | 6 +- .../Scripts/Markdown.Sanitizer.min.js | 6 +- .../Modules/Markdown/Scripts/Web.config | 32 +- .../Scripts/jquery.textarearesizer.js | 254 +- .../Scripts/jquery.textarearesizer.min.js | 6 +- .../Scripts/orchard-markdown-media-library.js | 154 +- .../orchard-markdown-media-library.min.js | 2 +- .../Scripts/orchard-markdown-media-picker.js | 94 +- .../orchard-markdown-media-picker.min.js | 2 +- .../Markdown/Scripts/orchard-markdown.js | 32 +- .../Markdown/Scripts/orchard-markdown.min.js | 6 +- .../Markdown/Services/MarkdownFilter.cs | 38 +- .../Modules/Markdown/Styles/Web.config | 32 +- .../Markdown/Styles/admin-markdown.css | 416 +- .../Views/Body-Markdown.Editor.cshtml | 86 +- .../Modules/Orchard.Alias/AdminMenu.cs | 40 +- .../Controllers/AdminController.cs | 556 +- .../Modules/Orchard.Alias/IAliasService.cs | 58 +- .../Implementation/AliasRoute.cs | 166 +- .../Implementation/DefaultAliasService.cs | 328 +- .../Implementation/Holder/AliasHolder.cs | 92 +- .../Implementation/Holder/AliasInfo.cs | 16 +- .../Implementation/Holder/IAliasHolder.cs | 68 +- .../Implementation/Map/AliasMap.cs | 394 +- .../Implementation/Storage/AliasStorage.cs | 304 +- .../Orchard.Alias/Implementation/Utils.cs | 338 +- .../Modules/Orchard.Alias/Migrations.cs | 46 +- .../Modules/Orchard.Alias/Module.txt | 40 +- .../Orchard.Alias/Orchard.Alias.csproj | 320 +- .../Orchard.Alias/Properties/AssemblyInfo.cs | 70 +- .../Orchard.Alias/Records/ActionRecord.cs | 14 +- .../Orchard.Alias/Records/AliasRecord.cs | 16 +- .../Modules/Orchard.Alias/Routes.cs | 72 +- .../ViewModels/AdminIndexViewModel.cs | 68 +- .../Orchard.Alias/Views/Admin/Add.cshtml | 54 +- .../Orchard.Alias/Views/Admin/Delete.cshtml | 26 +- .../Orchard.Alias/Views/Admin/Edit.cshtml | 56 +- .../Orchard.Alias/Views/Admin/Index.cshtml | 182 +- .../Modules/Orchard.Alias/Web.config | 108 +- .../Modules/Orchard.AntiSpam/AdminMenu.cs | 32 +- .../Orchard.AntiSpam/Content/Web.config | 32 +- .../Controllers/AdminController.cs | 336 +- .../Drivers/ReCaptchaPartDriver.cs | 264 +- .../Drivers/SpamFilterPartDriver.cs | 116 +- .../Drivers/SubmissionLimitPartDriver.cs | 142 +- .../Handlers/AkismetSettingsPartHandler.cs | 52 +- .../Handlers/ReCaptchaSettingsPartHandler.cs | 48 +- .../Handlers/SpamFilterPartHandler.cs | 74 +- .../Handlers/TypePadSettingsPartHandler.cs | 52 +- .../Modules/Orchard.AntiSpam/Migrations.cs | 180 +- .../Models/AkismetSettingsPart.cs | 28 +- .../Models/CommentCheckContext.cs | 110 +- .../Orchard.AntiSpam/Models/ReCaptchaPart.cs | 10 +- .../Models/ReCaptchaSettingsPart.cs | 38 +- .../Orchard.AntiSpam/Models/SpamFilterPart.cs | 20 +- .../Models/SpamFilterPartRecord.cs | 12 +- .../Orchard.AntiSpam/Models/SpamStatus.cs | 10 +- .../Models/SubmissionLimitPart.cs | 10 +- .../Models/TypePadSettingsPart.cs | 28 +- .../Modules/Orchard.AntiSpam/Module.txt | 46 +- .../Orchard.AntiSpam/Orchard.AntiSpam.csproj | 440 +- .../Modules/Orchard.AntiSpam/Permissions.cs | 86 +- .../Modules/Orchard.AntiSpam/Placement.info | 22 +- .../Properties/AssemblyInfo.cs | 68 +- .../Orchard.AntiSpam/Rules/AntiSpamEvents.cs | 50 +- .../Orchard.AntiSpam/Rules/IRulesManager.cs | 18 +- .../Orchard.AntiSpam/Scripts/Web.config | 32 +- .../Services/AkismetApiSpamFilter.cs | 206 +- .../Services/AkismetSpamFilterProvider.cs | 76 +- .../Services/DefaultSpamFilterProvider.cs | 24 +- .../Services/DefaultSpamService.cs | 280 +- .../Services/ISpamEventHandler.cs | 18 +- .../Orchard.AntiSpam/Services/ISpamFilter.cs | 56 +- .../Services/ISpamFilterProvider.cs | 20 +- .../Orchard.AntiSpam/Services/ISpamService.cs | 72 +- .../Services/MissingFilterBanner.cs | 60 +- .../Services/NullSpamFilterProvider.cs | 26 +- .../Services/TypePadSpamFilterProvider.cs | 76 +- .../Settings/SpamFilterPartSettings.cs | 40 +- .../Settings/SpamFilterPartSettingsEvents.cs | 90 +- .../Settings/SubmissionLimitPartSettings.cs | 26 +- .../SubmissionLimitPartSettingsEvents.cs | 80 +- .../Orchard.AntiSpam/Styles/Web.config | 32 +- .../ViewModels/ReCaptchaPartEditViewModel.cs | 18 +- .../ViewModels/SpamIndexViewModel.cs | 90 +- .../Orchard.AntiSpam/Views/Admin/Index.cshtml | 120 +- .../SpamFilterPartSettings.cshtml | 146 +- .../SubmissionLimitPartSettings.cshtml | 42 +- .../Parts.ReCaptcha.Fields.cshtml | 14 +- .../Parts/AntiSpam.AkismetSettings.cshtml | 32 +- .../Parts/AntiSpam.ReCaptchaSettings.cshtml | 48 +- .../Parts/AntiSpam.TypePadSettings.cshtml | 32 +- .../Parts/SpamFilter.Metadata.Actions.cshtml | 26 +- .../SpamFilter.Metadata.SummaryAdmin.cshtml | 16 +- .../Modules/Orchard.AntiSpam/Web.config | 108 +- .../Orchard.ArchiveLater/Content/Web.config | 32 +- .../Drivers/ArchiveLaterPartDriver.cs | 226 +- .../Handlers/ArchiveLaterPartHandler.cs | 38 +- .../Handlers/UnpublishingTaskHandler.cs | 58 +- .../Orchard.ArchiveLater/Migrations.cs | 44 +- .../Models/ArchiveLaterPart.cs | 20 +- .../Modules/Orchard.ArchiveLater/Module.txt | 22 +- .../Orchard.ArchiveLater.csproj | 278 +- .../Orchard.ArchiveLater/Placement.info | 12 +- .../Properties/AssemblyInfo.cs | 70 +- .../Services/ArchiveLaterService.cs | 88 +- .../Services/IArchiveLaterService.cs | 20 +- .../ViewModels/ArchiveLaterViewModel.cs | 44 +- .../EditorTemplates/Parts/ArchiveLater.cshtml | 76 +- .../ArchiveLater.Metadata.SummaryAdmin.cshtml | 22 +- .../Commands/AutorouteCommands.cs | 36 +- .../Drivers/AutoroutePartDriver.cs | 274 +- .../Handlers/AutoroutePartHandler.cs | 214 +- .../Modules/Orchard.Autoroute/Migrations.cs | 84 +- .../Orchard.Autoroute/Models/AutoroutePart.cs | 48 +- .../Models/AutoroutePartRecord.cs | 30 +- .../Modules/Orchard.Autoroute/Module.txt | 26 +- .../Orchard.Autoroute.csproj | 358 +- .../Modules/Orchard.Autoroute/Permissions.cs | 60 +- .../Modules/Orchard.Autoroute/Placement.info | 6 +- .../Properties/AssemblyInfo.cs | 70 +- .../Orchard.Autoroute/Providers/SlugTokens.cs | 144 +- .../Orchard.Autoroute/ResourceManifest.cs | 20 +- .../Orchard.Autoroute/Scripts/Web.config | 24 +- .../Services/AliasResolverSelector.cs | 72 +- .../Services/AutorouteService.cs | 426 +- .../Services/DefaultSlugService.cs | 182 +- .../Services/IAutorouteService.cs | 42 +- .../Services/IRouteEvents.cs | 16 +- .../Services/ISlugEventHandler.cs | 38 +- .../Services/ISlugService.cs | 12 +- .../Settings/AutorouteSettings.cs | 112 +- .../Settings/AutorouteSettingsEvents.cs | 150 +- .../Settings/RoutePattern.cs | 22 +- .../Orchard.Autoroute/Styles/Web.config | 24 +- .../Styles/orchard-autoroute-settings.css | 46 +- .../ViewModels/AutoroutePartEditViewModel.cs | 24 +- .../AutorouteSettings.cshtml | 106 +- .../Parts.Autoroute.Edit.cshtml | 126 +- .../Modules/Orchard.Autoroute/Web.config | 106 +- .../Modules/Orchard.Azure/Constants.cs | 44 +- .../Modules/Orchard.Azure/Module.txt | 48 +- .../Orchard.Azure/Orchard.Azure.csproj | 364 +- .../Orchard.Azure/Properties/AssemblyInfo.cs | 72 +- .../Caching/CacheClientConfiguration.cs | 162 +- .../Caching/Database/AzureCacheClient.cs | 352 +- .../Database/AzureCacheConfiguration.cs | 54 +- .../Caching/Database/AzureCacheProvider.cs | 122 +- .../Output/AzureOutputCacheStorageProvider.cs | 396 +- .../AzureBlobShellSettingsManager.cs | 152 +- .../Services/FileSystems/AzureFileSystem.cs | 824 +- .../CloudBlobContainerExtensions.cs | 94 +- .../Media/AzureBlobStorageProvider.cs | 148 +- .../Logging/AzureDiagnosticsAppender.cs | 48 +- .../Modules/Orchard.Azure/Web.config | 148 +- .../Modules/Orchard.Blogs/AdminMenu.cs | 102 +- .../Orchard.Blogs/Commands/BlogCommands.cs | 356 +- .../Modules/Orchard.Blogs/Content/Web.config | 32 +- .../Controllers/BlogAdminController.cs | 386 +- .../Controllers/BlogController.cs | 178 +- .../Controllers/BlogPostAdminController.cs | 556 +- .../Controllers/BlogPostController.cs | 150 +- .../RemoteBlogPublishingController.cs | 140 +- .../Drivers/BlogArchivesPartDriver.cs | 144 +- .../Orchard.Blogs/Drivers/BlogPartDriver.cs | 142 +- .../Drivers/BlogPostPartDriver.cs | 54 +- .../Drivers/RecentBlogPostsPartDriver.cs | 180 +- .../Drivers/RemoteBlogPublishingDriver.cs | 26 +- .../Extensions/FeedManagerExtensions.cs | 44 +- .../Extensions/UrlHelperExtensions.cs | 166 +- .../Handlers/BlogArchivesPartHandler.cs | 24 +- .../Handlers/BlogPartArchiveHandler.cs | 284 +- .../Orchard.Blogs/Handlers/BlogPartHandler.cs | 110 +- .../Handlers/BlogPostPartHandler.cs | 152 +- .../Handlers/RecentBlogPostsPartHandler.cs | 24 +- .../Modules/Orchard.Blogs/Migrations.cs | 292 +- .../Orchard.Blogs/Models/ArchiveData.cs | 248 +- .../Orchard.Blogs/Models/BlogArchivesPart.cs | 28 +- .../Models/BlogArchivesPartRecord.cs | 20 +- .../Modules/Orchard.Blogs/Models/BlogPart.cs | 70 +- .../Models/BlogPartArchiveRecord.cs | 20 +- .../Orchard.Blogs/Models/BlogPostPart.cs | 104 +- .../Models/RecentBlogPostsPart.cs | 36 +- .../Models/RecentBlogPostsPartRecord.cs | 24 +- .../Modules/Orchard.Blogs/Module.txt | 32 +- .../Orchard.Blogs/Orchard.Blogs.csproj | 470 +- .../Modules/Orchard.Blogs/Permissions.cs | 124 +- .../Modules/Orchard.Blogs/Placement.info | 92 +- .../Orchard.Blogs/Properties/AssemblyInfo.cs | 68 +- .../Modules/Orchard.Blogs/ResourceManifest.cs | 26 +- .../Modules/Orchard.Blogs/Routes.cs | 430 +- .../Routing/ArchiveConstraint.CS | 274 +- .../Routing/IArchiveConstraint.CS | 16 +- .../Orchard.Blogs/Routing/IRsdConstraint.CS | 12 +- .../Orchard.Blogs/Routing/RsdConstraint.CS | 120 +- .../Modules/Orchard.Blogs/Scripts/Web.config | 32 +- .../Scripts/orchard-blogs-archives.js | 30 +- .../Security/BlogAuthorizationEventHandler.cs | 156 +- .../Orchard.Blogs/Services/ArchiveService.cs | 180 +- .../Orchard.Blogs/Services/BlogPostService.cs | 268 +- .../Orchard.Blogs/Services/BlogService.cs | 154 +- .../Orchard.Blogs/Services/IArchiveService.cs | 12 +- .../Services/IBlogPostService.cs | 48 +- .../Orchard.Blogs/Services/IBlogService.cs | 26 +- .../Orchard.Blogs/Services/XmlRpcHandler.cs | 764 +- .../Modules/Orchard.Blogs/Styles/Web.config | 32 +- .../Orchard.Blogs/Styles/menu.blog-admin.css | 10 +- .../Styles/orchard-blogs-admin.css | 6 +- .../Styles/orchard-blogs-archives.css | 134 +- .../ViewModels/BlogArchivesViewModel.cs | 16 +- .../ViewModels/RecentBlogPostsViewModel.cs | 30 +- .../Views/Blog.DeleteButton.cshtml | 4 +- .../Orchard.Blogs/Views/Blog/List.cshtml | 14 +- .../Views/BlogAdmin/Create.cshtml | 12 +- .../Orchard.Blogs/Views/BlogAdmin/Edit.cshtml | 12 +- .../Orchard.Blogs/Views/BlogAdmin/Item.cshtml | 10 +- .../Orchard.Blogs/Views/BlogAdmin/List.cshtml | 48 +- .../Views/BlogPost/ListByArchive.cshtml | 34 +- .../Views/BlogPostAdmin/Create.cshtml | 12 +- .../Views/BlogPostAdmin/Edit.cshtml | 12 +- .../Views/Content-Blog.DetailAdmin.cshtml | 26 +- .../Views/Content-Blog.Edit.cshtml | 48 +- .../Content-BlogPost.SummaryAdmin.cshtml | 122 +- .../Parts.Blogs.Blog.Fields.cshtml | 50 +- .../Parts.Blogs.BlogArchives.cshtml | 30 +- .../Parts.Blogs.RecentBlogPosts.cshtml | 40 +- .../Views/Parts.Blogs.Blog.Description.cshtml | 8 +- .../Views/Parts.Blogs.Blog.Manage.cshtml | 18 +- .../Parts.Blogs.Blog.SummaryAdmin.cshtml | 18 +- .../Views/Parts.Blogs.BlogArchives.cshtml | 82 +- .../Views/Parts.Blogs.BlogPost.List.cshtml | 16 +- .../Parts.Blogs.BlogPost.ListAdmin.cshtml | 42 +- .../Views/Parts.Blogs.RemotePublishing.cshtml | 14 +- .../CodeGenerationTemplates/Controller.txt | 32 +- .../CodeGenerationTemplates/DataMigration.txt | 36 +- .../ModuleAssemblyInfo.txt | 74 +- .../CodeGenerationTemplates/ModuleCsProj.txt | 230 +- .../ModuleManifest.txt | 18 +- .../ModuleRootWebConfig.txt | 82 +- .../CodeGenerationTemplates/Placement.info | 34 +- .../StaticFilesWebConfig.txt | 32 +- .../CodeGenerationTemplates/ThemeManifest.txt | 16 +- .../Commands/CodeGenerationCommands.cs | 984 +- .../Modules/Orchard.CodeGeneration/Module.txt | 18 +- .../Orchard.CodeGeneration.csproj | 284 +- .../Properties/AssemblyInfo.cs | 70 +- .../CodeGenerationCommandInterpreter.cs | 222 +- .../Modules/Orchard.Comments/AdminMenu.cs | 34 +- .../Controllers/AdminController.cs | 618 +- .../Controllers/CommentController.cs | 350 +- .../Drivers/CommentPartDriver.cs | 466 +- .../Drivers/CommentSettingsPartDriver.cs | 62 +- .../Drivers/CommentsContainerPartDriver.cs | 58 +- .../Drivers/CommentsPartDriver.cs | 278 +- .../Feeds/CommentFeedItemBuilder.cs | 138 +- .../Feeds/CommentedOnContainerFeedQuery.cs | 92 +- .../Feeds/CommentedOnFeedQuery.cs | 86 +- .../Handlers/CommentPartHandler.cs | 94 +- .../Handlers/CommentSettingsPartHandler.cs | 46 +- .../Handlers/CommentsPartHandler.cs | 94 +- .../Modules/Orchard.Comments/Migrations.cs | 380 +- .../Orchard.Comments/Models/CommentPart.cs | 170 +- .../Models/CommentPartRecord.cs | 54 +- .../Models/CommentSettingsPart.cs | 46 +- .../Orchard.Comments/Models/CommentStatus.cs | 20 +- .../Models/CommentsContainerPart.cs | 10 +- .../Orchard.Comments/Models/CommentsPart.cs | 84 +- .../Models/CommentsPartRecord.cs | 36 +- .../Modules/Orchard.Comments/Module.txt | 34 +- .../Orchard.Comments/Orchard.Comments.csproj | 454 +- .../Modules/Orchard.Comments/Permissions.cs | 104 +- .../Modules/Orchard.Comments/Placement.info | 66 +- .../Projections/CommentsFilter.cs | 76 +- .../Properties/AssemblyInfo.cs | 68 +- .../Orchard.Comments/ResourceManifest.cs | 20 +- .../Orchard.Comments/Rules/CommentsActions.cs | 90 +- .../Orchard.Comments/Rules/CommentsForms.cs | 68 +- .../Services/CommentService.cs | 528 +- .../Services/CreateCommentContext.cs | 16 +- .../Services/ICommentService.cs | 54 +- .../Settings/CommentsPartSettings.cs | 10 +- .../Settings/CommentsPartSettingsEvents.cs | 78 +- .../Modules/Orchard.Comments/Shapes.cs | 112 +- .../Orchard.Comments/Styles/Web.config | 32 +- .../Styles/menu.comments-admin.css | 10 +- .../Styles/orchard-comments-admin.css | 38 +- .../Orchard.Comments/Tokens/CommentTokens.cs | 120 +- .../ViewModels/CommentCountViewModel.cs | 36 +- .../ViewModels/CommentsDetailsViewModel.cs | 58 +- .../ViewModels/CommentsIndexViewModel.cs | 72 +- .../Views/Admin/Details.cshtml | 224 +- .../Orchard.Comments/Views/Admin/Edit.cshtml | 14 +- .../Orchard.Comments/Views/Admin/Index.cshtml | 210 +- .../Views/CommentAuthor.cshtml | 10 +- .../Views/CommentMetadata.cshtml | 10 +- .../Views/CommentReplyButton.cshtml | 10 +- .../Orchard.Comments/Views/CommentText.cshtml | 12 +- .../CommentsPartSettings.cshtml | 26 +- .../Parts.Comment.AdminEdit.cshtml | 86 +- .../EditorTemplates/Parts.Comment.cshtml | 76 +- .../Parts.Comments.Comments.cshtml | 34 +- .../Parts.Comments.SiteSettings.cshtml | 74 +- .../Views/Parts.Comment.SummaryAdmin.cshtml | 36 +- .../Views/Parts.Comment.cshtml | 56 +- .../Views/Parts.CommentForm.cshtml | 80 +- .../Parts.Comments.Count.SummaryAdmin.cshtml | 10 +- .../Views/Parts.ListOfComments.cshtml | 114 +- .../Drivers/ContentPermissionsPartDriver.cs | 454 +- .../Orchard.ContentPermissions/Migrations.cs | 56 +- .../Models/ContentPermissionsPart.cs | 126 +- .../Orchard.ContentPermissions/Module.txt | 26 +- .../Orchard.ContentPermissions.csproj | 350 +- .../Orchard.ContentPermissions/Permissions.cs | 102 +- .../Orchard.ContentPermissions/Placement.info | 16 +- .../Properties/AssemblyInfo.cs | 70 +- .../ContentPermissionsPartSettings.cs | 396 +- .../Styles/Web.config | 32 +- .../orchard-contentpermissions-admin.css | 46 +- .../ContentPermissionsPartViewModel.cs | 84 +- .../ContentPermissionsPartViewModel.cshtml | 270 +- .../Parts.ContentPermissions.cshtml | 246 +- ...rts.ContentPermissions.SummaryAdmin.cshtml | 28 +- .../Orchard.ContentPermissions/Web.config | 108 +- .../Controllers/AdminController.cs | 314 +- .../Drivers/ContentMenuItemPartDriver.cs | 176 +- .../Drivers/ContentPickerFieldDriver.cs | 208 +- .../Drivers/NavigationPartDriver.cs | 204 +- .../Fields/ContentPickerField.cs | 82 +- .../Handlers/ContentMenuItemPartHandler.cs | 90 +- .../Handlers/ContentPickerFieldHandler.cs | 72 +- .../Handlers/NavigationPartHandler.cs | 128 +- .../Orchard.ContentPicker/Migrations.cs | 64 +- .../Models/ContentMenuItemPart.cs | 46 +- .../Models/ContentMenuItemPartRecord.cs | 12 +- .../Models/NavigationPart.cs | 16 +- .../Modules/Orchard.ContentPicker/Module.txt | 22 +- .../Orchard.ContentPicker.csproj | 404 +- .../Orchard.ContentPicker/Placement.info | 28 +- .../Properties/AssemblyInfo.cs | 72 +- .../Orchard.ContentPicker/ResourceManifest.cs | 22 +- .../Scripts/ContentPicker.js | 250 +- .../Orchard.ContentPicker/Scripts/Web.config | 32 +- ...ontentMenuItemAuthorizationEventHandler.cs | 62 +- .../ContentPickerNavigationProvider.cs | 118 +- .../Services/ContentPickerShapes.cs | 108 +- .../ContentPickerFieldEditorEvents.cs | 70 +- .../Settings/ContentPickerFieldSettings.cs | 28 +- .../Styles/ContentPicker.css | 108 +- .../Orchard.ContentPicker/Styles/Web.config | 32 +- .../Styles/content-picker-admin.css | 22 +- .../Tokens/FieldTokens.cs | 68 +- .../ContentMenuItemEditViewModel.cs | 14 +- .../ViewModels/ContentPickerFieldViewModel.cs | 26 +- .../ViewModels/NavigationPartViewModel.cs | 28 +- .../Views/ContentPicker.SummaryAdmin.cshtml | 64 +- .../Views/ContentPicker.cshtml | 222 +- .../ContentPickerFieldSettings.cshtml | 66 +- .../Fields/ContentPicker.Edit.cshtml | 40 +- .../Parts.ContentMenuItem.Edit.cshtml | 74 +- .../Parts.Navigation.Edit.cshtml | 84 +- .../Fields/ContentPicker.SummaryAdmin.cshtml | 70 +- .../Views/Fields/ContentPicker.cshtml | 46 +- .../Views/MenuItemLink-ContentMenuItem.cshtml | 14 +- .../Views/RecentContentTab.cshtml | 84 +- .../Modules/Orchard.ContentPicker/Web.config | 108 +- .../Modules/Orchard.ContentTypes/AdminMenu.cs | 38 +- .../Controllers/AdminController.cs | 1390 +- .../Extensions/MetadataExtensions.cs | 172 +- .../Extensions/StringExtensions.cs | 22 +- .../Modules/Orchard.ContentTypes/Module.txt | 20 +- .../Orchard.ContentTypes.csproj | 438 +- .../Orchard.ContentTypes.sln | 40 +- .../Orchard.ContentTypes/Permissions.cs | 56 +- .../Properties/AssemblyInfo.cs | 70 +- .../Orchard.ContentTypes/ResourceManifest.cs | 18 +- .../Orchard.ContentTypes/Scripts/Web.config | 32 +- .../Scripts/admin-contenttypes.js | 78 +- .../Services/ContentDefinitionService.cs | 782 +- .../Services/ContentTypePlacementStrategy.cs | 140 +- .../Services/DefaultStereotypesProvider.cs | 34 +- .../Services/IContentDefinitionService.cs | 60 +- .../Services/IPlacementService.cs | 18 +- .../Services/IStereotypesProvider.cs | 22 +- .../Services/PlacementService.cs | 514 +- .../Services/StereotypeService.cs | 70 +- .../Settings/EditorEvents.cs | 116 +- .../Settings/PlacementSettings.cs | 88 +- .../Orchard.ContentTypes/Styles/Web.config | 32 +- .../Styles/menu.contenttypes-admin.css | 10 +- .../Styles/orchard-contenttypes-admin.css | 344 +- .../ViewModels/AddFieldViewModel.cs | 76 +- .../ViewModels/AddPartsViewModel.cs | 38 +- .../ContentTypeSettingsViewModel.cs | 16 +- .../ViewModels/CreatePartViewModel.cs | 10 +- .../ViewModels/CreateTypeViewModel.cs | 12 +- .../ViewModels/EditFieldNameViewModel.cs | 34 +- .../ViewModels/EditFieldViewModel.cs | 30 +- .../ViewModels/EditPartFieldViewModel.cs | 62 +- .../ViewModels/EditPartViewModel.cs | 84 +- .../ViewModels/EditPlacementViewModel.cs | 22 +- .../ViewModels/EditTypePartViewModel.cs | 62 +- .../ViewModels/EditTypeViewModel.cs | 94 +- .../ViewModels/ListContentPartsViewModel.cs | 12 +- .../ViewModels/ListContentTypesViewModel.cs | 12 +- .../ViewModels/ListContentsViewModel.cs | 30 +- .../ViewModels/RemoveFieldViewModel.cs | 12 +- .../ViewModels/RemovePartViewModel.cs | 12 +- .../Views/Admin/AddFieldTo.cshtml | 144 +- .../Views/Admin/AddPartsTo.cshtml | 58 +- .../Views/Admin/Create.cshtml | 120 +- .../Views/Admin/CreatePart.cshtml | 26 +- .../Views/Admin/Edit.cshtml | 108 +- .../Views/Admin/EditField.cshtml | 42 +- .../Views/Admin/EditPart.cshtml | 76 +- .../Views/Admin/EditPlacement.cshtml | 212 +- .../Views/Admin/List.cshtml | 42 +- .../Views/Admin/ListParts.cshtml | 40 +- .../Views/Admin/RemoveFieldFrom.cshtml | 24 +- .../Views/Admin/RemovePartFrom.cshtml | 24 +- .../ContentPartSettings.cshtml | 24 +- .../ContentTypeSettingsViewModel.cshtml | 70 +- .../DisplayTemplates/EditPartViewModel.cshtml | 18 +- .../DisplayTemplates/EditTypeViewModel.cshtml | 36 +- .../Views/DisplayTemplates/Field.cshtml | 8 +- .../Views/DisplayTemplates/Fields.cshtml | 10 +- .../Views/DisplayTemplates/Settings.cshtml | 14 +- .../Views/EditorTemplates/Field.cshtml | 24 +- .../Views/EditorTemplates/Fields.cshtml | 10 +- .../Views/EditorTemplates/TypePart.cshtml | 44 +- .../EditorTemplates/TypePartField.cshtml | 12 +- .../EditorTemplates/TypePartFields.cshtml | 10 +- .../Views/EditorTemplates/TypeParts.cshtml | 10 +- .../Modules/Orchard.CustomForms/AdminMenu.cs | 40 +- .../Controllers/AdminController.cs | 292 +- .../Controllers/ItemController.cs | 378 +- .../Drivers/CustomFormPartDriver.cs | 214 +- .../Handlers/CustomFormPartHandler.cs | 48 +- .../Modules/Orchard.CustomForms/Migrations.cs | 130 +- .../Models/CustomFormPart.cs | 94 +- .../Models/CustomFormPartRecord.cs | 38 +- .../Modules/Orchard.CustomForms/Module.txt | 26 +- .../Orchard.CustomForms.csproj | 392 +- .../Orchard.CustomForms/Permissions.cs | 194 +- .../Orchard.CustomForms/Placement.info | 8 +- .../Properties/AssemblyInfo.cs | 70 +- .../Rules/CustomFormEvents.cs | 108 +- .../Rules/IRulesManager.cs | 18 +- .../Orchard.CustomForms/Scripts/Web.config | 32 +- .../Security/AuthorizationEventHandler.cs | 50 +- .../Orchard.CustomForms/Styles/Web.config | 32 +- .../ViewModels/CustomFormIndexViewModel.cs | 78 +- .../ViewModels/CustomFormPartEditViewModel.cs | 16 +- .../Views/Admin/Index.cshtml | 160 +- .../Views/Admin/Item.cshtml | 58 +- .../Parts.CustomForm.Fields.cshtml | 96 +- .../Views/Item/Create.cshtml | 52 +- .../Views/Parts.CustomForm.Edit.cshtml | 12 +- .../Parts.CustomForm.SummaryAdmin.cshtml | 14 +- .../Views/Parts.CustomForm.Wrapper.cshtml | 44 +- .../Modules/Orchard.CustomForms/Web.config | 108 +- .../Controllers/AlternateController.cs | 98 +- .../Modules/Orchard.DesignerTools/Module.txt | 42 +- .../Orchard.DesignerTools.csproj | 328 +- .../Properties/AssemblyInfo.cs | 70 +- .../Scripts/CodeMirror/razor.js | 686 +- .../Orchard.DesignerTools/Scripts/Web.config | 32 +- .../Scripts/jquery.scrollTo-1.4.4.min.js | 14 +- .../orchard-designertools-shapetracing.js | 1138 +- .../Services/ObjectDumper.cs | 702 +- .../Services/ShapeTracingFactory.cs | 366 +- .../Services/TemplatesFilter.cs | 100 +- .../Services/UrlAlternatesFactory.cs | 142 +- .../Services/WidgetAlternatesFactory.cs | 86 +- .../Styles/CodeMirror/codemirror.css | 110 +- .../Orchard.DesignerTools/Styles/Web.config | 32 +- .../orchard-designertools-shapetracing.css | 684 +- .../Views/ShapeTracingMeta.cshtml | 146 +- .../Views/ShapeTracingTemplates.cshtml | 196 +- .../Views/ShapeTracingWrapper.cshtml | 88 +- .../Modules/Orchard.DesignerTools/Web.config | 110 +- .../Drivers/SmtpSettingsPartDriver.cs | 84 +- .../Modules/Orchard.Email/Forms/MailForms.cs | 218 +- .../Handlers/SmtpSettingsPartHandler.cs | 126 +- .../Modules/Orchard.Email/Migrations.cs | 20 +- .../Orchard.Email/Models/SmtpSettingsPart.cs | 140 +- .../Modules/Orchard.Email/Module.txt | 34 +- .../Orchard.Email/Orchard.Email.csproj | 368 +- .../Modules/Orchard.Email/Placement.info | 6 +- .../Orchard.Email/Properties/AssemblyInfo.cs | 70 +- .../Orchard.Email/Rules/MailActions.cs | 244 +- .../Modules/Orchard.Email/Rules/MailForms.cs | 210 +- .../Services/EmailMessageEventHandler.cs | 98 +- .../Services/EmailMessagingChannel.cs | 146 +- .../Services/MissingSettingsBanner.cs | 64 +- .../EditorTemplates/Parts/SmtpSettings.cshtml | 272 +- .../Drivers/BooleanFieldDriver.cs | 148 +- .../Drivers/DateTimeFieldDriver.cs | 362 +- .../Drivers/EnumerationFieldDriver.cs | 126 +- .../Drivers/InputFieldDriver.cs | 136 +- .../Orchard.Fields/Drivers/LinkFieldDriver.cs | 154 +- .../Drivers/NumericFieldDriver.cs | 232 +- .../Orchard.Fields/Fields/BooleanField.cs | 28 +- .../Orchard.Fields/Fields/DateTimeField.cs | 74 +- .../Orchard.Fields/Fields/EnumerationField.cs | 68 +- .../Orchard.Fields/Fields/InputField.cs | 26 +- .../Orchard.Fields/Fields/LinkField.cs | 46 +- .../Orchard.Fields/Fields/NumericField.cs | 26 +- .../Modules/Orchard.Fields/Module.txt | 24 +- .../Orchard.Fields/Orchard.Fields.csproj | 386 +- .../Modules/Orchard.Fields/Placement.info | 60 +- .../Orchard.Fields/Properties/AssemblyInfo.cs | 70 +- .../Settings/BooleanFieldEditorEvents.cs | 74 +- .../Settings/BooleanFieldSettings.cs | 46 +- .../Settings/DateTimeFieldEditorEvents.cs | 66 +- .../Settings/DateTimeFieldSettings.cs | 28 +- .../Settings/EnumerationFieldEditorEvents.cs | 68 +- .../Settings/EnumerationFieldSettings.cs | 40 +- .../Settings/InputFieldEditorEvents.cs | 78 +- .../Settings/InputFieldSettings.cs | 52 +- .../Settings/LinkFieldEditorEvents.cs | 70 +- .../Settings/LinkFieldSettings.cs | 66 +- .../Settings/NumericFieldEditorEvents.cs | 70 +- .../Settings/NumericFieldSettings.cs | 26 +- .../Modules/Orchard.Fields/Styles/Web.config | 24 +- .../Styles/media-gallery-admin.css | 22 +- .../Orchard.Fields/Tokens/FieldTokens.cs | 128 +- .../ViewModels/DateTimeFieldViewModel.cs | 18 +- .../ViewModels/NumericFieldViewModel.cs | 18 +- .../BooleanFieldSettings.cshtml | 118 +- .../DateTimeFieldSettings.cshtml | 58 +- .../EnumerationFieldSettings.cshtml | 60 +- .../InputFieldSettings.cshtml | 158 +- .../LinkFieldSettings.cshtml | 92 +- .../NumericFieldSettings.cshtml | 82 +- .../Fields/Boolean.Edit.cshtml | 92 +- .../Fields/DateTime.Edit.cshtml | 18 +- .../Fields/Enumeration.Edit.cshtml | 98 +- .../EditorTemplates/Fields/Input.Edit.cshtml | 28 +- .../EditorTemplates/Fields/Link.Edit.cshtml | 104 +- .../Fields/Numeric.Edit.cshtml | 28 +- .../Views/Fields/Boolean.cshtml | 40 +- .../Views/Fields/DateTime.cshtml | 18 +- .../Views/Fields/Enumeration.cshtml | 38 +- .../Orchard.Fields/Views/Fields/Input.cshtml | 18 +- .../Orchard.Fields/Views/Fields/Link.cshtml | 48 +- .../Views/Fields/Numeric.cshtml | 24 +- .../Modules/Orchard.Fields/Web.config | 108 +- .../Modules/Orchard.Forms/Module.txt | 22 +- .../Orchard.Forms/Orchard.Forms.csproj | 310 +- .../Orchard.Forms/Properties/AssemblyInfo.cs | 70 +- .../Modules/Orchard.Forms/Scripts/Web.config | 32 +- .../Services/DefaultFormManager.cs | 220 +- .../Services/FormParametersHelper.cs | 208 +- .../Orchard.Forms/Services/FormProcessor.cs | 48 +- .../Orchard.Forms/Services/IFormEvents.cs | 62 +- .../Orchard.Forms/Services/IFormManager.cs | 24 +- .../Orchard.Forms/Services/IFormProvider.cs | 86 +- .../Orchard.Forms/Shapes/EditorShapes.cs | 870 +- .../Shapes/PropertyItemsBehavior.cs | 88 +- .../Modules/Orchard.Forms/Styles/Web.config | 32 +- .../Modules/Orchard.Forms/Web.config | 108 +- .../Controllers/AdminController.cs | 274 +- .../Drivers/ImageEditorCropPartDriver.cs | 26 +- .../Drivers/ImageEditorEffectsPartDriver.cs | 26 +- .../Drivers/ImageEditorFilterPartDriver.cs | 26 +- .../Drivers/ImageEditorResizePartDriver.cs | 26 +- .../Drivers/ImagePartDriver.cs | 20 +- .../Modules/Orchard.ImageEditor/Migrations.cs | 24 +- .../Models/ImageEditorPart.cs | 16 +- .../Modules/Orchard.ImageEditor/Module.txt | 22 +- .../Orchard.ImageEditor.csproj | 406 +- .../Orchard.ImageEditor/Placement.info | 48 +- .../Properties/AssemblyInfo.cs | 72 +- .../Orchard.ImageEditor/Scripts/Web.config | 32 +- .../Scripts/image.editor-crop.js | 196 +- .../Scripts/image.editor.js | 158 +- .../Scripts/jcrop/js/jquery.Jcrop.js | 3380 +- .../Scripts/jcrop/js/jquery.Jcrop.min.js | 2 +- .../Orchard.ImageEditor/Styles/Web.config | 32 +- .../Styles/image-editor.css | 128 +- .../Styles/orchard-imageeditor-admin.css | 870 +- .../Views/Admin/Edit.cshtml | 46 +- .../Views/Content-ImageEditor.cshtml | 114 +- .../Views/Parts/Image.Editor.Crop.cshtml | 14 +- .../Parts/Image.Editor.CropOptions.cshtml | 52 +- .../Views/Parts/Image.Editor.Effects.cshtml | 200 +- .../Parts/Image.Editor.EffectsOptions.cshtml | 56 +- .../Views/Parts/Image.Editor.Filter.cshtml | 238 +- .../Parts/Image.Editor.FilterOptions.cshtml | 126 +- .../Views/Parts/Image.Editor.Resize.cshtml | 162 +- .../Parts/Image.Editor.ResizeOptions.cshtml | 56 +- .../Views/Parts/Image.Editor.cshtml | 44 +- .../Modules/Orchard.ImageEditor/Web.config | 110 +- .../Modules/Orchard.ImportExport/AdminMenu.cs | 44 +- .../Commands/ImportExportCommands.cs | 94 +- .../Controllers/AdminController.cs | 224 +- .../Models/ExportOptions.cs | 32 +- .../Modules/Orchard.ImportExport/Module.txt | 20 +- .../Orchard.ImportExport.csproj | 290 +- .../Orchard.ImportExport/Permissions.cs | 48 +- .../Properties/AssemblyInfo.cs | 70 +- .../Services/ICustomExportStep.cs | 14 +- .../Services/IExportEventHandler.cs | 32 +- .../Services/IImportExportService.cs | 28 +- .../Services/ImportExportService.cs | 468 +- .../Orchard.ImportExport/Styles/Web.config | 32 +- .../Styles/menu.importexport-admin.css | 10 +- .../ViewModels/ExportViewModel.cs | 44 +- .../ViewModels/ImportViewModel.cs | 6 +- .../Views/Admin/Export.cshtml | 136 +- .../Views/Admin/Import.cshtml | 32 +- .../Views/Admin/ImportResult.cshtml | 58 +- .../Modules/Orchard.Indexing/AdminMenu.cs | 30 +- .../Commands/IndexingCommands.cs | 348 +- .../Controllers/AdminController.cs | 246 +- .../Handlers/CreateIndexingTaskHandler.cs | 88 +- .../Handlers/InfosetFieldIndexingHandler.cs | 208 +- .../Modules/Orchard.Indexing/Migrations.cs | 76 +- .../Orchard.Indexing/Models/IndexSettings.cs | 114 +- .../Orchard.Indexing/Models/IndexingTask.cs | 70 +- .../Models/IndexingTaskRecord.cs | 30 +- .../Modules/Orchard.Indexing/Module.txt | 18 +- .../Orchard.Indexing/Orchard.Indexing.csproj | 300 +- .../Properties/AssemblyInfo.cs | 70 +- .../Services/IIndexStatisticsProvider.cs | 26 +- .../Services/IIndexingService.cs | 36 +- .../Services/IIndexingTaskExecutor.cs | 12 +- .../Services/IUpdateIndexScheduler.cs | 8 +- .../IndexServiceNotificationProvider.cs | 48 +- .../Services/IndexingBackgroundTask.cs | 68 +- .../Services/IndexingService.cs | 176 +- .../Services/IndexingTaskExecutor.cs | 750 +- .../Services/IndexingTaskManager.cs | 130 +- .../Services/UpdateIndexScheduler.cs | 82 +- .../Orchard.Indexing/Settings/EditorEvents.cs | 214 +- .../Settings/FieldIndexing.cs | 10 +- .../Orchard.Indexing/Settings/TypeIndexing.cs | 24 +- .../ViewModels/IndexViewModel.cs | 16 +- .../Views/Admin/Create.cshtml | 24 +- .../Orchard.Indexing/Views/Admin/Index.cshtml | 144 +- .../DefinitionTemplates/FieldIndexing.cshtml | 18 +- .../DefinitionTemplates/TypeIndexing.cshtml | 42 +- .../Orchard.Layouts/Orchard.Layouts.csproj | 1214 +- .../Modules/Orchard.Lists/AdminMenu.cs | 194 +- .../Controllers/AdminController.cs | 1018 +- .../Drivers/ContainerPartDriver.cs | 22 +- .../Handlers/ContainerPartHandler.cs | 44 +- .../Modules/Orchard.Lists/Migrations.cs | 78 +- .../Modules/Orchard.Lists/Module.txt | 20 +- .../Orchard.Lists/Orchard.Lists.csproj | 490 +- .../Modules/Orchard.Lists/Placement.info | 34 +- .../Orchard.Lists/Properties/AssemblyInfo.cs | 70 +- .../Modules/Orchard.Lists/Routes.cs | 188 +- .../Modules/Orchard.Lists/Scripts/Web.config | 32 +- .../Scripts/orchard-lists-admin.js | 354 +- .../Modules/Orchard.Lists/Styles/Web.config | 32 +- .../Orchard.Lists/Styles/menu.list-admin.css | 42 +- .../ViewModels/ListContentsViewModel.cs | 98 +- .../Orchard.Lists/Views/Admin/List.cshtml | 82 +- ...ts.Container.Contained.SummaryAdmin.cshtml | 14 +- .../Views/Parts.Container.Manage.cshtml | 42 +- .../Modules/Orchard.Lists/Web.config | 108 +- .../Controllers/AdminController.cs | 248 +- .../Drivers/LocalizationPartDriver.cs | 292 +- .../Handlers/LocalizationPartHandler.cs | 108 +- .../Orchard.Localization/Migrations.cs | 88 +- .../Models/LocalizationPart.cs | 68 +- .../Models/LocalizationPartRecord.cs | 14 +- .../Modules/Orchard.Localization/Module.txt | 66 +- .../Orchard.Localization.csproj | 404 +- .../Orchard.Localization/Placement.info | 36 +- .../Projections/CurrentCultureFilter.cs | 88 +- .../Properties/AssemblyInfo.cs | 72 +- .../Orchard.Localization/ResourceManifest.cs | 22 +- .../Services/ILocalizationService.cs | 28 +- .../Services/LocalizationService.cs | 178 +- .../Orchard.Localization/Styles/Web.config | 32 +- .../Styles/orchard-localization-admin.css | 90 +- .../Styles/orchard-localization-base.css | 72 +- .../ContentLocalizationsViewModel.cs | 28 +- .../ViewModels/EditLocalizationViewModel.cs | 22 +- .../Views/Admin/Translate.cshtml | 14 +- ...calization.ContentTranslations.Edit.cshtml | 232 +- ...ization.ContentTranslations.Summary.cshtml | 22 +- ...on.ContentTranslations.SummaryAdmin.cshtml | 42 +- .../Localization.ContentTranslations.cshtml | 24 +- .../Modules/Orchard.Media/AdminMenu.cs | 40 +- .../Modules/Orchard.Media/Content/Site.css | 634 +- .../Modules/Orchard.Media/Content/Web.config | 32 +- .../Controllers/AdminController.cs | 618 +- .../Extensions/LongExtensions.cs | 50 +- .../Handlers/MediaSettingsPartHandler.cs | 52 +- .../Orchard.Media/Helpers/MediaHelpers.cs | 68 +- .../Modules/Orchard.Media/Migrations.cs | 30 +- .../Orchard.Media/Models/FolderNavigation.cs | 12 +- .../Modules/Orchard.Media/Models/MediaFile.cs | 26 +- .../Orchard.Media/Models/MediaFolder.cs | 22 +- .../Orchard.Media/Models/MediaSettingsPart.cs | 18 +- .../Models/MediaSettingsPartRecord.cs | 28 +- .../Modules/Orchard.Media/Module.txt | 18 +- .../Orchard.Media/Orchard.Media.csproj | 354 +- .../Modules/Orchard.Media/Permissions.cs | 80 +- .../Orchard.Media/Properties/AssemblyInfo.cs | 70 +- .../Modules/Orchard.Media/ResourceManifest.cs | 18 +- .../Orchard.Media/Services/IMediaService.cs | 254 +- .../Orchard.Media/Services/MediaService.cs | 730 +- .../Orchard.Media/Services/XmlRpcHandler.cs | 176 +- .../Modules/Orchard.Media/Styles/Web.config | 32 +- .../Orchard.Media/Styles/menu.media-admin.css | 10 +- .../Styles/orchard-media-admin.css | 34 +- .../ViewModels/MediaFolderCreateViewModel.cs | 20 +- .../MediaFolderEditPropertiesViewModel.cs | 12 +- .../ViewModels/MediaFolderEditViewModel.cs | 22 +- .../ViewModels/MediaFolderIndexViewModel.cs | 16 +- .../ViewModels/MediaItemAddViewModel.cs | 24 +- .../ViewModels/MediaItemEditViewModel.cs | 38 +- .../Orchard.Media/Views/Admin/Add.cshtml | 110 +- .../Orchard.Media/Views/Admin/Create.cshtml | 54 +- .../Orchard.Media/Views/Admin/Edit.cshtml | 198 +- .../Views/Admin/EditMedia.cshtml | 136 +- .../Views/Admin/EditProperties.cshtml | 56 +- .../Orchard.Media/Views/Admin/Index.cshtml | 106 +- .../Parts/Media.MediaSettings.cshtml | 16 +- .../Modules/Orchard.MediaLibrary/AdminMenu.cs | 40 +- .../Controllers/ClientStorageController.cs | 158 +- .../Controllers/FolderController.cs | 336 +- .../Controllers/OEmbedController.cs | 324 +- .../Controllers/WebSearchController.cs | 136 +- .../Drivers/AudioPartDriver.cs | 58 +- .../Drivers/DocumentPartDriver.cs | 58 +- .../Drivers/ImagePartDriver.cs | 72 +- .../Drivers/MediaLibraryPickerFieldDriver.cs | 202 +- .../Drivers/MediaPartDriver.cs | 144 +- .../Drivers/OEmbedPartDriver.cs | 58 +- .../Drivers/VideoPartDriver.cs | 58 +- .../Factories/AudioFactory.cs | 138 +- .../Factories/DocumentFactory.cs | 134 +- .../Factories/IMediaFactory.cs | 36 +- .../Factories/IMediaFactorySelector.cs | 12 +- .../Factories/ImageFactory.cs | 198 +- .../Factories/MediaFactorySelectorResult.cs | 10 +- .../Factories/VideoFactory.cs | 134 +- .../Fields/MediaLibraryPickerField.cs | 108 +- .../MediaLibraryPickerFieldHandler.cs | 86 +- .../Handlers/MediaPartHandler.cs | 140 +- .../Handlers/WebSearchSettingsPartHandler.cs | 48 +- .../Orchard.MediaLibrary/Migrations.cs | 464 +- .../Orchard.MediaLibrary/ModalAdminFilter.cs | 46 +- .../Orchard.MediaLibrary/Models/AudioPart.cs | 24 +- .../Models/DocumentPart.cs | 24 +- .../Models/FolderHierarchy.cs | 24 +- .../Orchard.MediaLibrary/Models/ImagePart.cs | 36 +- .../Orchard.MediaLibrary/Models/MediaFile.cs | 26 +- .../Models/MediaFolder.cs | 40 +- .../Orchard.MediaLibrary/Models/MediaPart.cs | 158 +- .../Models/MediaPartRecord.cs | 22 +- .../Orchard.MediaLibrary/Models/OEmbedPart.cs | 32 +- .../Orchard.MediaLibrary/Models/VideoPart.cs | 24 +- .../Models/WebSearchSettingsPart.cs | 22 +- .../Modules/Orchard.MediaLibrary/Module.txt | 24 +- .../Orchard.MediaLibrary/Permissions.cs | 86 +- .../Orchard.MediaLibrary/Placement.info | 270 +- .../Properties/AssemblyInfo.cs | 72 +- .../Providers/ClientStorageMenu.cs | 40 +- .../Providers/OEmbedMenu.cs | 40 +- .../Providers/WebSearchMenu.cs | 40 +- .../Orchard.MediaLibrary/ResourceManifest.cs | 34 +- .../Orchard.MediaLibrary/Scripts/Web.config | 32 +- .../Scripts/media-library.js | 1226 +- .../Scripts/modal-window.js | 14 +- .../Services/IMediaLibraryService.cs | 320 +- .../Services/MediaLibraryService.cs | 870 +- .../Orchard.MediaLibrary/Services/Shapes.cs | 118 +- .../MediaLibraryPickerFieldEditorEvents.cs | 68 +- .../MediaLibraryPickerFieldSettings.cs | 18 +- .../Orchard.MediaLibrary/Styles/Web.config | 32 +- .../Styles/dialog-mode.css | 46 +- .../Styles/media-library-picker-admin.css | 176 +- .../menu.clientstorage-mediaproviders.css | 34 +- .../Styles/menu.media-library-admin.css | 16 +- .../Styles/menu.oembed-mediaproviders.css | 36 +- .../Styles/menu.websearch-mediaproviders.css | 34 +- .../Styles/orchard-clientstorage-admin.css | 200 +- .../Styles/orchard-medialibrary-admin.css | 1012 +- .../Styles/orchard-mediaproviders-admin.css | 400 +- .../Styles/orchard-oembed-admin.css | 96 +- .../Styles/orchard-websearch-admin.css | 404 +- .../MediaLibraryPickerFieldViewModel.cs | 26 +- .../MediaManagerFolderCreateViewModel.cs | 20 +- .../MediaManagerFolderEditViewModel.cs | 22 +- .../ViewModels/MediaManagerImportViewModel.cs | 22 +- .../MediaManagerMediaItemsViewModel.cs | 30 +- .../ViewModels/OEmbedViewModel.cs | 20 +- .../Views/Admin/Import.cshtml | 190 +- .../Views/Admin/Index.cshtml | 238 +- .../Views/Admin/MediaItems.cshtml | 50 +- .../Views/ClientStorage/Index.cshtml | 320 +- .../MediaLibraryPickerFieldSettings.cshtml | 54 +- .../Fields/MediaLibraryPicker.Edit.cshtml | 26 +- .../EditorTemplates/Parts.Media.Edit.cshtml | 24 +- .../Parts/WebSearch.WebSearchSettings.cshtml | 28 +- .../MediaLibraryPicker.SummaryAdmin.cshtml | 64 +- .../Views/Fields/MediaLibraryPicker.cshtml | 38 +- .../Views/Folder/Create.cshtml | 62 +- .../Views/Folder/Edit.cshtml | 54 +- .../Views/Media-Audio.Thumbnail.cshtml | 24 +- .../Views/Media-Document.Thumbnail.cshtml | 24 +- .../Views/Media-Image.Thumbnail.cshtml | 26 +- .../Views/Media-OEmbed.Thumbnail.cshtml | 46 +- .../Views/Media-Video.Thumbnail.cshtml | 26 +- .../Views/Media.Edit.cshtml | 44 +- .../Views/Media.Raw.cshtml | 2 +- .../Views/Media.Summary.cshtml | 42 +- .../Views/Media.SummaryAdmin.cshtml | 42 +- .../Views/Media.Thumbnail.cshtml | 20 +- .../Orchard.MediaLibrary/Views/Media.cshtml | 44 +- .../Views/OEmbed/Index.cshtml | 280 +- .../Views/Parts/Audio.Metadata.cshtml | 18 +- .../Views/Parts/Audio.Summary.cshtml | 16 +- .../Views/Parts/Audio.SummaryAdmin.cshtml | 16 +- .../Views/Parts/Audio.cshtml | 16 +- .../Views/Parts/Document.Metadata.cshtml | 18 +- .../Views/Parts/Document.Summary.cshtml | 20 +- .../Views/Parts/Document.SummaryAdmin.cshtml | 20 +- .../Views/Parts/Document.cshtml | 20 +- .../Views/Parts/Image.Metadata.cshtml | 18 +- .../Views/Parts/Image.Summary.cshtml | 24 +- .../Views/Parts/Image.SummaryAdmin.cshtml | 20 +- .../Views/Parts/Image.cshtml | 18 +- .../Views/Parts/Media.Actions.cshtml | 68 +- .../Views/Parts/Media.SummaryAdmin.cshtml | 70 +- .../Views/Parts/OEmbed.Metadata.cshtml | 20 +- .../Views/Parts/OEmbed.Summary.cshtml | 40 +- .../Views/Parts/OEmbed.SummaryAdmin.cshtml | 16 +- .../Views/Parts/OEmbed.cshtml | 54 +- .../Views/Parts/Video.Metadata.cshtml | 20 +- .../Views/Parts/Video.Summary.cshtml | 16 +- .../Views/Parts/Video.SummaryAdmin.cshtml | 16 +- .../Views/Parts/Video.cshtml | 16 +- .../Views/WebSearch/Index.cshtml | 502 +- .../Modules/Orchard.MediaLibrary/Web.config | 110 +- .../Orchard.MediaPicker/AdminFilter.cs | 48 +- .../Orchard.MediaPicker/Content/Web.config | 32 +- .../Controllers/AdminController.cs | 98 +- .../Drivers/MediaGalleryFieldDriver.cs | 258 +- .../Drivers/MediaPickerFieldDriver.cs | 166 +- .../Fields/MediaGalleryField.cs | 54 +- .../Fields/MediaPickerField.cs | 84 +- .../Handlers/MediaGalleryFieldHandler.cs | 72 +- .../Modules/Orchard.MediaPicker/Module.txt | 22 +- .../Orchard.MediaPicker.csproj | 406 +- .../Orchard.MediaPicker/Placement.info | 42 +- .../Properties/AssemblyInfo.cs | 72 +- .../Scripts/MediaBrowser.js | 650 +- .../Scripts/MediaPicker.js | 52 +- .../Orchard.MediaPicker/Scripts/Web.config | 32 +- .../Settings/MediaGalleryFieldEditorEvents.cs | 68 +- .../Settings/MediaGalleryFieldSettings.cs | 16 +- .../Settings/MediaPickerFieldEditorEvents.cs | 70 +- .../Settings/MediaPickerFieldSettings.cs | 20 +- .../Orchard.MediaPicker/Styles/Web.config | 24 +- .../Styles/media-gallery-admin.css | 22 +- .../Styles/mediapicker.css | 248 +- .../Orchard.MediaPicker/Tokens/FieldTokens.cs | 98 +- .../ViewModels/MediaGalleryFieldViewModel.cs | 22 +- .../Views/Admin/Index.cshtml | 108 +- .../Views/Admin/Tab_Gallery.cshtml | 278 +- .../Views/Admin/Tab_Url.cshtml | 174 +- .../MediaGalleryFieldSettings.cshtml | 66 +- .../MediaPickerFieldSettings.cshtml | 96 +- .../Fields/MediaGallery.Edit.cshtml | 396 +- .../Fields/MediaPicker.Edit.cshtml | 182 +- .../Fields/MediaGallery.SummaryAdmin.cshtml | 46 +- .../Views/Fields/MediaGallery.cshtml | 42 +- .../Views/Fields/MediaPicker.cshtml | 76 +- .../Orchard.MediaProcessing/AdminMenu.cs | 34 +- .../Controllers/AdminController.cs | 392 +- .../Controllers/FilterController.cs | 304 +- .../Filter/DescribeFilterContext.cs | 60 +- .../Descriptors/Filter/DescribeFilterFor.cs | 48 +- .../Descriptors/Filter/FilterContext.cs | 28 +- .../Descriptors/Filter/FilterDescriptor.cs | 26 +- .../Descriptors/TypeDescriptor.cs | 20 +- .../Drivers/ImageProfilePartDriver.cs | 218 +- .../Handlers/ImageProfilePartHandler.cs | 20 +- .../Media/StorageProviderExtensions.cs | 42 +- .../Orchard.MediaProcessing/Migrations.cs | 84 +- .../Models/FileNameRecord.cs | 18 +- .../Models/FilterRecord.cs | 26 +- .../Models/ImageProfilePart.cs | 52 +- .../Models/ImageProfilePartRecord.cs | 44 +- .../Orchard.MediaProcessing/Module.txt | 16 +- .../Orchard.MediaProcessing.csproj | 408 +- .../Orchard.MediaProcessing/Placement.info | 16 +- .../Properties/AssemblyInfo.cs | 72 +- .../Providers/Filters/FormatFilter.cs | 182 +- .../Providers/Filters/ResizeFilter.cs | 322 +- .../Scripts/Web.config | 32 +- .../Services/IImageFilterProvider.cs | 12 +- .../IImageProcessingFileNameProvider.cs | 12 +- .../Services/IImageProcessingManager.cs | 16 +- .../Services/IImageProfileManager.cs | 22 +- .../Services/IImageProfileService.cs | 26 +- .../ImageProcessingFileNameProvider.cs | 154 +- .../Services/ImageProcessingManager.cs | 52 +- .../Services/ImageProfileManager.cs | 480 +- .../Services/ImageProfileService.cs | 236 +- .../Shapes/MediaShapes.cs | 122 +- .../Orchard.MediaProcessing/Styles/Web.config | 32 +- .../ViewModels/AdminCreateViewModel.cs | 14 +- .../ViewModels/AdminEditViewModel.cs | 38 +- .../ViewModels/AdminIndexViewModel.cs | 68 +- .../ViewModels/FilterAddViewModel.cs | 20 +- .../ViewModels/FilterEditViewModel.cs | 20 +- .../ViewModels/ImageProfileViewModel.cs | 8 +- .../Views/Admin/Edit.cshtml | 98 +- .../Views/Admin/Index.cshtml | 134 +- ...ts.MediaProcessing.ImageProfilePart.cshtml | 10 +- .../Views/Filter/Add.cshtml | 54 +- .../Views/Filter/Edit.cshtml | 60 +- .../Orchard.MediaProcessing/Web.config | 108 +- .../Commands/DataMigrationCommands.cs | 82 +- .../Commands/DatabaseUpdateCommands.cs | 124 +- .../Modules/Orchard.Migrations/Module.txt | 28 +- .../Orchard.Migrations.csproj | 234 +- .../Properties/AssemblyInfo.cs | 70 +- .../Modules/Orchard.Modules/AdminMenu.cs | 44 +- .../Commands/FeatureCommands.cs | 194 +- .../Orchard.Modules/Content/Web.config | 32 +- .../Controllers/AdminController.cs | 516 +- .../DataMigrationNotificationProvider.cs | 92 +- .../Events/IExtensionDisplayEventHandler.cs | 24 +- .../Extensions/StringExtensions.cs | 24 +- .../Models/DoghouseComparer.cs | 52 +- .../Orchard.Modules/Models/ModuleEntry.cs | 80 +- .../Orchard.Modules/Models/ModuleFeature.cs | 78 +- .../Modules/Orchard.Modules/Module.txt | 18 +- .../Orchard.Modules/Orchard.Modules.csproj | 338 +- .../Modules/Orchard.Modules/Permissions.cs | 46 +- .../Properties/AssemblyInfo.cs | 70 +- .../Orchard.Modules/ResourceManifest.cs | 18 +- .../Orchard.Modules/Scripts/Web.config | 32 +- .../Orchard.Modules/Scripts/features.admin.js | 124 +- .../Services/IModuleService.cs | 104 +- .../Orchard.Modules/Services/ModuleService.cs | 334 +- .../ViewModels/FeaturesViewModel.cs | 40 +- .../ViewModels/ModulesIndexViewModel.cs | 30 +- .../ViewModels/RecipesViewModel.cs | 26 +- .../Views/Admin/Features.cshtml | 298 +- .../Orchard.Modules/Views/Admin/Index.cshtml | 72 +- .../Views/Admin/Recipes.cshtml | 76 +- .../Orchard.Modules/Views/ModuleEntry.cshtml | 96 +- .../Modules/Orchard.Modules/styles/Web.config | 32 +- .../styles/menu.modules-admin.css | 10 +- .../styles/orchard-modules-admin.css | 452 +- .../Modules/Orchard.MultiTenancy/AdminMenu.cs | 54 +- .../SqlDatabaseConnectionStringAttribute.cs | 40 +- .../Commands/TenantCommand.cs | 176 +- .../Orchard.MultiTenancy/Content/Web.config | 32 +- .../Controllers/AdminController.cs | 422 +- .../Extensions/UrlHelperExtensions.cs | 56 +- .../Modules/Orchard.MultiTenancy/Module.txt | 20 +- .../Modules/Orchard.MultiTenancy/Module.txt_ | 22 +- .../Orchard.MultiTenancy.csproj | 314 +- .../Properties/AssemblyInfo.cs | 70 +- .../Orchard.MultiTenancy/ResourceManifest.cs | 18 +- .../Modules/Orchard.MultiTenancy/Routes.cs | 68 +- .../Services/ITenantService.cs | 68 +- .../Services/TenantService.cs | 122 +- .../Orchard.MultiTenancy/Styles/Web.config | 32 +- .../Styles/orchard-multitenancy-admin.css | 8 +- .../ViewModels/TenantAddViewModel.cs | 54 +- .../ViewModels/TenantEditViewModel.cs | 56 +- .../ViewModels/TenantsIndexViewModel.cs | 16 +- .../ViewModels/ThemeEntry.cs | 22 +- .../Views/Admin/Add.cshtml | 230 +- .../ActionsForDisabled.cshtml | 14 +- .../DisplayTemplates/ActionsForInvalid.cshtml | 8 +- .../DisplayTemplates/ActionsForRunning.cshtml | 14 +- .../ActionsForUninitialized.cshtml | 8 +- .../Views/Admin/Edit.cshtml | 236 +- .../Views/Admin/Index.cshtml | 72 +- .../Modules/Orchard.OutputCache/AdminMenu.cs | 38 +- .../Controllers/AdminController.cs | 278 +- .../Controllers/StatisticsController.cs | 146 +- .../Filters/OutputCacheFilter.cs | 1220 +- .../Handlers/CacheSettingsPartHandler.cs | 78 +- .../Handlers/DisplayedContentItemHandler.cs | 50 +- .../Modules/Orchard.OutputCache/Migrations.cs | 118 +- .../Orchard.OutputCache/Models/CacheItem.cs | 90 +- .../Models/CacheParameterRecord.cs | 14 +- .../Models/CacheSettingsPart.cs | 168 +- .../Modules/Orchard.OutputCache/Module.txt | 44 +- .../Orchard.OutputCache.csproj | 352 +- .../Properties/AssemblyInfo.cs | 68 +- .../Orchard.OutputCache/Scripts/Web.config | 32 +- .../Services/CacheService.cs | 264 +- .../Services/DefaultCacheStorageProvider.cs | 130 +- .../Services/DefaultTagCache.cs | 90 +- .../Services/ICacheService.cs | 76 +- .../Services/IDisplayedContentItemHandler.cs | 16 +- .../Services/IOutputCacheStorageProvider.cs | 40 +- .../Orchard.OutputCache/Services/ITagCache.cs | 16 +- .../Orchard.OutputCache/Styles/Web.config | 32 +- .../ViewModels/IndexViewModel.cs | 40 +- .../ViewModels/StatisticsViewModel.cs | 16 +- .../Views/Admin/Index.cshtml | 220 +- .../Views/Statistics/Index.cshtml | 82 +- .../Modules/Orchard.OutputCache/Web.config | 108 +- .../Modules/Orchard.Packaging/AdminMenu.cs | 62 +- .../AdminMenuGalleryUpdates.cs | 120 +- .../Commands/PackagingCommands.cs | 208 +- .../Orchard.Packaging/Content/Web.config | 32 +- .../Controllers/GalleryController.cs | 494 +- .../Controllers/GalleryUpdatesController.cs | 226 +- .../PackagingServicesController.cs | 576 +- .../DefaultPackagingUpdater.cs | 88 +- .../Events/ExtensionDisplayEventHandler.cs | 106 +- .../Events/IExtensionDisplayEventHandler.cs | 24 +- .../Extensions/PackageExtensions.cs | 140 +- .../Modules/Orchard.Packaging/Migrations.cs | 30 +- .../Orchard.Packaging/Models/NugetLogger.cs | 52 +- .../Orchard.Packaging/Models/PackageData.cs | 20 +- .../Models/PackagingEntry.cs | 72 +- .../Models/PackagingSource.cs | 12 +- .../Models/UpdatePackageEntry.cs | 60 +- .../Modules/Orchard.Packaging/Module.txt | 50 +- .../Orchard.Packaging.csproj | 450 +- .../Modules/Orchard.Packaging/Permissions.cs | 38 +- .../Properties/AssemblyInfo.cs | 70 +- .../Orchard.Packaging/ResourceManifest.cs | 24 +- .../GalleryServer/Reference.cs | 1960 +- .../GalleryServer/Reference.datasvcmap | 18 +- .../GalleryServer/service.edmx | 132 +- .../Services/BackgroundPackageUpdateStatus.cs | 24 +- .../Services/BackgroundPackageUpdateTask.cs | 64 +- .../Services/ExtensionReferenceRepository.cs | 112 +- .../Services/FileBaseProjectSystem.cs | 416 +- .../Services/FolderUpdater.cs | 170 +- .../Services/IPackageBuilder.cs | 14 +- .../Services/IPackageInstaller.cs | 30 +- .../Services/IPackageManager.cs | 22 +- .../Services/IPackagingSourceManager.cs | 96 +- .../Services/PackageBuilder.cs | 460 +- .../Services/PackageInstaller.cs | 638 +- .../Services/PackageManager.cs | 220 +- .../Services/PackageUpdateManager.cs | 234 +- .../Services/PackagingSourceManager.cs | 328 +- .../Orchard.Packaging/Styles/Web.config | 32 +- .../Styles/orchard-packaging-admin.css | 282 +- .../ViewModels/PackagingAddSourceViewModel.cs | 16 +- .../PackagingExtensionsViewModel.cs | 44 +- .../ViewModels/PackagingHarvestViewModel.cs | 34 +- .../ViewModels/PackagingInstallViewModel.cs | 42 +- .../ViewModels/PackagingListViewModel.cs | 20 +- .../ViewModels/PackagingSourcesViewModel.cs | 14 +- .../Views/Gallery/AddSource.cshtml | 26 +- .../Views/Gallery/Modules.cshtml | 212 +- .../Views/Gallery/Sources.cshtml | 64 +- .../Views/Gallery/Themes.cshtml | 222 +- .../GalleryUpdates/ModulesUpdates.cshtml | 176 +- .../Views/GalleryUpdates/ThemesUpdates.cshtml | 186 +- .../Views/PackagingServices/AddModule.cshtml | 18 +- .../Views/PackagingServices/AddTheme.cshtml | 18 +- .../InstallModuleDetails.cshtml | 118 +- .../InstallPackageFailed.cshtml | 8 +- .../Modules/Orchard.Pages/AdminMenu.cs | 24 +- .../Orchard.Pages/Commands/PageCommands.cs | 438 +- .../Modules/Orchard.Pages/Migrations.cs | 64 +- .../Modules/Orchard.Pages/Module.txt | 20 +- .../Orchard.Pages/Orchard.Pages.csproj | 246 +- .../Orchard.Pages/Properties/AssemblyInfo.cs | 70 +- .../Modules/Orchard.Pages/Styles/Web.config | 32 +- .../Orchard.Pages/Styles/menu.page-admin.css | 12 +- .../Modules/Orchard.Projections/AdminMenu.cs | 40 +- .../Controllers/AdminController.cs | 524 +- .../Controllers/BindingController.cs | 498 +- .../Controllers/FilterController.cs | 352 +- .../Controllers/LayoutController.cs | 498 +- .../Controllers/PropertyController.cs | 460 +- .../Controllers/SortCriteriaController.cs | 350 +- .../Filter/DescribeFilterContext.cs | 64 +- .../Descriptors/Filter/DescribeFilterFor.cs | 48 +- .../Descriptors/Filter/FilterContext.cs | 26 +- .../Descriptors/Filter/FilterDescriptor.cs | 26 +- .../Layout/DescribeLayoutContext.cs | 64 +- .../Descriptors/Layout/DescribeLayoutFor.cs | 48 +- .../Layout/LayoutComponentResult.cs | 24 +- .../Descriptors/Layout/LayoutContext.cs | 16 +- .../Descriptors/Layout/LayoutDescriptor.cs | 28 +- .../Property/DescribePropertyContext.cs | 64 +- .../Property/DescribePropertyFor.cs | 50 +- .../Descriptors/Property/PropertyContext.cs | 24 +- .../Property/PropertyDescriptor.cs | 28 +- .../DescribeSortCriteriaContext.cs | 64 +- .../SortCriterion/DescribeSortCriteriaFor.cs | 48 +- .../SortCriterion/SortCriteriaContext.cs | 26 +- .../SortCriterion/SortCriteriaDescriptor.cs | 26 +- .../Descriptors/TypeDescriptor.cs | 20 +- .../Drivers/NavigationQueryPartDriver.cs | 174 +- .../Drivers/ProjectionPartDriver.cs | 698 +- .../Drivers/QueryPartDriver.cs | 534 +- .../Drivers/QueryPartTitleDriver.cs | 70 +- .../BooleanFieldTypeEditor.cs | 76 +- .../DateTimeFieldTypeEditor.cs | 84 +- .../DecimalFieldTypeEditor.cs | 80 +- .../FieldTypeEditors/FloatFieldTypeEditor.cs | 82 +- .../FieldTypeEditors/IFieldTypeEditor.cs | 78 +- .../IntegerFieldTypeEditor.cs | 94 +- .../FieldTypeEditors/StringFieldTypeEditor.cs | 76 +- .../FilterEditors/BooleanFilterEditor.cs | 66 +- .../FilterEditors/DateTimeFilterEditor.cs | 74 +- .../FilterEditors/DefaultFilterFormater.cs | 90 +- .../FilterEditors/Forms/BooleanFilterForm.cs | 146 +- .../FilterEditors/Forms/DateTimeFilterForm.cs | 624 +- .../Forms/DateTimeFormValidation.cs | 178 +- .../FilterEditors/Forms/NumericFilterForm.cs | 320 +- .../Forms/NumericFilterFormValidation.cs | 120 +- .../FilterEditors/Forms/StringFilterForm.cs | 272 +- .../FilterEditors/IFilterCoordinator.cs | 50 +- .../FilterEditors/IFilterEditor.cs | 64 +- .../FilterEditors/NumericFilterEditor.cs | 84 +- .../FilterEditors/StringFilterEditor.cs | 66 +- .../Handlers/FieldIndexPartHandler.cs | 154 +- .../Handlers/NavigationQueryPartHandler.cs | 20 +- .../Handlers/ProjectionPartHandler.cs | 20 +- .../Handlers/QueryPartHandler.cs | 54 +- .../Modules/Orchard.Projections/Migrations.cs | 572 +- .../Models/FieldIndexPart.cs | 22 +- .../Models/FieldIndexPartRecord.cs | 44 +- .../Models/FieldIndexRecord.cs | 48 +- .../Models/FilterGroupRecord.cs | 34 +- .../Models/FilterRecord.cs | 26 +- .../Models/LayoutRecord.cs | 72 +- .../Models/MemberBindingRecord.cs | 36 +- .../Models/NavigationQueryPart.cs | 56 +- .../Models/NavigationQueryPartRecord.cs | 38 +- .../Models/ProjectionPart.cs | 10 +- .../Models/ProjectionPartRecord.cs | 108 +- .../Models/PropertyRecord.cs | 114 +- .../Orchard.Projections/Models/QueryPart.cs | 48 +- .../Models/QueryPartRecord.cs | 52 +- .../Models/SortCriteriaRecord.cs | 24 +- .../Modules/Orchard.Projections/Module.txt | 18 +- .../Navigation/NavigationQueryProvider.cs | 130 +- .../Orchard.Projections.csproj | 668 +- .../Orchard.Projections/Permissions.cs | 56 +- .../Orchard.Projections/Placement.info | 36 +- .../Properties/AssemblyInfo.cs | 70 +- .../PropertyEditors/DateTimePropertyEditor.cs | 54 +- .../DefaultPropertyFormater.cs | 98 +- .../Forms/DateTimePropertyForm.cs | 164 +- .../Forms/NumericPropertyForm.cs | 124 +- .../PropertyEditors/IPropertyEditor.cs | 52 +- .../PropertyEditors/IPropertyFormater.cs | 38 +- .../PropertyEditors/NumericPropertyEditor.cs | 76 +- .../Providers/Filters/ContentFieldsFilter.cs | 190 +- .../Providers/Filters/ContentTypesFilter.cs | 174 +- .../Providers/Filters/MemberBindingFilter.cs | 110 +- .../Providers/Layouts/GridLayout.cs | 130 +- .../Providers/Layouts/GridLayoutForms.cs | 254 +- .../Providers/Layouts/LayoutShapes.cs | 188 +- .../Providers/Layouts/ListLayout.cs | 134 +- .../Providers/Layouts/ListLayoutForms.cs | 158 +- .../Providers/Layouts/RawLayout.cs | 130 +- .../Providers/Layouts/RawLayoutForms.cs | 166 +- .../Providers/Layouts/RawShapes.cs | 158 +- .../Providers/Layouts/ShapeLayout.cs | 98 +- .../Providers/Layouts/ShapeLayoutForms.cs | 82 +- .../Properties/ContentFieldProperties.cs | 200 +- .../Providers/Properties/ContentProperties.cs | 70 +- .../Properties/CustomValueProperties.cs | 68 +- .../Properties/MemberBindingProperties.cs | 138 +- .../SortCriteria/ContentFieldsSortCriteria.cs | 196 +- .../SortCriteria/MemberBindingSortCriteria.cs | 122 +- .../SortCriteria/RandomSortCriterion.cs | 42 +- .../SortCriteria/SortOrderFormProvider.cs | 112 +- .../Orchard.Projections/Scripts/Web.config | 32 +- .../Scripts/datetime-editor-filter.js | 74 +- .../Scripts/numeric-editor-filter.js | 42 +- .../Services/CustomMemberBindingProvider.cs | 76 +- .../Services/FieldIndexService.cs | 250 +- .../Services/IFieldIndexService.cs | 18 +- .../Services/IFilterProvider.cs | 14 +- .../Services/IMemberBindingProvider.cs | 78 +- .../Services/IProjectionManager.cs | 48 +- .../Services/IPropertyProvider.cs | 14 +- .../Services/IPropertyService.cs | 12 +- .../Services/IQueryService.cs | 22 +- .../Services/ISortCriteriaProvider.cs | 14 +- .../Services/ISortService.cs | 12 +- .../Services/LayoutProvider.cs | 14 +- .../Services/ProjectionManager.cs | 486 +- .../Services/PropertyService.cs | 104 +- .../Services/PropertyShapes.cs | 306 +- .../Services/QueryService.cs | 80 +- .../Services/SortService.cs | 104 +- .../Modules/Orchard.Projections/Shapes.cs | 32 +- .../StandardQueries/QueryFeedQuery.cs | 172 +- .../Orchard.Projections/Styles/Web.config | 32 +- .../Styles/admin-projections.css | 16 +- .../Styles/datetime-editor-filter.css | 6 +- .../Styles/menu.projector-admin.css | 24 +- .../Tests/Orchard.Projections.Tests.csproj | 212 +- .../Tests/Properties/AssemblyInfo.cs | 70 +- .../Tests/Services/FieldIndexServiceTests.cs | 356 +- .../Tests/Services/FieldIndexStorageTests.cs | 458 +- .../ViewModels/AdminCreateViewModel.cs | 16 +- .../ViewModels/AdminEditViewModel.cs | 80 +- .../ViewModels/AdminIndexViewModel.cs | 80 +- .../ViewModels/BindingEditViewModel.cs | 38 +- .../ViewModels/BindingIndexViewModel.cs | 74 +- .../ViewModels/BindingSelectViewModel.cs | 32 +- .../ViewModels/FilterAddViewModel.cs | 24 +- .../ViewModels/FilterEditViewModel.cs | 22 +- .../ViewModels/LayoutAddViewModel.cs | 20 +- .../ViewModels/LayoutEditViewModel.cs | 82 +- .../NavigationQueryPartEditViewModel.cs | 36 +- .../ViewModels/ProjectionPartEditViewModel.cs | 76 +- .../ViewModels/PropertyAddViewModel.cs | 20 +- .../ViewModels/PropertyEditViewModel.cs | 112 +- .../ViewModels/SortCriteriaAddViewModel.cs | 20 +- .../ViewModels/SortCriteriaEditViewModel.cs | 22 +- .../Views/Admin/Edit.cshtml | 232 +- .../Views/Admin/Index.cshtml | 152 +- .../Views/Admin/Preview.cshtml | 20 +- .../Views/Binding/Edit.cshtml | 92 +- .../Views/Binding/Index.cshtml | 180 +- .../Views/Binding/Select.cshtml | 66 +- .../Parts/NavigationQueryPart.cshtml | 74 +- .../Parts/ProjectionPart.cshtml | 146 +- .../Views/Filter/Add.cshtml | 60 +- .../Views/Filter/Edit.cshtml | 72 +- .../Views/Layout/Add.cshtml | 60 +- .../Views/Layout/Create.cshtml | 144 +- .../Views/Layout/Edit.cshtml | 240 +- .../Views/Property/Add.cshtml | 60 +- .../Views/Property/Edit.cshtml | 434 +- .../Views/SortCriterion/Add.cshtml | 60 +- .../Views/SortCriterion/Edit.cshtml | 62 +- .../Modules/Orchard.Projections/Web.config | 108 +- .../Orchard.PublishLater/Content/Web.config | 32 +- .../Drivers/PublishLaterPartDriver.cs | 260 +- .../Handlers/PublishLaterPartHandler.cs | 46 +- .../Handlers/PublishingTaskHandler.cs | 62 +- .../Orchard.PublishLater/Migrations.cs | 42 +- .../Models/PublishLaterPart.cs | 22 +- .../Modules/Orchard.PublishLater/Module.txt | 22 +- .../Orchard.PublishLater.csproj | 312 +- .../Orchard.PublishLater/Placement.info | 28 +- .../Properties/AssemblyInfo.cs | 70 +- .../Services/IPublishLaterService.cs | 18 +- .../Services/PublishLaterService.cs | 68 +- .../Services/PublishingTaskManager.cs | 66 +- .../Services/XmlRpcHandler.cs | 338 +- .../ViewModels/PublishLaterViewModel.cs | 68 +- .../EditorTemplates/Parts/PublishLater.cshtml | 114 +- .../PublishLater.Metadata.Summary.cshtml | 18 +- .../PublishLater.Metadata.SummaryAdmin.cshtml | 82 +- .../Views/Parts/PublishLater.Metadata.cshtml | 18 +- .../Commands/RecipesCommands.cs | 150 +- .../Modules/Orchard.Recipes/Module.txt | 18 +- .../Orchard.Recipes/Orchard.Recipes.csproj | 284 +- .../Properties/AssemblyInfo.cs | 70 +- .../RecipeHandlers/CommandRecipeHandler.cs | 412 +- .../RecipeHandlers/DataRecipeHandler.cs | 218 +- .../RecipeHandlers/FeatureRecipeHandler.cs | 146 +- .../RecipeHandlers/MetaDataRecipeHandler.cs | 160 +- .../RecipeHandlers/MigrationRecipeHandler.cs | 126 +- .../RecipeHandlers/ModuleRecipeHandler.cs | 228 +- .../RecipeHandlers/SettingsRecipeHandler.cs | 198 +- .../RecipeHandlers/ThemeRecipeHandler.cs | 260 +- .../Modules/Orchard.Recipes/Routes.cs | 62 +- .../Services/RecipeHarvester.cs | 98 +- .../Services/RecipeJournalManager.cs | 290 +- .../Orchard.Recipes/Services/RecipeManager.cs | 86 +- .../Orchard.Recipes/Services/RecipeParser.cs | 158 +- .../Services/RecipeScheduler.cs | 96 +- .../Services/RecipeStepExecutor.cs | 138 +- .../Services/RecipeStepQueue.cs | 178 +- .../Modules/Orchard.Roles/AdminMenu.cs | 32 +- .../Modules/Orchard.Roles/Content/Site.css | 634 +- .../Modules/Orchard.Roles/Content/Web.config | 32 +- .../Controllers/AdminController.cs | 358 +- .../Orchard.Roles/DefaultRoleUpdater.cs | 202 +- .../Drivers/UserRolesPartDriver.cs | 264 +- .../Handlers/UserRolesPartHandler.cs | 40 +- .../Modules/Orchard.Roles/Migrations.cs | 106 +- .../Orchard.Roles/Models/IUserRoles.cs | 14 +- .../Orchard.Roles/Models/PermissionRecord.cs | 14 +- .../Orchard.Roles/Models/RoleRecord.cs | 30 +- .../Models/RolesPermissionsRecord.cs | 12 +- .../Orchard.Roles/Models/UserRolesPart.cs | 26 +- .../Models/UserRolesPartRecord.cs | 12 +- .../Orchard.Roles/Models/UserSimulation.cs | 56 +- .../Modules/Orchard.Roles/Module.txt | 36 +- .../Orchard.Roles/Orchard.Roles.csproj | 422 +- .../Modules/Orchard.Roles/Placement.info | 6 +- .../Orchard.Roles/Properties/AssemblyInfo.cs | 72 +- .../Orchard.Roles/Services/IRoleService.cs | 52 +- .../Orchard.Roles/Services/RoleService.cs | 436 +- .../RolesBasedAuthorizationService.cs | 258 +- .../ViewModels/RoleCreateViewModel.cs | 22 +- .../ViewModels/RoleEditViewModel.cs | 28 +- .../ViewModels/RolesIndexViewModel.cs | 16 +- .../ViewModels/UserRolesViewModel.cs | 42 +- .../Orchard.Roles/Views/Admin/Create.cshtml | 82 +- .../Orchard.Roles/Views/Admin/Edit.cshtml | 132 +- .../Orchard.Roles/Views/Admin/Index.cshtml | 96 +- .../Parts/Roles.UserRoles.cshtml | 52 +- .../Modules/Orchard.Rules/AdminMenu.cs | 36 +- .../Modules/Orchard.Rules/Content/Web.config | 32 +- .../Controllers/ActionController.cs | 336 +- .../Controllers/AdminController.cs | 640 +- .../Controllers/EventController.cs | 300 +- .../Handlers/ScheduledActionTaskHandler.cs | 70 +- .../ScheduledActionTaskPartHandler.cs | 28 +- .../ImportExport/RulesCustomExportStep.cs | 26 +- .../ImportExport/RulesExportEventHandler.cs | 126 +- .../ImportExport/RulesRecipeHandler.cs | 114 +- .../Modules/Orchard.Rules/Migrations.cs | 94 +- .../Orchard.Rules/Models/ActionContext.cs | 24 +- .../Orchard.Rules/Models/ActionDescriptor.cs | 26 +- .../Orchard.Rules/Models/ActionRecord.cs | 28 +- .../Models/DescribeActionContext.cs | 64 +- .../Orchard.Rules/Models/DescribeActionFor.cs | 48 +- .../Models/DescribeEventContext.cs | 64 +- .../Orchard.Rules/Models/DescribeEventFor.cs | 48 +- .../Orchard.Rules/Models/EventContext.cs | 24 +- .../Orchard.Rules/Models/EventDescriptor.cs | 26 +- .../Orchard.Rules/Models/EventRecord.cs | 26 +- .../Orchard.Rules/Models/RuleRecord.cs | 46 +- .../Models/ScheduledActionRecord.cs | 18 +- .../Models/ScheduledActionTaskPart.cs | 18 +- .../Models/ScheduledActionTaskRecord.cs | 26 +- .../Orchard.Rules/Models/TypeDescriptor.cs | 20 +- .../Modules/Orchard.Rules/Module.txt | 26 +- .../Orchard.Rules/Orchard.Rules.csproj | 430 +- .../Modules/Orchard.Rules/Placement.info | 4 +- .../Orchard.Rules/Properties/AssemblyInfo.cs | 72 +- .../Providers/NotificationActions.cs | 82 +- .../Providers/NotificationForms.cs | 70 +- .../Providers/ScheduleActions.cs | 224 +- .../Orchard.Rules/Providers/ScheduleForms.cs | 172 +- .../Modules/Orchard.Rules/Scripts/Web.config | 32 +- .../Orchard.Rules/Services/IActionProvider.cs | 14 +- .../Orchard.Rules/Services/IEventProvider.cs | 14 +- .../Orchard.Rules/Services/IRulesManager.cs | 54 +- .../Orchard.Rules/Services/IRulesServices.cs | 32 +- .../Orchard.Rules/Services/RulesManager.cs | 274 +- .../Orchard.Rules/Services/RulesServices.cs | 200 +- .../Modules/Orchard.Rules/Styles/Web.config | 32 +- .../Orchard.Rules/Styles/admin-rules.css | 16 +- .../ViewModels/AddActionViewModel.cs | 20 +- .../ViewModels/AddEventViewModel.cs | 20 +- .../ViewModels/CreateRuleViewModel.cs | 16 +- .../ViewModels/EditActionViewModel.cs | 22 +- .../ViewModels/EditEventViewModel.cs | 22 +- .../ViewModels/EditRuleViewModel.cs | 56 +- .../ViewModels/RulesIndexViewModel.cs | 86 +- .../Orchard.Rules/Views/Action/Add.cshtml | 62 +- .../Orchard.Rules/Views/Action/Edit.cshtml | 22 +- .../Orchard.Rules/Views/Admin/Create.cshtml | 34 +- .../Orchard.Rules/Views/Admin/Edit.cshtml | 214 +- .../Orchard.Rules/Views/Admin/Index.cshtml | 166 +- .../Orchard.Rules/Views/Event/Add.cshtml | 62 +- .../Orchard.Rules/Views/Event/Edit.cshtml | 20 +- .../Modules/Orchard.Rules/Web.config | 114 +- .../Drivers/ScriptValidationPartDriver.cs | 102 +- .../Orchard.Scripting.CSharp/Migrations.cs | 38 +- .../Models/ScriptValidationPart.cs | 14 +- .../Orchard.Scripting.CSharp/Module.txt | 34 +- .../Orchard.Scripting.CSharp.csproj | 336 +- .../Orchard.Scripting.CSharp/Placement.info | 6 +- .../Properties/AssemblyInfo.cs | 72 +- .../Services/CSharpService.cs | 116 +- .../Services/ICSharpService.cs | 18 +- .../Settings/ScriptValidationPartSettings.cs | 8 +- .../ScriptValidationPartSettingsEvents.cs | 76 +- .../ScriptValidationPartSettings.cshtml | 22 +- .../Orchard.Scripting.CSharp/Web.config | 108 +- .../Modules/Orchard.Scripting.Dlr/Module.txt | 20 +- .../Orchard.Scripting.Dlr.csproj | 280 +- .../Properties/AssemblyInfo.cs | 70 +- .../Services/IScriptingManager.cs | 22 +- .../Services/IScriptingRuntime.cs | 16 +- .../Services/RubyScriptExpressionEvaluator.cs | 158 +- .../Services/RubyScriptingRuntime.cs | 70 +- .../Services/ScriptingManager.cs | 70 +- .../Ast/AbstractSyntaxTree.cs | 60 +- .../Modules/Orchard.Scripting/Ast/AstNode.cs | 50 +- .../Orchard.Scripting/Ast/AstVisitor.cs | 64 +- .../Orchard.Scripting/Ast/BinaryAstNode.cs | 74 +- .../Orchard.Scripting/Ast/ConstantAstNode.cs | 40 +- .../Orchard.Scripting/Ast/ErrorAstNode.cs | 58 +- .../Ast/IAstNodeWithToken.cs | 12 +- .../Ast/MethodCallAstNode.cs | 52 +- .../Orchard.Scripting/Ast/UnaryAstNode.cs | 54 +- .../Compiler/EvaluationResult.cs | 94 +- .../Orchard.Scripting/Compiler/Interpreter.cs | 30 +- .../Compiler/InterpreterVisitor.cs | 320 +- .../Orchard.Scripting/Compiler/Lexer.cs | 86 +- .../Orchard.Scripting/Compiler/Parser.cs | 620 +- .../Compiler/PrimitiveType.cs | 326 +- .../Orchard.Scripting/Compiler/Token.cs | 24 +- .../Orchard.Scripting/Compiler/TokenKind.cs | 64 +- .../Orchard.Scripting/Compiler/Tokenizer.cs | 598 +- .../IGlobalMethodProvider.cs | 24 +- .../IScriptExpressionEvaluator.cs | 12 +- .../Modules/Orchard.Scripting/Module.txt | 38 +- .../Orchard.Scripting.csproj | 268 +- .../Properties/AssemblyInfo.cs | 70 +- .../Rules/ConditionActions.cs | 102 +- .../Orchard.Scripting/Rules/ConditionForms.cs | 80 +- .../ScriptExpressionEvaluator.cs | 132 +- .../Orchard.Search/Commands/SearchCommands.cs | 54 +- .../Orchard.Search/ContentAdminMenu.cs | 50 +- .../ContentPickerNavigationProvider.cs | 124 +- .../Controllers/AdminController.cs | 152 +- .../Controllers/ContentPickerController.cs | 252 +- .../Controllers/SearchController.cs | 190 +- .../Drivers/SearchFormPartDriver.cs | 36 +- .../Drivers/SearchSettingsPartDriver.cs | 168 +- .../Handlers/SearchSettingsPartHandler.cs | 48 +- .../Modules/Orchard.Search/Migrations.cs | 148 +- .../Orchard.Search/Models/SearchFormPart.cs | 18 +- .../Models/SearchSettingsPart.cs | 66 +- .../Modules/Orchard.Search/Module.txt | 56 +- .../Orchard.Search/Orchard.Search.csproj | 386 +- .../Modules/Orchard.Search/Placement.info | 22 +- .../Orchard.Search/Properties/AssemblyInfo.cs | 70 +- .../Orchard.Search/Recipes/Search.recipe.xml | 68 +- .../Orchard.Search/ResourceManifest.cs | 20 +- .../Modules/Orchard.Search/Routes.cs | 66 +- .../Orchard.Search/Services/ISearchService.cs | 16 +- .../Orchard.Search/Services/SearchService.cs | 122 +- .../ContentPickerFieldEditorEvents.cs | 70 +- .../Settings/ContentPickerFieldSettings.cs | 22 +- .../Modules/Orchard.Search/Styles/Web.config | 32 +- .../Styles/orchard-search-admin.css | 4 +- .../Styles/orchard-search-search.css | 54 +- .../ViewModels/SearchResultViewModel.cs | 16 +- .../ViewModels/SearchSettingsViewModel.cs | 56 +- .../ViewModels/SearchViewModel.cs | 18 +- .../Orchard.Search/Views/Admin/Index.cshtml | 40 +- .../ContentPickerSearchFieldSettings.cshtml | 60 +- .../Parts/Search.SiteSettings.cshtml | 128 +- .../Parts/Search.MediaLibrary.Actions.cshtml | 54 +- .../Views/Parts/Search.SearchForm.cshtml | 26 +- .../Orchard.Search/Views/Search/Index.cshtml | 40 +- .../Views/SearchContentTab.cshtml | 60 +- .../Annotations/SetupValidationAttributes.cs | 174 +- .../SqlDatabaseConnectionStringAttribute.cs | 40 +- .../Annotations/StringLengthMin.cs | 36 +- .../Orchard.Setup/Commands/SetupCommand.cs | 150 +- .../Modules/Orchard.Setup/Content/Web.config | 32 +- .../Controllers/SetupController.cs | 366 +- .../Controllers/SetupDatabaseType.cs | 26 +- .../Modules/Orchard.Setup/Module.txt | 16 +- .../Orchard.Setup/Orchard.Setup.csproj | 360 +- .../Orchard.Setup/Properties/AssemblyInfo.cs | 70 +- .../Orchard.Setup/Recipes/blog.recipe.xml | 134 +- .../Orchard.Setup/Recipes/core.recipe.xml | 72 +- .../Orchard.Setup/Recipes/default.recipe.xml | 120 +- .../Modules/Orchard.Setup/Routes.cs | 70 +- .../Modules/Orchard.Setup/Scripts/Web.config | 32 +- .../Modules/Orchard.Setup/Scripts/setup.js | 46 +- .../Orchard.Setup/Services/ISetupService.cs | 20 +- .../Orchard.Setup/Services/SetupContext.cs | 26 +- .../Orchard.Setup/Services/SetupService.cs | 458 +- .../Modules/Orchard.Setup/SetupMode.cs | 450 +- .../ViewModels/SetupViewModel.cs | 56 +- .../Orchard.Setup/Views/Setup/Index.cshtml | 184 +- .../Modules/Orchard.Tags/AdminMenu.cs | 32 +- .../Controllers/AdminController.cs | 334 +- .../Controllers/HomeController.cs | 136 +- .../Orchard.Tags/Drivers/TagsPartDriver.cs | 188 +- .../Orchard.Tags/Handlers/TagsPartHandler.cs | 42 +- .../Orchard.Tags/Helpers/TagHelpers.cs | 40 +- .../Modules/Orchard.Tags/Migrations.cs | 114 +- .../Orchard.Tags/Models/ContentTagRecord.cs | 22 +- .../Modules/Orchard.Tags/Models/TagRecord.cs | 24 +- .../Modules/Orchard.Tags/Models/TagsPart.cs | 30 +- .../Orchard.Tags/Models/TagsPartRecord.cs | 22 +- .../Modules/Orchard.Tags/Module.txt | 44 +- .../Modules/Orchard.Tags/Orchard.Tags.csproj | 406 +- .../Modules/Orchard.Tags/Permissions.cs | 82 +- .../Modules/Orchard.Tags/Placement.info | 26 +- .../Orchard.Tags/Projections/TagsFilter.cs | 158 +- .../Projections/TagsFilterForms.cs | 120 +- .../Orchard.Tags/Properties/AssemblyInfo.cs | 70 +- .../Modules/Orchard.Tags/ResourceManifest.cs | 24 +- .../Modules/Orchard.Tags/Routes.cs | 64 +- .../Modules/Orchard.Tags/Scripts/Web.config | 32 +- .../Scripts/orchard-tags-autocomplete.js | 112 +- .../Orchard.Tags/Services/ITagService.cs | 66 +- .../Orchard.Tags/Services/TagService.cs | 442 +- .../Orchard.Tags/Services/XmlRpcHandler.cs | 354 +- .../Modules/Orchard.Tags/Styles/Web.config | 32 +- .../Orchard.Tags/Styles/menu.tags-admin.css | 10 +- .../Styles/orchard-tags-admin.css | 22 +- .../ViewModels/EditTagsViewModel.cs | 8 +- .../ViewModels/TagsAdminCreateViewModel.cs | 18 +- .../ViewModels/TagsAdminEditViewModel.cs | 20 +- .../ViewModels/TagsAdminIndexViewModel.cs | 40 +- .../ViewModels/TagsIndexViewModel.cs | 16 +- .../ViewModels/TagsSearchViewModel.cs | 14 +- .../Orchard.Tags/Views/Admin/Edit.cshtml | 82 +- .../Orchard.Tags/Views/Admin/Index.cshtml | 108 +- .../EditorTemplates/Parts/CreateTag.cshtml | 24 +- .../Views/EditorTemplates/Parts/Tags.cshtml | 46 +- .../Orchard.Tags/Views/Home/Index.cshtml | 22 +- .../Orchard.Tags/Views/Home/Search.cshtml | 18 +- .../Views/Parts/Tags.ShowTags.cshtml | 32 +- .../Modules/Orchard.TaskLease/Migrations.cs | 44 +- .../Models/TaskLeaseRecord.cs | 38 +- .../Modules/Orchard.TaskLease/Module.txt | 14 +- .../Orchard.TaskLease.csproj | 292 +- .../Properties/AssemblyInfo.cs | 72 +- .../Orchard.TaskLease/Scripts/Web.config | 32 +- .../Services/ITaskLeaseService.cs | 54 +- .../Services/TaskLeaseService.cs | 188 +- .../Orchard.TaskLease/Styles/Web.config | 32 +- .../Orchard.TaskLease.Tests.csproj | 214 +- .../Properties/AssemblyInfo.cs | 72 +- .../Services/TaskLeaseServiceTests.cs | 192 +- .../Modules/Orchard.TaskLease/Web.config | 108 +- .../Modules/Orchard.Taxonomies/AdminMenu.cs | 34 +- .../Controllers/AdminController.cs | 422 +- .../Controllers/TermAdminController.cs | 514 +- .../Drivers/TaxonomyFieldDriver.cs | 382 +- .../Drivers/TaxonomyNavigationPartDriver.cs | 268 +- .../Drivers/TaxonomyPartDriver.cs | 150 +- .../Drivers/TermsPartDriver.cs | 12 +- .../Fields/TaxonomyField.cs | 46 +- .../Handlers/TaxonomyPartHandler.cs | 112 +- .../Handlers/TermPartHandler.cs | 22 +- .../Handlers/TermsPartHandler.cs | 246 +- .../Helpers/PathExtensions.cs | 56 +- .../Helpers/PredicateBuilder.cs | 40 +- .../Modules/Orchard.Taxonomies/Migrations.cs | 162 +- .../Models/TaxonomyNavigationPart.cs | 120 +- .../Orchard.Taxonomies/Models/TaxonomyPart.cs | 66 +- .../Models/TaxonomyPartRecord.cs | 16 +- .../Models/TermContentItem.cs | 30 +- .../Models/TermContentItemPart.cs | 18 +- .../Orchard.Taxonomies/Models/TermPart.cs | 242 +- .../Orchard.Taxonomies/Models/TermPartNode.cs | 28 +- .../Models/TermPartRecord.cs | 26 +- .../Orchard.Taxonomies/Models/TermsPart.cs | 30 +- .../Models/TermsPartRecord.cs | 26 +- .../Modules/Orchard.Taxonomies/Module.txt | 26 +- .../Navigation/TaxonomyNavigationProvider.cs | 230 +- .../Modules/Orchard.Taxonomies/Permissions.cs | 110 +- .../Modules/Orchard.Taxonomies/Placement.info | 62 +- .../Projections/TermsFilter.cs | 196 +- .../Projections/TermsFilterForms.cs | 200 +- .../Properties/AssemblyInfo.cs | 66 +- .../Orchard.Taxonomies/Scripts/Web.config | 32 +- .../Scripts/admin-taxonomy-expando.js | 4 +- .../Scripts/admin-taxonomy-field-settings.js | 52 +- .../Scripts/admin-taxonomy-tags.js | 334 +- .../Orchard.Taxonomies/Scripts/tagit.js | 914 +- .../Services/ITaxonomyService.cs | 164 +- .../Services/TaxonomyService.cs | 800 +- .../Settings/TaxonomyFieldEditorEvents.cs | 98 +- .../Settings/TaxonomyFieldSettings.cs | 84 +- .../Modules/Orchard.Taxonomies/Shapes.cs | 212 +- .../StandardQueries/TermFeedQuery.cs | 160 +- .../Orchard.Taxonomies/Styles/Web.config | 32 +- .../Styles/admin-taxonomy-tags.css | 330 +- .../Styles/admin-taxonomy.css | 48 +- .../Styles/menu.taxonomies-admin.css | 10 +- .../Tokens/TaxonomyTokens.cs | 124 +- .../ViewModels/ImportViewModel.cs | 14 +- .../ViewModels/MergeTermViewModel.cs | 22 +- .../ViewModels/MoveTermViewModel.cs | 20 +- .../ViewModels/SelectTermViewModel.cs | 18 +- .../ViewModels/TaxonomyAdminIndexViewModel.cs | 44 +- .../ViewModels/TaxonomyFieldViewModel.cs | 24 +- .../ViewModels/TaxonomyNavigationViewModel.cs | 34 +- .../ViewModels/TermAdminIndexViewModel.cs | 60 +- .../Views/Admin/Create.cshtml | 14 +- .../Views/Admin/Edit.cshtml | 14 +- .../Views/Admin/Import.cshtml | 132 +- .../Views/Admin/Index.cshtml | 126 +- .../TaxonomyFieldSettings.cshtml | 92 +- .../Fields/TaxonomyField.Autocomplete.cshtml | 154 +- .../Fields/TaxonomyField.cshtml | 108 +- .../Parts/Navigation.Taxonomy.Edit.cshtml | 132 +- .../Parts/Taxonomies.Term.Fields.cshtml | 24 +- .../Views/Fields/TaxonomyField.cshtml | 20 +- .../Orchard.Taxonomies/Views/Home/List.cshtml | 2 +- .../Views/Items/Content-Term.Edit.cshtml | 12 +- .../Views/Parts.TermPart.cshtml | 24 +- .../Orchard.Taxonomies/Views/Taxonomy.cshtml | 40 +- .../Views/TaxonomyItem.cshtml | 72 +- .../Views/TaxonomyItemLink.cshtml | 22 +- .../Views/TermAdmin/Create.cshtml | 12 +- .../Views/TermAdmin/Edit.cshtml | 12 +- .../Views/TermAdmin/Index.cshtml | 108 +- .../Views/TermAdmin/Merge.cshtml | 56 +- .../Views/TermAdmin/MoveTerm.cshtml | 44 +- .../Views/TermAdmin/RenderTermSelect.cshtml | 14 +- .../Views/TermAdmin/SelectTerm.cshtml | 40 +- .../Modules/Orchard.Themes/AdminMenu.cs | 28 +- .../Orchard.Themes/Commands/ThemeCommands.cs | 210 +- .../Modules/Orchard.Themes/Content/Web.config | 32 +- .../Controllers/AdminController.cs | 518 +- .../Events/IExtensionDisplayEventHandler.cs | 24 +- .../Handlers/ThemeSiteSettingsPartHandler.cs | 22 +- .../Modules/Orchard.Themes/Migrations.cs | 40 +- .../Orchard.Themes/Models/ThemeEntry.cs | 128 +- .../Models/ThemeSiteSettingsPart.cs | 18 +- .../Modules/Orchard.Themes/Module.txt | 20 +- .../Orchard.Themes/Orchard.Themes.csproj | 332 +- .../Modules/Orchard.Themes/Permissions.cs | 50 +- .../Orchard.Themes/Preview/IPreviewTheme.cs | 10 +- .../Orchard.Themes/Preview/PreviewTheme.cs | 66 +- .../Preview/PreviewThemeFilter.cs | 104 +- .../Preview/PreviewThemeSelector.cs | 30 +- .../Orchard.Themes/Properties/AssemblyInfo.cs | 70 +- .../Orchard.Themes/ResourceManifest.cs | 20 +- .../Orchard.Themes/Services/IThemeService.cs | 16 +- .../Services/SafeModeThemeSelector.cs | 20 +- .../Services/SiteThemeSelector.cs | 38 +- .../Services/SiteThemeService.cs | 106 +- .../Orchard.Themes/Services/ThemeService.cs | 356 +- .../Modules/Orchard.Themes/Styles/Web.config | 32 +- .../Styles/menu.themes-admin.css | 10 +- .../Styles/orchard-themes-admin.css | 108 +- .../ViewModels/ThemesIndexViewModel.cs | 18 +- .../Orchard.Themes/Views/Admin/Index.cshtml | 74 +- .../Views/ThemeEntry.Current.cshtml | 46 +- .../Orchard.Themes/Views/ThemeEntry.cshtml | 146 +- .../Orchard.Themes/Views/ThemePreview.cshtml | 138 +- .../Controllers/AdminController.cs | 76 +- .../Modules/Orchard.Tokens/DescribeContext.cs | 18 +- .../Modules/Orchard.Tokens/DescribeFor.cs | 22 +- .../Modules/Orchard.Tokens/EvaluateContext.cs | 28 +- .../Modules/Orchard.Tokens/EvaluateFor.cs | 22 +- .../Modules/Orchard.Tokens/ITokenManager.cs | 14 +- .../Modules/Orchard.Tokens/ITokenProvider.cs | 14 +- .../Modules/Orchard.Tokens/ITokenizer.cs | 24 +- .../Implementation/TokenManager.cs | 542 +- .../Implementation/Tokenizer.cs | 226 +- .../Modules/Orchard.Tokens/Module.txt | 44 +- .../Orchard.Tokens/Orchard.Tokens.csproj | 356 +- .../Orchard.Tokens/Properties/AssemblyInfo.cs | 72 +- .../Orchard.Tokens/Providers/ContentTokens.cs | 408 +- .../Orchard.Tokens/Providers/DateTokens.cs | 192 +- .../Orchard.Tokens/Providers/RequestTokens.cs | 202 +- .../Orchard.Tokens/Providers/TextTokens.cs | 188 +- .../Orchard.Tokens/Providers/UserTokens.cs | 106 +- .../Modules/Orchard.Tokens/ReplaceOptions.cs | 54 +- .../Modules/Orchard.Tokens/Scripts/Web.config | 32 +- .../Scripts/orchard-tokens-admin.js | 158 +- .../Modules/Orchard.Tokens/Styles/Web.config | 32 +- .../Styles/orchard-tokens-admin.css | 134 +- .../Orchard.Tokens/Tests/DateTokenTests.cs | 264 +- .../Tests/Orchard.Tokens.Tests.csproj | 180 +- .../Tests/Properties/AssemblyInfo.cs | 72 +- .../Modules/Orchard.Tokens/Tests/StubClock.cs | 60 +- .../Tests/StubOrchardServices.cs | 98 +- .../Tests/StubWorkContextAccessor.cs | 326 +- .../Orchard.Tokens/Tests/TestTokenProvider.cs | 172 +- .../Orchard.Tokens/Tests/TokenManagerTests.cs | 148 +- .../Orchard.Tokens/Tests/TokenizerTests.cs | 236 +- .../Orchard.Tokens/Tests/UserTokenTests.cs | 82 +- .../Modules/Orchard.Tokens/TokenDescriptor.cs | 36 +- .../Orchard.Tokens/Views/TokenHint.cshtml | 26 +- .../Modules/Orchard.Tokens/Web.config | 108 +- .../Modules/Orchard.Users/AdminMenu.cs | 36 +- .../Orchard.Users/Commands/UserCommands.cs | 124 +- .../Modules/Orchard.Users/Content/Web.config | 32 +- .../Controllers/AccountController.cs | 886 +- .../Controllers/AdminController.cs | 716 +- .../Orchard.Users/Drivers/UserPartDriver.cs | 86 +- .../Orchard.Users/Events/IUserEventHandler.cs | 124 +- .../Orchard.Users/Events/UserContext.cs | 16 +- .../RegistrationSettingsPartHandler.cs | 48 +- .../Orchard.Users/Handlers/UserPartHandler.cs | 46 +- .../Modules/Orchard.Users/Migrations.cs | 64 +- .../Orchard.Users/Models/MessageTypes.cs | 14 +- .../Models/RegistrationSettingsPart.cs | 90 +- .../Modules/Orchard.Users/Models/UserPart.cs | 122 +- .../Orchard.Users/Models/UserPartRecord.cs | 36 +- .../Orchard.Users/Models/UserStatus.cs | 10 +- .../Modules/Orchard.Users/Module.txt | 44 +- .../Orchard.Users/Orchard.Users.csproj | 510 +- .../Orchard.Users/Properties/AssemblyInfo.cs | 70 +- .../Orchard.Users/Services/IUserService.cs | 32 +- .../Services/MembershipService.cs | 582 +- .../Services/MissingSettingsBanner.cs | 78 +- .../Services/UserResolverSelector.cs | 78 +- .../Orchard.Users/Services/UserService.cs | 398 +- .../Modules/Orchard.Users/Styles/Web.config | 32 +- .../Orchard.Users/Styles/menu.users-admin.css | 10 +- .../ViewModels/UserCreateViewModel.cs | 38 +- .../ViewModels/UserEditViewModel.cs | 40 +- .../ViewModels/UsersIndexViewModel.cs | 86 +- .../Views/Account/AccessDenied.cshtml | 6 +- .../Views/Account/ChallengeEmailFail.cshtml | 6 +- .../Views/Account/ChallengeEmailSent.cshtml | 6 +- .../Account/ChallengeEmailSuccess.cshtml | 6 +- .../Views/Account/ChangePassword.cshtml | 54 +- .../Account/ChangePasswordSuccess.cshtml | 6 +- .../Views/Account/LostPassword.cshtml | 44 +- .../Views/Account/RegistrationPending.cshtml | 6 +- .../Views/Account/RequestLostPassword.cshtml | 28 +- .../Orchard.Users/Views/Admin/Create.cshtml | 12 +- .../Orchard.Users/Views/Admin/Edit.cshtml | 14 +- .../Orchard.Users/Views/Admin/Index.cshtml | 178 +- .../EditorTemplates/Parts/User.Create.cshtml | 40 +- .../EditorTemplates/Parts/User.Edit.cshtml | 20 +- .../Parts/Users.RegistrationSettings.cshtml | 126 +- .../Views/Items/Content-User.Edit.cshtml | 14 +- .../Modules/Orchard.Users/Views/LogOn.cshtml | 70 +- .../Orchard.Users/Views/Register.cshtml | 62 +- .../Modules/Orchard.Warmup/AdminMenu.cs | 36 +- .../Orchard.Warmup/Commands/WarmupCommands.cs | 56 +- .../Modules/Orchard.Warmup/Content/Web.config | 32 +- .../Controllers/AdminController.cs | 206 +- .../Handlers/WarmupContentHandler.cs | 58 +- .../Handlers/WarmupSettingsPartHandler.cs | 30 +- .../Modules/Orchard.Warmup/Migrations.cs | 20 +- .../Orchard.Warmup/Models/ReportEntry.cs | 18 +- .../Models/WarmupSettingsPart.cs | 50 +- .../Modules/Orchard.Warmup/Module.txt | 18 +- .../Orchard.Warmup/Orchard.Warmup.csproj | 334 +- .../Modules/Orchard.Warmup/Placement.info | 6 +- .../Orchard.Warmup/Properties/AssemblyInfo.cs | 78 +- .../Modules/Orchard.Warmup/Scripts/Web.config | 32 +- .../Services/IWarmupReportManager.cs | 16 +- .../Services/IWarmupScheduler.cs | 8 +- .../Orchard.Warmup/Services/IWarmupUpdater.cs | 26 +- .../Orchard.Warmup/Services/IWebDownloader.cs | 26 +- .../Orchard.Warmup/Services/SettingsBanner.cs | 56 +- .../Services/WarmupReportManager.cs | 114 +- .../Services/WarmupScheduler.cs | 98 +- .../Orchard.Warmup/Services/WarmupTask.cs | 48 +- .../Orchard.Warmup/Services/WarmupUpdater.cs | 408 +- .../Orchard.Warmup/Services/WebDownloader.cs | 98 +- .../Modules/Orchard.Warmup/Styles/Web.config | 32 +- .../Styles/orchard-warmup-admin.css | 16 +- .../ViewModels/WarmupViewModel.cs | 16 +- .../Orchard.Warmup/Views/Admin/Index.cshtml | 152 +- .../Modules/Orchard.Warmup/Web.config | 108 +- .../Modules/Orchard.Widgets/AdminMenu.cs | 32 +- .../Orchard.Widgets/Commands/LayerCommands.cs | 102 +- .../Commands/WidgetCommands.cs | 282 +- .../Orchard.Widgets/Content/Web.config | 32 +- .../Modules/Orchard.Widgets/ControlWrapper.cs | 34 +- .../Controllers/AdminController.cs | 864 +- .../Drivers/LayerPartDriver.cs | 190 +- .../Drivers/WidgetPartDriver.cs | 216 +- .../Orchard.Widgets/Filters/WidgetFilter.cs | 228 +- .../Handlers/DisplayedContentItemHandler.cs | 48 +- .../Handlers/LayerHintHandler.cs | 102 +- .../Handlers/LayerPartHandler.cs | 42 +- .../Handlers/WidgetPartHandler.cs | 92 +- .../Modules/Orchard.Widgets/Migrations.cs | 148 +- .../Orchard.Widgets/Models/LayerPart.cs | 64 +- .../Orchard.Widgets/Models/LayerPartRecord.cs | 16 +- .../Orchard.Widgets/Models/WidgetPart.cs | 158 +- .../Models/WidgetPartRecord.cs | 22 +- .../Modules/Orchard.Widgets/Module.txt | 42 +- .../Orchard.Widgets/Orchard.Widgets.csproj | 446 +- .../Modules/Orchard.Widgets/Permissions.cs | 52 +- .../Modules/Orchard.Widgets/Placement.info | 10 +- .../Properties/AssemblyInfo.cs | 70 +- .../Orchard.Widgets/ResourceManifest.cs | 18 +- .../RuleEngine/AuthenticatedRuleProvider.cs | 50 +- .../RuleEngine/BuiltinRuleProvider.cs | 34 +- .../ContentDisplayedRuleProvider.cs | 44 +- .../Orchard.Widgets/RuleEngine/RuleManager.cs | 106 +- .../RuleEngine/UrlRuleProvider.cs | 92 +- .../Orchard.Widgets/Services/IRuleManager.cs | 8 +- .../Orchard.Widgets/Services/IRuleProvider.cs | 12 +- .../Services/IWidgetsService.cs | 74 +- .../Services/LayerResolverSelector.cs | 78 +- .../Orchard.Widgets/Services/RuleContext.cs | 12 +- .../Services/WidgetsService.cs | 512 +- .../Modules/Orchard.Widgets/Shapes.cs | 100 +- .../Modules/Orchard.Widgets/Styles/Web.config | 32 +- .../Styles/menu.widgets-admin.css | 10 +- .../Styles/orchard-widgets-admin.css | 726 +- .../Views/Admin/AddLayer.cshtml | 12 +- .../Views/Admin/AddWidget.cshtml | 12 +- .../Views/Admin/ChooseWidget.cshtml | 54 +- .../Views/Admin/EditLayer.cshtml | 12 +- .../Views/Admin/EditWidget.cshtml | 12 +- .../Orchard.Widgets/Views/Admin/Index.cshtml | 36 +- .../Parts.Widgets.LayerPart.cshtml | 38 +- .../Parts.Widgets.WidgetPart.cshtml | 58 +- .../Views/Widget.ControlWrapper.cshtml | 28 +- .../Views/Widget.DeleteButton.cshtml | 4 +- .../Orchard.Widgets/Views/Widget.Edit.cshtml | 16 +- .../Views/Widget.Wrapper.cshtml | 42 +- .../Views/WidgetLayerVisibility.cshtml | 188 +- .../Views/WidgetPlacement.Orphans.cshtml | 52 +- .../Views/WidgetPlacement.Zones.cshtml | 216 +- .../Views/WidgetPlacement.cshtml | 48 +- .../Views/WidgetSimplePreview.cshtml | 6 +- .../Activities/BranchActivity.cs | 112 +- .../Activities/ContentActivity.cs | 222 +- .../Activities/DeleteActivity.cs | 82 +- .../Activities/ExclusiveBranchActivity.cs | 88 +- .../Activities/MergeBranchActivity.cs | 180 +- .../Activities/PublishActivity.cs | 82 +- .../Activities/RedirectActivity.cs | 96 +- .../Activities/SignalActivity.cs | 104 +- .../Activities/TimerActivity.cs | 280 +- .../Activities/TriggerActivity.cs | 98 +- .../Activities/WebRequestActivity.cs | 242 +- .../Modules/Orchard.Workflows/AdminMenu.cs | 40 +- .../Controllers/AdminController.cs | 896 +- .../Controllers/SignalController.cs | 120 +- .../Drivers/WorkflowDriver.cs | 68 +- .../Orchard.Workflows/Forms/BranchForms.cs | 70 +- .../Forms/ContentActivityForms.cs | 100 +- .../Forms/NotificationActivityForms.cs | 70 +- .../Forms/RedirectActionForm.cs | 54 +- .../Orchard.Workflows/Forms/SignalForms.cs | 158 +- .../Orchard.Workflows/Forms/TimerForms.cs | 126 +- .../Orchard.Workflows/Forms/WebRequestForm.cs | 116 +- .../Handlers/WorkflowHandler.cs | 50 +- .../ImportExport/WorkflowsCustomExportStep.cs | 26 +- .../WorkflowsExportEventHandler.cs | 124 +- .../ImportExport/WorkflowsRecipeHandler.cs | 200 +- .../Modules/Orchard.Workflows/Migrations.cs | 104 +- .../Models/ActivityContext.cs | 48 +- .../Models/ActivityRecord.cs | 100 +- .../Models/AwaitingActivityRecord.cs | 18 +- .../Models/CancellationToken.cs | 16 +- .../Models/TransitionRecord.cs | 66 +- .../Models/WorkflowContext.cs | 208 +- .../Models/WorkflowDefinitionRecord.cs | 96 +- .../Models/WorkflowRecord.cs | 78 +- .../Modules/Orchard.Workflows/Module.txt | 34 +- .../Modules/Orchard.Workflows/Placement.info | 16 +- .../Properties/AssemblyInfo.cs | 72 +- .../Orchard.Workflows/ResourceManifest.cs | 64 +- .../Orchard.Workflows/Scripts/Web.config | 32 +- .../Scripts/orchard-workflows-serialize.js | 330 +- .../Scripts/orchard-workflows.js | 576 +- .../Services/ActivitiesManager.cs | 40 +- .../Orchard.Workflows/Services/Event.cs | 98 +- .../Services/GenericEventService.cs | 74 +- .../Services/IActivitiesManager.cs | 16 +- .../Orchard.Workflows/Services/IActivity.cs | 124 +- .../Services/ISignalService.cs | 10 +- .../Services/IWorkflowManager.cs | 34 +- .../Orchard.Workflows/Services/Task.cs | 94 +- .../Services/WorkflowManager.cs | 580 +- .../Orchard.Workflows/Styles/Web.config | 32 +- .../Styles/menu.workflows-admin.css | 10 +- .../Styles/orchard-workflows-admin.css | 574 +- .../Styles/workflows-activity-branch.css | 104 +- .../Styles/workflows-activity-timer.css | 32 +- .../Orchard.Workflows/Tokens/SignalTokens.cs | 94 +- .../ViewModels/AdminEditViewModel.cs | 38 +- .../ViewModels/AdminIndexViewModel.cs | 80 +- .../ViewModels/WorkflowDefinitionViewModel.cs | 62 +- .../Views/Activity-Branch.cshtml | 14 +- .../Views/Activity-Delete.cshtml | 14 +- .../Views/Activity-ExclusiveBranch.cshtml | 14 +- .../Views/Activity-MergeBranch.cshtml | 26 +- .../Views/Activity-Notify.cshtml | 26 +- .../Views/Activity-Publish.cshtml | 14 +- .../Views/Activity-Redirect.cshtml | 14 +- .../Views/Activity-Timer.cshtml | 34 +- .../Orchard.Workflows/Views/Activity.cshtml | 24 +- .../Views/ActivityToolbox.cshtml | 82 +- .../Views/Admin/Create.cshtml | 36 +- .../Orchard.Workflows/Views/Admin/Edit.cshtml | 268 +- .../Views/Admin/EditActivity.cshtml | 74 +- .../Views/Admin/Index.cshtml | 154 +- .../Orchard.Workflows/Views/Admin/List.cshtml | 84 +- .../Views/Parts.Workflow.SummaryAdmin.cshtml | 28 +- .../Modules/Orchard.Workflows/Web.config | 108 +- .../Modules/Orchard.jQuery/Module.txt | 22 +- .../Orchard.jQuery/Orchard.jQuery.csproj | 1262 +- .../Orchard.jQuery/Properties/AssemblyInfo.cs | 70 +- .../Orchard.jQuery/ResourceManifest.cs | 170 +- .../Modules/Orchard.jQuery/Scripts/Web.config | 32 +- .../Scripts/calendars/jquery.calendars-am.js | 46 +- .../calendars/jquery.calendars-ar-DZ.js | 44 +- .../calendars/jquery.calendars-ar-EG.js | 46 +- .../Scripts/calendars/jquery.calendars-ar.js | 48 +- .../Scripts/calendars/jquery.calendars-az.js | 46 +- .../Scripts/calendars/jquery.calendars-bg.js | 46 +- .../Scripts/calendars/jquery.calendars-cs.js | 46 +- .../Scripts/calendars/jquery.calendars-el.js | 46 +- .../Scripts/calendars/jquery.calendars-fa.js | 44 +- .../Scripts/calendars/jquery.calendars-gu.js | 46 +- .../Scripts/calendars/jquery.calendars-he.js | 46 +- .../calendars/jquery.calendars-hi-IN.js | 42 +- .../Scripts/calendars/jquery.calendars-hy.js | 46 +- .../Scripts/calendars/jquery.calendars-ja.js | 46 +- .../Scripts/calendars/jquery.calendars-ka.js | 46 +- .../Scripts/calendars/jquery.calendars-km.js | 46 +- .../Scripts/calendars/jquery.calendars-ko.js | 46 +- .../Scripts/calendars/jquery.calendars-me.js | 46 +- .../Scripts/calendars/jquery.calendars-mk.js | 46 +- .../Scripts/calendars/jquery.calendars-ml.js | 46 +- .../Scripts/calendars/jquery.calendars-pl.js | 46 +- .../Scripts/calendars/jquery.calendars-ru.js | 46 +- .../Scripts/calendars/jquery.calendars-sr.js | 44 +- .../Scripts/calendars/jquery.calendars-ta.js | 46 +- .../Scripts/calendars/jquery.calendars-th.js | 46 +- .../Scripts/calendars/jquery.calendars-tr.js | 46 +- .../Scripts/calendars/jquery.calendars-uk.js | 46 +- .../Scripts/calendars/jquery.calendars-ur.js | 50 +- .../calendars/jquery.calendars-zh-CN.js | 46 +- .../calendars/jquery.calendars-zh-HK.js | 46 +- .../calendars/jquery.calendars-zh-TW.js | 46 +- .../jquery.calendars.ethiopian-am.js | 38 +- .../calendars/jquery.calendars.hebrew-he.js | 38 +- .../calendars/jquery.calendars.islamic-ar.js | 36 +- .../calendars/jquery.calendars.islamic-fa.js | 36 +- .../calendars/jquery.calendars.lang.js | 3412 +- .../calendars/jquery.calendars.lang.min.js | 10 +- .../calendars/jquery.calendars.nepali-ne.js | 34 +- .../calendars/jquery.calendars.persian-fa.js | 36 +- .../calendars/jquery.calendars.picker-am.js | 42 +- .../jquery.calendars.picker-ar-DZ.js | 42 +- .../jquery.calendars.picker-ar-EG.js | 44 +- .../calendars/jquery.calendars.picker-ar.js | 42 +- .../calendars/jquery.calendars.picker-az.js | 42 +- .../calendars/jquery.calendars.picker-bg.js | 42 +- .../calendars/jquery.calendars.picker-cs.js | 42 +- .../calendars/jquery.calendars.picker-el.js | 42 +- .../calendars/jquery.calendars.picker-fa.js | 42 +- .../calendars/jquery.calendars.picker-gu.js | 42 +- .../calendars/jquery.calendars.picker-he.js | 42 +- .../jquery.calendars.picker-hi-IN.js | 42 +- .../calendars/jquery.calendars.picker-hy.js | 42 +- .../calendars/jquery.calendars.picker-ja.js | 46 +- .../calendars/jquery.calendars.picker-ka.js | 42 +- .../calendars/jquery.calendars.picker-km.js | 42 +- .../calendars/jquery.calendars.picker-ko.js | 46 +- .../calendars/jquery.calendars.picker-mk.js | 42 +- .../calendars/jquery.calendars.picker-ml.js | 42 +- .../calendars/jquery.calendars.picker-pl.js | 42 +- .../calendars/jquery.calendars.picker-ru.js | 42 +- .../calendars/jquery.calendars.picker-sr.js | 42 +- .../calendars/jquery.calendars.picker-ta.js | 42 +- .../calendars/jquery.calendars.picker-th.js | 42 +- .../calendars/jquery.calendars.picker-uk.js | 42 +- .../calendars/jquery.calendars.picker-ur.js | 44 +- .../calendars/jquery.calendars.picker-vi.js | 42 +- .../jquery.calendars.picker-zh-CN.js | 46 +- .../jquery.calendars.picker-zh-HK.js | 46 +- .../jquery.calendars.picker-zh-TW.js | 46 +- .../calendars/jquery.calendars.picker.lang.js | 3144 +- .../jquery.calendars.picker.lang.min.js | 10 +- .../jquery.calendars.taiwan-zh-TW.js | 38 +- .../calendars/jquery.calendars.thai-th.js | 38 +- .../jquery.calendars.ummalqura-ar.js | 34 +- .../Orchard.jQuery/Scripts/jquery.utils.js | 5556 +- .../Scripts/timeentry/jquery.timeentry-ar.js | 18 +- .../Scripts/timeentry/jquery.timeentry-fa.js | 16 +- .../Scripts/timeentry/jquery.timeentry-hu.js | 18 +- .../Scripts/timeentry/jquery.timeentry-ja.js | 18 +- .../Scripts/timeentry/jquery.timeentry-lv.js | 16 +- .../Scripts/timeentry/jquery.timeentry-pl.js | 18 +- .../timeentry/jquery.timeentry-zh-CN.js | 18 +- .../Modules/Orchard.jQuery/Styles/Web.config | 32 +- .../Modules/SysCache/Models/SysCacheRecord.cs | 16 +- src/Orchard.Web/Modules/SysCache/Module.txt | 20 +- .../SysCache/Properties/AssemblyInfo.cs | 72 +- .../SysCacheDatabaseCacheConfiguration.cs | 40 +- .../Modules/SysCache/SysCache.csproj | 290 +- src/Orchard.Web/Modules/SysCache/Web.config | 108 +- src/Orchard.Web/Modules/TinyMce/Module.txt | 20 +- .../TinyMce/Properties/AssemblyInfo.cs | 70 +- .../Modules/TinyMce/ResourceManifest.cs | 22 +- .../Modules/TinyMce/Scripts/Web.config | 32 +- .../TinyMce/Scripts/orchard-tinymce.js | 74 +- .../Modules/TinyMce/TinyMce.csproj | 646 +- .../TinyMce/Views/Body-Html.Editor.cshtml | 58 +- src/Orchard.Web/Modules/Upgrade/AdminMenu.cs | 56 +- .../Controllers/ContentPickerController.cs | 120 +- .../Upgrade/Controllers/FieldController.cs | 200 +- .../Upgrade/Controllers/MediaController.cs | 500 +- .../Upgrade/Controllers/MenuController.cs | 182 +- .../Upgrade/Controllers/RouteController.cs | 358 +- .../Upgrade/Controllers/TaxonomyController.cs | 150 +- src/Orchard.Web/Modules/Upgrade/Module.txt | 22 +- .../Upgrade/Properties/AssemblyInfo.cs | 72 +- .../Upgrade/Services/IUpgradeService.cs | 24 +- .../Upgrade/Services/UpgradeService.cs | 266 +- .../Modules/Upgrade/Styles/Web.config | 32 +- .../Upgrade/Styles/menu.upgrade-admin.css | 10 +- .../Modules/Upgrade/Upgrade.csproj | 376 +- .../Upgrade/ViewModels/MigrateViewModel.cs | 24 +- .../Upgrade/Views/ContentPicker/Index.cshtml | 26 +- .../Modules/Upgrade/Views/Field/Index.cshtml | 50 +- .../Modules/Upgrade/Views/Media/Index.cshtml | 156 +- .../Modules/Upgrade/Views/Menu/Index.cshtml | 26 +- .../Modules/Upgrade/Views/Route/Index.cshtml | 50 +- .../Upgrade/Views/Taxonomy/Index.cshtml | 32 +- src/Orchard.Web/Modules/Upgrade/Web.config | 120 +- src/Orchard.Web/Orchard.Web.csproj | 568 +- src/Orchard.Web/Properties/AssemblyInfo.cs | 76 +- src/Orchard.Web/Refresh.html | 30 +- .../Themes/Properties/AssemblyInfo.cs | 76 +- .../Themes/SafeMode/Content/Web.config | 32 +- .../Themes/SafeMode/Styles/Web.config | 32 +- .../Themes/SafeMode/Styles/ie6.css | 44 +- .../Themes/SafeMode/Styles/site.css | 676 +- src/Orchard.Web/Themes/SafeMode/Theme.txt | 12 +- .../Themes/SafeMode/Views/Layout.cshtml | 76 +- .../Themes/TheAdmin/Scripts/Web.config | 32 +- .../Themes/TheAdmin/Scripts/admin.js | 386 +- .../Themes/TheAdmin/Styles/Web.config | 32 +- src/Orchard.Web/Themes/TheAdmin/Styles/ie.css | 62 +- .../Themes/TheAdmin/Styles/ie7.css | 84 +- .../Themes/TheAdmin/Styles/ie8.css | 32 +- .../Themes/TheAdmin/Styles/site.css | 3156 +- src/Orchard.Web/Themes/TheAdmin/Theme.txt | 14 +- .../Themes/TheAdmin/Views/ErrorPage.cshtml | 24 +- .../Themes/TheAdmin/Views/Header.cshtml | 20 +- .../Themes/TheAdmin/Views/Layout.cshtml | 204 +- .../Themes/TheAdmin/Views/LocalMenu.cshtml | 82 +- .../Themes/TheAdmin/Views/Menu.cshtml | 252 +- .../TheAdmin/Views/OrchardVersion.cshtml | 6 +- .../Themes/TheAdmin/Views/Pager.cshtml | 264 +- .../Themes/TheAdmin/Views/User.cshtml | 2 +- .../Themes/TheThemeMachine/Placement.info | 34 +- .../Themes/TheThemeMachine/Styles/Site.css | 1550 +- .../Themes/TheThemeMachine/Styles/Web.config | 32 +- .../Themes/TheThemeMachine/Theme.txt | 14 +- .../TheThemeMachine/Views/Branding.cshtml | 2 +- .../TheThemeMachine/Views/Layout.cshtml | 344 +- .../Themes/TheThemeMachine/Views/Pager.cshtml | 20 +- src/Orchard.Web/Themes/Themes.csproj | 422 +- src/Orchard.Web/Themes/Web.config | 156 +- src/Orchard.Web/Web.Debug.config | 6 +- src/Orchard.Web/Web.Release.config | 22 +- src/Orchard.Web/Web.config | 430 +- src/Orchard.sln | 2314 +- src/Orchard/Caching/AcquireContext.cs | 64 +- src/Orchard/Caching/Cache.cs | 182 +- src/Orchard/Caching/CacheModule.cs | 58 +- .../Caching/DefaultAsyncTokenProvider.cs | 134 +- .../Caching/DefaultCacheContextAccessor.cs | 38 +- src/Orchard/Caching/DefaultCacheHolder.cs | 72 +- src/Orchard/Caching/DefaultCacheManager.cs | 72 +- .../Caching/DefaultParallelCacheContext.cs | 230 +- src/Orchard/Caching/IAsyncTokenProvider.cs | 12 +- src/Orchard/Caching/ICache.cs | 14 +- src/Orchard/Caching/ICacheContextAccessor.cs | 8 +- src/Orchard/Caching/ICacheHolder.cs | 14 +- src/Orchard/Caching/ICacheManager.cs | 42 +- src/Orchard/Caching/IParallelCacheContext.cs | 72 +- src/Orchard/Caching/IVolatileProvider.cs | 6 +- src/Orchard/Caching/IVolatileToken.cs | 8 +- src/Orchard/Caching/Signals.cs | 84 +- src/Orchard/Caching/Weak.cs | 38 +- src/Orchard/Collections/IPageOfItems.cs | 22 +- src/Orchard/Collections/PageOfItems.cs | 54 +- src/Orchard/Commands/Builtin/HelpCommand.cs | 98 +- .../Commands/CommandBackgroundService.cs | 28 +- .../Commands/CommandBackgroundService.cs.rej | 22 +- src/Orchard/Commands/CommandContext.cs | 32 +- src/Orchard/Commands/CommandDescriptor.cs | 16 +- .../Commands/CommandHandlerDescriptor.cs | 14 +- .../CommandHandlerDescriptorBuilder.cs | 94 +- src/Orchard/Commands/CommandHostAgent.cs | 516 +- .../Commands/CommandHostEnvironment.cs | 32 +- .../Commands/CommandHostVirtualPathMonitor.cs | 192 +- src/Orchard/Commands/CommandModule.cs | 34 +- src/Orchard/Commands/CommandNameAttribute.cs | 50 +- src/Orchard/Commands/CommandParameters.cs | 24 +- src/Orchard/Commands/DefaultCommandManager.cs | 176 +- .../Commands/DefaultOrchardCommandHandler.cs | 240 +- src/Orchard/Commands/ICommandHandler.cs | 10 +- src/Orchard/Commands/ICommandManager.cs | 14 +- .../OrchardCommandHostRetryException.cs | 38 +- .../Commands/OrchardSwitchAttribute.cs | 14 +- .../Commands/OrchardSwitchesAttribute.cs | 40 +- .../ContentManagement/Aspects/IAliasAspect.cs | 10 +- .../ContentManagement/Aspects/ICommonPart.cs | 34 +- .../Aspects/ILocalizableAspect.cs | 10 +- .../Aspects/IPublishingControlAspect.cs | 14 +- .../Aspects/IRoutableAspect.cs | 10 +- .../ContentManagement/Aspects/ITitleAspect.cs | 10 +- .../ContentManagement/ContentExtensions.cs | 476 +- src/Orchard/ContentManagement/ContentField.cs | 28 +- .../ContentManagement/ContentIdentity.cs | 362 +- src/Orchard/ContentManagement/ContentItem.cs | 128 +- .../ContentManagement/ContentItemMetadata.cs | 52 +- .../ContentManagement/ContentModule.cs | 18 +- src/Orchard/ContentManagement/ContentPart.cs | 262 +- .../DataMigrations/FrameworkDataMigration.cs | 134 +- .../DefaultContentDisplay.cs | 322 +- .../DefaultContentManager.cs | 1746 +- .../DefaultContentManagerSession.cs | 76 +- .../ContentManagement/DefaultContentQuery.cs | 800 +- .../ContentManagement/DefaultHqlQuery.cs | 1288 +- .../Drivers/CombinedResult.cs | 108 +- .../Drivers/ContentFieldDriver.cs | 438 +- .../Drivers/ContentItemTemplateResult.cs | 78 +- .../Drivers/ContentLocation.cs | 10 +- .../Drivers/ContentPartDriver.cs | 508 +- .../Drivers/ContentShapeResult.cs | 256 +- .../Drivers/ContentTemplateResult.cs | 122 +- .../ContentFieldDriverCoordinator.cs | 214 +- .../ContentPartDriverCoordinator.cs | 184 +- .../ContentManagement/Drivers/DriverResult.cs | 22 +- .../Drivers/IContentFieldDriver.cs | 34 +- .../Drivers/IContentPartDriver.cs | 32 +- .../FieldStorageProviderSelector.cs | 60 +- .../FieldStorage/IFieldStorage.cs | 26 +- .../FieldStorage/IFieldStorageEvents.cs | 116 +- .../FieldStorage/IFieldStorageProvider.cs | 20 +- .../IFieldStorageProviderSelector.cs | 12 +- .../FieldStorage/InfosetStorage/Infoset.cs | 52 +- .../InfosetStorage/InfosetHandler.cs | 66 +- .../InfosetStorage/InfosetPart.cs | 192 +- .../InfosetStorage/InfosetStorageProvider.cs | 116 +- .../FieldStorage/SimpleFieldStorage.cs | 96 +- src/Orchard/ContentManagement/GroupInfo.cs | 36 +- .../Handlers/ActivatedContentContext.cs | 10 +- .../Handlers/ActivatingContentContext.cs | 18 +- .../Handlers/ActivatingFilter.cs | 48 +- .../Handlers/BuildDisplayContext.cs | 52 +- .../Handlers/BuildEditorContext.cs | 16 +- .../Handlers/BuildShapeContext.cs | 54 +- .../Handlers/ContentContextBase.cs | 40 +- .../Handlers/ContentHandler.cs | 1020 +- .../Handlers/ContentHandlerBase.cs | 72 +- .../Handlers/ContentItemBuilder.cs | 132 +- .../Handlers/ContentItemTemplates.cs | 100 +- .../Handlers/CreateContentContext.cs | 22 +- .../Handlers/DescribeMembersContext.cs | 102 +- .../Handlers/ExportContentContext.cs | 50 +- .../Handlers/GetContentItemMetadataContext.cs | 16 +- .../Handlers/IContentActivatingFilter.cs | 10 +- .../Handlers/IContentFilter.cs | 8 +- .../Handlers/IContentHandler.cs | 74 +- .../Handlers/IContentStorageFilter.cs | 62 +- .../Handlers/IContentTemplateFilter.cs | 16 +- .../Handlers/ImportContentContext.cs | 142 +- .../Handlers/IndexContentContext.cs | 24 +- .../Handlers/InitializingContentContext.cs | 10 +- .../Handlers/LoadContentContext.cs | 20 +- .../Handlers/PublishContentContext.cs | 28 +- .../Handlers/RemoveContentContext.cs | 10 +- .../Handlers/StorageFilter.cs | 130 +- .../Handlers/StorageFilterBase.cs | 336 +- .../Handlers/StorageVersionFilter.cs | 92 +- .../Handlers/TemplateFilterBase.cs | 56 +- .../Handlers/TemplateFilterForPart.cs | 110 +- .../Handlers/TemplateFilterForRecord.cs | 108 +- .../Handlers/UpdateContentContext.cs | 20 +- .../Handlers/UpdateEditorContext.cs | 36 +- .../Handlers/VersionContentContext.cs | 28 +- src/Orchard/ContentManagement/IContent.cs | 20 +- .../ContentManagement/IContentManager.cs | 394 +- .../IContentManagerSession.cs | 20 +- .../ContentManagement/IContentQuery.cs | 82 +- .../ContentManagement/IHqlCriterion.cs | 602 +- .../ContentManagement/IHqlExpression.cs | 78 +- src/Orchard/ContentManagement/IHqlQuery.cs | 384 +- .../IIdentityResolverSelector.cs | 26 +- src/Orchard/ContentManagement/IUpdateModel.cs | 14 +- .../ContentManagement/ImportContentSession.cs | 292 +- .../Builders/ContentPartDefinitionBuilder.cs | 330 +- .../ContentPartFieldDefinitionBuilder.cs | 68 +- .../Builders/ContentTypeDefinitionBuilder.cs | 198 +- .../ContentTypePartDefinitionBuilder.cs | 48 +- .../MetaData/ContentFieldInfo.cs | 20 +- .../MetaData/ContentPartInfo.cs | 18 +- .../IContentDefinitionEditorEvents.cs | 176 +- .../MetaData/IContentDefinitionManager.cs | 74 +- .../MetaData/IContentDefinitionReader.cs | 34 +- .../MetaData/IContentDefinitionWriter.cs | 18 +- .../MetaData/Models/ContentFieldDefinition.cs | 18 +- .../MetaData/Models/ContentPartDefinition.cs | 46 +- .../Models/ContentPartFieldDefinition.cs | 60 +- .../MetaData/Models/ContentTypeDefinition.cs | 58 +- .../Models/ContentTypePartDefinition.cs | 32 +- .../MetaData/Models/SettingsDictionary.cs | 64 +- .../Services/ContentDefinitionReader.cs | 226 +- .../Services/ContentDefinitionWriter.cs | 154 +- .../MetaData/Services/ISettingsFormatter.cs | 46 +- .../MetaData/Services/SettingsFormatter.cs | 86 +- src/Orchard/ContentManagement/QueryHints.cs | 402 +- .../Records/ContentItemAlteration.cs | 482 +- .../Records/ContentItemRecord.cs | 44 +- .../Records/ContentItemVersionRecord.cs | 42 +- .../Records/ContentPartAlteration.cs | 108 +- .../Records/ContentPartRecord.cs | 18 +- .../Records/ContentPartVersionRecord.cs | 8 +- .../Records/ContentTypeRecord.cs | 14 +- .../ContentManagement/Records/Utility.cs | 26 +- .../Utilities/ComputedField.cs | 58 +- .../ContentManagement/Utilities/LazyField.cs | 80 +- .../ViewModels/TemplateViewModel.cs | 40 +- .../Data/AbstractSessionInterceptor.cs | 464 +- src/Orchard/Data/Bags/SArray.cs | 154 +- src/Orchard/Data/Bags/SConvert.cs | 250 +- src/Orchard/Data/Bags/SItem.cs | 12 +- src/Orchard/Data/Bags/SObject.cs | 226 +- src/Orchard/Data/Bags/SValue.cs | 62 +- .../Data/Bags/Serialization/IBagSerializer.cs | 14 +- .../Serialization/XmlSettingsSerializer.cs | 210 +- src/Orchard/Data/Bags/StateValueProvider.cs | 36 +- .../Data/Conventions/AggregateAttribute.cs | 70 +- .../AttributeCollectionConvention.cs | 44 +- .../Data/Conventions/CacheConventions.cs | 114 +- .../CascadeAllDeleteOrphanAttribute.cs | 32 +- .../Conventions/RecordTableNameConvention.cs | 44 +- .../Conventions/StringLengthConvention.cs | 34 +- src/Orchard/Data/DataModule.cs | 40 +- .../Data/DefaultDatabaseCacheConfiguration.cs | 16 +- src/Orchard/Data/FetchRequest.cs | 136 +- .../Data/IDatabaseCacheConfiguration.cs | 12 +- src/Orchard/Data/IRepository.cs | 46 +- .../Data/ISessionConfigurationCache.cs | 14 +- .../Data/ISessionConfigurationEvents.cs | 98 +- src/Orchard/Data/ISessionInterceptor.cs | 16 +- src/Orchard/Data/ISessionLocator.cs | 18 +- .../Data/Migration/AutomaticDataMigrations.cs | 116 +- src/Orchard/Data/Migration/DataMigration.cs | 26 +- .../Migration/DataMigrationCoordinator.cs | 108 +- .../Data/Migration/DataMigrationManager.cs | 532 +- .../DataMigrationNotificationProvider.cs | 54 +- .../Generator/ISchemaCommandGenerator.cs | 46 +- .../Generator/SchemaCommandGenerator.cs | 308 +- src/Orchard/Data/Migration/IDataMigration.cs | 14 +- .../Data/Migration/IDataMigrationManager.cs | 60 +- .../AbstractDataMigrationInterpreter.cs | 82 +- .../DefaultDataMigrationInterpreter.cs | 792 +- .../Interpreters/ICommandInterpreter.cs | 30 +- .../Interpreters/IDataMigrationInterpreter.cs | 28 +- .../Interpreters/MySqlCommandInterpreter.cs | 168 +- .../Interpreters/SQLiteCommandInterpreter.cs | 80 +- .../Interpreters/SqlCeCommandInterpreter.cs | 72 +- .../Interpreters/StringCommandInterpreter.cs | 72 +- .../Migration/Records/DataMigrationRecord.cs | 12 +- .../Data/Migration/Schema/AddColumnCommand.cs | 12 +- .../Data/Migration/Schema/AddIndexCommand.cs | 26 +- .../Migration/Schema/AlterColumnCommand.cs | 72 +- .../Migration/Schema/AlterTableCommand.cs | 102 +- .../Data/Migration/Schema/ColumnCommand.cs | 88 +- .../Migration/Schema/CreateColumnCommand.cs | 162 +- .../Schema/CreateForeignKeyCommand.cs | 38 +- .../Migration/Schema/CreateTableCommand.cs | 90 +- .../Migration/Schema/DropColumnCommand.cs | 16 +- .../Migration/Schema/DropForeignKeyCommand.cs | 20 +- .../Data/Migration/Schema/DropIndexCommand.cs | 20 +- .../Data/Migration/Schema/DropTableCommand.cs | 14 +- .../Migration/Schema/ISchemaBuilderCommand.cs | 8 +- .../Data/Migration/Schema/SchemaBuilder.cs | 234 +- .../Data/Migration/Schema/SchemaCommand.cs | 62 +- .../Data/Migration/Schema/SchemaUtils.cs | 68 +- .../Migration/Schema/SqlStatementCommand.cs | 40 +- .../Data/Migration/Schema/TableCommand.cs | 20 +- src/Orchard/Data/Orderable.cs | 128 +- .../Providers/AbstractDataServicesProvider.cs | 334 +- .../Data/Providers/DataServiceParameters.cs | 12 +- .../Providers/DataServicesProviderFactory.cs | 70 +- .../Data/Providers/IDataServicesProvider.cs | 18 +- .../Providers/IDataServicesProviderFactory.cs | 12 +- .../Data/Providers/ISqlStatementProvider.cs | 12 +- .../Providers/MySqlDataServicesProvider.cs | 62 +- .../Data/Providers/MySqlStatementProvider.cs | 32 +- .../Providers/SessionFactoryParameters.cs | 28 +- .../Providers/SqlCeDataServicesProvider.cs | 298 +- .../Data/Providers/SqlCeStatementProvider.cs | 32 +- .../SqlServerDataServicesProvider.cs | 86 +- .../Providers/SqlServerStatementProvider.cs | 32 +- src/Orchard/Data/Repository.cs | 320 +- src/Orchard/Data/SessionConfigurationCache.cs | 366 +- src/Orchard/Data/SessionFactoryHolder.cs | 288 +- src/Orchard/Data/SessionLocator.cs | 500 +- src/Orchard/Data/TransactionManager.cs | 54 +- src/Orchard/DisplayManagement/Arguments.cs | 326 +- .../Descriptors/DefaultShapeTableManager.cs | 270 +- .../Descriptors/Interfaces.cs | 38 +- .../Descriptors/PlacementInfo.cs | 150 +- .../StylesheetBindingStrategy.cs | 244 +- .../Descriptors/ShapeAlteration.cs | 44 +- .../Descriptors/ShapeAlterationBuilder.cs | 244 +- .../ShapeAttributeBindingModule.cs | 66 +- .../ShapeAttributeBindingStrategy.cs | 268 +- .../ShapeAttributeOccurrence.cs | 42 +- .../Descriptors/ShapeDescriptor.cs | 120 +- .../ShapePlacementStrategy/PlacementFile.cs | 36 +- .../PlacementFileParser.cs | 188 +- .../ShapePlacementParsingStrategy.cs | 388 +- .../Descriptors/ShapeTable.cs | 14 +- .../Descriptors/ShapeTableBuilder.cs | 46 +- .../Descriptors/ShapeTableLocator.cs | 60 +- .../IShapeTemplateHarvester.cs | 146 +- .../ShapeTemplateBindingStrategy.cs | 396 +- .../IDisplayHelperFactory.cs | 18 +- .../DisplayManagement/INamedEnumerable.cs | 16 +- src/Orchard/DisplayManagement/IShape.cs | 22 +- .../DisplayManagement/IShapeFactory.cs | 28 +- .../Implementation/DefaultDisplayManager.cs | 462 +- .../Implementation/DefaultShapeFactory.cs | 244 +- .../Implementation/DisplayContext.cs | 20 +- .../Implementation/DisplayHelper.cs | 186 +- .../Implementation/DisplayHelperFactory.cs | 40 +- .../Implementation/IDisplayManager.cs | 24 +- .../Implementation/IShapeDisplayEvents.cs | 52 +- .../Implementation/IShapeFactoryEvents.cs | 58 +- .../DisplayManagement/ShapeAttribute.cs | 18 +- .../DisplayManagement/Shapes/Composite.cs | 962 +- .../Shapes/ITagBuilderFactory.cs | 62 +- src/Orchard/DisplayManagement/Shapes/Shape.cs | 412 +- .../Shapes/ShapeDebugView.cs | 106 +- .../DisplayManagement/Shapes/ShapeMetadata.cs | 84 +- .../ConfigurationSettingsReaderConstants.cs | 8 +- .../DynamicProxy2/ConstructorFinderWrapper.cs | 48 +- .../DynamicProxy2/DynamicProxyContext.cs | 192 +- .../DynamicProxy2/DynamicProxyExtensions.cs | 70 +- .../AutofacUtil/LifetimeScopeContainer.cs | 128 +- .../Environment/CollectionOrderModule.cs | 46 +- .../Configuration/IShellSettingsManager.cs | 32 +- .../IShellSettingsManagerEventHandler.cs | 12 +- .../Configuration/ShellSettings.cs | 352 +- .../Configuration/ShellSettingsManager.cs | 116 +- .../Configuration/ShellSettingsSerializer.cs | 180 +- .../Environment/Configuration/TenantState.cs | 16 +- .../Environment/DefaultHostContainer.cs | 144 +- .../Environment/DefaultHostEnvironment.cs | 170 +- src/Orchard/Environment/DefaultOrchardHost.cs | 752 +- .../Environment/DefaultOrchardShell.cs | 230 +- .../Descriptor/IShellDescriptorManager.cs | 66 +- .../Descriptor/Models/ShellDescriptor.cs | 66 +- .../Descriptor/ShellDescriptorCache.cs | 294 +- .../CSharpExtensionBuildProviderShim.cs | 68 +- .../Compilers/CompileExtensionContext.cs | 10 +- .../Compilers/DefaultExtensionCompiler.cs | 280 +- .../Compilers/DefaultProjectFileParser.cs | 234 +- .../Compilers/IExtensionCompiler.cs | 10 +- .../Compilers/IProjectFileParser.cs | 14 +- .../Compilers/ProjectFileDescriptor.cs | 38 +- .../DefaultCriticalErrorProvider.cs | 66 +- .../Environment/Extensions/ExtensionEntry.cs | 22 +- .../Extensions/ExtensionLoaderCoordinator.cs | 738 +- .../Extensions/ExtensionLoadingContext.cs | 130 +- .../Extensions/ExtensionManager.cs | 344 +- .../ExtensionMonitoringCoordinator.cs | 120 +- .../Extensions/Folders/CoreModuleFolders.cs | 34 +- .../Extensions/Folders/ExtensionHarvester.cs | 722 +- .../Extensions/Folders/IExtensionFolders.cs | 14 +- .../Extensions/Folders/IExtensionHarvester.cs | 14 +- .../Extensions/Folders/ModuleFolders.cs | 34 +- .../Extensions/Folders/ThemeFolders.cs | 34 +- .../Extensions/Helpers/PathHelpers.cs | 22 +- .../Extensions/ICriticalErrorProvider.cs | 38 +- .../Extensions/IExtensionLoaderCoordinator.cs | 8 +- .../Extensions/IExtensionManager.cs | 42 +- .../IExtensionMonitoringCoordinator.cs | 14 +- .../Extensions/Loaders/CoreExtensionLoader.cs | 130 +- .../Loaders/DynamicExtensionLoader.cs | 588 +- .../Extensions/Loaders/ExtensionLoaderBase.cs | 120 +- .../Extensions/Loaders/IExtensionLoader.cs | 124 +- .../Loaders/PrecompiledExtensionLoader.cs | 494 +- .../Loaders/RawThemeExtensionLoader.cs | 132 +- .../Loaders/ReferencedExtensionLoader.cs | 172 +- .../Models/DefaultExtensionTypes.cs | 30 +- .../Extensions/Models/ExtensionDescriptor.cs | 70 +- .../Environment/Extensions/Models/Feature.cs | 16 +- .../Extensions/Models/FeatureDescriptor.cs | 36 +- .../Extensions/OrchardFeatureAttribute.cs | 22 +- .../OrchardSuppressDependencyAttribute.cs | 22 +- .../Environment/Features/FeatureManager.cs | 478 +- .../Environment/Features/IFeatureManager.cs | 116 +- .../Environment/HostComponentsConfigModule.cs | 280 +- src/Orchard/Environment/HostEnvironment.cs | 34 +- src/Orchard/Environment/IAssemblyBuilder.cs | 54 +- src/Orchard/Environment/IAssemblyLoader.cs | 172 +- .../Environment/IAssemblyNameResolver.cs | 524 +- src/Orchard/Environment/IBuildManager.cs | 128 +- src/Orchard/Environment/IHostEnvironment.cs | 22 +- src/Orchard/Environment/IHostLocalRestart.cs | 112 +- .../IOrchardFrameworkAssemblies.cs | 28 +- src/Orchard/Environment/IOrchardHost.cs | 72 +- .../Environment/IOrchardHostContainer.cs | 8 +- src/Orchard/Environment/IOrchardShell.cs | 10 +- .../Environment/IOrchardShellEvents.cs | 16 +- .../IShellContainerRegistrations.cs | 32 +- src/Orchard/Environment/IShim.cs | 16 +- src/Orchard/Environment/IWorkContextEvents.cs | 30 +- .../OrchardHostContainerRegistry.cs | 94 +- src/Orchard/Environment/OrchardServices.cs | 74 +- src/Orchard/Environment/OrchardStarter.cs | 380 +- src/Orchard/Environment/RunningShellTable.cs | 380 +- .../ShellBuilders/CompositionStrategy.cs | 364 +- .../ShellBuilders/Models/ShellBlueprint.cs | 82 +- .../ShellBuilders/ShellContainerFactory.cs | 292 +- .../Environment/ShellBuilders/ShellContext.cs | 82 +- .../ShellBuilders/ShellContextFactory.cs | 274 +- .../State/DefaultProcessingEngine.cs | 204 +- .../Environment/State/IProcessingEngine.cs | 62 +- .../Environment/State/IShellStateManager.cs | 16 +- .../State/IShellStateManagerEventHandler.cs | 12 +- .../Environment/State/Models/ShellState.cs | 62 +- .../State/ShellStateCoordinator.cs | 398 +- .../Environment/ViewsBackgroundCompilation.cs | 334 +- .../Environment/Warmup/WarmupUtility.cs | 58 +- .../Environment/WorkContextAccessor.cs | 292 +- .../Environment/WorkContextImplementation.cs | 88 +- src/Orchard/Environment/WorkContextModule.cs | 228 +- .../Environment/WorkContextProperty.cs | 8 +- src/Orchard/Events/DefaultOrchardEventBus.cs | 254 +- src/Orchard/Events/DelegateHelper.cs | 348 +- src/Orchard/Events/EventsInterceptor.cs | 114 +- src/Orchard/Events/EventsModule.cs | 20 +- .../Events/EventsRegistrationSource.cs | 90 +- src/Orchard/Events/IEventBus.cs | 16 +- src/Orchard/Events/IEventHandler.cs | 8 +- .../Exceptions/DefaultExceptionPolicy.cs | 148 +- src/Orchard/Exceptions/ExceptionExtensions.cs | 46 +- .../Filters/UnhandledExceptionFilter.cs | 218 +- src/Orchard/Exceptions/IExceptionPolicy.cs | 16 +- .../FileSystems/AppData/AppDataFolder.cs | 396 +- .../FileSystems/AppData/IAppDataFolder.cs | 128 +- .../FileSystems/AppData/IAppDataFolderRoot.cs | 54 +- .../DefaultAssemblyProbingFolder.cs | 134 +- .../Dependencies/DefaultDependenciesFolder.cs | 300 +- .../DefaultExtensionDependenciesManager.cs | 302 +- .../DynamicModuleVirtualPathProvider.cs | 146 +- .../Dependencies/IAssemblyProbingFolder.cs | 90 +- .../Dependencies/IDependenciesFolder.cs | 54 +- .../IExtensionDependenciesManager.cs | 36 +- .../LockFile/DefaultLockFileManager.cs | 146 +- src/Orchard/FileSystems/LockFile/ILockFile.cs | 16 +- .../FileSystems/LockFile/ILockFileManager.cs | 52 +- src/Orchard/FileSystems/LockFile/LockFile.cs | 108 +- .../Media/ConfigurationMimeTypeProvider.cs | 32 +- .../Media/FileSystemStorageProvider.cs | 954 +- .../FileSystems/Media/IMimeTypeProvider.cs | 10 +- src/Orchard/FileSystems/Media/IStorageFile.cs | 54 +- .../FileSystems/Media/IStorageFolder.cs | 20 +- .../FileSystems/Media/IStorageProvider.cs | 274 +- .../VirtualPath/DefaultVirtualPathMonitor.cs | 272 +- .../VirtualPath/DefaultVirtualPathProvider.cs | 366 +- .../VirtualPath/ICustomVirtualPathProvider.cs | 12 +- .../VirtualPath/IVirtualPathMonitor.cs | 18 +- .../VirtualPath/IVirtualPathProvider.cs | 58 +- .../FileSystems/WebSite/IWebSiteFolder.cs | 40 +- .../FileSystems/WebSite/WebSiteFolder.cs | 210 +- src/Orchard/IDependency.cs | 80 +- src/Orchard/IMapper.cs | 8 +- src/Orchard/IOrchardServices.cs | 64 +- src/Orchard/IWorkContextAccessor.cs | 44 +- src/Orchard/Indexing/DefaultIndexManager.cs | 48 +- src/Orchard/Indexing/IIndexDocument.cs | 70 +- src/Orchard/Indexing/IIndexManager.cs | 12 +- src/Orchard/Indexing/IIndexNotifierHandler.cs | 14 +- src/Orchard/Indexing/IIndexProvider.cs | 142 +- src/Orchard/Indexing/ISearchBits.cs | 16 +- src/Orchard/Indexing/ISearchBuilder.cs | 138 +- src/Orchard/Indexing/ISearchHit.cs | 26 +- src/Orchard/Indexing/MetaDataExtensions.cs | 18 +- src/Orchard/Indexing/NullSearchBuilder.cs | 288 +- src/Orchard/InvokeExtensions.cs | 126 +- .../Localization/Commands/CultureCommands.cs | 134 +- src/Orchard/Localization/IText.cs | 8 +- .../Localization/LocalizationModule.cs | 84 +- .../Localization/LocalizationUtilities.cs | 40 +- src/Orchard/Localization/LocalizedString.cs | 164 +- src/Orchard/Localization/Localizer.cs | 62 +- src/Orchard/Localization/NullLocalizer.cs | 22 +- .../Localization/Records/CultureRecord.cs | 12 +- .../Services/CurrentCultureWorkContext.cs | 74 +- .../Services/DefaultCultureManager.cs | 196 +- .../Services/DefaultLocalizedStringManager.cs | 366 +- .../Localization/Services/ICultureManager.cs | 32 +- .../Localization/Services/ICultureSelector.cs | 24 +- .../Services/ILocalizedStringManager.cs | 10 +- .../Services/SiteCultureSelector.cs | 44 +- src/Orchard/Localization/Text.cs | 126 +- src/Orchard/Logging/CastleLogger.cs | 146 +- src/Orchard/Logging/CastleLoggerFactory.cs | 30 +- src/Orchard/Logging/ILogger.cs | 32 +- src/Orchard/Logging/ILoggerFactory.cs | 12 +- src/Orchard/Logging/LoggingExtensions.cs | 148 +- src/Orchard/Logging/LoggingModule.cs | 160 +- src/Orchard/Logging/NullLogger.cs | 34 +- src/Orchard/Logging/NullLoggerFactory.cs | 16 +- src/Orchard/Logging/OrchardFileAppender.cs | 144 +- src/Orchard/Logging/OrchardLog4netFactory.cs | 62 +- .../Messaging/Events/IMessageEventHandler.cs | 22 +- .../Messaging/Models/MessageContext.cs | 52 +- .../Services/DefaultMessageManager.cs | 210 +- .../Messaging/Services/IMessageManager.cs | 92 +- .../Messaging/Services/IMessagingChannel.cs | 36 +- ...alidateAntiForgeryTokenOrchardAttribute.cs | 32 +- .../LocalizedModelValidatorProvider.cs | 138 +- .../LocalizedRangeAttribute.cs | 48 +- .../LocalizedRequiredAttribute.cs | 48 +- .../LocalizedStringMaxLengthAttribute.cs | 56 +- .../Mvc/Extensions/ControllerExtensions.cs | 54 +- .../ModelStateDictionaryExtensions.cs | 20 +- src/Orchard/Mvc/Extensions/RouteExtension.cs | 58 +- .../Mvc/Extensions/UrlHelperExtensions.cs | 138 +- src/Orchard/Mvc/Filters/FilterProvider.cs | 58 +- src/Orchard/Mvc/FormValueRequiredAttribute.cs | 32 +- .../Mvc/Html/FileRegistrationContext.cs | 186 +- .../Html/FileRegistrationContextExtensions.cs | 36 +- src/Orchard/Mvc/Html/LayoutExtensions.cs | 188 +- .../Mvc/Html/MvcFormAntiForgeryPost.cs | 38 +- .../Mvc/Html/TemplateViewModelExtensions.cs | 70 +- src/Orchard/Mvc/Html/ThemeExtensions.cs | 40 +- src/Orchard/Mvc/HttpContextWorkContext.cs | 38 +- src/Orchard/Mvc/IHasRequestContext.cs | 12 +- src/Orchard/Mvc/IHttpContextAccessor.cs | 16 +- src/Orchard/Mvc/IOrchardViewPage.cs | 62 +- .../Mvc/ModelBinders/IModelBinderProvider.cs | 12 +- .../Mvc/ModelBinders/IModelBinderPublisher.cs | 12 +- .../Mvc/ModelBinders/ModelBinderDescriptor.cs | 16 +- .../Mvc/ModelBinders/ModelBinderPublisher.cs | 36 +- src/Orchard/Mvc/OrchardControllerFactory.cs | 156 +- .../Mvc/Routes/DefaultRouteProvider.cs | 90 +- src/Orchard/Mvc/Routes/IRouteProvider.cs | 22 +- src/Orchard/Mvc/Routes/IRoutePublisher.cs | 16 +- src/Orchard/Mvc/Routes/RouteDescriptor.cs | 32 +- src/Orchard/Mvc/Routes/RoutePublisher.cs | 280 +- src/Orchard/Mvc/Routes/ShellRoute.cs | 386 +- .../Routes/StandardExtensionRouteProvider.cs | 144 +- src/Orchard/Mvc/Routes/UrlPrefix.cs | 112 +- .../Routes/UrlPrefixAdjustedHttpContext.cs | 82 +- src/Orchard/Mvc/ShapeResult.cs | 42 +- src/Orchard/Mvc/Spooling/HtmlStringWriter.cs | 66 +- .../Mvc/ViewEngines/LayoutViewContext.cs | 84 +- .../Razor/IRazorCompilationEvents.cs | 338 +- .../Razor/RazorCompilationEventsShim.cs | 70 +- .../ThemeAwareness/ConfiguredEnginesCache.cs | 66 +- .../ThemeAwareness/LayoutAwareViewEngine.cs | 196 +- .../ThemeAwareViewEngineShim.cs | 94 +- .../ThemeAwareness/ThemeViewLocationCache.cs | 70 +- .../ThemeAwareness/ThemedViewResultFilter.cs | 76 +- .../ViewEngineCollectionWrapper.cs | 84 +- .../Mvc/Wrappers/HttpContextBaseWrapper.cs | 420 +- .../Mvc/Wrappers/HttpRequestBaseWrapper.cs | 572 +- .../Mvc/Wrappers/HttpResponseBaseWrapper.cs | 714 +- src/Orchard/OrchardCoreException.cs | 50 +- src/Orchard/OrchardException.cs | 50 +- src/Orchard/OrchardFatalException.cs | 52 +- src/Orchard/Properties/AssemblyInfo.cs | 78 +- .../Events/IRecipeExecuteEventHandler.cs | 22 +- .../Events/IRecipeSchedulerEventHandler.cs | 14 +- src/Orchard/Recipes/Models/RecipeContext.cs | 12 +- .../Recipes/Services/IRecipeHandler.cs | 14 +- .../Recipes/Services/IRecipeManager.cs | 14 +- .../Recipes/Services/IRecipeScheduler.cs | 10 +- .../Recipes/Services/IRecipeStepExecutor.cs | 10 +- .../Recipes/Services/IRecipeStepQueue.cs | 16 +- .../Security/AlwaysAccessibleAttribute.cs | 20 +- src/Orchard/Security/Authorizer.cs | 180 +- src/Orchard/Security/CreateUserParams.cs | 86 +- .../Security/CurrentUserWorkContext.cs | 34 +- .../Security/IAuthenticationService.cs | 16 +- src/Orchard/Security/IAuthorizationService.cs | 24 +- .../IAuthorizationServiceEventHandler.cs | 48 +- src/Orchard/Security/IEncryptionService.cs | 40 +- src/Orchard/Security/IUser.cs | 22 +- src/Orchard/Security/MembershipSettings.cs | 56 +- .../Security/OrchardSecurityException.cs | 34 +- .../Permissions/IPermissionProvider.cs | 36 +- .../Security/Permissions/Permission.cs | 30 +- .../Providers/DefaultEncryptionService.cs | 186 +- .../Security/Providers/OrchardRoleProvider.cs | 104 +- src/Orchard/Security/StandardPermissions.cs | 144 +- src/Orchard/Services/Clock.cs | 78 +- src/Orchard/Services/DefaultJsonConverter.cs | 52 +- src/Orchard/Services/IClock.cs | 112 +- src/Orchard/Services/IHtmlFilter.cs | 8 +- src/Orchard/Services/IJsonConverter.cs | 84 +- .../Settings/CurrentSiteWorkContext.cs | 38 +- src/Orchard/Settings/ISite.cs | 46 +- src/Orchard/Settings/ISiteService.cs | 10 +- src/Orchard/Settings/ResourceDebugMode.cs | 14 +- src/Orchard/Tasks/IBackgroundTask.cs | 10 +- src/Orchard/Tasks/Indexing/IIndexingTask.cs | 18 +- .../Tasks/Indexing/IIndexingTaskManager.cs | 30 +- .../Scheduling/IPublishingTaskManager.cs | 18 +- .../Tasks/Scheduling/IScheduledTask.cs | 18 +- .../Tasks/Scheduling/IScheduledTaskHandler.cs | 8 +- .../Tasks/Scheduling/IScheduledTaskManager.cs | 26 +- .../Tasks/Scheduling/ScheduledTaskContext.cs | 8 +- src/Orchard/Tasks/SweepGenerator.cs | 156 +- src/Orchard/Themes/CurrentThemeWorkContext.cs | 54 +- src/Orchard/Themes/IThemeManager.cs | 16 +- src/Orchard/Themes/IThemeSelector.cs | 24 +- src/Orchard/Themes/ThemeFilter.cs | 104 +- src/Orchard/Themes/ThemeManager.cs | 70 +- src/Orchard/Themes/ThemedAttribute.cs | 28 +- .../Time/CurrentTimeZoneWorkContext.cs | 70 +- src/Orchard/Time/FallbackTimeZoneSelector.cs | 30 +- src/Orchard/Time/ITimeZoneSelector.cs | 14 +- src/Orchard/Time/SiteTimeZoneSelector.cs | 92 +- src/Orchard/Time/TimeZoneSelectorResult.cs | 16 +- src/Orchard/UI/Admin/AdminAttribute.cs | 12 +- src/Orchard/UI/Admin/AdminFilter.cs | 138 +- src/Orchard/UI/Admin/AdminThemeSelector.cs | 30 +- .../Notification/INotificationManager.cs | 22 +- .../Notification/INotificationProvider.cs | 22 +- .../Admin/Notification/NotificationFilter.cs | 92 +- .../Admin/Notification/NotificationManager.cs | 72 +- src/Orchard/UI/FlatPositionComparer.cs | 122 +- src/Orchard/UI/IPage.cs | 84 +- src/Orchard/UI/Navigation/IMenuProvider.cs | 12 +- .../UI/Navigation/INavigationFilter.cs | 20 +- .../UI/Navigation/INavigationManager.cs | 24 +- .../UI/Navigation/INavigationProvider.cs | 10 +- src/Orchard/UI/Navigation/MenuFilter.cs | 138 +- src/Orchard/UI/Navigation/MenuItem.cs | 102 +- src/Orchard/UI/Navigation/MenuItemComparer.cs | 122 +- .../UI/Navigation/NavigationBuilder.cs | 122 +- src/Orchard/UI/Navigation/NavigationHelper.cs | 468 +- .../UI/Navigation/NavigationItemBuilder.cs | 208 +- src/Orchard/UI/Navigation/Pager.cs | 104 +- src/Orchard/UI/Navigation/PagerParameters.cs | 26 +- src/Orchard/UI/Notify/Notifier.cs | 92 +- src/Orchard/UI/Notify/NotifierExtensions.cs | 62 +- src/Orchard/UI/Notify/NotifyEntry.cs | 26 +- src/Orchard/UI/PageClass/IPageClassBuilder.cs | 8 +- src/Orchard/UI/PageClass/PageClassBuilder.cs | 58 +- src/Orchard/UI/PageTitle/IPageTitleBuilder.cs | 42 +- src/Orchard/UI/PageTitle/PageTitleBuilder.cs | 80 +- src/Orchard/UI/Resources/IResourceManager.cs | 50 +- src/Orchard/UI/Resources/IResourceManifest.cs | 20 +- .../UI/Resources/IResourceManifestProvider.cs | 10 +- src/Orchard/UI/Resources/LinkEntry.cs | 124 +- src/Orchard/UI/Resources/RequireSettings.cs | 284 +- .../UI/Resources/ResourceDefinition.cs | 498 +- src/Orchard/UI/Resources/ResourceFilter.cs | 68 +- src/Orchard/UI/Resources/ResourceLocation.cs | 14 +- src/Orchard/UI/Resources/ResourceManager.cs | 666 +- src/Orchard/UI/Resources/ResourceManifest.cs | 104 +- .../UI/Resources/ResourceManifestBuilder.cs | 48 +- src/Orchard/UI/Resources/ResourceRegister.cs | 174 +- .../UI/Resources/ResourceRequiredContext.cs | 50 +- src/Orchard/UI/Zones/LayoutWorkContext.cs | 40 +- src/Orchard/UI/Zones/ZoneHoldingBehavior.cs | 406 +- .../Utility/DependencyOrderingUtility.cs | 190 +- .../Extensions/HttpRequestExtensions.cs | 228 +- .../ReadOnlyCollectionExtensions.cs | 20 +- .../RouteValueDictionaryExtensions.cs | 140 +- .../VirtualPathProviderExtensions.cs | 64 +- src/Orchard/Utility/Hash.cs | 122 +- src/Orchard/Utility/Position.cs | 120 +- src/Orchard/Utility/Reflect.cs | 370 +- src/Orchard/Utility/ReflectOn.cs | 120 +- src/Orchard/Validation/PathValidation.cs | 70 +- ...chardDependencyInjectionServiceBehavior.cs | 142 +- src/Orchard/Wcf/OrchardInstanceContext.cs | 78 +- src/Orchard/Wcf/OrchardInstanceProvider.cs | 70 +- src/Orchard/Wcf/OrchardServiceHostFactory.cs | 170 +- .../WebApi/AutofacWebApiDependencyResolver.cs | 82 +- .../WebApi/AutofacWebApiDependencyScope.cs | 64 +- ...aultOrchardWebApiHttpControllerSelector.cs | 132 +- .../WebApi/Extensions/RouteExtension.cs | 68 +- .../WebApi/Routes/IHttpRouteProvider.cs | 18 +- .../StandardExtensionHttpRouteProvider.cs | 74 +- src/Orchard/WorkContextExtensions.cs | 174 +- src/Orchard/app.config | 22 +- src/OrchardBasicCorrectness.ruleset | 60 +- src/OrchardSecurity.ruleset | 90 +- src/Shapes.txt | 232 +- .../MSBuild.Orchard.Tasks/FileUpdateLines.cs | 154 +- .../FilterModuleBinaries.cs | 64 +- .../MSBuild.Orchard.Tasks.csproj | 204 +- .../Properties/AssemblyInfo.cs | 68 +- .../ValidateExtensionProjectFiles.cs | 378 +- src/Tools/MSBuild.Orchard.Tasks/XmlDelete.cs | 104 +- .../Orchard.Tests/CommandLineParserTests.cs | 370 +- src/Tools/Orchard.Tests/Orchard.Tests.csproj | 234 +- .../Orchard.Tests/Properties/AssemblyInfo.cs | 68 +- src/Tools/Orchard/Host/CommandHost.cs | 240 +- .../Orchard/HostContext/CommandHostContext.cs | 28 +- .../ICommandHostContextProvider.cs | 10 +- src/Tools/Orchard/IOrchardParametersParser.cs | 12 +- src/Tools/Orchard/Logger.cs | 42 +- src/Tools/Orchard/Orchard.csproj | 250 +- src/Tools/Orchard/OrchardHost.cs | 490 +- src/Tools/Orchard/OrchardParameters.cs | 26 +- src/Tools/Orchard/OrchardParametersParser.cs | 134 +- .../Orchard/Parameters/CommandLineParser.cs | 248 +- .../Orchard/Parameters/CommandParameters.cs | 14 +- .../Parameters/CommandParametersParser.cs | 68 +- src/Tools/Orchard/Parameters/CommandSwitch.cs | 10 +- .../Parameters/ICommandParametersParser.cs | 12 +- src/Tools/Orchard/Program.cs | 26 +- src/Tools/Orchard/Properties/AssemblyInfo.cs | 68 +- .../ResponseFiles/ResponseFileReader.cs | 66 +- .../Orchard/ResponseFiles/ResponseFiles.cs | 28 +- src/Tools/Orchard/app.config | 12 +- src/Zones.txt | 206 +- 3470 files changed, 371153 insertions(+), 371153 deletions(-) diff --git a/CREDITS.txt b/CREDITS.txt index 7f8f2320fe9..e223fdf1c7e 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -1,290 +1,290 @@ -Orchard Project - Copyright .NET Foundation - -Orchard includes works distributed under the licenses listed below. The full text for most of the licenses listed below can be found in the LICENSE.txt file accompanying each work. The original copyright notices have been preserved within the respective files and or packages. Please refer to the specific files and/or packages for more detailed information about the authors, copyright notices, and licenses. - -Antlr ------ -Website: http://www.antlr.org/ -Copyright: Copyright (c) 2003-2008 Terence Parr -License: New BSD - -ASP.NET MVC ------ -Website: http://aspnet.codeplex.com/wikipage?title=MVC&referringTitle=Home -Copyright: Copyright (c) 2008-2011 Microsoft Corporation -License: MICROSOFT ASP.NET MODEL VIEW CONTROLLER 3 EULA - http://go.microsoft.com/fwlink/?LinkID=207621 - -Autofac -------- -Website: http://code.google.com/p/autofac/ -Copyright: Copyright (c) 2007-2008 Autofac Contributors - http://code.google.com/p/autofac/wiki/Contributing -License: MIT - -Autofac Contrib ------ -Website: http://code.google.com/p/autofac/ -Copyright: Copyright (c) 2007-2008 Autofac Contributors -License: http://code.google.com/p/autofac/source/browse/trunk/contrib/AutofacContrib%20License.txt - -Castle ------ -Website: http://www.castleproject.org/container/index.html -Copyright: Copyright (c) 2004-2009 Castle Project -License: Apache Software Foundation License 2.0 - -Clay ----- -Website: http://clay.codeplex.com/ -Copyright: Copyright (c) 2010 Louis Dejardin -License: MS-PL - -CodeMirror ----------- -Website: http://codemirror.net/2/ -Copyright: Copyright (C) 2011 by Marijn Haverbeke -License: MIT - -Console Shim ------ -Website: https://github.com/kayahr/console-shim -Copyright: Copyright (C) 2011 Klaus Reimer -License: MIT - -DLR ---- -Website: http://dlr.codeplex.com -Copyright: Copyright (c) Microsoft Corporation -License: Apache Software Foundation License 2.0 - -DotNetZip ------ -Website: http://dotnetzip.codeplex.com/ -Copyright: -License: MS-PL - -Eric Meyer's Reset CSS ------ -Website: http://meyerweb.com/eric/tools/css/reset/ -Copyright: Copyright (C) 1995-2005 Eric A. and Kathryn S. Meyer -License: Public domain - -Fam Fam Fam Silk Icons ------ -Website: http://famfamfam.com/lab/icons/silk/ -Copyright: Copyright (c) 2005-2006 Mark James -License: CC Attribution 2.5 http://creativecommons.org/licenses/by/2.5/ - -Fluent NHibernate ------ -Website: http://fluentnhibernate.org/ -Copyright: Copyright (c) 2008-2009 James Gregory and contributors -License: New BSD - -FluentPath ------ -Website: http://fluentpath.codeplex.com/ -Copyright: Copyright (c) 2011 Bertrand Le Roy -License: MS-PL - -Font Awesome ------ -Author: Dave Gandy -Website: http://fontawesome.io -License: MIT License - -History.js ------ -Website: https://github.com/browserstate/history.js -Copyright: Copyright (c) 2011, Benjamin Arthur Lupton -Licence: BSD - -Html Agility Pack ------ -Website: http://htmlagilitypack.codeplex.com/ -Copyright: Copyright (c) 2003-20010 Simon Mourier -License: MS-PL - -html5shim ------ -Website: http://code.google.com/p/html5shim/ -License: MIT - -IESI Collections ------ -Website: http://www.codeproject.com/KB/recipes/sets.aspx -Copyright: Copyright (c) 2002-2004 Jason Smith -License: http://www.codeproject.com/info/Licenses.aspx - distributed with NHibernate under LGPL 2.1 - -Image Resizer ------ -Author: Brice Lambson -Website: https://imageresizer.codeplex.com -Copyright: Copyright (c) 2012 Imazen -License: Freedom license - -jQuery ------ -Website: http://jquery.com -Copyright: Copyright (c) 2010 John Resig, http://jquery.com -License: MIT - -jQuery Colorbox ------ -Website: http://www.jacklmoore.com/colorbox/ -Copyright: (c) 2013 Jack Moore - jacklmoore.com/colorbox -License: MIT - -jQuery File Upload ------ -Website: https://blueimp.net -Copyright: Copyright 2010, Sebastian Tschan -License MIT - -jQuery UI (Core, Widget, Datepicker) ------ -Website: http://docs.jquery.com/UI -Copyright: Copyright (c) 2010 lib/jquery.ui/AUTHORS.txt (http://jqueryui.com/about) -License: MIT - -jQuery Calendar ------ -Website: http://keith-wood.name/calendars.html -Author: Keith Wood -License: MIT - -jQuery Date/Time Entry ------ -Website: http://keith-wood.name/datetimeEntry.html -Copyright: Keith Wood -License: MIT - -jQuery ScrollTo ------ -Website: http://flesler.blogspot.com -Copyright: Copyright (c) 2007-2009 Ariel Flesler -License: MIT - -jsPlumb ------ -Website: http://jsplumb.org -Copyright: Copyright (c) 2010 - 2013 Simon Porritt (http://jsplumb.org) -License: MIT - -Knockout ------ -Website: http://knockoutjs.com/ -Copyright: Copyright (c) Steven Sanderson -License: MIT - -Log4Net ------ -Website: http://logging.apache.org/log4net/index.html -Copyright: Copyright (c) 2007 Apache Software Foundation -License: Apache Software Foundation License 2.0 - -Lucene.net ------ -Website: http://incubator.apache.org/projects/lucene.net.html -Copyright: Copyright (c) 2009 Apache Software Foundation -License: Apache Software Foundation License 2.0 - -Mono Class Library ------ -Website: http://www.mono-project.com/The_Class_Library -Copyright: Xamarin -License: MIT - -Moq ------ -Website: http://code.google.com/p/moq/ -Copyright: Copyright (c) 2007. Clarius Consulting, Manas Technology Solutions, InSTEDD -License: New BSD - -MySQL Connectors ------ -Copyright: Copyright (c) 2004, 2011, Oracle and/or its affiliates -License: GNU GENERAL PUBLIC LICENSE Version 2; Oracles Free and Open Source Software ("FOSS") License Exception - -In order to comply with Section 2(a) of the FOSS License Exception, .NET Foundation hereby offers any recipient of this package a machine-readable copy of the corresponding source code for Oracle's MySQL Client Libraries upon written demand. This offer is good for three years. - -NHibernate, NHibernate Linq ------ -Website: http://nhforge.org -Copyright: Copyright (C) 2003 - 2009 NHibernate Project -License: LGPL 2.1 - -NHibernate Lambda Extensions ------ -Website: http://code.google.com/p/nhlambdaextensions/ -Copyright: Unknown http://code.google.com/p/nhlambdaextensions/people/list -License: LGPL 2.1 - -NProgress ------ -Website: http://ricostacruz.com/nprogress/ -Copyright: Copyright (c) 2013-2014 Rico Sta. Cruz -License: MIT - -NuGet ------ -Website: http://nuget.codeplex.com -Copyright: Copyright 2010-2011 Outercurve Foundation -License: Apache Software Foundation License 2.0 - -nUnit ------ -Website: http://www.nunit.org/index.php -Copyright: Copyright (c) 2002-2007 NUnit.org - Portions Copyright (c) 2002-2008 Charlie Poole or Copyright (c) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright (c) 2000-2002 Philip A. Craig -License: Derived from zlib: http://nunit.org/index.php?p=license&r=2.4 - -Microsoft SQL Server Compact 4.0 ------ -Website: http://www.microsoft.com -Copyright: Copyright (c) 2011 Microsoft Corporation -License: Custom EULA - http://www.microsoft.com/web/webpi/eula/SQLCE_EULA_ENU.rtf - -Microsoft Xml Document Transformation 1.0.0.0 ------ -Website: http://www.microsoft.com -Copyright: Copyright Microsoft Corporation -License: Custom EULA - http://www.microsoft.com/web/webpi/eula/microsoft_web_xmltransform.htm - -StackExchange.Redis ------- -Websites: https://github.com/StackExchange/StackExchange.Redis -Copyright: Copyright (c) 2014 Stack Exchange -License: MIT - https://raw.githubusercontent.com/StackExchange/StackExchange.Redis/master/LICENSE - -SlowCheetah ------ -Website: https://github.com/sayedihashimi/package-web/ -Copyright: Copyright 2013 Sayed Ibrahim Hashimi -License: Apache 2.0 - -SpecFlow ------ -Website: http://www.specflow.org/ -Copyright: Copyright (c) 2009 TechTalk -License: New BSD - -TinyMCE ------ -WebSite: http://tinymce.moxiecode.com/ -Copyright: Copyright (c) 2003-2009 Moxiecode Systems AB -License: LGPL 2.1 - -WCat ------ -WebSite: http://www.iis.net/community/default.aspx?tabid=34&i=1466&g=6 -Copyright: Copyright (c) 2007 Microsoft -License: "Free" - -YUI ------ -Website: http://developer.yahoo.com/yui/ -Copyright: Copyright (c) 2010, Yahoo! Inc. +Orchard Project - Copyright .NET Foundation + +Orchard includes works distributed under the licenses listed below. The full text for most of the licenses listed below can be found in the LICENSE.txt file accompanying each work. The original copyright notices have been preserved within the respective files and or packages. Please refer to the specific files and/or packages for more detailed information about the authors, copyright notices, and licenses. + +Antlr +----- +Website: http://www.antlr.org/ +Copyright: Copyright (c) 2003-2008 Terence Parr +License: New BSD + +ASP.NET MVC +----- +Website: http://aspnet.codeplex.com/wikipage?title=MVC&referringTitle=Home +Copyright: Copyright (c) 2008-2011 Microsoft Corporation +License: MICROSOFT ASP.NET MODEL VIEW CONTROLLER 3 EULA + http://go.microsoft.com/fwlink/?LinkID=207621 + +Autofac +------- +Website: http://code.google.com/p/autofac/ +Copyright: Copyright (c) 2007-2008 Autofac Contributors + http://code.google.com/p/autofac/wiki/Contributing +License: MIT + +Autofac Contrib +----- +Website: http://code.google.com/p/autofac/ +Copyright: Copyright (c) 2007-2008 Autofac Contributors +License: http://code.google.com/p/autofac/source/browse/trunk/contrib/AutofacContrib%20License.txt + +Castle +----- +Website: http://www.castleproject.org/container/index.html +Copyright: Copyright (c) 2004-2009 Castle Project +License: Apache Software Foundation License 2.0 + +Clay +---- +Website: http://clay.codeplex.com/ +Copyright: Copyright (c) 2010 Louis Dejardin +License: MS-PL + +CodeMirror +---------- +Website: http://codemirror.net/2/ +Copyright: Copyright (C) 2011 by Marijn Haverbeke +License: MIT + +Console Shim +----- +Website: https://github.com/kayahr/console-shim +Copyright: Copyright (C) 2011 Klaus Reimer +License: MIT + +DLR +--- +Website: http://dlr.codeplex.com +Copyright: Copyright (c) Microsoft Corporation +License: Apache Software Foundation License 2.0 + +DotNetZip +----- +Website: http://dotnetzip.codeplex.com/ +Copyright: +License: MS-PL + +Eric Meyer's Reset CSS +----- +Website: http://meyerweb.com/eric/tools/css/reset/ +Copyright: Copyright (C) 1995-2005 Eric A. and Kathryn S. Meyer +License: Public domain + +Fam Fam Fam Silk Icons +----- +Website: http://famfamfam.com/lab/icons/silk/ +Copyright: Copyright (c) 2005-2006 Mark James +License: CC Attribution 2.5 http://creativecommons.org/licenses/by/2.5/ + +Fluent NHibernate +----- +Website: http://fluentnhibernate.org/ +Copyright: Copyright (c) 2008-2009 James Gregory and contributors +License: New BSD + +FluentPath +----- +Website: http://fluentpath.codeplex.com/ +Copyright: Copyright (c) 2011 Bertrand Le Roy +License: MS-PL + +Font Awesome +----- +Author: Dave Gandy +Website: http://fontawesome.io +License: MIT License + +History.js +----- +Website: https://github.com/browserstate/history.js +Copyright: Copyright (c) 2011, Benjamin Arthur Lupton +Licence: BSD + +Html Agility Pack +----- +Website: http://htmlagilitypack.codeplex.com/ +Copyright: Copyright (c) 2003-20010 Simon Mourier +License: MS-PL + +html5shim +----- +Website: http://code.google.com/p/html5shim/ +License: MIT + +IESI Collections +----- +Website: http://www.codeproject.com/KB/recipes/sets.aspx +Copyright: Copyright (c) 2002-2004 Jason Smith +License: http://www.codeproject.com/info/Licenses.aspx + distributed with NHibernate under LGPL 2.1 + +Image Resizer +----- +Author: Brice Lambson +Website: https://imageresizer.codeplex.com +Copyright: Copyright (c) 2012 Imazen +License: Freedom license + +jQuery +----- +Website: http://jquery.com +Copyright: Copyright (c) 2010 John Resig, http://jquery.com +License: MIT + +jQuery Colorbox +----- +Website: http://www.jacklmoore.com/colorbox/ +Copyright: (c) 2013 Jack Moore - jacklmoore.com/colorbox +License: MIT + +jQuery File Upload +----- +Website: https://blueimp.net +Copyright: Copyright 2010, Sebastian Tschan +License MIT + +jQuery UI (Core, Widget, Datepicker) +----- +Website: http://docs.jquery.com/UI +Copyright: Copyright (c) 2010 lib/jquery.ui/AUTHORS.txt (http://jqueryui.com/about) +License: MIT + +jQuery Calendar +----- +Website: http://keith-wood.name/calendars.html +Author: Keith Wood +License: MIT + +jQuery Date/Time Entry +----- +Website: http://keith-wood.name/datetimeEntry.html +Copyright: Keith Wood +License: MIT + +jQuery ScrollTo +----- +Website: http://flesler.blogspot.com +Copyright: Copyright (c) 2007-2009 Ariel Flesler +License: MIT + +jsPlumb +----- +Website: http://jsplumb.org +Copyright: Copyright (c) 2010 - 2013 Simon Porritt (http://jsplumb.org) +License: MIT + +Knockout +----- +Website: http://knockoutjs.com/ +Copyright: Copyright (c) Steven Sanderson +License: MIT + +Log4Net +----- +Website: http://logging.apache.org/log4net/index.html +Copyright: Copyright (c) 2007 Apache Software Foundation +License: Apache Software Foundation License 2.0 + +Lucene.net +----- +Website: http://incubator.apache.org/projects/lucene.net.html +Copyright: Copyright (c) 2009 Apache Software Foundation +License: Apache Software Foundation License 2.0 + +Mono Class Library +----- +Website: http://www.mono-project.com/The_Class_Library +Copyright: Xamarin +License: MIT + +Moq +----- +Website: http://code.google.com/p/moq/ +Copyright: Copyright (c) 2007. Clarius Consulting, Manas Technology Solutions, InSTEDD +License: New BSD + +MySQL Connectors +----- +Copyright: Copyright (c) 2004, 2011, Oracle and/or its affiliates +License: GNU GENERAL PUBLIC LICENSE Version 2; Oracles Free and Open Source Software ("FOSS") License Exception + +In order to comply with Section 2(a) of the FOSS License Exception, .NET Foundation hereby offers any recipient of this package a machine-readable copy of the corresponding source code for Oracle's MySQL Client Libraries upon written demand. This offer is good for three years. + +NHibernate, NHibernate Linq +----- +Website: http://nhforge.org +Copyright: Copyright (C) 2003 - 2009 NHibernate Project +License: LGPL 2.1 + +NHibernate Lambda Extensions +----- +Website: http://code.google.com/p/nhlambdaextensions/ +Copyright: Unknown http://code.google.com/p/nhlambdaextensions/people/list +License: LGPL 2.1 + +NProgress +----- +Website: http://ricostacruz.com/nprogress/ +Copyright: Copyright (c) 2013-2014 Rico Sta. Cruz +License: MIT + +NuGet +----- +Website: http://nuget.codeplex.com +Copyright: Copyright 2010-2011 Outercurve Foundation +License: Apache Software Foundation License 2.0 + +nUnit +----- +Website: http://www.nunit.org/index.php +Copyright: Copyright (c) 2002-2007 NUnit.org + Portions Copyright (c) 2002-2008 Charlie Poole or Copyright (c) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright (c) 2000-2002 Philip A. Craig +License: Derived from zlib: http://nunit.org/index.php?p=license&r=2.4 + +Microsoft SQL Server Compact 4.0 +----- +Website: http://www.microsoft.com +Copyright: Copyright (c) 2011 Microsoft Corporation +License: Custom EULA - http://www.microsoft.com/web/webpi/eula/SQLCE_EULA_ENU.rtf + +Microsoft Xml Document Transformation 1.0.0.0 +----- +Website: http://www.microsoft.com +Copyright: Copyright Microsoft Corporation +License: Custom EULA - http://www.microsoft.com/web/webpi/eula/microsoft_web_xmltransform.htm + +StackExchange.Redis +------ +Websites: https://github.com/StackExchange/StackExchange.Redis +Copyright: Copyright (c) 2014 Stack Exchange +License: MIT - https://raw.githubusercontent.com/StackExchange/StackExchange.Redis/master/LICENSE + +SlowCheetah +----- +Website: https://github.com/sayedihashimi/package-web/ +Copyright: Copyright 2013 Sayed Ibrahim Hashimi +License: Apache 2.0 + +SpecFlow +----- +Website: http://www.specflow.org/ +Copyright: Copyright (c) 2009 TechTalk +License: New BSD + +TinyMCE +----- +WebSite: http://tinymce.moxiecode.com/ +Copyright: Copyright (c) 2003-2009 Moxiecode Systems AB +License: LGPL 2.1 + +WCat +----- +WebSite: http://www.iis.net/community/default.aspx?tabid=34&i=1466&g=6 +Copyright: Copyright (c) 2007 Microsoft +License: "Free" + +YUI +----- +Website: http://developer.yahoo.com/yui/ +Copyright: Copyright (c) 2010, Yahoo! Inc. License: New BSD \ No newline at end of file diff --git a/ClickToBuild.cmd b/ClickToBuild.cmd index 38d5db736ad..ee56b4376c8 100644 --- a/ClickToBuild.cmd +++ b/ClickToBuild.cmd @@ -1,29 +1,29 @@ -FOR %%b in ( - "%VS120COMNTOOLS%..\..\VC\vcvarsall.bat" - "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" - "%ProgramFiles%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" - - "%VS110COMNTOOLS%..\..\VC\vcvarsall.bat" - "%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" - "%ProgramFiles%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" - ) do ( - if exist %%b ( - call %%b x86 - goto build - ) -) - -echo "Unable to detect suitable environment. Build may not succeed." - -:build - -SET target=%1 -SET project=%2 - -IF "%target%" == "" SET target=Build -IF "%project%" =="" SET project=Orchard.proj - -msbuild /t:%target% %project% - -pause - +FOR %%b in ( + "%VS120COMNTOOLS%..\..\VC\vcvarsall.bat" + "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" + "%ProgramFiles%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" + + "%VS110COMNTOOLS%..\..\VC\vcvarsall.bat" + "%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" + "%ProgramFiles%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" + ) do ( + if exist %%b ( + call %%b x86 + goto build + ) +) + +echo "Unable to detect suitable environment. Build may not succeed." + +:build + +SET target=%1 +SET project=%2 + +IF "%target%" == "" SET target=Build +IF "%project%" =="" SET project=Orchard.proj + +msbuild /t:%target% %project% + +pause + diff --git a/DeleteModuleBinaries.cmd b/DeleteModuleBinaries.cmd index 3934132c5ff..6402abd063f 100644 --- a/DeleteModuleBinaries.cmd +++ b/DeleteModuleBinaries.cmd @@ -1,4 +1,4 @@ -@echo off -REM Delete all compiled module binaries to force dynamic compilation (.csproj) to kick in -set SRC=src\Orchard.Web\Modules -for /f %%i in ('dir %SRC% /b /ad') do del /q %SRC%\%%i\bin\%%i.dll +@echo off +REM Delete all compiled module binaries to force dynamic compilation (.csproj) to kick in +set SRC=src\Orchard.Web\Modules +for /f %%i in ('dir %SRC% /b /ad') do del /q %SRC%\%%i\bin\%%i.dll diff --git a/LICENSE.txt b/LICENSE.txt index 2558204bc2c..b373e558378 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,10 +1,10 @@ -Copyright (c) 2009 Outercurve Foundation -Copyright (c) 2014 .NET Foundation -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -Neither the name of .NET Foundation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. +Copyright (c) 2009 Outercurve Foundation +Copyright (c) 2014 .NET Foundation +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +Neither the name of .NET Foundation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/Orchard.proj b/Orchard.proj index ac1c1621f33..b1561cb20c5 100644 --- a/Orchard.proj +++ b/Orchard.proj @@ -1,458 +1,458 @@ - - - - - - - $(MSBuildProjectDirectory)\lib - $(MSBuildProjectDirectory)\src - $(MSBuildProjectDirectory)\build - $(MSBuildProjectDirectory)\buildtasks - $(MSBuildProjectDirectory)\artifacts - $(MSBuildProjectDirectory)\lib\sqlce - $(ArtifactsFolder)\Source - $(ArtifactsFolder)\MsDeploy - $(ArtifactsFolder)\Gallery - $(MSBuildProjectDirectory)\src\Orchard.Web\Modules - $(MSBuildProjectDirectory)\src\Orchard.Web\Core - $(MSBuildProjectDirectory)\src\Orchard.Web\Themes - - $(BuildFolder)\Compile - $(CompileFolder)\_PublishedWebsites - $(BuildFolder)\Stage - $(BuildFolder)\MsDeploy - $(BuildFolder)\Precompiled - $(BuildFolder)\Profiling - $(BuildFolder)\Gallery - - x64 - x86 - Release - - - $(BUILD_NUMBER) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %(Stage-Modules-Names.Identity) - - - %(Stage-Modules-Names.Identity) - - - - %(Stage-Themes-Names.Identity) - - - %(Stage-Themes-Names.Identity) - - - - %(Stage-Themes-Names.Identity) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .$(Version) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + $(MSBuildProjectDirectory)\lib + $(MSBuildProjectDirectory)\src + $(MSBuildProjectDirectory)\build + $(MSBuildProjectDirectory)\buildtasks + $(MSBuildProjectDirectory)\artifacts + $(MSBuildProjectDirectory)\lib\sqlce + $(ArtifactsFolder)\Source + $(ArtifactsFolder)\MsDeploy + $(ArtifactsFolder)\Gallery + $(MSBuildProjectDirectory)\src\Orchard.Web\Modules + $(MSBuildProjectDirectory)\src\Orchard.Web\Core + $(MSBuildProjectDirectory)\src\Orchard.Web\Themes + + $(BuildFolder)\Compile + $(CompileFolder)\_PublishedWebsites + $(BuildFolder)\Stage + $(BuildFolder)\MsDeploy + $(BuildFolder)\Precompiled + $(BuildFolder)\Profiling + $(BuildFolder)\Gallery + + x64 + x86 + Release + + + $(BUILD_NUMBER) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %(Stage-Modules-Names.Identity) + + + %(Stage-Modules-Names.Identity) + + + + %(Stage-Themes-Names.Identity) + + + %(Stage-Themes-Names.Identity) + + + + %(Stage-Themes-Names.Identity) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + .$(Version) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build.cmd b/build.cmd index f2a1903ac1c..30756685862 100644 --- a/build.cmd +++ b/build.cmd @@ -1 +1 @@ -clicktobuild %* +clicktobuild %* diff --git a/lib/aspnetmvc/System.Web.Helpers.xml b/lib/aspnetmvc/System.Web.Helpers.xml index 04f6a69eace..d5cfa6debc4 100644 --- a/lib/aspnetmvc/System.Web.Helpers.xml +++ b/lib/aspnetmvc/System.Web.Helpers.xml @@ -1,839 +1,839 @@ - - - - System.Web.Helpers - - - - Displays data in the form of a graphical chart. - - - Initializes a new instance of the class. - The width, in pixels, of the complete chart image. - The height, in pixels, of the complete chart image. - (Optional) The template (theme) to apply to the chart. - (Optional) The template (theme) path and file name to apply to the chart. - - - Adds a legend to the chart. - The chart. - The text of the legend title. - The unique name of the legend. - - - Provides data points and series attributes for the chart. - The chart. - The unique name of the series. - The chart type of a series. - The name of the chart area that is used to plot the data series. - The axis label text for the series. - The name of the series that is associated with the legend. - The granularity of data point markers. - The values to plot along the x-axis. - The name of the field for x-values. - The values to plot along the y-axis. - A comma-separated list of name or names of the field or fields for y-values. - - - Adds a title to the chart. - The chart. - The title text. - The unique name of the title. - - - Binds a chart to a data table, where one series is created for each unique value in a column. - The chart. - The chart data source. - The name of the column that is used to group data into the series. - The name of the column for x-values. - A comma-separated list of names of the columns for y-values. - Other data point properties that can be bound. - The order in which the series will be sorted. The default is "Ascending". - - - Creates and binds series data to the specified data table, and optionally populates multiple x-values. - The chart. - The chart data source. This can be can be any object. - The name of the table column used for the series x-values. - - - Gets or sets the name of the file that contains the chart image. - The name of the file. - - - Returns a chart image as a byte array. - The chart. - The image format. The default is "jpeg". - - - Retrieves the specified chart from the cache. - The chart. - The ID of the cache item that contains the chart to retrieve. The key is set when you call the method. - - - Gets or sets the height, in pixels, of the chart image. - The chart height. - - - Saves a chart image to the specified file. - The chart. - The location and name of the image file. - The image file format, such as "png" or "jpeg". - - - Saves a chart in the system cache. - The ID of the cache item that contains the chart. - The ID of the chart in the cache. - The number of minutes to keep the chart image in the cache. The default is 20. - true to indicate that the chart cache item's expiration is reset each time the item is accessed, or false to indicate that the expiration is based on an absolute interval since the time that the item was added to the cache. The default is true. - - - Saves a chart as an XML file. - The chart. - The path and name of the XML file. - - - Sets values for the horizontal axis. - The chart. - The title of the x-axis. - The minimum value for the x-axis. - The maximum value for the x-axis. - - - Sets values for the vertical axis. - The chart. - The title of the y-axis. - The minimum value for the y-axis. - The maximum value for the y-axis. - - - Creates a object based on the current object. - The chart. - The format of the image to save the object as. The default is "jpeg". The parameter is not case sensitive. - - - Gets or set the width, in pixels, of the chart image. - The chart width. - - - Renders the output of the object as an image. - The chart. - The format of the image. The default is "jpeg". - - - Renders the output of a object that has been cached as an image. - The chart. - The ID of the chart in the cache. - The format of the image. The default is "jpeg". - - - Specifies visual themes for a object. - - - A theme for 2D charting that features a visual container with a blue gradient, rounded edges, drop-shadowing, and high-contrast gridlines. - - - A theme for 2D charting that features a visual container with a green gradient, rounded edges, drop-shadowing, and low-contrast gridlines. - - - A theme for 2D charting that features no visual container and no gridlines. - - - A theme for 3D charting that features no visual container, limited labeling and, sparse, high-contrast gridlines. - - - A theme for 2D charting that features a visual container that has a yellow gradient, rounded edges, drop-shadowing, and high-contrast gridlines. - - - Provides methods to generate hash values and encrypt passwords or other sensitive data. - - - Generates a cryptographically strong sequence of random byte values. - The generated salt value as a base-64-encoded string. - The number of cryptographically random bytes to generate. - - - Returns a hash value for the specified byte array. - The hash value for as a string of hexadecimal characters. - The data to provide a hash value for. - The algorithm that is used to generate the hash value. The default is "sha256". - - is null. - - - Returns a hash value for the specified string. - The hash value for as a string of hexadecimal characters. - The data to provide a hash value for. - The algorithm that is used to generate the hash value. The default is "sha256". - - is null. - - - Returns an RFC 2898 hash value for the specified password. - The hash value for as a base-64-encoded string. - The password to generate a hash value for. - - is null. - - - Returns a SHA-1 hash value for the specified string. - The SHA-1 hash value for as a string of hexadecimal characters. - The data to provide a hash value for. - - is null. - - - Returns a SHA-256 hash value for the specified string. - The SHA-256 hash value for as a string of hexadecimal characters. - The data to provide a hash value for. - - is null. - - - Determines whether the specified RFC 2898 hash and password are a cryptographic match. - true if the hash value is a cryptographic match for the password; otherwise, false. - The previously-computed RFC 2898 hash value as a base-64-encoded string. - The plaintext password to cryptographically compare with . - - or is null. - - - Represents a series of values as a JavaScript-like array by using the dynamic capabilities of the Dynamic Language Runtime (DLR). - - - Initializes a new instance of the class using the specified array element values. - An array of objects that contains the values to add to the instance. - - - Returns an enumerator that can be used to iterate through the elements of the instance. - An enumerator that can be used to iterate through the elements of the JSON array. - - - Returns the value at the specified index in the instance. - The value at the specified index. - - - Returns the number of elements in the instance. - The number of elements in the JSON array. - - - Converts a instance to an array of objects. - The array of objects that represents the JSON array. - The JSON array to convert. - - - Converts a instance to an array of objects. - The array of objects that represents the JSON array. - The JSON array to convert. - - - Returns an enumerator that can be used to iterate through a collection. - An enumerator that can be used to iterate through the collection. - - - Converts the instance to a compatible type. - true if the conversion was successful; otherwise, false. - Provides information about the conversion operation. - When this method returns, contains the result of the type conversion operation. This parameter is passed uninitialized. - - - Tests the instance for dynamic members (which are not supported) in a way that does not cause an exception to be thrown. - true in all cases. - Provides information about the get operation. - When this method returns, contains null. This parameter is passed uninitialized. - - - Represents a collection of values as a JavaScript-like object by using the capabilities of the Dynamic Language Runtime. - - - Initializes a new instance of the class using the specified field values. - A dictionary of property names and values to add to the instance as dynamic members. - - - Returns a list that contains the name of all dynamic members (JSON fields) of the instance. - A list that contains the name of every dynamic member (JSON field). - - - Converts the instance to a compatible type. - true in all cases. - Provides information about the conversion operation. - When this method returns, contains the result of the type conversion operation. This parameter is passed uninitialized. - The instance could not be converted to the specified type. - - - Gets the value of a field using the specified index. - true in all cases. - Provides information about the indexed get operation. - An array that contains a single object that indexes the field by name. The object must be convertible to a string that specifies the name of the JSON field to return. If multiple indexes are specified, contains null when this method returns. - When this method returns, contains the value of the indexed field, or null if the get operation was unsuccessful. This parameter is passed uninitialized. - - - Gets the value of a field using the specified name. - true in all cases. - Provides information about the get operation. - When this method returns, contains the value of the field, or null if the get operation was unsuccessful. This parameter is passed uninitialized. - - - Sets the value of a field using the specified index. - true in all cases. - Provides information about the indexed set operation. - An array that contains a single object that indexes the field by name. The object must be convertible to a string that specifies the name of the JSON field to return. If multiple indexes are specified, no field is changed or added. - The value to set the field to. - - - Sets the value of a field using the specified name. - true in all cases. - Provides information about the set operation. - The value to set the field to. - - - Provides methods for working with data in JavaScript Object Notation (JSON) format. - - - Converts data in JavaScript Object Notation (JSON) format into the specified strongly typed data list. - The JSON-encoded data converted to a strongly typed list. - The JSON-encoded string to convert. - The type of the strongly typed list to convert JSON data into. - - - Converts data in JavaScript Object Notation (JSON) format into a data object. - The JSON-encoded data converted to a data object. - The JSON-encoded string to convert. - - - Converts data in JavaScript Object Notation (JSON) format into a data object of a specified type. - The JSON-encoded data converted to the specified type. - The JSON-encoded string to convert. - The type that the data should be converted to. - - - Converts a data object to a string that is in the JavaScript Object Notation (JSON) format. - Returns a string of data converted to the JSON format. - The data object to convert. - - - Converts a data object to a string in JavaScript Object Notation (JSON) format and adds the string to the specified object. - The data object to convert. - The object that contains the converted JSON data. - - - Renders the property names and values of the specified object and of any subobjects that it references. - - - Renders the property names and values of the specified object and of any subobjects. - For a simple variable, returns the type and the value. For an object that contains multiple items, returns the property name or key and the value for each property. - The object to render information for. - Optional. Specifies the depth of nested subobjects to render information for. The default is 10. - Optional. Specifies the maximum number of characters that the method displays for object values. The default is 1000. - - is less than zero. - - is less than or equal to zero. - - - Displays information about the web server environment that hosts the current web page. - - - Displays information about the web server environment. - A string of name-value pairs that contains information about the web server. - - - Specifies the direction in which to sort a list of items. - - - Sort from smallest to largest —for example, from 1 to 10. - - - Sort from largest to smallest — for example, from 10 to 1. - - - Provides a cache to store frequently accessed data. - - - Retrieves the specified item from the object. - The item retrieved from the cache, or null if the item is not found. - The identifier for the cache item to retrieve. - - - Removes the specified item from the object. - The item removed from the object. If the item is not found, returns null. - The identifier for the cache item to remove. - - - Inserts an item into the object. - The identifier for the cache item. - The data to insert into the cache. - Optional. The number of minutes to keep an item in the cache. The default is 20. - Optional. true to indicate that the cache item expiration is reset each time the item is accessed, or false to indicate that the expiration is based the absolute time since the item was added to the cache. The default is true. In that case, if you also use the default value for the parameter, a cached item expires 20 minutes after it was last accessed. - The value of is less than or equal to zero. - Sliding expiration is enabled and the value of is greater than a year. - - - Displays data on a web page using an HTML table element. - - - Initializes a new instance of the class. - The data to display. - A collection that contains the names of the data columns to display. By default, this value is auto-populated according to the values in the parameter. - The name of the data column that is used to sort the grid by default. - The number of rows that are displayed on each page of the grid when paging is enabled. The default is 10. - true to specify that paging is enabled for the instance; otherwise false. The default is true. - true to specify that sorting is enabled for the instance; otherwise, false. The default is true. - The value of the HTML id attribute that is used to mark the HTML element that gets dynamic Ajax updates that are associated with the instance. - The name of the JavaScript function that is called after the HTML element specified by the property has been updated. If the name of a function is not provided, no function will be called. If the specified function does not exist, a JavaScript error will occur if it is invoked. - The prefix that is applied to all query-string fields that are associated with the instance. This value is used in order to support multiple instances on the same web page. - The name of the query-string field that is used to specify the current page of the instance. - The name of the query-string field that is used to specify the currently selected row of the instance. - The name of the query-string field that is used to specify the name of the data column that the instance is sorted by. - The name of the query-string field that is used to specify the direction in which the instance is sorted. - - - Adds a specific sort function for a given column. - The current grid, with the new custom sorter applied. - The column name (as used for sorting) - The function used to select a key to sort by, for each element in the grid's source. - The type of elements in the grid's source. - The column type, usually inferred from the keySelector function's return type. - - - Gets the name of the JavaScript function to call after the HTML element that is associated with the instance has been updated in response to an Ajax update request. - The name of the function. - - - Gets the value of the HTML id attribute that marks an HTML element on the web page that gets dynamic Ajax updates that are associated with the instance. - The value of the id attribute. - - - Binds the specified data to the instance. - The bound and populated instance. - The data to display. - A collection that contains the names of the data columns to bind. - true to enable sorting and paging of the instance; otherwise, false. - The number of rows to display on each page of the grid. - - - Gets a value that indicates whether the instance supports sorting. - true if the instance supports sorting; otherwise, false. - - - Creates a new instance. - The new column. - The name of the data column to associate with the instance. - The text that is rendered in the header of the HTML table column that is associated with the instance. - The function that is used to format the data values that are associated with the instance. - A string that specifies the name of the CSS class that is used to style the HTML table cells that are associated with the instance. - true to enable sorting in the instance by the data values that are associated with the instance; otherwise, false. The default is true. - - - Gets a collection that contains the name of each data column that is bound to the instance. - The collection of data column names. - - - Returns an array that contains the specified instances. - An array of columns. - A variable number of column instances. - - - Gets the prefix that is applied to all query-string fields that are associated with the instance. - The query-string field prefix of the instance. - - - Returns a JavaScript statement that can be used to update the HTML element that is associated with the instance on the specified web page. - A JavaScript statement that can be used to update the HTML element in a web page that is associated with the instance. - The URL of the web page that contains the instance that is being updated. The URL can include query-string arguments. - - - Returns the HTML markup that is used to render the instance and using the specified paging options. - The HTML markup that represents the fully-populated instance. - The name of the CSS class that is used to style the whole table. - The name of the CSS class that is used to style the table header. - The name of the CSS class that is used to style the table footer. - The name of the CSS class that is used to style each table row. - The name of the CSS class that is used to style even-numbered table rows. - The name of the CSS class that is used to style the selected table row. (Only one row can be selected at a time.) - The table caption. - true to display the table header; otherwise, false. The default is true. - true to insert additional rows in the last page when there are insufficient data items to fill the last page; otherwise, false. The default is false. Additional rows are populated using the text specified by the parameter. - The text that is used to populate additional rows in a page when there are insufficient data items to fill the last page. The parameter must be set to true to display these additional rows. - A collection of instances that specify how each column is displayed. This includes which data column is associated with each grid column, and how to format the data values that each grid column contains. - A collection that contains the names of the data columns to exclude when the grid auto-populates columns. - A bitwise combination of the enumeration values that specify methods that are provided for moving between pages of the instance. - The text for the HTML link element that is used to link to the first page of the instance. The flag of the parameter must be set to display this page navigation element. - The text for the HTML link element that is used to link to previous page of the instance. The flag of the parameter must be set to display this page navigation element. - The text for the HTML link element that is used to link to the next page of the instance. The flag of the parameter must be set to display this page navigation element. - The text for the HTML link element that is used to link to the last page of the instance. The flag of the parameter must be set to display this page navigation element. - The number of numeric page links that are provided to nearby pages. The text of each numeric page link contains the page number. The flag of the parameter must be set to display these page navigation elements. - An object that represents a collection of attributes (names and values) to set for the HTML table element that represents the instance. - - - Returns a URL that can be used to display the specified data page of the instance. - A URL that can be used to display the specified data page of the grid. - The index of the page to display. - - - Returns a URL that can be used to sort the instance by the specified column. - A URL that can be used to sort the grid. - The name of the data column to sort by. - - - Gets a value that indicates whether a row in the instance is selected. - true if a row is currently selected; otherwise, false. - - - Returns a value that indicates whether the instance can use Ajax calls to refresh the display. - true if the instance supports Ajax calls; otherwise, false.. - - - Gets the number of pages that the instance contains. - The page count. - - - Gets the full name of the query-string field that is used to specify the current page of the instance. - The full name of the query string field that is used to specify the current page of the grid. - - - Gets or sets the index of the current page of the instance. - The index of the current page. - - - Returns the HTML markup that is used to provide the specified paging support for the instance. - The HTML markup that provides paging support for the grid. - A bitwise combination of the enumeration values that specify the methods that are provided for moving between the pages of the grid. The default is the bitwise OR of the and flags. - The text for the HTML link element that navigates to the first page of the grid. - The text for the HTML link element that navigates to the previous page of the grid. - The text for the HTML link element that navigates to the next page of the grid. - The text for the HTML link element that navigates to the last page of the grid. - The number of numeric page links to display. The default is 5. - - - Gets a list that contains the rows that are on the current page of the instance after the grid has been sorted. - The list of rows. - - - Gets the number of rows that are displayed on each page of the instance. - The number of rows that are displayed on each page of the grid. - - - Gets or sets the index of the selected row relative to the current page of the instance. - The index of the selected row relative to the current page. - - - Gets the currently selected row of the instance. - The currently selected row. - - - Gets the full name of the query-string field that is used to specify the selected row of the instance. - The full name of the query string field that is used to specify the selected row of the grid. - - - Gets or sets the name of the data column that the instance is sorted by. - The name of the data column that is used to sort the grid. - - - Gets or sets the direction in which the instance is sorted. - The sort direction. - - - Gets the full name of the query-string field that is used to specify the sort direction of the instance. - The full name of the query string field that is used to specify the sort direction of the grid. - - - Gets the full name of the query-string field that is used to specify the name of the data column that the instance is sorted by. - The full name of the query-string field that is used to specify the name of the data column that the grid is sorted by. - - - Returns the HTML markup that is used to render the instance. - The HTML markup that represents the fully-populated instance. - The name of the CSS class that is used to style the whole table. - The name of the CSS class that is used to style the table header. - The name of the CSS class that is used to style the table footer. - The name of the CSS class that is used to style each table row. - The name of the CSS class that is used to style even-numbered table rows. - The name of the CSS class that is used use to style the selected table row. - The table caption. - true to display the table header; otherwise, false. The default is true. - true to insert additional rows in the last page when there are insufficient data items to fill the last page; otherwise, false. The default is false. Additional rows are populated using the text specified by the parameter. - The text that is used to populate additional rows in the last page when there are insufficient data items to fill the last page. The parameter must be set to true to display these additional rows. - A collection of instances that specify how each column is displayed. This includes which data column is associated with each grid column, and how to format the data values that each grid column contains. - A collection that contains the names of the data columns to exclude when the grid auto-populates columns. - A function that returns the HTML markup that is used to render the table footer. - An object that represents a collection of attributes (names and values) to set for the HTML table element that represents the instance. - - - Gets the total number of rows that the instance contains. - The total number of rows in the grid. This value includes all rows from every page, but does not include the additional rows inserted in the last page when there are insufficient data items to fill the last page. - - - Represents a column in a instance. - - - Initializes a new instance of the class. - - - Gets or sets a value that indicates whether the column can be sorted. - true to indicate that the column can be sorted; otherwise, false. - - - Gets or sets the name of the data item that is associated with the column. - The name of the data item. - - - Gets or sets a function that is used to format the data item that is associated with the column. - The function that is used to format that data item that is associated with the column. - - - Gets or sets the text that is rendered in the header of the column. - The text that is rendered to the column header. - - - Gets or sets the CSS class attribute that is rendered as part of the HTML table cells that are associated with the column. - The CSS class attribute that is applied to cells that are associated with the column. - - - Specifies flags that describe the methods that are provided for moving between the pages of a instance.This enumeration has a attribute that allows a bitwise combination of its member values. - - - Indicates that all methods for moving between pages are provided. - - - Indicates that methods for moving directly to the first or last page are provided. - - - Indicates that methods for moving to the next or previous page are provided. - - - Indicates that methods for moving to a nearby page by using a page number are provided. - - - Represents a row in a instance. - - - Initializes a new instance of the class using the specified instance, row value, and index. - The instance that contains the row. - An object that contains a property member for each value in the row. - The index of the row. - - - Returns an enumerator that can be used to iterate through the values of the instance. - An enumerator that can be used to iterate through the values of the row. - - - Returns an HTML element (a link) that users can use to select the row. - The link that users can click to select the row. - The inner text of the link element. If is empty or null, "Select" is used. - - - Returns the URL that can be used to select the row. - The URL that is used to select a row. - - - Returns the value at the specified index in the instance. - The value at the specified index. - The zero-based index of the value in the row to return. - - is less than 0 or greater than or equal to the number of values in the row. - - - Returns the value that has the specified name in the instance. - The specified value. - The name of the value in the row to return. - - is Nothing or empty. - - specifies a value that does not exist. - - - Returns an enumerator that can be used to iterate through a collection. - An enumerator that can be used to iterate through the collection. - - - Returns a string that represents all of the values of the instance. - A string that represents the row's values. - - - Returns the value of a member that is described by the specified binder. - true if the value of the item was successfully retrieved; otherwise, false. - The getter of the bound property member. - When this method returns, contains an object that holds the value of the item described by . This parameter is passed uninitialized. - - - Gets an object that contains a property member for each value in the row. - An object that contains each value in the row as a property. - - - Gets the instance that the row belongs to. - The instance that contains the row. - - - Represents an object that lets you display and manage images in a web page. - - - Initializes a new instance of the class using a byte array to represent the image. - The image. - - - Initializes a new instance of the class using a stream to represent the image. - The image. - - - Initializes a new instance of the class using a path to represent the image location. - The path of the file that contains the image. - - - Adds a watermark image using a path to the watermark image. - The watermarked image. - The path of a file that contains the watermark image. - The width, in pixels, of the watermark image. - The height, in pixels, of the watermark image. - The horizontal alignment for watermark image. Values can be "Left", "Right", or "Center". - The vertical alignment for the watermark image. Values can be "Top", "Middle", or "Bottom". - The opacity for the watermark image, specified as a value between 0 and 100. - The size, in pixels, of the padding around the watermark image. - - - Adds a watermark image using the specified image object. - The watermarked image. - A object. - The width, in pixels, of the watermark image. - The height, in pixels, of the watermark image. - The horizontal alignment for watermark image. Values can be "Left", "Right", or "Center". - The vertical alignment for the watermark image. Values can be "Top", "Middle", or "Bottom". - The opacity for the watermark image, specified as a value between 0 and 100. - The size, in pixels, of the padding around the watermark image. - - - Adds watermark text to the image. - The watermarked image. - The text to use as a watermark. - The color of the watermark text. - The font size of the watermark text. - The font style of the watermark text. - The font type of the watermark text. - The horizontal alignment for watermark text. Values can be "Left", "Right", or "Center". - The vertical alignment for the watermark text. Values can be "Top", "Middle", or "Bottom". - The opacity for the watermark image, specified as a value between 0 and 100. - The size, in pixels, of the padding around the watermark text. - - - Copies the object. - The image. - - - Crops an image. - The cropped image. - The number of pixels to remove from the top. - The number of pixels to remove from the left. - The number of pixels to remove from the bottom. - The number of pixels to remove from the right. - - - Gets or sets the file name of the object. - The file name. - - - Flips an image horizontally. - The flipped image. - - - Flips an image vertically. - The flipped image. - - - Returns the image as a byte array. - The image. - The value of the object. - - - Returns an image that has been uploaded using the browser. - The image. - (Optional) The name of the file that has been posted. If no file name is specified, the first file that was uploaded is returned. - - - Gets the height, in pixels, of the image. - The height. - - - Gets the format of the image (for example, "jpeg" or "png"). - The file format of the image. - - - Resizes an image. - The resized image. - The width, in pixels, of the object. - The height, in pixels, of the object. - true to preserve the aspect ratio of the image; otherwise, false. - true to prevent the enlargement of the image; otherwise, false. - - - Rotates an image to the left. - The rotated image. - - - Rotates an image to the right. - The rotated image. - - - Saves the image using the specified file name. - The image. - The path to save the image to. - The format to use when the image file is saved, such as "gif", or "png". - true to force the correct file-name extension to be used for the format that is specified in ; otherwise, false. If there is a mismatch between the file type and the specified file-name extension, and if is true, the correct extension will be appended to the file name. For example, a PNG file named Photograph.txt is saved using the name Photograph.txt.png. - - - Gets the width, in pixels, of the image. - The width. - - - Renders an image to the browser. - The image. - (Optional) The file format to use when the image is written. - - - Provides a way to construct and send an email message using Simple Mail Transfer Protocol (SMTP). - - - Gets or sets a value that indicates whether Secure Sockets Layer (SSL) is used to encrypt the connection when an email message is sent. - true if SSL is used to encrypt the connection; otherwise, false. - - - Gets or sets the email address of the sender. - The email address of the sender. - - - Gets or sets the password of the sender's email account. - The sender's password. - - - Sends the specified message to an SMTP server for delivery. - The email address of the recipient or recipients. Separate multiple recipients using a semicolon (;). - The subject line for the email message. - The body of the email message. If is true, HTML in the body is interpreted as markup. - (Optional) The email address of the message sender, or null to not specify a sender. The default value is null. - (Optional) The email addresses of additional recipients to send a copy of the message to, or null if there are no additional recipients. Separate multiple recipients using a semicolon (;). The default value is null. - (Optional) A collection of file names that specifies the files to attach to the email message, or null if there are no files to attach. The default value is null. - (Optional) true to specify that the email message body is in HTML format; false to indicate that the body is in plain-text format. The default value is true. - (Optional) A collection of headers to add to the normal SMTP headers included in this email message, or null to send no additional headers. The default value is null. - (Optional) The email addresses of additional recipients to send a "blind" copy of the message to, or null if there are no additional recipients. Separate multiple recipients using a semicolon (;). The default value is null. - (Optional) The encoding to use for the body of the message. Possible values are property values for the class, such as . The default value is null. - (Optional) The encoding to use for the header of the message. Possible values are property values for the class, such as . The default value is null. - (Optional) A value ("Normal", "Low", "High") that specifies the priority of the message. The default is "Normal". - (Optional) The email address that will be used when the recipient replies to the message. The default value is null, which indicates that the reply address is the value of the From property. - - - Gets or sets the port that is used for SMTP transactions. - The port that is used for SMTP transactions. - - - Gets or sets the name of the SMTP server that is used to transmit the email message. - The SMTP server. - - - Gets or sets a value that indicates whether the default credentials are sent with the requests. - true if credentials are sent with the email message; otherwise, false. - - - Gets or sets the name of email account that is used to send email. - The name of the user account. - - + + + + System.Web.Helpers + + + + Displays data in the form of a graphical chart. + + + Initializes a new instance of the class. + The width, in pixels, of the complete chart image. + The height, in pixels, of the complete chart image. + (Optional) The template (theme) to apply to the chart. + (Optional) The template (theme) path and file name to apply to the chart. + + + Adds a legend to the chart. + The chart. + The text of the legend title. + The unique name of the legend. + + + Provides data points and series attributes for the chart. + The chart. + The unique name of the series. + The chart type of a series. + The name of the chart area that is used to plot the data series. + The axis label text for the series. + The name of the series that is associated with the legend. + The granularity of data point markers. + The values to plot along the x-axis. + The name of the field for x-values. + The values to plot along the y-axis. + A comma-separated list of name or names of the field or fields for y-values. + + + Adds a title to the chart. + The chart. + The title text. + The unique name of the title. + + + Binds a chart to a data table, where one series is created for each unique value in a column. + The chart. + The chart data source. + The name of the column that is used to group data into the series. + The name of the column for x-values. + A comma-separated list of names of the columns for y-values. + Other data point properties that can be bound. + The order in which the series will be sorted. The default is "Ascending". + + + Creates and binds series data to the specified data table, and optionally populates multiple x-values. + The chart. + The chart data source. This can be can be any object. + The name of the table column used for the series x-values. + + + Gets or sets the name of the file that contains the chart image. + The name of the file. + + + Returns a chart image as a byte array. + The chart. + The image format. The default is "jpeg". + + + Retrieves the specified chart from the cache. + The chart. + The ID of the cache item that contains the chart to retrieve. The key is set when you call the method. + + + Gets or sets the height, in pixels, of the chart image. + The chart height. + + + Saves a chart image to the specified file. + The chart. + The location and name of the image file. + The image file format, such as "png" or "jpeg". + + + Saves a chart in the system cache. + The ID of the cache item that contains the chart. + The ID of the chart in the cache. + The number of minutes to keep the chart image in the cache. The default is 20. + true to indicate that the chart cache item's expiration is reset each time the item is accessed, or false to indicate that the expiration is based on an absolute interval since the time that the item was added to the cache. The default is true. + + + Saves a chart as an XML file. + The chart. + The path and name of the XML file. + + + Sets values for the horizontal axis. + The chart. + The title of the x-axis. + The minimum value for the x-axis. + The maximum value for the x-axis. + + + Sets values for the vertical axis. + The chart. + The title of the y-axis. + The minimum value for the y-axis. + The maximum value for the y-axis. + + + Creates a object based on the current object. + The chart. + The format of the image to save the object as. The default is "jpeg". The parameter is not case sensitive. + + + Gets or set the width, in pixels, of the chart image. + The chart width. + + + Renders the output of the object as an image. + The chart. + The format of the image. The default is "jpeg". + + + Renders the output of a object that has been cached as an image. + The chart. + The ID of the chart in the cache. + The format of the image. The default is "jpeg". + + + Specifies visual themes for a object. + + + A theme for 2D charting that features a visual container with a blue gradient, rounded edges, drop-shadowing, and high-contrast gridlines. + + + A theme for 2D charting that features a visual container with a green gradient, rounded edges, drop-shadowing, and low-contrast gridlines. + + + A theme for 2D charting that features no visual container and no gridlines. + + + A theme for 3D charting that features no visual container, limited labeling and, sparse, high-contrast gridlines. + + + A theme for 2D charting that features a visual container that has a yellow gradient, rounded edges, drop-shadowing, and high-contrast gridlines. + + + Provides methods to generate hash values and encrypt passwords or other sensitive data. + + + Generates a cryptographically strong sequence of random byte values. + The generated salt value as a base-64-encoded string. + The number of cryptographically random bytes to generate. + + + Returns a hash value for the specified byte array. + The hash value for as a string of hexadecimal characters. + The data to provide a hash value for. + The algorithm that is used to generate the hash value. The default is "sha256". + + is null. + + + Returns a hash value for the specified string. + The hash value for as a string of hexadecimal characters. + The data to provide a hash value for. + The algorithm that is used to generate the hash value. The default is "sha256". + + is null. + + + Returns an RFC 2898 hash value for the specified password. + The hash value for as a base-64-encoded string. + The password to generate a hash value for. + + is null. + + + Returns a SHA-1 hash value for the specified string. + The SHA-1 hash value for as a string of hexadecimal characters. + The data to provide a hash value for. + + is null. + + + Returns a SHA-256 hash value for the specified string. + The SHA-256 hash value for as a string of hexadecimal characters. + The data to provide a hash value for. + + is null. + + + Determines whether the specified RFC 2898 hash and password are a cryptographic match. + true if the hash value is a cryptographic match for the password; otherwise, false. + The previously-computed RFC 2898 hash value as a base-64-encoded string. + The plaintext password to cryptographically compare with . + + or is null. + + + Represents a series of values as a JavaScript-like array by using the dynamic capabilities of the Dynamic Language Runtime (DLR). + + + Initializes a new instance of the class using the specified array element values. + An array of objects that contains the values to add to the instance. + + + Returns an enumerator that can be used to iterate through the elements of the instance. + An enumerator that can be used to iterate through the elements of the JSON array. + + + Returns the value at the specified index in the instance. + The value at the specified index. + + + Returns the number of elements in the instance. + The number of elements in the JSON array. + + + Converts a instance to an array of objects. + The array of objects that represents the JSON array. + The JSON array to convert. + + + Converts a instance to an array of objects. + The array of objects that represents the JSON array. + The JSON array to convert. + + + Returns an enumerator that can be used to iterate through a collection. + An enumerator that can be used to iterate through the collection. + + + Converts the instance to a compatible type. + true if the conversion was successful; otherwise, false. + Provides information about the conversion operation. + When this method returns, contains the result of the type conversion operation. This parameter is passed uninitialized. + + + Tests the instance for dynamic members (which are not supported) in a way that does not cause an exception to be thrown. + true in all cases. + Provides information about the get operation. + When this method returns, contains null. This parameter is passed uninitialized. + + + Represents a collection of values as a JavaScript-like object by using the capabilities of the Dynamic Language Runtime. + + + Initializes a new instance of the class using the specified field values. + A dictionary of property names and values to add to the instance as dynamic members. + + + Returns a list that contains the name of all dynamic members (JSON fields) of the instance. + A list that contains the name of every dynamic member (JSON field). + + + Converts the instance to a compatible type. + true in all cases. + Provides information about the conversion operation. + When this method returns, contains the result of the type conversion operation. This parameter is passed uninitialized. + The instance could not be converted to the specified type. + + + Gets the value of a field using the specified index. + true in all cases. + Provides information about the indexed get operation. + An array that contains a single object that indexes the field by name. The object must be convertible to a string that specifies the name of the JSON field to return. If multiple indexes are specified, contains null when this method returns. + When this method returns, contains the value of the indexed field, or null if the get operation was unsuccessful. This parameter is passed uninitialized. + + + Gets the value of a field using the specified name. + true in all cases. + Provides information about the get operation. + When this method returns, contains the value of the field, or null if the get operation was unsuccessful. This parameter is passed uninitialized. + + + Sets the value of a field using the specified index. + true in all cases. + Provides information about the indexed set operation. + An array that contains a single object that indexes the field by name. The object must be convertible to a string that specifies the name of the JSON field to return. If multiple indexes are specified, no field is changed or added. + The value to set the field to. + + + Sets the value of a field using the specified name. + true in all cases. + Provides information about the set operation. + The value to set the field to. + + + Provides methods for working with data in JavaScript Object Notation (JSON) format. + + + Converts data in JavaScript Object Notation (JSON) format into the specified strongly typed data list. + The JSON-encoded data converted to a strongly typed list. + The JSON-encoded string to convert. + The type of the strongly typed list to convert JSON data into. + + + Converts data in JavaScript Object Notation (JSON) format into a data object. + The JSON-encoded data converted to a data object. + The JSON-encoded string to convert. + + + Converts data in JavaScript Object Notation (JSON) format into a data object of a specified type. + The JSON-encoded data converted to the specified type. + The JSON-encoded string to convert. + The type that the data should be converted to. + + + Converts a data object to a string that is in the JavaScript Object Notation (JSON) format. + Returns a string of data converted to the JSON format. + The data object to convert. + + + Converts a data object to a string in JavaScript Object Notation (JSON) format and adds the string to the specified object. + The data object to convert. + The object that contains the converted JSON data. + + + Renders the property names and values of the specified object and of any subobjects that it references. + + + Renders the property names and values of the specified object and of any subobjects. + For a simple variable, returns the type and the value. For an object that contains multiple items, returns the property name or key and the value for each property. + The object to render information for. + Optional. Specifies the depth of nested subobjects to render information for. The default is 10. + Optional. Specifies the maximum number of characters that the method displays for object values. The default is 1000. + + is less than zero. + + is less than or equal to zero. + + + Displays information about the web server environment that hosts the current web page. + + + Displays information about the web server environment. + A string of name-value pairs that contains information about the web server. + + + Specifies the direction in which to sort a list of items. + + + Sort from smallest to largest —for example, from 1 to 10. + + + Sort from largest to smallest — for example, from 10 to 1. + + + Provides a cache to store frequently accessed data. + + + Retrieves the specified item from the object. + The item retrieved from the cache, or null if the item is not found. + The identifier for the cache item to retrieve. + + + Removes the specified item from the object. + The item removed from the object. If the item is not found, returns null. + The identifier for the cache item to remove. + + + Inserts an item into the object. + The identifier for the cache item. + The data to insert into the cache. + Optional. The number of minutes to keep an item in the cache. The default is 20. + Optional. true to indicate that the cache item expiration is reset each time the item is accessed, or false to indicate that the expiration is based the absolute time since the item was added to the cache. The default is true. In that case, if you also use the default value for the parameter, a cached item expires 20 minutes after it was last accessed. + The value of is less than or equal to zero. + Sliding expiration is enabled and the value of is greater than a year. + + + Displays data on a web page using an HTML table element. + + + Initializes a new instance of the class. + The data to display. + A collection that contains the names of the data columns to display. By default, this value is auto-populated according to the values in the parameter. + The name of the data column that is used to sort the grid by default. + The number of rows that are displayed on each page of the grid when paging is enabled. The default is 10. + true to specify that paging is enabled for the instance; otherwise false. The default is true. + true to specify that sorting is enabled for the instance; otherwise, false. The default is true. + The value of the HTML id attribute that is used to mark the HTML element that gets dynamic Ajax updates that are associated with the instance. + The name of the JavaScript function that is called after the HTML element specified by the property has been updated. If the name of a function is not provided, no function will be called. If the specified function does not exist, a JavaScript error will occur if it is invoked. + The prefix that is applied to all query-string fields that are associated with the instance. This value is used in order to support multiple instances on the same web page. + The name of the query-string field that is used to specify the current page of the instance. + The name of the query-string field that is used to specify the currently selected row of the instance. + The name of the query-string field that is used to specify the name of the data column that the instance is sorted by. + The name of the query-string field that is used to specify the direction in which the instance is sorted. + + + Adds a specific sort function for a given column. + The current grid, with the new custom sorter applied. + The column name (as used for sorting) + The function used to select a key to sort by, for each element in the grid's source. + The type of elements in the grid's source. + The column type, usually inferred from the keySelector function's return type. + + + Gets the name of the JavaScript function to call after the HTML element that is associated with the instance has been updated in response to an Ajax update request. + The name of the function. + + + Gets the value of the HTML id attribute that marks an HTML element on the web page that gets dynamic Ajax updates that are associated with the instance. + The value of the id attribute. + + + Binds the specified data to the instance. + The bound and populated instance. + The data to display. + A collection that contains the names of the data columns to bind. + true to enable sorting and paging of the instance; otherwise, false. + The number of rows to display on each page of the grid. + + + Gets a value that indicates whether the instance supports sorting. + true if the instance supports sorting; otherwise, false. + + + Creates a new instance. + The new column. + The name of the data column to associate with the instance. + The text that is rendered in the header of the HTML table column that is associated with the instance. + The function that is used to format the data values that are associated with the instance. + A string that specifies the name of the CSS class that is used to style the HTML table cells that are associated with the instance. + true to enable sorting in the instance by the data values that are associated with the instance; otherwise, false. The default is true. + + + Gets a collection that contains the name of each data column that is bound to the instance. + The collection of data column names. + + + Returns an array that contains the specified instances. + An array of columns. + A variable number of column instances. + + + Gets the prefix that is applied to all query-string fields that are associated with the instance. + The query-string field prefix of the instance. + + + Returns a JavaScript statement that can be used to update the HTML element that is associated with the instance on the specified web page. + A JavaScript statement that can be used to update the HTML element in a web page that is associated with the instance. + The URL of the web page that contains the instance that is being updated. The URL can include query-string arguments. + + + Returns the HTML markup that is used to render the instance and using the specified paging options. + The HTML markup that represents the fully-populated instance. + The name of the CSS class that is used to style the whole table. + The name of the CSS class that is used to style the table header. + The name of the CSS class that is used to style the table footer. + The name of the CSS class that is used to style each table row. + The name of the CSS class that is used to style even-numbered table rows. + The name of the CSS class that is used to style the selected table row. (Only one row can be selected at a time.) + The table caption. + true to display the table header; otherwise, false. The default is true. + true to insert additional rows in the last page when there are insufficient data items to fill the last page; otherwise, false. The default is false. Additional rows are populated using the text specified by the parameter. + The text that is used to populate additional rows in a page when there are insufficient data items to fill the last page. The parameter must be set to true to display these additional rows. + A collection of instances that specify how each column is displayed. This includes which data column is associated with each grid column, and how to format the data values that each grid column contains. + A collection that contains the names of the data columns to exclude when the grid auto-populates columns. + A bitwise combination of the enumeration values that specify methods that are provided for moving between pages of the instance. + The text for the HTML link element that is used to link to the first page of the instance. The flag of the parameter must be set to display this page navigation element. + The text for the HTML link element that is used to link to previous page of the instance. The flag of the parameter must be set to display this page navigation element. + The text for the HTML link element that is used to link to the next page of the instance. The flag of the parameter must be set to display this page navigation element. + The text for the HTML link element that is used to link to the last page of the instance. The flag of the parameter must be set to display this page navigation element. + The number of numeric page links that are provided to nearby pages. The text of each numeric page link contains the page number. The flag of the parameter must be set to display these page navigation elements. + An object that represents a collection of attributes (names and values) to set for the HTML table element that represents the instance. + + + Returns a URL that can be used to display the specified data page of the instance. + A URL that can be used to display the specified data page of the grid. + The index of the page to display. + + + Returns a URL that can be used to sort the instance by the specified column. + A URL that can be used to sort the grid. + The name of the data column to sort by. + + + Gets a value that indicates whether a row in the instance is selected. + true if a row is currently selected; otherwise, false. + + + Returns a value that indicates whether the instance can use Ajax calls to refresh the display. + true if the instance supports Ajax calls; otherwise, false.. + + + Gets the number of pages that the instance contains. + The page count. + + + Gets the full name of the query-string field that is used to specify the current page of the instance. + The full name of the query string field that is used to specify the current page of the grid. + + + Gets or sets the index of the current page of the instance. + The index of the current page. + + + Returns the HTML markup that is used to provide the specified paging support for the instance. + The HTML markup that provides paging support for the grid. + A bitwise combination of the enumeration values that specify the methods that are provided for moving between the pages of the grid. The default is the bitwise OR of the and flags. + The text for the HTML link element that navigates to the first page of the grid. + The text for the HTML link element that navigates to the previous page of the grid. + The text for the HTML link element that navigates to the next page of the grid. + The text for the HTML link element that navigates to the last page of the grid. + The number of numeric page links to display. The default is 5. + + + Gets a list that contains the rows that are on the current page of the instance after the grid has been sorted. + The list of rows. + + + Gets the number of rows that are displayed on each page of the instance. + The number of rows that are displayed on each page of the grid. + + + Gets or sets the index of the selected row relative to the current page of the instance. + The index of the selected row relative to the current page. + + + Gets the currently selected row of the instance. + The currently selected row. + + + Gets the full name of the query-string field that is used to specify the selected row of the instance. + The full name of the query string field that is used to specify the selected row of the grid. + + + Gets or sets the name of the data column that the instance is sorted by. + The name of the data column that is used to sort the grid. + + + Gets or sets the direction in which the instance is sorted. + The sort direction. + + + Gets the full name of the query-string field that is used to specify the sort direction of the instance. + The full name of the query string field that is used to specify the sort direction of the grid. + + + Gets the full name of the query-string field that is used to specify the name of the data column that the instance is sorted by. + The full name of the query-string field that is used to specify the name of the data column that the grid is sorted by. + + + Returns the HTML markup that is used to render the instance. + The HTML markup that represents the fully-populated instance. + The name of the CSS class that is used to style the whole table. + The name of the CSS class that is used to style the table header. + The name of the CSS class that is used to style the table footer. + The name of the CSS class that is used to style each table row. + The name of the CSS class that is used to style even-numbered table rows. + The name of the CSS class that is used use to style the selected table row. + The table caption. + true to display the table header; otherwise, false. The default is true. + true to insert additional rows in the last page when there are insufficient data items to fill the last page; otherwise, false. The default is false. Additional rows are populated using the text specified by the parameter. + The text that is used to populate additional rows in the last page when there are insufficient data items to fill the last page. The parameter must be set to true to display these additional rows. + A collection of instances that specify how each column is displayed. This includes which data column is associated with each grid column, and how to format the data values that each grid column contains. + A collection that contains the names of the data columns to exclude when the grid auto-populates columns. + A function that returns the HTML markup that is used to render the table footer. + An object that represents a collection of attributes (names and values) to set for the HTML table element that represents the instance. + + + Gets the total number of rows that the instance contains. + The total number of rows in the grid. This value includes all rows from every page, but does not include the additional rows inserted in the last page when there are insufficient data items to fill the last page. + + + Represents a column in a instance. + + + Initializes a new instance of the class. + + + Gets or sets a value that indicates whether the column can be sorted. + true to indicate that the column can be sorted; otherwise, false. + + + Gets or sets the name of the data item that is associated with the column. + The name of the data item. + + + Gets or sets a function that is used to format the data item that is associated with the column. + The function that is used to format that data item that is associated with the column. + + + Gets or sets the text that is rendered in the header of the column. + The text that is rendered to the column header. + + + Gets or sets the CSS class attribute that is rendered as part of the HTML table cells that are associated with the column. + The CSS class attribute that is applied to cells that are associated with the column. + + + Specifies flags that describe the methods that are provided for moving between the pages of a instance.This enumeration has a attribute that allows a bitwise combination of its member values. + + + Indicates that all methods for moving between pages are provided. + + + Indicates that methods for moving directly to the first or last page are provided. + + + Indicates that methods for moving to the next or previous page are provided. + + + Indicates that methods for moving to a nearby page by using a page number are provided. + + + Represents a row in a instance. + + + Initializes a new instance of the class using the specified instance, row value, and index. + The instance that contains the row. + An object that contains a property member for each value in the row. + The index of the row. + + + Returns an enumerator that can be used to iterate through the values of the instance. + An enumerator that can be used to iterate through the values of the row. + + + Returns an HTML element (a link) that users can use to select the row. + The link that users can click to select the row. + The inner text of the link element. If is empty or null, "Select" is used. + + + Returns the URL that can be used to select the row. + The URL that is used to select a row. + + + Returns the value at the specified index in the instance. + The value at the specified index. + The zero-based index of the value in the row to return. + + is less than 0 or greater than or equal to the number of values in the row. + + + Returns the value that has the specified name in the instance. + The specified value. + The name of the value in the row to return. + + is Nothing or empty. + + specifies a value that does not exist. + + + Returns an enumerator that can be used to iterate through a collection. + An enumerator that can be used to iterate through the collection. + + + Returns a string that represents all of the values of the instance. + A string that represents the row's values. + + + Returns the value of a member that is described by the specified binder. + true if the value of the item was successfully retrieved; otherwise, false. + The getter of the bound property member. + When this method returns, contains an object that holds the value of the item described by . This parameter is passed uninitialized. + + + Gets an object that contains a property member for each value in the row. + An object that contains each value in the row as a property. + + + Gets the instance that the row belongs to. + The instance that contains the row. + + + Represents an object that lets you display and manage images in a web page. + + + Initializes a new instance of the class using a byte array to represent the image. + The image. + + + Initializes a new instance of the class using a stream to represent the image. + The image. + + + Initializes a new instance of the class using a path to represent the image location. + The path of the file that contains the image. + + + Adds a watermark image using a path to the watermark image. + The watermarked image. + The path of a file that contains the watermark image. + The width, in pixels, of the watermark image. + The height, in pixels, of the watermark image. + The horizontal alignment for watermark image. Values can be "Left", "Right", or "Center". + The vertical alignment for the watermark image. Values can be "Top", "Middle", or "Bottom". + The opacity for the watermark image, specified as a value between 0 and 100. + The size, in pixels, of the padding around the watermark image. + + + Adds a watermark image using the specified image object. + The watermarked image. + A object. + The width, in pixels, of the watermark image. + The height, in pixels, of the watermark image. + The horizontal alignment for watermark image. Values can be "Left", "Right", or "Center". + The vertical alignment for the watermark image. Values can be "Top", "Middle", or "Bottom". + The opacity for the watermark image, specified as a value between 0 and 100. + The size, in pixels, of the padding around the watermark image. + + + Adds watermark text to the image. + The watermarked image. + The text to use as a watermark. + The color of the watermark text. + The font size of the watermark text. + The font style of the watermark text. + The font type of the watermark text. + The horizontal alignment for watermark text. Values can be "Left", "Right", or "Center". + The vertical alignment for the watermark text. Values can be "Top", "Middle", or "Bottom". + The opacity for the watermark image, specified as a value between 0 and 100. + The size, in pixels, of the padding around the watermark text. + + + Copies the object. + The image. + + + Crops an image. + The cropped image. + The number of pixels to remove from the top. + The number of pixels to remove from the left. + The number of pixels to remove from the bottom. + The number of pixels to remove from the right. + + + Gets or sets the file name of the object. + The file name. + + + Flips an image horizontally. + The flipped image. + + + Flips an image vertically. + The flipped image. + + + Returns the image as a byte array. + The image. + The value of the object. + + + Returns an image that has been uploaded using the browser. + The image. + (Optional) The name of the file that has been posted. If no file name is specified, the first file that was uploaded is returned. + + + Gets the height, in pixels, of the image. + The height. + + + Gets the format of the image (for example, "jpeg" or "png"). + The file format of the image. + + + Resizes an image. + The resized image. + The width, in pixels, of the object. + The height, in pixels, of the object. + true to preserve the aspect ratio of the image; otherwise, false. + true to prevent the enlargement of the image; otherwise, false. + + + Rotates an image to the left. + The rotated image. + + + Rotates an image to the right. + The rotated image. + + + Saves the image using the specified file name. + The image. + The path to save the image to. + The format to use when the image file is saved, such as "gif", or "png". + true to force the correct file-name extension to be used for the format that is specified in ; otherwise, false. If there is a mismatch between the file type and the specified file-name extension, and if is true, the correct extension will be appended to the file name. For example, a PNG file named Photograph.txt is saved using the name Photograph.txt.png. + + + Gets the width, in pixels, of the image. + The width. + + + Renders an image to the browser. + The image. + (Optional) The file format to use when the image is written. + + + Provides a way to construct and send an email message using Simple Mail Transfer Protocol (SMTP). + + + Gets or sets a value that indicates whether Secure Sockets Layer (SSL) is used to encrypt the connection when an email message is sent. + true if SSL is used to encrypt the connection; otherwise, false. + + + Gets or sets the email address of the sender. + The email address of the sender. + + + Gets or sets the password of the sender's email account. + The sender's password. + + + Sends the specified message to an SMTP server for delivery. + The email address of the recipient or recipients. Separate multiple recipients using a semicolon (;). + The subject line for the email message. + The body of the email message. If is true, HTML in the body is interpreted as markup. + (Optional) The email address of the message sender, or null to not specify a sender. The default value is null. + (Optional) The email addresses of additional recipients to send a copy of the message to, or null if there are no additional recipients. Separate multiple recipients using a semicolon (;). The default value is null. + (Optional) A collection of file names that specifies the files to attach to the email message, or null if there are no files to attach. The default value is null. + (Optional) true to specify that the email message body is in HTML format; false to indicate that the body is in plain-text format. The default value is true. + (Optional) A collection of headers to add to the normal SMTP headers included in this email message, or null to send no additional headers. The default value is null. + (Optional) The email addresses of additional recipients to send a "blind" copy of the message to, or null if there are no additional recipients. Separate multiple recipients using a semicolon (;). The default value is null. + (Optional) The encoding to use for the body of the message. Possible values are property values for the class, such as . The default value is null. + (Optional) The encoding to use for the header of the message. Possible values are property values for the class, such as . The default value is null. + (Optional) A value ("Normal", "Low", "High") that specifies the priority of the message. The default is "Normal". + (Optional) The email address that will be used when the recipient replies to the message. The default value is null, which indicates that the reply address is the value of the From property. + + + Gets or sets the port that is used for SMTP transactions. + The port that is used for SMTP transactions. + + + Gets or sets the name of the SMTP server that is used to transmit the email message. + The SMTP server. + + + Gets or sets a value that indicates whether the default credentials are sent with the requests. + true if credentials are sent with the email message; otherwise, false. + + + Gets or sets the name of email account that is used to send email. + The name of the user account. + + \ No newline at end of file diff --git a/lib/aspnetmvc/System.Web.Mvc.xml b/lib/aspnetmvc/System.Web.Mvc.xml index 367e05aede4..b4b6df8a5e8 100644 --- a/lib/aspnetmvc/System.Web.Mvc.xml +++ b/lib/aspnetmvc/System.Web.Mvc.xml @@ -1,11485 +1,11485 @@ - - - - System.Web.Mvc - - - - Represents an attribute that specifies which HTTP verbs an action method will respond to. - - - Initializes a new instance of the class by using a list of HTTP verbs that the action method will respond to. - The HTTP verbs that the action method will respond to. - The parameter is null or zero length. - - - Initializes a new instance of the class using the HTTP verbs that the action method will respond to. - The HTTP verbs that the action method will respond to. - - - Determines whether the specified method information is valid for the specified controller context. - true if the method information is valid; otherwise, false. - The controller context. - The method information. - The parameter is null. - - - Gets or sets the list of HTTP verbs that the action method will respond to. - The list of HTTP verbs that the action method will respond to. - - - Provides information about an action method, such as its name, controller, parameters, attributes, and filters. - - - Initializes a new instance of the class. - - - Gets the name of the action method. - The name of the action method. - - - Gets the controller descriptor. - The controller descriptor. - - - Executes the action method by using the specified parameters and controller context. - The result of executing the action method. - The controller context. - The parameters of the action method. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes of the specified type exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - The parameter is null. - - - Gets the filter attributes. - The filter attributes. - true to use the cache, otherwise false. - - - Returns the filters that are associated with this action method. - The filters that are associated with this action method. - - - Returns the parameters of the action method. - The parameters of the action method. - - - Returns the action-method selectors. - The action-method selectors. - - - Determines whether one or more instances of the specified attribute type are defined for this member. - true if is defined for this member; otherwise, false. - The type of the custom attribute. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The parameter is null. - - - Gets the unique ID for the action descriptor using lazy initialization. - The unique ID. - - - Provides the context for the ActionExecuted method of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The controller context. - The action method descriptor. - true if the action is canceled. - The exception object. - The parameter is null. - - - Gets or sets the action descriptor. - The action descriptor. - - - Gets or sets a value that indicates that this object is canceled. - true if the context canceled; otherwise, false. - - - Gets or sets the exception that occurred during the execution of the action method, if any. - The exception that occurred during the execution of the action method. - - - Gets or sets a value that indicates whether the exception is handled. - true if the exception is handled; otherwise, false. - - - Gets or sets the result returned by the action method. - The result returned by the action method. - - - Provides the context for the ActionExecuting method of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified controller context, action descriptor, and action-method parameters. - The controller context. - The action descriptor. - The action-method parameters. - The or parameter is null. - - - Gets or sets the action descriptor. - The action descriptor. - - - Gets or sets the action-method parameters. - The action-method parameters. - - - Gets or sets the result that is returned by the action method. - The result that is returned by the action method. - - - Represents the base class for filter attributes. - - - Initializes a new instance of the class. - - - Called by the ASP.NET MVC framework after the action method executes. - The filter context. - - - Called by the ASP.NET MVC framework before the action method executes. - The filter context. - - - Called by the ASP.NET MVC framework after the action result executes. - The filter context. - - - Called by the ASP.NET MVC framework before the action result executes. - The filter context. - - - Represents an attribute that is used to influence the selection of an action method. - - - Initializes a new instance of the class. - - - Determines whether the action method selection is valid for the specified controller context. - true if the action method selection is valid for the specified controller context; otherwise, false. - The controller context. - Information about the action method. - - - Represents an attribute that is used for the name of an action. - - - Initializes a new instance of the class. - Name of the action. - The parameter is null or empty. - - - Determines whether the action name is valid within the specified controller context. - true if the action name is valid within the specified controller context; otherwise, false. - The controller context. - The name of the action. - Information about the action method. - - - Gets or sets the name of the action. - The name of the action. - - - Represents an attribute that affects the selection of an action method. - - - Initializes a new instance of the class. - - - Determines whether the action name is valid in the specified controller context. - true if the action name is valid in the specified controller context; otherwise, false. - The controller context. - The name of the action. - Information about the action method. - - - Represents the result of an action method. - - - Initializes a new instance of the class. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data. - - - Represents a delegate that contains the logic for selecting an action method. - - - Provides a class that implements the interface in order to support additional metadata. - - - Initializes a new instance of the class. - The name of the model metadata. - The value of the model metadata. - - - Gets the name of the additional metadata attribute. - The name of the of the additional metadata attribute. - - - Provides metadata to the model metadata creation process. - The meta data. - - - Gets the type of the of the additional metadata attribute. - The type of the of the additional metadata attribute. - - - Gets the value of the of the additional metadata attribute. - The value of the of the additional metadata attribute. - - - Represents support for rendering HTML in AJAX scenarios within a view. - - - Initializes a new instance of the class using the specified view context and view data container. - The view context. - The view data container. - One or both of the parameters is null. - - - Initializes a new instance of the class by using the specified view context, view data container, and route collection. - The view context. - The view data container. - The URL route collection. - One or more of the parameters is null. - - - Gets or sets the root path for the location to use for globalization script files. - The location of the folder where globalization script files are stored. The default location is "~/Scripts/Globalization". - - - Serializes the specified message and returns the resulting JSON-formatted string. - The serialized message as a JSON-formatted string. - The message to serialize. - - - Gets the collection of URL routes for the application. - The collection of routes for the application. - - - Gets the ViewBag. - The ViewBag. - - - Gets the context information about the view. - The context of the view. - - - Gets the current view data dictionary. - The view data dictionary. - - - Gets the view data container. - The view data container. - - - Represents support for rendering HTML in AJAX scenarios within a strongly typed view. - The type of the model. - - - Initializes a new instance of the class by using the specified view context and view data container. - The view context. - The view data container. - - - Initializes a new instance of the class by using the specified view context, view data container, and URL route collection. - The view context. - The view data container. - The URL route collection. - - - Gets the ViewBag. - The ViewBag. - - - Gets the strongly typed version of the view data dictionary. - The strongly typed data dictionary of the view. - - - Represents a class that extends the class by adding the ability to determine whether an HTTP request is an AJAX request. - - - Determines whether the specified HTTP request is an AJAX request. - true if the specified HTTP request is an AJAX request; otherwise, false. - The HTTP request. - The parameter is null (Nothing in Visual Basic). - - - Represents an attribute that marks controllers and actions to skip the during authorization. - - - Initializes a new instance of the class. - - - Allows a request to include HTML markup during model binding by skipping request validation for the property. (It is strongly recommended that your application explicitly check all models where you disable request validation in order to prevent script exploits.) - - - Initializes a new instance of the class. - - - This method supports the ASP.NET MVC validation infrastructure and is not intended to be used directly from your code. - The model metadata. - - - Controls interpretation of a controller name when constructing a . - - - Find the controller in the current area. - - - Find the controller in the root area. - - - Provides a way to register one or more areas in an ASP.NET MVC application. - - - Initializes a new instance of the class. - - - Gets the name of the area to register. - The name of the area to register. - - - Registers all areas in an ASP.NET MVC application. - - - Registers all areas in an ASP.NET MVC application by using the specified user-defined information. - An object that contains user-defined information to pass to the area. - - - Registers an area in an ASP.NET MVC application using the specified area's context information. - Encapsulates the information that is required in order to register the area. - - - Encapsulates the information that is required in order to register an area within an ASP.NET MVC application. - - - Initializes a new instance of the class using the specified area name and routes collection. - The name of the area to register. - The collection of routes for the application. - - - Initializes a new instance of the class using the specified area name, routes collection, and user-defined data. - The name of the area to register. - The collection of routes for the application. - An object that contains user-defined information to pass to the area. - - - Gets the name of the area to register. - The name of the area to register. - - - Maps the specified URL route and associates it with the area that is specified by the property. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - The parameter is null. - - - Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - An object that contains default route values. - The parameter is null. - - - Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values and constraint. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - An object that contains default route values. - A set of expressions that specify valid values for a URL parameter. - The parameter is null. - - - Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values, constraints, and namespaces. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - An object that contains default route values. - A set of expressions that specify valid values for a URL parameter. - An enumerable set of namespaces for the application. - The parameter is null. - - - Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values and namespaces. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - An object that contains default route values. - An enumerable set of namespaces for the application. - The parameter is null. - - - Maps the specified URL route and associates it with the area that is specified by the property, using the specified namespaces. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - An enumerable set of namespaces for the application. - The parameter is null. - - - Gets the namespaces for the application. - An enumerable set of namespaces for the application. - - - Gets a collection of defined routes for the application. - A collection of defined routes for the application. - - - Gets an object that contains user-defined information to pass to the area. - An object that contains user-defined information to pass to the area. - - - Provides an abstract class to implement a metadata provider. - - - Called from constructors in a derived class to initialize the class. - - - When overridden in a derived class, creates the model metadata for the property. - The model metadata for the property. - The set of attributes. - The type of the container. - The model accessor. - The type of the model. - The name of the property. - - - Gets a list of attributes. - A list of attributes. - The type of the container. - The property descriptor. - The attribute container. - - - Returns a list of properties for the model. - A list of properties for the model. - The model container. - The type of the container. - - - Returns the metadata for the specified property using the container type and property descriptor. - The metadata for the specified property using the container type and property descriptor. - The model accessor. - The type of the container. - The property descriptor - - - Returns the metadata for the specified property using the container type and property name. - The metadata for the specified property using the container type and property name. - The model accessor. - The type of the container. - The name of the property. - - - Returns the metadata for the specified property using the type of the model. - The metadata for the specified property using the type of the model. - The model accessor. - The type of the model. - - - Returns the type descriptor from the specified type. - The type descriptor. - The type. - - - Provides an abstract class for classes that implement a validation provider. - - - Called from constructors in derived classes to initialize the class. - - - Gets a type descriptor for the specified type. - A type descriptor for the specified type. - The type of the validation provider. - - - Gets the validators for the model using the metadata and controller context. - The validators for the model. - The metadata. - The controller context. - - - Gets the validators for the model using the metadata, the controller context, and a list of attributes. - The validators for the model. - The metadata. - The controller context. - The list of attributes. - - - Provided for backward compatibility with ASP.NET MVC 3. - - - Initializes a new instance of the class. - - - Represents an attribute that is used to set the timeout value, in milliseconds, for an asynchronous method. - - - Initializes a new instance of the class. - The timeout value, in milliseconds. - - - Gets the timeout duration, in milliseconds. - The timeout duration, in milliseconds. - - - Called by ASP.NET before the asynchronous action method executes. - The filter context. - - - Encapsulates the information that is required for using an attribute. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified controller context. - The context within which the result is executed. The context information includes the controller, HTTP content, request context, and route data. - - - Initializes a new instance of the class using the specified controller context and action descriptor. - The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data. - An object that provides information about an action method, such as its name, controller, parameters, attributes, and filters. - - - Provides information about the action method that is marked by the attribute, such as its name, controller, parameters, attributes, and filters. - The action descriptor for the action method that is marked by the attribute. - - - Gets or sets the result that is returned by an action method. - The result that is returned by an action method. - - - Specifies that access to a controller or action method is restricted to users who meet the authorization requirement. - - - Initializes a new instance of the class. - - - When overridden, provides an entry point for custom authorization checks. - true if the user is authorized; otherwise, false. - The HTTP context, which encapsulates all HTTP-specific information about an individual HTTP request. - The parameter is null. - - - Processes HTTP requests that fail authorization. - Encapsulates the information for using . The object contains the controller, HTTP context, request context, action result, and route data. - - - Called when a process requests authorization. - The filter context, which encapsulates information for using . - The parameter is null. - - - Called when the caching module requests authorization. - A reference to the validation status. - The HTTP context, which encapsulates all HTTP-specific information about an individual HTTP request. - The parameter is null. - - - Gets or sets the user roles that are authorized to access the controller or action method. - The user roles that are authorized to access the controller or action method. - - - Gets the unique identifier for this attribute. - The unique identifier for this attribute. - - - Gets or sets the users that are authorized to access the controller or action method. - The users that are authorized to access the controller or action method. - - - Represents an attribute that is used to provide details about how model binding to a parameter should occur. - - - Initializes a new instance of the class. - - - Gets or sets a comma-delimited list of property names for which binding is not allowed. - The exclude list. - - - Gets or sets a comma-delimited list of property names for which binding is allowed. - The include list. - - - Determines whether the specified property is allowed. - true if the specified property is allowed; otherwise, false. - The name of the property. - - - Gets or sets the prefix to use when markup is rendered for binding to an action argument or to a model property. - The prefix to use. - - - Represents the base class for views that are compiled by the BuildManager class before being rendered by a view engine. - - - Initializes a new instance of the class using the specified controller context and view path. - The controller context. - The view path. - - - Initializes a new instance of the class using the specified controller context, view path, and view page activator. - Context information for the current controller. This information includes the HTTP context, request context, route data, parent action view context, and more. - The path to the view that will be rendered. - The object responsible for dynamically constructing the view page at run time. - The parameter is null. - The parameter is null or empty. - - - Renders the specified view context by using the specified the writer object. - Information related to rendering a view, such as view data, temporary data, and form context. - The writer object. - The parameter is null. - An instance of the view type could not be created. - - - When overridden in a derived class, renders the specified view context by using the specified writer object and object instance. - Information related to rendering a view, such as view data, temporary data, and form context. - The writer object. - An object that contains additional information that can be used in the view. - - - Gets or sets the view path. - The view path. - - - Provides a base class for view engines. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified view page activator. - The view page activator. - - - Gets a value that indicates whether a file exists in the specified virtual file system (path). - true if the file exists in the virtual file system; otherwise, false. - The controller context. - The virtual path. - - - - Gets the view page activator. - The view page activator. - - - Maps a browser request to a byte array. - - - Initializes a new instance of the class. - - - Binds the model by using the specified controller context and binding context. - The bound data object.Implements - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - The parameter is null. - - - Provides an abstract class to implement a cached metadata provider. - - - - Initializes a new instance of the class. - - - Gets the cache item policy. - The cache item policy. - - - Gets the cache key prefix. - The cache key prefix. - - - When overridden in a derived class, creates the cached model metadata for the property. - The cached model metadata for the property. - The attributes. - The container type. - The model accessor. - The model type. - The property name. - - - Creates prototype metadata by applying the prototype and model access to yield the final metadata. - The prototype metadata. - The prototype. - The model accessor. - - - Creates a metadata prototype. - A metadata prototype. - The attributes. - The container type. - The model type. - The property name. - - - Gets the metadata for the properties. - The metadata for the properties. - The container. - The container type. - - - Returns the metadata for the specified property. - The metadata for the specified property. - The model accessor. - The container type. - The property descriptor. - - - Returns the metadata for the specified property. - The metadata for the specified property. - The model accessor. - The container type. - The property name. - - - Returns the cached metadata for the specified property using the type of the model. - The cached metadata for the specified property using the type of the model. - The model accessor. - The type of the container. - - - Gets the prototype cache. - The prototype cache. - - - Provides a container to cache attributes. - - - Initializes a new instance of the class. - The attributes. - - - Gets the data type. - The data type. - - - Gets the display. - The display. - - - Gets the display column. - The display column. - - - Gets the display format. - The display format. - - - Gets the display name. - The display name. - - - Indicates whether a data field is editable. - true if the field is editable; otherwise, false. - - - Gets the hidden input. - The hidden input. - - - Indicates whether a data field is read only. - true if the field is read only; otherwise, false. - - - Indicates whether a data field is required. - true if the field is required; otherwise, false. - - - Indicates whether a data field is scaffold. - true if the field is scaffold; otherwise, false. - - - Gets the UI hint. - The UI hint. - - - Provides a container to cache . - - - Initializes a new instance of the class using the prototype and model accessor. - The prototype. - The model accessor. - - - Initializes a new instance of the class using the provider, container type, model type, property name and attributes. - The provider. - The container type. - The model type. - The property name. - The attributes. - - - Gets a value that indicates whether empty strings that are posted back in forms should be converted to Nothing.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - A value that indicates whether empty strings that are posted back in forms should be converted to Nothing. - - - Gets meta information about the data type.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - Meta information about the data type. - - - Gets the description of the model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - The description of the model. - - - Gets the display format string for the model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - The display format string for the model. - - - Gets the display name of the model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - The display name of the model. - - - Gets the edit format string of the model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - The edit format string of the model. - - - Gets a value that indicates whether the model uses a non-default edit format. - A value that indicates whether non-default edit format is used. - - - Gets a value that indicates whether the model object should be rendered using associated HTML elements.Gets a value that indicates whether the model object should be rendered using associated HTML elements.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - A value that indicates whether the model object should be rendered using associated HTML elements. - - - Gets a value that indicates whether the model is read-only.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - A value that indicates whether the model is read-only. - - - Gets a value that indicates whether the model is required.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - A value that indicates whether the model is required. - - - Gets the string to display for null values.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - The string to display for null values. - - - Gets a value that represents order of the current metadata.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - A value that represents order of the current metadata. - - - Gets a short display name.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - A short display name. - - - Gets a value that indicates whether the property should be displayed in read-only views such as list and detail views.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - A value that indicates whether the property should be displayed in read-only views such as list and detail views. - - - Gets or sets a value that indicates whether the model should be displayed in editable views.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - Returns . - - - Gets the simple display string for the model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - The simple display string for the model. - - - Gets a hint that suggests what template to use for this model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - A hint that suggests what template to use for this model. - - - Gets a value that can be used as a watermark.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. - A value that can be used as a watermark. - - - Implements the default cached model metadata provider for ASP.NET MVC. - - - Initializes a new instance of the class. - - - Returns a container of real instances of the cached metadata class based on prototype and model accessor. - A container of real instances of the cached metadata class. - The prototype. - The model accessor. - - - Returns a container prototype instances of the metadata class. - a container prototype instances of the metadata class. - The attributes type. - The container type. - The model type. - The property name. - - - Provides a container for cached metadata. - he type of the container. - - - Constructor for creating real instances of the metadata class based on a prototype. - The provider. - The container type. - The model type. - The property name. - The prototype. - - - Constructor for creating the prototype instances of the metadata class. - The prototype. - The model accessor. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that indicates whether empty strings that are posted back in forms should be converted to null. - A cached value that indicates whether empty strings that are posted back in forms should be converted to null. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets meta information about the data type. - Meta information about the data type. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets the description of the model. - The description of the model. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets the display format string for the model. - The display format string for the model. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets the display name of the model. - The display name of the model. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets the edit format string of the model. - The edit format string of the model. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as . - A value that indicates whether a non-default edit format is used. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that indicates whether the model object should be rendered using associated HTML elements. - A cached value that indicates whether the model object should be rendered using associated HTML elements. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that indicates whether the model is read-only. - A cached value that indicates whether the model is read-only. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that indicates whether the model is required. - A cached value that indicates whether the model is required. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets the cached string to display for null values. - The cached string to display for null values. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that represents order of the current metadata. - A cached value that represents order of the current metadata. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a short display name. - A short display name. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that indicates whether the property should be displayed in read-only views such as list and detail views. - A cached value that indicates whether the property should be displayed in read-only views such as list and detail views. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that indicates whether the model should be displayed in editable views. - A cached value that indicates whether the model should be displayed in editable views. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets the cached simple display string for the model. - The cached simple display string for the model. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached hint that suggests what template to use for this model. - A cached hint that suggests what template to use for this model. - - - This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that can be used as a watermark. - A cached value that can be used as a watermark. - - - Gets or sets a cached value that indicates whether empty strings that are posted back in forms should be converted to null. - A cached value that indicates whether empty strings that are posted back in forms should be converted to null. - - - Gets or sets meta information about the data type. - The meta information about the data type. - - - Gets or sets the description of the model. - The description of the model. - - - Gets or sets the display format string for the model. - The display format string for the model. - - - Gets or sets the display name of the model. - The display name of the model. - - - Gets or sets the edit format string of the model. - The edit format string of the model. - - - Gets or sets the simple display string for the model. - The simple display string for the model. - - - Gets or sets a value that indicates whether the model object should be rendered using associated HTML elements. - A value that indicates whether the model object should be rendered using associated HTML elements. - - - Gets or sets a value that indicates whether the model is read-only. - A value that indicates whether the model is read-only. - - - Gets or sets a value that indicates whether the model is required. - A value that indicates whether the model is required. - - - Gets or sets the string to display for null values. - The string to display for null values. - - - Gets or sets a value that represents order of the current metadata. - The order value of the current metadata. - - - Gets or sets the prototype cache. - The prototype cache. - - - Gets or sets a short display name. - The short display name. - - - Gets or sets a value that indicates whether the property should be displayed in read-only views such as list and detail views. - true if the model should be displayed in read-only views; otherwise, false. - - - Gets or sets a value that indicates whether the model should be displayed in editable views. - true if the model should be displayed in editable views; otherwise, false. - - - Gets or sets the simple display string for the model. - The simple display string for the model. - - - Gets or sets a hint that suggests what template to use for this model. - A hint that suggests what template to use for this model. - - - Gets or sets a value that can be used as a watermark. - A value that can be used as a watermark. - - - Provides a mechanism to propagates notification that model binder operations should be canceled. - - - Initializes a new instance of the class. - - - Returns the default cancellation token. - The default cancellation token.Implements - The controller context. - The binding context. - - - Represents an attribute that is used to indicate that an action method should be called only as a child action. - - - Initializes a new instance of the class. - - - Called when authorization is required. - An object that encapsulates the information that is required in order to authorize access to the child action. - - - Represents a value provider for values from child actions. - - - Initializes a new instance of the class. - The controller context. - - - Retrieves a value object using the specified key. - The value object for the specified key. - The key. - - - Represents a factory for creating value provider objects for child actions. - - - Initializes a new instance of the class. - - - Returns a object for the specified controller context. - A object. - The controller context. - - - Returns the client data-type model validators. - - - Initializes a new instance of the class. - - - Returns the client data-type model validators. - The client data-type model validators. - The metadata. - The context. - - - Gets the resource class key. - The resource class key. - - - Provides an attribute that compares two properties of a model. - - - Initializes a new instance of the class. - The property to compare with the current property. - - - Applies formatting to an error message based on the data field where the compare error occurred. - The formatted error message. - The name of the field that caused the validation failure. - - - Formats the property for client validation by prepending an asterisk (*) and a dot. - The string "*." is prepended to the property. - The property. - - - Gets a list of compare-value client validation rules for the property using the specified model metadata and controller context. - A list of compare-value client validation rules. - The model metadata. - The controller context. - - - Determines whether the specified object is equal to the compared object. - null if the value of the compared property is equal to the value parameter; otherwise, a validation result that contains the error message that indicates that the comparison failed. - The value of the object to compare. - The validation context. - - - Gets the property to compare with the current property. - The property to compare with the current property. - - - Gets the other properties display name. - The other properties display name. - - - Represents a user-defined content type that is the result of an action method. - - - Initializes a new instance of the class. - - - Gets or sets the content. - The content. - - - Gets or sets the content encoding. - The content encoding. - - - Gets or sets the type of the content. - The type of the content. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Provides methods that respond to HTTP requests that are made to an ASP.NET MVC Web site. - - - Initializes a new instance of the class. - - - Gets the action invoker for the controller. - The action invoker. - - - Provides asynchronous operations. - Returns . - - - Begins execution of the specified request context - Returns an IAsyncController instance. - The request context. - The asynchronous callback. - The state. - - - Begins to invoke the action in the current controller context. - Returns an IAsyncController instance. - The callback. - The state. - - - Gets or sets the binder. - The binder. - - - Creates a content result object by using a string. - The content result instance. - The content to write to the response. - - - Creates a content result object by using a string and the content type. - The content result instance. - The content to write to the response. - The content type (MIME type). - - - Creates a content result object by using a string, the content type, and content encoding. - The content result instance. - The content to write to the response. - The content type (MIME type). - The content encoding. - - - Creates an action invoker. - An action invoker. - - - Creates a temporary data provider. - A temporary data provider. - - - Gets whether to disable the asynchronous support for the controller. - true to disable the asynchronous support for the controller; otherwise, false. - - - Releases all resources that are used by the current instance of the class. - - - Releases unmanaged resources and optionally releases managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Ends the invocation of the action in the current controller context. - The asynchronous result. - - - Ends the execute core. - The asynchronous result. - - - Invokes the action in the current controller context. - - - Creates a FileContentResult object by using the file contents and file type. - The file-content result object. - The binary content to send to the response. - The content type (MIME type). - - - Creates a FileContentResult object by using the file contents, content type, and the destination file name. - The file-content result object. - The binary content to send to the response. - The content type (MIME type). - The file name to use in the file-download dialog box that is displayed in the browser. - - - Creates a FileStreamResult object by using the Stream object and content type. - The file-content result object. - The stream to send to the response. - The content type (MIME type). - - - Creates a FileStreamResult object using the Stream object, the content type, and the target file name. - The file-stream result object. - The stream to send to the response. - The content type (MIME type) - The file name to use in the file-download dialog box that is displayed in the browser. - - - Creates a FilePathResult object by using the file name and the content type. - The file-stream result object. - The path of the file to send to the response. - The content type (MIME type). - - - Creates a FilePathResult object by using the file name, the content type, and the file download name. - The file-stream result object. - The path of the file to send to the response. - The content type (MIME type). - The file name to use in the file-download dialog box that is displayed in the browser. - - - Called when a request matches this controller, but no method with the specified action name is found in the controller. - The name of the attempted action. - - - Gets HTTP-specific information about an individual HTTP request. - The HTTP context. - - - Returns an instance of the class. - An instance of the class. - - - Returns an instance of the class. - An instance of the class. - The status description. - - - Initializes data that might not be available when the constructor is called. - The HTTP context and route data. - - - Creates a object. - The object that writes the script to the response. - The JavaScript code to run on the client - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON). - The JSON result object that serializes the specified object to JSON format. The result object that is prepared by this method is written to the response by the ASP.NET MVC framework when the object is executed. - The JavaScript object graph to serialize. - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format. - The JSON result object that serializes the specified object to JSON format. - The JavaScript object graph to serialize. - The content type (MIME type). - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format. - The JSON result object that serializes the specified object to JSON format. - The JavaScript object graph to serialize. - The content type (MIME type). - The content encoding. - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format using the content type, content encoding, and the JSON request behavior. - The result object that serializes the specified object to JSON format. - The JavaScript object graph to serialize. - The content type (MIME type). - The content encoding. - The JSON request behavior - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format using the specified content type and JSON request behavior. - The result object that serializes the specified object to JSON format. - The JavaScript object graph to serialize. - The content type (MIME type). - The JSON request behavior - - - Creates a JsonResult object that serializes the specified object to JavaScript Object Notation (JSON) format using the specified JSON request behavior. - The result object that serializes the specified object to JSON format. - The JavaScript object graph to serialize. - The JSON request behavior. - - - Gets the model state dictionary object that contains the state of the model and of model-binding validation. - The model state dictionary. - - - Called after the action method is invoked. - Information about the current request and action. - - - Called before the action method is invoked. - Information about the current request and action. - - - Called when authorization occurs. - Information about the current request and action. - - - Called when authorization challenge occurs. - Information about the current request and action. - - - Called when authorization occurs. - Information about the current request and action. - - - Called when an unhandled exception occurs in the action. - Information about the current request and action. - - - Called after the action result that is returned by an action method is executed. - Information about the current request and action result. - - - Called before the action result that is returned by an action method is executed. - Information about the current request and action result. - - - Creates a object that renders a partial view. - A partial-view result object. - - - Creates a object that renders a partial view, by using the specified model. - A partial-view result object. - The model that is rendered by the partial view - - - Creates a object that renders a partial view, by using the specified view name. - A partial-view result object. - The name of the view that is rendered to the response. - - - Creates a object that renders a partial view, by using the specified view name and model. - A partial-view result object. - The name of the view that is rendered to the response. - The model that is rendered by the partial view - - - Gets the HTTP context profile. - The HTTP context profile. - - - Creates a object that redirects to the specified URL. - The redirect result object. - The URL to redirect to. - - - Returns an instance of the class with the Permanent property set to true. - An instance of the class with the Permanent property set to true. - The URL to redirect to. - - - Redirects to the specified action using the action name. - The redirect result object. - The name of the action. - - - Redirects to the specified action using the action name and route values. - The redirect result object. - The name of the action. - The parameters for a route. - - - Redirects to the specified action using the action name and controller name. - The redirect result object. - The name of the action. - The name of the controller. - - - Redirects to the specified action using the action name, controller name, and route dictionary. - The redirect result object. - The name of the action. - The name of the controller. - The parameters for a route. - - - Redirects to the specified action using the action name, controller name, and route values. - The redirect result object. - The name of the action. - The name of the controller. - The parameters for a route. - - - Redirects to the specified action using the action name and route dictionary. - The redirect result object. - The name of the action. - The parameters for a route. - - - Returns an instance of the class with the Permanent property set to true using the specified action name. - An instance of the class with the Permanent property set to true using the specified action name, controller name, and route values. - The action name. - - - Returns an instance of the class with the Permanent property set to true using the specified action name, and route values. - An instance of the class with the Permanent property set to true using the specified action name, and route values. - The action name. - The route values. - - - Returns an instance of the class with the Permanent property set to true using the specified action name, and controller name. - An instance of the class with the Permanent property set to true using the specified action name, and controller name. - The action name. - The controller name. - - - Returns an instance of the class with the Permanent property set to true using the specified action name, controller name, and route values. - An instance of the class with the Permanent property set to true using the specified action name, controller name, and route values. - The action name. - The controller name. - The route values. - - - Returns an instance of the class with the Permanent property set to true using the specified action name, controller name, and route values. - An instance of the class with the Permanent property set to true using the specified action name, controller name, and route values. - The action name. - The controller name. - The route values. - - - Returns an instance of the class with the Permanent property set to true using the specified action name, and route values. - An instance of the class with the Permanent property set to true using the specified action name, and route values. - The action name. - The route values. - - - Redirects to the specified route using the specified route values. - The redirect-to-route result object. - The parameters for a route. - - - Redirects to the specified route using the route name. - The redirect-to-route result object. - The name of the route. - - - Redirects to the specified route using the route name and route values. - The redirect-to-route result object. - The name of the route. - The parameters for a route. - - - Redirects to the specified route using the route name and route dictionary. - The redirect-to-route result object. - The name of the route. - The parameters for a route. - - - Redirects to the specified route using the route dictionary. - The redirect-to-route result object. - The parameters for a route. - - - Returns an instance of the RedirectResult class with the Permanent property set to true using the specified route values. - Returns an instance of the RedirectResult class with the Permanent property set to true. - The route name. - - - Returns an instance of the RedirectResult class with the Permanent property set to true using the specified route name. - Returns an instance of the RedirectResult class with the Permanent property set to true using the specified route name. - The route name. - - - Returns an instance of the RedirectResult class with the Permanent property set to true using the specified route name and route values. - An instance of the RedirectResult class with the Permanent property set to true using the specified route name and route values. - The route name. - The route values. - - - Returns an instance of the RedirectResult class with the Permanent property set to true using the specified route name and route values. - An instance of the RedirectResult class with the Permanent property set to true. - The route name. - The route values. - - - Returns an instance of the RedirectResult class with the Permanent property set to true using the specified route values. - An instance of the RedirectResult class with the Permanent property set to true using the specified route values. - The route values. - - - Gets the HttpRequestBase object for the current HTTP request. - The request object. - - - Represents a replaceable dependency resolver providing services. By default, it uses the . - - - Gets the HttpResponseBase object for the current HTTP response. - The HttpResponseBase object for the current HTTP response. - - - Gets the route data for the current request. - The route data. - - - Gets the HttpServerUtilityBase object that provides methods that are used during Web request processing. - The HTTP server object. - - - Gets the HttpSessionStateBase object for the current HTTP request. - The HTTP session-state object for the current HTTP request. - - - This method calls the BeginExecute method. - The result of the operation. - The request context. - The asynchronous callback. - The state of the object. - - - This method calls the EndExecute method. - The asynchronous result of the operation. - - - This method calls the OnAuthentication method. - The filter context. - - - This method calls the OnAuthenticationChallenge method. - The filter context. - - - This method calls the OnActionExecuted method. - The filter context. - - - This method calls the OnActionExecuting method. - The filter context. - - - This method calls the OnAuthorization method. - The filter context. - - - This method calls the OnException method. - The filter context. - - - This method calls the OnResultExecuted method. - The filter context. - - - This method calls the OnResultExecuting method. - The filter context. - - - Gets the temporary-data provider object that is used to store data for the next request. - The temporary-data provider. - - - Updates the specified model instance using values from the controller's current value provider. - true if the update is successful; otherwise, false. - The model instance to update. - The type of the model object. - The parameter or the ValueProvider property is null. - - - Updates the specified model instance using values from the controller's current value provider and a prefix. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider. - The type of the model object. - The parameter or the ValueProvider property is null. - - - Updates the specified model instance using values from the controller's current value provider, a prefix, and included properties. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - The type of the model object. - The parameter or the ValueProvider property is null. - - - Updates the specified model instance using values from the controller's current value provider, a prefix, a list of properties to exclude, and a list of properties to include. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the includeProperties parameter list. - The type of the model object. - The parameter or the ValueProvider property is null. - - - Updates the specified model instance using values from the value provider, a prefix, a list of properties to exclude , and a list of properties to include. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the includeProperties parameter list. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider, a prefix, and included properties. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider and a list of properties to include. - true if the update is successful; otherwise, false. - The model instance to update. - A list of properties of the model to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the controller's current value provider and included properties. - true if the update is successful; otherwise, false. - The model instance to update. - A list of properties of the model to update. - The type of the model object. - - - Updates the specified model instance using values from the value provider and a list of properties to include. - true if the update is successful; otherwise, false. - The model instance to update. - A list of properties of the model to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider. - true if the update is successful; otherwise, false. - The model instance to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Validates the specified model instance. - true if the model validation is successful; otherwise, false. - The model to validate. - - - Validates the specified model instance using an HTML prefix. - true if the model validation is successful; otherwise, false. - The model to validate. - The prefix to use when looking up values in the model provider. - - - Updates the specified model instance using values from the controller's current value provider. - The model instance to update. - The type of the model object. - - - Updates the specified model instance using values from the controller's current value provider and a prefix. - The model instance to update. - A prefix to use when looking up values in the value provider. - The type of the model object. - - - Updates the specified model instance using values from the controller's current value provider, a prefix, and included properties. - The model instance to update. - A prefix to use when looking up values in the value provider. - A list of properties of the model to update. - The type of the model object. - - - Updates the specified model instance using values from the controller's current value provider, a prefix, a list of properties to exclude, and a list of properties to include. - The model instance to update. - A prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the includeProperties list. - The type of the model object. - - - Updates the specified model instance using values from the value provider, a prefix, a list of properties to exclude, and a list of properties to include. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the includeProperties parameter list. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider, a prefix, and a list of properties to include. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider, a prefix, and a list of properties to include. - The model instance to update. - A list of properties of the model to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the controller object's current value provider. - The model instance to update. - A list of properties of the model to update. - The type of the model object. - - - Updates the specified model instance using values from the value provider, a prefix, and a list of properties to include. - The model instance to update. - A list of properties of the model to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider. - The model instance to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Gets the URL helper object that is used to generate URLs by using routing. - The URL helper object. - - - Gets the user security information for the current HTTP request. - The user security information for the current HTTP request. - - - Validates the specified model instance. - The model to validate. - - - Validates the specified model instance using an HTML prefix. - The model to validate. - The prefix to use when looking up values in the model provider. - - - Creates a object that renders a view to the response. - The result that renders a view to the response. - - - Creates a object by using the model that renders a view to the response. - The view result. - The model that is rendered by the view. - - - Creates a object by using the view name that renders a view. - The view result. - The name of the view that is rendered to the response. - - - Creates a object that renders the specified IView object. - The view result. - The view that is rendered to the response. - The model that is rendered by the view. - - - Creates a object using the view name and master-page name that renders a view to the response. - The view result. - The name of the view that is rendered to the response. - The name of the master page or template to use when the view is rendered. - - - Creates a object using the view name, master-page name, and model that renders a view. - The view result. - The name of the view that is rendered to the response. - The name of the master page or template to use when the view is rendered. - The model that is rendered by the view. - - - Creates a object that renders the specified IView object. - The view result. - The view that is rendered to the response. - - - Creates a object that renders the specified object. - The view result. - The view that is rendered to the response. - The model that is rendered by the view. - - - Gets the view engine collection. - The view engine collection. - - - Represents a class that is responsible for invoking the action methods of a controller. - - - Initializes a new instance of the class. - - - Gets or sets the model binders that are associated with the action. - The model binders that are associated with the action. - - - Creates the action result. - The action result object. - The controller context. - The action descriptor. - The action return value. - - - Finds the information about the action method. - Information about the action method. - The controller context. - The controller descriptor. - The name of the action. - - - Retrieves information about the controller by using the specified controller context. - Information about the controller. - The controller context. - - - Retrieves information about the action filters. - Information about the action filters. - The controller context. - The action descriptor. - - - Gets the value of the specified action-method parameter. - The value of the action-method parameter. - The controller context. - The parameter descriptor. - - - Gets the values of the action-method parameters. - The values of the action-method parameters. - The controller context. - The action descriptor. - - - Invokes the specified action by using the specified controller context. - The result of executing the action. - The controller context. - The name of the action to invoke. - The parameter is null. - The parameter is null or empty. - The thread was aborted during invocation of the action. - An unspecified error occurred during invocation of the action. - - - Invokes the specified action method by using the specified parameters and the controller context. - The result of executing the action method. - The controller context. - The action descriptor. - The parameters. - - - Invokes the specified action method by using the specified parameters, controller context, and action filters. - The context for the ActionExecuted method of the class. - The controller context. - The action filters. - The action descriptor. - The parameters. - - - Invokes the specified action result by using the specified controller context. - The controller context. - The action result. - - - Invokes the specified action result by using the specified action filters and the controller context. - The context for the ResultExecuted method of the class. - The controller context. - The action filters. - The action result. - - - - - Invokes the specified authorization filters by using the specified action descriptor and controller context. - The context for the object. - The controller context. - The authorization filters. - The action descriptor. - - - Invokes the specified exception filters by using the specified exception and controller context. - The context for the object. - The controller context. - The exception filters. - The exception. - - - Represents the base class for all MVC controllers. - - - Initializes a new instance of the class. - - - Gets or sets the controller context. - The controller context. - - - Executes the specified request context. - The request context. - The parameter is null. - - - Executes the request. - - - Initializes the specified request context. - The request context. - - - Executes the specified request context. - The request context. - - - Gets or sets the dictionary for temporary data. - The dictionary for temporary data. - - - Gets or sets a value that indicates whether request validation is enabled for this request. - true if request validation is enabled for this request; otherwise, false. The default is true. - - - Gets or sets the value provider for the controller. - The value provider for the controller. - - - Gets the dynamic view data dictionary. - The dynamic view data dictionary. - - - Gets or sets the dictionary for view data. - The dictionary for the view data. - - - Represents a class that is responsible for dynamically building a controller. - - - Initializes a new instance of the class. - - - Gets the current controller builder object. - The current controller builder. - - - Gets the default namespaces. - The default namespaces. - - - Gets the associated controller factory. - The controller factory. - - - Sets the controller factory by using the specified type. - The type of the controller factory. - The parameter is null. - The controller factory cannot be assigned from the type in the parameter. - An error occurred while the controller factory was being set. - - - Sets the specified controller factory. - The controller factory. - The parameter is null. - - - Encapsulates information about an HTTP request that matches specified and instances. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified HTTP context, URL route data, and controller. - The HTTP context. - The route data. - The controller. - - - Initializes a new instance of the class by using the specified controller context. - The controller context. - The parameter is null. - - - Initializes a new instance of the class by using the specified request context and controller. - The request context. - The controller. - One or both parameters are null. - - - Gets or sets the controller. - The controller. - - - Gets the display mode. - The display mode. - - - Gets or sets the HTTP context. - The HTTP context. - - - Gets a value that indicates whether the associated action method is a child action. - true if the associated action method is a child action; otherwise, false. - - - Gets an object that contains the view context information for the parent action method. - An object that contains the view context information for the parent action method. - - - Gets or sets the request context. - The request context. - - - Gets or sets the URL route data. - The URL route data. - - - Encapsulates information that describes a controller, such as its name, type, and actions. - - - Initializes a new instance of the class. - - - Gets the name of the controller. - The name of the controller. - - - Gets the type of the controller. - The type of the controller. - - - Finds an action method by using the specified name and controller context. - The information about the action method. - The controller context. - The name of the action. - - - Retrieves a list of action-method descriptors in the controller. - A list of action-method descriptors in the controller. - - - Retrieves custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Retrieves custom attributes of a specified type that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - The parameter is null (Nothing in Visual Basic). - - - Gets the filter attributes. - The filter attributes. - true if the cache should be used; otherwise, false. - - - Retrieves a value that indicates whether one or more instance of the specified custom attribute are defined for this member. - true if the is defined for this member; otherwise, false. - The type of the custom attribute. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The parameter is null (Nothing in Visual Basic). - - - When implemented in a derived class, gets the unique ID for the controller descriptor using lazy initialization. - The unique ID. - - - Adds the controller to the instance. - - - Initializes a new instance of the class. - - - Returns the collection of controller instance filters. - The collection of controller instance filters. - The controller context. - The action descriptor. - - - Represents an attribute that invokes a custom model binder. - - - Initializes a new instance of the class. - - - Retrieves the associated model binder. - A reference to an object that implements the interface. - - - Provides a container for common metadata, for the class, and for the class for a data model. - - - Initializes a new instance of the class. - The data-annotations model metadata provider. - The type of the container. - The model accessor. - The type of the model. - The name of the property. - The display column attribute. - - - Returns simple text for the model data. - Simple text for the model data. - - - Implements the default model metadata provider for ASP.NET MVC. - - - Initializes a new instance of the class. - - - Gets the metadata for the specified property. - The metadata for the property. - The attributes. - The type of the container. - The model accessor. - The type of the model. - The name of the property. - - - Represents the method that creates a instance. - - - Provides a model validator. - - - Initializes a new instance of the class. - The metadata for the model. - The controller context for the model. - The validation attribute for the model. - - - Gets the validation attribute for the model validator. - The validation attribute for the model validator. - - - Gets the error message for the validation failure. - The error message for the validation failure. - - - Retrieves a collection of client validation rules. - A collection of client validation rules. - - - Gets a value that indicates whether model validation is required. - true if model validation is required; otherwise, false. - - - Returns a list of validation error messages for the model. - A list of validation error messages for the model, or an empty list if no errors have occurred. - The container for the model. - - - Provides a model validator for a specified validation type. - - - - Initializes a new instance of the class. - The metadata for the model. - The controller context for the model. - The validation attribute for the model. - - - Gets the validation attribute from the model validator. - The validation attribute from the model validator. - - - Implements the default validation provider for ASP.NET MVC. - - - Initializes a new instance of the class. - - - Gets or sets a value that indicates whether non-nullable value types are required. - true if non-nullable value types are required; otherwise, false. - - - Gets a list of validators. - A list of validators. - The metadata. - The context. - The list of validation attributes. - - - Registers an adapter to provide client-side validation. - The type of the validation attribute. - The type of the adapter. - - - Registers an adapter factory for the validation provider. - The type of the attribute. - The factory that will be used to create the object for the specified attribute. - - - Registers the default adapter. - The type of the adapter. - - - Registers the default adapter factory. - The factory that will be used to create the object for the default adapter. - - - Registers an adapter to provide default object validation. - The type of the adapter. - - - Registers an adapter factory for the default object validation provider. - The factory. - - - Registers an adapter to provide object validation. - The type of the model. - The type of the adapter. - - - Registers an adapter factory for the object validation provider. - The type of the model. - The factory. - - - Provides a factory for validators that are based on . - - - Provides a container for the error-information model validator. - - - Initializes a new instance of the class. - - - Gets a list of error-information model validators. - A list of error-information model validators. - The model metadata. - The controller context. - - - Represents the controller factory that is registered by default. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using a controller activator. - An object that implements the controller activator interface. - - - Creates the specified controller by using the specified request context. - The controller. - The context of the HTTP request, which includes the HTTP context and route data. - The name of the controller. - The parameter is null. - The parameter is null or empty. - - - Retrieves the controller instance for the specified request context and controller type. - The controller instance. - The context of the HTTP request, which includes the HTTP context and route data. - The type of the controller. - - is null. - - cannot be assigned. - An instance of cannot be created. - - - Returns the controller's session behavior. - The controller's session behavior. - The request context. - The type of the controller. - - - Retrieves the controller type for the specified name and request context. - The controller type. - The context of the HTTP request, which includes the HTTP context and route data. - The name of the controller. - - - Releases the specified controller. - The controller to release. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. This method calls the method. - The controller's session behavior. - The request context. - The controller name. - - - Maps a browser request to a data object. This class provides a concrete implementation of a model binder. - - - Initializes a new instance of the class. - - - Gets or sets the model binders for the application. - The model binders for the application. - - - Binds the model by using the specified controller context and binding context. - The bound object. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - The parameter is null. - - - Binds the specified property by using the specified controller context and binding context and the specified property descriptor. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - Describes a property to be bound. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. - - - Creates the specified model type by using the specified controller context and binding context. - A data object of the specified type. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - The type of the model object to return. - - - Creates an index (a subindex) based on a category of components that make up a larger index, where the specified index value is an integer. - The name of the subindex. - The prefix for the subindex. - The index value. - - - Creates an index (a subindex) based on a category of components that make up a larger index, where the specified index value is a string. - The name of the subindex. - The prefix for the subindex. - The index value. - - - Creates the name of the subproperty by using the specified prefix and property name. - The name of the subproperty. - The prefix for the subproperty. - The name of the property. - - - Returns a set of properties that match the property filter restrictions that are established by the specified . - An enumerable set of property descriptors. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Returns the properties of the model by using the specified controller context and binding context. - A collection of property descriptors. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Returns the value of a property using the specified controller context, binding context, property descriptor, and property binder. - An object that represents the property value. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - The descriptor for the property to access. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. - An object that provides a way to bind the property. - - - Returns the descriptor object for a type that is specified by its controller context and binding context. - A custom type descriptor object. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Determines whether a data model is valid for the specified binding context. - true if the model is valid; otherwise, false. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - The parameter is null. - - - Called when the model is updated. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Called when the model is updating. - true if the model is updating; otherwise, false. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Called when the specified property is validated. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - Describes a property to be validated. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. - The value to set for the property. - - - Called when the specified property is validating. - true if the property is validating; otherwise, false. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - Describes a property being validated. The descriptor provides information such as component type, property type, and property value. It also provides methods to get or set the property value. - The value to set for the property. - - - Gets or sets the name of the resource file (class key) that contains localized string values. - The name of the resource file (class key). - - - Sets the specified property by using the specified controller context, binding context, and property value. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - Describes a property to be set. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. - The value to set for the property. - - - Represents a memory cache for view locations. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified cache time span. - The cache time span. - The Ticks attribute of the parameter is set to a negative number. - - - Retrieves the default view location by using the specified HTTP context and cache key. - The default view location. - The HTTP context. - The cache key - The parameter is null. - - - Inserts the view in the specified virtual path by using the specified HTTP context, cache key, and virtual path. - The HTTP context. - The cache key. - The virtual path - The parameter is null. - - - Creates an empty view location cache. - - - Gets or sets the cache time span. - The cache time span. - - - Provides a registration point for dependency resolvers that implement or the Common Service Locator IServiceLocator interface. - - - Initializes a new instance of the class. - - - Gets the implementation of the dependency resolver. - The implementation of the dependency resolver. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. - The implementation of the dependency resolver. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. - The function that provides the service. - The function that provides the services. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. - The common service locator. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. - The object that implements the dependency resolver. - - - Provides a registration point for dependency resolvers using the specified service delegate and specified service collection delegates. - The service delegate. - The services delegates. - - - Provides a registration point for dependency resolvers using the provided common service locator when using a service locator interface. - The common service locator. - - - Provides a registration point for dependency resolvers, using the specified dependency resolver interface. - The dependency resolver. - - - Provides a type-safe implementation of and . - - - Resolves singly registered services that support arbitrary object creation. - The requested service or object. - The dependency resolver instance that this method extends. - The type of the requested service or object. - - - Resolves multiply registered services. - The requested services. - The dependency resolver instance that this method extends. - The type of the requested services. - - - Represents the base class for value providers whose values come from a collection that implements the interface. - The type of the value. - - - Initializes a new instance of the class. - The name/value pairs that are used to initialize the value provider. - Information about a specific culture, such as the names of the culture, the writing system, and the calendar used. - The parameter is null. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - The parameter is null. - - - Gets the keys from the prefix. - The keys from the prefix. - the prefix. - - - Returns a value object using the specified key and controller context. - The value object for the specified key. - The key of the value object to retrieve. - The parameter is null. - - - Provides an empty metadata provider for data models that do not require metadata. - - - Initializes a new instance of the class. - - - Creates a new instance of the class. - A new instance of the class. - The attributes. - The type of the container. - The model accessor. - The type of the model. - The name of the model. - - - Provides an empty validation provider for models that do not require a validator. - - - Initializes a new instance of the class. - - - Gets the empty model validator. - The empty model validator. - The metadata. - The context. - - - Represents a result that does nothing, such as a controller action method that returns nothing. - - - Initializes a new instance of the class. - - - Executes the specified result context. - The result context. - - - Provides the context for using the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class for the specified exception by using the specified controller context. - The controller context. - The exception. - The parameter is null. - - - Gets or sets the exception object. - The exception object. - - - Gets or sets a value that indicates whether the exception has been handled. - true if the exception has been handled; otherwise, false. - - - Gets or sets the action result. - The action result. - - - Provides a helper class to get the model name from an expression. - - - Gets the model name from a lambda expression. - The model name. - The expression. - - - Gets the model name from a string expression. - The model name. - The expression. - - - Provides a container for client-side field validation metadata. - - - Initializes a new instance of the class. - - - Gets or sets the name of the data field. - The name of the data field. - - - Gets or sets a value that indicates whether the validation message contents should be replaced with the client validation error. - true if the validation message contents should be replaced with the client validation error; otherwise, false. - - - Gets or sets the validator message ID. - The validator message ID. - - - Gets the client validation rules. - The client validation rules. - - - Sends the contents of a binary file to the response. - - - Initializes a new instance of the class by using the specified file contents and content type. - The byte array to send to the response. - The content type to use for the response. - The parameter is null. - - - The binary content to send to the response. - The file contents. - - - Writes the file content to the response. - The response. - - - Sends the contents of a file to the response. - - - Initializes a new instance of the class by using the specified file name and content type. - The name of the file to send to the response. - The content type of the response. - The parameter is null or empty. - - - Gets or sets the path of the file that is sent to the response. - The path of the file that is sent to the response. - - - Writes the file to the response. - The response. - - - Represents a base class that is used to send binary file content to the response. - - - Initializes a new instance of the class. - The type of the content. - The parameter is null or empty. - - - Gets the content type to use for the response. - The type of the content. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Gets or sets the content-disposition header so that a file-download dialog box is displayed in the browser with the specified file name. - The name of the file. - - - Writes the file to the response. - The response. - - - Sends binary content to the response by using a instance. - - - Initializes a new instance of the class. - The stream to send to the response. - The content type to use for the response. - The parameter is null. - - - Gets the stream that will be sent to the response. - The file stream. - - - Writes the file to the response. - The response. - - - Represents a metadata class that contains a reference to the implementation of one or more of the filter interfaces, the filter's order, and the filter's scope. - - - Initializes a new instance of the class. - The instance. - The scope. - The order. - - - Represents a constant that is used to specify the default ordering of filters. - - - Gets the instance of this class. - The instance of this class. - - - Gets the order in which the filter is applied. - The order in which the filter is applied. - - - Gets the scope ordering of the filter. - The scope ordering of the filter. - - - Represents the base class for action and result filter attributes. - - - Initializes a new instance of the class. - - - Gets or sets a value that indicates whether more than one instance of the filter attribute can be specified. - true if more than one instance of the filter attribute can be specified; otherwise, false. - - - Gets or sets the order in which the action filters are executed. - The order in which the action filters are executed. - - - Defines a filter provider for filter attributes. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and optionally caches attribute instances. - true to cache attribute instances; otherwise, false. - - - Gets a collection of custom action attributes. - A collection of custom action attributes. - The controller context. - The action descriptor. - - - Gets a collection of controller attributes. - A collection of controller attributes. - The controller context. - The action descriptor. - - - Aggregates the filters from all of the filter providers into one collection. - The collection filters from all of the filter providers. - The controller context. - The action descriptor. - - - Encapsulates information about the available action filters. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified filters collection. - The filters collection. - - - Gets all the action filters in the application. - The action filters. - - - Gets all the authentication filters in the application. - The list of authentication filters. - - - Gets all the authorization filters in the application. - The authorization filters. - - - Gets all the exception filters in the application. - The exception filters. - - - Gets all the result filters in the application. - The result filters. - - - Represents the collection of filter providers for the application. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with specified list of filter provider. - The list of filter providers. - - - Removes all elements from the collection. - - - Returns the collection of filter providers. - The collection of filter providers. - The controller context. - The action descriptor. - - - Inserts an element into the collection at the specified index. - The zero-based index at which item should be inserted. - The object to insert. The value can be null for reference types. - - - Removes the element at the specified index of the collection - The zero-based index of the element to remove. - - - Replaces the element at the specified index. - The zero-based index of the element to replace. - The new value for the element at the specified index. The value can be null for reference types. - - - Provides a registration point for filters. - - - Provides a registration point for filters. - The collection of filters. - - - Defines values that specify the order in which ASP.NET MVC filters run within the same filter type and filter order. - - - Specifies an order before and after . - - - Specifies an order before and after . - - - Specifies first. - - - Specifies an order before and after . - - - Specifies last. - - - Contains the form value providers for the application. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The collection. - The parameter is null. - - - Gets the specified value provider. - The value provider. - The name of the value provider to get. - The parameter is null or empty. - - - Gets a value that indicates whether the value provider contains an entry that has the specified prefix. - true if the value provider contains an entry that has the specified prefix; otherwise, false. - The prefix to look for. - - - Gets a value from a value provider using the specified key. - A value from a value provider. - The key. - - - Returns a dictionary that contains the value providers. - A dictionary of value providers. - - - Encapsulates information that is required in order to validate and process the input data from an HTML form. - - - Initializes a new instance of the class. - - - Gets the field validators for the form. - A dictionary of field validators for the form. - - - Gets or sets the form identifier. - The form identifier. - - - Returns a serialized object that contains the form identifier and field-validation values for the form. - A serialized object that contains the form identifier and field-validation values for the form. - - - Returns the validation value for the specified input field. - The value to validate the field input with. - The name of the field to retrieve the validation value for. - The parameter is either null or empty. - - - Returns the validation value for the specified input field and a value that indicates what to do if the validation value is not found. - The value to validate the field input with. - The name of the field to retrieve the validation value for. - true to create a validation value if one is not found; otherwise, false. - The parameter is either null or empty. - - - Returns a value that indicates whether the specified field has been rendered in the form. - true if the field has been rendered; otherwise, false. - The field name. - - - Sets a value that indicates whether the specified field has been rendered in the form. - The field name. - true to specify that the field has been rendered in the form; otherwise, false. - - - Determines whether client validation errors should be dynamically added to the validation summary. - true if client validation errors should be added to the validation summary; otherwise, false. - - - Gets or sets the identifier for the validation summary. - The identifier for the validation summary. - - - Enumerates the HTTP request types for a form. - - - Specifies a GET request. - - - Specifies a POST request. - - - Represents a value provider for form values that are contained in a object. - - - Initializes a new instance of the class. - An object that encapsulates information about the current HTTP request. - - - Represents a class that is responsible for creating a new instance of a form-value provider object. - - - Initializes a new instance of the class. - - - Returns a form-value provider object for the specified controller context. - A form-value provider object. - An object that encapsulates information about the current HTTP request. - The parameter is null. - - - Represents a class that contains all the global filters. - - - Initializes a new instance of the class. - - - Adds the specified filter to the global filter collection. - The filter. - - - Adds the specified filter to the global filter collection using the specified filter run order. - The filter. - The filter run order. - - - Removes all filters from the global filter collection. - - - Determines whether a filter is in the global filter collection. - true if is found in the global filter collection; otherwise, false. - The filter. - - - Gets the number of filters in the global filter collection. - The number of filters in the global filter collection. - - - Returns an enumerator that iterates through the global filter collection. - An enumerator that iterates through the global filter collection. - - - Removes all the filters that match the specified filter. - The filter to remove. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. - An enumerator that iterates through the global filter collection. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. - An enumerator that iterates through the global filter collection. - The controller context. - The action descriptor. - - - Represents the global filter collection. - - - Gets or sets the global filter collection. - The global filter collection. - - - Represents an attribute that is used to handle an exception that is thrown by an action method. - - - Initializes a new instance of the class. - - - Gets or sets the type of the exception. - The type of the exception. - - - Gets or sets the master view for displaying exception information. - The master view. - - - Called when an exception occurs. - The action-filter context. - The parameter is null. - - - Gets the unique identifier for this attribute. - The unique identifier for this attribute. - - - Gets or sets the page view for displaying exception information. - The page view. - - - Encapsulates information for handling an error that was thrown by an action method. - - - Initializes a new instance of the class. - The exception. - The name of the controller. - The name of the action. - The parameter is null. - The or parameter is null or empty. - - - Gets or sets the name of the action that was executing when the exception was thrown. - The name of the action. - - - Gets or sets the name of the controller that contains the action method that threw the exception. - The name of the controller. - - - Gets or sets the exception object. - The exception object. - - - Represents an attribute that is used to indicate whether a property or field value should be rendered as a hidden input element. - - - Initializes a new instance of the class. - - - Gets or sets a value that indicates whether to display the value of the hidden input element. - true if the value should be displayed; otherwise, false. - - - Enumerates the date rendering mode for HTML5. - - - The current culture formatting. - - - The RFC 3339 formatting. - - - Supports the rendering of HTML controls in a view. - - - Initializes a new instance of the class by using the specified view context and view data container. - The view context. - The view data container. - The or the viewDataContainer parameter is null. - - - Initializes a new instance of the class by using the specified view context, view data container, and route collection. - The view context. - The view data container. - The route collection. - One or more parameters is null. - - - Replaces underscore characters (_) with hyphens (-) in the specified HTML attributes. - The HTML attributes with underscore characters replaced by hyphens. - The HTML attributes. - - - Generates a hidden form field (anti-forgery token) that is validated when the form is submitted. - The generated form field (anti-forgery token). - - - Generates a hidden form field (anti-forgery token) that is validated when the form is submitted. The field value is generated using the specified salt value. - The generated form field (anti-forgery token). - The salt value, which can be any non-empty string. - - - Generates a hidden form field (anti-forgery token) that is validated when the form is submitted. The field value is generated using the specified salt value, domain, and path. - The generated form field (anti-forgery token). - The salt value, which can be any non-empty string. - The application domain. - The virtual path. - - - Converts the specified attribute value to an HTML-encoded string. - The HTML-encoded string. If the value parameter is null or empty, this method returns an empty string. - The object to encode. - - - Converts the specified attribute value to an HTML-encoded string. - The HTML-encoded string. If the value parameter is null or empty, this method returns an empty string. - The string to encode. - - - Gets or sets a value that indicates whether client validation is enabled. - true if enable client validation is enabled; otherwise, false. - - - Enables input validation that is performed by using client script in the browser. - - - Enables or disables client validation. - true to enable client validation; otherwise, false. - - - Enables or disables unobtrusive JavaScript. - - - Enables or disables unobtrusive JavaScript. - true to enable unobtrusive JavaScript; otherwise, false. - - - Converts the value of the specified object to an HTML-encoded string. - The HTML-encoded string. - The object to encode. - - - Converts the specified string to an HTML-encoded string. - The HTML-encoded string. - The string to encode. - - - Formats the value. - The formatted value. - The value. - The format string. - - - Creates an HTML element ID using the specified element name. - The ID of the HTML element. - The name of the HTML element. - The name parameter is null. - - - Creates an HTML element ID using the specified element name and a string that replaces dots in the name. - The ID of the HTML element. - The name of the HTML element. - The string that replaces dots (.) in the name parameter. - The name parameter or the idAttributeDotReplacement parameter is null. - - - Generates an HTML anchor element (a element) that links to the specified action method, and enables the user to specify the communication protocol, name of the host, and a URL fragment. - An HTML element that links to the specified action method. - The context of the HTTP request. - The collection of URL routes. - The text caption to display for the link. - The name of the route that is used to return a virtual path. - The name of the action method. - The name of the controller. - The communication protocol, such as HTTP or HTTPS. If this parameter is null, the protocol defaults to HTTP. - The name of the host. - The fragment identifier. - An object that contains the parameters for a route. - An object that contains the HTML attributes for the element. - - - Generates an HTML anchor element (a element) that links to the specified action method. - An HTML element that links to the specified action method. - The context of the HTTP request. - The collection of URL routes. - The text caption to display for the link. - The name of the route that is used to return a virtual path. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - An object that contains the HTML attributes for the element. - - - Generates an HTML anchor element (a element) that links to the specified URL route, and enables the user to specify the communication protocol, name of the host, and a URL fragment. - An HTML element that links to the specified URL route. - The context of the HTTP request. - The collection of URL routes. - The text caption to display for the link. - The name of the route that is used to return a virtual path. - The communication protocol, such as HTTP or HTTPS. If this parameter is null, the protocol defaults to HTTP. - The name of the host. - The fragment identifier. - An object that contains the parameters for a route. - An object that contains the HTML attributes for the element. - - - Generates an HTML anchor element (a element) that links to the specified URL route. - An HTML element that links to the specified URL route. - The context of the HTTP request. - The collection of URL routes. - The text caption to display for the link. - The name of the route that is used to return a virtual path. - An object that contains the parameters for a route. - An object that contains the HTML attributes for the element. - - - Returns the HTTP method that handles form input (GET or POST) as a string. - The form method string, either "get" or "post". - The HTTP method that handles the form. - - - Returns the HTML input control type as a string. - The input type string ("checkbox", "hidden", "password", "radio", or "text"). - The enumerated input type. - - - Gets the collection of unobtrusive JavaScript validation attributes using the specified HTML name attribute. - The collection of unobtrusive JavaScript validation attributes. - The HTML name attribute. - - - Gets the collection of unobtrusive JavaScript validation attributes using the specified HTML name attribute and model metadata. - The collection of unobtrusive JavaScript validation attributes. - The HTML name attribute. - The model metadata. - - - Gets or sets the HTML5 date rendering mode. - The HTML5 date rendering mode. - - - Returns a hidden input element that identifies the override method for the specified HTTP data-transfer method that was used by the client. - The override method that uses the HTTP data-transfer method that was used by the client. - The HTTP data-transfer method that was used by the client (DELETE, HEAD, or PUT). - The httpVerb parameter is not "PUT", "DELETE", or "HEAD". - - - Returns a hidden input element that identifies the override method for the specified verb that represents the HTTP data-transfer method used by the client. - The override method that uses the verb that represents the HTTP data-transfer method used by the client. - The verb that represents the HTTP data-transfer method used by the client. - The httpVerb parameter is not "PUT", "DELETE", or "HEAD". - - - Gets or sets the character that replaces periods in the ID attribute of an element. - The character that replaces periods in the ID attribute of an element. - - - Creates a dictionary from an object, by adding each public instance property as a key with its associated value to the dictionary. It will expose public properties from derived types as well. This is typically used with objects of an anonymous type. - The created dictionary of property names and property values. - The object to be converted. - - - Returns markup that is not HTML encoded. - The HTML markup without encoding. - The HTML markup. - - - Returns markup that is not HTML encoded. - The HTML markup without encoding. - The HTML markup. - - - Gets or sets the collection of routes for the application. - The collection of routes for the application. - - - Set element name used to wrap the validation message generated by and other overloads. - - - Set element name used to wrap a top-level message in and other overloads. - - - Gets or sets a value that indicates whether unobtrusive JavaScript is enabled. - true if unobtrusive JavaScript is enabled; otherwise, false. - - - The name of the CSS class that is used to style an input field when a validation error occurs. - - - The name of the CSS class that is used to style an input field when the input is valid. - - - The name of the CSS class that is used to style the error message when a validation error occurs. - - - Element name used to wrap the validation message generated by and other overloads. - - - The name of the CSS class that is used to style the validation message when the input is valid. - - - The name of the CSS class that is used to style validation summary error messages. - - - Element name used to wrap a top-level message in and other overloads. - - - The name of the CSS class that is used to style the validation summary when the input is valid. - - - Gets the view bag. - The view bag. - - - Gets or sets the context information about the view. - The context of the view. - - - Gets the current view data dictionary. - The view data dictionary. - - - Gets or sets the view data container. - The view data container. - - - Represents support for rendering HTML controls in a strongly typed view. - The type of the model. - - - Initializes a new instance of the class by using the specified view context and view data container. - The view context. - The view data container. - - - Initializes a new instance of the class by using the specified view context, view data container, and route collection. - The view context. - The view data container. - The route collection. - - - Gets the view bag. - The view bag. - - - Gets the strongly typed view data dictionary. - The strongly typed view data dictionary. - - - Represents an attribute that is used to restrict an action method so that the method handles only HTTP DELETE requests. - - - Initializes a new instance of the class. - - - Determines whether the action method delete request is valid for the specified controller context. - true if the action method request is valid for the specified controller context; otherwise, false. - The controller context. - Information about the action method. - - - Represents a value provider to use with values that come from a collection of HTTP files. - - - Initializes a new instance of the class. - An object that encapsulates information about the current HTTP request. - - - Represents a class that is responsible for creating a new instance of an HTTP file collection value provider object. - - - Initializes a new instance of the class. - - - Returns a value provider object for the specified controller context. - An HTTP file collection value provider. - An object that encapsulates information about the HTTP request. - The parameter is null. - - - Represents an attribute that is used to restrict an action method so that the method handles only HTTP GET requests. - - - Initializes a new instance of the class. - - - Determines whether the action method get request is valid for the specified controller context. - true if the action method request is valid for the specified controller context; otherwise, false. - The controller context. - Information about the action method. - - - Specifies that the HTTP request must be the HTTP HEAD method. - - - Initializes a new instance of the class. - - - Determines whether the action method request is valid for the specified controller context. - true if the action method request is valid for the specified controller context; otherwise, false. - The controller context. - Information about the action method. - - - Defines an object that is used to indicate that the requested resource was not found. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using a status description. - The status description. - - - Represents an attribute that is used to restrict an action method so that the method handles only HTTP OPTIONS requests. - - - Initializes a new instance of the class. - - - Determines whether the action method request is valid for the specified controller context. - true if the action method request is valid for the specified controller context; otherwise, false. - The controller context. - Information about the action method. - - - Represents an attribute that is used to restrict an action method so that the method handles only HTTP PATCH requests. - - - Initializes a new instance of the class. - - - Determines whether the action method request is valid for the specified controller context. - true if the action method request is valid for the specified controller context; otherwise, false. - The controller context. - Information about the action method. - - - Represents an attribute that is used to restrict an action method so that the method handles only HTTP POST requests. - - - Initializes a new instance of the class. - - - Determines whether the action method post request is valid for the specified controller context. - true if the action method request is valid for the specified controller context; otherwise, false. - The controller context. - Information about the action method. - - - Binds a model to a posted file. - - - Initializes a new instance of the class. - - - Binds the model. - The bound value.Implements - The controller context. - The binding context. - One or both parameters are null. - - - Represents an attribute that is used to restrict an action method so that the method handles only HTTP PUT requests. - - - Initializes a new instance of the class. - - - Determines whether the action method put request is valid for the specified controller context. - true if the action method request is valid for the specified controller context; otherwise, false. - The controller context. - Information about the action method. - - - Extends the class that contains the HTTP values that were sent by a client during a Web request. - - - Retrieves the HTTP data-transfer method override that was used by the client. - The HTTP data-transfer method override that was used by the client. - An object that contains the HTTP values that were sent by a client during a Web request. - The parameter is null. - The HTTP data-transfer method override was not implemented. - - - Provides a way to return an action result with a specific HTTP response status code and description. - - - Initializes a new instance of the class using a status code. - The status code. - - - Initializes a new instance of the class using a status code and status description. - The status code. - The status description. - - - Initializes a new instance of the class using a status code. - The status code. - - - Initializes a new instance of the class using a status code and status description. - The status code. - The status description. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data. - - - Gets the HTTP status code. - The HTTP status code. - - - Gets the HTTP status description. - the HTTP status description. - - - Represents the result of an unauthorized HTTP request. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the status description. - The status description. - - - Enumerates the HTTP verbs. - - - Requests that a specified URI be deleted. - - - Retrieves the information or entity that is identified by the URI of the request. - - - Retrieves the message headers for the information or entity that is identified by the URI of the request. - - - Represents a request for information about the communication options available on the request/response chain identified by the Request-URI. - - - Requests that a set of changes described in the request entity be applied to the resource identified by the Request- URI. - - - Posts a new entity as an addition to a URI. - - - Replaces an entity that is identified by a URI. - - - Defines the methods that are used in an action filter. - - - Called after the action method executes. - The filter context. - - - Called before an action method executes. - The filter context. - - - Defines the contract for an action invoker, which is used to invoke an action in response to an HTTP request. - - - Invokes the specified action by using the specified controller context. - true if the action was found; otherwise, false. - The controller context. - The name of the action. - - - Used to create an instance for the current request. - - - Creates an instance of action invoker for the current request. - The created . - - - Defines the methods that are required for an authorization filter. - - - Called when authorization is required. - The filter context. - - - Provides a way for the ASP.NET MVC validation framework to discover at run time whether a validator has support for client validation. - - - When implemented in a class, returns client validation rules for that class. - The client validation rules for this validator. - The model metadata. - The controller context. - - - Defines the methods that are required for a controller. - - - Executes the specified request context. - The request context. - - - Provides fine-grained control over how controllers are instantiated using dependency injection. - - - When implemented in a class, creates a controller. - The created controller. - The request context. - The controller type. - - - Defines the methods that are required for a controller factory. - - - Creates the specified controller by using the specified request context. - The controller. - The request context. - The name of the controller. - - - Gets the controller's session behavior. - The controller's session behavior. - The request context. - The name of the controller whose session behavior you want to get. - - - Releases the specified controller. - The controller. - - - Defines the methods that simplify service location and dependency resolution. - - - Resolves singly registered services that support arbitrary object creation. - The requested service or object. - The type of the requested service or object. - - - Resolves multiply registered services. - The requested services. - The type of the requested services. - - - Represents a special that has the ability to be enumerable. - - - Gets the keys from the prefix. - The keys. - The prefix. - - - Defines the methods that are required for an exception filter. - - - Called when an exception occurs. - The filter context. - - - Provides an interface for finding filters. - - - Returns an enumerator that contains all the instances in the service locator. - The enumerator that contains all the instances in the service locator. - The controller context. - The action descriptor. - - - Provides an interface for exposing attributes to the class. - - - When implemented in a class, provides metadata to the model metadata creation process. - The model metadata. - - - An optional interface for types which provide a . - - - Gets the MethodInfo - - - Defines the methods that are required for a model binder. - - - Binds the model to a value by using the specified controller context and binding context. - The bound value. - The controller context. - The binding context. - - - Defines methods that enable dynamic implementations of model binding for classes that implement the interface. - - - Returns the model binder for the specified type. - The model binder for the specified type. - The type of the model. - - - Defines members that specify the order of filters and whether multiple filters are allowed. - - - When implemented in a class, gets or sets a value that indicates whether multiple filters are allowed. - true if multiple filters are allowed; otherwise, false. - - - When implemented in a class, gets the filter order. - The filter order. - - - Enumerates the types of input controls. - - - A check box. - - - A hidden field. - - - A password box. - - - A radio button. - - - A text box. - - - Defines the methods that are required for a result filter. - - - Called after an action result executes. - The filter context. - - - Called before an action result executes. - The filter context. - - - Associates a route with an area in an ASP.NET MVC application. - - - Gets the name of the area to associate the route with. - The name of the area to associate the route with. - - - Defines the contract for temporary-data providers that store data that is viewed on the next request. - - - Loads the temporary data. - The temporary data. - The controller context. - - - Saves the temporary data. - The controller context. - The values. - - - Used to create an instance for the controller. - - - Creates an instance of for the controller. - The created . - - - Represents an interface that can skip request validation. - - - Retrieves the value of the object that is associated with the specified key. - The value of the object for the specified key. - The key. - true if validation should be skipped; otherwise, false. - - - Defines the methods that are required for a value provider in ASP.NET MVC. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - - - Retrieves a value object using the specified key. - The value object for the specified key, or null if the key is not found. - The key of the value object to retrieve. - - - Defines the methods that are required for a view. - - - Renders the specified view context by using the specified the writer object. - The view context. - The writer object. - - - Defines the methods that are required for a view data dictionary. - - - Gets or sets the view data dictionary. - The view data dictionary. - - - Defines the methods that are required for a view engine. - - - Finds the specified partial view by using the specified controller context. - The partial view. - The controller context. - The name of the partial view. - true to specify that the view engine returns the cached view, if a cached view exists; otherwise, false. - - - Finds the specified view by using the specified controller context. - The page view. - The controller context. - The name of the view. - The name of the master. - true to specify that the view engine returns the cached view, if a cached view exists; otherwise, false. - - - Releases the specified view by using the specified controller context. - The controller context. - The view. - - - Defines the methods that are required in order to cache view locations in memory. - - - Gets the view location by using the specified HTTP context and the cache key. - The view location. - The HTTP context. - The cache key. - - - Inserts the specified view location into the cache by using the specified HTTP context and the cache key. - The HTTP context. - The cache key. - The virtual path. - - - Provides fine-grained control over how view pages are created using dependency injection. - - - Provides fine-grained control over how view pages are created using dependency injection. - The created view page. - The controller context. - The type of the controller. - - - Sends JavaScript content to the response. - - - Initializes a new instance of the class. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Gets or sets the script. - The script. - - - The JQuery Form Value provider is used to handle JQuery formatted data in request Forms. - - - Constructs a new instance of the JQuery form ValueProvider - The context on which the ValueProvider operates. - - - Provides the necessary ValueProvider to handle JQuery Form data. - - - Constructs a new instance of the factory which provides JQuery form ValueProviders. - - - Returns the suitable ValueProvider. - The context on which the ValueProvider should operate. - - - Specifies whether HTTP GET requests from the client are allowed. - - - HTTP GET requests from the client are allowed. - - - HTTP GET requests from the client are not allowed. - - - Represents a class that is used to send JSON-formatted content to the response. - - - Initializes a new instance of the class. - - - Gets or sets the content encoding. - The content encoding. - - - Gets or sets the type of the content. - The type of the content. - - - Gets or sets the data. - The data. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Gets or sets a value that indicates whether HTTP GET requests from the client are allowed. - A value that indicates whether HTTP GET requests from the client are allowed. - - - Gets or sets the maximum length of data. - The maximum length of data. - - - Gets or sets the recursion limit. - The recursion limit. - - - Enables action methods to send and receive JSON-formatted text and to model-bind the JSON text to parameters of action methods. - - - Initializes a new instance of the class. - - - Returns a JSON value-provider object for the specified controller context. - A JSON value-provider object for the specified controller context. - The controller context. - - - Maps a browser request to a LINQ object. - - - Initializes a new instance of the class. - - - Binds the model by using the specified controller context and binding context. - The bound data object. If the model cannot be bound, this method returns null.Implements. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Provides an adapter for the MaxLengthAttribute attribute. - - - Initializes a new instance of the MaxLengthAttribute class. - The model metadata. - The controller context. - The MaxLength attribute. - - - Gets a list of client validation rules for a max length check. - A list of client validation rules for the check. - - - Provides an adapter for the MinLengthAttribute attribute. - - - Initializes a new instance of the MinLenghtAttribute class. - The model metadata. - The controller context. - The minimum length attribute. - - - Gets a list of client validation rules for the minimum length check. - A list of client validation rules for a check. - - - Represents an attribute that is used to associate a model type to a model-builder type. - - - Initializes a new instance of the class. - The type of the binder. - The parameter is null. - - - Gets or sets the type of the binder. - The type of the binder. - - - Retrieves an instance of the model binder. - A reference to an object that implements the interface. - An error occurred while an instance of the model binder was being created. - - - Represents a class that contains all model binders for the application, listed by binder type. - - - Initializes a new instance of the class. - - - Adds the specified item to the model binder dictionary. - The object to add to the instance. - The object is read-only. - - - Adds the specified item to the model binder dictionary using the specified key. - The key of the element to add. - The value of the element to add. - The object is read-only. - - is null. - An element that has the same key already exists in the object. - - - Removes all items from the model binder dictionary. - The object is read-only. - - - Determines whether the model binder dictionary contains a specified value. - true if is found in the model binder dictionary; otherwise, false. - The object to locate in the object. - - - Determines whether the model binder dictionary contains an element that has the specified key. - true if the model binder dictionary contains an element that has the specified key; otherwise, false. - The key to locate in the object. - - is null. - - - Copies the elements of the model binder dictionary to an array, starting at a specified index. - The one-dimensional array that is the destination of the elements copied from . The array must have zero-based indexing. - The zero-based index in at which copying starts. - - is null. - - is less than 0. - - is multidimensional.-or- is equal to or greater than the length of .-or- The number of elements in the source object is greater than the available space from to the end of the destination array. -or- Type cannot be cast automatically to the type of the destination array. - - - Gets the number of elements in the model binder dictionary. - The number of elements in the model binder dictionary. - - - Gets or sets the default model binder. - The default model binder. - - - Retrieves the model binder for the specified type. - The model binder. - The type of the model to retrieve. - The parameter is null. - - - Retrieves the model binder for the specified type or retrieves the default model binder. - The model binder. - The type of the model to retrieve. - true to retrieve the default model binder. - The parameter is null. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets a value that indicates whether the model binder dictionary is read-only. - true if the model binder dictionary is read-only; otherwise, false. - - - Gets or sets the specified key in an object that implements the interface. - The key for the specified item. - - - Gets a collection that contains the keys in the model binder dictionary. - A collection that contains the keys in the model binder dictionary. - - - Removes the first occurrence of the specified element from the model binder dictionary. - true if was successfully removed from the model binder dictionary; otherwise, false. This method also returns false if is not found in the model binder dictionary. - The object to remove from the object. - The object is read-only. - - - Removes the element that has the specified key from the model binder dictionary. - true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the model binder dictionary. - The key of the element to remove. - The object is read-only. - - is null. - - - Returns an enumerator that can be used to iterate through a collection. - An enumerator that can be used to iterate through the collection. - - - Gets the value that is associated with the specified key. - true if the object that implements contains an element that has the specified key; otherwise, false. - The key of the value to get. - When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. - - is null. - - - Gets a collection that contains the values in the model binder dictionary. - A collection that contains the values in the model binder dictionary. - - - No content here will be updated; please do not add material here. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using a list of model binder providers. - A list of model binder providers. - - - Removes all elements from the collection. - - - Returns a model binder of the specified type. - A model binder of the specified type. - The type of the model binder. - - - Inserts a model binder provider into the ModelBinderProviderCollection at the specified index. - The index. - The model binder provider. - - - Removes the element at the specified index of the collection. - The zero-based index of the element to remove. - - - Replaces the model binder provider element at the specified index. - The index. - The model binder provider. - - - Provides a container for model binder providers. - - - Provides a registration point for model binder providers for applications that do not use dependency injection. - The model binder provider collection. - - - Provides global access to the model binders for the application. - - - Gets the model binders for the application. - The model binders for the application. - - - Provides the context in which a model binder functions. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the binding context. - The binding context. - - - Gets or sets a value that indicates whether the binder should use an empty prefix. - true if the binder should use an empty prefix; otherwise, false. - - - Gets or sets the model. - The model. - - - Gets or sets the model metadata. - The model metadata. - - - Gets or sets the name of the model. - The name of the model. - - - Gets or sets the state of the model. - The state of the model. - - - Gets or sets the type of the model. - The type of the model. - - - Gets or sets the property filter. - The property filter. - - - Gets the property metadata. - The property metadata. - - - Gets or sets the value provider. - The value provider. - - - Represents an error that occurs during model binding. - - - Initializes a new instance of the class by using the specified exception. - The exception. - The parameter is null. - - - Initializes a new instance of the class by using the specified exception and error message. - The exception. - The error message. - The parameter is null. - - - Initializes a new instance of the class by using the specified error message. - The error message. - - - Gets or sets the error message. - The error message. - - - Gets or sets the exception object. - The exception object. - - - A collection of instances. - - - Initializes a new instance of the class. - - - Adds the specified object to the model-error collection. - The exception. - - - Adds the specified error message to the model-error collection. - The error message. - - - Provides a container for common metadata, for the class, and for the class for a data model. - - - Initializes a new instance of the class. - The provider. - The type of the container. - The model accessor. - The type of the model. - The name of the model. - - - Gets a dictionary that contains additional metadata about the model. - A dictionary that contains additional metadata about the model. - - - A reference to the model's container object. Will be non-null if the model represents a property. - - - Gets or sets the type of the container for the model. - The type of the container for the model. - - - Gets or sets a value that indicates whether empty strings that are posted back in forms should be converted to null. - true if empty strings that are posted back in forms should be converted to null; otherwise, false. The default value is true. - - - Gets or sets meta information about the data type. - Meta information about the data type. - - - The default order value, which is 10000. - - - Gets or sets the description of the model. - The description of the model. The default value is null. - - - Gets or sets the display format string for the model. - The display format string for the model. - - - Gets or sets the display name of the model. - The display name of the model. - - - Gets or sets the edit format string of the model. - The edit format string of the model. - - - Returns the metadata from the parameter for the model. - The metadata. - An expression that identifies the model. - The view data dictionary. - The type of the parameter. - The type of the value. - - - Gets the metadata from the expression parameter for the model. - The metadata for the model. - An expression that identifies the model. - The view data dictionary. - - - Gets the display name for the model. - The display name for the model. - - - Returns the simple description of the model. - The simple description of the model. - - - Gets a list of validators for the model. - A list of validators for the model. - The controller context. - - - Gets or sets a value that indicates whether the model object should be rendered using associated HTML elements. - true if the associated HTML elements that contains the model object should be included with the object; otherwise, false. - - - Gets or sets a value that indicates whether the model is a complex type. - A value that indicates whether the model is considered a complex type by the MVC framework. - - - Gets a value that indicates whether the type is nullable. - true if the type is nullable; otherwise, false. - - - Gets or sets a value that indicates whether the model is read-only. - true if the model is read-only; otherwise, false. - - - Gets or sets a value that indicates whether the model is required. - true if the model is required; otherwise, false. - - - Gets the value of the model. - The value of the model. For more information about , see the entry ASP.NET MVC 2 Templates, Part 2: ModelMetadata on Brad Wilson's blog - - - Gets the type of the model. - The type of the model. - - - Gets or sets the string to display for null values. - The string to display for null values. - - - Gets or sets a value that represents order of the current metadata. - The order value of the current metadata. - - - Gets a collection of model metadata objects that describe the properties of the model. - A collection of model metadata objects that describe the properties of the model. - - - Gets the property name. - The property name. - - - Gets or sets the provider. - The provider. - - - Gets or sets a value that indicates whether request validation is enabled. - true if request validation is enabled; otherwise, false. - - - Gets or sets a short display name. - The short display name. - - - Gets or sets a value that indicates whether the property should be displayed in read-only views such as list and detail views. - true if the model should be displayed in read-only views; otherwise, false. - - - Gets or sets a value that indicates whether the model should be displayed in editable views. - true if the model should be displayed in editable views; otherwise, false. - - - Gets or sets the simple display string for the model. - The simple display string for the model. - - - Gets or sets a hint that suggests what template to use for this model. - A hint that suggests what template to use for this model. - - - Gets or sets a value that can be used as a watermark. - The watermark. - - - Provides an abstract base class for a custom metadata provider. - - - When overridden in a derived class, initializes a new instance of the object that derives from the class. - - - Gets a object for each property of a model. - A object for each property of a model. - The container. - The type of the container. - - - Gets metadata for the specified property. - A object for the property. - The model accessor. - The type of the container. - The property to get the metadata model for. - - - Gets metadata for the specified model accessor and model type. - A object for the specified model accessor and model type. - The model accessor. - The type of the model. - - - Provides a container for the current instance. - - - Gets or sets the current object. - The current object. - - - Encapsulates the state of model binding to a property of an action-method argument, or to the argument itself. - - - Initializes a new instance of the class. - - - Returns a object that contains any errors that occurred during model binding. - The errors. - - - Returns a object that encapsulates the value that was being bound during model binding. - The value. - - - Represents the state of an attempt to bind a posted form to an action method, which includes validation information. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using values that are copied from the specified model-state dictionary. - The model-state dictionary. - The parameter is null. - - - Adds the specified item to the model-state dictionary. - The object to add to the model-state dictionary. - The model-state dictionary is read-only. - - - Adds an element that has the specified key and value to the model-state dictionary. - The key of the element to add. - The value of the element to add. - The model-state dictionary is read-only. - - is null. - An element that has the specified key already occurs in the model-state dictionary. - - - Adds the specified model error to the errors collection for the model-state dictionary that is associated with the specified key. - The key. - The exception. - - - Adds the specified error message to the errors collection for the model-state dictionary that is associated with the specified key. - The key. - The error message. - - - Removes all items from the model-state dictionary. - The model-state dictionary is read-only. - - - Determines whether the model-state dictionary contains a specific value. - true if is found in the model-state dictionary; otherwise, false. - The object to locate in the model-state dictionary. - - - Determines whether the model-state dictionary contains the specified key. - true if the model-state dictionary contains the specified key; otherwise, false. - The key to locate in the model-state dictionary. - - - Copies the elements of the model-state dictionary to an array, starting at a specified index. - The one-dimensional array that is the destination of the elements copied from the object. The array must have zero-based indexing. - The zero-based index in at which copying starts. - - is null. - - is less than 0. - - is multidimensional.-or- is equal to or greater than the length of .-or- The number of elements in the source collection is greater than the available space from to the end of the destination .-or- Type cannot be cast automatically to the type of the destination . - - - Gets the number of key/value pairs in the collection. - The number of key/value pairs in the collection. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets a value that indicates whether the collection is read-only. - true if the collection is read-only; otherwise, false. - - - Gets a value that indicates whether this instance of the model-state dictionary is valid. - true if this instance is valid; otherwise, false. - - - Determines whether there are any objects that are associated with or prefixed with the specified key. - true if the model-state dictionary contains a value that is associated with the specified key; otherwise, false. - The key. - The parameter is null. - - - Gets or sets the value that is associated with the specified key. - The model state item. - - - Gets a collection that contains the keys in the dictionary. - A collection that contains the keys of the model-state dictionary. - - - Copies the values from the specified object into this dictionary, overwriting existing values if keys are the same. - The dictionary. - - - Removes the first occurrence of the specified object from the model-state dictionary. - true if was successfully removed the model-state dictionary; otherwise, false. This method also returns false if is not found in the model-state dictionary. - The object to remove from the model-state dictionary. - The model-state dictionary is read-only. - - - Removes the element that has the specified key from the model-state dictionary. - true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the model-state dictionary. - The key of the element to remove. - The model-state dictionary is read-only. - - is null. - - - Sets the value for the specified key by using the specified value provider dictionary. - The key. - The value. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Attempts to gets the value that is associated with the specified key. - true if the object that implements contains an element that has the specified key; otherwise, false. - The key of the value to get. - When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. - - is null. - - - Gets a collection that contains the values in the dictionary. - A collection that contains the values of the model-state dictionary. - - - Provides a container for a validation result. - - - Initializes a new instance of the class. - - - Gets or sets the name of the member. - The name of the member. - - - Gets or sets the validation result message. - The validation result message. - - - Provides a base class for implementing validation logic. - - - Called from constructors in derived classes to initialize the class. - The metadata. - The controller context. - - - Gets the controller context. - The controller context. - - - When implemented in a derived class, returns metadata for client validation. - The metadata for client validation. - - - Returns a composite model validator for the model. - A composite model validator for the model. - The metadata. - The controller context. - - - Gets or sets a value that indicates whether a model property is required. - true if the model property is required; otherwise, false. - - - Gets the metadata for the model validator. - The metadata for the model validator. - - - When implemented in a derived class, validates the object. - A list of validation results. - The container. - - - Provides a list of validators for a model. - - - When implemented in a derived class, initializes a new instance of the class. - - - Gets a list of validators. - A list of validators. - The metadata. - The context. - - - No content here will be updated; please do not add material here. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using a list of model-validation providers. - A list of model-validation providers. - - - Removes all elements from the collection. - - - Returns the list of model validators. - The list of model validators. - The model metadata. - The controller context. - - - Inserts a model-validator provider into the collection. - The zero-based index at which item should be inserted. - The model-validator provider object to insert. - - - Removes the element at the specified index of the collection. - The zero-based index of the element to remove. - - - Replaces the model-validator provider element at the specified index. - The zero-based index of the model-validator provider element to replace. - The new value for the model-validator provider element. - - - Provides a container for the current validation provider. - - - Gets the model validator provider collection. - The model validator provider collection. - - - Represents a list of items that users can select more than one item from. - - - Initializes a new instance of the class by using the specified items to include in the list. - The items. - The parameter is null. - - - Initializes a new instance of the class by using the specified items to include in the list and the selected values. - The items. - The selected values. - The parameter is null. - - - Initializes a new instance of the MultiSelectList class by using the items to include in the list, the selected values, the disabled values. - The items used to build each of the list. - The selected values field. Used to match the Selected property of the corresponding . - The disabled values. Used to match the Disabled property of the corresponding . - - - Initializes a new instance of the class by using the items to include in the list, the data value field, and the data text field. - The items. - The data value field. - The data text field. - The parameter is null. - - - Initializes a new instance of the class by using the items to include in the list, the data value field, the data text field, and the selected values. - The items. - The data value field. - The data text field. - The selected values. - The parameter is null. - - - Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, the data text field, the selected values, and the disabled values. - The items used to build each of the list. - The data value field. Used to match the Value property of the corresponding . - The data text field. Used to match the Text property of the corresponding . - The selected values field. Used to match the Selected property of the corresponding . - The disabled values. Used to match the Disabled property of the corresponding . - - - Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, the data text field, and the data group field. - The items used to build each of the list. - The data value field. Used to match the Value property of the corresponding . - The data text field. Used to match the Text property of the corresponding . - The data group field. Used to match the Group property of the corresponding . - - - Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, the data text field, the data group field, and the selected values. - The items used to build each of the list. - The data value field. Used to match the Value property of the corresponding . - The data text field. Used to match the Text property of the corresponding . - The data group field. Used to match the Group property of the corresponding . - The selected values field. Used to match the Selected property of the corresponding . - - - Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, the data text field, the data group field, the selected values, and the disabled values. - The items used to build each of the list. - The data value field. Used to match the Value property of the corresponding . - The data text field. Used to match the Text property of the corresponding . - The data group field. Used to match the Group property of the corresponding . - The selected values field. Used to match the Selected property of the corresponding . - The disabled values. Used to match the Disabled property of the corresponding . - - - Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, the data text field, the data group field, the selected values, the disabled values, and the disabled groups. - The items used to build each of the list. - The data value field. Used to match the Value property of the corresponding . - The data text field. Used to match the Text property of the corresponding . - The data group field. Used to match the Group property of the corresponding . - The selected values field. Used to match the Selected property of the corresponding . - The disabled values. Used to match the Disabled property of the corresponding . - The disabled groups. Used to match the Disabled property of the corresponding . - - - Gets the data group field. - - - Gets or sets the data text field. - The data text field. - - - Gets or sets the data value field. - The data value field. - - - Gets the disabled groups. - - - Gets the disabled values. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets or sets the items in the list. - The items in the list. - - - Gets or sets the selected values. - The selected values. - - - Returns an enumerator can be used to iterate through a collection. - An enumerator that can be used to iterate through the collection. - - - When implemented in a derived class, provides a metadata class that contains a reference to the implementation of one or more of the filter interfaces, the filter's order, and the filter's scope. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and specifies the order of filters and whether multiple filters are allowed. - true to specify that multiple filters of the same type are allowed; otherwise, false. - The filter order. - - - Gets a value that indicates whether more than one instance of the filter attribute can be specified. - true if more than one instance of the filter attribute is allowed; otherwise, false.Implements. - - - Gets a value that indicates the order in which a filter is applied. - A value that indicates the order in which a filter is applied.Implements. - - - Selects the controller that will handle an HTTP request. - - - Initializes a new instance of the class. - The request context. - The parameter is null. - - - Adds the version header by using the specified HTTP context. - The HTTP context. - - - Called by ASP.NET to begin asynchronous request processing. - The status of the asynchronous call. - The HTTP context. - The asynchronous callback method. - The state of the asynchronous object. - - - Called by ASP.NET to begin asynchronous request processing using the base HTTP context. - The status of the asynchronous call. - The HTTP context. - The asynchronous callback method. - The state of the asynchronous object. - - - Gets or sets a value that indicates whether the MVC response header is disabled. - true if the MVC response header is disabled; otherwise, false. - - - Called by ASP.NET when asynchronous request processing has ended. - The asynchronous result. - - - Gets a value that indicates whether another request can use the instance. - true if the instance is reusable; otherwise, false. - - - Contains the header name of the ASP.NET MVC version. - - - Processes the request by using the specified HTTP request context. - The HTTP context. - - - Processes the request by using the specified base HTTP request context. - The HTTP context. - - - Gets the request context. - The request context. - - - Called by ASP.NET to begin asynchronous request processing using the base HTTP context. - The status of the asynchronous call. - The HTTP context. - The asynchronous callback method. - The data. - - - Called by ASP.NET when asynchronous request processing has ended. - The asynchronous result. - - - Gets a value that indicates whether another request can use the instance. - true if the instance is reusable; otherwise, false. - - - Enables processing of HTTP Web requests by a custom HTTP handler that implements the interface. - An object that provides references to the intrinsic server objects (for example, Request, Response, Session, and Server) that are used to service HTTP requests. - - - Represents an HTML-encoded string that should not be encoded again. - - - Initializes a new instance of the class. - The string to create. If no value is assigned, the object is created using an empty-string value. - - - Creates an HTML-encoded string using the specified text value. - An HTML-encoded string. - The value of the string to create . - - - Contains an empty HTML string. - - - Determines whether the specified string contains content or is either null or empty. - true if the string is null or empty; otherwise, false. - The string. - - - Verifies and processes an HTTP request. - - - Initializes a new instance of the class. - - - Called by ASP.NET to begin asynchronous request processing. - The status of the asynchronous call. - The HTTP context. - The asynchronous callback method. - The state. - - - Called by ASP.NET to begin asynchronous request processing. - The status of the asynchronous call. - The base HTTP context. - The asynchronous callback method. - The state. - - - Called by ASP.NET when asynchronous request processing has ended. - The asynchronous result. - - - Called by ASP.NET to begin asynchronous request processing. - The status of the asynchronous call. - The context. - The asynchronous callback method. - An object that contains data. - - - Called by ASP.NET when asynchronous request processing has ended. - The status of the asynchronous operations. - - - Verifies and processes an HTTP request. - The HTTP handler. - The HTTP context. - - - Creates an object that implements the IHttpHandler interface and passes the request context to it. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified factory controller object. - The controller factory. - - - Returns the HTTP handler by using the specified HTTP context. - The HTTP handler. - The request context. - - - Returns the session behavior. - The session behavior. - The request context. - - - Returns the HTTP handler by using the specified request context. - The HTTP handler. - The request context. - - - Creates instances of files. - - - Initializes a new instance of the class. - - - Creates a Razor host. - A Razor host. - The virtual path to the target file. - The physical path to the target file. - - - Extends a NameValueCollection object so that the collection can be copied to a specified dictionary. - - - Copies the specified collection to the specified destination. - The collection. - The destination. - - - Copies the specified collection to the specified destination, and optionally replaces previous entries. - The collection. - The destination. - true to replace previous entries; otherwise, false. - - - Represents the base class for value providers whose values come from a object. - - - Initializes a new instance of the class using the specified unvalidated collection. - A collection that contains the values that are used to initialize the provider. - A collection that contains the values that are used to initialize the provider. This collection will not be validated. - An object that contains information about the target culture. - - - Initializes Name Value collection provider. - Key value collection from request. - Unvalidated key value collection from the request. - Culture with which the values are to be used. - jQuery POST when sending complex Javascript objects to server does not encode in the way understandable by MVC. This flag should be set if the request should be normalized to MVC form - https://aspnetwebstack.codeplex.com/workitem/1564. - - - Initializes a new instance of the class. - A collection that contains the values that are used to initialize the provider. - An object that contains information about the target culture. - The parameter is null. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - The parameter is null. - - - Gets the keys using the specified prefix. - They keys. - The prefix. - - - Returns a value object using the specified key. - The value object for the specified key. - The key of the value object to retrieve. - The parameter is null. - - - Returns a value object using the specified key and validation directive. - The value object for the specified key. - The key. - true if validation should be skipped; otherwise, false. - - - Provides a convenience wrapper for the attribute. - - - Initializes a new instance of the class. - - - Represents an attribute that is used to indicate that a controller method is not an action method. - - - Initializes a new instance of the class. - - - Determines whether the attribute marks a method that is not an action method by using the specified controller context. - true if the attribute marks a valid non-action method; otherwise, false. - The controller context. - The method information. - - - Represents an attribute that is used to mark an action method whose output will be cached. - - - Initializes a new instance of the class. - - - Gets or sets the cache profile name. - The cache profile name. - - - Gets or sets the child action cache. - The child action cache. - - - Gets or sets the cache duration, in seconds. - The cache duration. - - - Returns a value that indicates whether a child action cache is active. - true if the child action cache is active; otherwise, false. - The controller context. - - - Gets or sets the location. - The location. - - - Gets or sets a value that indicates whether to store the cache. - true if the cache should be stored; otherwise, false. - - - This method is an implementation of and supports the ASP.NET MVC infrastructure. It is not intended to be used directly from your code. - The filter context. - - - This method is an implementation of and supports the ASP.NET MVC infrastructure. It is not intended to be used directly from your code. - The filter context. - - - This method is an implementation of and supports the ASP.NET MVC infrastructure. It is not intended to be used directly from your code. - The filter context. - - - This method is an implementation of and supports the ASP.NET MVC infrastructure. It is not intended to be used directly from your code. - The filter context. - - - Called before the action result executes. - The filter context, which encapsulates information for using . - The parameter is null. - - - Gets or sets the SQL dependency. - The SQL dependency. - - - Gets or sets the vary-by-content encoding. - The vary-by-content encoding. - - - Gets or sets the vary-by-custom value. - The vary-by-custom value. - - - Gets or sets the vary-by-header value. - The vary-by-header value. - - - Gets or sets the vary-by-param value. - The vary-by-param value. - - - Represents the attributes associated with the override filter. - - - Initializes a new instance of the class. - - - Gets the filters to override for this instance. - The filters to override for this instance. - - - Represents the attributes associated with the authentication. - - - Initializes a new instance of the class. - - - Gets the filters to override for this instance. - The filters to override for this instance. - - - Represents the attributes associated with the authorization. - - - Initializes a new instance of the class. - - - Gets the filters to override for this instance. - The filters to override for this instance. - - - Represents the attributes associated with the exception filter. - - - Initializes a new instance of the class. - - - Gets the filters to override for this instance. - The filters to override for this instance. - - - Represents the attributes associated with the result filter. - - - Initializes a new instance of the class. - - - Gets the filters to override for this instance. - The filters to override for this instance. - - - Encapsulates information for binding action-method parameters to a data model. - - - Initializes a new instance of the class. - - - Gets the model binder. - The model binder. - - - Gets a comma-delimited list of property names for which binding is disabled. - The exclude list. - - - Gets a comma-delimited list of property names for which binding is enabled. - The include list. - - - Gets the prefix to use when the MVC framework binds a value to an action parameter or to a model property. - The prefix. - - - Contains information that describes a parameter. - - - Initializes a new instance of the class. - - - Gets the action descriptor. - The action descriptor. - - - Gets the binding information. - The binding information. - - - Gets the default value of the parameter. - The default value of the parameter. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - The parameter is null. - - - Indicates whether one or more instances of a custom attribute type are defined for this member. - true if the custom attribute type is defined for this member; otherwise, false. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The parameter is null. - - - Gets the name of the parameter. - The name of the parameter. - - - Gets the type of the parameter. - The type of the parameter. - - - Represents a base class that is used to send a partial view to the response. - - - Initializes a new instance of the class. - - - Returns the object that is used to render the view. - The view engine result. - The controller context. - An error occurred while the method was attempting to find the view. - - - Provides a registration point for ASP.NET Razor pre-application start code. - - - Registers Razor pre-application start code. - - - Represents a value provider for query strings that are contained in a object. - - - Initializes a new instance of the class. - An object that encapsulates information about the current HTTP request. - - - Represents a class that is responsible for creating a new instance of a query-string value-provider object. - - - Initializes a new instance of the class. - - - Returns a value-provider object for the specified controller context. - A query-string value-provider object. - An object that encapsulates information about the current HTTP request. - The parameter is null. - - - Provides an adapter for the attribute. - - - Initializes a new instance of the class. - The model metadata. - The controller context. - The range attribute. - - - Gets a list of client validation rules for a range check. - A list of client validation rules for a range check. - - - Represents the class used to create views that have Razor syntax. - - - Initializes a new instance of the class. - The controller context. - The view path. - The layout or master page. - A value that indicates whether view start files should be executed before the view. - The set of extensions that will be used when looking up view start files. - - - Initializes a new instance of the class using the view page activator. - The controller context. - The view path. - The layout or master page. - A value that indicates whether view start files should be executed before the view. - The set of extensions that will be used when looking up view start files. - The view page activator. - - - Gets the layout or master page. - The layout or master page. - - - Renders the specified view context by using the specified writer and instance. - The view context. - The writer that is used to render the view to the response. - The instance. - - - Gets a value that indicates whether view start files should be executed before the view. - A value that indicates whether view start files should be executed before the view. - - - Gets or sets the set of file extensions that will be used when looking up view start files. - The set of file extensions that will be used when looking up view start files. - - - Represents a view engine that is used to render a Web page that uses the ASP.NET Razor syntax. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the view page activator. - The view page activator. - - - Creates a partial view using the specified controller context and partial path. - The partial view. - The controller context. - The path to the partial view. - - - Creates a view by using the specified controller context and the paths of the view and master view. - The view. - The controller context. - The path to the view. - The path to the master view. - - - Controls the processing of application actions by redirecting to a specified URI. - - - Initializes a new instance of the class. - The target URL. - The parameter is null. - - - Initializes a new instance of the class using the specified URL and permanent-redirection flag. - The URL. - A value that indicates whether the redirection should be permanent. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Gets a value that indicates whether the redirection should be permanent. - true if the redirection should be permanent; otherwise, false. - - - Gets or sets the target URL. - The target URL. - - - Represents a result that performs a redirection by using the specified route values dictionary. - - - Initializes a new instance of the class by using the specified route name and route values. - The name of the route. - The route values. - - - Initializes a new instance of the class by using the specified route name, route values, and permanent-redirection flag. - The name of the route. - The route values. - A value that indicates whether the redirection should be permanent. - - - Initializes a new instance of the class by using the specified route values. - The route values. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Gets a value that indicates whether the redirection should be permanent. - true if the redirection should be permanent; otherwise, false. - - - Gets or sets the name of the route. - The name of the route. - - - Gets or sets the route values. - The route values. - - - Contains information that describes a reflected action method. - - - Initializes a new instance of the class. - The action-method information. - The name of the action. - The controller descriptor. - Either the or parameter is null. - The parameter is null or empty. - - - Gets the name of the action. - The name of the action. - - - Gets the controller descriptor. - The controller descriptor. - - - Executes the specified controller context by using the specified action-method parameters. - The action return value. - The controller context. - The parameters. - The or parameter is null. - - - Returns an array of custom attributes defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns an array of custom attributes defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Gets the filter attributes. - The filter attributes. - true to use the cache, otherwise false. - - - Retrieves the parameters of the action method. - The parameters of the action method. - - - Retrieves the action selectors. - The action selectors. - - - Indicates whether one or more instances of a custom attribute type are defined for this member. - true if the custom attribute type is defined for this member; otherwise, false. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Gets or sets the action-method information. - The action-method information. - - - Gets the unique ID for the reflected action descriptor using lazy initialization. - The unique ID. - - - Contains information that describes a reflected controller. - - - Initializes a new instance of the class. - The type of the controller. - The parameter is null. - - - Gets the type of the controller. - The type of the controller. - - - Finds the specified action for the specified controller context. - The information about the action. - The controller context. - The name of the action. - The parameter is null. - The parameter is null or empty. - - - Returns the list of actions for the controller. - A list of action descriptors for the controller. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Gets the filter attributes. - The filter attributes. - true to use the cache, otherwise false. - - - Returns a value that indicates whether one or more instances of a custom attribute type are defined for this member. - true if the custom attribute type is defined for this member; otherwise, false. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Contains information that describes a reflected action-method parameter. - - - Initializes a new instance of the class. - The parameter information. - The action descriptor. - The or parameter is null. - - - Gets the action descriptor. - The action descriptor. - - - Gets the binding information. - The binding information. - - - Gets the default value of the reflected parameter. - The default value of the reflected parameter. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns a value that indicates whether one or more instances of a custom attribute type are defined for this member. - true if the custom attribute type is defined for this member; otherwise, false. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Gets or sets the parameter information. - The parameter information. - - - Gets the name of the parameter. - The name of the parameter. - - - Gets the type of the parameter. - The type of the parameter. - - - Provides an adapter for the attribute. - - - Initializes a new instance of the class. - The model metadata. - The controller context. - The regular expression attribute. - - - Gets a list of regular-expression client validation rules. - A list of regular-expression client validation rules. - - - Provides an attribute that uses the jQuery validation plug-in remote validator. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified route name. - The route name. - - - Initializes a new instance of the class using the specified action-method name and controller name. - The name of the action method. - The name of the controller. - - - Initializes a new instance of the class using the specified action-method name, controller name, and area name. - The name of the action method. - The name of the controller. - The name of the area. - - - Initializes a new instance of the class. - The route name. - The name of the controller. - Find the controller in the root if . Otherwise look in the current area. - - - Gets or sets the additional fields that are required for validation. - The additional fields that are required for validation. - - - Returns a comma-delimited string of validation field names. - A comma-delimited string of validation field names. - The name of the validation property. - - - Formats the error message that is displayed when validation fails. - A formatted error message. - A name to display with the error message. - - - Formats the property for client validation by prepending an asterisk (*) and a dot. - The string "*." Is prepended to the property. - The property. - - - Gets a list of client validation rules for the property. - A list of remote client validation rules for the property. - The model metadata. - The controller context. - - - Gets the URL for the remote validation call. - The URL for the remote validation call. - The controller context. - - - Gets or sets the HTTP method used for remote validation. - The HTTP method used for remote validation. The default value is "Get". - - - This method always returns true. - true - The validation target. - - - Gets the route data dictionary. - The route data dictionary. - - - Gets or sets the route name. - The route name. - - - Gets the route collection from the route table. - The route collection from the route table. - - - Provides an adapter for the attribute. - - - Initializes a new instance of the class. - The model metadata. - The controller context. - The required attribute. - - - Gets a list of required-value client validation rules. - A list of required-value client validation rules. - - - Represents an attribute that forces an unsecured HTTP request to be re-sent over HTTPS. - - - Initializes a new instance of the class. - - - Handles unsecured HTTP requests that are sent to the action method. - An object that encapsulates information that is required in order to use the attribute. - The HTTP request contains an invalid transfer method override. All GET requests are considered invalid. - - - Determines whether a request is secured (HTTPS) and, if it is not, calls the method. - An object that encapsulates information that is required in order to use the attribute. - The parameter is null. - - - Provides the context for the method of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The controller context. - The result object. - true to cancel execution; otherwise, false. - The exception object. - The parameter is null. - - - Gets or sets a value that indicates whether this instance is canceled. - true if the instance is canceled; otherwise, false. - - - Gets or sets the exception object. - The exception object. - - - Gets or sets a value that indicates whether the exception has been handled. - true if the exception has been handled; otherwise, false. - - - Gets or sets the action result. - The action result. - - - Provides the context for the method of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified controller context and action result. - The controller context. - The action result. - The parameter is null. - - - Gets or sets a value that indicates whether this value is "cancel". - true if the value is "cancel"; otherwise, false. - - - Gets or sets the action result. - The action result. - - - Defines the area to set for all the routes defined in this controller. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The name of the area. If the value is null, an attempt will be made to infer the area name from the target controller's namespace. - - - Gets the area name to set for all the routes defined in the controller. If the value is null, an attempt will be made to infer the area name from the target controller's namespace. - The area name to set for all the routes defined in the controller. - - - Gets the URL prefix to apply to the routes of this area. Defaults to the area's name. - The URL prefix to apply to the routes of this area. - - - Place on a controller or action to expose it directly via a route. When placed on a controller, it applies to actions that do not have any System.Web.Mvc.RouteAttribute’s on them. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified template. - The pattern of the route to match. - - - Gets or sets the name of the route. - The name of the route - - - Gets the order the route is applied. - The order the route is applied. - - - Creates a direct route entry. - The direct route entry. - The context to use to create the route. - - - Gets the pattern for the route to match. - The pattern to match. - - - Provides routing extensions for route collection attribute. - - - Maps the attribute-defined routes for the application. - A collection of routes. - - - Maps the attribute-defined routes for the application. - The to use for mapping routes. - - - Maps the attribute-defined routes for the application. - A collection of routes. - The to use for resolving inline constraints in route templates. - - - Maps the attribute-defined routes for the application. - The to use for resolving inline constraints in route templates. - The to use for mapping routes. - - - Extends a object for MVC routing. - - - Returns an object that contains information about the route and virtual path that are the result of generating a URL in the current area. - An object that contains information about the route and virtual path that are the result of generating a URL in the current area. - An object that contains the routes for the applications. - An object that encapsulates information about the requested route. - The name of the route to use when information about the URL path is retrieved. - An object that contains the parameters for a route. - - - Returns an object that contains information about the route and virtual path that are the result of generating a URL in the current area. - An object that contains information about the route and virtual path that are the result of generating a URL in the current area. - An object that contains the routes for the applications. - An object that encapsulates information about the requested route. - An object that contains the parameters for a route. - - - Ignores the specified URL route for the given list of available routes. - A collection of routes for the application. - The URL pattern for the route to ignore. - The or parameter is null. - - - Ignores the specified URL route for the given list of the available routes and a list of constraints. - A collection of routes for the application. - The URL pattern for the route to ignore. - A set of expressions that specify values for the parameter. - The or parameter is null. - - - Maps the specified URL route. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - The or parameter is null. - - - Maps the specified URL route and sets default route values. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - An object that contains default route values. - The or parameter is null. - - - Maps the specified URL route and sets default route values and constraints. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - An object that contains default route values. - A set of expressions that specify values for the parameter. - The or parameter is null. - - - Maps the specified URL route and sets default route values, constraints, and namespaces. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - An object that contains default route values. - A set of expressions that specify values for the parameter. - A set of namespaces for the application. - The or parameter is null. - - - Maps the specified URL route and sets default route values and namespaces. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - An object that contains default route values. - A set of namespaces for the application. - The or parameter is null. - - - Maps the specified URL route and sets the namespaces. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - A set of namespaces for the application. - The or parameter is null. - - - Represents a value provider for route data that is contained in an object that implements the interface. - - - Initializes a new instance of the class. - An object that contain information about the HTTP request. - - - Represents a factory for creating route-data value provider objects. - - - Initialized a new instance of the class. - - - Returns a value-provider object for the specified controller context. - A value-provider object. - An object that encapsulates information about the current HTTP request. - The parameter is null. - - - Annotates a controller with a route prefix that applies to all actions within the controller. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified prefix. - The route prefix for the controller. - - - Gets the route prefix. - The route prefix. - - - Represents a list that lets users select one item. - - - Initializes a new instance of the class by using the specified items for the list. - The items. - - - Initializes a new instance of the class by using the specified items for the list and a selected value. - The items. - The selected value. - - - Initializes a new instance of the SelectList class by using the specified items for the list, the selected value, and the disabled values. - The items used to build each of the list. - The selected value. Used to match the Selected property of the corresponding . - The disabled values. Used to match the Disabled property of the corresponding . - - - Initializes a new instance of the class by using the specified items for the list, the data value field, and the data text field. - The items. - The data value field. - The data text field. - - - Initializes a new instance of the class by using the specified items for the list, the data value field, the data text field, and a selected value. - The items. - The data value field. - The data text field. - The selected value. - - - Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, the data text field, the selected value, and the disabled values. - The items used to build each of the list. - The data value field. Used to match the Value property of the corresponding . - The data text field. Used to match the Text property of the corresponding . - The selected value. Used to match the Selected property of the corresponding . - The disabled values. Used to match the Disabled property of the corresponding . - - - Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, the data text field, the data group field, and the selected value. - The items used to build each of the list. - The data value field. Used to match the Value property of the corresponding . - The data text field. Used to match the Text property of the corresponding . - The data group field. Used to match the Group property of the corresponding . - The selected value. Used to match the Selected property of the corresponding . - - - Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, the data text field, the data group field, the selected value, and the disabled values. - The items used to build each of the list. - The data value field. Used to match the Value property of the corresponding . - The data text field. Used to match the Text property of the corresponding . - The data group field. Used to match the Group property of the corresponding . - The selected value. Used to match the Selected property of the corresponding . - The disabled values. Used to match the Disabled property of the corresponding . - - - Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, the data text field, the data group field. the selected value, the disabled values, and the disabled groups. - The items used to build each of the list. - The data value field. Used to match the Value property of the corresponding . - The data text field. Used to match the Text property of the corresponding . - The data group field. Used to match the Group property of the corresponding . - The selected value. Used to match the Selected property of the corresponding . - The disabled values. Used to match the Disabled property of the corresponding . - The disabled groups. Used to match the Disabled property of the corresponding . - - - Gets the list value that was selected by the user. - The selected value. - - - Represents the optgroup HTML element and its attributes. In a select list, multiple groups with the same name are supported. They are compared with reference equality. - - - - Gets or sets a value that indicates whether this is disabled. - - - Represents the value of the optgroup's label. - - - Represents the selected item in an instance of the class. - - - Initializes a new instance of the class. - - - Gets or sets a value that indicates whether this is disabled. - - - Represents the optgroup HTML element this item is wrapped into. In a select list, multiple groups with the same name are supported. They are compared with reference equality. - - - Gets or sets a value that indicates whether this is selected. - true if the item is selected; otherwise, false. - - - Gets or sets the text of the selected item. - The text. - - - Gets or sets the value of the selected item. - The value. - - - Specifies the session state of the controller. - - - Initializes a new instance of the class - The type of the session state. - - - Get the session state behavior for the controller. - The session state behavior for the controller. - - - Provides session-state data to the current object. - - - Initializes a new instance of the class. - - - Loads the temporary data by using the specified controller context. - The temporary data. - The controller context. - An error occurred when the session context was being retrieved. - - - Saves the specified values in the temporary data dictionary by using the specified controller context. - The controller context. - The values. - An error occurred the session context was being retrieved. - - - Provides an adapter for the attribute. - - - Initializes a new instance of the class. - The model metadata. - The controller context. - The string-length attribute. - - - Gets a list of string-length client validation rules. - A list of string-length client validation rules. - - - Represents a set of data that persists only from one request to the next. - - - Initializes a new instance of the class. - - - Adds an element that has the specified key and value to the object. - The key of the element to add. - The value of the element to add. - The object is read-only. - - is null. - An element that has the same key already exists in the object. - - - Removes all items from the instance. - The object is read-only. - - - Determines whether the instance contains an element that has the specified key. - true if the instance contains an element that has the specified key; otherwise, false. - The key to locate in the instance. - - is null. - - - Determines whether the dictionary contains the specified value. - true if the dictionary contains the specified value; otherwise, false. - The value. - - - Gets the number of elements in the object. - The number of elements in the object. - - - Gets the enumerator. - The enumerator. - - - Gets or sets the object that has the specified key. - The object that has the specified key. - - - Marks all keys in the dictionary for retention. - - - Marks the specified key in the dictionary for retention. - The key to retain in the dictionary. - - - Gets an object that contains the keys of elements in the object. - The keys of the elements in the object. - - - Loads the specified controller context by using the specified data provider. - The controller context. - The temporary data provider. - - - Returns an object that contains the element that is associated with the specified key, without marking the key for deletion. - An object that contains the element that is associated with the specified key. - The key of the element to return. - - - Removes the element that has the specified key from the object. - true if the element was removed successfully; otherwise, false. This method also returns false if was not found in the . instance. - The key of the element to remove. - The object is read-only. - - is null. - - - Saves the specified controller context by using the specified data provider. - The controller context. - The temporary data provider. - - - Adds the specified key/value pair to the dictionary. - The key/value pair. - - - Determines whether a sequence contains a specified element by using the default equality comparer. - true if the dictionary contains the specified key/value pair; otherwise, false. - The key/value pair to search for. - - - Copies a key/value pair to the specified array at the specified index. - The target array. - The index. - - - Gets a value that indicates whether the dictionary is read-only. - true if the dictionary is read-only; otherwise, false. - - - Deletes the specified key/value pair from the dictionary. - true if the key/value pair was removed successfully; otherwise, false. - The key/value pair. - - - Returns an enumerator that can be used to iterate through a collection. - An object that can be used to iterate through the collection. - - - Gets the value of the element that has the specified key. - true if the object that implements contains an element that has the specified key; otherwise, false. - The key of the value to get. - When this method returns, the value that is associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. - - is null. - - - Gets the object that contains the values in the object. - The values of the elements in the object that implements . - - - Encapsulates information about the current template context. - - - Initializes a new instance of the class. - - - Gets or sets the formatted model value. - The formatted model value. - - - Retrieves the full DOM ID of a field using the specified HTML name attribute. - The full DOM ID. - The value of the HTML name attribute. - - - Retrieves the fully qualified name (including a prefix) for a field using the specified HTML name attribute. - The prefixed name of the field. - The value of the HTML name attribute. - - - Gets or sets the HTML field prefix. - The HTML field prefix. - - - Contains the number of objects that were visited by the user. - The number of objects. - - - Determines whether the template has been visited by the user. - true if the template has been visited by the user; otherwise, false. - An object that encapsulates information that describes the model. - - - Contains methods to build URLs for ASP.NET MVC within an application. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified request context. - An object that contains information about the current request and about the route that it matched. - - - Initializes a new instance of the class using the specified request context and route collection. - An object that contains information about the current request and about the route that it matched. - A collection of routes. - The or the parameter is null. - - - Generates a string to a fully qualified URL to an action method. - A string to a fully qualified URL to an action method. - - - Generates a fully qualified URL to an action method by using the specified action name. - The fully qualified URL to an action method. - The name of the action method. - - - Generates a fully qualified URL to an action method by using the specified action name and route values. - The fully qualified URL to an action method. - The name of the action method. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - - - Generates a fully qualified URL to an action method by using the specified action name and controller name. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - - - Generates a fully qualified URL to an action method by using the specified action name, controller name, and route values. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - - - Generates a fully qualified URL to an action method by using the specified action name, controller name, route values, and protocol to use. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The protocol for the URL, such as "http" or "https". - - - Generates a fully qualified URL to an action method by using the specified action name, controller name, and route values. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - - - Generates a fully qualified URL for an action method by using the specified action name, controller name, route values, and protocol to use. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - The protocol for the URL, such as "http" or "https". - - - Generates a fully qualified URL for an action method by using the specified action name, controller name, route values, protocol to use and host name. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - - - Generates a fully qualified URL to an action method for the specified action name and route values. - The fully qualified URL to an action method. - The name of the action method. - An object that contains the parameters for a route. - - - Converts a virtual (relative) path to an application absolute path. - The application absolute path. - The virtual path of the content. - - - Encodes special characters in a URL string into character-entity equivalents. - An encoded URL string. - The text to encode. - - - Returns a string that contains a content URL. - A string that contains a content URL. - The content path. - The http context. - - - Returns a string that contains a URL. - A string that contains a URL. - The route name. - The action name. - The controller name. - The HTTP protocol. - The host name. - The fragment. - The route values. - The route collection. - The request context. - true to include implicit MVC values; otherwise false. - - - Returns a string that contains a URL. - A string that contains a URL. - The route name. - The action name. - The controller name. - The route values. - The route collection. - The request context. - true to include implicit MVC values; otherwise false. - - - Generates a fully qualified URL for the specified route values. - A fully qualified URL for the specified route values. - The route name. - The route values. - - - Generates a fully qualified URL for the specified route values. - A fully qualified URL for the specified route values. - The route name. - The route values. - - - Returns a value that indicates whether the URL is local. - true if the URL is local; otherwise, false. - The URL. - - - Gets information about an HTTP request that matches a defined route. - The request context. - - - Gets a collection that contains the routes that are registered for the application. - The route collection. - - - Generates a fully qualified URL for the specified route values. - The fully qualified URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - - - Generates a fully qualified URL for the specified route name. - The fully qualified URL. - The name of the route that is used to generate URL. - - - Generates a fully qualified URL for the specified route values by using a route name. - The fully qualified URL. - The name of the route that is used to generate URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - - - Generates a fully qualified URL for the specified route values by using a route name and the protocol to use. - The fully qualified URL. - The name of the route that is used to generate the URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The protocol for the URL, such as "http" or "https". - - - Generates a fully qualified URL for the specified route values by using a route name. - The fully qualified URL. - The name of the route that is used to generate URL. - An object that contains the parameters for a route. - - - Generates a fully qualified URL for the specified route values by using the specified route name, protocol to use, and host name. - The fully qualified URL. - The name of the route that is used to generate URL. - An object that contains the parameters for a route. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - - - Generates a fully qualified URL for the specified route values. - The fully qualified URL. - An object that contains the parameters for a route. - - - Represents an optional parameter that is used by the class during routing. - - - Contains the read-only value for the optional parameter. - - - Returns an empty string. This method supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. - An empty string. - - - Provides an object adapter that can be validated. - - - Initializes a new instance of the class. - The model metadata. - The controller context. - - - Validates the specified object. - A list of validation results. - The container. - - - Represents an attribute that is used to prevent forgery of a request. - - - Initializes a new instance of the class. - - - Called when authorization is required. - The filter context. - The parameter is null. - - - Gets or sets the salt string. - The salt string. - - - Represents an attribute that is used to mark action methods whose input must be validated. - - - Initializes a new instance of the class. - true to enable validation. - - - Gets or sets a value that indicates whether to enable validation. - true if validation is enabled; otherwise, false. - - - Called when authorization is required. - The filter context. - The parameter is null. - - - Represents the collection of value-provider objects for the application. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and registers the specified value providers. - The list of value providers to register. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - - - Gets the keys using the specified prefix. - They keys. - The prefix. - - - Returns a value object using the specified key. - The value object for the specified key. - The key of the value object to retrieve. - - - Returns a value object using the specified key and skip-validation parameter. - The value object for the specified key. - The key of the value object to retrieve. - true to specify that validation should be skipped; otherwise, false. - - - Inserts the specified value-provider object into the collection at the specified index location. - The zero-based index location at which to insert the value provider into the collection. - The value-provider object to insert. - The parameter is null. - - - Replaces the value provider at the specified index location with a new value provider. - The zero-based index of the element to replace. - The new value for the element at the specified index. - The parameter is null. - - - Note: This API is now obsolete.Represents a dictionary of value providers for the application. - - - Initializes a new instance of the class. - The controller context. - - - Adds the specified item to the collection of value providers. - The object to add to the object. - The object is read-only. - - - Adds an element that has the specified key and value to the collection of value providers. - The key of the element to add. - The value of the element to add. - The object is read-only. - - is null. - An element that has the specified key already exists in the object. - - - Adds an element that has the specified key and value to the collection of value providers. - The key of the element to add. - The value of the element to add. - The object is read-only. - - is null. - An element that has the specified key already exists in the object. - - - Removes all items from the collection of value providers. - The object is read-only. - - - Determines whether the collection of value providers contains the specified item. - true if is found in the collection of value providers; otherwise, false. - The object to locate in the instance. - - - Determines whether the collection of value providers contains an element that has the specified key. - true if the collection of value providers contains an element that has the key; otherwise, false. - The key of the element to find in the instance. - - is null. - - - Gets or sets the controller context. - The controller context. - - - Copies the elements of the collection to an array, starting at the specified index. - The one-dimensional array that is the destination of the elements copied from the object. The array must have zero-based indexing. - The zero-based index in at which copying starts. - - is null. - - is less than 0. - - is multidimensional.-or- is equal to or greater than the length of .-or-The number of elements in the source collection is greater than the available space from to the end of the destination .-or-Type cannot be cast automatically to the type of the destination array. - - - Gets the number of elements in the collection. - The number of elements in the collection. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets a value that indicates whether the collection is read-only. - true if the collection is read-only; otherwise, false. - - - Gets or sets the object that has the specified key. - The object. - - - Gets a collection that contains the keys of the instance. - A collection that contains the keys of the object that implements the interface. - - - Removes the first occurrence of the specified item from the collection of value providers. - true if was successfully removed from the collection; otherwise, false. This method also returns false if is not found in the collection. - The object to remove from the instance. - The object is read-only. - - - Removes the element that has the specified key from the collection of value providers. - true if the element was successfully removed; otherwise, false. This method also returns false if was not found in the collection. - The key of the element to remove. - The object is read-only. - - is null. - - - Returns an enumerator that can be used to iterate through a collection. - An enumerator that can be used to iterate through the collection. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - - - Returns a value object using the specified key. - The value object for the specified key. - The key of the value object to return. - - - Gets the value of the element that has the specified key. - true if the object that implements contains an element that has the specified key; otherwise, false. - The key of the element to get. - When this method returns, the value that is associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. - - is null. - - - Gets a collection that contains the values in the object. - A collection of the values in the object that implements the interface. - - - Represents a container for value-provider factory objects. - - - Gets the collection of value-provider factories for the application. - The collection of value-provider factory objects. - - - Represents a factory for creating value-provider objects. - - - Initializes a new instance of the class. - - - Returns a value-provider object for the specified controller context. - A value-provider object. - An object that encapsulates information about the current HTTP request. - - - Represents the collection of value-provider factories for the application. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified list of value-provider factories. - A list of value-provider factories to initialize the collection with. - - - Removes all elements from the collection. - - - Returns the value-provider factory for the specified controller context. - The value-provider factory object for the specified controller context. - An object that encapsulates information about the current HTTP request. - - - Inserts the specified value-provider factory object at the specified index location. - The zero-based index location at which to insert the value provider into the collection. - The value-provider factory object to insert. - The parameter is null. - - - Removes the element at the specified index of the . - The zero-based index of the element to remove. - - is less than zero.-or- is equal to or greater than - - - Sets the specified value-provider factory object at the given index location. - The zero-based index location at which to insert the value provider into the collection. - The value-provider factory object to set. - The parameter is null. - - - Represents the result of binding a value (such as from a form post or query string) to an action-method argument property, or to the argument itself. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified raw value, attempted value, and culture information. - The raw value. - The attempted value. - The culture. - - - Gets or sets the raw value that is converted to a string for display. - The raw value. - - - Converts the value that is encapsulated by this result to the specified type. - The converted value. - The target type. - The parameter is null. - - - Converts the value that is encapsulated by this result to the specified type by using the specified culture information. - The converted value. - The target type. - The culture to use in the conversion. - The parameter is null. - - - Gets or sets the culture. - The culture. - - - Gets or set the raw value that is supplied by the value provider. - The raw value. - - - Encapsulates information that is related to rendering a view. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified controller context, view, view data dictionary, temporary data dictionary, and text writer. - Encapsulates information about the HTTP request. - The view to render. - The dictionary that contains the data that is required in order to render the view. - The dictionary that contains temporary data for the view. - The text writer object that is used to write HTML output. - One of the parameters is null. - - - Gets or sets a value that indicates whether client-side validation is enabled. - true if client-side validation is enabled; otherwise, false. - - - Gets or sets an object that encapsulates information that is required in order to validate and process the input data from an HTML form. - An object that encapsulates information that is required in order to validate and process the input data from an HTML form. - - - Writes the client validation information to the HTTP response. - - - Gets data that is associated with this request and that is available for only one request. - The temporary data. - - - Gets or sets a value that indicates whether unobtrusive JavaScript is enabled. - true if unobtrusive JavaScript is enabled; otherwise, false. - - - Element name used to wrap a top-level message generated by and other overloads. - - - Element name used to wrap a top-level message generated by and other overloads. - - - Gets an object that implements the interface to render in the browser. - The view. - - - Gets the dynamic view data dictionary. - The dynamic view data dictionary. - - - Gets the view data that is passed to the view. - The view data. - - - Gets or sets the text writer object that is used to write HTML output. - The object that is used to write the HTML output. - - - Represents a container that is used to pass data between a controller and a view. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified model. - The model. - - - Initializes a new instance of the class by using the specified dictionary. - The dictionary. - The parameter is null. - - - Adds the specified item to the collection. - The object to add to the collection. - The collection is read-only. - - - Adds an element to the collection using the specified key and value . - The key of the element to add. - The value of the element to add. - The object is read-only. - - is null. - An element with the same key already exists in the object. - - - Removes all items from the collection. - The object is read-only. - - - Determines whether the collection contains the specified item. - true if is found in the collection; otherwise, false. - The object to locate in the collection. - - - Determines whether the collection contains an element that has the specified key. - true if the collection contains an element that has the specified key; otherwise, false. - The key of the element to locate in the collection. - - is null. - - - Copies the elements of the collection to an array, starting at a particular index. - The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing. - The zero-based index in at which copying begins. - - is null. - - is less than 0. - - is multidimensional.-or- is equal to or greater than the length of .-or- The number of elements in the source collection is greater than the available space from to the end of the destination .-or- Type cannot be cast automatically to the type of the destination . - - - Gets the number of elements in the collection. - The number of elements in the collection. - - - Evaluates the specified expression. - The results of the evaluation. - The expression. - The parameter is null or empty. - - - Evaluates the specified expression by using the specified format. - The results of the evaluation. - The expression. - The format. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Returns information about the view data as defined by the parameter. - An object that contains the view data information that is defined by the parameter. - A set of key/value pairs that define the view-data information to return. - The parameter is either null or empty. - - - Gets a value that indicates whether the collection is read-only. - true if the collection is read-only; otherwise, false. - - - Gets or sets the item that is associated with the specified key. - The value of the selected item. - - - Gets a collection that contains the keys of this dictionary. - A collection that contains the keys of the object that implements . - - - Gets or sets the model that is associated with the view data. - The model that is associated with the view data. - - - Gets or sets information about the model. - Information about the model. - - - Gets the state of the model. - The state of the model. - - - Removes the first occurrence of a specified object from the collection. - true if was successfully removed from the collection; otherwise, false. This method also returns false if is not found in the collection. - The object to remove from the collection. - The collection is read-only. - - - Removes the element from the collection using the specified key. - true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the original collection. - The key of the element to remove. - The collection is read-only. - - is null. - - - Sets the data model to use for the view. - The data model to use for the view. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets or sets an object that encapsulates information about the current template context. - An object that contains information about the current template. - - - Attempts to retrieve the value that is associated with the specified key. - true if the collection contains an element with the specified key; otherwise, false. - The key of the value to get. - When this method returns, the value that is associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. - - is null. - - - Gets a collection that contains the values in this dictionary. - A collection that contains the values of the object that implements . - - - Represents a container that is used to pass strongly typed data between a controller and a view. - The type of the model. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified view data dictionary. - An existing view data dictionary to copy into this instance. - - - Initializes a new instance of the class by using the specified model. - The data model to use for the view. - - - Gets or sets the model. - A reference to the data model. - - - Gets or sets information about the model. - Information about the model. - - - Sets the data model to use for the view. - The data model to use for the view. - An error occurred while the model was being set. - - - Encapsulates information about the current template content that is used to develop templates and about HTML helpers that interact with templates. - - - Initializes a new instance of the class. - - - Initializes a new instance of the T:System.Web.Mvc.ViewDataInfo class and associates a delegate for accessing the view data information. - A delegate that defines how the view data information is accessed. - - - Gets or sets the object that contains the values to be displayed by the template. - The object that contains the values to be displayed by the template. - - - Gets or sets the description of the property to be displayed by the template. - The description of the property to be displayed by the template. - - - Gets or sets the current value to be displayed by the template. - The current value to be displayed by the template. - - - Represents a collection of view engines that are available to the application. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified list of view engines. - The list that is wrapped by the new collection. - - is null. - - - Removes all elements from the . - - - Finds the specified partial view by using the specified controller context. - The partial view. - The controller context. - The name of the partial view. - The parameter is null. - The parameter is null or empty. - - - Finds the specified view by using the specified controller context and master view. - The view. - The controller context. - The name of the view. - The name of the master view. - The parameter is null. - The parameter is null or empty. - - - Inserts an element into the collection at the specified index. - The zero-based index at which item should be inserted. - The object to insert. - - is less than zero.-or- is greater than the number of items in the collection. - The parameter is null. - - - Removes the element at the specified index of the . - The zero-based index of the element to remove. - - is less than zero.-or- is equal to or greater than - - - Replaces the element at the specified index. - The zero-based index of the element to replace. - The new value for the element at the specified index. - - is less than zero.-or- is greater than the number of items in the collection. - The parameter is null. - - - Represents the result of locating a view engine. - - - Initializes a new instance of the class by using the specified searched locations. - The searched locations. - The parameter is null. - - - Initializes a new instance of the class by using the specified view and view engine. - The view. - The view engine. - The or parameter is null. - - - Gets or sets the searched locations. - The searched locations. - - - Gets or sets the view. - The view. - - - Gets or sets the view engine. - The view engine. - - - Represents a collection of view engines that are available to the application. - - - Gets the view engines. - The view engines. - - - Represents the information that is needed to build a master view page. - - - Initializes a new instance of the class. - - - Gets the AJAX script for the master page. - The AJAX script for the master page. - - - Gets the HTML for the master page. - The HTML for the master page. - - - Gets the model. - The model. - - - Gets the temporary data. - The temporary data. - - - Gets the URL. - The URL. - - - Gets the dynamic view-bag dictionary. - The dynamic view-bag dictionary. - - - Gets the view context. - The view context. - - - Gets the view data. - The view data. - - - Gets the writer that is used to render the master page. - The writer that is used to render the master page. - - - Represents the information that is required in order to build a strongly typed master view page. - The type of the model. - - - Initializes a new instance of the class. - - - Gets the AJAX script for the master page. - The AJAX script for the master page. - - - Gets the HTML for the master page. - The HTML for the master page. - - - Gets the model. - A reference to the data model. - - - Gets the view data. - The view data. - - - Represents the properties and methods that are needed to render a view as a Web Forms page. - - - Initializes a new instance of the class. - - - Gets or sets the object that is used to render HTML in Ajax scenarios. - The Ajax helper object that is associated with the view. - - - Gets or sets the object that is used to render HTML elements. - The HTML helper object that is associated with the view. - - - Initializes the , , and properties. - - - Gets or sets the path of the master view. - The path of the master view. - - - Gets the Model property of the associated object. - The Model property of the associated object. - - - Raises the event at the beginning of page initialization. - The event data. - - - Enables processing of the specified HTTP request by the ASP.NET MVC framework. - An object that encapsulates HTTP-specific information about the current HTTP request. - - - Initializes the object that receives the page content to be rendered. - The object that receives the page content. - - - Renders the view page to the response using the specified view context. - An object that encapsulates the information that is required in order to render the view, which includes the controller context, form context, the temporary data, and the view data for the associated view. - - - Note: This API is now obsolete.Sets the text writer that is used to render the view to the response. - The writer that is used to render the view to the response. - - - Sets the view data dictionary for the associated view. - A dictionary of data to pass to the view. - - - Gets the temporary data to pass to the view. - The temporary data to pass to the view. - - - Gets or sets the URL of the rendered page. - The URL of the rendered page. - - - Gets the view bag. - The view bag. - - - Gets or sets the information that is used to render the view. - The information that is used to render the view, which includes the form context, the temporary data, and the view data of the associated view. - - - Gets or sets a dictionary that contains data to pass between the controller and the view. - A dictionary that contains data to pass between the controller and the view. - - - Gets the text writer that is used to render the view to the response. - The text writer that is used to render the view to the response. - - - Represents the information that is required in order to render a strongly typed view as a Web Forms page. - The type of the model. - - - Initializes a new instance of the class. - - - Gets or sets the object that supports rendering HTML in Ajax scenarios. - The Ajax helper object that is associated with the view. - - - Gets or sets the object that provides support for rendering elements. - The HTML helper object that is associated with the view. - - - Instantiates and initializes the and properties. - - - Gets the property of the associated object. - A reference to the data model. - - - Sets the view data dictionary for the associated view. - A dictionary of data to pass to the view. - - - Gets or sets a dictionary that contains data to pass between the controller and the view. - A dictionary that contains data to pass between the controller and the view. - - - Represents a class that is used to render a view by using an instance that is returned by an object. - - - Initializes a new instance of the class. - - - Searches the registered view engines and returns the object that is used to render the view. - The object that is used to render the view. - The controller context. - An error occurred while the method was searching for the view. - - - Gets the name of the master view (such as a master page or template) to use when the view is rendered. - The name of the master view. - - - Represents a base class that is used to provide the model to the view and then render the view to the response. - - - Initializes a new instance of the class. - - - When called by the action invoker, renders the view to the response. - The context that the result is executed in. - The parameter is null. - - - Returns the object that is used to render the view. - The view engine. - The context. - - - Gets the view data model. - The view data model. - - - Gets or sets the object for this result. - The temporary data. - - - Gets or sets the object that is rendered to the response. - The view. - - - Gets the view bag. - The view bag. - - - Gets or sets the view data object for this result. - The view data. - - - Gets or sets the collection of view engines that are associated with this result. - The collection of view engines. - - - Gets or sets the name of the view to render. - The name of the view. - - - Provides an abstract class that can be used to implement a view start (master) page. - - - When implemented in a derived class, initializes a new instance of the class. - - - When implemented in a derived class, gets the HTML markup for the view start page. - The HTML markup for the view start page. - - - When implemented in a derived class, gets the URL for the view start page. - The URL for the view start page. - - - When implemented in a derived class, gets the view context for the view start page. - The view context for the view start page. - - - Provides a container for objects. - - - Initializes a new instance of the class. - - - Provides a container for objects. - The type of the model. - - - Initializes a new instance of the class. - - - Gets the formatted value. - The formatted value. - - - Represents the type of a view. - - - Initializes a new instance of the class. - - - Gets or sets the name of the type. - The name of the type. - - - Represents the information that is needed to build a user control. - - - Initializes a new instance of the class. - - - Gets the AJAX script for the view. - The AJAX script for the view. - - - Ensures that view data is added to the object of the user control if the view data exists. - - - Gets the HTML for the view. - The HTML for the view. - - - Gets the model. - The model. - - - Renders the view by using the specified view context. - The view context. - - - Sets the text writer that is used to render the view to the response. - The writer that is used to render the view to the response. - - - Sets the view-data dictionary by using the specified view data. - The view data. - - - Gets the temporary-data dictionary. - The temporary-data dictionary. - - - Gets the URL for the view. - The URL for the view. - - - Gets the view bag. - The view bag. - - - Gets or sets the view context. - The view context. - - - Gets or sets the view-data dictionary. - The view-data dictionary. - - - Gets or sets the view-data key. - The view-data key. - - - Gets the writer that is used to render the view to the response. - The writer that is used to render the view to the response. - - - Represents the information that is required in order to build a strongly typed user control. - The type of the model. - - - Initializes a new instance of the class. - - - Gets the AJAX script for the view. - The AJAX script for the view. - - - Gets the HTML for the view. - The HTML for the view. - - - Gets the model. - A reference to the data model. - - - Sets the view data for the view. - The view data. - - - Gets or sets the view data. - The view data. - - - Represents an abstract base-class implementation of the interface. - - - Initializes a new instance of the class. - - - Gets or sets the area-enabled master location formats. - The area-enabled master location formats. - - - Gets or sets the area-enabled partial-view location formats. - The area-enabled partial-view location formats. - - - Gets or sets the area-enabled view location formats. - The area-enabled view location formats. - - - Creates the specified partial view by using the specified controller context. - A reference to the partial view. - The controller context. - The partial path for the new partial view. - - - Creates the specified view by using the controller context, path of the view, and path of the master view. - A reference to the view. - The controller context. - The path of the view. - The path of the master view. - - - Gets or sets the display mode provider. - The display mode provider. - - - Returns a value that indicates whether the file is in the specified path by using the specified controller context. - true if the file is in the specified path; otherwise, false. - The controller context. - The virtual path. - - - Gets or sets the file-name extensions that are used to locate a view. - The file-name extensions that are used to locate a view. - - - Finds the specified partial view by using the specified controller context. - The partial view. - The controller context. - The name of the partial view. - true to use the cached partial view. - The parameter is null (Nothing in Visual Basic). - The parameter is null or empty. - - - Finds the specified view by using the specified controller context and master view name. - The page view. - The controller context. - The name of the view. - The name of the master view. - true to use the cached view. - The parameter is null (Nothing in Visual Basic). - The parameter is null or empty. - - - Gets or sets the master location formats. - The master location formats. - - - Gets or sets the partial-view location formats. - The partial-view location formats. - - - Releases the specified view by using the specified controller context. - The controller context. - The view to release. - - - Gets or sets the view location cache. - The view location cache. - - - Gets or sets the view location formats. - The view location formats. - - - Gets or sets the virtual path provider. - The virtual path provider. - - - Represents the information that is needed to build a Web Forms page in ASP.NET MVC. - - - Initializes a new instance of the class using the controller context and view path. - The controller context. - The view path. - - - Initializes a new instance of the class using the controller context, view path, and the path to the master page. - The controller context. - The view path. - The path to the master page. - - - Initializes a new instance of the class using the controller context, view path, the path to the master page, and a instance. - The controller context. - The view path. - The path to the master page. - An instance of the view page activator interface. - - - Gets or sets the master path. - The master path. - - - Renders the view to the response. - An object that encapsulates the information that is required in order to render the view, which includes the controller context, form context, the temporary data, and the view data for the associated view. - The text writer object that is used to write HTML output. - The view page instance. - - - Represents a view engine that is used to render a Web Forms page to the response. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified view page activator. - An instance of a class that implements the interface. - - - Creates the specified partial view by using the specified controller context. - The partial view. - The controller context. - The partial path. - - - Creates the specified view by using the specified controller context and the paths of the view and master view. - The view. - The controller context. - The view path. - The master-view path. - - - Represents the properties and methods that are needed in order to render a view that uses ASP.NET Razor syntax. - - - Initializes a new instance of the class. - - - Gets or sets the object that is used to render HTML using Ajax. - The object that is used to render HTML using Ajax. - - - Sets the view context and view data for the page. - The parent page. - - - Gets the object that is associated with the page. - The object that is associated with the page. - - - Runs the page hierarchy for the ASP.NET Razor execution pipeline. - - - Gets or sets the object that is used to render HTML elements. - The object that is used to render HTML elements. - - - Initializes the , , and classes. - - - Gets the Model property of the associated object. - The Model property of the associated object. - - - Sets the view data. - The view data. - - - Gets the temporary data to pass to the view. - The temporary data to pass to the view. - - - Gets or sets the URL of the rendered page. - The URL of the rendered page. - - - Gets the view bag. - The view bag. - - - Gets or sets the information that is used to render the view. - The information that is used to render the view, which includes the form context, the temporary data, and the view data of the associated view. - - - Gets or sets a dictionary that contains data to pass between the controller and the view. - A dictionary that contains data to pass between the controller and the view. - - - Represents the properties and methods that are needed in order to render a view that uses ASP.NET Razor syntax. - The type of the view data model. - - - Initializes a new instance of the class. - - - Gets or sets the object that is used to render HTML markup using Ajax. - The object that is used to render HTML markup using Ajax. - - - Gets or sets the object that is used to render HTML elements. - The object that is used to render HTML elements. - - - Initializes the , , and classes. - - - Gets the Model property of the associated object. - The Model property of the associated object. - - - Sets the view data. - The view data. - - - Gets or sets a dictionary that contains data to pass between the controller and the view. - A dictionary that contains data to pass between the controller and the view. - - - Represents support for ASP.NET AJAX within an ASP.NET MVC application. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - The name of the controller. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - The name of the controller. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - The name of the controller. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element.. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response using the specified routing information. - An opening <form> tag. - The AJAX helper. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response using the specified routing information. - An opening <form> tag. - The AJAX helper. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response using the specified routing information. - An opening <form> tag. - The AJAX helper. - The name of the route to use to obtain the form post URL. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response using the specified routing information. - An opening <form> tag. - The AJAX helper. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response using the specified routing information. - An opening <form> tag. - The AJAX helper. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML script element that contains a reference to a globalization script that defines the culture information. - A script element whose src attribute is set to the globalization script, as in the following example: <script type="text/javascript" src="/MvcApplication1/Scripts/Globalization/en-US.js"></script> - The AJAX helper object that this method extends. - - - Returns an HTML script element that contains a reference to a globalization script that defines the specified culture information. - An HTML script element whose src attribute is set to the globalization script, as in the following example:<script type="text/javascript" src="/MvcApplication1/Scripts/Globalization/en-US.js"></script> - The AJAX helper object that this method extends. - Encapsulates information about the target culture, such as date formats. - The parameter is null. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Represents option settings for running Ajax scripts in an ASP.NET MVC application. - - - Initializes a new instance of the class. - - - - Gets or sets the message to display in a confirmation window before a request is submitted. - The message to display in a confirmation window. - - - Gets or sets the HTTP request method ("Get" or "Post"). - The HTTP request method. The default value is "Post". - - - Gets or sets the mode that specifies how to insert the response into the target DOM element. - The insertion mode ("InsertAfter", "InsertBefore", or "Replace"). The default value is "Replace". - - - Gets or sets a value, in milliseconds, that controls the duration of the animation when showing or hiding the loading element. - A value, in milliseconds, that controls the duration of the animation when showing or hiding the loading element. - - - Gets or sets the id attribute of an HTML element that is displayed while the Ajax function is loading. - The ID of the element that is displayed while the Ajax function is loading. - - - Gets or sets the name of the JavaScript function to call immediately before the page is updated. - The name of the JavaScript function to call before the page is updated. - - - Gets or sets the JavaScript function to call when response data has been instantiated but before the page is updated. - The JavaScript function to call when the response data has been instantiated. - - - Gets or sets the JavaScript function to call if the page update fails. - The JavaScript function to call if the page update fails. - - - Gets or sets the JavaScript function to call after the page is successfully updated. - The JavaScript function to call after the page is successfully updated. - - - Returns the Ajax options as a collection of HTML attributes to support unobtrusive JavaScript. - The Ajax options as a collection of HTML attributes to support unobtrusive JavaScript. - - - Gets or sets the ID of the DOM element to update by using the response from the server. - The ID of the DOM element to update. - - - Gets or sets the URL to make the request to. - The URL to make the request to. - - - Enumerates the AJAX script insertion modes. - - - Insert after the element. - - - Insert before the element. - - - Replace the element. - - - Replace the entire element. - - - Provides information about an asynchronous action method, such as its name, controller, parameters, attributes, and filters. - - - Initializes a new instance of the class. - - - Invokes the asynchronous action method by using the specified parameters and controller context. - An object that contains the result of an asynchronous call. - The controller context. - The parameters of the action method. - The callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Returns the result of an asynchronous operation. - The result of an asynchronous operation. - An object that represents the status of an asynchronous operation. - - - Executes the asynchronous action method by using the specified parameters and controller context. - The result of executing the asynchronous action method. - The controller context. - The parameters of the action method. - - - Represents a class that is responsible for invoking the action methods of an asynchronous controller. - - - Initializes a new instance of the class. - - - Invokes the asynchronous action method by using the specified controller context, action name, callback method, and state. - An object that contains the result of an asynchronous operation.Implements - The controller context. - The name of the action. - The callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Invokes the asynchronous action method by using the specified controller context, action descriptor, parameters, callback method, and state. - An object that contains the result of an asynchronous operation. - The controller context. - The action descriptor. - The parameters for the asynchronous action method. - The callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Invokes the asynchronous action method by using the specified controller context, filters, action descriptor, parameters, callback method, and state. - An object that contains the result of an asynchronous operation. - The controller context. - The filters. - The action descriptor. - The parameters for the asynchronous action method. - The callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Cancels the action. - true if the action was canceled; otherwise, false. - The user-defined object that qualifies or contains information about an asynchronous operation. - - - Cancels the action. - true if the action was canceled; otherwise, false. - The user-defined object that qualifies or contains information about an asynchronous operation. - - - Cancels the action. - true if the action was canceled; otherwise, false. - The user-defined object that qualifies or contains information about an asynchronous operation. - - - Returns the controller descriptor. - The controller descriptor. - The controller context. - - - Provides asynchronous operations for the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the synchronization context. - The synchronization context. - - - Notifies ASP.NET that all asynchronous operations are complete. - - - Occurs when the method is called. - - - Gets the number of outstanding operations. - The number of outstanding operations. - - - Gets the parameters that were passed to the asynchronous completion method. - The parameters that were passed to the asynchronous completion method. - - - Executes a callback in the current synchronization context. - The asynchronous action. - - - Gets or sets the asynchronous timeout value, in milliseconds. - The asynchronous timeout value, in milliseconds. - - - Defines the interface for an action invoker, which is used to invoke an asynchronous action in response to an HTTP request. - - - Invokes the specified action. - The status of the asynchronous result. - The controller context. - The name of the asynchronous action. - The callback method. - The state. - - - Cancels the asynchronous action. - true if the asynchronous method could be canceled; otherwise, false. - The asynchronous result. - - - Used to create an instance for the current request. - - - Creates an instance of async action invoker for the current request. - The created . - - - Defines the methods that are required for an asynchronous controller. - - - Executes the specified request context. - The status of the asynchronous operation. - The request context. - The asynchronous callback method. - The state. - - - Ends the asynchronous operation. - The asynchronous result. - - - Provides a container for the asynchronous manager object. - - - Gets the asynchronous manager object. - The asynchronous manager object. - - - Provides a container that maintains a count of pending asynchronous operations. - - - Initializes a new instance of the class. - - - Occurs when an asynchronous method completes. - - - Gets the operation count. - The operation count. - - - Reduces the operation count by 1. - The updated operation count. - - - Reduces the operation count by the specified value. - The updated operation count. - The number of operations to reduce the count by. - - - Increments the operation count by one. - The updated operation count. - - - Increments the operation count by the specified value. - The updated operation count. - The number of operations to increment the count by. - - - Provides information about an asynchronous action method, such as its name, controller, parameters, attributes, and filters. - - - Initializes a new instance of the class. - An object that contains information about the method that begins the asynchronous operation (the method whose name ends with "Asynch"). - An object that contains information about the completion method (method whose name ends with "Completed"). - The name of the action. - The controller descriptor. - - - Gets the name of the action method. - The name of the action method. - - - Gets the method information for the asynchronous action method. - The method information for the asynchronous action method. - - - Begins running the asynchronous action method by using the specified parameters and controller context. - An object that contains the result of an asynchronous call. - The controller context. - The parameters of the action method. - The callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Gets the method information for the asynchronous completion method. - The method information for the asynchronous completion method. - - - Gets the controller descriptor for the asynchronous action method. - The controller descriptor for the asynchronous action method. - - - Returns the result of an asynchronous operation. - The result of an asynchronous operation. - An object that represents the status of an asynchronous operation. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes of the specified type exist. - The type of the custom attributes to return. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Gets the filter attributes. - The filter attributes. - Use cache flag. - - - Returns the parameters of the action method. - The parameters of the action method. - - - Returns the action-method selectors. - The action-method selectors. - - - Determines whether one or more instances of the specified attribute type are defined for the action member. - true if an attribute of type that is represented by is defined for this member; otherwise, false. - The type of the custom attribute. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - - Gets the lazy initialized unique ID of the instance of this class. - The lazy initialized unique ID of the instance of this class. - - - Encapsulates information that describes an asynchronous controller, such as its name, type, and actions. - - - Initializes a new instance of the class. - The type of the controller. - - - Gets the type of the controller. - The type of the controller. - - - Finds an action method by using the specified name and controller context. - The information about the action method. - The controller context. - The name of the action. - - - Returns a list of action method descriptors in the controller. - A list of action method descriptors in the controller. - - - Returns custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Returns custom attributes of a specified type that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Gets the filter attributes. - The filter attributes. - true to use the cache, otherwise false. - - - Returns a value that indicates whether one or more instances of the specified custom attribute are defined for this member. - true if an attribute of the type represented by is defined for this member; otherwise, false. - The type of the custom attribute. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Represents an exception that occurred during the synchronous processing of an HTTP request in an ASP.NET MVC application. - - - Initializes a new instance of the class using a system-supplied message. - - - Initializes a new instance of the class using the specified message. - The message that describes the exception. The caller of this constructor must make sure that this string has been localized for the current system culture. - - - Initializes a new instance of the class using a specified error message and a reference to the inner exception that is the cause of this exception. - The message that describes the exception. The caller of this constructor must make sure that this string has been localized for the current system culture. - The exception that is the cause of the current exception. If the parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - When an action method returns either Task or Task<T> the provides information about the action. - - - Initializes a new instance of the class. - The task method information. - The action name. - The controller descriptor. - - - Gets the name of the action method. - The name of the action method. - - - Invokes the asynchronous action method using the specified parameters, controller context callback and state. - An object that contains the result of an asynchronous call. - The controller context. - The parameters of the action method. - The optional callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Gets the controller descriptor. - The controller descriptor. - - - Ends the asynchronous operation. - The result of an asynchronous operation. - An object that represents the status of an asynchronous operation. - - - Executes the asynchronous action method - The result of executing the asynchronous action method. - The controller context. - The parameters of the action method. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Returns an array of all custom attributes applied to this member. - An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined. - true to search this member's inheritance chain to find the attributes; otherwise, false. - - - Returns the parameters of the asynchronous action method. - The parameters of the asynchronous action method. - - - Returns the asynchronous action-method selectors. - The asynchronous action-method selectors. - - - Returns a value that indicates whether one or more instance of the specified custom attribute are defined for this member. - A value that indicates whether one or more instance of the specified custom attribute are defined for this member. - The type of the custom attribute. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - - Gets information for the asynchronous task. - Information for the asynchronous task. - - - Gets the unique ID for the task. - The unique ID for the task. - - - Represents an authentication challenge context containing information for executing an authentication challenge. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The controller context. - The action methods associated with the challenge. - The challenge response. - - - Gets or sets the action descriptor. - The action descriptor associated with the challenge. - - - Gets or sets the action result to execute. - The challenge response. - - - Represents an authentication context containing information for performing authentication. - - - Initializes a new instance of the class. - - - - Gets or sets the action descriptor. - The action methods associated with the authentication - - - Gets or sets the currently authenticated principal. - The security credentials for the authentication. - - - Gets or sets the error result, which indicates that authentication was attempted and failed. - The authentication result. - - - Defines a filter that performs authentication. - - - Authenticates the request. - The context to use for authentication. - - - Adds an authentication challenge to the current . - The context to use for the authentication challenge. - - - Defines a filter that overrides other filters. - - - Gets the type of filters to override. - The filter to override. - - - Represents support for calling child action methods and rendering the result inline in a parent view. - - - Invokes the specified child action method and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method with the specified parameters and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified controller name and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - The name of the controller that contains the action method. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and controller name and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - The name of the controller that contains the action method. - An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and controller name and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - The name of the controller that contains the action method. - A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified controller name and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - The name of the controller that contains the action method. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and controller name and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - The name of the controller that contains the action method. - An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and controller name and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - The name of the controller that contains the action method. - A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Represents support for rendering object values as HTML. - - - Returns HTML markup for each property in the object that is represented by a string expression. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - - - Returns HTML markup for each property in the object that is represented by a string expression, using additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns HTML markup for each property in the object that is represented by the expression, using the specified template. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - - - Returns HTML markup for each property in the object that is represented by the expression, using the specified template and additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns HTML markup for each property in the object that is represented by the expression, using the specified template and an HTML field ID. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - - - Returns HTML markup for each property in the object that is represented by the expression, using the specified template, HTML field ID, and additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns HTML markup for each property in the object that is represented by the expression. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The type of the model. - The type of the value. - - - Returns a string that contains each property value in the object that is represented by the specified expression, using additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns a string that contains each property value in the object that is represented by the , using the specified template. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - The type of the model. - The type of the value. - - - Returns a string that contains each property value in the object that is represented by the specified expression, using the specified template and additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns HTML markup for each property in the object that is represented by the , using the specified template and an HTML field ID. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - The type of the model. - The type of the value. - - - Returns HTML markup for each property in the object that is represented by the specified expression, using the template, an HTML field ID, and additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns HTML markup for each property in the model. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - - - Returns HTML markup for each property in the model, using additional view data. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns HTML markup for each property in the model using the specified template. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - The name of the template that is used to render the object. - - - Returns HTML markup for each property in the model, using the specified template and additional view data. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - The name of the template that is used to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns HTML markup for each property in the model using the specified template and HTML field ID. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - - - Returns HTML markup for each property in the model, using the specified template, an HTML field ID, and additional view data. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Provides a mechanism to get display names. - - - Gets the display name. - The display name. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the display name. - - - Gets the display name for the model. - The display name for the model. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the display name. - The type of the model. - The type of the value. - - - Gets the display name for the model. - The display name for the model. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the display name. - The type of the model. - The type of the value. - - - Gets the display name for the model. - The display name for the model. - The HTML helper instance that this method extends. - - - Provides a way to render object values as HTML. - - - Returns HTML markup for each property in the object that is represented by the specified expression. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - - - Returns HTML markup for each property in the object that is represented by the specified expression. - The HTML markup for each property. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The type of the model. - The type of the result. - - - Represents support for the HTML input element in an application. - - - Returns an HTML input element for each property in the object that is represented by the expression. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - - - Returns an HTML input element for each property in the object that is represented by the expression, using additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and HTML field name. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template, HTML field name, and additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns an HTML input element for each property in the object that is represented by the expression. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the object that is represented by the expression, using additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and HTML field name. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template, HTML field name, and additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the model. - An HTML input element for each property in the model. - The HTML helper instance that this method extends. - - - Returns an HTML input element for each property in the model, using additional view data. - An HTML input element for each property in the model. - The HTML helper instance that this method extends. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns an HTML input element for each property in the model, using the specified template. - An HTML input element for each property in the model and in the specified template. - The HTML helper instance that this method extends. - The name of the template to use to render the object. - - - Returns an HTML input element for each property in the model, using the specified template and additional view data. - An HTML input element for each property in the model. - The HTML helper instance that this method extends. - The name of the template to use to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns an HTML input element for each property in the model, using the specified template name and HTML field name. - An HTML input element for each property in the model and in the named template. - The HTML helper instance that this method extends. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - - - Returns an HTML input element for each property in the model, using the template name, HTML field name, and additional view data. - An HTML input element for each property in the model. - The HTML helper instance that this method extends. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Provides methods for working with enumeration values and select lists. - - - Gets a list of objects corresponding to enum constants defined in the given type. - A list for the given . - The type to evaluate. - - - Gets a list of objects corresponding to enum constants defined in the given type. Also ensures the will round-trip even if it does not match a defined constant and sets the Selected property to true for one element in the returned list -- matching the . - A list for the given , possibly extended to include an unrecognized . - The type to evaluate. - The value from type to select. - - - Gets a list of objects corresponding to enum constants defined in the given metadata. - A list for the given metadata. - The model metadata to evaluate. - - - Gets a list of objects corresponding to enum constants defined in the given metadata. Also ensures the value will round-trip even if it does not match a defined constant and sets the Selected property to true for one element in the returned list -- matching the value. - A list for the given , possibly extended to include an unrecognized . - The metadata to evaluate. - Value from the type of metadata to select. - - - Gets a value indicating whether the given type or an expression of this type is suitable for use in and calls. - true if will not throw when passed the given type and will not throw when passed an expression of this type; otherwise, false. - The type to check. - - - Gets a value indicating whether the given metadata or associated expression is suitable for use in and calls. - true if will return not throw when passed given and will not throw when passed associated expression; otherwise, false. - The metadata to check. - - - Represents support for HTML in an application. - - - Writes an opening <form> tag to the response. The form uses the POST method, and the request is processed by the action method for the view. - An opening <form> tag. - The HTML helper instance that this method extends. - - - Writes an opening <form> tag to the response and includes the route values in the action attribute. The form uses the POST method, and the request is processed by the action method for the view. - An opening <form> tag. - The HTML helper instance that this method extends. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - - - Writes an opening <form> tag to the response and sets the action tag to the specified controller and action. The form uses the POST method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - - - Writes an opening <form> tag to the response, and sets the action tag to the specified controller, action, and route values. The form uses the POST method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - - - Writes an opening <form> tag to the response and sets the action tag to the specified controller, action, and route values. The form uses the specified HTTP method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response and sets the action tag to the specified controller, action, and route values. The form uses the specified HTTP method and includes the HTML attributes. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response and sets the action tag to the specified controller and action. The form uses the specified HTTP method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response and sets the action tag to the specified controller and action. The form uses the specified HTTP method and includes the HTML attributes from a dictionary. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response and sets the action tag to the specified controller and action. The form uses the specified HTTP method and includes the HTML attributes. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response, and sets the action tag to the specified controller, action, and route values from the route value dictionary. The form uses the POST method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - - - Writes an opening <form> tag to the response, and sets the action tag to the specified controller, action, and route values from the route value dictionary. The form uses the specified HTTP method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response, and sets the action tag to the specified controller, action, and route values from the route value dictionary. The form uses the specified HTTP method, and includes the HTML attributes from the dictionary. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response and includes the route values from the route value dictionary in the action attribute. The form uses the POST method, and the request is processed by the action method for the view. - An opening <form> tag. - The HTML helper instance that this method extends. - An object that contains the parameters for a route. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - An object that contains the parameters for a route - - - Renders the closing </form> tag to the response. - The HTML helper instance that this method extends. - - - Represents support for HTML input controls in an application. - - - Returns a check box input element by using the specified HTML helper and the name of the form field. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - - - Returns a check box input element by using the specified HTML helper, the name of the form field, and a value to indicate whether the check box is selected. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - true to select the check box; otherwise, false. The value of the check box is retrieved in this order - the object, the value of this parameter, the object, and lastly, a checked attribute in the html attributes. - - - Returns a check box input element by using the specified HTML helper, the name of the form field, a value to indicate whether the check box is selected, and the HTML attributes. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - true to select the check box; otherwise, false. The value of the check box is retrieved in this order - the object, the value of this parameter, the object, and lastly, a checked attribute in the html attributes. - An object that contains the HTML attributes to set for the element. - - - Returns a check box input element by using the specified HTML helper, the name of the form field, a value that indicates whether the check box is selected, and the HTML attributes. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - true to select the check box; otherwise, false. The value of the check box is retrieved in this order - the object, the value of this parameter, the object, and lastly, a checked attribute in the html attributes. - An object that contains the HTML attributes to set for the element. - - - Returns a check box input element by using the specified HTML helper, the name of the form field, and the HTML attributes. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - An object that contains the HTML attributes to set for the element. - - - Returns a check box input element by using the specified HTML helper, the name of the form field, and the HTML attributes. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - An object that contains the HTML attributes to set for the element. - - - Returns a check box input element for each property in the object that is represented by the specified expression. - An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The parameter is null. - - - Returns a check box input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The parameter is null. - - - Returns a check box input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - An object that contains the HTML attributes to set for the element. - The type of the model. - The parameter is null. - - - Returns a hidden input element by using the specified HTML helper and the name of the form field. - An input element whose type attribute is set to "hidden". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - - - Returns a hidden input element by using the specified HTML helper, the name of the form field, and the value. - An input element whose type attribute is set to "hidden". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the hidden input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - - - Returns a hidden input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "hidden". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the hidden input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - An object that contains the HTML attributes to set for the element. - - - Returns a hidden input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "hidden". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the hidden input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML hidden input element for each property in the object that is represented by the specified expression. - An input element whose type attribute is set to "hidden" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the property. - - - Returns an HTML hidden input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An input element whose type attribute is set to "hidden" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - - - Returns an HTML hidden input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An input element whose type attribute is set to "hidden" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - - - Returns a password input element by using the specified HTML helper and the name of the form field. - An input element whose type attribute is set to "password". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - - - Returns a password input element by using the specified HTML helper, the name of the form field, and the value. - An input element whose type attribute is set to "password". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the password input element. If a value for this parameter is not provided, the value attribute in the html attributes is used to retrieve the value. - - - Returns a password input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "password". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the password input element. If a value for this parameter is not provided, the value attribute in the html attributes is used to retrieve the value. - An object that contains the HTML attributes to set for the element. - - - Returns a password input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "password". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the password input element. If a value for this parameter is not provided, the value attribute in the html attributes is used to retrieve the value. - An object that contains the HTML attributes to set for the element. - - - Returns a password input element for each property in the object that is represented by the specified expression. - An HTML input element whose type attribute is set to "password" for each property in the object that is represented by the specified expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a password input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "password" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a password input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "password" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - true to select the radio button; otherwise, false. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - true to select the radio button; otherwise, false. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - true to select the radio button; otherwise, false. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element for each property in the object that is represented by the specified expression. - An HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a radio button input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a radio button input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a text input element by using the specified HTML helper and the name of the form field. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - - - Returns a text input element by using the specified HTML helper, the name of the form field, and the value. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the text input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - - - Returns a text input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the text input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - An object that contains the HTML attributes to set for the element. - - - Returns a text input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the text input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - An object that contains the HTML attributes to set for the element. - - - Returns a text input element. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field. - The value of the text input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - A string that is used to format the input. - - - Returns a text input element. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the text input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - A string that is used to format the input. - An object that contains the HTML attributes to set for the element. - - - Returns a text input element. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the text input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. - A string that is used to format the input. - An object that contains the HTML attributes to set for the element. - - - Returns a text input element for each property in the object that is represented by the specified expression. - An HTML input element whose type attribute is set to "text" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the value. - The parameter is null or empty. - - - Returns a text input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element type attribute is set to "text" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null or empty. - - - Returns a text input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "text" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null or empty. - - - Returns a text input element. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A string that is used to format the input. - The type of the model. - The type of the value. - - - Returns a text input element. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A string that is used to format the input. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - - - Returns a text input element. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A string that is used to format the input. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - - - Represents support for the HTML label element in an ASP.NET MVC view. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression using the label text. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - The label text to display. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - The label text. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - The label text. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - The type of the model. - The type of the value. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - An object that contains the HTML attributes to set for the element. - The type of the model. - The value. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression using the label text. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - The label text to display. - The type of the model. - The type of the value. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - The label text to display. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - The label text. - An object that contains the HTML attributes to set for the element. - The type of the model. - The Value. - - - Returns an HTML label element and the property name of the property that is represented by the model. - An HTML label element and the property name of the property that is represented by the model. - The HTML helper instance that this method extends. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression using the label text. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - The label text to display. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - The label Text. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - The label text. - An object that contains the HTML attributes to set for the element. - - - Represents support for HTML links in an application. - - - Returns an anchor element (a element) for the specified link text and action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The parameter is null or empty. - - - Returns an anchor element (a element) for the specified link text, action, and route values. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The parameter is null or empty. - - - Returns an anchor element (a element) for the specified link text, action, route values, and HTML attributes. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes for the element. The attributes are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The parameter is null or empty. - - - Returns an anchor element (a element) for the specified link text, action, and controller. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The name of the controller. - The parameter is null or empty. - - - Returns an anchor element (a element) for the specified link text, action, controller, route values, and HTML attributes. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) for the specified link text, action, controller, protocol, host name, URL fragment, route values, and HTML attributes. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The name of the controller. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) for the specified link text, action, controller, protocol, host name, URL fragment, route values as a route value dictionary, and HTML attributes as a dictionary. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The name of the controller. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) for the specified link text, action, controller, route values as a route value dictionary, and HTML attributes as a dictionary. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The name of the controller. - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) for the specified link text, action, and route values as a route value dictionary. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - An object that contains the parameters for a route. - The parameter is null or empty. - - - Returns an anchor element (a element) for the specified link text, action, route values as a route value dictionary, and HTML attributes as a dictionary. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - An object that contains the parameters for a route. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - An object that contains the parameters for a route. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Represents an HTML form element in an MVC view. - - - Initializes a new instance of the class using the specified HTTP response object. - The HTTP response object. - The parameter is null. - - - Initializes a new instance of the class using the specified view context. - An object that encapsulates the information that is required in order to render a view. - The parameter is null. - - - Releases all resources that are used by the current instance of the class. - - - Releases unmanaged and, optionally, managed resources used by the current instance of the class. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Ends the form and disposes of all form resources. - - - Gets the HTML ID and name attributes of the string. - - - Gets the ID of the string. - The HTML ID attribute value for the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the ID. - - - Gets the ID of the string - The HTML ID attribute value for the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the ID. - The type of the model. - The type of the property. - - - Gets the ID of the string. - The HTML ID attribute value for the object that is represented by the expression. - The HTML helper instance that this method extends. - - - Gets the full HTML field name for the object that is represented by the expression. - The full HTML field name for the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the name. - - - Gets the full HTML field name for the object that is represented by the expression. - The full HTML field name for the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the name. - The type of the model. - The type of the property. - - - Gets the full HTML field name for the object that is represented by the expression. - The full HTML field name for the object that is represented by the expression. - The HTML helper instance that this method extends. - - - Represents the functionality to render a partial view as an HTML-encoded string. - - - Renders the specified partial view as an HTML-encoded string. - The partial view that is rendered as an HTML-encoded string. - The HTML helper instance that this method extends. - The name of the partial view to render. - - - Renders the specified partial view as an HTML-encoded string. - The partial view that is rendered as an HTML-encoded string. - The HTML helper instance that this method extends. - The name of the partial view to render. - The model for the partial view. - - - Renders the specified partial view as an HTML-encoded string. - The partial view that is rendered as an HTML-encoded string. - The HTML helper instance that this method extends. - The name of the partial view. - The model for the partial view. - The view data dictionary for the partial view. - - - Renders the specified partial view as an HTML-encoded string. - The partial view that is rendered as an HTML-encoded string. - The HTML helper instance that this method extends. - The name of the partial view to render. - The view data dictionary for the partial view. - - - Provides support for rendering a partial view. - - - Renders the specified partial view by using the specified HTML helper. - The HTML helper. - The name of the partial view - - - Renders the specified partial view, passing it a copy of the current object, but with the Model property set to the specified model. - The HTML helper. - The name of the partial view. - The model. - - - Renders the specified partial view, replacing the partial view's ViewData property with the specified object and setting the Model property of the view data to the specified model. - The HTML helper. - The name of the partial view. - The model for the partial view. - The view data for the partial view. - - - Renders the specified partial view, replacing its ViewData property with the specified object. - The HTML helper. - The name of the partial view. - The view data. - - - Represents support for making selections in a list. - - - Returns a single-selection select element using the specified HTML helper and the name of the form field. - An HTML select element. - The HTML helper instance that this method extends. - The name of the form field to return. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, and the specified list items. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, and the specified HTML attributes. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, and the specified HTML attributes. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, and an option label. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - The text for a default empty item. This parameter can be null. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, an option label, and the specified HTML attributes. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - The text for a default empty item. This parameter can be null. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, an option label, and the specified HTML attributes. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - The text for a default empty item. This parameter can be null. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, and an option label. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - The text for a default empty item. This parameter can be null. - The parameter is null or empty. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and option label. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - The text for a default empty item. This parameter can be null. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items, option label, and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - The text for a default empty item. This parameter can be null. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items, option label, and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - The text for a default empty item. This parameter can be null. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each value in the enumeration that is represented by the specified expression. - An HTML select element for each value in the enumeration that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the values to display. - The type of the model. - The type of the value. - - - Returns an HTML select element for each value in the enumeration that is represented by the specified expression. - An HTML select element for each value in the enumeration that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the values to display. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - - - Returns an HTML select element for each value in the enumeration that is represented by the specified expression. - An HTML select element for each value in the enumeration that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the values to display. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - - - Returns an HTML select element for each value in the enumeration that is represented by the specified expression. - An HTML select element for each value in the enumeration that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the values to display. - The text for a default empty item. This parameter can be null. - The type of the model. - The type of the value. - - - Returns an HTML select element for each value in the enumeration that is represented by the specified expression. - An HTML select element for each value in the enumeration that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the values to display. - The text for a default empty item. This parameter can be null. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - - - Returns an HTML select element for each value in the enumeration that is represented by the specified expression. - An HTML select element for each value in the enumeration that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the values to display. - The text for a default empty item. This parameter can be null. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - - - Returns a multi-select select element using the specified HTML helper and the name of the form field. - An HTML select element. - The HTML helper instance that this method extends. - The name of the form field to return. - The parameter is null or empty. - - - Returns a multi-select select element using the specified HTML helper, the name of the form field, and the specified list items. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - The parameter is null or empty. - - - Returns a multi-select select element using the specified HTML helper, the name of the form field, the specified list items, and the specified HMTL attributes. - An HTML select element with an option subelement for each item in the list.. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns a multi-select select element using the specified HTML helper, the name of the form field, and the specified list items. - An HTML select element with an option subelement for each item in the list.. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an HTML select element for each property in the object that is represented by the specified expression and using the specified list items. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - The type of the model. - The type of the property. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - The parameter is null. - - - Represents support for HTML textarea controls. - - - Returns the specified textarea element by using the specified HTML helper and the name of the form field. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, and the specified HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - An object that contains the HTML attributes to set for the element. - - - Returns the specified textarea element by using the specified HTML helper and HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - An object that contains the HTML attributes to set for the element. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, and the text content. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - The text content. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, and the specified HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - The text content. - An object that contains the HTML attributes to set for the element. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, the number of rows and columns, and the specified HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - The text content. - The number of rows. - The number of columns. - An object that contains the HTML attributes to set for the element. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, the number of rows and columns, and the specified HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - The text content. - The number of rows. - The number of columns. - An object that contains the HTML attributes to set for the element. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, and the specified HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - The text content. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML textarea element for each property in the object that is represented by the specified expression. - An HTML textarea element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the property. - The parameter is null. - - - Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes. - An HTML textarea element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - The parameter is null. - - - Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes and the number of rows and columns. - An HTML textarea element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The number of rows. - The number of columns. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - The parameter is null. - - - Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes and the number of rows and columns. - An HTML textarea element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The number of rows. - The number of columns. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - The parameter is null. - - - Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes. - An HTML textarea element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - The parameter is null. - - - Provides support for validating the input from an HTML form. - - - Gets or sets the name of the resource file (class key) that contains localized string values. - The name of the resource file (class key). - - - Retrieves the validation metadata for the specified model and applies each rule to the data field. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - The parameter is null. - - - Retrieves the validation metadata for the specified model and applies each rule to the data field. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the property. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - An object that contains the HTML attributes for the element. - - - Displays a validation message if an error exists for the specified entry in the object. - null if the entry is valid and client-side validation is disabled. Otherwise, a element that contains an error message. - The HTML helper instance that this method operates on. - The name of the entry being validated. - An that contains the HTML attributes for the element. - The tag to be set for the wrapping HTML element of the validation message. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - An object that contains the HTML attributes for the element. - - - Displays a validation message if an error exists for the specified entry in the object. - null if the entry is valid and client-side validation is disabled. Otherwise, a element that contains an error message. - The HTML helper instance that this method operates on. - The name of the entry being validated. - An object that contains the HTML attributes for the element. - The tag to be set for the wrapping HTML element of the validation message. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - The message to display if the specified field contains an error. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - The message to display if the specified field contains an error. - An object that contains the HTML attributes for the element. - - - Displays a validation message if an error exists for the specified entry in the object. - null if the model object is valid and client-side validation is disabled. Otherwise, a element that contains an error message. - The HTML helper instance that this method operates on. - The name of the model object being validated. - The message to display if the specified entry contains an error. - An that contains the HTML attributes for the element. - The tag to be set for the wrapping HTML element of the validation message. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - The message to display if the specified field contains an error. - An object that contains the HTML attributes for the element. - - - Displays a validation message if an error exists for the specified entry in the object. - null if the entry is valid and client-side validation is disabled. Otherwise, a element that contains an error message. - The HTML helper instance that this method operates on. - The name of the entry being validated. - The message to display if the specified entry contains an error. - An object that contains the HTML attributes for the element. - The tag to be set for the wrapping HTML element of the validation message. - - - Displays a validation message if an error exists for the specified entry in the object. - null if the entry is valid and client-side validation is disabled. Otherwise, a element that contains an error message. - The HTML helper instance that this method operates on. - The name of the entry being validated. - The message to display if the specified entry contains an error. - The tag to be set for the wrapping HTML element of the validation message. - - - Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the property. - - - Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The message to display if the specified field contains an error. - The type of the model. - The type of the property. - - - Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message and HTML attributes. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The message to display if the specified field contains an error. - An object that contains the HTML attributes for the element. - The type of the model. - The type of the property. - - - Returns the HTML markup for a validation-error message for the specified expression. - null if the model object is valid and client-side validation is disabled. Otherwise, a element that contains an error message. - The HTML helper instance that this method operates on. - An expression that identifies the object that contains the properties to render. - The message to display if a validation error occurs. - An that contains the HTML attributes for the element. - The tag to be set for the wrapping HTML element of the validation message. - The type of the model. - The type of the property. - - - Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message and HTML attributes. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The message to display if the specified field contains an error. - An object that contains the HTML attributes for the element. - The type of the model. - The type of the property. - - - Returns the HTML markup for a validation-error message for the specified expression. - null if the model object is valid and client-side validation is disabled. Otherwise, a element that contains an error message. - The HTML helper instance that this method operates on. - An expression that identifies the object that contains the properties to render. - The message to display if a validation error occurs. - An object that contains the HTML attributes for the element. - The tag to be set for the wrapping HTML element of the validation message. - The type of the model. - The type of the property. - - - Returns the HTML markup for a validation-error message for the specified expression. - null if the model object is valid and client-side validation is disabled. Otherwise, a element that contains an error message. - The HTML helper instance that this method operates on. - An expression that identifies the object that contains the properties to render. - The message to display if a validation error occurs. - The tag to be set for the wrapping HTML element of the validation message. - The type of the model. - The type of the property. - - - Returns an unordered list (ul element) of validation messages that are in the object. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - - - Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - true to have the summary display model-level errors only, or false to have the summary display all errors. - - - Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - true to have the summary display model-level errors only, or false to have the summary display all errors. - The message to display with the validation summary. - - - Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - true to have the summary display model-level errors only, or false to have the summary display all errors. - The message to display with the validation summary. - A dictionary that contains the HTML attributes for the element. - - - - Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - true to have the summary display model-level errors only, or false to have the summary display all errors. - The message to display with the validation summary. - An object that contains the HTML attributes for the element. - - - - - Returns an unordered list (ul element) of validation messages that are in the object. - A string that contains an unordered list (ul element) of validation messages. - The HMTL helper instance that this method extends. - The message to display if the specified field contains an error. - - - Returns an unordered list (ul element) of validation messages that are in the object. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - The message to display if the specified field contains an error. - A dictionary that contains the HTML attributes for the element. - - - - Returns an unordered list (ul element) of validation messages in the object. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - The message to display if the specified field contains an error. - An object that contains the HTML attributes for the element. - - - - - Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. - - - Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. - The HTML markup for the value. - The HTML helper instance that this method extends. - The name of the model. - - - Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. - The HTML markup for the value. - The HTML helper instance that this method extends. - The name of the model. - The format string. - - - Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. - The HTML markup for the value. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to expose. - The model. - The property. - - - Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. - The HTML markup for the value. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to expose. - The format string. - The model. - The property. - - - Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. - The HTML markup for the value. - The HTML helper instance that this method extends. - - - Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. - The HTML markup for the value. - The HTML helper instance that this method extends. - The format string. - - - Compiles ASP.NET Razor views into classes. - - - Initializes a new instance of the class. - - - The inherits directive. - - - The model directive. - - - Extends the VBCodeParser class by adding support for the @model keyword. - - - Initializes a new instance of the class. - - - Sets a value that indicates whether the current code block and model should be inherited. - true if the code block and model is inherited; otherwise, false. - - - The Model Type Directive. - Returns void. - - - Configures the ASP.NET Razor parser and code generator for a specified file. - - - Initializes a new instance of the class. - The virtual path of the ASP.NET Razor file. - The physical path of the ASP.NET Razor file. - - - Returns the ASP.NET MVC language-specific Razor code generator. - The ASP.NET MVC language-specific Razor code generator. - The C# or Visual Basic code generator. - - - Returns the ASP.NET MVC language-specific Razor code parser using the specified language parser. - The ASP.NET MVC language-specific Razor code parser. - The C# or Visual Basic code parser. - - - - - Creates instances based on the provided factories and action. The route entries provide direct routing to the provided action. - A set of route entries. - The action descriptor. - The direct route factories. - The constraint resolver. - - - Gets a set of route factories for the given action descriptor. - A set of route factories. - The action descriptor. - - - Gets the area prefix from the provided controller. - The area prefix or null. - The controller descriptor. - - - Creates instances based on the provided factories, controller and actions. The route entries provided direct routing to the provided controller and can reach the set of provided actions. - A set of route entries. - The controller descriptor. - The action descriptors. - The direct route factories. - The constraint resolver. - - - Gets route factories for the given controller descriptor. - A set of route factories. - The controller descriptor. - - - Gets direct routes for the given controller descriptor and action descriptors based on attributes. - A set of route entries. - The controller descriptor. - The action descriptors for all actions. - The constraint resolver. - - - Gets the route prefix from the provided controller. - The route prefix or null. - The controller descriptor. - - - The default implementation of . Resolves constraints by parsing a constraint key and constraint arguments, using a map to resolve the constraint type, and calling an appropriate constructor for the constraint type. - - - - Gets the mutable dictionary that maps constraint keys to a particular constraint type. - - - - Represents a context that supports creating a direct route. - - - Initializes a new instance of the class. - The route prefix, if any, defined by the area. - The route prefix, if any, defined by the controller. - The action descriptors to which to create a route. - The inline constraint resolver. - A value indicating whether the route is configured at the action or controller level. - - - Gets the action descriptors to which to create a route. - The action descriptors to which to create a route. - - - Gets the route prefix, if any, defined by the area. - The route prefix, if any, defined by the area. - - - Gets the route prefix, if any, defined by the controller. - The route prefix, if any, defined by the controller. - - - Creates a route builder that can build a route matching this context. - A route builder that can build a route matching this context. - The route template. - - - Creates a route builder that can build a route matching this context. - A route builder that can build a route matching this context. - The route template. - The inline constraint resolver to use, if any; otherwise, null. - - - Gets the inline constraint resolver. - The inline constraint resolver. - - - Gets a value indicating whether the route is configured at the action or controller level. - true when the route is configured at the action level; otherwise false if the route is configured at the controller level. - - - Defines a builder that creates direct routes to actions (attribute routes). - - - Gets the action descriptors to which to create a route. - The action descriptors to which to create a route. - - - Creates a route entry based on the current property values. - The route entry created. - - - Gets or sets the route constraints. - The route constraints. - - - Gets or sets the route data tokens. - The route data tokens. - - - Gets or sets the route defaults. - The route defaults. - - - Gets or sets the route name. - The route name, or null if no name supplied. - - - Gets or sets the route order. - The route order. - - - Gets or sets the route precedence. - The route precedence. - - - Gets a value indicating whether the route is configured at the action or controller level. - true when the route is configured at the action level; otherwise, false if the route is configured at the controller level. - - - Gets or sets the route template. - The route template. - - - Defines a factory that creates a route directly to a set of action descriptors (an attribute route). - - - Creates a direct route entry. - The direct route entry. - The context to use to create the route. - - - Defines a provider for routes that directly target action descriptors (attribute routes). - - - Gets the direct routes for a controller. - A set of route entries for the controller. - The controller descriptor. - The action descriptors. - The inline constraint resolver. - - - Defines an abstraction for resolving inline constraints as instances of . - - - Resolves the inline constraint. - The the inline constraint was resolved to. - The inline constraint to resolve. - - - Provides information for building a System.Web.Routing.Route. - - - Gets the route template describing the URI pattern to match against. - The route template describing the URI pattern to match against. - - - Gets the name of the route to generate. - The name of the route to generate. - - - Defines a route prefix. - - - Gets the route prefix. - The route prefix. - - - Builds instances based on route information. - - - Initializes a new instance of the class using the default inline constraint resolver. - - - Initializes a new instance of the class. - The to use for resolving inline constraints. - - - Builds an for a particular action. - The generated . - The tokenized route template for the route. - The HTTP methods supported by the route. A null value specify that all possible methods are supported. - The name of the associated controller. - The name of the associated action. - The method that the route attribute has been applied on. - - - Builds an for a particular action. - The generated route. - The tokenized route template for the route. - The controller the route attribute has been applied on. - - - Builds an . - The generated . - The route defaults. - The route constraints. - The detokenized route template. - The method that the route attribute has been applied on. - - - Gets the resolver for resolving inline constraints. - The resolver for resolving inline constraints. - - - Represents a named route. - - - Initializes a new instance of the class. - The route name. - The route. - - - Gets the route name. - The route name, if any; otherwise, null. - - - Gets the route. - The route. - - - Represents an attribute route that may contain custom constraints. - - - Initializes a new instance of the class. - The route template. - - - Gets the route constraints. - The route constraints, if any; otherwise null. - - - Creates a direct route entry. - The direct route entry. - The context to use to create the route. - - - Gets the route data tokens. - The route data tokens, if any; otherwise null. - - - Gets the route defaults. - The route defaults, if any; otherwise null. - - - Gets or sets the route name. - The route name, if any; otherwise null. - - - Gets or sets the route order. - The route order. - - - Gets the route template. - The route template. - - - Constrains a route parameter to contain only lowercase or uppercase letters A through Z in the English alphabet. - - - Initializes a new instance of the class. - - - Constrains a route parameter to represent only Boolean values. - - - - - Constrains a route by several child constraints. - - - Initializes a new instance of the class. - The child constraints that must match for this constraint to match. - - - Gets the child constraints that must match for this constraint to match. - The child constraints that must match for this constraint to match. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to represent only values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to represent only decimal values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to represent only 64-bit floating-point values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to represent only 32-bit floating-point values. - - - - - Constrains a route parameter to represent only values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to represent only 32-bit integer values. - - - - - Constrains a route parameter to be a string of a given length or within a given range of lengths. - - - - Initializes a new instance of the class that constrains a route parameter to be a string of a given length. - The minimum length of the route parameter. - The maximum length of the route parameter. - - - Gets the length of the route parameter, if one is set. - - - - Gets the maximum length of the route parameter, if one is set. - - - Gets the minimum length of the route parameter, if one is set. - - - Constrains a route parameter to represent only 64-bit integer values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to be a string with a maximum length. - - - - - Gets the maximum length of the route parameter. - - - Constrains a route parameter to be an integer with a maximum value. - - - Initializes a new instance of the class. - The maximum value. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of parameter. - A list of parameter values. - The route direction. - - - Gets the maximum value of the route parameter. - The maximum value of the route parameter. - - - Constrains a route parameter to be a string with a maximum length. - - - Initializes a new instance of the class. - The minimum length. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of the compare. - A list of parameter values. - The route direction. - - - Gets the minimum length of the route parameter. - The minimum length of the route parameter. - - - Constrains a route parameter to be a long with a minimum value. - - - Initializes a new instance of the class. - The minimum value. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Gets the minimum value of the route parameter. - The minimum value of the route parameter. - - - Constrains a route by an inner constraint that doesn't fail when an optional parameter is set to its default value. - - - Initializes a new instance of the class. - The inner constraint to match if the parameter is not an optional parameter without a value - - - Gets the inner constraint to match if the parameter is not an optional parameter without a value. - - - - Constraints a route parameter to be an integer within a given range of values. - - - Initializes a new instance of the class. - The minimum value. - The maximum value. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Gets the maximum value of the route parameter. - The maximum value of the route parameter. - - - Gets the minimum value of the route parameter. - The minimum value of the route parameter. - - - Constrains a route parameter to match a regular expression. - - - Initializes a new instance of the class with the specified pattern. - The pattern to match. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP context. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Gets the regular expression pattern to match. - The regular expression pattern to match. - - + + + + System.Web.Mvc + + + + Represents an attribute that specifies which HTTP verbs an action method will respond to. + + + Initializes a new instance of the class by using a list of HTTP verbs that the action method will respond to. + The HTTP verbs that the action method will respond to. + The parameter is null or zero length. + + + Initializes a new instance of the class using the HTTP verbs that the action method will respond to. + The HTTP verbs that the action method will respond to. + + + Determines whether the specified method information is valid for the specified controller context. + true if the method information is valid; otherwise, false. + The controller context. + The method information. + The parameter is null. + + + Gets or sets the list of HTTP verbs that the action method will respond to. + The list of HTTP verbs that the action method will respond to. + + + Provides information about an action method, such as its name, controller, parameters, attributes, and filters. + + + Initializes a new instance of the class. + + + Gets the name of the action method. + The name of the action method. + + + Gets the controller descriptor. + The controller descriptor. + + + Executes the action method by using the specified parameters and controller context. + The result of executing the action method. + The controller context. + The parameters of the action method. + + + Returns an array of custom attributes that are defined for this member, excluding named attributes. + An array of custom attributes, or an empty array if no custom attributes exist. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + + + Returns an array of custom attributes that are defined for this member, identified by type. + An array of custom attributes, or an empty array if no custom attributes of the specified type exist. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + The parameter is null. + + + Gets the filter attributes. + The filter attributes. + true to use the cache, otherwise false. + + + Returns the filters that are associated with this action method. + The filters that are associated with this action method. + + + Returns the parameters of the action method. + The parameters of the action method. + + + Returns the action-method selectors. + The action-method selectors. + + + Determines whether one or more instances of the specified attribute type are defined for this member. + true if is defined for this member; otherwise, false. + The type of the custom attribute. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The parameter is null. + + + Gets the unique ID for the action descriptor using lazy initialization. + The unique ID. + + + Provides the context for the ActionExecuted method of the class. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The controller context. + The action method descriptor. + true if the action is canceled. + The exception object. + The parameter is null. + + + Gets or sets the action descriptor. + The action descriptor. + + + Gets or sets a value that indicates that this object is canceled. + true if the context canceled; otherwise, false. + + + Gets or sets the exception that occurred during the execution of the action method, if any. + The exception that occurred during the execution of the action method. + + + Gets or sets a value that indicates whether the exception is handled. + true if the exception is handled; otherwise, false. + + + Gets or sets the result returned by the action method. + The result returned by the action method. + + + Provides the context for the ActionExecuting method of the class. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using the specified controller context, action descriptor, and action-method parameters. + The controller context. + The action descriptor. + The action-method parameters. + The or parameter is null. + + + Gets or sets the action descriptor. + The action descriptor. + + + Gets or sets the action-method parameters. + The action-method parameters. + + + Gets or sets the result that is returned by the action method. + The result that is returned by the action method. + + + Represents the base class for filter attributes. + + + Initializes a new instance of the class. + + + Called by the ASP.NET MVC framework after the action method executes. + The filter context. + + + Called by the ASP.NET MVC framework before the action method executes. + The filter context. + + + Called by the ASP.NET MVC framework after the action result executes. + The filter context. + + + Called by the ASP.NET MVC framework before the action result executes. + The filter context. + + + Represents an attribute that is used to influence the selection of an action method. + + + Initializes a new instance of the class. + + + Determines whether the action method selection is valid for the specified controller context. + true if the action method selection is valid for the specified controller context; otherwise, false. + The controller context. + Information about the action method. + + + Represents an attribute that is used for the name of an action. + + + Initializes a new instance of the class. + Name of the action. + The parameter is null or empty. + + + Determines whether the action name is valid within the specified controller context. + true if the action name is valid within the specified controller context; otherwise, false. + The controller context. + The name of the action. + Information about the action method. + + + Gets or sets the name of the action. + The name of the action. + + + Represents an attribute that affects the selection of an action method. + + + Initializes a new instance of the class. + + + Determines whether the action name is valid in the specified controller context. + true if the action name is valid in the specified controller context; otherwise, false. + The controller context. + The name of the action. + Information about the action method. + + + Represents the result of an action method. + + + Initializes a new instance of the class. + + + Enables processing of the result of an action method by a custom type that inherits from the class. + The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data. + + + Represents a delegate that contains the logic for selecting an action method. + + + Provides a class that implements the interface in order to support additional metadata. + + + Initializes a new instance of the class. + The name of the model metadata. + The value of the model metadata. + + + Gets the name of the additional metadata attribute. + The name of the of the additional metadata attribute. + + + Provides metadata to the model metadata creation process. + The meta data. + + + Gets the type of the of the additional metadata attribute. + The type of the of the additional metadata attribute. + + + Gets the value of the of the additional metadata attribute. + The value of the of the additional metadata attribute. + + + Represents support for rendering HTML in AJAX scenarios within a view. + + + Initializes a new instance of the class using the specified view context and view data container. + The view context. + The view data container. + One or both of the parameters is null. + + + Initializes a new instance of the class by using the specified view context, view data container, and route collection. + The view context. + The view data container. + The URL route collection. + One or more of the parameters is null. + + + Gets or sets the root path for the location to use for globalization script files. + The location of the folder where globalization script files are stored. The default location is "~/Scripts/Globalization". + + + Serializes the specified message and returns the resulting JSON-formatted string. + The serialized message as a JSON-formatted string. + The message to serialize. + + + Gets the collection of URL routes for the application. + The collection of routes for the application. + + + Gets the ViewBag. + The ViewBag. + + + Gets the context information about the view. + The context of the view. + + + Gets the current view data dictionary. + The view data dictionary. + + + Gets the view data container. + The view data container. + + + Represents support for rendering HTML in AJAX scenarios within a strongly typed view. + The type of the model. + + + Initializes a new instance of the class by using the specified view context and view data container. + The view context. + The view data container. + + + Initializes a new instance of the class by using the specified view context, view data container, and URL route collection. + The view context. + The view data container. + The URL route collection. + + + Gets the ViewBag. + The ViewBag. + + + Gets the strongly typed version of the view data dictionary. + The strongly typed data dictionary of the view. + + + Represents a class that extends the class by adding the ability to determine whether an HTTP request is an AJAX request. + + + Determines whether the specified HTTP request is an AJAX request. + true if the specified HTTP request is an AJAX request; otherwise, false. + The HTTP request. + The parameter is null (Nothing in Visual Basic). + + + Represents an attribute that marks controllers and actions to skip the during authorization. + + + Initializes a new instance of the class. + + + Allows a request to include HTML markup during model binding by skipping request validation for the property. (It is strongly recommended that your application explicitly check all models where you disable request validation in order to prevent script exploits.) + + + Initializes a new instance of the class. + + + This method supports the ASP.NET MVC validation infrastructure and is not intended to be used directly from your code. + The model metadata. + + + Controls interpretation of a controller name when constructing a . + + + Find the controller in the current area. + + + Find the controller in the root area. + + + Provides a way to register one or more areas in an ASP.NET MVC application. + + + Initializes a new instance of the class. + + + Gets the name of the area to register. + The name of the area to register. + + + Registers all areas in an ASP.NET MVC application. + + + Registers all areas in an ASP.NET MVC application by using the specified user-defined information. + An object that contains user-defined information to pass to the area. + + + Registers an area in an ASP.NET MVC application using the specified area's context information. + Encapsulates the information that is required in order to register the area. + + + Encapsulates the information that is required in order to register an area within an ASP.NET MVC application. + + + Initializes a new instance of the class using the specified area name and routes collection. + The name of the area to register. + The collection of routes for the application. + + + Initializes a new instance of the class using the specified area name, routes collection, and user-defined data. + The name of the area to register. + The collection of routes for the application. + An object that contains user-defined information to pass to the area. + + + Gets the name of the area to register. + The name of the area to register. + + + Maps the specified URL route and associates it with the area that is specified by the property. + A reference to the mapped route. + The name of the route. + The URL pattern for the route. + The parameter is null. + + + Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values. + A reference to the mapped route. + The name of the route. + The URL pattern for the route. + An object that contains default route values. + The parameter is null. + + + Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values and constraint. + A reference to the mapped route. + The name of the route. + The URL pattern for the route. + An object that contains default route values. + A set of expressions that specify valid values for a URL parameter. + The parameter is null. + + + Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values, constraints, and namespaces. + A reference to the mapped route. + The name of the route. + The URL pattern for the route. + An object that contains default route values. + A set of expressions that specify valid values for a URL parameter. + An enumerable set of namespaces for the application. + The parameter is null. + + + Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values and namespaces. + A reference to the mapped route. + The name of the route. + The URL pattern for the route. + An object that contains default route values. + An enumerable set of namespaces for the application. + The parameter is null. + + + Maps the specified URL route and associates it with the area that is specified by the property, using the specified namespaces. + A reference to the mapped route. + The name of the route. + The URL pattern for the route. + An enumerable set of namespaces for the application. + The parameter is null. + + + Gets the namespaces for the application. + An enumerable set of namespaces for the application. + + + Gets a collection of defined routes for the application. + A collection of defined routes for the application. + + + Gets an object that contains user-defined information to pass to the area. + An object that contains user-defined information to pass to the area. + + + Provides an abstract class to implement a metadata provider. + + + Called from constructors in a derived class to initialize the class. + + + When overridden in a derived class, creates the model metadata for the property. + The model metadata for the property. + The set of attributes. + The type of the container. + The model accessor. + The type of the model. + The name of the property. + + + Gets a list of attributes. + A list of attributes. + The type of the container. + The property descriptor. + The attribute container. + + + Returns a list of properties for the model. + A list of properties for the model. + The model container. + The type of the container. + + + Returns the metadata for the specified property using the container type and property descriptor. + The metadata for the specified property using the container type and property descriptor. + The model accessor. + The type of the container. + The property descriptor + + + Returns the metadata for the specified property using the container type and property name. + The metadata for the specified property using the container type and property name. + The model accessor. + The type of the container. + The name of the property. + + + Returns the metadata for the specified property using the type of the model. + The metadata for the specified property using the type of the model. + The model accessor. + The type of the model. + + + Returns the type descriptor from the specified type. + The type descriptor. + The type. + + + Provides an abstract class for classes that implement a validation provider. + + + Called from constructors in derived classes to initialize the class. + + + Gets a type descriptor for the specified type. + A type descriptor for the specified type. + The type of the validation provider. + + + Gets the validators for the model using the metadata and controller context. + The validators for the model. + The metadata. + The controller context. + + + Gets the validators for the model using the metadata, the controller context, and a list of attributes. + The validators for the model. + The metadata. + The controller context. + The list of attributes. + + + Provided for backward compatibility with ASP.NET MVC 3. + + + Initializes a new instance of the class. + + + Represents an attribute that is used to set the timeout value, in milliseconds, for an asynchronous method. + + + Initializes a new instance of the class. + The timeout value, in milliseconds. + + + Gets the timeout duration, in milliseconds. + The timeout duration, in milliseconds. + + + Called by ASP.NET before the asynchronous action method executes. + The filter context. + + + Encapsulates the information that is required for using an attribute. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified controller context. + The context within which the result is executed. The context information includes the controller, HTTP content, request context, and route data. + + + Initializes a new instance of the class using the specified controller context and action descriptor. + The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data. + An object that provides information about an action method, such as its name, controller, parameters, attributes, and filters. + + + Provides information about the action method that is marked by the attribute, such as its name, controller, parameters, attributes, and filters. + The action descriptor for the action method that is marked by the attribute. + + + Gets or sets the result that is returned by an action method. + The result that is returned by an action method. + + + Specifies that access to a controller or action method is restricted to users who meet the authorization requirement. + + + Initializes a new instance of the class. + + + When overridden, provides an entry point for custom authorization checks. + true if the user is authorized; otherwise, false. + The HTTP context, which encapsulates all HTTP-specific information about an individual HTTP request. + The parameter is null. + + + Processes HTTP requests that fail authorization. + Encapsulates the information for using . The object contains the controller, HTTP context, request context, action result, and route data. + + + Called when a process requests authorization. + The filter context, which encapsulates information for using . + The parameter is null. + + + Called when the caching module requests authorization. + A reference to the validation status. + The HTTP context, which encapsulates all HTTP-specific information about an individual HTTP request. + The parameter is null. + + + Gets or sets the user roles that are authorized to access the controller or action method. + The user roles that are authorized to access the controller or action method. + + + Gets the unique identifier for this attribute. + The unique identifier for this attribute. + + + Gets or sets the users that are authorized to access the controller or action method. + The users that are authorized to access the controller or action method. + + + Represents an attribute that is used to provide details about how model binding to a parameter should occur. + + + Initializes a new instance of the class. + + + Gets or sets a comma-delimited list of property names for which binding is not allowed. + The exclude list. + + + Gets or sets a comma-delimited list of property names for which binding is allowed. + The include list. + + + Determines whether the specified property is allowed. + true if the specified property is allowed; otherwise, false. + The name of the property. + + + Gets or sets the prefix to use when markup is rendered for binding to an action argument or to a model property. + The prefix to use. + + + Represents the base class for views that are compiled by the BuildManager class before being rendered by a view engine. + + + Initializes a new instance of the class using the specified controller context and view path. + The controller context. + The view path. + + + Initializes a new instance of the class using the specified controller context, view path, and view page activator. + Context information for the current controller. This information includes the HTTP context, request context, route data, parent action view context, and more. + The path to the view that will be rendered. + The object responsible for dynamically constructing the view page at run time. + The parameter is null. + The parameter is null or empty. + + + Renders the specified view context by using the specified the writer object. + Information related to rendering a view, such as view data, temporary data, and form context. + The writer object. + The parameter is null. + An instance of the view type could not be created. + + + When overridden in a derived class, renders the specified view context by using the specified writer object and object instance. + Information related to rendering a view, such as view data, temporary data, and form context. + The writer object. + An object that contains additional information that can be used in the view. + + + Gets or sets the view path. + The view path. + + + Provides a base class for view engines. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified view page activator. + The view page activator. + + + Gets a value that indicates whether a file exists in the specified virtual file system (path). + true if the file exists in the virtual file system; otherwise, false. + The controller context. + The virtual path. + + + + Gets the view page activator. + The view page activator. + + + Maps a browser request to a byte array. + + + Initializes a new instance of the class. + + + Binds the model by using the specified controller context and binding context. + The bound data object.Implements + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + The parameter is null. + + + Provides an abstract class to implement a cached metadata provider. + + + + Initializes a new instance of the class. + + + Gets the cache item policy. + The cache item policy. + + + Gets the cache key prefix. + The cache key prefix. + + + When overridden in a derived class, creates the cached model metadata for the property. + The cached model metadata for the property. + The attributes. + The container type. + The model accessor. + The model type. + The property name. + + + Creates prototype metadata by applying the prototype and model access to yield the final metadata. + The prototype metadata. + The prototype. + The model accessor. + + + Creates a metadata prototype. + A metadata prototype. + The attributes. + The container type. + The model type. + The property name. + + + Gets the metadata for the properties. + The metadata for the properties. + The container. + The container type. + + + Returns the metadata for the specified property. + The metadata for the specified property. + The model accessor. + The container type. + The property descriptor. + + + Returns the metadata for the specified property. + The metadata for the specified property. + The model accessor. + The container type. + The property name. + + + Returns the cached metadata for the specified property using the type of the model. + The cached metadata for the specified property using the type of the model. + The model accessor. + The type of the container. + + + Gets the prototype cache. + The prototype cache. + + + Provides a container to cache attributes. + + + Initializes a new instance of the class. + The attributes. + + + Gets the data type. + The data type. + + + Gets the display. + The display. + + + Gets the display column. + The display column. + + + Gets the display format. + The display format. + + + Gets the display name. + The display name. + + + Indicates whether a data field is editable. + true if the field is editable; otherwise, false. + + + Gets the hidden input. + The hidden input. + + + Indicates whether a data field is read only. + true if the field is read only; otherwise, false. + + + Indicates whether a data field is required. + true if the field is required; otherwise, false. + + + Indicates whether a data field is scaffold. + true if the field is scaffold; otherwise, false. + + + Gets the UI hint. + The UI hint. + + + Provides a container to cache . + + + Initializes a new instance of the class using the prototype and model accessor. + The prototype. + The model accessor. + + + Initializes a new instance of the class using the provider, container type, model type, property name and attributes. + The provider. + The container type. + The model type. + The property name. + The attributes. + + + Gets a value that indicates whether empty strings that are posted back in forms should be converted to Nothing.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. + A value that indicates whether empty strings that are posted back in forms should be converted to Nothing. + + + Gets meta information about the data type.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. + Meta information about the data type. + + + Gets the description of the model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. + The description of the model. + + + Gets the display format string for the model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. + The display format string for the model. + + + Gets the display name of the model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. + The display name of the model. + + + Gets the edit format string of the model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. + The edit format string of the model. + + + Gets a value that indicates whether the model uses a non-default edit format. + A value that indicates whether non-default edit format is used. + + + Gets a value that indicates whether the model object should be rendered using associated HTML elements.Gets a value that indicates whether the model object should be rendered using associated HTML elements.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. + A value that indicates whether the model object should be rendered using associated HTML elements. + + + Gets a value that indicates whether the model is read-only.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. + A value that indicates whether the model is read-only. + + + Gets a value that indicates whether the model is required.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. + A value that indicates whether the model is required. + + + Gets the string to display for null values.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. + The string to display for null values. + + + Gets a value that represents order of the current metadata.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. + A value that represents order of the current metadata. + + + Gets a short display name.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. + A short display name. + + + Gets a value that indicates whether the property should be displayed in read-only views such as list and detail views.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. + A value that indicates whether the property should be displayed in read-only views such as list and detail views. + + + Gets or sets a value that indicates whether the model should be displayed in editable views.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. + Returns . + + + Gets the simple display string for the model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. + The simple display string for the model. + + + Gets a hint that suggests what template to use for this model.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. + A hint that suggests what template to use for this model. + + + Gets a value that can be used as a watermark.If the value is cached, the cashed value is returned; otherwise the value is retrieved from the model metadata and stored in the cache. + A value that can be used as a watermark. + + + Implements the default cached model metadata provider for ASP.NET MVC. + + + Initializes a new instance of the class. + + + Returns a container of real instances of the cached metadata class based on prototype and model accessor. + A container of real instances of the cached metadata class. + The prototype. + The model accessor. + + + Returns a container prototype instances of the metadata class. + a container prototype instances of the metadata class. + The attributes type. + The container type. + The model type. + The property name. + + + Provides a container for cached metadata. + he type of the container. + + + Constructor for creating real instances of the metadata class based on a prototype. + The provider. + The container type. + The model type. + The property name. + The prototype. + + + Constructor for creating the prototype instances of the metadata class. + The prototype. + The model accessor. + + + This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that indicates whether empty strings that are posted back in forms should be converted to null. + A cached value that indicates whether empty strings that are posted back in forms should be converted to null. + + + This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets meta information about the data type. + Meta information about the data type. + + + This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets the description of the model. + The description of the model. + + + This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets the display format string for the model. + The display format string for the model. + + + This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets the display name of the model. + The display name of the model. + + + This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets the edit format string of the model. + The edit format string of the model. + + + This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as . + A value that indicates whether a non-default edit format is used. + + + This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that indicates whether the model object should be rendered using associated HTML elements. + A cached value that indicates whether the model object should be rendered using associated HTML elements. + + + This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that indicates whether the model is read-only. + A cached value that indicates whether the model is read-only. + + + This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that indicates whether the model is required. + A cached value that indicates whether the model is required. + + + This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets the cached string to display for null values. + The cached string to display for null values. + + + This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that represents order of the current metadata. + A cached value that represents order of the current metadata. + + + This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a short display name. + A short display name. + + + This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that indicates whether the property should be displayed in read-only views such as list and detail views. + A cached value that indicates whether the property should be displayed in read-only views such as list and detail views. + + + This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that indicates whether the model should be displayed in editable views. + A cached value that indicates whether the model should be displayed in editable views. + + + This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets the cached simple display string for the model. + The cached simple display string for the model. + + + This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached hint that suggests what template to use for this model. + A cached hint that suggests what template to use for this model. + + + This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as .Gets or sets a cached value that can be used as a watermark. + A cached value that can be used as a watermark. + + + Gets or sets a cached value that indicates whether empty strings that are posted back in forms should be converted to null. + A cached value that indicates whether empty strings that are posted back in forms should be converted to null. + + + Gets or sets meta information about the data type. + The meta information about the data type. + + + Gets or sets the description of the model. + The description of the model. + + + Gets or sets the display format string for the model. + The display format string for the model. + + + Gets or sets the display name of the model. + The display name of the model. + + + Gets or sets the edit format string of the model. + The edit format string of the model. + + + Gets or sets the simple display string for the model. + The simple display string for the model. + + + Gets or sets a value that indicates whether the model object should be rendered using associated HTML elements. + A value that indicates whether the model object should be rendered using associated HTML elements. + + + Gets or sets a value that indicates whether the model is read-only. + A value that indicates whether the model is read-only. + + + Gets or sets a value that indicates whether the model is required. + A value that indicates whether the model is required. + + + Gets or sets the string to display for null values. + The string to display for null values. + + + Gets or sets a value that represents order of the current metadata. + The order value of the current metadata. + + + Gets or sets the prototype cache. + The prototype cache. + + + Gets or sets a short display name. + The short display name. + + + Gets or sets a value that indicates whether the property should be displayed in read-only views such as list and detail views. + true if the model should be displayed in read-only views; otherwise, false. + + + Gets or sets a value that indicates whether the model should be displayed in editable views. + true if the model should be displayed in editable views; otherwise, false. + + + Gets or sets the simple display string for the model. + The simple display string for the model. + + + Gets or sets a hint that suggests what template to use for this model. + A hint that suggests what template to use for this model. + + + Gets or sets a value that can be used as a watermark. + A value that can be used as a watermark. + + + Provides a mechanism to propagates notification that model binder operations should be canceled. + + + Initializes a new instance of the class. + + + Returns the default cancellation token. + The default cancellation token.Implements + The controller context. + The binding context. + + + Represents an attribute that is used to indicate that an action method should be called only as a child action. + + + Initializes a new instance of the class. + + + Called when authorization is required. + An object that encapsulates the information that is required in order to authorize access to the child action. + + + Represents a value provider for values from child actions. + + + Initializes a new instance of the class. + The controller context. + + + Retrieves a value object using the specified key. + The value object for the specified key. + The key. + + + Represents a factory for creating value provider objects for child actions. + + + Initializes a new instance of the class. + + + Returns a object for the specified controller context. + A object. + The controller context. + + + Returns the client data-type model validators. + + + Initializes a new instance of the class. + + + Returns the client data-type model validators. + The client data-type model validators. + The metadata. + The context. + + + Gets the resource class key. + The resource class key. + + + Provides an attribute that compares two properties of a model. + + + Initializes a new instance of the class. + The property to compare with the current property. + + + Applies formatting to an error message based on the data field where the compare error occurred. + The formatted error message. + The name of the field that caused the validation failure. + + + Formats the property for client validation by prepending an asterisk (*) and a dot. + The string "*." is prepended to the property. + The property. + + + Gets a list of compare-value client validation rules for the property using the specified model metadata and controller context. + A list of compare-value client validation rules. + The model metadata. + The controller context. + + + Determines whether the specified object is equal to the compared object. + null if the value of the compared property is equal to the value parameter; otherwise, a validation result that contains the error message that indicates that the comparison failed. + The value of the object to compare. + The validation context. + + + Gets the property to compare with the current property. + The property to compare with the current property. + + + Gets the other properties display name. + The other properties display name. + + + Represents a user-defined content type that is the result of an action method. + + + Initializes a new instance of the class. + + + Gets or sets the content. + The content. + + + Gets or sets the content encoding. + The content encoding. + + + Gets or sets the type of the content. + The type of the content. + + + Enables processing of the result of an action method by a custom type that inherits from the class. + The context within which the result is executed. + The parameter is null. + + + Provides methods that respond to HTTP requests that are made to an ASP.NET MVC Web site. + + + Initializes a new instance of the class. + + + Gets the action invoker for the controller. + The action invoker. + + + Provides asynchronous operations. + Returns . + + + Begins execution of the specified request context + Returns an IAsyncController instance. + The request context. + The asynchronous callback. + The state. + + + Begins to invoke the action in the current controller context. + Returns an IAsyncController instance. + The callback. + The state. + + + Gets or sets the binder. + The binder. + + + Creates a content result object by using a string. + The content result instance. + The content to write to the response. + + + Creates a content result object by using a string and the content type. + The content result instance. + The content to write to the response. + The content type (MIME type). + + + Creates a content result object by using a string, the content type, and content encoding. + The content result instance. + The content to write to the response. + The content type (MIME type). + The content encoding. + + + Creates an action invoker. + An action invoker. + + + Creates a temporary data provider. + A temporary data provider. + + + Gets whether to disable the asynchronous support for the controller. + true to disable the asynchronous support for the controller; otherwise, false. + + + Releases all resources that are used by the current instance of the class. + + + Releases unmanaged resources and optionally releases managed resources. + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + Ends the invocation of the action in the current controller context. + The asynchronous result. + + + Ends the execute core. + The asynchronous result. + + + Invokes the action in the current controller context. + + + Creates a FileContentResult object by using the file contents and file type. + The file-content result object. + The binary content to send to the response. + The content type (MIME type). + + + Creates a FileContentResult object by using the file contents, content type, and the destination file name. + The file-content result object. + The binary content to send to the response. + The content type (MIME type). + The file name to use in the file-download dialog box that is displayed in the browser. + + + Creates a FileStreamResult object by using the Stream object and content type. + The file-content result object. + The stream to send to the response. + The content type (MIME type). + + + Creates a FileStreamResult object using the Stream object, the content type, and the target file name. + The file-stream result object. + The stream to send to the response. + The content type (MIME type) + The file name to use in the file-download dialog box that is displayed in the browser. + + + Creates a FilePathResult object by using the file name and the content type. + The file-stream result object. + The path of the file to send to the response. + The content type (MIME type). + + + Creates a FilePathResult object by using the file name, the content type, and the file download name. + The file-stream result object. + The path of the file to send to the response. + The content type (MIME type). + The file name to use in the file-download dialog box that is displayed in the browser. + + + Called when a request matches this controller, but no method with the specified action name is found in the controller. + The name of the attempted action. + + + Gets HTTP-specific information about an individual HTTP request. + The HTTP context. + + + Returns an instance of the class. + An instance of the class. + + + Returns an instance of the class. + An instance of the class. + The status description. + + + Initializes data that might not be available when the constructor is called. + The HTTP context and route data. + + + Creates a object. + The object that writes the script to the response. + The JavaScript code to run on the client + + + Creates a object that serializes the specified object to JavaScript Object Notation (JSON). + The JSON result object that serializes the specified object to JSON format. The result object that is prepared by this method is written to the response by the ASP.NET MVC framework when the object is executed. + The JavaScript object graph to serialize. + + + Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format. + The JSON result object that serializes the specified object to JSON format. + The JavaScript object graph to serialize. + The content type (MIME type). + + + Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format. + The JSON result object that serializes the specified object to JSON format. + The JavaScript object graph to serialize. + The content type (MIME type). + The content encoding. + + + Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format using the content type, content encoding, and the JSON request behavior. + The result object that serializes the specified object to JSON format. + The JavaScript object graph to serialize. + The content type (MIME type). + The content encoding. + The JSON request behavior + + + Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format using the specified content type and JSON request behavior. + The result object that serializes the specified object to JSON format. + The JavaScript object graph to serialize. + The content type (MIME type). + The JSON request behavior + + + Creates a JsonResult object that serializes the specified object to JavaScript Object Notation (JSON) format using the specified JSON request behavior. + The result object that serializes the specified object to JSON format. + The JavaScript object graph to serialize. + The JSON request behavior. + + + Gets the model state dictionary object that contains the state of the model and of model-binding validation. + The model state dictionary. + + + Called after the action method is invoked. + Information about the current request and action. + + + Called before the action method is invoked. + Information about the current request and action. + + + Called when authorization occurs. + Information about the current request and action. + + + Called when authorization challenge occurs. + Information about the current request and action. + + + Called when authorization occurs. + Information about the current request and action. + + + Called when an unhandled exception occurs in the action. + Information about the current request and action. + + + Called after the action result that is returned by an action method is executed. + Information about the current request and action result. + + + Called before the action result that is returned by an action method is executed. + Information about the current request and action result. + + + Creates a object that renders a partial view. + A partial-view result object. + + + Creates a object that renders a partial view, by using the specified model. + A partial-view result object. + The model that is rendered by the partial view + + + Creates a object that renders a partial view, by using the specified view name. + A partial-view result object. + The name of the view that is rendered to the response. + + + Creates a object that renders a partial view, by using the specified view name and model. + A partial-view result object. + The name of the view that is rendered to the response. + The model that is rendered by the partial view + + + Gets the HTTP context profile. + The HTTP context profile. + + + Creates a object that redirects to the specified URL. + The redirect result object. + The URL to redirect to. + + + Returns an instance of the class with the Permanent property set to true. + An instance of the class with the Permanent property set to true. + The URL to redirect to. + + + Redirects to the specified action using the action name. + The redirect result object. + The name of the action. + + + Redirects to the specified action using the action name and route values. + The redirect result object. + The name of the action. + The parameters for a route. + + + Redirects to the specified action using the action name and controller name. + The redirect result object. + The name of the action. + The name of the controller. + + + Redirects to the specified action using the action name, controller name, and route dictionary. + The redirect result object. + The name of the action. + The name of the controller. + The parameters for a route. + + + Redirects to the specified action using the action name, controller name, and route values. + The redirect result object. + The name of the action. + The name of the controller. + The parameters for a route. + + + Redirects to the specified action using the action name and route dictionary. + The redirect result object. + The name of the action. + The parameters for a route. + + + Returns an instance of the class with the Permanent property set to true using the specified action name. + An instance of the class with the Permanent property set to true using the specified action name, controller name, and route values. + The action name. + + + Returns an instance of the class with the Permanent property set to true using the specified action name, and route values. + An instance of the class with the Permanent property set to true using the specified action name, and route values. + The action name. + The route values. + + + Returns an instance of the class with the Permanent property set to true using the specified action name, and controller name. + An instance of the class with the Permanent property set to true using the specified action name, and controller name. + The action name. + The controller name. + + + Returns an instance of the class with the Permanent property set to true using the specified action name, controller name, and route values. + An instance of the class with the Permanent property set to true using the specified action name, controller name, and route values. + The action name. + The controller name. + The route values. + + + Returns an instance of the class with the Permanent property set to true using the specified action name, controller name, and route values. + An instance of the class with the Permanent property set to true using the specified action name, controller name, and route values. + The action name. + The controller name. + The route values. + + + Returns an instance of the class with the Permanent property set to true using the specified action name, and route values. + An instance of the class with the Permanent property set to true using the specified action name, and route values. + The action name. + The route values. + + + Redirects to the specified route using the specified route values. + The redirect-to-route result object. + The parameters for a route. + + + Redirects to the specified route using the route name. + The redirect-to-route result object. + The name of the route. + + + Redirects to the specified route using the route name and route values. + The redirect-to-route result object. + The name of the route. + The parameters for a route. + + + Redirects to the specified route using the route name and route dictionary. + The redirect-to-route result object. + The name of the route. + The parameters for a route. + + + Redirects to the specified route using the route dictionary. + The redirect-to-route result object. + The parameters for a route. + + + Returns an instance of the RedirectResult class with the Permanent property set to true using the specified route values. + Returns an instance of the RedirectResult class with the Permanent property set to true. + The route name. + + + Returns an instance of the RedirectResult class with the Permanent property set to true using the specified route name. + Returns an instance of the RedirectResult class with the Permanent property set to true using the specified route name. + The route name. + + + Returns an instance of the RedirectResult class with the Permanent property set to true using the specified route name and route values. + An instance of the RedirectResult class with the Permanent property set to true using the specified route name and route values. + The route name. + The route values. + + + Returns an instance of the RedirectResult class with the Permanent property set to true using the specified route name and route values. + An instance of the RedirectResult class with the Permanent property set to true. + The route name. + The route values. + + + Returns an instance of the RedirectResult class with the Permanent property set to true using the specified route values. + An instance of the RedirectResult class with the Permanent property set to true using the specified route values. + The route values. + + + Gets the HttpRequestBase object for the current HTTP request. + The request object. + + + Represents a replaceable dependency resolver providing services. By default, it uses the . + + + Gets the HttpResponseBase object for the current HTTP response. + The HttpResponseBase object for the current HTTP response. + + + Gets the route data for the current request. + The route data. + + + Gets the HttpServerUtilityBase object that provides methods that are used during Web request processing. + The HTTP server object. + + + Gets the HttpSessionStateBase object for the current HTTP request. + The HTTP session-state object for the current HTTP request. + + + This method calls the BeginExecute method. + The result of the operation. + The request context. + The asynchronous callback. + The state of the object. + + + This method calls the EndExecute method. + The asynchronous result of the operation. + + + This method calls the OnAuthentication method. + The filter context. + + + This method calls the OnAuthenticationChallenge method. + The filter context. + + + This method calls the OnActionExecuted method. + The filter context. + + + This method calls the OnActionExecuting method. + The filter context. + + + This method calls the OnAuthorization method. + The filter context. + + + This method calls the OnException method. + The filter context. + + + This method calls the OnResultExecuted method. + The filter context. + + + This method calls the OnResultExecuting method. + The filter context. + + + Gets the temporary-data provider object that is used to store data for the next request. + The temporary-data provider. + + + Updates the specified model instance using values from the controller's current value provider. + true if the update is successful; otherwise, false. + The model instance to update. + The type of the model object. + The parameter or the ValueProvider property is null. + + + Updates the specified model instance using values from the controller's current value provider and a prefix. + true if the update is successful; otherwise, false. + The model instance to update. + The prefix to use when looking up values in the value provider. + The type of the model object. + The parameter or the ValueProvider property is null. + + + Updates the specified model instance using values from the controller's current value provider, a prefix, and included properties. + true if the update is successful; otherwise, false. + The model instance to update. + The prefix to use when looking up values in the value provider. + A list of properties of the model to update. + The type of the model object. + The parameter or the ValueProvider property is null. + + + Updates the specified model instance using values from the controller's current value provider, a prefix, a list of properties to exclude, and a list of properties to include. + true if the update is successful; otherwise, false. + The model instance to update. + The prefix to use when looking up values in the value provider. + A list of properties of the model to update. + A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the includeProperties parameter list. + The type of the model object. + The parameter or the ValueProvider property is null. + + + Updates the specified model instance using values from the value provider, a prefix, a list of properties to exclude , and a list of properties to include. + true if the update is successful; otherwise, false. + The model instance to update. + The prefix to use when looking up values in the value provider. + A list of properties of the model to update. + A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the includeProperties parameter list. + A dictionary of values that is used to update the model. + The type of the model object. + + + Updates the specified model instance using values from the value provider, a prefix, and included properties. + true if the update is successful; otherwise, false. + The model instance to update. + The prefix to use when looking up values in the value provider. + A list of properties of the model to update. + A dictionary of values that is used to update the model. + The type of the model object. + + + Updates the specified model instance using values from the value provider and a list of properties to include. + true if the update is successful; otherwise, false. + The model instance to update. + A list of properties of the model to update. + A dictionary of values that is used to update the model. + The type of the model object. + + + Updates the specified model instance using values from the controller's current value provider and included properties. + true if the update is successful; otherwise, false. + The model instance to update. + A list of properties of the model to update. + The type of the model object. + + + Updates the specified model instance using values from the value provider and a list of properties to include. + true if the update is successful; otherwise, false. + The model instance to update. + A list of properties of the model to update. + A dictionary of values that is used to update the model. + The type of the model object. + + + Updates the specified model instance using values from the value provider. + true if the update is successful; otherwise, false. + The model instance to update. + A dictionary of values that is used to update the model. + The type of the model object. + + + Validates the specified model instance. + true if the model validation is successful; otherwise, false. + The model to validate. + + + Validates the specified model instance using an HTML prefix. + true if the model validation is successful; otherwise, false. + The model to validate. + The prefix to use when looking up values in the model provider. + + + Updates the specified model instance using values from the controller's current value provider. + The model instance to update. + The type of the model object. + + + Updates the specified model instance using values from the controller's current value provider and a prefix. + The model instance to update. + A prefix to use when looking up values in the value provider. + The type of the model object. + + + Updates the specified model instance using values from the controller's current value provider, a prefix, and included properties. + The model instance to update. + A prefix to use when looking up values in the value provider. + A list of properties of the model to update. + The type of the model object. + + + Updates the specified model instance using values from the controller's current value provider, a prefix, a list of properties to exclude, and a list of properties to include. + The model instance to update. + A prefix to use when looking up values in the value provider. + A list of properties of the model to update. + A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the includeProperties list. + The type of the model object. + + + Updates the specified model instance using values from the value provider, a prefix, a list of properties to exclude, and a list of properties to include. + The model instance to update. + The prefix to use when looking up values in the value provider. + A list of properties of the model to update. + A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the includeProperties parameter list. + A dictionary of values that is used to update the model. + The type of the model object. + + + Updates the specified model instance using values from the value provider, a prefix, and a list of properties to include. + The model instance to update. + The prefix to use when looking up values in the value provider. + A list of properties of the model to update. + A dictionary of values that is used to update the model. + The type of the model object. + + + Updates the specified model instance using values from the value provider, a prefix, and a list of properties to include. + The model instance to update. + A list of properties of the model to update. + A dictionary of values that is used to update the model. + The type of the model object. + + + Updates the specified model instance using values from the controller object's current value provider. + The model instance to update. + A list of properties of the model to update. + The type of the model object. + + + Updates the specified model instance using values from the value provider, a prefix, and a list of properties to include. + The model instance to update. + A list of properties of the model to update. + A dictionary of values that is used to update the model. + The type of the model object. + + + Updates the specified model instance using values from the value provider. + The model instance to update. + A dictionary of values that is used to update the model. + The type of the model object. + + + Gets the URL helper object that is used to generate URLs by using routing. + The URL helper object. + + + Gets the user security information for the current HTTP request. + The user security information for the current HTTP request. + + + Validates the specified model instance. + The model to validate. + + + Validates the specified model instance using an HTML prefix. + The model to validate. + The prefix to use when looking up values in the model provider. + + + Creates a object that renders a view to the response. + The result that renders a view to the response. + + + Creates a object by using the model that renders a view to the response. + The view result. + The model that is rendered by the view. + + + Creates a object by using the view name that renders a view. + The view result. + The name of the view that is rendered to the response. + + + Creates a object that renders the specified IView object. + The view result. + The view that is rendered to the response. + The model that is rendered by the view. + + + Creates a object using the view name and master-page name that renders a view to the response. + The view result. + The name of the view that is rendered to the response. + The name of the master page or template to use when the view is rendered. + + + Creates a object using the view name, master-page name, and model that renders a view. + The view result. + The name of the view that is rendered to the response. + The name of the master page or template to use when the view is rendered. + The model that is rendered by the view. + + + Creates a object that renders the specified IView object. + The view result. + The view that is rendered to the response. + + + Creates a object that renders the specified object. + The view result. + The view that is rendered to the response. + The model that is rendered by the view. + + + Gets the view engine collection. + The view engine collection. + + + Represents a class that is responsible for invoking the action methods of a controller. + + + Initializes a new instance of the class. + + + Gets or sets the model binders that are associated with the action. + The model binders that are associated with the action. + + + Creates the action result. + The action result object. + The controller context. + The action descriptor. + The action return value. + + + Finds the information about the action method. + Information about the action method. + The controller context. + The controller descriptor. + The name of the action. + + + Retrieves information about the controller by using the specified controller context. + Information about the controller. + The controller context. + + + Retrieves information about the action filters. + Information about the action filters. + The controller context. + The action descriptor. + + + Gets the value of the specified action-method parameter. + The value of the action-method parameter. + The controller context. + The parameter descriptor. + + + Gets the values of the action-method parameters. + The values of the action-method parameters. + The controller context. + The action descriptor. + + + Invokes the specified action by using the specified controller context. + The result of executing the action. + The controller context. + The name of the action to invoke. + The parameter is null. + The parameter is null or empty. + The thread was aborted during invocation of the action. + An unspecified error occurred during invocation of the action. + + + Invokes the specified action method by using the specified parameters and the controller context. + The result of executing the action method. + The controller context. + The action descriptor. + The parameters. + + + Invokes the specified action method by using the specified parameters, controller context, and action filters. + The context for the ActionExecuted method of the class. + The controller context. + The action filters. + The action descriptor. + The parameters. + + + Invokes the specified action result by using the specified controller context. + The controller context. + The action result. + + + Invokes the specified action result by using the specified action filters and the controller context. + The context for the ResultExecuted method of the class. + The controller context. + The action filters. + The action result. + + + + + Invokes the specified authorization filters by using the specified action descriptor and controller context. + The context for the object. + The controller context. + The authorization filters. + The action descriptor. + + + Invokes the specified exception filters by using the specified exception and controller context. + The context for the object. + The controller context. + The exception filters. + The exception. + + + Represents the base class for all MVC controllers. + + + Initializes a new instance of the class. + + + Gets or sets the controller context. + The controller context. + + + Executes the specified request context. + The request context. + The parameter is null. + + + Executes the request. + + + Initializes the specified request context. + The request context. + + + Executes the specified request context. + The request context. + + + Gets or sets the dictionary for temporary data. + The dictionary for temporary data. + + + Gets or sets a value that indicates whether request validation is enabled for this request. + true if request validation is enabled for this request; otherwise, false. The default is true. + + + Gets or sets the value provider for the controller. + The value provider for the controller. + + + Gets the dynamic view data dictionary. + The dynamic view data dictionary. + + + Gets or sets the dictionary for view data. + The dictionary for the view data. + + + Represents a class that is responsible for dynamically building a controller. + + + Initializes a new instance of the class. + + + Gets the current controller builder object. + The current controller builder. + + + Gets the default namespaces. + The default namespaces. + + + Gets the associated controller factory. + The controller factory. + + + Sets the controller factory by using the specified type. + The type of the controller factory. + The parameter is null. + The controller factory cannot be assigned from the type in the parameter. + An error occurred while the controller factory was being set. + + + Sets the specified controller factory. + The controller factory. + The parameter is null. + + + Encapsulates information about an HTTP request that matches specified and instances. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using the specified HTTP context, URL route data, and controller. + The HTTP context. + The route data. + The controller. + + + Initializes a new instance of the class by using the specified controller context. + The controller context. + The parameter is null. + + + Initializes a new instance of the class by using the specified request context and controller. + The request context. + The controller. + One or both parameters are null. + + + Gets or sets the controller. + The controller. + + + Gets the display mode. + The display mode. + + + Gets or sets the HTTP context. + The HTTP context. + + + Gets a value that indicates whether the associated action method is a child action. + true if the associated action method is a child action; otherwise, false. + + + Gets an object that contains the view context information for the parent action method. + An object that contains the view context information for the parent action method. + + + Gets or sets the request context. + The request context. + + + Gets or sets the URL route data. + The URL route data. + + + Encapsulates information that describes a controller, such as its name, type, and actions. + + + Initializes a new instance of the class. + + + Gets the name of the controller. + The name of the controller. + + + Gets the type of the controller. + The type of the controller. + + + Finds an action method by using the specified name and controller context. + The information about the action method. + The controller context. + The name of the action. + + + Retrieves a list of action-method descriptors in the controller. + A list of action-method descriptors in the controller. + + + Retrieves custom attributes that are defined for this member, excluding named attributes. + An array of custom attributes, or an empty array if no custom attributes exist. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + + + Retrieves custom attributes of a specified type that are defined for this member, excluding named attributes. + An array of custom attributes, or an empty array if no custom attributes exist. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + The parameter is null (Nothing in Visual Basic). + + + Gets the filter attributes. + The filter attributes. + true if the cache should be used; otherwise, false. + + + Retrieves a value that indicates whether one or more instance of the specified custom attribute are defined for this member. + true if the is defined for this member; otherwise, false. + The type of the custom attribute. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The parameter is null (Nothing in Visual Basic). + + + When implemented in a derived class, gets the unique ID for the controller descriptor using lazy initialization. + The unique ID. + + + Adds the controller to the instance. + + + Initializes a new instance of the class. + + + Returns the collection of controller instance filters. + The collection of controller instance filters. + The controller context. + The action descriptor. + + + Represents an attribute that invokes a custom model binder. + + + Initializes a new instance of the class. + + + Retrieves the associated model binder. + A reference to an object that implements the interface. + + + Provides a container for common metadata, for the class, and for the class for a data model. + + + Initializes a new instance of the class. + The data-annotations model metadata provider. + The type of the container. + The model accessor. + The type of the model. + The name of the property. + The display column attribute. + + + Returns simple text for the model data. + Simple text for the model data. + + + Implements the default model metadata provider for ASP.NET MVC. + + + Initializes a new instance of the class. + + + Gets the metadata for the specified property. + The metadata for the property. + The attributes. + The type of the container. + The model accessor. + The type of the model. + The name of the property. + + + Represents the method that creates a instance. + + + Provides a model validator. + + + Initializes a new instance of the class. + The metadata for the model. + The controller context for the model. + The validation attribute for the model. + + + Gets the validation attribute for the model validator. + The validation attribute for the model validator. + + + Gets the error message for the validation failure. + The error message for the validation failure. + + + Retrieves a collection of client validation rules. + A collection of client validation rules. + + + Gets a value that indicates whether model validation is required. + true if model validation is required; otherwise, false. + + + Returns a list of validation error messages for the model. + A list of validation error messages for the model, or an empty list if no errors have occurred. + The container for the model. + + + Provides a model validator for a specified validation type. + + + + Initializes a new instance of the class. + The metadata for the model. + The controller context for the model. + The validation attribute for the model. + + + Gets the validation attribute from the model validator. + The validation attribute from the model validator. + + + Implements the default validation provider for ASP.NET MVC. + + + Initializes a new instance of the class. + + + Gets or sets a value that indicates whether non-nullable value types are required. + true if non-nullable value types are required; otherwise, false. + + + Gets a list of validators. + A list of validators. + The metadata. + The context. + The list of validation attributes. + + + Registers an adapter to provide client-side validation. + The type of the validation attribute. + The type of the adapter. + + + Registers an adapter factory for the validation provider. + The type of the attribute. + The factory that will be used to create the object for the specified attribute. + + + Registers the default adapter. + The type of the adapter. + + + Registers the default adapter factory. + The factory that will be used to create the object for the default adapter. + + + Registers an adapter to provide default object validation. + The type of the adapter. + + + Registers an adapter factory for the default object validation provider. + The factory. + + + Registers an adapter to provide object validation. + The type of the model. + The type of the adapter. + + + Registers an adapter factory for the object validation provider. + The type of the model. + The factory. + + + Provides a factory for validators that are based on . + + + Provides a container for the error-information model validator. + + + Initializes a new instance of the class. + + + Gets a list of error-information model validators. + A list of error-information model validators. + The model metadata. + The controller context. + + + Represents the controller factory that is registered by default. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using a controller activator. + An object that implements the controller activator interface. + + + Creates the specified controller by using the specified request context. + The controller. + The context of the HTTP request, which includes the HTTP context and route data. + The name of the controller. + The parameter is null. + The parameter is null or empty. + + + Retrieves the controller instance for the specified request context and controller type. + The controller instance. + The context of the HTTP request, which includes the HTTP context and route data. + The type of the controller. + + is null. + + cannot be assigned. + An instance of cannot be created. + + + Returns the controller's session behavior. + The controller's session behavior. + The request context. + The type of the controller. + + + Retrieves the controller type for the specified name and request context. + The controller type. + The context of the HTTP request, which includes the HTTP context and route data. + The name of the controller. + + + Releases the specified controller. + The controller to release. + + + This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. This method calls the method. + The controller's session behavior. + The request context. + The controller name. + + + Maps a browser request to a data object. This class provides a concrete implementation of a model binder. + + + Initializes a new instance of the class. + + + Gets or sets the model binders for the application. + The model binders for the application. + + + Binds the model by using the specified controller context and binding context. + The bound object. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + The parameter is null. + + + Binds the specified property by using the specified controller context and binding context and the specified property descriptor. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + Describes a property to be bound. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. + + + Creates the specified model type by using the specified controller context and binding context. + A data object of the specified type. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + The type of the model object to return. + + + Creates an index (a subindex) based on a category of components that make up a larger index, where the specified index value is an integer. + The name of the subindex. + The prefix for the subindex. + The index value. + + + Creates an index (a subindex) based on a category of components that make up a larger index, where the specified index value is a string. + The name of the subindex. + The prefix for the subindex. + The index value. + + + Creates the name of the subproperty by using the specified prefix and property name. + The name of the subproperty. + The prefix for the subproperty. + The name of the property. + + + Returns a set of properties that match the property filter restrictions that are established by the specified . + An enumerable set of property descriptors. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + + + Returns the properties of the model by using the specified controller context and binding context. + A collection of property descriptors. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + + + Returns the value of a property using the specified controller context, binding context, property descriptor, and property binder. + An object that represents the property value. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + The descriptor for the property to access. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. + An object that provides a way to bind the property. + + + Returns the descriptor object for a type that is specified by its controller context and binding context. + A custom type descriptor object. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + + + Determines whether a data model is valid for the specified binding context. + true if the model is valid; otherwise, false. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + The parameter is null. + + + Called when the model is updated. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + + + Called when the model is updating. + true if the model is updating; otherwise, false. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + + + Called when the specified property is validated. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + Describes a property to be validated. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. + The value to set for the property. + + + Called when the specified property is validating. + true if the property is validating; otherwise, false. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + Describes a property being validated. The descriptor provides information such as component type, property type, and property value. It also provides methods to get or set the property value. + The value to set for the property. + + + Gets or sets the name of the resource file (class key) that contains localized string values. + The name of the resource file (class key). + + + Sets the specified property by using the specified controller context, binding context, and property value. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + Describes a property to be set. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. + The value to set for the property. + + + Represents a memory cache for view locations. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using the specified cache time span. + The cache time span. + The Ticks attribute of the parameter is set to a negative number. + + + Retrieves the default view location by using the specified HTTP context and cache key. + The default view location. + The HTTP context. + The cache key + The parameter is null. + + + Inserts the view in the specified virtual path by using the specified HTTP context, cache key, and virtual path. + The HTTP context. + The cache key. + The virtual path + The parameter is null. + + + Creates an empty view location cache. + + + Gets or sets the cache time span. + The cache time span. + + + Provides a registration point for dependency resolvers that implement or the Common Service Locator IServiceLocator interface. + + + Initializes a new instance of the class. + + + Gets the implementation of the dependency resolver. + The implementation of the dependency resolver. + + + This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. + The implementation of the dependency resolver. + + + This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. + The function that provides the service. + The function that provides the services. + + + This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. + The common service locator. + + + This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. + The object that implements the dependency resolver. + + + Provides a registration point for dependency resolvers using the specified service delegate and specified service collection delegates. + The service delegate. + The services delegates. + + + Provides a registration point for dependency resolvers using the provided common service locator when using a service locator interface. + The common service locator. + + + Provides a registration point for dependency resolvers, using the specified dependency resolver interface. + The dependency resolver. + + + Provides a type-safe implementation of and . + + + Resolves singly registered services that support arbitrary object creation. + The requested service or object. + The dependency resolver instance that this method extends. + The type of the requested service or object. + + + Resolves multiply registered services. + The requested services. + The dependency resolver instance that this method extends. + The type of the requested services. + + + Represents the base class for value providers whose values come from a collection that implements the interface. + The type of the value. + + + Initializes a new instance of the class. + The name/value pairs that are used to initialize the value provider. + Information about a specific culture, such as the names of the culture, the writing system, and the calendar used. + The parameter is null. + + + Determines whether the collection contains the specified prefix. + true if the collection contains the specified prefix; otherwise, false. + The prefix to search for. + The parameter is null. + + + Gets the keys from the prefix. + The keys from the prefix. + the prefix. + + + Returns a value object using the specified key and controller context. + The value object for the specified key. + The key of the value object to retrieve. + The parameter is null. + + + Provides an empty metadata provider for data models that do not require metadata. + + + Initializes a new instance of the class. + + + Creates a new instance of the class. + A new instance of the class. + The attributes. + The type of the container. + The model accessor. + The type of the model. + The name of the model. + + + Provides an empty validation provider for models that do not require a validator. + + + Initializes a new instance of the class. + + + Gets the empty model validator. + The empty model validator. + The metadata. + The context. + + + Represents a result that does nothing, such as a controller action method that returns nothing. + + + Initializes a new instance of the class. + + + Executes the specified result context. + The result context. + + + Provides the context for using the class. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class for the specified exception by using the specified controller context. + The controller context. + The exception. + The parameter is null. + + + Gets or sets the exception object. + The exception object. + + + Gets or sets a value that indicates whether the exception has been handled. + true if the exception has been handled; otherwise, false. + + + Gets or sets the action result. + The action result. + + + Provides a helper class to get the model name from an expression. + + + Gets the model name from a lambda expression. + The model name. + The expression. + + + Gets the model name from a string expression. + The model name. + The expression. + + + Provides a container for client-side field validation metadata. + + + Initializes a new instance of the class. + + + Gets or sets the name of the data field. + The name of the data field. + + + Gets or sets a value that indicates whether the validation message contents should be replaced with the client validation error. + true if the validation message contents should be replaced with the client validation error; otherwise, false. + + + Gets or sets the validator message ID. + The validator message ID. + + + Gets the client validation rules. + The client validation rules. + + + Sends the contents of a binary file to the response. + + + Initializes a new instance of the class by using the specified file contents and content type. + The byte array to send to the response. + The content type to use for the response. + The parameter is null. + + + The binary content to send to the response. + The file contents. + + + Writes the file content to the response. + The response. + + + Sends the contents of a file to the response. + + + Initializes a new instance of the class by using the specified file name and content type. + The name of the file to send to the response. + The content type of the response. + The parameter is null or empty. + + + Gets or sets the path of the file that is sent to the response. + The path of the file that is sent to the response. + + + Writes the file to the response. + The response. + + + Represents a base class that is used to send binary file content to the response. + + + Initializes a new instance of the class. + The type of the content. + The parameter is null or empty. + + + Gets the content type to use for the response. + The type of the content. + + + Enables processing of the result of an action method by a custom type that inherits from the class. + The context within which the result is executed. + The parameter is null. + + + Gets or sets the content-disposition header so that a file-download dialog box is displayed in the browser with the specified file name. + The name of the file. + + + Writes the file to the response. + The response. + + + Sends binary content to the response by using a instance. + + + Initializes a new instance of the class. + The stream to send to the response. + The content type to use for the response. + The parameter is null. + + + Gets the stream that will be sent to the response. + The file stream. + + + Writes the file to the response. + The response. + + + Represents a metadata class that contains a reference to the implementation of one or more of the filter interfaces, the filter's order, and the filter's scope. + + + Initializes a new instance of the class. + The instance. + The scope. + The order. + + + Represents a constant that is used to specify the default ordering of filters. + + + Gets the instance of this class. + The instance of this class. + + + Gets the order in which the filter is applied. + The order in which the filter is applied. + + + Gets the scope ordering of the filter. + The scope ordering of the filter. + + + Represents the base class for action and result filter attributes. + + + Initializes a new instance of the class. + + + Gets or sets a value that indicates whether more than one instance of the filter attribute can be specified. + true if more than one instance of the filter attribute can be specified; otherwise, false. + + + Gets or sets the order in which the action filters are executed. + The order in which the action filters are executed. + + + Defines a filter provider for filter attributes. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class and optionally caches attribute instances. + true to cache attribute instances; otherwise, false. + + + Gets a collection of custom action attributes. + A collection of custom action attributes. + The controller context. + The action descriptor. + + + Gets a collection of controller attributes. + A collection of controller attributes. + The controller context. + The action descriptor. + + + Aggregates the filters from all of the filter providers into one collection. + The collection filters from all of the filter providers. + The controller context. + The action descriptor. + + + Encapsulates information about the available action filters. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified filters collection. + The filters collection. + + + Gets all the action filters in the application. + The action filters. + + + Gets all the authentication filters in the application. + The list of authentication filters. + + + Gets all the authorization filters in the application. + The authorization filters. + + + Gets all the exception filters in the application. + The exception filters. + + + Gets all the result filters in the application. + The result filters. + + + Represents the collection of filter providers for the application. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with specified list of filter provider. + The list of filter providers. + + + Removes all elements from the collection. + + + Returns the collection of filter providers. + The collection of filter providers. + The controller context. + The action descriptor. + + + Inserts an element into the collection at the specified index. + The zero-based index at which item should be inserted. + The object to insert. The value can be null for reference types. + + + Removes the element at the specified index of the collection + The zero-based index of the element to remove. + + + Replaces the element at the specified index. + The zero-based index of the element to replace. + The new value for the element at the specified index. The value can be null for reference types. + + + Provides a registration point for filters. + + + Provides a registration point for filters. + The collection of filters. + + + Defines values that specify the order in which ASP.NET MVC filters run within the same filter type and filter order. + + + Specifies an order before and after . + + + Specifies an order before and after . + + + Specifies first. + + + Specifies an order before and after . + + + Specifies last. + + + Contains the form value providers for the application. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The collection. + The parameter is null. + + + Gets the specified value provider. + The value provider. + The name of the value provider to get. + The parameter is null or empty. + + + Gets a value that indicates whether the value provider contains an entry that has the specified prefix. + true if the value provider contains an entry that has the specified prefix; otherwise, false. + The prefix to look for. + + + Gets a value from a value provider using the specified key. + A value from a value provider. + The key. + + + Returns a dictionary that contains the value providers. + A dictionary of value providers. + + + Encapsulates information that is required in order to validate and process the input data from an HTML form. + + + Initializes a new instance of the class. + + + Gets the field validators for the form. + A dictionary of field validators for the form. + + + Gets or sets the form identifier. + The form identifier. + + + Returns a serialized object that contains the form identifier and field-validation values for the form. + A serialized object that contains the form identifier and field-validation values for the form. + + + Returns the validation value for the specified input field. + The value to validate the field input with. + The name of the field to retrieve the validation value for. + The parameter is either null or empty. + + + Returns the validation value for the specified input field and a value that indicates what to do if the validation value is not found. + The value to validate the field input with. + The name of the field to retrieve the validation value for. + true to create a validation value if one is not found; otherwise, false. + The parameter is either null or empty. + + + Returns a value that indicates whether the specified field has been rendered in the form. + true if the field has been rendered; otherwise, false. + The field name. + + + Sets a value that indicates whether the specified field has been rendered in the form. + The field name. + true to specify that the field has been rendered in the form; otherwise, false. + + + Determines whether client validation errors should be dynamically added to the validation summary. + true if client validation errors should be added to the validation summary; otherwise, false. + + + Gets or sets the identifier for the validation summary. + The identifier for the validation summary. + + + Enumerates the HTTP request types for a form. + + + Specifies a GET request. + + + Specifies a POST request. + + + Represents a value provider for form values that are contained in a object. + + + Initializes a new instance of the class. + An object that encapsulates information about the current HTTP request. + + + Represents a class that is responsible for creating a new instance of a form-value provider object. + + + Initializes a new instance of the class. + + + Returns a form-value provider object for the specified controller context. + A form-value provider object. + An object that encapsulates information about the current HTTP request. + The parameter is null. + + + Represents a class that contains all the global filters. + + + Initializes a new instance of the class. + + + Adds the specified filter to the global filter collection. + The filter. + + + Adds the specified filter to the global filter collection using the specified filter run order. + The filter. + The filter run order. + + + Removes all filters from the global filter collection. + + + Determines whether a filter is in the global filter collection. + true if is found in the global filter collection; otherwise, false. + The filter. + + + Gets the number of filters in the global filter collection. + The number of filters in the global filter collection. + + + Returns an enumerator that iterates through the global filter collection. + An enumerator that iterates through the global filter collection. + + + Removes all the filters that match the specified filter. + The filter to remove. + + + This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. + An enumerator that iterates through the global filter collection. + + + This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. + An enumerator that iterates through the global filter collection. + The controller context. + The action descriptor. + + + Represents the global filter collection. + + + Gets or sets the global filter collection. + The global filter collection. + + + Represents an attribute that is used to handle an exception that is thrown by an action method. + + + Initializes a new instance of the class. + + + Gets or sets the type of the exception. + The type of the exception. + + + Gets or sets the master view for displaying exception information. + The master view. + + + Called when an exception occurs. + The action-filter context. + The parameter is null. + + + Gets the unique identifier for this attribute. + The unique identifier for this attribute. + + + Gets or sets the page view for displaying exception information. + The page view. + + + Encapsulates information for handling an error that was thrown by an action method. + + + Initializes a new instance of the class. + The exception. + The name of the controller. + The name of the action. + The parameter is null. + The or parameter is null or empty. + + + Gets or sets the name of the action that was executing when the exception was thrown. + The name of the action. + + + Gets or sets the name of the controller that contains the action method that threw the exception. + The name of the controller. + + + Gets or sets the exception object. + The exception object. + + + Represents an attribute that is used to indicate whether a property or field value should be rendered as a hidden input element. + + + Initializes a new instance of the class. + + + Gets or sets a value that indicates whether to display the value of the hidden input element. + true if the value should be displayed; otherwise, false. + + + Enumerates the date rendering mode for HTML5. + + + The current culture formatting. + + + The RFC 3339 formatting. + + + Supports the rendering of HTML controls in a view. + + + Initializes a new instance of the class by using the specified view context and view data container. + The view context. + The view data container. + The or the viewDataContainer parameter is null. + + + Initializes a new instance of the class by using the specified view context, view data container, and route collection. + The view context. + The view data container. + The route collection. + One or more parameters is null. + + + Replaces underscore characters (_) with hyphens (-) in the specified HTML attributes. + The HTML attributes with underscore characters replaced by hyphens. + The HTML attributes. + + + Generates a hidden form field (anti-forgery token) that is validated when the form is submitted. + The generated form field (anti-forgery token). + + + Generates a hidden form field (anti-forgery token) that is validated when the form is submitted. The field value is generated using the specified salt value. + The generated form field (anti-forgery token). + The salt value, which can be any non-empty string. + + + Generates a hidden form field (anti-forgery token) that is validated when the form is submitted. The field value is generated using the specified salt value, domain, and path. + The generated form field (anti-forgery token). + The salt value, which can be any non-empty string. + The application domain. + The virtual path. + + + Converts the specified attribute value to an HTML-encoded string. + The HTML-encoded string. If the value parameter is null or empty, this method returns an empty string. + The object to encode. + + + Converts the specified attribute value to an HTML-encoded string. + The HTML-encoded string. If the value parameter is null or empty, this method returns an empty string. + The string to encode. + + + Gets or sets a value that indicates whether client validation is enabled. + true if enable client validation is enabled; otherwise, false. + + + Enables input validation that is performed by using client script in the browser. + + + Enables or disables client validation. + true to enable client validation; otherwise, false. + + + Enables or disables unobtrusive JavaScript. + + + Enables or disables unobtrusive JavaScript. + true to enable unobtrusive JavaScript; otherwise, false. + + + Converts the value of the specified object to an HTML-encoded string. + The HTML-encoded string. + The object to encode. + + + Converts the specified string to an HTML-encoded string. + The HTML-encoded string. + The string to encode. + + + Formats the value. + The formatted value. + The value. + The format string. + + + Creates an HTML element ID using the specified element name. + The ID of the HTML element. + The name of the HTML element. + The name parameter is null. + + + Creates an HTML element ID using the specified element name and a string that replaces dots in the name. + The ID of the HTML element. + The name of the HTML element. + The string that replaces dots (.) in the name parameter. + The name parameter or the idAttributeDotReplacement parameter is null. + + + Generates an HTML anchor element (a element) that links to the specified action method, and enables the user to specify the communication protocol, name of the host, and a URL fragment. + An HTML element that links to the specified action method. + The context of the HTTP request. + The collection of URL routes. + The text caption to display for the link. + The name of the route that is used to return a virtual path. + The name of the action method. + The name of the controller. + The communication protocol, such as HTTP or HTTPS. If this parameter is null, the protocol defaults to HTTP. + The name of the host. + The fragment identifier. + An object that contains the parameters for a route. + An object that contains the HTML attributes for the element. + + + Generates an HTML anchor element (a element) that links to the specified action method. + An HTML element that links to the specified action method. + The context of the HTTP request. + The collection of URL routes. + The text caption to display for the link. + The name of the route that is used to return a virtual path. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. + An object that contains the HTML attributes for the element. + + + Generates an HTML anchor element (a element) that links to the specified URL route, and enables the user to specify the communication protocol, name of the host, and a URL fragment. + An HTML element that links to the specified URL route. + The context of the HTTP request. + The collection of URL routes. + The text caption to display for the link. + The name of the route that is used to return a virtual path. + The communication protocol, such as HTTP or HTTPS. If this parameter is null, the protocol defaults to HTTP. + The name of the host. + The fragment identifier. + An object that contains the parameters for a route. + An object that contains the HTML attributes for the element. + + + Generates an HTML anchor element (a element) that links to the specified URL route. + An HTML element that links to the specified URL route. + The context of the HTTP request. + The collection of URL routes. + The text caption to display for the link. + The name of the route that is used to return a virtual path. + An object that contains the parameters for a route. + An object that contains the HTML attributes for the element. + + + Returns the HTTP method that handles form input (GET or POST) as a string. + The form method string, either "get" or "post". + The HTTP method that handles the form. + + + Returns the HTML input control type as a string. + The input type string ("checkbox", "hidden", "password", "radio", or "text"). + The enumerated input type. + + + Gets the collection of unobtrusive JavaScript validation attributes using the specified HTML name attribute. + The collection of unobtrusive JavaScript validation attributes. + The HTML name attribute. + + + Gets the collection of unobtrusive JavaScript validation attributes using the specified HTML name attribute and model metadata. + The collection of unobtrusive JavaScript validation attributes. + The HTML name attribute. + The model metadata. + + + Gets or sets the HTML5 date rendering mode. + The HTML5 date rendering mode. + + + Returns a hidden input element that identifies the override method for the specified HTTP data-transfer method that was used by the client. + The override method that uses the HTTP data-transfer method that was used by the client. + The HTTP data-transfer method that was used by the client (DELETE, HEAD, or PUT). + The httpVerb parameter is not "PUT", "DELETE", or "HEAD". + + + Returns a hidden input element that identifies the override method for the specified verb that represents the HTTP data-transfer method used by the client. + The override method that uses the verb that represents the HTTP data-transfer method used by the client. + The verb that represents the HTTP data-transfer method used by the client. + The httpVerb parameter is not "PUT", "DELETE", or "HEAD". + + + Gets or sets the character that replaces periods in the ID attribute of an element. + The character that replaces periods in the ID attribute of an element. + + + Creates a dictionary from an object, by adding each public instance property as a key with its associated value to the dictionary. It will expose public properties from derived types as well. This is typically used with objects of an anonymous type. + The created dictionary of property names and property values. + The object to be converted. + + + Returns markup that is not HTML encoded. + The HTML markup without encoding. + The HTML markup. + + + Returns markup that is not HTML encoded. + The HTML markup without encoding. + The HTML markup. + + + Gets or sets the collection of routes for the application. + The collection of routes for the application. + + + Set element name used to wrap the validation message generated by and other overloads. + + + Set element name used to wrap a top-level message in and other overloads. + + + Gets or sets a value that indicates whether unobtrusive JavaScript is enabled. + true if unobtrusive JavaScript is enabled; otherwise, false. + + + The name of the CSS class that is used to style an input field when a validation error occurs. + + + The name of the CSS class that is used to style an input field when the input is valid. + + + The name of the CSS class that is used to style the error message when a validation error occurs. + + + Element name used to wrap the validation message generated by and other overloads. + + + The name of the CSS class that is used to style the validation message when the input is valid. + + + The name of the CSS class that is used to style validation summary error messages. + + + Element name used to wrap a top-level message in and other overloads. + + + The name of the CSS class that is used to style the validation summary when the input is valid. + + + Gets the view bag. + The view bag. + + + Gets or sets the context information about the view. + The context of the view. + + + Gets the current view data dictionary. + The view data dictionary. + + + Gets or sets the view data container. + The view data container. + + + Represents support for rendering HTML controls in a strongly typed view. + The type of the model. + + + Initializes a new instance of the class by using the specified view context and view data container. + The view context. + The view data container. + + + Initializes a new instance of the class by using the specified view context, view data container, and route collection. + The view context. + The view data container. + The route collection. + + + Gets the view bag. + The view bag. + + + Gets the strongly typed view data dictionary. + The strongly typed view data dictionary. + + + Represents an attribute that is used to restrict an action method so that the method handles only HTTP DELETE requests. + + + Initializes a new instance of the class. + + + Determines whether the action method delete request is valid for the specified controller context. + true if the action method request is valid for the specified controller context; otherwise, false. + The controller context. + Information about the action method. + + + Represents a value provider to use with values that come from a collection of HTTP files. + + + Initializes a new instance of the class. + An object that encapsulates information about the current HTTP request. + + + Represents a class that is responsible for creating a new instance of an HTTP file collection value provider object. + + + Initializes a new instance of the class. + + + Returns a value provider object for the specified controller context. + An HTTP file collection value provider. + An object that encapsulates information about the HTTP request. + The parameter is null. + + + Represents an attribute that is used to restrict an action method so that the method handles only HTTP GET requests. + + + Initializes a new instance of the class. + + + Determines whether the action method get request is valid for the specified controller context. + true if the action method request is valid for the specified controller context; otherwise, false. + The controller context. + Information about the action method. + + + Specifies that the HTTP request must be the HTTP HEAD method. + + + Initializes a new instance of the class. + + + Determines whether the action method request is valid for the specified controller context. + true if the action method request is valid for the specified controller context; otherwise, false. + The controller context. + Information about the action method. + + + Defines an object that is used to indicate that the requested resource was not found. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using a status description. + The status description. + + + Represents an attribute that is used to restrict an action method so that the method handles only HTTP OPTIONS requests. + + + Initializes a new instance of the class. + + + Determines whether the action method request is valid for the specified controller context. + true if the action method request is valid for the specified controller context; otherwise, false. + The controller context. + Information about the action method. + + + Represents an attribute that is used to restrict an action method so that the method handles only HTTP PATCH requests. + + + Initializes a new instance of the class. + + + Determines whether the action method request is valid for the specified controller context. + true if the action method request is valid for the specified controller context; otherwise, false. + The controller context. + Information about the action method. + + + Represents an attribute that is used to restrict an action method so that the method handles only HTTP POST requests. + + + Initializes a new instance of the class. + + + Determines whether the action method post request is valid for the specified controller context. + true if the action method request is valid for the specified controller context; otherwise, false. + The controller context. + Information about the action method. + + + Binds a model to a posted file. + + + Initializes a new instance of the class. + + + Binds the model. + The bound value.Implements + The controller context. + The binding context. + One or both parameters are null. + + + Represents an attribute that is used to restrict an action method so that the method handles only HTTP PUT requests. + + + Initializes a new instance of the class. + + + Determines whether the action method put request is valid for the specified controller context. + true if the action method request is valid for the specified controller context; otherwise, false. + The controller context. + Information about the action method. + + + Extends the class that contains the HTTP values that were sent by a client during a Web request. + + + Retrieves the HTTP data-transfer method override that was used by the client. + The HTTP data-transfer method override that was used by the client. + An object that contains the HTTP values that were sent by a client during a Web request. + The parameter is null. + The HTTP data-transfer method override was not implemented. + + + Provides a way to return an action result with a specific HTTP response status code and description. + + + Initializes a new instance of the class using a status code. + The status code. + + + Initializes a new instance of the class using a status code and status description. + The status code. + The status description. + + + Initializes a new instance of the class using a status code. + The status code. + + + Initializes a new instance of the class using a status code and status description. + The status code. + The status description. + + + Enables processing of the result of an action method by a custom type that inherits from the class. + The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data. + + + Gets the HTTP status code. + The HTTP status code. + + + Gets the HTTP status description. + the HTTP status description. + + + Represents the result of an unauthorized HTTP request. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the status description. + The status description. + + + Enumerates the HTTP verbs. + + + Requests that a specified URI be deleted. + + + Retrieves the information or entity that is identified by the URI of the request. + + + Retrieves the message headers for the information or entity that is identified by the URI of the request. + + + Represents a request for information about the communication options available on the request/response chain identified by the Request-URI. + + + Requests that a set of changes described in the request entity be applied to the resource identified by the Request- URI. + + + Posts a new entity as an addition to a URI. + + + Replaces an entity that is identified by a URI. + + + Defines the methods that are used in an action filter. + + + Called after the action method executes. + The filter context. + + + Called before an action method executes. + The filter context. + + + Defines the contract for an action invoker, which is used to invoke an action in response to an HTTP request. + + + Invokes the specified action by using the specified controller context. + true if the action was found; otherwise, false. + The controller context. + The name of the action. + + + Used to create an instance for the current request. + + + Creates an instance of action invoker for the current request. + The created . + + + Defines the methods that are required for an authorization filter. + + + Called when authorization is required. + The filter context. + + + Provides a way for the ASP.NET MVC validation framework to discover at run time whether a validator has support for client validation. + + + When implemented in a class, returns client validation rules for that class. + The client validation rules for this validator. + The model metadata. + The controller context. + + + Defines the methods that are required for a controller. + + + Executes the specified request context. + The request context. + + + Provides fine-grained control over how controllers are instantiated using dependency injection. + + + When implemented in a class, creates a controller. + The created controller. + The request context. + The controller type. + + + Defines the methods that are required for a controller factory. + + + Creates the specified controller by using the specified request context. + The controller. + The request context. + The name of the controller. + + + Gets the controller's session behavior. + The controller's session behavior. + The request context. + The name of the controller whose session behavior you want to get. + + + Releases the specified controller. + The controller. + + + Defines the methods that simplify service location and dependency resolution. + + + Resolves singly registered services that support arbitrary object creation. + The requested service or object. + The type of the requested service or object. + + + Resolves multiply registered services. + The requested services. + The type of the requested services. + + + Represents a special that has the ability to be enumerable. + + + Gets the keys from the prefix. + The keys. + The prefix. + + + Defines the methods that are required for an exception filter. + + + Called when an exception occurs. + The filter context. + + + Provides an interface for finding filters. + + + Returns an enumerator that contains all the instances in the service locator. + The enumerator that contains all the instances in the service locator. + The controller context. + The action descriptor. + + + Provides an interface for exposing attributes to the class. + + + When implemented in a class, provides metadata to the model metadata creation process. + The model metadata. + + + An optional interface for types which provide a . + + + Gets the MethodInfo + + + Defines the methods that are required for a model binder. + + + Binds the model to a value by using the specified controller context and binding context. + The bound value. + The controller context. + The binding context. + + + Defines methods that enable dynamic implementations of model binding for classes that implement the interface. + + + Returns the model binder for the specified type. + The model binder for the specified type. + The type of the model. + + + Defines members that specify the order of filters and whether multiple filters are allowed. + + + When implemented in a class, gets or sets a value that indicates whether multiple filters are allowed. + true if multiple filters are allowed; otherwise, false. + + + When implemented in a class, gets the filter order. + The filter order. + + + Enumerates the types of input controls. + + + A check box. + + + A hidden field. + + + A password box. + + + A radio button. + + + A text box. + + + Defines the methods that are required for a result filter. + + + Called after an action result executes. + The filter context. + + + Called before an action result executes. + The filter context. + + + Associates a route with an area in an ASP.NET MVC application. + + + Gets the name of the area to associate the route with. + The name of the area to associate the route with. + + + Defines the contract for temporary-data providers that store data that is viewed on the next request. + + + Loads the temporary data. + The temporary data. + The controller context. + + + Saves the temporary data. + The controller context. + The values. + + + Used to create an instance for the controller. + + + Creates an instance of for the controller. + The created . + + + Represents an interface that can skip request validation. + + + Retrieves the value of the object that is associated with the specified key. + The value of the object for the specified key. + The key. + true if validation should be skipped; otherwise, false. + + + Defines the methods that are required for a value provider in ASP.NET MVC. + + + Determines whether the collection contains the specified prefix. + true if the collection contains the specified prefix; otherwise, false. + The prefix to search for. + + + Retrieves a value object using the specified key. + The value object for the specified key, or null if the key is not found. + The key of the value object to retrieve. + + + Defines the methods that are required for a view. + + + Renders the specified view context by using the specified the writer object. + The view context. + The writer object. + + + Defines the methods that are required for a view data dictionary. + + + Gets or sets the view data dictionary. + The view data dictionary. + + + Defines the methods that are required for a view engine. + + + Finds the specified partial view by using the specified controller context. + The partial view. + The controller context. + The name of the partial view. + true to specify that the view engine returns the cached view, if a cached view exists; otherwise, false. + + + Finds the specified view by using the specified controller context. + The page view. + The controller context. + The name of the view. + The name of the master. + true to specify that the view engine returns the cached view, if a cached view exists; otherwise, false. + + + Releases the specified view by using the specified controller context. + The controller context. + The view. + + + Defines the methods that are required in order to cache view locations in memory. + + + Gets the view location by using the specified HTTP context and the cache key. + The view location. + The HTTP context. + The cache key. + + + Inserts the specified view location into the cache by using the specified HTTP context and the cache key. + The HTTP context. + The cache key. + The virtual path. + + + Provides fine-grained control over how view pages are created using dependency injection. + + + Provides fine-grained control over how view pages are created using dependency injection. + The created view page. + The controller context. + The type of the controller. + + + Sends JavaScript content to the response. + + + Initializes a new instance of the class. + + + Enables processing of the result of an action method by a custom type that inherits from the class. + The context within which the result is executed. + The parameter is null. + + + Gets or sets the script. + The script. + + + The JQuery Form Value provider is used to handle JQuery formatted data in request Forms. + + + Constructs a new instance of the JQuery form ValueProvider + The context on which the ValueProvider operates. + + + Provides the necessary ValueProvider to handle JQuery Form data. + + + Constructs a new instance of the factory which provides JQuery form ValueProviders. + + + Returns the suitable ValueProvider. + The context on which the ValueProvider should operate. + + + Specifies whether HTTP GET requests from the client are allowed. + + + HTTP GET requests from the client are allowed. + + + HTTP GET requests from the client are not allowed. + + + Represents a class that is used to send JSON-formatted content to the response. + + + Initializes a new instance of the class. + + + Gets or sets the content encoding. + The content encoding. + + + Gets or sets the type of the content. + The type of the content. + + + Gets or sets the data. + The data. + + + Enables processing of the result of an action method by a custom type that inherits from the class. + The context within which the result is executed. + The parameter is null. + + + Gets or sets a value that indicates whether HTTP GET requests from the client are allowed. + A value that indicates whether HTTP GET requests from the client are allowed. + + + Gets or sets the maximum length of data. + The maximum length of data. + + + Gets or sets the recursion limit. + The recursion limit. + + + Enables action methods to send and receive JSON-formatted text and to model-bind the JSON text to parameters of action methods. + + + Initializes a new instance of the class. + + + Returns a JSON value-provider object for the specified controller context. + A JSON value-provider object for the specified controller context. + The controller context. + + + Maps a browser request to a LINQ object. + + + Initializes a new instance of the class. + + + Binds the model by using the specified controller context and binding context. + The bound data object. If the model cannot be bound, this method returns null.Implements. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + + + Provides an adapter for the MaxLengthAttribute attribute. + + + Initializes a new instance of the MaxLengthAttribute class. + The model metadata. + The controller context. + The MaxLength attribute. + + + Gets a list of client validation rules for a max length check. + A list of client validation rules for the check. + + + Provides an adapter for the MinLengthAttribute attribute. + + + Initializes a new instance of the MinLenghtAttribute class. + The model metadata. + The controller context. + The minimum length attribute. + + + Gets a list of client validation rules for the minimum length check. + A list of client validation rules for a check. + + + Represents an attribute that is used to associate a model type to a model-builder type. + + + Initializes a new instance of the class. + The type of the binder. + The parameter is null. + + + Gets or sets the type of the binder. + The type of the binder. + + + Retrieves an instance of the model binder. + A reference to an object that implements the interface. + An error occurred while an instance of the model binder was being created. + + + Represents a class that contains all model binders for the application, listed by binder type. + + + Initializes a new instance of the class. + + + Adds the specified item to the model binder dictionary. + The object to add to the instance. + The object is read-only. + + + Adds the specified item to the model binder dictionary using the specified key. + The key of the element to add. + The value of the element to add. + The object is read-only. + + is null. + An element that has the same key already exists in the object. + + + Removes all items from the model binder dictionary. + The object is read-only. + + + Determines whether the model binder dictionary contains a specified value. + true if is found in the model binder dictionary; otherwise, false. + The object to locate in the object. + + + Determines whether the model binder dictionary contains an element that has the specified key. + true if the model binder dictionary contains an element that has the specified key; otherwise, false. + The key to locate in the object. + + is null. + + + Copies the elements of the model binder dictionary to an array, starting at a specified index. + The one-dimensional array that is the destination of the elements copied from . The array must have zero-based indexing. + The zero-based index in at which copying starts. + + is null. + + is less than 0. + + is multidimensional.-or- is equal to or greater than the length of .-or- The number of elements in the source object is greater than the available space from to the end of the destination array. -or- Type cannot be cast automatically to the type of the destination array. + + + Gets the number of elements in the model binder dictionary. + The number of elements in the model binder dictionary. + + + Gets or sets the default model binder. + The default model binder. + + + Retrieves the model binder for the specified type. + The model binder. + The type of the model to retrieve. + The parameter is null. + + + Retrieves the model binder for the specified type or retrieves the default model binder. + The model binder. + The type of the model to retrieve. + true to retrieve the default model binder. + The parameter is null. + + + Returns an enumerator that can be used to iterate through the collection. + An enumerator that can be used to iterate through the collection. + + + Gets a value that indicates whether the model binder dictionary is read-only. + true if the model binder dictionary is read-only; otherwise, false. + + + Gets or sets the specified key in an object that implements the interface. + The key for the specified item. + + + Gets a collection that contains the keys in the model binder dictionary. + A collection that contains the keys in the model binder dictionary. + + + Removes the first occurrence of the specified element from the model binder dictionary. + true if was successfully removed from the model binder dictionary; otherwise, false. This method also returns false if is not found in the model binder dictionary. + The object to remove from the object. + The object is read-only. + + + Removes the element that has the specified key from the model binder dictionary. + true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the model binder dictionary. + The key of the element to remove. + The object is read-only. + + is null. + + + Returns an enumerator that can be used to iterate through a collection. + An enumerator that can be used to iterate through the collection. + + + Gets the value that is associated with the specified key. + true if the object that implements contains an element that has the specified key; otherwise, false. + The key of the value to get. + When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. + + is null. + + + Gets a collection that contains the values in the model binder dictionary. + A collection that contains the values in the model binder dictionary. + + + No content here will be updated; please do not add material here. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using a list of model binder providers. + A list of model binder providers. + + + Removes all elements from the collection. + + + Returns a model binder of the specified type. + A model binder of the specified type. + The type of the model binder. + + + Inserts a model binder provider into the ModelBinderProviderCollection at the specified index. + The index. + The model binder provider. + + + Removes the element at the specified index of the collection. + The zero-based index of the element to remove. + + + Replaces the model binder provider element at the specified index. + The index. + The model binder provider. + + + Provides a container for model binder providers. + + + Provides a registration point for model binder providers for applications that do not use dependency injection. + The model binder provider collection. + + + Provides global access to the model binders for the application. + + + Gets the model binders for the application. + The model binders for the application. + + + Provides the context in which a model binder functions. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the binding context. + The binding context. + + + Gets or sets a value that indicates whether the binder should use an empty prefix. + true if the binder should use an empty prefix; otherwise, false. + + + Gets or sets the model. + The model. + + + Gets or sets the model metadata. + The model metadata. + + + Gets or sets the name of the model. + The name of the model. + + + Gets or sets the state of the model. + The state of the model. + + + Gets or sets the type of the model. + The type of the model. + + + Gets or sets the property filter. + The property filter. + + + Gets the property metadata. + The property metadata. + + + Gets or sets the value provider. + The value provider. + + + Represents an error that occurs during model binding. + + + Initializes a new instance of the class by using the specified exception. + The exception. + The parameter is null. + + + Initializes a new instance of the class by using the specified exception and error message. + The exception. + The error message. + The parameter is null. + + + Initializes a new instance of the class by using the specified error message. + The error message. + + + Gets or sets the error message. + The error message. + + + Gets or sets the exception object. + The exception object. + + + A collection of instances. + + + Initializes a new instance of the class. + + + Adds the specified object to the model-error collection. + The exception. + + + Adds the specified error message to the model-error collection. + The error message. + + + Provides a container for common metadata, for the class, and for the class for a data model. + + + Initializes a new instance of the class. + The provider. + The type of the container. + The model accessor. + The type of the model. + The name of the model. + + + Gets a dictionary that contains additional metadata about the model. + A dictionary that contains additional metadata about the model. + + + A reference to the model's container object. Will be non-null if the model represents a property. + + + Gets or sets the type of the container for the model. + The type of the container for the model. + + + Gets or sets a value that indicates whether empty strings that are posted back in forms should be converted to null. + true if empty strings that are posted back in forms should be converted to null; otherwise, false. The default value is true. + + + Gets or sets meta information about the data type. + Meta information about the data type. + + + The default order value, which is 10000. + + + Gets or sets the description of the model. + The description of the model. The default value is null. + + + Gets or sets the display format string for the model. + The display format string for the model. + + + Gets or sets the display name of the model. + The display name of the model. + + + Gets or sets the edit format string of the model. + The edit format string of the model. + + + Returns the metadata from the parameter for the model. + The metadata. + An expression that identifies the model. + The view data dictionary. + The type of the parameter. + The type of the value. + + + Gets the metadata from the expression parameter for the model. + The metadata for the model. + An expression that identifies the model. + The view data dictionary. + + + Gets the display name for the model. + The display name for the model. + + + Returns the simple description of the model. + The simple description of the model. + + + Gets a list of validators for the model. + A list of validators for the model. + The controller context. + + + Gets or sets a value that indicates whether the model object should be rendered using associated HTML elements. + true if the associated HTML elements that contains the model object should be included with the object; otherwise, false. + + + Gets or sets a value that indicates whether the model is a complex type. + A value that indicates whether the model is considered a complex type by the MVC framework. + + + Gets a value that indicates whether the type is nullable. + true if the type is nullable; otherwise, false. + + + Gets or sets a value that indicates whether the model is read-only. + true if the model is read-only; otherwise, false. + + + Gets or sets a value that indicates whether the model is required. + true if the model is required; otherwise, false. + + + Gets the value of the model. + The value of the model. For more information about , see the entry ASP.NET MVC 2 Templates, Part 2: ModelMetadata on Brad Wilson's blog + + + Gets the type of the model. + The type of the model. + + + Gets or sets the string to display for null values. + The string to display for null values. + + + Gets or sets a value that represents order of the current metadata. + The order value of the current metadata. + + + Gets a collection of model metadata objects that describe the properties of the model. + A collection of model metadata objects that describe the properties of the model. + + + Gets the property name. + The property name. + + + Gets or sets the provider. + The provider. + + + Gets or sets a value that indicates whether request validation is enabled. + true if request validation is enabled; otherwise, false. + + + Gets or sets a short display name. + The short display name. + + + Gets or sets a value that indicates whether the property should be displayed in read-only views such as list and detail views. + true if the model should be displayed in read-only views; otherwise, false. + + + Gets or sets a value that indicates whether the model should be displayed in editable views. + true if the model should be displayed in editable views; otherwise, false. + + + Gets or sets the simple display string for the model. + The simple display string for the model. + + + Gets or sets a hint that suggests what template to use for this model. + A hint that suggests what template to use for this model. + + + Gets or sets a value that can be used as a watermark. + The watermark. + + + Provides an abstract base class for a custom metadata provider. + + + When overridden in a derived class, initializes a new instance of the object that derives from the class. + + + Gets a object for each property of a model. + A object for each property of a model. + The container. + The type of the container. + + + Gets metadata for the specified property. + A object for the property. + The model accessor. + The type of the container. + The property to get the metadata model for. + + + Gets metadata for the specified model accessor and model type. + A object for the specified model accessor and model type. + The model accessor. + The type of the model. + + + Provides a container for the current instance. + + + Gets or sets the current object. + The current object. + + + Encapsulates the state of model binding to a property of an action-method argument, or to the argument itself. + + + Initializes a new instance of the class. + + + Returns a object that contains any errors that occurred during model binding. + The errors. + + + Returns a object that encapsulates the value that was being bound during model binding. + The value. + + + Represents the state of an attempt to bind a posted form to an action method, which includes validation information. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using values that are copied from the specified model-state dictionary. + The model-state dictionary. + The parameter is null. + + + Adds the specified item to the model-state dictionary. + The object to add to the model-state dictionary. + The model-state dictionary is read-only. + + + Adds an element that has the specified key and value to the model-state dictionary. + The key of the element to add. + The value of the element to add. + The model-state dictionary is read-only. + + is null. + An element that has the specified key already occurs in the model-state dictionary. + + + Adds the specified model error to the errors collection for the model-state dictionary that is associated with the specified key. + The key. + The exception. + + + Adds the specified error message to the errors collection for the model-state dictionary that is associated with the specified key. + The key. + The error message. + + + Removes all items from the model-state dictionary. + The model-state dictionary is read-only. + + + Determines whether the model-state dictionary contains a specific value. + true if is found in the model-state dictionary; otherwise, false. + The object to locate in the model-state dictionary. + + + Determines whether the model-state dictionary contains the specified key. + true if the model-state dictionary contains the specified key; otherwise, false. + The key to locate in the model-state dictionary. + + + Copies the elements of the model-state dictionary to an array, starting at a specified index. + The one-dimensional array that is the destination of the elements copied from the object. The array must have zero-based indexing. + The zero-based index in at which copying starts. + + is null. + + is less than 0. + + is multidimensional.-or- is equal to or greater than the length of .-or- The number of elements in the source collection is greater than the available space from to the end of the destination .-or- Type cannot be cast automatically to the type of the destination . + + + Gets the number of key/value pairs in the collection. + The number of key/value pairs in the collection. + + + Returns an enumerator that can be used to iterate through the collection. + An enumerator that can be used to iterate through the collection. + + + Gets a value that indicates whether the collection is read-only. + true if the collection is read-only; otherwise, false. + + + Gets a value that indicates whether this instance of the model-state dictionary is valid. + true if this instance is valid; otherwise, false. + + + Determines whether there are any objects that are associated with or prefixed with the specified key. + true if the model-state dictionary contains a value that is associated with the specified key; otherwise, false. + The key. + The parameter is null. + + + Gets or sets the value that is associated with the specified key. + The model state item. + + + Gets a collection that contains the keys in the dictionary. + A collection that contains the keys of the model-state dictionary. + + + Copies the values from the specified object into this dictionary, overwriting existing values if keys are the same. + The dictionary. + + + Removes the first occurrence of the specified object from the model-state dictionary. + true if was successfully removed the model-state dictionary; otherwise, false. This method also returns false if is not found in the model-state dictionary. + The object to remove from the model-state dictionary. + The model-state dictionary is read-only. + + + Removes the element that has the specified key from the model-state dictionary. + true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the model-state dictionary. + The key of the element to remove. + The model-state dictionary is read-only. + + is null. + + + Sets the value for the specified key by using the specified value provider dictionary. + The key. + The value. + + + Returns an enumerator that can be used to iterate through the collection. + An enumerator that can be used to iterate through the collection. + + + Attempts to gets the value that is associated with the specified key. + true if the object that implements contains an element that has the specified key; otherwise, false. + The key of the value to get. + When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. + + is null. + + + Gets a collection that contains the values in the dictionary. + A collection that contains the values of the model-state dictionary. + + + Provides a container for a validation result. + + + Initializes a new instance of the class. + + + Gets or sets the name of the member. + The name of the member. + + + Gets or sets the validation result message. + The validation result message. + + + Provides a base class for implementing validation logic. + + + Called from constructors in derived classes to initialize the class. + The metadata. + The controller context. + + + Gets the controller context. + The controller context. + + + When implemented in a derived class, returns metadata for client validation. + The metadata for client validation. + + + Returns a composite model validator for the model. + A composite model validator for the model. + The metadata. + The controller context. + + + Gets or sets a value that indicates whether a model property is required. + true if the model property is required; otherwise, false. + + + Gets the metadata for the model validator. + The metadata for the model validator. + + + When implemented in a derived class, validates the object. + A list of validation results. + The container. + + + Provides a list of validators for a model. + + + When implemented in a derived class, initializes a new instance of the class. + + + Gets a list of validators. + A list of validators. + The metadata. + The context. + + + No content here will be updated; please do not add material here. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using a list of model-validation providers. + A list of model-validation providers. + + + Removes all elements from the collection. + + + Returns the list of model validators. + The list of model validators. + The model metadata. + The controller context. + + + Inserts a model-validator provider into the collection. + The zero-based index at which item should be inserted. + The model-validator provider object to insert. + + + Removes the element at the specified index of the collection. + The zero-based index of the element to remove. + + + Replaces the model-validator provider element at the specified index. + The zero-based index of the model-validator provider element to replace. + The new value for the model-validator provider element. + + + Provides a container for the current validation provider. + + + Gets the model validator provider collection. + The model validator provider collection. + + + Represents a list of items that users can select more than one item from. + + + Initializes a new instance of the class by using the specified items to include in the list. + The items. + The parameter is null. + + + Initializes a new instance of the class by using the specified items to include in the list and the selected values. + The items. + The selected values. + The parameter is null. + + + Initializes a new instance of the MultiSelectList class by using the items to include in the list, the selected values, the disabled values. + The items used to build each of the list. + The selected values field. Used to match the Selected property of the corresponding . + The disabled values. Used to match the Disabled property of the corresponding . + + + Initializes a new instance of the class by using the items to include in the list, the data value field, and the data text field. + The items. + The data value field. + The data text field. + The parameter is null. + + + Initializes a new instance of the class by using the items to include in the list, the data value field, the data text field, and the selected values. + The items. + The data value field. + The data text field. + The selected values. + The parameter is null. + + + Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, the data text field, the selected values, and the disabled values. + The items used to build each of the list. + The data value field. Used to match the Value property of the corresponding . + The data text field. Used to match the Text property of the corresponding . + The selected values field. Used to match the Selected property of the corresponding . + The disabled values. Used to match the Disabled property of the corresponding . + + + Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, the data text field, and the data group field. + The items used to build each of the list. + The data value field. Used to match the Value property of the corresponding . + The data text field. Used to match the Text property of the corresponding . + The data group field. Used to match the Group property of the corresponding . + + + Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, the data text field, the data group field, and the selected values. + The items used to build each of the list. + The data value field. Used to match the Value property of the corresponding . + The data text field. Used to match the Text property of the corresponding . + The data group field. Used to match the Group property of the corresponding . + The selected values field. Used to match the Selected property of the corresponding . + + + Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, the data text field, the data group field, the selected values, and the disabled values. + The items used to build each of the list. + The data value field. Used to match the Value property of the corresponding . + The data text field. Used to match the Text property of the corresponding . + The data group field. Used to match the Group property of the corresponding . + The selected values field. Used to match the Selected property of the corresponding . + The disabled values. Used to match the Disabled property of the corresponding . + + + Initializes a new instance of the MultiSelectList class by using the items to include in the list, the data value field, the data text field, the data group field, the selected values, the disabled values, and the disabled groups. + The items used to build each of the list. + The data value field. Used to match the Value property of the corresponding . + The data text field. Used to match the Text property of the corresponding . + The data group field. Used to match the Group property of the corresponding . + The selected values field. Used to match the Selected property of the corresponding . + The disabled values. Used to match the Disabled property of the corresponding . + The disabled groups. Used to match the Disabled property of the corresponding . + + + Gets the data group field. + + + Gets or sets the data text field. + The data text field. + + + Gets or sets the data value field. + The data value field. + + + Gets the disabled groups. + + + Gets the disabled values. + + + Returns an enumerator that can be used to iterate through the collection. + An enumerator that can be used to iterate through the collection. + + + Gets or sets the items in the list. + The items in the list. + + + Gets or sets the selected values. + The selected values. + + + Returns an enumerator can be used to iterate through a collection. + An enumerator that can be used to iterate through the collection. + + + When implemented in a derived class, provides a metadata class that contains a reference to the implementation of one or more of the filter interfaces, the filter's order, and the filter's scope. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class and specifies the order of filters and whether multiple filters are allowed. + true to specify that multiple filters of the same type are allowed; otherwise, false. + The filter order. + + + Gets a value that indicates whether more than one instance of the filter attribute can be specified. + true if more than one instance of the filter attribute is allowed; otherwise, false.Implements. + + + Gets a value that indicates the order in which a filter is applied. + A value that indicates the order in which a filter is applied.Implements. + + + Selects the controller that will handle an HTTP request. + + + Initializes a new instance of the class. + The request context. + The parameter is null. + + + Adds the version header by using the specified HTTP context. + The HTTP context. + + + Called by ASP.NET to begin asynchronous request processing. + The status of the asynchronous call. + The HTTP context. + The asynchronous callback method. + The state of the asynchronous object. + + + Called by ASP.NET to begin asynchronous request processing using the base HTTP context. + The status of the asynchronous call. + The HTTP context. + The asynchronous callback method. + The state of the asynchronous object. + + + Gets or sets a value that indicates whether the MVC response header is disabled. + true if the MVC response header is disabled; otherwise, false. + + + Called by ASP.NET when asynchronous request processing has ended. + The asynchronous result. + + + Gets a value that indicates whether another request can use the instance. + true if the instance is reusable; otherwise, false. + + + Contains the header name of the ASP.NET MVC version. + + + Processes the request by using the specified HTTP request context. + The HTTP context. + + + Processes the request by using the specified base HTTP request context. + The HTTP context. + + + Gets the request context. + The request context. + + + Called by ASP.NET to begin asynchronous request processing using the base HTTP context. + The status of the asynchronous call. + The HTTP context. + The asynchronous callback method. + The data. + + + Called by ASP.NET when asynchronous request processing has ended. + The asynchronous result. + + + Gets a value that indicates whether another request can use the instance. + true if the instance is reusable; otherwise, false. + + + Enables processing of HTTP Web requests by a custom HTTP handler that implements the interface. + An object that provides references to the intrinsic server objects (for example, Request, Response, Session, and Server) that are used to service HTTP requests. + + + Represents an HTML-encoded string that should not be encoded again. + + + Initializes a new instance of the class. + The string to create. If no value is assigned, the object is created using an empty-string value. + + + Creates an HTML-encoded string using the specified text value. + An HTML-encoded string. + The value of the string to create . + + + Contains an empty HTML string. + + + Determines whether the specified string contains content or is either null or empty. + true if the string is null or empty; otherwise, false. + The string. + + + Verifies and processes an HTTP request. + + + Initializes a new instance of the class. + + + Called by ASP.NET to begin asynchronous request processing. + The status of the asynchronous call. + The HTTP context. + The asynchronous callback method. + The state. + + + Called by ASP.NET to begin asynchronous request processing. + The status of the asynchronous call. + The base HTTP context. + The asynchronous callback method. + The state. + + + Called by ASP.NET when asynchronous request processing has ended. + The asynchronous result. + + + Called by ASP.NET to begin asynchronous request processing. + The status of the asynchronous call. + The context. + The asynchronous callback method. + An object that contains data. + + + Called by ASP.NET when asynchronous request processing has ended. + The status of the asynchronous operations. + + + Verifies and processes an HTTP request. + The HTTP handler. + The HTTP context. + + + Creates an object that implements the IHttpHandler interface and passes the request context to it. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified factory controller object. + The controller factory. + + + Returns the HTTP handler by using the specified HTTP context. + The HTTP handler. + The request context. + + + Returns the session behavior. + The session behavior. + The request context. + + + Returns the HTTP handler by using the specified request context. + The HTTP handler. + The request context. + + + Creates instances of files. + + + Initializes a new instance of the class. + + + Creates a Razor host. + A Razor host. + The virtual path to the target file. + The physical path to the target file. + + + Extends a NameValueCollection object so that the collection can be copied to a specified dictionary. + + + Copies the specified collection to the specified destination. + The collection. + The destination. + + + Copies the specified collection to the specified destination, and optionally replaces previous entries. + The collection. + The destination. + true to replace previous entries; otherwise, false. + + + Represents the base class for value providers whose values come from a object. + + + Initializes a new instance of the class using the specified unvalidated collection. + A collection that contains the values that are used to initialize the provider. + A collection that contains the values that are used to initialize the provider. This collection will not be validated. + An object that contains information about the target culture. + + + Initializes Name Value collection provider. + Key value collection from request. + Unvalidated key value collection from the request. + Culture with which the values are to be used. + jQuery POST when sending complex Javascript objects to server does not encode in the way understandable by MVC. This flag should be set if the request should be normalized to MVC form - https://aspnetwebstack.codeplex.com/workitem/1564. + + + Initializes a new instance of the class. + A collection that contains the values that are used to initialize the provider. + An object that contains information about the target culture. + The parameter is null. + + + Determines whether the collection contains the specified prefix. + true if the collection contains the specified prefix; otherwise, false. + The prefix to search for. + The parameter is null. + + + Gets the keys using the specified prefix. + They keys. + The prefix. + + + Returns a value object using the specified key. + The value object for the specified key. + The key of the value object to retrieve. + The parameter is null. + + + Returns a value object using the specified key and validation directive. + The value object for the specified key. + The key. + true if validation should be skipped; otherwise, false. + + + Provides a convenience wrapper for the attribute. + + + Initializes a new instance of the class. + + + Represents an attribute that is used to indicate that a controller method is not an action method. + + + Initializes a new instance of the class. + + + Determines whether the attribute marks a method that is not an action method by using the specified controller context. + true if the attribute marks a valid non-action method; otherwise, false. + The controller context. + The method information. + + + Represents an attribute that is used to mark an action method whose output will be cached. + + + Initializes a new instance of the class. + + + Gets or sets the cache profile name. + The cache profile name. + + + Gets or sets the child action cache. + The child action cache. + + + Gets or sets the cache duration, in seconds. + The cache duration. + + + Returns a value that indicates whether a child action cache is active. + true if the child action cache is active; otherwise, false. + The controller context. + + + Gets or sets the location. + The location. + + + Gets or sets a value that indicates whether to store the cache. + true if the cache should be stored; otherwise, false. + + + This method is an implementation of and supports the ASP.NET MVC infrastructure. It is not intended to be used directly from your code. + The filter context. + + + This method is an implementation of and supports the ASP.NET MVC infrastructure. It is not intended to be used directly from your code. + The filter context. + + + This method is an implementation of and supports the ASP.NET MVC infrastructure. It is not intended to be used directly from your code. + The filter context. + + + This method is an implementation of and supports the ASP.NET MVC infrastructure. It is not intended to be used directly from your code. + The filter context. + + + Called before the action result executes. + The filter context, which encapsulates information for using . + The parameter is null. + + + Gets or sets the SQL dependency. + The SQL dependency. + + + Gets or sets the vary-by-content encoding. + The vary-by-content encoding. + + + Gets or sets the vary-by-custom value. + The vary-by-custom value. + + + Gets or sets the vary-by-header value. + The vary-by-header value. + + + Gets or sets the vary-by-param value. + The vary-by-param value. + + + Represents the attributes associated with the override filter. + + + Initializes a new instance of the class. + + + Gets the filters to override for this instance. + The filters to override for this instance. + + + Represents the attributes associated with the authentication. + + + Initializes a new instance of the class. + + + Gets the filters to override for this instance. + The filters to override for this instance. + + + Represents the attributes associated with the authorization. + + + Initializes a new instance of the class. + + + Gets the filters to override for this instance. + The filters to override for this instance. + + + Represents the attributes associated with the exception filter. + + + Initializes a new instance of the class. + + + Gets the filters to override for this instance. + The filters to override for this instance. + + + Represents the attributes associated with the result filter. + + + Initializes a new instance of the class. + + + Gets the filters to override for this instance. + The filters to override for this instance. + + + Encapsulates information for binding action-method parameters to a data model. + + + Initializes a new instance of the class. + + + Gets the model binder. + The model binder. + + + Gets a comma-delimited list of property names for which binding is disabled. + The exclude list. + + + Gets a comma-delimited list of property names for which binding is enabled. + The include list. + + + Gets the prefix to use when the MVC framework binds a value to an action parameter or to a model property. + The prefix. + + + Contains information that describes a parameter. + + + Initializes a new instance of the class. + + + Gets the action descriptor. + The action descriptor. + + + Gets the binding information. + The binding information. + + + Gets the default value of the parameter. + The default value of the parameter. + + + Returns an array of custom attributes that are defined for this member, excluding named attributes. + An array of custom attributes, or an empty array if no custom attributes exist. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + + + Returns an array of custom attributes that are defined for this member, identified by type. + An array of custom attributes, or an empty array if no custom attributes exist. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + The parameter is null. + + + Indicates whether one or more instances of a custom attribute type are defined for this member. + true if the custom attribute type is defined for this member; otherwise, false. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The parameter is null. + + + Gets the name of the parameter. + The name of the parameter. + + + Gets the type of the parameter. + The type of the parameter. + + + Represents a base class that is used to send a partial view to the response. + + + Initializes a new instance of the class. + + + Returns the object that is used to render the view. + The view engine result. + The controller context. + An error occurred while the method was attempting to find the view. + + + Provides a registration point for ASP.NET Razor pre-application start code. + + + Registers Razor pre-application start code. + + + Represents a value provider for query strings that are contained in a object. + + + Initializes a new instance of the class. + An object that encapsulates information about the current HTTP request. + + + Represents a class that is responsible for creating a new instance of a query-string value-provider object. + + + Initializes a new instance of the class. + + + Returns a value-provider object for the specified controller context. + A query-string value-provider object. + An object that encapsulates information about the current HTTP request. + The parameter is null. + + + Provides an adapter for the attribute. + + + Initializes a new instance of the class. + The model metadata. + The controller context. + The range attribute. + + + Gets a list of client validation rules for a range check. + A list of client validation rules for a range check. + + + Represents the class used to create views that have Razor syntax. + + + Initializes a new instance of the class. + The controller context. + The view path. + The layout or master page. + A value that indicates whether view start files should be executed before the view. + The set of extensions that will be used when looking up view start files. + + + Initializes a new instance of the class using the view page activator. + The controller context. + The view path. + The layout or master page. + A value that indicates whether view start files should be executed before the view. + The set of extensions that will be used when looking up view start files. + The view page activator. + + + Gets the layout or master page. + The layout or master page. + + + Renders the specified view context by using the specified writer and instance. + The view context. + The writer that is used to render the view to the response. + The instance. + + + Gets a value that indicates whether view start files should be executed before the view. + A value that indicates whether view start files should be executed before the view. + + + Gets or sets the set of file extensions that will be used when looking up view start files. + The set of file extensions that will be used when looking up view start files. + + + Represents a view engine that is used to render a Web page that uses the ASP.NET Razor syntax. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the view page activator. + The view page activator. + + + Creates a partial view using the specified controller context and partial path. + The partial view. + The controller context. + The path to the partial view. + + + Creates a view by using the specified controller context and the paths of the view and master view. + The view. + The controller context. + The path to the view. + The path to the master view. + + + Controls the processing of application actions by redirecting to a specified URI. + + + Initializes a new instance of the class. + The target URL. + The parameter is null. + + + Initializes a new instance of the class using the specified URL and permanent-redirection flag. + The URL. + A value that indicates whether the redirection should be permanent. + + + Enables processing of the result of an action method by a custom type that inherits from the class. + The context within which the result is executed. + The parameter is null. + + + Gets a value that indicates whether the redirection should be permanent. + true if the redirection should be permanent; otherwise, false. + + + Gets or sets the target URL. + The target URL. + + + Represents a result that performs a redirection by using the specified route values dictionary. + + + Initializes a new instance of the class by using the specified route name and route values. + The name of the route. + The route values. + + + Initializes a new instance of the class by using the specified route name, route values, and permanent-redirection flag. + The name of the route. + The route values. + A value that indicates whether the redirection should be permanent. + + + Initializes a new instance of the class by using the specified route values. + The route values. + + + Enables processing of the result of an action method by a custom type that inherits from the class. + The context within which the result is executed. + The parameter is null. + + + Gets a value that indicates whether the redirection should be permanent. + true if the redirection should be permanent; otherwise, false. + + + Gets or sets the name of the route. + The name of the route. + + + Gets or sets the route values. + The route values. + + + Contains information that describes a reflected action method. + + + Initializes a new instance of the class. + The action-method information. + The name of the action. + The controller descriptor. + Either the or parameter is null. + The parameter is null or empty. + + + Gets the name of the action. + The name of the action. + + + Gets the controller descriptor. + The controller descriptor. + + + Executes the specified controller context by using the specified action-method parameters. + The action return value. + The controller context. + The parameters. + The or parameter is null. + + + Returns an array of custom attributes defined for this member, excluding named attributes. + An array of custom attributes, or an empty array if no custom attributes exist. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + + + Returns an array of custom attributes defined for this member, identified by type. + An array of custom attributes, or an empty array if no custom attributes exist. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + + + Gets the filter attributes. + The filter attributes. + true to use the cache, otherwise false. + + + Retrieves the parameters of the action method. + The parameters of the action method. + + + Retrieves the action selectors. + The action selectors. + + + Indicates whether one or more instances of a custom attribute type are defined for this member. + true if the custom attribute type is defined for this member; otherwise, false. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + + + Gets or sets the action-method information. + The action-method information. + + + Gets the unique ID for the reflected action descriptor using lazy initialization. + The unique ID. + + + Contains information that describes a reflected controller. + + + Initializes a new instance of the class. + The type of the controller. + The parameter is null. + + + Gets the type of the controller. + The type of the controller. + + + Finds the specified action for the specified controller context. + The information about the action. + The controller context. + The name of the action. + The parameter is null. + The parameter is null or empty. + + + Returns the list of actions for the controller. + A list of action descriptors for the controller. + + + Returns an array of custom attributes that are defined for this member, excluding named attributes. + An array of custom attributes, or an empty array if no custom attributes exist. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + + + Returns an array of custom attributes that are defined for this member, identified by type. + An array of custom attributes, or an empty array if no custom attributes exist. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + + + Gets the filter attributes. + The filter attributes. + true to use the cache, otherwise false. + + + Returns a value that indicates whether one or more instances of a custom attribute type are defined for this member. + true if the custom attribute type is defined for this member; otherwise, false. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + + + Contains information that describes a reflected action-method parameter. + + + Initializes a new instance of the class. + The parameter information. + The action descriptor. + The or parameter is null. + + + Gets the action descriptor. + The action descriptor. + + + Gets the binding information. + The binding information. + + + Gets the default value of the reflected parameter. + The default value of the reflected parameter. + + + Returns an array of custom attributes that are defined for this member, excluding named attributes. + An array of custom attributes, or an empty array if no custom attributes exist. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + + + Returns an array of custom attributes that are defined for this member, identified by type. + An array of custom attributes, or an empty array if no custom attributes exist. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + + + Returns a value that indicates whether one or more instances of a custom attribute type are defined for this member. + true if the custom attribute type is defined for this member; otherwise, false. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + + + Gets or sets the parameter information. + The parameter information. + + + Gets the name of the parameter. + The name of the parameter. + + + Gets the type of the parameter. + The type of the parameter. + + + Provides an adapter for the attribute. + + + Initializes a new instance of the class. + The model metadata. + The controller context. + The regular expression attribute. + + + Gets a list of regular-expression client validation rules. + A list of regular-expression client validation rules. + + + Provides an attribute that uses the jQuery validation plug-in remote validator. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified route name. + The route name. + + + Initializes a new instance of the class using the specified action-method name and controller name. + The name of the action method. + The name of the controller. + + + Initializes a new instance of the class using the specified action-method name, controller name, and area name. + The name of the action method. + The name of the controller. + The name of the area. + + + Initializes a new instance of the class. + The route name. + The name of the controller. + Find the controller in the root if . Otherwise look in the current area. + + + Gets or sets the additional fields that are required for validation. + The additional fields that are required for validation. + + + Returns a comma-delimited string of validation field names. + A comma-delimited string of validation field names. + The name of the validation property. + + + Formats the error message that is displayed when validation fails. + A formatted error message. + A name to display with the error message. + + + Formats the property for client validation by prepending an asterisk (*) and a dot. + The string "*." Is prepended to the property. + The property. + + + Gets a list of client validation rules for the property. + A list of remote client validation rules for the property. + The model metadata. + The controller context. + + + Gets the URL for the remote validation call. + The URL for the remote validation call. + The controller context. + + + Gets or sets the HTTP method used for remote validation. + The HTTP method used for remote validation. The default value is "Get". + + + This method always returns true. + true + The validation target. + + + Gets the route data dictionary. + The route data dictionary. + + + Gets or sets the route name. + The route name. + + + Gets the route collection from the route table. + The route collection from the route table. + + + Provides an adapter for the attribute. + + + Initializes a new instance of the class. + The model metadata. + The controller context. + The required attribute. + + + Gets a list of required-value client validation rules. + A list of required-value client validation rules. + + + Represents an attribute that forces an unsecured HTTP request to be re-sent over HTTPS. + + + Initializes a new instance of the class. + + + Handles unsecured HTTP requests that are sent to the action method. + An object that encapsulates information that is required in order to use the attribute. + The HTTP request contains an invalid transfer method override. All GET requests are considered invalid. + + + Determines whether a request is secured (HTTPS) and, if it is not, calls the method. + An object that encapsulates information that is required in order to use the attribute. + The parameter is null. + + + Provides the context for the method of the class. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The controller context. + The result object. + true to cancel execution; otherwise, false. + The exception object. + The parameter is null. + + + Gets or sets a value that indicates whether this instance is canceled. + true if the instance is canceled; otherwise, false. + + + Gets or sets the exception object. + The exception object. + + + Gets or sets a value that indicates whether the exception has been handled. + true if the exception has been handled; otherwise, false. + + + Gets or sets the action result. + The action result. + + + Provides the context for the method of the class. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using the specified controller context and action result. + The controller context. + The action result. + The parameter is null. + + + Gets or sets a value that indicates whether this value is "cancel". + true if the value is "cancel"; otherwise, false. + + + Gets or sets the action result. + The action result. + + + Defines the area to set for all the routes defined in this controller. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The name of the area. If the value is null, an attempt will be made to infer the area name from the target controller's namespace. + + + Gets the area name to set for all the routes defined in the controller. If the value is null, an attempt will be made to infer the area name from the target controller's namespace. + The area name to set for all the routes defined in the controller. + + + Gets the URL prefix to apply to the routes of this area. Defaults to the area's name. + The URL prefix to apply to the routes of this area. + + + Place on a controller or action to expose it directly via a route. When placed on a controller, it applies to actions that do not have any System.Web.Mvc.RouteAttribute’s on them. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with the specified template. + The pattern of the route to match. + + + Gets or sets the name of the route. + The name of the route + + + Gets the order the route is applied. + The order the route is applied. + + + Creates a direct route entry. + The direct route entry. + The context to use to create the route. + + + Gets the pattern for the route to match. + The pattern to match. + + + Provides routing extensions for route collection attribute. + + + Maps the attribute-defined routes for the application. + A collection of routes. + + + Maps the attribute-defined routes for the application. + The to use for mapping routes. + + + Maps the attribute-defined routes for the application. + A collection of routes. + The to use for resolving inline constraints in route templates. + + + Maps the attribute-defined routes for the application. + The to use for resolving inline constraints in route templates. + The to use for mapping routes. + + + Extends a object for MVC routing. + + + Returns an object that contains information about the route and virtual path that are the result of generating a URL in the current area. + An object that contains information about the route and virtual path that are the result of generating a URL in the current area. + An object that contains the routes for the applications. + An object that encapsulates information about the requested route. + The name of the route to use when information about the URL path is retrieved. + An object that contains the parameters for a route. + + + Returns an object that contains information about the route and virtual path that are the result of generating a URL in the current area. + An object that contains information about the route and virtual path that are the result of generating a URL in the current area. + An object that contains the routes for the applications. + An object that encapsulates information about the requested route. + An object that contains the parameters for a route. + + + Ignores the specified URL route for the given list of available routes. + A collection of routes for the application. + The URL pattern for the route to ignore. + The or parameter is null. + + + Ignores the specified URL route for the given list of the available routes and a list of constraints. + A collection of routes for the application. + The URL pattern for the route to ignore. + A set of expressions that specify values for the parameter. + The or parameter is null. + + + Maps the specified URL route. + A reference to the mapped route. + A collection of routes for the application. + The name of the route to map. + The URL pattern for the route. + The or parameter is null. + + + Maps the specified URL route and sets default route values. + A reference to the mapped route. + A collection of routes for the application. + The name of the route to map. + The URL pattern for the route. + An object that contains default route values. + The or parameter is null. + + + Maps the specified URL route and sets default route values and constraints. + A reference to the mapped route. + A collection of routes for the application. + The name of the route to map. + The URL pattern for the route. + An object that contains default route values. + A set of expressions that specify values for the parameter. + The or parameter is null. + + + Maps the specified URL route and sets default route values, constraints, and namespaces. + A reference to the mapped route. + A collection of routes for the application. + The name of the route to map. + The URL pattern for the route. + An object that contains default route values. + A set of expressions that specify values for the parameter. + A set of namespaces for the application. + The or parameter is null. + + + Maps the specified URL route and sets default route values and namespaces. + A reference to the mapped route. + A collection of routes for the application. + The name of the route to map. + The URL pattern for the route. + An object that contains default route values. + A set of namespaces for the application. + The or parameter is null. + + + Maps the specified URL route and sets the namespaces. + A reference to the mapped route. + A collection of routes for the application. + The name of the route to map. + The URL pattern for the route. + A set of namespaces for the application. + The or parameter is null. + + + Represents a value provider for route data that is contained in an object that implements the interface. + + + Initializes a new instance of the class. + An object that contain information about the HTTP request. + + + Represents a factory for creating route-data value provider objects. + + + Initialized a new instance of the class. + + + Returns a value-provider object for the specified controller context. + A value-provider object. + An object that encapsulates information about the current HTTP request. + The parameter is null. + + + Annotates a controller with a route prefix that applies to all actions within the controller. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with the specified prefix. + The route prefix for the controller. + + + Gets the route prefix. + The route prefix. + + + Represents a list that lets users select one item. + + + Initializes a new instance of the class by using the specified items for the list. + The items. + + + Initializes a new instance of the class by using the specified items for the list and a selected value. + The items. + The selected value. + + + Initializes a new instance of the SelectList class by using the specified items for the list, the selected value, and the disabled values. + The items used to build each of the list. + The selected value. Used to match the Selected property of the corresponding . + The disabled values. Used to match the Disabled property of the corresponding . + + + Initializes a new instance of the class by using the specified items for the list, the data value field, and the data text field. + The items. + The data value field. + The data text field. + + + Initializes a new instance of the class by using the specified items for the list, the data value field, the data text field, and a selected value. + The items. + The data value field. + The data text field. + The selected value. + + + Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, the data text field, the selected value, and the disabled values. + The items used to build each of the list. + The data value field. Used to match the Value property of the corresponding . + The data text field. Used to match the Text property of the corresponding . + The selected value. Used to match the Selected property of the corresponding . + The disabled values. Used to match the Disabled property of the corresponding . + + + Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, the data text field, the data group field, and the selected value. + The items used to build each of the list. + The data value field. Used to match the Value property of the corresponding . + The data text field. Used to match the Text property of the corresponding . + The data group field. Used to match the Group property of the corresponding . + The selected value. Used to match the Selected property of the corresponding . + + + Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, the data text field, the data group field, the selected value, and the disabled values. + The items used to build each of the list. + The data value field. Used to match the Value property of the corresponding . + The data text field. Used to match the Text property of the corresponding . + The data group field. Used to match the Group property of the corresponding . + The selected value. Used to match the Selected property of the corresponding . + The disabled values. Used to match the Disabled property of the corresponding . + + + Initializes a new instance of the SelectList class by using the specified items for the list, the data value field, the data text field, the data group field. the selected value, the disabled values, and the disabled groups. + The items used to build each of the list. + The data value field. Used to match the Value property of the corresponding . + The data text field. Used to match the Text property of the corresponding . + The data group field. Used to match the Group property of the corresponding . + The selected value. Used to match the Selected property of the corresponding . + The disabled values. Used to match the Disabled property of the corresponding . + The disabled groups. Used to match the Disabled property of the corresponding . + + + Gets the list value that was selected by the user. + The selected value. + + + Represents the optgroup HTML element and its attributes. In a select list, multiple groups with the same name are supported. They are compared with reference equality. + + + + Gets or sets a value that indicates whether this is disabled. + + + Represents the value of the optgroup's label. + + + Represents the selected item in an instance of the class. + + + Initializes a new instance of the class. + + + Gets or sets a value that indicates whether this is disabled. + + + Represents the optgroup HTML element this item is wrapped into. In a select list, multiple groups with the same name are supported. They are compared with reference equality. + + + Gets or sets a value that indicates whether this is selected. + true if the item is selected; otherwise, false. + + + Gets or sets the text of the selected item. + The text. + + + Gets or sets the value of the selected item. + The value. + + + Specifies the session state of the controller. + + + Initializes a new instance of the class + The type of the session state. + + + Get the session state behavior for the controller. + The session state behavior for the controller. + + + Provides session-state data to the current object. + + + Initializes a new instance of the class. + + + Loads the temporary data by using the specified controller context. + The temporary data. + The controller context. + An error occurred when the session context was being retrieved. + + + Saves the specified values in the temporary data dictionary by using the specified controller context. + The controller context. + The values. + An error occurred the session context was being retrieved. + + + Provides an adapter for the attribute. + + + Initializes a new instance of the class. + The model metadata. + The controller context. + The string-length attribute. + + + Gets a list of string-length client validation rules. + A list of string-length client validation rules. + + + Represents a set of data that persists only from one request to the next. + + + Initializes a new instance of the class. + + + Adds an element that has the specified key and value to the object. + The key of the element to add. + The value of the element to add. + The object is read-only. + + is null. + An element that has the same key already exists in the object. + + + Removes all items from the instance. + The object is read-only. + + + Determines whether the instance contains an element that has the specified key. + true if the instance contains an element that has the specified key; otherwise, false. + The key to locate in the instance. + + is null. + + + Determines whether the dictionary contains the specified value. + true if the dictionary contains the specified value; otherwise, false. + The value. + + + Gets the number of elements in the object. + The number of elements in the object. + + + Gets the enumerator. + The enumerator. + + + Gets or sets the object that has the specified key. + The object that has the specified key. + + + Marks all keys in the dictionary for retention. + + + Marks the specified key in the dictionary for retention. + The key to retain in the dictionary. + + + Gets an object that contains the keys of elements in the object. + The keys of the elements in the object. + + + Loads the specified controller context by using the specified data provider. + The controller context. + The temporary data provider. + + + Returns an object that contains the element that is associated with the specified key, without marking the key for deletion. + An object that contains the element that is associated with the specified key. + The key of the element to return. + + + Removes the element that has the specified key from the object. + true if the element was removed successfully; otherwise, false. This method also returns false if was not found in the . instance. + The key of the element to remove. + The object is read-only. + + is null. + + + Saves the specified controller context by using the specified data provider. + The controller context. + The temporary data provider. + + + Adds the specified key/value pair to the dictionary. + The key/value pair. + + + Determines whether a sequence contains a specified element by using the default equality comparer. + true if the dictionary contains the specified key/value pair; otherwise, false. + The key/value pair to search for. + + + Copies a key/value pair to the specified array at the specified index. + The target array. + The index. + + + Gets a value that indicates whether the dictionary is read-only. + true if the dictionary is read-only; otherwise, false. + + + Deletes the specified key/value pair from the dictionary. + true if the key/value pair was removed successfully; otherwise, false. + The key/value pair. + + + Returns an enumerator that can be used to iterate through a collection. + An object that can be used to iterate through the collection. + + + Gets the value of the element that has the specified key. + true if the object that implements contains an element that has the specified key; otherwise, false. + The key of the value to get. + When this method returns, the value that is associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. + + is null. + + + Gets the object that contains the values in the object. + The values of the elements in the object that implements . + + + Encapsulates information about the current template context. + + + Initializes a new instance of the class. + + + Gets or sets the formatted model value. + The formatted model value. + + + Retrieves the full DOM ID of a field using the specified HTML name attribute. + The full DOM ID. + The value of the HTML name attribute. + + + Retrieves the fully qualified name (including a prefix) for a field using the specified HTML name attribute. + The prefixed name of the field. + The value of the HTML name attribute. + + + Gets or sets the HTML field prefix. + The HTML field prefix. + + + Contains the number of objects that were visited by the user. + The number of objects. + + + Determines whether the template has been visited by the user. + true if the template has been visited by the user; otherwise, false. + An object that encapsulates information that describes the model. + + + Contains methods to build URLs for ASP.NET MVC within an application. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified request context. + An object that contains information about the current request and about the route that it matched. + + + Initializes a new instance of the class using the specified request context and route collection. + An object that contains information about the current request and about the route that it matched. + A collection of routes. + The or the parameter is null. + + + Generates a string to a fully qualified URL to an action method. + A string to a fully qualified URL to an action method. + + + Generates a fully qualified URL to an action method by using the specified action name. + The fully qualified URL to an action method. + The name of the action method. + + + Generates a fully qualified URL to an action method by using the specified action name and route values. + The fully qualified URL to an action method. + The name of the action method. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + + + Generates a fully qualified URL to an action method by using the specified action name and controller name. + The fully qualified URL to an action method. + The name of the action method. + The name of the controller. + + + Generates a fully qualified URL to an action method by using the specified action name, controller name, and route values. + The fully qualified URL to an action method. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + + + Generates a fully qualified URL to an action method by using the specified action name, controller name, route values, and protocol to use. + The fully qualified URL to an action method. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + The protocol for the URL, such as "http" or "https". + + + Generates a fully qualified URL to an action method by using the specified action name, controller name, and route values. + The fully qualified URL to an action method. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. + + + Generates a fully qualified URL for an action method by using the specified action name, controller name, route values, and protocol to use. + The fully qualified URL to an action method. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. + The protocol for the URL, such as "http" or "https". + + + Generates a fully qualified URL for an action method by using the specified action name, controller name, route values, protocol to use and host name. + The fully qualified URL to an action method. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. + The protocol for the URL, such as "http" or "https". + The host name for the URL. + + + Generates a fully qualified URL to an action method for the specified action name and route values. + The fully qualified URL to an action method. + The name of the action method. + An object that contains the parameters for a route. + + + Converts a virtual (relative) path to an application absolute path. + The application absolute path. + The virtual path of the content. + + + Encodes special characters in a URL string into character-entity equivalents. + An encoded URL string. + The text to encode. + + + Returns a string that contains a content URL. + A string that contains a content URL. + The content path. + The http context. + + + Returns a string that contains a URL. + A string that contains a URL. + The route name. + The action name. + The controller name. + The HTTP protocol. + The host name. + The fragment. + The route values. + The route collection. + The request context. + true to include implicit MVC values; otherwise false. + + + Returns a string that contains a URL. + A string that contains a URL. + The route name. + The action name. + The controller name. + The route values. + The route collection. + The request context. + true to include implicit MVC values; otherwise false. + + + Generates a fully qualified URL for the specified route values. + A fully qualified URL for the specified route values. + The route name. + The route values. + + + Generates a fully qualified URL for the specified route values. + A fully qualified URL for the specified route values. + The route name. + The route values. + + + Returns a value that indicates whether the URL is local. + true if the URL is local; otherwise, false. + The URL. + + + Gets information about an HTTP request that matches a defined route. + The request context. + + + Gets a collection that contains the routes that are registered for the application. + The route collection. + + + Generates a fully qualified URL for the specified route values. + The fully qualified URL. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + + + Generates a fully qualified URL for the specified route name. + The fully qualified URL. + The name of the route that is used to generate URL. + + + Generates a fully qualified URL for the specified route values by using a route name. + The fully qualified URL. + The name of the route that is used to generate URL. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + + + Generates a fully qualified URL for the specified route values by using a route name and the protocol to use. + The fully qualified URL. + The name of the route that is used to generate the URL. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + The protocol for the URL, such as "http" or "https". + + + Generates a fully qualified URL for the specified route values by using a route name. + The fully qualified URL. + The name of the route that is used to generate URL. + An object that contains the parameters for a route. + + + Generates a fully qualified URL for the specified route values by using the specified route name, protocol to use, and host name. + The fully qualified URL. + The name of the route that is used to generate URL. + An object that contains the parameters for a route. + The protocol for the URL, such as "http" or "https". + The host name for the URL. + + + Generates a fully qualified URL for the specified route values. + The fully qualified URL. + An object that contains the parameters for a route. + + + Represents an optional parameter that is used by the class during routing. + + + Contains the read-only value for the optional parameter. + + + Returns an empty string. This method supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. + An empty string. + + + Provides an object adapter that can be validated. + + + Initializes a new instance of the class. + The model metadata. + The controller context. + + + Validates the specified object. + A list of validation results. + The container. + + + Represents an attribute that is used to prevent forgery of a request. + + + Initializes a new instance of the class. + + + Called when authorization is required. + The filter context. + The parameter is null. + + + Gets or sets the salt string. + The salt string. + + + Represents an attribute that is used to mark action methods whose input must be validated. + + + Initializes a new instance of the class. + true to enable validation. + + + Gets or sets a value that indicates whether to enable validation. + true if validation is enabled; otherwise, false. + + + Called when authorization is required. + The filter context. + The parameter is null. + + + Represents the collection of value-provider objects for the application. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class and registers the specified value providers. + The list of value providers to register. + + + Determines whether the collection contains the specified prefix. + true if the collection contains the specified prefix; otherwise, false. + The prefix to search for. + + + Gets the keys using the specified prefix. + They keys. + The prefix. + + + Returns a value object using the specified key. + The value object for the specified key. + The key of the value object to retrieve. + + + Returns a value object using the specified key and skip-validation parameter. + The value object for the specified key. + The key of the value object to retrieve. + true to specify that validation should be skipped; otherwise, false. + + + Inserts the specified value-provider object into the collection at the specified index location. + The zero-based index location at which to insert the value provider into the collection. + The value-provider object to insert. + The parameter is null. + + + Replaces the value provider at the specified index location with a new value provider. + The zero-based index of the element to replace. + The new value for the element at the specified index. + The parameter is null. + + + Note: This API is now obsolete.Represents a dictionary of value providers for the application. + + + Initializes a new instance of the class. + The controller context. + + + Adds the specified item to the collection of value providers. + The object to add to the object. + The object is read-only. + + + Adds an element that has the specified key and value to the collection of value providers. + The key of the element to add. + The value of the element to add. + The object is read-only. + + is null. + An element that has the specified key already exists in the object. + + + Adds an element that has the specified key and value to the collection of value providers. + The key of the element to add. + The value of the element to add. + The object is read-only. + + is null. + An element that has the specified key already exists in the object. + + + Removes all items from the collection of value providers. + The object is read-only. + + + Determines whether the collection of value providers contains the specified item. + true if is found in the collection of value providers; otherwise, false. + The object to locate in the instance. + + + Determines whether the collection of value providers contains an element that has the specified key. + true if the collection of value providers contains an element that has the key; otherwise, false. + The key of the element to find in the instance. + + is null. + + + Gets or sets the controller context. + The controller context. + + + Copies the elements of the collection to an array, starting at the specified index. + The one-dimensional array that is the destination of the elements copied from the object. The array must have zero-based indexing. + The zero-based index in at which copying starts. + + is null. + + is less than 0. + + is multidimensional.-or- is equal to or greater than the length of .-or-The number of elements in the source collection is greater than the available space from to the end of the destination .-or-Type cannot be cast automatically to the type of the destination array. + + + Gets the number of elements in the collection. + The number of elements in the collection. + + + Returns an enumerator that can be used to iterate through the collection. + An enumerator that can be used to iterate through the collection. + + + Gets a value that indicates whether the collection is read-only. + true if the collection is read-only; otherwise, false. + + + Gets or sets the object that has the specified key. + The object. + + + Gets a collection that contains the keys of the instance. + A collection that contains the keys of the object that implements the interface. + + + Removes the first occurrence of the specified item from the collection of value providers. + true if was successfully removed from the collection; otherwise, false. This method also returns false if is not found in the collection. + The object to remove from the instance. + The object is read-only. + + + Removes the element that has the specified key from the collection of value providers. + true if the element was successfully removed; otherwise, false. This method also returns false if was not found in the collection. + The key of the element to remove. + The object is read-only. + + is null. + + + Returns an enumerator that can be used to iterate through a collection. + An enumerator that can be used to iterate through the collection. + + + Determines whether the collection contains the specified prefix. + true if the collection contains the specified prefix; otherwise, false. + The prefix to search for. + + + Returns a value object using the specified key. + The value object for the specified key. + The key of the value object to return. + + + Gets the value of the element that has the specified key. + true if the object that implements contains an element that has the specified key; otherwise, false. + The key of the element to get. + When this method returns, the value that is associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. + + is null. + + + Gets a collection that contains the values in the object. + A collection of the values in the object that implements the interface. + + + Represents a container for value-provider factory objects. + + + Gets the collection of value-provider factories for the application. + The collection of value-provider factory objects. + + + Represents a factory for creating value-provider objects. + + + Initializes a new instance of the class. + + + Returns a value-provider object for the specified controller context. + A value-provider object. + An object that encapsulates information about the current HTTP request. + + + Represents the collection of value-provider factories for the application. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified list of value-provider factories. + A list of value-provider factories to initialize the collection with. + + + Removes all elements from the collection. + + + Returns the value-provider factory for the specified controller context. + The value-provider factory object for the specified controller context. + An object that encapsulates information about the current HTTP request. + + + Inserts the specified value-provider factory object at the specified index location. + The zero-based index location at which to insert the value provider into the collection. + The value-provider factory object to insert. + The parameter is null. + + + Removes the element at the specified index of the . + The zero-based index of the element to remove. + + is less than zero.-or- is equal to or greater than + + + Sets the specified value-provider factory object at the given index location. + The zero-based index location at which to insert the value provider into the collection. + The value-provider factory object to set. + The parameter is null. + + + Represents the result of binding a value (such as from a form post or query string) to an action-method argument property, or to the argument itself. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using the specified raw value, attempted value, and culture information. + The raw value. + The attempted value. + The culture. + + + Gets or sets the raw value that is converted to a string for display. + The raw value. + + + Converts the value that is encapsulated by this result to the specified type. + The converted value. + The target type. + The parameter is null. + + + Converts the value that is encapsulated by this result to the specified type by using the specified culture information. + The converted value. + The target type. + The culture to use in the conversion. + The parameter is null. + + + Gets or sets the culture. + The culture. + + + Gets or set the raw value that is supplied by the value provider. + The raw value. + + + Encapsulates information that is related to rendering a view. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using the specified controller context, view, view data dictionary, temporary data dictionary, and text writer. + Encapsulates information about the HTTP request. + The view to render. + The dictionary that contains the data that is required in order to render the view. + The dictionary that contains temporary data for the view. + The text writer object that is used to write HTML output. + One of the parameters is null. + + + Gets or sets a value that indicates whether client-side validation is enabled. + true if client-side validation is enabled; otherwise, false. + + + Gets or sets an object that encapsulates information that is required in order to validate and process the input data from an HTML form. + An object that encapsulates information that is required in order to validate and process the input data from an HTML form. + + + Writes the client validation information to the HTTP response. + + + Gets data that is associated with this request and that is available for only one request. + The temporary data. + + + Gets or sets a value that indicates whether unobtrusive JavaScript is enabled. + true if unobtrusive JavaScript is enabled; otherwise, false. + + + Element name used to wrap a top-level message generated by and other overloads. + + + Element name used to wrap a top-level message generated by and other overloads. + + + Gets an object that implements the interface to render in the browser. + The view. + + + Gets the dynamic view data dictionary. + The dynamic view data dictionary. + + + Gets the view data that is passed to the view. + The view data. + + + Gets or sets the text writer object that is used to write HTML output. + The object that is used to write the HTML output. + + + Represents a container that is used to pass data between a controller and a view. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using the specified model. + The model. + + + Initializes a new instance of the class by using the specified dictionary. + The dictionary. + The parameter is null. + + + Adds the specified item to the collection. + The object to add to the collection. + The collection is read-only. + + + Adds an element to the collection using the specified key and value . + The key of the element to add. + The value of the element to add. + The object is read-only. + + is null. + An element with the same key already exists in the object. + + + Removes all items from the collection. + The object is read-only. + + + Determines whether the collection contains the specified item. + true if is found in the collection; otherwise, false. + The object to locate in the collection. + + + Determines whether the collection contains an element that has the specified key. + true if the collection contains an element that has the specified key; otherwise, false. + The key of the element to locate in the collection. + + is null. + + + Copies the elements of the collection to an array, starting at a particular index. + The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing. + The zero-based index in at which copying begins. + + is null. + + is less than 0. + + is multidimensional.-or- is equal to or greater than the length of .-or- The number of elements in the source collection is greater than the available space from to the end of the destination .-or- Type cannot be cast automatically to the type of the destination . + + + Gets the number of elements in the collection. + The number of elements in the collection. + + + Evaluates the specified expression. + The results of the evaluation. + The expression. + The parameter is null or empty. + + + Evaluates the specified expression by using the specified format. + The results of the evaluation. + The expression. + The format. + + + Returns an enumerator that can be used to iterate through the collection. + An enumerator that can be used to iterate through the collection. + + + Returns information about the view data as defined by the parameter. + An object that contains the view data information that is defined by the parameter. + A set of key/value pairs that define the view-data information to return. + The parameter is either null or empty. + + + Gets a value that indicates whether the collection is read-only. + true if the collection is read-only; otherwise, false. + + + Gets or sets the item that is associated with the specified key. + The value of the selected item. + + + Gets a collection that contains the keys of this dictionary. + A collection that contains the keys of the object that implements . + + + Gets or sets the model that is associated with the view data. + The model that is associated with the view data. + + + Gets or sets information about the model. + Information about the model. + + + Gets the state of the model. + The state of the model. + + + Removes the first occurrence of a specified object from the collection. + true if was successfully removed from the collection; otherwise, false. This method also returns false if is not found in the collection. + The object to remove from the collection. + The collection is read-only. + + + Removes the element from the collection using the specified key. + true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the original collection. + The key of the element to remove. + The collection is read-only. + + is null. + + + Sets the data model to use for the view. + The data model to use for the view. + + + Returns an enumerator that can be used to iterate through the collection. + An enumerator that can be used to iterate through the collection. + + + Gets or sets an object that encapsulates information about the current template context. + An object that contains information about the current template. + + + Attempts to retrieve the value that is associated with the specified key. + true if the collection contains an element with the specified key; otherwise, false. + The key of the value to get. + When this method returns, the value that is associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. + + is null. + + + Gets a collection that contains the values in this dictionary. + A collection that contains the values of the object that implements . + + + Represents a container that is used to pass strongly typed data between a controller and a view. + The type of the model. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using the specified view data dictionary. + An existing view data dictionary to copy into this instance. + + + Initializes a new instance of the class by using the specified model. + The data model to use for the view. + + + Gets or sets the model. + A reference to the data model. + + + Gets or sets information about the model. + Information about the model. + + + Sets the data model to use for the view. + The data model to use for the view. + An error occurred while the model was being set. + + + Encapsulates information about the current template content that is used to develop templates and about HTML helpers that interact with templates. + + + Initializes a new instance of the class. + + + Initializes a new instance of the T:System.Web.Mvc.ViewDataInfo class and associates a delegate for accessing the view data information. + A delegate that defines how the view data information is accessed. + + + Gets or sets the object that contains the values to be displayed by the template. + The object that contains the values to be displayed by the template. + + + Gets or sets the description of the property to be displayed by the template. + The description of the property to be displayed by the template. + + + Gets or sets the current value to be displayed by the template. + The current value to be displayed by the template. + + + Represents a collection of view engines that are available to the application. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified list of view engines. + The list that is wrapped by the new collection. + + is null. + + + Removes all elements from the . + + + Finds the specified partial view by using the specified controller context. + The partial view. + The controller context. + The name of the partial view. + The parameter is null. + The parameter is null or empty. + + + Finds the specified view by using the specified controller context and master view. + The view. + The controller context. + The name of the view. + The name of the master view. + The parameter is null. + The parameter is null or empty. + + + Inserts an element into the collection at the specified index. + The zero-based index at which item should be inserted. + The object to insert. + + is less than zero.-or- is greater than the number of items in the collection. + The parameter is null. + + + Removes the element at the specified index of the . + The zero-based index of the element to remove. + + is less than zero.-or- is equal to or greater than + + + Replaces the element at the specified index. + The zero-based index of the element to replace. + The new value for the element at the specified index. + + is less than zero.-or- is greater than the number of items in the collection. + The parameter is null. + + + Represents the result of locating a view engine. + + + Initializes a new instance of the class by using the specified searched locations. + The searched locations. + The parameter is null. + + + Initializes a new instance of the class by using the specified view and view engine. + The view. + The view engine. + The or parameter is null. + + + Gets or sets the searched locations. + The searched locations. + + + Gets or sets the view. + The view. + + + Gets or sets the view engine. + The view engine. + + + Represents a collection of view engines that are available to the application. + + + Gets the view engines. + The view engines. + + + Represents the information that is needed to build a master view page. + + + Initializes a new instance of the class. + + + Gets the AJAX script for the master page. + The AJAX script for the master page. + + + Gets the HTML for the master page. + The HTML for the master page. + + + Gets the model. + The model. + + + Gets the temporary data. + The temporary data. + + + Gets the URL. + The URL. + + + Gets the dynamic view-bag dictionary. + The dynamic view-bag dictionary. + + + Gets the view context. + The view context. + + + Gets the view data. + The view data. + + + Gets the writer that is used to render the master page. + The writer that is used to render the master page. + + + Represents the information that is required in order to build a strongly typed master view page. + The type of the model. + + + Initializes a new instance of the class. + + + Gets the AJAX script for the master page. + The AJAX script for the master page. + + + Gets the HTML for the master page. + The HTML for the master page. + + + Gets the model. + A reference to the data model. + + + Gets the view data. + The view data. + + + Represents the properties and methods that are needed to render a view as a Web Forms page. + + + Initializes a new instance of the class. + + + Gets or sets the object that is used to render HTML in Ajax scenarios. + The Ajax helper object that is associated with the view. + + + Gets or sets the object that is used to render HTML elements. + The HTML helper object that is associated with the view. + + + Initializes the , , and properties. + + + Gets or sets the path of the master view. + The path of the master view. + + + Gets the Model property of the associated object. + The Model property of the associated object. + + + Raises the event at the beginning of page initialization. + The event data. + + + Enables processing of the specified HTTP request by the ASP.NET MVC framework. + An object that encapsulates HTTP-specific information about the current HTTP request. + + + Initializes the object that receives the page content to be rendered. + The object that receives the page content. + + + Renders the view page to the response using the specified view context. + An object that encapsulates the information that is required in order to render the view, which includes the controller context, form context, the temporary data, and the view data for the associated view. + + + Note: This API is now obsolete.Sets the text writer that is used to render the view to the response. + The writer that is used to render the view to the response. + + + Sets the view data dictionary for the associated view. + A dictionary of data to pass to the view. + + + Gets the temporary data to pass to the view. + The temporary data to pass to the view. + + + Gets or sets the URL of the rendered page. + The URL of the rendered page. + + + Gets the view bag. + The view bag. + + + Gets or sets the information that is used to render the view. + The information that is used to render the view, which includes the form context, the temporary data, and the view data of the associated view. + + + Gets or sets a dictionary that contains data to pass between the controller and the view. + A dictionary that contains data to pass between the controller and the view. + + + Gets the text writer that is used to render the view to the response. + The text writer that is used to render the view to the response. + + + Represents the information that is required in order to render a strongly typed view as a Web Forms page. + The type of the model. + + + Initializes a new instance of the class. + + + Gets or sets the object that supports rendering HTML in Ajax scenarios. + The Ajax helper object that is associated with the view. + + + Gets or sets the object that provides support for rendering elements. + The HTML helper object that is associated with the view. + + + Instantiates and initializes the and properties. + + + Gets the property of the associated object. + A reference to the data model. + + + Sets the view data dictionary for the associated view. + A dictionary of data to pass to the view. + + + Gets or sets a dictionary that contains data to pass between the controller and the view. + A dictionary that contains data to pass between the controller and the view. + + + Represents a class that is used to render a view by using an instance that is returned by an object. + + + Initializes a new instance of the class. + + + Searches the registered view engines and returns the object that is used to render the view. + The object that is used to render the view. + The controller context. + An error occurred while the method was searching for the view. + + + Gets the name of the master view (such as a master page or template) to use when the view is rendered. + The name of the master view. + + + Represents a base class that is used to provide the model to the view and then render the view to the response. + + + Initializes a new instance of the class. + + + When called by the action invoker, renders the view to the response. + The context that the result is executed in. + The parameter is null. + + + Returns the object that is used to render the view. + The view engine. + The context. + + + Gets the view data model. + The view data model. + + + Gets or sets the object for this result. + The temporary data. + + + Gets or sets the object that is rendered to the response. + The view. + + + Gets the view bag. + The view bag. + + + Gets or sets the view data object for this result. + The view data. + + + Gets or sets the collection of view engines that are associated with this result. + The collection of view engines. + + + Gets or sets the name of the view to render. + The name of the view. + + + Provides an abstract class that can be used to implement a view start (master) page. + + + When implemented in a derived class, initializes a new instance of the class. + + + When implemented in a derived class, gets the HTML markup for the view start page. + The HTML markup for the view start page. + + + When implemented in a derived class, gets the URL for the view start page. + The URL for the view start page. + + + When implemented in a derived class, gets the view context for the view start page. + The view context for the view start page. + + + Provides a container for objects. + + + Initializes a new instance of the class. + + + Provides a container for objects. + The type of the model. + + + Initializes a new instance of the class. + + + Gets the formatted value. + The formatted value. + + + Represents the type of a view. + + + Initializes a new instance of the class. + + + Gets or sets the name of the type. + The name of the type. + + + Represents the information that is needed to build a user control. + + + Initializes a new instance of the class. + + + Gets the AJAX script for the view. + The AJAX script for the view. + + + Ensures that view data is added to the object of the user control if the view data exists. + + + Gets the HTML for the view. + The HTML for the view. + + + Gets the model. + The model. + + + Renders the view by using the specified view context. + The view context. + + + Sets the text writer that is used to render the view to the response. + The writer that is used to render the view to the response. + + + Sets the view-data dictionary by using the specified view data. + The view data. + + + Gets the temporary-data dictionary. + The temporary-data dictionary. + + + Gets the URL for the view. + The URL for the view. + + + Gets the view bag. + The view bag. + + + Gets or sets the view context. + The view context. + + + Gets or sets the view-data dictionary. + The view-data dictionary. + + + Gets or sets the view-data key. + The view-data key. + + + Gets the writer that is used to render the view to the response. + The writer that is used to render the view to the response. + + + Represents the information that is required in order to build a strongly typed user control. + The type of the model. + + + Initializes a new instance of the class. + + + Gets the AJAX script for the view. + The AJAX script for the view. + + + Gets the HTML for the view. + The HTML for the view. + + + Gets the model. + A reference to the data model. + + + Sets the view data for the view. + The view data. + + + Gets or sets the view data. + The view data. + + + Represents an abstract base-class implementation of the interface. + + + Initializes a new instance of the class. + + + Gets or sets the area-enabled master location formats. + The area-enabled master location formats. + + + Gets or sets the area-enabled partial-view location formats. + The area-enabled partial-view location formats. + + + Gets or sets the area-enabled view location formats. + The area-enabled view location formats. + + + Creates the specified partial view by using the specified controller context. + A reference to the partial view. + The controller context. + The partial path for the new partial view. + + + Creates the specified view by using the controller context, path of the view, and path of the master view. + A reference to the view. + The controller context. + The path of the view. + The path of the master view. + + + Gets or sets the display mode provider. + The display mode provider. + + + Returns a value that indicates whether the file is in the specified path by using the specified controller context. + true if the file is in the specified path; otherwise, false. + The controller context. + The virtual path. + + + Gets or sets the file-name extensions that are used to locate a view. + The file-name extensions that are used to locate a view. + + + Finds the specified partial view by using the specified controller context. + The partial view. + The controller context. + The name of the partial view. + true to use the cached partial view. + The parameter is null (Nothing in Visual Basic). + The parameter is null or empty. + + + Finds the specified view by using the specified controller context and master view name. + The page view. + The controller context. + The name of the view. + The name of the master view. + true to use the cached view. + The parameter is null (Nothing in Visual Basic). + The parameter is null or empty. + + + Gets or sets the master location formats. + The master location formats. + + + Gets or sets the partial-view location formats. + The partial-view location formats. + + + Releases the specified view by using the specified controller context. + The controller context. + The view to release. + + + Gets or sets the view location cache. + The view location cache. + + + Gets or sets the view location formats. + The view location formats. + + + Gets or sets the virtual path provider. + The virtual path provider. + + + Represents the information that is needed to build a Web Forms page in ASP.NET MVC. + + + Initializes a new instance of the class using the controller context and view path. + The controller context. + The view path. + + + Initializes a new instance of the class using the controller context, view path, and the path to the master page. + The controller context. + The view path. + The path to the master page. + + + Initializes a new instance of the class using the controller context, view path, the path to the master page, and a instance. + The controller context. + The view path. + The path to the master page. + An instance of the view page activator interface. + + + Gets or sets the master path. + The master path. + + + Renders the view to the response. + An object that encapsulates the information that is required in order to render the view, which includes the controller context, form context, the temporary data, and the view data for the associated view. + The text writer object that is used to write HTML output. + The view page instance. + + + Represents a view engine that is used to render a Web Forms page to the response. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified view page activator. + An instance of a class that implements the interface. + + + Creates the specified partial view by using the specified controller context. + The partial view. + The controller context. + The partial path. + + + Creates the specified view by using the specified controller context and the paths of the view and master view. + The view. + The controller context. + The view path. + The master-view path. + + + Represents the properties and methods that are needed in order to render a view that uses ASP.NET Razor syntax. + + + Initializes a new instance of the class. + + + Gets or sets the object that is used to render HTML using Ajax. + The object that is used to render HTML using Ajax. + + + Sets the view context and view data for the page. + The parent page. + + + Gets the object that is associated with the page. + The object that is associated with the page. + + + Runs the page hierarchy for the ASP.NET Razor execution pipeline. + + + Gets or sets the object that is used to render HTML elements. + The object that is used to render HTML elements. + + + Initializes the , , and classes. + + + Gets the Model property of the associated object. + The Model property of the associated object. + + + Sets the view data. + The view data. + + + Gets the temporary data to pass to the view. + The temporary data to pass to the view. + + + Gets or sets the URL of the rendered page. + The URL of the rendered page. + + + Gets the view bag. + The view bag. + + + Gets or sets the information that is used to render the view. + The information that is used to render the view, which includes the form context, the temporary data, and the view data of the associated view. + + + Gets or sets a dictionary that contains data to pass between the controller and the view. + A dictionary that contains data to pass between the controller and the view. + + + Represents the properties and methods that are needed in order to render a view that uses ASP.NET Razor syntax. + The type of the view data model. + + + Initializes a new instance of the class. + + + Gets or sets the object that is used to render HTML markup using Ajax. + The object that is used to render HTML markup using Ajax. + + + Gets or sets the object that is used to render HTML elements. + The object that is used to render HTML elements. + + + Initializes the , , and classes. + + + Gets the Model property of the associated object. + The Model property of the associated object. + + + Sets the view data. + The view data. + + + Gets or sets a dictionary that contains data to pass between the controller and the view. + A dictionary that contains data to pass between the controller and the view. + + + Represents support for ASP.NET AJAX within an ASP.NET MVC application. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + The name of the controller. + The protocol for the URL, such as "http" or "https". + The host name for the URL. + The URL fragment name (the anchor name). + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + The name of the controller. + The protocol for the URL, such as "http" or "https". + The host name for the URL. + The URL fragment name (the anchor name). + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + The name of the controller. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + The name of the action method that will handle the request. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + The name of the action method that will handle the request. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + The name of the action method that will handle the request. + The name of the controller. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + The name of the action method that will handle the request. + The name of the controller. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + The name of the action method that will handle the request. + The name of the controller. + An object that provides options for the asynchronous request. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + The name of the action method that will handle the request. + The name of the controller. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + The name of the action method that will handle the request. + The name of the controller. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + The name of the action method that will handle the request. + An object that provides options for the asynchronous request. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + The name of the action method that will handle the request. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + The name of the action method that will handle the request. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element.. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + An object that provides options for the asynchronous request. + + + Writes an opening <form> tag to the response using the specified routing information. + An opening <form> tag. + The AJAX helper. + The name of the route to use to obtain the form post URL. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + + + Writes an opening <form> tag to the response using the specified routing information. + An opening <form> tag. + The AJAX helper. + The name of the route to use to obtain the form post URL. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response using the specified routing information. + An opening <form> tag. + The AJAX helper. + The name of the route to use to obtain the form post URL. + An object that provides options for the asynchronous request. + + + Writes an opening <form> tag to the response using the specified routing information. + An opening <form> tag. + The AJAX helper. + The name of the route to use to obtain the form post URL. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + + + Writes an opening <form> tag to the response using the specified routing information. + An opening <form> tag. + The AJAX helper. + The name of the route to use to obtain the form post URL. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + + + Returns an HTML script element that contains a reference to a globalization script that defines the culture information. + A script element whose src attribute is set to the globalization script, as in the following example: <script type="text/javascript" src="/MvcApplication1/Scripts/Globalization/en-US.js"></script> + The AJAX helper object that this method extends. + + + Returns an HTML script element that contains a reference to a globalization script that defines the specified culture information. + An HTML script element whose src attribute is set to the globalization script, as in the following example:<script type="text/javascript" src="/MvcApplication1/Scripts/Globalization/en-US.js"></script> + The AJAX helper object that this method extends. + Encapsulates information about the target culture, such as date formats. + The parameter is null. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the route to use to obtain the form post URL. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the route to use to obtain the form post URL. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the route to use to obtain the form post URL. + The protocol for the URL, such as "http" or "https". + The host name for the URL. + The URL fragment name (the anchor name). + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the route to use to obtain the form post URL. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the route to use to obtain the form post URL. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the route to use to obtain the form post URL. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the route to use to obtain the form post URL. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the route to use to obtain the form post URL. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Represents option settings for running Ajax scripts in an ASP.NET MVC application. + + + Initializes a new instance of the class. + + + + Gets or sets the message to display in a confirmation window before a request is submitted. + The message to display in a confirmation window. + + + Gets or sets the HTTP request method ("Get" or "Post"). + The HTTP request method. The default value is "Post". + + + Gets or sets the mode that specifies how to insert the response into the target DOM element. + The insertion mode ("InsertAfter", "InsertBefore", or "Replace"). The default value is "Replace". + + + Gets or sets a value, in milliseconds, that controls the duration of the animation when showing or hiding the loading element. + A value, in milliseconds, that controls the duration of the animation when showing or hiding the loading element. + + + Gets or sets the id attribute of an HTML element that is displayed while the Ajax function is loading. + The ID of the element that is displayed while the Ajax function is loading. + + + Gets or sets the name of the JavaScript function to call immediately before the page is updated. + The name of the JavaScript function to call before the page is updated. + + + Gets or sets the JavaScript function to call when response data has been instantiated but before the page is updated. + The JavaScript function to call when the response data has been instantiated. + + + Gets or sets the JavaScript function to call if the page update fails. + The JavaScript function to call if the page update fails. + + + Gets or sets the JavaScript function to call after the page is successfully updated. + The JavaScript function to call after the page is successfully updated. + + + Returns the Ajax options as a collection of HTML attributes to support unobtrusive JavaScript. + The Ajax options as a collection of HTML attributes to support unobtrusive JavaScript. + + + Gets or sets the ID of the DOM element to update by using the response from the server. + The ID of the DOM element to update. + + + Gets or sets the URL to make the request to. + The URL to make the request to. + + + Enumerates the AJAX script insertion modes. + + + Insert after the element. + + + Insert before the element. + + + Replace the element. + + + Replace the entire element. + + + Provides information about an asynchronous action method, such as its name, controller, parameters, attributes, and filters. + + + Initializes a new instance of the class. + + + Invokes the asynchronous action method by using the specified parameters and controller context. + An object that contains the result of an asynchronous call. + The controller context. + The parameters of the action method. + The callback method. + An object that contains information to be used by the callback method. This parameter can be null. + + + Returns the result of an asynchronous operation. + The result of an asynchronous operation. + An object that represents the status of an asynchronous operation. + + + Executes the asynchronous action method by using the specified parameters and controller context. + The result of executing the asynchronous action method. + The controller context. + The parameters of the action method. + + + Represents a class that is responsible for invoking the action methods of an asynchronous controller. + + + Initializes a new instance of the class. + + + Invokes the asynchronous action method by using the specified controller context, action name, callback method, and state. + An object that contains the result of an asynchronous operation.Implements + The controller context. + The name of the action. + The callback method. + An object that contains information to be used by the callback method. This parameter can be null. + + + Invokes the asynchronous action method by using the specified controller context, action descriptor, parameters, callback method, and state. + An object that contains the result of an asynchronous operation. + The controller context. + The action descriptor. + The parameters for the asynchronous action method. + The callback method. + An object that contains information to be used by the callback method. This parameter can be null. + + + Invokes the asynchronous action method by using the specified controller context, filters, action descriptor, parameters, callback method, and state. + An object that contains the result of an asynchronous operation. + The controller context. + The filters. + The action descriptor. + The parameters for the asynchronous action method. + The callback method. + An object that contains information to be used by the callback method. This parameter can be null. + + + Cancels the action. + true if the action was canceled; otherwise, false. + The user-defined object that qualifies or contains information about an asynchronous operation. + + + Cancels the action. + true if the action was canceled; otherwise, false. + The user-defined object that qualifies or contains information about an asynchronous operation. + + + Cancels the action. + true if the action was canceled; otherwise, false. + The user-defined object that qualifies or contains information about an asynchronous operation. + + + Returns the controller descriptor. + The controller descriptor. + The controller context. + + + Provides asynchronous operations for the class. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the synchronization context. + The synchronization context. + + + Notifies ASP.NET that all asynchronous operations are complete. + + + Occurs when the method is called. + + + Gets the number of outstanding operations. + The number of outstanding operations. + + + Gets the parameters that were passed to the asynchronous completion method. + The parameters that were passed to the asynchronous completion method. + + + Executes a callback in the current synchronization context. + The asynchronous action. + + + Gets or sets the asynchronous timeout value, in milliseconds. + The asynchronous timeout value, in milliseconds. + + + Defines the interface for an action invoker, which is used to invoke an asynchronous action in response to an HTTP request. + + + Invokes the specified action. + The status of the asynchronous result. + The controller context. + The name of the asynchronous action. + The callback method. + The state. + + + Cancels the asynchronous action. + true if the asynchronous method could be canceled; otherwise, false. + The asynchronous result. + + + Used to create an instance for the current request. + + + Creates an instance of async action invoker for the current request. + The created . + + + Defines the methods that are required for an asynchronous controller. + + + Executes the specified request context. + The status of the asynchronous operation. + The request context. + The asynchronous callback method. + The state. + + + Ends the asynchronous operation. + The asynchronous result. + + + Provides a container for the asynchronous manager object. + + + Gets the asynchronous manager object. + The asynchronous manager object. + + + Provides a container that maintains a count of pending asynchronous operations. + + + Initializes a new instance of the class. + + + Occurs when an asynchronous method completes. + + + Gets the operation count. + The operation count. + + + Reduces the operation count by 1. + The updated operation count. + + + Reduces the operation count by the specified value. + The updated operation count. + The number of operations to reduce the count by. + + + Increments the operation count by one. + The updated operation count. + + + Increments the operation count by the specified value. + The updated operation count. + The number of operations to increment the count by. + + + Provides information about an asynchronous action method, such as its name, controller, parameters, attributes, and filters. + + + Initializes a new instance of the class. + An object that contains information about the method that begins the asynchronous operation (the method whose name ends with "Asynch"). + An object that contains information about the completion method (method whose name ends with "Completed"). + The name of the action. + The controller descriptor. + + + Gets the name of the action method. + The name of the action method. + + + Gets the method information for the asynchronous action method. + The method information for the asynchronous action method. + + + Begins running the asynchronous action method by using the specified parameters and controller context. + An object that contains the result of an asynchronous call. + The controller context. + The parameters of the action method. + The callback method. + An object that contains information to be used by the callback method. This parameter can be null. + + + Gets the method information for the asynchronous completion method. + The method information for the asynchronous completion method. + + + Gets the controller descriptor for the asynchronous action method. + The controller descriptor for the asynchronous action method. + + + Returns the result of an asynchronous operation. + The result of an asynchronous operation. + An object that represents the status of an asynchronous operation. + + + Returns an array of custom attributes that are defined for this member, excluding named attributes. + An array of custom attributes, or an empty array if no custom attributes exist. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + + + Returns an array of custom attributes that are defined for this member, identified by type. + An array of custom attributes, or an empty array if no custom attributes of the specified type exist. + The type of the custom attributes to return. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + + + Gets the filter attributes. + The filter attributes. + Use cache flag. + + + Returns the parameters of the action method. + The parameters of the action method. + + + Returns the action-method selectors. + The action-method selectors. + + + Determines whether one or more instances of the specified attribute type are defined for the action member. + true if an attribute of type that is represented by is defined for this member; otherwise, false. + The type of the custom attribute. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + + + + Gets the lazy initialized unique ID of the instance of this class. + The lazy initialized unique ID of the instance of this class. + + + Encapsulates information that describes an asynchronous controller, such as its name, type, and actions. + + + Initializes a new instance of the class. + The type of the controller. + + + Gets the type of the controller. + The type of the controller. + + + Finds an action method by using the specified name and controller context. + The information about the action method. + The controller context. + The name of the action. + + + Returns a list of action method descriptors in the controller. + A list of action method descriptors in the controller. + + + Returns custom attributes that are defined for this member, excluding named attributes. + An array of custom attributes, or an empty array if no custom attributes exist. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + + + Returns custom attributes of a specified type that are defined for this member, excluding named attributes. + An array of custom attributes, or an empty array if no custom attributes exist. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + + + Gets the filter attributes. + The filter attributes. + true to use the cache, otherwise false. + + + Returns a value that indicates whether one or more instances of the specified custom attribute are defined for this member. + true if an attribute of the type represented by is defined for this member; otherwise, false. + The type of the custom attribute. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + + + Represents an exception that occurred during the synchronous processing of an HTTP request in an ASP.NET MVC application. + + + Initializes a new instance of the class using a system-supplied message. + + + Initializes a new instance of the class using the specified message. + The message that describes the exception. The caller of this constructor must make sure that this string has been localized for the current system culture. + + + Initializes a new instance of the class using a specified error message and a reference to the inner exception that is the cause of this exception. + The message that describes the exception. The caller of this constructor must make sure that this string has been localized for the current system culture. + The exception that is the cause of the current exception. If the parameter is not null, the current exception is raised in a catch block that handles the inner exception. + + + When an action method returns either Task or Task<T> the provides information about the action. + + + Initializes a new instance of the class. + The task method information. + The action name. + The controller descriptor. + + + Gets the name of the action method. + The name of the action method. + + + Invokes the asynchronous action method using the specified parameters, controller context callback and state. + An object that contains the result of an asynchronous call. + The controller context. + The parameters of the action method. + The optional callback method. + An object that contains information to be used by the callback method. This parameter can be null. + + + Gets the controller descriptor. + The controller descriptor. + + + Ends the asynchronous operation. + The result of an asynchronous operation. + An object that represents the status of an asynchronous operation. + + + Executes the asynchronous action method + The result of executing the asynchronous action method. + The controller context. + The parameters of the action method. + + + Returns an array of custom attributes that are defined for this member, excluding named attributes. + An array of custom attributes, or an empty array if no custom attributes exist. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + + + Returns an array of custom attributes that are defined for this member, identified by type. + An array of custom attributes, or an empty array if no custom attributes exist. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + + + Returns an array of all custom attributes applied to this member. + An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined. + true to search this member's inheritance chain to find the attributes; otherwise, false. + + + Returns the parameters of the asynchronous action method. + The parameters of the asynchronous action method. + + + Returns the asynchronous action-method selectors. + The asynchronous action-method selectors. + + + Returns a value that indicates whether one or more instance of the specified custom attribute are defined for this member. + A value that indicates whether one or more instance of the specified custom attribute are defined for this member. + The type of the custom attribute. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + + + + Gets information for the asynchronous task. + Information for the asynchronous task. + + + Gets the unique ID for the task. + The unique ID for the task. + + + Represents an authentication challenge context containing information for executing an authentication challenge. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The controller context. + The action methods associated with the challenge. + The challenge response. + + + Gets or sets the action descriptor. + The action descriptor associated with the challenge. + + + Gets or sets the action result to execute. + The challenge response. + + + Represents an authentication context containing information for performing authentication. + + + Initializes a new instance of the class. + + + + Gets or sets the action descriptor. + The action methods associated with the authentication + + + Gets or sets the currently authenticated principal. + The security credentials for the authentication. + + + Gets or sets the error result, which indicates that authentication was attempted and failed. + The authentication result. + + + Defines a filter that performs authentication. + + + Authenticates the request. + The context to use for authentication. + + + Adds an authentication challenge to the current . + The context to use for the authentication challenge. + + + Defines a filter that overrides other filters. + + + Gets the type of filters to override. + The filter to override. + + + Represents support for calling child action methods and rendering the result inline in a parent view. + + + Invokes the specified child action method and returns the result as an HTML string. + The child action result as an HTML string. + The HTML helper instance that this method extends. + The name of the action method to invoke. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method with the specified parameters and returns the result as an HTML string. + The child action result as an HTML string. + The HTML helper instance that this method extends. + The name of the action method to invoke. + An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method using the specified controller name and returns the result as an HTML string. + The child action result as an HTML string. + The HTML helper instance that this method extends. + The name of the action method to invoke. + The name of the controller that contains the action method. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method using the specified parameters and controller name and returns the result as an HTML string. + The child action result as an HTML string. + The HTML helper instance that this method extends. + The name of the action method to invoke. + The name of the controller that contains the action method. + An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method using the specified parameters and controller name and returns the result as an HTML string. + The child action result as an HTML string. + The HTML helper instance that this method extends. + The name of the action method to invoke. + The name of the controller that contains the action method. + A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method using the specified parameters and returns the result as an HTML string. + The child action result as an HTML string. + The HTML helper instance that this method extends. + The name of the action method to invoke. + A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method and renders the result inline in the parent view. + The HTML helper instance that this method extends. + The name of the child action method to invoke. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method using the specified parameters and renders the result inline in the parent view. + The HTML helper instance that this method extends. + The name of the child action method to invoke. + An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method using the specified controller name and renders the result inline in the parent view. + The HTML helper instance that this method extends. + The name of the child action method to invoke. + The name of the controller that contains the action method. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method using the specified parameters and controller name and renders the result inline in the parent view. + The HTML helper instance that this method extends. + The name of the child action method to invoke. + The name of the controller that contains the action method. + An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method using the specified parameters and controller name and renders the result inline in the parent view. + The HTML helper instance that this method extends. + The name of the child action method to invoke. + The name of the controller that contains the action method. + A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method using the specified parameters and renders the result inline in the parent view. + The HTML helper instance that this method extends. + The name of the child action method to invoke. + A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Represents support for rendering object values as HTML. + + + Returns HTML markup for each property in the object that is represented by a string expression. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + + + Returns HTML markup for each property in the object that is represented by a string expression, using additional view data. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Returns HTML markup for each property in the object that is represented by the expression, using the specified template. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template that is used to render the object. + + + Returns HTML markup for each property in the object that is represented by the expression, using the specified template and additional view data. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template that is used to render the object. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Returns HTML markup for each property in the object that is represented by the expression, using the specified template and an HTML field ID. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template that is used to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + + + Returns HTML markup for each property in the object that is represented by the expression, using the specified template, HTML field ID, and additional view data. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template that is used to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Returns HTML markup for each property in the object that is represented by the expression. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The type of the model. + The type of the value. + + + Returns a string that contains each property value in the object that is represented by the specified expression, using additional view data. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + The type of the model. + The type of the value. + + + Returns a string that contains each property value in the object that is represented by the , using the specified template. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template that is used to render the object. + The type of the model. + The type of the value. + + + Returns a string that contains each property value in the object that is represented by the specified expression, using the specified template and additional view data. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template that is used to render the object. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + The type of the model. + The type of the value. + + + Returns HTML markup for each property in the object that is represented by the , using the specified template and an HTML field ID. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template that is used to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + The type of the model. + The type of the value. + + + Returns HTML markup for each property in the object that is represented by the specified expression, using the template, an HTML field ID, and additional view data. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template that is used to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + The type of the model. + The type of the value. + + + Returns HTML markup for each property in the model. + The HTML markup for each property in the model. + The HTML helper instance that this method extends. + + + Returns HTML markup for each property in the model, using additional view data. + The HTML markup for each property in the model. + The HTML helper instance that this method extends. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Returns HTML markup for each property in the model using the specified template. + The HTML markup for each property in the model. + The HTML helper instance that this method extends. + The name of the template that is used to render the object. + + + Returns HTML markup for each property in the model, using the specified template and additional view data. + The HTML markup for each property in the model. + The HTML helper instance that this method extends. + The name of the template that is used to render the object. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Returns HTML markup for each property in the model using the specified template and HTML field ID. + The HTML markup for each property in the model. + The HTML helper instance that this method extends. + The name of the template that is used to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + + + Returns HTML markup for each property in the model, using the specified template, an HTML field ID, and additional view data. + The HTML markup for each property in the model. + The HTML helper instance that this method extends. + The name of the template that is used to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Provides a mechanism to get display names. + + + Gets the display name. + The display name. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the display name. + + + Gets the display name for the model. + The display name for the model. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the display name. + The type of the model. + The type of the value. + + + Gets the display name for the model. + The display name for the model. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the display name. + The type of the model. + The type of the value. + + + Gets the display name for the model. + The display name for the model. + The HTML helper instance that this method extends. + + + Provides a way to render object values as HTML. + + + Returns HTML markup for each property in the object that is represented by the specified expression. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + + + Returns HTML markup for each property in the object that is represented by the specified expression. + The HTML markup for each property. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The type of the model. + The type of the result. + + + Represents support for the HTML input element in an application. + + + Returns an HTML input element for each property in the object that is represented by the expression. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + + + Returns an HTML input element for each property in the object that is represented by the expression, using additional view data. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Returns an HTML input element for each property in the object that is represented by the expression, using the specified template. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template to use to render the object. + + + Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and additional view data. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template to use to render the object. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and HTML field name. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template to use to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + + + Returns an HTML input element for each property in the object that is represented by the expression, using the specified template, HTML field name, and additional view data. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template to use to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Returns an HTML input element for each property in the object that is represented by the expression. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The type of the model. + The type of the value. + + + Returns an HTML input element for each property in the object that is represented by the expression, using additional view data. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + The type of the model. + The type of the value. + + + Returns an HTML input element for each property in the object that is represented by the expression, using the specified template. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template to use to render the object. + The type of the model. + The type of the value. + + + Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and additional view data. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template to use to render the object. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + The type of the model. + The type of the value. + + + Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and HTML field name. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template to use to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + The type of the model. + The type of the value. + + + Returns an HTML input element for each property in the object that is represented by the expression, using the specified template, HTML field name, and additional view data. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template to use to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + The type of the model. + The type of the value. + + + Returns an HTML input element for each property in the model. + An HTML input element for each property in the model. + The HTML helper instance that this method extends. + + + Returns an HTML input element for each property in the model, using additional view data. + An HTML input element for each property in the model. + The HTML helper instance that this method extends. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Returns an HTML input element for each property in the model, using the specified template. + An HTML input element for each property in the model and in the specified template. + The HTML helper instance that this method extends. + The name of the template to use to render the object. + + + Returns an HTML input element for each property in the model, using the specified template and additional view data. + An HTML input element for each property in the model. + The HTML helper instance that this method extends. + The name of the template to use to render the object. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Returns an HTML input element for each property in the model, using the specified template name and HTML field name. + An HTML input element for each property in the model and in the named template. + The HTML helper instance that this method extends. + The name of the template to use to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + + + Returns an HTML input element for each property in the model, using the template name, HTML field name, and additional view data. + An HTML input element for each property in the model. + The HTML helper instance that this method extends. + The name of the template to use to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Provides methods for working with enumeration values and select lists. + + + Gets a list of objects corresponding to enum constants defined in the given type. + A list for the given . + The type to evaluate. + + + Gets a list of objects corresponding to enum constants defined in the given type. Also ensures the will round-trip even if it does not match a defined constant and sets the Selected property to true for one element in the returned list -- matching the . + A list for the given , possibly extended to include an unrecognized . + The type to evaluate. + The value from type to select. + + + Gets a list of objects corresponding to enum constants defined in the given metadata. + A list for the given metadata. + The model metadata to evaluate. + + + Gets a list of objects corresponding to enum constants defined in the given metadata. Also ensures the value will round-trip even if it does not match a defined constant and sets the Selected property to true for one element in the returned list -- matching the value. + A list for the given , possibly extended to include an unrecognized . + The metadata to evaluate. + Value from the type of metadata to select. + + + Gets a value indicating whether the given type or an expression of this type is suitable for use in and calls. + true if will not throw when passed the given type and will not throw when passed an expression of this type; otherwise, false. + The type to check. + + + Gets a value indicating whether the given metadata or associated expression is suitable for use in and calls. + true if will return not throw when passed given and will not throw when passed associated expression; otherwise, false. + The metadata to check. + + + Represents support for HTML in an application. + + + Writes an opening <form> tag to the response. The form uses the POST method, and the request is processed by the action method for the view. + An opening <form> tag. + The HTML helper instance that this method extends. + + + Writes an opening <form> tag to the response and includes the route values in the action attribute. The form uses the POST method, and the request is processed by the action method for the view. + An opening <form> tag. + The HTML helper instance that this method extends. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + + + Writes an opening <form> tag to the response and sets the action tag to the specified controller and action. The form uses the POST method. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the action method. + The name of the controller. + + + Writes an opening <form> tag to the response, and sets the action tag to the specified controller, action, and route values. The form uses the POST method. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + + + Writes an opening <form> tag to the response and sets the action tag to the specified controller, action, and route values. The form uses the specified HTTP method. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + The HTTP method for processing the form, either GET or POST. + + + Writes an opening <form> tag to the response and sets the action tag to the specified controller, action, and route values. The form uses the specified HTTP method and includes the HTML attributes. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + The HTTP method for processing the form, either GET or POST. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response and sets the action tag to the specified controller and action. The form uses the specified HTTP method. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the action method. + The name of the controller. + The HTTP method for processing the form, either GET or POST. + + + Writes an opening <form> tag to the response and sets the action tag to the specified controller and action. The form uses the specified HTTP method and includes the HTML attributes from a dictionary. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the action method. + The name of the controller. + The HTTP method for processing the form, either GET or POST. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response and sets the action tag to the specified controller and action. The form uses the specified HTTP method and includes the HTML attributes. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the action method. + The name of the controller. + The HTTP method for processing the form, either GET or POST. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response, and sets the action tag to the specified controller, action, and route values from the route value dictionary. The form uses the POST method. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. + + + Writes an opening <form> tag to the response, and sets the action tag to the specified controller, action, and route values from the route value dictionary. The form uses the specified HTTP method. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. + The HTTP method for processing the form, either GET or POST. + + + Writes an opening <form> tag to the response, and sets the action tag to the specified controller, action, and route values from the route value dictionary. The form uses the specified HTTP method, and includes the HTML attributes from the dictionary. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. + The HTTP method for processing the form, either GET or POST. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response and includes the route values from the route value dictionary in the action attribute. The form uses the POST method, and the request is processed by the action method for the view. + An opening <form> tag. + The HTML helper instance that this method extends. + An object that contains the parameters for a route. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the route to use to obtain the form-post URL. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the route to use to obtain the form-post URL. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the route to use to obtain the form-post URL. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + The HTTP method for processing the form, either GET or POST. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the route to use to obtain the form-post URL. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + The HTTP method for processing the form, either GET or POST. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the route to use to obtain the form-post URL. + The HTTP method for processing the form, either GET or POST. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the route to use to obtain the form-post URL. + The HTTP method for processing the form, either GET or POST. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the route to use to obtain the form-post URL. + The HTTP method for processing the form, either GET or POST. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the route to use to obtain the form-post URL. + An object that contains the parameters for a route + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the route to use to obtain the form-post URL. + An object that contains the parameters for a route + The HTTP method for processing the form, either GET or POST. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the route to use to obtain the form-post URL. + An object that contains the parameters for a route + The HTTP method for processing the form, either GET or POST. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + An object that contains the parameters for a route + + + Renders the closing </form> tag to the response. + The HTML helper instance that this method extends. + + + Represents support for HTML input controls in an application. + + + Returns a check box input element by using the specified HTML helper and the name of the form field. + An input element whose type attribute is set to "checkbox". + The HTML helper instance that this method extends. + The name of the form field. + + + Returns a check box input element by using the specified HTML helper, the name of the form field, and a value to indicate whether the check box is selected. + An input element whose type attribute is set to "checkbox". + The HTML helper instance that this method extends. + The name of the form field. + true to select the check box; otherwise, false. The value of the check box is retrieved in this order - the object, the value of this parameter, the object, and lastly, a checked attribute in the html attributes. + + + Returns a check box input element by using the specified HTML helper, the name of the form field, a value to indicate whether the check box is selected, and the HTML attributes. + An input element whose type attribute is set to "checkbox". + The HTML helper instance that this method extends. + The name of the form field. + true to select the check box; otherwise, false. The value of the check box is retrieved in this order - the object, the value of this parameter, the object, and lastly, a checked attribute in the html attributes. + An object that contains the HTML attributes to set for the element. + + + Returns a check box input element by using the specified HTML helper, the name of the form field, a value that indicates whether the check box is selected, and the HTML attributes. + An input element whose type attribute is set to "checkbox". + The HTML helper instance that this method extends. + The name of the form field. + true to select the check box; otherwise, false. The value of the check box is retrieved in this order - the object, the value of this parameter, the object, and lastly, a checked attribute in the html attributes. + An object that contains the HTML attributes to set for the element. + + + Returns a check box input element by using the specified HTML helper, the name of the form field, and the HTML attributes. + An input element whose type attribute is set to "checkbox". + The HTML helper instance that this method extends. + The name of the form field. + An object that contains the HTML attributes to set for the element. + + + Returns a check box input element by using the specified HTML helper, the name of the form field, and the HTML attributes. + An input element whose type attribute is set to "checkbox". + The HTML helper instance that this method extends. + The name of the form field. + An object that contains the HTML attributes to set for the element. + + + Returns a check box input element for each property in the object that is represented by the specified expression. + An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The type of the model. + The parameter is null. + + + Returns a check box input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. + An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression, using the specified HTML attributes. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + A dictionary that contains the HTML attributes to set for the element. + The type of the model. + The parameter is null. + + + Returns a check box input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. + An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression, using the specified HTML attributes. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + An object that contains the HTML attributes to set for the element. + The type of the model. + The parameter is null. + + + Returns a hidden input element by using the specified HTML helper and the name of the form field. + An input element whose type attribute is set to "hidden". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + + + Returns a hidden input element by using the specified HTML helper, the name of the form field, and the value. + An input element whose type attribute is set to "hidden". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the hidden input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. + + + Returns a hidden input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. + An input element whose type attribute is set to "hidden". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the hidden input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. + An object that contains the HTML attributes to set for the element. + + + Returns a hidden input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. + An input element whose type attribute is set to "hidden". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the hidden input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. + An object that contains the HTML attributes to set for the element. + + + Returns an HTML hidden input element for each property in the object that is represented by the specified expression. + An input element whose type attribute is set to "hidden" for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The type of the model. + The type of the property. + + + Returns an HTML hidden input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. + An input element whose type attribute is set to "hidden" for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the property. + + + Returns an HTML hidden input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. + An input element whose type attribute is set to "hidden" for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the property. + + + Returns a password input element by using the specified HTML helper and the name of the form field. + An input element whose type attribute is set to "password". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + + + Returns a password input element by using the specified HTML helper, the name of the form field, and the value. + An input element whose type attribute is set to "password". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the password input element. If a value for this parameter is not provided, the value attribute in the html attributes is used to retrieve the value. + + + Returns a password input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. + An input element whose type attribute is set to "password". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the password input element. If a value for this parameter is not provided, the value attribute in the html attributes is used to retrieve the value. + An object that contains the HTML attributes to set for the element. + + + Returns a password input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. + An input element whose type attribute is set to "password". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the password input element. If a value for this parameter is not provided, the value attribute in the html attributes is used to retrieve the value. + An object that contains the HTML attributes to set for the element. + + + Returns a password input element for each property in the object that is represented by the specified expression. + An HTML input element whose type attribute is set to "password" for each property in the object that is represented by the specified expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The type of the model. + The type of the value. + The parameter is null. + + + Returns a password input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. + An HTML input element whose type attribute is set to "password" for each property in the object that is represented by the specified expression, using the specified HTML attributes. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + A dictionary that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + The parameter is null. + + + Returns a password input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. + An HTML input element whose type attribute is set to "password" for each property in the object that is represented by the specified expression, using the specified HTML attributes. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + The parameter is null. + + + Returns a radio button input element that is used to present mutually exclusive options. + An input element whose type attribute is set to "radio". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. + The parameter is null or empty. + The parameter is null. + + + Returns a radio button input element that is used to present mutually exclusive options. + An input element whose type attribute is set to "radio". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. + true to select the radio button; otherwise, false. + The parameter is null or empty. + The parameter is null. + + + Returns a radio button input element that is used to present mutually exclusive options. + An input element whose type attribute is set to "radio". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. + true to select the radio button; otherwise, false. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + The parameter is null. + + + Returns a radio button input element that is used to present mutually exclusive options. + An input element whose type attribute is set to "radio". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. + true to select the radio button; otherwise, false. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + The parameter is null. + + + Returns a radio button input element that is used to present mutually exclusive options. + An input element whose type attribute is set to "radio". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + The parameter is null. + + + Returns a radio button input element that is used to present mutually exclusive options. + An input element whose type attribute is set to "radio". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + The parameter is null. + + + Returns a radio button input element for each property in the object that is represented by the specified expression. + An HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. + The type of the model. + The type of the value. + The parameter is null. + + + Returns a radio button input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. + An HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression, using the specified HTML attributes. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. + A dictionary that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + The parameter is null. + + + Returns a radio button input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. + An HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression, using the specified HTML attributes. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The value of the selected radio button. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + The parameter is null. + + + Returns a text input element by using the specified HTML helper and the name of the form field. + An input element whose type attribute is set to "text". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + + + Returns a text input element by using the specified HTML helper, the name of the form field, and the value. + An input element whose type attribute is set to "text". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the text input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. + + + Returns a text input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. + An input element whose type attribute is set to "text". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the text input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. + An object that contains the HTML attributes to set for the element. + + + Returns a text input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. + An input element whose type attribute is set to "text". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the text input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. + An object that contains the HTML attributes to set for the element. + + + Returns a text input element. + An input element whose type attribute is set to "text". + The HTML helper instance that this method extends. + The name of the form field. + The value of the text input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. + A string that is used to format the input. + + + Returns a text input element. + An input element whose type attribute is set to "text". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the text input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. + A string that is used to format the input. + An object that contains the HTML attributes to set for the element. + + + Returns a text input element. + An input element whose type attribute is set to "text". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the text input element. The value is retrieved in this order - the object, the value of this parameter, the object, and lastly, a value attribute in the html attributes. + A string that is used to format the input. + An object that contains the HTML attributes to set for the element. + + + Returns a text input element for each property in the object that is represented by the specified expression. + An HTML input element whose type attribute is set to "text" for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The type of the model. + The type of the value. + The parameter is null or empty. + + + Returns a text input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. + An HTML input element type attribute is set to "text" for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + A dictionary that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + The parameter is null or empty. + + + Returns a text input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. + An HTML input element whose type attribute is set to "text" for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + The parameter is null or empty. + + + Returns a text input element. + An input element whose type attribute is set to "text". + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + A string that is used to format the input. + The type of the model. + The type of the value. + + + Returns a text input element. + An input element whose type attribute is set to "text". + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + A string that is used to format the input. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + + + Returns a text input element. + An input element whose type attribute is set to "text". + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + A string that is used to format the input. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + + + Represents support for the HTML label element in an ASP.NET MVC view. + + + Returns an HTML label element and the property name of the property that is represented by the specified expression. + An HTML label element and the property name of the property that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the property to display. + + + Returns an HTML label element and the property name of the property that is represented by the specified expression. + An HTML label element and the property name of the property that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the property to display. + An object that contains the HTML attributes to set for the element. + + + Returns an HTML label element and the property name of the property that is represented by the specified expression. + An HTML label element and the property name of the property that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the property to display. + An object that contains the HTML attributes to set for the element. + + + Returns an HTML label element and the property name of the property that is represented by the specified expression using the label text. + An HTML label element and the property name of the property that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the property to display. + The label text to display. + + + Returns an HTML label element and the property name of the property that is represented by the specified expression. + An HTML label element and the property name of the property that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the property to display. + The label text. + An object that contains the HTML attributes to set for the element. + + + Returns an HTML label element and the property name of the property that is represented by the specified expression. + An HTML label element and the property name of the property that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the property to display. + The label text. + An object that contains the HTML attributes to set for the element. + + + Returns an HTML label element and the property name of the property that is represented by the specified expression. + An HTML label element and the property name of the property that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the property to display. + The type of the model. + The type of the value. + + + Returns an HTML label element and the property name of the property that is represented by the specified expression. + An HTML label element and the property name of the property that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the property to display. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + + + Returns an HTML label element and the property name of the property that is represented by the specified expression. + An HTML label element and the property name of the property that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the property to display. + An object that contains the HTML attributes to set for the element. + The type of the model. + The value. + + + Returns an HTML label element and the property name of the property that is represented by the specified expression using the label text. + An HTML label element and the property name of the property that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the property to display. + The label text to display. + The type of the model. + The type of the value. + + + Returns an HTML label element and the property name of the property that is represented by the specified expression. + An HTML label element and the property name of the property that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the property to display. + The label text to display. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + + + Returns an HTML label element and the property name of the property that is represented by the specified expression. + An HTML label element and the property name of the property that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the property to display. + The label text. + An object that contains the HTML attributes to set for the element. + The type of the model. + The Value. + + + Returns an HTML label element and the property name of the property that is represented by the model. + An HTML label element and the property name of the property that is represented by the model. + The HTML helper instance that this method extends. + + + Returns an HTML label element and the property name of the property that is represented by the specified expression. + An HTML label element and the property name of the property that is represented by the expression. + The HTML helper instance that this method extends. + An object that contains the HTML attributes to set for the element. + + + Returns an HTML label element and the property name of the property that is represented by the specified expression. + An HTML label element and the property name of the property that is represented by the expression. + The HTML helper instance that this method extends. + An object that contains the HTML attributes to set for the element. + + + Returns an HTML label element and the property name of the property that is represented by the specified expression using the label text. + An HTML label element and the property name of the property that is represented by the expression. + The HTML helper instance that this method extends. + The label text to display. + + + Returns an HTML label element and the property name of the property that is represented by the specified expression. + An HTML label element and the property name of the property that is represented by the expression. + The HTML helper instance that this method extends. + The label Text. + An object that contains the HTML attributes to set for the element. + + + Returns an HTML label element and the property name of the property that is represented by the specified expression. + An HTML label element and the property name of the property that is represented by the expression. + The HTML helper instance that this method extends. + The label text. + An object that contains the HTML attributes to set for the element. + + + Represents support for HTML links in an application. + + + Returns an anchor element (a element) for the specified link text and action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the action. + The parameter is null or empty. + + + Returns an anchor element (a element) for the specified link text, action, and route values. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the action. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + The parameter is null or empty. + + + Returns an anchor element (a element) for the specified link text, action, route values, and HTML attributes. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the action. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + An object that contains the HTML attributes for the element. The attributes are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + The parameter is null or empty. + + + Returns an anchor element (a element) for the specified link text, action, and controller. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the action. + The name of the controller. + The parameter is null or empty. + + + Returns an anchor element (a element) for the specified link text, action, controller, route values, and HTML attributes. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the action. + The name of the controller. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element (a element) for the specified link text, action, controller, protocol, host name, URL fragment, route values, and HTML attributes. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the action. + The name of the controller. + The protocol for the URL, such as "http" or "https". + The host name for the URL. + The URL fragment name (the anchor name). + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element (a element) for the specified link text, action, controller, protocol, host name, URL fragment, route values as a route value dictionary, and HTML attributes as a dictionary. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the action. + The name of the controller. + The protocol for the URL, such as "http" or "https". + The host name for the URL. + The URL fragment name (the anchor name). + An object that contains the parameters for a route. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element (a element) for the specified link text, action, controller, route values as a route value dictionary, and HTML attributes as a dictionary. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the action. + The name of the controller. + An object that contains the parameters for a route. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element (a element) for the specified link text, action, and route values as a route value dictionary. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the action. + An object that contains the parameters for a route. + The parameter is null or empty. + + + Returns an anchor element (a element) for the specified link text, action, route values as a route value dictionary, and HTML attributes as a dictionary. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the action. + An object that contains the parameters for a route. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the route that is used to return a virtual path. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the route that is used to return a virtual path. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the route that is used to return a virtual path. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the route that is used to return a virtual path. + The protocol for the URL, such as "http" or "https". + The host name for the URL. + The URL fragment name (the anchor name). + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the route that is used to return a virtual path. + The protocol for the URL, such as "http" or "https". + The host name for the URL. + The URL fragment name (the anchor name). + An object that contains the parameters for a route. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the route that is used to return a virtual path. + An object that contains the parameters for a route. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the route that is used to return a virtual path. + An object that contains the parameters for a route. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + An object that contains the parameters for a route. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + An object that contains the parameters for a route. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Represents an HTML form element in an MVC view. + + + Initializes a new instance of the class using the specified HTTP response object. + The HTTP response object. + The parameter is null. + + + Initializes a new instance of the class using the specified view context. + An object that encapsulates the information that is required in order to render a view. + The parameter is null. + + + Releases all resources that are used by the current instance of the class. + + + Releases unmanaged and, optionally, managed resources used by the current instance of the class. + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + Ends the form and disposes of all form resources. + + + Gets the HTML ID and name attributes of the string. + + + Gets the ID of the string. + The HTML ID attribute value for the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the ID. + + + Gets the ID of the string + The HTML ID attribute value for the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the ID. + The type of the model. + The type of the property. + + + Gets the ID of the string. + The HTML ID attribute value for the object that is represented by the expression. + The HTML helper instance that this method extends. + + + Gets the full HTML field name for the object that is represented by the expression. + The full HTML field name for the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the name. + + + Gets the full HTML field name for the object that is represented by the expression. + The full HTML field name for the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the name. + The type of the model. + The type of the property. + + + Gets the full HTML field name for the object that is represented by the expression. + The full HTML field name for the object that is represented by the expression. + The HTML helper instance that this method extends. + + + Represents the functionality to render a partial view as an HTML-encoded string. + + + Renders the specified partial view as an HTML-encoded string. + The partial view that is rendered as an HTML-encoded string. + The HTML helper instance that this method extends. + The name of the partial view to render. + + + Renders the specified partial view as an HTML-encoded string. + The partial view that is rendered as an HTML-encoded string. + The HTML helper instance that this method extends. + The name of the partial view to render. + The model for the partial view. + + + Renders the specified partial view as an HTML-encoded string. + The partial view that is rendered as an HTML-encoded string. + The HTML helper instance that this method extends. + The name of the partial view. + The model for the partial view. + The view data dictionary for the partial view. + + + Renders the specified partial view as an HTML-encoded string. + The partial view that is rendered as an HTML-encoded string. + The HTML helper instance that this method extends. + The name of the partial view to render. + The view data dictionary for the partial view. + + + Provides support for rendering a partial view. + + + Renders the specified partial view by using the specified HTML helper. + The HTML helper. + The name of the partial view + + + Renders the specified partial view, passing it a copy of the current object, but with the Model property set to the specified model. + The HTML helper. + The name of the partial view. + The model. + + + Renders the specified partial view, replacing the partial view's ViewData property with the specified object and setting the Model property of the view data to the specified model. + The HTML helper. + The name of the partial view. + The model for the partial view. + The view data for the partial view. + + + Renders the specified partial view, replacing its ViewData property with the specified object. + The HTML helper. + The name of the partial view. + The view data. + + + Represents support for making selections in a list. + + + Returns a single-selection select element using the specified HTML helper and the name of the form field. + An HTML select element. + The HTML helper instance that this method extends. + The name of the form field to return. + The parameter is null or empty. + + + Returns a single-selection select element using the specified HTML helper, the name of the form field, and the specified list items. + An HTML select element with an option subelement for each item in the list. + The HTML helper instance that this method extends. + The name of the form field to return. + A collection of objects that are used to populate the drop-down list. + The parameter is null or empty. + + + Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, and the specified HTML attributes. + An HTML select element with an option subelement for each item in the list. + The HTML helper instance that this method extends. + The name of the form field to return. + A collection of objects that are used to populate the drop-down list. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, and the specified HTML attributes. + An HTML select element with an option subelement for each item in the list. + The HTML helper instance that this method extends. + The name of the form field to return. + A collection of objects that are used to populate the drop-down list. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, and an option label. + An HTML select element with an option subelement for each item in the list. + The HTML helper instance that this method extends. + The name of the form field to return. + A collection of objects that are used to populate the drop-down list. + The text for a default empty item. This parameter can be null. + The parameter is null or empty. + + + Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, an option label, and the specified HTML attributes. + An HTML select element with an option subelement for each item in the list. + The HTML helper instance that this method extends. + The name of the form field to return. + A collection of objects that are used to populate the drop-down list. + The text for a default empty item. This parameter can be null. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, an option label, and the specified HTML attributes. + An HTML select element with an option subelement for each item in the list. + The HTML helper instance that this method extends. + The name of the form field to return. + A collection of objects that are used to populate the drop-down list. + The text for a default empty item. This parameter can be null. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns a single-selection select element using the specified HTML helper, the name of the form field, and an option label. + An HTML select element with an option subelement for each item in the list. + The HTML helper instance that this method extends. + The name of the form field to return. + The text for a default empty item. This parameter can be null. + The parameter is null or empty. + + + Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items. + An HTML select element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + A collection of objects that are used to populate the drop-down list. + The type of the model. + The type of the value. + The parameter is null. + + + Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. + An HTML select element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + A collection of objects that are used to populate the drop-down list. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + The parameter is null. + + + Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. + An HTML select element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + A collection of objects that are used to populate the drop-down list. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + The parameter is null. + + + Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and option label. + An HTML select element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + A collection of objects that are used to populate the drop-down list. + The text for a default empty item. This parameter can be null. + The type of the model. + The type of the value. + The parameter is null. + + + Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items, option label, and HTML attributes. + An HTML select element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + A collection of objects that are used to populate the drop-down list. + The text for a default empty item. This parameter can be null. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + The parameter is null. + + + Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items, option label, and HTML attributes. + An HTML select element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + A collection of objects that are used to populate the drop-down list. + The text for a default empty item. This parameter can be null. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + The parameter is null. + + + Returns an HTML select element for each value in the enumeration that is represented by the specified expression. + An HTML select element for each value in the enumeration that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the values to display. + The type of the model. + The type of the value. + + + Returns an HTML select element for each value in the enumeration that is represented by the specified expression. + An HTML select element for each value in the enumeration that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the values to display. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + + + Returns an HTML select element for each value in the enumeration that is represented by the specified expression. + An HTML select element for each value in the enumeration that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the values to display. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + + + Returns an HTML select element for each value in the enumeration that is represented by the specified expression. + An HTML select element for each value in the enumeration that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the values to display. + The text for a default empty item. This parameter can be null. + The type of the model. + The type of the value. + + + Returns an HTML select element for each value in the enumeration that is represented by the specified expression. + An HTML select element for each value in the enumeration that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the values to display. + The text for a default empty item. This parameter can be null. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + + + Returns an HTML select element for each value in the enumeration that is represented by the specified expression. + An HTML select element for each value in the enumeration that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the values to display. + The text for a default empty item. This parameter can be null. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + + + Returns a multi-select select element using the specified HTML helper and the name of the form field. + An HTML select element. + The HTML helper instance that this method extends. + The name of the form field to return. + The parameter is null or empty. + + + Returns a multi-select select element using the specified HTML helper, the name of the form field, and the specified list items. + An HTML select element with an option subelement for each item in the list. + The HTML helper instance that this method extends. + The name of the form field to return. + A collection of objects that are used to populate the drop-down list. + The parameter is null or empty. + + + Returns a multi-select select element using the specified HTML helper, the name of the form field, the specified list items, and the specified HMTL attributes. + An HTML select element with an option subelement for each item in the list.. + The HTML helper instance that this method extends. + The name of the form field to return. + A collection of objects that are used to populate the drop-down list. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns a multi-select select element using the specified HTML helper, the name of the form field, and the specified list items. + An HTML select element with an option subelement for each item in the list.. + The HTML helper instance that this method extends. + The name of the form field to return. + A collection of objects that are used to populate the drop-down list. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an HTML select element for each property in the object that is represented by the specified expression and using the specified list items. + An HTML select element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + A collection of objects that are used to populate the drop-down list. + The type of the model. + The type of the property. + The parameter is null. + + + Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. + An HTML select element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + A collection of objects that are used to populate the drop-down list. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the property. + The parameter is null. + + + Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. + An HTML select element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + A collection of objects that are used to populate the drop-down list. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the property. + The parameter is null. + + + Represents support for HTML textarea controls. + + + Returns the specified textarea element by using the specified HTML helper and the name of the form field. + The textarea element. + The HTML helper instance that this method extends. + The name of the form field to return. + + + Returns the specified textarea element by using the specified HTML helper, the name of the form field, and the specified HTML attributes. + The textarea element. + The HTML helper instance that this method extends. + The name of the form field to return. + An object that contains the HTML attributes to set for the element. + + + Returns the specified textarea element by using the specified HTML helper and HTML attributes. + The textarea element. + The HTML helper instance that this method extends. + The name of the form field to return. + An object that contains the HTML attributes to set for the element. + + + Returns the specified textarea element by using the specified HTML helper, the name of the form field, and the text content. + The textarea element. + The HTML helper instance that this method extends. + The name of the form field to return. + The text content. + + + Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, and the specified HTML attributes. + The textarea element. + The HTML helper instance that this method extends. + The name of the form field to return. + The text content. + An object that contains the HTML attributes to set for the element. + + + Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, the number of rows and columns, and the specified HTML attributes. + The textarea element. + The HTML helper instance that this method extends. + The name of the form field to return. + The text content. + The number of rows. + The number of columns. + An object that contains the HTML attributes to set for the element. + + + Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, the number of rows and columns, and the specified HTML attributes. + The textarea element. + The HTML helper instance that this method extends. + The name of the form field to return. + The text content. + The number of rows. + The number of columns. + An object that contains the HTML attributes to set for the element. + + + Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, and the specified HTML attributes. + The textarea element. + The HTML helper instance that this method extends. + The name of the form field to return. + The text content. + An object that contains the HTML attributes to set for the element. + + + Returns an HTML textarea element for each property in the object that is represented by the specified expression. + An HTML textarea element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The type of the model. + The type of the property. + The parameter is null. + + + Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes. + An HTML textarea element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + A dictionary that contains the HTML attributes to set for the element. + The type of the model. + The type of the property. + The parameter is null. + + + Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes and the number of rows and columns. + An HTML textarea element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The number of rows. + The number of columns. + A dictionary that contains the HTML attributes to set for the element. + The type of the model. + The type of the property. + The parameter is null. + + + Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes and the number of rows and columns. + An HTML textarea element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The number of rows. + The number of columns. + A dictionary that contains the HTML attributes to set for the element. + The type of the model. + The type of the property. + The parameter is null. + + + Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes. + An HTML textarea element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + A dictionary that contains the HTML attributes to set for the element. + The type of the model. + The type of the property. + The parameter is null. + + + Provides support for validating the input from an HTML form. + + + Gets or sets the name of the resource file (class key) that contains localized string values. + The name of the resource file (class key). + + + Retrieves the validation metadata for the specified model and applies each rule to the data field. + The HTML helper instance that this method extends. + The name of the property or model object that is being validated. + The parameter is null. + + + Retrieves the validation metadata for the specified model and applies each rule to the data field. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The type of the model. + The type of the property. + + + Displays a validation message if an error exists for the specified field in the object. + If the property or object is valid, an empty string; otherwise, a span element that contains an error message. + The HTML helper instance that this method extends. + The name of the property or model object that is being validated. + + + Displays a validation message if an error exists for the specified field in the object. + If the property or object is valid, an empty string; otherwise, a span element that contains an error message. + The HTML helper instance that this method extends. + The name of the property or model object that is being validated. + An object that contains the HTML attributes for the element. + + + Displays a validation message if an error exists for the specified entry in the object. + null if the entry is valid and client-side validation is disabled. Otherwise, a element that contains an error message. + The HTML helper instance that this method operates on. + The name of the entry being validated. + An that contains the HTML attributes for the element. + The tag to be set for the wrapping HTML element of the validation message. + + + Displays a validation message if an error exists for the specified field in the object. + If the property or object is valid, an empty string; otherwise, a span element that contains an error message. + The HTML helper instance that this method extends. + The name of the property or model object that is being validated. + An object that contains the HTML attributes for the element. + + + Displays a validation message if an error exists for the specified entry in the object. + null if the entry is valid and client-side validation is disabled. Otherwise, a element that contains an error message. + The HTML helper instance that this method operates on. + The name of the entry being validated. + An object that contains the HTML attributes for the element. + The tag to be set for the wrapping HTML element of the validation message. + + + Displays a validation message if an error exists for the specified field in the object. + If the property or object is valid, an empty string; otherwise, a span element that contains an error message. + The HTML helper instance that this method extends. + The name of the property or model object that is being validated. + The message to display if the specified field contains an error. + + + Displays a validation message if an error exists for the specified field in the object. + If the property or object is valid, an empty string; otherwise, a span element that contains an error message. + The HTML helper instance that this method extends. + The name of the property or model object that is being validated. + The message to display if the specified field contains an error. + An object that contains the HTML attributes for the element. + + + Displays a validation message if an error exists for the specified entry in the object. + null if the model object is valid and client-side validation is disabled. Otherwise, a element that contains an error message. + The HTML helper instance that this method operates on. + The name of the model object being validated. + The message to display if the specified entry contains an error. + An that contains the HTML attributes for the element. + The tag to be set for the wrapping HTML element of the validation message. + + + Displays a validation message if an error exists for the specified field in the object. + If the property or object is valid, an empty string; otherwise, a span element that contains an error message. + The HTML helper instance that this method extends. + The name of the property or model object that is being validated. + The message to display if the specified field contains an error. + An object that contains the HTML attributes for the element. + + + Displays a validation message if an error exists for the specified entry in the object. + null if the entry is valid and client-side validation is disabled. Otherwise, a element that contains an error message. + The HTML helper instance that this method operates on. + The name of the entry being validated. + The message to display if the specified entry contains an error. + An object that contains the HTML attributes for the element. + The tag to be set for the wrapping HTML element of the validation message. + + + Displays a validation message if an error exists for the specified entry in the object. + null if the entry is valid and client-side validation is disabled. Otherwise, a element that contains an error message. + The HTML helper instance that this method operates on. + The name of the entry being validated. + The message to display if the specified entry contains an error. + The tag to be set for the wrapping HTML element of the validation message. + + + Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression. + If the property or object is valid, an empty string; otherwise, a span element that contains an error message. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The type of the model. + The type of the property. + + + Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message. + If the property or object is valid, an empty string; otherwise, a span element that contains an error message. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The message to display if the specified field contains an error. + The type of the model. + The type of the property. + + + Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message and HTML attributes. + If the property or object is valid, an empty string; otherwise, a span element that contains an error message. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The message to display if the specified field contains an error. + An object that contains the HTML attributes for the element. + The type of the model. + The type of the property. + + + Returns the HTML markup for a validation-error message for the specified expression. + null if the model object is valid and client-side validation is disabled. Otherwise, a element that contains an error message. + The HTML helper instance that this method operates on. + An expression that identifies the object that contains the properties to render. + The message to display if a validation error occurs. + An that contains the HTML attributes for the element. + The tag to be set for the wrapping HTML element of the validation message. + The type of the model. + The type of the property. + + + Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message and HTML attributes. + If the property or object is valid, an empty string; otherwise, a span element that contains an error message. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The message to display if the specified field contains an error. + An object that contains the HTML attributes for the element. + The type of the model. + The type of the property. + + + Returns the HTML markup for a validation-error message for the specified expression. + null if the model object is valid and client-side validation is disabled. Otherwise, a element that contains an error message. + The HTML helper instance that this method operates on. + An expression that identifies the object that contains the properties to render. + The message to display if a validation error occurs. + An object that contains the HTML attributes for the element. + The tag to be set for the wrapping HTML element of the validation message. + The type of the model. + The type of the property. + + + Returns the HTML markup for a validation-error message for the specified expression. + null if the model object is valid and client-side validation is disabled. Otherwise, a element that contains an error message. + The HTML helper instance that this method operates on. + An expression that identifies the object that contains the properties to render. + The message to display if a validation error occurs. + The tag to be set for the wrapping HTML element of the validation message. + The type of the model. + The type of the property. + + + Returns an unordered list (ul element) of validation messages that are in the object. + A string that contains an unordered list (ul element) of validation messages. + The HTML helper instance that this method extends. + + + Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. + A string that contains an unordered list (ul element) of validation messages. + The HTML helper instance that this method extends. + true to have the summary display model-level errors only, or false to have the summary display all errors. + + + Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. + A string that contains an unordered list (ul element) of validation messages. + The HTML helper instance that this method extends. + true to have the summary display model-level errors only, or false to have the summary display all errors. + The message to display with the validation summary. + + + Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. + A string that contains an unordered list (ul element) of validation messages. + The HTML helper instance that this method extends. + true to have the summary display model-level errors only, or false to have the summary display all errors. + The message to display with the validation summary. + A dictionary that contains the HTML attributes for the element. + + + + Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. + A string that contains an unordered list (ul element) of validation messages. + The HTML helper instance that this method extends. + true to have the summary display model-level errors only, or false to have the summary display all errors. + The message to display with the validation summary. + An object that contains the HTML attributes for the element. + + + + + Returns an unordered list (ul element) of validation messages that are in the object. + A string that contains an unordered list (ul element) of validation messages. + The HMTL helper instance that this method extends. + The message to display if the specified field contains an error. + + + Returns an unordered list (ul element) of validation messages that are in the object. + A string that contains an unordered list (ul element) of validation messages. + The HTML helper instance that this method extends. + The message to display if the specified field contains an error. + A dictionary that contains the HTML attributes for the element. + + + + Returns an unordered list (ul element) of validation messages in the object. + A string that contains an unordered list (ul element) of validation messages. + The HTML helper instance that this method extends. + The message to display if the specified field contains an error. + An object that contains the HTML attributes for the element. + + + + + Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. + + + Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. + The HTML markup for the value. + The HTML helper instance that this method extends. + The name of the model. + + + Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. + The HTML markup for the value. + The HTML helper instance that this method extends. + The name of the model. + The format string. + + + Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. + The HTML markup for the value. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to expose. + The model. + The property. + + + Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. + The HTML markup for the value. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to expose. + The format string. + The model. + The property. + + + Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. + The HTML markup for the value. + The HTML helper instance that this method extends. + + + Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. + The HTML markup for the value. + The HTML helper instance that this method extends. + The format string. + + + Compiles ASP.NET Razor views into classes. + + + Initializes a new instance of the class. + + + The inherits directive. + + + The model directive. + + + Extends the VBCodeParser class by adding support for the @model keyword. + + + Initializes a new instance of the class. + + + Sets a value that indicates whether the current code block and model should be inherited. + true if the code block and model is inherited; otherwise, false. + + + The Model Type Directive. + Returns void. + + + Configures the ASP.NET Razor parser and code generator for a specified file. + + + Initializes a new instance of the class. + The virtual path of the ASP.NET Razor file. + The physical path of the ASP.NET Razor file. + + + Returns the ASP.NET MVC language-specific Razor code generator. + The ASP.NET MVC language-specific Razor code generator. + The C# or Visual Basic code generator. + + + Returns the ASP.NET MVC language-specific Razor code parser using the specified language parser. + The ASP.NET MVC language-specific Razor code parser. + The C# or Visual Basic code parser. + + + + + Creates instances based on the provided factories and action. The route entries provide direct routing to the provided action. + A set of route entries. + The action descriptor. + The direct route factories. + The constraint resolver. + + + Gets a set of route factories for the given action descriptor. + A set of route factories. + The action descriptor. + + + Gets the area prefix from the provided controller. + The area prefix or null. + The controller descriptor. + + + Creates instances based on the provided factories, controller and actions. The route entries provided direct routing to the provided controller and can reach the set of provided actions. + A set of route entries. + The controller descriptor. + The action descriptors. + The direct route factories. + The constraint resolver. + + + Gets route factories for the given controller descriptor. + A set of route factories. + The controller descriptor. + + + Gets direct routes for the given controller descriptor and action descriptors based on attributes. + A set of route entries. + The controller descriptor. + The action descriptors for all actions. + The constraint resolver. + + + Gets the route prefix from the provided controller. + The route prefix or null. + The controller descriptor. + + + The default implementation of . Resolves constraints by parsing a constraint key and constraint arguments, using a map to resolve the constraint type, and calling an appropriate constructor for the constraint type. + + + + Gets the mutable dictionary that maps constraint keys to a particular constraint type. + + + + Represents a context that supports creating a direct route. + + + Initializes a new instance of the class. + The route prefix, if any, defined by the area. + The route prefix, if any, defined by the controller. + The action descriptors to which to create a route. + The inline constraint resolver. + A value indicating whether the route is configured at the action or controller level. + + + Gets the action descriptors to which to create a route. + The action descriptors to which to create a route. + + + Gets the route prefix, if any, defined by the area. + The route prefix, if any, defined by the area. + + + Gets the route prefix, if any, defined by the controller. + The route prefix, if any, defined by the controller. + + + Creates a route builder that can build a route matching this context. + A route builder that can build a route matching this context. + The route template. + + + Creates a route builder that can build a route matching this context. + A route builder that can build a route matching this context. + The route template. + The inline constraint resolver to use, if any; otherwise, null. + + + Gets the inline constraint resolver. + The inline constraint resolver. + + + Gets a value indicating whether the route is configured at the action or controller level. + true when the route is configured at the action level; otherwise false if the route is configured at the controller level. + + + Defines a builder that creates direct routes to actions (attribute routes). + + + Gets the action descriptors to which to create a route. + The action descriptors to which to create a route. + + + Creates a route entry based on the current property values. + The route entry created. + + + Gets or sets the route constraints. + The route constraints. + + + Gets or sets the route data tokens. + The route data tokens. + + + Gets or sets the route defaults. + The route defaults. + + + Gets or sets the route name. + The route name, or null if no name supplied. + + + Gets or sets the route order. + The route order. + + + Gets or sets the route precedence. + The route precedence. + + + Gets a value indicating whether the route is configured at the action or controller level. + true when the route is configured at the action level; otherwise, false if the route is configured at the controller level. + + + Gets or sets the route template. + The route template. + + + Defines a factory that creates a route directly to a set of action descriptors (an attribute route). + + + Creates a direct route entry. + The direct route entry. + The context to use to create the route. + + + Defines a provider for routes that directly target action descriptors (attribute routes). + + + Gets the direct routes for a controller. + A set of route entries for the controller. + The controller descriptor. + The action descriptors. + The inline constraint resolver. + + + Defines an abstraction for resolving inline constraints as instances of . + + + Resolves the inline constraint. + The the inline constraint was resolved to. + The inline constraint to resolve. + + + Provides information for building a System.Web.Routing.Route. + + + Gets the route template describing the URI pattern to match against. + The route template describing the URI pattern to match against. + + + Gets the name of the route to generate. + The name of the route to generate. + + + Defines a route prefix. + + + Gets the route prefix. + The route prefix. + + + Builds instances based on route information. + + + Initializes a new instance of the class using the default inline constraint resolver. + + + Initializes a new instance of the class. + The to use for resolving inline constraints. + + + Builds an for a particular action. + The generated . + The tokenized route template for the route. + The HTTP methods supported by the route. A null value specify that all possible methods are supported. + The name of the associated controller. + The name of the associated action. + The method that the route attribute has been applied on. + + + Builds an for a particular action. + The generated route. + The tokenized route template for the route. + The controller the route attribute has been applied on. + + + Builds an . + The generated . + The route defaults. + The route constraints. + The detokenized route template. + The method that the route attribute has been applied on. + + + Gets the resolver for resolving inline constraints. + The resolver for resolving inline constraints. + + + Represents a named route. + + + Initializes a new instance of the class. + The route name. + The route. + + + Gets the route name. + The route name, if any; otherwise, null. + + + Gets the route. + The route. + + + Represents an attribute route that may contain custom constraints. + + + Initializes a new instance of the class. + The route template. + + + Gets the route constraints. + The route constraints, if any; otherwise null. + + + Creates a direct route entry. + The direct route entry. + The context to use to create the route. + + + Gets the route data tokens. + The route data tokens, if any; otherwise null. + + + Gets the route defaults. + The route defaults, if any; otherwise null. + + + Gets or sets the route name. + The route name, if any; otherwise null. + + + Gets or sets the route order. + The route order. + + + Gets the route template. + The route template. + + + Constrains a route parameter to contain only lowercase or uppercase letters A through Z in the English alphabet. + + + Initializes a new instance of the class. + + + Constrains a route parameter to represent only Boolean values. + + + + + Constrains a route by several child constraints. + + + Initializes a new instance of the class. + The child constraints that must match for this constraint to match. + + + Gets the child constraints that must match for this constraint to match. + The child constraints that must match for this constraint to match. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The HTTP context. + The route to compare. + The name of the parameter. + A list of parameter values. + The route direction. + + + Constrains a route parameter to represent only values. + + + Initializes a new instance of the class. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The HTTP context. + The route to compare. + The name of the parameter. + A list of parameter values. + The route direction. + + + Constrains a route parameter to represent only decimal values. + + + Initializes a new instance of the class. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The HTTP context. + The route to compare. + The name of the parameter. + A list of parameter values. + The route direction. + + + Constrains a route parameter to represent only 64-bit floating-point values. + + + Initializes a new instance of the class. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The HTTP context. + The route to compare. + The name of the parameter. + A list of parameter values. + The route direction. + + + Constrains a route parameter to represent only 32-bit floating-point values. + + + + + Constrains a route parameter to represent only values. + + + Initializes a new instance of the class. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The HTTP context. + The route to compare. + The name of the parameter. + A list of parameter values. + The route direction. + + + Constrains a route parameter to represent only 32-bit integer values. + + + + + Constrains a route parameter to be a string of a given length or within a given range of lengths. + + + + Initializes a new instance of the class that constrains a route parameter to be a string of a given length. + The minimum length of the route parameter. + The maximum length of the route parameter. + + + Gets the length of the route parameter, if one is set. + + + + Gets the maximum length of the route parameter, if one is set. + + + Gets the minimum length of the route parameter, if one is set. + + + Constrains a route parameter to represent only 64-bit integer values. + + + Initializes a new instance of the class. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The HTTP context. + The route to compare. + The name of the parameter. + A list of parameter values. + The route direction. + + + Constrains a route parameter to be a string with a maximum length. + + + + + Gets the maximum length of the route parameter. + + + Constrains a route parameter to be an integer with a maximum value. + + + Initializes a new instance of the class. + The maximum value. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The HTTP context. + The route to compare. + The name of parameter. + A list of parameter values. + The route direction. + + + Gets the maximum value of the route parameter. + The maximum value of the route parameter. + + + Constrains a route parameter to be a string with a maximum length. + + + Initializes a new instance of the class. + The minimum length. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The HTTP context. + The route to compare. + The name of the compare. + A list of parameter values. + The route direction. + + + Gets the minimum length of the route parameter. + The minimum length of the route parameter. + + + Constrains a route parameter to be a long with a minimum value. + + + Initializes a new instance of the class. + The minimum value. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The HTTP context. + The route to compare. + The name of the parameter. + A list of parameter values. + The route direction. + + + Gets the minimum value of the route parameter. + The minimum value of the route parameter. + + + Constrains a route by an inner constraint that doesn't fail when an optional parameter is set to its default value. + + + Initializes a new instance of the class. + The inner constraint to match if the parameter is not an optional parameter without a value + + + Gets the inner constraint to match if the parameter is not an optional parameter without a value. + + + + Constraints a route parameter to be an integer within a given range of values. + + + Initializes a new instance of the class. + The minimum value. + The maximum value. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The HTTP context. + The route to compare. + The name of the parameter. + A list of parameter values. + The route direction. + + + Gets the maximum value of the route parameter. + The maximum value of the route parameter. + + + Gets the minimum value of the route parameter. + The minimum value of the route parameter. + + + Constrains a route parameter to match a regular expression. + + + Initializes a new instance of the class with the specified pattern. + The pattern to match. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The HTTP context. + The route to compare. + The name of the parameter. + A list of parameter values. + The route direction. + + + Gets the regular expression pattern to match. + The regular expression pattern to match. + + \ No newline at end of file diff --git a/lib/aspnetmvc/System.Web.Razor.xml b/lib/aspnetmvc/System.Web.Razor.xml index f95072fe54a..c88ee13184b 100644 --- a/lib/aspnetmvc/System.Web.Razor.xml +++ b/lib/aspnetmvc/System.Web.Razor.xml @@ -1,5742 +1,5742 @@ - - - - System.Web.Razor - - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a Razor code language that is based on C# syntax. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the type of the code provider. - The type of the code provider. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a new Razor code generator based on C# code language. - The newly created Razor code generator based on C# code language. - The class name for the generated code. - The name of the root namespace for the generated code. - The name of the source code file. - The Razor engine host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a new code parser for C# code language. - The newly created code parser for C# code language. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the name of the C# code language. - The name of the C# code language. Value is ‘csharp’. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents results from code generation. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - true if the code generation is a success; otherwise, false. - The document. - The parser errors. - The generated code. - The dictionary of design-time generated code mappings. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The document. - The parser errors. - The generated code. - The dictionary of design-time generated code mappings. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The parser results. - The generated code. - The dictionary of design-time generated code mappings. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the dictionary of design-time generated code mappings. - The dictionary of design-time generated code mappings. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the generated code. - The generated code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the results of parsing a Razor document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - true if parsing was successful; otherwise, false. - The root node in the document’s syntax tree. - The list of errors which occurred during parsing. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The root node in the document’s syntax tree. - The list of errors which occurred during parsing. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the root node in the document’s syntax tree. - The root node in the document’s syntax tree. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the list of errors which occurred during parsing. - The list of errors which occurred during parsing. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether parsing was successful. - true if parsing was successful; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - Represents the base for all Razor code language.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - Initializes a new instance of the class.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - Gets the type of the CodeDOM provider.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The type of the CodeDOM provider. - - - Creates the code generator for the Razor code language.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The code generator for the Razor code language. - The class name. - The name of the root namespace. - The source file name. - The Razor engine host. - - - Creates the code parser for the Razor code language.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The code parser for the Razor code language. - - - Gets the language of the Razor code using the specified file extension.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The language of the Razor code. - The file extension. - - - Gets the language name of the current Razor code, that is “csharp” or “vb”.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The language name of the current Razor code. - - - Gets the list of language supported by the Razor code.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The list of language supported by the Razor code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents an attribute for the Razor directive. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The name of the attribute. - The value of the attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether this instance is equal to a specified object. - true if the object is equal to the this instance; otherwise, false. - The object to compare with this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this instance. - The hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the name of the attribute. - The name of the attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the unique type ID of the attribute. - The unique type ID of the attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the value of the attribute. - The value of the attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parser used by editors to avoid reparsing the entire document on each text change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Constructs the editor parser. - The which defines the environment in which the generated code will live. - The physical path to use in line pragmas. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines if a change will cause a structural change to the document and if not, applies it to the existing tree. If a structural change would occur, automatically starts a reparse. - A value indicating the result of the incremental parse. - The change to apply to the parse tree. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current parse tree. - The current parse tree. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases all resources used by the current instance of the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases the unmanaged resources used by the class and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Event fired when a full reparse of the document completes. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the filename of the document to parse. - The filename of the document to parse. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the auto complete string. - The auto complete string. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the host for the parse. - The host for the parse. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the last result of the parse was provisionally accepted for next partial parse. - true if the last result of the parse was provisionally accepted for next partial parse; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the generated code for the razor engine host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The specified code language. - - - Initializes a new instance of the class. - The specified code language. - The markup parser factory. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the languages supported by the code generator. - The languages supported that by the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a markup parser using the specified language parser for the . - A markup parser to create using the specified language parser for the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the methods as language-specific Razor code generator. - The methods as language-specific Razor code generator. - The C# or Visual Basic code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the methods as language-specific Razor code parser using the specified language parser. - The methods as language-specific Razor code parser using the specified language parser. - The C# or Visual Basic code parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the method to decorate markup parser using the specified language parser. - The method to decorate markup parser using the specified language parser. - The C# or Visual Basic code parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the default base class for the host. - The default base class for the host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the default class name for the host. - The default class name for the host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the default namespace for the host. - The default namespace for the host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the mode designs a time for the host. - true if the mode designs a time for the host; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the host that enables the instrumentation. - The host that enables the instrumentation. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the generated class context for the host. - The generated class context for the host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the instrumented source file path for the host. - The instrumented source file path for the host. - - - Gets or sets whether the design time editor is using tabs or spaces for indentation. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the namespace imports for the host. - The namespace imports for the host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns this method to post all the processed generated code for the host. - The code compile unit. - The generated namespace. - The generated class. - The execute method. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns this method to post all the processed generated code for the host. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the static helpers for the host. - The static helpers for the host. - - - Tab size used by the hosting editor, when indenting with tabs. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents an entry-point to the Razor Template Engine. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a code generator. - The created . - The name of the generated class. - The namespace in which the generated class will reside. - The file name to use in line pragmas. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a . - The created . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the default class name of the template. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the default namespace for the template. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. - The resulting parse tree AND generated Code DOM tree. - The input text to parse. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. - The resulting parse tree AND generated Code DOM tree. - The input text to parse. - A token used to cancel the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. - The resulting parse tree AND generated Code DOM tree. - The input text to parse. - The name of the generated class, overriding whatever is specified in the host. - The namespace in which the generated class will reside. - The file name to use in line pragmas. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. - The resulting parse tree AND generated Code DOM tree. - The input text to parse. - The name of the generated class, overriding whatever is specified in the host. - The namespace in which the generated class will reside. - The file name to use in line pragmas. - A token used to cancel the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. - The resulting parse tree AND generated Code DOM tree. - The input text to parse. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. - The resulting parse tree AND generated Code DOM tree. - The input text to parse. - A token used to cancel the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. - The resulting parse tree AND generated Code DOM tree. - The input text to parse. - The name of the generated class, overriding whatever is specified in the host. - The namespace in which the generated class will reside. - The file name to use in line pragmas. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. - The resulting parse tree AND generated Code DOM tree. - The input text to parse. - The name of the generated class, overriding whatever is specified in the host. - The namespace in which the generated class will reside. - The file name to use in line pragmas. - A token used to cancel the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a code core. - The results of the generated core. - The input text to parse. - The name of the generated class, overriding whatever is specified in the host. - The namespace in which the generated class will reside. - The file name to use in line pragmas. - A token used to cancel the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the which defines the environment in which the generated template code will live. - The which defines the environment in which the generated template code will live. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer and returns its result. - The resulting parse tree. - The input text to parse. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer and returns its result. - The resulting parse tree. - The input text to parse. - A token used to cancel the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer and returns its result. - The resulting parse tree. - The input text to parse. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer and returns its result. - The resulting parse tree. - The input text to parse. - A token used to cancel the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template core. - The resulting parse tree. - The input text to parse. - A token used to cancel the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the state of the machine. - The generic type Return. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the current state of the machine. - The current state of the machine. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the starting state of the machine. - The starting state of the machine. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Stays into the machine during the transition. - Transition of the state machine. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Stays into the machine during the transition with the specified output. - The output of the transition. - The output. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Disables the machine upon transition. - The machine to stop. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the new transition of the state. - The new transition of the state. - The new state. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the new transition of the state with the specified output. - The new transition of the state with the specified output. - The output. - The new state. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Describes the turning process of the state. - The turning process of the state. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the state result. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The next output. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The output. - The next state. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the state has output. - true if the state has output; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the next state in the machine. - The next state in the machine. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the output. - The representing the output. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a language generator and provider of the VB razor code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the type of CodeDomProvider. - The type of CodeDomProvider. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates the code language generator. - The code language generator. - The name of the class. - The root namespace name. - The source File name. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a code parser in a . - A code parser in a . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the language name. - The language name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the editing result of the Editor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The partial parse result. - The edited span builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the edited span of the . - The edited span of the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the partial parse result. - The partial parse result. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides edit handler for implicit expression. - - - Initializes a new instance of the class. - The tokenizer. - The keywords. - true to accept trailing dot; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the expression accepts trailing dot. - true if the expression accepts trailing dot; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the parse that can accept change. - The partial parse result. - The target. - The normalized change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the specified object is equal to the current object. - true if the specified object is equal to the current objet; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the hash code for this current instance. - The hash code for this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the keywords associated with the expression. - The keywords associated with the expression. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of this current instance. - A string representation of this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the handler editor for this webpages. - - - Initializes a new instance of the class. - The tokenizer symbols. - - - Initializes a new instance of the class. - The tokenizer symbols. - The accepted characters. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Provides methods for handling the span edits. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The method used to parse string into tokens. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The method used to parse string into tokens. - One of the values of the enumeration. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets a value that specifies the accepted characters. - One of the values of the enumeration. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Applies the text change to the span. - The result of the apply operation. - The span to apply changes to. - The change to apply. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Applies the text change to the span. - The result of the apply operation. - The span to apply changes to. - The change to apply. - true to accept partial result; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the span can accept the specified change. - true if the span can accept the specified change; otherwise, false. - The span to check. - The change to apply. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a new default span edit handler. - A newly created default span edit handler. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a new default span edit handler. - A newly created default span edit handler. - The method used to parse string into tokens. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the editor hints. - The editor hints. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether this instance is equal to a specified object. - true if the object is equal to the this instance; otherwise, false. - The object to compare with this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this instance. - The hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the old text from the span content. - The old text from the span content. - The span to get old text from. - The text change which contains the location of the old text. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified change is at the end of first line of the span content. - true if the specified change is at the end of first line of the span content; otherwise, false. - The span to check. - The change to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified change is at the end of the span. - true if the specified change is at the end of the span; otherwise, false. - The span to check. - The change to chek. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified change is at the end the span content and for deletion. - true if the specified change is at the end the span content and for deletion; otherwise, false. - The span to check. - The change to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified change is at the end the span content and for insertion. - true if the specified change is at the end the span content and for insertion; otherwise, false. - The span to check. - The change to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified change is at the end the span content and for replacement. - true if the specified change is at the end the span content and for replacement; otherwise, false. - The span to check. - The change to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the span owns the specified change. - true if the span owns the specified change; otherwise, false. - The span to check. - The change to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the method used to parse string into tokens. - The method used to parse string into tokens. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation of the span edit handler. - The string representation of the span edit handler. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Updates the span using the normalized change. - The new span builder for the specified target. - The span to update. - The normalized change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the added import code generator for the razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The string namespace. - The length of the keyword namespace. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether two object instances are equal. - true if the specified object is equal to the current object; otherwise, false. - The object to compare with the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code with the specified parameters using the added import code generator. - The target span. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. - The hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the string namespace of the generator to add import code generator. - The string namespace of the generator to add import code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the length of keyword namespace for the code generator. - The length of keyword namespace for the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string that represents the current object. - A string that represents the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the attributes of the block code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The name. - The prefix string. - The suffix string. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare with the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to end the block using the specified parameters. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to start the block using the specified parameters. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this code generator. - The hash code for this code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the string name of the . - The string name of the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the prefix of the code generator. - The prefix of the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the suffix for the code generator. - The suffix for the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string that represents the current object. - A string that represents the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represent the block code generator for this razor syntax. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare with the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the end of the block code generator for this razor syntax. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the start of the block code generator for this razor syntax. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a hash code for the block code generator. - A hash code for the block code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a null value for the block code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the completion of event arguments for the code generation. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The virtual path string. - The physical path string. - The generated code compile unit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the generated code to complete the event argument. - The generated code to complete the event argument. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the physical path for the code generation. - The physical path for the code generation. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the virtual path of the code generation. - The virtual path of the code generation. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents the context of the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds a new generated code mapping to the collection. - The collection index of the newly added code mapping. - The source location of the generated code mapping. - The code start of the generated code mapping. - The length of the generated code mapping. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds a code statement for a context call on the specified method. - The content span. - The name of the method to invoke a context call. - true to specify that the method parameter is literal; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds a code statement that inserts the Razor design time helpers method in the specified code statement. - The code statement that receives the code insertion. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds the specified code statement to the body of the target method. - The code statement to add the target method. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds the specified code statement to the body of the target method. - The code statement to add the target method. - The line pragma. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Appends the specified fragment to the current buffered statement. - The fragment to add. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Appends the specified fragment to the current buffered statement. - The fragment to add. - The source span for the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Appends the content of the span to the current buffered statement. - The source span whose content is to be added. - - - Assigns a new statement collector and returns a disposable action that restores the old statement collector. - A disposable action that restores the old statement collector. - The new statement collector. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the dictionary collection of generated code mapping. - The dictionary collection of generated code mapping. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the code compile unit that will hold the program graph. - The code compile unit that will hold the program graph. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a new instance of the class. - The newly created instance of the code generator context. - The Razor engine host. - The class name for the generated class type declaration. - The name for the generated namespace declaration. - The source file. - true to enable the generation of line pragmas; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the current buffered statement. - The current buffered statement. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds the expression helper variable to the generated class if not yet added, - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Flushes the current buffered statement. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the generated class type declaration. - The generated class type declaration. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the line pragma for the specified source. - The line pragma for the specified source. - The source span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the line pragma for the source. - The line pragma for the specified source. - The source span. - The start index of code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the line pragma for the source. - The line pragma for the specified source. - The source span. - The start index of code. - The length of code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the line pragma for the source. - The line pragma for the specified source. - The source location. - The start index of code. - The length of code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the Razor engine host. - The Razor engine host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Marks the end of generated code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Marks the start of generated code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the generated namespace declaration. - The generated namespace declaration. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the source file. - The source file. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the generated member method. - The generated member method. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the name of text writer. - The name of text writer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a Razor code generator for C# language. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The class name for the generated class type declaration. - The name for the generated namespace declaration. - The source file. - The Razor engine host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes the context for this code generator. - The context for this code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the dynamic attributes of the block code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instances of the class. - The prefix. - The offset values. - The line values. - The col. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instances of the class. - The string prefix. - The value start. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare with the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to end the block using the specified parameters. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to start the block using the specified parameters. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. - The hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the namespace prefix of the code generator. - The namespace prefix of the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string that represents the current object. - A string that represents the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the value start for the dynamic attribute block code generator. - The value start for the dynamic attribute block code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a code generator for expression. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether this instance and a specified object are equal. - true if and this instance are the same type and represent the same value; otherwise, false. - The object to compare with the current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code for the expression. - The source span whose content represents an expression. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the end code for the block. - The target block for the end code generation. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the start code for the block. - The target block the start code generation. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. - The hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the string representation of this instance. - The string representation of this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a generated class context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The execute method name. - The write method name. - Write literal method name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - Execute method name. - Write method name. - Write literal method name. - Write to method name. - Write literal to method name. - Template type name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - Execute method name. - Write method name. - Write literal method name. - Write to method name. - Write literal to method name. - Template type name. - Define section method name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - Execute method name. - Write method name. - Write literal method name. - Write to method name. - Write literal to method name. - Template type name. - Define section method name. - Begin context method name. - End context method name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the context allows sections. - true if the context allows sections; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the context allows templates. - true if the context allows templates; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method before the generated context. - The name of the method before the generated context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default generated context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default name of the execute method. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default name of the layout property. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default name of the write attribute method. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default name of the write to attribute to method. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Specifies the default name of the write literal method. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Specifies the default name of the write method. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that defines the section of the context. - The name of the method that defines the section of the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method after the generated context. - The name of the method after the generated context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that will be invoked on the context. - The name of the method that will be invoked on the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this current instance. - The hash code for this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the property name for the layout. - The property name for the layout. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two object are equal. - true if the two object are equal; otherwise, false. - The first object to compare. - The second object to compare. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two object are not equal. - true if the two object are not equal; otherwise, false. - The first object to compare. - The second object to compare. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that resolves a Url for the context. - The name of the method that resolves a Url for the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the generated class supports instrumentation. - true if the generated class supports instrumentation; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the type name for the template. - The type name for the template. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that writes an attribute. - The name of the method that writes an attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method where to write an attribute. - The name of the method where to write an attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method where to write literal for the context. - The name of the method where to write literal for the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method where to write literal for the context. - The name of the method where to write literal for the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that will write on the context. - The name of the method that will write on the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that will write on the context. - The name of the method that will write on the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the generated code mapping objects. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The starting line. - The starting column. - The start generated column. - The code length. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The start offset. - The starting line. - The starting column. - The start generated column. - The code length. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the length of the generated map codes. - The length of the generated map codes. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current generated code mapping object. - true if the specified object is equal to the current generated code mapping object; otherwise, false. - The object to compare with the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for the generated code mapping object. - The hash code for the generated code mapping object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two specified generated code mapping objects have the same value. - true if the two specified generated code mapping objects have the same value; otherwise, false. - The left generated code mapping objects. - The right generated code mapping objects. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two specified generated code mapping objects have different values. - true the two specified generated code mapping objects have different values; otherwise, false. - The right generated code mapping objects. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the starting column of the generated code maps. - The starting column of the generated code maps. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the starting column of a generated code maps in the generated source file. - The starting column of a generated code maps in the generated source file. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the starting line of the generated code maps. - The starting line of the generated code maps. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the starting offset of the generated code maps. - The starting offset of the generated code maps. - - - Returns a string that represents the current object. - A string that represents the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a helper code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The signature. - true to complete the header; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the footer for this code. - The footer for this code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a block after the code. - The block to generate. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a block before the code. - The block to generate. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the hash code for the current instance. - The hash code for the current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the header for this code is complete. - true if the header for this code is complete; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the signature for this code. - The signature for this code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the current instance. - A string representation of the current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a hybrid code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code for the data model from switches identified by parameters. - The target object. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates an end block code. - The target object. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the start block code. - The target object. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the for the webpages. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the end block code for the razor. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the start block code for the razor. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a phase of the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code for the data model with the specified target and context. - The target object. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a code generator for literal attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. . Initializes a new instance of the class. - The prefix of the literal attribute. - The value of the literal attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. . Initializes a new instance of the class. - The prefix of the literal attribute. - The value generator for the literal attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. - true if the specified object is equal to this instance; otherwise, false. - The object to compare to this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the code for the literal attribute. - The source span whose content represents the literal attribute. - The context of the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the hash code for the current instance. - The hash code for the current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the prefix of the literal attribute. - The prefix of the literal attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation of this instance. - The string representation of this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the value of the literal attribute. - The value of the literal attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the value generator for the literal attribute. - The value generator for the literal attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a code generator for markup. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. - true if the specified object is equal to this instance; otherwise, false. - The object to compare to this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the code for the markup. - The source span whose content represents the markup. - The context of the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this instance. - The hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation for this instance. - The string representation for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a Razor code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The class name. - The root namespace name. - The source file name. - The host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the class name for this code. - The class name for this code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the context of this code generator. - The context of this code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the code generator is in design-time mode. - true if the code generator is in design-time mode; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the generator should generate line pragmas in the Razor code. - true if the generator should generate line pragmas in the Razor code; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the razor engine host. - The razor engine host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes the current instance. - The context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Raises the Complete event. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the root namespace. - The name of the root namespace. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the source file. - The name of the source file. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the end block. - The block to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the span. - The span to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the start block. - The block to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the razor comment code generator for the webpages. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the start block code with the specified parameters. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a code generator for Razor directive attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The name of the directive attribute. - The value of the directive attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. - true if the specified object is equal to this instance; otherwise, false. - The object to compare to this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the code for the directive attribute. - The source span whose content represents the directive attribute to generate. - The context of the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this instance. - The hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the name of the directive attribute. - The name of the directive attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation for this instance. - The string representation for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the value of the directive attribute. - The value of the directive attribute. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the resolve Url code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether this instance and a specified object are equal. - true if and this instance are the same type and represent the same value; otherwise, false. - The object to compare with the current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code for the Url. - The target object. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. - The hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the fully qualified type name of this instance. - The fully qualified type name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a section code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The name of the section code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a block after the section code. - The target to generate. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a block before the section code. - The target to generate. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the hash code for this current instance. - The hash code for this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the section. - The name of the section. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of this current instance. - A string representation of this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a code generator for set base type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The set base type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the set base type. - The set base type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. - true if the specified object is equal to this instance; otherwise, false. - The object to compare to this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the code for this set base type. - The source span that contains the set base type to generate code. - The context of the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the hash code for this current instance. - The hash code for this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Resolves the given set base type. - The resolved set base type. - The context of the code generator. - The set base type to resolve. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation for this instance. - The string representation for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a code generator that sets layout for the web Razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The layout path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a layout code. - The target where to generate the code. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves a hash code for this current instance. - A hash code for this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the path of the layout code. - The path of the layout code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of this current instance. - A string representation of this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the conversion of the SetVBOptionCodeGenerator of the value. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The option name. - true if the object has a value; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Converts the explicitly to the on and off value. - The explicitly converts to the on and off value. - true if the converts to on and off value; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the explicit code Dom option name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code for the specified parameters. - The target. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the option name for the code generator. - The option name for the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Strictly converts the to the on and off value. - The strictly converts to the on and off value. - true if the strictly converts to the on and off value; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the strict code Dom option name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a String that represents the current Object. - A String that represents the current Object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the has a value. - true if the has a value; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the span code generator for the razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare with the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a code for the specified target and context parameters. - The target span. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a hash code for the span code generator. - A hash code for the span code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a null value for the span code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a code generator for the statement. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. - true if the specified object is equal to this instance; otherwise, false. - The object to compare to this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the code for the statement. - The span source whose content contains the statement to generate. - The context of the code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this current instance. - The hash code for this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation for this instance. - The string representation for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the template block code generator of the razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to end the block of the template block code generator. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to start the block for the template block code generator. - The target block. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a type member code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code with a given target and context. - The target where to generate the code. - The code generator context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the hash code for this current instance. - The hash code for this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of this code. - A string representation of this code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the razor code generator for VB. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The name of the class. - The root namespace. - The file name of the asset source. - The host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a visitor that executes a callback upon the completion of a visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The delegate for the span visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The delegate for the span visit. - The delegate for the error visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The delegate for the span visit. - The delegate for the error visit. - The delegate for the start block visit. - The delegate for the end block visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The delegate for the span visit. - The delegate for the error visit. - The delegate for the start block visit. - The delegate for the end block visit. - The delegate to execute for the complete event. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the synchronization context for this callback visitor. - The synchronization context for this callback visitor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Executes the visitor callback to visit the end block. - The end block to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Executes the visitor callback to visit the error. - The Razor error to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Executes the visitor callback to visit the span. - The span to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Executes the visitor callback to visit the start block. - The start block to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a C sharp code parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser accepts the ‘IF’ keyword. - true if the parser accepts the ‘IF’ keyword; otherwise, false. - The keyword to accept. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Asserts a directive code. - The directive code to assert. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code contains ‘AT’ keyword. - true if the code contains ‘AT’ keyword; otherwise, false. - The keyword. - - - Indicates the base type directive. - The no type name error. - The create code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the functions directive. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the code that handles embedded transition. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a helper directive. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates which class the application will derive the view from, and can therefore ensure proper type checking. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Inherits a directive core. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is at embedded transition. - true if the code is at embedded transition; otherwise, false. - true to allow templates and comments; otherwise, false. - true to allow transitions; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the code is nested. - true if the code is nested; otherwise, false. - - - Indicates whether the lines and comments is spacing token. - The function that indicates the spacing token. - true to include new lines; otherwise, false. - true to include comments; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the C sharp language keywords. - The C sharp language keywords. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the specific language for parsing. - The specific language for parsing. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the layout directive. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Maps the given directives. - The handler. - The directives. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the other parser used for the code. - The other parser used for the code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Spans the output of the parsing before the comment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Blocks the parsing. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the reserved directive. - Determines whether the directive is a top level. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a section directive. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a session state directive. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the session state directive core. - - - Indicates the directive for session state type. - The no value error. - The create code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a directive handler. - true if successful; otherwise, false. - The directive. - The handler. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the value of the session state is valid. - true if the value of the session state is valid; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the block for this CSharpCode parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The string name. - The start of the source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The CSharp symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the string name for the block. - The string name for the block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the source location to start the block. - The source location to start the block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the different language characteristics in a CSharp language. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a marker symbol in the code. - A marker symbol in the code. - The source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a symbol in the code. - A symbol in the code. - The source location. - The content value. - The html symbol type. - List of errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a language tokenizer. - A language tokenizer. - The source of the text document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Flips the bracket symbol in the code. - The bracket symbol in the code. - The symbol bracket. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the keyword in the code. - The keyword in the code. - The keyword. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the in the code. - The in the code. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a sample symbol in the code. - A sample symbol in the code. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a sample symbol in the code. - A sample symbol in the code. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the instance for the class. - The instance for the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the different language characteristics in an html. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a marker symbol in the Html. - A marker symbol in the Html. - The source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a symbol in the Html. - A symbol in the Html. - The source location. - The content value. - The html symbol type. - List of errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates an html tokenizer. - An html tokenizer. - The source of the text document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Flips the bracket symbol in the html. - The bracket symbol in the html. - The symbol bracket. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the in the html. - The in the html. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a sample symbol in the html. - A sample symbol in the html. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the instance for the class. - The instance for the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a parser specifically for parsing HTML markup. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Builds the span for the given content using the specified span builder. - The span builder used to build the span. - The start location. - The span content. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the function delegate used to determine the token used for HTML spacing. - The function delegate used to determine the token used for HTML spacing. - true to indicate that new lines are considered as spacing token; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the instance that defines the characteristics of HTML language. - The instance that defines the characteristics of HTML language. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the other parser for parsing HTML markup. - The other parser for parsing HTML markup. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Builds the span before the Razor comment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Parses the next HTML block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Parses the HTML document. - - - Parses a section with markups given by the nesting sequences. - A tuple that specifies the markup nesting sequences. - true to indicate case-sensitive parsing; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Skips the parse until the specified condition is meet. - A function delegate that defines the condition. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Skips the parse until the specified HTML symbol type is encountered. - The HTML symbol type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the HTML tags that are considered as void. - The HTML tags that are considered as void. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Provides methods that define the behavior of a Razor code language. - The type of the code tokenizer for the Razor language. - The type for the language symbol. - The enumeration type for the language symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a code language symbol with the specified source location as the start marker. - The symbol for the code language. - The source location as the start marker. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a code language symbol with the specified source location with the specified source location as the start marker. - The symbol for the code language. - The source location as the start marker. - The content. - The enumeration type for the language symbol. - The collection of error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a Razor code language tokenizer for the specified source document. - A Razor code language tokenizer for the specified source document. - The source document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the opposite bracket symbol for the specified bracket symbol. - The opposite bracket symbol for the specified bracket symbol. - The bracket symbol to flip. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the specific language symbol type for the given symbol type. - The specific language symbol type for the given symbol type. - The symbol type to get. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the actual symbol for the given language symbol type. - The actual symbol for the given language symbol type. - The language symbol type to get. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a comment body type. - true if the symbol is a comment body type; otherwise, false. - The symbol to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a comment star type. - true if the symbol is a comment star type; otherwise, false. - The symbol to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a comment start type. - true if the symbol is a comment start type; otherwise, false. - The symbol to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is an identifier type. - true if the symbol is an identifier type; otherwise, false. - The symbol to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a keyword type. - true if the symbol is a keyword type; otherwise, false. - The symbol to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol type is a known symbol type. - true if the symbol type is a known symbol type; otherwise, false. - The symbol whose type is to be checked. - The known type of the symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a new line type. - true if the symbol is a new line type; otherwise, false. - The symbol to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a transition type. - true if the symbol is a transition type; otherwise, false. - The symbol to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is an unknown type. - true if the symbol is an unknown type; otherwise, false. - The symbol to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a whitespace type. - true if the symbol is a whitespace type; otherwise, false. - The symbol to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is an unknown type. - true if the symbol is an unknown type; otherwise, false. - The known type of the symbol. - - - Splits the content of the code language symbol at the specified index. - A tuple of code language symbol. - The symbol whose content is to be splitted. - The index where the split occurs. - The enumeration type for the language symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Splits the specified string into tokens. - The collection of token. - The string to tokenize. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Splits the specified string into tokens. - The collection of token. - The source location as the start marker for the tokenizer. - The string to tokenize. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the parser base class for the razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Builds a span for the parser base. - The span builder. - The beginning of the source location. - The content. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the . - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the parser is a markup parser. - true if the parser is a markup parser; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the other parser . - The other parser . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Blocks the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates documentation for the parse. - - - Parses the section in ordered list of the elements. - The pair of nesting sequences. - true if the case is sensitive; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a parser whose context can be switched to either a code or a markup. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The source document. - The code parser for the context. - The markup parser for the context. - The active parser for the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the active parser for the context. - The active parser for the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds the specified span at the end of the block builder stack. - The span to add. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the code parser for the context. - The code parser for the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Parses the last span and returns the parse results that contain the newly built block. - The parse results that contain the newly built block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the current block builder. - The current block builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the current character available from the source. - The current character available from the source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets a value that indicates whether the parser is in design mode. - true if the parser is in design mode; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates an end block from the last item of the block builder stack. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets a value that indicates whether the source status is end of file. - true if the source status is end of file; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the list of errors during parsing. - The list of errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified block type exists in the block builder list. - true if the specified block type exists in the block builder list; otherwise, false. - The block type to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the last accepted characters. - One of the values of the enumeration. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the last span. - The last span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the markup parser for the context. - The markup parser for the context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Occurs when parse encountered error. - The source location. - The error message. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Occurs when parse encountered an error. - The source location. - The error message. - The other information about the source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the text reader for the source document. - The text reader for the source document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds a new block builder at the end of the block builder stack and returns a disposable action that returns an end block. - A disposable action that returns an end block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds a new block builder at the end of the block builder stack and returns a disposable action that returns an end block. - A disposable action that returns an end block. - The type for the new block builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Alternately switches the code parser or markup parser as the active parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets a value that indicates whether white space is significant to ancestor block. - true is white space is significant to ancestor block; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Provides helper methods for the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a spacing combining mark or a non-spacing mark. - true if the specified character value is a spacing combining mark or a non-spacing mark; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a connector punctuation. - true if the specified character value is a connector punctuation; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a decimal digit number. - true if the specified character value is a decimal digit number; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is valid for use in email address. - true if the specified character value is valid for use in email address; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is used for formatting text layout or formatting text operation. - true if the specified character value is used for formatting text layout or formatting text operation.; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a hexadecimal digit number. - true if the specified character is a hexadecimal digit number; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified string value is an identifier. - true if the specified string value is an identifier; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified string value is an identifier. - true if the specified string value is an identifier; otherwise, false. - The value to check. - true to require that the identifier starts with a letter or underscore (_); otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is valid for use in identifier. - true if the specified character is valid for use in identifier; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is valid for use as start character of an identifier. - true if the specified character value is valid for use as start character of an identifier; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a letter. - true if the specified character is a letter; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a letter or a decimal digit number. - true if the specified character is a letter or a decimal digit number; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified value is a newline. - true if the specified character is a newline; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified value is a newline. - true if the specified character is a newline; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a terminating character token. - true if the specified character value is a terminating character token; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a terminating quoted string. - true if the specified character value is a terminating quoted string; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a whitespace. - true if the specified character value is a whitespace; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a whitespace or newline. - true if the specified character value is a whitespace or newline; otherwise, false. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Sanitizes the specified input name to conform as a valid value for class name. - The sanitized class name. - The value to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a parser visitor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the cancellation token. - The cancellation token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates that a visitor method has completed execution. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the specified block. - The block to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the specified black after parsing. - The block to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the given razor error. - The error to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the specified span. - The span to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the specified block before parsing. - The block to visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides extension methods for parser visitor. - - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a Razor parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The code parser. - The markup parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a task that parses a specified object. - The created . - The object to parse. - The span callback. - The error callback. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a task that parses a specified object. - The created . - The object to parse. - The span callback. - The error callback. - The cancellation token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a task that parses a specified object. - The created . - The object to parse. - The span callback. - The error callback. - The context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a task that parses a specified object. - The created . - The object to parse. - The span callback. - The error callback. - The context. - The cancellation token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a task that parses a specified object. - The created . - The object to parse. - The consumer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the design time mode. - The design time mode. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the specified object. - The parser result. - The object to parse. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the specified object. - The object to parse. - The visitor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the specified object. - The parser result. - The object to parse. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the specified object. - The parser result. - The object to parse. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the specified object. - The object to parse. - The visitor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a tokenizer backed parser. - The type of tokenizer. - The type of symbol. - The type of SymbolType. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the list of symbols - The list of symbols. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the specified symbol. - The symbol to accept. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser accepts all types of tokenizer. - true of the parser accepts all types of tokenizer; otherwise, false. - The types. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser accepts and moves to the next tokenizer. - true if the parser accepts and moves to the next tokenizer; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser accepts single whitespace character. - true if the parser accepts single whitespace character; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token until a token of the given type is found. - The type of the token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token until a token of the given type is found and it will backup so that the next token is of the given type. - The type of the first token. - The type of the second token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the given tokens until a token of the given type is found. - The type of the first token. - The type of the second token. - The type of the third token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token until a token of the given types is found. - The types of the token. - - - Accepts token while the condition has been reached. - The condition. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the token while a token of the given type is not found. - The type of the token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token while the token of the given type has been reached. - The type of the first token. - The type of the second token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token while the token of the given type has been reached. - The type of the first token. - The type of the second token. - The type of the third token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token while the token of the given types has been reached. - The types. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser accepts whitespace in lines. - true if the parser accepts whitespace in lines; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds a marker symbol if necessary. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds a marker symbol if necessary. - The location where to add the symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the token is at the specified type. - true if the token is at the specified type; otherwise, false. - The type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the token is at the specified identifier. - true if the token is at the specified identifier; otherwise, false. - true to allow keywords; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parsing is balance. - true if the parsing is balance; otherwise, false. - The balancing mode. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parsing is balance. - true if the parsing is balance; otherwise, false. - The balancing mode. - The left parse. - The right parse. - The start of the mode. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Builds a specified span. - The span to build. - The start location to build the span. - The content of the span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Configures the span. - The configuration. - - - Configures the span. - The configuration. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current location of the current instance. - The current location of the current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current symbol of this instance. - The current symbol of this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the tokenizer is in the end of file. - true if the tokenizer is in the end of file; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether to ensure the current parser. - true if to ensure the current parser; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the expected token with the given type. - The type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the expected token with the given types. - The types. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Handles the embedded transition. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a specified span. - The span to initialize. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether this instance is at embedded transition. - true if this instance is at embedded transition; otherwise, false. - true to allow templates and comments; otherwise, false. - true to allow transitions; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the language used for parsing. - The language used for parsing. - - - Determines whether the token with the given condition would pass. - true if the token with the given condition would pass; otherwise, false. - The condition. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the token with the given type would pass. - true if the token with the give type would pass; otherwise, false. - The type of the token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the token with the given types would pass. - true if the token with the given types would pass; otherwise, false. - The types. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser advances to the next token. - true if the parser advances to the next token; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether parsing a token with the given type is optional. - true if parsing a token with the given type is optional; otherwise, false. - The type of the token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether parsing a token with the given type is optional. - true if parsing a token with the given type is optional; otherwise, false. - The type of the token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Outputs a token with accepted characters. - The accepted characters. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Outputs a token with span kind. - The span kind. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Outputs a token with a given span kind and accepted characters. - The span kind. - The accepted characters. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Outputs a span before the razor comment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code..Gets the previous symbol of this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Pushes the span configuration. - An that shuts down the configuration. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Pushes the span configuration. - An that shuts down the configuration. - The new configuration. - - - Pushes the span configuration. - An that shuts down the configuration. - The new configuration. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts the transition back. - The symbols. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts the transition back. - The symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts the current transition back. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Displays the razor comment. - - - Reads a token while the condition is not reached. - The token to read. - The condition. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the expected token is required. - true if the expected token is required; otherwise, false. - The expected token. - true to display an error if not found; otherwise, false. - The error base. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the associated with this instance. - The associated with this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the span configuration. - The span configuration. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the tokenizer. - The tokenizer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the token with the given type was parsed. - true if the token with the given type was parsed; otherwise, false. - The type of the token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a Visual Basic code parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts spaces in the VB code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Checks for a condition and displays a keyword in the code. - The keyword. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Asserts the given directive. - The directive to assert. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the directive is ‘AT’ directive. - true if the directive is an ‘AT’ directive; otherwise, false. - The directive. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the given keyword is ‘AT’. - true if the given keyword is ‘AT’; otherwise, false. - The keyword. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Ends a terminated directive. - The function that ends the terminated directive. - The directive. - The block type. - The code generator. - true to allow markup; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the termination of directive body is ended. - true if the termination of directive body is ended; otherwise, false. - The directive. - The block start. - true to allow all transitions; otherwise, false. - - - Ends a termination of statement. - The function that ends the termination. - The keyword. - true if the termination supports exit; otherwise, false. - true if the termination supports continue; otherwise, false. - - - Ends a termination of statement. - The function that ends the termination. - The keyword. - true if the termination supports exit; otherwise, false. - true if the termination supports continue; otherwise, false. - The block name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Handles the embedded transition. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Handles the embedded transition. - The last white space. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the code that handles the Exit or Continue keyword. - The keyword. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a code that handles a transition. - The last white space. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the code is a helper directive. - true if the code is a helper directive; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code imports a statement. - true if the code imports a statement; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code inherits a statement. - true if the code inherits a statement; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is at embedded transition. - true if the code is at embedded transition; otherwise, false. - true to allow templates and comments; otherwise, false. - true to allow transitions; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is directive defined. - true if the code is directive defined; otherwise, false. - The directive. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the keywords associated with the code. - The keywords associated with the code. - - - Indicates a keyword that terminates a statement. - The function that terminates the statement. - The start. - The terminator. - true if the termination supports exit; otherwise, false. - true if the termination supports continue; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the language for the parser. - The language for the parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is a layout directive. - true if the code is a layout directive; otherwise, false. - - - Maps a given directive. - The directive. - The action whether to map a given directive. - - - Maps a given keyword. - The keyword. - The action whether to map a given keyword. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a nested block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the keyword from the code is optional. - true if the keyword from the code is optional; otherwise, false. - The keyword. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is an option statement. - true if the code is an option statement; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the other parser. - The other parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the parser block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the parser block. - The start sequence. - The end sequence. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Spans the output before Razor comment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Blocks the parsing. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads a list of Visual Basic spaces. - A list of Visual Basic spaces. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the expected symbol is required. - true if the expected symbol is required; otherwise, false. - The expected symbol. - The error base. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is a reserved word. - true if the code is a reserved word; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is a section directive. - true if the code is a section directive; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code has a session state directive. - true if the code has a session state directive; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the characteristics of the Visual Basic language. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a Visual Basic marker symbol. - The created Visual Basic marker symbol. - The location to create the symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a Visual Basic symbol. - The created . - The location to create the symbol. - The content. - The type of the symbol. - The errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a Visual Basic tokenizer. - The created . - The source where to create the tokenizer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Flips the given bracket. - The type of the Visual Basic symbol. - The bracket to flip. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the type of the known symbol. - The type of the known symbol. - The type to retrieve. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a sample symbol with the given type. - A sample symbol with the given type. - The type of the symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets an instance of this . - An instance of . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the auto-complete editing handler class. - - - Initializes a new instance of the class. - The tokenizer. - - - Initializes a new instance of the class. - The tokenizer. - The accepted characters. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the auto-complete function is at the end of this span. - true if the auto-complete function is at the end of this span; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a string value to auto-complete. - A string value to auto-complete. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a parse result that can accept changes. - The phase of the target. - The normalized . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether this instance and a specified object are equal. - true if and this instance are the same type and represent the same value; otherwise, false. - The object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. - A 32-bit signed integer that is the hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the fully qualified type name of this instance. - A String containing a fully qualified type name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the block for creating webpages. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The source for the block builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the parser visitor of the block. - The parser visitor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a collection of SyntaxTreeNode to view the children of the block. - A collection of SyntaxTreeNode to view the children of the block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the IBlockCodeGenerator to generate codes for the elements. - The IBlockCodeGenerator to generate codes for the elements. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current block. - true if the specified object is equal to the current block; otherwise, false. - The object to compare with the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a value indicating whether the block is equivalent to the same element. - true if the block is equivalent to the same element; otherwise, false. - The syntax tree node. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Finds the first descendent span of the block. - The first descendent span of the block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Finds the last descendent span of the block. - The last descendent span of the block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Flattens a collection of a specified type for the block. - A collection of a specified type for the block to flatten. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. - The hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the object is a block-level object. - true if the object is a block-level object; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the length value of the block. - The length value of the block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Locates the owner of the block. - The owner of the block to locate. - The text change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the string name of the block. - The string name of the block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the start to identify the specific location of the block. - The start to identify the specific location of the block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string that represents the current object. - A string that represents the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the type of code block. - The type of code block. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the block builder for the webpages. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The original block builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Builds a block for this instance. - A block builds for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the collection of child elements of the block builder. - The collection of child elements of the block builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the code generator for the block builder. - The code generator for the block builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the string name for the block builder. - The string name for the block builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Resets the block builder to its original position. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a block type that can be assigned null. - A block type that can be assigned null. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a parsing error in Razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The error message. - The absolute index of the source location. - The line index of the source location. - The column index of the source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The error message. - The absolute index of the source location. - The line index of the source location. - The column index of the source location. - The length for the error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The error message. - The source location of the error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The error message. - The source location of the error. - The length for the error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. - true if the specified object is equal to this instance; otherwise, false. - The object to compare to this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. - true if the specified object is equal to this instance; otherwise, false. - The object to compare to this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for the current instance. - The hash code for the current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the length for the error. - The length for the error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the source location of the error. - The source location of the error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the error message. - The error message. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation of this error instance. - The string representation of this error instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a Razor parse tree node that contains the all the content of a block node. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The builder to use for this span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Accepts visit from the specified visitor. - The object that performs the visit. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Changes the span builder for this span. - A delegate that will be executed along with this change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Sets the start character location of this span. - The new start location to set for this span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the code generator for the span. - The code generator for the span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the content of the span. - The content of the span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the handler for span edits. - The handler for span edits. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this span. - true if the specified object is equal to this span; otherwise, false. - The object to compare to this span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified node is equivalent to this span. - true if the specified node is equal to this span; otherwise, false. - The node to compare with this span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this current span. - The hash code for this current span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets a value that indicates whether this node is a block node. - false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the kind for this span. - One of the values of the enumeration. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the length of the span content. - The length of the span content. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the next span in the tree node. - The next span in the tree node. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the previous span in the tree node. - The previous span in the tree node. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Replaces the span builder for this span with the specified span builder. - The new builder to use for this span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the start character location of the span. - The start character location of the span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the symbols used to generate the code for the span. - The symbols used to generate the code for the span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation of this current span. - The string representation of this current span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the span builder for the syntax tree. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The original span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the given symbol for the span builder. - The symbol builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Builds a span builder for this instance. - A span builder for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Clears the symbols of the span builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the span code generator. - The span code generator. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the span edit handler of the builder. - The span edit handler of the builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the span kind of the span builder. - The span kind of the span builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Resets the span builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the source location of the span builder. - The source location of the span builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the symbols for a generic read-only collection. - The symbols for a generic read-only collection. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the node for the syntax tree. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the visitor of the tree node. - The parser visitor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the syntax tree node is equivalent to given node. - true the syntax tree node is equivalent to given node; false. - The given node. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the syntax tree node is a block-level object. - true if the syntax tree node is a block-level object; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the length of the syntax tree node. - The length of the syntax tree node. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the parent tree node of the current tree node. - The parent tree node of the current tree node. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the specific source location for the syntax tree node. - The specific source location for the syntax tree node. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Provides a lookahead buffer for the text reader. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The text reader for the buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Begins the lookahead buffering operation for this . - A disposable action that ends the lookahead buffering. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Discards the backtrack context associated the lookahead buffering operation. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the current character in the buffer. - The current character in the buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the current location of the character in the buffer. - The current location of the character in the buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Releases the unmanaged resources used by the current instance of this class, and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Reads the next character from the text reader and appends it to the lookahead buffer. - true if a character was read from the text reader; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Advances the buffer position to the next character. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the current character in the buffer. - The current character in the buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the current character from the buffer and advances the buffer position to the next character. - The current character from the buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a location tagged. - The type of the location tagged. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The value of the source. - The offset. - The line. - The column location of the source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The value of the source. - The location of the source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for the current instance. - The hash code for the current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the location of the source. - The location of the source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two object are equal. - true if the two object are equal; otherwise, false. - The first object to compare. - The second object to compare. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Converts the specified value to a object. - true if successfully converted; otherwise, false. - The value to convert. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two object are not equal. - true if the two object are not equal; otherwise, false. - The first object to compare. - The second objet to compare. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the current instance. - The string that represents the current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the current instance. - A string that represents the current instance. - The format. - The format provider. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the value of the source. - The value of the source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the token to look for the razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The action to cancel. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the token. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases the resources used by the current instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a reader - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The source reader. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The string content. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The text buffering. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the length of the text to read. - The length of the text to read. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the source of location for the text reader. - The source of location for the text reader. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads the next character without changing the state of the reader or the character source. - An integer representing the next character to be read. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the position to seek the text reader. - The position to seek the text reader. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads the next character from the text reader and advances the character position by one character. - The next character from the text reader, or -1 if no more characters are available. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The absolute index. - The line index. - The character index. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the absolute index for the source location. - The absolute index for the source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds the two object. - The sum of the two object. - The first object to add. - The second object to add. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Advances the specified object to the given location. - The source location. - The location where to advance the object. - The text that advances to the given location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the character index for the source location. - The character index for the source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Compares current object to the other object. - The value of the objects compared. - The object to compare. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the current object is equal to the other object. - true if the current object is equal to the other object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. - The hash code for this instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the line index for the source location. - The line index for the source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds the two object. - The that is the sum of the two object. - The object to add. - The object to add. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two objects are equal. - true if the two objects are equal; otherwise, false. - The first object to compare. - The second object to compare. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the first object is greater than the second object. - true if the first object is greater than the second object; otherwise, false. - The first object. - The second object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two object are not equal. - true if the two objects are not equal; otherwise, false. - The object to compare. - The object to compare. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the first object is less than the second object. - true if the first object is greater than the second object; otherwise, false. - The first object. - The second object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - Returns . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Subtracts the first object to the second object. - The difference of the two objects. - The first object. - The second object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the source location. - A string representation of the source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides a source location tracker. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The current location of the source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Calculates the new location of the source. - The new source location. - The last position. - The new content. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the current location of the source. - The current location of the source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Updates the source location. - The character to read. - The character to update. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Updates the location of the source. - The object. - The content of the source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides a reader for text buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The text buffer to read. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Begins reading the current text buffer. - An instance that stops the text buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Cancels backtrack. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current location of the text buffer. - The current location of the text buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases the unmanaged resources used by the class and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the next text buffer to read. - The next text buffer to read. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads the current text buffer. - The current text buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Describes a text change operation. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The position of the text change in the snapshot immediately before the change. - The length of the old text. - An old text buffer. - The position of the text change in the snapshot immediately after the change. - The length of the new text. - A new text buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Applies the specified text change. - A string that contains the value of the text. - The content of the text. - The change offset. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Applies the specified text change. - A string that contains the value of the text. - The span of the text change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the hash code for this text change. - The hash code for this text change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether this text change is a delete. - true if this text change is a delete; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether this text change is an insert. - true if this text change is an insert; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether this text change is a replace. - true if this text change is a replace; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a new text buffer. - A new text buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the length of the new text. - The length of the new text. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the position of the text change in the snapshot immediately after the change. - The position of the text change in the snapshot immediately after the change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the text that replaced the old text. - The text that replaced the old text. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a normalized value of this text change. - A normalized value of this text change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets an old text buffer. - An old text buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the length of the old text. - The length of the old text. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the position of the text change in the snapshot immediately before the change. - The position of the text change in the snapshot immediately before the change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the text that was replaced. - The text that was replaced. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two text change are equal. - true if the two text change are equal; otherwise, false. - The left text change. - The right text change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two text change are not equal. - true if the two text change are not equal; otherwise, false. - The left text change. - The right text change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the text change. - A string representation of the text change. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides reader for text document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The source to read. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the length of the document. - The length of the document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the location of the document. - The location of the document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the next text document to read. - The next text document to read. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the position of the text document. - The position of the text document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads a specified text document. - The text document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides helper functions for the CSharp tokenizer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified character can be used for identifier. - true if the specified character can be used for identifier; otherwise, false. - The character to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified character can be used as an identifier start character. - true if the specified character can be used as an identifier start character; otherwise, false. - The character to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified character is a literal suffix for real numbers. - true if the specified character is a literal suffix for real numbers; otherwise, false. - The character to check. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a CSharp tokenizer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a CSharp tokenizer symbol. - A CSharp tokenizer symbol. - The beginning of the source location. - The contents. - The CSharp symbol type. - A collection of razor errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the star type of the . - The star type of the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the razor comment transition type for the . - The razor comment transition type for the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the razor comment type for the . - The razor comment type for the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the state of the machine. - The state of the machine. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the html tokenizer of the razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The source for the text document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a symbol for the specified parameters of the html tokenizer. - A symbol to create for the specified parameters of the html tokenizer. - The source location. - The content string. - The type of html symbol. - The razor errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the html symbols for the razor comment star type. - The html symbols for the razor comment star type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the html symbols for the razor comment transition type. - The html symbols for the razor comment transition type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the html symbols for the razor comment type. - The html symbols for the razor comment type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the start of the state machine for the html. - The start of the state machine for the html. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The type for the language symbol. - The enumeration type for the language symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a result after the razor comment transition. - The result. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the lookahead buffer contains the expected string. - true if the lookahead buffer contains the expected string; otherwise, false. - The string to check. - true to indicate comparison is case sensitive; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the buffer for the tokenizer. - The buffer for the tokenizer. - - - Returns a function delegate, that accepts a character parameter and returns a value that indicates whether the character parameter is equal to specified character or white space. - A function delegate. - The character used to compare. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a language symbol type for the tokenizer with the specified content. - A language symbol type for the tokenizer. - The start of the source location. - The content value. - The symbol type. - The razor error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current character in the tokenizer. - The current character. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a list of the current razor errors. - A list of the current errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current source location. - The current source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current start of the source location. - The current start of the source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value whether the tokenizer current location is at the end of the file. - true if the tokenizer current location is at the end of the file; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the language end symbol type used by the tokenizer. - The language end symbol type. - The start of the source location. - The enumeration type for the language symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the language end symbol type used by the tokenizer. - The language end symbol type. - The enumeration type for the language symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value whether the tokenizer have content. - true if the tokenizer have content; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads to the next character from the code reader. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Shows the next symbol to be used. - The next symbol to be used. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads the next symbol in the code. - The next symbol to read. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the Razor comment body. - The object that represent the state of the result. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the star type for the razor comment. - The star type for the razor comment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the transition type for the razor comment. - The transition type for the razor comment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the type of razor comment. - The type of razor comment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Sets the tokenizer status to its initial state. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Resumes using the previous language symbol type. - The previous language symbol type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Uses a single type of symbol. - A single type of symbol. - The type of symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the source of the text document. - The source of the source document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the start symbol used in this class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the next language symbol type. - The next language symbol type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Takes the string if found in the lookahead buffer into the tokenizer buffer. - true if the lookahead buffer contains the expected string; otherwise, false. - The string to match. - true to indicate comparison is case sensitive; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the current character into the buffer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the given input string into the buffer. - true if the whole input string was accepted; false, if only a substring was accepted. - The input string. - true to indicate comparison is case sensitive; otherwise, false. - - - Parses the source document until the condition specified by predicate is met or end file is reached. - true if the predicate condition is met; false if end of file is reached. - The predicate that specifies the processing condition. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the specified parameters for the tokenizer view. - The type tokenizer. - The type symbol. - The token symbol type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The tokenizer view. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current view of the TSymbol. - The current view of the TSymbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the view can reach the end of a file. - true if the view can reach the end of a file; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the tokenizer moves to the next view. - true if the tokenizer moves to the next view; false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts a specified symbol into the tokenizer view. - The symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the source of the text document for the tokenizer view. - The source of the text document for the tokenizer view. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the tokenizer to view the symbols for the razor. - The tokenizer to view the symbols for the razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a set of characters as helpers in VB. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether a specified character is enclosed in double quotation marks ("). - true if the character is enclosed in double quotation marks ("); otherwise, false. - The character. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether a character is in octal digit. - true if a character is in octal digit; otherwise, false. - The character. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether a specified character is enclosed in a single quotation mark ('). - true if the character is enclosed in a single quotation mark ('); otherwise, false. - The character. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Allows an application to break a VB symbol into tokens. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The source of text. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a domain of symbols. - A domain of symbols. - The source location. - The content value. - The . - The razor error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the VB symbol type. - The VB symbol type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the transition style of the VB symbol. - The transition style of the VB symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the razor type comment of the . - The razor type comment of the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the start state of the machine. - The start state of the machine. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a C sharp symbol for the razor tokenizer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The symbol’s offset. - The line. - The column - The content of the symbol. - The type of the symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The symbol’s offset. - The line. - The column - The content of the symbol. - The type of the symbol. - A list of errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The location to start the symbol. - The content of the symbol. - The type of the symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The location to start the symbol. - The content of the symbol. - The type of the symbol. - A list of errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the symbol has an escaped identifier. - true if the symbol has an escaped identifier; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this current instance. - The hash code for this current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the language keyword. - The language keyword. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the Html symbols. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The location of the symbol. - The exact line the symbol is found. - The column number the symbol is found. - The content value. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The location of the symbol. - The exact line the symbol is found. - The column number the symbol is found. - The content value. - The . - The razor error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The start of the source location. - The content value. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The start of the source location. - The content value. - The . - The razor error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents an interface for the web razor symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Changes the location of the symbol. - The new location of the symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the content of the symbol. - The content of the symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the starting offset of the symbol. - The location where to start the document. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the location of the symbol. - The location of the symbol. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a new instance of symbols. - The generic type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The source location. - The content value. - The type. - The razor error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Changes the start of the machine. - The new start. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the content of a . - The content of a . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified Object is equal to the current Object. - true if the specified Object is equal to the current Object; otherwise, false. - The object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the razor error. - The razor error. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves a hash code based on the current object. - A hash of the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Starts the time’s offset for the source location. - The document start. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the starting point of the source location. - The starting point of the source location. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a string representation of the current object. - A string representation of the current object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a Type that inherits from the base Type. - A Type that inherits from the base Type. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the symbol extensions for the web tokenizer. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the content of this class. - The content of this class. - The symbols to provide. - The starting index of the span. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the content of this class. - The content of this class. - The intersection with the given span. - - - Gets the content of this class. - The content of this class. - The intersection with the given span. - A list of chosen symbols. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the content of this class. - The content of this class. - The provided symbols. - - - Enumerates the list of Visual Basic keywords. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the VB symbol components. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The offset value. - The line value. - The column value. - The content String value. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The offset value. - The line value. - The column value. - The content String value. - The . - List of razor errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The start of the source location. - The content String value. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The start of the source location. - The content String value. - The . - List of razor errors. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether the current object is equal to the new object. - true if the current object is equal to the new object; otherwise, false. - The object to compare. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. - The hash code to return. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the specified data sample from the object. - The specified data sample from the object. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the keyword used in the VB. - The keyword used. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - + + + + System.Web.Razor + + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a Razor code language that is based on C# syntax. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the type of the code provider. + The type of the code provider. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a new Razor code generator based on C# code language. + The newly created Razor code generator based on C# code language. + The class name for the generated code. + The name of the root namespace for the generated code. + The name of the source code file. + The Razor engine host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a new code parser for C# code language. + The newly created code parser for C# code language. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the name of the C# code language. + The name of the C# code language. Value is ‘csharp’. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents results from code generation. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + true if the code generation is a success; otherwise, false. + The document. + The parser errors. + The generated code. + The dictionary of design-time generated code mappings. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The document. + The parser errors. + The generated code. + The dictionary of design-time generated code mappings. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The parser results. + The generated code. + The dictionary of design-time generated code mappings. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the dictionary of design-time generated code mappings. + The dictionary of design-time generated code mappings. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the generated code. + The generated code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the results of parsing a Razor document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + true if parsing was successful; otherwise, false. + The root node in the document’s syntax tree. + The list of errors which occurred during parsing. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The root node in the document’s syntax tree. + The list of errors which occurred during parsing. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the root node in the document’s syntax tree. + The root node in the document’s syntax tree. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the list of errors which occurred during parsing. + The list of errors which occurred during parsing. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether parsing was successful. + true if parsing was successful; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + Represents the base for all Razor code language.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + Initializes a new instance of the class.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + Gets the type of the CodeDOM provider.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The type of the CodeDOM provider. + + + Creates the code generator for the Razor code language.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The code generator for the Razor code language. + The class name. + The name of the root namespace. + The source file name. + The Razor engine host. + + + Creates the code parser for the Razor code language.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The code parser for the Razor code language. + + + Gets the language of the Razor code using the specified file extension.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The language of the Razor code. + The file extension. + + + Gets the language name of the current Razor code, that is “csharp” or “vb”.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The language name of the current Razor code. + + + Gets the list of language supported by the Razor code.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The list of language supported by the Razor code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents an attribute for the Razor directive. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The name of the attribute. + The value of the attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether this instance is equal to a specified object. + true if the object is equal to the this instance; otherwise, false. + The object to compare with this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this instance. + The hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the name of the attribute. + The name of the attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the unique type ID of the attribute. + The unique type ID of the attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the value of the attribute. + The value of the attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parser used by editors to avoid reparsing the entire document on each text change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Constructs the editor parser. + The which defines the environment in which the generated code will live. + The physical path to use in line pragmas. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines if a change will cause a structural change to the document and if not, applies it to the existing tree. If a structural change would occur, automatically starts a reparse. + A value indicating the result of the incremental parse. + The change to apply to the parse tree. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current parse tree. + The current parse tree. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases all resources used by the current instance of the . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases the unmanaged resources used by the class and optionally releases the managed resources. + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Event fired when a full reparse of the document completes. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the filename of the document to parse. + The filename of the document to parse. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the auto complete string. + The auto complete string. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the host for the parse. + The host for the parse. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the last result of the parse was provisionally accepted for next partial parse. + true if the last result of the parse was provisionally accepted for next partial parse; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the generated code for the razor engine host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The specified code language. + + + Initializes a new instance of the class. + The specified code language. + The markup parser factory. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the languages supported by the code generator. + The languages supported that by the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a markup parser using the specified language parser for the . + A markup parser to create using the specified language parser for the . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the methods as language-specific Razor code generator. + The methods as language-specific Razor code generator. + The C# or Visual Basic code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the methods as language-specific Razor code parser using the specified language parser. + The methods as language-specific Razor code parser using the specified language parser. + The C# or Visual Basic code parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the method to decorate markup parser using the specified language parser. + The method to decorate markup parser using the specified language parser. + The C# or Visual Basic code parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the default base class for the host. + The default base class for the host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the default class name for the host. + The default class name for the host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the default namespace for the host. + The default namespace for the host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the mode designs a time for the host. + true if the mode designs a time for the host; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the host that enables the instrumentation. + The host that enables the instrumentation. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the generated class context for the host. + The generated class context for the host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the instrumented source file path for the host. + The instrumented source file path for the host. + + + Gets or sets whether the design time editor is using tabs or spaces for indentation. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the namespace imports for the host. + The namespace imports for the host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns this method to post all the processed generated code for the host. + The code compile unit. + The generated namespace. + The generated class. + The execute method. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns this method to post all the processed generated code for the host. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the static helpers for the host. + The static helpers for the host. + + + Tab size used by the hosting editor, when indenting with tabs. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents an entry-point to the Razor Template Engine. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a code generator. + The created . + The name of the generated class. + The namespace in which the generated class will reside. + The file name to use in line pragmas. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a . + The created . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the default class name of the template. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the default namespace for the template. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. + The resulting parse tree AND generated Code DOM tree. + The input text to parse. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. + The resulting parse tree AND generated Code DOM tree. + The input text to parse. + A token used to cancel the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. + The resulting parse tree AND generated Code DOM tree. + The input text to parse. + The name of the generated class, overriding whatever is specified in the host. + The namespace in which the generated class will reside. + The file name to use in line pragmas. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. + The resulting parse tree AND generated Code DOM tree. + The input text to parse. + The name of the generated class, overriding whatever is specified in the host. + The namespace in which the generated class will reside. + The file name to use in line pragmas. + A token used to cancel the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. + The resulting parse tree AND generated Code DOM tree. + The input text to parse. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. + The resulting parse tree AND generated Code DOM tree. + The input text to parse. + A token used to cancel the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. + The resulting parse tree AND generated Code DOM tree. + The input text to parse. + The name of the generated class, overriding whatever is specified in the host. + The namespace in which the generated class will reside. + The file name to use in line pragmas. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer, generates code for it, and returns the constructed CodeDOM tree. + The resulting parse tree AND generated Code DOM tree. + The input text to parse. + The name of the generated class, overriding whatever is specified in the host. + The namespace in which the generated class will reside. + The file name to use in line pragmas. + A token used to cancel the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a code core. + The results of the generated core. + The input text to parse. + The name of the generated class, overriding whatever is specified in the host. + The namespace in which the generated class will reside. + The file name to use in line pragmas. + A token used to cancel the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the which defines the environment in which the generated template code will live. + The which defines the environment in which the generated template code will live. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer and returns its result. + The resulting parse tree. + The input text to parse. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer and returns its result. + The resulting parse tree. + The input text to parse. + A token used to cancel the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer and returns its result. + The resulting parse tree. + The input text to parse. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template specified by the TextBuffer and returns its result. + The resulting parse tree. + The input text to parse. + A token used to cancel the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the template core. + The resulting parse tree. + The input text to parse. + A token used to cancel the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the state of the machine. + The generic type Return. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the current state of the machine. + The current state of the machine. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the starting state of the machine. + The starting state of the machine. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Stays into the machine during the transition. + Transition of the state machine. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Stays into the machine during the transition with the specified output. + The output of the transition. + The output. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Disables the machine upon transition. + The machine to stop. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the new transition of the state. + The new transition of the state. + The new state. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the new transition of the state with the specified output. + The new transition of the state with the specified output. + The output. + The new state. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Describes the turning process of the state. + The turning process of the state. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the state result. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The next output. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The output. + The next state. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the state has output. + true if the state has output; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the next state in the machine. + The next state in the machine. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the output. + The representing the output. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a language generator and provider of the VB razor code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the type of CodeDomProvider. + The type of CodeDomProvider. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates the code language generator. + The code language generator. + The name of the class. + The root namespace name. + The source File name. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a code parser in a . + A code parser in a . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the language name. + The language name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the editing result of the Editor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The partial parse result. + The edited span builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the edited span of the . + The edited span of the . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the partial parse result. + The partial parse result. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides edit handler for implicit expression. + + + Initializes a new instance of the class. + The tokenizer. + The keywords. + true to accept trailing dot; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the expression accepts trailing dot. + true if the expression accepts trailing dot; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the parse that can accept change. + The partial parse result. + The target. + The normalized change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the specified object is equal to the current object. + true if the specified object is equal to the current objet; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the hash code for this current instance. + The hash code for this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the keywords associated with the expression. + The keywords associated with the expression. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of this current instance. + A string representation of this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the handler editor for this webpages. + + + Initializes a new instance of the class. + The tokenizer symbols. + + + Initializes a new instance of the class. + The tokenizer symbols. + The accepted characters. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Provides methods for handling the span edits. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The method used to parse string into tokens. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The method used to parse string into tokens. + One of the values of the enumeration. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets a value that specifies the accepted characters. + One of the values of the enumeration. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Applies the text change to the span. + The result of the apply operation. + The span to apply changes to. + The change to apply. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Applies the text change to the span. + The result of the apply operation. + The span to apply changes to. + The change to apply. + true to accept partial result; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the span can accept the specified change. + true if the span can accept the specified change; otherwise, false. + The span to check. + The change to apply. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a new default span edit handler. + A newly created default span edit handler. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a new default span edit handler. + A newly created default span edit handler. + The method used to parse string into tokens. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the editor hints. + The editor hints. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether this instance is equal to a specified object. + true if the object is equal to the this instance; otherwise, false. + The object to compare with this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this instance. + The hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the old text from the span content. + The old text from the span content. + The span to get old text from. + The text change which contains the location of the old text. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified change is at the end of first line of the span content. + true if the specified change is at the end of first line of the span content; otherwise, false. + The span to check. + The change to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified change is at the end of the span. + true if the specified change is at the end of the span; otherwise, false. + The span to check. + The change to chek. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified change is at the end the span content and for deletion. + true if the specified change is at the end the span content and for deletion; otherwise, false. + The span to check. + The change to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified change is at the end the span content and for insertion. + true if the specified change is at the end the span content and for insertion; otherwise, false. + The span to check. + The change to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified change is at the end the span content and for replacement. + true if the specified change is at the end the span content and for replacement; otherwise, false. + The span to check. + The change to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the span owns the specified change. + true if the span owns the specified change; otherwise, false. + The span to check. + The change to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the method used to parse string into tokens. + The method used to parse string into tokens. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation of the span edit handler. + The string representation of the span edit handler. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Updates the span using the normalized change. + The new span builder for the specified target. + The span to update. + The normalized change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the added import code generator for the razor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The string namespace. + The length of the keyword namespace. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether two object instances are equal. + true if the specified object is equal to the current object; otherwise, false. + The object to compare with the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code with the specified parameters using the added import code generator. + The target span. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. + The hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the string namespace of the generator to add import code generator. + The string namespace of the generator to add import code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the length of keyword namespace for the code generator. + The length of keyword namespace for the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string that represents the current object. + A string that represents the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the attributes of the block code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The name. + The prefix string. + The suffix string. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare with the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to end the block using the specified parameters. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to start the block using the specified parameters. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this code generator. + The hash code for this code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the string name of the . + The string name of the . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the prefix of the code generator. + The prefix of the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the suffix for the code generator. + The suffix for the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string that represents the current object. + A string that represents the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represent the block code generator for this razor syntax. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare with the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the end of the block code generator for this razor syntax. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the start of the block code generator for this razor syntax. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a hash code for the block code generator. + A hash code for the block code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a null value for the block code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the completion of event arguments for the code generation. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The virtual path string. + The physical path string. + The generated code compile unit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the generated code to complete the event argument. + The generated code to complete the event argument. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the physical path for the code generation. + The physical path for the code generation. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the virtual path of the code generation. + The virtual path of the code generation. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents the context of the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds a new generated code mapping to the collection. + The collection index of the newly added code mapping. + The source location of the generated code mapping. + The code start of the generated code mapping. + The length of the generated code mapping. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds a code statement for a context call on the specified method. + The content span. + The name of the method to invoke a context call. + true to specify that the method parameter is literal; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds a code statement that inserts the Razor design time helpers method in the specified code statement. + The code statement that receives the code insertion. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds the specified code statement to the body of the target method. + The code statement to add the target method. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds the specified code statement to the body of the target method. + The code statement to add the target method. + The line pragma. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Appends the specified fragment to the current buffered statement. + The fragment to add. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Appends the specified fragment to the current buffered statement. + The fragment to add. + The source span for the . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Appends the content of the span to the current buffered statement. + The source span whose content is to be added. + + + Assigns a new statement collector and returns a disposable action that restores the old statement collector. + A disposable action that restores the old statement collector. + The new statement collector. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the dictionary collection of generated code mapping. + The dictionary collection of generated code mapping. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the code compile unit that will hold the program graph. + The code compile unit that will hold the program graph. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a new instance of the class. + The newly created instance of the code generator context. + The Razor engine host. + The class name for the generated class type declaration. + The name for the generated namespace declaration. + The source file. + true to enable the generation of line pragmas; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the current buffered statement. + The current buffered statement. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds the expression helper variable to the generated class if not yet added, + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Flushes the current buffered statement. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the generated class type declaration. + The generated class type declaration. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the line pragma for the specified source. + The line pragma for the specified source. + The source span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the line pragma for the source. + The line pragma for the specified source. + The source span. + The start index of code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the line pragma for the source. + The line pragma for the specified source. + The source span. + The start index of code. + The length of code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the line pragma for the source. + The line pragma for the specified source. + The source location. + The start index of code. + The length of code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the Razor engine host. + The Razor engine host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Marks the end of generated code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Marks the start of generated code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the generated namespace declaration. + The generated namespace declaration. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the source file. + The source file. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the generated member method. + The generated member method. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the name of text writer. + The name of text writer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a Razor code generator for C# language. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The class name for the generated class type declaration. + The name for the generated namespace declaration. + The source file. + The Razor engine host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes the context for this code generator. + The context for this code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the dynamic attributes of the block code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instances of the class. + The prefix. + The offset values. + The line values. + The col. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instances of the class. + The string prefix. + The value start. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare with the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to end the block using the specified parameters. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to start the block using the specified parameters. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. + The hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the namespace prefix of the code generator. + The namespace prefix of the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string that represents the current object. + A string that represents the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the value start for the dynamic attribute block code generator. + The value start for the dynamic attribute block code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a code generator for expression. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether this instance and a specified object are equal. + true if and this instance are the same type and represent the same value; otherwise, false. + The object to compare with the current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code for the expression. + The source span whose content represents an expression. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the end code for the block. + The target block for the end code generation. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the start code for the block. + The target block the start code generation. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. + The hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the string representation of this instance. + The string representation of this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a generated class context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The execute method name. + The write method name. + Write literal method name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + Execute method name. + Write method name. + Write literal method name. + Write to method name. + Write literal to method name. + Template type name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + Execute method name. + Write method name. + Write literal method name. + Write to method name. + Write literal to method name. + Template type name. + Define section method name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + Execute method name. + Write method name. + Write literal method name. + Write to method name. + Write literal to method name. + Template type name. + Define section method name. + Begin context method name. + End context method name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the context allows sections. + true if the context allows sections; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the context allows templates. + true if the context allows templates; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method before the generated context. + The name of the method before the generated context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default generated context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default name of the execute method. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default name of the layout property. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default name of the write attribute method. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default name of the write to attribute to method. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Specifies the default name of the write literal method. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Specifies the default name of the write method. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that defines the section of the context. + The name of the method that defines the section of the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method after the generated context. + The name of the method after the generated context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that will be invoked on the context. + The name of the method that will be invoked on the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this current instance. + The hash code for this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the property name for the layout. + The property name for the layout. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two object are equal. + true if the two object are equal; otherwise, false. + The first object to compare. + The second object to compare. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two object are not equal. + true if the two object are not equal; otherwise, false. + The first object to compare. + The second object to compare. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that resolves a Url for the context. + The name of the method that resolves a Url for the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the generated class supports instrumentation. + true if the generated class supports instrumentation; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the type name for the template. + The type name for the template. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that writes an attribute. + The name of the method that writes an attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method where to write an attribute. + The name of the method where to write an attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method where to write literal for the context. + The name of the method where to write literal for the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method where to write literal for the context. + The name of the method where to write literal for the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that will write on the context. + The name of the method that will write on the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the method that will write on the context. + The name of the method that will write on the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the generated code mapping objects. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The starting line. + The starting column. + The start generated column. + The code length. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The start offset. + The starting line. + The starting column. + The start generated column. + The code length. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the length of the generated map codes. + The length of the generated map codes. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current generated code mapping object. + true if the specified object is equal to the current generated code mapping object; otherwise, false. + The object to compare with the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for the generated code mapping object. + The hash code for the generated code mapping object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two specified generated code mapping objects have the same value. + true if the two specified generated code mapping objects have the same value; otherwise, false. + The left generated code mapping objects. + The right generated code mapping objects. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two specified generated code mapping objects have different values. + true the two specified generated code mapping objects have different values; otherwise, false. + The right generated code mapping objects. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the starting column of the generated code maps. + The starting column of the generated code maps. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the starting column of a generated code maps in the generated source file. + The starting column of a generated code maps in the generated source file. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the starting line of the generated code maps. + The starting line of the generated code maps. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the starting offset of the generated code maps. + The starting offset of the generated code maps. + + + Returns a string that represents the current object. + A string that represents the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a helper code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The signature. + true to complete the header; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the footer for this code. + The footer for this code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a block after the code. + The block to generate. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a block before the code. + The block to generate. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the hash code for the current instance. + The hash code for the current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the header for this code is complete. + true if the header for this code is complete; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the signature for this code. + The signature for this code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the current instance. + A string representation of the current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a hybrid code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code for the data model from switches identified by parameters. + The target object. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates an end block code. + The target object. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the start block code. + The target object. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the for the webpages. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the end block code for the razor. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the start block code for the razor. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a phase of the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code for the data model with the specified target and context. + The target object. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a code generator for literal attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. . Initializes a new instance of the class. + The prefix of the literal attribute. + The value of the literal attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. . Initializes a new instance of the class. + The prefix of the literal attribute. + The value generator for the literal attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. + true if the specified object is equal to this instance; otherwise, false. + The object to compare to this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the code for the literal attribute. + The source span whose content represents the literal attribute. + The context of the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the hash code for the current instance. + The hash code for the current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the prefix of the literal attribute. + The prefix of the literal attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation of this instance. + The string representation of this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the value of the literal attribute. + The value of the literal attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the value generator for the literal attribute. + The value generator for the literal attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a code generator for markup. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. + true if the specified object is equal to this instance; otherwise, false. + The object to compare to this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the code for the markup. + The source span whose content represents the markup. + The context of the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this instance. + The hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation for this instance. + The string representation for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a Razor code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The class name. + The root namespace name. + The source file name. + The host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the class name for this code. + The class name for this code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the context of this code generator. + The context of this code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the code generator is in design-time mode. + true if the code generator is in design-time mode; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value indicating whether the generator should generate line pragmas in the Razor code. + true if the generator should generate line pragmas in the Razor code; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the razor engine host. + The razor engine host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes the current instance. + The context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Raises the Complete event. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the root namespace. + The name of the root namespace. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the source file. + The name of the source file. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the end block. + The block to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the span. + The span to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the start block. + The block to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the razor comment code generator for the webpages. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the start block code with the specified parameters. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a code generator for Razor directive attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The name of the directive attribute. + The value of the directive attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. + true if the specified object is equal to this instance; otherwise, false. + The object to compare to this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the code for the directive attribute. + The source span whose content represents the directive attribute to generate. + The context of the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this instance. + The hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the name of the directive attribute. + The name of the directive attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation for this instance. + The string representation for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the value of the directive attribute. + The value of the directive attribute. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the resolve Url code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether this instance and a specified object are equal. + true if and this instance are the same type and represent the same value; otherwise, false. + The object to compare with the current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code for the Url. + The target object. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. + The hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the fully qualified type name of this instance. + The fully qualified type name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a section code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The name of the section code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a block after the section code. + The target to generate. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a block before the section code. + The target to generate. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the hash code for this current instance. + The hash code for this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the section. + The name of the section. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of this current instance. + A string representation of this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a code generator for set base type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The set base type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the set base type. + The set base type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. + true if the specified object is equal to this instance; otherwise, false. + The object to compare to this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the code for this set base type. + The source span that contains the set base type to generate code. + The context of the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the hash code for this current instance. + The hash code for this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Resolves the given set base type. + The resolved set base type. + The context of the code generator. + The set base type to resolve. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation for this instance. + The string representation for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a code generator that sets layout for the web Razor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The layout path. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a layout code. + The target where to generate the code. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves a hash code for this current instance. + A hash code for this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the path of the layout code. + The path of the layout code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of this current instance. + A string representation of this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the conversion of the SetVBOptionCodeGenerator of the value. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The option name. + true if the object has a value; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Converts the explicitly to the on and off value. + The explicitly converts to the on and off value. + true if the converts to on and off value; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the explicit code Dom option name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code for the specified parameters. + The target. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the option name for the code generator. + The option name for the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Strictly converts the to the on and off value. + The strictly converts to the on and off value. + true if the strictly converts to the on and off value; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the strict code Dom option name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a String that represents the current Object. + A String that represents the current Object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the has a value. + true if the has a value; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the span code generator for the razor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare with the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a code for the specified target and context parameters. + The target span. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a hash code for the span code generator. + A hash code for the span code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a null value for the span code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a code generator for the statement. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. + true if the specified object is equal to this instance; otherwise, false. + The object to compare to this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Generates the code for the statement. + The span source whose content contains the statement to generate. + The context of the code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this current instance. + The hash code for this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation for this instance. + The string representation for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the template block code generator of the razor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to end the block of the template block code generator. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code to start the block for the template block code generator. + The target block. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a type member code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code with a given target and context. + The target where to generate the code. + The code generator context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the hash code for this current instance. + The hash code for this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of this code. + A string representation of this code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the razor code generator for VB. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The name of the class. + The root namespace. + The file name of the asset source. + The host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a visitor that executes a callback upon the completion of a visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The delegate for the span visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The delegate for the span visit. + The delegate for the error visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The delegate for the span visit. + The delegate for the error visit. + The delegate for the start block visit. + The delegate for the end block visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The delegate for the span visit. + The delegate for the error visit. + The delegate for the start block visit. + The delegate for the end block visit. + The delegate to execute for the complete event. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the synchronization context for this callback visitor. + The synchronization context for this callback visitor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Executes the visitor callback to visit the end block. + The end block to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Executes the visitor callback to visit the error. + The Razor error to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Executes the visitor callback to visit the span. + The span to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Executes the visitor callback to visit the start block. + The start block to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a C sharp code parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser accepts the ‘IF’ keyword. + true if the parser accepts the ‘IF’ keyword; otherwise, false. + The keyword to accept. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Asserts a directive code. + The directive code to assert. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code contains ‘AT’ keyword. + true if the code contains ‘AT’ keyword; otherwise, false. + The keyword. + + + Indicates the base type directive. + The no type name error. + The create code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the functions directive. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the code that handles embedded transition. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a helper directive. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates which class the application will derive the view from, and can therefore ensure proper type checking. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Inherits a directive core. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is at embedded transition. + true if the code is at embedded transition; otherwise, false. + true to allow templates and comments; otherwise, false. + true to allow transitions; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the code is nested. + true if the code is nested; otherwise, false. + + + Indicates whether the lines and comments is spacing token. + The function that indicates the spacing token. + true to include new lines; otherwise, false. + true to include comments; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the C sharp language keywords. + The C sharp language keywords. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the specific language for parsing. + The specific language for parsing. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the layout directive. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Maps the given directives. + The handler. + The directives. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the other parser used for the code. + The other parser used for the code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Spans the output of the parsing before the comment. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Blocks the parsing. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the reserved directive. + Determines whether the directive is a top level. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a section directive. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a session state directive. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the session state directive core. + + + Indicates the directive for session state type. + The no value error. + The create code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a directive handler. + true if successful; otherwise, false. + The directive. + The handler. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the value of the session state is valid. + true if the value of the session state is valid; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the block for this CSharpCode parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The string name. + The start of the source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The CSharp symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the string name for the block. + The string name for the block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the source location to start the block. + The source location to start the block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the different language characteristics in a CSharp language. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a marker symbol in the code. + A marker symbol in the code. + The source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a symbol in the code. + A symbol in the code. + The source location. + The content value. + The html symbol type. + List of errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a language tokenizer. + A language tokenizer. + The source of the text document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Flips the bracket symbol in the code. + The bracket symbol in the code. + The symbol bracket. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the keyword in the code. + The keyword in the code. + The keyword. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the in the code. + The in the code. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a sample symbol in the code. + A sample symbol in the code. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a sample symbol in the code. + A sample symbol in the code. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the instance for the class. + The instance for the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the different language characteristics in an html. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a marker symbol in the Html. + A marker symbol in the Html. + The source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a symbol in the Html. + A symbol in the Html. + The source location. + The content value. + The html symbol type. + List of errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates an html tokenizer. + An html tokenizer. + The source of the text document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Flips the bracket symbol in the html. + The bracket symbol in the html. + The symbol bracket. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the in the html. + The in the html. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a sample symbol in the html. + A sample symbol in the html. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the instance for the class. + The instance for the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a parser specifically for parsing HTML markup. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Builds the span for the given content using the specified span builder. + The span builder used to build the span. + The start location. + The span content. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the function delegate used to determine the token used for HTML spacing. + The function delegate used to determine the token used for HTML spacing. + true to indicate that new lines are considered as spacing token; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the instance that defines the characteristics of HTML language. + The instance that defines the characteristics of HTML language. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the other parser for parsing HTML markup. + The other parser for parsing HTML markup. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Builds the span before the Razor comment. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Parses the next HTML block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Parses the HTML document. + + + Parses a section with markups given by the nesting sequences. + A tuple that specifies the markup nesting sequences. + true to indicate case-sensitive parsing; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Skips the parse until the specified condition is meet. + A function delegate that defines the condition. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Skips the parse until the specified HTML symbol type is encountered. + The HTML symbol type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the HTML tags that are considered as void. + The HTML tags that are considered as void. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Provides methods that define the behavior of a Razor code language. + The type of the code tokenizer for the Razor language. + The type for the language symbol. + The enumeration type for the language symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a code language symbol with the specified source location as the start marker. + The symbol for the code language. + The source location as the start marker. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a code language symbol with the specified source location with the specified source location as the start marker. + The symbol for the code language. + The source location as the start marker. + The content. + The enumeration type for the language symbol. + The collection of error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates a Razor code language tokenizer for the specified source document. + A Razor code language tokenizer for the specified source document. + The source document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the opposite bracket symbol for the specified bracket symbol. + The opposite bracket symbol for the specified bracket symbol. + The bracket symbol to flip. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the specific language symbol type for the given symbol type. + The specific language symbol type for the given symbol type. + The symbol type to get. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the actual symbol for the given language symbol type. + The actual symbol for the given language symbol type. + The language symbol type to get. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a comment body type. + true if the symbol is a comment body type; otherwise, false. + The symbol to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a comment star type. + true if the symbol is a comment star type; otherwise, false. + The symbol to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a comment start type. + true if the symbol is a comment start type; otherwise, false. + The symbol to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is an identifier type. + true if the symbol is an identifier type; otherwise, false. + The symbol to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a keyword type. + true if the symbol is a keyword type; otherwise, false. + The symbol to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol type is a known symbol type. + true if the symbol type is a known symbol type; otherwise, false. + The symbol whose type is to be checked. + The known type of the symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a new line type. + true if the symbol is a new line type; otherwise, false. + The symbol to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a transition type. + true if the symbol is a transition type; otherwise, false. + The symbol to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is an unknown type. + true if the symbol is an unknown type; otherwise, false. + The symbol to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is a whitespace type. + true if the symbol is a whitespace type; otherwise, false. + The symbol to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the symbol is an unknown type. + true if the symbol is an unknown type; otherwise, false. + The known type of the symbol. + + + Splits the content of the code language symbol at the specified index. + A tuple of code language symbol. + The symbol whose content is to be splitted. + The index where the split occurs. + The enumeration type for the language symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Splits the specified string into tokens. + The collection of token. + The string to tokenize. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Splits the specified string into tokens. + The collection of token. + The source location as the start marker for the tokenizer. + The string to tokenize. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the parser base class for the razor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Builds a span for the parser base. + The span builder. + The beginning of the source location. + The content. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the . + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the parser is a markup parser. + true if the parser is a markup parser; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the other parser . + The other parser . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Blocks the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates documentation for the parse. + + + Parses the section in ordered list of the elements. + The pair of nesting sequences. + true if the case is sensitive; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a parser whose context can be switched to either a code or a markup. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The source document. + The code parser for the context. + The markup parser for the context. + The active parser for the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the active parser for the context. + The active parser for the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds the specified span at the end of the block builder stack. + The span to add. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the code parser for the context. + The code parser for the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Parses the last span and returns the parse results that contain the newly built block. + The parse results that contain the newly built block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the current block builder. + The current block builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the current character available from the source. + The current character available from the source. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets a value that indicates whether the parser is in design mode. + true if the parser is in design mode; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Creates an end block from the last item of the block builder stack. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets a value that indicates whether the source status is end of file. + true if the source status is end of file; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the list of errors during parsing. + The list of errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified block type exists in the block builder list. + true if the specified block type exists in the block builder list; otherwise, false. + The block type to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the last accepted characters. + One of the values of the enumeration. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the last span. + The last span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the markup parser for the context. + The markup parser for the context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Occurs when parse encountered error. + The source location. + The error message. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Occurs when parse encountered an error. + The source location. + The error message. + The other information about the source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the text reader for the source document. + The text reader for the source document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds a new block builder at the end of the block builder stack and returns a disposable action that returns an end block. + A disposable action that returns an end block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Adds a new block builder at the end of the block builder stack and returns a disposable action that returns an end block. + A disposable action that returns an end block. + The type for the new block builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Alternately switches the code parser or markup parser as the active parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets a value that indicates whether white space is significant to ancestor block. + true is white space is significant to ancestor block; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Provides helper methods for the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a spacing combining mark or a non-spacing mark. + true if the specified character value is a spacing combining mark or a non-spacing mark; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a connector punctuation. + true if the specified character value is a connector punctuation; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a decimal digit number. + true if the specified character value is a decimal digit number; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is valid for use in email address. + true if the specified character value is valid for use in email address; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is used for formatting text layout or formatting text operation. + true if the specified character value is used for formatting text layout or formatting text operation.; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a hexadecimal digit number. + true if the specified character is a hexadecimal digit number; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified string value is an identifier. + true if the specified string value is an identifier; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified string value is an identifier. + true if the specified string value is an identifier; otherwise, false. + The value to check. + true to require that the identifier starts with a letter or underscore (_); otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is valid for use in identifier. + true if the specified character is valid for use in identifier; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is valid for use as start character of an identifier. + true if the specified character value is valid for use as start character of an identifier; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a letter. + true if the specified character is a letter; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a letter or a decimal digit number. + true if the specified character is a letter or a decimal digit number; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified value is a newline. + true if the specified character is a newline; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified value is a newline. + true if the specified character is a newline; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a terminating character token. + true if the specified character value is a terminating character token; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a terminating quoted string. + true if the specified character value is a terminating quoted string; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a whitespace. + true if the specified character value is a whitespace; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified character value is a whitespace or newline. + true if the specified character value is a whitespace or newline; otherwise, false. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Sanitizes the specified input name to conform as a valid value for class name. + The sanitized class name. + The value to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a parser visitor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the cancellation token. + The cancellation token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates that a visitor method has completed execution. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the specified block. + The block to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the specified black after parsing. + The block to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the given razor error. + The error to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the specified span. + The span to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Visits the specified block before parsing. + The block to visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides extension methods for parser visitor. + + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a Razor parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The code parser. + The markup parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a task that parses a specified object. + The created . + The object to parse. + The span callback. + The error callback. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a task that parses a specified object. + The created . + The object to parse. + The span callback. + The error callback. + The cancellation token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a task that parses a specified object. + The created . + The object to parse. + The span callback. + The error callback. + The context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a task that parses a specified object. + The created . + The object to parse. + The span callback. + The error callback. + The context. + The cancellation token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a task that parses a specified object. + The created . + The object to parse. + The consumer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the design time mode. + The design time mode. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the specified object. + The parser result. + The object to parse. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the specified object. + The object to parse. + The visitor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the specified object. + The parser result. + The object to parse. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the specified object. + The parser result. + The object to parse. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the specified object. + The object to parse. + The visitor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a tokenizer backed parser. + The type of tokenizer. + The type of symbol. + The type of SymbolType. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the list of symbols + The list of symbols. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the specified symbol. + The symbol to accept. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser accepts all types of tokenizer. + true of the parser accepts all types of tokenizer; otherwise, false. + The types. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser accepts and moves to the next tokenizer. + true if the parser accepts and moves to the next tokenizer; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser accepts single whitespace character. + true if the parser accepts single whitespace character; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token until a token of the given type is found. + The type of the token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token until a token of the given type is found and it will backup so that the next token is of the given type. + The type of the first token. + The type of the second token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the given tokens until a token of the given type is found. + The type of the first token. + The type of the second token. + The type of the third token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token until a token of the given types is found. + The types of the token. + + + Accepts token while the condition has been reached. + The condition. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the token while a token of the given type is not found. + The type of the token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token while the token of the given type has been reached. + The type of the first token. + The type of the second token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token while the token of the given type has been reached. + The type of the first token. + The type of the second token. + The type of the third token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts token while the token of the given types has been reached. + The types. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser accepts whitespace in lines. + true if the parser accepts whitespace in lines; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds a marker symbol if necessary. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds a marker symbol if necessary. + The location where to add the symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the token is at the specified type. + true if the token is at the specified type; otherwise, false. + The type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the token is at the specified identifier. + true if the token is at the specified identifier; otherwise, false. + true to allow keywords; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parsing is balance. + true if the parsing is balance; otherwise, false. + The balancing mode. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parsing is balance. + true if the parsing is balance; otherwise, false. + The balancing mode. + The left parse. + The right parse. + The start of the mode. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Builds a specified span. + The span to build. + The start location to build the span. + The content of the span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Configures the span. + The configuration. + + + Configures the span. + The configuration. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current location of the current instance. + The current location of the current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current symbol of this instance. + The current symbol of this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the tokenizer is in the end of file. + true if the tokenizer is in the end of file; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether to ensure the current parser. + true if to ensure the current parser; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the expected token with the given type. + The type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the expected token with the given types. + The types. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Handles the embedded transition. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a specified span. + The span to initialize. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether this instance is at embedded transition. + true if this instance is at embedded transition; otherwise, false. + true to allow templates and comments; otherwise, false. + true to allow transitions; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the language used for parsing. + The language used for parsing. + + + Determines whether the token with the given condition would pass. + true if the token with the given condition would pass; otherwise, false. + The condition. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the token with the given type would pass. + true if the token with the give type would pass; otherwise, false. + The type of the token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the token with the given types would pass. + true if the token with the given types would pass; otherwise, false. + The types. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the parser advances to the next token. + true if the parser advances to the next token; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether parsing a token with the given type is optional. + true if parsing a token with the given type is optional; otherwise, false. + The type of the token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether parsing a token with the given type is optional. + true if parsing a token with the given type is optional; otherwise, false. + The type of the token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Outputs a token with accepted characters. + The accepted characters. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Outputs a token with span kind. + The span kind. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Outputs a token with a given span kind and accepted characters. + The span kind. + The accepted characters. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Outputs a span before the razor comment. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code..Gets the previous symbol of this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Pushes the span configuration. + An that shuts down the configuration. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Pushes the span configuration. + An that shuts down the configuration. + The new configuration. + + + Pushes the span configuration. + An that shuts down the configuration. + The new configuration. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts the transition back. + The symbols. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts the transition back. + The symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts the current transition back. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Displays the razor comment. + + + Reads a token while the condition is not reached. + The token to read. + The condition. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the expected token is required. + true if the expected token is required; otherwise, false. + The expected token. + true to display an error if not found; otherwise, false. + The error base. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the associated with this instance. + The associated with this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the span configuration. + The span configuration. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the tokenizer. + The tokenizer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the token with the given type was parsed. + true if the token with the given type was parsed; otherwise, false. + The type of the token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a Visual Basic code parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts spaces in the VB code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Checks for a condition and displays a keyword in the code. + The keyword. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Asserts the given directive. + The directive to assert. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the directive is ‘AT’ directive. + true if the directive is an ‘AT’ directive; otherwise, false. + The directive. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the given keyword is ‘AT’. + true if the given keyword is ‘AT’; otherwise, false. + The keyword. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Ends a terminated directive. + The function that ends the terminated directive. + The directive. + The block type. + The code generator. + true to allow markup; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the termination of directive body is ended. + true if the termination of directive body is ended; otherwise, false. + The directive. + The block start. + true to allow all transitions; otherwise, false. + + + Ends a termination of statement. + The function that ends the termination. + The keyword. + true if the termination supports exit; otherwise, false. + true if the termination supports continue; otherwise, false. + + + Ends a termination of statement. + The function that ends the termination. + The keyword. + true if the termination supports exit; otherwise, false. + true if the termination supports continue; otherwise, false. + The block name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Handles the embedded transition. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Handles the embedded transition. + The last white space. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the code that handles the Exit or Continue keyword. + The keyword. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a code that handles a transition. + The last white space. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the code is a helper directive. + true if the code is a helper directive; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code imports a statement. + true if the code imports a statement; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code inherits a statement. + true if the code inherits a statement; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is at embedded transition. + true if the code is at embedded transition; otherwise, false. + true to allow templates and comments; otherwise, false. + true to allow transitions; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is directive defined. + true if the code is directive defined; otherwise, false. + The directive. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the keywords associated with the code. + The keywords associated with the code. + + + Indicates a keyword that terminates a statement. + The function that terminates the statement. + The start. + The terminator. + true if the termination supports exit; otherwise, false. + true if the termination supports continue; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the language for the parser. + The language for the parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is a layout directive. + true if the code is a layout directive; otherwise, false. + + + Maps a given directive. + The directive. + The action whether to map a given directive. + + + Maps a given keyword. + The keyword. + The action whether to map a given keyword. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a nested block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the keyword from the code is optional. + true if the keyword from the code is optional; otherwise, false. + The keyword. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is an option statement. + true if the code is an option statement; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the other parser. + The other parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the parser block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the parser block. + The start sequence. + The end sequence. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Spans the output before Razor comment. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Blocks the parsing. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads a list of Visual Basic spaces. + A list of Visual Basic spaces. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the expected symbol is required. + true if the expected symbol is required; otherwise, false. + The expected symbol. + The error base. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is a reserved word. + true if the code is a reserved word; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code is a section directive. + true if the code is a section directive; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the code has a session state directive. + true if the code has a session state directive; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the characteristics of the Visual Basic language. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a Visual Basic marker symbol. + The created Visual Basic marker symbol. + The location to create the symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a Visual Basic symbol. + The created . + The location to create the symbol. + The content. + The type of the symbol. + The errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a Visual Basic tokenizer. + The created . + The source where to create the tokenizer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Flips the given bracket. + The type of the Visual Basic symbol. + The bracket to flip. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the type of the known symbol. + The type of the known symbol. + The type to retrieve. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a sample symbol with the given type. + A sample symbol with the given type. + The type of the symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets an instance of this . + An instance of . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the auto-complete editing handler class. + + + Initializes a new instance of the class. + The tokenizer. + + + Initializes a new instance of the class. + The tokenizer. + The accepted characters. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the auto-complete function is at the end of this span. + true if the auto-complete function is at the end of this span; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a string value to auto-complete. + A string value to auto-complete. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a parse result that can accept changes. + The phase of the target. + The normalized . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether this instance and a specified object are equal. + true if and this instance are the same type and represent the same value; otherwise, false. + The object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. + A 32-bit signed integer that is the hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the fully qualified type name of this instance. + A String containing a fully qualified type name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the block for creating webpages. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The source for the block builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the parser visitor of the block. + The parser visitor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a collection of SyntaxTreeNode to view the children of the block. + A collection of SyntaxTreeNode to view the children of the block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the IBlockCodeGenerator to generate codes for the elements. + The IBlockCodeGenerator to generate codes for the elements. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current block. + true if the specified object is equal to the current block; otherwise, false. + The object to compare with the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a value indicating whether the block is equivalent to the same element. + true if the block is equivalent to the same element; otherwise, false. + The syntax tree node. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Finds the first descendent span of the block. + The first descendent span of the block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Finds the last descendent span of the block. + The last descendent span of the block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Flattens a collection of a specified type for the block. + A collection of a specified type for the block to flatten. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. + The hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the object is a block-level object. + true if the object is a block-level object; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the length value of the block. + The length value of the block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Locates the owner of the block. + The owner of the block to locate. + The text change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the string name of the block. + The string name of the block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the start to identify the specific location of the block. + The start to identify the specific location of the block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string that represents the current object. + A string that represents the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the type of code block. + The type of code block. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the block builder for the webpages. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The original block builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Builds a block for this instance. + A block builds for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the collection of child elements of the block builder. + The collection of child elements of the block builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the code generator for the block builder. + The code generator for the block builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the string name for the block builder. + The string name for the block builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Resets the block builder to its original position. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a block type that can be assigned null. + A block type that can be assigned null. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a parsing error in Razor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The error message. + The absolute index of the source location. + The line index of the source location. + The column index of the source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The error message. + The absolute index of the source location. + The line index of the source location. + The column index of the source location. + The length for the error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The error message. + The source location of the error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The error message. + The source location of the error. + The length for the error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. + true if the specified object is equal to this instance; otherwise, false. + The object to compare to this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this instance. + true if the specified object is equal to this instance; otherwise, false. + The object to compare to this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for the current instance. + The hash code for the current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the length for the error. + The length for the error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the source location of the error. + The source location of the error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the error message. + The error message. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation of this error instance. + The string representation of this error instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Represents a Razor parse tree node that contains the all the content of a block node. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The builder to use for this span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Accepts visit from the specified visitor. + The object that performs the visit. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Changes the span builder for this span. + A delegate that will be executed along with this change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Sets the start character location of this span. + The new start location to set for this span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the code generator for the span. + The code generator for the span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the content of the span. + The content of the span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the handler for span edits. + The handler for span edits. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified object is equal to this span. + true if the specified object is equal to this span; otherwise, false. + The object to compare to this span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Determines whether the specified node is equivalent to this span. + true if the specified node is equal to this span; otherwise, false. + The node to compare with this span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the hash code for this current span. + The hash code for this current span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets a value that indicates whether this node is a block node. + false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the kind for this span. + One of the values of the enumeration. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the length of the span content. + The length of the span content. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the next span in the tree node. + The next span in the tree node. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the previous span in the tree node. + The previous span in the tree node. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Replaces the span builder for this span with the specified span builder. + The new builder to use for this span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the start character location of the span. + The start character location of the span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the symbols used to generate the code for the span. + The symbols used to generate the code for the span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the string representation of this current span. + The string representation of this current span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the span builder for the syntax tree. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The original span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the given symbol for the span builder. + The symbol builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Builds a span builder for this instance. + A span builder for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Clears the symbols of the span builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the span code generator. + The span code generator. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the span edit handler of the builder. + The span edit handler of the builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the span kind of the span builder. + The span kind of the span builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Resets the span builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the source location of the span builder. + The source location of the span builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the symbols for a generic read-only collection. + The symbols for a generic read-only collection. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the node for the syntax tree. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the visitor of the tree node. + The parser visitor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the syntax tree node is equivalent to given node. + true the syntax tree node is equivalent to given node; false. + The given node. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the syntax tree node is a block-level object. + true if the syntax tree node is a block-level object; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the length of the syntax tree node. + The length of the syntax tree node. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the parent tree node of the current tree node. + The parent tree node of the current tree node. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the specific source location for the syntax tree node. + The specific source location for the syntax tree node. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Provides a lookahead buffer for the text reader. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The text reader for the buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Begins the lookahead buffering operation for this . + A disposable action that ends the lookahead buffering. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Discards the backtrack context associated the lookahead buffering operation. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets the current character in the buffer. + The current character in the buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Gets or sets the current location of the character in the buffer. + The current location of the character in the buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Releases the unmanaged resources used by the current instance of this class, and optionally releases the managed resources. + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Reads the next character from the text reader and appends it to the lookahead buffer. + true if a character was read from the text reader; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Advances the buffer position to the next character. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the current character in the buffer. + The current character in the buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Returns the current character from the buffer and advances the buffer position to the next character. + The current character from the buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a location tagged. + The type of the location tagged. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The value of the source. + The offset. + The line. + The column location of the source. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The value of the source. + The location of the source. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for the current instance. + The hash code for the current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the location of the source. + The location of the source. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two object are equal. + true if the two object are equal; otherwise, false. + The first object to compare. + The second object to compare. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Converts the specified value to a object. + true if successfully converted; otherwise, false. + The value to convert. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two object are not equal. + true if the two object are not equal; otherwise, false. + The first object to compare. + The second objet to compare. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the current instance. + The string that represents the current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the current instance. + A string that represents the current instance. + The format. + The format provider. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the value of the source. + The value of the source. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the token to look for the razor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The action to cancel. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the token. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases the resources used by the current instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases the unmanaged resources used by the and optionally releases the managed resources. + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a reader + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The source reader. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The string content. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The text buffering. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the length of the text to read. + The length of the text to read. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the source of location for the text reader. + The source of location for the text reader. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads the next character without changing the state of the reader or the character source. + An integer representing the next character to be read. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the position to seek the text reader. + The position to seek the text reader. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads the next character from the text reader and advances the character position by one character. + The next character from the text reader, or -1 if no more characters are available. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The absolute index. + The line index. + The character index. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the absolute index for the source location. + The absolute index for the source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds the two object. + The sum of the two object. + The first object to add. + The second object to add. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Advances the specified object to the given location. + The source location. + The location where to advance the object. + The text that advances to the given location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the character index for the source location. + The character index for the source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Compares current object to the other object. + The value of the objects compared. + The object to compare. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the current object is equal to the other object. + true if the current object is equal to the other object; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. + The hash code for this instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the line index for the source location. + The line index for the source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds the two object. + The that is the sum of the two object. + The object to add. + The object to add. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two objects are equal. + true if the two objects are equal; otherwise, false. + The first object to compare. + The second object to compare. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the first object is greater than the second object. + true if the first object is greater than the second object; otherwise, false. + The first object. + The second object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two object are not equal. + true if the two objects are not equal; otherwise, false. + The object to compare. + The object to compare. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the first object is less than the second object. + true if the first object is greater than the second object; otherwise, false. + The first object. + The second object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + Returns . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Subtracts the first object to the second object. + The difference of the two objects. + The first object. + The second object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the source location. + A string representation of the source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides a source location tracker. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The current location of the source. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Calculates the new location of the source. + The new source location. + The last position. + The new content. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the current location of the source. + The current location of the source. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Updates the source location. + The character to read. + The character to update. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Updates the location of the source. + The object. + The content of the source. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides a reader for text buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The text buffer to read. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Begins reading the current text buffer. + An instance that stops the text buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Cancels backtrack. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current location of the text buffer. + The current location of the text buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Releases the unmanaged resources used by the class and optionally releases the managed resources. + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the next text buffer to read. + The next text buffer to read. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads the current text buffer. + The current text buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Describes a text change operation. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The position of the text change in the snapshot immediately before the change. + The length of the old text. + An old text buffer. + The position of the text change in the snapshot immediately after the change. + The length of the new text. + A new text buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Applies the specified text change. + A string that contains the value of the text. + The content of the text. + The change offset. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Applies the specified text change. + A string that contains the value of the text. + The span of the text change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the hash code for this text change. + The hash code for this text change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether this text change is a delete. + true if this text change is a delete; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether this text change is an insert. + true if this text change is an insert; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether this text change is a replace. + true if this text change is a replace; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a new text buffer. + A new text buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the length of the new text. + The length of the new text. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the position of the text change in the snapshot immediately after the change. + The position of the text change in the snapshot immediately after the change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the text that replaced the old text. + The text that replaced the old text. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a normalized value of this text change. + A normalized value of this text change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets an old text buffer. + An old text buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the length of the old text. + The length of the old text. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the position of the text change in the snapshot immediately before the change. + The position of the text change in the snapshot immediately before the change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the text that was replaced. + The text that was replaced. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two text change are equal. + true if the two text change are equal; otherwise, false. + The left text change. + The right text change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two text change are not equal. + true if the two text change are not equal; otherwise, false. + The left text change. + The right text change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the text change. + A string representation of the text change. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides reader for text document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The source to read. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the length of the document. + The length of the document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the location of the document. + The location of the document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the next text document to read. + The next text document to read. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the position of the text document. + The position of the text document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads a specified text document. + The text document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides helper functions for the CSharp tokenizer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified character can be used for identifier. + true if the specified character can be used for identifier; otherwise, false. + The character to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified character can be used as an identifier start character. + true if the specified character can be used as an identifier start character; otherwise, false. + The character to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified character is a literal suffix for real numbers. + true if the specified character is a literal suffix for real numbers; otherwise, false. + The character to check. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a CSharp tokenizer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The source. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a CSharp tokenizer symbol. + A CSharp tokenizer symbol. + The beginning of the source location. + The contents. + The CSharp symbol type. + A collection of razor errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the star type of the . + The star type of the . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the razor comment transition type for the . + The razor comment transition type for the . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the razor comment type for the . + The razor comment type for the . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the state of the machine. + The state of the machine. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the html tokenizer of the razor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The source for the text document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a symbol for the specified parameters of the html tokenizer. + A symbol to create for the specified parameters of the html tokenizer. + The source location. + The content string. + The type of html symbol. + The razor errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the html symbols for the razor comment star type. + The html symbols for the razor comment star type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the html symbols for the razor comment transition type. + The html symbols for the razor comment transition type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the html symbols for the razor comment type. + The html symbols for the razor comment type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the start of the state machine for the html. + The start of the state machine for the html. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The type for the language symbol. + The enumeration type for the language symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The source. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a result after the razor comment transition. + The result. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the lookahead buffer contains the expected string. + true if the lookahead buffer contains the expected string; otherwise, false. + The string to check. + true to indicate comparison is case sensitive; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the buffer for the tokenizer. + The buffer for the tokenizer. + + + Returns a function delegate, that accepts a character parameter and returns a value that indicates whether the character parameter is equal to specified character or white space. + A function delegate. + The character used to compare. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a language symbol type for the tokenizer with the specified content. + A language symbol type for the tokenizer. + The start of the source location. + The content value. + The symbol type. + The razor error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current character in the tokenizer. + The current character. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a list of the current razor errors. + A list of the current errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current source location. + The current source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current start of the source location. + The current start of the source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value whether the tokenizer current location is at the end of the file. + true if the tokenizer current location is at the end of the file; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the language end symbol type used by the tokenizer. + The language end symbol type. + The start of the source location. + The enumeration type for the language symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the language end symbol type used by the tokenizer. + The language end symbol type. + The enumeration type for the language symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value whether the tokenizer have content. + true if the tokenizer have content; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads to the next character from the code reader. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Shows the next symbol to be used. + The next symbol to be used. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Reads the next symbol in the code. + The next symbol to read. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Parses the Razor comment body. + The object that represent the state of the result. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the star type for the razor comment. + The star type for the razor comment. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the transition type for the razor comment. + The transition type for the razor comment. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the type of razor comment. + The type of razor comment. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Sets the tokenizer status to its initial state. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Resumes using the previous language symbol type. + The previous language symbol type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Uses a single type of symbol. + A single type of symbol. + The type of symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the source of the text document. + The source of the source document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the start symbol used in this class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the next language symbol type. + The next language symbol type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Takes the string if found in the lookahead buffer into the tokenizer buffer. + true if the lookahead buffer contains the expected string; otherwise, false. + The string to match. + true to indicate comparison is case sensitive; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the current character into the buffer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Accepts the given input string into the buffer. + true if the whole input string was accepted; false, if only a substring was accepted. + The input string. + true to indicate comparison is case sensitive; otherwise, false. + + + Parses the source document until the condition specified by predicate is met or end file is reached. + true if the predicate condition is met; false if end of file is reached. + The predicate that specifies the processing condition. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the specified parameters for the tokenizer view. + The type tokenizer. + The type symbol. + The token symbol type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The tokenizer view. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the current view of the TSymbol. + The current view of the TSymbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the view can reach the end of a file. + true if the view can reach the end of a file; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the tokenizer moves to the next view. + true if the tokenizer moves to the next view; false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts a specified symbol into the tokenizer view. + The symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the source of the text document for the tokenizer view. + The source of the text document for the tokenizer view. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the tokenizer to view the symbols for the razor. + The tokenizer to view the symbols for the razor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a set of characters as helpers in VB. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether a specified character is enclosed in double quotation marks ("). + true if the character is enclosed in double quotation marks ("); otherwise, false. + The character. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether a character is in octal digit. + true if a character is in octal digit; otherwise, false. + The character. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether a specified character is enclosed in a single quotation mark ('). + true if the character is enclosed in a single quotation mark ('); otherwise, false. + The character. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Allows an application to break a VB symbol into tokens. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The source of text. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a domain of symbols. + A domain of symbols. + The source location. + The content value. + The . + The razor error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the VB symbol type. + The VB symbol type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the transition style of the VB symbol. + The transition style of the VB symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the razor type comment of the . + The razor type comment of the . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the start state of the machine. + The start state of the machine. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a C sharp symbol for the razor tokenizer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The symbol’s offset. + The line. + The column + The content of the symbol. + The type of the symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The symbol’s offset. + The line. + The column + The content of the symbol. + The type of the symbol. + A list of errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The location to start the symbol. + The content of the symbol. + The type of the symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The location to start the symbol. + The content of the symbol. + The type of the symbol. + A list of errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the symbol has an escaped identifier. + true if the symbol has an escaped identifier; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this current instance. + The hash code for this current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the language keyword. + The language keyword. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the Html symbols. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The location of the symbol. + The exact line the symbol is found. + The column number the symbol is found. + The content value. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The location of the symbol. + The exact line the symbol is found. + The column number the symbol is found. + The content value. + The . + The razor error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The start of the source location. + The content value. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The start of the source location. + The content value. + The . + The razor error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents an interface for the web razor symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Changes the location of the symbol. + The new location of the symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the content of the symbol. + The content of the symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the starting offset of the symbol. + The location where to start the document. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the location of the symbol. + The location of the symbol. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a new instance of symbols. + The generic type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The source location. + The content value. + The type. + The razor error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Changes the start of the machine. + The new start. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the content of a . + The content of a . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified Object is equal to the current Object. + true if the specified Object is equal to the current Object; otherwise, false. + The object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the razor error. + The razor error. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves a hash code based on the current object. + A hash of the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Starts the time’s offset for the source location. + The document start. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the starting point of the source location. + The starting point of the source location. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates a string representation of the current object. + A string representation of the current object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a Type that inherits from the base Type. + A Type that inherits from the base Type. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the symbol extensions for the web tokenizer. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the content of this class. + The content of this class. + The symbols to provide. + The starting index of the span. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the content of this class. + The content of this class. + The intersection with the given span. + + + Gets the content of this class. + The content of this class. + The intersection with the given span. + A list of chosen symbols. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the content of this class. + The content of this class. + The provided symbols. + + + Enumerates the list of Visual Basic keywords. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the VB symbol components. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The offset value. + The line value. + The column value. + The content String value. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The offset value. + The line value. + The column value. + The content String value. + The . + List of razor errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The start of the source location. + The content String value. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The start of the source location. + The content String value. + The . + List of razor errors. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether the current object is equal to the new object. + true if the current object is equal to the new object; otherwise, false. + The object to compare. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this instance. + The hash code to return. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the specified data sample from the object. + The specified data sample from the object. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the keyword used in the VB. + The keyword used. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + \ No newline at end of file diff --git a/lib/aspnetmvc/System.Web.WebPages.Deployment.xml b/lib/aspnetmvc/System.Web.WebPages.Deployment.xml index 221c0785e2d..7dc960bc04d 100644 --- a/lib/aspnetmvc/System.Web.WebPages.Deployment.xml +++ b/lib/aspnetmvc/System.Web.WebPages.Deployment.xml @@ -1,60 +1,60 @@ - - - - System.Web.WebPages.Deployment - - - - Provides a registration point for pre-application start code for Web Pages deployment. - - - Registers pre-application start code for Web Pages deployment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides methods that are used to get deployment information about the Web application. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the assembly path for the Web Pages deployment. - The assembly path for the Web Pages deployment. - The Web Pages version. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the Web Pages version from the given binary path. - The Web Pages version. - The binary path for the Web Pages. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the assembly references from the given path regardless of the Web Pages version. - The dictionary containing the assembly references of the Web Pages and its version. - The path to the Web Pages application. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the maximum version of the Web Pages loaded assemblies. - The maximum version of the Web Pages loaded assemblies. - - - Gets the Web Pages version from the given path. - The Web Pages version. - The path of the root directory for the application. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the Web Pages version using the configuration settings with the specified path. - The Web Pages version. - The path to the application settings. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the assemblies for this Web Pages deployment. - A list containing the assemblies for this Web Pages deployment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the Web Pages deployment is enabled. - true if the Web Pages deployment is enabled; otherwise, false. - The path to the Web Pages deployment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the Web Pages deployment is explicitly disabled. - true if the Web Pages deployment is explicitly disabled; otherwise, false. - The path to the Web Pages deployment. - - + + + + System.Web.WebPages.Deployment + + + + Provides a registration point for pre-application start code for Web Pages deployment. + + + Registers pre-application start code for Web Pages deployment. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides methods that are used to get deployment information about the Web application. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the assembly path for the Web Pages deployment. + The assembly path for the Web Pages deployment. + The Web Pages version. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the Web Pages version from the given binary path. + The Web Pages version. + The binary path for the Web Pages. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the assembly references from the given path regardless of the Web Pages version. + The dictionary containing the assembly references of the Web Pages and its version. + The path to the Web Pages application. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the maximum version of the Web Pages loaded assemblies. + The maximum version of the Web Pages loaded assemblies. + + + Gets the Web Pages version from the given path. + The Web Pages version. + The path of the root directory for the application. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the Web Pages version using the configuration settings with the specified path. + The Web Pages version. + The path to the application settings. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the assemblies for this Web Pages deployment. + A list containing the assemblies for this Web Pages deployment. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the Web Pages deployment is enabled. + true if the Web Pages deployment is enabled; otherwise, false. + The path to the Web Pages deployment. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the Web Pages deployment is explicitly disabled. + true if the Web Pages deployment is explicitly disabled; otherwise, false. + The path to the Web Pages deployment. + + \ No newline at end of file diff --git a/lib/aspnetmvc/System.Web.WebPages.Razor.xml b/lib/aspnetmvc/System.Web.WebPages.Razor.xml index 60cc787569f..bf6455588bc 100644 --- a/lib/aspnetmvc/System.Web.WebPages.Razor.xml +++ b/lib/aspnetmvc/System.Web.WebPages.Razor.xml @@ -1,292 +1,292 @@ - - - - System.Web.WebPages.Razor - - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the base class for the compiling path that contains event data. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The string of virtual path. - The host for the webpage razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the host for the webpage razor. - The host for the webpage razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the virtual path for the webpage. - The virtual path for the webpage. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a build provider for Razor. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds a virtual path dependency to the collection. - A virtual path dependency to add. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the assembly builder for Razor environment. - The assembly builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the compiler settings for Razor environment. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Occurs when code generation is completed. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Occurs when code generation is started. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Occurs when compiling with a new virtual path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a Razor engine host instance base on web configuration. - A Razor engine host instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the code using the provided assembly builder. - The assembly builder. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the type of the generated code. - The type of the generated code. - The results of the code compilation. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates the Razor engine host instance based on the web configuration. - The Razor engine host instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Opens an internal text reader. - An internal text reader. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Raises the CompilingPath event. - The data provided for the CompilingPath event. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the virtual path of the source code. - The virtual path of the source code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the collection of virtual path for the dependencies. - The collection of virtual path for the dependencies. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a web code razor host for the web pages. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The virtual path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The virtual path. - The physical path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the class name of this instance. - The class name of this instance. - The virtual path. - - - Generates a post process code for the web code razor host. - The generator code context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the razor hosts in a webpage. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class with the specified virtual file path. - The virtual file path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class with the specified virtual and physical file path. - The virtual file path. - The physical file path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds a global import on the webpage. - The notification service name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the . - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a markup parser. - A markup parser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value for the DefaultBaseClass. - A value for the DefaultBaseClass. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the default class. - The name of the default class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the debug compilation is set to default. - true if the debug compilation is set to default; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the base class of the default page. - The base class of the default page. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the name of the class to which the specified webpage belongs. - The name of the class to which the specified webpage belongs. - The virtual file path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the code language specified in the webpage. - The code language specified in the webpage. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the global imports for the webpage. - The global imports for the webpage. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the file path of the instrumental source. - The file path of the instrumental source. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the webpage is a special page. - true if the webpage is a special page; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the physical file system path of the razor host. - They physical file system path of the razor host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the generated code after the process. - The . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Registers the special file with the specified file name and base type name. - The file name. - The base type name. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Registers the special file with the specified file name and base type. - The file name. - The type of base file. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the virtual file path. - The virtual file path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates instances of the host files. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Loads the service description information from the configuration file and applies it to the host. - The configuration. - The webpage razor host. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a default host with the specified virtual path. - A default host. - The virtual path of the file. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a default host with the specified virtual and physical path. - A default host. - The virtual path of the file. - The physical file system path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a Razor host. - A razor host. - The virtual path to the target file. - The physical path to the target file. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a host from the configuration. - A host from the configuration. - The virtual path to the target file. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a host from the configuration. - A host from the configuration. - The virtual path of the file. - The physical file system path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a host from the configuration. - A host from the configuration. - The configuration. - The virtual path of the file. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a host from the configuration. - A host from the configuration. - The configuration. - The virtual path of the file. - The physical file system path. - - - Provides configuration system support for the host configuration section. - - - Initializes a new instance of the class. - - - Gets or sets the host factory. - The host factory. - - - Represents the name of the configuration section for a Razor host environment. - - - Provides configuration system support for the pages configuration section. - - - Initializes a new instance of the class. - - - Gets or sets the collection of namespaces to add to Web Pages pages in the current application. - The collection of namespaces. - - - Gets or sets the name of the page base type class. - The name of the page base type class. - - - Represents the name of the configuration section for Razor pages. - - - Provides configuration system support for the system.web.webPages.razor configuration section. - - - Initializes a new instance of the class. - - - Represents the name of the configuration section for Razor Web section. Contains the static, read-only string "system.web.webPages.razor". - - - Gets or sets the host value for system.web.webPages.razor section group. - The host value. - - - Gets or sets the value of the pages element for the system.web.webPages.razor section. - The pages element value. - - + + + + System.Web.WebPages.Razor + + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the base class for the compiling path that contains event data. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The string of virtual path. + The host for the webpage razor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the host for the webpage razor. + The host for the webpage razor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the virtual path for the webpage. + The virtual path for the webpage. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a build provider for Razor. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds a virtual path dependency to the collection. + A virtual path dependency to add. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the assembly builder for Razor environment. + The assembly builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the compiler settings for Razor environment. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Occurs when code generation is completed. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Occurs when code generation is started. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Occurs when compiling with a new virtual path. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a Razor engine host instance base on web configuration. + A Razor engine host instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates the code using the provided assembly builder. + The assembly builder. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the type of the generated code. + The type of the generated code. + The results of the code compilation. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates the Razor engine host instance based on the web configuration. + The Razor engine host instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Opens an internal text reader. + An internal text reader. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Raises the CompilingPath event. + The data provided for the CompilingPath event. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the virtual path of the source code. + The virtual path of the source code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the collection of virtual path for the dependencies. + The collection of virtual path for the dependencies. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a web code razor host for the web pages. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The virtual path. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The virtual path. + The physical path. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the class name of this instance. + The class name of this instance. + The virtual path. + + + Generates a post process code for the web code razor host. + The generator code context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the razor hosts in a webpage. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class with the specified virtual file path. + The virtual file path. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class with the specified virtual and physical file path. + The virtual file path. + The physical file path. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds a global import on the webpage. + The notification service name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the . + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a markup parser. + A markup parser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value for the DefaultBaseClass. + A value for the DefaultBaseClass. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the name of the default class. + The name of the default class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the debug compilation is set to default. + true if the debug compilation is set to default; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the base class of the default page. + The base class of the default page. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the name of the class to which the specified webpage belongs. + The name of the class to which the specified webpage belongs. + The virtual file path. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the code language specified in the webpage. + The code language specified in the webpage. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the global imports for the webpage. + The global imports for the webpage. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the file path of the instrumental source. + The file path of the instrumental source. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value that indicates whether the webpage is a special page. + true if the webpage is a special page; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the physical file system path of the razor host. + They physical file system path of the razor host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the generated code after the process. + The . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Registers the special file with the specified file name and base type name. + The file name. + The base type name. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Registers the special file with the specified file name and base type. + The file name. + The type of base file. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the virtual file path. + The virtual file path. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates instances of the host files. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Loads the service description information from the configuration file and applies it to the host. + The configuration. + The webpage razor host. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a default host with the specified virtual path. + A default host. + The virtual path of the file. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a default host with the specified virtual and physical path. + A default host. + The virtual path of the file. + The physical file system path. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a Razor host. + A razor host. + The virtual path to the target file. + The physical path to the target file. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a host from the configuration. + A host from the configuration. + The virtual path to the target file. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a host from the configuration. + A host from the configuration. + The virtual path of the file. + The physical file system path. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a host from the configuration. + A host from the configuration. + The configuration. + The virtual path of the file. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Creates a host from the configuration. + A host from the configuration. + The configuration. + The virtual path of the file. + The physical file system path. + + + Provides configuration system support for the host configuration section. + + + Initializes a new instance of the class. + + + Gets or sets the host factory. + The host factory. + + + Represents the name of the configuration section for a Razor host environment. + + + Provides configuration system support for the pages configuration section. + + + Initializes a new instance of the class. + + + Gets or sets the collection of namespaces to add to Web Pages pages in the current application. + The collection of namespaces. + + + Gets or sets the name of the page base type class. + The name of the page base type class. + + + Represents the name of the configuration section for Razor pages. + + + Provides configuration system support for the system.web.webPages.razor configuration section. + + + Initializes a new instance of the class. + + + Represents the name of the configuration section for Razor Web section. Contains the static, read-only string "system.web.webPages.razor". + + + Gets or sets the host value for system.web.webPages.razor section group. + The host value. + + + Gets or sets the value of the pages element for the system.web.webPages.razor section. + The pages element value. + + \ No newline at end of file diff --git a/lib/aspnetmvc/System.Web.WebPages.xml b/lib/aspnetmvc/System.Web.WebPages.xml index a394054e979..84699ef2ee0 100644 --- a/lib/aspnetmvc/System.Web.WebPages.xml +++ b/lib/aspnetmvc/System.Web.WebPages.xml @@ -1,2706 +1,2706 @@ - - - - System.Web.WebPages - - - - Helps prevent malicious scripts from submitting forged page requests. - - - Adds an authenticating token to a form to help protect against request forgery. - Returns a string that contains the encrypted token value in a hidden HTML field. - The current object is null. - - - Adds an authenticating token to a form to help protect against request forgery and lets callers specify authentication details. - Returns the encrypted token value in a hidden HTML field. - The HTTP context data for a request. - An optional string of random characters (such as Z*7g1&p4) that is used to add complexity to the encryption for extra safety. The default is null. - The domain of a web application that a request is submitted from. - The virtual root path of a web application that a request is submitted from. - - is null. - - - Gets the search tokens. - The previous cookie token. - The new cookie token. - The form of the token. - - - Validates that input data from an HTML form field comes from the user who submitted the data. - The current value is null. - The HTTP cookie token that accompanies a valid request is missing-or-The form token is missing.-or-The form token value does not match the cookie token value.-or-The form token value does not match the cookie token value. - - - Validates that input data from an HTML form field comes from the user who submitted the data. - The cookie token value. - The token form. - - - Validates that input data from an HTML form field comes from the user who submitted the data and lets callers specify additional validation details. - The HTTP context data for a request. - An optional string of random characters (such as Z*7g1&p4) that is used to decrypt an authentication token created by the class. The default is null. - The current value is null. - The HTTP cookie token that accompanies a valid request is missing.-or-The form token is missing.-or-The form token value does not match the cookie token value.-or-The form token value does not match the cookie token value.-or-The value supplied does not match the value that was used to create the form token. - - - Provides programmatic configuration for the anti-forgery token system. - - - Gets a data provider that can provide additional data to put into all generated tokens and that can validate additional data in incoming tokens. - The data provider. - - - Gets or sets the name of the cookie that is used by the anti-forgery system. - The cookie name. - - - Gets or sets a value that indicates whether the anti-forgery cookie requires SSL in order to be returned to the server. - true if SSL is required to return the anti-forgery cookie to the server; otherwise, false. - - - Gets or sets a value that indicates whether the anti-forgery system should skip checking for conditions that might indicate misuse of the system. - true if the anti-forgery system should not check for possible misuse; otherwise, false. - - - Specifies whether to suppress the generation of X-Frame-Options header which is used to prevent ClickJacking. By default, the X-Frame-Options header is generated with the value SAMEORIGIN. If this setting is 'true', the X-Frame-Options header will not be generated for the response. - - - If claims-based authorization is in use, gets or sets the claim type from the identity that is used to uniquely identify the user. - The claim type. - - - Provides a way to include or validate custom data for anti-forgery tokens. - - - Provides additional data to store for the anti-forgery tokens that are generated during this request. - The supplemental data to embed in the anti-forgery token. - Information about the current request. - - - Validates additional data that was embedded inside an incoming anti-forgery token. - true if the data is valid, or false if the data is invalid. - Information about the current request. - The supplemental data that was embedded in the token. - - - Provides access to unvalidated form values in the object. - - - Gets a collection of unvalidated form values that were posted from the browser. - An unvalidated collection of form values. - - - Gets the specified unvalidated object from the collection of posted values in the object. - The specified member, or null if the specified item is not found. - - - Gets a collection of unvalidated query-string values. - A collection of unvalidated query-string values. - - - Excludes fields of the Request object from being checked for potentially unsafe HTML markup and client script. - - - Returns a version of form values, cookies, and query-string variables without checking them first for HTML markup and client script. - An object that contains unvalidated versions of the form and query-string values. - The object that contains values to exclude from request validation. - - - Returns a value from the specified form field, cookie, or query-string variable without checking it first for HTML markup and client script. - A string that contains unvalidated text from the specified field, cookie, or query-string value. - The object that contains values to exclude from validation. - The name of the field to exclude from validation. can refer to a form field, to a cookie, or to the query-string variable. - - - Returns all values from the Request object (including form fields, cookies, and the query string) without checking them first for HTML markup and client script. - An object that contains unvalidated versions of the form, cookie, and query-string values. - The object that contains values to exclude from validation. - - - Returns the specified value from the Request object without checking it first for HTML markup and client script. - A string that contains unvalidated text from the specified field, cookie, or query-string value. - The object that contains values to exclude from validation. - The name of the field to exclude from validation. can refer to a form field, to a cookie, or to the query-string variable. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The containing message. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The message. - The inner exception. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The error message. - The other. - - - - - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The error message. - The minimum value. - The maximum value. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. - The exception message. - The pattern. - - - Represents the remote rule for the validation of the model client. - - - Initializes a new instance of the class. - The error message. - The URL of the rule. - The HTTP method. - The additional fields used. - - - Represents the required rule for the validation of the model client. - - - Initializes a new instance of the class. - The error message - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a length of the validation rule of the model client. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The error message. - The minimum length of the validation rule. - The maximum length of the validation rule. - - - Contains classes and properties that are used to create HTML elements. This class is used to write helpers, such as those found in the namespace. - - - Creates a new tag that has the specified tag name. - The tag name without the "<", "/", or ">" delimiters. - - is null or empty. - - - Adds a CSS class to the list of CSS classes in the tag. - The CSS class to add. - - - Gets the collection of attributes. - The collection of attributes. - - - Replaces each invalid character in the tag ID with a valid HTML character. - The sanitized tag ID, or null if is null or empty, or if does not begin with a letter. - The ID that might contain characters to replace. - - - Replaces each invalid character in the tag ID with the specified replacement string. - The sanitized tag ID, or null if is null or empty, or if does not begin with a letter. - The ID that might contain characters to replace. - The replacement string. - - is null. - - - Generates a sanitized ID attribute for the tag by using the specified name. - The name to use to generate an ID attribute. - - - Gets or sets a string that can be used to replace invalid HTML characters. - The string to use to replace invalid HTML characters. - - - Gets or sets the inner HTML value for the element. - The inner HTML value for the element. - - - Adds a new attribute to the tag. - The key for the attribute. - The value of the attribute. - - - Adds a new attribute or optionally replaces an existing attribute in the opening tag. - The key for the attribute. - The value of the attribute. - true to replace an existing attribute if an attribute exists that has the specified value, or false to leave the original attribute unchanged. - - - Adds new attributes to the tag. - The collection of attributes to add. - The type of the key object. - The type of the value object. - - - Adds new attributes or optionally replaces existing attributes in the tag. - The collection of attributes to add or replace. - For each attribute in , true to replace the attribute if an attribute already exists that has the same key, or false to leave the original attribute unchanged. - The type of the key object. - The type of the value object. - - - Sets the property of the element to an HTML-encoded version of the specified string. - The string to HTML-encode. - - - Gets the tag name for this tag. - The name. - - - Renders the element as a element. - - - Renders the HTML tag by using the specified render mode. - The rendered HTML tag. - The render mode. - - - Enumerates the modes that are available for rendering HTML tags. - - - Represents the mode for rendering a closing tag (for example, </tag>). - - - Represents the mode for rendering normal text. - - - Represents the mode for rendering a self-closing tag (for example, <tag />). - - - Represents the mode for rendering an opening tag (for example, <tag>). - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the validation attributes from the structure or content of . - The to be implemented. - The result of the validation. - - - Contains methods to register assemblies as application parts. - - - Initializes a new instance of the class by using the specified assembly and root virtual path. - The assembly. - The root virtual path. - - is null or empty. - - - Resolves a path to the specified assembly or resource within an assembly by using the specified base virtual path and specified virtual path. - The path of the assembly or resource. - The assembly. - The base virtual path. - The virtual path. - - is not registered. - - - Adds an assembly and all web pages within the assembly to the list of available application parts. - The application part. - - is already registered. - - - Provides objects and methods that are used to execute and render ASP.NET Web Pages application start pages (_AppStart.cshtml or _AppStart.vbhtml files). - - - Initializes a new instance of the class. - - - Gets the HTTP application object that references this application startup page. - The HTTP application object that references this application startup page. - - - The prefix that is applied to all keys that are added to the cache by the application start page. - - - Gets the object that represents context data that is associated with this page. - The current context data. - - - Returns the text writer instance that is used to render the page. - The text writer. - - - Gets the output from the application start page as an HTML-encoded string. - The output from the application start page as an HTML-encoded string. - - - Gets the text writer for the page. - The text writer for the page. - - - The path to the application start page. - - - Gets or sets the virtual path of the page. - The virtual path. - - - Writes the string representation of the specified object as an HTML-encoded string. - The object to encode and write. - - - Writes the specified object as an HTML-encoded string. - The helper result to encode and write. - - - Writes the specified object without HTML encoding. - The object to write. - - - Stores the value for an attribute.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - Initializes a new instance of the class.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The namespace prefix for the attribute. - The value for the attribute. - true to indicate that the value is a literal value; otherwise, false. - - - Creates an attribute value from the specified tuple object. - The created attribute value. - The tuple object from which to create from. - - - Creates an attribute value from the specified tuple object. - The created attribute value. - The tuple object from which to create from. - - - Gets or sets a value that indicates whether the value is a literal value.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - true if the value is a literal value; otherwise, false. - - - Creates an attribute value from the specified tuple object. - The created attribute value. - The tuple object from which to create from. - - - Creates an attribute value from the specified tuple object. - The created attribute value. - The tuple object from which to create from. - - - Gets or sets the namespace prefix for the attribute.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The namespace prefix for the attribute. - - - Gets or set the value for the attribute.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The value for the attribute. - - - Provides a way to specify custom browser (user agent) information. - - - Removes any overridden user agent for the current request. - The current context. - - - Returns the browser capabilities object for the overridden browser capabilities or for the actual browser if no override has been specified. - The browser capabilities. - The current context. - - - Returns the overridden user agent value or the actual user agent string if no override has been specified. - The user agent string - The current context. - - - Gets a string that varies based on the type of the browser. - A string that identifies the browser. - The current context. - - - Gets a string that varies based on the type of the browser. - A string that identifies the browser. - The current context base. - - - Overrides the request's actual user agent value using the specified user agent. - The current context. - The user agent to use. - - - Overrides the request's actual user agent value using the specified browser override information. - The current context. - One of the enumeration values that represents the browser override information to use. - - - Specifies browser types that can be defined for the method. - - - Specifies a desktop browser. - - - Specifies a mobile browser. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.The current BrowserOverrideStore is used to get and set the user agent of a request. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Looks for a user agent by searching for the browser override cookie. - The user agent. - The HTTP context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds a browser override cookie with the set user agent to the response of the current request. - The HTTP context. - The user agent. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets overridden user agent for a request from a cookie. Creates a cookie to set the overridden user agent. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The days to expire. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Looks for a user agent by searching for the browser override cookie. - The user agent. - The HTTP context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds a browser override cookie with the set user agent to the response of the current request. - The HTTP context. - The user agent. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the default display mode of the web pages. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The suffix. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether the can handle context. - true if the can handle context; otherwise, false. - The specified http context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the context condition displays a default mode. - true if the context condition displays a default mode; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the display mode identifier of the web pages. - The display mode identifier of the web pages. - - - Retrieves the display information about an item in the result pane. - The display information about an item in the result pane. - The http context. - The virtual path. - true if the virtual path exists; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Transforms the path of the display mode. - The path of the display mode to transform. - The virtual path. - The suffix. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a property’s display information. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The virtual path. - The active display mode. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the active display mode for a Web page. - The active display mode for a Web page. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the virtual path of the current Web page. - The virtual path of the current Web page. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the modes of display for the provider. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default display mode identifier. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a list of the available display modes for the context base. - A list of the available display modes for the context base. - The http context base. - The current display mode. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the for the virtual path. - The for the virtual path. - The virtual path. - The http context base. - true if the virtual path exists; otherwise, false. - The current display mode. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the instance of the . - The instance of the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the mobile display mode identifier. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a list of modes of the . - A list of modes of the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the Web page requires consistent display mode. - true if the Web page requires consistent display mode; otherwise, false. - - - Represents a base class for pages that is used when ASP.NET compiles a .cshtml or .vbhtml file and that exposes page-level and application-level properties and methods. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - Gets the application-state data as a object that callers can use to create and access custom application-scoped properties. - The application-state data. - - - Gets a reference to global application-state data that can be shared across sessions and requests in an ASP.NET application. - The application-state data. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts all the helper statements into the context of the helper page. - The text writer. - The helper virtual path. - The starting position. - The length of the context. - true of the context has a literal attribute; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts all the helper statements into the context of the helper page. - The helper virtual path. - The starting position. - The length of the context. - true of the context has a literal attribute; otherwise, false. - - - Gets the cache object for the current application domain. - The cache object. - - - Gets the object that is associated with a page. - The current context data. - - - Gets the current page for this helper page. - The current page. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the end of context block. - The text writer. - The helper virtual path. - The starting position. - The length of the context. - true of the context has a literal attribute; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the end of context block. - The helper virtual path. - The starting position. - The length of the context. - true of the context has a literal attribute; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the path of the helper page. - The path of the helper page. - - - Builds an absolute URL from an application-relative URL by using the specified parameters. - The absolute URL. - The initial path to use in the URL. - Additional path information, such as folders and subfolders. - - - Gets the object that is associated with a page. - An object that supports rendering HTML form controls in a page. - - - Gets a value that indicates whether Ajax is being used during the request of the web page. - true if Ajax is being used during the request; otherwise, false. - - - Gets a value that indicates whether the current request is a post (submitted using the HTTP POST verb). - true if the HTTP verb is POST; otherwise, false. - - - Gets the model that is associated with a page. - An object that represents a model that is associated with the view data for a page. - - - Gets the state data for the model that is associated with a page. - The state of the model. - - - Gets property-like access to page data that is shared between pages, layout pages, and partial pages. - An object that contains page data. - - - Gets and sets the HTTP context for the web page. - The HTTP context for the web page. - - - Gets array-like access to page data that is shared between pages, layout pages, and partial pages. - An object that provides array-like access to page data. - - - Gets the object for the current HTTP request. - An object that contains the HTTP values that were sent by a client during a web request. - - - Gets the object for the current HTTP response. - An object that contains the HTTP-response information from an ASP.NET operation. - - - Gets the object that provides methods that can be used as part of web-page processing. - The object. - - - Gets the object for the current HTTP request. - The object for the current HTTP request. - - - Gets data related to the URL path. - Data related to the URL path. - - - Gets a user value based on the HTTP context. - A user value based on the HTTP context. - - - Gets the virtual path of the page. - The virtual path. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Writes an attribute associated with the helper. - The text writer. - The name of the attribute. - The prefix. - The suffix. - The attribute value. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Writes a literal object to the helper. - The text writer. - The value of the object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Writes a helper result object to the helper. - The text writer - The helper result. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Writes an object to the helper. - The text writer. - The object value. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Writes a helper result object to the helper. - The text writer. - The helper result value. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the display mode interface for the web pages. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether the web pages can handle HTTP context. - true if the web pages can handle HTTP context; otherwise, false. - The HTTP context. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the display mode id for the web pages. - The display mode id for the web pages. - - - Returns this method to display all the information for the web pages. - The method to display all the information for the web pages. - The HTTP context. - The virtual path. - true if the virtual path exists; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the properties and methods that objects that participate in webpages. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a container for client validation for the required field. - A container for client validation for the required field. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Evaluates the condition it checks and updates the validation context. - The condition it checks and updates the validation context. - The validation context. - - - Defines methods that are implemented by virtual path handler factories. - - - Creates a handler factory for the specified virtual path. - A handler factory for the specified virtual path. - The virtual path. - - - Determines whether the specified virtual path is associated with a handler factory. - true if a handler factory exists for the specified virtual path; otherwise, false. - The virtual path. - - - Defines methods to implement an executor class that can execute the code on a web page. - - - Executes the code on the specified web page. - true if the executor took over execution of the web page; otherwise, false. - The web page. - - - Represents a path attribute for a web page class. - - - Initializes a new instance of the class by using the specified virtual path. - The virtual path. - - - Gets the virtual path of the current web page. - The virtual path. - - - Provides a registration point for pre-application start code for web pages. - - - Registers pre-application start code for web pages. - - - Defines extension methods for the class. - - - Determines whether the specified URL references the local computer. - true if the specified URL references the local computer; otherwise, false. - The HTTP request object. - The URL to test. - - - Serves as the abstract base class for the validation helper classes. - - - Initializes a new instance of the derived class and specifies the name of the HTML element that is being validated. - The name (value of the name attribute) of the user input element to validate. - - - Initializes a new instance of the derived class, registers the specified string as the error message to display if no value is supplied, and specifies whether the method can use unvalidated data. - The error message. - true to use unvalidated user input; false to reject unvalidated data. This parameter is set to true by calling methods in circumstances when the actual value of the user input is not important, such as for required fields. - - - When implemented in a derived class, gets a container for client validation for the required field. - The container. - - - Returns the HTTP context of the current request. - The context. - The validation context. - - - Returns the value to validate. - The value to validate. - The current request. - The name of the field from the current request to validate. - - - Returns a value that indicates whether the specified value is valid. - true if the value is valid; otherwise, false. - The current context. - The value to validate. - - - Performs the validation test. - The result of the validation test. - The context. - - - Defines extension methods for the base class. - - - Configures the cache policy of an HTTP response instance. - The HTTP response instance. - The length of time, in seconds, before items expire from the cache. - true to indicate that items expire from the cache on a sliding basis; false to indicate that items expire when they reach the predefined expiration time. - The list of all parameters that can be received by a GET or POST operation that affect caching. - The list of all HTTP headers that affect caching. - The list of all Content-Encoding headers that affect caching. - One of the enumeration values that specifies how items are cached. - - - Sets the HTTP status code of an HTTP response using the specified integer value. - The HTTP response instance. - The HTTP status code. - - - Sets the HTTP status code of an HTTP response using the specified HTTP status code enumeration value. - The HTTP response instance. - The HTTP status code - - - Writes a sequence of bytes that represent binary content of an unspecified type to the output stream of an HTTP response. - The HTTP response instance. - An array that contains the bytes to write. - - - Writes a sequence of bytes that represent binary content of the specified MIME type to the output stream of an HTTP response. - The receiving HTTP response instance. - An array that contains the bytes to write. - The MIME type of the binary content. - - - Provides a delegate that represents one or more methods that are called when a content section is written. - - - Provides methods and properties that are used to render start pages that use the Razor view engine. - - - Initializes a new instance of the class. - - - Gets or sets the child page of the current start page. - The child page of the current start page. - - - Gets or sets the context of the page. - The context of the page. - - - Calls the methods that are used to execute the developer-written code in the _PageStart start page and in the page. - - - Returns the text writer instance that is used to render the page. - The text writer. - - - Returns the initialization page for the specified page. - The _AppStart page if the _AppStart page exists. If the _AppStart page cannot be found, returns the _PageStart page if a _PageStart page exists. If the _AppStart and _PageStart pages cannot be found, returns . - The page. - The file name of the page. - The collection of file-name extensions that can contain ASP.NET Razor syntax, such as "cshtml" and "vbhtml". - Either or are null. - - is null or empty. - - - Gets or sets the path of the layout page for the page. - The path of the layout page for the page. - - - Gets property-like access to page data that is shared between pages, layout pages, and partial pages. - An object that contains page data. - - - Gets array-like access to page data that is shared between pages, layout pages, and partial pages. - An object that provides array-like access to page data. - - - Renders the page. - The HTML markup that represents the web page. - The path of the page to render. - Additional data that is used to render the page. - - - Executes the developer-written code in the page. - - - Writes the string representation of the specified object as an HTML-encoded string. - The object to encode and write. - - - Writes the string representation of the specified object as an HTML-encoded string. - The helper result to encode and write. - - - Writes the string representation of the specified object without HTML encoding. - The object to write. - - - Provides utility methods for converting string values to other data types. - - - Converts a string to a strongly typed value of the specified data type. - The converted value. - The value to convert. - The data type to convert to. - - - Converts a string to the specified data type and specifies a default value. - The converted value. - The value to convert. - The value to return if is null. - The data type to convert to. - - - Converts a string to a Boolean (true/false) value. - The converted value. - The value to convert. - - - Converts a string to a Boolean (true/false) value and specifies a default value. - The converted value. - The value to convert. - The value to return if is null or is an invalid value. - - - Converts a string to a value. - The converted value. - The value to convert. - - - Converts a string to a value and specifies a default value. - The converted value. - The value to convert. - The value to return if is null or is an invalid value. The default is the minimum time value on the system. - - - Converts a string to a number. - The converted value. - The value to convert. - - - Converts a string to a number and specifies a default value. - The converted value. - The value to convert. - The value to return if is null or invalid. - - - Converts a string to a number. - The converted value. - The value to convert. - - - Converts a string to a number and specifies a default value. - The converted value. - The value to convert. - The value to return if is null. - - - Converts a string to an integer. - The converted value. - The value to convert. - - - Converts a string to an integer and specifies a default value. - The converted value. - The value to convert. - The value to return if is null or is an invalid value. - - - Checks whether a string can be converted to the specified data type. - true if can be converted to the specified type; otherwise, false. - The value to test. - The data type to convert to. - - - Checks whether a string can be converted to the Boolean (true/false) type. - true if can be converted to the specified type; otherwise, false. - The string value to test. - - - Checks whether a string can be converted to the type. - true if can be converted to the specified type; otherwise, false. - The string value to test. - - - Checks whether a string can be converted to the type. - true if can be converted to the specified type; otherwise, false. - The string value to test. - - - Checks whether a string value is null or empty. - true if is null or is a zero-length string (""); otherwise, false. - The string value to test. - - - Checks whether a string can be converted to the type. - true if can be converted to the specified type; otherwise, false. - The string value to test. - - - Checks whether a string can be converted to an integer. - true if can be converted to the specified type; otherwise, false. - The string value to test. - - - Contains methods and properties that describe a file information template. - - - Initializes a new instance of the class by using the specified virtual path. - The virtual path. - - - Gets the virtual path of the web page. - The virtual path. - - - Represents a last-in-first-out (LIFO) collection of template files. - - - Returns the current template file from the specified HTTP context. - The template file, removed from the top of the stack. - The HTTP context that contains the stack that stores the template files. - - - Removes and returns the template file that is at the top of the stack in the specified HTTP context. - The template file, removed from the top of the stack. - The HTTP context that contains the stack that stores the template files. - - is null. - - - Inserts a template file at the top of the stack in the specified HTTP context. - The HTTP context that contains the stack that stores the template files. - The template file to push onto the specified stack. - - or are null. - - - Implements validation for user input. - - - Registers a list of user input elements for validation. - The names (value of the name attribute) of the user input elements to validate. - The type of validation to register for each user input element specified in . - - - Registers a user input element for validation. - The name (value of the name attribute) of the user input element to validate. - A list of one or more types of validation to register. - - - Adds an error message. - The error message. - - - Renders an attribute that references the CSS style definition to use when validation messages for the user input element are rendered. - The attribute. - The name (value of the name attribute) of the user input element to validate. - - - Renders attributes that enable client-side validation for an individual user input element. - The attributes to render. - The name (value of the name attribute) of the user input element to validate. - - - Gets the name of the current form. This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The name. - - - Returns a list of current validation errors, and optionally lets you specify a list of fields to check. - The list of errors. - Optional. The names (value of the name attribute) of the user input elements to get error information for. You can specify any number of element names, separated by commas. If you do not specify a list of fields, the method returns errors for all fields. - - - Gets the name of the class that is used to specify the appearance of error-message display when errors have occurred. This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The name. - - - Determines whether the contents of the user input fields pass validation checks, and optionally lets you specify a list of fields to check. - true if all specified field or fields pass validation checks; false if any field contains a validation error. - Optional. The names (value of the name attribute) of the user input elements to check for validation errors. You can specify any number of element names, separated by commas. If you do not specify a list of fields, the method checks all elements that are registered for validation. - - - Registers the specified field as one that requires user entry. - The name (value of the name attribute) of the user input element to validate. - - - Registers the specified field as one that requires user entry and registers the specified string as the error message to display if no value is supplied. - The name (value of the name attribute) of the user input element to validate. - The error message. - - - Registers the specified fields as ones that require user entry. - The names (value of the name attribute) of the user input elements to validate. You can specify any number of element names, separated by commas. - - - Performs validation on elements registered for validation, and optionally lets you specify a list of fields to check. - The list of errors for the specified fields, if any validation errors occurred. - Optional. The names (value of the name attribute) of the user input elements to validate. You can specify any number of element names, separated by commas. If you do not specify a list, the method validates all registered elements. - - - Gets the name of the class that is used to specify the appearance of error-message display when errors have occurred. This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The name. - - - Defines validation tests that can be registered using the method. - - - Initializes a new instance of the class. - - - Defines a validation test that tests whether a value can be treated as a date/time value. - The validation test. - The error message to display if validation fails. - - - Defines a validation test that tests whether a value can be treated as a decimal number. - The validation test. - The error message to display if validation fails. - - - Defines a validation test that test user input against the value of another field. - The validation test. - The other field to compare. - The error message to display if validation fails. - - - Defines a validation test that tests whether a value can be treated as a floating-point number. - The validation test. - The error message to display if validation fails. - - - Defines a validation test that tests whether a value can be treated as an integer. - The validation test. - The error message to display if validation fails. - - - Defines a validation test that tests whether a decimal number falls within a specific range. - The validation test. - The minimum value. The default is 0. - The maximum value. - The error message to display if validation fails. - - - Defines a validation test that tests whether an integer value falls within a specific range. - The validation test. - The minimum value. The default is 0. - The maximum value. - The error message to display if validation fails. - - - Defines a validation test that tests a value against a pattern specified as a regular expression. - The validation test. - The regular expression to use to test the user input. - The error message to display if validation fails. - - - Defines a validation test that tests whether a value has been provided. - The validation test. - The error message to display if validation fails. - - - Defines a validation test that tests the length of a string. - The validation test. - The maximum length of the string. - The minimum length of the string. The default is 0. - The error message to display if validation fails. - - - Defines a validation test that tests whether a value is a well-formed URL. - The validation test. - The error message to display if validation fails. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - Represents an ASP.NET Razor page. - - - Called from a derived class to create a new instance that is based on the class. - - - Gets or sets the object that is associated with a page. - The current context data. - - - Executes the code in a set of dependent pages. - - - Gets the object that is associated with a page. - An object that can render HTML form controls in a page. - - - Initializes an object that inherits from the class. - - - Gets the model that is associated with a page. - An object that represents a model that is associated with the view data for a page. - - - Gets the state of the model that is associated with a page. - The state of the model. - - - Adds a class to a list of classes that handle page execution and that implement custom features for pages. - The class to add. - - - Renders a content page. - An object that can write the output of the page. - The path of the page to render. - Data to pass to the page. - - - Gets the validation helper for the current page context. - The validation helper. - - - Serves as the base class for classes that represent an ASP.NET Razor page. - - - Initializes the class for use by an inherited class instance. This constructor can only be called by an inherited class. - - - When overridden in a derived class, configures the current web page based on the configuration of the parent web page. - The parent page from which to read configuration information. - - - Creates a new instance of the class by using the specified virtual path. - The new object. - The virtual path to use to create the instance. - - - Attempts to create a WebPageBase instance from a virtualPath and wraps complex compiler exceptions with simpler messages - - - Called by content pages to create named content sections. - The name of the section to create. - The type of action to take with the new section. - - - Executes the code in a set of dependent web pages. - - - Executes the code in a set of dependent web pages by using the specified parameters. - The context data for the page. - The writer to use to write the executed HTML. - - - Executes the code in a set of dependent web pages by using the specified context, writer, and start page. - The context data for the page. - The writer to use to write the executed HTML. - The page to start execution in the page hierarchy. - - - Returns the text writer instance that is used to render the page. - The text writer. - - - Initializes the current page. - - - Returns a value that indicates whether the specified section is defined in the page. - true if the specified section is defined in the page; otherwise, false. - The name of the section to search for. - - - Gets or sets the path of a layout page. - The path of the layout page. - - - Gets the current object for the page. - The object. - - - Gets the stack of objects for the current page context. - The objects. - - - Provides property-like access to page data that is shared between pages, layout pages, and partial pages. - An object that contains page data. - - - Provides array-like access to page data that is shared between pages, layout pages, and partial pages. - A dictionary that contains page data. - - - Returns and removes the context from the top of the instance. - - - Inserts the specified context at the top of the instance. - The page context to push onto the instance. - The writer for the page context. - - - In layout pages, renders the portion of a content page that is not within a named section. - The HTML content to render. - - - Renders the content of one page within another page. - The HTML content to render. - The path of the page to render. - (Optional) An array of data to pass to the page being rendered. In the rendered page, these parameters can be accessed by using the property. - - - In layout pages, renders the content of a named section. - The HTML content to render. - The section to render. - The section was already rendered.-or-The section was marked as required but was not found. - - - In layout pages, renders the content of a named section and specifies whether the section is required. - The HTML content to render. - The section to render. - true to specify that the section is required; otherwise, false. - - - Writes the specified object as an HTML-encoded string. - The object to encode and write. - - - Writes the specified object as an HTML-encoded string. - The helper result to encode and write. - - - Writes the specified object without HTML-encoding it first. - The object to write. - - - Contains data that is used by a object to reference details about the web application, the current HTTP request, the current execution context, and page-rendering data. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified context, page, and model. - The HTTP request context data to associate with the page context. - The page data to share between pages, layout pages, and partial pages. - The model to associate with the view data. - - - Gets a reference to the current object that is associated with a page. - The current page context object. - - - Gets the model that is associated with a page. - An object that represents a model that is associated with the view data for a page. - - - Gets the object that is associated with a page. - The object that renders the page. - - - Gets the page data that is shared between pages, layout pages, and partial pages. - A dictionary that contains page data. - - - Provides objects and methods that are used to execute and render ASP.NET pages that include Razor syntax. - - - Initializes a new instance of the class. This constructor can only be called by an inherited class. - - - - - - - - - When overridden in a derived class, gets or sets the object that is associated with a page. - The current context data. - - - - - - - - Returns the text writer instance that is used to render the page. - The text writer. - - - - - - - - Writes the string representation of the specified object as an HTML-encoded string. - The object to encode and write. - - - Writes the specified object as an HTML-encoded string. - The helper result to encode and write. - - - - - - Writes the specified object without HTML encoding. - The object to write. - - - Writes the specified object to the specified instance without HTML encoding. - The text writer. - The object to write. - - - Writes the specified object as an HTML-encoded string to the specified text writer. - The text writer. - The object to encode and write. - - - Writes the specified object as an HTML-encoded string to the specified text writer. - The text writer. - The helper result to encode and write. - - - Provides methods and properties that are used to process specific URL extensions. - - - Initializes a new instance of the class by using the specified web page. - The web page to process. - - is null. - - - Creates a new handler object from the specified virtual path. - A object for the specified virtual path. - The virtual path to use to create the handler. - - - Gets or sets a value that indicates whether web page response headers are disabled. - true if web page response headers are disabled; otherwise, false. - - - Returns a list of file name extensions that the current instance can process. - A read-only list of file name extensions that are processed by the current instance. - - - Gets a value that indicates whether another request can use the instance. - true if the instance is reusable; otherwise, false. - - - Processes the web page by using the specified context. - The context to use when processing the web page. - - - Adds a file name extension to the list of extensions that are processed by the current instance. - The extension to add, without a leading period. - - - The HTML tag name (X-AspNetWebPages-Version) for the version of the ASP.NET Web Pages specification that is used by this web page. - - - Provides methods and properties that are used to render pages that use the Razor view engine. - - - Initializes a new instance of the class. - - - - - - When overridden in a derived class, calls the methods that are used to initialize the page. - - - - - When overridden in a derived class, gets or sets the path of a layout page. - The path of a layout page. - - - When overridden in a derived class, provides property-like access to page data that is shared between pages, layout pages, and partial pages. - An object that contains page data. - - - - When overridden in a derived class, provides array-like access to page data that is shared between pages, layout pages, and partial pages. - An object that provides array-like access to page data. - - - - When overridden in a derived class, renders a web page. - The markup that represents the web page. - The path of the page to render. - Additional data that is used to render the page. - - - - - - - - - - - Provides support for rendering HTML form controls and performing form validation in a web page. - - - Creates a dictionary of HTML attributes from the input object, translating underscores to dashes. - A dictionary that represents HTML attributes. - Anonymous object describing HTML attributes. - - - Returns an HTML-encoded string that represents the specified object by using a minimal encoding that is suitable only for HTML attributes that are enclosed in quotation marks. - An HTML-encoded string that represents the object. - The object to encode. - - - Returns an HTML-encoded string that represents the specified string by using a minimal encoding that is suitable only for HTML attributes that are enclosed in quotation marks. - An HTML-encoded string that represents the original string. - The string to encode. - - - Returns an HTML check box control that has the specified name. - The HTML markup that represents the check box control. - The value to assign to the name attribute of the HTML control element. - - is null or empty. - - - Returns an HTML check box control that has the specified name and default checked status. - The HTML markup that represents the check box control. - The value to assign to the name attribute of the HTML control element. - true to indicate that the checked attribute is set to checked; otherwise, false. - - is null or empty. - - - Returns an HTML check box control that has the specified name, default checked status, and custom attributes defined by an attribute dictionary. - The HTML markup that represents the check box control. - The value to assign to the name attribute of the HTML control element. - true to indicate that the checked attribute is set to checked; otherwise, false. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML check box control that has the specified name, default checked status, and custom attributes defined by an attribute object. - The HTML markup that represents the check box control. - The value to assign to the name attribute of the HTML control element. - true to indicate that the checked attribute is set to checked; otherwise, false. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML check box control that has the specified name and custom attributes defined by an attribute dictionary. - The HTML markup that represents the check box control. - The value to assign to the name attribute of the HTML control element. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML check box control that has the specified name and custom attributes defined by an attribute object. - The HTML markup that represents the check box control. - The value to assign to the name attribute of the HTML control element. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML drop-down list control that has the specified name and that contains the specified list items. - The HTML markup that represents the drop-down list control. - The value to assign to the name attribute of the HTML select element. - A list of instances that are used to populate the list. - - is null or empty. - - - Returns an HTML drop-down list control that has the specified name and custom attributes defined by an attribute dictionary, and that contains the specified list items. - The HTML markup that represents the drop-down list control. - The value to assign to the name attribute of the HTML select element. - A list of instances that are used to populate the list. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML drop-down list control that has the specified name and custom attributes defined by an attribute object, and that contains the specified list items. - The HTML markup that represents the drop-down list control. - The value to assign to the name attribute of the HTML select element. - A list of instances that are used to populate the list. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML drop-down list control that has the specified name, and that contains the specified list items and default item. - The HTML markup that represents the drop-down list control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - - is null or empty. - - - Returns an HTML drop-down list control that has the specified name and custom attributes defined by an attribute dictionary, and that contains the specified list items and default item. - The HTML markup that represents the drop-down list control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML drop-down list control that has the specified name and custom attributes defined by an attribute object, and that contains the specified list items and default item. - The HTML markup that represents the drop-down list control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML drop-down list control that has the specified name, custom attributes defined by an attribute dictionary, and default selection, and that contains the specified list items and default item. - The HTML markup that represents the drop-down list control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - The value that specifies the item in the list that is selected by default. The selected item is the first item in the list whose value matches the parameter (or whose text matches, if there is no value.) - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML drop-down list control that has the specified name, custom attributes defined by an attribute object, and default selection, and that contains the specified list items and default item. - The HTML markup that represents the drop-down list control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - The value that specifies the item in the list that is selected by default. The item that is selected is the first item in the list that has a matching value, or that matches the items displayed text if the item has no value. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML-encoded string that represents the specified object by using a full encoding that is suitable for arbitrary HTML. - An HTML-encoded string that represents the object. - The object to encode. - - - Returns an HTML-encoded string that represents the specified string by using a full encoding that is suitable for arbitrary HTML. - An HTML-encoded string that represents the original string. - The string to encode. - - - Returns an HTML hidden control that has the specified name. - The HTML markup that represents the hidden control. - The value to assign to the name attribute of the HTML control element. - - is null or empty. - - - Returns an HTML hidden control that has the specified name and value. - The HTML markup that represents the hidden control. - The value to assign to the name attribute of the HTML control element. - The value to assign to the value attribute of the element. - - is null or empty. - - - Returns an HTML hidden control that has the specified name, value, and custom attributes defined by an attribute dictionary. - The HTML markup that represents the hidden control. - The value to assign to the name attribute of the HTML control element. - The value to assign to the value attribute of the element. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML hidden control that has the specified name, value, and custom attributes defined by an attribute object. - The HTML markup that represents the hidden control. - The value to assign to the name attribute of the HTML control element. - The value to assign to the value attribute of the element. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Gets or sets the character that is used to replace the dot (.) in the id attribute of rendered form controls. - The character that is used to replace the dot in the id attribute of rendered form controls. The default is an underscore (_). - - - Returns an HTML label that displays the specified text. - The HTML markup that represents the label. - The text to display. - - is null or empty. - - - Returns an HTML label that displays the specified text and that has the specified custom attributes. - The HTML markup that represents the label. - The text to display. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML label that displays the specified text and that has the specified for attribute. - The HTML markup that represents the label. - The text to display. - The value to assign to the for attribute of the HTML control element. - - is null or empty. - - - Returns an HTML label that displays the specified text, and that has the specified for attribute and custom attributes defined by an attribute dictionary. - The HTML markup that represents the label. - The text to display. - The value to assign to the for attribute of the HTML control element. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML label that displays the specified text, and that has the specified for attribute and custom attributes defined by an attribute object. - The HTML markup that represents the label. - The text to display. - The value to assign to the for attribute of the HTML control element. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML list box control that has the specified name and that contains the specified list items. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - A list of instances that are used to populate the list. - - is null or empty. - - - Returns an HTML list box control that has the specified name and custom attributes defined by an attribute dictionary, and that contains the specified list items. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - A list of instances that are used to populate the list. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML list box control that has the specified name and custom attributes defined by an attribute object, and that contains the specified list items. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - A list of instances that are used to populate the list. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML list box control that has the specified name, size, list items, and default selections, and that specifies whether multiple selections are enabled. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - A list of instances that are used to populate the list. - An object that specifies the items in the list that are selected by default. The selections are retrieved through reflection by examining the properties of the object. - The value to assign to the size attribute of the element. - true to indicate that the multiple selections are enabled; otherwise, false. - - is null or empty. - - - Returns an HTML list box control that has the specified name, and that contains the specified list items and default item. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list box. - - is null or empty. - - - Returns an HTML list box control that has the specified name and custom attributes defined by an attribute dictionary, and that contains the specified list items and default item. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML list box control that has the specified name and custom attributes defined by an attribute object, and that contains the specified list items and default item. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list box. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML list box control that has the specified name and custom attributes defined by an attribute dictionary, and that contains the specified list items, default item, and selections. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - An object that specifies the items in the list that are selected by default. The selections are retrieved through reflection by examining the properties of the object. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML list box control that has the specified name, size, items, default item, and selections, and that specifies whether multiple selections are enabled. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - An object that specifies the items in the list that are selected by default. The selections are retrieved through reflection by examining the properties of the object. - The value to assign to the size attribute of the element. - true to indicate that multiple selections are enabled; otherwise, false. - - is null or empty. - - - Returns an HTML list box control that has the specified name, size, custom attributes defined by an attribute dictionary, items, default item, and selections, and that specifies whether multiple selections are enabled. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - An object that specifies the items in the list that are selected by default. The selections are retrieved through reflection by examining the properties of the object. - The value to assign to the size attribute of the element. - true to indicate that multiple selections are enabled; otherwise, false. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML list box control that has the specified name, size, custom attributes defined by an attribute object, items, default item, and selections, and that specifies whether multiple selections are enabled. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - An object that specifies the items in the list that are selected by default. The selections are retrieved through reflection by examining the properties of the object. - The value to assign to the size attribute of the element. - true to indicate that multiple selections are enabled; otherwise, false. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML list box control that has the specified name, items, default item, and custom attributes defined by an attribute object, and selections. - The HTML markup that represents the list box control. - The value to assign to the name attribute of the HTML select element. - The text to display for the default option in the list. - A list of instances that are used to populate the list. - An object that specifies the items in the list that are selected by default. The selections are retrieved through reflection by examining the properties of the object. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Creates a dictionary from an object, by adding each public instance property as a key with its associated value to the dictionary. It will expose public properties from derived types as well. This is typically used with objects of an anonymous type. - The created dictionary of property names and property values. - The object to be converted. - - - Returns an HTML password control that has the specified name. - The HTML markup that represents the password control. - The value to assign to the name attribute of the HTML control element. - - is null or empty. - - - Returns an HTML password control that has the specified name and value. - The HTML markup that represents the password control. - The value to assign to the name attribute of the HTML control element. - The value to assign to the value attribute of the element. - - is null or empty. - - - Returns an HTML password control that has the specified name, value, and custom attributes defined by an attribute dictionary. - The HTML markup that represents the password control. - The value to assign to the name attribute of the HTML control element. - The value to assign to the value attribute of the element. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML password control that has the specified name, value, and custom attributes defined by an attribute object. - The HTML markup that represents the password control. - The value to assign to the name attribute of the HTML control element. - The value to assign to the value attribute of the element. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML radio button control that has the specified name and value. - The HTML markup that represents the radio button control. - The value to assign to the name attribute of the HTML control element. The name attribute defines the group that the radio button belongs to. - The value to assign to the value attribute of the element. - - is null or empty. - - - Returns an HTML radio button control that has the specified name, value, and default selected status. - The HTML markup that represents the radio button control. - The value to assign to the name attribute of the HTML control element. The name attribute defines the group that the radio button belongs to. - The value to assign to the value attribute of the element. - true to indicate that the control is selected; otherwise, false. - - is null or empty. - - - Returns an HTML radio button control that has the specified name, value, default selected status, and custom attributes defined by an attribute dictionary. - The HTML markup that represents the radio button control. - The value to assign to the name attribute of the HTML control element. The name attribute defines the group that the radio button belongs to. - The value to assign to the value attribute of the element. - true to indicate that the control is selected; otherwise, false. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML radio button control that has the specified name, value, default selected status, and custom attributes defined by an attribute object. - The HTML markup that represents the radio button control. - The value to assign to the name attribute of the HTML control element. The name attribute defines the group that the radio button belongs to. - The value to assign to the value attribute of the element. - true to indicate that the control is selected; otherwise, false. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML radio button control that has the specified name, value, and custom attributes defined by an attribute dictionary. - The HTML markup that represents the radio button control. - The value to assign to the name attribute of the HTML control element. The name attribute defines the group that the radio button belongs to. - The value to assign to the value attribute of the element. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML radio button control that has the specified name, value, and custom attributes defined by an attribute object. - The HTML markup that represents the radio button control. - The value to assign to the name attribute of the HTML control element. The name attribute defines the group that the radio button belongs to. - The value to assign to the value attribute of the element. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Wraps HTML markup in an instance so that it is interpreted as HTML markup. - The unencoded HTML. - The object to render HTML for. - - - Wraps HTML markup in an instance so that it is interpreted as HTML markup. - The unencoded HTML. - The string to interpret as HTML markup instead of being HTML-encoded. - - - Returns an HTML multi-line text input (text area) control that has the specified name. - The HTML markup that represents the text area control. - The value to assign to the name attribute of the HTML textarea element. - - is null or empty. - - - Returns an HTML multi-line text input (text area) control that has the specified name and custom attributes defined by an attribute dictionary. - The HTML markup that represents the text area control. - The value to assign to the name attribute of the HTML textarea element. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML multi-line text input (text area) control that has the specified name and custom attributes defined by an attribute object. - The HTML markup that represents the text area control. - The value to assign to the name attribute of the HTML textarea element. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML multi-line text input (text area) control that has the specified name and value. - The HTML markup that represents the text area control. - The value to assign to the name attribute of the HTML textrarea element. - The text to display. - - is null or empty. - - - Returns an HTML multi-line text input (text area) control that has the specified name, value, and custom attributes defined by an attribute dictionary. - The HTML markup that represents the text area control. - The value to assign to the name attribute of the HTML textarea element. - The text to display. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML multi-line text input (text area) control that has the specified name, value, row attribute, col attribute, and custom attributes defined by an attribute dictionary. - The HTML markup that represents the text area control. - The value to assign to the name attribute of the HTML textarea element. - The text to display. - The value to assign to the rows attribute of the element. - The value to assign to the cols attribute of the element. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML multi-line text input (text area) control that has the specified name, value, row attribute, col attribute, and custom attributes defined by an attribute object. - The HTML markup that represents the text area control. - The value to assign to the name attribute of the HTML textarea element. - The text to display. - The value to assign to the rows attribute of the element. - The value to assign to the cols attribute of the element. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML multi-line text input (text area) control that has the specified name, value, and custom attributes defined by an attribute object. - The HTML markup that represents the text area control. - The value to assign to the name attribute of the HTML textarea element. - The text to display. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML text control that has the specified name. - The HTML markup that represents the text control. - The value to assign to the name attribute of the HTML control element. - - is null or empty. - - - Returns an HTML text control that has the specified name and value. - The HTML markup that represents the text control. - The value to assign to the name attribute of the HTML control element. - The value to assign to the value attribute of the element. - - is null or empty. - - - Returns an HTML text control that has the specified name, value, and custom attributes defined by an attribute dictionary. - The HTML markup that represents the text control. - The value to assign to the name attribute of the HTML control element. - The value to assign to the value attribute of the element. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML text control that has the specified name, value, and custom attributes defined by an attribute object. - The HTML markup that represents the text control. - The value to assign to the name attribute of the HTML control element. - The value to assign to the value attribute of the element. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Gets or sets a value that indicates whether the page uses unobtrusive JavaScript for Ajax functionality. - true if the page uses unobtrusive JavaScript; otherwise, false. - - - Gets or sets the name of the CSS class that defines the appearance of input elements when validation fails. - The name of the CSS class. The default is field-validation-error. - - - Gets or sets the name of the CSS class that defines the appearance of input elements when validation passes. - The name of the CSS class. The default is input-validation-valid. - - - Returns an HTML span element that contains the first validation error message for the specified form field. - If the value in the specified field is valid, null; otherwise, the HTML markup that represents the validation error message that is associated with the specified field. - The name of the form field that was validated. - - is null or empty. - - - Returns an HTML span element that has the specified custom attributes defined by an attribute dictionary, and that contains the first validation error message for the specified form field. - If the value in the specified field is valid, null; otherwise, the HTML markup that represents the validation error message that is associated with the specified field. - The name of the form field that was validated. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML span element that has the specified custom attributes defined by an attribute object, and that contains the first validation error message for the specified form field. - If the value in the specified field is valid, null; otherwise, the HTML markup that represents the validation error message that is associated with the specified field. - The name of the form field that was validated. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Returns an HTML span element that contains a validation error message for the specified form field. - If the value in the specified field is valid, null; otherwise, the HTML markup that represents the validation error message that is associated with the specified field. - The name of the form field that was validated. - The validation error message to display. If null, the first validation error message that is associated with the specified form field is displayed. - - is null or empty. - - - Returns an HTML span element that has the specified custom attributes defined by an attribute dictionary, and that contains a validation error message for the specified form field. - If the specified field is valid, null; otherwise, the HTML markup that represents a validation error message that is associated with the specified field. - The name of the form field that was validated. - The validation error message to display. If null, the first validation error message that is associated with the specified form field is displayed. - The names and values of custom attributes for the element. - - is null or empty. - - - Returns an HTML span element that has the specified custom attributes defined by an attribute object, and that contains a validation error message for the specified form field. - If the specified field is valid, null; otherwise, the HTML markup that represents a validation error message that is associated with the specified field. - The name of the form field that was validated. - The validation error message to display. If null, the first validation error message that is associated with the specified form field is displayed. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - is null or empty. - - - Gets or sets the name of the CSS class that defines the appearance of validation error messages when validation fails. - The name of the CSS class. The default is field-validation-error. - - - Gets or sets the name of the CSS class that defines the appearance of validation error messages when validation passes. - The name of the CSS class. The default is field-validation-valid. - - - Returns an HTML div element that contains an unordered list of all validation error messages from the model-state dictionary. - The HTML markup that represents the validation error messages. - - - Returns an HTML div element that contains an unordered list of validation error message from the model-state dictionary, optionally excluding field-level errors. - The HTML markup that represents the validation error messages. - true to exclude field-level validation error messages from the list; false to include both model-level and field-level validation error messages. - - - Returns an HTML div element that has the specified custom attributes defined by an attribute dictionary, and that contains an unordered list of all validation error messages that are in the model-state dictionary. - The HTML markup that represents the validation error messages. - The names and values of custom attributes for the element. - - - Returns an HTML div element that has the specified custom attributes defined by an attribute object, and that contains an unordered list of all validation error messages that are in the model-state dictionary. - The HTML markup that represents the validation error messages. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - - Returns an HTML div element that contains a summary message and an unordered list of all validation error messages that are in the model-state dictionary. - The HTML markup that represents the validation error messages. - The message that comes before the list of validation error messages. - - - Returns an HTML div element that has the specified custom attributes defined by an attribute dictionary, and that contains a summary message and an unordered list of validation error message from the model-state dictionary, optionally excluding field-level errors. - The HTML markup that represents the validation error messages. - The summary message that comes before the list of validation error messages. - true to exclude field-level validation error messages from the results; false to include both model-level and field-level validation error messages. - The names and values of custom attributes for the element. - - - Returns an HTML div element that has the specified custom attributes defined by an attribute object, and that contains a summary message and an unordered list of validation error message from the model-state dictionary, optionally excluding field-level errors. - The HTML markup that represents the validation error messages. - The summary message that comes before the list of validation error messages. - true to exclude field-level validation error messages from the results; false to include and field-level validation error messages. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - - Returns an HTML div element that has the specified custom attributes defined by an attribute dictionary, and that contains a summary message and an unordered list of all validation error message from the model-state dictionary. - The HTML markup that represents the validation error messages. - The message that comes before the list of validation error messages. - The names and values of custom attributes for the element. - - - Returns an HTML div element that has the specified custom attributes defined by an attribute object, and that contains a summary message and an unordered list of all validation error message from the model-state dictionary. - The HTML markup that represents the validation error messages. - The summary message that comes before the list of validation error messages. - An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. - - - Gets or sets the name of the CSS class that defines the appearance of a validation summary when validation fails. - The name of the CSS class. The default is validation-summary-errors. - - - Gets or sets the name of the CSS class that defines the appearance of a validation summary when validation passes. - The name of the CSS class. The default is validation-summary-valid. - - - Encapsulates the state of model binding to a property of an action-method argument, or to the argument itself. - - - Initializes a new instance of the class. - - - Returns a list of strings that contains any errors that occurred during model binding. - The errors that occurred during model binding. - - - Returns an object that encapsulates the value that was bound during model binding. - The value that was bound. - - - Represents the result of binding a posted form to an action method, which includes information such as validation status and validation error messages. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using values that are copied from the specified model-state dictionary. - The model-state dictionary that values are copied from. - - - Adds the specified item to the model-state dictionary. - The item to add to the model-state dictionary. - - - Adds an item that has the specified key and value to the model-state dictionary. - The key. - The value. - - - Adds an error message to the model state that is associated with the specified key. - The key that is associated with the model state that the error message is added to. - The error message. - - - Adds an error message to the model state that is associated with the entire form. - The error message. - - - Removes all items from the model-state dictionary. - - - Determines whether the model-state dictionary contains the specified item. - true if the model-state dictionary contains the specified item; otherwise, false. - The item to look for. - - - Determines whether the model-state dictionary contains the specified key. - true if the model-state dictionary contains the specified key; otherwise, false. - The key to look for. - - - Copies the elements of the model-state dictionary to an array, starting at the specified index. - The one-dimensional instance where the elements will be copied to. - The index in at which copying begins. - - - Gets the number of model states that the model-state dictionary contains. - The number of model states in the model-state dictionary. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets a value that indicates whether the model-state dictionary is read-only. - true if the model-state dictionary is read-only; otherwise, false. - - - Gets a value that indicates whether any error messages are associated with any model state in the model-state dictionary. - true if any error messages are associated with any model state in the dictionary; otherwise, false. - - - Determines whether any error messages are associated with the specified key. - true if no error messages are associated with the specified key, or the specified key does not exist; otherwise, false. - The key. - - is null. - - - Gets or sets the model state that is associated with the specified key in the model-state dictionary. - The model state that is associated with the specified key in the dictionary. - - - Gets a list that contains the keys in the model-state dictionary. - The list of keys in the dictionary. - - - Copies the values from the specified model-state dictionary into this instance, overwriting existing values when the keys are the same. - The model-state dictionary that values are copied from. - - - Removes the first occurrence of the specified item from the model-state dictionary. - true if the item was successfully removed from the model-state dictionary; false if the item was not removed or if the item does not exist in the model-state dictionary. - The item to remove. - - - Removes the item that has the specified key from the model-state dictionary. - true if the item was successfully removed from the model-state dictionary; false if the item was not removed or does not exist in the model-state dictionary. - The key of the element to remove. - - - Sets the value of the model state that is associated with the specified key. - The key to set the value of. - The value to set the key to. - - - Returns an enumerator that can be used to iterate through the model-state dictionary. - An enumerator that can be used to iterate through the model-state dictionary. - - - Gets the model-state value that is associated with the specified key. - true if the model-state dictionary contains an element that has the specified key; otherwise, false. - The key to get the value of. - When this method returns, if the key is found, contains the model-state value that is associated with the specified key; otherwise, contains the default value for the type. This parameter is passed uninitialized. - - - Gets a list that contains the values in the model-state dictionary. - The list of values in the dictionary. - - - Represents an item in an HTML select list. - - - Initializes a new instance of the class using the default settings. - - - Initializes a new instance of the class by copying the specified select list item. - The select list item to copy. - - - Gets or sets a value that indicates whether the instance is selected. - true if the select list item is selected; otherwise, false. - - - Gets or sets the text that is used to display the instance on a web page. - The text that is used to display the select list item. - - - Gets or sets the value of the HTML value attribute of the HTML option element that is associated with the instance. - The value of the HTML value attribute that is associated with the select list item. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a web pages instrumentation service. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Called before it renders the output for the specified context. - The context. - The virtual path. - The writer. - The start position. - The length of the context. - Determines whether the context is literal. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Called after it renders the output for the specified context. - The context. - The virtual path. - The writer. - The start position. - The length of the context. - Determines whether the context is literal. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the service is available. - true if the service is available; otherwise, false. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a position tagged. - The type of the position.. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. - The value of this current instance. - The offset. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. - true if the specified object is equal to the current object; otherwise, false. - The object to compare to. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the hash code of the current instance. - The hash code of the current instance. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two objects are equal. - true if the two objects are equal; otherwise, false. - The first object. - The second object. - - - Converts the specified object to a object. - The that represents the converted . - The object to convert. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Converts the to a object. - The that represents the converted . - The object to convert. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two objects are not equal. - true if the two objects are not equal; otherwise, false. - The first object. - The second object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the position associated with the . - The position associated with the . - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the object. - A string that represents the object. - - - This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the value of the current instance. - The value of the current instance. - - - Defines an ASP.NET request scope storage provider. - - - Initializes a new instance of the class. - - - Gets the dictionary to store data in the application scope. - The dictionary that stores application scope data. - - - Gets or sets the dictionary to store data in the current scope. - The dictionary that stores current scope data. - - - Gets the dictionary to store data in the global scope. - The dictionary that stores global scope data. - - - Gets the dictionary to store data in the request scope. - The dictionary that stores request scope data. - - - Defines a dictionary that provides scoped access to data. - - - Gets and sets the dictionary that is used to store data in the current scope. - The dictionary that stores current scope data. - - - Gets the dictionary that is used to store data in the global scope. - The dictionary that stores global scope data. - - - Defines a class that is used to contain storage for a transient scope. - - - Returns a dictionary that is used to store data in a transient scope, based on the scope in the property. - The dictionary that stores transient scope data. - - - Returns a dictionary that is used to store data in a transient scope. - The dictionary that stores transient scope data. - The context. - - - Gets or sets the current scope provider. - The current scope provider. - - - Gets the dictionary that is used to store data in the current scope. - The dictionary that stores current scope data. - - - Gets the dictionary that is used to store data in the global scope. - The dictionary that stores global scope data. - - - Represents a collection of keys and values that are used to store data at different scope levels (local, global, and so on). - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified base scope. - The base scope. - - - Adds a key/value pair to the object using the specified generic collection. - The key/value pair. - - - Adds the specified key and specified value to the object. - The key. - The value. - - - Gets the dictionary that stores the object data. - - - Gets the base scope for the object. - The base scope for the object. - - - Removes all keys and values from the concatenated and objects. - - - Returns a value that indicates whether the specified key/value pair exists in either the object or in the object. - true if the object or the object contains an element that has the specified key/value pair; otherwise, false. - The key/value pair. - - - Returns a value that indicates whether the specified key exists in the object or in the object. - true if the object or the object contains an element that has the specified key; otherwise, false. - The key. - - - Copies all of the elements in the object and the object to an object, starting at the specified index. - The array. - The zero-based index in . - - - Gets the number of key/value pairs that are in the concatenated and objects. - The number of key/value pairs. - - - Returns an enumerator that can be used to iterate through concatenated and objects. - An object. - - - Returns an enumerator that can be used to iterate through the distinct elements of concatenated and objects. - An enumerator that contains distinct elements from the concatenated dictionary objects. - - - Gets a value that indicates whether the object is read-only. - true if the object is read-only; otherwise, false. - - - Gets or sets the element that is associated with the specified key. - The element that has the specified key. - - - Gets a object that contains the keys from the concatenated and objects. - An object that contains that contains the keys. - - - Removes the specified key/value pair from the concatenated and objects. - true if the key/value pair is removed, or false if is not found in the concatenated and objects. - The key/value pair. - - - Removes the value that has the specified key from the concatenated and objects. - true if the key/value pair is removed, or false if is not found in the concatenated and objects. - The key. - - - Sets a value using the specified key in the concatenated and objects. - The key. - The value. - - - Returns an enumerator for the concatenated and objects. - The enumerator. - - - Gets the value that is associated with the specified key from the concatenated and objects. - true if the concatenated and objects contain an element that has the specified key; otherwise, false. - The key. - When this method returns, if the key is found, contains the value that is associated with the specified key; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. - - - Gets a object that contains the values from the concatenated and objects. - The object that contains the values. - - - Provides scoped access to static data. - - - Initializes a new instance of the class. - - - Gets or sets a dictionary that stores current data under a static context. - The dictionary that provides current scoped data. - - - Gets a dictionary that stores global data under a static context. - The dictionary that provides global scoped data. - - + + + + System.Web.WebPages + + + + Helps prevent malicious scripts from submitting forged page requests. + + + Adds an authenticating token to a form to help protect against request forgery. + Returns a string that contains the encrypted token value in a hidden HTML field. + The current object is null. + + + Adds an authenticating token to a form to help protect against request forgery and lets callers specify authentication details. + Returns the encrypted token value in a hidden HTML field. + The HTTP context data for a request. + An optional string of random characters (such as Z*7g1&p4) that is used to add complexity to the encryption for extra safety. The default is null. + The domain of a web application that a request is submitted from. + The virtual root path of a web application that a request is submitted from. + + is null. + + + Gets the search tokens. + The previous cookie token. + The new cookie token. + The form of the token. + + + Validates that input data from an HTML form field comes from the user who submitted the data. + The current value is null. + The HTTP cookie token that accompanies a valid request is missing-or-The form token is missing.-or-The form token value does not match the cookie token value.-or-The form token value does not match the cookie token value. + + + Validates that input data from an HTML form field comes from the user who submitted the data. + The cookie token value. + The token form. + + + Validates that input data from an HTML form field comes from the user who submitted the data and lets callers specify additional validation details. + The HTTP context data for a request. + An optional string of random characters (such as Z*7g1&p4) that is used to decrypt an authentication token created by the class. The default is null. + The current value is null. + The HTTP cookie token that accompanies a valid request is missing.-or-The form token is missing.-or-The form token value does not match the cookie token value.-or-The form token value does not match the cookie token value.-or-The value supplied does not match the value that was used to create the form token. + + + Provides programmatic configuration for the anti-forgery token system. + + + Gets a data provider that can provide additional data to put into all generated tokens and that can validate additional data in incoming tokens. + The data provider. + + + Gets or sets the name of the cookie that is used by the anti-forgery system. + The cookie name. + + + Gets or sets a value that indicates whether the anti-forgery cookie requires SSL in order to be returned to the server. + true if SSL is required to return the anti-forgery cookie to the server; otherwise, false. + + + Gets or sets a value that indicates whether the anti-forgery system should skip checking for conditions that might indicate misuse of the system. + true if the anti-forgery system should not check for possible misuse; otherwise, false. + + + Specifies whether to suppress the generation of X-Frame-Options header which is used to prevent ClickJacking. By default, the X-Frame-Options header is generated with the value SAMEORIGIN. If this setting is 'true', the X-Frame-Options header will not be generated for the response. + + + If claims-based authorization is in use, gets or sets the claim type from the identity that is used to uniquely identify the user. + The claim type. + + + Provides a way to include or validate custom data for anti-forgery tokens. + + + Provides additional data to store for the anti-forgery tokens that are generated during this request. + The supplemental data to embed in the anti-forgery token. + Information about the current request. + + + Validates additional data that was embedded inside an incoming anti-forgery token. + true if the data is valid, or false if the data is invalid. + Information about the current request. + The supplemental data that was embedded in the token. + + + Provides access to unvalidated form values in the object. + + + Gets a collection of unvalidated form values that were posted from the browser. + An unvalidated collection of form values. + + + Gets the specified unvalidated object from the collection of posted values in the object. + The specified member, or null if the specified item is not found. + + + Gets a collection of unvalidated query-string values. + A collection of unvalidated query-string values. + + + Excludes fields of the Request object from being checked for potentially unsafe HTML markup and client script. + + + Returns a version of form values, cookies, and query-string variables without checking them first for HTML markup and client script. + An object that contains unvalidated versions of the form and query-string values. + The object that contains values to exclude from request validation. + + + Returns a value from the specified form field, cookie, or query-string variable without checking it first for HTML markup and client script. + A string that contains unvalidated text from the specified field, cookie, or query-string value. + The object that contains values to exclude from validation. + The name of the field to exclude from validation. can refer to a form field, to a cookie, or to the query-string variable. + + + Returns all values from the Request object (including form fields, cookies, and the query string) without checking them first for HTML markup and client script. + An object that contains unvalidated versions of the form, cookie, and query-string values. + The object that contains values to exclude from validation. + + + Returns the specified value from the Request object without checking it first for HTML markup and client script. + A string that contains unvalidated text from the specified field, cookie, or query-string value. + The object that contains values to exclude from validation. + The name of the field to exclude from validation. can refer to a form field, to a cookie, or to the query-string variable. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The containing message. + + + This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The message. + The inner exception. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The error message. + The other. + + + + + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The error message. + The minimum value. + The maximum value. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. Initializes a new instance of the class. + The exception message. + The pattern. + + + Represents the remote rule for the validation of the model client. + + + Initializes a new instance of the class. + The error message. + The URL of the rule. + The HTTP method. + The additional fields used. + + + Represents the required rule for the validation of the model client. + + + Initializes a new instance of the class. + The error message + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a length of the validation rule of the model client. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The error message. + The minimum length of the validation rule. + The maximum length of the validation rule. + + + Contains classes and properties that are used to create HTML elements. This class is used to write helpers, such as those found in the namespace. + + + Creates a new tag that has the specified tag name. + The tag name without the "<", "/", or ">" delimiters. + + is null or empty. + + + Adds a CSS class to the list of CSS classes in the tag. + The CSS class to add. + + + Gets the collection of attributes. + The collection of attributes. + + + Replaces each invalid character in the tag ID with a valid HTML character. + The sanitized tag ID, or null if is null or empty, or if does not begin with a letter. + The ID that might contain characters to replace. + + + Replaces each invalid character in the tag ID with the specified replacement string. + The sanitized tag ID, or null if is null or empty, or if does not begin with a letter. + The ID that might contain characters to replace. + The replacement string. + + is null. + + + Generates a sanitized ID attribute for the tag by using the specified name. + The name to use to generate an ID attribute. + + + Gets or sets a string that can be used to replace invalid HTML characters. + The string to use to replace invalid HTML characters. + + + Gets or sets the inner HTML value for the element. + The inner HTML value for the element. + + + Adds a new attribute to the tag. + The key for the attribute. + The value of the attribute. + + + Adds a new attribute or optionally replaces an existing attribute in the opening tag. + The key for the attribute. + The value of the attribute. + true to replace an existing attribute if an attribute exists that has the specified value, or false to leave the original attribute unchanged. + + + Adds new attributes to the tag. + The collection of attributes to add. + The type of the key object. + The type of the value object. + + + Adds new attributes or optionally replaces existing attributes in the tag. + The collection of attributes to add or replace. + For each attribute in , true to replace the attribute if an attribute already exists that has the same key, or false to leave the original attribute unchanged. + The type of the key object. + The type of the value object. + + + Sets the property of the element to an HTML-encoded version of the specified string. + The string to HTML-encode. + + + Gets the tag name for this tag. + The name. + + + Renders the element as a element. + + + Renders the HTML tag by using the specified render mode. + The rendered HTML tag. + The render mode. + + + Enumerates the modes that are available for rendering HTML tags. + + + Represents the mode for rendering a closing tag (for example, </tag>). + + + Represents the mode for rendering normal text. + + + Represents the mode for rendering a self-closing tag (for example, <tag />). + + + Represents the mode for rendering an opening tag (for example, <tag>). + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the validation attributes from the structure or content of . + The to be implemented. + The result of the validation. + + + Contains methods to register assemblies as application parts. + + + Initializes a new instance of the class by using the specified assembly and root virtual path. + The assembly. + The root virtual path. + + is null or empty. + + + Resolves a path to the specified assembly or resource within an assembly by using the specified base virtual path and specified virtual path. + The path of the assembly or resource. + The assembly. + The base virtual path. + The virtual path. + + is not registered. + + + Adds an assembly and all web pages within the assembly to the list of available application parts. + The application part. + + is already registered. + + + Provides objects and methods that are used to execute and render ASP.NET Web Pages application start pages (_AppStart.cshtml or _AppStart.vbhtml files). + + + Initializes a new instance of the class. + + + Gets the HTTP application object that references this application startup page. + The HTTP application object that references this application startup page. + + + The prefix that is applied to all keys that are added to the cache by the application start page. + + + Gets the object that represents context data that is associated with this page. + The current context data. + + + Returns the text writer instance that is used to render the page. + The text writer. + + + Gets the output from the application start page as an HTML-encoded string. + The output from the application start page as an HTML-encoded string. + + + Gets the text writer for the page. + The text writer for the page. + + + The path to the application start page. + + + Gets or sets the virtual path of the page. + The virtual path. + + + Writes the string representation of the specified object as an HTML-encoded string. + The object to encode and write. + + + Writes the specified object as an HTML-encoded string. + The helper result to encode and write. + + + Writes the specified object without HTML encoding. + The object to write. + + + Stores the value for an attribute.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + Initializes a new instance of the class.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The namespace prefix for the attribute. + The value for the attribute. + true to indicate that the value is a literal value; otherwise, false. + + + Creates an attribute value from the specified tuple object. + The created attribute value. + The tuple object from which to create from. + + + Creates an attribute value from the specified tuple object. + The created attribute value. + The tuple object from which to create from. + + + Gets or sets a value that indicates whether the value is a literal value.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + true if the value is a literal value; otherwise, false. + + + Creates an attribute value from the specified tuple object. + The created attribute value. + The tuple object from which to create from. + + + Creates an attribute value from the specified tuple object. + The created attribute value. + The tuple object from which to create from. + + + Gets or sets the namespace prefix for the attribute.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The namespace prefix for the attribute. + + + Gets or set the value for the attribute.This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The value for the attribute. + + + Provides a way to specify custom browser (user agent) information. + + + Removes any overridden user agent for the current request. + The current context. + + + Returns the browser capabilities object for the overridden browser capabilities or for the actual browser if no override has been specified. + The browser capabilities. + The current context. + + + Returns the overridden user agent value or the actual user agent string if no override has been specified. + The user agent string + The current context. + + + Gets a string that varies based on the type of the browser. + A string that identifies the browser. + The current context. + + + Gets a string that varies based on the type of the browser. + A string that identifies the browser. + The current context base. + + + Overrides the request's actual user agent value using the specified user agent. + The current context. + The user agent to use. + + + Overrides the request's actual user agent value using the specified browser override information. + The current context. + One of the enumeration values that represents the browser override information to use. + + + Specifies browser types that can be defined for the method. + + + Specifies a desktop browser. + + + Specifies a mobile browser. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.The current BrowserOverrideStore is used to get and set the user agent of a request. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Looks for a user agent by searching for the browser override cookie. + The user agent. + The HTTP context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds a browser override cookie with the set user agent to the response of the current request. + The HTTP context. + The user agent. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets overridden user agent for a request from a cookie. Creates a cookie to set the overridden user agent. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The days to expire. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Looks for a user agent by searching for the browser override cookie. + The user agent. + The HTTP context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Adds a browser override cookie with the set user agent to the response of the current request. + The HTTP context. + The user agent. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the default display mode of the web pages. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The suffix. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether the can handle context. + true if the can handle context; otherwise, false. + The specified http context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the context condition displays a default mode. + true if the context condition displays a default mode; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the display mode identifier of the web pages. + The display mode identifier of the web pages. + + + Retrieves the display information about an item in the result pane. + The display information about an item in the result pane. + The http context. + The virtual path. + true if the virtual path exists; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Transforms the path of the display mode. + The path of the display mode to transform. + The virtual path. + The suffix. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a property’s display information. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The virtual path. + The active display mode. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the active display mode for a Web page. + The active display mode for a Web page. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the virtual path of the current Web page. + The virtual path of the current Web page. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the modes of display for the provider. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the default display mode identifier. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a list of the available display modes for the context base. + A list of the available display modes for the context base. + The http context base. + The current display mode. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the for the virtual path. + The for the virtual path. + The virtual path. + The http context base. + true if the virtual path exists; otherwise, false. + The current display mode. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the instance of the . + The instance of the . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the mobile display mode identifier. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a list of modes of the . + A list of modes of the . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the Web page requires consistent display mode. + true if the Web page requires consistent display mode; otherwise, false. + + + Represents a base class for pages that is used when ASP.NET compiles a .cshtml or .vbhtml file and that exposes page-level and application-level properties and methods. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + Gets the application-state data as a object that callers can use to create and access custom application-scoped properties. + The application-state data. + + + Gets a reference to global application-state data that can be shared across sessions and requests in an ASP.NET application. + The application-state data. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts all the helper statements into the context of the helper page. + The text writer. + The helper virtual path. + The starting position. + The length of the context. + true of the context has a literal attribute; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Puts all the helper statements into the context of the helper page. + The helper virtual path. + The starting position. + The length of the context. + true of the context has a literal attribute; otherwise, false. + + + Gets the cache object for the current application domain. + The cache object. + + + Gets the object that is associated with a page. + The current context data. + + + Gets the current page for this helper page. + The current page. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the end of context block. + The text writer. + The helper virtual path. + The starting position. + The length of the context. + true of the context has a literal attribute; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates the end of context block. + The helper virtual path. + The starting position. + The length of the context. + true of the context has a literal attribute; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the path of the helper page. + The path of the helper page. + + + Builds an absolute URL from an application-relative URL by using the specified parameters. + The absolute URL. + The initial path to use in the URL. + Additional path information, such as folders and subfolders. + + + Gets the object that is associated with a page. + An object that supports rendering HTML form controls in a page. + + + Gets a value that indicates whether Ajax is being used during the request of the web page. + true if Ajax is being used during the request; otherwise, false. + + + Gets a value that indicates whether the current request is a post (submitted using the HTTP POST verb). + true if the HTTP verb is POST; otherwise, false. + + + Gets the model that is associated with a page. + An object that represents a model that is associated with the view data for a page. + + + Gets the state data for the model that is associated with a page. + The state of the model. + + + Gets property-like access to page data that is shared between pages, layout pages, and partial pages. + An object that contains page data. + + + Gets and sets the HTTP context for the web page. + The HTTP context for the web page. + + + Gets array-like access to page data that is shared between pages, layout pages, and partial pages. + An object that provides array-like access to page data. + + + Gets the object for the current HTTP request. + An object that contains the HTTP values that were sent by a client during a web request. + + + Gets the object for the current HTTP response. + An object that contains the HTTP-response information from an ASP.NET operation. + + + Gets the object that provides methods that can be used as part of web-page processing. + The object. + + + Gets the object for the current HTTP request. + The object for the current HTTP request. + + + Gets data related to the URL path. + Data related to the URL path. + + + Gets a user value based on the HTTP context. + A user value based on the HTTP context. + + + Gets the virtual path of the page. + The virtual path. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Writes an attribute associated with the helper. + The text writer. + The name of the attribute. + The prefix. + The suffix. + The attribute value. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Writes a literal object to the helper. + The text writer. + The value of the object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Writes a helper result object to the helper. + The text writer + The helper result. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Writes an object to the helper. + The text writer. + The object value. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Writes a helper result object to the helper. + The text writer. + The helper result value. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents the display mode interface for the web pages. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates a value whether the web pages can handle HTTP context. + true if the web pages can handle HTTP context; otherwise, false. + The HTTP context. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the display mode id for the web pages. + The display mode id for the web pages. + + + Returns this method to display all the information for the web pages. + The method to display all the information for the web pages. + The HTTP context. + The virtual path. + true if the virtual path exists; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Defines the properties and methods that objects that participate in webpages. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a container for client validation for the required field. + A container for client validation for the required field. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Evaluates the condition it checks and updates the validation context. + The condition it checks and updates the validation context. + The validation context. + + + Defines methods that are implemented by virtual path handler factories. + + + Creates a handler factory for the specified virtual path. + A handler factory for the specified virtual path. + The virtual path. + + + Determines whether the specified virtual path is associated with a handler factory. + true if a handler factory exists for the specified virtual path; otherwise, false. + The virtual path. + + + Defines methods to implement an executor class that can execute the code on a web page. + + + Executes the code on the specified web page. + true if the executor took over execution of the web page; otherwise, false. + The web page. + + + Represents a path attribute for a web page class. + + + Initializes a new instance of the class by using the specified virtual path. + The virtual path. + + + Gets the virtual path of the current web page. + The virtual path. + + + Provides a registration point for pre-application start code for web pages. + + + Registers pre-application start code for web pages. + + + Defines extension methods for the class. + + + Determines whether the specified URL references the local computer. + true if the specified URL references the local computer; otherwise, false. + The HTTP request object. + The URL to test. + + + Serves as the abstract base class for the validation helper classes. + + + Initializes a new instance of the derived class and specifies the name of the HTML element that is being validated. + The name (value of the name attribute) of the user input element to validate. + + + Initializes a new instance of the derived class, registers the specified string as the error message to display if no value is supplied, and specifies whether the method can use unvalidated data. + The error message. + true to use unvalidated user input; false to reject unvalidated data. This parameter is set to true by calling methods in circumstances when the actual value of the user input is not important, such as for required fields. + + + When implemented in a derived class, gets a container for client validation for the required field. + The container. + + + Returns the HTTP context of the current request. + The context. + The validation context. + + + Returns the value to validate. + The value to validate. + The current request. + The name of the field from the current request to validate. + + + Returns a value that indicates whether the specified value is valid. + true if the value is valid; otherwise, false. + The current context. + The value to validate. + + + Performs the validation test. + The result of the validation test. + The context. + + + Defines extension methods for the base class. + + + Configures the cache policy of an HTTP response instance. + The HTTP response instance. + The length of time, in seconds, before items expire from the cache. + true to indicate that items expire from the cache on a sliding basis; false to indicate that items expire when they reach the predefined expiration time. + The list of all parameters that can be received by a GET or POST operation that affect caching. + The list of all HTTP headers that affect caching. + The list of all Content-Encoding headers that affect caching. + One of the enumeration values that specifies how items are cached. + + + Sets the HTTP status code of an HTTP response using the specified integer value. + The HTTP response instance. + The HTTP status code. + + + Sets the HTTP status code of an HTTP response using the specified HTTP status code enumeration value. + The HTTP response instance. + The HTTP status code + + + Writes a sequence of bytes that represent binary content of an unspecified type to the output stream of an HTTP response. + The HTTP response instance. + An array that contains the bytes to write. + + + Writes a sequence of bytes that represent binary content of the specified MIME type to the output stream of an HTTP response. + The receiving HTTP response instance. + An array that contains the bytes to write. + The MIME type of the binary content. + + + Provides a delegate that represents one or more methods that are called when a content section is written. + + + Provides methods and properties that are used to render start pages that use the Razor view engine. + + + Initializes a new instance of the class. + + + Gets or sets the child page of the current start page. + The child page of the current start page. + + + Gets or sets the context of the page. + The context of the page. + + + Calls the methods that are used to execute the developer-written code in the _PageStart start page and in the page. + + + Returns the text writer instance that is used to render the page. + The text writer. + + + Returns the initialization page for the specified page. + The _AppStart page if the _AppStart page exists. If the _AppStart page cannot be found, returns the _PageStart page if a _PageStart page exists. If the _AppStart and _PageStart pages cannot be found, returns . + The page. + The file name of the page. + The collection of file-name extensions that can contain ASP.NET Razor syntax, such as "cshtml" and "vbhtml". + Either or are null. + + is null or empty. + + + Gets or sets the path of the layout page for the page. + The path of the layout page for the page. + + + Gets property-like access to page data that is shared between pages, layout pages, and partial pages. + An object that contains page data. + + + Gets array-like access to page data that is shared between pages, layout pages, and partial pages. + An object that provides array-like access to page data. + + + Renders the page. + The HTML markup that represents the web page. + The path of the page to render. + Additional data that is used to render the page. + + + Executes the developer-written code in the page. + + + Writes the string representation of the specified object as an HTML-encoded string. + The object to encode and write. + + + Writes the string representation of the specified object as an HTML-encoded string. + The helper result to encode and write. + + + Writes the string representation of the specified object without HTML encoding. + The object to write. + + + Provides utility methods for converting string values to other data types. + + + Converts a string to a strongly typed value of the specified data type. + The converted value. + The value to convert. + The data type to convert to. + + + Converts a string to the specified data type and specifies a default value. + The converted value. + The value to convert. + The value to return if is null. + The data type to convert to. + + + Converts a string to a Boolean (true/false) value. + The converted value. + The value to convert. + + + Converts a string to a Boolean (true/false) value and specifies a default value. + The converted value. + The value to convert. + The value to return if is null or is an invalid value. + + + Converts a string to a value. + The converted value. + The value to convert. + + + Converts a string to a value and specifies a default value. + The converted value. + The value to convert. + The value to return if is null or is an invalid value. The default is the minimum time value on the system. + + + Converts a string to a number. + The converted value. + The value to convert. + + + Converts a string to a number and specifies a default value. + The converted value. + The value to convert. + The value to return if is null or invalid. + + + Converts a string to a number. + The converted value. + The value to convert. + + + Converts a string to a number and specifies a default value. + The converted value. + The value to convert. + The value to return if is null. + + + Converts a string to an integer. + The converted value. + The value to convert. + + + Converts a string to an integer and specifies a default value. + The converted value. + The value to convert. + The value to return if is null or is an invalid value. + + + Checks whether a string can be converted to the specified data type. + true if can be converted to the specified type; otherwise, false. + The value to test. + The data type to convert to. + + + Checks whether a string can be converted to the Boolean (true/false) type. + true if can be converted to the specified type; otherwise, false. + The string value to test. + + + Checks whether a string can be converted to the type. + true if can be converted to the specified type; otherwise, false. + The string value to test. + + + Checks whether a string can be converted to the type. + true if can be converted to the specified type; otherwise, false. + The string value to test. + + + Checks whether a string value is null or empty. + true if is null or is a zero-length string (""); otherwise, false. + The string value to test. + + + Checks whether a string can be converted to the type. + true if can be converted to the specified type; otherwise, false. + The string value to test. + + + Checks whether a string can be converted to an integer. + true if can be converted to the specified type; otherwise, false. + The string value to test. + + + Contains methods and properties that describe a file information template. + + + Initializes a new instance of the class by using the specified virtual path. + The virtual path. + + + Gets the virtual path of the web page. + The virtual path. + + + Represents a last-in-first-out (LIFO) collection of template files. + + + Returns the current template file from the specified HTTP context. + The template file, removed from the top of the stack. + The HTTP context that contains the stack that stores the template files. + + + Removes and returns the template file that is at the top of the stack in the specified HTTP context. + The template file, removed from the top of the stack. + The HTTP context that contains the stack that stores the template files. + + is null. + + + Inserts a template file at the top of the stack in the specified HTTP context. + The HTTP context that contains the stack that stores the template files. + The template file to push onto the specified stack. + + or are null. + + + Implements validation for user input. + + + Registers a list of user input elements for validation. + The names (value of the name attribute) of the user input elements to validate. + The type of validation to register for each user input element specified in . + + + Registers a user input element for validation. + The name (value of the name attribute) of the user input element to validate. + A list of one or more types of validation to register. + + + Adds an error message. + The error message. + + + Renders an attribute that references the CSS style definition to use when validation messages for the user input element are rendered. + The attribute. + The name (value of the name attribute) of the user input element to validate. + + + Renders attributes that enable client-side validation for an individual user input element. + The attributes to render. + The name (value of the name attribute) of the user input element to validate. + + + Gets the name of the current form. This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The name. + + + Returns a list of current validation errors, and optionally lets you specify a list of fields to check. + The list of errors. + Optional. The names (value of the name attribute) of the user input elements to get error information for. You can specify any number of element names, separated by commas. If you do not specify a list of fields, the method returns errors for all fields. + + + Gets the name of the class that is used to specify the appearance of error-message display when errors have occurred. This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The name. + + + Determines whether the contents of the user input fields pass validation checks, and optionally lets you specify a list of fields to check. + true if all specified field or fields pass validation checks; false if any field contains a validation error. + Optional. The names (value of the name attribute) of the user input elements to check for validation errors. You can specify any number of element names, separated by commas. If you do not specify a list of fields, the method checks all elements that are registered for validation. + + + Registers the specified field as one that requires user entry. + The name (value of the name attribute) of the user input element to validate. + + + Registers the specified field as one that requires user entry and registers the specified string as the error message to display if no value is supplied. + The name (value of the name attribute) of the user input element to validate. + The error message. + + + Registers the specified fields as ones that require user entry. + The names (value of the name attribute) of the user input elements to validate. You can specify any number of element names, separated by commas. + + + Performs validation on elements registered for validation, and optionally lets you specify a list of fields to check. + The list of errors for the specified fields, if any validation errors occurred. + Optional. The names (value of the name attribute) of the user input elements to validate. You can specify any number of element names, separated by commas. If you do not specify a list, the method validates all registered elements. + + + Gets the name of the class that is used to specify the appearance of error-message display when errors have occurred. This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + The name. + + + Defines validation tests that can be registered using the method. + + + Initializes a new instance of the class. + + + Defines a validation test that tests whether a value can be treated as a date/time value. + The validation test. + The error message to display if validation fails. + + + Defines a validation test that tests whether a value can be treated as a decimal number. + The validation test. + The error message to display if validation fails. + + + Defines a validation test that test user input against the value of another field. + The validation test. + The other field to compare. + The error message to display if validation fails. + + + Defines a validation test that tests whether a value can be treated as a floating-point number. + The validation test. + The error message to display if validation fails. + + + Defines a validation test that tests whether a value can be treated as an integer. + The validation test. + The error message to display if validation fails. + + + Defines a validation test that tests whether a decimal number falls within a specific range. + The validation test. + The minimum value. The default is 0. + The maximum value. + The error message to display if validation fails. + + + Defines a validation test that tests whether an integer value falls within a specific range. + The validation test. + The minimum value. The default is 0. + The maximum value. + The error message to display if validation fails. + + + Defines a validation test that tests a value against a pattern specified as a regular expression. + The validation test. + The regular expression to use to test the user input. + The error message to display if validation fails. + + + Defines a validation test that tests whether a value has been provided. + The validation test. + The error message to display if validation fails. + + + Defines a validation test that tests the length of a string. + The validation test. + The maximum length of the string. + The minimum length of the string. The default is 0. + The error message to display if validation fails. + + + Defines a validation test that tests whether a value is a well-formed URL. + The validation test. + The error message to display if validation fails. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code. + + + Represents an ASP.NET Razor page. + + + Called from a derived class to create a new instance that is based on the class. + + + Gets or sets the object that is associated with a page. + The current context data. + + + Executes the code in a set of dependent pages. + + + Gets the object that is associated with a page. + An object that can render HTML form controls in a page. + + + Initializes an object that inherits from the class. + + + Gets the model that is associated with a page. + An object that represents a model that is associated with the view data for a page. + + + Gets the state of the model that is associated with a page. + The state of the model. + + + Adds a class to a list of classes that handle page execution and that implement custom features for pages. + The class to add. + + + Renders a content page. + An object that can write the output of the page. + The path of the page to render. + Data to pass to the page. + + + Gets the validation helper for the current page context. + The validation helper. + + + Serves as the base class for classes that represent an ASP.NET Razor page. + + + Initializes the class for use by an inherited class instance. This constructor can only be called by an inherited class. + + + When overridden in a derived class, configures the current web page based on the configuration of the parent web page. + The parent page from which to read configuration information. + + + Creates a new instance of the class by using the specified virtual path. + The new object. + The virtual path to use to create the instance. + + + Attempts to create a WebPageBase instance from a virtualPath and wraps complex compiler exceptions with simpler messages + + + Called by content pages to create named content sections. + The name of the section to create. + The type of action to take with the new section. + + + Executes the code in a set of dependent web pages. + + + Executes the code in a set of dependent web pages by using the specified parameters. + The context data for the page. + The writer to use to write the executed HTML. + + + Executes the code in a set of dependent web pages by using the specified context, writer, and start page. + The context data for the page. + The writer to use to write the executed HTML. + The page to start execution in the page hierarchy. + + + Returns the text writer instance that is used to render the page. + The text writer. + + + Initializes the current page. + + + Returns a value that indicates whether the specified section is defined in the page. + true if the specified section is defined in the page; otherwise, false. + The name of the section to search for. + + + Gets or sets the path of a layout page. + The path of the layout page. + + + Gets the current object for the page. + The object. + + + Gets the stack of objects for the current page context. + The objects. + + + Provides property-like access to page data that is shared between pages, layout pages, and partial pages. + An object that contains page data. + + + Provides array-like access to page data that is shared between pages, layout pages, and partial pages. + A dictionary that contains page data. + + + Returns and removes the context from the top of the instance. + + + Inserts the specified context at the top of the instance. + The page context to push onto the instance. + The writer for the page context. + + + In layout pages, renders the portion of a content page that is not within a named section. + The HTML content to render. + + + Renders the content of one page within another page. + The HTML content to render. + The path of the page to render. + (Optional) An array of data to pass to the page being rendered. In the rendered page, these parameters can be accessed by using the property. + + + In layout pages, renders the content of a named section. + The HTML content to render. + The section to render. + The section was already rendered.-or-The section was marked as required but was not found. + + + In layout pages, renders the content of a named section and specifies whether the section is required. + The HTML content to render. + The section to render. + true to specify that the section is required; otherwise, false. + + + Writes the specified object as an HTML-encoded string. + The object to encode and write. + + + Writes the specified object as an HTML-encoded string. + The helper result to encode and write. + + + Writes the specified object without HTML-encoding it first. + The object to write. + + + Contains data that is used by a object to reference details about the web application, the current HTTP request, the current execution context, and page-rendering data. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using the specified context, page, and model. + The HTTP request context data to associate with the page context. + The page data to share between pages, layout pages, and partial pages. + The model to associate with the view data. + + + Gets a reference to the current object that is associated with a page. + The current page context object. + + + Gets the model that is associated with a page. + An object that represents a model that is associated with the view data for a page. + + + Gets the object that is associated with a page. + The object that renders the page. + + + Gets the page data that is shared between pages, layout pages, and partial pages. + A dictionary that contains page data. + + + Provides objects and methods that are used to execute and render ASP.NET pages that include Razor syntax. + + + Initializes a new instance of the class. This constructor can only be called by an inherited class. + + + + + + + + + When overridden in a derived class, gets or sets the object that is associated with a page. + The current context data. + + + + + + + + Returns the text writer instance that is used to render the page. + The text writer. + + + + + + + + Writes the string representation of the specified object as an HTML-encoded string. + The object to encode and write. + + + Writes the specified object as an HTML-encoded string. + The helper result to encode and write. + + + + + + Writes the specified object without HTML encoding. + The object to write. + + + Writes the specified object to the specified instance without HTML encoding. + The text writer. + The object to write. + + + Writes the specified object as an HTML-encoded string to the specified text writer. + The text writer. + The object to encode and write. + + + Writes the specified object as an HTML-encoded string to the specified text writer. + The text writer. + The helper result to encode and write. + + + Provides methods and properties that are used to process specific URL extensions. + + + Initializes a new instance of the class by using the specified web page. + The web page to process. + + is null. + + + Creates a new handler object from the specified virtual path. + A object for the specified virtual path. + The virtual path to use to create the handler. + + + Gets or sets a value that indicates whether web page response headers are disabled. + true if web page response headers are disabled; otherwise, false. + + + Returns a list of file name extensions that the current instance can process. + A read-only list of file name extensions that are processed by the current instance. + + + Gets a value that indicates whether another request can use the instance. + true if the instance is reusable; otherwise, false. + + + Processes the web page by using the specified context. + The context to use when processing the web page. + + + Adds a file name extension to the list of extensions that are processed by the current instance. + The extension to add, without a leading period. + + + The HTML tag name (X-AspNetWebPages-Version) for the version of the ASP.NET Web Pages specification that is used by this web page. + + + Provides methods and properties that are used to render pages that use the Razor view engine. + + + Initializes a new instance of the class. + + + + + + When overridden in a derived class, calls the methods that are used to initialize the page. + + + + + When overridden in a derived class, gets or sets the path of a layout page. + The path of a layout page. + + + When overridden in a derived class, provides property-like access to page data that is shared between pages, layout pages, and partial pages. + An object that contains page data. + + + + When overridden in a derived class, provides array-like access to page data that is shared between pages, layout pages, and partial pages. + An object that provides array-like access to page data. + + + + When overridden in a derived class, renders a web page. + The markup that represents the web page. + The path of the page to render. + Additional data that is used to render the page. + + + + + + + + + + + Provides support for rendering HTML form controls and performing form validation in a web page. + + + Creates a dictionary of HTML attributes from the input object, translating underscores to dashes. + A dictionary that represents HTML attributes. + Anonymous object describing HTML attributes. + + + Returns an HTML-encoded string that represents the specified object by using a minimal encoding that is suitable only for HTML attributes that are enclosed in quotation marks. + An HTML-encoded string that represents the object. + The object to encode. + + + Returns an HTML-encoded string that represents the specified string by using a minimal encoding that is suitable only for HTML attributes that are enclosed in quotation marks. + An HTML-encoded string that represents the original string. + The string to encode. + + + Returns an HTML check box control that has the specified name. + The HTML markup that represents the check box control. + The value to assign to the name attribute of the HTML control element. + + is null or empty. + + + Returns an HTML check box control that has the specified name and default checked status. + The HTML markup that represents the check box control. + The value to assign to the name attribute of the HTML control element. + true to indicate that the checked attribute is set to checked; otherwise, false. + + is null or empty. + + + Returns an HTML check box control that has the specified name, default checked status, and custom attributes defined by an attribute dictionary. + The HTML markup that represents the check box control. + The value to assign to the name attribute of the HTML control element. + true to indicate that the checked attribute is set to checked; otherwise, false. + The names and values of custom attributes for the element. + + is null or empty. + + + Returns an HTML check box control that has the specified name, default checked status, and custom attributes defined by an attribute object. + The HTML markup that represents the check box control. + The value to assign to the name attribute of the HTML control element. + true to indicate that the checked attribute is set to checked; otherwise, false. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + is null or empty. + + + Returns an HTML check box control that has the specified name and custom attributes defined by an attribute dictionary. + The HTML markup that represents the check box control. + The value to assign to the name attribute of the HTML control element. + The names and values of custom attributes for the element. + + is null or empty. + + + Returns an HTML check box control that has the specified name and custom attributes defined by an attribute object. + The HTML markup that represents the check box control. + The value to assign to the name attribute of the HTML control element. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + is null or empty. + + + Returns an HTML drop-down list control that has the specified name and that contains the specified list items. + The HTML markup that represents the drop-down list control. + The value to assign to the name attribute of the HTML select element. + A list of instances that are used to populate the list. + + is null or empty. + + + Returns an HTML drop-down list control that has the specified name and custom attributes defined by an attribute dictionary, and that contains the specified list items. + The HTML markup that represents the drop-down list control. + The value to assign to the name attribute of the HTML select element. + A list of instances that are used to populate the list. + The names and values of custom attributes for the element. + + is null or empty. + + + Returns an HTML drop-down list control that has the specified name and custom attributes defined by an attribute object, and that contains the specified list items. + The HTML markup that represents the drop-down list control. + The value to assign to the name attribute of the HTML select element. + A list of instances that are used to populate the list. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + is null or empty. + + + Returns an HTML drop-down list control that has the specified name, and that contains the specified list items and default item. + The HTML markup that represents the drop-down list control. + The value to assign to the name attribute of the HTML select element. + The text to display for the default option in the list. + A list of instances that are used to populate the list. + + is null or empty. + + + Returns an HTML drop-down list control that has the specified name and custom attributes defined by an attribute dictionary, and that contains the specified list items and default item. + The HTML markup that represents the drop-down list control. + The value to assign to the name attribute of the HTML select element. + The text to display for the default option in the list. + A list of instances that are used to populate the list. + The names and values of custom attributes for the element. + + is null or empty. + + + Returns an HTML drop-down list control that has the specified name and custom attributes defined by an attribute object, and that contains the specified list items and default item. + The HTML markup that represents the drop-down list control. + The value to assign to the name attribute of the HTML select element. + The text to display for the default option in the list. + A list of instances that are used to populate the list. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + is null or empty. + + + Returns an HTML drop-down list control that has the specified name, custom attributes defined by an attribute dictionary, and default selection, and that contains the specified list items and default item. + The HTML markup that represents the drop-down list control. + The value to assign to the name attribute of the HTML select element. + The text to display for the default option in the list. + A list of instances that are used to populate the list. + The value that specifies the item in the list that is selected by default. The selected item is the first item in the list whose value matches the parameter (or whose text matches, if there is no value.) + The names and values of custom attributes for the element. + + is null or empty. + + + Returns an HTML drop-down list control that has the specified name, custom attributes defined by an attribute object, and default selection, and that contains the specified list items and default item. + The HTML markup that represents the drop-down list control. + The value to assign to the name attribute of the HTML select element. + The text to display for the default option in the list. + A list of instances that are used to populate the list. + The value that specifies the item in the list that is selected by default. The item that is selected is the first item in the list that has a matching value, or that matches the items displayed text if the item has no value. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + is null or empty. + + + Returns an HTML-encoded string that represents the specified object by using a full encoding that is suitable for arbitrary HTML. + An HTML-encoded string that represents the object. + The object to encode. + + + Returns an HTML-encoded string that represents the specified string by using a full encoding that is suitable for arbitrary HTML. + An HTML-encoded string that represents the original string. + The string to encode. + + + Returns an HTML hidden control that has the specified name. + The HTML markup that represents the hidden control. + The value to assign to the name attribute of the HTML control element. + + is null or empty. + + + Returns an HTML hidden control that has the specified name and value. + The HTML markup that represents the hidden control. + The value to assign to the name attribute of the HTML control element. + The value to assign to the value attribute of the element. + + is null or empty. + + + Returns an HTML hidden control that has the specified name, value, and custom attributes defined by an attribute dictionary. + The HTML markup that represents the hidden control. + The value to assign to the name attribute of the HTML control element. + The value to assign to the value attribute of the element. + The names and values of custom attributes for the element. + + is null or empty. + + + Returns an HTML hidden control that has the specified name, value, and custom attributes defined by an attribute object. + The HTML markup that represents the hidden control. + The value to assign to the name attribute of the HTML control element. + The value to assign to the value attribute of the element. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + is null or empty. + + + Gets or sets the character that is used to replace the dot (.) in the id attribute of rendered form controls. + The character that is used to replace the dot in the id attribute of rendered form controls. The default is an underscore (_). + + + Returns an HTML label that displays the specified text. + The HTML markup that represents the label. + The text to display. + + is null or empty. + + + Returns an HTML label that displays the specified text and that has the specified custom attributes. + The HTML markup that represents the label. + The text to display. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + is null or empty. + + + Returns an HTML label that displays the specified text and that has the specified for attribute. + The HTML markup that represents the label. + The text to display. + The value to assign to the for attribute of the HTML control element. + + is null or empty. + + + Returns an HTML label that displays the specified text, and that has the specified for attribute and custom attributes defined by an attribute dictionary. + The HTML markup that represents the label. + The text to display. + The value to assign to the for attribute of the HTML control element. + The names and values of custom attributes for the element. + + is null or empty. + + + Returns an HTML label that displays the specified text, and that has the specified for attribute and custom attributes defined by an attribute object. + The HTML markup that represents the label. + The text to display. + The value to assign to the for attribute of the HTML control element. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + is null or empty. + + + Returns an HTML list box control that has the specified name and that contains the specified list items. + The HTML markup that represents the list box control. + The value to assign to the name attribute of the HTML select element. + A list of instances that are used to populate the list. + + is null or empty. + + + Returns an HTML list box control that has the specified name and custom attributes defined by an attribute dictionary, and that contains the specified list items. + The HTML markup that represents the list box control. + The value to assign to the name attribute of the HTML select element. + A list of instances that are used to populate the list. + The names and values of custom attributes for the element. + + is null or empty. + + + Returns an HTML list box control that has the specified name and custom attributes defined by an attribute object, and that contains the specified list items. + The HTML markup that represents the list box control. + The value to assign to the name attribute of the HTML select element. + A list of instances that are used to populate the list. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + is null or empty. + + + Returns an HTML list box control that has the specified name, size, list items, and default selections, and that specifies whether multiple selections are enabled. + The HTML markup that represents the list box control. + The value to assign to the name attribute of the HTML select element. + A list of instances that are used to populate the list. + An object that specifies the items in the list that are selected by default. The selections are retrieved through reflection by examining the properties of the object. + The value to assign to the size attribute of the element. + true to indicate that the multiple selections are enabled; otherwise, false. + + is null or empty. + + + Returns an HTML list box control that has the specified name, and that contains the specified list items and default item. + The HTML markup that represents the list box control. + The value to assign to the name attribute of the HTML select element. + The text to display for the default option in the list. + A list of instances that are used to populate the list box. + + is null or empty. + + + Returns an HTML list box control that has the specified name and custom attributes defined by an attribute dictionary, and that contains the specified list items and default item. + The HTML markup that represents the list box control. + The value to assign to the name attribute of the HTML select element. + The text to display for the default option in the list. + A list of instances that are used to populate the list. + The names and values of custom attributes for the element. + + is null or empty. + + + Returns an HTML list box control that has the specified name and custom attributes defined by an attribute object, and that contains the specified list items and default item. + The HTML markup that represents the list box control. + The value to assign to the name attribute of the HTML select element. + The text to display for the default option in the list. + A list of instances that are used to populate the list box. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + is null or empty. + + + Returns an HTML list box control that has the specified name and custom attributes defined by an attribute dictionary, and that contains the specified list items, default item, and selections. + The HTML markup that represents the list box control. + The value to assign to the name attribute of the HTML select element. + The text to display for the default option in the list. + A list of instances that are used to populate the list. + An object that specifies the items in the list that are selected by default. The selections are retrieved through reflection by examining the properties of the object. + The names and values of custom attributes for the element. + + is null or empty. + + + Returns an HTML list box control that has the specified name, size, items, default item, and selections, and that specifies whether multiple selections are enabled. + The HTML markup that represents the list box control. + The value to assign to the name attribute of the HTML select element. + The text to display for the default option in the list. + A list of instances that are used to populate the list. + An object that specifies the items in the list that are selected by default. The selections are retrieved through reflection by examining the properties of the object. + The value to assign to the size attribute of the element. + true to indicate that multiple selections are enabled; otherwise, false. + + is null or empty. + + + Returns an HTML list box control that has the specified name, size, custom attributes defined by an attribute dictionary, items, default item, and selections, and that specifies whether multiple selections are enabled. + The HTML markup that represents the list box control. + The value to assign to the name attribute of the HTML select element. + The text to display for the default option in the list. + A list of instances that are used to populate the list. + An object that specifies the items in the list that are selected by default. The selections are retrieved through reflection by examining the properties of the object. + The value to assign to the size attribute of the element. + true to indicate that multiple selections are enabled; otherwise, false. + The names and values of custom attributes for the element. + + is null or empty. + + + Returns an HTML list box control that has the specified name, size, custom attributes defined by an attribute object, items, default item, and selections, and that specifies whether multiple selections are enabled. + The HTML markup that represents the list box control. + The value to assign to the name attribute of the HTML select element. + The text to display for the default option in the list. + A list of instances that are used to populate the list. + An object that specifies the items in the list that are selected by default. The selections are retrieved through reflection by examining the properties of the object. + The value to assign to the size attribute of the element. + true to indicate that multiple selections are enabled; otherwise, false. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + is null or empty. + + + Returns an HTML list box control that has the specified name, items, default item, and custom attributes defined by an attribute object, and selections. + The HTML markup that represents the list box control. + The value to assign to the name attribute of the HTML select element. + The text to display for the default option in the list. + A list of instances that are used to populate the list. + An object that specifies the items in the list that are selected by default. The selections are retrieved through reflection by examining the properties of the object. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + is null or empty. + + + Creates a dictionary from an object, by adding each public instance property as a key with its associated value to the dictionary. It will expose public properties from derived types as well. This is typically used with objects of an anonymous type. + The created dictionary of property names and property values. + The object to be converted. + + + Returns an HTML password control that has the specified name. + The HTML markup that represents the password control. + The value to assign to the name attribute of the HTML control element. + + is null or empty. + + + Returns an HTML password control that has the specified name and value. + The HTML markup that represents the password control. + The value to assign to the name attribute of the HTML control element. + The value to assign to the value attribute of the element. + + is null or empty. + + + Returns an HTML password control that has the specified name, value, and custom attributes defined by an attribute dictionary. + The HTML markup that represents the password control. + The value to assign to the name attribute of the HTML control element. + The value to assign to the value attribute of the element. + The names and values of custom attributes for the element. + + is null or empty. + + + Returns an HTML password control that has the specified name, value, and custom attributes defined by an attribute object. + The HTML markup that represents the password control. + The value to assign to the name attribute of the HTML control element. + The value to assign to the value attribute of the element. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + is null or empty. + + + Returns an HTML radio button control that has the specified name and value. + The HTML markup that represents the radio button control. + The value to assign to the name attribute of the HTML control element. The name attribute defines the group that the radio button belongs to. + The value to assign to the value attribute of the element. + + is null or empty. + + + Returns an HTML radio button control that has the specified name, value, and default selected status. + The HTML markup that represents the radio button control. + The value to assign to the name attribute of the HTML control element. The name attribute defines the group that the radio button belongs to. + The value to assign to the value attribute of the element. + true to indicate that the control is selected; otherwise, false. + + is null or empty. + + + Returns an HTML radio button control that has the specified name, value, default selected status, and custom attributes defined by an attribute dictionary. + The HTML markup that represents the radio button control. + The value to assign to the name attribute of the HTML control element. The name attribute defines the group that the radio button belongs to. + The value to assign to the value attribute of the element. + true to indicate that the control is selected; otherwise, false. + The names and values of custom attributes for the element. + + is null or empty. + + + Returns an HTML radio button control that has the specified name, value, default selected status, and custom attributes defined by an attribute object. + The HTML markup that represents the radio button control. + The value to assign to the name attribute of the HTML control element. The name attribute defines the group that the radio button belongs to. + The value to assign to the value attribute of the element. + true to indicate that the control is selected; otherwise, false. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + is null or empty. + + + Returns an HTML radio button control that has the specified name, value, and custom attributes defined by an attribute dictionary. + The HTML markup that represents the radio button control. + The value to assign to the name attribute of the HTML control element. The name attribute defines the group that the radio button belongs to. + The value to assign to the value attribute of the element. + The names and values of custom attributes for the element. + + is null or empty. + + + Returns an HTML radio button control that has the specified name, value, and custom attributes defined by an attribute object. + The HTML markup that represents the radio button control. + The value to assign to the name attribute of the HTML control element. The name attribute defines the group that the radio button belongs to. + The value to assign to the value attribute of the element. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + is null or empty. + + + Wraps HTML markup in an instance so that it is interpreted as HTML markup. + The unencoded HTML. + The object to render HTML for. + + + Wraps HTML markup in an instance so that it is interpreted as HTML markup. + The unencoded HTML. + The string to interpret as HTML markup instead of being HTML-encoded. + + + Returns an HTML multi-line text input (text area) control that has the specified name. + The HTML markup that represents the text area control. + The value to assign to the name attribute of the HTML textarea element. + + is null or empty. + + + Returns an HTML multi-line text input (text area) control that has the specified name and custom attributes defined by an attribute dictionary. + The HTML markup that represents the text area control. + The value to assign to the name attribute of the HTML textarea element. + The names and values of custom attributes for the element. + + is null or empty. + + + Returns an HTML multi-line text input (text area) control that has the specified name and custom attributes defined by an attribute object. + The HTML markup that represents the text area control. + The value to assign to the name attribute of the HTML textarea element. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + is null or empty. + + + Returns an HTML multi-line text input (text area) control that has the specified name and value. + The HTML markup that represents the text area control. + The value to assign to the name attribute of the HTML textrarea element. + The text to display. + + is null or empty. + + + Returns an HTML multi-line text input (text area) control that has the specified name, value, and custom attributes defined by an attribute dictionary. + The HTML markup that represents the text area control. + The value to assign to the name attribute of the HTML textarea element. + The text to display. + The names and values of custom attributes for the element. + + is null or empty. + + + Returns an HTML multi-line text input (text area) control that has the specified name, value, row attribute, col attribute, and custom attributes defined by an attribute dictionary. + The HTML markup that represents the text area control. + The value to assign to the name attribute of the HTML textarea element. + The text to display. + The value to assign to the rows attribute of the element. + The value to assign to the cols attribute of the element. + The names and values of custom attributes for the element. + + is null or empty. + + + Returns an HTML multi-line text input (text area) control that has the specified name, value, row attribute, col attribute, and custom attributes defined by an attribute object. + The HTML markup that represents the text area control. + The value to assign to the name attribute of the HTML textarea element. + The text to display. + The value to assign to the rows attribute of the element. + The value to assign to the cols attribute of the element. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + is null or empty. + + + Returns an HTML multi-line text input (text area) control that has the specified name, value, and custom attributes defined by an attribute object. + The HTML markup that represents the text area control. + The value to assign to the name attribute of the HTML textarea element. + The text to display. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + is null or empty. + + + Returns an HTML text control that has the specified name. + The HTML markup that represents the text control. + The value to assign to the name attribute of the HTML control element. + + is null or empty. + + + Returns an HTML text control that has the specified name and value. + The HTML markup that represents the text control. + The value to assign to the name attribute of the HTML control element. + The value to assign to the value attribute of the element. + + is null or empty. + + + Returns an HTML text control that has the specified name, value, and custom attributes defined by an attribute dictionary. + The HTML markup that represents the text control. + The value to assign to the name attribute of the HTML control element. + The value to assign to the value attribute of the element. + The names and values of custom attributes for the element. + + is null or empty. + + + Returns an HTML text control that has the specified name, value, and custom attributes defined by an attribute object. + The HTML markup that represents the text control. + The value to assign to the name attribute of the HTML control element. + The value to assign to the value attribute of the element. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + is null or empty. + + + Gets or sets a value that indicates whether the page uses unobtrusive JavaScript for Ajax functionality. + true if the page uses unobtrusive JavaScript; otherwise, false. + + + Gets or sets the name of the CSS class that defines the appearance of input elements when validation fails. + The name of the CSS class. The default is field-validation-error. + + + Gets or sets the name of the CSS class that defines the appearance of input elements when validation passes. + The name of the CSS class. The default is input-validation-valid. + + + Returns an HTML span element that contains the first validation error message for the specified form field. + If the value in the specified field is valid, null; otherwise, the HTML markup that represents the validation error message that is associated with the specified field. + The name of the form field that was validated. + + is null or empty. + + + Returns an HTML span element that has the specified custom attributes defined by an attribute dictionary, and that contains the first validation error message for the specified form field. + If the value in the specified field is valid, null; otherwise, the HTML markup that represents the validation error message that is associated with the specified field. + The name of the form field that was validated. + The names and values of custom attributes for the element. + + is null or empty. + + + Returns an HTML span element that has the specified custom attributes defined by an attribute object, and that contains the first validation error message for the specified form field. + If the value in the specified field is valid, null; otherwise, the HTML markup that represents the validation error message that is associated with the specified field. + The name of the form field that was validated. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + is null or empty. + + + Returns an HTML span element that contains a validation error message for the specified form field. + If the value in the specified field is valid, null; otherwise, the HTML markup that represents the validation error message that is associated with the specified field. + The name of the form field that was validated. + The validation error message to display. If null, the first validation error message that is associated with the specified form field is displayed. + + is null or empty. + + + Returns an HTML span element that has the specified custom attributes defined by an attribute dictionary, and that contains a validation error message for the specified form field. + If the specified field is valid, null; otherwise, the HTML markup that represents a validation error message that is associated with the specified field. + The name of the form field that was validated. + The validation error message to display. If null, the first validation error message that is associated with the specified form field is displayed. + The names and values of custom attributes for the element. + + is null or empty. + + + Returns an HTML span element that has the specified custom attributes defined by an attribute object, and that contains a validation error message for the specified form field. + If the specified field is valid, null; otherwise, the HTML markup that represents a validation error message that is associated with the specified field. + The name of the form field that was validated. + The validation error message to display. If null, the first validation error message that is associated with the specified form field is displayed. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + is null or empty. + + + Gets or sets the name of the CSS class that defines the appearance of validation error messages when validation fails. + The name of the CSS class. The default is field-validation-error. + + + Gets or sets the name of the CSS class that defines the appearance of validation error messages when validation passes. + The name of the CSS class. The default is field-validation-valid. + + + Returns an HTML div element that contains an unordered list of all validation error messages from the model-state dictionary. + The HTML markup that represents the validation error messages. + + + Returns an HTML div element that contains an unordered list of validation error message from the model-state dictionary, optionally excluding field-level errors. + The HTML markup that represents the validation error messages. + true to exclude field-level validation error messages from the list; false to include both model-level and field-level validation error messages. + + + Returns an HTML div element that has the specified custom attributes defined by an attribute dictionary, and that contains an unordered list of all validation error messages that are in the model-state dictionary. + The HTML markup that represents the validation error messages. + The names and values of custom attributes for the element. + + + Returns an HTML div element that has the specified custom attributes defined by an attribute object, and that contains an unordered list of all validation error messages that are in the model-state dictionary. + The HTML markup that represents the validation error messages. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + + Returns an HTML div element that contains a summary message and an unordered list of all validation error messages that are in the model-state dictionary. + The HTML markup that represents the validation error messages. + The message that comes before the list of validation error messages. + + + Returns an HTML div element that has the specified custom attributes defined by an attribute dictionary, and that contains a summary message and an unordered list of validation error message from the model-state dictionary, optionally excluding field-level errors. + The HTML markup that represents the validation error messages. + The summary message that comes before the list of validation error messages. + true to exclude field-level validation error messages from the results; false to include both model-level and field-level validation error messages. + The names and values of custom attributes for the element. + + + Returns an HTML div element that has the specified custom attributes defined by an attribute object, and that contains a summary message and an unordered list of validation error message from the model-state dictionary, optionally excluding field-level errors. + The HTML markup that represents the validation error messages. + The summary message that comes before the list of validation error messages. + true to exclude field-level validation error messages from the results; false to include and field-level validation error messages. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + + Returns an HTML div element that has the specified custom attributes defined by an attribute dictionary, and that contains a summary message and an unordered list of all validation error message from the model-state dictionary. + The HTML markup that represents the validation error messages. + The message that comes before the list of validation error messages. + The names and values of custom attributes for the element. + + + Returns an HTML div element that has the specified custom attributes defined by an attribute object, and that contains a summary message and an unordered list of all validation error message from the model-state dictionary. + The HTML markup that represents the validation error messages. + The summary message that comes before the list of validation error messages. + An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object. + + + Gets or sets the name of the CSS class that defines the appearance of a validation summary when validation fails. + The name of the CSS class. The default is validation-summary-errors. + + + Gets or sets the name of the CSS class that defines the appearance of a validation summary when validation passes. + The name of the CSS class. The default is validation-summary-valid. + + + Encapsulates the state of model binding to a property of an action-method argument, or to the argument itself. + + + Initializes a new instance of the class. + + + Returns a list of strings that contains any errors that occurred during model binding. + The errors that occurred during model binding. + + + Returns an object that encapsulates the value that was bound during model binding. + The value that was bound. + + + Represents the result of binding a posted form to an action method, which includes information such as validation status and validation error messages. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using values that are copied from the specified model-state dictionary. + The model-state dictionary that values are copied from. + + + Adds the specified item to the model-state dictionary. + The item to add to the model-state dictionary. + + + Adds an item that has the specified key and value to the model-state dictionary. + The key. + The value. + + + Adds an error message to the model state that is associated with the specified key. + The key that is associated with the model state that the error message is added to. + The error message. + + + Adds an error message to the model state that is associated with the entire form. + The error message. + + + Removes all items from the model-state dictionary. + + + Determines whether the model-state dictionary contains the specified item. + true if the model-state dictionary contains the specified item; otherwise, false. + The item to look for. + + + Determines whether the model-state dictionary contains the specified key. + true if the model-state dictionary contains the specified key; otherwise, false. + The key to look for. + + + Copies the elements of the model-state dictionary to an array, starting at the specified index. + The one-dimensional instance where the elements will be copied to. + The index in at which copying begins. + + + Gets the number of model states that the model-state dictionary contains. + The number of model states in the model-state dictionary. + + + Returns an enumerator that can be used to iterate through the collection. + An enumerator that can be used to iterate through the collection. + + + Gets a value that indicates whether the model-state dictionary is read-only. + true if the model-state dictionary is read-only; otherwise, false. + + + Gets a value that indicates whether any error messages are associated with any model state in the model-state dictionary. + true if any error messages are associated with any model state in the dictionary; otherwise, false. + + + Determines whether any error messages are associated with the specified key. + true if no error messages are associated with the specified key, or the specified key does not exist; otherwise, false. + The key. + + is null. + + + Gets or sets the model state that is associated with the specified key in the model-state dictionary. + The model state that is associated with the specified key in the dictionary. + + + Gets a list that contains the keys in the model-state dictionary. + The list of keys in the dictionary. + + + Copies the values from the specified model-state dictionary into this instance, overwriting existing values when the keys are the same. + The model-state dictionary that values are copied from. + + + Removes the first occurrence of the specified item from the model-state dictionary. + true if the item was successfully removed from the model-state dictionary; false if the item was not removed or if the item does not exist in the model-state dictionary. + The item to remove. + + + Removes the item that has the specified key from the model-state dictionary. + true if the item was successfully removed from the model-state dictionary; false if the item was not removed or does not exist in the model-state dictionary. + The key of the element to remove. + + + Sets the value of the model state that is associated with the specified key. + The key to set the value of. + The value to set the key to. + + + Returns an enumerator that can be used to iterate through the model-state dictionary. + An enumerator that can be used to iterate through the model-state dictionary. + + + Gets the model-state value that is associated with the specified key. + true if the model-state dictionary contains an element that has the specified key; otherwise, false. + The key to get the value of. + When this method returns, if the key is found, contains the model-state value that is associated with the specified key; otherwise, contains the default value for the type. This parameter is passed uninitialized. + + + Gets a list that contains the values in the model-state dictionary. + The list of values in the dictionary. + + + Represents an item in an HTML select list. + + + Initializes a new instance of the class using the default settings. + + + Initializes a new instance of the class by copying the specified select list item. + The select list item to copy. + + + Gets or sets a value that indicates whether the instance is selected. + true if the select list item is selected; otherwise, false. + + + Gets or sets the text that is used to display the instance on a web page. + The text that is used to display the select list item. + + + Gets or sets the value of the HTML value attribute of the HTML option element that is associated with the instance. + The value of the HTML value attribute that is associated with the select list item. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a web pages instrumentation service. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Called before it renders the output for the specified context. + The context. + The virtual path. + The writer. + The start position. + The length of the context. + Determines whether the context is literal. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Called after it renders the output for the specified context. + The context. + The virtual path. + The writer. + The start position. + The length of the context. + Determines whether the context is literal. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets a value indicating whether the service is available. + true if the service is available; otherwise, false. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a position tagged. + The type of the position.. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the class. + The value of this current instance. + The offset. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare to. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the hash code of the current instance. + The hash code of the current instance. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two objects are equal. + true if the two objects are equal; otherwise, false. + The first object. + The second object. + + + Converts the specified object to a object. + The that represents the converted . + The object to convert. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Converts the to a object. + The that represents the converted . + The object to convert. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the two objects are not equal. + true if the two objects are not equal; otherwise, false. + The first object. + The second object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the position associated with the . + The position associated with the . + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of the object. + A string that represents the object. + + + This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the value of the current instance. + The value of the current instance. + + + Defines an ASP.NET request scope storage provider. + + + Initializes a new instance of the class. + + + Gets the dictionary to store data in the application scope. + The dictionary that stores application scope data. + + + Gets or sets the dictionary to store data in the current scope. + The dictionary that stores current scope data. + + + Gets the dictionary to store data in the global scope. + The dictionary that stores global scope data. + + + Gets the dictionary to store data in the request scope. + The dictionary that stores request scope data. + + + Defines a dictionary that provides scoped access to data. + + + Gets and sets the dictionary that is used to store data in the current scope. + The dictionary that stores current scope data. + + + Gets the dictionary that is used to store data in the global scope. + The dictionary that stores global scope data. + + + Defines a class that is used to contain storage for a transient scope. + + + Returns a dictionary that is used to store data in a transient scope, based on the scope in the property. + The dictionary that stores transient scope data. + + + Returns a dictionary that is used to store data in a transient scope. + The dictionary that stores transient scope data. + The context. + + + Gets or sets the current scope provider. + The current scope provider. + + + Gets the dictionary that is used to store data in the current scope. + The dictionary that stores current scope data. + + + Gets the dictionary that is used to store data in the global scope. + The dictionary that stores global scope data. + + + Represents a collection of keys and values that are used to store data at different scope levels (local, global, and so on). + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified base scope. + The base scope. + + + Adds a key/value pair to the object using the specified generic collection. + The key/value pair. + + + Adds the specified key and specified value to the object. + The key. + The value. + + + Gets the dictionary that stores the object data. + + + Gets the base scope for the object. + The base scope for the object. + + + Removes all keys and values from the concatenated and objects. + + + Returns a value that indicates whether the specified key/value pair exists in either the object or in the object. + true if the object or the object contains an element that has the specified key/value pair; otherwise, false. + The key/value pair. + + + Returns a value that indicates whether the specified key exists in the object or in the object. + true if the object or the object contains an element that has the specified key; otherwise, false. + The key. + + + Copies all of the elements in the object and the object to an object, starting at the specified index. + The array. + The zero-based index in . + + + Gets the number of key/value pairs that are in the concatenated and objects. + The number of key/value pairs. + + + Returns an enumerator that can be used to iterate through concatenated and objects. + An object. + + + Returns an enumerator that can be used to iterate through the distinct elements of concatenated and objects. + An enumerator that contains distinct elements from the concatenated dictionary objects. + + + Gets a value that indicates whether the object is read-only. + true if the object is read-only; otherwise, false. + + + Gets or sets the element that is associated with the specified key. + The element that has the specified key. + + + Gets a object that contains the keys from the concatenated and objects. + An object that contains that contains the keys. + + + Removes the specified key/value pair from the concatenated and objects. + true if the key/value pair is removed, or false if is not found in the concatenated and objects. + The key/value pair. + + + Removes the value that has the specified key from the concatenated and objects. + true if the key/value pair is removed, or false if is not found in the concatenated and objects. + The key. + + + Sets a value using the specified key in the concatenated and objects. + The key. + The value. + + + Returns an enumerator for the concatenated and objects. + The enumerator. + + + Gets the value that is associated with the specified key from the concatenated and objects. + true if the concatenated and objects contain an element that has the specified key; otherwise, false. + The key. + When this method returns, if the key is found, contains the value that is associated with the specified key; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. + + + Gets a object that contains the values from the concatenated and objects. + The object that contains the values. + + + Provides scoped access to static data. + + + Initializes a new instance of the class. + + + Gets or sets a dictionary that stores current data under a static context. + The dictionary that provides current scoped data. + + + Gets a dictionary that stores global data under a static context. + The dictionary that provides global scoped data. + + \ No newline at end of file diff --git a/lib/aspnetwebapi/System.Net.Http.Formatting.xml b/lib/aspnetwebapi/System.Net.Http.Formatting.xml index 1d57d2eda1b..3fb65976cf3 100644 --- a/lib/aspnetwebapi/System.Net.Http.Formatting.xml +++ b/lib/aspnetwebapi/System.Net.Http.Formatting.xml @@ -1,2094 +1,2094 @@ - - - - System.Net.Http.Formatting - - - - - implementation which provides a byte range view over a stream used to generate HTTP 206 (Partial Content) byte range responses. The supports one or more byte ranges regardless of whether the ranges are consecutive or not. If there is only one range then a single partial response body containing a Content-Range header is generated. If there are more than one ranges then a multipart/byteranges response is generated where each body part contains a range indicated by the associated Content-Range header field. - - - - implementation which provides a byte range view over a stream used to generate HTTP 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend of the selected resource represented by the content parameter then an is thrown indicating the valid Content-Range of the content. - The stream over which to generate a byte range view. - The range or ranges, typically obtained from the Range HTTP request header field. - The media type of the content stream. - - - - implementation which provides a byte range view over a stream used to generate HTTP 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend of the selected resource represented by the content parameter then an is thrown indicating the valid Content-Range of the content. - The stream over which to generate a byte range view. - The range or ranges, typically obtained from the Range HTTP request header field. - The media type of the content stream. - The buffer size used when copying the content stream. - - - - implementation which provides a byte range view over a stream used to generate HTTP 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend of the selected resource represented by the content parameter then an is thrown indicating the valid Content-Range of the content. - The stream over which to generate a byte range view. - The range or ranges, typically obtained from the Range HTTP request header field. - The media type of the content stream. - - - - implementation which provides a byte range view over a stream used to generate HTTP 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend of the selected resource represented by the content parameter then an is thrown indicating the valid Content-Range of the content. - The stream over which to generate a byte range view. - The range or ranges, typically obtained from the Range HTTP request header field. - The media type of the content stream. - The buffer size used when copying the content stream. - - - Releases the resources used by the current instance of the class. - true to release managed and unmanaged resources; false to release only unmanaged resources. - - - Asynchronously serialize and write the byte range to an HTTP content stream. - The task object representing the asynchronous operation. - The target stream. - Information about the transport. - - - Determines whether a byte array has a valid length in bytes. - true if length is a valid length; otherwise, false. - The length in bytes of the byte array. - - - Extension methods that aid in making formatted requests using . - - - - - - - - - Sends a POST request as an asynchronous operation to the specified Uri with the given value serialized as JSON. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The type of value. - - - Sends a POST request as an asynchronous operation to the specified Uri with the given value serialized as JSON. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - - - - - - - Sends a POST request as an asynchronous operation to the specified Uri with the given value serialized as XML. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The type of value. - - - Sends a POST request as an asynchronous operation to the specified Uri with the given value serialized as XML. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - - - - - - - - - - - - - - - - Sends a POST request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The type of value. - - - Sends a POST request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - Sends a POST request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. - The type of value. - - - Sends a POST request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - Sends a POST request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - - - - - - - Sends a PUT request as an asynchronous operation to the specified Uri with the given value serialized as JSON. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The type of value. - - - Sends a PUT request as an asynchronous operation to the specified Uri with the given value serialized as JSON. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - - - - - - - Sends a PUT request as an asynchronous operation to the specified Uri with the given value serialized as XML. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The type of value. - - - Sends a PUT request as an asynchronous operation to the specified Uri with the given value serialized as XML. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - - - - - - - - - - - - - - - - Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The type of value. - - - Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. - The type of value. - - - Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - Represents the factory for creating new instance of . - - - Creates a new instance of the . - A new instance of the . - The list of HTTP handler that delegates the processing of HTTP response messages to another handler. - - - Creates a new instance of the . - A new instance of the . - The inner handler which is responsible for processing the HTTP response messages. - The list of HTTP handler that delegates the processing of HTTP response messages to another handler. - - - Creates a new instance of the which should be pipelined. - A new instance of the which should be pipelined. - The inner handler which is responsible for processing the HTTP response messages. - The list of HTTP handler that delegates the processing of HTTP response messages to another handler. - - - Specifies extension methods to allow strongly typed objects to be read from HttpContent instances. - - - Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance. - An object instance of the specified type. - The HttpContent instance from which to read. - The type of the object to read. - - - Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance. - An object instance of the specified type. - The HttpContent instance from which to read. - The collection of MediaTyepFormatter instances to use. - The type of the object to read. - - - Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance. - An object instance of the specified type. - The HttpContent instance from which to read. - The collection of MediaTypeFormatter instances to use. - The IFormatterLogger to log events to. - The type of the object to read. - - - Returns a Task that will yield an object of the specified type from the content instance. - An object instance of the specified type. - The HttpContent instance from which to read. - The collection of MediaTypeFormatter instances to use. - The IFormatterLogger to log events to. - The token to cancel the operation. - The type of the object to read. - - - Returns a Task that will yield an object of the specified type from the content instance. - An object instance of the specified type. - The HttpContent instance from which to read. - The collection of MediaTypeFormatter instances to use. - The token to cancel the operation. - The type of the object to read. - - - Returns a Task that will yield an object of the specified type from the content instance. - An object instance of the specified type. - The HttpContent instance from which to read. - The token to cancel the operation. - The type of the object to read. - - - Returns a Task that will yield an object of the specified type from the content instance. - A Task that will yield an object instance of the specified type. - The HttpContent instance from which to read. - The type of the object to read. - - - Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. - An object instance of the specified type. - The HttpContent instance from which to read. - The type of the object to read. - The collection of MediaTypeFormatter instances to use. - - - Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. - An object instance of the specified type. - The HttpContent instance from which to read. - The type of the object to read. - The collection of MediaTypeFormatter instances to use. - The IFormatterLogger to log events to. - - - Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. - An object instance of the specified type. - The HttpContent instance from which to read. - The type of the object to read. - The collection of MediaTypeFormatter instances to use. - The IFormatterLogger to log events to. - The token to cancel the operation. - - - Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. - An object instance of the specified type. - The HttpContent instance from which to read. - The type of the object to read. - The collection of MediaTypeFormatter instances to use. - The token to cancel the operation. - - - Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. - An object instance of the specified type. - The HttpContent instance from which to read. - The type of the object to read. - The token to cancel the operation. - - - Extension methods to read HTML form URL-encoded datafrom instances. - - - Determines whether the specified content is HTML form URL-encoded data. - true if the specified content is HTML form URL-encoded data; otherwise, false. - The content. - - - Asynchronously reads HTML form URL-encoded from an instance and stores the results in a object. - A task object representing the asynchronous operation. - The content. - - - Asynchronously reads HTML form URL-encoded from an instance and stores the results in a object. - A task object representing the asynchronous operation. - The content. - The token to cancel the operation. - - - Provides extension methods to read and entities from instances. - - - Determines whether the specified content is HTTP request message content. - true if the specified content is HTTP message content; otherwise, false. - The content to check. - - - Determines whether the specified content is HTTP response message content. - true if the specified content is HTTP message content; otherwise, false. - The content to check. - - - Reads the as an . - The parsed instance. - The content to read. - - - Reads the as an . - The parsed instance. - The content to read. - The URI scheme to use for the request URI. - - - Reads the as an . - The parsed instance. - The content to read. - The URI scheme to use for the request URI. - The size of the buffer. - - - Reads the as an . - The parsed instance. - The content to read. - The URI scheme to use for the request URI. - The size of the buffer. - The maximum length of the HTTP header. - - - - - - - Reads the as an . - The parsed instance. - The content to read. - - - Reads the as an . - The parsed instance. - The content to read. - The size of the buffer. - - - Reads the as an . - The parsed instance. - The content to read. - The size of the buffer. - The maximum length of the HTTP header. - - - - - - Extension methods to read MIME multipart entities from instances. - - - Determines whether the specified content is MIME multipart content. - true if the specified content is MIME multipart content; otherwise, false. - The content. - - - Determines whether the specified content is MIME multipart content with the specified subtype. - true if the specified content is MIME multipart content with the specified subtype; otherwise, false. - The content. - The MIME multipart subtype to match. - - - Reads all body parts within a MIME multipart message and produces a set of instances as a result. - A representing the tasks of getting the collection of instances where each instance represents a body part. - An existing instance to use for the object's content. - - - Reads all body parts within a MIME multipart message and produces a set of instances as a result. - A representing the tasks of getting the collection of instances where each instance represents a body part. - An existing instance to use for the object's content. - The token to cancel the operation. - - - Reads all body parts within a MIME multipart message and produces a set of instances as a result using the streamProvider instance to determine where the contents of each body part is written. - A representing the tasks of getting the collection of instances where each instance represents a body part. - An existing instance to use for the object's content. - A stream provider providing output streams for where to write body parts as they are parsed. - The type of the MIME multipart. - - - Reads all body parts within a MIME multipart message and produces a set of instances as a result using the streamProvider instance to determine where the contents of each body part is written and bufferSize as read buffer size. - A representing the tasks of getting the collection of instances where each instance represents a body part. - An existing instance to use for the object's content. - A stream provider providing output streams for where to write body parts as they are parsed. - Size of the buffer used to read the contents. - The type of the MIME multipart. - - - Reads all body parts within a MIME multipart message and produces a set of instances as a result using the streamProvider instance to determine where the contents of each body part is written and bufferSize as read buffer size. - A representing the tasks of getting the collection of instances where each instance represents a body part. - An existing instance to use for the object's content. - A stream provider providing output streams for where to write body parts as they are parsed. - Size of the buffer used to read the contents. - The token to cancel the operation. - The type of the MIME multipart. - - - Reads all body parts within a MIME multipart message and produces a set of instances as a result using the streamProvider instance to determine where the contents of each body part is written. - A representing the tasks of getting the collection of instances where each instance represents a body part. - An existing instance to use for the object's content. - A stream provider providing output streams for where to write body parts as they are parsed. - The token to cancel the operation. - The type of the MIME multipart. - - - Derived class which can encapsulate an or an as an entity with media type "application/http". - - - Initializes a new instance of the class encapsulating an . - The instance to encapsulate. - - - Initializes a new instance of the class encapsulating an . - The instance to encapsulate. - - - Releases unmanaged and - optionally - managed resources - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets the HTTP request message. - - - Gets the HTTP response message. - - - Asynchronously serializes the object's content to the given stream. - A instance that is asynchronously serializing the object's content. - The to which to write. - The associated . - - - Computes the length of the stream if possible. - true if the length has been computed; otherwise false. - The computed length of the stream. - - - Provides extension methods for the class. - - - Gets any cookie headers present in the request. - A collection of instances. - The request headers. - - - Gets any cookie headers present in the request that contain a cookie state whose name that matches the specified value. - A collection of instances. - The request headers. - The cookie state name to match. - - - - - Provides extension methods for the class. - - - Adds cookies to a response. Each Set-Cookie header is represented as one instance. A contains information about the domain, path, and other cookie information as well as one or more instances. Each instance contains a cookie name and whatever cookie state is associate with that name. The state is in the form of a which on the wire is encoded as HTML Form URL-encoded data. This representation allows for multiple related "cookies" to be carried within the same Cookie header while still providing separation between each cookie state. A sample Cookie header is shown below. In this example, there are two with names state1 and state2 respectively. Further, each cookie state contains two name/value pairs (name1/value1 and name2/value2) and (name3/value3 and name4/value4). <code> Set-Cookie: state1:name1=value1&amp;name2=value2; state2:name3=value3&amp;name4=value4; domain=domain1; path=path1; </code> - The response headers - The cookie values to add to the response. - - - An exception thrown by in case none of the requested ranges overlap with the current extend of the selected resource. The current extend of the resource is indicated in the ContentRange property. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - - - The current extend of the resource indicated in terms of a ContentRange header field. - - - Represents a multipart file data. - - - Initializes a new instance of the class. - The headers of the multipart file data. - The name of the local file for the multipart file data. - - - Gets or sets the headers of the multipart file data. - The headers of the multipart file data. - - - Gets or sets the name of the local file for the multipart file data. - The name of the local file for the multipart file data. - - - Represents an suited for writing each MIME body parts of the MIME multipart message to a file using a . - - - Initializes a new instance of the class. - The root path where the content of MIME multipart body parts are written to. - - - Initializes a new instance of the class. - The root path where the content of MIME multipart body parts are written to. - The number of bytes buffered for writes to the file. - - - Gets or sets the number of bytes buffered for writes to the file. - The number of bytes buffered for writes to the file. - - - Gets or sets the multipart file data. - The multipart file data. - - - Gets the name of the local file which will be combined with the root path to create an absolute file name where the contents of the current MIME body part will be stored. - A relative filename with no path component. - The headers for the current MIME body part. - - - Gets the stream instance where the message body part is written to. - The instance where the message body part is written to. - The content of HTTP. - The header fields describing the body part. - - - Gets or sets the root path where the content of MIME multipart body parts are written to. - The root path where the content of MIME multipart body parts are written to. - - - A implementation suited for use with HTML file uploads for writing file content to a remote storage . The stream provider looks at the Content-Disposition header field and determines an output remote based on the presence of a filename parameter. If a filename parameter is present in the Content-Disposition header field, then the body part is written to a remote provided by . Otherwise it is written to a . - - - Initializes a new instance of the class. - - - Read the non-file contents as form data. - A representing the post processing. - - - Read the non-file contents as form data. - A representing the post processing. - The token to monitor for cancellation requests. - - - Gets a collection of file data passed as part of the multipart form data. - - - Gets a of form data passed as part of the multipart form data. - - - Provides a for . Override this method to provide a remote stream to which the data should be written. - A result specifying a remote stream where the file will be written to and a location where the file can be accessed. It cannot be null and the stream must be writable. - The parent MIME multipart instance. - The header fields describing the body part's content. - - - - Represents an suited for use with HTML file uploads for writing file content to a . - - - Initializes a new instance of the class. - The root path where the content of MIME multipart body parts are written to. - - - Initializes a new instance of the class. - The root path where the content of MIME multipart body parts are written to. - The number of bytes buffered for writes to the file. - - - Reads the non-file contents as form data. - A task that represents the asynchronous operation. - - - - Gets a of form data passed as part of the multipart form data. - The of form data. - - - Gets the streaming instance where the message body part is written. - The instance where the message body part is written. - The HTTP content that contains this body part. - Header fields describing the body part. - - - Represents a multipart memory stream provider. - - - Initializes a new instance of the class. - - - Returns the for the . - The for the . - A object. - The HTTP content headers. - - - Represents the provider for the multipart related multistream. - - - Initializes a new instance of the class. - - - Gets the related stream for the provider. - The content headers. - The parent content. - The http content headers. - - - Gets the root content of the . - The root content of the . - - - Represents a multipart file data for remote storage. - - - Initializes a new instance of the class. - The headers of the multipart file data. - The remote file's location. - The remote file's name. - - - Gets the remote file's name. - - - Gets the headers of the multipart file data. - - - Gets the remote file's location. - - - Represents a stream provider that examines the headers provided by the MIME multipart parser as part of the MIME multipart extension methods (see ) and decides what kind of stream to return for the body part to be written to. - - - Initializes a new instance of the class. - - - Gets or sets the contents for this . - The contents for this . - - - Executes the post processing operation for this . - The asynchronous task for this operation. - - - Executes the post processing operation for this . - The asynchronous task for this operation. - The token to cancel the operation. - - - Gets the stream where to write the body part to. This method is called when a MIME multipart body part has been parsed. - The instance where the message body part is written to. - The content of the HTTP. - The header fields describing the body part. - - - Contains a value as well as an associated that will be used to serialize the value when writing this content. - - - Initializes a new instance of the class. - The type of object this instance will contain. - The value of the object this instance will contain. - The formatter to use when serializing the value. - - - Initializes a new instance of the class. - The type of object this instance will contain. - The value of the object this instance will contain. - The formatter to use when serializing the value. - The authoritative value of the Content-Type header. Can be null, in which case the default content type of the formatter will be used. - - - Initializes a new instance of the class. - The type of object this instance will contain. - The value of the object this instance will contain. - The formatter to use when serializing the value. - The authoritative value of the Content-Type header. - - - Gets the media-type formatter associated with this content instance. - The media type formatter associated with this content instance. - - - Gets the type of object managed by this instance. - The object type. - - - Asynchronously serializes the object's content to the given stream. - The task object representing the asynchronous operation. - The stream to write to. - The associated . - - - Computes the length of the stream if possible. - true if the length has been computed; otherwise, false. - Receives the computed length of the stream. - - - Gets or sets the value of the content. - The content value. - - - Generic form of . - The type of object this class will contain. - - - Initializes a new instance of the class. - The value of the object this instance will contain. - The formatter to use when serializing the value. - - - Initializes a new instance of the <see cref="T:System.Net.Http.ObjectContent`1" /> class. - The value of the object this instance will contain. - The formatter to use when serializing the value. - The authoritative value of the Content-Type header. Can be null, in which case the default content type of the formatter will be used. - - - Initializes a new instance of the class. - The value of the object this instance will contain. - The formatter to use when serializing the value. - The authoritative value of the Content-Type header. - - - Enables scenarios where a data producer wants to write directly (either synchronously or asynchronously) using a stream. - - - Initializes a new instance of the class. - An action that is called when an output stream is available, allowing the action to write to it directly. - - - Initializes a new instance of the class. - An action that is called when an output stream is available, allowing the action to write to it directly. - The media type. - - - Initializes a new instance of the class. - An action that is called when an output stream is available, allowing the action to write to it directly. - The media type. - - - Initializes a new instance of the class. - An action that is called when an output stream is available, allowing the action to write to it directly. - - - Initializes a new instance of the class. - An action that is called when an output stream is available, allowing the action to write to it directly. - The media type. - - - Initializes a new instance of the class. - An action that is called when an output stream is available, allowing the action to write to it directly. - The media type. - - - Asynchronously serializes the push content into stream. - The serialized push content. - The stream where the push content will be serialized. - The context. - - - Determines whether the stream content has a valid length in bytes. - true if length is a valid length; otherwise, false. - The length in bytes of the stream content. - - - Represents the result for . - - - Initializes a new instance of the class. - The remote stream instance where the file will be written to. - The remote file's location. - The remote file's name. - - - Gets the remote file's location. - - - Gets the remote file's location. - - - Gets the remote stream instance where the file will be written to. - - - Defines an exception type for signalling that a request's media type was not supported. - - - Initializes a new instance of the class. - The message that describes the error. - The unsupported media type. - - - Gets or sets the media type. - The media type. - - - Contains extension methods to allow strongly typed objects to be read from the query component of instances. - - - Parses the query portion of the specified URI. - A that contains the query parameters. - The URI to parse. - - - Reads HTML form URL encoded data provided in the URI query string as an object of a specified type. - true if the query component of the URI can be read as the specified type; otherwise, false. - The URI to read. - The type of object to read. - When this method returns, contains an object that is initialized from the query component of the URI. This parameter is treated as uninitialized. - - - Reads HTML form URL encoded data provided in the URI query string as an object of a specified type. - true if the query component of the URI can be read as the specified type; otherwise, false. - The URI to read. - When this method returns, contains an object that is initialized from the query component of the URI. This parameter is treated as uninitialized. - The type of object to read. - - - Reads HTML form URL encoded data provided in the query component as a object. - true if the query component can be read as ; otherwise false. - The instance from which to read. - An object to be initialized with this instance or null if the conversion cannot be performed. - - - Abstract media type formatter class to support Bson and Json. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The instance to copy settings from. - - - Determines whether this formatter can read objects of the specified type. - true if objects of this type can be read, otherwise false. - The type of object that will be read. - - - Determines whether this formatter can write objects of the specified type. - true if objects of this type can be written, otherwise false. - The type of object to write. - - - Creates a instance with the default settings used by the . - Returns . - - - Called during deserialization to get the . - The reader to use during deserialization. - The type of the object to read. - The stream from which to read. - The encoding to use when reading. - - - Called during serialization and deserialization to get the . - The JsonSerializer used during serialization and deserialization. - - - Called during serialization to get the . - The writer to use during serialization. - The type of the object to write. - The stream to write to. - The encoding to use when writing. - - - Gets or sets the maximum depth allowed by this formatter. - The maximum depth allowed by this formatter. - - - Called during deserialization to read an object of the specified type from the specified stream. - The object that has been read. - The type of the object to read. - The stream from which to read. - The encoding to use when reading. - The logger to log events to. - - - Called during deserialization to read an object of the specified type from the specified stream. - A task whose result will be the object instance that has been read. - The type of the object to read. - The stream from which to read. - The for the content being read. - The logger to log events to. - - - Gets or sets the JsonSerializerSettings used to configure the JsonSerializer. - The JsonSerializerSettings used to configure the JsonSerializer. - - - Called during serialization to write an object of the specified type to the specified stream. - The type of the object to write. - The object to write. - The stream to write to. - The encoding to use when writing. - - - Called during serialization to write an object of the specified type to the specified stream. - Returns . - The type of the object to write. - The object to write. - The stream to write to. - The for the content being written. - The transport context. - The token to monitor for cancellation. - - - Represents a media type formatter to handle Bson. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The formatter to copy settings from. - - - Called during deserialization to get the . - The reader to use during deserialization. - The type of the object to read. - The stream from which to read. - The encoding to use when reading. - - - Called during serialization to get the . - The writer to use during serialization. - The type of the object to write. - The stream to write to. - The encoding to use when writing. - - - Gets the default media type for Json, namely "application/bson". - The default media type for Json, namely "application/bson". - - - Gets or sets the maximum depth allowed by this formatter. - The maximum depth allowed by this formatter. - - - Called during deserialization to read an object of the specified type from the specified stream. - The object that has been read. - The type of the object to read. - The stream from which to read. - The encoding to use when reading. - The logger to log events to. - - - Called during deserialization to read an object of the specified type from the specified stream. - A task whose result will be the object instance that has been read. - The type of the object to read. - The stream from which to read. - The for the content being read. - The logger to log events to. - - - Called during serialization to write an object of the specified type to the specified stream. - The type of the object to write. - The object to write. - The stream to write to. - The encoding to use when writing. - - - Represents a helper class to allow a synchronous formatter on top of the asynchronous formatter infrastructure. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The instance to copy settings from. - - - Gets or sets the suggested size of buffer to use with streams in bytes. - The suggested size of buffer to use with streams in bytes. - - - Reads synchronously from the buffered stream. - An object of the given . - The type of the object to deserialize. - The stream from which to read. - The , if available. Can be null. - The to log events to. - - - Reads synchronously from the buffered stream. - An object of the given . - The type of the object to deserialize. - The stream from which to read. - The , if available. Can be null. - The to log events to. - The token to cancel the operation. - - - Reads asynchronously from the buffered stream. - A task object representing the asynchronous operation. - The type of the object to deserialize. - The stream from which to read. - The , if available. Can be null. - The to log events to. - - - Reads asynchronously from the buffered stream. - A task object representing the asynchronous operation. - The type of the object to deserialize. - The stream from which to read. - The , if available. Can be null. - The to log events to. - The token to cancel the operation. - - - Writes synchronously to the buffered stream. - The type of the object to serialize. - The object value to write. Can be null. - The stream to which to write. - The , if available. Can be null. - - - Writes synchronously to the buffered stream. - The type of the object to serialize. - The object value to write. Can be null. - The stream to which to write. - The , if available. Can be null. - The token to cancel the operation. - - - Writes asynchronously to the buffered stream. - A task object representing the asynchronous operation. - The type of the object to serialize. - The object value to write. It may be null. - The stream to which to write. - The , if available. Can be null. - The transport context. - - - Writes asynchronously to the buffered stream. - A task object representing the asynchronous operation. - The type of the object to serialize. - The object value to write. It may be null. - The stream to which to write. - The , if available. Can be null. - The transport context. - The token to cancel the operation. - - - Represents the result of content negotiation performed using <see cref="M:System.Net.Http.Formatting.IContentNegotiator.Negotiate(System.Type,System.Net.Http.HttpRequestMessage,System.Collections.Generic.IEnumerable{System.Net.Http.Formatting.MediaTypeFormatter})" /> - - - Create the content negotiation result object. - The formatter. - The preferred media type. Can be null. - - - The formatter chosen for serialization. - - - The media type that is associated with the formatter chosen for serialization. Can be null. - - - The default implementation of , which is used to select a for an or . - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - true to exclude formatters that match only on the object type; otherwise, false. - - - Determines how well each formatter matches an HTTP request. - Returns a collection of objects that represent all of the matches. - The type to be serialized. - The request. - The set of objects from which to choose. - - - If true, exclude formatters that match only on the object type; otherwise, false. - Returns a . - - - Matches a set of Accept header fields against the media types that a formatter supports. - Returns a object that indicates the quality of the match, or null if there is no match. - A list of Accept header values, sorted in descending order of q factor. You can create this list by calling the method. - The formatter to match against. - - - Matches a request against the objects in a media-type formatter. - Returns a object that indicates the quality of the match, or null if there is no match. - The request to match. - The media-type formatter. - - - Match the content type of a request against the media types that a formatter supports. - Returns a object that indicates the quality of the match, or null if there is no match. - The request to match. - The formatter to match against. - - - Selects the first supported media type of a formatter. - Returns a with set to MatchOnCanWriteType, or null if there is no match. A indicating the quality of the match or null is no match. - The type to match. - The formatter to match against. - - - Performs content negotiating by selecting the most appropriate out of the passed in for the given that can serialize an object of the given . - The result of the negotiation containing the most appropriate instance, or null if there is no appropriate formatter. - The type to be serialized. - The request. - The set of objects from which to choose. - - - Determines the best character encoding for writing the response. - Returns the that is the best match. - The request. - The selected media formatter. - - - Select the best match among the candidate matches found. - Returns the object that represents the best match. - The collection of matches. - - - Determine whether to match on type or not. This is used to determine whether to generate a 406 response or use the default media type formatter in case there is no match against anything in the request. If ExcludeMatchOnTypeOnly is true then we don't match on type unless there are no accept headers. - True if not ExcludeMatchOnTypeOnly and accept headers with a q-factor bigger than 0.0 are present. - The sorted accept header values to match. - - - Sorts Accept header values in descending order of q factor. - Returns the sorted list of MediaTypeWithQualityHeaderValue objects. - A collection of StringWithQualityHeaderValue objects, representing the header fields. - - - Sorts a list of Accept-Charset, Accept-Encoding, Accept-Language or related header values in descending order or q factor. - Returns the sorted list of StringWithQualityHeaderValue objects. - A collection of StringWithQualityHeaderValue objects, representing the header fields. - - - Evaluates whether a match is better than the current match. - Returns whichever object is a better match. - The current match. - The match to evaluate against the current match. - - - Helper class to serialize <see cref="T:System.Collections.Generic.IEnumerable`1" /> types by delegating them through a concrete implementation."/&gt;. - The interface implementing to proxy. - - - Initialize a DelegatingEnumerable. This constructor is necessary for to work. - - - Initialize a DelegatingEnumerable with an <see cref="T:System.Collections.Generic.IEnumerable`1" />. This is a helper class to proxy <see cref="T:System.Collections.Generic.IEnumerable`1" /> interfaces for . - The <see cref="T:System.Collections.Generic.IEnumerable`1" /> instance to get the enumerator from. - - - This method is not implemented but is required method for serialization to work. Do not use. - The item to add. Unused. - - - Get the enumerator of the associated <see cref="T:System.Collections.Generic.IEnumerable`1" />. - The enumerator of the <see cref="T:System.Collections.Generic.IEnumerable`1" /> source. - - - Get the enumerator of the associated <see cref="T:System.Collections.Generic.IEnumerable`1" />. - The enumerator of the <see cref="T:System.Collections.Generic.IEnumerable`1" /> source. - - - Represent the collection of form data. - - - Initializes a new instance of class. - The pairs. - - - Initializes a new instance of class. - The query. - - - Initializes a new instance of class. - The URI - - - Gets the collection of form data. - The collection of form data. - The key. - - - Gets an enumerable that iterates through the collection. - The enumerable that iterates through the collection. - - - Gets the values of the collection of form data. - The values of the collection of form data. - The key. - - - Gets values associated with a given key. If there are multiple values, they're concatenated. - Values associated with a given key. If there are multiple values, they're concatenated. - - - Reads the collection of form data as a collection of name value. - The collection of form data as a collection of name value. - - - Gets an enumerable that iterates through the collection. - The enumerable that iterates through the collection. - - - - class for handling HTML form URL-ended data, also known as application/x-www-form-urlencoded. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The instance to copy settings from. - - - Queries whether the can deserializean object of the specified type. - true if the can deserialize the type; otherwise, false. - The type to deserialize. - - - Queries whether the can serializean object of the specified type. - true if the can serialize the type; otherwise, false. - The type to serialize. - - - Gets the default media type for HTML form-URL-encoded data, which is application/x-www-form-urlencoded. - The default media type for HTML form-URL-encoded data - - - Gets or sets the maximum depth allowed by this formatter. - The maximum depth. - - - Gets or sets the size of the buffer when reading the incoming stream. - The buffer size. - - - Asynchronously deserializes an object of the specified type. - A whose result will be the object instance that has been read. - The type of object to deserialize. - The to read. - The for the content being read. - The to log events to. - - - Performs content negotiation. This is the process of selecting a response writer (formatter) in compliance with header values in the request. - - - Performs content negotiating by selecting the most appropriate out of the passed in formatters for the given request that can serialize an object of the given type. - The result of the negotiation containing the most appropriate instance, or null if there is no appropriate formatter. - The type to be serialized. - Request message, which contains the header values used to perform negotiation. - The set of objects from which to choose. - - - Specifies a callback interface that a formatter can use to log errors while reading. - - - Logs an error. - The path to the member for which the error is being logged. - The error message. - - - Logs an error. - The path to the member for which the error is being logged. - The error message to be logged. - - - Defines method that determines whether a given member is required on deserialization. - - - Determines whether a given member is required on deserialization. - true if should be treated as a required member; otherwise false. - The to be deserialized. - - - Represents the default used by . It uses the formatter's to select required members and recognizes the type annotation. - - - Initializes a new instance of the class. - The formatter to use for resolving required members. - - - Creates a property on the specified class by using the specified parameters. - A to create on the specified class by using the specified parameters. - The member info. - The member serialization. - - - Represents the class to handle JSON. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The instance to copy settings from. - - - Determines whether this can read objects of the specified . - true if objects of this can be read, otherwise false. - The type of object that will be read. - - - Determines whether this can write objects of the specified . - true if objects of this can be written, otherwise false. - The type of object that will be written. - - - Called during deserialization to get the . - The object used for serialization. - The type of object that will be serialized or deserialized. - - - Called during deserialization to get the . - The reader to use during deserialization. - The type of the object to read. - The stream from which to read. - The encoding to use when reading. - - - Called during serialization to get the . - The writer to use during serialization. - The type of the object to write. - The stream to write to. - The encoding to use when writing. - - - Gets the default media type for JSON, namely "application/json". - The for JSON. - - - Gets or sets a value indicating whether to indent elements when writing data. - true if to indent elements when writing data; otherwise, false. - - - Gets or sets the maximum depth allowed by this formatter. - The maximum depth allowed by this formatter. - - - Called during deserialization to read an object of the specified type from the specified stream. - The object that has been read. - The type of the object to read. - The stream from which to read. - The encoding to use when reading. - The logger to log events to. - - - Gets or sets a value indicating whether to use by default. - true if to by default; otherwise, false. - - - Called during serialization to write an object of the specified type to the specified stream. - The type of the object to write. - The object to write. - The stream to write to. - The encoding to use when writing. - - - Called during serialization to write an object of the specified type to the specified stream. - Returns . - The type of the object to write. - The object to write. - The stream to write to. - The for the content being written. - The transport context. - The token to monitor for cancellation. - - - Base class to handle serializing and deserializing strongly-typed objects using . - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The instance to copy settings from. - - - Queries whether this can deserializean object of the specified type. - true if the can deserialize the type; otherwise, false. - The type to deserialize. - - - Queries whether this can serializean object of the specified type. - true if the can serialize the type; otherwise, false. - The type to serialize. - - - Gets the default value for the specified type. - The default value. - The type for which to get the default value. - - - Returns a specialized instance of the that can format a response for the given parameters. - Returns . - The type to format. - The request. - The media type. - - - Gets or sets the maximum number of keys stored in a T: . - The maximum number of keys. - - - Gets the mutable collection of objects that match HTTP requests to media types. - The collection. - - - Asynchronously deserializes an object of the specified type. - A whose result will be an object of the given type. - The type of the object to deserialize. - The to read. - The , if available. It may be null. - The to log events to. - Derived types need to support reading. - - - Asynchronously deserializes an object of the specified type. - A whose result will be an object of the given type. - The type of the object to deserialize. - The to read. - The , if available. It may be null. - The to log events to. - The token to cancel the operation. - - - Gets or sets the instance used to determine required members. - The instance. - - - Determines the best character encoding for reading or writing an HTTP entity body, given a set of content headers. - The encoding that is the best match. - The content headers. - - - Sets the default headers for content that will be formatted using this formatter. This method is called from the constructor. This implementation sets the Content-Type header to the value of mediaType if it is not null. If it is null it sets the Content-Type to the default media type of this formatter. If the Content-Type does not specify a charset it will set it using this formatters configured . - The type of the object being serialized. See . - The content headers that should be configured. - The authoritative media type. Can be null. - - - Gets the mutable collection of character encodings supported bythis . - The collection of objects. - - - Gets the mutable collection of media types supported bythis . - The collection of objects. - - - Asynchronously writes an object of the specified type. - A that will perform the write. - The type of the object to write. - The object value to write. It may be null. - The to which to write. - The if available. It may be null. - The if available. It may be null. - Derived types need to support writing. - - - Asynchronously writes an object of the specified type. - A that will perform the write. - The type of the object to write. - The object value to write. It may be null. - The to which to write. - The if available. It may be null. - The if available. It may be null. - The token to cancel the operation. - Derived types need to support writing. - - - Collection class that contains instances. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - A collection of instances to place in the collection. - - - Adds the elements of the specified collection to the end of the . - The items that should be added to the end of the . The items collection itself cannot be , but it can contain elements that are . - - - Removes all items in the collection. - - - Helper to search a collection for a formatter that can read the .NET type in the given mediaType. - The formatter that can read the type. Null if no formatter found. - The .NET type to read - The media type to match on. - - - Helper to search a collection for a formatter that can write the .NET type in the given mediaType. - The formatter that can write the type. Null if no formatter found. - The .NET type to read - The media type to match on. - - - Gets the to use for application/x-www-form-urlencoded data. - The to use for application/x-www-form-urlencoded data. - - - Inserts the specified item at the specified index in the collection. - The index to insert at. - The item to insert. - - - Inserts the elements of a collection into the at the specified index. - The zero-based index at which the new elements should be inserted. - The items that should be inserted into the . The items collection itself cannot be , but it can contain elements that are . - - - Returns true if the type is one of those loosely defined types that should be excluded from validation. - true if the type should be excluded; otherwise, false. - The .NET to validate. - - - Gets the to use for JSON. - The to use for JSON. - - - Removes the item at the specified index. - The index of the item to remove. - - - Assigns the item at the specified index in the collection. - The index to insert at. - The item to assign. - - - Gets the to use for XML. - The to use for XML. - - - - - - - This class describes how well a particular matches a request. - - - Initializes a new instance of the class. - The matching formatter. - The media type. Can be null in which case the media type application/octet-stream is used. - The quality of the match. Can be null in which case it is considered a full match with a value of 1.0 - The kind of match. - - - Gets the media type formatter. - - - Gets the matched media type. - - - Gets the quality of the match - - - Gets the kind of match that occurred. - - - Contains information about the degree to which a matches the explicit or implicit preferences found in an incoming request. - - - Matched on a type, meaning that the formatter is able to serialize the type. - - - Matched on an explicit “*/*” range in the Accept header. - - - Matched on an explicit literal accept header, such as “application/json”. - - - Matched on an explicit subtype range in an Accept header, such as “application/*”. - - - Matched on the media type of the entity body in the HTTP request message. - - - Matched on after having applied the various s. - - - No match was found - - - An abstract base class used to create an association between or instances that have certain characteristics and a specific . - - - Initializes a new instance of a with the given mediaType value. - The that is associated with or instances that have the given characteristics of the . - - - Initializes a new instance of a with the given mediaType value. - The that is associated with or instances that have the given characteristics of the . - - - Gets the that is associated with or instances that have the given characteristics of the . - - - Returns the quality of the match of the associated with request. - The quality of the match. It must be between 0.0 and 1.0. A value of 0.0 signifies no match. A value of 1.0 signifies a complete match. - The to evaluate for the characteristics associated with the of the . - - - Class that provides s from query strings. - - - Initializes a new instance of the class. - The name of the query string parameter to match, if present. - The value of the query string parameter specified by queryStringParameterName. - The to use if the query parameter specified by queryStringParameterName is present and assigned the value specified by queryStringParameterValue. - - - Initializes a new instance of the class. - The name of the query string parameter to match, if present. - The value of the query string parameter specified by queryStringParameterName. - The media type to use if the query parameter specified by queryStringParameterName is present and assigned the value specified by queryStringParameterValue. - - - Gets the query string parameter name. - - - Gets the query string parameter value. - - - Returns a value indicating whether the current instance can return a from request. - If this instance can produce a from request it returns 1.0 otherwise 0.0. - The to check. - - - This class provides a mapping from an arbitrary HTTP request header field to a used to select instances for handling the entity body of an or . <remarks>This class only checks header fields associated with for a match. It does not check header fields associated with or instances.</remarks> - - - Initializes a new instance of the class. - Name of the header to match. - The header value to match. - The to use when matching headerValue. - if set to true then headerValue is considered a match if it matches a substring of the actual header value. - The to use if headerName and headerValue is considered a match. - - - Initializes a new instance of the class. - Name of the header to match. - The header value to match. - The value comparison to use when matching headerValue. - if set to true then headerValue is considered a match if it matches a substring of the actual header value. - The media type to use if headerName and headerValue is considered a match. - - - Gets the name of the header to match. - - - Gets the header value to match. - - - Gets the to use when matching . - - - Gets a value indicating whether is a matched as a substring of the actual header value. this instance is value substring. - truefalse - - - Returns a value indicating whether the current instance can return a from request. - The quality of the match. It must be between 0.0 and 1.0. A value of 0.0 signifies no match. A value of 1.0 signifies a complete match. - The to check. - - - A that maps the X-Requested-With http header field set by AJAX XmlHttpRequest (XHR) to the media type application/json if no explicit Accept header fields are present in the request. - - - Initializes a new instance of class - - - Returns a value indicating whether the current instance can return a from request. - The quality of the match. A value of 0.0 signifies no match. A value of 1.0 signifies a complete match and that the request was made using XmlHttpRequest without an Accept header. - The to check. - - - - class to handle Xml. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The instance to copy settings from. - - - Queries whether the can deserializean object of the specified type. - true if the can deserialize the type; otherwise, false. - The type to deserialize. - - - Queries whether the can serializean object of the specified type. - true if the can serialize the type; otherwise, false. - The type to serialize. - - - Called during deserialization to get the DataContractSerializer serializer. - The object used for serialization. - The type of object that will be serialized or deserialized. - - - Called during deserialization to get the XML reader to use for reading objects from the stream. - The to use for reading objects. - The to read from. - The for the content being read. - - - Called during deserialization to get the XML serializer. - The object used for serialization. - The type of object that will be serialized or deserialized. - - - Called during serialization to get the XML writer to use for writing objects to the stream. - The to use for writing objects. - The to write to. - The for the content being written. - - - Gets the default media type for the XML formatter. - The default media type, which is “application/xml”. - - - Called during deserialization to get the XML serializer to use for deserializing objects. - An instance of or to use for deserializing the object. - The type of object to deserialize. - The for the content being read. - - - Called during serialization to get the XML serializer to use for serializing objects. - An instance of or to use for serializing the object. - The type of object to serialize. - The object to serialize. - The for the content being written. - - - Gets or sets a value indicating whether to indent elements when writing data. - true to indent elements; otherwise, false. - - - This method is to support infrastructure and is not intended to be used directly from your code. - Returns . - - - This method is to support infrastructure and is not intended to be used directly from your code. - Returns . - - - This method is to support infrastructure and is not intended to be used directly from your code. - Returns . - - - This method is to support infrastructure and is not intended to be used directly from your code. - Returns . - - - Gets and sets the maximum nested node depth. - The maximum nested node depth. - - - Called during deserialization to read an object of the specified type from the specified readStream. - A whose result will be the object instance that has been read. - The type of object to read. - The from which to read. - The for the content being read. - The to log events to. - - - Unregisters the serializer currently associated with the given type. - true if a serializer was previously registered for the type; otherwise, false. - The type of object whose serializer should be removed. - - - Registers an to read or write objects of a specified type. - The instance. - The type of object that will be serialized or deserialized with. - - - Registers an to read or write objects of a specified type. - The type of object that will be serialized or deserialized with. - The instance. - - - Registers an to read or write objects of a specified type. - The type of object that will be serialized or deserialized with. - The instance. - - - Registers an to read or write objects of a specified type. - The instance. - The type of object that will be serialized or deserialized with. - - - Gets or sets a value indicating whether the XML formatter uses the as the default serializer, instead of using the . - If true, the formatter uses the by default; otherwise, it uses the by default. - - - Gets the settings to be used while writing. - The settings to be used while writing. - - - Called during serialization to write an object of the specified type to the specified writeStream. - A that will write the value to the stream. - The type of object to write. - The object to write. - The to which to write. - The for the content being written. - The . - The token to monitor cancellation. - - - Represents the event arguments for the HTTP progress. - - - Initializes a new instance of the class. - The percentage of the progress. - The user token. - The number of bytes transferred. - The total number of bytes transferred. - - - - - Generates progress notification for both request entities being uploaded and response entities being downloaded. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The inner message handler. - - - Occurs when event entities are being downloaded. - - - Occurs when event entities are being uploaded. - - - Raises the event that handles the request of the progress. - The request. - The event handler for the request. - - - Raises the event that handles the response of the progress. - The request. - The event handler for the request. - - - Sends the specified progress message to an HTTP server for delivery. - The sent progress message. - The request. - The cancellation token. - - - Provides value for the cookie header. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The value of the name. - The values. - - - Initializes a new instance of the class. - The value of the name. - The value. - - - Creates a shallow copy of the cookie value. - A shallow copy of the cookie value. - - - Gets a collection of cookies sent by the client. - A collection object representing the client’s cookie variables. - - - Gets or sets the domain to associate the cookie with. - The name of the domain to associate the cookie with. - - - Gets or sets the expiration date and time for the cookie. - The time of day (on the client) at which the cookie expires. - - - Gets or sets a value that specifies whether a cookie is accessible by client-side script. - true if the cookie has the HttpOnly attribute and cannot be accessed through a client-side script; otherwise, false. - - - Gets a shortcut to the cookie property. - The cookie value. - - - Gets or sets the maximum age permitted for a resource. - The maximum age permitted for a resource. - - - Gets or sets the virtual path to transmit with the current cookie. - The virtual path to transmit with the cookie. - - - Gets or sets a value indicating whether to transmit the cookie using Secure Sockets Layer (SSL)—that is, over HTTPS only. - true to transmit the cookie over an SSL connection (HTTPS); otherwise, false. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Indicates a value whether the string representation will be converted. - true if the string representation will be converted; otherwise, false. - The input value. - The parsed value to convert. - - - Contains cookie name and its associated cookie state. - - - Initializes a new instance of the class. - The name of the cookie. - - - Initializes a new instance of the class. - The name of the cookie. - The collection of name-value pair for the cookie. - - - Initializes a new instance of the class. - The name of the cookie. - The value of the cookie. - - - Returns a new object that is a copy of the current instance. - A new object that is a copy of the current instance. - - - Gets or sets the cookie value with the specified cookie name, if the cookie data is structured. - The cookie value with the specified cookie name. - - - Gets or sets the name of the cookie. - The name of the cookie. - - - Returns the string representation the current object. - The string representation the current object. - - - Gets or sets the cookie value, if cookie data is a simple string value. - The value of the cookie. - - - Gets or sets the collection of name-value pair, if the cookie data is structured. - The collection of name-value pair for the cookie. - - + + + + System.Net.Http.Formatting + + + + + implementation which provides a byte range view over a stream used to generate HTTP 206 (Partial Content) byte range responses. The supports one or more byte ranges regardless of whether the ranges are consecutive or not. If there is only one range then a single partial response body containing a Content-Range header is generated. If there are more than one ranges then a multipart/byteranges response is generated where each body part contains a range indicated by the associated Content-Range header field. + + + + implementation which provides a byte range view over a stream used to generate HTTP 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend of the selected resource represented by the content parameter then an is thrown indicating the valid Content-Range of the content. + The stream over which to generate a byte range view. + The range or ranges, typically obtained from the Range HTTP request header field. + The media type of the content stream. + + + + implementation which provides a byte range view over a stream used to generate HTTP 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend of the selected resource represented by the content parameter then an is thrown indicating the valid Content-Range of the content. + The stream over which to generate a byte range view. + The range or ranges, typically obtained from the Range HTTP request header field. + The media type of the content stream. + The buffer size used when copying the content stream. + + + + implementation which provides a byte range view over a stream used to generate HTTP 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend of the selected resource represented by the content parameter then an is thrown indicating the valid Content-Range of the content. + The stream over which to generate a byte range view. + The range or ranges, typically obtained from the Range HTTP request header field. + The media type of the content stream. + + + + implementation which provides a byte range view over a stream used to generate HTTP 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend of the selected resource represented by the content parameter then an is thrown indicating the valid Content-Range of the content. + The stream over which to generate a byte range view. + The range or ranges, typically obtained from the Range HTTP request header field. + The media type of the content stream. + The buffer size used when copying the content stream. + + + Releases the resources used by the current instance of the class. + true to release managed and unmanaged resources; false to release only unmanaged resources. + + + Asynchronously serialize and write the byte range to an HTTP content stream. + The task object representing the asynchronous operation. + The target stream. + Information about the transport. + + + Determines whether a byte array has a valid length in bytes. + true if length is a valid length; otherwise, false. + The length in bytes of the byte array. + + + Extension methods that aid in making formatted requests using . + + + + + + + + + Sends a POST request as an asynchronous operation to the specified Uri with the given value serialized as JSON. + A task object representing the asynchronous operation. + The client used to make the request. + The Uri the request is sent to. + The value that will be placed in the request's entity body. + The type of value. + + + Sends a POST request as an asynchronous operation to the specified Uri with the given value serialized as JSON. + A task object representing the asynchronous operation. + The client used to make the request. + The Uri the request is sent to. + The value that will be placed in the request's entity body. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The type of value. + + + + + + + + + Sends a POST request as an asynchronous operation to the specified Uri with the given value serialized as XML. + A task object representing the asynchronous operation. + The client used to make the request. + The Uri the request is sent to. + The value that will be placed in the request's entity body. + The type of value. + + + Sends a POST request as an asynchronous operation to the specified Uri with the given value serialized as XML. + A task object representing the asynchronous operation. + The client used to make the request. + The Uri the request is sent to. + The value that will be placed in the request's entity body. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The type of value. + + + + + + + + + + + + + + + + + + Sends a POST request as an asynchronous operation to the specified Uri with value serialized using the given formatter. + A task object representing the asynchronous operation. + The client used to make the request. + The Uri the request is sent to. + The value that will be placed in the request's entity body. + The formatter used to serialize the value. + The type of value. + + + Sends a POST request as an asynchronous operation to the specified Uri with value serialized using the given formatter. + A task object representing the asynchronous operation. + The client used to make the request. + The Uri the request is sent to. + The value that will be placed in the request's entity body. + The formatter used to serialize the value. + The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The type of value. + + + Sends a POST request as an asynchronous operation to the specified Uri with value serialized using the given formatter. + A task object representing the asynchronous operation. + The client used to make the request. + The Uri the request is sent to. + The value that will be placed in the request's entity body. + The formatter used to serialize the value. + The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. + The type of value. + + + Sends a POST request as an asynchronous operation to the specified Uri with value serialized using the given formatter. + A task object representing the asynchronous operation. + The client used to make the request. + The Uri the request is sent to. + The value that will be placed in the request's entity body. + The formatter used to serialize the value. + The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The type of value. + + + Sends a POST request as an asynchronous operation to the specified Uri with value serialized using the given formatter. + A task object representing the asynchronous operation. + The client used to make the request. + The Uri the request is sent to. + The value that will be placed in the request's entity body. + The formatter used to serialize the value. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The type of value. + + + + + + + + + Sends a PUT request as an asynchronous operation to the specified Uri with the given value serialized as JSON. + A task object representing the asynchronous operation. + The client used to make the request. + The Uri the request is sent to. + The value that will be placed in the request's entity body. + The type of value. + + + Sends a PUT request as an asynchronous operation to the specified Uri with the given value serialized as JSON. + A task object representing the asynchronous operation. + The client used to make the request. + The Uri the request is sent to. + The value that will be placed in the request's entity body. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The type of value. + + + + + + + + + Sends a PUT request as an asynchronous operation to the specified Uri with the given value serialized as XML. + A task object representing the asynchronous operation. + The client used to make the request. + The Uri the request is sent to. + The value that will be placed in the request's entity body. + The type of value. + + + Sends a PUT request as an asynchronous operation to the specified Uri with the given value serialized as XML. + A task object representing the asynchronous operation. + The client used to make the request. + The Uri the request is sent to. + The value that will be placed in the request's entity body. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The type of value. + + + + + + + + + + + + + + + + + + Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. + A task object representing the asynchronous operation. + The client used to make the request. + The Uri the request is sent to. + The value that will be placed in the request's entity body. + The formatter used to serialize the value. + The type of value. + + + Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. + A task object representing the asynchronous operation. + The client used to make the request. + The Uri the request is sent to. + The value that will be placed in the request's entity body. + The formatter used to serialize the value. + The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The type of value. + + + Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. + A task object representing the asynchronous operation. + The client used to make the request. + The Uri the request is sent to. + The value that will be placed in the request's entity body. + The formatter used to serialize the value. + The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. + The type of value. + + + Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. + A task object representing the asynchronous operation. + The client used to make the request. + The Uri the request is sent to. + The value that will be placed in the request's entity body. + The formatter used to serialize the value. + The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The type of value. + + + Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. + A task object representing the asynchronous operation. + The client used to make the request. + The Uri the request is sent to. + The value that will be placed in the request's entity body. + The formatter used to serialize the value. + A cancellation token that can be used by other objects or threads to receive notice of cancellation. + The type of value. + + + Represents the factory for creating new instance of . + + + Creates a new instance of the . + A new instance of the . + The list of HTTP handler that delegates the processing of HTTP response messages to another handler. + + + Creates a new instance of the . + A new instance of the . + The inner handler which is responsible for processing the HTTP response messages. + The list of HTTP handler that delegates the processing of HTTP response messages to another handler. + + + Creates a new instance of the which should be pipelined. + A new instance of the which should be pipelined. + The inner handler which is responsible for processing the HTTP response messages. + The list of HTTP handler that delegates the processing of HTTP response messages to another handler. + + + Specifies extension methods to allow strongly typed objects to be read from HttpContent instances. + + + Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance. + An object instance of the specified type. + The HttpContent instance from which to read. + The type of the object to read. + + + Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance. + An object instance of the specified type. + The HttpContent instance from which to read. + The collection of MediaTyepFormatter instances to use. + The type of the object to read. + + + Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance. + An object instance of the specified type. + The HttpContent instance from which to read. + The collection of MediaTypeFormatter instances to use. + The IFormatterLogger to log events to. + The type of the object to read. + + + Returns a Task that will yield an object of the specified type from the content instance. + An object instance of the specified type. + The HttpContent instance from which to read. + The collection of MediaTypeFormatter instances to use. + The IFormatterLogger to log events to. + The token to cancel the operation. + The type of the object to read. + + + Returns a Task that will yield an object of the specified type from the content instance. + An object instance of the specified type. + The HttpContent instance from which to read. + The collection of MediaTypeFormatter instances to use. + The token to cancel the operation. + The type of the object to read. + + + Returns a Task that will yield an object of the specified type from the content instance. + An object instance of the specified type. + The HttpContent instance from which to read. + The token to cancel the operation. + The type of the object to read. + + + Returns a Task that will yield an object of the specified type from the content instance. + A Task that will yield an object instance of the specified type. + The HttpContent instance from which to read. + The type of the object to read. + + + Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. + An object instance of the specified type. + The HttpContent instance from which to read. + The type of the object to read. + The collection of MediaTypeFormatter instances to use. + + + Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. + An object instance of the specified type. + The HttpContent instance from which to read. + The type of the object to read. + The collection of MediaTypeFormatter instances to use. + The IFormatterLogger to log events to. + + + Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. + An object instance of the specified type. + The HttpContent instance from which to read. + The type of the object to read. + The collection of MediaTypeFormatter instances to use. + The IFormatterLogger to log events to. + The token to cancel the operation. + + + Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. + An object instance of the specified type. + The HttpContent instance from which to read. + The type of the object to read. + The collection of MediaTypeFormatter instances to use. + The token to cancel the operation. + + + Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. + An object instance of the specified type. + The HttpContent instance from which to read. + The type of the object to read. + The token to cancel the operation. + + + Extension methods to read HTML form URL-encoded datafrom instances. + + + Determines whether the specified content is HTML form URL-encoded data. + true if the specified content is HTML form URL-encoded data; otherwise, false. + The content. + + + Asynchronously reads HTML form URL-encoded from an instance and stores the results in a object. + A task object representing the asynchronous operation. + The content. + + + Asynchronously reads HTML form URL-encoded from an instance and stores the results in a object. + A task object representing the asynchronous operation. + The content. + The token to cancel the operation. + + + Provides extension methods to read and entities from instances. + + + Determines whether the specified content is HTTP request message content. + true if the specified content is HTTP message content; otherwise, false. + The content to check. + + + Determines whether the specified content is HTTP response message content. + true if the specified content is HTTP message content; otherwise, false. + The content to check. + + + Reads the as an . + The parsed instance. + The content to read. + + + Reads the as an . + The parsed instance. + The content to read. + The URI scheme to use for the request URI. + + + Reads the as an . + The parsed instance. + The content to read. + The URI scheme to use for the request URI. + The size of the buffer. + + + Reads the as an . + The parsed instance. + The content to read. + The URI scheme to use for the request URI. + The size of the buffer. + The maximum length of the HTTP header. + + + + + + + Reads the as an . + The parsed instance. + The content to read. + + + Reads the as an . + The parsed instance. + The content to read. + The size of the buffer. + + + Reads the as an . + The parsed instance. + The content to read. + The size of the buffer. + The maximum length of the HTTP header. + + + + + + Extension methods to read MIME multipart entities from instances. + + + Determines whether the specified content is MIME multipart content. + true if the specified content is MIME multipart content; otherwise, false. + The content. + + + Determines whether the specified content is MIME multipart content with the specified subtype. + true if the specified content is MIME multipart content with the specified subtype; otherwise, false. + The content. + The MIME multipart subtype to match. + + + Reads all body parts within a MIME multipart message and produces a set of instances as a result. + A representing the tasks of getting the collection of instances where each instance represents a body part. + An existing instance to use for the object's content. + + + Reads all body parts within a MIME multipart message and produces a set of instances as a result. + A representing the tasks of getting the collection of instances where each instance represents a body part. + An existing instance to use for the object's content. + The token to cancel the operation. + + + Reads all body parts within a MIME multipart message and produces a set of instances as a result using the streamProvider instance to determine where the contents of each body part is written. + A representing the tasks of getting the collection of instances where each instance represents a body part. + An existing instance to use for the object's content. + A stream provider providing output streams for where to write body parts as they are parsed. + The type of the MIME multipart. + + + Reads all body parts within a MIME multipart message and produces a set of instances as a result using the streamProvider instance to determine where the contents of each body part is written and bufferSize as read buffer size. + A representing the tasks of getting the collection of instances where each instance represents a body part. + An existing instance to use for the object's content. + A stream provider providing output streams for where to write body parts as they are parsed. + Size of the buffer used to read the contents. + The type of the MIME multipart. + + + Reads all body parts within a MIME multipart message and produces a set of instances as a result using the streamProvider instance to determine where the contents of each body part is written and bufferSize as read buffer size. + A representing the tasks of getting the collection of instances where each instance represents a body part. + An existing instance to use for the object's content. + A stream provider providing output streams for where to write body parts as they are parsed. + Size of the buffer used to read the contents. + The token to cancel the operation. + The type of the MIME multipart. + + + Reads all body parts within a MIME multipart message and produces a set of instances as a result using the streamProvider instance to determine where the contents of each body part is written. + A representing the tasks of getting the collection of instances where each instance represents a body part. + An existing instance to use for the object's content. + A stream provider providing output streams for where to write body parts as they are parsed. + The token to cancel the operation. + The type of the MIME multipart. + + + Derived class which can encapsulate an or an as an entity with media type "application/http". + + + Initializes a new instance of the class encapsulating an . + The instance to encapsulate. + + + Initializes a new instance of the class encapsulating an . + The instance to encapsulate. + + + Releases unmanaged and - optionally - managed resources + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + Gets the HTTP request message. + + + Gets the HTTP response message. + + + Asynchronously serializes the object's content to the given stream. + A instance that is asynchronously serializing the object's content. + The to which to write. + The associated . + + + Computes the length of the stream if possible. + true if the length has been computed; otherwise false. + The computed length of the stream. + + + Provides extension methods for the class. + + + Gets any cookie headers present in the request. + A collection of instances. + The request headers. + + + Gets any cookie headers present in the request that contain a cookie state whose name that matches the specified value. + A collection of instances. + The request headers. + The cookie state name to match. + + + + + Provides extension methods for the class. + + + Adds cookies to a response. Each Set-Cookie header is represented as one instance. A contains information about the domain, path, and other cookie information as well as one or more instances. Each instance contains a cookie name and whatever cookie state is associate with that name. The state is in the form of a which on the wire is encoded as HTML Form URL-encoded data. This representation allows for multiple related "cookies" to be carried within the same Cookie header while still providing separation between each cookie state. A sample Cookie header is shown below. In this example, there are two with names state1 and state2 respectively. Further, each cookie state contains two name/value pairs (name1/value1 and name2/value2) and (name3/value3 and name4/value4). <code> Set-Cookie: state1:name1=value1&amp;name2=value2; state2:name3=value3&amp;name4=value4; domain=domain1; path=path1; </code> + The response headers + The cookie values to add to the response. + + + An exception thrown by in case none of the requested ranges overlap with the current extend of the selected resource. The current extend of the resource is indicated in the ContentRange property. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + + + The current extend of the resource indicated in terms of a ContentRange header field. + + + Represents a multipart file data. + + + Initializes a new instance of the class. + The headers of the multipart file data. + The name of the local file for the multipart file data. + + + Gets or sets the headers of the multipart file data. + The headers of the multipart file data. + + + Gets or sets the name of the local file for the multipart file data. + The name of the local file for the multipart file data. + + + Represents an suited for writing each MIME body parts of the MIME multipart message to a file using a . + + + Initializes a new instance of the class. + The root path where the content of MIME multipart body parts are written to. + + + Initializes a new instance of the class. + The root path where the content of MIME multipart body parts are written to. + The number of bytes buffered for writes to the file. + + + Gets or sets the number of bytes buffered for writes to the file. + The number of bytes buffered for writes to the file. + + + Gets or sets the multipart file data. + The multipart file data. + + + Gets the name of the local file which will be combined with the root path to create an absolute file name where the contents of the current MIME body part will be stored. + A relative filename with no path component. + The headers for the current MIME body part. + + + Gets the stream instance where the message body part is written to. + The instance where the message body part is written to. + The content of HTTP. + The header fields describing the body part. + + + Gets or sets the root path where the content of MIME multipart body parts are written to. + The root path where the content of MIME multipart body parts are written to. + + + A implementation suited for use with HTML file uploads for writing file content to a remote storage . The stream provider looks at the Content-Disposition header field and determines an output remote based on the presence of a filename parameter. If a filename parameter is present in the Content-Disposition header field, then the body part is written to a remote provided by . Otherwise it is written to a . + + + Initializes a new instance of the class. + + + Read the non-file contents as form data. + A representing the post processing. + + + Read the non-file contents as form data. + A representing the post processing. + The token to monitor for cancellation requests. + + + Gets a collection of file data passed as part of the multipart form data. + + + Gets a of form data passed as part of the multipart form data. + + + Provides a for . Override this method to provide a remote stream to which the data should be written. + A result specifying a remote stream where the file will be written to and a location where the file can be accessed. It cannot be null and the stream must be writable. + The parent MIME multipart instance. + The header fields describing the body part's content. + + + + Represents an suited for use with HTML file uploads for writing file content to a . + + + Initializes a new instance of the class. + The root path where the content of MIME multipart body parts are written to. + + + Initializes a new instance of the class. + The root path where the content of MIME multipart body parts are written to. + The number of bytes buffered for writes to the file. + + + Reads the non-file contents as form data. + A task that represents the asynchronous operation. + + + + Gets a of form data passed as part of the multipart form data. + The of form data. + + + Gets the streaming instance where the message body part is written. + The instance where the message body part is written. + The HTTP content that contains this body part. + Header fields describing the body part. + + + Represents a multipart memory stream provider. + + + Initializes a new instance of the class. + + + Returns the for the . + The for the . + A object. + The HTTP content headers. + + + Represents the provider for the multipart related multistream. + + + Initializes a new instance of the class. + + + Gets the related stream for the provider. + The content headers. + The parent content. + The http content headers. + + + Gets the root content of the . + The root content of the . + + + Represents a multipart file data for remote storage. + + + Initializes a new instance of the class. + The headers of the multipart file data. + The remote file's location. + The remote file's name. + + + Gets the remote file's name. + + + Gets the headers of the multipart file data. + + + Gets the remote file's location. + + + Represents a stream provider that examines the headers provided by the MIME multipart parser as part of the MIME multipart extension methods (see ) and decides what kind of stream to return for the body part to be written to. + + + Initializes a new instance of the class. + + + Gets or sets the contents for this . + The contents for this . + + + Executes the post processing operation for this . + The asynchronous task for this operation. + + + Executes the post processing operation for this . + The asynchronous task for this operation. + The token to cancel the operation. + + + Gets the stream where to write the body part to. This method is called when a MIME multipart body part has been parsed. + The instance where the message body part is written to. + The content of the HTTP. + The header fields describing the body part. + + + Contains a value as well as an associated that will be used to serialize the value when writing this content. + + + Initializes a new instance of the class. + The type of object this instance will contain. + The value of the object this instance will contain. + The formatter to use when serializing the value. + + + Initializes a new instance of the class. + The type of object this instance will contain. + The value of the object this instance will contain. + The formatter to use when serializing the value. + The authoritative value of the Content-Type header. Can be null, in which case the default content type of the formatter will be used. + + + Initializes a new instance of the class. + The type of object this instance will contain. + The value of the object this instance will contain. + The formatter to use when serializing the value. + The authoritative value of the Content-Type header. + + + Gets the media-type formatter associated with this content instance. + The media type formatter associated with this content instance. + + + Gets the type of object managed by this instance. + The object type. + + + Asynchronously serializes the object's content to the given stream. + The task object representing the asynchronous operation. + The stream to write to. + The associated . + + + Computes the length of the stream if possible. + true if the length has been computed; otherwise, false. + Receives the computed length of the stream. + + + Gets or sets the value of the content. + The content value. + + + Generic form of . + The type of object this class will contain. + + + Initializes a new instance of the class. + The value of the object this instance will contain. + The formatter to use when serializing the value. + + + Initializes a new instance of the <see cref="T:System.Net.Http.ObjectContent`1" /> class. + The value of the object this instance will contain. + The formatter to use when serializing the value. + The authoritative value of the Content-Type header. Can be null, in which case the default content type of the formatter will be used. + + + Initializes a new instance of the class. + The value of the object this instance will contain. + The formatter to use when serializing the value. + The authoritative value of the Content-Type header. + + + Enables scenarios where a data producer wants to write directly (either synchronously or asynchronously) using a stream. + + + Initializes a new instance of the class. + An action that is called when an output stream is available, allowing the action to write to it directly. + + + Initializes a new instance of the class. + An action that is called when an output stream is available, allowing the action to write to it directly. + The media type. + + + Initializes a new instance of the class. + An action that is called when an output stream is available, allowing the action to write to it directly. + The media type. + + + Initializes a new instance of the class. + An action that is called when an output stream is available, allowing the action to write to it directly. + + + Initializes a new instance of the class. + An action that is called when an output stream is available, allowing the action to write to it directly. + The media type. + + + Initializes a new instance of the class. + An action that is called when an output stream is available, allowing the action to write to it directly. + The media type. + + + Asynchronously serializes the push content into stream. + The serialized push content. + The stream where the push content will be serialized. + The context. + + + Determines whether the stream content has a valid length in bytes. + true if length is a valid length; otherwise, false. + The length in bytes of the stream content. + + + Represents the result for . + + + Initializes a new instance of the class. + The remote stream instance where the file will be written to. + The remote file's location. + The remote file's name. + + + Gets the remote file's location. + + + Gets the remote file's location. + + + Gets the remote stream instance where the file will be written to. + + + Defines an exception type for signalling that a request's media type was not supported. + + + Initializes a new instance of the class. + The message that describes the error. + The unsupported media type. + + + Gets or sets the media type. + The media type. + + + Contains extension methods to allow strongly typed objects to be read from the query component of instances. + + + Parses the query portion of the specified URI. + A that contains the query parameters. + The URI to parse. + + + Reads HTML form URL encoded data provided in the URI query string as an object of a specified type. + true if the query component of the URI can be read as the specified type; otherwise, false. + The URI to read. + The type of object to read. + When this method returns, contains an object that is initialized from the query component of the URI. This parameter is treated as uninitialized. + + + Reads HTML form URL encoded data provided in the URI query string as an object of a specified type. + true if the query component of the URI can be read as the specified type; otherwise, false. + The URI to read. + When this method returns, contains an object that is initialized from the query component of the URI. This parameter is treated as uninitialized. + The type of object to read. + + + Reads HTML form URL encoded data provided in the query component as a object. + true if the query component can be read as ; otherwise false. + The instance from which to read. + An object to be initialized with this instance or null if the conversion cannot be performed. + + + Abstract media type formatter class to support Bson and Json. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The instance to copy settings from. + + + Determines whether this formatter can read objects of the specified type. + true if objects of this type can be read, otherwise false. + The type of object that will be read. + + + Determines whether this formatter can write objects of the specified type. + true if objects of this type can be written, otherwise false. + The type of object to write. + + + Creates a instance with the default settings used by the . + Returns . + + + Called during deserialization to get the . + The reader to use during deserialization. + The type of the object to read. + The stream from which to read. + The encoding to use when reading. + + + Called during serialization and deserialization to get the . + The JsonSerializer used during serialization and deserialization. + + + Called during serialization to get the . + The writer to use during serialization. + The type of the object to write. + The stream to write to. + The encoding to use when writing. + + + Gets or sets the maximum depth allowed by this formatter. + The maximum depth allowed by this formatter. + + + Called during deserialization to read an object of the specified type from the specified stream. + The object that has been read. + The type of the object to read. + The stream from which to read. + The encoding to use when reading. + The logger to log events to. + + + Called during deserialization to read an object of the specified type from the specified stream. + A task whose result will be the object instance that has been read. + The type of the object to read. + The stream from which to read. + The for the content being read. + The logger to log events to. + + + Gets or sets the JsonSerializerSettings used to configure the JsonSerializer. + The JsonSerializerSettings used to configure the JsonSerializer. + + + Called during serialization to write an object of the specified type to the specified stream. + The type of the object to write. + The object to write. + The stream to write to. + The encoding to use when writing. + + + Called during serialization to write an object of the specified type to the specified stream. + Returns . + The type of the object to write. + The object to write. + The stream to write to. + The for the content being written. + The transport context. + The token to monitor for cancellation. + + + Represents a media type formatter to handle Bson. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The formatter to copy settings from. + + + Called during deserialization to get the . + The reader to use during deserialization. + The type of the object to read. + The stream from which to read. + The encoding to use when reading. + + + Called during serialization to get the . + The writer to use during serialization. + The type of the object to write. + The stream to write to. + The encoding to use when writing. + + + Gets the default media type for Json, namely "application/bson". + The default media type for Json, namely "application/bson". + + + Gets or sets the maximum depth allowed by this formatter. + The maximum depth allowed by this formatter. + + + Called during deserialization to read an object of the specified type from the specified stream. + The object that has been read. + The type of the object to read. + The stream from which to read. + The encoding to use when reading. + The logger to log events to. + + + Called during deserialization to read an object of the specified type from the specified stream. + A task whose result will be the object instance that has been read. + The type of the object to read. + The stream from which to read. + The for the content being read. + The logger to log events to. + + + Called during serialization to write an object of the specified type to the specified stream. + The type of the object to write. + The object to write. + The stream to write to. + The encoding to use when writing. + + + Represents a helper class to allow a synchronous formatter on top of the asynchronous formatter infrastructure. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The instance to copy settings from. + + + Gets or sets the suggested size of buffer to use with streams in bytes. + The suggested size of buffer to use with streams in bytes. + + + Reads synchronously from the buffered stream. + An object of the given . + The type of the object to deserialize. + The stream from which to read. + The , if available. Can be null. + The to log events to. + + + Reads synchronously from the buffered stream. + An object of the given . + The type of the object to deserialize. + The stream from which to read. + The , if available. Can be null. + The to log events to. + The token to cancel the operation. + + + Reads asynchronously from the buffered stream. + A task object representing the asynchronous operation. + The type of the object to deserialize. + The stream from which to read. + The , if available. Can be null. + The to log events to. + + + Reads asynchronously from the buffered stream. + A task object representing the asynchronous operation. + The type of the object to deserialize. + The stream from which to read. + The , if available. Can be null. + The to log events to. + The token to cancel the operation. + + + Writes synchronously to the buffered stream. + The type of the object to serialize. + The object value to write. Can be null. + The stream to which to write. + The , if available. Can be null. + + + Writes synchronously to the buffered stream. + The type of the object to serialize. + The object value to write. Can be null. + The stream to which to write. + The , if available. Can be null. + The token to cancel the operation. + + + Writes asynchronously to the buffered stream. + A task object representing the asynchronous operation. + The type of the object to serialize. + The object value to write. It may be null. + The stream to which to write. + The , if available. Can be null. + The transport context. + + + Writes asynchronously to the buffered stream. + A task object representing the asynchronous operation. + The type of the object to serialize. + The object value to write. It may be null. + The stream to which to write. + The , if available. Can be null. + The transport context. + The token to cancel the operation. + + + Represents the result of content negotiation performed using <see cref="M:System.Net.Http.Formatting.IContentNegotiator.Negotiate(System.Type,System.Net.Http.HttpRequestMessage,System.Collections.Generic.IEnumerable{System.Net.Http.Formatting.MediaTypeFormatter})" /> + + + Create the content negotiation result object. + The formatter. + The preferred media type. Can be null. + + + The formatter chosen for serialization. + + + The media type that is associated with the formatter chosen for serialization. Can be null. + + + The default implementation of , which is used to select a for an or . + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + true to exclude formatters that match only on the object type; otherwise, false. + + + Determines how well each formatter matches an HTTP request. + Returns a collection of objects that represent all of the matches. + The type to be serialized. + The request. + The set of objects from which to choose. + + + If true, exclude formatters that match only on the object type; otherwise, false. + Returns a . + + + Matches a set of Accept header fields against the media types that a formatter supports. + Returns a object that indicates the quality of the match, or null if there is no match. + A list of Accept header values, sorted in descending order of q factor. You can create this list by calling the method. + The formatter to match against. + + + Matches a request against the objects in a media-type formatter. + Returns a object that indicates the quality of the match, or null if there is no match. + The request to match. + The media-type formatter. + + + Match the content type of a request against the media types that a formatter supports. + Returns a object that indicates the quality of the match, or null if there is no match. + The request to match. + The formatter to match against. + + + Selects the first supported media type of a formatter. + Returns a with set to MatchOnCanWriteType, or null if there is no match. A indicating the quality of the match or null is no match. + The type to match. + The formatter to match against. + + + Performs content negotiating by selecting the most appropriate out of the passed in for the given that can serialize an object of the given . + The result of the negotiation containing the most appropriate instance, or null if there is no appropriate formatter. + The type to be serialized. + The request. + The set of objects from which to choose. + + + Determines the best character encoding for writing the response. + Returns the that is the best match. + The request. + The selected media formatter. + + + Select the best match among the candidate matches found. + Returns the object that represents the best match. + The collection of matches. + + + Determine whether to match on type or not. This is used to determine whether to generate a 406 response or use the default media type formatter in case there is no match against anything in the request. If ExcludeMatchOnTypeOnly is true then we don't match on type unless there are no accept headers. + True if not ExcludeMatchOnTypeOnly and accept headers with a q-factor bigger than 0.0 are present. + The sorted accept header values to match. + + + Sorts Accept header values in descending order of q factor. + Returns the sorted list of MediaTypeWithQualityHeaderValue objects. + A collection of StringWithQualityHeaderValue objects, representing the header fields. + + + Sorts a list of Accept-Charset, Accept-Encoding, Accept-Language or related header values in descending order or q factor. + Returns the sorted list of StringWithQualityHeaderValue objects. + A collection of StringWithQualityHeaderValue objects, representing the header fields. + + + Evaluates whether a match is better than the current match. + Returns whichever object is a better match. + The current match. + The match to evaluate against the current match. + + + Helper class to serialize <see cref="T:System.Collections.Generic.IEnumerable`1" /> types by delegating them through a concrete implementation."/&gt;. + The interface implementing to proxy. + + + Initialize a DelegatingEnumerable. This constructor is necessary for to work. + + + Initialize a DelegatingEnumerable with an <see cref="T:System.Collections.Generic.IEnumerable`1" />. This is a helper class to proxy <see cref="T:System.Collections.Generic.IEnumerable`1" /> interfaces for . + The <see cref="T:System.Collections.Generic.IEnumerable`1" /> instance to get the enumerator from. + + + This method is not implemented but is required method for serialization to work. Do not use. + The item to add. Unused. + + + Get the enumerator of the associated <see cref="T:System.Collections.Generic.IEnumerable`1" />. + The enumerator of the <see cref="T:System.Collections.Generic.IEnumerable`1" /> source. + + + Get the enumerator of the associated <see cref="T:System.Collections.Generic.IEnumerable`1" />. + The enumerator of the <see cref="T:System.Collections.Generic.IEnumerable`1" /> source. + + + Represent the collection of form data. + + + Initializes a new instance of class. + The pairs. + + + Initializes a new instance of class. + The query. + + + Initializes a new instance of class. + The URI + + + Gets the collection of form data. + The collection of form data. + The key. + + + Gets an enumerable that iterates through the collection. + The enumerable that iterates through the collection. + + + Gets the values of the collection of form data. + The values of the collection of form data. + The key. + + + Gets values associated with a given key. If there are multiple values, they're concatenated. + Values associated with a given key. If there are multiple values, they're concatenated. + + + Reads the collection of form data as a collection of name value. + The collection of form data as a collection of name value. + + + Gets an enumerable that iterates through the collection. + The enumerable that iterates through the collection. + + + + class for handling HTML form URL-ended data, also known as application/x-www-form-urlencoded. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The instance to copy settings from. + + + Queries whether the can deserializean object of the specified type. + true if the can deserialize the type; otherwise, false. + The type to deserialize. + + + Queries whether the can serializean object of the specified type. + true if the can serialize the type; otherwise, false. + The type to serialize. + + + Gets the default media type for HTML form-URL-encoded data, which is application/x-www-form-urlencoded. + The default media type for HTML form-URL-encoded data + + + Gets or sets the maximum depth allowed by this formatter. + The maximum depth. + + + Gets or sets the size of the buffer when reading the incoming stream. + The buffer size. + + + Asynchronously deserializes an object of the specified type. + A whose result will be the object instance that has been read. + The type of object to deserialize. + The to read. + The for the content being read. + The to log events to. + + + Performs content negotiation. This is the process of selecting a response writer (formatter) in compliance with header values in the request. + + + Performs content negotiating by selecting the most appropriate out of the passed in formatters for the given request that can serialize an object of the given type. + The result of the negotiation containing the most appropriate instance, or null if there is no appropriate formatter. + The type to be serialized. + Request message, which contains the header values used to perform negotiation. + The set of objects from which to choose. + + + Specifies a callback interface that a formatter can use to log errors while reading. + + + Logs an error. + The path to the member for which the error is being logged. + The error message. + + + Logs an error. + The path to the member for which the error is being logged. + The error message to be logged. + + + Defines method that determines whether a given member is required on deserialization. + + + Determines whether a given member is required on deserialization. + true if should be treated as a required member; otherwise false. + The to be deserialized. + + + Represents the default used by . It uses the formatter's to select required members and recognizes the type annotation. + + + Initializes a new instance of the class. + The formatter to use for resolving required members. + + + Creates a property on the specified class by using the specified parameters. + A to create on the specified class by using the specified parameters. + The member info. + The member serialization. + + + Represents the class to handle JSON. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The instance to copy settings from. + + + Determines whether this can read objects of the specified . + true if objects of this can be read, otherwise false. + The type of object that will be read. + + + Determines whether this can write objects of the specified . + true if objects of this can be written, otherwise false. + The type of object that will be written. + + + Called during deserialization to get the . + The object used for serialization. + The type of object that will be serialized or deserialized. + + + Called during deserialization to get the . + The reader to use during deserialization. + The type of the object to read. + The stream from which to read. + The encoding to use when reading. + + + Called during serialization to get the . + The writer to use during serialization. + The type of the object to write. + The stream to write to. + The encoding to use when writing. + + + Gets the default media type for JSON, namely "application/json". + The for JSON. + + + Gets or sets a value indicating whether to indent elements when writing data. + true if to indent elements when writing data; otherwise, false. + + + Gets or sets the maximum depth allowed by this formatter. + The maximum depth allowed by this formatter. + + + Called during deserialization to read an object of the specified type from the specified stream. + The object that has been read. + The type of the object to read. + The stream from which to read. + The encoding to use when reading. + The logger to log events to. + + + Gets or sets a value indicating whether to use by default. + true if to by default; otherwise, false. + + + Called during serialization to write an object of the specified type to the specified stream. + The type of the object to write. + The object to write. + The stream to write to. + The encoding to use when writing. + + + Called during serialization to write an object of the specified type to the specified stream. + Returns . + The type of the object to write. + The object to write. + The stream to write to. + The for the content being written. + The transport context. + The token to monitor for cancellation. + + + Base class to handle serializing and deserializing strongly-typed objects using . + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The instance to copy settings from. + + + Queries whether this can deserializean object of the specified type. + true if the can deserialize the type; otherwise, false. + The type to deserialize. + + + Queries whether this can serializean object of the specified type. + true if the can serialize the type; otherwise, false. + The type to serialize. + + + Gets the default value for the specified type. + The default value. + The type for which to get the default value. + + + Returns a specialized instance of the that can format a response for the given parameters. + Returns . + The type to format. + The request. + The media type. + + + Gets or sets the maximum number of keys stored in a T: . + The maximum number of keys. + + + Gets the mutable collection of objects that match HTTP requests to media types. + The collection. + + + Asynchronously deserializes an object of the specified type. + A whose result will be an object of the given type. + The type of the object to deserialize. + The to read. + The , if available. It may be null. + The to log events to. + Derived types need to support reading. + + + Asynchronously deserializes an object of the specified type. + A whose result will be an object of the given type. + The type of the object to deserialize. + The to read. + The , if available. It may be null. + The to log events to. + The token to cancel the operation. + + + Gets or sets the instance used to determine required members. + The instance. + + + Determines the best character encoding for reading or writing an HTTP entity body, given a set of content headers. + The encoding that is the best match. + The content headers. + + + Sets the default headers for content that will be formatted using this formatter. This method is called from the constructor. This implementation sets the Content-Type header to the value of mediaType if it is not null. If it is null it sets the Content-Type to the default media type of this formatter. If the Content-Type does not specify a charset it will set it using this formatters configured . + The type of the object being serialized. See . + The content headers that should be configured. + The authoritative media type. Can be null. + + + Gets the mutable collection of character encodings supported bythis . + The collection of objects. + + + Gets the mutable collection of media types supported bythis . + The collection of objects. + + + Asynchronously writes an object of the specified type. + A that will perform the write. + The type of the object to write. + The object value to write. It may be null. + The to which to write. + The if available. It may be null. + The if available. It may be null. + Derived types need to support writing. + + + Asynchronously writes an object of the specified type. + A that will perform the write. + The type of the object to write. + The object value to write. It may be null. + The to which to write. + The if available. It may be null. + The if available. It may be null. + The token to cancel the operation. + Derived types need to support writing. + + + Collection class that contains instances. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + A collection of instances to place in the collection. + + + Adds the elements of the specified collection to the end of the . + The items that should be added to the end of the . The items collection itself cannot be , but it can contain elements that are . + + + Removes all items in the collection. + + + Helper to search a collection for a formatter that can read the .NET type in the given mediaType. + The formatter that can read the type. Null if no formatter found. + The .NET type to read + The media type to match on. + + + Helper to search a collection for a formatter that can write the .NET type in the given mediaType. + The formatter that can write the type. Null if no formatter found. + The .NET type to read + The media type to match on. + + + Gets the to use for application/x-www-form-urlencoded data. + The to use for application/x-www-form-urlencoded data. + + + Inserts the specified item at the specified index in the collection. + The index to insert at. + The item to insert. + + + Inserts the elements of a collection into the at the specified index. + The zero-based index at which the new elements should be inserted. + The items that should be inserted into the . The items collection itself cannot be , but it can contain elements that are . + + + Returns true if the type is one of those loosely defined types that should be excluded from validation. + true if the type should be excluded; otherwise, false. + The .NET to validate. + + + Gets the to use for JSON. + The to use for JSON. + + + Removes the item at the specified index. + The index of the item to remove. + + + Assigns the item at the specified index in the collection. + The index to insert at. + The item to assign. + + + Gets the to use for XML. + The to use for XML. + + + + + + + This class describes how well a particular matches a request. + + + Initializes a new instance of the class. + The matching formatter. + The media type. Can be null in which case the media type application/octet-stream is used. + The quality of the match. Can be null in which case it is considered a full match with a value of 1.0 + The kind of match. + + + Gets the media type formatter. + + + Gets the matched media type. + + + Gets the quality of the match + + + Gets the kind of match that occurred. + + + Contains information about the degree to which a matches the explicit or implicit preferences found in an incoming request. + + + Matched on a type, meaning that the formatter is able to serialize the type. + + + Matched on an explicit “*/*” range in the Accept header. + + + Matched on an explicit literal accept header, such as “application/json”. + + + Matched on an explicit subtype range in an Accept header, such as “application/*”. + + + Matched on the media type of the entity body in the HTTP request message. + + + Matched on after having applied the various s. + + + No match was found + + + An abstract base class used to create an association between or instances that have certain characteristics and a specific . + + + Initializes a new instance of a with the given mediaType value. + The that is associated with or instances that have the given characteristics of the . + + + Initializes a new instance of a with the given mediaType value. + The that is associated with or instances that have the given characteristics of the . + + + Gets the that is associated with or instances that have the given characteristics of the . + + + Returns the quality of the match of the associated with request. + The quality of the match. It must be between 0.0 and 1.0. A value of 0.0 signifies no match. A value of 1.0 signifies a complete match. + The to evaluate for the characteristics associated with the of the . + + + Class that provides s from query strings. + + + Initializes a new instance of the class. + The name of the query string parameter to match, if present. + The value of the query string parameter specified by queryStringParameterName. + The to use if the query parameter specified by queryStringParameterName is present and assigned the value specified by queryStringParameterValue. + + + Initializes a new instance of the class. + The name of the query string parameter to match, if present. + The value of the query string parameter specified by queryStringParameterName. + The media type to use if the query parameter specified by queryStringParameterName is present and assigned the value specified by queryStringParameterValue. + + + Gets the query string parameter name. + + + Gets the query string parameter value. + + + Returns a value indicating whether the current instance can return a from request. + If this instance can produce a from request it returns 1.0 otherwise 0.0. + The to check. + + + This class provides a mapping from an arbitrary HTTP request header field to a used to select instances for handling the entity body of an or . <remarks>This class only checks header fields associated with for a match. It does not check header fields associated with or instances.</remarks> + + + Initializes a new instance of the class. + Name of the header to match. + The header value to match. + The to use when matching headerValue. + if set to true then headerValue is considered a match if it matches a substring of the actual header value. + The to use if headerName and headerValue is considered a match. + + + Initializes a new instance of the class. + Name of the header to match. + The header value to match. + The value comparison to use when matching headerValue. + if set to true then headerValue is considered a match if it matches a substring of the actual header value. + The media type to use if headerName and headerValue is considered a match. + + + Gets the name of the header to match. + + + Gets the header value to match. + + + Gets the to use when matching . + + + Gets a value indicating whether is a matched as a substring of the actual header value. this instance is value substring. + truefalse + + + Returns a value indicating whether the current instance can return a from request. + The quality of the match. It must be between 0.0 and 1.0. A value of 0.0 signifies no match. A value of 1.0 signifies a complete match. + The to check. + + + A that maps the X-Requested-With http header field set by AJAX XmlHttpRequest (XHR) to the media type application/json if no explicit Accept header fields are present in the request. + + + Initializes a new instance of class + + + Returns a value indicating whether the current instance can return a from request. + The quality of the match. A value of 0.0 signifies no match. A value of 1.0 signifies a complete match and that the request was made using XmlHttpRequest without an Accept header. + The to check. + + + + class to handle Xml. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The instance to copy settings from. + + + Queries whether the can deserializean object of the specified type. + true if the can deserialize the type; otherwise, false. + The type to deserialize. + + + Queries whether the can serializean object of the specified type. + true if the can serialize the type; otherwise, false. + The type to serialize. + + + Called during deserialization to get the DataContractSerializer serializer. + The object used for serialization. + The type of object that will be serialized or deserialized. + + + Called during deserialization to get the XML reader to use for reading objects from the stream. + The to use for reading objects. + The to read from. + The for the content being read. + + + Called during deserialization to get the XML serializer. + The object used for serialization. + The type of object that will be serialized or deserialized. + + + Called during serialization to get the XML writer to use for writing objects to the stream. + The to use for writing objects. + The to write to. + The for the content being written. + + + Gets the default media type for the XML formatter. + The default media type, which is “application/xml”. + + + Called during deserialization to get the XML serializer to use for deserializing objects. + An instance of or to use for deserializing the object. + The type of object to deserialize. + The for the content being read. + + + Called during serialization to get the XML serializer to use for serializing objects. + An instance of or to use for serializing the object. + The type of object to serialize. + The object to serialize. + The for the content being written. + + + Gets or sets a value indicating whether to indent elements when writing data. + true to indent elements; otherwise, false. + + + This method is to support infrastructure and is not intended to be used directly from your code. + Returns . + + + This method is to support infrastructure and is not intended to be used directly from your code. + Returns . + + + This method is to support infrastructure and is not intended to be used directly from your code. + Returns . + + + This method is to support infrastructure and is not intended to be used directly from your code. + Returns . + + + Gets and sets the maximum nested node depth. + The maximum nested node depth. + + + Called during deserialization to read an object of the specified type from the specified readStream. + A whose result will be the object instance that has been read. + The type of object to read. + The from which to read. + The for the content being read. + The to log events to. + + + Unregisters the serializer currently associated with the given type. + true if a serializer was previously registered for the type; otherwise, false. + The type of object whose serializer should be removed. + + + Registers an to read or write objects of a specified type. + The instance. + The type of object that will be serialized or deserialized with. + + + Registers an to read or write objects of a specified type. + The type of object that will be serialized or deserialized with. + The instance. + + + Registers an to read or write objects of a specified type. + The type of object that will be serialized or deserialized with. + The instance. + + + Registers an to read or write objects of a specified type. + The instance. + The type of object that will be serialized or deserialized with. + + + Gets or sets a value indicating whether the XML formatter uses the as the default serializer, instead of using the . + If true, the formatter uses the by default; otherwise, it uses the by default. + + + Gets the settings to be used while writing. + The settings to be used while writing. + + + Called during serialization to write an object of the specified type to the specified writeStream. + A that will write the value to the stream. + The type of object to write. + The object to write. + The to which to write. + The for the content being written. + The . + The token to monitor cancellation. + + + Represents the event arguments for the HTTP progress. + + + Initializes a new instance of the class. + The percentage of the progress. + The user token. + The number of bytes transferred. + The total number of bytes transferred. + + + + + Generates progress notification for both request entities being uploaded and response entities being downloaded. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The inner message handler. + + + Occurs when event entities are being downloaded. + + + Occurs when event entities are being uploaded. + + + Raises the event that handles the request of the progress. + The request. + The event handler for the request. + + + Raises the event that handles the response of the progress. + The request. + The event handler for the request. + + + Sends the specified progress message to an HTTP server for delivery. + The sent progress message. + The request. + The cancellation token. + + + Provides value for the cookie header. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The value of the name. + The values. + + + Initializes a new instance of the class. + The value of the name. + The value. + + + Creates a shallow copy of the cookie value. + A shallow copy of the cookie value. + + + Gets a collection of cookies sent by the client. + A collection object representing the client’s cookie variables. + + + Gets or sets the domain to associate the cookie with. + The name of the domain to associate the cookie with. + + + Gets or sets the expiration date and time for the cookie. + The time of day (on the client) at which the cookie expires. + + + Gets or sets a value that specifies whether a cookie is accessible by client-side script. + true if the cookie has the HttpOnly attribute and cannot be accessed through a client-side script; otherwise, false. + + + Gets a shortcut to the cookie property. + The cookie value. + + + Gets or sets the maximum age permitted for a resource. + The maximum age permitted for a resource. + + + Gets or sets the virtual path to transmit with the current cookie. + The virtual path to transmit with the cookie. + + + Gets or sets a value indicating whether to transmit the cookie using Secure Sockets Layer (SSL)—that is, over HTTPS only. + true to transmit the cookie over an SSL connection (HTTPS); otherwise, false. + + + Returns a string that represents the current object. + A string that represents the current object. + + + Indicates a value whether the string representation will be converted. + true if the string representation will be converted; otherwise, false. + The input value. + The parsed value to convert. + + + Contains cookie name and its associated cookie state. + + + Initializes a new instance of the class. + The name of the cookie. + + + Initializes a new instance of the class. + The name of the cookie. + The collection of name-value pair for the cookie. + + + Initializes a new instance of the class. + The name of the cookie. + The value of the cookie. + + + Returns a new object that is a copy of the current instance. + A new object that is a copy of the current instance. + + + Gets or sets the cookie value with the specified cookie name, if the cookie data is structured. + The cookie value with the specified cookie name. + + + Gets or sets the name of the cookie. + The name of the cookie. + + + Returns the string representation the current object. + The string representation the current object. + + + Gets or sets the cookie value, if cookie data is a simple string value. + The value of the cookie. + + + Gets or sets the collection of name-value pair, if the cookie data is structured. + The collection of name-value pair for the cookie. + + \ No newline at end of file diff --git a/lib/aspnetwebapi/System.Web.Http.WebHost.xml b/lib/aspnetwebapi/System.Web.Http.WebHost.xml index 06daedf5631..89aabcce6da 100644 --- a/lib/aspnetwebapi/System.Web.Http.WebHost.xml +++ b/lib/aspnetwebapi/System.Web.Http.WebHost.xml @@ -1,135 +1,135 @@ - - - - System.Web.Http.WebHost - - - - Provides a global for ASP.NET applications. - - - - - - Gets the global . - - - Extension methods for - - - Maps the specified route template. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - - - Maps the specified route template and sets default route. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - An object that contains default route values. - - - Maps the specified route template and sets default route values and constraints. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - An object that contains default route values. - A set of expressions that specify values for routeTemplate. - - - Maps the specified route template and sets default route values, constraints, and end-point message handler. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - An object that contains default route values. - A set of expressions that specify values for routeTemplate. - The handler to which the request will be dispatched. - - - A that passes ASP.NET requests into the pipeline and write the result back. - - - Initializes a new instance of the class. - The route data. - - - Initializes a new instance of the class. - The route data. - The message handler to dispatch requests to. - - - Provides code that handles an asynchronous task - The asynchronous task. - The HTTP context. - - - A that returns instances of that can pass requests to a given instance. - - - Initializes a new instance of the class. - - - Provides the object that processes the request. - An object that processes the request. - An object that encapsulates information about the request. - - - Gets the singleton instance. - - - Provides the object that processes the request. - An object that processes the request. - An object that encapsulates information about the request. - - - Provides a registration point for the simple membership pre-application start code. - - - Registers the simple membership pre-application start code. - - - Represents the web host buffer policy selector. - - - Initializes a new instance of the class. - - - Gets a value that indicates whether the host should buffer the entity body of the HTTP request. - true if buffering should be used; otherwise a streamed request should be used. - The host context. - - - Uses a buffered output stream for the web host. - A buffered output stream. - The response. - - - Provides the catch blocks used within this assembly. - - - Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteBufferedResponseContentAsync. - The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteBufferedResponseContentAsync. - - - Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteErrorResponseContentAsync. - The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteErrorResponseContentAsync. - - - Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.ComputeContentLength. - The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.ComputeContentLength. - - - Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteStreamedResponseContentAsync. - The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteStreamedResponseContentAsync. - - - Gets the label for the catch block in System.Web.Http.WebHost.WebHostExceptionCatchBlocks.HttpWebRoute.GetRouteData. - The catch block in System.Web.Http.WebHost.WebHostExceptionCatchBlocks.HttpWebRoute.GetRouteData. - - + + + + System.Web.Http.WebHost + + + + Provides a global for ASP.NET applications. + + + + + + Gets the global . + + + Extension methods for + + + Maps the specified route template. + A reference to the mapped route. + A collection of routes for the application. + The name of the route to map. + The route template for the route. + + + Maps the specified route template and sets default route. + A reference to the mapped route. + A collection of routes for the application. + The name of the route to map. + The route template for the route. + An object that contains default route values. + + + Maps the specified route template and sets default route values and constraints. + A reference to the mapped route. + A collection of routes for the application. + The name of the route to map. + The route template for the route. + An object that contains default route values. + A set of expressions that specify values for routeTemplate. + + + Maps the specified route template and sets default route values, constraints, and end-point message handler. + A reference to the mapped route. + A collection of routes for the application. + The name of the route to map. + The route template for the route. + An object that contains default route values. + A set of expressions that specify values for routeTemplate. + The handler to which the request will be dispatched. + + + A that passes ASP.NET requests into the pipeline and write the result back. + + + Initializes a new instance of the class. + The route data. + + + Initializes a new instance of the class. + The route data. + The message handler to dispatch requests to. + + + Provides code that handles an asynchronous task + The asynchronous task. + The HTTP context. + + + A that returns instances of that can pass requests to a given instance. + + + Initializes a new instance of the class. + + + Provides the object that processes the request. + An object that processes the request. + An object that encapsulates information about the request. + + + Gets the singleton instance. + + + Provides the object that processes the request. + An object that processes the request. + An object that encapsulates information about the request. + + + Provides a registration point for the simple membership pre-application start code. + + + Registers the simple membership pre-application start code. + + + Represents the web host buffer policy selector. + + + Initializes a new instance of the class. + + + Gets a value that indicates whether the host should buffer the entity body of the HTTP request. + true if buffering should be used; otherwise a streamed request should be used. + The host context. + + + Uses a buffered output stream for the web host. + A buffered output stream. + The response. + + + Provides the catch blocks used within this assembly. + + + Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteBufferedResponseContentAsync. + The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteBufferedResponseContentAsync. + + + Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteErrorResponseContentAsync. + The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteErrorResponseContentAsync. + + + Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.ComputeContentLength. + The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.ComputeContentLength. + + + Gets the label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteStreamedResponseContentAsync. + The label for the catch block in System.Web.Http.WebHost.HttpControllerHandler.WriteStreamedResponseContentAsync. + + + Gets the label for the catch block in System.Web.Http.WebHost.WebHostExceptionCatchBlocks.HttpWebRoute.GetRouteData. + The catch block in System.Web.Http.WebHost.WebHostExceptionCatchBlocks.HttpWebRoute.GetRouteData. + + \ No newline at end of file diff --git a/lib/aspnetwebapi/System.Web.Http.xml b/lib/aspnetwebapi/System.Web.Http.xml index db54457213d..365dd7b93ad 100644 --- a/lib/aspnetwebapi/System.Web.Http.xml +++ b/lib/aspnetwebapi/System.Web.Http.xml @@ -1,6664 +1,6664 @@ - - - - System.Web.Http - - - - - Creates an that represents an exception. - The request must be associated with an instance.An whose content is a serialized representation of an instance. - The HTTP request. - The status code of the response. - The exception. - - - Creates an that represents an error message. - The request must be associated with an instance.An whose content is a serialized representation of an instance. - The HTTP request. - The status code of the response. - The error message. - - - Creates an that represents an exception with an error message. - The request must be associated with an instance.An whose content is a serialized representation of an instance. - The HTTP request. - The status code of the response. - The error message. - The exception. - - - Creates an that represents an error. - The request must be associated with an instance.An whose content is a serialized representation of an instance. - The HTTP request. - The status code of the response. - The HTTP error. - - - Creates an that represents an error in the model state. - The request must be associated with an instance.An whose content is a serialized representation of an instance. - The HTTP request. - The status code of the response. - The model state. - - - Creates an wired up to the associated . - An initialized wired up to the associated . - The HTTP request message which led to this response message. - The HTTP response status code. - The content of the HTTP response message. - The type of the HTTP response message. - - - Creates an wired up to the associated . - An initialized wired up to the associated . - The HTTP request message which led to this response message. - The HTTP response status code. - The content of the HTTP response message. - The media type formatter. - The type of the HTTP response message. - - - Creates an wired up to the associated . - An initialized wired up to the associated . - The HTTP request message which led to this response message. - The HTTP response status code. - The content of the HTTP response message. - The media type formatter. - The media type header value. - The type of the HTTP response message. - - - Creates an wired up to the associated . - An initialized wired up to the associated . - The HTTP request message which led to this response message. - The HTTP response status code. - The content of the HTTP response message. - The media type formatter. - The media type. - The type of the HTTP response message. - - - Creates an wired up to the associated . - An initialized wired up to the associated . - The HTTP request message which led to this response message. - The HTTP response status code. - The content of the HTTP response message. - The media type header value. - The type of the HTTP response message. - - - Creates an wired up to the associated . - An initialized wired up to the associated . - The HTTP request message which led to this response message. - The HTTP response status code. - The content of the HTTP response message. - The media type. - The type of the HTTP response message. - - - Creates an wired up to the associated . - An initialized wired up to the associated . - The HTTP request message which led to this response message. - The HTTP response status code. - The content of the HTTP response message. - The HTTP configuration which contains the dependency resolver used to resolve services. - The type of the HTTP response message. - - - - - - Disposes of all tracked resources associated with the which were added via the method. - The HTTP request. - - - - Gets the current X.509 certificate from the given HTTP request. - The current , or null if a certificate is not available. - The HTTP request. - - - Retrieves the for the given request. - The for the given request. - The HTTP request. - - - Retrieves the which has been assigned as the correlation ID associated with the given . The value will be created and set the first time this method is called. - The object that represents the correlation ID associated with the request. - The HTTP request. - - - Retrieves the for the given request or null if not available. - The for the given request or null if not available. - The HTTP request. - - - Gets the parsed query string as a collection of key-value pairs. - The query string as a collection of key-value pairs. - The HTTP request. - - - - - Retrieves the for the given request or null if not available. - The for the given request or null if not available. - The HTTP request. - - - Retrieves the for the given request or null if not available. - The for the given request or null if not available. - The HTTP request. - - - Gets a instance for an HTTP request. - A instance that is initialized for the specified HTTP request. - The HTTP request. - - - - - - Adds the given to a list of resources that will be disposed by a host once the is disposed. - The HTTP request controlling the lifecycle of . - The resource to dispose when is being disposed. - - - - - - - Represents the message extensions for the HTTP response from an ASP.NET operation. - - - Attempts to retrieve the value of the content for the . - The result of the retrieval of value of the content. - The response of the operation. - The value of the content. - The type of the value to retrieve. - - - Represents extensions for adding items to a . - - - - - Provides s from path extensions appearing in a . - - - Initializes a new instance of the class. - The extension corresponding to mediaType. This value should not include a dot or wildcards. - The that will be returned if uriPathExtension is matched. - - - Initializes a new instance of the class. - The extension corresponding to mediaType. This value should not include a dot or wildcards. - The media type that will be returned if uriPathExtension is matched. - - - Returns a value indicating whether this instance can provide a for the of request. - If this instance can match a file extension in request it returns 1.0 otherwise 0.0. - The to check. - - - Gets the path extension. - The path extension. - - - The path extension key. - - - Represents an attribute that specifies which HTTP methods an action method will respond to. - - - Initializes a new instance of the class by using the action method it will respond to. - The HTTP method that the action method will respond to. - - - Initializes a new instance of the class by using a list of HTTP methods that the action method will respond to. - The HTTP methods that the action method will respond to. - - - Gets or sets the list of HTTP methods that the action method will respond to. - Gets or sets the list of HTTP methods that the action method will respond to. - - - Represents an attribute that is used for the name of an action. - - - Initializes a new instance of the class. - The name of the action. - - - Gets or sets the name of the action. - The name of the action. - - - Specifies that actions and controllers are skipped by during authorization. - - - Initializes a new instance of the class. - - - Defines properties and methods for API controller. - - - - Gets the action context. - The action context. - - - Creates a . - A . - - - Creates an (400 Bad Request) with the specified error message. - An with the specified model state. - The user-visible error message. - - - Creates an with the specified model state. - An with the specified model state. - The model state to include in the error. - - - Gets the of the current . - The of the current . - - - Creates a (409 Conflict). - A . - - - Creates a <see cref="T:System.Web.Http.NegotiatedContentResult`1" /> with the specified values. - A <see cref="T:System.Web.Http.NegotiatedContentResult`1" /> with the specified values. - The HTTP status code for the response message. - The content value to negotiate and format in the entity body. - The type of content in the entity body. - - - Creates a <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. - A <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. - The HTTP status code for the response message. - The content value to format in the entity body. - The formatter to use to format the content. - The type of content in the entity body. - - - Creates a <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. - A <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. - The HTTP status code for the response message. - The content value to format in the entity body. - The formatter to use to format the content. - The value for the Content-Type header, or <see langword="null" /> to have the formatter pick a default value. - The type of content in the entity body. - - - Creates a <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. - A <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. - The HTTP status code for the response message. - The content value to format in the entity body. - The formatter to use to format the content. - The value for the Content-Type header. - The type of content in the entity body. - - - Gets the of the current . - The of the current . - - - Creates a (201 Created) with the specified values. - A with the specified values. - The location at which the content has been created. - The content value to negotiate and format in the entity body. - The type of content in the entity body. - - - Creates a (201 Created) with the specified values. - A with the specified values. - The location at which the content has been created. - The content value to negotiate and format in the entity body. - The type of content in the entity body. - - - Creates a (201 Created) with the specified values. - A with the specified values. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - The content value to negotiate and format in the entity body. - The type of content in the entity body. - - - Creates a (201 Created) with the specified values. - A with the specified values. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - The content value to negotiate and format in the entity body. - The type of content in the entity body. - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - Releases the unmanaged resources that are used by the object and, optionally, releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Executes asynchronously a single HTTP operation. - The newly started task. - The controller context for a single HTTP operation. - The cancellation token assigned for the HTTP operation. - - - Initializes the instance with the specified controllerContext. - The object that is used for the initialization. - - - Creates an (500 Internal Server Error). - A . - - - Creates an (500 Internal Server Error) with the specified exception. - An with the specified exception. - The exception to include in the error. - - - Creates a (200 OK) with the specified value. - A with the specified value. - The content value to serialize in the entity body. - The type of content in the entity body. - - - Creates a (200 OK) with the specified values. - A with the specified values. - The content value to serialize in the entity body. - The serializer settings. - The type of content in the entity body. - - - Creates a (200 OK) with the specified values. - A with the specified values. - The content value to serialize in the entity body. - The serializer settings. - The content encoding. - The type of content in the entity body. - - - Gets the model state after the model binding process. - The model state after the model binding process. - - - Creates a . - A . - - - Creates an (200 OK). - An . - - - Creates an with the specified values. - An with the specified values. - The content value to negotiate and format in the entity body. - The type of content in the entity body. - - - Creates a redirect result (302 Found) with the specified value. - A redirect result (302 Found) with the specified value. - The location to redirect to. - - - Creates a redirect result (302 Found) with the specified value. - A redirect result (302 Found) with the specified value. - The location to redirect to. - - - Creates a redirect to route result (302 Found) with the specified values. - A redirect to route result (302 Found) with the specified values. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - - - Creates a redirect to route result (302 Found) with the specified values. - A redirect to route result (302 Found) with the specified values. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - - - Gets or sets the HttpRequestMessage of the current . - The HttpRequestMessage of the current . - - - Gets the request context. - The request context. - - - Creates a with the specified response. - A for the specified response. - The HTTP response message. - - - Creates a with the specified status code. - A with the specified status code. - The HTTP status code for the response message - - - Creates an (401 Unauthorized) with the specified values. - An with the specified values. - The WWW-Authenticate challenges. - - - Creates an (401 Unauthorized) with the specified values. - An with the specified values. - The WWW-Authenticate challenges. - - - Gets an instance of a , which is used to generate URLs to other APIs. - A , which is used to generate URLs to other APIs. - - - Returns the current principal associated with this request. - The current principal associated with this request. - - - Validates the given entity and adds the validation errors to the model state under the empty prefix, if any. - The entity being validated. - The type of the entity to be validated. - - - Validates the given entity and adds the validation errors to the model state, if any. - The entity being validated. - The key prefix under which the model state errors would be added in the model state. - The type of the entity to be validated. - - - Specifies the authorization filter that verifies the request's . - - - Initializes a new instance of the class. - - - Processes requests that fail authorization. - The context. - - - Indicates whether the specified control is authorized. - true if the control is authorized; otherwise, false. - The context. - - - Calls when an action is being authorized. - The context. - The context parameter is null. - - - Gets or sets the authorized roles. - The roles string. - - - Gets a unique identifier for this attribute. - A unique identifier for this attribute. - - - Gets or sets the authorized users. - The users string. - - - An attribute that specifies that an action parameter comes only from the entity body of the incoming . - - - Initializes a new instance of the class. - - - Gets a parameter binding. - The parameter binding. - The parameter description. - - - An attribute that specifies that an action parameter comes from the URI of the incoming . - - - Initializes a new instance of the class. - - - Gets the value provider factories for the model binder. - A collection of objects. - The configuration. - - - Represents attributes that specifies that HTTP binding should exclude a property. - - - Initializes a new instance of the class. - - - Represents the required attribute for http binding. - - - Initializes a new instance of the class. - - - Represents a configuration of instances. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with an HTTP route collection. - The HTTP route collection to associate with this instance. - - - Gets or sets the dependency resolver associated with thisinstance. - The dependency resolver. - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - Releases the unmanaged resources that are used by the object and, optionally, releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Invoke the Intializer hook. It is considered immutable from this point forward. It's safe to call this multiple times. - - - Gets the list of filters that apply to all requests served using this instance. - The list of filters. - - - Gets the media-type formatters for this instance. - A collection of objects. - - - Gets or sets a value indicating whether error details should be included in error messages. - The value that indicates that error detail policy. - - - Gets or sets the action that will perform final initialization of the instance before it is used to process requests. - The action that will perform final initialization of the instance. - - - Gets an ordered list of instances to be invoked as an travels up the stack and an travels down in stack in return. - The message handler collection. - - - Gets the collection of rules for how parameters should be bound. - A collection of functions that can produce a parameter binding for a given parameter. - - - Gets the properties associated with this instance. - The that contains the properties. - - - Gets the associated with this instance. - The . - - - Gets the container of default services associated with this instance. - The that contains the default services for this instance. - - - Gets the root virtual path. - The root virtual path. - - - Contains extension methods for the class. - - - - - Maps the attribute-defined routes for the application. - The server configuration. - The to use for discovering and building routes. - - - Maps the attribute-defined routes for the application. - The server configuration. - The constraint resolver. - - - Maps the attribute-defined routes for the application. - The server configuration. - The to use for resolving inline constraints. - The to use for discovering and building routes. - - - - Specifies that an action supports the DELETE HTTP method. - - - Initializes a new instance of the class. - - - Gets the http methods that correspond to this attribute. - The http methods that correspond to this attribute. - - - Defines a serializable container for storing error information. This information is stored as key/value pairs. The dictionary keys to look up standard error information are available on the type. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class for . - The exception to use for error information. - true to include the exception information in the error; false otherwise - - - Initializes a new instance of the class containing error message . - The error message to associate with this instance. - - - Initializes a new instance of the class for . - The invalid model state to use for error information. - true to include exception messages in the error; false otherwise - - - Gets or sets the message of the if available. - The message of the if available. - - - Gets or sets the type of the if available. - The type of the if available. - - - Gets a particular property value from this error instance. - A particular property value from this error instance. - The name of the error property. - The type of the property. - - - Gets the inner associated with this instance if available. - The inner associated with this instance if available. - - - Gets or sets the high-level, user-visible message explaining the cause of the error. Information carried in this field should be considered public in that it will go over the wire regardless of the . As a result care should be taken not to disclose sensitive information about the server or the application. - The high-level, user-visible message explaining the cause of the error. Information carried in this field should be considered public in that it will go over the wire regardless of the . As a result care should be taken not to disclose sensitive information about the server or the application. - - - Gets or sets a detailed description of the error intended for the developer to understand exactly what failed. - A detailed description of the error intended for the developer to understand exactly what failed. - - - Gets the containing information about the errors that occurred during model binding. - The containing information about the errors that occurred during model binding. - - - Gets or sets the stack trace information associated with this instance if available. - The stack trace information associated with this instance if available. - - - This method is reserved and should not be used. - Always returns null. - - - Generates an instance from its XML representation. - The XmlReader stream from which the object is deserialized. - - - Converts an instance into its XML representation. - The XmlWriter stream to which the object is serialized. - - - Provides keys to look up error information stored in the dictionary. - - - Provides a key for the ErrorCode. - - - Provides a key for the ExceptionMessage. - - - Provides a key for the ExceptionType. - - - Provides a key for the InnerException. - - - Provides a key for the MessageDetail. - - - Provides a key for the Message. - - - Provides a key for the MessageLanguage. - - - Provides a key for the ModelState. - - - Provides a key for the StackTrace. - - - Specifies that an action supports the GET HTTP method. - - - Initializes a new instance of the class. - - - Gets the http methods that correspond to this attribute. - The http methods that correspond to this attribute. - - - Specifies that an action supports the HEAD HTTP method. - - - Initializes a new instance of the class. - - - Gets the http methods that correspond to this attribute. - The http methods that correspond to this attribute. - - - Represents an attribute that is used to restrict an HTTP method so that the method handles only HTTP OPTIONS requests. - - - Initializes a new instance of the class. - - - Gets the http methods that correspond to this attribute. - The http methods that correspond to this attribute. - - - Specifies that an action supports the PATCH HTTP method. - - - Initializes a new instance of the class. - - - Gets the http methods that correspond to this attribute. - The http methods that correspond to this attribute. - - - Specifies that an action supports the POST HTTP method. - - - Initializes a new instance of the class. - - - Gets the http methods that correspond to this attribute. - The http methods that correspond to this attribute. - - - Represents an attribute that is used to restrict an HTTP method so that the method handles only HTTP PUT requests. - - - Initializes a new instance of the class. - - - Gets the http methods that correspond to this attribute. - The http methods that correspond to this attribute. - - - An exception that allows for a given to be returned to the client. - - - Initializes a new instance of the class. - The HTTP response to return to the client. - - - Initializes a new instance of the class. - The status code of the response. - - - Gets the HTTP response to return to the client. - The that represents the HTTP response. - - - A collection of instances. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The virtual path root. - - - Adds an instance to the collection. - The name of the route. - The instance to add to the collection. - - - Removes all items from the collection. - - - Determines whether the collection contains a specific . - true if the is found in the collection; otherwise, false. - The object to locate in the collection. - - - Determines whether the collection contains an element with the specified key. - true if the collection contains an element with the key; otherwise, false. - The key to locate in the collection. - - - Copies the instances of the collection to an array, starting at a particular array index. - The array that is the destination of the elements copied from the collection. - The zero-based index in at which copying begins. - - - Copies the route names and instances of the collection to an array, starting at a particular array index. - The array that is the destination of the elements copied from the collection. - The zero-based index in at which copying begins. - - - Gets the number of items in the collection. - The number of items in the collection. - - - Creates an instance. - The new instance. - The route template. - An object that contains the default route parameters. - An object that contains the route constraints. - The route data tokens. - - - Creates an instance. - The new instance. - The route template. - An object that contains the default route parameters. - An object that contains the route constraints. - The route data tokens. - The message handler for the route. - - - Creates an instance. - The new instance. - The route template. - An object that contains the default route parameters. - An object that contains the route constraints. - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - Releases the unmanaged resources that are used by the object and, optionally, releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Returns an enumerator that iterates through the collection. - An that can be used to iterate through the collection. - - - Gets the route data for a specified HTTP request. - An instance that represents the route data. - The HTTP request. - - - Gets a virtual path. - An instance that represents the virtual path. - The HTTP request. - The route name. - The route values. - - - Inserts an instance into the collection. - The zero-based index at which should be inserted. - The route name. - The to insert. The value cannot be null. - - - Gets a value indicating whether the collection is read-only. - true if the collection is read-only; otherwise, false. - - - Gets or sets the element at the specified index. - The at the specified index. - The index. - - - Gets or sets the element with the specified route name. - The at the specified index. - The route name. - - - Called internally to get the enumerator for the collection. - An that can be used to iterate through the collection. - - - Removes an instance from the collection. - true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the collection. - The name of the route to remove. - - - Adds an item to the collection. - The object to add to the collection. - - - Removes the first occurrence of a specific object from the collection. - true if was successfully removed from the collection; otherwise, false. This method also returns false if is not found in the original collection. - The object to remove from the collection. - - - Returns an enumerator that iterates through the collection. - An object that can be used to iterate through the collection. - - - Gets the with the specified route name. - true if the collection contains an element with the specified name; otherwise, false. - The route name. - When this method returns, contains the instance, if the route name is found; otherwise, null. This parameter is passed uninitialized. - - - Validates that a constraint is valid for an created by a call to the method. - The route template. - The constraint name. - The constraint object. - - - Gets the virtual path root. - The virtual path root. - - - Extension methods for - - - Ignores the specified route. - Returns . - A collection of routes for the application. - The name of the route to ignore. - The route template for the route. - - - Ignores the specified route. - Returns . - A collection of routes for the application. - The name of the route to ignore. - The route template for the route. - A set of expressions that specify values for the route template. - - - Maps the specified route for handling HTTP batch requests. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - The for handling batch requests. - - - Maps the specified route template. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - - - Maps the specified route template and sets default route values. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - An object that contains default route values. - - - Maps the specified route template and sets default route values and constraints. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - An object that contains default route values. - A set of expressions that specify values for . - - - Maps the specified route template and sets default route values, constraints, and end-point message handler. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - An object that contains default route values. - A set of expressions that specify values for . - The handler to which the request will be dispatched. - - - Defines an implementation of an which dispatches an incoming and creates an as a result. - - - Initializes a new instance of the class, using the default configuration and dispatcher. - - - Initializes a new instance of the class with a specified dispatcher. - The HTTP dispatcher that will handle incoming requests. - - - Initializes a new instance of the class with a specified configuration. - The used to configure this instance. - - - Initializes a new instance of the class with a specified configuration and dispatcher. - The used to configure this instance. - The HTTP dispatcher that will handle incoming requests. - - - Gets the used to configure this instance. - The used to configure this instance. - - - Gets the HTTP dispatcher that handles incoming requests. - The HTTP dispatcher that handles incoming requests. - - - Releases the unmanaged resources that are used by the object and, optionally, releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Prepares the server for operation. - - - Dispatches an incoming . - A task representing the asynchronous operation. - The request to dispatch. - The token to monitor for cancellation requests. - - - Defines a command that asynchronously creates an . - - - Creates an asynchronously. - A task that, when completed, contains the . - The token to monitor for cancellation requests. - - - Specifies whether error details, such as exception messages and stack traces, should be included in error messages. - - - Always include error details. - - - Use the default behavior for the host environment. For ASP.NET hosting, use the value from the customErrors element in the Web.config file. For self-hosting, use the value . - - - Only include error details when responding to a local request. - - - Never include error details. - - - Represents an attribute that is used to indicate that a controller method is not an action method. - - - Initializes a new instance of the class. - - - Represents a filter attribute that overrides action filters defined at a higher level. - - - Initializes a new instance of the class. - - - Gets a value indicating whether the action filter allows multiple attribute. - true if the action filter allows multiple attribute; otherwise, false. - - - Gets the type of filters to override. - The type of filters to override. - - - Represents a filter attribute that overrides authentication filters defined at a higher level. - - - - - - Represents a filter attribute that overrides authorization filters defined at a higher level. - - - Initializes a new instance of the class. - - - Gets or sets a Boolean value indicating whether more than one instance of the indicated attribute can be specified for a single program element. - true if more than one instance is allowed to be specified; otherwise, false. - - - Gets the type to filters override attributes. - The type to filters override attributes. - - - Represents a filter attribute that overrides exception filters defined at a higher level. - - - - - - Attribute on a parameter or type that produces a . If the attribute is on a type-declaration, then it's as if that attribute is present on all action parameters of that type. - - - Initializes a new instance of the class. - - - Gets the parameter binding. - The parameter binding. - The parameter description. - - - Place on an action to expose it directly via a route. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The route template describing the URI pattern to match against. - - - Returns . - - - Returns . - - - - Returns . - - - The class can be used to indicate properties about a route parameter (the literals and placeholders located within segments of a ). It can for example be used to indicate that a route parameter is optional. - - - An optional parameter. - - - Returns a that represents this instance. - A that represents this instance. - - - Annotates a controller with a route prefix that applies to all actions within the controller. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The route prefix for the controller. - - - Gets the route prefix. - - - Provides type-safe accessors for services obtained from a object. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Returns the registered unhandled exception handler, if any. - The registered unhandled exception hander, if present; otherwise, null. - The services container. - - - Returns the collection of registered unhandled exception loggers. - The collection of registered unhandled exception loggers. - The services container. - - - Gets the collection. - Returns a collection of objects. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance, or null if no instance was registered. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the collection. - Returns a collection of objects. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the collection. - Returns a collection ofobjects. - The services container. - - - Gets the service. - Returns aninstance. - The services container. - - - Gets the service. - Returns aninstance. - The services container. - - - Gets the collection. - Returns a collection of objects. - The services container. - - - Represents an containing zero or one entities. Use together with an [EnableQuery] from the System.Web.Http.OData or System.Web.OData namespace. - - - Initializes a new instance of the class. - The containing zero or one entities. - - - Creates a from an . A helper method to instantiate a object without having to explicitly specify the type . - The created . - The containing zero or one entities. - The type of the data in the data source. - - - The containing zero or one entities. - - - Represents an containing zero or one entities. Use together with an [EnableQuery] from the System.Web.Http.OData or System.Web.OData namespace. - The type of the data in the data source. - - - Initializes a new instance of the class. - The containing zero or one entities. - - - The containing zero or one entities. - - - Defines the order of execution for batch requests. - - - Executes the batch requests non-sequentially. - - - Executes the batch requests sequentially. - - - Provides extension methods for the class. - - - Copies the properties from another . - The sub-request. - The batch request that contains the properties to copy. - - - Represents the default implementation of that encodes the HTTP request/response messages as MIME multipart. - - - Initializes a new instance of the class. - The for handling the individual batch requests. - - - Creates the batch response message. - The batch response message. - The responses for the batch requests. - The original request containing all the batch requests. - The cancellation token. - - - Executes the batch request messages. - A collection of for the batch requests. - The collection of batch request messages. - The cancellation token. - - - Gets or sets the execution order for the batch requests. The default execution order is sequential. - The execution order for the batch requests. The default execution order is sequential. - - - Converts the incoming batch request into a collection of request messages. - A collection of . - The request containing the batch request messages. - The cancellation token. - - - Processes the batch requests. - The result of the operation. - The batch request. - The cancellation token. - - - Gets the supported content types for the batch request. - The supported content types for the batch request. - - - Validates the incoming request that contains the batch request messages. - The request containing the batch request messages. - - - Defines the abstraction for handling HTTP batch requests. - - - Initializes a new instance of the class. - The for handling the individual batch requests. - - - Gets the invoker to send the batch requests to the . - The invoker to send the batch requests to the . - - - Processes the incoming batch request as a single . - The batch response. - The batch request. - The cancellation token. - - - Sends the batch handler asynchronously. - The result of the operation. - the send request. - The cancelation token. - - - Invokes the action methods of a controller. - - - Initializes a new instance of the class. - - - Asynchronously invokes the specified action by using the specified controller context. - The invoked action. - The controller context. - The cancellation token. - - - Represents a reflection based action selector. - - - Initializes a new instance of the class. - - - Gets the action mappings for the . - The action mappings. - The information that describes a controller. - - - Selects an action for the . - The selected action. - The controller context. - - - Represents a container for services that can be specific to a controller. This shadows the services from its parent . A controller can either set a service here, or fall through to the more global set of services. - - - Initializes a new instance of the class. - The parent services container. - - - Removes a single-instance service from the default services. - The type of service. - - - Gets a service of the specified type. - The first instance of the service, or null if the service is not found. - The type of service. - - - Gets the list of service objects for a given service type, and validates the service type. - The list of service objects of the specified type. - The service type. - - - Gets the list of service objects for a given service type. - The list of service objects of the specified type, or an empty list if the service is not found. - The type of service. - - - Queries whether a service type is single-instance. - true if the service type has at most one instance, or false if the service type supports multiple instances. - The service type. - - - Replaces a single-instance service object. - The service type. - The service object that replaces the previous instance. - - - Describes *how* the binding will happen and does not actually bind. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The back pointer to the action this binding is for. - The synchronous bindings for each parameter. - - - Gets or sets the back pointer to the action this binding is for. - The back pointer to the action this binding is for. - - - Executes asynchronously the binding for the given request context. - Task that is signaled when the binding is complete. - The action context for the binding. This contains the parameter dictionary that will get populated. - The cancellation token for cancelling the binding operation. Or a binder can also bind a parameter to this. - - - Gets or sets the synchronous bindings for each parameter. - The synchronous bindings for each parameter. - - - Contains information for the executing action. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The controller context. - The action descriptor. - - - Gets a list of action arguments. - A list of action arguments. - - - Gets or sets the action descriptor for the action context. - The action descriptor. - - - Gets or sets the controller context. - The controller context. - - - Gets the model state dictionary for the context. - The model state dictionary. - - - Gets the request message for the action context. - The request message for the action context. - - - Gets the current request context. - The current request context. - - - Gets or sets the response message for the action context. - The response message for the action context. - - - Contains extension methods for . - - - - - - - - - - - Provides information about the action methods. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with specified information that describes the controller of the action.. - The information that describes the controller of the action. - - - Gets or sets the binding that describes the action. - The binding that describes the action. - - - Gets the name of the action. - The name of the action. - - - Gets or sets the action configuration. - The action configuration. - - - Gets the information that describes the controller of the action. - The information that describes the controller of the action. - - - Executes the described action and returns a that once completed will contain the return value of the action. - A that once completed will contain the return value of the action. - The controller context. - A list of arguments. - The cancellation token. - - - Returns the custom attributes associated with the action descriptor. - The custom attributes associated with the action descriptor. - The action descriptor. - - - Gets the custom attributes for the action. - The collection of custom attributes applied to this action. - true to search this action's inheritance chain to find the attributes; otherwise, false. - The type of attribute to search for. - - - Retrieves the filters for the given configuration and action. - The filters for the given configuration and action. - - - Retrieves the filters for the action descriptor. - The filters for the action descriptor. - - - Retrieves the parameters for the action descriptor. - The parameters for the action descriptor. - - - Gets the properties associated with this instance. - The properties associated with this instance. - - - Gets the converter for correctly transforming the result of calling ExecuteAsync(HttpControllerContext, IDictionaryString, Object)" into an instance of . - The action result converter. - - - Gets the return type of the descriptor. - The return type of the descriptor. - - - Gets the collection of supported HTTP methods for the descriptor. - The collection of supported HTTP methods for the descriptor. - - - Contains information for a single HTTP operation. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The request context. - The HTTP request. - The controller descriptor. - The controller. - - - Initializes a new instance of the class. - The configuration. - The route data. - The request. - - - Gets or sets the configuration. - The configuration. - - - Gets or sets the HTTP controller. - The HTTP controller. - - - Gets or sets the controller descriptor. - The controller descriptor. - - - Gets or sets the request. - The request. - - - Gets or sets the request context. - - - Gets or sets the route data. - The route data. - - - Represents information that describes the HTTP controller. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The configuration. - The controller name. - The controller type. - - - Gets or sets the configurations associated with the controller. - The configurations associated with the controller. - - - Gets or sets the name of the controller. - The name of the controller. - - - Gets or sets the type of the controller. - The type of the controller. - - - Creates a controller instance for the given . - The created controller instance. - The request message. - - - Retrieves a collection of custom attributes of the controller. - A collection of custom attributes. - The type of the object. - - - Returns a collection of attributes that can be assigned to <typeparamref name="T" /> for this descriptor's controller. - A collection of attributes associated with this controller. - true to search this controller's inheritance chain to find the attributes; otherwise, false. - Used to filter the collection of attributes. Use a value of to retrieve all attributes. - - - Returns a collection of filters associated with the controller. - A collection of filters associated with the controller. - - - Gets the properties associated with this instance. - The properties associated with this instance. - - - Contains settings for an HTTP controller. - - - Initializes a new instance of the class. - A configuration object that is used to initialize the instance. - - - Gets the collection of instances for the controller. - The collection of instances. - - - Gets the collection of parameter bindingfunctions for for the controller. - The collection of parameter binding functions. - - - Gets the collection of service instances for the controller. - The collection of service instances. - - - Describes how a parameter is bound. The binding should be static (based purely on the descriptor) and can be shared across requests. - - - Initializes a new instance of the class. - An that describes the parameters. - - - Gets the that was used to initialize this instance. - The instance. - - - If the binding is invalid, gets an error message that describes the binding error. - An error message. If the binding was successful, the value is null. - - - Asynchronously executes the binding for the given request. - A task object representing the asynchronous operation. - Metadata provider to use for validation. - The action context for the binding. The action context contains the parameter dictionary that will get populated with the parameter. - Cancellation token for cancelling the binding operation. - - - Gets the parameter value from argument dictionary of the action context. - The value for this parameter in the given action context, or null if the parameter has not yet been set. - The action context. - - - Gets a value that indicates whether the binding was successful. - true if the binding was successful; otherwise, false. - - - Sets the result of this parameter binding in the argument dictionary of the action context. - The action context. - The parameter value. - - - Returns a value indicating whether this instance will read the entity body of the HTTP message. - true if this will read the entity body; otherwise, false. - - - Represents the HTTP parameter descriptor. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The action descriptor. - - - Gets or sets the action descriptor. - The action descriptor. - - - Gets or sets the for the . - The for the . - - - Gets the default value of the parameter. - The default value of the parameter. - - - Retrieves a collection of the custom attributes from the parameter. - A collection of the custom attributes from the parameter. - The type of the custom attributes. - - - Gets a value that indicates whether the parameter is optional. - true if the parameter is optional; otherwise, false. - - - Gets or sets the parameter binding attribute. - The parameter binding attribute. - - - Gets the name of the parameter. - The name of the parameter. - - - Gets the type of the parameter. - The type of the parameter. - - - Gets the prefix of this parameter. - The prefix of this parameter. - - - Gets the properties of this parameter. - The properties of this parameter. - - - Represents the context associated with a request. - - - Initializes a new instance of the class. - - - Gets or sets the client certificate. - Returns . - - - Gets or sets the configuration. - Returns . - - - Gets or sets a value indicating whether error details, such as exception messages and stack traces, should be included in the response for this request. - Returns . - - - Gets or sets a value indicating whether the request originates from a local address. - Returns . - - - .Gets or sets the principal - Returns . - - - Gets or sets the route data. - Returns . - - - Gets or sets the factory used to generate URLs to other APIs. - Returns . - - - Gets or sets the virtual path root. - Returns . - - - - - A contract for a conversion routine that can take the result of an action returned from <see cref="M:System.Web.Http.Controllers.HttpActionDescriptor.ExecuteAsync(System.Web.Http.Controllers.HttpControllerContext,System.Collections.Generic.IDictionary{System.String,System.Object})" /> and convert it to an instance of . - - - Converts the specified object to another object. - The converted object. - The controller context. - The action result. - - - Defines the method for retrieval of action binding associated with parameter value. - - - Gets the . - A object. - The action descriptor. - - - If a controller is decorated with an attribute with this interface, then it gets invoked to initialize the controller settings. - - - Callback invoked to set per-controller overrides for this controllerDescriptor. - The controller settings to initialize. - The controller descriptor. Note that the can be associated with the derived controller type given that is inherited. - - - Contains method that is used to invoke HTTP operation. - - - Executes asynchronously the HTTP operation. - The newly started task. - The execution context. - The cancellation token assigned for the HTTP operation. - - - Contains the logic for selecting an action method. - - - Returns a map, keyed by action string, of all that the selector can select. This is primarily called by to discover all the possible actions in the controller. - A map of that the selector can select, or null if the selector does not have a well-defined mapping of . - The controller descriptor. - - - Selects the action for the controller. - The action for the controller. - The context of the controller. - - - Represents an HTTP controller. - - - Executes the controller for synchronization. - The controller. - The current context for a test controller. - The notification that cancels the operation. - - - Defines extension methods for . - - - Binds parameter that results as an error. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The error message that describes the reason for fail bind. - - - Bind the parameter as if it had the given attribute on the declaration. - The HTTP parameter binding object. - The parameter to provide binding for. - The attribute that describes the binding. - - - Binds parameter by parsing the HTTP body content. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - - - Binds parameter by parsing the HTTP body content. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The list of formatters which provides selection of an appropriate formatter for serializing the parameter into object. - - - Binds parameter by parsing the HTTP body content. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The list of formatters which provides selection of an appropriate formatter for serializing the parameter into object. - The body model validator used to validate the parameter. - - - Binds parameter by parsing the HTTP body content. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The list of formatters which provides selection of an appropriate formatter for serializing the parameter into object. - - - Binds parameter by parsing the query string. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - - - Binds parameter by parsing the query string. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The value provider factories which provide query string parameter data. - - - Binds parameter by parsing the query string. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The model binder used to assemble the parameter into an object. - - - Binds parameter by parsing the query string. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The model binder used to assemble the parameter into an object. - The value provider factories which provide query string parameter data. - - - Binds parameter by parsing the query string. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The value provider factories which provide query string parameter data. - - - Represents a reflected synchronous or asynchronous action method. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified descriptor and method details.. - The controller descriptor. - The action-method information. - - - Gets the name of the action. - The name of the action. - - - - Executes the described action and returns a that once completed will contain the return value of the action. - A [T:System.Threading.Tasks.Task`1"] that once completed will contain the return value of the action. - The context. - The arguments. - A cancellation token to cancel the action. - - - Returns an array of custom attributes defined for this member, identified by type. - An array of custom attributes or an empty array if no custom attributes exist. - true to search this action's inheritance chain to find the attributes; otherwise, false. - The type of the custom attributes. - - - Retrieves information about action filters. - The filter information. - - - - Retrieves the parameters of the action method. - The parameters of the action method. - - - Gets or sets the action-method information. - The action-method information. - - - Gets the return type of this method. - The return type of this method. - - - Gets or sets the supported http methods. - The supported http methods. - - - Represents the reflected HTTP parameter descriptor. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The action descriptor. - The parameter information. - - - Gets the default value for the parameter. - The default value for the parameter. - - - Retrieves a collection of the custom attributes from the parameter. - A collection of the custom attributes from the parameter. - The type of the custom attributes. - - - Gets a value that indicates whether the parameter is optional. - true if the parameter is optional; otherwise false. - - - Gets or sets the parameter information. - The parameter information. - - - Gets the name of the parameter. - The name of the parameter. - - - Gets the type of the parameter. - The type of the parameter. - - - Represents a converter for actions with a return type of . - - - Initializes a new instance of the class. - - - Converts a object to another object. - The converted object. - The controller context. - The action result. - - - An abstract class that provides a container for services used by ASP.NET Web API. - - - Initializes a new instance of the class. - - - Adds a service to the end of services list for the given service type. - The service type. - The service instance. - - - Adds the services of the specified collection to the end of the services list for the given service type. - The service type. - The services to add. - - - Removes all the service instances of the given service type. - The service type to clear from the services list. - - - Removes all instances of a multi-instance service type. - The service type to remove. - - - Removes a single-instance service type. - The service type to remove. - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - Searches for a service that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence. - The zero-based index of the first occurrence, if found; otherwise, -1. - The service type. - The delegate that defines the conditions of the element to search for. - - - Gets a service instance of a specified type. - The service type. - - - Gets a mutable list of service instances of a specified type. - A mutable list of service instances. - The service type. - - - Gets a collection of service instanes of a specified type. - A collection of service instances. - The service type. - - - Inserts a service into the collection at the specified index. - The service type. - The zero-based index at which the service should be inserted. If is passed, ensures the element is added to the end. - The service to insert. - - - Inserts the elements of the collection into the service list at the specified index. - The service type. - The zero-based index at which the new elements should be inserted. If is passed, ensures the elements are added to the end. - The collection of services to insert. - - - Determine whether the service type should be fetched with GetService or GetServices. - true iff the service is singular. - type of service to query - - - Removes the first occurrence of the given service from the service list for the given service type. - true if the item is successfully removed; otherwise, false. - The service type. - The service instance to remove. - - - Removes all the elements that match the conditions defined by the specified predicate. - The number of elements removed from the list. - The service type. - The delegate that defines the conditions of the elements to remove. - - - Removes the service at the specified index. - The service type. - The zero-based index of the service to remove. - - - Replaces all existing services for the given service type with the given service instance. This works for both singular and plural services. - The service type. - The service instance. - - - Replaces all instances of a multi-instance service with a new instance. - The type of service. - The service instance that will replace the current services of this type. - - - Replaces all existing services for the given service type with the given service instances. - The service type. - The service instances. - - - Replaces a single-instance service of a specified type. - The service type. - The service instance. - - - Removes the cached values for a single service type. - The service type. - - - A converter for creating responses from actions that return an arbitrary value. - The declared return type of an action. - - - Initializes a new instance of the class. - - - Converts the result of an action with arbitrary return type to an instance of . - The newly created object. - The action controller context. - The execution result. - - - Represents a converter for creating a response from actions that do not return a value. - - - Initializes a new instance of the class. - - - Converts the created response from actions that do not return a value. - The converted response. - The context of the controller. - The result of the action. - - - Represents a dependency injection container. - - - Starts a resolution scope. - The dependency scope. - - - Represents an interface for the range of the dependencies. - - - Retrieves a service from the scope. - The retrieved service. - The service to be retrieved. - - - Retrieves a collection of services from the scope. - The retrieved collection of services. - The collection of services to be retrieved. - - - Describes an API defined by relative URI path and HTTP method. - - - Initializes a new instance of the class. - - - Gets or sets the action descriptor that will handle the API. - The action descriptor. - - - Gets or sets the documentation of the API. - The documentation. - - - Gets or sets the HTTP method. - The HTTP method. - - - Gets the ID. The ID is unique within . - The ID. - - - Gets the parameter descriptions. - The parameter descriptions. - - - Gets or sets the relative path. - The relative path. - - - Gets or sets the response description. - The response description. - - - Gets or sets the registered route for the API. - The route. - - - Gets the supported request body formatters. - The supported request body formatters. - - - Gets the supported response formatters. - The supported response formatters. - - - Explores the URI space of the service based on routes, controllers and actions available in the system. - - - Initializes a new instance of the class. - The configuration. - - - Gets the API descriptions. The descriptions are initialized on the first access. - - - Gets or sets the documentation provider. The provider will be responsible for documenting the API. - The documentation provider. - - - Gets a collection of HttpMethods supported by the action. Called when initializing the . - A collection of HttpMethods supported by the action. - The route. - The action descriptor. - - - Determines whether the action should be considered for generation. Called when initializing the . - true if the action should be considered for generation, false otherwise. - The action variable value from the route. - The action descriptor. - The route. - - - Determines whether the controller should be considered for generation. Called when initializing the . - true if the controller should be considered for generation, false otherwise. - The controller variable value from the route. - The controller descriptor. - The route. - - - This attribute can be used on the controllers and actions to influence the behavior of . - - - Initializes a new instance of the class. - - - Gets or sets a value indicating whether to exclude the controller or action from the instances generated by . - true if the controller or action should be ignored; otherwise, false. - - - Describes a parameter on the API defined by relative URI path and HTTP method. - - - Initializes a new instance of the class. - - - Gets or sets the documentation. - The documentation. - - - Gets or sets the name. - The name. - - - Gets or sets the parameter descriptor. - The parameter descriptor. - - - Gets or sets the source of the parameter. It may come from the request URI, request body or other places. - The source. - - - Describes where the parameter come from. - - - The parameter come from Body. - - - The parameter come from Uri. - - - The location is unknown. - - - Defines the interface for getting a collection of . - - - Gets the API descriptions. - - - Defines the provider responsible for documenting the service. - - - Gets the documentation based on . - The documentation for the controller. - The action descriptor. - - - - Gets the documentation based on . - The documentation for the controller. - The parameter descriptor. - - - - Describes the API response. - - - Initializes a new instance of the class. - - - Gets or sets the declared response type. - The declared response type. - - - Gets or sets the response documentation. - The response documentation. - - - Gets or sets the actual response type. - The actual response type. - - - Use this to specify the entity type returned by an action when the declared return type is or . The will be read by when generating . - - - Initializes a new instance of the class. - The response type. - - - Gets the response type. - - - Provides an implementation of with no external dependencies. - - - Initializes a new instance of the class. - - - Returns a list of assemblies available for the application. - A <see cref="T:System.Collections.ObjectModel.Collection`1" /> of assemblies. - - - Represents a default implementation of an . A different implementation can be registered via the . We optimize for the case where we have an instance per instance but can support cases where there are many instances for one as well. In the latter case the lookup is slightly slower because it goes through the dictionary. - - - Initializes a new instance of the class. - - - Creates the specified by using the given . - An instance of type . - The request message. - The controller descriptor. - The type of the controller. - - - Represents a default instance for choosing a given a . A different implementation can be registered via the . - - - Initializes a new instance of the class. - The configuration. - - - Specifies the suffix string in the controller name. - - - Returns a map, keyed by controller string, of all that the selector can select. - A map of all that the selector can select, or null if the selector does not have a well-defined mapping of . - - - Gets the name of the controller for the specified . - The name of the controller for the specified . - The HTTP request message. - - - Selects a for the given . - The instance for the given . - The HTTP request message. - - - Provides an implementation of with no external dependencies. - - - Initializes a new instance of the class. - - - Initializes a new instance using a predicate to filter controller types. - The predicate. - - - Returns a list of controllers available for the application. - An <see cref="T:System.Collections.Generic.ICollection`1" /> of controllers. - The assemblies resolver. - - - Gets a value whether the resolver type is a controller type predicate. - true if the resolver type is a controller type predicate; otherwise, false. - - - Dispatches an incoming to an implementation for processing. - - - Initializes a new instance of the class with the specified configuration. - The http configuration. - - - Gets the HTTP configuration. - The HTTP configuration. - - - Dispatches an incoming to an . - A representing the ongoing operation. - The request to dispatch - The cancellation token. - - - This class is the default endpoint message handler which examines the of the matched route, and chooses which message handler to call. If is null, then it delegates to . - - - Initializes a new instance of the class, using the provided and as the default handler. - The server configuration. - - - Initializes a new instance of the class, using the provided and . - The server configuration. - The default handler to use when the has no . - - - Sends an HTTP request as an asynchronous operation. - The task object representing the asynchronous operation. - The HTTP request message to send. - The cancellation token to cancel operation. - - - Provides an abstraction for managing the assemblies of an application. A different implementation can be registered via the . - - - Returns a list of assemblies available for the application. - An <see cref="T:System.Collections.Generic.ICollection`1" /> of assemblies. - - - Defines the methods that are required for an . - - - Creates an object. - An object. - The message request. - The HTTP controller descriptor. - The type of the controller. - - - Defines the methods that are required for an factory. - - - Returns a map, keyed by controller string, of all that the selector can select. This is primarily called by to discover all the possible controllers in the system. - A map of all that the selector can select, or null if the selector does not have a well-defined mapping of . - - - Selects a for the given . - An instance. - The request message. - - - Provides an abstraction for managing the controller types of an application. A different implementation can be registered via the DependencyResolver. - - - Returns a list of controllers available for the application. - An <see cref="T:System.Collections.Generic.ICollection`1" /> of controllers. - The resolver for failed assemblies. - - - Provides the catch blocks used within this assembly. - - - Gets the catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpBatchHandler.SendAsync. - The catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpBatchHandler.SendAsync. - - - Gets the catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpControllerDispatcher.SendAsync. - The catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpControllerDispatcher.SendAsync. - - - Gets the catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpServer.SendAsync. - The catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpServer.SendAsync. - - - Gets the catch block in System.Web.Http.ApiController.ExecuteAsync when using . - The catch block in System.Web.Http.ApiController.ExecuteAsync when using . - - - Represents an exception and the contextual data associated with it when it was caught. - - - Initializes a new instance of the class. - The caught exception. - The catch block where the exception was caught. - - - Initializes a new instance of the class. - The caught exception. - The catch block where the exception was caught. - The request being processed when the exception was caught. - - - Initializes a new instance of the class. - The caught exception. - The catch block where the exception was caught. - The request being processed when the exception was caught. - The repsonse being returned when the exception was caught. - - - Initializes a new instance of the class. - The caught exception. - The catch block where the exception was caught. - The action context in which the exception occurred. - - - Gets the action context in which the exception occurred, if available. - The action context in which the exception occurred, if available. - - - Gets the catch block in which the exception was caught. - The catch block in which the exception was caught. - - - Gets the controller context in which the exception occurred, if available. - The controller context in which the exception occurred, if available. - - - Gets the caught exception. - The caught exception. - - - Gets the request being processed when the exception was caught. - The request being processed when the exception was caught. - - - Gets the request context in which the exception occurred. - The request context in which the exception occurred. - - - Gets the response being sent when the exception was caught. - The response being sent when the exception was caught. - - - Represents the catch block location for an exception context. - - - Initializes a new instance of the class. - The label for the catch block where the exception was caught. - A value indicating whether the catch block where the exception was caught is the last one before the host. - A value indicating whether exceptions in the catch block can be handled after they are logged. - - - Gets a value indicating whether exceptions in the catch block can be handled after they are logged. - A value indicating whether exceptions in the catch block can be handled after they are logged. - - - Gets a value indicating whether the catch block where the exception was caught is the last one before the host. - A value indicating whether the catch block where the exception was caught is the last one before the host. - - - Gets a label for the catch block in which the exception was caught. - A label for the catch block in which the exception was caught. - - - Returns . - - - Represents an unhandled exception handler. - - - Initializes a new instance of the class. - - - When overridden in a derived class, handles the exception synchronously. - The exception handler context. - - - When overridden in a derived class, handles the exception asynchronously. - A task representing the asynchronous exception handling operation. - The exception handler context. - The token to monitor for cancellation requests. - - - Determines whether the exception should be handled. - true if the exception should be handled; otherwise, false. - The exception handler context. - - - Returns . - - - Represents the context within which unhandled exception handling occurs. - - - Initializes a new instance of the class. - The exception context. - - - Gets the catch block in which the exception was caught. - The catch block in which the exception was caught. - - - Gets the caught exception. - The caught exception. - - - Gets the exception context providing the exception and related data. - The exception context providing the exception and related data. - - - Gets the request being processed when the exception was caught. - The request being processed when the exception was caught. - - - Gets the request context in which the exception occurred. - The request context in which the exception occurred. - - - Gets or sets the result providing the response message when the exception is handled. - The result providing the response message when the exception is handled. - - - Provides extension methods for . - - - Calls an exception handler and determines the response handling it, if any. - A task that, when completed, contains the response message to return when the exception is handled, or null when the exception remains unhandled. - The unhandled exception handler. - The exception context. - The token to monitor for cancellation requests. - - - Represents an unhandled exception logger. - - - Initializes a new instance of the class. - - - When overridden in a derived class, logs the exception synchronously. - The exception logger context. - - - When overridden in a derived class, logs the exception asynchronously. - A task representing the asynchronous exception logging operation. - The exception logger context. - The token to monitor for cancellation requests. - - - Determines whether the exception should be logged. - true if the exception should be logged; otherwise, false. - The exception logger context. - - - Returns . - - - Represents the context within which unhandled exception logging occurs. - - - Initializes a new instance of the class. - The exception context. - - - Gets or sets a value indicating whether the exception can subsequently be handled by an to produce a new response message. - A value indicating whether the exception can subsequently be handled by an to produce a new response message. - - - Gets the catch block in which the exception was caught. - The catch block in which the exception was caught. - - - Gets the caught exception. - The caught exception. - - - Gets the exception context providing the exception and related data. - The exception context providing the exception and related data. - - - Gets the request being processed when the exception was caught. - The request being processed when the exception was caught. - - - Gets the request context in which the exception occurred. - The request context in which the exception occurred. - - - Provides extension methods for . - - - Calls an exception logger. - A task representing the asynchronous exception logging operation. - The unhandled exception logger. - The exception context. - The token to monitor for cancellation requests. - - - Creates exception services to call logging and handling from catch blocks. - - - Gets an exception handler that calls the registered handler service, if any, and ensures exceptions do not accidentally propagate to the host. - An exception handler that calls any registered handler and ensures exceptions do not accidentally propagate to the host. - The services container. - - - Gets an exception handler that calls the registered handler service, if any, and ensures exceptions do not accidentally propagate to the host. - An exception handler that calls any registered handler and ensures exceptions do not accidentally propagate to the host. - The configuration. - - - Gets an exception logger that calls all registered logger services. - A composite logger. - The services container. - - - Gets an exception logger that calls all registered logger services. - A composite logger. - The configuration. - - - Defines an unhandled exception handler. - - - Process an unhandled exception, either allowing it to propagate or handling it by providing a response message to return instead. - A task representing the asynchronous exception handling operation. - The exception handler context. - The token to monitor for cancellation requests. - - - Defines an unhandled exception logger. - - - Logs an unhandled exception. - A task representing the asynchronous exception logging operation. - The exception logger context. - The token to monitor for cancellation requests. - - - Provides information about an action method, such as its name, controller, parameters, attributes, and filters. - - - Initializes a new instance of the class. - - - Returns the filters that are associated with this action method. - The filters that are associated with this action method. - The configuration. - The action descriptor. - - - Represents the base class for all action-filter attributes. - - - Initializes a new instance of the class. - - - Occurs after the action method is invoked. - The action executed context. - - - - Occurs before the action method is invoked. - The action context. - - - - Executes the filter action asynchronously. - The newly created task for this operation. - The action context. - The cancellation token assigned for this task. - The delegate function to continue after the action method is invoked. - - - Provides details for authorization filter. - - - Initializes a new instance of the class. - - - Calls when a process requests authorization. - The action context, which encapsulates information for using . - - - - Executes the authorization filter during synchronization. - The authorization filter during synchronization. - The action context, which encapsulates information for using . - The cancellation token that cancels the operation. - A continuation of the operation. - - - Represents the configuration filter provider. - - - Initializes a new instance of the class. - - - Returns the filters that are associated with this configuration method. - The filters that are associated with this configuration method. - The configuration. - The action descriptor. - - - Represents the attributes for the exception filter. - - - Initializes a new instance of the class. - - - Raises the exception event. - The context for the action. - - - - Asynchronously executes the exception filter. - The result of the execution. - The context for the action. - The cancellation context. - - - Represents the base class for action-filter attributes. - - - Initializes a new instance of the class. - - - Gets a value that indicates whether multiple filters are allowed. - true if multiple filters are allowed; otherwise, false. - - - Provides information about the available action filters. - - - Initializes a new instance of the class. - The instance of this class. - The scope of this class. - - - Gets or sets an instance of the . - A . - - - Gets or sets the scope . - The scope of the FilterInfo. - - - Defines values that specify the order in which filters run within the same filter type and filter order. - - - Specifies an order after Controller. - - - Specifies an order before Action and after Global. - - - Specifies an action before Controller. - - - Represents the action of the HTTP executed context. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The action context. - The exception. - - - Gets or sets the HTTP action context. - The HTTP action context. - - - Gets or sets the exception that was raised during the execution. - The exception that was raised during the execution. - - - Gets the object for the context. - The object for the context. - - - Gets or sets the for the context. - The for the context. - - - Represents an authentication challenge context containing information for executing an authentication challenge. - - - Initializes a new instance of the class. - The action context. - The current action result. - - - Gets the action context. - - - Gets the request message. - - - Gets or sets the action result to execute. - - - Represents an authentication context containing information for performing authentication. - - - Initializes a new instance of the class. - The action context. - The current principal. - - - Gets the action context. - The action context. - - - Gets or sets an action result that will produce an error response (if authentication failed; otherwise, null). - An action result that will produce an error response. - - - Gets or sets the authenticated principal. - The authenticated principal. - - - Gets the request message. - The request message. - - - Represents a collection of HTTP filters. - - - Initializes a new instance of the class. - - - Adds an item at the end of the collection. - The item to add to the collection. - - - - Removes all item in the collection. - - - Determines whether the collection contains the specified item. - true if the collection contains the specified item; otherwise, false. - The item to check. - - - Gets the number of elements in the collection. - The number of elements in the collection. - - - Gets an enumerator that iterates through the collection. - An enumerator object that can be used to iterate through the collection. - - - Removes the specified item from the collection. - The item to remove in the collection. - - - Gets an enumerator that iterates through the collection. - An enumerator object that can be used to iterate through the collection. - - - Defines the methods that are used in an action filter. - - - Executes the filter action asynchronously. - The newly created task for this operation. - The action context. - The cancellation token assigned for this task. - The delegate function to continue after the action method is invoked. - - - Defines a filter that performs authentication. - - - Authenticates the request. - A Task that will perform authentication. - The authentication context. - The token to monitor for cancellation requests. - - - - Defines the methods that are required for an authorization filter. - - - Executes the authorization filter to synchronize. - The authorization filter to synchronize. - The action context. - The cancellation token associated with the filter. - The continuation. - - - Defines the methods that are required for an exception filter. - - - Executes an asynchronous exception filter. - An asynchronous exception filter. - The action executed context. - The cancellation token. - - - Defines the methods that are used in a filter. - - - Gets or sets a value indicating whether more than one instance of the indicated attribute can be specified for a single program element. - true if more than one instance is allowed to be specified; otherwise, false. The default is false. - - - Provides filter information. - - - Returns an enumeration of filters. - An enumeration of filters. - The HTTP configuration. - The action descriptor. - - - - - Provides common keys for properties stored in the - - - Provides a key for the client certificate for this request. - - - Provides a key for the associated with this request. - - - Provides a key for the collection of resources that should be disposed when a request is disposed. - - - Provides a key for the associated with this request. - - - Provides a key for the associated with this request. - - - Provides a key for the associated with this request. - - - Provides a key that indicates whether error details are to be included in the response for this HTTP request. - - - Provides a key that indicates whether the request is a batch request. - - - Provides a key that indicates whether the request originates from a local address. - - - Provides a key that indicates whether the request failed to match a route. - - - Provides a key for the for this request. - - - Provides a key for the stored in . This is the correlation ID for that request. - - - Provides a key for the parsed query string stored in . - - - Provides a key for a delegate which can retrieve the client certificate for this request. - - - Provides a key for the current stored in Properties(). If Current() is null then no context is stored. - - - Interface for controlling the use of buffering requests and responses in the host. If a host provides support for buffering requests and/or responses then it can use this interface to determine the policy for when buffering is to be used. - - - Determines whether the host should buffer the entity body. - true if buffering should be used; otherwise a streamed request should be used. - The host context. - - - Determines whether the host should buffer the entity body. - true if buffering should be used; otherwise a streamed response should be used. - The HTTP response message. - - - Represents a message handler that suppresses host authentication results. - - - Initializes a new instance of the class. - - - Asynchronously sends a request message. - That task that completes the asynchronous operation. - The request message to send. - The cancellation token. - - - Represents the metadata class of the ModelMetadata. - - - Initializes a new instance of the class. - The provider. - The type of the container. - The model accessor. - The type of the model. - The name of the property. - - - Gets a dictionary that contains additional metadata about the model. - A dictionary that contains additional metadata about the model. - - - Gets or sets the type of the container for the model. - The type of the container for the model. - - - Gets or sets a value that indicates whether empty strings that are posted back in forms should be converted to null. - true if empty strings that are posted back in forms should be converted to null; otherwise, false. The default value is true. - - - Gets or sets the description of the model. - The description of the model. The default value is null. - - - Gets the display name for the model. - The display name for the model. - - - Gets a list of validators for the model. - A list of validators for the model. - The validator providers for the model. - - - Gets or sets a value that indicates whether the model is a complex type. - A value that indicates whether the model is considered a complex. - - - Gets a value that indicates whether the type is nullable. - true if the type is nullable; otherwise, false. - - - Gets or sets a value that indicates whether the model is read-only. - true if the model is read-only; otherwise, false. - - - Gets the value of the model. - The model value can be null. - - - Gets the type of the model. - The type of the model. - - - Gets a collection of model metadata objects that describe the properties of the model. - A collection of model metadata objects that describe the properties of the model. - - - Gets the property name. - The property name. - - - Gets or sets the provider. - The provider. - - - Provides an abstract base class for a custom metadata provider. - - - Initializes a new instance of the class. - - - Gets a ModelMetadata object for each property of a model. - A ModelMetadata object for each property of a model. - The container. - The type of the container. - - - Gets a metadata for the specified property. - The metadata model for the specified property. - The model accessor. - The type of the container. - The property to get the metadata model for. - - - Gets the metadata for the specified model accessor and model type. - The metadata. - The model accessor. - The type of the mode. - - - Provides an abstract class to implement a metadata provider. - The type of the model metadata. - - - Initializes a new instance of the class. - - - When overridden in a derived class, creates the model metadata for the property using the specified prototype. - The model metadata for the property. - The prototype from which to create the model metadata. - The model accessor. - - - When overridden in a derived class, creates the model metadata for the property. - The model metadata for the property. - The set of attributes. - The type of the container. - The type of the model. - The name of the property. - - - Retrieves a list of properties for the model. - A list of properties for the model. - The model container. - The type of the container. - - - Retrieves the metadata for the specified property using the container type and property name. - The metadata for the specified property. - The model accessor. - The type of the container. - The name of the property. - - - Returns the metadata for the specified property using the type of the model. - The metadata for the specified property. - The model accessor. - The type of the container. - - - Provides prototype cache data for . - - - Initializes a new instance of the class. - The attributes that provides data for the initialization. - - - Gets or sets the metadata display attribute. - The metadata display attribute. - - - Gets or sets the metadata display format attribute. - The metadata display format attribute. - - - - Gets or sets the metadata editable attribute. - The metadata editable attribute. - - - Gets or sets the metadata read-only attribute. - The metadata read-only attribute. - - - Provides a container for common metadata, for the class, for a data model. - - - Initializes a new instance of the class. - The prototype used to initialize the model metadata. - The model accessor. - - - Initializes a new instance of the class. - The metadata provider. - The type of the container. - The type of the model. - The name of the property. - The attributes that provides data for the initialization. - - - Retrieves a value that indicates whether empty strings that are posted back in forms should be converted to null. - true if empty strings that are posted back in forms should be converted to null; otherwise, false. - - - Retrieves the description of the model. - The description of the model. - - - Retrieves a value that indicates whether the model is read-only. - true if the model is read-only; otherwise, false. - - - - Provides prototype cache data for the . - The type of prototype cache. - - - Initializes a new instance of the class. - The prototype. - The model accessor. - - - Initializes a new instance of the class. - The provider. - The type of container. - The type of the model. - The name of the property. - The prototype cache. - - - Indicates whether empty strings that are posted back in forms should be computed and converted to null. - true if empty strings that are posted back in forms should be computed and converted to null; otherwise, false. - - - Indicates the computation value. - The computation value. - - - Gets a value that indicates whether the model is a complex type. - A value that indicates whether the model is considered a complex type by the Web API framework. - - - Gets a value that indicates whether the model to be computed is read-only. - true if the model to be computed is read-only; otherwise, false. - - - Gets or sets a value that indicates whether empty strings that are posted back in forms should be converted to null. - true if empty strings that are posted back in forms should be converted to null; otherwise, false. The default value is true. - - - Gets or sets the description of the model. - The description of the model. - - - Gets a value that indicates whether the model is a complex type. - A value that indicates whether the model is considered a complex type by the Web API framework. - - - Gets or sets a value that indicates whether the model is read-only. - true if the model is read-only; otherwise, false. - - - Gets or sets a value that indicates whether the prototype cache is updating. - true if the prototype cache is updating; otherwise, false. - - - Implements the default model metadata provider. - - - Initializes a new instance of the class. - - - Creates the metadata from prototype for the specified property. - The metadata for the property. - The prototype. - The model accessor. - - - Creates the metadata for the specified property. - The metadata for the property. - The attributes. - The type of the container. - The type of the model. - The name of the property. - - - Represents an empty model metadata provider. - - - Initializes a new instance of the class. - - - Creates metadata from prototype. - The metadata. - The model metadata prototype. - The model accessor. - - - Creates a prototype of the metadata provider of the . - A prototype of the metadata provider. - The attributes. - The type of container. - The type of model. - The name of the property. - - - Represents the binding directly to the cancellation token. - - - Initializes a new instance of the class. - The binding descriptor. - - - Executes the binding during synchronization. - The binding during synchronization. - The metadata provider. - The action context. - The notification after the cancellation of the operations. - - - Represents an attribute that invokes a custom model binder. - - - Initializes a new instance of the class. - - - Retrieves the associated model binder. - A reference to an object that implements the interface. - - - Represents the default action value of the binder. - - - Initializes a new instance of the class. - - - Default implementation of the interface. This interface is the primary entry point for binding action parameters. - The associated with the . - The action descriptor. - - - Gets the associated with the . - The associated with the . - The parameter descriptor. - - - Defines a binding error. - - - Initializes a new instance of the class. - The error descriptor. - The message. - - - Gets the error message. - The error message. - - - Executes the binding method during synchronization. - The metadata provider. - The action context. - The cancellation Token value. - - - Represents parameter binding that will read from the body and invoke the formatters. - - - Initializes a new instance of the class. - The descriptor. - The formatter. - The body model validator. - - - Gets or sets an interface for the body model validator. - An interface for the body model validator. - - - Gets the error message. - The error message. - - - Asynchronously execute the binding of . - The result of the action. - The metadata provider. - The context associated with the action. - The cancellation token. - - - Gets or sets an enumerable object that represents the formatter for the parameter binding. - An enumerable object that represents the formatter for the parameter binding. - - - Asynchronously reads the content of . - The result of the action. - The request. - The type. - The formatter. - The format logger. - - - - Gets whether the will read body. - True if the will read body; otherwise, false. - - - Represents the extensions for the collection of form data. - - - Reads the collection extensions with specified type. - The read collection extensions. - The form data. - The generic type. - - - Reads the collection extensions with specified type. - The collection extensions. - The form data. - The name of the model. - The required member selector. - The formatter logger. - The generic type. - - - - - - Reads the collection extensions with specified type. - The collection extensions with specified type. - The form data. - The type of the object. - - - Reads the collection extensions with specified type and model name. - The collection extensions. - The form data. - The type of the object. - The name of the model. - The required member selector. - The formatter logger. - - - Deserialize the form data to the given type, using model binding. - best attempt to bind the object. The best attempt may be null. - collection with parsed form url data - target type to read as - null or empty to read the entire form as a single object. This is common for body data. Or the name of a model to do a partial binding against the form data. This is common for extracting individual fields. - The used to determine required members. - The to log events to. - The configuration to pick binder from. Can be null if the config was not created already. In that case a new config is created. - - - - - - - - Enumerates the behavior of the HTTP binding. - - - Never use HTTP binding. - - - The optional binding behavior - - - HTTP binding is required. - - - Provides a base class for model-binding behavior attributes. - - - Initializes a new instance of the class. - The behavior. - - - Gets or sets the behavior category. - The behavior category. - - - Gets the unique identifier for this attribute. - The id for this attribute. - - - Parameter binds to the request. - - - Initializes a new instance of the class. - The parameter descriptor. - - - Asynchronously executes parameter binding. - The binded parameter. - The metadata provider. - The action context. - The cancellation token. - - - Defines the methods that are required for a model binder. - - - Binds the model to a value by using the specified controller context and binding context. - true if model binding is successful; otherwise, false. - The action context. - The binding context. - - - Represents a value provider for parameter binding. - - - Gets the instances used by this parameter binding. - The instances used by this parameter binding. - - - Represents the class for handling HTML form URL-ended data, also known as application/x-www-form-urlencoded. - - - Initializes a new instance of the class. - - - - Determines whether this can read objects of the specified . - true if objects of this type can be read; otherwise false. - The type of object that will be read. - - - Reads an object of the specified from the specified stream. This method is called during deserialization. - A whose result will be the object instance that has been read. - The type of object to read. - The from which to read. - The content being read. - The to log events to. - - - Specify this parameter uses a model binder. This can optionally specify the specific model binder and value providers that drive that model binder. Derived attributes may provide convenience settings for the model binder or value provider. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The type of model binder. - - - Gets or sets the type of model binder. - The type of model binder. - - - Gets the binding for a parameter. - The that contains the binding. - The parameter to bind. - - - Get the IModelBinder for this type. - a non-null model binder. - The configuration. - model type that the binder is expected to bind. - - - Gets the model binder provider. - The instance. - The configuration object. - - - Gets the value providers that will be fed to the model binder. - A collection of instances. - The configuration object. - - - Gets or sets the name to consider as the parameter name during model binding. - The parameter name to consider. - - - Gets or sets a value that specifies whether the prefix check should be suppressed. - true if the prefix check should be suppressed; otherwise, false. - - - Provides a container for model-binder configuration. - - - Gets or sets the name of the resource file (class key) that contains localized string values. - The name of the resource file (class key). - - - Gets or sets the current provider for type-conversion error message. - The current provider for type-conversion error message. - - - Gets or sets the current provider for value-required error messages. - The error message provider. - - - Provides a container for model-binder error message provider. - - - Describes a parameter that gets bound via ModelBinding. - - - Initializes a new instance of the class. - The parameter descriptor. - The model binder. - The collection of value provider factory. - - - Gets the model binder. - The model binder. - - - Asynchronously executes the parameter binding via the model binder. - The task that is signaled when the binding is complete. - The metadata provider to use for validation. - The action context for the binding. - The cancellation token assigned for this task for cancelling the binding operation. - - - Gets the collection of value provider factory. - The collection of value provider factory. - - - Provides an abstract base class for model binder providers. - - - Initializes a new instance of the class. - - - Finds a binder for the given type. - A binder, which can attempt to bind this type. Or null if the binder knows statically that it will never be able to bind the type. - A configuration object. - The type of the model to bind against. - - - Provides the context in which a model binder functions. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The binding context. - - - Gets or sets a value that indicates whether the binder should use an empty prefix. - true if the binder should use an empty prefix; otherwise, false. - - - Gets or sets the model. - The model. - - - Gets or sets the model metadata. - The model metadata. - - - Gets or sets the name of the model. - The name of the model. - - - Gets or sets the state of the model. - The state of the model. - - - Gets or sets the type of the model. - The type of the model. - - - Gets the property metadata. - The property metadata. - - - Gets or sets the validation node. - The validation node. - - - Gets or sets the value provider. - The value provider. - - - Represents an error that occurs during model binding. - - - Initializes a new instance of the class by using the specified exception. - The exception. - - - Initializes a new instance of the class by using the specified exception and error message. - The exception. - The error message - - - Initializes a new instance of the class by using the specified error message. - The error message - - - Gets or sets the error message. - The error message. - - - Gets or sets the exception object. - The exception object. - - - Represents a collection of instances. - - - Initializes a new instance of the class. - - - Adds the specified Exception object to the model-error collection. - The exception. - - - Adds the specified error message to the model-error collection. - The error message. - - - Encapsulates the state of model binding to a property of an action-method argument, or to the argument itself. - - - Initializes a new instance of the class. - - - Gets a object that contains any errors that occurred during model binding. - The model state errors. - - - Gets a object that encapsulates the value that was being bound during model binding. - The model state value. - - - Represents the state of an attempt to bind a posted form to an action method, which includes validation information. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using values that are copied from the specified model-state dictionary. - The dictionary. - - - Adds the specified item to the model-state dictionary. - The object to add to the model-state dictionary. - - - Adds an element that has the specified key and value to the model-state dictionary. - The key of the element to add. - The value of the element to add. - - - Adds the specified model error to the errors collection for the model-state dictionary that is associated with the specified key. - The key. - The exception. - - - Adds the specified error message to the errors collection for the model-state dictionary that is associated with the specified key. - The key. - The error message. - - - Removes all items from the model-state dictionary. - - - Determines whether the model-state dictionary contains a specific value. - true if item is found in the model-state dictionary; otherwise, false. - The object to locate in the model-state dictionary. - - - Determines whether the model-state dictionary contains the specified key. - true if the model-state dictionary contains the specified key; otherwise, false. - The key to locate in the model-state dictionary. - - - Copies the elements of the model-state dictionary to an array, starting at a specified index. - The array. The array must have zero-based indexing. - The zero-based index in array at which copying starts. - - - Gets the number of key/value pairs in the collection. - The number of key/value pairs in the collection. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets a value that indicates whether the collection is read-only. - true if the collection is read-only; otherwise, false. - - - Gets a value that indicates whether this instance of the model-state dictionary is valid. - true if this instance is valid; otherwise, false. - - - Determines whether there are any objects that are associated with or prefixed with the specified key. - true if the model-state dictionary contains a value that is associated with the specified key; otherwise, false. - The key. - - - Gets or sets the value that is associated with the specified key. - The model state item. - The key. - - - Gets a collection that contains the keys in the dictionary. - A collection that contains the keys of the model-state dictionary. - - - Copies the values from the specified object into this dictionary, overwriting existing values if keys are the same. - The dictionary. - - - Removes the first occurrence of the specified object from the model-state dictionary. - true if item was successfully removed the model-state dictionary; otherwise, false. This method also returns false if item is not found in the model-state dictionary. - The object to remove from the model-state dictionary. - - - Removes the element that has the specified key from the model-state dictionary. - true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the model-state dictionary. - The key of the element to remove. - - - Sets the value for the specified key by using the specified value provider dictionary. - The key. - The value. - - - Returns an enumerator that iterates through a collection. - An IEnumerator object that can be used to iterate through the collection. - - - Attempts to gets the value that is associated with the specified key. - true if the object contains an element that has the specified key; otherwise, false. - The key of the value to get. - The value associated with the specified key. - - - Gets a collection that contains the values in the dictionary. - A collection that contains the values of the model-state dictionary. - - - Collection of functions that can produce a parameter binding for a given parameter. - - - Initializes a new instance of the class. - - - Adds function to the end of the collection. The function added is a wrapper around funcInner that checks that parameterType matches typeMatch. - type to match against HttpParameterDescriptor.ParameterType - inner function that is invoked if type match succeeds - - - Insert a function at the specified index in the collection. /// The function added is a wrapper around funcInner that checks that parameterType matches typeMatch. - index to insert at. - type to match against HttpParameterDescriptor.ParameterType - inner function that is invoked if type match succeeds - - - Execute each binding function in order until one of them returns a non-null binding. - the first non-null binding produced for the parameter. Of null if no binding is produced. - parameter to bind. - - - Maps a browser request to an array. - The type of the array. - - - Initializes a new instance of the class. - - - Indicates whether the model is binded. - true if the specified model is binded; otherwise, false. - The action context. - The binding context. - - - Converts the collection to an array. - true in all cases. - The action context. - The binding context. - The new collection. - - - Provides a model binder for arrays. - - - Initializes a new instance of the class. - - - Returns a model binder for arrays. - A model binder object or null if the attempt to get a model binder is unsuccessful. - The configuration. - The type of model. - - - Maps a browser request to a collection. - The type of the collection. - - - Initializes a new instance of the class. - - - Binds the model by using the specified execution context and binding context. - true if model binding is successful; otherwise, false. - The action context. - The binding context. - - - Provides a way for derived classes to manipulate the collection before returning it from the binder. - true in all cases. - The action context. - The binding context. - The new collection. - - - Provides a model binder for a collection. - - - Initializes a new instance of the class. - - - Retrieves a model binder for a collection. - The model binder. - The configuration of the model. - The type of the model. - - - Represents a data transfer object (DTO) for a complex model. - - - Initializes a new instance of the class. - The model metadata. - The collection of property metadata. - - - Gets or sets the model metadata of the . - The model metadata of the . - - - Gets or sets the collection of property metadata of the . - The collection of property metadata of the . - - - Gets or sets the results of the . - The results of the . - - - Represents a model binder for object. - - - Initializes a new instance of the class. - - - Determines whether the specified model is binded. - true if the specified model is binded; otherwise, false. - The action context. - The binding context. - - - Represents a complex model that invokes a model binder provider. - - - Initializes a new instance of the class. - - - Retrieves the associated model binder. - The model binder. - The configuration. - The type of the model to retrieve. - - - Represents the result for object. - - - Initializes a new instance of the class. - The object model. - The validation node. - - - Gets or sets the model for this object. - The model for this object. - - - Gets or sets the for this object. - The for this object. - - - Represents an that delegates to one of a collection of instances. - - - Initializes a new instance of the class. - An enumeration of binders. - - - Initializes a new instance of the class. - An array of binders. - - - Indicates whether the specified model is binded. - true if the model is binded; otherwise, false. - The action context. - The binding context. - - - Represents the class for composite model binder providers. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - A collection of - - - Gets the binder for the model. - The binder for the model. - The binder configuration. - The type of the model. - - - Gets the providers for the composite model binder. - The collection of providers. - - - Maps a browser request to a dictionary data object. - The type of the key. - The type of the value. - - - Initializes a new instance of the class. - - - Converts the collection to a dictionary. - true in all cases. - The action context. - The binding context. - The new collection. - - - Provides a model binder for a dictionary. - - - Initializes a new instance of the class. - - - Retrieves the associated model binder. - The associated model binder. - The configuration to use. - The type of model. - - - Maps a browser request to a key/value pair data object. - The type of the key. - The type of the value. - - - Initializes a new instance of the class. - - - Binds the model by using the specified execution context and binding context. - true if model binding is successful; otherwise, false. - The action context. - The binding context. - - - Provides a model binder for a collection of key/value pairs. - - - Initializes a new instance of the class. - - - Retrieves the associated model binder. - The associated model binder. - The configuration. - The type of model. - - - Maps a browser request to a mutable data object. - - - Initializes a new instance of the class. - - - Binds the model by using the specified action context and binding context. - true if binding is successful; otherwise, false. - The action context. - The binding context. - - - Retrieves a value that indicates whether a property can be updated. - true if the property can be updated; otherwise, false. - The metadata for the property to be evaluated. - - - Creates an instance of the model. - The newly created model object. - The action context. - The binding context. - - - Creates a model instance if an instance does not yet exist in the binding context. - The action context. - The binding context. - - - Retrieves metadata for properties of the model. - The metadata for properties of the model. - The action context. - The binding context. - - - Sets the value of a specified property. - The action context. - The binding context. - The metadata for the property to set. - The validation information about the property. - The validator for the model. - - - Provides a model binder for mutable objects. - - - Initializes a new instance of the class. - - - Retrieves the model binder for the specified type. - The model binder. - The configuration. - The type of the model to retrieve. - - - Provides a simple model binder for this model binding class. - - - Initializes a new instance of the class. - The model type. - The model binder factory. - - - Initializes a new instance of the class by using the specified model type and the model binder. - The model type. - The model binder. - - - Returns a model binder by using the specified execution context and binding context. - The model binder, or null if the attempt to get a model binder is unsuccessful. - The configuration. - The model type. - - - Gets the type of the model. - The type of the model. - - - Gets or sets a value that specifies whether the prefix check should be suppressed. - true if the prefix check should be suppressed; otherwise, false. - - - Maps a browser request to a data object. This type is used when model binding requires conversions using a .NET Framework type converter. - - - Initializes a new instance of the class. - - - Binds the model by using the specified controller context and binding context. - true if model binding is successful; otherwise, false. - The action context. - The binding context. - - - Provides a model binder for a model that requires type conversion. - - - Initializes a new instance of the class. - - - Retrieve a model binder for a model that requires type conversion. - The model binder, or Nothing if the type cannot be converted or there is no value to convert. - The configuration of the binder. - The type of the model. - - - Maps a browser request to a data object. This class is used when model binding does not require type conversion. - - - Initializes a new instance of the class. - - - Binds the model by using the specified execution context and binding context. - true if model binding is successful; otherwise, false. - The action context. - The binding context. - - - Provides a model binder for a model that does not require type conversion. - - - Initializes a new instance of the class. - - - Retrieves the associated model binder. - The associated model binder. - The configuration. - The type of model. - - - Represents an action result that returns response and performs content negotiation on an see with . - - - Initializes a new instance of the class. - The user-visible error message. - The content negotiator to handle content negotiation. - The request message which led to this result. - The formatters to use to negotiate and format the content. - - - Initializes a new instance of the class. - The user-visible error message. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content negotiator to handle content negotiation. - Returns . - - - Returns . - - - Gets the formatters to use to negotiate and format the content. - Returns . - - - Gets the user-visible error message. - Returns . - - - Gets the request message which led to this result. - Returns . - - - Represents an action result that returns an empty response. - - - Initializes a new instance of the class. - The request message which led to this result. - - - Initializes a new instance of the class. - The controller from which to obtain the dependencies needed for execution. - - - Asynchronously executes the request. - The task that completes the execute operation. - The cancellation token. - - - Gets the request message which led to this result. - The request message which led to this result. - - - Represents an action result that returns an empty HttpStatusCode.Conflict response. - - - Initializes a new instance of the class. - The request message which led to this result. - - - Initializes a new instance of the class. - The controller from which to obtain the dependencies needed for execution. - - - Executes asynchronously the operation of the conflict result. - Asynchronously executes the specified task. - The cancellation token. - - - Gets the request message which led to this result. - The HTTP request message which led to this result. - - - Represents an action result that performs route generation and content negotiation and returns a response when content negotiation succeeds. - The type of content in the entity body. - - - Initializes a new instance of the class with the values provided. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - The content value to negotiate and format in the entity body. - The controller from which to obtain the dependencies needed for execution. - - - Initializes a new instance of the class with the values provided. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - The content value to negotiate and format in the entity body. - The factory to use to generate the route URL. - The content negotiator to handle content negotiation. - The request message which led to this result. - The formatters to use to negotiate and format the content. - - - Gets the content value to negotiate and format in the entity body. - - - Gets the content negotiator to handle content negotiation. - - - - Gets the formatters to use to negotiate and format the content. - - - Gets the request message which led to this result. - - - Gets the name of the route to use for generating the URL. - - - Gets the route data to use for generating the URL. - - - Gets the factory to use to generate the route URL. - - - Represents an action result that performs content negotiation and returns a response when it succeeds. - The type of content in the entity body. - - - Initializes a new instance of the class with the values provided. - The content value to negotiate and format in the entity body. - The location at which the content has been created. - The content negotiator to handle content negotiation. - The request message which led to this result. - The formatters to use to negotiate and format the content. - - - Initializes a new instance of the class with the values provided. - The location at which the content has been created. - The content value to negotiate and format in the entity body. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content value to negotiate and format in the entity body. - The content value to negotiate and format in the entity body. - - - Gets the content negotiator to handle content negotiation. - The content negotiator to handle content negotiation. - - - Executes asynchronously the operation of the created negotiated content result. - Asynchronously executes a return value. - The cancellation token. - - - Gets the formatters to use to negotiate and format the content. - The formatters to use to negotiate and format the content. - - - Gets the location at which the content has been created. - The location at which the content has been created. - - - Gets the request message which led to this result. - The HTTP request message which led to this result. - - - Represents an action result that returns a response and performs content negotiation on an  based on an . - - - Initializes a new instance of the class. - The exception to include in the error. - true if the error should include exception messages; otherwise, false . - The content negotiator to handle content negotiation. - The request message which led to this result. - The formatters to use to negotiate and format the content. - - - Initializes a new instance of the class. - The exception to include in the error. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content negotiator to handle content negotiation. - Returns . - - - Gets the exception to include in the error. - Returns . - - - Returns . - - - Gets the formatters to use to negotiate and format the content. - Returns . - - - Gets a value indicating whether the error should include exception messages. - Returns . - - - Gets the request message which led to this result. - Returns . - - - Represents an action result that returns formatted content. - The type of content in the entity body. - - - Initializes a new instance of the class with the values provided. - The HTTP status code for the response message. - The content value to format in the entity body. - The formatter to use to format the content. - The value for the Content-Type header, or to have the formatter pick a default value. - The request message which led to this result. - - - Initializes a new instance of the class with the values provided. - The HTTP status code for the response message. - The content value to format in the entity body. - The formatter to use to format the content. - The value for the Content-Type header, or to have the formatter pick a default value. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content value to format in the entity body. - - - - Gets the formatter to use to format the content. - - - Gets the value for the Content-Type header, or to have the formatter pick a default value. - - - Gets the request message which led to this result. - - - Gets the HTTP status code for the response message. - - - Represents an action result that returns an empty response. - - - Initializes a new instance of the class. - The request message which led to this result. - - - Initializes a new instance of the class. - The controller from which to obtain the dependencies needed for execution. - - - Returns . - - - Gets the request message which led to this result. - Returns . - - - Represents an action result that returns a response and performs content negotiation on an based on a . - - - Initializes a new instance of the class. - The model state to include in the error. - true if the error should include exception messages; otherwise, false. - The content negotiator to handle content negotiation. - The request message which led to this result. - The formatters to use to negotiate and format the content. - - - Initializes a new instance of the class. - The model state to include in the error. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content negotiator to handle content negotiation. - The content negotiator to handle content negotiation. - - - Creates a response message asynchronously. - A task that, when completed, contains the response message. - The token to monitor for cancellation requests. - - - Gets the formatters to use to negotiate and format the content. - The formatters to use to negotiate and format the content. - - - Gets a value indicating whether the error should include exception messages. - true if the error should include exception messages; otherwise, false. - - - Gets the model state to include in the error. - The model state to include in the error. - - - Gets the request message which led to this result. - The request message which led to this result. - - - Represents an action result that returns an response with JSON data. - The type of content in the entity body. - - - Initializes a new instance of the class with the values provided. - The content value to serialize in the entity body. - The serializer settings. - The content encoding. - The request message which led to this result. - - - Initializes a new instance of the class with the values provided. - The content value to serialize in the entity body. - The serializer settings. - The content encoding. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content value to serialize in the entity body. - The content value to serialize in the entity body. - - - Gets the content encoding. - The content encoding. - - - Creates a response message asynchronously. - A task that, when completed, contains the response message. - The token to monitor for cancellation requests. - - - Gets the request message which led to this result. - The request message which led to this result. - - - Gets the serializer settings. - The serializer settings. - - - Represents an action result that performs content negotiation. - The type of content in the entity body. - - - Initializes a new instance of the class with the values provided. - The HTTP status code for the response message. - The content value to negotiate and format in the entity body. - The content negotiator to handle content negotiation. - The request message which led to this result. - The formatters to use to negotiate and format the content. - - - Initializes a new instance of the class with the values provided. - The HTTP status code for the response message. - The content value to negotiate and format in the entity body. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content value to negotiate and format in the entity body. - The content value to negotiate and format in the entity body. - - - Gets the content negotiator to handle content negotiation. - The content negotiator to handle content negotiation. - - - Executes asynchronously an HTTP negotiated content results. - Asynchronously executes an HTTP negotiated content results. - The cancellation token. - - - Gets the formatters to use to negotiate and format the content. - The formatters to use to negotiate and format the content. - - - Gets the request message which led to this result. - The HTTP request message which led to this result. - - - Gets the HTTP status code for the response message. - The HTTP status code for the response message. - - - Represents an action result that returns an empty response. - - - Initializes a new instance of the class. - The request message which led to this result. - - - Initializes a new instance of the class. - The controller from which to obtain the dependencies needed for execution. - - - - Gets the request message which led to this result. - - - Represents an action result that performs content negotiation and returns an HttpStatusCode.OK response when it succeeds. - The type of content in the entity body. - - - Initializes a new instance of the class with the values provided. - The content value to negotiate and format in the entity body. - The content negotiator to handle content negotiation. - The request message which led to this result. - The formatters to use to negotiate and format the content. - - - Initializes a new instance of the class with the values provided. - The content value to negotiate and format in the entity body. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content value to negotiate and format in the entity body. - - - Gets the content negotiator to handle content negotiation. - - - - Gets the formatters to use to negotiate and format the content. - - - Gets the request message which led to this result. - - - Represents an action result that returns an empty HttpStatusCode.OK response. - - - Initializes a new instance of the class. - The request message which led to this result. - - - Initializes a new instance of the class. - The controller from which to obtain the dependencies needed for execution. - - - Executes asynchronously. - Returns the task. - The cancellation token. - - - Gets a HTTP request message for the results. - A HTTP request message for the results. - - - Represents an action result for a <see cref="F:System.Net.HttpStatusCode.Redirect"/>. - - - Initializes a new instance of the <see cref="T:System.Web.Http.Results.RedirectResult"/> class with the values provided. - The location to which to redirect. - The request message which led to this result. - - - Initializes a new instance of the <see cref="T:System.Web.Http.Results.RedirectResult"/> class with the values provided. - The location to which to redirect. - The controller from which to obtain the dependencies needed for execution. - - - Returns . - - - Gets the location at which the content has been created. - Returns . - - - Gets the request message which led to this result. - Returns . - - - Represents an action result that performs route generation and returns a <see cref="F:System.Net.HttpStatusCode.Redirect"/> response. - - - Initializes a new instance of the <see cref="T:System.Web.Http.Results.RedirectToRouteResult"/> class with the values provided. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - The controller from which to obtain the dependencies needed for execution. - - - Initializes a new instance of the <see cref="T:System.Web.Http.Results.RedirectToRouteResult"/> class with the values provided. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - The factory to use to generate the route URL. - The request message which led to this result. - - - Returns . - - - Gets the request message which led to this result. - Returns . - - - Gets the name of the route to use for generating the URL. - Returns . - - - Gets the route data to use for generating the URL. - Returns . - - - Gets the factory to use to generate the route URL. - Returns . - - - Represents an action result that returns a specified response message. - - - Initializes a new instance of the class. - The response message. - - - - Gets the response message. - - - Represents an action result that returns a specified HTTP status code. - - - Initializes a new instance of the class. - The HTTP status code for the response message. - The request message which led to this result. - - - Initializes a new instance of the class. - The HTTP status code for the response message. - The controller from which to obtain the dependencies needed for execution. - - - Creates a response message asynchronously. - A task that, when completed, contains the response message. - The token to monitor for cancellation requests. - - - Gets the request message which led to this result. - The request message which led to this result. - - - Gets the HTTP status code for the response message. - The HTTP status code for the response message. - - - Represents an action result that returns an response. - - - Initializes a new instance of the class. - The WWW-Authenticate challenges. - The request message which led to this result. - - - Initializes a new instance of the class. - The WWW-Authenticate challenges. - The controller from which to obtain the dependencies needed for execution. - - - Gets the WWW-Authenticate challenges. - Returns . - - - Returns . - - - Gets the request message which led to this result. - Returns . - - - A default implementation of . - - - - Creates instances based on the provided factories and action. The route entries provide direct routing to the provided action. - A set of route entries. - The action descriptor. - The direct route factories. - The constraint resolver. - - - Gets a set of route factories for the given action descriptor. - A set of route factories. - The action descriptor. - - - Creates instances based on the provided factories, controller and actions. The route entries provided direct routing to the provided controller and can reach the set of provided actions. - A set of route entries. - The controller descriptor. - The action descriptors. - The direct route factories. - The constraint resolver. - - - Gets route factories for the given controller descriptor. - A set of route factories. - The controller descriptor. - - - Gets direct routes for the given controller descriptor and action descriptors based on attributes. - A set of route entries. - The controller descriptor. - The action descriptors for all actions. - The constraint resolver. - - - Gets the route prefix from the provided controller. - The route prefix or null. - The controller descriptor. - - - The default implementation of . Resolves constraints by parsing a constraint key and constraint arguments, using a map to resolve the constraint type, and calling an appropriate constructor for the constraint type. - - - Initializes a new instance of the class. - - - Gets the mutable dictionary that maps constraint keys to a particular constraint type. - The mutable dictionary that maps constraint keys to a particular constraint type. - - - Resolves the inline constraint. - The the inline constraint was resolved to. - The inline constraint to resolve. - - - Represents a context that supports creating a direct route. - - - Initializes a new instance of the class. - The route prefix, if any, defined by the controller. - The action descriptors to which to create a route. - The inline constraint resolver. - A value indicating whether the route is configured at the action or controller level. - - - Gets the action descriptors to which to create a route. - The action descriptors to which to create a route. - - - Creates a route builder that can build a route matching this context. - A route builder that can build a route matching this context. - The route template. - - - Creates a route builder that can build a route matching this context. - A route builder that can build a route matching this context. - The route template. - The inline constraint resolver to use, if any; otherwise, null. - - - Gets the inline constraint resolver. - The inline constraint resolver. - - - Gets the route prefix, if any, defined by the controller. - The route prefix, if any, defined by the controller. - - - Gets a value indicating whether the route is configured at the action or controller level. - true when the route is configured at the action level; otherwise false (if the route is configured at the controller level). - - - Enables you to define which HTTP verbs are allowed when ASP.NET routing determines whether a URL matches a route. - - - Initializes a new instance of the class by using the HTTP verbs that are allowed for the route. - The HTTP verbs that are valid for the route. - - - Gets or sets the collection of allowed HTTP verbs for the route. - A collection of allowed HTTP verbs for the route. - - - Determines whether the request was made with an HTTP verb that is one of the allowed verbs for the route. - When ASP.NET routing is processing a request, true if the request was made by using an allowed HTTP verb; otherwise, false. When ASP.NET routing is constructing a URL, true if the supplied values contain an HTTP verb that matches one of the allowed HTTP verbs; otherwise, false. The default is true. - The request that is being checked to determine whether it matches the URL. - The object that is being checked to determine whether it matches the URL. - The name of the parameter that is being checked. - An object that contains the parameters for a route. - An object that indicates whether the constraint check is being performed when an incoming request is processed or when a URL is generated. - - - Determines whether the request was made with an HTTP verb that is one of the allowed verbs for the route. - When ASP.NET routing is processing a request, true if the request was made by using an allowed HTTP verb; otherwise, false. When ASP.NET routing is constructing a URL, true if the supplied values contain an HTTP verb that matches one of the allowed HTTP verbs; otherwise, false. The default is true. - The request that is being checked to determine whether it matches the URL. - The object that is being checked to determine whether it matches the URL. - The name of the parameter that is being checked. - An object that contains the parameters for a route. - An object that indicates whether the constraint check is being performed when an incoming request is processed or when a URL is generated. - - - Represents a route class for self-host (i.e. hosted outside of ASP.NET). - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The route template. - - - Initializes a new instance of the class. - The route template. - The default values for the route parameters. - - - Initializes a new instance of the class. - The route template. - The default values for the route parameters. - The constraints for the route parameters. - - - Initializes a new instance of the class. - The route template. - The default values for the route parameters. - The constraints for the route parameters. - Any additional tokens for the route parameters. - - - Initializes a new instance of the class. - The route template. - The default values for the route parameters. - The constraints for the route parameters. - Any additional tokens for the route parameters. - The message handler that will be the recipient of the request. - - - Gets the constraints for the route parameters. - The constraints for the route parameters. - - - Gets any additional data tokens not used directly to determine whether a route matches an incoming . - Any additional data tokens not used directly to determine whether a route matches an incoming . - - - Gets the default values for route parameters if not provided by the incoming . - The default values for route parameters if not provided by the incoming . - - - Determines whether this route is a match for the incoming request by looking up the for the route. - The for a route if matches; otherwise null. - The virtual path root. - The HTTP request. - - - Attempts to generate a URI that represents the values passed in based on current values from the and new values using the specified . - A instance or null if URI cannot be generated. - The HTTP request message. - The route values. - - - Gets or sets the http route handler. - The http route handler. - - - Specifies the HTTP route key. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP request. - The constraints for the route parameters. - The name of the parameter. - The list of parameter values. - One of the enumeration values of the enumeration. - - - Gets the route template describing the URI pattern to match against. - The route template describing the URI pattern to match against. - - - Encapsulates information regarding the HTTP route. - - - Initializes a new instance of the class. - An object that defines the route. - - - Initializes a new instance of the class. - An object that defines the route. - The value. - - - Gets the object that represents the route. - the object that represents the route. - - - Gets a collection of URL parameter values and default values for the route. - An object that contains values that are parsed from the URL and from default values. - - - Removes all optional parameters that do not have a value from the route data. - - - If a route is really a union of other routes, return the set of sub routes. - Returns the set of sub routes contained within this route. - A union route data. - - - Removes all optional parameters that do not have a value from the route data. - The route data, to be mutated in-place. - - - Specifies an enumeration of route direction. - - - The UriGeneration direction. - - - The UriResolution direction. - - - Represents a route class for self-host of specified key/value pairs. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The dictionary. - - - Initializes a new instance of the class. - The key value. - - - Presents the data regarding the HTTP virtual path. - - - Initializes a new instance of the class. - The route of the virtual path. - The URL that was created from the route definition. - - - Gets or sets the route of the virtual path.. - The route of the virtual path. - - - Gets or sets the URL that was created from the route definition. - The URL that was created from the route definition. - - - Defines a builder that creates direct routes to actions (attribute routes). - - - Gets the action descriptors to which to create a route. - The action descriptors to which to create a route. - - - Creates a route entry based on the current property values. - The route entry created. - - - Gets or sets the route constraints. - The route constraints. - - - Gets or sets the route data tokens. - The route data tokens. - - - Gets or sets the route defaults. - The route defaults. - - - Gets or sets the route name, if any; otherwise null. - The route name, if any; otherwise null. - - - Gets or sets the route order. - The route order. - - - Gets or sets the route precedence. - The route precedence. - - - Gets a value indicating whether the route is configured at the action or controller level. - true when the route is configured at the action level; otherwise false (if the route is configured at the controller level). - - - Gets or sets the route template. - The route template. - - - Defines a factory that creates a route directly to a set of action descriptors (an attribute route). - - - Creates a direct route entry. - The direct route entry. - The context to use to create the route. - - - Defines a provider for routes that directly target action descriptors (attribute routes). - - - Gets the direct routes for a controller. - A set of route entries for the controller. - The controller descriptor. - The action descriptors. - The inline constraint resolver. - - - - defines the interface for a route expressing how to map an incoming to a particular controller and action. - - - Gets the constraints for the route parameters. - The constraints for the route parameters. - - - Gets any additional data tokens not used directly to determine whether a route matches an incoming . - The additional data tokens. - - - Gets the default values for route parameters if not provided by the incoming . - The default values for route parameters. - - - Determine whether this route is a match for the incoming request by looking up the <see cref="!:IRouteData" /> for the route. - The <see cref="!:RouteData" /> for a route if matches; otherwise null. - The virtual path root. - The request. - - - Gets a virtual path data based on the route and the values provided. - The virtual path data. - The request message. - The values. - - - Gets the message handler that will be the recipient of the request. - The message handler. - - - Gets the route template describing the URI pattern to match against. - The route template. - - - Represents a base class route constraint. - - - Determines whether this instance equals a specified route. - True if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Provides information about a route. - - - Gets the object that represents the route. - The object that represents the route. - - - Gets a collection of URL parameter values and default values for the route. - The values that are parsed from the URL and from default values. - - - Provides information for defining a route. - - - Gets the name of the route to generate. - - - Gets the order of the route relative to other routes. - - - Gets the route template describing the URI pattern to match against. - - - Defines the properties for HTTP route. - - - Gets the HTTP route. - The HTTP route. - - - Gets the URI that represents the virtual path of the current HTTP route. - The URI that represents the virtual path of the current HTTP route. - - - Defines an abstraction for resolving inline constraints as instances of . - - - Resolves the inline constraint. - The the inline constraint was resolved to. - The inline constraint to resolve. - - - Defines a route prefix. - - - Gets the route prefix. - The route prefix. - - - Represents a named route. - - - Initializes a new instance of the class. - The route name, if any; otherwise, null. - The route. - - - Gets the route name, if any; otherwise, null. - The route name, if any; otherwise, null. - - - Gets the route. - The route. - - - Represents an attribute route that may contain custom constraints. - - - Initializes a new instance of the class. - The route template. - - - Gets the route constraints, if any; otherwise null. - The route constraints, if any; otherwise null. - - - Creates the route entry - The created route entry. - The context. - - - Gets the route data tokens, if any; otherwise null. - The route data tokens, if any; otherwise null. - - - Gets the route defaults, if any; otherwise null. - The route defaults, if any; otherwise null. - - - Gets or sets the route name, if any; otherwise null. - The route name, if any; otherwise null. - - - Gets or sets the route order. - The route order. - - - Gets the route template. - The route template. - - - Represents a handler that specifies routing should not handle requests for a route template. When a route provides this class as a handler, requests matching against the route will be ignored. - - - Initializes a new instance of the class. - - - Represents a factory for creating URLs. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The HTTP request for this instance. - - - Creates an absolute URL using the specified path. - The generated URL. - The URL path, which may be a relative URL, a rooted URL, or a virtual path. - - - Returns a link for the specified route. - A link for the specified route. - The name of the route. - An object that contains the parameters for a route. - - - Returns a link for the specified route. - A link for the specified route. - The name of the route. - A route value. - - - Gets or sets the of the current instance. - The of the current instance. - - - Returns the route for the . - The route for the . - The name of the route. - A list of route values. - - - Returns the route for the . - The route for the . - The name of the route. - The route values. - - - Constrains a route parameter to contain only lowercase or uppercase letters A through Z in the English alphabet. - - - Initializes a new instance of the class. - - - Constrains a route parameter to represent only Boolean values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route by several child constraints. - - - Initializes a new instance of the class. - The child constraints that must match for this constraint to match. - - - Gets the child constraints that must match for this constraint to match. - The child constraints that must match for this constraint to match. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to represent only values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route of direction. - - - Constrains a route parameter to represent only decimal values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to represent only 64-bit floating-point values. - - - - - Constrains a route parameter to represent only 32-bit floating-point values. - - - - - Constrains a route parameter to represent only values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to represent only 32-bit integer values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to be a string of a given length or within a given range of lengths. - - - - Initializes a new instance of the class that constrains a route parameter to be a string of a given length. - The minimum length of the route parameter. - The maximum length of the route parameter. - - - Gets the length of the route parameter, if one is set. - - - - Gets the maximum length of the route parameter, if one is set. - - - Gets the minimum length of the route parameter, if one is set. - - - Constrains a route parameter to represent only 64-bit integer values. - - - - - Constrains a route parameter to be a string with a maximum length. - - - Initializes a new instance of the class. - The maximum length. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Gets the maximum length of the route parameter. - The maximum length of the route parameter. - - - Constrains a route parameter to be an integer with a maximum value. - - - - - Gets the maximum value of the route parameter. - - - Constrains a route parameter to be a string with a maximum length. - - - Initializes a new instance of the class. - The minimum length. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Gets the minimum length of the route parameter. - The minimum length of the route parameter. - - - Constrains a route parameter to be a long with a minimum value. - - - Initializes a new instance of the class. - The minimum value of the route parameter. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Gets the minimum value of the route parameter. - The minimum value of the route parameter. - - - Constrains a route by an inner constraint that doesn't fail when an optional parameter is set to its default value. - - - Initializes a new instance of the class. - The inner constraint to match if the parameter is not an optional parameter without a value - - - Gets the inner constraint to match if the parameter is not an optional parameter without a value. - The inner constraint to match if the parameter is not an optional parameter without a value. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constraints a route parameter to be an integer within a given range of values. - - - Initializes a new instance of the class. - The minimum value. - The maximum value. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Gets the maximum value of the route parameter. - The maximum value of the route parameter. - - - Gets the minimum value of the route parameter. - The minimum value of the route parameter. - - - Constrains a route parameter to match a regular expression. - - - Initializes a new instance of the class. - The pattern. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Gets the regular expression pattern to match. - The regular expression pattern to match. - - - Provides a method for retrieving the innermost object of an object that might be wrapped by an <see cref="T:System.Web.Http.Services.IDecorator`1" />. - - - Gets the innermost object which does not implement <see cref="T:System.Web.Http.Services.IDecorator`1" />. - Object which needs to be unwrapped. - - - - Represents a container for service instances used by the . Note that this container only supports known types, and methods to get or set arbitrary service types will throw when called. For creation of arbitrary types, please use instead. The supported types for this container are: Passing any type which is not on this to any method on this interface will cause an to be thrown. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified object. - The object. - - - Removes a single-instance service from the default services. - The type of the service. - - - Gets a service of the specified type. - The first instance of the service, or null if the service is not found. - The type of service. - - - Gets the list of service objects for a given service type, and validates the service type. - The list of service objects of the specified type. - The service type. - - - Gets the list of service objects for a given service type. - The list of service objects of the specified type, or an empty list if the service is not found. - The type of service. - - - Queries whether a service type is single-instance. - true if the service type has at most one instance, or false if the service type supports multiple instances. - The service type. - - - Replaces a single-instance service object. - The service type. - The service object that replaces the previous instance. - - - Removes the cached values for a single service type. - The service type. - - - Defines a decorator that exposes the inner decorated object. - This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see . - - - Gets the inner object. - - - Represents a performance tracing class to log method entry/exit and duration. - - - Initializes the class with a specified configuration. - The configuration. - - - Represents the trace writer. - - - Invokes the specified traceAction to allow setting values in a new if and only if tracing is permitted at the given category and level. - The current . It may be null but doing so will prevent subsequent trace analysis from correlating the trace to a particular request. - The logical category for the trace. Users can define their own. - The at which to write this trace. - The action to invoke if tracing is enabled. The caller is expected to fill in the fields of the given in this action. - - - Represents an extension methods for . - - - Provides a set of methods and properties that help debug your code with the specified writer, request, category and exception. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The error occurred during execution. - - - Provides a set of methods and properties that help debug your code with the specified writer, request, category, exception, message format and argument. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The error occurred during execution. - The format of the message. - The message argument. - - - Provides a set of methods and properties that help debug your code with the specified writer, request, category, exception, message format and argument. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The format of the message. - The message argument. - - - Displays an error message in the list with the specified writer, request, category and exception. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The error occurred during execution. - - - Displays an error message in the list with the specified writer, request, category, exception, message format and argument. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The exception. - The format of the message. - The argument in the message. - - - Displays an error message in the list with the specified writer, request, category, message format and argument. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The format of the message. - The argument in the message. - - - Displays an error message in the class with the specified writer, request, category and exception. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The exception that appears during execution. - - - Displays an error message in the class with the specified writer, request, category and exception, message format and argument. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The exception. - The format of the message. - The message argument. - - - Displays an error message in the class with the specified writer, request, category and message format and argument. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The format of the message. - The message argument. - - - Displays the details in the . - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The error occurred during execution. - - - Displays the details in the . - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The error occurred during execution. - The format of the message. - The message argument. - - - Displays the details in the . - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The format of the message. - The message argument. - - - Indicates the trace listeners in the Listeners collection. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The trace level. - The error occurred during execution. - - - Indicates the trace listeners in the Listeners collection. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The trace level. - The error occurred during execution. - The format of the message. - The message argument. - - - Indicates the trace listeners in the Listeners collection. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The of the trace. - The format of the message. - The message argument. - - - Traces both a begin and an end trace around a specified operation. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The of the trace. - The name of the object performing the operation. It may be null. - The name of the operation being performed. It may be null. - The to invoke prior to performing the operation, allowing the given to be filled in. It may be null. - An <see cref="T:System.Func`1" /> that returns the that will perform the operation. - The to invoke after successfully performing the operation, allowing the given to be filled in. It may be null. - The to invoke if an error was encountered performing the operation, allowing the given to be filled in. It may be null. - - - Traces both a begin and an end trace around a specified operation. - The returned by the operation. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The of the trace. - The name of the object performing the operation. It may be null. - The name of the operation being performed. It may be null. - The to invoke prior to performing the operation, allowing the given to be filled in. It may be null. - An <see cref="T:System.Func`1" /> that returns the that will perform the operation. - The to invoke after successfully performing the operation, allowing the given to be filled in. The result of the completed task will also be passed to this action. This action may be null. - The to invoke if an error was encountered performing the operation, allowing the given to be filled in. It may be null. - The type of result produced by the . - - - Traces both a begin and an end trace around a specified operation. - The returned by the operation. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The of the trace. - The name of the object performing the operation. It may be null. - The name of the operation being performed. It may be null. - The to invoke prior to performing the operation, allowing the given to be filled in. It may be null. - An <see cref="T:System.Func`1" /> that returns the that will perform the operation. - The to invoke after successfully performing the operation, allowing the given to be filled in. It may be null. - The to invoke if an error was encountered performing the operation, allowing the given to be filled in. It may be null. - - - Indicates the warning level of execution. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The error occurred during execution. - - - Indicates the warning level of execution. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The error occurred during execution. - The format of the message. - The message argument. - - - Indicates the warning level of execution. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The format of the message. - The message argument. - - - Specifies an enumeration of tracing categories. - - - An action category. - - - The controllers category. - - - The filters category. - - - The formatting category. - - - The message handlers category. - - - The model binding category. - - - The request category. - - - The routing category. - - - Specifies the kind of tracing operation. - - - Trace marking the beginning of some operation. - - - Trace marking the end of some operation. - - - Single trace, not part of a Begin/End trace pair. - - - Specifies an enumeration of tracing level. - - - Trace level for debugging traces. - - - Trace level for error traces. - - - Trace level for fatal traces. - - - Trace level for informational traces. - - - Tracing is disabled. - - - Trace level for warning traces. - - - Represents a trace record. - - - Initializes a new instance of the class. - The message request. - The trace category. - The trace level. - - - Gets or sets the tracing category. - The tracing category. - - - Gets or sets the exception. - The exception. - - - Gets or sets the kind of trace. - The kind of trace. - - - Gets or sets the tracing level. - The tracing level. - - - Gets or sets the message. - The message. - - - Gets or sets the logical operation name being performed. - The logical operation name being performed. - - - Gets or sets the logical name of the object performing the operation. - The logical name of the object performing the operation. - - - Gets the optional user-defined properties. - The optional user-defined properties. - - - Gets the from the record. - The from the record. - - - Gets the correlation ID from the . - The correlation ID from the . - - - Gets or sets the associated with the . - The associated with the . - - - Gets the of this trace (via ). - The of this trace (via ). - - - Represents a class used to recursively validate an object. - - - Initializes a new instance of the class. - - - Determines whether instances of a particular type should be validated. - true if the type should be validated; false otherwise. - The type to validate. - - - Determines whether the is valid and adds any validation errors to the 's . - true if model is valid, false otherwise. - The model to be validated. - The to use for validation. - The used to provide model metadata. - The within which the model is being validated. - The to append to the key for any validation errors. - - - Represents an interface for the validation of the models - - - Determines whether the model is valid and adds any validation errors to the actionContext's - trueif model is valid, false otherwise. - The model to be validated. - The to use for validation. - The used to provide the model metadata. - The within which the model is being validated. - The to append to the key for any validation errors. - - - This logs formatter errors to the provided . - - - Initializes a new instance of the class. - The model state. - The prefix. - - - Logs the specified model error. - The error path. - The error message. - - - Logs the specified model error. - The error path. - The error message. - - - Provides data for the event. - - - Initializes a new instance of the class. - The action context. - The parent node. - - - Gets or sets the context for an action. - The context for an action. - - - Gets or sets the parent of this node. - The parent of this node. - - - Provides data for the event. - - - Initializes a new instance of the class. - The action context. - The parent node. - - - Gets or sets the context for an action. - The context for an action. - - - Gets or sets the parent of this node. - The parent of this node. - - - Provides a container for model validation information. - - - Initializes a new instance of the class, using the model metadata and state key. - The model metadata. - The model state key. - - - Initializes a new instance of the class, using the model metadata, the model state key, and child model-validation nodes. - The model metadata. - The model state key. - The model child nodes. - - - Gets or sets the child nodes. - The child nodes. - - - Combines the current instance with a specified instance. - The model validation node to combine with the current instance. - - - Gets or sets the model metadata. - The model metadata. - - - Gets or sets the model state key. - The model state key. - - - Gets or sets a value that indicates whether validation should be suppressed. - true if validation should be suppressed; otherwise, false. - - - Validates the model using the specified execution context. - The action context. - - - Validates the model using the specified execution context and parent node. - The action context. - The parent node. - - - Gets or sets a value that indicates whether all properties of the model should be validated. - true if all properties of the model should be validated, or false if validation should be skipped. - - - Occurs when the model has been validated. - - - Occurs when the model is being validated. - - - Represents the selection of required members by checking for any required ModelValidators associated with the member. - - - Initializes a new instance of the class. - The metadata provider. - The validator providers. - - - Indicates whether the member is required for validation. - true if the member is required for validation; otherwise, false. - The member. - - - Provides a container for a validation result. - - - Initializes a new instance of the class. - - - Gets or sets the name of the member. - The name of the member. - - - Gets or sets the validation result message. - The validation result message. - - - Provides a base class for implementing validation logic. - - - Initializes a new instance of the class. - The validator providers. - - - Returns a composite model validator for the model. - A composite model validator for the model. - An enumeration of validator providers. - - - Gets a value that indicates whether a model property is required. - true if the model property is required; otherwise, false. - - - Validates a specified object. - A list of validation results. - The metadata. - The container. - - - Gets or sets an enumeration of validator providers. - An enumeration of validator providers. - - - Provides a list of validators for a model. - - - Initializes a new instance of the class. - - - Gets a list of validators associated with this . - The list of validators. - The metadata. - The validator providers. - - - Provides an abstract class for classes that implement a validation provider. - - - Initializes a new instance of the class. - - - Gets a type descriptor for the specified type. - A type descriptor for the specified type. - The type of the validation provider. - - - Gets the validators for the model using the metadata and validator providers. - The validators for the model. - The metadata. - An enumeration of validator providers. - - - Gets the validators for the model using the metadata, the validator providers, and a list of attributes. - The validators for the model. - The metadata. - An enumeration of validator providers. - The list of attributes. - - - Represents the method that creates a instance. - - - Represents an implementation of which providers validators for attributes which derive from . It also provides a validator for types which implement . To support client side validation, you can either register adapters through the static methods on this class, or by having your validation attributes implement . The logic to support IClientValidatable is implemented in . - - - Initializes a new instance of the class. - - - Gets the validators for the model using the specified metadata, validator provider and attributes. - The validators for the model. - The metadata. - The validator providers. - The attributes. - - - Registers an adapter to provide client-side validation. - The type of the validation attribute. - The type of the adapter. - - - Registers an adapter factory for the validation provider. - The type of the attribute. - The factory that will be used to create the object for the specified attribute. - - - Registers the default adapter. - The type of the adapter. - - - Registers the default adapter factory. - The factory that will be used to create the object for the default adapter. - - - Registers the default adapter type for objects which implement . The adapter type must derive from and it must contain a public constructor which takes two parameters of types and . - The type of the adapter. - - - Registers the default adapter factory for objects which implement . - The factory. - - - Registers an adapter type for the given modelType, which must implement . The adapter type must derive from and it must contain a public constructor which takes two parameters of types and . - The model type. - The type of the adapter. - - - Registers an adapter factory for the given modelType, which must implement . - The model type. - The factory. - - - Provides a factory for validators that are based on . - - - Represents a validator provider for data member model. - - - Initializes a new instance of the class. - - - Gets the validators for the model. - The validators for the model. - The metadata. - An enumerator of validator providers. - A list of attributes. - - - An implementation of which provides validators that throw exceptions when the model is invalid. - - - Initializes a new instance of the class. - - - Gets a list of validators associated with this . - The list of validators. - The metadata. - The validator providers. - The list of attributes. - - - Represents the provider for the required member model validator. - - - Initializes a new instance of the class. - The required member selector. - - - Gets the validator for the member model. - The validator for the member model. - The metadata. - The validator providers - - - Provides a model validator. - - - Initializes a new instance of the class. - The validator providers. - The validation attribute for the model. - - - Gets or sets the validation attribute for the model validator. - The validation attribute for the model validator. - - - Gets a value that indicates whether model validation is required. - true if model validation is required; otherwise, false. - - - Validates the model and returns the validation errors if any. - A list of validation error messages for the model, or an empty list if no errors have occurred. - The model metadata. - The container for the model. - - - A to represent an error. This validator will always throw an exception regardless of the actual model value. - - - Initializes a new instance of the class. - The list of model validator providers. - The error message for the exception. - - - Validates a specified object. - A list of validation results. - The metadata. - The container. - - - Represents the for required members. - - - Initializes a new instance of the class. - The validator providers. - - - Gets or sets a value that instructs the serialization engine that the member must be presents when validating. - true if the member is required; otherwise, false. - - - Validates the object. - A list of validation results. - The metadata. - The container. - - - Provides an object adapter that can be validated. - - - Initializes a new instance of the class. - The validation provider. - - - Validates the specified object. - A list of validation results. - The metadata. - The container. - - - Represents the base class for value providers whose values come from a collection that implements the interface. - - - Retrieves the keys from the specified . - The keys from the specified . - The prefix. - - - Represents an interface that is implemented by any that supports the creation of a to access the of an incoming . - - - Defines the methods that are required for a value provider in ASP.NET MVC. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - - - Retrieves a value object using the specified key. - The value object for the specified key, or null if the key is not found. - The key of the value object to retrieve. - - - This attribute is used to specify a custom . - - - Initializes a new instance of the . - The type of the model binder. - - - Initializes a new instance of the . - An array of model binder types. - - - Gets the value provider factories. - A collection of value provider factories. - A configuration object. - - - Gets the types of object returned by the value provider factory. - A collection of types. - - - Represents a factory for creating value-provider objects. - - - Initializes a new instance of the class. - - - Returns a value-provider object for the specified controller context. - A value-provider object. - An object that encapsulates information about the current HTTP request. - - - Represents the result of binding a value (such as from a form post or query string) to an action-method argument property, or to the argument itself. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The raw value. - The attempted value. - The culture. - - - Gets or sets the raw value that is converted to a string for display. - The raw value that is converted to a string for display. - - - Converts the value that is encapsulated by this result to the specified type. - The converted value. - The target type. - - - Converts the value that is encapsulated by this result to the specified type by using the specified culture information. - The converted value. - The target type. - The culture to use in the conversion. - - - Gets or sets the culture. - The culture. - - - Gets or set the raw value that is supplied by the value provider. - The raw value that is supplied by the value provider. - - - Represents a value provider whose values come from a list of value providers that implements the interface. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The list of value providers. - - - Determines whether the collection contains the specified . - true if the collection contains the specified ; otherwise, false. - The prefix to search for. - - - Retrieves the keys from the specified . - The keys from the specified . - The prefix from which keys are retrieved. - - - Retrieves a value object using the specified . - The value object for the specified . - The key of the value object to retrieve. - - - Inserts an element into the collection at the specified index. - The zero-based index at which should be inserted. - The object to insert. - - - Replaces the element at the specified index. - The zero-based index of the element to replace. - The new value for the element at the specified index. - - - Represents a factory for creating a list of value-provider objects. - - - Initializes a new instance of the class. - The collection of value-provider factories. - - - Retrieves a list of value-provider objects for the specified controller context. - The list of value-provider objects for the specified controller context. - An object that encapsulates information about the current HTTP request. - - - A value provider for name/value pairs. - - - - Initializes a new instance of the class. - The name/value pairs for the provider. - The culture used for the name/value pairs. - - - Initializes a new instance of the class, using a function delegate to provide the name/value pairs. - A function delegate that returns a collection of name/value pairs. - The culture used for the name/value pairs. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - - - Gets the keys from a prefix. - The keys. - The prefix. - - - Retrieves a value object using the specified key. - The value object for the specified key. - The key of the value object to retrieve. - - - Represents a value provider for query strings that are contained in a object. - - - Initializes a new instance of the class. - An object that encapsulates information about the current HTTP request. - An object that contains information about the target culture. - - - Represents a class that is responsible for creating a new instance of a query-string value-provider object. - - - Initializes a new instance of the class. - - - Retrieves a value-provider object for the specified controller context. - A query-string value-provider object. - An object that encapsulates information about the current HTTP request. - - - Represents a value provider for route data that is contained in an object that implements the IDictionary(Of TKey, TValue) interface. - - - Initializes a new instance of the class. - An object that contain information about the HTTP request. - An object that contains information about the target culture. - - - Represents a factory for creating route-data value provider objects. - - - Initializes a new instance of the class. - - - Retrieves a value-provider object for the specified controller context. - A value-provider object. - An object that encapsulates information about the current HTTP request. - - + + + + System.Web.Http + + + + + Creates an that represents an exception. + The request must be associated with an instance.An whose content is a serialized representation of an instance. + The HTTP request. + The status code of the response. + The exception. + + + Creates an that represents an error message. + The request must be associated with an instance.An whose content is a serialized representation of an instance. + The HTTP request. + The status code of the response. + The error message. + + + Creates an that represents an exception with an error message. + The request must be associated with an instance.An whose content is a serialized representation of an instance. + The HTTP request. + The status code of the response. + The error message. + The exception. + + + Creates an that represents an error. + The request must be associated with an instance.An whose content is a serialized representation of an instance. + The HTTP request. + The status code of the response. + The HTTP error. + + + Creates an that represents an error in the model state. + The request must be associated with an instance.An whose content is a serialized representation of an instance. + The HTTP request. + The status code of the response. + The model state. + + + Creates an wired up to the associated . + An initialized wired up to the associated . + The HTTP request message which led to this response message. + The HTTP response status code. + The content of the HTTP response message. + The type of the HTTP response message. + + + Creates an wired up to the associated . + An initialized wired up to the associated . + The HTTP request message which led to this response message. + The HTTP response status code. + The content of the HTTP response message. + The media type formatter. + The type of the HTTP response message. + + + Creates an wired up to the associated . + An initialized wired up to the associated . + The HTTP request message which led to this response message. + The HTTP response status code. + The content of the HTTP response message. + The media type formatter. + The media type header value. + The type of the HTTP response message. + + + Creates an wired up to the associated . + An initialized wired up to the associated . + The HTTP request message which led to this response message. + The HTTP response status code. + The content of the HTTP response message. + The media type formatter. + The media type. + The type of the HTTP response message. + + + Creates an wired up to the associated . + An initialized wired up to the associated . + The HTTP request message which led to this response message. + The HTTP response status code. + The content of the HTTP response message. + The media type header value. + The type of the HTTP response message. + + + Creates an wired up to the associated . + An initialized wired up to the associated . + The HTTP request message which led to this response message. + The HTTP response status code. + The content of the HTTP response message. + The media type. + The type of the HTTP response message. + + + Creates an wired up to the associated . + An initialized wired up to the associated . + The HTTP request message which led to this response message. + The HTTP response status code. + The content of the HTTP response message. + The HTTP configuration which contains the dependency resolver used to resolve services. + The type of the HTTP response message. + + + + + + Disposes of all tracked resources associated with the which were added via the method. + The HTTP request. + + + + Gets the current X.509 certificate from the given HTTP request. + The current , or null if a certificate is not available. + The HTTP request. + + + Retrieves the for the given request. + The for the given request. + The HTTP request. + + + Retrieves the which has been assigned as the correlation ID associated with the given . The value will be created and set the first time this method is called. + The object that represents the correlation ID associated with the request. + The HTTP request. + + + Retrieves the for the given request or null if not available. + The for the given request or null if not available. + The HTTP request. + + + Gets the parsed query string as a collection of key-value pairs. + The query string as a collection of key-value pairs. + The HTTP request. + + + + + Retrieves the for the given request or null if not available. + The for the given request or null if not available. + The HTTP request. + + + Retrieves the for the given request or null if not available. + The for the given request or null if not available. + The HTTP request. + + + Gets a instance for an HTTP request. + A instance that is initialized for the specified HTTP request. + The HTTP request. + + + + + + Adds the given to a list of resources that will be disposed by a host once the is disposed. + The HTTP request controlling the lifecycle of . + The resource to dispose when is being disposed. + + + + + + + Represents the message extensions for the HTTP response from an ASP.NET operation. + + + Attempts to retrieve the value of the content for the . + The result of the retrieval of value of the content. + The response of the operation. + The value of the content. + The type of the value to retrieve. + + + Represents extensions for adding items to a . + + + + + Provides s from path extensions appearing in a . + + + Initializes a new instance of the class. + The extension corresponding to mediaType. This value should not include a dot or wildcards. + The that will be returned if uriPathExtension is matched. + + + Initializes a new instance of the class. + The extension corresponding to mediaType. This value should not include a dot or wildcards. + The media type that will be returned if uriPathExtension is matched. + + + Returns a value indicating whether this instance can provide a for the of request. + If this instance can match a file extension in request it returns 1.0 otherwise 0.0. + The to check. + + + Gets the path extension. + The path extension. + + + The path extension key. + + + Represents an attribute that specifies which HTTP methods an action method will respond to. + + + Initializes a new instance of the class by using the action method it will respond to. + The HTTP method that the action method will respond to. + + + Initializes a new instance of the class by using a list of HTTP methods that the action method will respond to. + The HTTP methods that the action method will respond to. + + + Gets or sets the list of HTTP methods that the action method will respond to. + Gets or sets the list of HTTP methods that the action method will respond to. + + + Represents an attribute that is used for the name of an action. + + + Initializes a new instance of the class. + The name of the action. + + + Gets or sets the name of the action. + The name of the action. + + + Specifies that actions and controllers are skipped by during authorization. + + + Initializes a new instance of the class. + + + Defines properties and methods for API controller. + + + + Gets the action context. + The action context. + + + Creates a . + A . + + + Creates an (400 Bad Request) with the specified error message. + An with the specified model state. + The user-visible error message. + + + Creates an with the specified model state. + An with the specified model state. + The model state to include in the error. + + + Gets the of the current . + The of the current . + + + Creates a (409 Conflict). + A . + + + Creates a <see cref="T:System.Web.Http.NegotiatedContentResult`1" /> with the specified values. + A <see cref="T:System.Web.Http.NegotiatedContentResult`1" /> with the specified values. + The HTTP status code for the response message. + The content value to negotiate and format in the entity body. + The type of content in the entity body. + + + Creates a <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. + A <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. + The HTTP status code for the response message. + The content value to format in the entity body. + The formatter to use to format the content. + The type of content in the entity body. + + + Creates a <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. + A <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. + The HTTP status code for the response message. + The content value to format in the entity body. + The formatter to use to format the content. + The value for the Content-Type header, or <see langword="null" /> to have the formatter pick a default value. + The type of content in the entity body. + + + Creates a <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. + A <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. + The HTTP status code for the response message. + The content value to format in the entity body. + The formatter to use to format the content. + The value for the Content-Type header. + The type of content in the entity body. + + + Gets the of the current . + The of the current . + + + Creates a (201 Created) with the specified values. + A with the specified values. + The location at which the content has been created. + The content value to negotiate and format in the entity body. + The type of content in the entity body. + + + Creates a (201 Created) with the specified values. + A with the specified values. + The location at which the content has been created. + The content value to negotiate and format in the entity body. + The type of content in the entity body. + + + Creates a (201 Created) with the specified values. + A with the specified values. + The name of the route to use for generating the URL. + The route data to use for generating the URL. + The content value to negotiate and format in the entity body. + The type of content in the entity body. + + + Creates a (201 Created) with the specified values. + A with the specified values. + The name of the route to use for generating the URL. + The route data to use for generating the URL. + The content value to negotiate and format in the entity body. + The type of content in the entity body. + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + Releases the unmanaged resources that are used by the object and, optionally, releases the managed resources. + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + Executes asynchronously a single HTTP operation. + The newly started task. + The controller context for a single HTTP operation. + The cancellation token assigned for the HTTP operation. + + + Initializes the instance with the specified controllerContext. + The object that is used for the initialization. + + + Creates an (500 Internal Server Error). + A . + + + Creates an (500 Internal Server Error) with the specified exception. + An with the specified exception. + The exception to include in the error. + + + Creates a (200 OK) with the specified value. + A with the specified value. + The content value to serialize in the entity body. + The type of content in the entity body. + + + Creates a (200 OK) with the specified values. + A with the specified values. + The content value to serialize in the entity body. + The serializer settings. + The type of content in the entity body. + + + Creates a (200 OK) with the specified values. + A with the specified values. + The content value to serialize in the entity body. + The serializer settings. + The content encoding. + The type of content in the entity body. + + + Gets the model state after the model binding process. + The model state after the model binding process. + + + Creates a . + A . + + + Creates an (200 OK). + An . + + + Creates an with the specified values. + An with the specified values. + The content value to negotiate and format in the entity body. + The type of content in the entity body. + + + Creates a redirect result (302 Found) with the specified value. + A redirect result (302 Found) with the specified value. + The location to redirect to. + + + Creates a redirect result (302 Found) with the specified value. + A redirect result (302 Found) with the specified value. + The location to redirect to. + + + Creates a redirect to route result (302 Found) with the specified values. + A redirect to route result (302 Found) with the specified values. + The name of the route to use for generating the URL. + The route data to use for generating the URL. + + + Creates a redirect to route result (302 Found) with the specified values. + A redirect to route result (302 Found) with the specified values. + The name of the route to use for generating the URL. + The route data to use for generating the URL. + + + Gets or sets the HttpRequestMessage of the current . + The HttpRequestMessage of the current . + + + Gets the request context. + The request context. + + + Creates a with the specified response. + A for the specified response. + The HTTP response message. + + + Creates a with the specified status code. + A with the specified status code. + The HTTP status code for the response message + + + Creates an (401 Unauthorized) with the specified values. + An with the specified values. + The WWW-Authenticate challenges. + + + Creates an (401 Unauthorized) with the specified values. + An with the specified values. + The WWW-Authenticate challenges. + + + Gets an instance of a , which is used to generate URLs to other APIs. + A , which is used to generate URLs to other APIs. + + + Returns the current principal associated with this request. + The current principal associated with this request. + + + Validates the given entity and adds the validation errors to the model state under the empty prefix, if any. + The entity being validated. + The type of the entity to be validated. + + + Validates the given entity and adds the validation errors to the model state, if any. + The entity being validated. + The key prefix under which the model state errors would be added in the model state. + The type of the entity to be validated. + + + Specifies the authorization filter that verifies the request's . + + + Initializes a new instance of the class. + + + Processes requests that fail authorization. + The context. + + + Indicates whether the specified control is authorized. + true if the control is authorized; otherwise, false. + The context. + + + Calls when an action is being authorized. + The context. + The context parameter is null. + + + Gets or sets the authorized roles. + The roles string. + + + Gets a unique identifier for this attribute. + A unique identifier for this attribute. + + + Gets or sets the authorized users. + The users string. + + + An attribute that specifies that an action parameter comes only from the entity body of the incoming . + + + Initializes a new instance of the class. + + + Gets a parameter binding. + The parameter binding. + The parameter description. + + + An attribute that specifies that an action parameter comes from the URI of the incoming . + + + Initializes a new instance of the class. + + + Gets the value provider factories for the model binder. + A collection of objects. + The configuration. + + + Represents attributes that specifies that HTTP binding should exclude a property. + + + Initializes a new instance of the class. + + + Represents the required attribute for http binding. + + + Initializes a new instance of the class. + + + Represents a configuration of instances. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with an HTTP route collection. + The HTTP route collection to associate with this instance. + + + Gets or sets the dependency resolver associated with thisinstance. + The dependency resolver. + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + Releases the unmanaged resources that are used by the object and, optionally, releases the managed resources. + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + Invoke the Intializer hook. It is considered immutable from this point forward. It's safe to call this multiple times. + + + Gets the list of filters that apply to all requests served using this instance. + The list of filters. + + + Gets the media-type formatters for this instance. + A collection of objects. + + + Gets or sets a value indicating whether error details should be included in error messages. + The value that indicates that error detail policy. + + + Gets or sets the action that will perform final initialization of the instance before it is used to process requests. + The action that will perform final initialization of the instance. + + + Gets an ordered list of instances to be invoked as an travels up the stack and an travels down in stack in return. + The message handler collection. + + + Gets the collection of rules for how parameters should be bound. + A collection of functions that can produce a parameter binding for a given parameter. + + + Gets the properties associated with this instance. + The that contains the properties. + + + Gets the associated with this instance. + The . + + + Gets the container of default services associated with this instance. + The that contains the default services for this instance. + + + Gets the root virtual path. + The root virtual path. + + + Contains extension methods for the class. + + + + + Maps the attribute-defined routes for the application. + The server configuration. + The to use for discovering and building routes. + + + Maps the attribute-defined routes for the application. + The server configuration. + The constraint resolver. + + + Maps the attribute-defined routes for the application. + The server configuration. + The to use for resolving inline constraints. + The to use for discovering and building routes. + + + + Specifies that an action supports the DELETE HTTP method. + + + Initializes a new instance of the class. + + + Gets the http methods that correspond to this attribute. + The http methods that correspond to this attribute. + + + Defines a serializable container for storing error information. This information is stored as key/value pairs. The dictionary keys to look up standard error information are available on the type. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class for . + The exception to use for error information. + true to include the exception information in the error; false otherwise + + + Initializes a new instance of the class containing error message . + The error message to associate with this instance. + + + Initializes a new instance of the class for . + The invalid model state to use for error information. + true to include exception messages in the error; false otherwise + + + Gets or sets the message of the if available. + The message of the if available. + + + Gets or sets the type of the if available. + The type of the if available. + + + Gets a particular property value from this error instance. + A particular property value from this error instance. + The name of the error property. + The type of the property. + + + Gets the inner associated with this instance if available. + The inner associated with this instance if available. + + + Gets or sets the high-level, user-visible message explaining the cause of the error. Information carried in this field should be considered public in that it will go over the wire regardless of the . As a result care should be taken not to disclose sensitive information about the server or the application. + The high-level, user-visible message explaining the cause of the error. Information carried in this field should be considered public in that it will go over the wire regardless of the . As a result care should be taken not to disclose sensitive information about the server or the application. + + + Gets or sets a detailed description of the error intended for the developer to understand exactly what failed. + A detailed description of the error intended for the developer to understand exactly what failed. + + + Gets the containing information about the errors that occurred during model binding. + The containing information about the errors that occurred during model binding. + + + Gets or sets the stack trace information associated with this instance if available. + The stack trace information associated with this instance if available. + + + This method is reserved and should not be used. + Always returns null. + + + Generates an instance from its XML representation. + The XmlReader stream from which the object is deserialized. + + + Converts an instance into its XML representation. + The XmlWriter stream to which the object is serialized. + + + Provides keys to look up error information stored in the dictionary. + + + Provides a key for the ErrorCode. + + + Provides a key for the ExceptionMessage. + + + Provides a key for the ExceptionType. + + + Provides a key for the InnerException. + + + Provides a key for the MessageDetail. + + + Provides a key for the Message. + + + Provides a key for the MessageLanguage. + + + Provides a key for the ModelState. + + + Provides a key for the StackTrace. + + + Specifies that an action supports the GET HTTP method. + + + Initializes a new instance of the class. + + + Gets the http methods that correspond to this attribute. + The http methods that correspond to this attribute. + + + Specifies that an action supports the HEAD HTTP method. + + + Initializes a new instance of the class. + + + Gets the http methods that correspond to this attribute. + The http methods that correspond to this attribute. + + + Represents an attribute that is used to restrict an HTTP method so that the method handles only HTTP OPTIONS requests. + + + Initializes a new instance of the class. + + + Gets the http methods that correspond to this attribute. + The http methods that correspond to this attribute. + + + Specifies that an action supports the PATCH HTTP method. + + + Initializes a new instance of the class. + + + Gets the http methods that correspond to this attribute. + The http methods that correspond to this attribute. + + + Specifies that an action supports the POST HTTP method. + + + Initializes a new instance of the class. + + + Gets the http methods that correspond to this attribute. + The http methods that correspond to this attribute. + + + Represents an attribute that is used to restrict an HTTP method so that the method handles only HTTP PUT requests. + + + Initializes a new instance of the class. + + + Gets the http methods that correspond to this attribute. + The http methods that correspond to this attribute. + + + An exception that allows for a given to be returned to the client. + + + Initializes a new instance of the class. + The HTTP response to return to the client. + + + Initializes a new instance of the class. + The status code of the response. + + + Gets the HTTP response to return to the client. + The that represents the HTTP response. + + + A collection of instances. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The virtual path root. + + + Adds an instance to the collection. + The name of the route. + The instance to add to the collection. + + + Removes all items from the collection. + + + Determines whether the collection contains a specific . + true if the is found in the collection; otherwise, false. + The object to locate in the collection. + + + Determines whether the collection contains an element with the specified key. + true if the collection contains an element with the key; otherwise, false. + The key to locate in the collection. + + + Copies the instances of the collection to an array, starting at a particular array index. + The array that is the destination of the elements copied from the collection. + The zero-based index in at which copying begins. + + + Copies the route names and instances of the collection to an array, starting at a particular array index. + The array that is the destination of the elements copied from the collection. + The zero-based index in at which copying begins. + + + Gets the number of items in the collection. + The number of items in the collection. + + + Creates an instance. + The new instance. + The route template. + An object that contains the default route parameters. + An object that contains the route constraints. + The route data tokens. + + + Creates an instance. + The new instance. + The route template. + An object that contains the default route parameters. + An object that contains the route constraints. + The route data tokens. + The message handler for the route. + + + Creates an instance. + The new instance. + The route template. + An object that contains the default route parameters. + An object that contains the route constraints. + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + Releases the unmanaged resources that are used by the object and, optionally, releases the managed resources. + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + Returns an enumerator that iterates through the collection. + An that can be used to iterate through the collection. + + + Gets the route data for a specified HTTP request. + An instance that represents the route data. + The HTTP request. + + + Gets a virtual path. + An instance that represents the virtual path. + The HTTP request. + The route name. + The route values. + + + Inserts an instance into the collection. + The zero-based index at which should be inserted. + The route name. + The to insert. The value cannot be null. + + + Gets a value indicating whether the collection is read-only. + true if the collection is read-only; otherwise, false. + + + Gets or sets the element at the specified index. + The at the specified index. + The index. + + + Gets or sets the element with the specified route name. + The at the specified index. + The route name. + + + Called internally to get the enumerator for the collection. + An that can be used to iterate through the collection. + + + Removes an instance from the collection. + true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the collection. + The name of the route to remove. + + + Adds an item to the collection. + The object to add to the collection. + + + Removes the first occurrence of a specific object from the collection. + true if was successfully removed from the collection; otherwise, false. This method also returns false if is not found in the original collection. + The object to remove from the collection. + + + Returns an enumerator that iterates through the collection. + An object that can be used to iterate through the collection. + + + Gets the with the specified route name. + true if the collection contains an element with the specified name; otherwise, false. + The route name. + When this method returns, contains the instance, if the route name is found; otherwise, null. This parameter is passed uninitialized. + + + Validates that a constraint is valid for an created by a call to the method. + The route template. + The constraint name. + The constraint object. + + + Gets the virtual path root. + The virtual path root. + + + Extension methods for + + + Ignores the specified route. + Returns . + A collection of routes for the application. + The name of the route to ignore. + The route template for the route. + + + Ignores the specified route. + Returns . + A collection of routes for the application. + The name of the route to ignore. + The route template for the route. + A set of expressions that specify values for the route template. + + + Maps the specified route for handling HTTP batch requests. + A collection of routes for the application. + The name of the route to map. + The route template for the route. + The for handling batch requests. + + + Maps the specified route template. + A reference to the mapped route. + A collection of routes for the application. + The name of the route to map. + The route template for the route. + + + Maps the specified route template and sets default route values. + A reference to the mapped route. + A collection of routes for the application. + The name of the route to map. + The route template for the route. + An object that contains default route values. + + + Maps the specified route template and sets default route values and constraints. + A reference to the mapped route. + A collection of routes for the application. + The name of the route to map. + The route template for the route. + An object that contains default route values. + A set of expressions that specify values for . + + + Maps the specified route template and sets default route values, constraints, and end-point message handler. + A reference to the mapped route. + A collection of routes for the application. + The name of the route to map. + The route template for the route. + An object that contains default route values. + A set of expressions that specify values for . + The handler to which the request will be dispatched. + + + Defines an implementation of an which dispatches an incoming and creates an as a result. + + + Initializes a new instance of the class, using the default configuration and dispatcher. + + + Initializes a new instance of the class with a specified dispatcher. + The HTTP dispatcher that will handle incoming requests. + + + Initializes a new instance of the class with a specified configuration. + The used to configure this instance. + + + Initializes a new instance of the class with a specified configuration and dispatcher. + The used to configure this instance. + The HTTP dispatcher that will handle incoming requests. + + + Gets the used to configure this instance. + The used to configure this instance. + + + Gets the HTTP dispatcher that handles incoming requests. + The HTTP dispatcher that handles incoming requests. + + + Releases the unmanaged resources that are used by the object and, optionally, releases the managed resources. + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + Prepares the server for operation. + + + Dispatches an incoming . + A task representing the asynchronous operation. + The request to dispatch. + The token to monitor for cancellation requests. + + + Defines a command that asynchronously creates an . + + + Creates an asynchronously. + A task that, when completed, contains the . + The token to monitor for cancellation requests. + + + Specifies whether error details, such as exception messages and stack traces, should be included in error messages. + + + Always include error details. + + + Use the default behavior for the host environment. For ASP.NET hosting, use the value from the customErrors element in the Web.config file. For self-hosting, use the value . + + + Only include error details when responding to a local request. + + + Never include error details. + + + Represents an attribute that is used to indicate that a controller method is not an action method. + + + Initializes a new instance of the class. + + + Represents a filter attribute that overrides action filters defined at a higher level. + + + Initializes a new instance of the class. + + + Gets a value indicating whether the action filter allows multiple attribute. + true if the action filter allows multiple attribute; otherwise, false. + + + Gets the type of filters to override. + The type of filters to override. + + + Represents a filter attribute that overrides authentication filters defined at a higher level. + + + + + + Represents a filter attribute that overrides authorization filters defined at a higher level. + + + Initializes a new instance of the class. + + + Gets or sets a Boolean value indicating whether more than one instance of the indicated attribute can be specified for a single program element. + true if more than one instance is allowed to be specified; otherwise, false. + + + Gets the type to filters override attributes. + The type to filters override attributes. + + + Represents a filter attribute that overrides exception filters defined at a higher level. + + + + + + Attribute on a parameter or type that produces a . If the attribute is on a type-declaration, then it's as if that attribute is present on all action parameters of that type. + + + Initializes a new instance of the class. + + + Gets the parameter binding. + The parameter binding. + The parameter description. + + + Place on an action to expose it directly via a route. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The route template describing the URI pattern to match against. + + + Returns . + + + Returns . + + + + Returns . + + + The class can be used to indicate properties about a route parameter (the literals and placeholders located within segments of a ). It can for example be used to indicate that a route parameter is optional. + + + An optional parameter. + + + Returns a that represents this instance. + A that represents this instance. + + + Annotates a controller with a route prefix that applies to all actions within the controller. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The route prefix for the controller. + + + Gets the route prefix. + + + Provides type-safe accessors for services obtained from a object. + + + Gets the service. + Returns an instance. + The services container. + + + Gets the service. + Returns an instance. + The services container. + + + Gets the service. + Returns an instance. + The services container. + + + Gets the service. + Returns an instance. + The services container. + + + Gets the service. + Returns an instance. + The services container. + + + Gets the service. + Returns an instance. + The services container. + + + Gets the service. + Returns an instance. + The services container. + + + Gets the service. + Returns an instance. + The services container. + + + Returns the registered unhandled exception handler, if any. + The registered unhandled exception hander, if present; otherwise, null. + The services container. + + + Returns the collection of registered unhandled exception loggers. + The collection of registered unhandled exception loggers. + The services container. + + + Gets the collection. + Returns a collection of objects. + The services container. + + + Gets the service. + Returns an instance. + The services container. + + + Gets the service. + Returns an instance, or null if no instance was registered. + The services container. + + + Gets the service. + Returns an instance. + The services container. + + + Gets the service. + Returns an instance. + The services container. + + + Gets the collection. + Returns a collection of objects. + The services container. + + + Gets the service. + Returns an instance. + The services container. + + + Gets the collection. + Returns a collection ofobjects. + The services container. + + + Gets the service. + Returns aninstance. + The services container. + + + Gets the service. + Returns aninstance. + The services container. + + + Gets the collection. + Returns a collection of objects. + The services container. + + + Represents an containing zero or one entities. Use together with an [EnableQuery] from the System.Web.Http.OData or System.Web.OData namespace. + + + Initializes a new instance of the class. + The containing zero or one entities. + + + Creates a from an . A helper method to instantiate a object without having to explicitly specify the type . + The created . + The containing zero or one entities. + The type of the data in the data source. + + + The containing zero or one entities. + + + Represents an containing zero or one entities. Use together with an [EnableQuery] from the System.Web.Http.OData or System.Web.OData namespace. + The type of the data in the data source. + + + Initializes a new instance of the class. + The containing zero or one entities. + + + The containing zero or one entities. + + + Defines the order of execution for batch requests. + + + Executes the batch requests non-sequentially. + + + Executes the batch requests sequentially. + + + Provides extension methods for the class. + + + Copies the properties from another . + The sub-request. + The batch request that contains the properties to copy. + + + Represents the default implementation of that encodes the HTTP request/response messages as MIME multipart. + + + Initializes a new instance of the class. + The for handling the individual batch requests. + + + Creates the batch response message. + The batch response message. + The responses for the batch requests. + The original request containing all the batch requests. + The cancellation token. + + + Executes the batch request messages. + A collection of for the batch requests. + The collection of batch request messages. + The cancellation token. + + + Gets or sets the execution order for the batch requests. The default execution order is sequential. + The execution order for the batch requests. The default execution order is sequential. + + + Converts the incoming batch request into a collection of request messages. + A collection of . + The request containing the batch request messages. + The cancellation token. + + + Processes the batch requests. + The result of the operation. + The batch request. + The cancellation token. + + + Gets the supported content types for the batch request. + The supported content types for the batch request. + + + Validates the incoming request that contains the batch request messages. + The request containing the batch request messages. + + + Defines the abstraction for handling HTTP batch requests. + + + Initializes a new instance of the class. + The for handling the individual batch requests. + + + Gets the invoker to send the batch requests to the . + The invoker to send the batch requests to the . + + + Processes the incoming batch request as a single . + The batch response. + The batch request. + The cancellation token. + + + Sends the batch handler asynchronously. + The result of the operation. + the send request. + The cancelation token. + + + Invokes the action methods of a controller. + + + Initializes a new instance of the class. + + + Asynchronously invokes the specified action by using the specified controller context. + The invoked action. + The controller context. + The cancellation token. + + + Represents a reflection based action selector. + + + Initializes a new instance of the class. + + + Gets the action mappings for the . + The action mappings. + The information that describes a controller. + + + Selects an action for the . + The selected action. + The controller context. + + + Represents a container for services that can be specific to a controller. This shadows the services from its parent . A controller can either set a service here, or fall through to the more global set of services. + + + Initializes a new instance of the class. + The parent services container. + + + Removes a single-instance service from the default services. + The type of service. + + + Gets a service of the specified type. + The first instance of the service, or null if the service is not found. + The type of service. + + + Gets the list of service objects for a given service type, and validates the service type. + The list of service objects of the specified type. + The service type. + + + Gets the list of service objects for a given service type. + The list of service objects of the specified type, or an empty list if the service is not found. + The type of service. + + + Queries whether a service type is single-instance. + true if the service type has at most one instance, or false if the service type supports multiple instances. + The service type. + + + Replaces a single-instance service object. + The service type. + The service object that replaces the previous instance. + + + Describes *how* the binding will happen and does not actually bind. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The back pointer to the action this binding is for. + The synchronous bindings for each parameter. + + + Gets or sets the back pointer to the action this binding is for. + The back pointer to the action this binding is for. + + + Executes asynchronously the binding for the given request context. + Task that is signaled when the binding is complete. + The action context for the binding. This contains the parameter dictionary that will get populated. + The cancellation token for cancelling the binding operation. Or a binder can also bind a parameter to this. + + + Gets or sets the synchronous bindings for each parameter. + The synchronous bindings for each parameter. + + + Contains information for the executing action. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The controller context. + The action descriptor. + + + Gets a list of action arguments. + A list of action arguments. + + + Gets or sets the action descriptor for the action context. + The action descriptor. + + + Gets or sets the controller context. + The controller context. + + + Gets the model state dictionary for the context. + The model state dictionary. + + + Gets the request message for the action context. + The request message for the action context. + + + Gets the current request context. + The current request context. + + + Gets or sets the response message for the action context. + The response message for the action context. + + + Contains extension methods for . + + + + + + + + + + + Provides information about the action methods. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with specified information that describes the controller of the action.. + The information that describes the controller of the action. + + + Gets or sets the binding that describes the action. + The binding that describes the action. + + + Gets the name of the action. + The name of the action. + + + Gets or sets the action configuration. + The action configuration. + + + Gets the information that describes the controller of the action. + The information that describes the controller of the action. + + + Executes the described action and returns a that once completed will contain the return value of the action. + A that once completed will contain the return value of the action. + The controller context. + A list of arguments. + The cancellation token. + + + Returns the custom attributes associated with the action descriptor. + The custom attributes associated with the action descriptor. + The action descriptor. + + + Gets the custom attributes for the action. + The collection of custom attributes applied to this action. + true to search this action's inheritance chain to find the attributes; otherwise, false. + The type of attribute to search for. + + + Retrieves the filters for the given configuration and action. + The filters for the given configuration and action. + + + Retrieves the filters for the action descriptor. + The filters for the action descriptor. + + + Retrieves the parameters for the action descriptor. + The parameters for the action descriptor. + + + Gets the properties associated with this instance. + The properties associated with this instance. + + + Gets the converter for correctly transforming the result of calling ExecuteAsync(HttpControllerContext, IDictionaryString, Object)" into an instance of . + The action result converter. + + + Gets the return type of the descriptor. + The return type of the descriptor. + + + Gets the collection of supported HTTP methods for the descriptor. + The collection of supported HTTP methods for the descriptor. + + + Contains information for a single HTTP operation. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The request context. + The HTTP request. + The controller descriptor. + The controller. + + + Initializes a new instance of the class. + The configuration. + The route data. + The request. + + + Gets or sets the configuration. + The configuration. + + + Gets or sets the HTTP controller. + The HTTP controller. + + + Gets or sets the controller descriptor. + The controller descriptor. + + + Gets or sets the request. + The request. + + + Gets or sets the request context. + + + Gets or sets the route data. + The route data. + + + Represents information that describes the HTTP controller. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The configuration. + The controller name. + The controller type. + + + Gets or sets the configurations associated with the controller. + The configurations associated with the controller. + + + Gets or sets the name of the controller. + The name of the controller. + + + Gets or sets the type of the controller. + The type of the controller. + + + Creates a controller instance for the given . + The created controller instance. + The request message. + + + Retrieves a collection of custom attributes of the controller. + A collection of custom attributes. + The type of the object. + + + Returns a collection of attributes that can be assigned to <typeparamref name="T" /> for this descriptor's controller. + A collection of attributes associated with this controller. + true to search this controller's inheritance chain to find the attributes; otherwise, false. + Used to filter the collection of attributes. Use a value of to retrieve all attributes. + + + Returns a collection of filters associated with the controller. + A collection of filters associated with the controller. + + + Gets the properties associated with this instance. + The properties associated with this instance. + + + Contains settings for an HTTP controller. + + + Initializes a new instance of the class. + A configuration object that is used to initialize the instance. + + + Gets the collection of instances for the controller. + The collection of instances. + + + Gets the collection of parameter bindingfunctions for for the controller. + The collection of parameter binding functions. + + + Gets the collection of service instances for the controller. + The collection of service instances. + + + Describes how a parameter is bound. The binding should be static (based purely on the descriptor) and can be shared across requests. + + + Initializes a new instance of the class. + An that describes the parameters. + + + Gets the that was used to initialize this instance. + The instance. + + + If the binding is invalid, gets an error message that describes the binding error. + An error message. If the binding was successful, the value is null. + + + Asynchronously executes the binding for the given request. + A task object representing the asynchronous operation. + Metadata provider to use for validation. + The action context for the binding. The action context contains the parameter dictionary that will get populated with the parameter. + Cancellation token for cancelling the binding operation. + + + Gets the parameter value from argument dictionary of the action context. + The value for this parameter in the given action context, or null if the parameter has not yet been set. + The action context. + + + Gets a value that indicates whether the binding was successful. + true if the binding was successful; otherwise, false. + + + Sets the result of this parameter binding in the argument dictionary of the action context. + The action context. + The parameter value. + + + Returns a value indicating whether this instance will read the entity body of the HTTP message. + true if this will read the entity body; otherwise, false. + + + Represents the HTTP parameter descriptor. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The action descriptor. + + + Gets or sets the action descriptor. + The action descriptor. + + + Gets or sets the for the . + The for the . + + + Gets the default value of the parameter. + The default value of the parameter. + + + Retrieves a collection of the custom attributes from the parameter. + A collection of the custom attributes from the parameter. + The type of the custom attributes. + + + Gets a value that indicates whether the parameter is optional. + true if the parameter is optional; otherwise, false. + + + Gets or sets the parameter binding attribute. + The parameter binding attribute. + + + Gets the name of the parameter. + The name of the parameter. + + + Gets the type of the parameter. + The type of the parameter. + + + Gets the prefix of this parameter. + The prefix of this parameter. + + + Gets the properties of this parameter. + The properties of this parameter. + + + Represents the context associated with a request. + + + Initializes a new instance of the class. + + + Gets or sets the client certificate. + Returns . + + + Gets or sets the configuration. + Returns . + + + Gets or sets a value indicating whether error details, such as exception messages and stack traces, should be included in the response for this request. + Returns . + + + Gets or sets a value indicating whether the request originates from a local address. + Returns . + + + .Gets or sets the principal + Returns . + + + Gets or sets the route data. + Returns . + + + Gets or sets the factory used to generate URLs to other APIs. + Returns . + + + Gets or sets the virtual path root. + Returns . + + + + + A contract for a conversion routine that can take the result of an action returned from <see cref="M:System.Web.Http.Controllers.HttpActionDescriptor.ExecuteAsync(System.Web.Http.Controllers.HttpControllerContext,System.Collections.Generic.IDictionary{System.String,System.Object})" /> and convert it to an instance of . + + + Converts the specified object to another object. + The converted object. + The controller context. + The action result. + + + Defines the method for retrieval of action binding associated with parameter value. + + + Gets the . + A object. + The action descriptor. + + + If a controller is decorated with an attribute with this interface, then it gets invoked to initialize the controller settings. + + + Callback invoked to set per-controller overrides for this controllerDescriptor. + The controller settings to initialize. + The controller descriptor. Note that the can be associated with the derived controller type given that is inherited. + + + Contains method that is used to invoke HTTP operation. + + + Executes asynchronously the HTTP operation. + The newly started task. + The execution context. + The cancellation token assigned for the HTTP operation. + + + Contains the logic for selecting an action method. + + + Returns a map, keyed by action string, of all that the selector can select. This is primarily called by to discover all the possible actions in the controller. + A map of that the selector can select, or null if the selector does not have a well-defined mapping of . + The controller descriptor. + + + Selects the action for the controller. + The action for the controller. + The context of the controller. + + + Represents an HTTP controller. + + + Executes the controller for synchronization. + The controller. + The current context for a test controller. + The notification that cancels the operation. + + + Defines extension methods for . + + + Binds parameter that results as an error. + The HTTP parameter binding object. + The parameter descriptor that describes the parameter to bind. + The error message that describes the reason for fail bind. + + + Bind the parameter as if it had the given attribute on the declaration. + The HTTP parameter binding object. + The parameter to provide binding for. + The attribute that describes the binding. + + + Binds parameter by parsing the HTTP body content. + The HTTP parameter binding object. + The parameter descriptor that describes the parameter to bind. + + + Binds parameter by parsing the HTTP body content. + The HTTP parameter binding object. + The parameter descriptor that describes the parameter to bind. + The list of formatters which provides selection of an appropriate formatter for serializing the parameter into object. + + + Binds parameter by parsing the HTTP body content. + The HTTP parameter binding object. + The parameter descriptor that describes the parameter to bind. + The list of formatters which provides selection of an appropriate formatter for serializing the parameter into object. + The body model validator used to validate the parameter. + + + Binds parameter by parsing the HTTP body content. + The HTTP parameter binding object. + The parameter descriptor that describes the parameter to bind. + The list of formatters which provides selection of an appropriate formatter for serializing the parameter into object. + + + Binds parameter by parsing the query string. + The HTTP parameter binding object. + The parameter descriptor that describes the parameter to bind. + + + Binds parameter by parsing the query string. + The HTTP parameter binding object. + The parameter descriptor that describes the parameter to bind. + The value provider factories which provide query string parameter data. + + + Binds parameter by parsing the query string. + The HTTP parameter binding object. + The parameter descriptor that describes the parameter to bind. + The model binder used to assemble the parameter into an object. + + + Binds parameter by parsing the query string. + The HTTP parameter binding object. + The parameter descriptor that describes the parameter to bind. + The model binder used to assemble the parameter into an object. + The value provider factories which provide query string parameter data. + + + Binds parameter by parsing the query string. + The HTTP parameter binding object. + The parameter descriptor that describes the parameter to bind. + The value provider factories which provide query string parameter data. + + + Represents a reflected synchronous or asynchronous action method. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with the specified descriptor and method details.. + The controller descriptor. + The action-method information. + + + Gets the name of the action. + The name of the action. + + + + Executes the described action and returns a that once completed will contain the return value of the action. + A [T:System.Threading.Tasks.Task`1"] that once completed will contain the return value of the action. + The context. + The arguments. + A cancellation token to cancel the action. + + + Returns an array of custom attributes defined for this member, identified by type. + An array of custom attributes or an empty array if no custom attributes exist. + true to search this action's inheritance chain to find the attributes; otherwise, false. + The type of the custom attributes. + + + Retrieves information about action filters. + The filter information. + + + + Retrieves the parameters of the action method. + The parameters of the action method. + + + Gets or sets the action-method information. + The action-method information. + + + Gets the return type of this method. + The return type of this method. + + + Gets or sets the supported http methods. + The supported http methods. + + + Represents the reflected HTTP parameter descriptor. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The action descriptor. + The parameter information. + + + Gets the default value for the parameter. + The default value for the parameter. + + + Retrieves a collection of the custom attributes from the parameter. + A collection of the custom attributes from the parameter. + The type of the custom attributes. + + + Gets a value that indicates whether the parameter is optional. + true if the parameter is optional; otherwise false. + + + Gets or sets the parameter information. + The parameter information. + + + Gets the name of the parameter. + The name of the parameter. + + + Gets the type of the parameter. + The type of the parameter. + + + Represents a converter for actions with a return type of . + + + Initializes a new instance of the class. + + + Converts a object to another object. + The converted object. + The controller context. + The action result. + + + An abstract class that provides a container for services used by ASP.NET Web API. + + + Initializes a new instance of the class. + + + Adds a service to the end of services list for the given service type. + The service type. + The service instance. + + + Adds the services of the specified collection to the end of the services list for the given service type. + The service type. + The services to add. + + + Removes all the service instances of the given service type. + The service type to clear from the services list. + + + Removes all instances of a multi-instance service type. + The service type to remove. + + + Removes a single-instance service type. + The service type to remove. + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + Searches for a service that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence. + The zero-based index of the first occurrence, if found; otherwise, -1. + The service type. + The delegate that defines the conditions of the element to search for. + + + Gets a service instance of a specified type. + The service type. + + + Gets a mutable list of service instances of a specified type. + A mutable list of service instances. + The service type. + + + Gets a collection of service instanes of a specified type. + A collection of service instances. + The service type. + + + Inserts a service into the collection at the specified index. + The service type. + The zero-based index at which the service should be inserted. If is passed, ensures the element is added to the end. + The service to insert. + + + Inserts the elements of the collection into the service list at the specified index. + The service type. + The zero-based index at which the new elements should be inserted. If is passed, ensures the elements are added to the end. + The collection of services to insert. + + + Determine whether the service type should be fetched with GetService or GetServices. + true iff the service is singular. + type of service to query + + + Removes the first occurrence of the given service from the service list for the given service type. + true if the item is successfully removed; otherwise, false. + The service type. + The service instance to remove. + + + Removes all the elements that match the conditions defined by the specified predicate. + The number of elements removed from the list. + The service type. + The delegate that defines the conditions of the elements to remove. + + + Removes the service at the specified index. + The service type. + The zero-based index of the service to remove. + + + Replaces all existing services for the given service type with the given service instance. This works for both singular and plural services. + The service type. + The service instance. + + + Replaces all instances of a multi-instance service with a new instance. + The type of service. + The service instance that will replace the current services of this type. + + + Replaces all existing services for the given service type with the given service instances. + The service type. + The service instances. + + + Replaces a single-instance service of a specified type. + The service type. + The service instance. + + + Removes the cached values for a single service type. + The service type. + + + A converter for creating responses from actions that return an arbitrary value. + The declared return type of an action. + + + Initializes a new instance of the class. + + + Converts the result of an action with arbitrary return type to an instance of . + The newly created object. + The action controller context. + The execution result. + + + Represents a converter for creating a response from actions that do not return a value. + + + Initializes a new instance of the class. + + + Converts the created response from actions that do not return a value. + The converted response. + The context of the controller. + The result of the action. + + + Represents a dependency injection container. + + + Starts a resolution scope. + The dependency scope. + + + Represents an interface for the range of the dependencies. + + + Retrieves a service from the scope. + The retrieved service. + The service to be retrieved. + + + Retrieves a collection of services from the scope. + The retrieved collection of services. + The collection of services to be retrieved. + + + Describes an API defined by relative URI path and HTTP method. + + + Initializes a new instance of the class. + + + Gets or sets the action descriptor that will handle the API. + The action descriptor. + + + Gets or sets the documentation of the API. + The documentation. + + + Gets or sets the HTTP method. + The HTTP method. + + + Gets the ID. The ID is unique within . + The ID. + + + Gets the parameter descriptions. + The parameter descriptions. + + + Gets or sets the relative path. + The relative path. + + + Gets or sets the response description. + The response description. + + + Gets or sets the registered route for the API. + The route. + + + Gets the supported request body formatters. + The supported request body formatters. + + + Gets the supported response formatters. + The supported response formatters. + + + Explores the URI space of the service based on routes, controllers and actions available in the system. + + + Initializes a new instance of the class. + The configuration. + + + Gets the API descriptions. The descriptions are initialized on the first access. + + + Gets or sets the documentation provider. The provider will be responsible for documenting the API. + The documentation provider. + + + Gets a collection of HttpMethods supported by the action. Called when initializing the . + A collection of HttpMethods supported by the action. + The route. + The action descriptor. + + + Determines whether the action should be considered for generation. Called when initializing the . + true if the action should be considered for generation, false otherwise. + The action variable value from the route. + The action descriptor. + The route. + + + Determines whether the controller should be considered for generation. Called when initializing the . + true if the controller should be considered for generation, false otherwise. + The controller variable value from the route. + The controller descriptor. + The route. + + + This attribute can be used on the controllers and actions to influence the behavior of . + + + Initializes a new instance of the class. + + + Gets or sets a value indicating whether to exclude the controller or action from the instances generated by . + true if the controller or action should be ignored; otherwise, false. + + + Describes a parameter on the API defined by relative URI path and HTTP method. + + + Initializes a new instance of the class. + + + Gets or sets the documentation. + The documentation. + + + Gets or sets the name. + The name. + + + Gets or sets the parameter descriptor. + The parameter descriptor. + + + Gets or sets the source of the parameter. It may come from the request URI, request body or other places. + The source. + + + Describes where the parameter come from. + + + The parameter come from Body. + + + The parameter come from Uri. + + + The location is unknown. + + + Defines the interface for getting a collection of . + + + Gets the API descriptions. + + + Defines the provider responsible for documenting the service. + + + Gets the documentation based on . + The documentation for the controller. + The action descriptor. + + + + Gets the documentation based on . + The documentation for the controller. + The parameter descriptor. + + + + Describes the API response. + + + Initializes a new instance of the class. + + + Gets or sets the declared response type. + The declared response type. + + + Gets or sets the response documentation. + The response documentation. + + + Gets or sets the actual response type. + The actual response type. + + + Use this to specify the entity type returned by an action when the declared return type is or . The will be read by when generating . + + + Initializes a new instance of the class. + The response type. + + + Gets the response type. + + + Provides an implementation of with no external dependencies. + + + Initializes a new instance of the class. + + + Returns a list of assemblies available for the application. + A <see cref="T:System.Collections.ObjectModel.Collection`1" /> of assemblies. + + + Represents a default implementation of an . A different implementation can be registered via the . We optimize for the case where we have an instance per instance but can support cases where there are many instances for one as well. In the latter case the lookup is slightly slower because it goes through the dictionary. + + + Initializes a new instance of the class. + + + Creates the specified by using the given . + An instance of type . + The request message. + The controller descriptor. + The type of the controller. + + + Represents a default instance for choosing a given a . A different implementation can be registered via the . + + + Initializes a new instance of the class. + The configuration. + + + Specifies the suffix string in the controller name. + + + Returns a map, keyed by controller string, of all that the selector can select. + A map of all that the selector can select, or null if the selector does not have a well-defined mapping of . + + + Gets the name of the controller for the specified . + The name of the controller for the specified . + The HTTP request message. + + + Selects a for the given . + The instance for the given . + The HTTP request message. + + + Provides an implementation of with no external dependencies. + + + Initializes a new instance of the class. + + + Initializes a new instance using a predicate to filter controller types. + The predicate. + + + Returns a list of controllers available for the application. + An <see cref="T:System.Collections.Generic.ICollection`1" /> of controllers. + The assemblies resolver. + + + Gets a value whether the resolver type is a controller type predicate. + true if the resolver type is a controller type predicate; otherwise, false. + + + Dispatches an incoming to an implementation for processing. + + + Initializes a new instance of the class with the specified configuration. + The http configuration. + + + Gets the HTTP configuration. + The HTTP configuration. + + + Dispatches an incoming to an . + A representing the ongoing operation. + The request to dispatch + The cancellation token. + + + This class is the default endpoint message handler which examines the of the matched route, and chooses which message handler to call. If is null, then it delegates to . + + + Initializes a new instance of the class, using the provided and as the default handler. + The server configuration. + + + Initializes a new instance of the class, using the provided and . + The server configuration. + The default handler to use when the has no . + + + Sends an HTTP request as an asynchronous operation. + The task object representing the asynchronous operation. + The HTTP request message to send. + The cancellation token to cancel operation. + + + Provides an abstraction for managing the assemblies of an application. A different implementation can be registered via the . + + + Returns a list of assemblies available for the application. + An <see cref="T:System.Collections.Generic.ICollection`1" /> of assemblies. + + + Defines the methods that are required for an . + + + Creates an object. + An object. + The message request. + The HTTP controller descriptor. + The type of the controller. + + + Defines the methods that are required for an factory. + + + Returns a map, keyed by controller string, of all that the selector can select. This is primarily called by to discover all the possible controllers in the system. + A map of all that the selector can select, or null if the selector does not have a well-defined mapping of . + + + Selects a for the given . + An instance. + The request message. + + + Provides an abstraction for managing the controller types of an application. A different implementation can be registered via the DependencyResolver. + + + Returns a list of controllers available for the application. + An <see cref="T:System.Collections.Generic.ICollection`1" /> of controllers. + The resolver for failed assemblies. + + + Provides the catch blocks used within this assembly. + + + Gets the catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpBatchHandler.SendAsync. + The catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpBatchHandler.SendAsync. + + + Gets the catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpControllerDispatcher.SendAsync. + The catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpControllerDispatcher.SendAsync. + + + Gets the catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpServer.SendAsync. + The catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpServer.SendAsync. + + + Gets the catch block in System.Web.Http.ApiController.ExecuteAsync when using . + The catch block in System.Web.Http.ApiController.ExecuteAsync when using . + + + Represents an exception and the contextual data associated with it when it was caught. + + + Initializes a new instance of the class. + The caught exception. + The catch block where the exception was caught. + + + Initializes a new instance of the class. + The caught exception. + The catch block where the exception was caught. + The request being processed when the exception was caught. + + + Initializes a new instance of the class. + The caught exception. + The catch block where the exception was caught. + The request being processed when the exception was caught. + The repsonse being returned when the exception was caught. + + + Initializes a new instance of the class. + The caught exception. + The catch block where the exception was caught. + The action context in which the exception occurred. + + + Gets the action context in which the exception occurred, if available. + The action context in which the exception occurred, if available. + + + Gets the catch block in which the exception was caught. + The catch block in which the exception was caught. + + + Gets the controller context in which the exception occurred, if available. + The controller context in which the exception occurred, if available. + + + Gets the caught exception. + The caught exception. + + + Gets the request being processed when the exception was caught. + The request being processed when the exception was caught. + + + Gets the request context in which the exception occurred. + The request context in which the exception occurred. + + + Gets the response being sent when the exception was caught. + The response being sent when the exception was caught. + + + Represents the catch block location for an exception context. + + + Initializes a new instance of the class. + The label for the catch block where the exception was caught. + A value indicating whether the catch block where the exception was caught is the last one before the host. + A value indicating whether exceptions in the catch block can be handled after they are logged. + + + Gets a value indicating whether exceptions in the catch block can be handled after they are logged. + A value indicating whether exceptions in the catch block can be handled after they are logged. + + + Gets a value indicating whether the catch block where the exception was caught is the last one before the host. + A value indicating whether the catch block where the exception was caught is the last one before the host. + + + Gets a label for the catch block in which the exception was caught. + A label for the catch block in which the exception was caught. + + + Returns . + + + Represents an unhandled exception handler. + + + Initializes a new instance of the class. + + + When overridden in a derived class, handles the exception synchronously. + The exception handler context. + + + When overridden in a derived class, handles the exception asynchronously. + A task representing the asynchronous exception handling operation. + The exception handler context. + The token to monitor for cancellation requests. + + + Determines whether the exception should be handled. + true if the exception should be handled; otherwise, false. + The exception handler context. + + + Returns . + + + Represents the context within which unhandled exception handling occurs. + + + Initializes a new instance of the class. + The exception context. + + + Gets the catch block in which the exception was caught. + The catch block in which the exception was caught. + + + Gets the caught exception. + The caught exception. + + + Gets the exception context providing the exception and related data. + The exception context providing the exception and related data. + + + Gets the request being processed when the exception was caught. + The request being processed when the exception was caught. + + + Gets the request context in which the exception occurred. + The request context in which the exception occurred. + + + Gets or sets the result providing the response message when the exception is handled. + The result providing the response message when the exception is handled. + + + Provides extension methods for . + + + Calls an exception handler and determines the response handling it, if any. + A task that, when completed, contains the response message to return when the exception is handled, or null when the exception remains unhandled. + The unhandled exception handler. + The exception context. + The token to monitor for cancellation requests. + + + Represents an unhandled exception logger. + + + Initializes a new instance of the class. + + + When overridden in a derived class, logs the exception synchronously. + The exception logger context. + + + When overridden in a derived class, logs the exception asynchronously. + A task representing the asynchronous exception logging operation. + The exception logger context. + The token to monitor for cancellation requests. + + + Determines whether the exception should be logged. + true if the exception should be logged; otherwise, false. + The exception logger context. + + + Returns . + + + Represents the context within which unhandled exception logging occurs. + + + Initializes a new instance of the class. + The exception context. + + + Gets or sets a value indicating whether the exception can subsequently be handled by an to produce a new response message. + A value indicating whether the exception can subsequently be handled by an to produce a new response message. + + + Gets the catch block in which the exception was caught. + The catch block in which the exception was caught. + + + Gets the caught exception. + The caught exception. + + + Gets the exception context providing the exception and related data. + The exception context providing the exception and related data. + + + Gets the request being processed when the exception was caught. + The request being processed when the exception was caught. + + + Gets the request context in which the exception occurred. + The request context in which the exception occurred. + + + Provides extension methods for . + + + Calls an exception logger. + A task representing the asynchronous exception logging operation. + The unhandled exception logger. + The exception context. + The token to monitor for cancellation requests. + + + Creates exception services to call logging and handling from catch blocks. + + + Gets an exception handler that calls the registered handler service, if any, and ensures exceptions do not accidentally propagate to the host. + An exception handler that calls any registered handler and ensures exceptions do not accidentally propagate to the host. + The services container. + + + Gets an exception handler that calls the registered handler service, if any, and ensures exceptions do not accidentally propagate to the host. + An exception handler that calls any registered handler and ensures exceptions do not accidentally propagate to the host. + The configuration. + + + Gets an exception logger that calls all registered logger services. + A composite logger. + The services container. + + + Gets an exception logger that calls all registered logger services. + A composite logger. + The configuration. + + + Defines an unhandled exception handler. + + + Process an unhandled exception, either allowing it to propagate or handling it by providing a response message to return instead. + A task representing the asynchronous exception handling operation. + The exception handler context. + The token to monitor for cancellation requests. + + + Defines an unhandled exception logger. + + + Logs an unhandled exception. + A task representing the asynchronous exception logging operation. + The exception logger context. + The token to monitor for cancellation requests. + + + Provides information about an action method, such as its name, controller, parameters, attributes, and filters. + + + Initializes a new instance of the class. + + + Returns the filters that are associated with this action method. + The filters that are associated with this action method. + The configuration. + The action descriptor. + + + Represents the base class for all action-filter attributes. + + + Initializes a new instance of the class. + + + Occurs after the action method is invoked. + The action executed context. + + + + Occurs before the action method is invoked. + The action context. + + + + Executes the filter action asynchronously. + The newly created task for this operation. + The action context. + The cancellation token assigned for this task. + The delegate function to continue after the action method is invoked. + + + Provides details for authorization filter. + + + Initializes a new instance of the class. + + + Calls when a process requests authorization. + The action context, which encapsulates information for using . + + + + Executes the authorization filter during synchronization. + The authorization filter during synchronization. + The action context, which encapsulates information for using . + The cancellation token that cancels the operation. + A continuation of the operation. + + + Represents the configuration filter provider. + + + Initializes a new instance of the class. + + + Returns the filters that are associated with this configuration method. + The filters that are associated with this configuration method. + The configuration. + The action descriptor. + + + Represents the attributes for the exception filter. + + + Initializes a new instance of the class. + + + Raises the exception event. + The context for the action. + + + + Asynchronously executes the exception filter. + The result of the execution. + The context for the action. + The cancellation context. + + + Represents the base class for action-filter attributes. + + + Initializes a new instance of the class. + + + Gets a value that indicates whether multiple filters are allowed. + true if multiple filters are allowed; otherwise, false. + + + Provides information about the available action filters. + + + Initializes a new instance of the class. + The instance of this class. + The scope of this class. + + + Gets or sets an instance of the . + A . + + + Gets or sets the scope . + The scope of the FilterInfo. + + + Defines values that specify the order in which filters run within the same filter type and filter order. + + + Specifies an order after Controller. + + + Specifies an order before Action and after Global. + + + Specifies an action before Controller. + + + Represents the action of the HTTP executed context. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The action context. + The exception. + + + Gets or sets the HTTP action context. + The HTTP action context. + + + Gets or sets the exception that was raised during the execution. + The exception that was raised during the execution. + + + Gets the object for the context. + The object for the context. + + + Gets or sets the for the context. + The for the context. + + + Represents an authentication challenge context containing information for executing an authentication challenge. + + + Initializes a new instance of the class. + The action context. + The current action result. + + + Gets the action context. + + + Gets the request message. + + + Gets or sets the action result to execute. + + + Represents an authentication context containing information for performing authentication. + + + Initializes a new instance of the class. + The action context. + The current principal. + + + Gets the action context. + The action context. + + + Gets or sets an action result that will produce an error response (if authentication failed; otherwise, null). + An action result that will produce an error response. + + + Gets or sets the authenticated principal. + The authenticated principal. + + + Gets the request message. + The request message. + + + Represents a collection of HTTP filters. + + + Initializes a new instance of the class. + + + Adds an item at the end of the collection. + The item to add to the collection. + + + + Removes all item in the collection. + + + Determines whether the collection contains the specified item. + true if the collection contains the specified item; otherwise, false. + The item to check. + + + Gets the number of elements in the collection. + The number of elements in the collection. + + + Gets an enumerator that iterates through the collection. + An enumerator object that can be used to iterate through the collection. + + + Removes the specified item from the collection. + The item to remove in the collection. + + + Gets an enumerator that iterates through the collection. + An enumerator object that can be used to iterate through the collection. + + + Defines the methods that are used in an action filter. + + + Executes the filter action asynchronously. + The newly created task for this operation. + The action context. + The cancellation token assigned for this task. + The delegate function to continue after the action method is invoked. + + + Defines a filter that performs authentication. + + + Authenticates the request. + A Task that will perform authentication. + The authentication context. + The token to monitor for cancellation requests. + + + + Defines the methods that are required for an authorization filter. + + + Executes the authorization filter to synchronize. + The authorization filter to synchronize. + The action context. + The cancellation token associated with the filter. + The continuation. + + + Defines the methods that are required for an exception filter. + + + Executes an asynchronous exception filter. + An asynchronous exception filter. + The action executed context. + The cancellation token. + + + Defines the methods that are used in a filter. + + + Gets or sets a value indicating whether more than one instance of the indicated attribute can be specified for a single program element. + true if more than one instance is allowed to be specified; otherwise, false. The default is false. + + + Provides filter information. + + + Returns an enumeration of filters. + An enumeration of filters. + The HTTP configuration. + The action descriptor. + + + + + Provides common keys for properties stored in the + + + Provides a key for the client certificate for this request. + + + Provides a key for the associated with this request. + + + Provides a key for the collection of resources that should be disposed when a request is disposed. + + + Provides a key for the associated with this request. + + + Provides a key for the associated with this request. + + + Provides a key for the associated with this request. + + + Provides a key that indicates whether error details are to be included in the response for this HTTP request. + + + Provides a key that indicates whether the request is a batch request. + + + Provides a key that indicates whether the request originates from a local address. + + + Provides a key that indicates whether the request failed to match a route. + + + Provides a key for the for this request. + + + Provides a key for the stored in . This is the correlation ID for that request. + + + Provides a key for the parsed query string stored in . + + + Provides a key for a delegate which can retrieve the client certificate for this request. + + + Provides a key for the current stored in Properties(). If Current() is null then no context is stored. + + + Interface for controlling the use of buffering requests and responses in the host. If a host provides support for buffering requests and/or responses then it can use this interface to determine the policy for when buffering is to be used. + + + Determines whether the host should buffer the entity body. + true if buffering should be used; otherwise a streamed request should be used. + The host context. + + + Determines whether the host should buffer the entity body. + true if buffering should be used; otherwise a streamed response should be used. + The HTTP response message. + + + Represents a message handler that suppresses host authentication results. + + + Initializes a new instance of the class. + + + Asynchronously sends a request message. + That task that completes the asynchronous operation. + The request message to send. + The cancellation token. + + + Represents the metadata class of the ModelMetadata. + + + Initializes a new instance of the class. + The provider. + The type of the container. + The model accessor. + The type of the model. + The name of the property. + + + Gets a dictionary that contains additional metadata about the model. + A dictionary that contains additional metadata about the model. + + + Gets or sets the type of the container for the model. + The type of the container for the model. + + + Gets or sets a value that indicates whether empty strings that are posted back in forms should be converted to null. + true if empty strings that are posted back in forms should be converted to null; otherwise, false. The default value is true. + + + Gets or sets the description of the model. + The description of the model. The default value is null. + + + Gets the display name for the model. + The display name for the model. + + + Gets a list of validators for the model. + A list of validators for the model. + The validator providers for the model. + + + Gets or sets a value that indicates whether the model is a complex type. + A value that indicates whether the model is considered a complex. + + + Gets a value that indicates whether the type is nullable. + true if the type is nullable; otherwise, false. + + + Gets or sets a value that indicates whether the model is read-only. + true if the model is read-only; otherwise, false. + + + Gets the value of the model. + The model value can be null. + + + Gets the type of the model. + The type of the model. + + + Gets a collection of model metadata objects that describe the properties of the model. + A collection of model metadata objects that describe the properties of the model. + + + Gets the property name. + The property name. + + + Gets or sets the provider. + The provider. + + + Provides an abstract base class for a custom metadata provider. + + + Initializes a new instance of the class. + + + Gets a ModelMetadata object for each property of a model. + A ModelMetadata object for each property of a model. + The container. + The type of the container. + + + Gets a metadata for the specified property. + The metadata model for the specified property. + The model accessor. + The type of the container. + The property to get the metadata model for. + + + Gets the metadata for the specified model accessor and model type. + The metadata. + The model accessor. + The type of the mode. + + + Provides an abstract class to implement a metadata provider. + The type of the model metadata. + + + Initializes a new instance of the class. + + + When overridden in a derived class, creates the model metadata for the property using the specified prototype. + The model metadata for the property. + The prototype from which to create the model metadata. + The model accessor. + + + When overridden in a derived class, creates the model metadata for the property. + The model metadata for the property. + The set of attributes. + The type of the container. + The type of the model. + The name of the property. + + + Retrieves a list of properties for the model. + A list of properties for the model. + The model container. + The type of the container. + + + Retrieves the metadata for the specified property using the container type and property name. + The metadata for the specified property. + The model accessor. + The type of the container. + The name of the property. + + + Returns the metadata for the specified property using the type of the model. + The metadata for the specified property. + The model accessor. + The type of the container. + + + Provides prototype cache data for . + + + Initializes a new instance of the class. + The attributes that provides data for the initialization. + + + Gets or sets the metadata display attribute. + The metadata display attribute. + + + Gets or sets the metadata display format attribute. + The metadata display format attribute. + + + + Gets or sets the metadata editable attribute. + The metadata editable attribute. + + + Gets or sets the metadata read-only attribute. + The metadata read-only attribute. + + + Provides a container for common metadata, for the class, for a data model. + + + Initializes a new instance of the class. + The prototype used to initialize the model metadata. + The model accessor. + + + Initializes a new instance of the class. + The metadata provider. + The type of the container. + The type of the model. + The name of the property. + The attributes that provides data for the initialization. + + + Retrieves a value that indicates whether empty strings that are posted back in forms should be converted to null. + true if empty strings that are posted back in forms should be converted to null; otherwise, false. + + + Retrieves the description of the model. + The description of the model. + + + Retrieves a value that indicates whether the model is read-only. + true if the model is read-only; otherwise, false. + + + + Provides prototype cache data for the . + The type of prototype cache. + + + Initializes a new instance of the class. + The prototype. + The model accessor. + + + Initializes a new instance of the class. + The provider. + The type of container. + The type of the model. + The name of the property. + The prototype cache. + + + Indicates whether empty strings that are posted back in forms should be computed and converted to null. + true if empty strings that are posted back in forms should be computed and converted to null; otherwise, false. + + + Indicates the computation value. + The computation value. + + + Gets a value that indicates whether the model is a complex type. + A value that indicates whether the model is considered a complex type by the Web API framework. + + + Gets a value that indicates whether the model to be computed is read-only. + true if the model to be computed is read-only; otherwise, false. + + + Gets or sets a value that indicates whether empty strings that are posted back in forms should be converted to null. + true if empty strings that are posted back in forms should be converted to null; otherwise, false. The default value is true. + + + Gets or sets the description of the model. + The description of the model. + + + Gets a value that indicates whether the model is a complex type. + A value that indicates whether the model is considered a complex type by the Web API framework. + + + Gets or sets a value that indicates whether the model is read-only. + true if the model is read-only; otherwise, false. + + + Gets or sets a value that indicates whether the prototype cache is updating. + true if the prototype cache is updating; otherwise, false. + + + Implements the default model metadata provider. + + + Initializes a new instance of the class. + + + Creates the metadata from prototype for the specified property. + The metadata for the property. + The prototype. + The model accessor. + + + Creates the metadata for the specified property. + The metadata for the property. + The attributes. + The type of the container. + The type of the model. + The name of the property. + + + Represents an empty model metadata provider. + + + Initializes a new instance of the class. + + + Creates metadata from prototype. + The metadata. + The model metadata prototype. + The model accessor. + + + Creates a prototype of the metadata provider of the . + A prototype of the metadata provider. + The attributes. + The type of container. + The type of model. + The name of the property. + + + Represents the binding directly to the cancellation token. + + + Initializes a new instance of the class. + The binding descriptor. + + + Executes the binding during synchronization. + The binding during synchronization. + The metadata provider. + The action context. + The notification after the cancellation of the operations. + + + Represents an attribute that invokes a custom model binder. + + + Initializes a new instance of the class. + + + Retrieves the associated model binder. + A reference to an object that implements the interface. + + + Represents the default action value of the binder. + + + Initializes a new instance of the class. + + + Default implementation of the interface. This interface is the primary entry point for binding action parameters. + The associated with the . + The action descriptor. + + + Gets the associated with the . + The associated with the . + The parameter descriptor. + + + Defines a binding error. + + + Initializes a new instance of the class. + The error descriptor. + The message. + + + Gets the error message. + The error message. + + + Executes the binding method during synchronization. + The metadata provider. + The action context. + The cancellation Token value. + + + Represents parameter binding that will read from the body and invoke the formatters. + + + Initializes a new instance of the class. + The descriptor. + The formatter. + The body model validator. + + + Gets or sets an interface for the body model validator. + An interface for the body model validator. + + + Gets the error message. + The error message. + + + Asynchronously execute the binding of . + The result of the action. + The metadata provider. + The context associated with the action. + The cancellation token. + + + Gets or sets an enumerable object that represents the formatter for the parameter binding. + An enumerable object that represents the formatter for the parameter binding. + + + Asynchronously reads the content of . + The result of the action. + The request. + The type. + The formatter. + The format logger. + + + + Gets whether the will read body. + True if the will read body; otherwise, false. + + + Represents the extensions for the collection of form data. + + + Reads the collection extensions with specified type. + The read collection extensions. + The form data. + The generic type. + + + Reads the collection extensions with specified type. + The collection extensions. + The form data. + The name of the model. + The required member selector. + The formatter logger. + The generic type. + + + + + + Reads the collection extensions with specified type. + The collection extensions with specified type. + The form data. + The type of the object. + + + Reads the collection extensions with specified type and model name. + The collection extensions. + The form data. + The type of the object. + The name of the model. + The required member selector. + The formatter logger. + + + Deserialize the form data to the given type, using model binding. + best attempt to bind the object. The best attempt may be null. + collection with parsed form url data + target type to read as + null or empty to read the entire form as a single object. This is common for body data. Or the name of a model to do a partial binding against the form data. This is common for extracting individual fields. + The used to determine required members. + The to log events to. + The configuration to pick binder from. Can be null if the config was not created already. In that case a new config is created. + + + + + + + + Enumerates the behavior of the HTTP binding. + + + Never use HTTP binding. + + + The optional binding behavior + + + HTTP binding is required. + + + Provides a base class for model-binding behavior attributes. + + + Initializes a new instance of the class. + The behavior. + + + Gets or sets the behavior category. + The behavior category. + + + Gets the unique identifier for this attribute. + The id for this attribute. + + + Parameter binds to the request. + + + Initializes a new instance of the class. + The parameter descriptor. + + + Asynchronously executes parameter binding. + The binded parameter. + The metadata provider. + The action context. + The cancellation token. + + + Defines the methods that are required for a model binder. + + + Binds the model to a value by using the specified controller context and binding context. + true if model binding is successful; otherwise, false. + The action context. + The binding context. + + + Represents a value provider for parameter binding. + + + Gets the instances used by this parameter binding. + The instances used by this parameter binding. + + + Represents the class for handling HTML form URL-ended data, also known as application/x-www-form-urlencoded. + + + Initializes a new instance of the class. + + + + Determines whether this can read objects of the specified . + true if objects of this type can be read; otherwise false. + The type of object that will be read. + + + Reads an object of the specified from the specified stream. This method is called during deserialization. + A whose result will be the object instance that has been read. + The type of object to read. + The from which to read. + The content being read. + The to log events to. + + + Specify this parameter uses a model binder. This can optionally specify the specific model binder and value providers that drive that model binder. Derived attributes may provide convenience settings for the model binder or value provider. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The type of model binder. + + + Gets or sets the type of model binder. + The type of model binder. + + + Gets the binding for a parameter. + The that contains the binding. + The parameter to bind. + + + Get the IModelBinder for this type. + a non-null model binder. + The configuration. + model type that the binder is expected to bind. + + + Gets the model binder provider. + The instance. + The configuration object. + + + Gets the value providers that will be fed to the model binder. + A collection of instances. + The configuration object. + + + Gets or sets the name to consider as the parameter name during model binding. + The parameter name to consider. + + + Gets or sets a value that specifies whether the prefix check should be suppressed. + true if the prefix check should be suppressed; otherwise, false. + + + Provides a container for model-binder configuration. + + + Gets or sets the name of the resource file (class key) that contains localized string values. + The name of the resource file (class key). + + + Gets or sets the current provider for type-conversion error message. + The current provider for type-conversion error message. + + + Gets or sets the current provider for value-required error messages. + The error message provider. + + + Provides a container for model-binder error message provider. + + + Describes a parameter that gets bound via ModelBinding. + + + Initializes a new instance of the class. + The parameter descriptor. + The model binder. + The collection of value provider factory. + + + Gets the model binder. + The model binder. + + + Asynchronously executes the parameter binding via the model binder. + The task that is signaled when the binding is complete. + The metadata provider to use for validation. + The action context for the binding. + The cancellation token assigned for this task for cancelling the binding operation. + + + Gets the collection of value provider factory. + The collection of value provider factory. + + + Provides an abstract base class for model binder providers. + + + Initializes a new instance of the class. + + + Finds a binder for the given type. + A binder, which can attempt to bind this type. Or null if the binder knows statically that it will never be able to bind the type. + A configuration object. + The type of the model to bind against. + + + Provides the context in which a model binder functions. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The binding context. + + + Gets or sets a value that indicates whether the binder should use an empty prefix. + true if the binder should use an empty prefix; otherwise, false. + + + Gets or sets the model. + The model. + + + Gets or sets the model metadata. + The model metadata. + + + Gets or sets the name of the model. + The name of the model. + + + Gets or sets the state of the model. + The state of the model. + + + Gets or sets the type of the model. + The type of the model. + + + Gets the property metadata. + The property metadata. + + + Gets or sets the validation node. + The validation node. + + + Gets or sets the value provider. + The value provider. + + + Represents an error that occurs during model binding. + + + Initializes a new instance of the class by using the specified exception. + The exception. + + + Initializes a new instance of the class by using the specified exception and error message. + The exception. + The error message + + + Initializes a new instance of the class by using the specified error message. + The error message + + + Gets or sets the error message. + The error message. + + + Gets or sets the exception object. + The exception object. + + + Represents a collection of instances. + + + Initializes a new instance of the class. + + + Adds the specified Exception object to the model-error collection. + The exception. + + + Adds the specified error message to the model-error collection. + The error message. + + + Encapsulates the state of model binding to a property of an action-method argument, or to the argument itself. + + + Initializes a new instance of the class. + + + Gets a object that contains any errors that occurred during model binding. + The model state errors. + + + Gets a object that encapsulates the value that was being bound during model binding. + The model state value. + + + Represents the state of an attempt to bind a posted form to an action method, which includes validation information. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using values that are copied from the specified model-state dictionary. + The dictionary. + + + Adds the specified item to the model-state dictionary. + The object to add to the model-state dictionary. + + + Adds an element that has the specified key and value to the model-state dictionary. + The key of the element to add. + The value of the element to add. + + + Adds the specified model error to the errors collection for the model-state dictionary that is associated with the specified key. + The key. + The exception. + + + Adds the specified error message to the errors collection for the model-state dictionary that is associated with the specified key. + The key. + The error message. + + + Removes all items from the model-state dictionary. + + + Determines whether the model-state dictionary contains a specific value. + true if item is found in the model-state dictionary; otherwise, false. + The object to locate in the model-state dictionary. + + + Determines whether the model-state dictionary contains the specified key. + true if the model-state dictionary contains the specified key; otherwise, false. + The key to locate in the model-state dictionary. + + + Copies the elements of the model-state dictionary to an array, starting at a specified index. + The array. The array must have zero-based indexing. + The zero-based index in array at which copying starts. + + + Gets the number of key/value pairs in the collection. + The number of key/value pairs in the collection. + + + Returns an enumerator that can be used to iterate through the collection. + An enumerator that can be used to iterate through the collection. + + + Gets a value that indicates whether the collection is read-only. + true if the collection is read-only; otherwise, false. + + + Gets a value that indicates whether this instance of the model-state dictionary is valid. + true if this instance is valid; otherwise, false. + + + Determines whether there are any objects that are associated with or prefixed with the specified key. + true if the model-state dictionary contains a value that is associated with the specified key; otherwise, false. + The key. + + + Gets or sets the value that is associated with the specified key. + The model state item. + The key. + + + Gets a collection that contains the keys in the dictionary. + A collection that contains the keys of the model-state dictionary. + + + Copies the values from the specified object into this dictionary, overwriting existing values if keys are the same. + The dictionary. + + + Removes the first occurrence of the specified object from the model-state dictionary. + true if item was successfully removed the model-state dictionary; otherwise, false. This method also returns false if item is not found in the model-state dictionary. + The object to remove from the model-state dictionary. + + + Removes the element that has the specified key from the model-state dictionary. + true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the model-state dictionary. + The key of the element to remove. + + + Sets the value for the specified key by using the specified value provider dictionary. + The key. + The value. + + + Returns an enumerator that iterates through a collection. + An IEnumerator object that can be used to iterate through the collection. + + + Attempts to gets the value that is associated with the specified key. + true if the object contains an element that has the specified key; otherwise, false. + The key of the value to get. + The value associated with the specified key. + + + Gets a collection that contains the values in the dictionary. + A collection that contains the values of the model-state dictionary. + + + Collection of functions that can produce a parameter binding for a given parameter. + + + Initializes a new instance of the class. + + + Adds function to the end of the collection. The function added is a wrapper around funcInner that checks that parameterType matches typeMatch. + type to match against HttpParameterDescriptor.ParameterType + inner function that is invoked if type match succeeds + + + Insert a function at the specified index in the collection. /// The function added is a wrapper around funcInner that checks that parameterType matches typeMatch. + index to insert at. + type to match against HttpParameterDescriptor.ParameterType + inner function that is invoked if type match succeeds + + + Execute each binding function in order until one of them returns a non-null binding. + the first non-null binding produced for the parameter. Of null if no binding is produced. + parameter to bind. + + + Maps a browser request to an array. + The type of the array. + + + Initializes a new instance of the class. + + + Indicates whether the model is binded. + true if the specified model is binded; otherwise, false. + The action context. + The binding context. + + + Converts the collection to an array. + true in all cases. + The action context. + The binding context. + The new collection. + + + Provides a model binder for arrays. + + + Initializes a new instance of the class. + + + Returns a model binder for arrays. + A model binder object or null if the attempt to get a model binder is unsuccessful. + The configuration. + The type of model. + + + Maps a browser request to a collection. + The type of the collection. + + + Initializes a new instance of the class. + + + Binds the model by using the specified execution context and binding context. + true if model binding is successful; otherwise, false. + The action context. + The binding context. + + + Provides a way for derived classes to manipulate the collection before returning it from the binder. + true in all cases. + The action context. + The binding context. + The new collection. + + + Provides a model binder for a collection. + + + Initializes a new instance of the class. + + + Retrieves a model binder for a collection. + The model binder. + The configuration of the model. + The type of the model. + + + Represents a data transfer object (DTO) for a complex model. + + + Initializes a new instance of the class. + The model metadata. + The collection of property metadata. + + + Gets or sets the model metadata of the . + The model metadata of the . + + + Gets or sets the collection of property metadata of the . + The collection of property metadata of the . + + + Gets or sets the results of the . + The results of the . + + + Represents a model binder for object. + + + Initializes a new instance of the class. + + + Determines whether the specified model is binded. + true if the specified model is binded; otherwise, false. + The action context. + The binding context. + + + Represents a complex model that invokes a model binder provider. + + + Initializes a new instance of the class. + + + Retrieves the associated model binder. + The model binder. + The configuration. + The type of the model to retrieve. + + + Represents the result for object. + + + Initializes a new instance of the class. + The object model. + The validation node. + + + Gets or sets the model for this object. + The model for this object. + + + Gets or sets the for this object. + The for this object. + + + Represents an that delegates to one of a collection of instances. + + + Initializes a new instance of the class. + An enumeration of binders. + + + Initializes a new instance of the class. + An array of binders. + + + Indicates whether the specified model is binded. + true if the model is binded; otherwise, false. + The action context. + The binding context. + + + Represents the class for composite model binder providers. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + A collection of + + + Gets the binder for the model. + The binder for the model. + The binder configuration. + The type of the model. + + + Gets the providers for the composite model binder. + The collection of providers. + + + Maps a browser request to a dictionary data object. + The type of the key. + The type of the value. + + + Initializes a new instance of the class. + + + Converts the collection to a dictionary. + true in all cases. + The action context. + The binding context. + The new collection. + + + Provides a model binder for a dictionary. + + + Initializes a new instance of the class. + + + Retrieves the associated model binder. + The associated model binder. + The configuration to use. + The type of model. + + + Maps a browser request to a key/value pair data object. + The type of the key. + The type of the value. + + + Initializes a new instance of the class. + + + Binds the model by using the specified execution context and binding context. + true if model binding is successful; otherwise, false. + The action context. + The binding context. + + + Provides a model binder for a collection of key/value pairs. + + + Initializes a new instance of the class. + + + Retrieves the associated model binder. + The associated model binder. + The configuration. + The type of model. + + + Maps a browser request to a mutable data object. + + + Initializes a new instance of the class. + + + Binds the model by using the specified action context and binding context. + true if binding is successful; otherwise, false. + The action context. + The binding context. + + + Retrieves a value that indicates whether a property can be updated. + true if the property can be updated; otherwise, false. + The metadata for the property to be evaluated. + + + Creates an instance of the model. + The newly created model object. + The action context. + The binding context. + + + Creates a model instance if an instance does not yet exist in the binding context. + The action context. + The binding context. + + + Retrieves metadata for properties of the model. + The metadata for properties of the model. + The action context. + The binding context. + + + Sets the value of a specified property. + The action context. + The binding context. + The metadata for the property to set. + The validation information about the property. + The validator for the model. + + + Provides a model binder for mutable objects. + + + Initializes a new instance of the class. + + + Retrieves the model binder for the specified type. + The model binder. + The configuration. + The type of the model to retrieve. + + + Provides a simple model binder for this model binding class. + + + Initializes a new instance of the class. + The model type. + The model binder factory. + + + Initializes a new instance of the class by using the specified model type and the model binder. + The model type. + The model binder. + + + Returns a model binder by using the specified execution context and binding context. + The model binder, or null if the attempt to get a model binder is unsuccessful. + The configuration. + The model type. + + + Gets the type of the model. + The type of the model. + + + Gets or sets a value that specifies whether the prefix check should be suppressed. + true if the prefix check should be suppressed; otherwise, false. + + + Maps a browser request to a data object. This type is used when model binding requires conversions using a .NET Framework type converter. + + + Initializes a new instance of the class. + + + Binds the model by using the specified controller context and binding context. + true if model binding is successful; otherwise, false. + The action context. + The binding context. + + + Provides a model binder for a model that requires type conversion. + + + Initializes a new instance of the class. + + + Retrieve a model binder for a model that requires type conversion. + The model binder, or Nothing if the type cannot be converted or there is no value to convert. + The configuration of the binder. + The type of the model. + + + Maps a browser request to a data object. This class is used when model binding does not require type conversion. + + + Initializes a new instance of the class. + + + Binds the model by using the specified execution context and binding context. + true if model binding is successful; otherwise, false. + The action context. + The binding context. + + + Provides a model binder for a model that does not require type conversion. + + + Initializes a new instance of the class. + + + Retrieves the associated model binder. + The associated model binder. + The configuration. + The type of model. + + + Represents an action result that returns response and performs content negotiation on an see with . + + + Initializes a new instance of the class. + The user-visible error message. + The content negotiator to handle content negotiation. + The request message which led to this result. + The formatters to use to negotiate and format the content. + + + Initializes a new instance of the class. + The user-visible error message. + The controller from which to obtain the dependencies needed for execution. + + + Gets the content negotiator to handle content negotiation. + Returns . + + + Returns . + + + Gets the formatters to use to negotiate and format the content. + Returns . + + + Gets the user-visible error message. + Returns . + + + Gets the request message which led to this result. + Returns . + + + Represents an action result that returns an empty response. + + + Initializes a new instance of the class. + The request message which led to this result. + + + Initializes a new instance of the class. + The controller from which to obtain the dependencies needed for execution. + + + Asynchronously executes the request. + The task that completes the execute operation. + The cancellation token. + + + Gets the request message which led to this result. + The request message which led to this result. + + + Represents an action result that returns an empty HttpStatusCode.Conflict response. + + + Initializes a new instance of the class. + The request message which led to this result. + + + Initializes a new instance of the class. + The controller from which to obtain the dependencies needed for execution. + + + Executes asynchronously the operation of the conflict result. + Asynchronously executes the specified task. + The cancellation token. + + + Gets the request message which led to this result. + The HTTP request message which led to this result. + + + Represents an action result that performs route generation and content negotiation and returns a response when content negotiation succeeds. + The type of content in the entity body. + + + Initializes a new instance of the class with the values provided. + The name of the route to use for generating the URL. + The route data to use for generating the URL. + The content value to negotiate and format in the entity body. + The controller from which to obtain the dependencies needed for execution. + + + Initializes a new instance of the class with the values provided. + The name of the route to use for generating the URL. + The route data to use for generating the URL. + The content value to negotiate and format in the entity body. + The factory to use to generate the route URL. + The content negotiator to handle content negotiation. + The request message which led to this result. + The formatters to use to negotiate and format the content. + + + Gets the content value to negotiate and format in the entity body. + + + Gets the content negotiator to handle content negotiation. + + + + Gets the formatters to use to negotiate and format the content. + + + Gets the request message which led to this result. + + + Gets the name of the route to use for generating the URL. + + + Gets the route data to use for generating the URL. + + + Gets the factory to use to generate the route URL. + + + Represents an action result that performs content negotiation and returns a response when it succeeds. + The type of content in the entity body. + + + Initializes a new instance of the class with the values provided. + The content value to negotiate and format in the entity body. + The location at which the content has been created. + The content negotiator to handle content negotiation. + The request message which led to this result. + The formatters to use to negotiate and format the content. + + + Initializes a new instance of the class with the values provided. + The location at which the content has been created. + The content value to negotiate and format in the entity body. + The controller from which to obtain the dependencies needed for execution. + + + Gets the content value to negotiate and format in the entity body. + The content value to negotiate and format in the entity body. + + + Gets the content negotiator to handle content negotiation. + The content negotiator to handle content negotiation. + + + Executes asynchronously the operation of the created negotiated content result. + Asynchronously executes a return value. + The cancellation token. + + + Gets the formatters to use to negotiate and format the content. + The formatters to use to negotiate and format the content. + + + Gets the location at which the content has been created. + The location at which the content has been created. + + + Gets the request message which led to this result. + The HTTP request message which led to this result. + + + Represents an action result that returns a response and performs content negotiation on an  based on an . + + + Initializes a new instance of the class. + The exception to include in the error. + true if the error should include exception messages; otherwise, false . + The content negotiator to handle content negotiation. + The request message which led to this result. + The formatters to use to negotiate and format the content. + + + Initializes a new instance of the class. + The exception to include in the error. + The controller from which to obtain the dependencies needed for execution. + + + Gets the content negotiator to handle content negotiation. + Returns . + + + Gets the exception to include in the error. + Returns . + + + Returns . + + + Gets the formatters to use to negotiate and format the content. + Returns . + + + Gets a value indicating whether the error should include exception messages. + Returns . + + + Gets the request message which led to this result. + Returns . + + + Represents an action result that returns formatted content. + The type of content in the entity body. + + + Initializes a new instance of the class with the values provided. + The HTTP status code for the response message. + The content value to format in the entity body. + The formatter to use to format the content. + The value for the Content-Type header, or to have the formatter pick a default value. + The request message which led to this result. + + + Initializes a new instance of the class with the values provided. + The HTTP status code for the response message. + The content value to format in the entity body. + The formatter to use to format the content. + The value for the Content-Type header, or to have the formatter pick a default value. + The controller from which to obtain the dependencies needed for execution. + + + Gets the content value to format in the entity body. + + + + Gets the formatter to use to format the content. + + + Gets the value for the Content-Type header, or to have the formatter pick a default value. + + + Gets the request message which led to this result. + + + Gets the HTTP status code for the response message. + + + Represents an action result that returns an empty response. + + + Initializes a new instance of the class. + The request message which led to this result. + + + Initializes a new instance of the class. + The controller from which to obtain the dependencies needed for execution. + + + Returns . + + + Gets the request message which led to this result. + Returns . + + + Represents an action result that returns a response and performs content negotiation on an based on a . + + + Initializes a new instance of the class. + The model state to include in the error. + true if the error should include exception messages; otherwise, false. + The content negotiator to handle content negotiation. + The request message which led to this result. + The formatters to use to negotiate and format the content. + + + Initializes a new instance of the class. + The model state to include in the error. + The controller from which to obtain the dependencies needed for execution. + + + Gets the content negotiator to handle content negotiation. + The content negotiator to handle content negotiation. + + + Creates a response message asynchronously. + A task that, when completed, contains the response message. + The token to monitor for cancellation requests. + + + Gets the formatters to use to negotiate and format the content. + The formatters to use to negotiate and format the content. + + + Gets a value indicating whether the error should include exception messages. + true if the error should include exception messages; otherwise, false. + + + Gets the model state to include in the error. + The model state to include in the error. + + + Gets the request message which led to this result. + The request message which led to this result. + + + Represents an action result that returns an response with JSON data. + The type of content in the entity body. + + + Initializes a new instance of the class with the values provided. + The content value to serialize in the entity body. + The serializer settings. + The content encoding. + The request message which led to this result. + + + Initializes a new instance of the class with the values provided. + The content value to serialize in the entity body. + The serializer settings. + The content encoding. + The controller from which to obtain the dependencies needed for execution. + + + Gets the content value to serialize in the entity body. + The content value to serialize in the entity body. + + + Gets the content encoding. + The content encoding. + + + Creates a response message asynchronously. + A task that, when completed, contains the response message. + The token to monitor for cancellation requests. + + + Gets the request message which led to this result. + The request message which led to this result. + + + Gets the serializer settings. + The serializer settings. + + + Represents an action result that performs content negotiation. + The type of content in the entity body. + + + Initializes a new instance of the class with the values provided. + The HTTP status code for the response message. + The content value to negotiate and format in the entity body. + The content negotiator to handle content negotiation. + The request message which led to this result. + The formatters to use to negotiate and format the content. + + + Initializes a new instance of the class with the values provided. + The HTTP status code for the response message. + The content value to negotiate and format in the entity body. + The controller from which to obtain the dependencies needed for execution. + + + Gets the content value to negotiate and format in the entity body. + The content value to negotiate and format in the entity body. + + + Gets the content negotiator to handle content negotiation. + The content negotiator to handle content negotiation. + + + Executes asynchronously an HTTP negotiated content results. + Asynchronously executes an HTTP negotiated content results. + The cancellation token. + + + Gets the formatters to use to negotiate and format the content. + The formatters to use to negotiate and format the content. + + + Gets the request message which led to this result. + The HTTP request message which led to this result. + + + Gets the HTTP status code for the response message. + The HTTP status code for the response message. + + + Represents an action result that returns an empty response. + + + Initializes a new instance of the class. + The request message which led to this result. + + + Initializes a new instance of the class. + The controller from which to obtain the dependencies needed for execution. + + + + Gets the request message which led to this result. + + + Represents an action result that performs content negotiation and returns an HttpStatusCode.OK response when it succeeds. + The type of content in the entity body. + + + Initializes a new instance of the class with the values provided. + The content value to negotiate and format in the entity body. + The content negotiator to handle content negotiation. + The request message which led to this result. + The formatters to use to negotiate and format the content. + + + Initializes a new instance of the class with the values provided. + The content value to negotiate and format in the entity body. + The controller from which to obtain the dependencies needed for execution. + + + Gets the content value to negotiate and format in the entity body. + + + Gets the content negotiator to handle content negotiation. + + + + Gets the formatters to use to negotiate and format the content. + + + Gets the request message which led to this result. + + + Represents an action result that returns an empty HttpStatusCode.OK response. + + + Initializes a new instance of the class. + The request message which led to this result. + + + Initializes a new instance of the class. + The controller from which to obtain the dependencies needed for execution. + + + Executes asynchronously. + Returns the task. + The cancellation token. + + + Gets a HTTP request message for the results. + A HTTP request message for the results. + + + Represents an action result for a <see cref="F:System.Net.HttpStatusCode.Redirect"/>. + + + Initializes a new instance of the <see cref="T:System.Web.Http.Results.RedirectResult"/> class with the values provided. + The location to which to redirect. + The request message which led to this result. + + + Initializes a new instance of the <see cref="T:System.Web.Http.Results.RedirectResult"/> class with the values provided. + The location to which to redirect. + The controller from which to obtain the dependencies needed for execution. + + + Returns . + + + Gets the location at which the content has been created. + Returns . + + + Gets the request message which led to this result. + Returns . + + + Represents an action result that performs route generation and returns a <see cref="F:System.Net.HttpStatusCode.Redirect"/> response. + + + Initializes a new instance of the <see cref="T:System.Web.Http.Results.RedirectToRouteResult"/> class with the values provided. + The name of the route to use for generating the URL. + The route data to use for generating the URL. + The controller from which to obtain the dependencies needed for execution. + + + Initializes a new instance of the <see cref="T:System.Web.Http.Results.RedirectToRouteResult"/> class with the values provided. + The name of the route to use for generating the URL. + The route data to use for generating the URL. + The factory to use to generate the route URL. + The request message which led to this result. + + + Returns . + + + Gets the request message which led to this result. + Returns . + + + Gets the name of the route to use for generating the URL. + Returns . + + + Gets the route data to use for generating the URL. + Returns . + + + Gets the factory to use to generate the route URL. + Returns . + + + Represents an action result that returns a specified response message. + + + Initializes a new instance of the class. + The response message. + + + + Gets the response message. + + + Represents an action result that returns a specified HTTP status code. + + + Initializes a new instance of the class. + The HTTP status code for the response message. + The request message which led to this result. + + + Initializes a new instance of the class. + The HTTP status code for the response message. + The controller from which to obtain the dependencies needed for execution. + + + Creates a response message asynchronously. + A task that, when completed, contains the response message. + The token to monitor for cancellation requests. + + + Gets the request message which led to this result. + The request message which led to this result. + + + Gets the HTTP status code for the response message. + The HTTP status code for the response message. + + + Represents an action result that returns an response. + + + Initializes a new instance of the class. + The WWW-Authenticate challenges. + The request message which led to this result. + + + Initializes a new instance of the class. + The WWW-Authenticate challenges. + The controller from which to obtain the dependencies needed for execution. + + + Gets the WWW-Authenticate challenges. + Returns . + + + Returns . + + + Gets the request message which led to this result. + Returns . + + + A default implementation of . + + + + Creates instances based on the provided factories and action. The route entries provide direct routing to the provided action. + A set of route entries. + The action descriptor. + The direct route factories. + The constraint resolver. + + + Gets a set of route factories for the given action descriptor. + A set of route factories. + The action descriptor. + + + Creates instances based on the provided factories, controller and actions. The route entries provided direct routing to the provided controller and can reach the set of provided actions. + A set of route entries. + The controller descriptor. + The action descriptors. + The direct route factories. + The constraint resolver. + + + Gets route factories for the given controller descriptor. + A set of route factories. + The controller descriptor. + + + Gets direct routes for the given controller descriptor and action descriptors based on attributes. + A set of route entries. + The controller descriptor. + The action descriptors for all actions. + The constraint resolver. + + + Gets the route prefix from the provided controller. + The route prefix or null. + The controller descriptor. + + + The default implementation of . Resolves constraints by parsing a constraint key and constraint arguments, using a map to resolve the constraint type, and calling an appropriate constructor for the constraint type. + + + Initializes a new instance of the class. + + + Gets the mutable dictionary that maps constraint keys to a particular constraint type. + The mutable dictionary that maps constraint keys to a particular constraint type. + + + Resolves the inline constraint. + The the inline constraint was resolved to. + The inline constraint to resolve. + + + Represents a context that supports creating a direct route. + + + Initializes a new instance of the class. + The route prefix, if any, defined by the controller. + The action descriptors to which to create a route. + The inline constraint resolver. + A value indicating whether the route is configured at the action or controller level. + + + Gets the action descriptors to which to create a route. + The action descriptors to which to create a route. + + + Creates a route builder that can build a route matching this context. + A route builder that can build a route matching this context. + The route template. + + + Creates a route builder that can build a route matching this context. + A route builder that can build a route matching this context. + The route template. + The inline constraint resolver to use, if any; otherwise, null. + + + Gets the inline constraint resolver. + The inline constraint resolver. + + + Gets the route prefix, if any, defined by the controller. + The route prefix, if any, defined by the controller. + + + Gets a value indicating whether the route is configured at the action or controller level. + true when the route is configured at the action level; otherwise false (if the route is configured at the controller level). + + + Enables you to define which HTTP verbs are allowed when ASP.NET routing determines whether a URL matches a route. + + + Initializes a new instance of the class by using the HTTP verbs that are allowed for the route. + The HTTP verbs that are valid for the route. + + + Gets or sets the collection of allowed HTTP verbs for the route. + A collection of allowed HTTP verbs for the route. + + + Determines whether the request was made with an HTTP verb that is one of the allowed verbs for the route. + When ASP.NET routing is processing a request, true if the request was made by using an allowed HTTP verb; otherwise, false. When ASP.NET routing is constructing a URL, true if the supplied values contain an HTTP verb that matches one of the allowed HTTP verbs; otherwise, false. The default is true. + The request that is being checked to determine whether it matches the URL. + The object that is being checked to determine whether it matches the URL. + The name of the parameter that is being checked. + An object that contains the parameters for a route. + An object that indicates whether the constraint check is being performed when an incoming request is processed or when a URL is generated. + + + Determines whether the request was made with an HTTP verb that is one of the allowed verbs for the route. + When ASP.NET routing is processing a request, true if the request was made by using an allowed HTTP verb; otherwise, false. When ASP.NET routing is constructing a URL, true if the supplied values contain an HTTP verb that matches one of the allowed HTTP verbs; otherwise, false. The default is true. + The request that is being checked to determine whether it matches the URL. + The object that is being checked to determine whether it matches the URL. + The name of the parameter that is being checked. + An object that contains the parameters for a route. + An object that indicates whether the constraint check is being performed when an incoming request is processed or when a URL is generated. + + + Represents a route class for self-host (i.e. hosted outside of ASP.NET). + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The route template. + + + Initializes a new instance of the class. + The route template. + The default values for the route parameters. + + + Initializes a new instance of the class. + The route template. + The default values for the route parameters. + The constraints for the route parameters. + + + Initializes a new instance of the class. + The route template. + The default values for the route parameters. + The constraints for the route parameters. + Any additional tokens for the route parameters. + + + Initializes a new instance of the class. + The route template. + The default values for the route parameters. + The constraints for the route parameters. + Any additional tokens for the route parameters. + The message handler that will be the recipient of the request. + + + Gets the constraints for the route parameters. + The constraints for the route parameters. + + + Gets any additional data tokens not used directly to determine whether a route matches an incoming . + Any additional data tokens not used directly to determine whether a route matches an incoming . + + + Gets the default values for route parameters if not provided by the incoming . + The default values for route parameters if not provided by the incoming . + + + Determines whether this route is a match for the incoming request by looking up the for the route. + The for a route if matches; otherwise null. + The virtual path root. + The HTTP request. + + + Attempts to generate a URI that represents the values passed in based on current values from the and new values using the specified . + A instance or null if URI cannot be generated. + The HTTP request message. + The route values. + + + Gets or sets the http route handler. + The http route handler. + + + Specifies the HTTP route key. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The HTTP request. + The constraints for the route parameters. + The name of the parameter. + The list of parameter values. + One of the enumeration values of the enumeration. + + + Gets the route template describing the URI pattern to match against. + The route template describing the URI pattern to match against. + + + Encapsulates information regarding the HTTP route. + + + Initializes a new instance of the class. + An object that defines the route. + + + Initializes a new instance of the class. + An object that defines the route. + The value. + + + Gets the object that represents the route. + the object that represents the route. + + + Gets a collection of URL parameter values and default values for the route. + An object that contains values that are parsed from the URL and from default values. + + + Removes all optional parameters that do not have a value from the route data. + + + If a route is really a union of other routes, return the set of sub routes. + Returns the set of sub routes contained within this route. + A union route data. + + + Removes all optional parameters that do not have a value from the route data. + The route data, to be mutated in-place. + + + Specifies an enumeration of route direction. + + + The UriGeneration direction. + + + The UriResolution direction. + + + Represents a route class for self-host of specified key/value pairs. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The dictionary. + + + Initializes a new instance of the class. + The key value. + + + Presents the data regarding the HTTP virtual path. + + + Initializes a new instance of the class. + The route of the virtual path. + The URL that was created from the route definition. + + + Gets or sets the route of the virtual path.. + The route of the virtual path. + + + Gets or sets the URL that was created from the route definition. + The URL that was created from the route definition. + + + Defines a builder that creates direct routes to actions (attribute routes). + + + Gets the action descriptors to which to create a route. + The action descriptors to which to create a route. + + + Creates a route entry based on the current property values. + The route entry created. + + + Gets or sets the route constraints. + The route constraints. + + + Gets or sets the route data tokens. + The route data tokens. + + + Gets or sets the route defaults. + The route defaults. + + + Gets or sets the route name, if any; otherwise null. + The route name, if any; otherwise null. + + + Gets or sets the route order. + The route order. + + + Gets or sets the route precedence. + The route precedence. + + + Gets a value indicating whether the route is configured at the action or controller level. + true when the route is configured at the action level; otherwise false (if the route is configured at the controller level). + + + Gets or sets the route template. + The route template. + + + Defines a factory that creates a route directly to a set of action descriptors (an attribute route). + + + Creates a direct route entry. + The direct route entry. + The context to use to create the route. + + + Defines a provider for routes that directly target action descriptors (attribute routes). + + + Gets the direct routes for a controller. + A set of route entries for the controller. + The controller descriptor. + The action descriptors. + The inline constraint resolver. + + + + defines the interface for a route expressing how to map an incoming to a particular controller and action. + + + Gets the constraints for the route parameters. + The constraints for the route parameters. + + + Gets any additional data tokens not used directly to determine whether a route matches an incoming . + The additional data tokens. + + + Gets the default values for route parameters if not provided by the incoming . + The default values for route parameters. + + + Determine whether this route is a match for the incoming request by looking up the <see cref="!:IRouteData" /> for the route. + The <see cref="!:RouteData" /> for a route if matches; otherwise null. + The virtual path root. + The request. + + + Gets a virtual path data based on the route and the values provided. + The virtual path data. + The request message. + The values. + + + Gets the message handler that will be the recipient of the request. + The message handler. + + + Gets the route template describing the URI pattern to match against. + The route template. + + + Represents a base class route constraint. + + + Determines whether this instance equals a specified route. + True if this instance equals a specified route; otherwise, false. + The request. + The route to compare. + The name of the parameter. + A list of parameter values. + The route direction. + + + Provides information about a route. + + + Gets the object that represents the route. + The object that represents the route. + + + Gets a collection of URL parameter values and default values for the route. + The values that are parsed from the URL and from default values. + + + Provides information for defining a route. + + + Gets the name of the route to generate. + + + Gets the order of the route relative to other routes. + + + Gets the route template describing the URI pattern to match against. + + + Defines the properties for HTTP route. + + + Gets the HTTP route. + The HTTP route. + + + Gets the URI that represents the virtual path of the current HTTP route. + The URI that represents the virtual path of the current HTTP route. + + + Defines an abstraction for resolving inline constraints as instances of . + + + Resolves the inline constraint. + The the inline constraint was resolved to. + The inline constraint to resolve. + + + Defines a route prefix. + + + Gets the route prefix. + The route prefix. + + + Represents a named route. + + + Initializes a new instance of the class. + The route name, if any; otherwise, null. + The route. + + + Gets the route name, if any; otherwise, null. + The route name, if any; otherwise, null. + + + Gets the route. + The route. + + + Represents an attribute route that may contain custom constraints. + + + Initializes a new instance of the class. + The route template. + + + Gets the route constraints, if any; otherwise null. + The route constraints, if any; otherwise null. + + + Creates the route entry + The created route entry. + The context. + + + Gets the route data tokens, if any; otherwise null. + The route data tokens, if any; otherwise null. + + + Gets the route defaults, if any; otherwise null. + The route defaults, if any; otherwise null. + + + Gets or sets the route name, if any; otherwise null. + The route name, if any; otherwise null. + + + Gets or sets the route order. + The route order. + + + Gets the route template. + The route template. + + + Represents a handler that specifies routing should not handle requests for a route template. When a route provides this class as a handler, requests matching against the route will be ignored. + + + Initializes a new instance of the class. + + + Represents a factory for creating URLs. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The HTTP request for this instance. + + + Creates an absolute URL using the specified path. + The generated URL. + The URL path, which may be a relative URL, a rooted URL, or a virtual path. + + + Returns a link for the specified route. + A link for the specified route. + The name of the route. + An object that contains the parameters for a route. + + + Returns a link for the specified route. + A link for the specified route. + The name of the route. + A route value. + + + Gets or sets the of the current instance. + The of the current instance. + + + Returns the route for the . + The route for the . + The name of the route. + A list of route values. + + + Returns the route for the . + The route for the . + The name of the route. + The route values. + + + Constrains a route parameter to contain only lowercase or uppercase letters A through Z in the English alphabet. + + + Initializes a new instance of the class. + + + Constrains a route parameter to represent only Boolean values. + + + Initializes a new instance of the class. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The request. + The route to compare. + The name of the parameter. + A list of parameter values. + The route direction. + + + Constrains a route by several child constraints. + + + Initializes a new instance of the class. + The child constraints that must match for this constraint to match. + + + Gets the child constraints that must match for this constraint to match. + The child constraints that must match for this constraint to match. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The request. + The route to compare. + The name of the parameter. + A list of parameter values. + The route direction. + + + Constrains a route parameter to represent only values. + + + Initializes a new instance of the class. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The request. + The route to compare. + The name of the parameter. + A list of parameter values. + The route of direction. + + + Constrains a route parameter to represent only decimal values. + + + Initializes a new instance of the class. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The request. + The route to compare. + The name of the parameter. + A list of parameter values. + The route direction. + + + Constrains a route parameter to represent only 64-bit floating-point values. + + + + + Constrains a route parameter to represent only 32-bit floating-point values. + + + + + Constrains a route parameter to represent only values. + + + Initializes a new instance of the class. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The request. + The route to compare. + The name of the parameter. + A list of parameter values. + The route direction. + + + Constrains a route parameter to represent only 32-bit integer values. + + + Initializes a new instance of the class. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The request. + The route to compare. + The name of the parameter. + A list of parameter values. + The route direction. + + + Constrains a route parameter to be a string of a given length or within a given range of lengths. + + + + Initializes a new instance of the class that constrains a route parameter to be a string of a given length. + The minimum length of the route parameter. + The maximum length of the route parameter. + + + Gets the length of the route parameter, if one is set. + + + + Gets the maximum length of the route parameter, if one is set. + + + Gets the minimum length of the route parameter, if one is set. + + + Constrains a route parameter to represent only 64-bit integer values. + + + + + Constrains a route parameter to be a string with a maximum length. + + + Initializes a new instance of the class. + The maximum length. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The request. + The route to compare. + The name of the parameter. + A list of parameter values. + The route direction. + + + Gets the maximum length of the route parameter. + The maximum length of the route parameter. + + + Constrains a route parameter to be an integer with a maximum value. + + + + + Gets the maximum value of the route parameter. + + + Constrains a route parameter to be a string with a maximum length. + + + Initializes a new instance of the class. + The minimum length. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The request. + The route to compare. + The name of the parameter. + A list of parameter values. + The route direction. + + + Gets the minimum length of the route parameter. + The minimum length of the route parameter. + + + Constrains a route parameter to be a long with a minimum value. + + + Initializes a new instance of the class. + The minimum value of the route parameter. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The request. + The route to compare. + The name of the parameter. + A list of parameter values. + The route direction. + + + Gets the minimum value of the route parameter. + The minimum value of the route parameter. + + + Constrains a route by an inner constraint that doesn't fail when an optional parameter is set to its default value. + + + Initializes a new instance of the class. + The inner constraint to match if the parameter is not an optional parameter without a value + + + Gets the inner constraint to match if the parameter is not an optional parameter without a value. + The inner constraint to match if the parameter is not an optional parameter without a value. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The request. + The route to compare. + The name of the parameter. + A list of parameter values. + The route direction. + + + Constraints a route parameter to be an integer within a given range of values. + + + Initializes a new instance of the class. + The minimum value. + The maximum value. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The request. + The route to compare. + The name of the parameter. + A list of parameter values. + The route direction. + + + Gets the maximum value of the route parameter. + The maximum value of the route parameter. + + + Gets the minimum value of the route parameter. + The minimum value of the route parameter. + + + Constrains a route parameter to match a regular expression. + + + Initializes a new instance of the class. + The pattern. + + + Determines whether this instance equals a specified route. + true if this instance equals a specified route; otherwise, false. + The request. + The route to compare. + The name of the parameter. + A list of parameter values. + The route direction. + + + Gets the regular expression pattern to match. + The regular expression pattern to match. + + + Provides a method for retrieving the innermost object of an object that might be wrapped by an <see cref="T:System.Web.Http.Services.IDecorator`1" />. + + + Gets the innermost object which does not implement <see cref="T:System.Web.Http.Services.IDecorator`1" />. + Object which needs to be unwrapped. + + + + Represents a container for service instances used by the . Note that this container only supports known types, and methods to get or set arbitrary service types will throw when called. For creation of arbitrary types, please use instead. The supported types for this container are: Passing any type which is not on this to any method on this interface will cause an to be thrown. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with a specified object. + The object. + + + Removes a single-instance service from the default services. + The type of the service. + + + Gets a service of the specified type. + The first instance of the service, or null if the service is not found. + The type of service. + + + Gets the list of service objects for a given service type, and validates the service type. + The list of service objects of the specified type. + The service type. + + + Gets the list of service objects for a given service type. + The list of service objects of the specified type, or an empty list if the service is not found. + The type of service. + + + Queries whether a service type is single-instance. + true if the service type has at most one instance, or false if the service type supports multiple instances. + The service type. + + + Replaces a single-instance service object. + The service type. + The service object that replaces the previous instance. + + + Removes the cached values for a single service type. + The service type. + + + Defines a decorator that exposes the inner decorated object. + This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see . + + + Gets the inner object. + + + Represents a performance tracing class to log method entry/exit and duration. + + + Initializes the class with a specified configuration. + The configuration. + + + Represents the trace writer. + + + Invokes the specified traceAction to allow setting values in a new if and only if tracing is permitted at the given category and level. + The current . It may be null but doing so will prevent subsequent trace analysis from correlating the trace to a particular request. + The logical category for the trace. Users can define their own. + The at which to write this trace. + The action to invoke if tracing is enabled. The caller is expected to fill in the fields of the given in this action. + + + Represents an extension methods for . + + + Provides a set of methods and properties that help debug your code with the specified writer, request, category and exception. + The . + The with which to associate the trace. It may be null. + The logical category of the trace. + The error occurred during execution. + + + Provides a set of methods and properties that help debug your code with the specified writer, request, category, exception, message format and argument. + The . + The with which to associate the trace. It may be null. + The logical category of the trace. + The error occurred during execution. + The format of the message. + The message argument. + + + Provides a set of methods and properties that help debug your code with the specified writer, request, category, exception, message format and argument. + The . + The with which to associate the trace. It may be null. + The logical category of the trace. + The format of the message. + The message argument. + + + Displays an error message in the list with the specified writer, request, category and exception. + The . + The with which to associate the trace. It may be null. + The logical category of the trace. + The error occurred during execution. + + + Displays an error message in the list with the specified writer, request, category, exception, message format and argument. + The . + The with which to associate the trace. It may be null. + The logical category of the trace. + The exception. + The format of the message. + The argument in the message. + + + Displays an error message in the list with the specified writer, request, category, message format and argument. + The . + The with which to associate the trace. It may be null. + The logical category of the trace. + The format of the message. + The argument in the message. + + + Displays an error message in the class with the specified writer, request, category and exception. + The . + The with which to associate the trace. It may be null. + The logical category of the trace. + The exception that appears during execution. + + + Displays an error message in the class with the specified writer, request, category and exception, message format and argument. + The . + The with which to associate the trace. It may be null. + The logical category of the trace. + The exception. + The format of the message. + The message argument. + + + Displays an error message in the class with the specified writer, request, category and message format and argument. + The . + The with which to associate the trace. It may be null. + The logical category of the trace. + The format of the message. + The message argument. + + + Displays the details in the . + The . + The with which to associate the trace. It may be null. + The logical category of the trace. + The error occurred during execution. + + + Displays the details in the . + The . + The with which to associate the trace. It may be null. + The logical category of the trace. + The error occurred during execution. + The format of the message. + The message argument. + + + Displays the details in the . + The . + The with which to associate the trace. It may be null. + The logical category of the trace. + The format of the message. + The message argument. + + + Indicates the trace listeners in the Listeners collection. + The . + The with which to associate the trace. It may be null. + The logical category of the trace. + The trace level. + The error occurred during execution. + + + Indicates the trace listeners in the Listeners collection. + The . + The with which to associate the trace. It may be null. + The logical category of the trace. + The trace level. + The error occurred during execution. + The format of the message. + The message argument. + + + Indicates the trace listeners in the Listeners collection. + The . + The with which to associate the trace. It may be null. + The logical category of the trace. + The of the trace. + The format of the message. + The message argument. + + + Traces both a begin and an end trace around a specified operation. + The . + The with which to associate the trace. It may be null. + The logical category of the trace. + The of the trace. + The name of the object performing the operation. It may be null. + The name of the operation being performed. It may be null. + The to invoke prior to performing the operation, allowing the given to be filled in. It may be null. + An <see cref="T:System.Func`1" /> that returns the that will perform the operation. + The to invoke after successfully performing the operation, allowing the given to be filled in. It may be null. + The to invoke if an error was encountered performing the operation, allowing the given to be filled in. It may be null. + + + Traces both a begin and an end trace around a specified operation. + The returned by the operation. + The . + The with which to associate the trace. It may be null. + The logical category of the trace. + The of the trace. + The name of the object performing the operation. It may be null. + The name of the operation being performed. It may be null. + The to invoke prior to performing the operation, allowing the given to be filled in. It may be null. + An <see cref="T:System.Func`1" /> that returns the that will perform the operation. + The to invoke after successfully performing the operation, allowing the given to be filled in. The result of the completed task will also be passed to this action. This action may be null. + The to invoke if an error was encountered performing the operation, allowing the given to be filled in. It may be null. + The type of result produced by the . + + + Traces both a begin and an end trace around a specified operation. + The returned by the operation. + The . + The with which to associate the trace. It may be null. + The logical category of the trace. + The of the trace. + The name of the object performing the operation. It may be null. + The name of the operation being performed. It may be null. + The to invoke prior to performing the operation, allowing the given to be filled in. It may be null. + An <see cref="T:System.Func`1" /> that returns the that will perform the operation. + The to invoke after successfully performing the operation, allowing the given to be filled in. It may be null. + The to invoke if an error was encountered performing the operation, allowing the given to be filled in. It may be null. + + + Indicates the warning level of execution. + The . + The with which to associate the trace. It may be null. + The logical category of the trace. + The error occurred during execution. + + + Indicates the warning level of execution. + The . + The with which to associate the trace. It may be null. + The logical category of the trace. + The error occurred during execution. + The format of the message. + The message argument. + + + Indicates the warning level of execution. + The . + The with which to associate the trace. It may be null. + The logical category of the trace. + The format of the message. + The message argument. + + + Specifies an enumeration of tracing categories. + + + An action category. + + + The controllers category. + + + The filters category. + + + The formatting category. + + + The message handlers category. + + + The model binding category. + + + The request category. + + + The routing category. + + + Specifies the kind of tracing operation. + + + Trace marking the beginning of some operation. + + + Trace marking the end of some operation. + + + Single trace, not part of a Begin/End trace pair. + + + Specifies an enumeration of tracing level. + + + Trace level for debugging traces. + + + Trace level for error traces. + + + Trace level for fatal traces. + + + Trace level for informational traces. + + + Tracing is disabled. + + + Trace level for warning traces. + + + Represents a trace record. + + + Initializes a new instance of the class. + The message request. + The trace category. + The trace level. + + + Gets or sets the tracing category. + The tracing category. + + + Gets or sets the exception. + The exception. + + + Gets or sets the kind of trace. + The kind of trace. + + + Gets or sets the tracing level. + The tracing level. + + + Gets or sets the message. + The message. + + + Gets or sets the logical operation name being performed. + The logical operation name being performed. + + + Gets or sets the logical name of the object performing the operation. + The logical name of the object performing the operation. + + + Gets the optional user-defined properties. + The optional user-defined properties. + + + Gets the from the record. + The from the record. + + + Gets the correlation ID from the . + The correlation ID from the . + + + Gets or sets the associated with the . + The associated with the . + + + Gets the of this trace (via ). + The of this trace (via ). + + + Represents a class used to recursively validate an object. + + + Initializes a new instance of the class. + + + Determines whether instances of a particular type should be validated. + true if the type should be validated; false otherwise. + The type to validate. + + + Determines whether the is valid and adds any validation errors to the 's . + true if model is valid, false otherwise. + The model to be validated. + The to use for validation. + The used to provide model metadata. + The within which the model is being validated. + The to append to the key for any validation errors. + + + Represents an interface for the validation of the models + + + Determines whether the model is valid and adds any validation errors to the actionContext's + trueif model is valid, false otherwise. + The model to be validated. + The to use for validation. + The used to provide the model metadata. + The within which the model is being validated. + The to append to the key for any validation errors. + + + This logs formatter errors to the provided . + + + Initializes a new instance of the class. + The model state. + The prefix. + + + Logs the specified model error. + The error path. + The error message. + + + Logs the specified model error. + The error path. + The error message. + + + Provides data for the event. + + + Initializes a new instance of the class. + The action context. + The parent node. + + + Gets or sets the context for an action. + The context for an action. + + + Gets or sets the parent of this node. + The parent of this node. + + + Provides data for the event. + + + Initializes a new instance of the class. + The action context. + The parent node. + + + Gets or sets the context for an action. + The context for an action. + + + Gets or sets the parent of this node. + The parent of this node. + + + Provides a container for model validation information. + + + Initializes a new instance of the class, using the model metadata and state key. + The model metadata. + The model state key. + + + Initializes a new instance of the class, using the model metadata, the model state key, and child model-validation nodes. + The model metadata. + The model state key. + The model child nodes. + + + Gets or sets the child nodes. + The child nodes. + + + Combines the current instance with a specified instance. + The model validation node to combine with the current instance. + + + Gets or sets the model metadata. + The model metadata. + + + Gets or sets the model state key. + The model state key. + + + Gets or sets a value that indicates whether validation should be suppressed. + true if validation should be suppressed; otherwise, false. + + + Validates the model using the specified execution context. + The action context. + + + Validates the model using the specified execution context and parent node. + The action context. + The parent node. + + + Gets or sets a value that indicates whether all properties of the model should be validated. + true if all properties of the model should be validated, or false if validation should be skipped. + + + Occurs when the model has been validated. + + + Occurs when the model is being validated. + + + Represents the selection of required members by checking for any required ModelValidators associated with the member. + + + Initializes a new instance of the class. + The metadata provider. + The validator providers. + + + Indicates whether the member is required for validation. + true if the member is required for validation; otherwise, false. + The member. + + + Provides a container for a validation result. + + + Initializes a new instance of the class. + + + Gets or sets the name of the member. + The name of the member. + + + Gets or sets the validation result message. + The validation result message. + + + Provides a base class for implementing validation logic. + + + Initializes a new instance of the class. + The validator providers. + + + Returns a composite model validator for the model. + A composite model validator for the model. + An enumeration of validator providers. + + + Gets a value that indicates whether a model property is required. + true if the model property is required; otherwise, false. + + + Validates a specified object. + A list of validation results. + The metadata. + The container. + + + Gets or sets an enumeration of validator providers. + An enumeration of validator providers. + + + Provides a list of validators for a model. + + + Initializes a new instance of the class. + + + Gets a list of validators associated with this . + The list of validators. + The metadata. + The validator providers. + + + Provides an abstract class for classes that implement a validation provider. + + + Initializes a new instance of the class. + + + Gets a type descriptor for the specified type. + A type descriptor for the specified type. + The type of the validation provider. + + + Gets the validators for the model using the metadata and validator providers. + The validators for the model. + The metadata. + An enumeration of validator providers. + + + Gets the validators for the model using the metadata, the validator providers, and a list of attributes. + The validators for the model. + The metadata. + An enumeration of validator providers. + The list of attributes. + + + Represents the method that creates a instance. + + + Represents an implementation of which providers validators for attributes which derive from . It also provides a validator for types which implement . To support client side validation, you can either register adapters through the static methods on this class, or by having your validation attributes implement . The logic to support IClientValidatable is implemented in . + + + Initializes a new instance of the class. + + + Gets the validators for the model using the specified metadata, validator provider and attributes. + The validators for the model. + The metadata. + The validator providers. + The attributes. + + + Registers an adapter to provide client-side validation. + The type of the validation attribute. + The type of the adapter. + + + Registers an adapter factory for the validation provider. + The type of the attribute. + The factory that will be used to create the object for the specified attribute. + + + Registers the default adapter. + The type of the adapter. + + + Registers the default adapter factory. + The factory that will be used to create the object for the default adapter. + + + Registers the default adapter type for objects which implement . The adapter type must derive from and it must contain a public constructor which takes two parameters of types and . + The type of the adapter. + + + Registers the default adapter factory for objects which implement . + The factory. + + + Registers an adapter type for the given modelType, which must implement . The adapter type must derive from and it must contain a public constructor which takes two parameters of types and . + The model type. + The type of the adapter. + + + Registers an adapter factory for the given modelType, which must implement . + The model type. + The factory. + + + Provides a factory for validators that are based on . + + + Represents a validator provider for data member model. + + + Initializes a new instance of the class. + + + Gets the validators for the model. + The validators for the model. + The metadata. + An enumerator of validator providers. + A list of attributes. + + + An implementation of which provides validators that throw exceptions when the model is invalid. + + + Initializes a new instance of the class. + + + Gets a list of validators associated with this . + The list of validators. + The metadata. + The validator providers. + The list of attributes. + + + Represents the provider for the required member model validator. + + + Initializes a new instance of the class. + The required member selector. + + + Gets the validator for the member model. + The validator for the member model. + The metadata. + The validator providers + + + Provides a model validator. + + + Initializes a new instance of the class. + The validator providers. + The validation attribute for the model. + + + Gets or sets the validation attribute for the model validator. + The validation attribute for the model validator. + + + Gets a value that indicates whether model validation is required. + true if model validation is required; otherwise, false. + + + Validates the model and returns the validation errors if any. + A list of validation error messages for the model, or an empty list if no errors have occurred. + The model metadata. + The container for the model. + + + A to represent an error. This validator will always throw an exception regardless of the actual model value. + + + Initializes a new instance of the class. + The list of model validator providers. + The error message for the exception. + + + Validates a specified object. + A list of validation results. + The metadata. + The container. + + + Represents the for required members. + + + Initializes a new instance of the class. + The validator providers. + + + Gets or sets a value that instructs the serialization engine that the member must be presents when validating. + true if the member is required; otherwise, false. + + + Validates the object. + A list of validation results. + The metadata. + The container. + + + Provides an object adapter that can be validated. + + + Initializes a new instance of the class. + The validation provider. + + + Validates the specified object. + A list of validation results. + The metadata. + The container. + + + Represents the base class for value providers whose values come from a collection that implements the interface. + + + Retrieves the keys from the specified . + The keys from the specified . + The prefix. + + + Represents an interface that is implemented by any that supports the creation of a to access the of an incoming . + + + Defines the methods that are required for a value provider in ASP.NET MVC. + + + Determines whether the collection contains the specified prefix. + true if the collection contains the specified prefix; otherwise, false. + The prefix to search for. + + + Retrieves a value object using the specified key. + The value object for the specified key, or null if the key is not found. + The key of the value object to retrieve. + + + This attribute is used to specify a custom . + + + Initializes a new instance of the . + The type of the model binder. + + + Initializes a new instance of the . + An array of model binder types. + + + Gets the value provider factories. + A collection of value provider factories. + A configuration object. + + + Gets the types of object returned by the value provider factory. + A collection of types. + + + Represents a factory for creating value-provider objects. + + + Initializes a new instance of the class. + + + Returns a value-provider object for the specified controller context. + A value-provider object. + An object that encapsulates information about the current HTTP request. + + + Represents the result of binding a value (such as from a form post or query string) to an action-method argument property, or to the argument itself. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The raw value. + The attempted value. + The culture. + + + Gets or sets the raw value that is converted to a string for display. + The raw value that is converted to a string for display. + + + Converts the value that is encapsulated by this result to the specified type. + The converted value. + The target type. + + + Converts the value that is encapsulated by this result to the specified type by using the specified culture information. + The converted value. + The target type. + The culture to use in the conversion. + + + Gets or sets the culture. + The culture. + + + Gets or set the raw value that is supplied by the value provider. + The raw value that is supplied by the value provider. + + + Represents a value provider whose values come from a list of value providers that implements the interface. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The list of value providers. + + + Determines whether the collection contains the specified . + true if the collection contains the specified ; otherwise, false. + The prefix to search for. + + + Retrieves the keys from the specified . + The keys from the specified . + The prefix from which keys are retrieved. + + + Retrieves a value object using the specified . + The value object for the specified . + The key of the value object to retrieve. + + + Inserts an element into the collection at the specified index. + The zero-based index at which should be inserted. + The object to insert. + + + Replaces the element at the specified index. + The zero-based index of the element to replace. + The new value for the element at the specified index. + + + Represents a factory for creating a list of value-provider objects. + + + Initializes a new instance of the class. + The collection of value-provider factories. + + + Retrieves a list of value-provider objects for the specified controller context. + The list of value-provider objects for the specified controller context. + An object that encapsulates information about the current HTTP request. + + + A value provider for name/value pairs. + + + + Initializes a new instance of the class. + The name/value pairs for the provider. + The culture used for the name/value pairs. + + + Initializes a new instance of the class, using a function delegate to provide the name/value pairs. + A function delegate that returns a collection of name/value pairs. + The culture used for the name/value pairs. + + + Determines whether the collection contains the specified prefix. + true if the collection contains the specified prefix; otherwise, false. + The prefix to search for. + + + Gets the keys from a prefix. + The keys. + The prefix. + + + Retrieves a value object using the specified key. + The value object for the specified key. + The key of the value object to retrieve. + + + Represents a value provider for query strings that are contained in a object. + + + Initializes a new instance of the class. + An object that encapsulates information about the current HTTP request. + An object that contains information about the target culture. + + + Represents a class that is responsible for creating a new instance of a query-string value-provider object. + + + Initializes a new instance of the class. + + + Retrieves a value-provider object for the specified controller context. + A query-string value-provider object. + An object that encapsulates information about the current HTTP request. + + + Represents a value provider for route data that is contained in an object that implements the IDictionary(Of TKey, TValue) interface. + + + Initializes a new instance of the class. + An object that contain information about the HTTP request. + An object that contains information about the target culture. + + + Represents a factory for creating route-data value provider objects. + + + Initializes a new instance of the class. + + + Retrieves a value-provider object for the specified controller context. + A value-provider object. + An object that encapsulates information about the current HTTP request. + + \ No newline at end of file diff --git a/lib/autofac/Autofac.Configuration.xml b/lib/autofac/Autofac.Configuration.xml index 1fed964869f..6ed974b36bf 100644 --- a/lib/autofac/Autofac.Configuration.xml +++ b/lib/autofac/Autofac.Configuration.xml @@ -1,1273 +1,1273 @@ - - - - Autofac.Configuration - - - - - Configures properties on other modules using settings from the appSettings section of - the configuration file. These can then be provided to component constructors as parameters - during registrations within the module. - - - The convention for the appSettings key is "Module.PropertyName" (e.g. Email.Pop3Host). - Modules should be named with a "Module" suffix (e.g. EmailModule). - - - - - Initializes a new instance of the class. - - The modules whose properties should be configured - using settings from the appSettings section of the configuration file. - - - - Override to add registrations to the container. - - The builder through which components can be registered. - - Note that the ContainerBuilder parameter is unique to this module. - - - - - Type converter used for converting assembly name strings to assembly and back. - - - - This type is used in configuration settings where an assembly name is provided and needs to be - handled on the back end as a strongly-typed, loaded assembly rather than a string. - - - - - - Converts an assembly name into an assembly. - - - The configuration context. - - - The configuration culture. - - - The assembly name to parse. - - - If is , empty, or whitespace this conversion - will return . Otherwise, the assembly specified by the - will be loaded and returned. - - - - - Converts an assembly into an assembly name. - - - The configuration context. - - - The configuration culture. - - - The assembly to convert. - - - The destination type to which the assembly should be converted. (Ignored for configuration converters.) - - - If is this conversion returns ; - otherwise the return value will be the full name of the assembly. - - - Thrown if is not and is not an . - - - - - Element describing a component registration. - - - - - Gets the type of the component. - - The type. - - - - Gets the service exposed by the component. For multiple-service components, - use the services element instead. - - The service. - - - - Allows the component to be added to another composite component. - - The name of the composite component. - - - - Allows the component to be added to another composite component. - - The name of the composite component. - - - - Sets the scope of the component instances. - - singleton (default,) factory or container. - - - - Sets the ownership over the component instances. - - container (default) or external. - - - - Sets up property injection for the component instances. This uses the - OnActivated event so that circular dependencies can be handled. - - never (default,) all, unset. - - - - Sets up auto activation for the component instances. - - no(default,) yes. - - - - Gets the services exposed by the component. - - The services. - - - - Gets the parameters used to construct the component. - - The parameters. - - - - Gets the properties to be explicitly set on the component. - - The explicit properties. - - - - Gets the extended properties associated with the registration. - - The extended properties. - - - - A collection of component elements. - - - - - A collection of configuration elements. - - The type of the element type. - - - - Initializes a new instance of the class. - - Name of the element. - - - - Indicates whether the specified exists in the . - - The name of the element to verify. - - true if the element exists in the collection; otherwise, false. The default is false. - - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - When overridden in a derived class, creates a new . - - - A new . - - - - - Gets the element key for a specified configuration element when overridden in a derived class. - - The to return the key for. - - An that acts as the key for the specified . - - - - - Gets the name used to identify this collection of elements in the configuration file when overridden in a derived class. - - The name of the collection; otherwise, an empty string. The default is an empty string. - - - - Gets the type of the . - - The of this collection. - - - - Initializes a new instance of the class. - - - - - Base class for a configuration parsing/execution module. - - - - Derived module classes are responsible for reading in configuration settings and populating - the property. The - value there will be used in to - convert the configuration into container registrations. - - - - - - - - Executes the conversion of configuration data into component registrations. - - - The into which registrations will be placed. - - - - This override uses the - to convert the - into component registrations in the provided . - - - If no specific - is set, the default type will be used. - - - - Thrown if is . - - - Thrown if the is . - - - - - Gets or sets the configuration registrar. - - - An that will be used as the - strategy for converting the - into component registrations. If this value is , the registrar - will be a . - - - - - Gets the section handler. - - - The that will be converted into - component registrations in a container. - - - - - Default service for adding configured registrations to a container. - - - - This default implementation of - processes contents into registrations into - a . You may derive and override to extend the functionality - or you may implement your own . - - - - - - - A service for adding configured registrations to a container. - - - - - Registers the contents of a configuration section into a container builder. - - - The that should receive the configured registrations. - - - The containing the configured registrations. - - - - - Registers the contents of a configuration section into a container builder. - - - The that should receive the configured registrations. - - - The containing the configured registrations. - - - Thrown if or is . - - - - This method is the primary entry point to configuration section registration. From here, - the various modules, components, and referenced files get registered. You may override - any of those behaviors for a custom registrar if you wish to extend registration behavior. - - - - - - Registers individual configured components into a container builder. - - - The that should receive the configured registrations. - - - The containing the configured registrations. - - - Thrown if or is . - - - Thrown if there is any issue in parsing the component configuration into registrations. - - - - This is where the individually configured component registrations get added to the . - The collection from the - get processed into individual registrations with associated lifetime scope, name, etc. - - - You may influence the process by overriding this whole method or by overriding these individual - parsing subroutines: - - - - - - - - - - - - - - - - - Registers individual configured modules into a container builder. - - - The that should receive the configured registrations. - - - The containing the configured registrations. - - - Thrown if or is . - - - Thrown if there is any issue in parsing the module configuration into registrations. - - - - This is where the individually configured component registrations get added to the . - The collection from the - get processed into individual modules which are instantiated and activated inside the . - - - - - - Registers referenced configuration files into a container builder. - - - The that should receive the configured registrations. - - - The containing the configured registrations. - - - Thrown if or is . - - - Thrown if there is any issue in processing the referenced files into registrations. - - - - This is where external files referenced in configuration get recursively loaded and added to the . - The collection from the - get processed into individual instances, each of which get - registered with the . - - - - - - Sets the property injection mode for the component. - - - The component registration on which property injection mode is being set. - - - The configuration value associated with property - injection for this component registration. - - - - By default, this implementation understands , empty, - or values (false, 0, no) - to mean "no property injection should occur" and - values (true, 1, yes) to mean "property injection - should occur." - - - You may override this method to extend the available grammar for property injection settings. - - - - Thrown if is . - - - Thrown if the value for is not part of the - recognized grammar. - - - - - Sets the auto activation mode for the component. - - - The component registration on which auto activation mode is being set. - - - The configuration value associated with auto - activate for this component registration. - - - - By default, this implementation understands , empty, - or values (false, 0, no) - to mean "no property injection should occur" and - values (true, 1, yes) to mean "auto activation - should occur." - - - You may override this method to extend the available grammar for auto activation settings. - - - - Thrown if is . - - - Thrown if the value for is not part of the - recognized grammar. - - - - - Sets the ownership model for the component. - - - The component registration on which the ownership model is being set. - - - The configuration value associated with the - ownership model for this component registration. - - - - By default, this implementation understands or empty - values to be "default ownership model"; lifetime-scope or LifetimeScope - is "owned by lifetime scope"; and external or ExternallyOwned is - "externally owned." - - - You may override this method to extend the available grammar for component ownership. - - - - Thrown if is . - - - Thrown if the value for is not part of the - recognized grammar. - - - - - Sets the lifetime scope for the component. - - - The component registration on which the lifetime scope is being set. - - - The configuration value associated with the - lifetime scope for this component registration. - - - - By default, this implementation understands or empty - values to be "default ownership model"; single-instance or SingleInstance - is singleton; instance-per-lifetime-scope, InstancePerLifetimeScope, per-lifetime-scope, - or PerLifetimeScope is one instance per nested lifetime scope; and instance-per-dependency, - InstancePerDependency, per-dependency, or PerDependency is - one instance for each resolution call. - - - You may override this method to extend the available grammar for lifetime scope. - - - - Thrown if is . - - - Thrown if the value for is not part of the - recognized grammar. - - - - - Loads a type by name. - - - Name of the to load. This may be a partial type name or a fully-qualified type name. - - - The default to use in type resolution if - is a partial type name. - - - The resolved based on the specified name. - - - Thrown if is . - - - Thrown if is empty. - - - Thrown if the specified can't be resolved as a fully-qualified type name and - isn't a partial type name for a found in the . - - - - - Configures containers based upon app.config/web.config settings. - - - - This module type uses standard .NET application configuration format files to initialize configuration - settings. By default the standard app.config/web.config is used with a configuration - section named autofac, but you can use the various constructors to override the file location - or configuration section name. - - - If you are storing your configuration settings in a raw XML file (without the additional - <configuration /> wrapper and section definitions you normally see in .NET application - configuration) you can use the module to specify - the XML file location directly. - - - - - - - - Initializes a new instance of the class - using the default application configuration file with a configuration section named autofac. - - - - - Initializes a new instance of the class - using the default application configuration file and a named section. - - - The name of the configuration section corresponding to a . - - - - - Initializes a new instance of the class - using a named configuration file and section. - - - The name of the configuration section corresponding to a . - - - The app.config/web.config format configuration file containing the - named section. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The {0} may not be empty.. - - - - - Looks up a localized string similar to Unable to find specified configuration file.. - - - - - Looks up a localized string similar to You must initialize the section handler on the module before executing the load operation.. - - - - - Looks up a localized string similar to No XML content nodes found in configuration. Check the XML reader to ensure configuration is in place.. - - - - - Looks up a localized string similar to The configuration section '{0}' could not be read.. - - - - - Looks up a localized string similar to If 'name' is specified, 'service' must also be specified (component name='{0}'.). - - - - - Looks up a localized string similar to Unable to convert object of type '{0}' to type '{1}'.. - - - - - Looks up a localized string similar to The type '{0}' specified in the TypeConverterAttribute is not a TypeConverter.. - - - - - Looks up a localized string similar to The type '{0}' could not be found. It may require assembly qualification, e.g. "MyType, MyAssembly".. - - - - - Looks up a localized string similar to The value '{0}' is not valid for the auto-activate attribute. Valid values are 'yes' and 'no'.. - - - - - Looks up a localized string similar to The value '{0}' is not valid for the inject-properties attribute. Valid values are 'yes' and 'no'.. - - - - - Looks up a localized string similar to The value '{0}' is not valid for the ownership attribute. Valid values are 'lifetime-scope' (the default) and 'external'.. - - - - - Looks up a localized string similar to The value '{0}' is not valid for the instance-scope attribute. Valid values are 'single-instance', 'per-dependency' (the default) and 'per-lifetime-scope'.. - - - - - Holds a dictionary of values for those properties/parameters that are a dictionary - - - - - Initializes a new instance of the class. - - - - - Helps convert the configuration element into an actuall generic list - - - - - Holds a list of values for those properties/parameters that are enumerable - - - - - Initializes a new instance of the class. - - - - - Helps convert the configuration element into an actual generic list - - - - - Helper methods used throughout the codebase. - - - - - Enforce that an argument is not null. Returns the - value if valid so that it can be used inline in - base initialiser syntax. - - - - - - - - - Element describing a component property. - - - - - Gets the name of the property. - - The name. - - - - Gets the value to be set (will be converted.) - - The value. - - - - Gets the type of the value. - - The type of the value. Defaults to string if not specified. - - - - Collection of extended property elements. - - - - - Base for multi-valued configuration elements. - - - - - - Initializes a new instance of the class. - - Name of the element. - The element key. - - - - Indicates whether the specified exists in the . - - The name of the element to verify. - - true if the element exists in the collection; otherwise, false. The default is false. - - - - - Creates a new . - - - A new . - - - - - Gets the element key for a specified configuration element when overridden in a derived class. - - The to return the key for. - - An that acts as the key for the specified . - - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Gets the name used to identify this collection of elements in the configuration file when overridden in a derived class. - - - The name of the collection; otherwise, an empty string. The default is an empty string. - - - - Gets the type of the . - - - The of this collection. - - - - Gets or sets the TElementType at the specified index. - - - - - - Initializes a new instance of the class. - - - - - Element describing an additional configuration file. - - - - - Gets the filename of the file. - - The filename. - - - - Gets the section name of the section in the configuration - file. - - The section name. - - - - A collection of file elements. - - - - - Initializes a new instance of the class. - - - - - Element describing a module registration. - - - - - Gets the type of the module. Must expose . - - The type. - - - - Gets the parameters used to construct the component. - - The parameters. - - - - Gets the properties to be explicitly set on the component. - - The explicit properties. - - - - A collection of module elements. - - - - - Initializes a new instance of the class. - - - - - Element describing a component constructor parameter. - - - - - Get the value of this element - - - - - - Gets the name of the parameter. - - The name. - - - - Gets the value used to set the parameter (type will be converted.) - - The value. - - - - If this parameter's value is a list of values - - - - - If this parameter's value is a dictionary - - - - - A collection of parameter elements. - - - - - Initializes a new instance of the class. - - - - - Convert to the Autofac parameter type. - - The parameters represented by this collection. - - - - Element describing a component property. - - - - - Get the value of this element - - - - - - Gets the name of the property. - - The name. - - - - Gets the value to be set (will be converted.) - - The value. - - - - If this property's value is a list of values - - - - - If this property's value is a dictionary - - - - - Collection of property elements. - - - - - Initializes a new instance of the class. - - - - - Convert to the Autofac parameter type. - - The parameters represented by this collection. - - - - Section handler for Autofac configuration. - - - - This configuration section is used for XML-based configuration of an Autofac - container. While it is primarily used from inside app.config or web.config - files, you may also use it with other arbitrary XML files via the - helper method. - - - - - - The default section name that will be searched for. - - - - - Deserializes a configuration section handler from a specific block of XML. - - - The used to read the XML configuration from the source. - - - A read/parsed based on the contents of the . - - - Thrown if is . - - - Thrown if does not contain XML configuration that can be parsed into - a . - - - - - Deserializes a configuration section handler from an XML configuration file. - - The path to the configuration file to parse. - - A read/parsed based on the contents of the . - - - Thrown if is . - - - Thrown if is empty. - - - Thrown if the file indicated by can't be found. - - - Thrown if the configuration can't properly be deserialized from the file. - - - - - Deserializes a configuration section handler from an XML configuration file. - - The path to the configuration file to parse. - - The name of the configuration section (if the is - application configuration format); or to use the default configuration - section name autofac or try the as a raw XML file. - - - A read/parsed based on the contents of the . - - - Thrown if is . - - - Thrown if is empty. - - - Thrown if the file indicated by can't be found. - - - Thrown if the configuration can't properly be deserialized from the file. - - - - - Checks the validity of a configuration file path and converts relative paths to absolute. - - - The file path to check/normalize. - - - If is an absolute path, it is returned unchanged; otherwise - it is made absolute relative to the current configuration location. - - - Thrown if is . - - - Thrown if is empty. - - - Thrown if the file indicated by can't be found. - - - - - Gets the components to be registered. - - - A with the list - of individual service components that should be registered. - - - - - Gets the default assembly to search for types in when not explicitly - provided with the type name. - - - An that should be used as the default assembly - in type searches. - - - - - Gets additional configuration files. - - - A with the list - of external/referenced configuration files. - - - - - Gets the modules to be registered. - - - A with the list - of modules that should be registered. - - - - - Element describing a service exposed by a component. - - - - - Gets the service type. - - The type. - - - - Gets the service name. - - The name. - - - - A collection of service elements. - - - - - Initializes a new instance of the class. - - - - - Some handy type conversion routines. - - - - - Does its best to convert whatever the value is into the destination - type. Null in yields null out for value types and the default(T) - for value types (this may change.) - - The value. - Type of the destination. - Reflected property or member info for the destination, if available, for retrieving custom type converter information. - An object of the destination type. - - - - Configuration for values in a list - - - - - Gets the key to be set (will be converted.) - - - - - Gets the value to be set (will be converted.) - - The value. - - - - Configures containers based upon XML configuration settings that are not stored in .NET application configuration. - - - - This module type uses raw XML files to initialize configuration settings. These files are expected to have XML - in them that can be deserialized into a . This XML is the same format - as you would see in a standard app.config/web.config for Autofac, but doesn't require the additional - configuration section definition or other .NET application configuration XML around it. - - - If you are storing your configuration settings in a .NET application configuration file - (app.config/web.config) you can use the - module to read the settings right out of the configuration file without having to manually parse the XML. - - - - - - - - Initializes a new instance of the class - using a specified XML configuration file. - - - The name of the configuration file containing XML that can deserialize into a . - - - Thrown if is . - - - Thrown if is empty. - - - - Relative paths may be specified in relation to the current application folder (where you would normally - find app.config or web.config). - - - - - - Extension methods for reflection-related types. - - - - - Maps from a property-set-value parameter to the declaring property. - - Parameter to the property setter. - The property info on which the setter is specified. - True if the parameter is a property setter. - - - + + + + Autofac.Configuration + + + + + Configures properties on other modules using settings from the appSettings section of + the configuration file. These can then be provided to component constructors as parameters + during registrations within the module. + + + The convention for the appSettings key is "Module.PropertyName" (e.g. Email.Pop3Host). + Modules should be named with a "Module" suffix (e.g. EmailModule). + + + + + Initializes a new instance of the class. + + The modules whose properties should be configured + using settings from the appSettings section of the configuration file. + + + + Override to add registrations to the container. + + The builder through which components can be registered. + + Note that the ContainerBuilder parameter is unique to this module. + + + + + Type converter used for converting assembly name strings to assembly and back. + + + + This type is used in configuration settings where an assembly name is provided and needs to be + handled on the back end as a strongly-typed, loaded assembly rather than a string. + + + + + + Converts an assembly name into an assembly. + + + The configuration context. + + + The configuration culture. + + + The assembly name to parse. + + + If is , empty, or whitespace this conversion + will return . Otherwise, the assembly specified by the + will be loaded and returned. + + + + + Converts an assembly into an assembly name. + + + The configuration context. + + + The configuration culture. + + + The assembly to convert. + + + The destination type to which the assembly should be converted. (Ignored for configuration converters.) + + + If is this conversion returns ; + otherwise the return value will be the full name of the assembly. + + + Thrown if is not and is not an . + + + + + Element describing a component registration. + + + + + Gets the type of the component. + + The type. + + + + Gets the service exposed by the component. For multiple-service components, + use the services element instead. + + The service. + + + + Allows the component to be added to another composite component. + + The name of the composite component. + + + + Allows the component to be added to another composite component. + + The name of the composite component. + + + + Sets the scope of the component instances. + + singleton (default,) factory or container. + + + + Sets the ownership over the component instances. + + container (default) or external. + + + + Sets up property injection for the component instances. This uses the + OnActivated event so that circular dependencies can be handled. + + never (default,) all, unset. + + + + Sets up auto activation for the component instances. + + no(default,) yes. + + + + Gets the services exposed by the component. + + The services. + + + + Gets the parameters used to construct the component. + + The parameters. + + + + Gets the properties to be explicitly set on the component. + + The explicit properties. + + + + Gets the extended properties associated with the registration. + + The extended properties. + + + + A collection of component elements. + + + + + A collection of configuration elements. + + The type of the element type. + + + + Initializes a new instance of the class. + + Name of the element. + + + + Indicates whether the specified exists in the . + + The name of the element to verify. + + true if the element exists in the collection; otherwise, false. The default is false. + + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + + + + When overridden in a derived class, creates a new . + + + A new . + + + + + Gets the element key for a specified configuration element when overridden in a derived class. + + The to return the key for. + + An that acts as the key for the specified . + + + + + Gets the name used to identify this collection of elements in the configuration file when overridden in a derived class. + + The name of the collection; otherwise, an empty string. The default is an empty string. + + + + Gets the type of the . + + The of this collection. + + + + Initializes a new instance of the class. + + + + + Base class for a configuration parsing/execution module. + + + + Derived module classes are responsible for reading in configuration settings and populating + the property. The + value there will be used in to + convert the configuration into container registrations. + + + + + + + + Executes the conversion of configuration data into component registrations. + + + The into which registrations will be placed. + + + + This override uses the + to convert the + into component registrations in the provided . + + + If no specific + is set, the default type will be used. + + + + Thrown if is . + + + Thrown if the is . + + + + + Gets or sets the configuration registrar. + + + An that will be used as the + strategy for converting the + into component registrations. If this value is , the registrar + will be a . + + + + + Gets the section handler. + + + The that will be converted into + component registrations in a container. + + + + + Default service for adding configured registrations to a container. + + + + This default implementation of + processes contents into registrations into + a . You may derive and override to extend the functionality + or you may implement your own . + + + + + + + A service for adding configured registrations to a container. + + + + + Registers the contents of a configuration section into a container builder. + + + The that should receive the configured registrations. + + + The containing the configured registrations. + + + + + Registers the contents of a configuration section into a container builder. + + + The that should receive the configured registrations. + + + The containing the configured registrations. + + + Thrown if or is . + + + + This method is the primary entry point to configuration section registration. From here, + the various modules, components, and referenced files get registered. You may override + any of those behaviors for a custom registrar if you wish to extend registration behavior. + + + + + + Registers individual configured components into a container builder. + + + The that should receive the configured registrations. + + + The containing the configured registrations. + + + Thrown if or is . + + + Thrown if there is any issue in parsing the component configuration into registrations. + + + + This is where the individually configured component registrations get added to the . + The collection from the + get processed into individual registrations with associated lifetime scope, name, etc. + + + You may influence the process by overriding this whole method or by overriding these individual + parsing subroutines: + + + + + + + + + + + + + + + + + Registers individual configured modules into a container builder. + + + The that should receive the configured registrations. + + + The containing the configured registrations. + + + Thrown if or is . + + + Thrown if there is any issue in parsing the module configuration into registrations. + + + + This is where the individually configured component registrations get added to the . + The collection from the + get processed into individual modules which are instantiated and activated inside the . + + + + + + Registers referenced configuration files into a container builder. + + + The that should receive the configured registrations. + + + The containing the configured registrations. + + + Thrown if or is . + + + Thrown if there is any issue in processing the referenced files into registrations. + + + + This is where external files referenced in configuration get recursively loaded and added to the . + The collection from the + get processed into individual instances, each of which get + registered with the . + + + + + + Sets the property injection mode for the component. + + + The component registration on which property injection mode is being set. + + + The configuration value associated with property + injection for this component registration. + + + + By default, this implementation understands , empty, + or values (false, 0, no) + to mean "no property injection should occur" and + values (true, 1, yes) to mean "property injection + should occur." + + + You may override this method to extend the available grammar for property injection settings. + + + + Thrown if is . + + + Thrown if the value for is not part of the + recognized grammar. + + + + + Sets the auto activation mode for the component. + + + The component registration on which auto activation mode is being set. + + + The configuration value associated with auto + activate for this component registration. + + + + By default, this implementation understands , empty, + or values (false, 0, no) + to mean "no property injection should occur" and + values (true, 1, yes) to mean "auto activation + should occur." + + + You may override this method to extend the available grammar for auto activation settings. + + + + Thrown if is . + + + Thrown if the value for is not part of the + recognized grammar. + + + + + Sets the ownership model for the component. + + + The component registration on which the ownership model is being set. + + + The configuration value associated with the + ownership model for this component registration. + + + + By default, this implementation understands or empty + values to be "default ownership model"; lifetime-scope or LifetimeScope + is "owned by lifetime scope"; and external or ExternallyOwned is + "externally owned." + + + You may override this method to extend the available grammar for component ownership. + + + + Thrown if is . + + + Thrown if the value for is not part of the + recognized grammar. + + + + + Sets the lifetime scope for the component. + + + The component registration on which the lifetime scope is being set. + + + The configuration value associated with the + lifetime scope for this component registration. + + + + By default, this implementation understands or empty + values to be "default ownership model"; single-instance or SingleInstance + is singleton; instance-per-lifetime-scope, InstancePerLifetimeScope, per-lifetime-scope, + or PerLifetimeScope is one instance per nested lifetime scope; and instance-per-dependency, + InstancePerDependency, per-dependency, or PerDependency is + one instance for each resolution call. + + + You may override this method to extend the available grammar for lifetime scope. + + + + Thrown if is . + + + Thrown if the value for is not part of the + recognized grammar. + + + + + Loads a type by name. + + + Name of the to load. This may be a partial type name or a fully-qualified type name. + + + The default to use in type resolution if + is a partial type name. + + + The resolved based on the specified name. + + + Thrown if is . + + + Thrown if is empty. + + + Thrown if the specified can't be resolved as a fully-qualified type name and + isn't a partial type name for a found in the . + + + + + Configures containers based upon app.config/web.config settings. + + + + This module type uses standard .NET application configuration format files to initialize configuration + settings. By default the standard app.config/web.config is used with a configuration + section named autofac, but you can use the various constructors to override the file location + or configuration section name. + + + If you are storing your configuration settings in a raw XML file (without the additional + <configuration /> wrapper and section definitions you normally see in .NET application + configuration) you can use the module to specify + the XML file location directly. + + + + + + + + Initializes a new instance of the class + using the default application configuration file with a configuration section named autofac. + + + + + Initializes a new instance of the class + using the default application configuration file and a named section. + + + The name of the configuration section corresponding to a . + + + + + Initializes a new instance of the class + using a named configuration file and section. + + + The name of the configuration section corresponding to a . + + + The app.config/web.config format configuration file containing the + named section. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to The {0} may not be empty.. + + + + + Looks up a localized string similar to Unable to find specified configuration file.. + + + + + Looks up a localized string similar to You must initialize the section handler on the module before executing the load operation.. + + + + + Looks up a localized string similar to No XML content nodes found in configuration. Check the XML reader to ensure configuration is in place.. + + + + + Looks up a localized string similar to The configuration section '{0}' could not be read.. + + + + + Looks up a localized string similar to If 'name' is specified, 'service' must also be specified (component name='{0}'.). + + + + + Looks up a localized string similar to Unable to convert object of type '{0}' to type '{1}'.. + + + + + Looks up a localized string similar to The type '{0}' specified in the TypeConverterAttribute is not a TypeConverter.. + + + + + Looks up a localized string similar to The type '{0}' could not be found. It may require assembly qualification, e.g. "MyType, MyAssembly".. + + + + + Looks up a localized string similar to The value '{0}' is not valid for the auto-activate attribute. Valid values are 'yes' and 'no'.. + + + + + Looks up a localized string similar to The value '{0}' is not valid for the inject-properties attribute. Valid values are 'yes' and 'no'.. + + + + + Looks up a localized string similar to The value '{0}' is not valid for the ownership attribute. Valid values are 'lifetime-scope' (the default) and 'external'.. + + + + + Looks up a localized string similar to The value '{0}' is not valid for the instance-scope attribute. Valid values are 'single-instance', 'per-dependency' (the default) and 'per-lifetime-scope'.. + + + + + Holds a dictionary of values for those properties/parameters that are a dictionary + + + + + Initializes a new instance of the class. + + + + + Helps convert the configuration element into an actuall generic list + + + + + Holds a list of values for those properties/parameters that are enumerable + + + + + Initializes a new instance of the class. + + + + + Helps convert the configuration element into an actual generic list + + + + + Helper methods used throughout the codebase. + + + + + Enforce that an argument is not null. Returns the + value if valid so that it can be used inline in + base initialiser syntax. + + + + + + + + + Element describing a component property. + + + + + Gets the name of the property. + + The name. + + + + Gets the value to be set (will be converted.) + + The value. + + + + Gets the type of the value. + + The type of the value. Defaults to string if not specified. + + + + Collection of extended property elements. + + + + + Base for multi-valued configuration elements. + + + + + + Initializes a new instance of the class. + + Name of the element. + The element key. + + + + Indicates whether the specified exists in the . + + The name of the element to verify. + + true if the element exists in the collection; otherwise, false. The default is false. + + + + + Creates a new . + + + A new . + + + + + Gets the element key for a specified configuration element when overridden in a derived class. + + The to return the key for. + + An that acts as the key for the specified . + + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + + + + Gets the name used to identify this collection of elements in the configuration file when overridden in a derived class. + + + The name of the collection; otherwise, an empty string. The default is an empty string. + + + + Gets the type of the . + + + The of this collection. + + + + Gets or sets the TElementType at the specified index. + + + + + + Initializes a new instance of the class. + + + + + Element describing an additional configuration file. + + + + + Gets the filename of the file. + + The filename. + + + + Gets the section name of the section in the configuration + file. + + The section name. + + + + A collection of file elements. + + + + + Initializes a new instance of the class. + + + + + Element describing a module registration. + + + + + Gets the type of the module. Must expose . + + The type. + + + + Gets the parameters used to construct the component. + + The parameters. + + + + Gets the properties to be explicitly set on the component. + + The explicit properties. + + + + A collection of module elements. + + + + + Initializes a new instance of the class. + + + + + Element describing a component constructor parameter. + + + + + Get the value of this element + + + + + + Gets the name of the parameter. + + The name. + + + + Gets the value used to set the parameter (type will be converted.) + + The value. + + + + If this parameter's value is a list of values + + + + + If this parameter's value is a dictionary + + + + + A collection of parameter elements. + + + + + Initializes a new instance of the class. + + + + + Convert to the Autofac parameter type. + + The parameters represented by this collection. + + + + Element describing a component property. + + + + + Get the value of this element + + + + + + Gets the name of the property. + + The name. + + + + Gets the value to be set (will be converted.) + + The value. + + + + If this property's value is a list of values + + + + + If this property's value is a dictionary + + + + + Collection of property elements. + + + + + Initializes a new instance of the class. + + + + + Convert to the Autofac parameter type. + + The parameters represented by this collection. + + + + Section handler for Autofac configuration. + + + + This configuration section is used for XML-based configuration of an Autofac + container. While it is primarily used from inside app.config or web.config + files, you may also use it with other arbitrary XML files via the + helper method. + + + + + + The default section name that will be searched for. + + + + + Deserializes a configuration section handler from a specific block of XML. + + + The used to read the XML configuration from the source. + + + A read/parsed based on the contents of the . + + + Thrown if is . + + + Thrown if does not contain XML configuration that can be parsed into + a . + + + + + Deserializes a configuration section handler from an XML configuration file. + + The path to the configuration file to parse. + + A read/parsed based on the contents of the . + + + Thrown if is . + + + Thrown if is empty. + + + Thrown if the file indicated by can't be found. + + + Thrown if the configuration can't properly be deserialized from the file. + + + + + Deserializes a configuration section handler from an XML configuration file. + + The path to the configuration file to parse. + + The name of the configuration section (if the is + application configuration format); or to use the default configuration + section name autofac or try the as a raw XML file. + + + A read/parsed based on the contents of the . + + + Thrown if is . + + + Thrown if is empty. + + + Thrown if the file indicated by can't be found. + + + Thrown if the configuration can't properly be deserialized from the file. + + + + + Checks the validity of a configuration file path and converts relative paths to absolute. + + + The file path to check/normalize. + + + If is an absolute path, it is returned unchanged; otherwise + it is made absolute relative to the current configuration location. + + + Thrown if is . + + + Thrown if is empty. + + + Thrown if the file indicated by can't be found. + + + + + Gets the components to be registered. + + + A with the list + of individual service components that should be registered. + + + + + Gets the default assembly to search for types in when not explicitly + provided with the type name. + + + An that should be used as the default assembly + in type searches. + + + + + Gets additional configuration files. + + + A with the list + of external/referenced configuration files. + + + + + Gets the modules to be registered. + + + A with the list + of modules that should be registered. + + + + + Element describing a service exposed by a component. + + + + + Gets the service type. + + The type. + + + + Gets the service name. + + The name. + + + + A collection of service elements. + + + + + Initializes a new instance of the class. + + + + + Some handy type conversion routines. + + + + + Does its best to convert whatever the value is into the destination + type. Null in yields null out for value types and the default(T) + for value types (this may change.) + + The value. + Type of the destination. + Reflected property or member info for the destination, if available, for retrieving custom type converter information. + An object of the destination type. + + + + Configuration for values in a list + + + + + Gets the key to be set (will be converted.) + + + + + Gets the value to be set (will be converted.) + + The value. + + + + Configures containers based upon XML configuration settings that are not stored in .NET application configuration. + + + + This module type uses raw XML files to initialize configuration settings. These files are expected to have XML + in them that can be deserialized into a . This XML is the same format + as you would see in a standard app.config/web.config for Autofac, but doesn't require the additional + configuration section definition or other .NET application configuration XML around it. + + + If you are storing your configuration settings in a .NET application configuration file + (app.config/web.config) you can use the + module to read the settings right out of the configuration file without having to manually parse the XML. + + + + + + + + Initializes a new instance of the class + using a specified XML configuration file. + + + The name of the configuration file containing XML that can deserialize into a . + + + Thrown if is . + + + Thrown if is empty. + + + + Relative paths may be specified in relation to the current application folder (where you would normally + find app.config or web.config). + + + + + + Extension methods for reflection-related types. + + + + + Maps from a property-set-value parameter to the declaring property. + + Parameter to the property setter. + The property info on which the setter is specified. + True if the parameter is a property setter. + + + diff --git a/lib/autofac/Autofac.XML b/lib/autofac/Autofac.XML index bf18e21a48b..0b2a8808a13 100644 --- a/lib/autofac/Autofac.XML +++ b/lib/autofac/Autofac.XML @@ -1,6923 +1,6923 @@ - - - - Autofac - - - - - Service used as a "flag" to indicate a particular component should be - automatically activated on container build. - - - - - Services are the lookup keys used to locate component instances. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Implements the operator ==. - - The left operand. - The right operand. - The result of the operator. - - - - Implements the operator !=. - - The left operand. - The right operand. - The result of the operator. - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - true if the specified is equal to the current ; otherwise, false. - - The parameter is null. - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Gets a human-readable description of the service. - - The description. - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - if the specified is not - and is an ; otherwise, . - - - - All services of this type are considered "equal." - - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . Always 0 for this type. - - - - All services of this type are considered "equal" and use the same hash code. - - - - - - Gets the service description. - - - Always returns AutoActivate. - - - - - Used with the WithMetadata configuration method to - associate key-value pairs with an . - - Interface with properties whose names correspond to - the property keys. - This feature was suggested by OJ Reeves (@TheColonial). - - - - Set one of the property values. - - The type of the property. - An expression that accesses the property to set. - The property value to set. - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Cannot choose between multiple constructors with equal length {0} on type '{1}'. Select the constructor explicitly, with the UsingConstructor() configuration method, when the component is registered.. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to {0} ---> {1} (See inner exception for details.). - - - - - Well-known tags used in setting up matching lifetime scopes. - - - - - Tag used in setting up per-request lifetime scope registrations - (e.g., per-HTTP-request or per-API-request). - - - - - Interface providing fluent syntax for chaining module registrations. - - - - - Add a module to the container. - - The module to add. - - The to allow - additional chained module registrations. - - - - - Basic implementation of the - interface allowing registration of modules into a - in a fluent format. - - - - - The into which registrations will be made. - - - - - Initializes a new instance of the class. - - - The into which registrations will be made. - - - Thrown if is . - - - - - Add a module to the container. - - The module to add. - - The to allow - additional chained module registrations. - - - Thrown if is . - - - - - Support the System.Lazy<T, TMetadata> - types automatically whenever type T is registered with the container. - Metadata values come from the component registration's metadata. - When a dependency of a lazy type is used, the instantiation of the underlying - component will be delayed until the Value property is first accessed. - - - - - Allows registrations to be made on-the-fly when unregistered - services are requested (lazy registrations.) - - - - - Retrieve registrations for an unregistered service, to be used - by the container. - - The service that was requested. - A function that will return existing registrations for a service. - Registrations providing the service. - - If the source is queried for service s, and it returns a component that implements both s and s', then it - will not be queried again for either s or s'. This means that if the source can return other implementations - of s', it should return these, plus the transitive closure of other components implementing their - additional services, along with the implementation of s. It is not an error to return components - that do not implement . - - - - - Gets whether the registrations provided by this source are 1:1 adapters on top - of other components (I.e. like Meta, Func or Owned.) - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Lazy<T, TMetadata> Support. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The type '{0}' cannot be used as a metadata view. A metadata view must be a concrete class with a parameterless or dictionary constructor.. - - - - - Looks up a localized string similar to Export metadata for '{0}' is missing and no default value was supplied.. - - - - - Provides a value along with metadata describing the value. - - The type of the value. - An interface to which metadata values can be bound. - - - - Create a new instance. - - The value described by the instance. - The metadata describing the value. - - - - The value described by . - - - - - Metadata describing the value. - - - - - Support the - types automatically whenever type T is registered with the container. - Metadata values come from the component registration's metadata. - - - - - Finds constructors that match a finder function. - - - - - Find suitable constructors from which to select. - - - - - Finds suitable constructors on the target type. - - Type to search for constructors. - Suitable constructors. - - - - Initializes a new instance of the class. - - - Default to selecting all public constructors. - - - - - Initializes a new instance of the class. - - The finder function. - - - - Finds suitable constructors on the target type. - - Type to search for constructors. - Suitable constructors. - - - - Extension methods for configuring the . - - - - - Fluent method for setting the registration configuration on . - - The registration source to configure. - A configuration action that will run on any registration provided by the source. - - The with the registration configuration set. - - - - - Extension methods for registering instances with a container. - - - - - Registers modules found in an assembly. - - The builder to register the modules with. - The assemblies from which to register modules. - - Thrown if is . - - - The to allow - additional chained module registrations. - - - - - Registers modules found in an assembly. - - The module registrar that will make the registrations into the container. - The assemblies from which to register modules. - - Thrown if is . - - - The to allow - additional chained module registrations. - - - - - Registers modules found in an assembly. - - The builder to register the modules with. - The assemblies from which to register modules. - The type of the module to add. - - Thrown if is . - - - The to allow - additional chained module registrations. - - - - - Registers modules found in an assembly. - - The module registrar that will make the registrations into the container. - The assemblies from which to register modules. - The type of the module to add. - - Thrown if is . - - - The to allow - additional chained module registrations. - - - - - Registers modules found in an assembly. - - The builder to register the modules with. - The of the module to add. - The assemblies from which to register modules. - - Thrown if or is . - - - The to allow - additional chained module registrations. - - - - - Registers modules found in an assembly. - - The module registrar that will make the registrations into the container. - The of the module to add. - The assemblies from which to register modules. - - Thrown if or is . - - - The to allow - additional chained module registrations. - - - - - Add a module to the container. - - The builder to register the module with. - The module to add. - - Thrown if is . - - - The to allow - additional chained module registrations. - - - - - Add a module to the container. - - The module registrar that will make the registration into the container. - The module to add. - - Thrown if is . - - - The to allow - additional chained module registrations. - - - - - Add a module to the container. - - The builder to register the module with. - The module to add. - - Thrown if or is . - - - The to allow - additional chained module registrations. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Module.ThisAssembly is only available in modules that inherit directly from Module.. - - - - - Support the - type automatically whenever type T is registered with the container. - When a dependency of a lazy type is used, the instantiation of the underlying - component will be delayed until the Value property is first accessed. - - - - - Generates context-bound closures that represent factories from - a set of heuristics based on delegate type signatures. - - - - - Create a factory generator. - - The service that will be activated in - order to create the products of the factory. - The delegate to provide as a factory. - The parameter mapping mode to use. - - - - Create a factory generator. - - The component that will be activated in - order to create the products of the factory. - The delegate to provide as a factory. - The parameter mapping mode to use. - - - - Generates a factory delegate that closes over the provided context. - - The context in which the factory will be used. - Parameters provided to the resolve call for the factory itself. - A factory delegate that will work within the context. - - - - Generates a factory delegate that closes over the provided context. - - The context in which the factory will be used. - Parameters provided to the resolve call for the factory itself. - A factory delegate that will work within the context. - - - - Reflection activator data for concrete types. - - - - - Builder for reflection-based activators. - - - - - Specify a reflection activator for the given type. - - Type that will be activated. - - - - Get the implementation type. - - - - - The constructor finder for the registration. - - - - - The constructor selector for the registration. - - - - - The explicitly bound constructor parameters. - - - - - The explicitly bound properties. - - - - - Activator data that can provide an IInstanceActivator instance. - - - - - The instance activator based on the provided data. - - - - - Specify a reflection activator for the given type. - - Type that will be activated. - - - - The instance activator based on the provided data. - - - - - Parameterises the construction of a container by a . - - - - - No options - the default behavior for container building. - - - - - Prevents inclusion of standard modules like support for - relationship types including etc. - - - - - Does not call on components implementing - this interface (useful for module testing.) - - - - - Data structure used to construct registrations. - - The most specific type to which instances of the registration - can be cast. - Activator builder type. - Registration style type. - - - - Configure the component so that instances are never disposed by the container. - - A registration builder allowing further configuration of the component. - - - - Configure the component so that instances that support IDisposable are - disposed by the container (default.) - - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - gets a new, unique instance (default.) - - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - gets the same, shared instance. - - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - within a single ILifetimeScope gets the same, shared instance. Dependent components in - different lifetime scopes will get different instances. - - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() within - a ILifetimeScope tagged with any of the provided tags value gets the same, shared instance. - Dependent components in lifetime scopes that are children of the tagged scope will - share the parent's instance. If no appropriately tagged scope can be found in the - hierarchy an is thrown. - - Tag applied to matching lifetime scopes. - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - within a ILifetimeScope created by an owned instance gets the same, shared instance. - Dependent components in lifetime scopes that are children of the owned instance scope will - share the parent's instance. If no appropriate owned instance scope can be found in the - hierarchy an is thrown. - - Service type. - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - within a ILifetimeScope created by an owned instance gets the same, shared instance. - Dependent components in lifetime scopes that are children of the owned instance scope will - share the parent's instance. If no appropriate owned instance scope can be found in the - hierarchy an is thrown. - - Service type. - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - within a ILifetimeScope created by an owned instance gets the same, shared instance. - Dependent components in lifetime scopes that are children of the owned instance scope will - share the parent's instance. If no appropriate owned instance scope can be found in the - hierarchy an is thrown. - - The service type provided by the component. - Key to associate with the component. - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - within a ILifetimeScope created by an owned instance gets the same, shared instance. - Dependent components in lifetime scopes that are children of the owned instance scope will - share the parent's instance. If no appropriate owned instance scope can be found in the - hierarchy an is thrown. - - Key to associate with the component. - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Configure the services that the component will provide. The generic parameter(s) to As() - will be exposed as TypedService instances. - - Service type. - A registration builder allowing further configuration of the component. - - - - Configure the services that the component will provide. The generic parameter(s) to As() - will be exposed as TypedService instances. - - Service type. - Service type. - A registration builder allowing further configuration of the component. - - - - Configure the services that the component will provide. The generic parameter(s) to As() - will be exposed as TypedService instances. - - Service type. - Service type. - Service type. - A registration builder allowing further configuration of the component. - - - - Configure the services that the component will provide. - - Service types to expose. - A registration builder allowing further configuration of the component. - - - - Configure the services that the component will provide. - - Services to expose. - A registration builder allowing further configuration of the component. - - - - Provide a textual name that can be used to retrieve the component. - - Named service to associate with the component. - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Provide a textual name that can be used to retrieve the component. - - Named service to associate with the component. - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Provide a key that can be used to retrieve the component. - - Key to associate with the component. - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Provide a key that can be used to retrieve the component. - - Key to associate with the component. - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Add a handler for the Preparing event. This event allows manipulating of the parameters - that will be provided to the component. - - The event handler. - A registration builder allowing further configuration of the component. - - - - Add a handler for the Activating event. - - The event handler. - A registration builder allowing further configuration of the component. - - - - Add a handler for the Activated event. - - The event handler. - A registration builder allowing further configuration of the component. - - - - Configure the component so that any properties whose types are registered in the - container will be wired to instances of the appropriate service. - - Set wiring options such as circular dependency wiring support. - A registration builder allowing further configuration of the component. - - - - Associates data with the component. - - Key by which the data can be located. - The data value. - A registration builder allowing further configuration of the component. - - - - Associates data with the component. - - The extended properties to associate with the component. - A registration builder allowing further configuration of the component. - - - - Associates data with the component. - - A type with properties whose names correspond to the - property names to configure. - A registration builder allowing further configuration of the component. - - - - The activator data. - - - - - The registration style. - - - - - The registration data. - - - - - Delegates registration lookups to a specified registry. When write operations are applied, - initialises a new 'writeable' registry. - - - Safe for concurrent access by multiple readers. Write operations are single-threaded. - - - - - Provides component registrations according to the services they provide. - - - - - Attempts to find a default registration for the specified service. - - The service to look up. - The default registration for the service. - True if a registration exists. - - - - Determines whether the specified service is registered. - - The service to test. - True if the service is registered. - - - - Register a component. - - The component registration. - - - - Register a component. - - The component registration. - If true, existing defaults for the services provided by the - component will not be changed. - - - - Selects from the available registrations after ensuring that any - dynamic registration sources that may provide - have been invoked. - - The service for which registrations are sought. - Registrations supporting . - - - - Add a registration source that will provide registrations on-the-fly. - - The source to register. - - - - Enumerate the registered components. - - - - - Fired whenever a component is registered - either explicitly or via a - . - - - - - Gets the registration sources that are used by the registry. - - - - - True if the registry contains its own components; false if it is forwarding - registrations from another external registry. - - This property is used when walking up the scope tree looking for - registrations for a new customised scope. (See issue 336.) - - - - Fired when an is added to the registry. - - - - - Enables contravariant Resolve() for interfaces that have a single contravariant ('in') parameter. - - - interface IHandler<in TCommand> - { - void Handle(TCommand command); - } - - class Command { } - - class DerivedCommand : Command { } - - class CommandHandler : IHandler<Command> { ... } - - var builder = new ContainerBuilder(); - builder.RegisterSource(new ContravariantRegistrationSource()); - builder.RegisterType<CommandHandler>(); - var container = builder.Build(); - // Source enables this line, even though IHandler<Command> is the - // actual registered type. - var handler = container.Resolve<IHandler<DerivedCommand>>(); - handler.Handle(new DerivedCommand()); - - - - - Retrieve registrations for an unregistered service, to be used - by the container. - - The service that was requested. - A function that will return existing registrations for a service. - Registrations providing the service. - - If the source is queried for service s, and it returns a component that implements both s and s', then it - will not be queried again for either s or s'. This means that if the source can return other implementations - of s', it should return these, plus the transitive closure of other components implementing their - additional services, along with the implementation of s. It is not an error to return components - that do not implement . - - - - - Gets whether the registrations provided by this source are 1:1 adapters on top - of other components (I.e. like Meta, Func or Owned.) - - - - - Options that can be applied when autowiring properties on a component. (Multiple options can - be specified using bitwise 'or' - e.g. AllowCircularDependencies | PreserveSetValues. - - - - - Default behavior. Circular dependencies are not allowed; existing non-default - property values are overwritten. - - - - - Allows property-property and property-constructor circular dependency wiring. - This flag moves property wiring from the Activating to the Activated event. - - - - - If specified, properties that already have a non-default value will be left - unchanged in the wiring operation. - - - - - Static factory methods to simplify the creation and handling of IRegistrationBuilder{L,A,R}. - - - To create an for a specific type, use: - - var cr = RegistrationBuilder.ForType(t).CreateRegistration(); - - The full builder syntax is supported: - - var cr = RegistrationBuilder.ForType(t).Named("foo").ExternallyOwned().CreateRegistration(); - - - - - - Creates a registration builder for the provided delegate. - - Instance type returned by delegate. - Delegate to register. - A registration builder. - - - - Creates a registration builder for the provided delegate. - - Delegate to register. - Most specific type return value of delegate can be cast to. - A registration builder. - - - - Creates a registration builder for the provided type. - - Implementation type to register. - A registration builder. - - - - Creates a registration builder for the provided type. - - Implementation type to register. - A registration builder. - - - - Create an from a . - (There is no need to call - this method when registering components through a .) - - - When called on the result of one of the methods, - the returned registration will be different from the one the builder itself registers - in the container. - - - - var registration = RegistrationBuilder.ForType<Foo>().CreateRegistration(); - - - - - - The registration builder. - An IComponentRegistration. - - Thrown if is . - - - - - Create an IComponentRegistration from data. - - Id of the registration. - Registration data. - Activator. - Services provided by the registration. - An IComponentRegistration. - - - - Create an IComponentRegistration from data. - - Id of the registration. - Registration data. - Activator. - Services provided by the registration. - Optional; target registration. - An IComponentRegistration. - - Thrown if or is . - - - - - Register a component in the component registry. This helper method is necessary - in order to execute OnRegistered hooks and respect PreserveDefaults. - - Hoping to refactor this out. - - - - Component registry to make registration in. - Registration builder with data for new registration. - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The type '{0}' is not assignable to service '{1}'.. - - - - - Adds registration syntax for less commonly-used features. - - - These features are in this namespace because they will remain accessible to - applications originally written against Autofac 1.4. In Autofac 2, this functionality - is implicitly provided and thus making explicit registrations is rarely necessary. - - - - - Registers a factory delegate. - - Container builder. - Factory type to generate. - Registration builder allowing the registration to be configured. - Factory delegates are provided automatically in Autofac 2, - and this method is generally not required. - - - - Registers a factory delegate. - - Container builder. - Factory type to generate. - The service that the delegate will return instances of. - Registration builder allowing the registration to be configured. - Factory delegates are provided automatically in Autofac 2, and - this method is generally not required. - - - - Registers a factory delegate. - - The type of the delegate. - Container builder. - The service that the delegate will return instances of. - Registration builder allowing the registration to be configured. - Factory delegates are provided automatically in Autofac 2, - and this method is generally not required. - - - - Registers a factory delegate. - - The type of the delegate. - Container builder. - Registration builder allowing the registration to be configured. - Factory delegates are provided automatically in Autofac 2, - and this method is generally not required. - - - - Changes the parameter mapping mode of the supplied delegate type to match - parameters by name. - - Factory delegate type - Activator data type - Registration style - Registration to change parameter mapping mode of. - Registration builder allowing the registration to be configured. - - Thrown if is . - - - - - Changes the parameter mapping mode of the supplied delegate type to match - parameters by position. - - Factory delegate type - Activator data type - Registration style - Registration to change parameter mapping mode of. - Registration builder allowing the registration to be configured. - - Thrown if is . - - - - - Changes the parameter mapping mode of the supplied delegate type to match - parameters by type. - - Factory delegate type - Activator data type - Registration style - Registration to change parameter mapping mode of. - Registration builder allowing the registration to be configured. - - Thrown if is . - - - - - Registers the type as a collection. If no services or names are specified, the - default services will be IList<T>, ICollection<T>, and IEnumerable<T> - - The type of the collection elements. - Container builder. - A unique name for the collection that can be passed to MemberOf(). - Registration builder allowing the registration to be configured. - Collections are provided automatically in Autofac 2, - and this method is generally not required. - - - - Registers the type as a collection. If no services or names are specified, the - default services will be IList<T>, ICollection<T>, and IEnumerable<T> - - The type of the collection elements. - Container builder. - A unique name for the collection that can be passed to MemberOf(). - Registration builder allowing the registration to be configured. - Collections are provided automatically in Autofac 2, - and this method is generally not required. - - - - Include the element explicitly in a collection configured using RegisterCollection. - - Registration limit type. - Registration style. - Activator data type. - Registration to export. - The collection name, as passed to RegisterCollection. - A registration builder allowing further configuration of the component. - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Build() or Update() can only be called once on a ContainerBuilder.. - - - - - Looks up a localized string similar to An error occurred while attempting to automatically activate registration '{0}'. See the inner exception for information on the source of the failure.. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to A delegate registered to create instances of '{0}' returned null.. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Bound constructor '{0}'.. - - - - - Looks up a localized string similar to The binding cannot be instantiated.. - - - - - Looks up a localized string similar to An exception was thrown while invoking the constructor '{0}' on type '{1}'.. - - - - - Looks up a localized string similar to Cannot resolve parameter '{1}' of constructor '{0}'.. - - - - - Provides parameters that have a default value, set with an optional parameter - declaration in C# or VB. - - - - - Used in order to provide a value to a constructor parameter or property on an instance - being created by the container. - - - Not all parameters can be applied to all sites. - - - - - Returns true if the parameter is able to provide a value to a particular site. - - Constructor, method, or property-mutator parameter. - The component context in which the value is being provided. - If the result is true, the valueProvider parameter will - be set to a function that will lazily retrieve the parameter value. If the result is false, - will be set to null. - True if a value can be supplied; otherwise, false. - - - - Returns true if the parameter is able to provide a value to a particular site. - - Constructor, method, or property-mutator parameter. - The component context in which the value is being provided. - If the result is true, the valueProvider parameter will - be set to a function that will lazily retrieve the parameter value. If the result is false, - will be set to null. - True if a value can be supplied; otherwise, false. - - Thrown if is . - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The container's self-registration of context interfaces should never be activated as it is hard-wired into the LifetimeScope class.. - - - - - Marks a module as container-aware (for the purposes of attaching to diagnostic events.) - - - - - Initialise the module with the container into which it is being registered. - - The container. - - - - Fired when the activation process for a new instance is complete. - - - - - The context in which the activation occurred. - - - - - The component providing the instance. - - - - - The paramters provided when resolved. - - - - - The instance that will be used to satisfy the request. - - - - - Fired after the construction of an instance but before that instance - is shared with any other or any members are invoked on it. - - - - - The instance can be replaced if needed, e.g. by an interface proxy. - - The object to use instead of the activated instance. - - - - The context in which the activation occurred. - - - - - The component providing the instance. - - - - - The instance that will be used to satisfy the request. - - - - - The parameters supplied to the activator. - - - - - Interface supported by services that carry type information. - - - - - Return a new service of the same kind, but carrying - as the . - - The new service type. - A new service with the service type. - - - - Gets the type of the service. - - The type of the service. - - - - Identifies a service using a key in addition to its type. - - - - - Initializes a new instance of the class. - - Key of the service. - Type of the service. - - - - Indicates whether the current object is equal to another object of the same type. - - An object to compare with this object. - - true if the current object is equal to the parameter; otherwise, false. - - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - true if the specified is equal to the current ; otherwise, false. - - The parameter is null. - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Return a new service of the same kind, but carrying - as the . - - The new service type. - A new service with the service type. - - - - Gets or sets the key of the service. - - The key of the service. - - - - Gets the type of the service. - - The type of the service. - - - - Gets a human-readable description of the service. - - The description. - - - - Describes when a lifetime scope is beginning. - - - - - Create an instance of the class. - - The lifetime scope that is beginning. - - - - The lifetime scope that is beginning. - - - - - Describes when a lifetime scope is ending. - - - - - Create an instance of the class. - - The lifetime scope that is ending. - - - - The lifetime scope that is ending. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it has already been disposed.. - - - - - Fired when an is added to the registry. - - - - - Construct an instance of the class. - - The registry to which the source was added. - The source that was added. - - - - - The registry to which the source was added. - - - - - The source that was added. - - - - - Represents the process of finding a component during a resolve operation. - - - - - The component for which an instance is to be looked up. - - - - - The scope in which the instance will be looked up. - - - - - The parameters provided for new instance creation. - - - - - Raised when the lookup phase of the operation is ending. - - - - - Raised when the completion phase of an instance lookup operation begins. - - - - - Raised when the completion phase of an instance lookup operation ends. - - - - - Raised when the completion phase of an instance lookup operation begins. - - - - - Create an instance of the class. - - The instance lookup that is beginning the completion phase. - - - - The instance lookup operation that is beginning the completion phase. - - - - - Raised when the completion phase of an instance lookup operation ends. - - - - - Create an instance of the class. - - The instance lookup that is ending the completion phase. - - - - The instance lookup operation that is ending the completion phase. - - - - - Fired when an instance is looked up. - - - - - Create an instance of the class. - - The instance lookup that is ending. - True if a new instance was created as part of the operation. - - - - True if a new instance was created as part of the operation. - - - - - The instance lookup operation that is ending. - - - - - Fired when instance lookup is complete. - - - - The instance lookup that is ending. - - - - The instance lookup operation that is beginning. - - - - - Describes the commencement of a new resolve operation. - - - - - Create an instance of the class. - - The resolve operation that is beginning. - - - - The resolve operation that is beginning. - - - - - Wraps a component registration, switching its lifetime. - - - - - Base class for disposable objects. - - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Returns true if the current instance has been disposed; otherwise false; - - - - - Describes a logical component within the container. - - - - - Called by the container when an instance is required. - - The context in which the instance will be activated. - Parameters for activation. These may be modified by the event handler. - - - - Called by the container once an instance has been constructed. - - The context in which the instance was activated. - The parameters supplied to the activator. - The instance. - - - - Called by the container once an instance has been fully constructed, including - any requested objects that depend on the instance. - - The context in which the instance was activated. - The parameters supplied to the activator. - The instance. - - - - A unique identifier for this component (shared in all sub-contexts.) - This value also appears in Services. - - - - - The activator used to create instances. - - - - - The lifetime associated with the component. - - - - - Whether the component instances are shared or not. - - - - - Whether the instances of the component should be disposed by the container. - - - - - The services provided by the component. - - - - - Additional data associated with the component. - - - - - The component registration upon which this registration is based. - - - - - Fired when a new instance is required. The instance can be - provided in order to skip the regular activator, by setting the Instance property in - the provided event arguments. - - - - - Fired when a new instance is being activated. The instance can be - wrapped or switched at this time by setting the Instance property in - the provided event arguments. - - - - - Fired when the activation process for a new instance is complete. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Activator = {0}, Services = [{1}], Lifetime = {2}, Sharing = {3}, Ownership = {4}. - - - - - Pulls registrations from another component registry. - Excludes most auto-generated registrations - currently has issues with - collection registrations. - - - - - Create an external registry source that draws components from - . - - Component registry to pull registrations from. - - - - Retrieve registrations for an unregistered service, to be used - by the container. - - The service that was requested. - A function that will return existing registrations for a service. - Registrations providing the service. - - - - In this case because the components that are adapted do not come from the same - logical scope, we must return false to avoid duplicating them. - - - - - Switches components with a RootScopeLifetime (singletons) with - decorators exposing MatchingScopeLifetime targeting the specified scope. - - - - - Maps services onto the components that provide them. - - - The component registry provides services directly from components, - and also uses to generate components - on-the-fly or as adapters for other components. A component registry - is normally used through a , and not - directly by application code. - - - - - Protects instance variables from concurrent access. - - - - - External registration sources. - - - - - All registrations. - - - - - Keeps track of the status of registered services. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Attempts to find a default registration for the specified service. - - The service to look up. - The default registration for the service. - True if a registration exists. - - - - Determines whether the specified service is registered. - - The service to test. - True if the service is registered. - - - - Register a component. - - The component registration. - - - - Register a component. - - The component registration. - If true, existing defaults for the services provided by the - component will not be changed. - - - - Selects from the available registrations after ensuring that any - dynamic registration sources that may provide - have been invoked. - - The service for which registrations are sought. - Registrations supporting . - - - - Add a registration source that will provide registrations on-the-fly. - - The source to register. - - - - Enumerate the registered components. - - - - - Fired whenever a component is registered - either explicitly or via a - . - - - - - Gets the registration sources that are used by the registry. - - - - - True if the registry contains its own components; false if it is forwarding - registrations from another external registry. - - This property is used when walking up the scope tree looking for - registrations for a new customised scope. (See issue 336.) - - - - Fired when an is added to the registry. - - - - - Tracks the services known to the registry. - - - - - Used for bookkeeping so that the same source is not queried twice (may be null.) - - - - - Initializes a new instance of the class. - - The tracked service. - - - - The first time a service is requested, initialization (e.g. reading from sources) - happens. This value will then be set to true. Calling many methods on this type before - initialisation is an error. - - - - - The known implementations. - - - - - True if any implementations are known. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The operation is only valid during initialization.. - - - - - Looks up a localized string similar to The operation is not valid until the object is initialized.. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The activation has already been executed.. - - - - - Describes the commencement of a new resolve operation. - - - - - Create an instance of the class. - - The resolve operation that is ending. - If included, the exception causing the operation to end; otherwise, null. - - - - The exception causing the operation to end, or null. - - - - - The resolve operation that is ending. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Subclasses of Autofac.Service must override Object.Equals(). - - - - - Looks up a localized string similar to Subclasses of Autofac.Service must override Object.GetHashCode(). - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Collection Support (Arrays and Generic Collection Interfaces). - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Lazy<T> Support. - - - - - Describes the basic requirements for generating a lightweight adapter. - - - - - Create an instance of . - - The service that will be adapted from. - The adapter function. - - - - The adapter function. - - - - - The service to be adapted from. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Lightweight Adapter from {0} to {1}. - - - - - Looks up a localized string similar to The service {0} cannot be both the adapter's from and to parameters - these must differ.. - - - - - Internal implementation of the RegisterCollection/MemberOf-style collection feature. - - - - - Registration style for dynamic registrations. - - - - - Data used to create factory activators. - - - - - Create a new GeneratedFactoryActivatorData - - The type of the factory. - The service used to provide the products of the factory. - - - - Determines how the parameters of the delegate type are passed on - to the generated Resolve() call as Parameter objects. - For Func-based delegates, this defaults to ByType. Otherwise, the - parameters will be mapped by name. - - - - - Activator data that can provide an IInstanceActivator instance. - - - - - Hides standard Object members to make fluent interfaces - easier to read. - Based on blog post by @kzu here: - http://www.clariusconsulting.net/blogs/kzu/archive/2008/03/10/58301.aspx - - - - - Standard System.Object member. - - Standard result. - - - - Standard System.Object member. - - Standard result. - - - - Standard System.Object member. - - Standard result. - - - - Standard System.Object member. - - The other. - Standard result. - - - - Determines how the parameters of the delegate type are passed on - to the generated Resolve() call as Parameter objects. - - - - - Chooses parameter mapping based on the factory type. - For Func-based factories this is equivalent to ByType, for all - others ByName will be used. - - - - - Pass the parameters supplied to the delegate through to the - underlying registration as NamedParameters based on the parameter - names in the delegate type's formal argument list. - - - - - Pass the parameters supplied to the delegate through to the - underlying registration as TypedParameters based on the parameter - types in the delegate type's formal argument list. - - - - - Pass the parameters supplied to the delegate through to the - underlying registration as PositionalParameters based on the parameter - indices in the delegate type's formal argument list. - - - - - Provides components by lookup operations via an index (key) type. - - The type of the index. - The service provided by the indexed components. - - Retrieving a value given a key: - - IIndex<AccountType, IRenderer> accountRenderers = // ... - var renderer = accountRenderers[AccountType.User]; - - - - - - Get the value associated with if any is available. - - The key to look up. - The retrieved value. - True if a value associated with the key exists. - - - - Get the value associated with . - - The value to retrieve. - The associated value. - - - - - - - - - - - - - Support the - types automatically whenever type T is registered with the container. - Metadata values come from the component registration's metadata. - - - - - Provides a value along with a dictionary of metadata describing the value. - - The type of the value. - - - - Create a new instance. - - The value described by the instance. - The metadata describing the value. - - - - The value described by . - - - - - Metadata describing the value. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Meta<T> Support. - - - - - Looks up a localized string similar to Meta<T, TMetadata> Support. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The service '{0}' is not an open generic type.. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to {0} providing {1}. - - - - - Describes the activator for an open generic decorator. - - - - - Construct an . - - The decorator type. - The open generic service type to decorate. - - - - The open generic service type to decorate. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The service {0} cannot be both the adapter's from and to parameters - these must differ.. - - - - - Looks up a localized string similar to Open Generic Decorator {0} from {1} to {2}. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The type {0} is not an open generic type definition.. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The type '{0}' does not implement the interface '{1}'.. - - - - - Looks up a localized string similar to The implementation type '{0}' is not an open generic type definition.. - - - - - Looks up a localized string similar to The implementation type '{0}' does not support the interface '{1}'.. - - - - - Looks up a localized string similar to The service '{0}' is not an open generic type definition.. - - - - - Looks up a localized string similar to The service '{1}' is not assignable from implementation type '{0}'.. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Owned<T> Support. - - - - - Provides registrations on-the-fly for any concrete type not already registered with - the container. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - A predicate that selects types the source will register. - - - - Retrieve registrations for an unregistered service, to be used - by the container. - - The service that was requested. - A function that will return existing registrations for a service. - Registrations providing the service. - - - - Returns a that represents the current . - - - A that represents the current . - - 2 - - - - Gets whether the registrations provided by this source are 1:1 adapters on top - of other components (I.e. like Meta, Func or Owned.) - - - - - Gets or sets an expression used to configure generated registrations. - - - A that can be used to modify the behavior - of registrations that are generated by this source. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to "Resolve Anything" Support. - - - - - Activation data for types located by scanning assemblies. - - - - - Create an instance of . - - - - - The filters applied to the types from the scanned assembly. - - - - - Additional actions to be performed on the concrete type registrations. - - - - - Actions to be called once the scanning operation is complete. - - - - - Fired when the activation process for a new instance is complete. - - - - - Initializes a new instance of the class. - - The context. - The component. - The parameters. - The instance. - - - - The context in which the activation occurred. - - - - - The component providing the instance. - - - - - The paramters provided when resolved. - - - - - The instance that will be used to satisfy the request. - - - - - Fired after the construction of an instance but before that instance - is shared with any other or any members are invoked on it. - - - - - Initializes a new instance of the class. - - The context. - The component. - The parameters. - The instance. - - - - The instance can be replaced if needed, e.g. by an interface proxy. - - The object to use instead of the activated instance. - - - - The context in which the activation occurred. - - - - - The component providing the instance. - - - - - The instance that will be used to satisfy the request. - - - The instance can be replaced if needed, e.g. by an interface proxy. - - - - - The parameters supplied to the activator. - - - - - Activate instances using a delegate. - - - - - Base class for instance activators. - - - - - Create an instance activator that will return instances compatible - with . - - Most derived type to which instances can be cast. - - - - Gets a string representation of the activator. - - A string describing the activator. - - - - The most specific type that the component instances are known to be castable to. - - - - - Activates component instances. - - - - - Activate an instance in the provided context. - - Context in which to activate instances. - Parameters to the instance. - The activated instance. - - The context parameter here should probably be ILifetimeScope in order to reveal Disposer, - but will wait until implementing a concrete use case to make the decision - - - - - The most specific type that the component instances are known to be castable to. - - - - - Create a delegate activator. - - The most specific type to which activated instances can be cast. - Activation delegate. - - - - Activate an instance in the provided context. - - Context in which to activate instances. - Parameters to the instance. - The activated instance. - - The context parameter here should probably be ILifetimeScope in order to reveal Disposer, - but will wait until implementing a concrete use case to make the decision - - - - - Provides a pre-constructed instance. - - - - - Provide the specified instance. - - The instance to provide. - - - - Activate an instance in the provided context. - - Context in which to activate instances. - Parameters to the instance. - The activated instance. - - The context parameter here should probably be ILifetimeScope in order to reveal Disposer, - but will wait until implementing a concrete use case to make the decision - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Determines whether the activator disposes the instance that it holds. - Necessary because otherwise instances that are never resolved will never be - disposed. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The provided instance has already been used in an activation request. Did you combine a provided instance with non-root/single-instance lifetime/sharing?. - - - - - Supplies values based on the target parameter type. - - - - - Returns true if the parameter is able to provide a value to a particular site. - - Constructor, method, or property-mutator parameter. - The component context in which the value is being provided. - If the result is true, the valueProvider parameter will - be set to a function that will lazily retrieve the parameter value. If the result is false, - will be set to null. - True if a value can be supplied; otherwise, false. - - Thrown if or is . - - - - - Binds a constructor to the parameters that will be used when it is invoked. - - - - - Construct a new ConstructorParameterBinding. - - ConstructorInfo to bind. - Available parameters. - Context in which to construct instance. - - - - Invoke the constructor with the parameter bindings. - - The constructed instance. - - - Returns a System.String that represents the current System.Object. - A System.String that represents the current System.Object. - - - - The constructor on the target type. The actual constructor used - might differ, e.g. if using a dynamic proxy. - - - - - True if the binding is valid. - - - - - Describes the constructor parameter binding. - - - - - Selects the best constructor from a set of available constructors. - - - - - Selects the best constructor from the available constructors. - - Available constructors. - The best constructor. - - - - Selects a constructor based on its signature. - - - - - Match constructors with the provided signature. - - Signature to match. - - - - Selects the best constructor from the available constructors. - - Available constructors. - The best constructor. - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to At least one binding must be provided in order to select a constructor.. - - - - - Looks up a localized string similar to The required constructor on type '{0}' with signature '{1}' is unavailable.. - - - - - Looks up a localized string similar to More than one constructor matches the signature '{0}'.. - - - - - Selects the constructor with the most parameters. - - - - - Selects the best constructor from the available constructors. - - Available constructors. - The best constructor. - A single unambiguous match could not be chosen. - - - - Uses reflection to activate instances of a type. - - - - - Create an activator for the provided type. - - Type to activate. - Constructor finder. - Constructor selector. - Parameters configured explicitly for this instance. - Properties configured explicitly for this instance. - - - - Activate an instance in the provided context. - - Context in which to activate instances. - Parameters to the instance. - The activated instance. - - The context parameter here should probably be ILifetimeScope in order to reveal Disposer, - but will wait until implementing a concrete use case to make the decision - - - - - The constructor finder. - - - - - The constructor selector. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to No constructors on type '{0}' can be found with the constructor finder '{1}'.. - - - - - Looks up a localized string similar to None of the constructors found with '{0}' on type '{1}' can be invoked with the available services and parameters:{2}. - - - - - Base class for parameters that provide a constant value. - - - - - Create a constant parameter that will apply to parameters matching - the supplied predicate. - - - - - - - Returns true if the parameter is able to provide a value to a particular site. - - Constructor, method, or property-mutator parameter. - The component context in which the value is being provided. - If the result is true, the valueProvider parameter will - be set to a function that will lazily retrieve the parameter value. If the result is false, - will be set to null. - True if a value can be supplied; otherwise, false. - - - - The value of the parameter. - - - - - Standard container implementation. - - - - - Creates, wires dependencies and manages lifetime for a set of components. - Most instances of are created - by a . - - - - // See ContainerBuilder for the definition of the builder variable - using (var container = builder.Build()) - { - var program = container.Resolve<Program>(); - program.Run(); - } - - - - Most functionality is provided by extension methods - on the inherited interface. - - - - - - - - - An tracks the instantiation of component instances. - It defines a boundary in which instances are shared and configured. - Disposing an will dispose the components that were - resolved through it. - - - - // See IContainer for definition of the container variable - using (var requestScope = container.BeginLifetimeScope()) - { - // Note that handler is resolved from requestScope, not - // from the container: - - var handler = requestScope.Resolve<IRequestHandler>(); - handler.Handle(request); - - // When requestScope is disposed, all resources used in processing - // the request will be released. - } - - - - All long-running applications should resolve components via an - . Choosing the duration of the lifetime is application- - specific. The standard Autofac WCF and ASP.NET/MVC integrations are already configured - to create and release s as appropriate. For example, the - ASP.NET integration will create and release an per HTTP - request. - Most functionality is provided by extension methods - on the inherited interface. - - - - - - - - - - - The context in which a service can be accessed or a component's - dependencies resolved. Disposal of a context will dispose any owned - components. - - - - - Resolve an instance of the provided registration within the context. - - The registration. - Parameters for the instance. - - The component instance. - - - - - - - Associates services with the components that provide them. - - - - - Begin a new nested scope. Component instances created via the new scope - will be disposed along with it. - - A new lifetime scope. - - - - Begin a new nested scope. Component instances created via the new scope - will be disposed along with it. - - The tag applied to the . - A new lifetime scope. - - - - Begin a new nested scope, with additional components available to it. - Component instances created via the new scope - will be disposed along with it. - - - The components registered in the sub-scope will be treated as though they were - registered in the root scope, i.e., SingleInstance() components will live as long - as the root scope. - - Action on a - that adds component registations visible only in the new scope. - A new lifetime scope. - - - - Begin a new nested scope, with additional components available to it. - Component instances created via the new scope - will be disposed along with it. - - - The components registered in the sub-scope will be treated as though they were - registered in the root scope, i.e., SingleInstance() components will live as long - as the root scope. - - The tag applied to the . - Action on a - that adds component registations visible only in the new scope. - A new lifetime scope. - - - - The disposer associated with this . - Component instances can be associated with it manually if required. - - Typical usage does not require interaction with this member- it - is used when extending the container. - - - - The tag applied to the . - - Tags allow a level in the lifetime hierarchy to be identified. - In most applications, tags are not necessary. - - - - - Fired when a new scope based on the current scope is beginning. - - - - - Fired when this scope is ending. - - - - - Fired when a resolve operation is beginning in this scope. - - - - - Create a new container. - - - - - Begin a new sub-scope. Instances created via the sub-scope - will be disposed along with it. - - A new lifetime scope. - - - - Begin a new sub-scope. Instances created via the sub-scope - will be disposed along with it. - - The tag applied to the . - A new lifetime scope. - - - - Begin a new nested scope, with additional components available to it. - Component instances created via the new scope - will be disposed along with it. - - Action on a - that adds component registations visible only in the new scope. - A new lifetime scope. - - - - Begin a new nested scope, with additional components available to it. - Component instances created via the new scope - will be disposed along with it. - - The tag applied to the . - Action on a - that adds component registations visible only in the new scope. - A new lifetime scope. - - - - Resolve an instance of the provided registration within the context. - - The registration. - Parameters for the instance. - - The component instance. - - - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Gets the service object of the specified type. - - An object that specifies the type of service object - to get. - - A service object of type .-or- null if there is - no service object of type . - - - - - The disposer associated with this container. Instances can be associated - with it manually if required. - - - - - Tag applied to the lifetime scope. - - The tag applied to this scope and the contexts generated when - it resolves component dependencies. - - - - Fired when a new scope based on the current scope is beginning. - - - - - Fired when this scope is ending. - - - - - Fired when a resolve operation is beginning in this scope. - - - - - Associates services with the components that provide them. - - - - - Base exception type thrown whenever the dependency resolution process fails. This is a fatal - exception, as Autofac is unable to 'roll back' changes to components that may have already - been made during the operation. For example, 'on activated' handlers may have already been - fired, or 'single instance' components partially constructed. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - The message. - The inner exception. - - - - Gets a message that describes the current exception. - - - The error message that explains the reason for the exception, or an empty string(""). - - - - - Maintains a set of objects to dispose, and disposes them in the reverse order - from which they were added when the Disposer is itself disposed. - - - - - Provided on an object that will dispose of other objects when it is - itself disposed. - - - - - Adds an object to the disposer. When the disposer is - disposed, so will the object be. - - The instance. - - - - Contents all implement IDisposable. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Adds an object to the disposer. When the disposer is - disposed, so will the object be. - - The instance. - - - - Locates the lifetime to which instances of a component should be attached. - - - - - Given the most nested scope visible within the resolve operation, find - the scope for the component. - - The most nested visible scope. - The scope for the component. - - - - Represents a set of components and related functionality - packaged together. - - - - - Apply the module to the component registry. - - Component registry to apply configuration to. - - - - Determines when instances supporting IDisposable are disposed. - - - - - The lifetime scope does not dispose the instances. - - - - - The instances are disposed when the lifetime scope is disposed. - - - - - Determines whether instances are shared within a lifetime scope. - - - - - Each request for an instance will return a new object. - - - - - Each request for an instance will return the same object. - - - - - Defines a nested structure of lifetimes. - - - - - Try to retrieve an instance based on a GUID key. If the instance - does not exist, invoke to create it. - - Key to look up. - Creation function. - An instance. - - - - The root of the sharing hierarchy. - - - - - The parent of this node of the hierarchy, or null. - - - - - Attaches the instance's lifetime to the current lifetime scope. - - - - - Given the most nested scope visible within the resolve operation, find - the scope for the component. - - The most nested visible scope. - The scope for the component. - - - - Lifetime scope implementation. - - - - - Protects shared instances from concurrent access. Other members and the base class are threadsafe. - - - - - The tag applied to root scopes when no other tag is specified. - - - - - Create a lifetime scope for the provided components and nested beneath a parent. - - The tag applied to the . - Components used in the scope. - Parent scope. - - - - Create a root lifetime scope for the provided components. - - The tag applied to the . - Components used in the scope. - - - - Create a root lifetime scope for the provided components. - - Components used in the scope. - - - - Begin a new anonymous sub-scope. Instances created via the sub-scope - will be disposed along with it. - - A new lifetime scope. - - - - Begin a new tagged sub-scope. Instances created via the sub-scope - will be disposed along with it. - - The tag applied to the . - A new lifetime scope. - - - - Begin a new anonymous sub-scope, with additional components available to it. - Component instances created via the new scope - will be disposed along with it. - - Action on a - that adds component registations visible only in the new scope. - A new lifetime scope. - - IContainer cr = // ... - using (var lifetime = cr.BeginLifetimeScope(builder => { - builder.RegisterType<Foo>(); - builder.RegisterType<Bar>().As<IBar>(); }) - { - var foo = lifetime.Resolve<Foo>(); - } - - - - - Begin a new tagged sub-scope, with additional components available to it. - Component instances created via the new scope - will be disposed along with it. - - The tag applied to the . - Action on a - that adds component registations visible only in the new scope. - A new lifetime scope. - - IContainer cr = // ... - using (var lifetime = cr.BeginLifetimeScope("unitOfWork", builder => { - builder.RegisterType<Foo>(); - builder.RegisterType<Bar>().As<IBar>(); }) - { - var foo = lifetime.Resolve<Foo>(); - } - - - - - Resolve an instance of the provided registration within the context. - - The registration. - Parameters for the instance. - - The component instance. - - - - - - - Try to retrieve an instance based on a GUID key. If the instance - does not exist, invoke to create it. - - Key to look up. - Creation function. - An instance. - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Gets the service object of the specified type. - - An object that specifies the type of service object - to get. - - A service object of type .-or- null if there is - no service object of type . - - - - - The parent of this node of the hierarchy, or null. - - - - - The root of the sharing hierarchy. - - - - - The disposer associated with this container. Instances can be associated - with it manually if required. - - - - - Tag applied to the lifetime scope. - - The tag applied to this scope and the contexts generated when - it resolves component dependencies. - - - - Associates services with the components that provide them. - - - - - Fired when a new scope based on the current scope is beginning. - - - - - Fired when this scope is ending. - - - - - Fired when a resolve operation is beginning in this scope. - - - - - Attaches the component's lifetime to scopes matching a supplied expression. - - - - - Match scopes by comparing tags for equality. - - The tags applied to matching scopes. - - - - Given the most nested scope visible within the resolve operation, find - the scope for the component. - - The most nested visible scope. - The scope for the component. - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to No scope with a Tag matching '{0}' is visible from the scope in which the instance was requested. This generally indicates that a component registered as per-HTTP request is being requested by a SingleInstance() component (or a similar scenario.) Under the web integration always request dependencies from the DependencyResolver.Current or ILifetimeScopeProvider.RequestLifetime, never from the container itself.. - - - - - Attaches the component's lifetime to the root scope. - - - - - Given the most nested scope visible within the resolve operation, find - the scope for the component. - - The most nested visible scope. - The scope for the component. - - - - A property identified by name. When applied to a reflection-based - component, the name will be matched against property names. - - - - - Create a with the specified constant value. - - The name of the property. - The property value. - - - - The name of the property. - - - - - Fired before the activation process to allow parameters to be changed or an alternative - instance to be provided. - - - - - Initializes a new instance of the class. - - The context. - The component. - The parameters. - - - - The context in which the activation is occurring. - - - - - The component providing the instance being activated. - - - - - The parameters supplied to the activator. - - - - - A service was requested that cannot be provided by the container. To avoid this exception, either register a component - to provide the required service, check for service registration using IsRegistered(), or use the ResolveOptional() - method to resolve an optional dependency. - - This exception is fatal. See for more information. - - - - Initializes a new instance of the class. - - The service. - - - - Initializes a new instance of the class. - - The service. - The inner exception. - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The requested service '{0}' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.. - - - - - Information about the ocurrence of a component being registered - with a container. - - - - - Create a new instance with a valid container and component registration. - - The container into which the registration - was made. - The component registration. - - - - The container into which the registration was made. - - - - - The component registration. - - - - - Describes a logical component within the container. - - - - - Create a new component registration. - - Unique identifier for the component. - Activator used to activate instances. - Determines how the component will be associated with its lifetime. - Whether the component is shared within its lifetime scope. - Whether the component instances are disposed at the end of their lifetimes. - Services the component provides. - Data associated with the component. - - - - Create a new component registration. - - Unique identifier for the component. - Activator used to activate instances. - Determines how the component will be associated with its lifetime. - Whether the component is shared within its lifetime scope. - Whether the component instances are disposed at the end of their lifetimes. - Services the component provides. - Data associated with the component. - The component registration upon which this registration is based. - - - - Called by the container when an instance is required. - - The context in which the instance will be activated. - Parameters for activation. - - - - Called by the container once an instance has been constructed. - - The context in which the instance was activated. - The parameters supplied to the activator. - The instance. - - - - Called by the container once an instance has been fully constructed, including - any requested objects that depend on the instance. - - The context in which the instance was activated. - The parameters supplied to the activator. - The instance. - - - - Describes the component in a human-readable form. - - A description of the component. - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - The component registration upon which this registration is based. - If this registration was created directly by the user, returns this. - - - - - A unique identifier for this component (shared in all sub-contexts.) - This value also appears in Services. - - - - - The activator used to create instances. - - - - - The lifetime associated with the component. - - - - - Whether the component instances are shared or not. - - - - - Whether the instances of the component should be disposed by the container. - - - - - The services provided by the component. - - - - - Additional data associated with the component. - - - - - Fired when a new instance is required. The instance can be - provided in order to skip the regular activator, by setting the Instance property in - the provided event arguments. - - - - - Fired when a new instance is being activated. The instance can be - wrapped or switched at this time by setting the Instance property in - the provided event arguments. - - - - - Fired when the activation process for a new instance is complete. - - - - - Catch circular dependencies that are triggered by post-resolve processing (e.g. 'OnActivated') - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Circular component dependency detected: {0}.. - - - - - Looks up a localized string similar to Probable circular dependency between factory-scoped components. Chain includes '{0}'. - - - - - An is a component context that sequences and monitors the multiple - activations that go into producing a single requested object graph. - - - - - Get or create and share an instance of in the . - - The scope in the hierarchy in which the operation will begin. - The component to resolve. - Parameters for the component. - The component instance. - - - - Raised when the entire operation is complete. - - - - - Raised when an instance is looked up within the operation. - - - - - A is a component context that sequences and monitors the multiple - activations that go into producing a single requested object graph. - - - - - Create an instance of in the provided scope. - - The most nested scope in which to begin the operation. The operation - can move upward to less nested scopes as components with wider sharing scopes are activated - - - - Resolve an instance of the provided registration within the context. - - The registration. - Parameters for the instance. - - The component instance. - - - - - - - Execute the complete resolve operation. - - - - - Continue building the object graph by instantiating in the - current . - - The current scope of the operation. - The component to activate. - The parameters for the component. - The resolved instance. - - - - - Associates services with the components that provide them. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to An exception was thrown while executing a resolve operation. See the InnerException for details.. - - - - - Looks up a localized string similar to Probable circular dependency between factory-scoped components. Chain includes '{0}'. - - - - - Looks up a localized string similar to This resolve operation has already ended. When registering components using lambdas, the IComponentContext 'c' parameter to the lambda cannot be stored. Instead, either resolve IComponentContext again from 'c', or resolve a Func<> based factory to create subsequent components from.. - - - - - Identifies a service according to a type to which it can be assigned. - - - - - Initializes a new instance of the class. - - Type of the service. - - - - Indicates whether the current object is equal to another object of the same type. - - An object to compare with this object. - - true if the current object is equal to the parameter; otherwise, false. - - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - true if the specified is equal to the current ; otherwise, false. - - The parameter is null. - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Return a new service of the same kind, but carrying - as the . - - The new service type. - A new service with the service type. - - - - Gets the type of the service. - - The type of the service. - - - - Gets a human-readable description of the service. - - The description. - - - - A handy unique service identifier type - all instances will be regarded as unequal. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The id. - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - true if the specified is equal to the current ; otherwise, false. - - The parameter is null. - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Provides a programmer-readable description of the identifying feature of the service. - - - - - - Registration source providing implicit collection/list/enumerable support. - - - - This registration source provides enumerable support to allow resolving - the set of all registered services of a given type. - - - What may not be immediately apparent is that it also means any time there - are no items of a particular type registered, it will always return an - empty set rather than or throwing an exception. - This is by design. - - - Consider the [possibly majority] use case where you're resolving a set - of message handlers or event handlers from the container. If there aren't - any handlers, you want an empty set - not or - an exception. It's valid to have no handlers registered. - - - This implicit support means other areas (like MVC support or manual - property injection) must take care to only request enumerable values they - expect to get something back for. In other words, "Don't ask the container - for something you don't expect to resolve." - - - - - - Retrieve registrations for an unregistered service, to be used - by the container. - - The service that was requested. - A function that will return existing registrations for a service. - Registrations providing the service. - - - - Generates activators for open generic types. - - - - - Represents a dependency that can be released by the dependent component. - - The service provided by the dependency. - - - Autofac automatically provides instances of whenever the - service is registered. - - - It is not necessary for , or the underlying component, to implement . - Disposing of the object is the correct way to handle cleanup of the dependency, - as this will dispose of any other components created indirectly as well. - - - When is resolved, a new is created for the - underlying , and tagged with the service matching , - generally a . This means that shared instances can be tied to this - scope by registering them as InstancePerMatchingLifetimeScope(new TypedService(typeof(T))). - - - - The component D below is disposable and implements IService: - - public class D : IService, IDisposable - { - // ... - } - - The dependent component C can dispose of the D instance whenever required by taking a dependency on - : - - public class C - { - IService _service; - - public C(Owned<IService> service) - { - _service = service; - } - - void DoWork() - { - _service.Value.DoSomething(); - } - - void OnFinished() - { - _service.Dispose(); - } - } - - In general, rather than depending on directly, components will depend on - System.Func<Owned<T>> in order to create and dispose of other components as required. - - - - - Create an instance of . - - The value representing the instance. - An IDisposable interface through which ownership can be released. - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - The owned value. - - - - - Generates registrations for services of type whenever the service - T is available. - - - - - Retrieve registrations for an unregistered service, to be used - by the container. - - The service that was requested. - A function that will return existing registrations for a service. - Registrations providing the service. - - - - When implemented by a component, an instance of the component will be resolved - and started as soon as the container is built. Autofac will not call the Start() - method when subsequent instances are resolved. If this behavior is required, use - an OnActivated() event handler instead. - - - For equivalent "Stop" functionality, implement . Autofac - will always dispose a component before any of its dependencies (except in the presence - of circular dependencies, in which case the components in the cycle are disposed in - reverse-construction order.) - - - - - Perform once-off startup processing. - - - - - Base class for user-defined modules. Modules can add a set of releated components - to a container () or attach cross-cutting functionality - to other components (. - Modules are given special support in the XML configuration feature - see - http://code.google.com/p/autofac/wiki/StructuringWithModules. - - Provides a user-friendly way to implement - via . - - Defining a module: - - public class DataAccessModule : Module - { - public string ConnectionString { get; set; } - - public override void Load(ContainerBuilder moduleBuilder) - { - moduleBuilder.RegisterGeneric(typeof(MyRepository<>)) - .As(typeof(IRepository<>)) - .InstancePerMatchingLifetimeScope(WebLifetime.Request); - - moduleBuilder.Register(c => new MyDbConnection(ConnectionString)) - .As<IDbConnection>() - .InstancePerMatchingLifetimeScope(WebLifetime.Request); - } - } - - Using the module: - - var builder = new ContainerBuilder(); - builder.RegisterModule(new DataAccessModule { ConnectionString = "..." }); - var container = builder.Build(); - var customers = container.Resolve<IRepository<Customer>>(); - - - - - - Apply the module to the component registry. - - Component registry to apply configuration to. - - - - Override to add registrations to the container. - - - Note that the ContainerBuilder parameter is unique to this module. - - The builder through which components can be - registered. - - - - Override to attach module-specific functionality to a - component registration. - - This method will be called for all existing and future component - registrations - ordering is not important. - The component registry. - The registration to attach functionality to. - - - - Override to perform module-specific processing on a registration source. - - This method will be called for all existing and future sources - - ordering is not important. - The component registry into which the source was added. - The registration source. - - - - The assembly in which the concrete module type is located. To avoid bugs whereby deriving from a module will - change the target assembly, this property can only be used by modules that inherit directly from - . - - - - - Configure the component so that instances are never disposed by the container. - - A registration builder allowing further configuration of the component. - - - - Configure the component so that instances that support IDisposable are - disposed by the container (default.) - - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - gets a new, unique instance (default.) - - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - gets the same, shared instance. - - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - within a single ILifetimeScope gets the same, shared instance. Dependent components in - different lifetime scopes will get different instances. - - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() within - a ILifetimeScope tagged with any of the provided tags value gets the same, shared instance. - Dependent components in lifetime scopes that are children of the tagged scope will - share the parent's instance. If no appropriately tagged scope can be found in the - hierarchy an is thrown. - - Tag applied to matching lifetime scopes. - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - within a ILifetimeScope created by an owned instance gets the same, shared instance. - Dependent components in lifetime scopes that are children of the owned instance scope will - share the parent's instance. If no appropriate owned instance scope can be found in the - hierarchy an is thrown. - - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - within a ILifetimeScope created by an owned instance gets the same, shared instance. - Dependent components in lifetime scopes that are children of the owned instance scope will - share the parent's instance. If no appropriate owned instance scope can be found in the - hierarchy an is thrown. - - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - within a ILifetimeScope created by an owned instance gets the same, shared instance. - Dependent components in lifetime scopes that are children of the owned instance scope will - share the parent's instance. If no appropriate owned instance scope can be found in the - hierarchy an is thrown. - - The service type provided by the component. - Key to associate with the component. - A registration builder allowing further configuration of the component. - - - - Configure the component so that every dependent component or call to Resolve() - within a ILifetimeScope created by an owned instance gets the same, shared instance. - Dependent components in lifetime scopes that are children of the owned instance scope will - share the parent's instance. If no appropriate owned instance scope can be found in the - hierarchy an is thrown. - - Key to associate with the component. - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Configure the services that the component will provide. The generic parameter(s) to As() - will be exposed as TypedService instances. - - Service type. - A registration builder allowing further configuration of the component. - - - - Configure the services that the component will provide. The generic parameter(s) to As() - will be exposed as TypedService instances. - - Service type. - Service type. - A registration builder allowing further configuration of the component. - - - - Configure the services that the component will provide. The generic parameter(s) to As() - will be exposed as TypedService instances. - - Service type. - Service type. - Service type. - A registration builder allowing further configuration of the component. - - - - Configure the services that the component will provide. - - Service types to expose. - A registration builder allowing further configuration of the component. - - - - Configure the services that the component will provide. - - Services to expose. - A registration builder allowing further configuration of the component. - - - - Provide a textual name that can be used to retrieve the component. - - Named service to associate with the component. - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Provide a textual name that can be used to retrieve the component. - - Named service to associate with the component. - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Provide a key that can be used to retrieve the component. - - Key to associate with the component. - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Provide a key that can be used to retrieve the component. - - Key to associate with the component. - The service type provided by the component. - A registration builder allowing further configuration of the component. - - - - Add a handler for the Preparing event. This event allows manipulating of the parameters - that will be provided to the component. - - The event handler. - A registration builder allowing further configuration of the component. - - - - Add a handler for the Activating event. - - The event handler. - A registration builder allowing further configuration of the component. - - - - Add a handler for the Activated event. - - The event handler. - A registration builder allowing further configuration of the component. - - - - Configure the component so that any properties whose types are registered in the - container will be wired to instances of the appropriate service. - - Set wiring options such as circular dependency wiring support. - A registration builder allowing further configuration of the component. - - - - Associates data with the component. - - Key by which the data can be located. - The data value. - A registration builder allowing further configuration of the component. - - - - Associates data with the component. - - The extended properties to associate with the component. - A registration builder allowing further configuration of the component. - - - - Associates data with the component. - - A type with properties whose names correspond to the - property names to configure. - A registration builder allowing further configuration of the component. - - - - The activator data. - - - - - The registration style. - - - - - The registration data. - - - - - Data common to all registrations made in the container, both direct (IComponentRegistration) - and dynamic (IRegistrationSource.) - - - - - Construct a RegistrationData instance. - - The default service that will be used if no others - are added. - - - - Add multiple services for the registration, overriding the default. - - The services to add. - If an empty collection is specified, this will still - clear the default service. - - - - Add a service to the registration, overriding the default. - - The service to add. - - - - Copies the contents of another RegistrationData object into this one. - - The data to copy. - When true, the default service - will be changed to that of the other. - - Thrown if is . - - - - - Empties the configured services. - - - - - The services explicitly assigned to the component. - - - - - The instance ownership assigned to the component. - - - - - The lifetime assigned to the component. - - - - - The sharing mode assigned to the component. - - - - - Extended properties assigned to the component. - - - - - Handlers for the Preparing event. - - - - - Handlers for the Activating event. - - - - - Handlers for the Activated event. - - - - - Adds registration syntax to the type. - - - - - Add a component to the container. - - The builder to register the component with. - The component to add. - - - - Add a registration source to the container. - - The builder to register the registration source via. - The registration source to add. - - - - Register an instance as a component. - - The type of the instance. - Container builder. - The instance to register. - Registration builder allowing the registration to be configured. - If no services are explicitly specified for the instance, the - static type will be used as the default service (i.e. *not* instance.GetType()). - - - - Register a component to be created through reflection. - - The type of the component implementation. - Container builder. - Registration builder allowing the registration to be configured. - - - - Register a component to be created through reflection. - - The type of the component implementation. - Container builder. - Registration builder allowing the registration to be configured. - - - - Register a delegate as a component. - - The type of the instance. - Container builder. - The delegate to register. - Registration builder allowing the registration to be configured. - - - - Register a delegate as a component. - - The type of the instance. - Container builder. - The delegate to register. - Registration builder allowing the registration to be configured. - - - - Register an un-parameterised generic type, e.g. Repository<>. - Concrete types will be made as they are requested, e.g. with Resolve<Repository<int>>(). - - Container builder. - The open generic implementation type. - Registration builder allowing the registration to be configured. - - - - Specifies that the component being registered should only be made the default for services - that have not already been registered. - - Registration limit type. - Registration style. - Activator data type. - Registration to set service mapping on. - Registration builder allowing the registration to be configured. - - - - Specifies that the components being registered should only be made the default for services - that have not already been registered. - - Registration limit type. - Registration style. - Registration to set service mapping on. - Registration builder allowing the registration to be configured. - - - - Register the types in an assembly. - - Container builder. - The assemblies from which to register types. - Registration builder allowing the registration to be configured. - - - - Register the types in a list. - - Container builder. - The types to register. - Registration builder allowing the registration to be configured. - - - - Specifies a subset of types to register from a scanned assembly. - - Registration limit type. - Registration style. - Activator data type. - Registration to filter types from. - Predicate that returns true for types to register. - Registration builder allowing the registration to be configured. - - - - Specifies how a type from a scanned assembly is mapped to a service. - - Registration limit type. - Registration style. - Activator data type. - Registration to set service mapping on. - Function mapping types to services. - Registration builder allowing the registration to be configured. - - - - Specifies how a type from a scanned assembly is mapped to a service. - - Registration limit type. - Registration style. - Activator data type. - Registration to set service mapping on. - Function mapping types to services. - Registration builder allowing the registration to be configured. - - - - Specifies how a type from a scanned assembly is mapped to a service. - - Registration limit type. - Registration style. - Activator data type. - Registration to set service mapping on. - Function mapping types to services. - Registration builder allowing the registration to be configured. - - - - Specifies how a type from a scanned assembly is mapped to a service. - - Registration limit type. - Registration style. - Activator data type. - Registration to set service mapping on. - Function mapping types to services. - Registration builder allowing the registration to be configured. - - - - Specifies that a type from a scanned assembly provides its own concrete type as a service. - - Registration limit type. - Registration to set service mapping on. - Registration builder allowing the registration to be configured. - - - - Specifies that a type provides its own concrete type as a service. - - Registration limit type. - Activator data type. - Registration to set service mapping on. - Registration builder allowing the registration to be configured. - - - - Specifies that a type provides its own concrete type as a service. - - Registration limit type. - Registration to set service mapping on. - Registration builder allowing the registration to be configured. - - - - Specify how a type from a scanned assembly provides metadata. - - Registration limit type. - Registration style. - Activator data type. - Registration to set metadata on. - A function mapping the type to a list of metadata items. - Registration builder allowing the registration to be configured. - - - - Use the properties of an attribute (or interface implemented by an attribute) on the scanned type - to provide metadata values. - - Inherited attributes are supported; however, there must be at most one matching attribute - in the inheritance chain. - The attribute applied to the scanned type. - Registration to set metadata on. - Registration builder allowing the registration to be configured. - - - - Specify how a type from a scanned assembly provides metadata. - - Registration limit type. - Registration style. - Activator data type. - Registration to set service mapping on. - Key of the metadata item. - A function retrieving the value of the item from the component type. - Registration builder allowing the registration to be configured. - - - - Specifies how a type from a scanned assembly is mapped to a named service. - - Registration to set service mapping on. - Service type provided by the component. - Function mapping types to service names. - Registration builder allowing the registration to be configured. - - - - Specifies how a type from a scanned assembly is mapped to a named service. - - Registration limit type. - Registration style. - Activator data type. - Registration to set service mapping on. - Service type provided by the component. - Function mapping types to service names. - Registration builder allowing the registration to be configured. - - - - Specifies how a type from a scanned assembly is mapped to a keyed service. - - Registration to set service mapping on. - Service type provided by the component. - Function mapping types to service keys. - Registration builder allowing the registration to be configured. - - - - Specifies how a type from a scanned assembly is mapped to a keyed service. - - Registration limit type. - Registration style. - Activator data type. - Registration to set service mapping on. - Service type provided by the component. - Function mapping types to service keys. - Registration builder allowing the registration to be configured. - - - - Specifies that a type from a scanned assembly is registered as providing all of its - implemented interfaces. - - Registration limit type. - Registration to set service mapping on. - Registration builder allowing the registration to be configured. - - - - Specifies that a type is registered as providing all of its implemented interfaces. - - Registration limit type. - Activator data type. - Registration to set service mapping on. - Registration builder allowing the registration to be configured. - - - - Specifies that a type is registered as providing all of its implemented interfaces. - - Registration limit type. - Registration to set service mapping on. - Registration builder allowing the registration to be configured. - - - - Set the policy used to find candidate constructors on the implementation type. - - Registration limit type. - Activator data type. - Registration style. - Registration to set policy on. - Policy to be used when searching for constructors. - A registration builder allowing further configuration of the component. - - - - Set the policy used to find candidate constructors on the implementation type. - - Registration limit type. - Activator data type. - Registration style. - Registration to set policy on. - A function that returns the constructors to select from. - A registration builder allowing further configuration of the component. - - - - Set the policy used to select from available constructors on the implementation type. - - Registration limit type. - Activator data type. - Registration style. - Registration to set policy on. - Constructor signature to match. - A registration builder allowing further configuration of the component. - - - - Set the policy used to select from available constructors on the implementation type. - - Registration limit type. - Registration style. - Activator data type. - Registration to set policy on. - Policy to be used when selecting a constructor. - A registration builder allowing further configuration of the component. - - - - Set the policy used to select from available constructors on the implementation type. - - Registration limit type. - Activator data type. - Registration style. - Registration to set policy on. - Expression demonstrating how the constructor is called. - A registration builder allowing further configuration of the component. - - - - Configure an explicit value for a constructor parameter. - - Registration limit type. - Registration style. - Activator data type. - Registration to set parameter on. - Name of a constructor parameter on the target type. - Value to supply to the parameter. - A registration builder allowing further configuration of the component. - - - - Configure an explicit value for a constructor parameter. - - Registration limit type. - Registration style. - Activator data type. - Registration to set parameter on. - The parameter to supply to the constructor. - A registration builder allowing further configuration of the component. - - - - Configure an explicit value for a constructor parameter. - - Registration limit type. - Registration style. - Activator data type. - Registration to set parameter on. - A predicate selecting the parameter to set. - - A registration builder allowing further configuration of the component. - - - - Configure explicit values for constructor parameters. - - Registration limit type. - Registration style. - Activator data type. - Registration to set parameter on. - The parameters to supply to the constructor. - A registration builder allowing further configuration of the component. - - - - Configure an explicit value for a property. - - Registration limit type. - Registration style. - Activator data type. - Registration to set property on. - Name of a property on the target type. - Value to supply to the property. - A registration builder allowing further configuration of the component. - - - - Configure an explicit value for a property. - - Registration limit type. - Registration style. - Activator data type. - Registration to set parameter on. - The property to supply. - A registration builder allowing further configuration of the component. - - - - Configure explicit values for properties. - - Registration limit type. - Registration style. - Activator data type. - Registration to set parameter on. - The properties to supply. - A registration builder allowing further configuration of the component. - - - - Sets the target of the registration (used for metadata generation.) - - The type of the limit. - The type of the activator data. - Registration style - Registration to set target for. - The target. - - Registration builder allowing the registration to be configured. - - - Thrown if or is . - - - - - Provide a handler to be called when the component is registered. - - Registration limit type. - Registration style. - Activator data type. - Registration add handler to. - The handler. - Registration builder allowing the registration to be configured. - - - - Provide a handler to be called when the component is registred. - - Registration limit type. - Registration style. - Registration add handler to. - The handler. - Registration builder allowing the registration to be configured. - - - - Specifies that a type from a scanned assembly is registered if it implements an interface - that closes the provided open generic interface type. - - Registration limit type. - Registration style. - Activator data type. - Registration to set service mapping on. - The open generic interface or base class type for which implementations will be found. - Registration builder allowing the registration to be configured. - - - - Filters the scanned types to include only those assignable to the provided - type. - - Registration limit type. - Registration style. - Activator data type. - Registration to filter types from. - The type or interface which all classes must be assignable from. - Registration builder allowing the registration to be configured. - - - - Filters the scanned types to include only those assignable to the provided - type. - - Registration to filter types from. - The type or interface which all classes must be assignable from. - Registration builder allowing the registration to be configured. - - - - Filters the scanned types to exclude the provided type. - - Registration to filter types from. - The concrete type to exclude. - Registration builder allowing the registration to be configured. - - - - Filters the scanned types to exclude the provided type, providing specific configuration for - the excluded type. - - Registration to filter types from. - Registration for the excepted type. - The concrete type to exclude. - Registration builder allowing the registration to be configured. - - - - Filters the scanned types to include only those in the namespace of the provided type - or one of its sub-namespaces. - - Registration to filter types from. - A type in the target namespace. - Registration builder allowing the registration to be configured. - - - - Filters the scanned types to include only those in the provided namespace - or one of its sub-namespaces. - - Registration limit type. - Registration style. - Activator data type. - Registration to filter types from. - The namespace from which types will be selected. - Registration builder allowing the registration to be configured. - - - - Adapt all components implementing service - to provide using the provided - function. - - Service type to adapt from. - Service type to adapt to. Must not be the - same as . - Container builder. - Function adapting to - service , given the context and parameters. - - - - Adapt all components implementing service - to provide using the provided - function. - - Service type to adapt from. - Service type to adapt to. Must not be the - same as . - Container builder. - Function adapting to - service , given the context. - - - - Adapt all components implementing service - to provide using the provided - function. - - Service type to adapt from. - Service type to adapt to. Must not be the - same as . - Container builder. - Function adapting to - service . - - - - Decorate all components implementing open generic service . - The and parameters must be different values. - - Container builder. - Service type being decorated. Must be an open generic type. - Service key or name associated with the components being decorated. - Service key or name given to the decorated components. - The type of the decorator. Must be an open generic type, and accept a parameter - of type , which will be set to the instance being decorated. - - - - Decorate all components implementing service - using the provided function. - The and parameters must be different values. - - Service type being decorated. - Container builder. - Function decorating a component instance that provides - , given the context and parameters. - Service key or name associated with the components being decorated. - Service key or name given to the decorated components. - - - - Decorate all components implementing service - using the provided function. - The and parameters must be different values. - - Service type being decorated. - Container builder. - Function decorating a component instance that provides - , given the context. - Service key or name associated with the components being decorated. - Service key or name given to the decorated components. - - - - Decorate all components implementing service - using the provided function. - The and parameters must be different values. - - Service type being decorated. - Container builder. - Function decorating a component instance that provides - . - Service key or name associated with the components being decorated. - Service key or name given to the decorated components. - - - - Run a supplied action instead of disposing instances when they're no - longer required. - - Registration limit type. - Activator data type. - Registration style. - Registration to set release action for. - An action to perform instead of disposing the instance. - Registration builder allowing the registration to be configured. - Only one release action can be configured per registration. - - - - Wraps a registration in an implicit and automatically - activates the registration after the container is built. - - Registration to set release action for. - Registration limit type. - Activator data type. - Registration style. - A registration builder allowing further configuration of the component. - - - While you can implement an to perform some logic at - container build time, sometimes you need to just activate a registered component and - that's it. This extension allows you to automatically activate a registration on - container build. No additional logic is executed and the resolved instance is not held - so container disposal will end up disposing of the instance. - - - Depending on how you register the lifetime of the component, you may get an exception - when you build the container - components that are scoped to specific lifetimes (like - ASP.NET components scoped to a request lifetime) will fail to resolve because the - appropriate lifetime is not available. - - - - - - Share one instance of the component within the context of a single - web/HTTP/API request. Only available for integration that supports - per-request dependencies (e.g., MVC, Web API, web forms, etc.). - - Registration limit type. - Registration style. - Activator data type. - The registration to configure. - Additional tags applied for matching lifetime scopes. - A registration builder allowing further configuration of the component. - - Thrown if is . - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The instance registration '{0}' can support SingleInstance() sharing only.. - - - - - Looks up a localized string similar to A metadata attribute of type {0} was not found on {1}.. - - - - - Looks up a localized string similar to More than one metadata attribute of type {0} was found on {1}.. - - - - - Looks up a localized string similar to No matching constructor exists on type '{0}'.. - - - - - An activator builder with no parameters. - - - - - Return the provided activator. - - The activator to return. - - - - Gets the activator. - - - - - Registration style for individual components. - - - - - The id used for the registration. - - - - - Handlers to notify of the component registration event. - - - - - By default, new registrations override existing registrations as defaults. - If set to true, new registrations will not change existing defaults. - - - - - The component upon which this registration is based. - - - - - Used to build an from component registrations. - - - - var builder = new ContainerBuilder(); - - builder.RegisterType<Logger>() - .As<ILogger>() - .SingleInstance(); - - builder.Register(c => new MessageHandler(c.Resolve<ILogger>())); - - var container = builder.Build(); - // resolve components from container... - - - Most functionality is accessed - via extension methods in . - - - - - - Register a callback that will be invoked when the container is configured. - - This is primarily for extending the builder syntax. - Callback to execute. - - - - Create a new container with the component registrations that have been made. - - Options that influence the way the container is initialised. - - Build can only be called once per - - this prevents ownership issues for provided instances. - Build enables support for the relationship types that come with Autofac (e.g. - Func, Owned, Meta, Lazy, IEnumerable.) To exclude support for these types, - first create the container, then call Update() on the builder. - - A new container with the configured component registrations. - - - - Configure an existing container with the component registrations - that have been made. - - - Update can only be called once per - - this prevents ownership issues for provided instances. - - An existing container to make the registrations in. - - - - Configure an existing container with the component registrations - that have been made and allows additional build options to be specified. - - - Update can only be called once per - - this prevents ownership issues for provided instances. - - An existing container to make the registrations in. - Options that influence the way the container is updated. - - - - Configure an existing registry with the component registrations - that have been made. - - - Update can only be called once per - - this prevents ownership issues for provided instances. - - An existing registry to make the registrations in. - - - - A parameter identified by name. When applied to a reflection-based - component, will be matched against - the name of the component's constructor arguments. When applied to - a delegate-based component, the parameter can be accessed using - . - - - Component with parameter: - - public class MyComponent - { - public MyComponent(int amount) { ... } - } - - Providing the parameter: - - var builder = new ContainerBuilder(); - builder.RegisterType<MyComponent>(); - var container = builder.Build(); - var myComponent = container.Resolve<MyComponent>(new NamedParameter("amount", 123)); - - - - - - Create a with the specified constant value. - - The name of the parameter. - The parameter value. - - - - The name of the parameter. - - - - - Extension methods that simplify extraction of parameter values from - an where T is . - Each method returns the first matching parameter value, or throws an exception if - none is provided. - - - At configuration time, delegate registrations can retrieve parameter values using - the methods , and : - - builder.Register((c, p) => new FtpClient(p.Named<string>("server"))); - - These parameters can be provided at resolution time: - - container.Resolve<FtpClient>(new NamedParameter("server", "ftp.example.com")); - - Alternatively, the parameters can be provided via a Generated Factory - http://code.google.com/p/autofac/wiki/DelegateFactories. - - - - - Retrieve a named parameter value from a instance. - - The type to which the returned value will be cast. - The available parameters to choose from. - The name of the parameter to select. - The value of the selected parameter. - - - - - Retrieve a positional parameter value from a instance. - - The type to which the returned value will be cast. - The available parameters to choose from. - The zero-based position of the parameter to select. - The value of the selected parameter. - The position value is the one associated with the parameter when - it was constructed, not its index into the - sequence. - - - - - Retrieve a typed parameter value from a instance. - - The type to which the returned value will be cast. - The available parameters to choose from. - The value of the selected parameter. - - - - - A parameter that is identified according to an integer representing its - position in an argument list. When applied to a reflection-based - component, will be matched against - the indices of the component's constructor arguments. When applied to - a delegate-based component, the parameter can be accessed using - . - - - Component with parameter: - - public class MyComponent - { - public MyComponent(int amount) { ... } - } - - Providing the parameter: - - var builder = new ContainerBuilder(); - builder.RegisterType<MyComponent>(); - var container = builder.Build(); - var myComponent = container.Resolve<MyComponent>(new PositionalParameter(0, 123)); - - - - - - Construct a positional parameter with the specified constant value. - - The zero-based position of the parameter. - The parameter value. - - - - The zero-based position of the parameter. - - - - - Adds syntactic convenience methods to the interface. - - - - - Set any properties on that can be - resolved in the context. - - Type of instance. Used only to provide method chaining. - The context from which to resolve the service. - The instance to inject properties into. - . - - - - Set any null-valued properties on that can be - resolved by the container. - - Type of instance. Used only to provide method chaining. - The context from which to resolve the service. - The instance to inject properties into. - . - - - - Retrieve a service from the context. - - The type to which the result will be cast. - The context from which to resolve the service. - Name of the service. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The type to which the result will be cast. - The context from which to resolve the service. - Name of the service. - The parameters. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The type to which the result will be cast. - The context from which to resolve the service. - Name of the service. - The parameters. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The type to which the result will be cast. - The context from which to resolve the service. - Key of the service. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The type to which the result will be cast. - The context from which to resolve the service. - Key of the service. - The parameters. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The type to which the result will be cast. - The context from which to resolve the service. - Key of the service. - The parameters. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The service to retrieve. - The context from which to resolve the service. - The component instance that provides the service. - - - - - - Retrieve a service from the context. - - The type to which the result will be cast. - The context from which to resolve the service. - Parameters for the service. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The type to which the result will be cast. - The context from which to resolve the service. - Parameters for the service. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - The service type. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - Parameters for the service. - The service type. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - Parameters for the service. - The service type. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - The service name. - Type of the service. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - Parameters for the service. - The service name. - Type of the service. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - Parameters for the service. - The service name. - Type of the service. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - Key of the service. - Type of the service. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - Key of the service. - Type of the service. - The parameters. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - Key of the service. - Type of the service. - The parameters. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - The service to resolve. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - Parameters for the service. - The service to resolve. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context. - - The context from which to resolve the service. - Parameters for the service. - The service to resolve. - - The component instance that provides the service. - - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - The service to resolve. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - Parameters for the service. - The service to resolve. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - Parameters for the service. - The service to resolve. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - The name of the service. - The service to resolve. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - Parameters for the service. - The name of the service. - The service to resolve. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - Parameters for the service. - The name of the service. - The service to resolve. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - The name of the service. - The service to resolve. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - Parameters for the service. - The name of the service. - The service to resolve. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - Parameters for the service. - The key of the service. - The service to resolve. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - The type of the service. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - Parameters for the service. - The type of the service. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - Parameters for the service. - The type of the service. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - The service. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - The service. - Parameters for the service. - - The component instance that provides the service, or null. - - - - - - Retrieve a service from the context, or null if the service is not - registered. - - The context from which to resolve the service. - The service. - Parameters for the service. - - The component instance that provides the service, or null. - - - - - - Determine whether the specified service is available in the context. - - The context from which to resolve the service. - The service to test for the registration of. - True if the service is registered. - - - - Determine whether the specified service is available in the context. - - The context from which to resolve the service. - The service to test for the registration of. - True if the service is registered. - - - - Determine whether the specified service is available in the context. - - The context from which to resolve the service. - The name of the service to test for the registration of. - Type type of the service to test for the registration of. - True if the service is registered. - - - - Determine whether the specified service is available in the context. - - The context from which to resolve the service. - The name of the service to test for the registration of. - Type type of the service to test for the registration of. - True if the service is registered. - - - - Determine whether the specified service is available in the context. - - The context from which to resolve the service. - The key of the service to test for the registration of. - Type type of the service to test for the registration of. - True if the service is registered. - - - - Determine whether the specified service is available in the context. - - The context from which to resolve the service. - The key of the service to test for the registration of. - Type type of the service to test for the registration of. - True if the service is registered. - - - - Determine whether the specified service is available in the context. - - The context from which to resolve the service. - The service to test for the registration of. - True if the service is registered. - - - - Try to retrieve a service from the context. - - The context from which to resolve the service. - The service to resolve. - The resulting component instance providing the service, or null. - The parameters. - - True if a component providing the service is available. - - - - Thrown if is . - - - - - Try to retrieve a service from the context. - - The context from which to resolve the service. - The service to resolve. - The resulting component instance providing the service, or null. - - True if a component providing the service is available. - - - - - - Try to retrieve a service from the context. - - The context from which to resolve the service. - The service type to resolve. - The resulting component instance providing the service, or null. - - True if a component providing the service is available. - - - - - - Try to retrieve a service from the context. - - The service type to resolve. - The context from which to resolve the service. - The resulting component instance providing the service, or default(T). - - True if a component providing the service is available. - - - - - - Try to retrieve a service from the context. - - The context from which to resolve the service. - The name of the service to resolve. - The type of the service to resolve. - The resulting component instance providing the service, or null. - - True if a component providing the service is available. - - - - - - Try to retrieve a service from the context. - - The context from which to resolve the service. - The key of the service to resolve. - The type of the service to resolve. - The resulting component instance providing the service, or null. - - True if a component providing the service is available. - - - - - - Flexible parameter type allows arbitrary values to be retrieved - from the resolution context. - - - - - Create an instance of the ResolvedParameter class. - - A predicate that determines which parameters on a constructor will be supplied by this instance. - A function that supplies the parameter value given the context. - - - - Returns true if the parameter is able to provide a value to a particular site. - - Constructor, method, or property-mutator parameter. - The component context in which the value is being provided. - If the result is true, the valueProvider parameter will - be set to a function that will lazily retrieve the parameter value. If the result is false, - will be set to null. - True if a value can be supplied; otherwise, false. - - - - Construct a that will match parameters of type - and resolve for those parameters an implementation - registered with the name . - - The type of the parameter to match. - The name of the matching service to resolve. - A configured instance. - - - - - - Construct a that will match parameters of type - and resolve for those parameters an implementation - registered with the key . - - The type of the parameter to match. - The key of the matching service to resolve. - A configured instance. - - - - A parameter that can supply values to sites that exactly - match a specified type. When applied to a reflection-based - component, will be matched against - the types of the component's constructor arguments. When applied to - a delegate-based component, the parameter can be accessed using - . - - - Component with parameter: - - public class MyComponent - { - public MyComponent(int amount) { ... } - } - - Providing the parameter: - - var builder = new ContainerBuilder(); - builder.RegisterType<MyComponent>(); - var container = builder.Build(); - var myComponent = container.Resolve<MyComponent>(new TypedParameter(typeof(int), 123)); - - - - - - Create a typed parameter with the specified constant value. - - The exact type to match. - The parameter value. - - - - Shortcut for creating - by using the - - type to be used for the parameter - The parameter value. - new typed parameter - - - - The type against which targets are matched. - - - - - Extends with methods that are useful in - building scanning rules for . - - - - - Returns true if this type is in the namespace - or one of its sub-namespaces. - - The type to test. - The namespace to test. - True if this type is in the namespace - or one of its sub-namespaces; otherwise, false. - - - - Returns true if this type is in the same namespace as - or one of its sub-namespaces. - - The type to test. - True if this type is in the same namespace as - or one of its sub-namespaces; otherwise, false. - - - Determines whether the candidate type supports any base or - interface that closes the provided generic type. - - - - - - - Determines whether this type is assignable to . - - The type to test assignability to. - True if this type is assignable to references of type - ; otherwise, False. - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The type '{0}' is not an open generic class or interface type.. - - - - - Extension methods for . - - - - - Safely returns the set of loadable types from an assembly. - - The from which to load types. - - The set of types from the , or the subset - of types that could be loaded if there was any error. - - - Thrown if is . - - - - - Helper methods used throughout the codebase. - - - - - Enforce that an argument is not null. Returns the - value if valid so that it can be used inline in - base initialiser syntax. - - - - - - - - - Enforce that sequence does not contain null. Returns the - value if valid so that it can be used inline in - base initialiser syntax. - - - The value. - The name. - - - - - Enforces that the provided object is non-null. - - - The value. - - - - - Enforce that an argument is not null or empty. Returns the - value if valid so that it can be used inline in - base initialiser syntax. - - The value. - The description. - - - - - Enforce that the argument is a delegate type. - - The type to test. - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The argument '{0}' cannot be empty.. - - - - - Looks up a localized string similar to The object of type '{0}' cannot be null.. - - - - - Looks up a localized string similar to Type {0} returns void.. - - - - - Looks up a localized string similar to The sequence provided as argument '{0}' cannot contain null elements.. - - - - - Looks up a localized string similar to Type {0} is not a delegate type.. - - - - - Extension methods for reflection-related types. - - - - - Maps from a property-set-value parameter to the declaring property. - - Parameter to the property setter. - The property info on which the setter is specified. - True if the parameter is a property setter. - - - - Get a PropertyInfo object from an expression of the form - x => x.P. - - Type declaring the property. - The type of the property. - Expression mapping an instance of the - declaring type to the property value. - Property info. - - - - Get the MethodInfo for a method called in the - expression. - - Type on which the method is called. - Expression demonstrating how the method appears. - The method info for the called method. - - - - Gets the for the new operation called in the expression. - - The type on which the constructor is called. - Expression demonstrating how the constructor is called. - The for the called constructor. - - - - Retrieves a custom attribute of a specified type that is applied to a specified member, - and optionally inspects the ancestors of that member. - - The type of attribute to search for. - The member to inspect. - true to inspect the ancestors of element; otherwise, false. - A custom attribute that matches , or null if no such attribute is found. - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to The provided expression must be of the form () =>new X(), but the provided expression was {0}.. - - - - - Looks up a localized string similar to The provided expression must be of the form x =>x.M(), but the provided expression was {0}.. - - - - - Looks up a localized string similar to The provided expression must be of the form x =>x.P, but the provided expression was {0}.. - - - - - Adapts an action to the interface. - - - - - Joins the strings into one single string interspersing the elements with the separator (a-la - System.String.Join()). - - The elements. - The separator. - The joined string. - - - - Appends the item to the specified sequence. - - - The sequence. - The trailing item. - - - - - Prepends the item to the specified sequence. - - - The sequence. - The leading item. - - - - Returns the first concrete interface supported by the candidate type that - closes the provided open generic service type. - The type that is being checked for the interface. - The open generic type to locate. - The type of the interface. - - - - Looks for an interface on the candidate type that closes the provided open generic interface type. - - The type that is being checked for the interface. - The open generic service type to locate. - True if a closed implementation was found; otherwise false. - - - - Retrieve registrations for an unregistered service, to be used - by the container. - - The service that was requested. - A function that will return existing registrations for a service. - Registrations providing the service. - - - - Signal attribute for static analysis that indicates a helper method is - validating arguments for . - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Unable to generate a function to return type '{0}' with input parameter types [{1}]. The input parameter type list has duplicate types. Try registering a custom delegate type instead of using a generic Func relationship.. - - - - - Looks up a localized string similar to Delegate Support (Func<T>and Custom Delegates). - - - - + + + + Autofac + + + + + Service used as a "flag" to indicate a particular component should be + automatically activated on container build. + + + + + Services are the lookup keys used to locate component instances. + + + + + Returns a that represents the current . + + + A that represents the current . + + + + + Implements the operator ==. + + The left operand. + The right operand. + The result of the operator. + + + + Implements the operator !=. + + The left operand. + The right operand. + The result of the operator. + + + + Determines whether the specified is equal to the current . + + The to compare with the current . + + true if the specified is equal to the current ; otherwise, false. + + The parameter is null. + + + + Serves as a hash function for a particular type. + + + A hash code for the current . + + + + + Gets a human-readable description of the service. + + The description. + + + + Determines whether the specified is equal to the current . + + The to compare with the current . + + if the specified is not + and is an ; otherwise, . + + + + All services of this type are considered "equal." + + + + + + Serves as a hash function for a particular type. + + + A hash code for the current . Always 0 for this type. + + + + All services of this type are considered "equal" and use the same hash code. + + + + + + Gets the service description. + + + Always returns AutoActivate. + + + + + Used with the WithMetadata configuration method to + associate key-value pairs with an . + + Interface with properties whose names correspond to + the property keys. + This feature was suggested by OJ Reeves (@TheColonial). + + + + Set one of the property values. + + The type of the property. + An expression that accesses the property to set. + The property value to set. + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Cannot choose between multiple constructors with equal length {0} on type '{1}'. Select the constructor explicitly, with the UsingConstructor() configuration method, when the component is registered.. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to {0} ---> {1} (See inner exception for details.). + + + + + Well-known tags used in setting up matching lifetime scopes. + + + + + Tag used in setting up per-request lifetime scope registrations + (e.g., per-HTTP-request or per-API-request). + + + + + Interface providing fluent syntax for chaining module registrations. + + + + + Add a module to the container. + + The module to add. + + The to allow + additional chained module registrations. + + + + + Basic implementation of the + interface allowing registration of modules into a + in a fluent format. + + + + + The into which registrations will be made. + + + + + Initializes a new instance of the class. + + + The into which registrations will be made. + + + Thrown if is . + + + + + Add a module to the container. + + The module to add. + + The to allow + additional chained module registrations. + + + Thrown if is . + + + + + Support the System.Lazy<T, TMetadata> + types automatically whenever type T is registered with the container. + Metadata values come from the component registration's metadata. + When a dependency of a lazy type is used, the instantiation of the underlying + component will be delayed until the Value property is first accessed. + + + + + Allows registrations to be made on-the-fly when unregistered + services are requested (lazy registrations.) + + + + + Retrieve registrations for an unregistered service, to be used + by the container. + + The service that was requested. + A function that will return existing registrations for a service. + Registrations providing the service. + + If the source is queried for service s, and it returns a component that implements both s and s', then it + will not be queried again for either s or s'. This means that if the source can return other implementations + of s', it should return these, plus the transitive closure of other components implementing their + additional services, along with the implementation of s. It is not an error to return components + that do not implement . + + + + + Gets whether the registrations provided by this source are 1:1 adapters on top + of other components (I.e. like Meta, Func or Owned.) + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Lazy<T, TMetadata> Support. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to The type '{0}' cannot be used as a metadata view. A metadata view must be a concrete class with a parameterless or dictionary constructor.. + + + + + Looks up a localized string similar to Export metadata for '{0}' is missing and no default value was supplied.. + + + + + Provides a value along with metadata describing the value. + + The type of the value. + An interface to which metadata values can be bound. + + + + Create a new instance. + + The value described by the instance. + The metadata describing the value. + + + + The value described by . + + + + + Metadata describing the value. + + + + + Support the + types automatically whenever type T is registered with the container. + Metadata values come from the component registration's metadata. + + + + + Finds constructors that match a finder function. + + + + + Find suitable constructors from which to select. + + + + + Finds suitable constructors on the target type. + + Type to search for constructors. + Suitable constructors. + + + + Initializes a new instance of the class. + + + Default to selecting all public constructors. + + + + + Initializes a new instance of the class. + + The finder function. + + + + Finds suitable constructors on the target type. + + Type to search for constructors. + Suitable constructors. + + + + Extension methods for configuring the . + + + + + Fluent method for setting the registration configuration on . + + The registration source to configure. + A configuration action that will run on any registration provided by the source. + + The with the registration configuration set. + + + + + Extension methods for registering instances with a container. + + + + + Registers modules found in an assembly. + + The builder to register the modules with. + The assemblies from which to register modules. + + Thrown if is . + + + The to allow + additional chained module registrations. + + + + + Registers modules found in an assembly. + + The module registrar that will make the registrations into the container. + The assemblies from which to register modules. + + Thrown if is . + + + The to allow + additional chained module registrations. + + + + + Registers modules found in an assembly. + + The builder to register the modules with. + The assemblies from which to register modules. + The type of the module to add. + + Thrown if is . + + + The to allow + additional chained module registrations. + + + + + Registers modules found in an assembly. + + The module registrar that will make the registrations into the container. + The assemblies from which to register modules. + The type of the module to add. + + Thrown if is . + + + The to allow + additional chained module registrations. + + + + + Registers modules found in an assembly. + + The builder to register the modules with. + The of the module to add. + The assemblies from which to register modules. + + Thrown if or is . + + + The to allow + additional chained module registrations. + + + + + Registers modules found in an assembly. + + The module registrar that will make the registrations into the container. + The of the module to add. + The assemblies from which to register modules. + + Thrown if or is . + + + The to allow + additional chained module registrations. + + + + + Add a module to the container. + + The builder to register the module with. + The module to add. + + Thrown if is . + + + The to allow + additional chained module registrations. + + + + + Add a module to the container. + + The module registrar that will make the registration into the container. + The module to add. + + Thrown if is . + + + The to allow + additional chained module registrations. + + + + + Add a module to the container. + + The builder to register the module with. + The module to add. + + Thrown if or is . + + + The to allow + additional chained module registrations. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Module.ThisAssembly is only available in modules that inherit directly from Module.. + + + + + Support the + type automatically whenever type T is registered with the container. + When a dependency of a lazy type is used, the instantiation of the underlying + component will be delayed until the Value property is first accessed. + + + + + Generates context-bound closures that represent factories from + a set of heuristics based on delegate type signatures. + + + + + Create a factory generator. + + The service that will be activated in + order to create the products of the factory. + The delegate to provide as a factory. + The parameter mapping mode to use. + + + + Create a factory generator. + + The component that will be activated in + order to create the products of the factory. + The delegate to provide as a factory. + The parameter mapping mode to use. + + + + Generates a factory delegate that closes over the provided context. + + The context in which the factory will be used. + Parameters provided to the resolve call for the factory itself. + A factory delegate that will work within the context. + + + + Generates a factory delegate that closes over the provided context. + + The context in which the factory will be used. + Parameters provided to the resolve call for the factory itself. + A factory delegate that will work within the context. + + + + Reflection activator data for concrete types. + + + + + Builder for reflection-based activators. + + + + + Specify a reflection activator for the given type. + + Type that will be activated. + + + + Get the implementation type. + + + + + The constructor finder for the registration. + + + + + The constructor selector for the registration. + + + + + The explicitly bound constructor parameters. + + + + + The explicitly bound properties. + + + + + Activator data that can provide an IInstanceActivator instance. + + + + + The instance activator based on the provided data. + + + + + Specify a reflection activator for the given type. + + Type that will be activated. + + + + The instance activator based on the provided data. + + + + + Parameterises the construction of a container by a . + + + + + No options - the default behavior for container building. + + + + + Prevents inclusion of standard modules like support for + relationship types including etc. + + + + + Does not call on components implementing + this interface (useful for module testing.) + + + + + Data structure used to construct registrations. + + The most specific type to which instances of the registration + can be cast. + Activator builder type. + Registration style type. + + + + Configure the component so that instances are never disposed by the container. + + A registration builder allowing further configuration of the component. + + + + Configure the component so that instances that support IDisposable are + disposed by the container (default.) + + A registration builder allowing further configuration of the component. + + + + Configure the component so that every dependent component or call to Resolve() + gets a new, unique instance (default.) + + A registration builder allowing further configuration of the component. + + + + Configure the component so that every dependent component or call to Resolve() + gets the same, shared instance. + + A registration builder allowing further configuration of the component. + + + + Configure the component so that every dependent component or call to Resolve() + within a single ILifetimeScope gets the same, shared instance. Dependent components in + different lifetime scopes will get different instances. + + A registration builder allowing further configuration of the component. + + + + Configure the component so that every dependent component or call to Resolve() within + a ILifetimeScope tagged with any of the provided tags value gets the same, shared instance. + Dependent components in lifetime scopes that are children of the tagged scope will + share the parent's instance. If no appropriately tagged scope can be found in the + hierarchy an is thrown. + + Tag applied to matching lifetime scopes. + A registration builder allowing further configuration of the component. + + + + Configure the component so that every dependent component or call to Resolve() + within a ILifetimeScope created by an owned instance gets the same, shared instance. + Dependent components in lifetime scopes that are children of the owned instance scope will + share the parent's instance. If no appropriate owned instance scope can be found in the + hierarchy an is thrown. + + Service type. + A registration builder allowing further configuration of the component. + + + + Configure the component so that every dependent component or call to Resolve() + within a ILifetimeScope created by an owned instance gets the same, shared instance. + Dependent components in lifetime scopes that are children of the owned instance scope will + share the parent's instance. If no appropriate owned instance scope can be found in the + hierarchy an is thrown. + + Service type. + A registration builder allowing further configuration of the component. + + + + Configure the component so that every dependent component or call to Resolve() + within a ILifetimeScope created by an owned instance gets the same, shared instance. + Dependent components in lifetime scopes that are children of the owned instance scope will + share the parent's instance. If no appropriate owned instance scope can be found in the + hierarchy an is thrown. + + The service type provided by the component. + Key to associate with the component. + A registration builder allowing further configuration of the component. + + + + Configure the component so that every dependent component or call to Resolve() + within a ILifetimeScope created by an owned instance gets the same, shared instance. + Dependent components in lifetime scopes that are children of the owned instance scope will + share the parent's instance. If no appropriate owned instance scope can be found in the + hierarchy an is thrown. + + Key to associate with the component. + The service type provided by the component. + A registration builder allowing further configuration of the component. + + + + Configure the services that the component will provide. The generic parameter(s) to As() + will be exposed as TypedService instances. + + Service type. + A registration builder allowing further configuration of the component. + + + + Configure the services that the component will provide. The generic parameter(s) to As() + will be exposed as TypedService instances. + + Service type. + Service type. + A registration builder allowing further configuration of the component. + + + + Configure the services that the component will provide. The generic parameter(s) to As() + will be exposed as TypedService instances. + + Service type. + Service type. + Service type. + A registration builder allowing further configuration of the component. + + + + Configure the services that the component will provide. + + Service types to expose. + A registration builder allowing further configuration of the component. + + + + Configure the services that the component will provide. + + Services to expose. + A registration builder allowing further configuration of the component. + + + + Provide a textual name that can be used to retrieve the component. + + Named service to associate with the component. + The service type provided by the component. + A registration builder allowing further configuration of the component. + + + + Provide a textual name that can be used to retrieve the component. + + Named service to associate with the component. + The service type provided by the component. + A registration builder allowing further configuration of the component. + + + + Provide a key that can be used to retrieve the component. + + Key to associate with the component. + The service type provided by the component. + A registration builder allowing further configuration of the component. + + + + Provide a key that can be used to retrieve the component. + + Key to associate with the component. + The service type provided by the component. + A registration builder allowing further configuration of the component. + + + + Add a handler for the Preparing event. This event allows manipulating of the parameters + that will be provided to the component. + + The event handler. + A registration builder allowing further configuration of the component. + + + + Add a handler for the Activating event. + + The event handler. + A registration builder allowing further configuration of the component. + + + + Add a handler for the Activated event. + + The event handler. + A registration builder allowing further configuration of the component. + + + + Configure the component so that any properties whose types are registered in the + container will be wired to instances of the appropriate service. + + Set wiring options such as circular dependency wiring support. + A registration builder allowing further configuration of the component. + + + + Associates data with the component. + + Key by which the data can be located. + The data value. + A registration builder allowing further configuration of the component. + + + + Associates data with the component. + + The extended properties to associate with the component. + A registration builder allowing further configuration of the component. + + + + Associates data with the component. + + A type with properties whose names correspond to the + property names to configure. + A registration builder allowing further configuration of the component. + + + + The activator data. + + + + + The registration style. + + + + + The registration data. + + + + + Delegates registration lookups to a specified registry. When write operations are applied, + initialises a new 'writeable' registry. + + + Safe for concurrent access by multiple readers. Write operations are single-threaded. + + + + + Provides component registrations according to the services they provide. + + + + + Attempts to find a default registration for the specified service. + + The service to look up. + The default registration for the service. + True if a registration exists. + + + + Determines whether the specified service is registered. + + The service to test. + True if the service is registered. + + + + Register a component. + + The component registration. + + + + Register a component. + + The component registration. + If true, existing defaults for the services provided by the + component will not be changed. + + + + Selects from the available registrations after ensuring that any + dynamic registration sources that may provide + have been invoked. + + The service for which registrations are sought. + Registrations supporting . + + + + Add a registration source that will provide registrations on-the-fly. + + The source to register. + + + + Enumerate the registered components. + + + + + Fired whenever a component is registered - either explicitly or via a + . + + + + + Gets the registration sources that are used by the registry. + + + + + True if the registry contains its own components; false if it is forwarding + registrations from another external registry. + + This property is used when walking up the scope tree looking for + registrations for a new customised scope. (See issue 336.) + + + + Fired when an is added to the registry. + + + + + Enables contravariant Resolve() for interfaces that have a single contravariant ('in') parameter. + + + interface IHandler<in TCommand> + { + void Handle(TCommand command); + } + + class Command { } + + class DerivedCommand : Command { } + + class CommandHandler : IHandler<Command> { ... } + + var builder = new ContainerBuilder(); + builder.RegisterSource(new ContravariantRegistrationSource()); + builder.RegisterType<CommandHandler>(); + var container = builder.Build(); + // Source enables this line, even though IHandler<Command> is the + // actual registered type. + var handler = container.Resolve<IHandler<DerivedCommand>>(); + handler.Handle(new DerivedCommand()); + + + + + Retrieve registrations for an unregistered service, to be used + by the container. + + The service that was requested. + A function that will return existing registrations for a service. + Registrations providing the service. + + If the source is queried for service s, and it returns a component that implements both s and s', then it + will not be queried again for either s or s'. This means that if the source can return other implementations + of s', it should return these, plus the transitive closure of other components implementing their + additional services, along with the implementation of s. It is not an error to return components + that do not implement . + + + + + Gets whether the registrations provided by this source are 1:1 adapters on top + of other components (I.e. like Meta, Func or Owned.) + + + + + Options that can be applied when autowiring properties on a component. (Multiple options can + be specified using bitwise 'or' - e.g. AllowCircularDependencies | PreserveSetValues. + + + + + Default behavior. Circular dependencies are not allowed; existing non-default + property values are overwritten. + + + + + Allows property-property and property-constructor circular dependency wiring. + This flag moves property wiring from the Activating to the Activated event. + + + + + If specified, properties that already have a non-default value will be left + unchanged in the wiring operation. + + + + + Static factory methods to simplify the creation and handling of IRegistrationBuilder{L,A,R}. + + + To create an for a specific type, use: + + var cr = RegistrationBuilder.ForType(t).CreateRegistration(); + + The full builder syntax is supported: + + var cr = RegistrationBuilder.ForType(t).Named("foo").ExternallyOwned().CreateRegistration(); + + + + + + Creates a registration builder for the provided delegate. + + Instance type returned by delegate. + Delegate to register. + A registration builder. + + + + Creates a registration builder for the provided delegate. + + Delegate to register. + Most specific type return value of delegate can be cast to. + A registration builder. + + + + Creates a registration builder for the provided type. + + Implementation type to register. + A registration builder. + + + + Creates a registration builder for the provided type. + + Implementation type to register. + A registration builder. + + + + Create an from a . + (There is no need to call + this method when registering components through a .) + + + When called on the result of one of the methods, + the returned registration will be different from the one the builder itself registers + in the container. + + + + var registration = RegistrationBuilder.ForType<Foo>().CreateRegistration(); + + + + + + The registration builder. + An IComponentRegistration. + + Thrown if is . + + + + + Create an IComponentRegistration from data. + + Id of the registration. + Registration data. + Activator. + Services provided by the registration. + An IComponentRegistration. + + + + Create an IComponentRegistration from data. + + Id of the registration. + Registration data. + Activator. + Services provided by the registration. + Optional; target registration. + An IComponentRegistration. + + Thrown if or is . + + + + + Register a component in the component registry. This helper method is necessary + in order to execute OnRegistered hooks and respect PreserveDefaults. + + Hoping to refactor this out. + + + + Component registry to make registration in. + Registration builder with data for new registration. + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to The type '{0}' is not assignable to service '{1}'.. + + + + + Adds registration syntax for less commonly-used features. + + + These features are in this namespace because they will remain accessible to + applications originally written against Autofac 1.4. In Autofac 2, this functionality + is implicitly provided and thus making explicit registrations is rarely necessary. + + + + + Registers a factory delegate. + + Container builder. + Factory type to generate. + Registration builder allowing the registration to be configured. + Factory delegates are provided automatically in Autofac 2, + and this method is generally not required. + + + + Registers a factory delegate. + + Container builder. + Factory type to generate. + The service that the delegate will return instances of. + Registration builder allowing the registration to be configured. + Factory delegates are provided automatically in Autofac 2, and + this method is generally not required. + + + + Registers a factory delegate. + + The type of the delegate. + Container builder. + The service that the delegate will return instances of. + Registration builder allowing the registration to be configured. + Factory delegates are provided automatically in Autofac 2, + and this method is generally not required. + + + + Registers a factory delegate. + + The type of the delegate. + Container builder. + Registration builder allowing the registration to be configured. + Factory delegates are provided automatically in Autofac 2, + and this method is generally not required. + + + + Changes the parameter mapping mode of the supplied delegate type to match + parameters by name. + + Factory delegate type + Activator data type + Registration style + Registration to change parameter mapping mode of. + Registration builder allowing the registration to be configured. + + Thrown if is . + + + + + Changes the parameter mapping mode of the supplied delegate type to match + parameters by position. + + Factory delegate type + Activator data type + Registration style + Registration to change parameter mapping mode of. + Registration builder allowing the registration to be configured. + + Thrown if is . + + + + + Changes the parameter mapping mode of the supplied delegate type to match + parameters by type. + + Factory delegate type + Activator data type + Registration style + Registration to change parameter mapping mode of. + Registration builder allowing the registration to be configured. + + Thrown if is . + + + + + Registers the type as a collection. If no services or names are specified, the + default services will be IList<T>, ICollection<T>, and IEnumerable<T> + + The type of the collection elements. + Container builder. + A unique name for the collection that can be passed to MemberOf(). + Registration builder allowing the registration to be configured. + Collections are provided automatically in Autofac 2, + and this method is generally not required. + + + + Registers the type as a collection. If no services or names are specified, the + default services will be IList<T>, ICollection<T>, and IEnumerable<T> + + The type of the collection elements. + Container builder. + A unique name for the collection that can be passed to MemberOf(). + Registration builder allowing the registration to be configured. + Collections are provided automatically in Autofac 2, + and this method is generally not required. + + + + Include the element explicitly in a collection configured using RegisterCollection. + + Registration limit type. + Registration style. + Activator data type. + Registration to export. + The collection name, as passed to RegisterCollection. + A registration builder allowing further configuration of the component. + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Build() or Update() can only be called once on a ContainerBuilder.. + + + + + Looks up a localized string similar to An error occurred while attempting to automatically activate registration '{0}'. See the inner exception for information on the source of the failure.. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to A delegate registered to create instances of '{0}' returned null.. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Bound constructor '{0}'.. + + + + + Looks up a localized string similar to The binding cannot be instantiated.. + + + + + Looks up a localized string similar to An exception was thrown while invoking the constructor '{0}' on type '{1}'.. + + + + + Looks up a localized string similar to Cannot resolve parameter '{1}' of constructor '{0}'.. + + + + + Provides parameters that have a default value, set with an optional parameter + declaration in C# or VB. + + + + + Used in order to provide a value to a constructor parameter or property on an instance + being created by the container. + + + Not all parameters can be applied to all sites. + + + + + Returns true if the parameter is able to provide a value to a particular site. + + Constructor, method, or property-mutator parameter. + The component context in which the value is being provided. + If the result is true, the valueProvider parameter will + be set to a function that will lazily retrieve the parameter value. If the result is false, + will be set to null. + True if a value can be supplied; otherwise, false. + + + + Returns true if the parameter is able to provide a value to a particular site. + + Constructor, method, or property-mutator parameter. + The component context in which the value is being provided. + If the result is true, the valueProvider parameter will + be set to a function that will lazily retrieve the parameter value. If the result is false, + will be set to null. + True if a value can be supplied; otherwise, false. + + Thrown if is . + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to The container's self-registration of context interfaces should never be activated as it is hard-wired into the LifetimeScope class.. + + + + + Marks a module as container-aware (for the purposes of attaching to diagnostic events.) + + + + + Initialise the module with the container into which it is being registered. + + The container. + + + + Fired when the activation process for a new instance is complete. + + + + + The context in which the activation occurred. + + + + + The component providing the instance. + + + + + The paramters provided when resolved. + + + + + The instance that will be used to satisfy the request. + + + + + Fired after the construction of an instance but before that instance + is shared with any other or any members are invoked on it. + + + + + The instance can be replaced if needed, e.g. by an interface proxy. + + The object to use instead of the activated instance. + + + + The context in which the activation occurred. + + + + + The component providing the instance. + + + + + The instance that will be used to satisfy the request. + + + + + The parameters supplied to the activator. + + + + + Interface supported by services that carry type information. + + + + + Return a new service of the same kind, but carrying + as the . + + The new service type. + A new service with the service type. + + + + Gets the type of the service. + + The type of the service. + + + + Identifies a service using a key in addition to its type. + + + + + Initializes a new instance of the class. + + Key of the service. + Type of the service. + + + + Indicates whether the current object is equal to another object of the same type. + + An object to compare with this object. + + true if the current object is equal to the parameter; otherwise, false. + + + + + Determines whether the specified is equal to the current . + + The to compare with the current . + + true if the specified is equal to the current ; otherwise, false. + + The parameter is null. + + + + Serves as a hash function for a particular type. + + + A hash code for the current . + + + + + Return a new service of the same kind, but carrying + as the . + + The new service type. + A new service with the service type. + + + + Gets or sets the key of the service. + + The key of the service. + + + + Gets the type of the service. + + The type of the service. + + + + Gets a human-readable description of the service. + + The description. + + + + Describes when a lifetime scope is beginning. + + + + + Create an instance of the class. + + The lifetime scope that is beginning. + + + + The lifetime scope that is beginning. + + + + + Describes when a lifetime scope is ending. + + + + + Create an instance of the class. + + The lifetime scope that is ending. + + + + The lifetime scope that is ending. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it has already been disposed.. + + + + + Fired when an is added to the registry. + + + + + Construct an instance of the class. + + The registry to which the source was added. + The source that was added. + + + + + The registry to which the source was added. + + + + + The source that was added. + + + + + Represents the process of finding a component during a resolve operation. + + + + + The component for which an instance is to be looked up. + + + + + The scope in which the instance will be looked up. + + + + + The parameters provided for new instance creation. + + + + + Raised when the lookup phase of the operation is ending. + + + + + Raised when the completion phase of an instance lookup operation begins. + + + + + Raised when the completion phase of an instance lookup operation ends. + + + + + Raised when the completion phase of an instance lookup operation begins. + + + + + Create an instance of the class. + + The instance lookup that is beginning the completion phase. + + + + The instance lookup operation that is beginning the completion phase. + + + + + Raised when the completion phase of an instance lookup operation ends. + + + + + Create an instance of the class. + + The instance lookup that is ending the completion phase. + + + + The instance lookup operation that is ending the completion phase. + + + + + Fired when an instance is looked up. + + + + + Create an instance of the class. + + The instance lookup that is ending. + True if a new instance was created as part of the operation. + + + + True if a new instance was created as part of the operation. + + + + + The instance lookup operation that is ending. + + + + + Fired when instance lookup is complete. + + + + The instance lookup that is ending. + + + + The instance lookup operation that is beginning. + + + + + Describes the commencement of a new resolve operation. + + + + + Create an instance of the class. + + The resolve operation that is beginning. + + + + The resolve operation that is beginning. + + + + + Wraps a component registration, switching its lifetime. + + + + + Base class for disposable objects. + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Returns true if the current instance has been disposed; otherwise false; + + + + + Describes a logical component within the container. + + + + + Called by the container when an instance is required. + + The context in which the instance will be activated. + Parameters for activation. These may be modified by the event handler. + + + + Called by the container once an instance has been constructed. + + The context in which the instance was activated. + The parameters supplied to the activator. + The instance. + + + + Called by the container once an instance has been fully constructed, including + any requested objects that depend on the instance. + + The context in which the instance was activated. + The parameters supplied to the activator. + The instance. + + + + A unique identifier for this component (shared in all sub-contexts.) + This value also appears in Services. + + + + + The activator used to create instances. + + + + + The lifetime associated with the component. + + + + + Whether the component instances are shared or not. + + + + + Whether the instances of the component should be disposed by the container. + + + + + The services provided by the component. + + + + + Additional data associated with the component. + + + + + The component registration upon which this registration is based. + + + + + Fired when a new instance is required. The instance can be + provided in order to skip the regular activator, by setting the Instance property in + the provided event arguments. + + + + + Fired when a new instance is being activated. The instance can be + wrapped or switched at this time by setting the Instance property in + the provided event arguments. + + + + + Fired when the activation process for a new instance is complete. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Activator = {0}, Services = [{1}], Lifetime = {2}, Sharing = {3}, Ownership = {4}. + + + + + Pulls registrations from another component registry. + Excludes most auto-generated registrations - currently has issues with + collection registrations. + + + + + Create an external registry source that draws components from + . + + Component registry to pull registrations from. + + + + Retrieve registrations for an unregistered service, to be used + by the container. + + The service that was requested. + A function that will return existing registrations for a service. + Registrations providing the service. + + + + In this case because the components that are adapted do not come from the same + logical scope, we must return false to avoid duplicating them. + + + + + Switches components with a RootScopeLifetime (singletons) with + decorators exposing MatchingScopeLifetime targeting the specified scope. + + + + + Maps services onto the components that provide them. + + + The component registry provides services directly from components, + and also uses to generate components + on-the-fly or as adapters for other components. A component registry + is normally used through a , and not + directly by application code. + + + + + Protects instance variables from concurrent access. + + + + + External registration sources. + + + + + All registrations. + + + + + Keeps track of the status of registered services. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Attempts to find a default registration for the specified service. + + The service to look up. + The default registration for the service. + True if a registration exists. + + + + Determines whether the specified service is registered. + + The service to test. + True if the service is registered. + + + + Register a component. + + The component registration. + + + + Register a component. + + The component registration. + If true, existing defaults for the services provided by the + component will not be changed. + + + + Selects from the available registrations after ensuring that any + dynamic registration sources that may provide + have been invoked. + + The service for which registrations are sought. + Registrations supporting . + + + + Add a registration source that will provide registrations on-the-fly. + + The source to register. + + + + Enumerate the registered components. + + + + + Fired whenever a component is registered - either explicitly or via a + . + + + + + Gets the registration sources that are used by the registry. + + + + + True if the registry contains its own components; false if it is forwarding + registrations from another external registry. + + This property is used when walking up the scope tree looking for + registrations for a new customised scope. (See issue 336.) + + + + Fired when an is added to the registry. + + + + + Tracks the services known to the registry. + + + + + Used for bookkeeping so that the same source is not queried twice (may be null.) + + + + + Initializes a new instance of the class. + + The tracked service. + + + + The first time a service is requested, initialization (e.g. reading from sources) + happens. This value will then be set to true. Calling many methods on this type before + initialisation is an error. + + + + + The known implementations. + + + + + True if any implementations are known. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to The operation is only valid during initialization.. + + + + + Looks up a localized string similar to The operation is not valid until the object is initialized.. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to The activation has already been executed.. + + + + + Describes the commencement of a new resolve operation. + + + + + Create an instance of the class. + + The resolve operation that is ending. + If included, the exception causing the operation to end; otherwise, null. + + + + The exception causing the operation to end, or null. + + + + + The resolve operation that is ending. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Subclasses of Autofac.Service must override Object.Equals(). + + + + + Looks up a localized string similar to Subclasses of Autofac.Service must override Object.GetHashCode(). + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Collection Support (Arrays and Generic Collection Interfaces). + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Lazy<T> Support. + + + + + Describes the basic requirements for generating a lightweight adapter. + + + + + Create an instance of . + + The service that will be adapted from. + The adapter function. + + + + The adapter function. + + + + + The service to be adapted from. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Lightweight Adapter from {0} to {1}. + + + + + Looks up a localized string similar to The service {0} cannot be both the adapter's from and to parameters - these must differ.. + + + + + Internal implementation of the RegisterCollection/MemberOf-style collection feature. + + + + + Registration style for dynamic registrations. + + + + + Data used to create factory activators. + + + + + Create a new GeneratedFactoryActivatorData + + The type of the factory. + The service used to provide the products of the factory. + + + + Determines how the parameters of the delegate type are passed on + to the generated Resolve() call as Parameter objects. + For Func-based delegates, this defaults to ByType. Otherwise, the + parameters will be mapped by name. + + + + + Activator data that can provide an IInstanceActivator instance. + + + + + Hides standard Object members to make fluent interfaces + easier to read. + Based on blog post by @kzu here: + http://www.clariusconsulting.net/blogs/kzu/archive/2008/03/10/58301.aspx + + + + + Standard System.Object member. + + Standard result. + + + + Standard System.Object member. + + Standard result. + + + + Standard System.Object member. + + Standard result. + + + + Standard System.Object member. + + The other. + Standard result. + + + + Determines how the parameters of the delegate type are passed on + to the generated Resolve() call as Parameter objects. + + + + + Chooses parameter mapping based on the factory type. + For Func-based factories this is equivalent to ByType, for all + others ByName will be used. + + + + + Pass the parameters supplied to the delegate through to the + underlying registration as NamedParameters based on the parameter + names in the delegate type's formal argument list. + + + + + Pass the parameters supplied to the delegate through to the + underlying registration as TypedParameters based on the parameter + types in the delegate type's formal argument list. + + + + + Pass the parameters supplied to the delegate through to the + underlying registration as PositionalParameters based on the parameter + indices in the delegate type's formal argument list. + + + + + Provides components by lookup operations via an index (key) type. + + The type of the index. + The service provided by the indexed components. + + Retrieving a value given a key: + + IIndex<AccountType, IRenderer> accountRenderers = // ... + var renderer = accountRenderers[AccountType.User]; + + + + + + Get the value associated with if any is available. + + The key to look up. + The retrieved value. + True if a value associated with the key exists. + + + + Get the value associated with . + + The value to retrieve. + The associated value. + + + + + + + + + + + + + Support the + types automatically whenever type T is registered with the container. + Metadata values come from the component registration's metadata. + + + + + Provides a value along with a dictionary of metadata describing the value. + + The type of the value. + + + + Create a new instance. + + The value described by the instance. + The metadata describing the value. + + + + The value described by . + + + + + Metadata describing the value. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Meta<T> Support. + + + + + Looks up a localized string similar to Meta<T, TMetadata> Support. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to The service '{0}' is not an open generic type.. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to {0} providing {1}. + + + + + Describes the activator for an open generic decorator. + + + + + Construct an . + + The decorator type. + The open generic service type to decorate. + + + + The open generic service type to decorate. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to The service {0} cannot be both the adapter's from and to parameters - these must differ.. + + + + + Looks up a localized string similar to Open Generic Decorator {0} from {1} to {2}. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to The type {0} is not an open generic type definition.. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to The type '{0}' does not implement the interface '{1}'.. + + + + + Looks up a localized string similar to The implementation type '{0}' is not an open generic type definition.. + + + + + Looks up a localized string similar to The implementation type '{0}' does not support the interface '{1}'.. + + + + + Looks up a localized string similar to The service '{0}' is not an open generic type definition.. + + + + + Looks up a localized string similar to The service '{1}' is not assignable from implementation type '{0}'.. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Owned<T> Support. + + + + + Provides registrations on-the-fly for any concrete type not already registered with + the container. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + A predicate that selects types the source will register. + + + + Retrieve registrations for an unregistered service, to be used + by the container. + + The service that was requested. + A function that will return existing registrations for a service. + Registrations providing the service. + + + + Returns a that represents the current . + + + A that represents the current . + + 2 + + + + Gets whether the registrations provided by this source are 1:1 adapters on top + of other components (I.e. like Meta, Func or Owned.) + + + + + Gets or sets an expression used to configure generated registrations. + + + A that can be used to modify the behavior + of registrations that are generated by this source. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to "Resolve Anything" Support. + + + + + Activation data for types located by scanning assemblies. + + + + + Create an instance of . + + + + + The filters applied to the types from the scanned assembly. + + + + + Additional actions to be performed on the concrete type registrations. + + + + + Actions to be called once the scanning operation is complete. + + + + + Fired when the activation process for a new instance is complete. + + + + + Initializes a new instance of the class. + + The context. + The component. + The parameters. + The instance. + + + + The context in which the activation occurred. + + + + + The component providing the instance. + + + + + The paramters provided when resolved. + + + + + The instance that will be used to satisfy the request. + + + + + Fired after the construction of an instance but before that instance + is shared with any other or any members are invoked on it. + + + + + Initializes a new instance of the class. + + The context. + The component. + The parameters. + The instance. + + + + The instance can be replaced if needed, e.g. by an interface proxy. + + The object to use instead of the activated instance. + + + + The context in which the activation occurred. + + + + + The component providing the instance. + + + + + The instance that will be used to satisfy the request. + + + The instance can be replaced if needed, e.g. by an interface proxy. + + + + + The parameters supplied to the activator. + + + + + Activate instances using a delegate. + + + + + Base class for instance activators. + + + + + Create an instance activator that will return instances compatible + with . + + Most derived type to which instances can be cast. + + + + Gets a string representation of the activator. + + A string describing the activator. + + + + The most specific type that the component instances are known to be castable to. + + + + + Activates component instances. + + + + + Activate an instance in the provided context. + + Context in which to activate instances. + Parameters to the instance. + The activated instance. + + The context parameter here should probably be ILifetimeScope in order to reveal Disposer, + but will wait until implementing a concrete use case to make the decision + + + + + The most specific type that the component instances are known to be castable to. + + + + + Create a delegate activator. + + The most specific type to which activated instances can be cast. + Activation delegate. + + + + Activate an instance in the provided context. + + Context in which to activate instances. + Parameters to the instance. + The activated instance. + + The context parameter here should probably be ILifetimeScope in order to reveal Disposer, + but will wait until implementing a concrete use case to make the decision + + + + + Provides a pre-constructed instance. + + + + + Provide the specified instance. + + The instance to provide. + + + + Activate an instance in the provided context. + + Context in which to activate instances. + Parameters to the instance. + The activated instance. + + The context parameter here should probably be ILifetimeScope in order to reveal Disposer, + but will wait until implementing a concrete use case to make the decision + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Determines whether the activator disposes the instance that it holds. + Necessary because otherwise instances that are never resolved will never be + disposed. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to The provided instance has already been used in an activation request. Did you combine a provided instance with non-root/single-instance lifetime/sharing?. + + + + + Supplies values based on the target parameter type. + + + + + Returns true if the parameter is able to provide a value to a particular site. + + Constructor, method, or property-mutator parameter. + The component context in which the value is being provided. + If the result is true, the valueProvider parameter will + be set to a function that will lazily retrieve the parameter value. If the result is false, + will be set to null. + True if a value can be supplied; otherwise, false. + + Thrown if or is . + + + + + Binds a constructor to the parameters that will be used when it is invoked. + + + + + Construct a new ConstructorParameterBinding. + + ConstructorInfo to bind. + Available parameters. + Context in which to construct instance. + + + + Invoke the constructor with the parameter bindings. + + The constructed instance. + + + Returns a System.String that represents the current System.Object. + A System.String that represents the current System.Object. + + + + The constructor on the target type. The actual constructor used + might differ, e.g. if using a dynamic proxy. + + + + + True if the binding is valid. + + + + + Describes the constructor parameter binding. + + + + + Selects the best constructor from a set of available constructors. + + + + + Selects the best constructor from the available constructors. + + Available constructors. + The best constructor. + + + + Selects a constructor based on its signature. + + + + + Match constructors with the provided signature. + + Signature to match. + + + + Selects the best constructor from the available constructors. + + Available constructors. + The best constructor. + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to At least one binding must be provided in order to select a constructor.. + + + + + Looks up a localized string similar to The required constructor on type '{0}' with signature '{1}' is unavailable.. + + + + + Looks up a localized string similar to More than one constructor matches the signature '{0}'.. + + + + + Selects the constructor with the most parameters. + + + + + Selects the best constructor from the available constructors. + + Available constructors. + The best constructor. + A single unambiguous match could not be chosen. + + + + Uses reflection to activate instances of a type. + + + + + Create an activator for the provided type. + + Type to activate. + Constructor finder. + Constructor selector. + Parameters configured explicitly for this instance. + Properties configured explicitly for this instance. + + + + Activate an instance in the provided context. + + Context in which to activate instances. + Parameters to the instance. + The activated instance. + + The context parameter here should probably be ILifetimeScope in order to reveal Disposer, + but will wait until implementing a concrete use case to make the decision + + + + + The constructor finder. + + + + + The constructor selector. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to No constructors on type '{0}' can be found with the constructor finder '{1}'.. + + + + + Looks up a localized string similar to None of the constructors found with '{0}' on type '{1}' can be invoked with the available services and parameters:{2}. + + + + + Base class for parameters that provide a constant value. + + + + + Create a constant parameter that will apply to parameters matching + the supplied predicate. + + + + + + + Returns true if the parameter is able to provide a value to a particular site. + + Constructor, method, or property-mutator parameter. + The component context in which the value is being provided. + If the result is true, the valueProvider parameter will + be set to a function that will lazily retrieve the parameter value. If the result is false, + will be set to null. + True if a value can be supplied; otherwise, false. + + + + The value of the parameter. + + + + + Standard container implementation. + + + + + Creates, wires dependencies and manages lifetime for a set of components. + Most instances of are created + by a . + + + + // See ContainerBuilder for the definition of the builder variable + using (var container = builder.Build()) + { + var program = container.Resolve<Program>(); + program.Run(); + } + + + + Most functionality is provided by extension methods + on the inherited interface. + + + + + + + + + An tracks the instantiation of component instances. + It defines a boundary in which instances are shared and configured. + Disposing an will dispose the components that were + resolved through it. + + + + // See IContainer for definition of the container variable + using (var requestScope = container.BeginLifetimeScope()) + { + // Note that handler is resolved from requestScope, not + // from the container: + + var handler = requestScope.Resolve<IRequestHandler>(); + handler.Handle(request); + + // When requestScope is disposed, all resources used in processing + // the request will be released. + } + + + + All long-running applications should resolve components via an + . Choosing the duration of the lifetime is application- + specific. The standard Autofac WCF and ASP.NET/MVC integrations are already configured + to create and release s as appropriate. For example, the + ASP.NET integration will create and release an per HTTP + request. + Most functionality is provided by extension methods + on the inherited interface. + + + + + + + + + + + The context in which a service can be accessed or a component's + dependencies resolved. Disposal of a context will dispose any owned + components. + + + + + Resolve an instance of the provided registration within the context. + + The registration. + Parameters for the instance. + + The component instance. + + + + + + + Associates services with the components that provide them. + + + + + Begin a new nested scope. Component instances created via the new scope + will be disposed along with it. + + A new lifetime scope. + + + + Begin a new nested scope. Component instances created via the new scope + will be disposed along with it. + + The tag applied to the . + A new lifetime scope. + + + + Begin a new nested scope, with additional components available to it. + Component instances created via the new scope + will be disposed along with it. + + + The components registered in the sub-scope will be treated as though they were + registered in the root scope, i.e., SingleInstance() components will live as long + as the root scope. + + Action on a + that adds component registations visible only in the new scope. + A new lifetime scope. + + + + Begin a new nested scope, with additional components available to it. + Component instances created via the new scope + will be disposed along with it. + + + The components registered in the sub-scope will be treated as though they were + registered in the root scope, i.e., SingleInstance() components will live as long + as the root scope. + + The tag applied to the . + Action on a + that adds component registations visible only in the new scope. + A new lifetime scope. + + + + The disposer associated with this . + Component instances can be associated with it manually if required. + + Typical usage does not require interaction with this member- it + is used when extending the container. + + + + The tag applied to the . + + Tags allow a level in the lifetime hierarchy to be identified. + In most applications, tags are not necessary. + + + + + Fired when a new scope based on the current scope is beginning. + + + + + Fired when this scope is ending. + + + + + Fired when a resolve operation is beginning in this scope. + + + + + Create a new container. + + + + + Begin a new sub-scope. Instances created via the sub-scope + will be disposed along with it. + + A new lifetime scope. + + + + Begin a new sub-scope. Instances created via the sub-scope + will be disposed along with it. + + The tag applied to the . + A new lifetime scope. + + + + Begin a new nested scope, with additional components available to it. + Component instances created via the new scope + will be disposed along with it. + + Action on a + that adds component registations visible only in the new scope. + A new lifetime scope. + + + + Begin a new nested scope, with additional components available to it. + Component instances created via the new scope + will be disposed along with it. + + The tag applied to the . + Action on a + that adds component registations visible only in the new scope. + A new lifetime scope. + + + + Resolve an instance of the provided registration within the context. + + The registration. + Parameters for the instance. + + The component instance. + + + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Gets the service object of the specified type. + + An object that specifies the type of service object + to get. + + A service object of type .-or- null if there is + no service object of type . + + + + + The disposer associated with this container. Instances can be associated + with it manually if required. + + + + + Tag applied to the lifetime scope. + + The tag applied to this scope and the contexts generated when + it resolves component dependencies. + + + + Fired when a new scope based on the current scope is beginning. + + + + + Fired when this scope is ending. + + + + + Fired when a resolve operation is beginning in this scope. + + + + + Associates services with the components that provide them. + + + + + Base exception type thrown whenever the dependency resolution process fails. This is a fatal + exception, as Autofac is unable to 'roll back' changes to components that may have already + been made during the operation. For example, 'on activated' handlers may have already been + fired, or 'single instance' components partially constructed. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner exception. + + + + Gets a message that describes the current exception. + + + The error message that explains the reason for the exception, or an empty string(""). + + + + + Maintains a set of objects to dispose, and disposes them in the reverse order + from which they were added when the Disposer is itself disposed. + + + + + Provided on an object that will dispose of other objects when it is + itself disposed. + + + + + Adds an object to the disposer. When the disposer is + disposed, so will the object be. + + The instance. + + + + Contents all implement IDisposable. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Adds an object to the disposer. When the disposer is + disposed, so will the object be. + + The instance. + + + + Locates the lifetime to which instances of a component should be attached. + + + + + Given the most nested scope visible within the resolve operation, find + the scope for the component. + + The most nested visible scope. + The scope for the component. + + + + Represents a set of components and related functionality + packaged together. + + + + + Apply the module to the component registry. + + Component registry to apply configuration to. + + + + Determines when instances supporting IDisposable are disposed. + + + + + The lifetime scope does not dispose the instances. + + + + + The instances are disposed when the lifetime scope is disposed. + + + + + Determines whether instances are shared within a lifetime scope. + + + + + Each request for an instance will return a new object. + + + + + Each request for an instance will return the same object. + + + + + Defines a nested structure of lifetimes. + + + + + Try to retrieve an instance based on a GUID key. If the instance + does not exist, invoke to create it. + + Key to look up. + Creation function. + An instance. + + + + The root of the sharing hierarchy. + + + + + The parent of this node of the hierarchy, or null. + + + + + Attaches the instance's lifetime to the current lifetime scope. + + + + + Given the most nested scope visible within the resolve operation, find + the scope for the component. + + The most nested visible scope. + The scope for the component. + + + + Lifetime scope implementation. + + + + + Protects shared instances from concurrent access. Other members and the base class are threadsafe. + + + + + The tag applied to root scopes when no other tag is specified. + + + + + Create a lifetime scope for the provided components and nested beneath a parent. + + The tag applied to the . + Components used in the scope. + Parent scope. + + + + Create a root lifetime scope for the provided components. + + The tag applied to the . + Components used in the scope. + + + + Create a root lifetime scope for the provided components. + + Components used in the scope. + + + + Begin a new anonymous sub-scope. Instances created via the sub-scope + will be disposed along with it. + + A new lifetime scope. + + + + Begin a new tagged sub-scope. Instances created via the sub-scope + will be disposed along with it. + + The tag applied to the . + A new lifetime scope. + + + + Begin a new anonymous sub-scope, with additional components available to it. + Component instances created via the new scope + will be disposed along with it. + + Action on a + that adds component registations visible only in the new scope. + A new lifetime scope. + + IContainer cr = // ... + using (var lifetime = cr.BeginLifetimeScope(builder => { + builder.RegisterType<Foo>(); + builder.RegisterType<Bar>().As<IBar>(); }) + { + var foo = lifetime.Resolve<Foo>(); + } + + + + + Begin a new tagged sub-scope, with additional components available to it. + Component instances created via the new scope + will be disposed along with it. + + The tag applied to the . + Action on a + that adds component registations visible only in the new scope. + A new lifetime scope. + + IContainer cr = // ... + using (var lifetime = cr.BeginLifetimeScope("unitOfWork", builder => { + builder.RegisterType<Foo>(); + builder.RegisterType<Bar>().As<IBar>(); }) + { + var foo = lifetime.Resolve<Foo>(); + } + + + + + Resolve an instance of the provided registration within the context. + + The registration. + Parameters for the instance. + + The component instance. + + + + + + + Try to retrieve an instance based on a GUID key. If the instance + does not exist, invoke to create it. + + Key to look up. + Creation function. + An instance. + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Gets the service object of the specified type. + + An object that specifies the type of service object + to get. + + A service object of type .-or- null if there is + no service object of type . + + + + + The parent of this node of the hierarchy, or null. + + + + + The root of the sharing hierarchy. + + + + + The disposer associated with this container. Instances can be associated + with it manually if required. + + + + + Tag applied to the lifetime scope. + + The tag applied to this scope and the contexts generated when + it resolves component dependencies. + + + + Associates services with the components that provide them. + + + + + Fired when a new scope based on the current scope is beginning. + + + + + Fired when this scope is ending. + + + + + Fired when a resolve operation is beginning in this scope. + + + + + Attaches the component's lifetime to scopes matching a supplied expression. + + + + + Match scopes by comparing tags for equality. + + The tags applied to matching scopes. + + + + Given the most nested scope visible within the resolve operation, find + the scope for the component. + + The most nested visible scope. + The scope for the component. + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to No scope with a Tag matching '{0}' is visible from the scope in which the instance was requested. This generally indicates that a component registered as per-HTTP request is being requested by a SingleInstance() component (or a similar scenario.) Under the web integration always request dependencies from the DependencyResolver.Current or ILifetimeScopeProvider.RequestLifetime, never from the container itself.. + + + + + Attaches the component's lifetime to the root scope. + + + + + Given the most nested scope visible within the resolve operation, find + the scope for the component. + + The most nested visible scope. + The scope for the component. + + + + A property identified by name. When applied to a reflection-based + component, the name will be matched against property names. + + + + + Create a with the specified constant value. + + The name of the property. + The property value. + + + + The name of the property. + + + + + Fired before the activation process to allow parameters to be changed or an alternative + instance to be provided. + + + + + Initializes a new instance of the class. + + The context. + The component. + The parameters. + + + + The context in which the activation is occurring. + + + + + The component providing the instance being activated. + + + + + The parameters supplied to the activator. + + + + + A service was requested that cannot be provided by the container. To avoid this exception, either register a component + to provide the required service, check for service registration using IsRegistered(), or use the ResolveOptional() + method to resolve an optional dependency. + + This exception is fatal. See for more information. + + + + Initializes a new instance of the class. + + The service. + + + + Initializes a new instance of the class. + + The service. + The inner exception. + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to The requested service '{0}' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.. + + + + + Information about the ocurrence of a component being registered + with a container. + + + + + Create a new instance with a valid container and component registration. + + The container into which the registration + was made. + The component registration. + + + + The container into which the registration was made. + + + + + The component registration. + + + + + Describes a logical component within the container. + + + + + Create a new component registration. + + Unique identifier for the component. + Activator used to activate instances. + Determines how the component will be associated with its lifetime. + Whether the component is shared within its lifetime scope. + Whether the component instances are disposed at the end of their lifetimes. + Services the component provides. + Data associated with the component. + + + + Create a new component registration. + + Unique identifier for the component. + Activator used to activate instances. + Determines how the component will be associated with its lifetime. + Whether the component is shared within its lifetime scope. + Whether the component instances are disposed at the end of their lifetimes. + Services the component provides. + Data associated with the component. + The component registration upon which this registration is based. + + + + Called by the container when an instance is required. + + The context in which the instance will be activated. + Parameters for activation. + + + + Called by the container once an instance has been constructed. + + The context in which the instance was activated. + The parameters supplied to the activator. + The instance. + + + + Called by the container once an instance has been fully constructed, including + any requested objects that depend on the instance. + + The context in which the instance was activated. + The parameters supplied to the activator. + The instance. + + + + Describes the component in a human-readable form. + + A description of the component. + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + The component registration upon which this registration is based. + If this registration was created directly by the user, returns this. + + + + + A unique identifier for this component (shared in all sub-contexts.) + This value also appears in Services. + + + + + The activator used to create instances. + + + + + The lifetime associated with the component. + + + + + Whether the component instances are shared or not. + + + + + Whether the instances of the component should be disposed by the container. + + + + + The services provided by the component. + + + + + Additional data associated with the component. + + + + + Fired when a new instance is required. The instance can be + provided in order to skip the regular activator, by setting the Instance property in + the provided event arguments. + + + + + Fired when a new instance is being activated. The instance can be + wrapped or switched at this time by setting the Instance property in + the provided event arguments. + + + + + Fired when the activation process for a new instance is complete. + + + + + Catch circular dependencies that are triggered by post-resolve processing (e.g. 'OnActivated') + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Circular component dependency detected: {0}.. + + + + + Looks up a localized string similar to Probable circular dependency between factory-scoped components. Chain includes '{0}'. + + + + + An is a component context that sequences and monitors the multiple + activations that go into producing a single requested object graph. + + + + + Get or create and share an instance of in the . + + The scope in the hierarchy in which the operation will begin. + The component to resolve. + Parameters for the component. + The component instance. + + + + Raised when the entire operation is complete. + + + + + Raised when an instance is looked up within the operation. + + + + + A is a component context that sequences and monitors the multiple + activations that go into producing a single requested object graph. + + + + + Create an instance of in the provided scope. + + The most nested scope in which to begin the operation. The operation + can move upward to less nested scopes as components with wider sharing scopes are activated + + + + Resolve an instance of the provided registration within the context. + + The registration. + Parameters for the instance. + + The component instance. + + + + + + + Execute the complete resolve operation. + + + + + Continue building the object graph by instantiating in the + current . + + The current scope of the operation. + The component to activate. + The parameters for the component. + The resolved instance. + + + + + Associates services with the components that provide them. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to An exception was thrown while executing a resolve operation. See the InnerException for details.. + + + + + Looks up a localized string similar to Probable circular dependency between factory-scoped components. Chain includes '{0}'. + + + + + Looks up a localized string similar to This resolve operation has already ended. When registering components using lambdas, the IComponentContext 'c' parameter to the lambda cannot be stored. Instead, either resolve IComponentContext again from 'c', or resolve a Func<> based factory to create subsequent components from.. + + + + + Identifies a service according to a type to which it can be assigned. + + + + + Initializes a new instance of the class. + + Type of the service. + + + + Indicates whether the current object is equal to another object of the same type. + + An object to compare with this object. + + true if the current object is equal to the parameter; otherwise, false. + + + + + Determines whether the specified is equal to the current . + + The to compare with the current . + + true if the specified is equal to the current ; otherwise, false. + + The parameter is null. + + + + Serves as a hash function for a particular type. + + + A hash code for the current . + + + + + Return a new service of the same kind, but carrying + as the . + + The new service type. + A new service with the service type. + + + + Gets the type of the service. + + The type of the service. + + + + Gets a human-readable description of the service. + + The description. + + + + A handy unique service identifier type - all instances will be regarded as unequal. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The id. + + + + Determines whether the specified is equal to the current . + + The to compare with the current . + + true if the specified is equal to the current ; otherwise, false. + + The parameter is null. + + + + Serves as a hash function for a particular type. + + + A hash code for the current . + + + + + Provides a programmer-readable description of the identifying feature of the service. + + + + + + Registration source providing implicit collection/list/enumerable support. + + + + This registration source provides enumerable support to allow resolving + the set of all registered services of a given type. + + + What may not be immediately apparent is that it also means any time there + are no items of a particular type registered, it will always return an + empty set rather than or throwing an exception. + This is by design. + + + Consider the [possibly majority] use case where you're resolving a set + of message handlers or event handlers from the container. If there aren't + any handlers, you want an empty set - not or + an exception. It's valid to have no handlers registered. + + + This implicit support means other areas (like MVC support or manual + property injection) must take care to only request enumerable values they + expect to get something back for. In other words, "Don't ask the container + for something you don't expect to resolve." + + + + + + Retrieve registrations for an unregistered service, to be used + by the container. + + The service that was requested. + A function that will return existing registrations for a service. + Registrations providing the service. + + + + Generates activators for open generic types. + + + + + Represents a dependency that can be released by the dependent component. + + The service provided by the dependency. + + + Autofac automatically provides instances of whenever the + service is registered. + + + It is not necessary for , or the underlying component, to implement . + Disposing of the object is the correct way to handle cleanup of the dependency, + as this will dispose of any other components created indirectly as well. + + + When is resolved, a new is created for the + underlying , and tagged with the service matching , + generally a . This means that shared instances can be tied to this + scope by registering them as InstancePerMatchingLifetimeScope(new TypedService(typeof(T))). + + + + The component D below is disposable and implements IService: + + public class D : IService, IDisposable + { + // ... + } + + The dependent component C can dispose of the D instance whenever required by taking a dependency on + : + + public class C + { + IService _service; + + public C(Owned<IService> service) + { + _service = service; + } + + void DoWork() + { + _service.Value.DoSomething(); + } + + void OnFinished() + { + _service.Dispose(); + } + } + + In general, rather than depending on directly, components will depend on + System.Func<Owned<T>> in order to create and dispose of other components as required. + + + + + Create an instance of . + + The value representing the instance. + An IDisposable interface through which ownership can be released. + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + The owned value. + + + + + Generates registrations for services of type whenever the service + T is available. + + + + + Retrieve registrations for an unregistered service, to be used + by the container. + + The service that was requested. + A function that will return existing registrations for a service. + Registrations providing the service. + + + + When implemented by a component, an instance of the component will be resolved + and started as soon as the container is built. Autofac will not call the Start() + method when subsequent instances are resolved. If this behavior is required, use + an OnActivated() event handler instead. + + + For equivalent "Stop" functionality, implement . Autofac + will always dispose a component before any of its dependencies (except in the presence + of circular dependencies, in which case the components in the cycle are disposed in + reverse-construction order.) + + + + + Perform once-off startup processing. + + + + + Base class for user-defined modules. Modules can add a set of releated components + to a container () or attach cross-cutting functionality + to other components (. + Modules are given special support in the XML configuration feature - see + http://code.google.com/p/autofac/wiki/StructuringWithModules. + + Provides a user-friendly way to implement + via . + + Defining a module: + + public class DataAccessModule : Module + { + public string ConnectionString { get; set; } + + public override void Load(ContainerBuilder moduleBuilder) + { + moduleBuilder.RegisterGeneric(typeof(MyRepository<>)) + .As(typeof(IRepository<>)) + .InstancePerMatchingLifetimeScope(WebLifetime.Request); + + moduleBuilder.Register(c => new MyDbConnection(ConnectionString)) + .As<IDbConnection>() + .InstancePerMatchingLifetimeScope(WebLifetime.Request); + } + } + + Using the module: + + var builder = new ContainerBuilder(); + builder.RegisterModule(new DataAccessModule { ConnectionString = "..." }); + var container = builder.Build(); + var customers = container.Resolve<IRepository<Customer>>(); + + + + + + Apply the module to the component registry. + + Component registry to apply configuration to. + + + + Override to add registrations to the container. + + + Note that the ContainerBuilder parameter is unique to this module. + + The builder through which components can be + registered. + + + + Override to attach module-specific functionality to a + component registration. + + This method will be called for all existing and future component + registrations - ordering is not important. + The component registry. + The registration to attach functionality to. + + + + Override to perform module-specific processing on a registration source. + + This method will be called for all existing and future sources + - ordering is not important. + The component registry into which the source was added. + The registration source. + + + + The assembly in which the concrete module type is located. To avoid bugs whereby deriving from a module will + change the target assembly, this property can only be used by modules that inherit directly from + . + + + + + Configure the component so that instances are never disposed by the container. + + A registration builder allowing further configuration of the component. + + + + Configure the component so that instances that support IDisposable are + disposed by the container (default.) + + A registration builder allowing further configuration of the component. + + + + Configure the component so that every dependent component or call to Resolve() + gets a new, unique instance (default.) + + A registration builder allowing further configuration of the component. + + + + Configure the component so that every dependent component or call to Resolve() + gets the same, shared instance. + + A registration builder allowing further configuration of the component. + + + + Configure the component so that every dependent component or call to Resolve() + within a single ILifetimeScope gets the same, shared instance. Dependent components in + different lifetime scopes will get different instances. + + A registration builder allowing further configuration of the component. + + + + Configure the component so that every dependent component or call to Resolve() within + a ILifetimeScope tagged with any of the provided tags value gets the same, shared instance. + Dependent components in lifetime scopes that are children of the tagged scope will + share the parent's instance. If no appropriately tagged scope can be found in the + hierarchy an is thrown. + + Tag applied to matching lifetime scopes. + A registration builder allowing further configuration of the component. + + + + Configure the component so that every dependent component or call to Resolve() + within a ILifetimeScope created by an owned instance gets the same, shared instance. + Dependent components in lifetime scopes that are children of the owned instance scope will + share the parent's instance. If no appropriate owned instance scope can be found in the + hierarchy an is thrown. + + The service type provided by the component. + A registration builder allowing further configuration of the component. + + + + Configure the component so that every dependent component or call to Resolve() + within a ILifetimeScope created by an owned instance gets the same, shared instance. + Dependent components in lifetime scopes that are children of the owned instance scope will + share the parent's instance. If no appropriate owned instance scope can be found in the + hierarchy an is thrown. + + The service type provided by the component. + A registration builder allowing further configuration of the component. + + + + Configure the component so that every dependent component or call to Resolve() + within a ILifetimeScope created by an owned instance gets the same, shared instance. + Dependent components in lifetime scopes that are children of the owned instance scope will + share the parent's instance. If no appropriate owned instance scope can be found in the + hierarchy an is thrown. + + The service type provided by the component. + Key to associate with the component. + A registration builder allowing further configuration of the component. + + + + Configure the component so that every dependent component or call to Resolve() + within a ILifetimeScope created by an owned instance gets the same, shared instance. + Dependent components in lifetime scopes that are children of the owned instance scope will + share the parent's instance. If no appropriate owned instance scope can be found in the + hierarchy an is thrown. + + Key to associate with the component. + The service type provided by the component. + A registration builder allowing further configuration of the component. + + + + Configure the services that the component will provide. The generic parameter(s) to As() + will be exposed as TypedService instances. + + Service type. + A registration builder allowing further configuration of the component. + + + + Configure the services that the component will provide. The generic parameter(s) to As() + will be exposed as TypedService instances. + + Service type. + Service type. + A registration builder allowing further configuration of the component. + + + + Configure the services that the component will provide. The generic parameter(s) to As() + will be exposed as TypedService instances. + + Service type. + Service type. + Service type. + A registration builder allowing further configuration of the component. + + + + Configure the services that the component will provide. + + Service types to expose. + A registration builder allowing further configuration of the component. + + + + Configure the services that the component will provide. + + Services to expose. + A registration builder allowing further configuration of the component. + + + + Provide a textual name that can be used to retrieve the component. + + Named service to associate with the component. + The service type provided by the component. + A registration builder allowing further configuration of the component. + + + + Provide a textual name that can be used to retrieve the component. + + Named service to associate with the component. + The service type provided by the component. + A registration builder allowing further configuration of the component. + + + + Provide a key that can be used to retrieve the component. + + Key to associate with the component. + The service type provided by the component. + A registration builder allowing further configuration of the component. + + + + Provide a key that can be used to retrieve the component. + + Key to associate with the component. + The service type provided by the component. + A registration builder allowing further configuration of the component. + + + + Add a handler for the Preparing event. This event allows manipulating of the parameters + that will be provided to the component. + + The event handler. + A registration builder allowing further configuration of the component. + + + + Add a handler for the Activating event. + + The event handler. + A registration builder allowing further configuration of the component. + + + + Add a handler for the Activated event. + + The event handler. + A registration builder allowing further configuration of the component. + + + + Configure the component so that any properties whose types are registered in the + container will be wired to instances of the appropriate service. + + Set wiring options such as circular dependency wiring support. + A registration builder allowing further configuration of the component. + + + + Associates data with the component. + + Key by which the data can be located. + The data value. + A registration builder allowing further configuration of the component. + + + + Associates data with the component. + + The extended properties to associate with the component. + A registration builder allowing further configuration of the component. + + + + Associates data with the component. + + A type with properties whose names correspond to the + property names to configure. + A registration builder allowing further configuration of the component. + + + + The activator data. + + + + + The registration style. + + + + + The registration data. + + + + + Data common to all registrations made in the container, both direct (IComponentRegistration) + and dynamic (IRegistrationSource.) + + + + + Construct a RegistrationData instance. + + The default service that will be used if no others + are added. + + + + Add multiple services for the registration, overriding the default. + + The services to add. + If an empty collection is specified, this will still + clear the default service. + + + + Add a service to the registration, overriding the default. + + The service to add. + + + + Copies the contents of another RegistrationData object into this one. + + The data to copy. + When true, the default service + will be changed to that of the other. + + Thrown if is . + + + + + Empties the configured services. + + + + + The services explicitly assigned to the component. + + + + + The instance ownership assigned to the component. + + + + + The lifetime assigned to the component. + + + + + The sharing mode assigned to the component. + + + + + Extended properties assigned to the component. + + + + + Handlers for the Preparing event. + + + + + Handlers for the Activating event. + + + + + Handlers for the Activated event. + + + + + Adds registration syntax to the type. + + + + + Add a component to the container. + + The builder to register the component with. + The component to add. + + + + Add a registration source to the container. + + The builder to register the registration source via. + The registration source to add. + + + + Register an instance as a component. + + The type of the instance. + Container builder. + The instance to register. + Registration builder allowing the registration to be configured. + If no services are explicitly specified for the instance, the + static type will be used as the default service (i.e. *not* instance.GetType()). + + + + Register a component to be created through reflection. + + The type of the component implementation. + Container builder. + Registration builder allowing the registration to be configured. + + + + Register a component to be created through reflection. + + The type of the component implementation. + Container builder. + Registration builder allowing the registration to be configured. + + + + Register a delegate as a component. + + The type of the instance. + Container builder. + The delegate to register. + Registration builder allowing the registration to be configured. + + + + Register a delegate as a component. + + The type of the instance. + Container builder. + The delegate to register. + Registration builder allowing the registration to be configured. + + + + Register an un-parameterised generic type, e.g. Repository<>. + Concrete types will be made as they are requested, e.g. with Resolve<Repository<int>>(). + + Container builder. + The open generic implementation type. + Registration builder allowing the registration to be configured. + + + + Specifies that the component being registered should only be made the default for services + that have not already been registered. + + Registration limit type. + Registration style. + Activator data type. + Registration to set service mapping on. + Registration builder allowing the registration to be configured. + + + + Specifies that the components being registered should only be made the default for services + that have not already been registered. + + Registration limit type. + Registration style. + Registration to set service mapping on. + Registration builder allowing the registration to be configured. + + + + Register the types in an assembly. + + Container builder. + The assemblies from which to register types. + Registration builder allowing the registration to be configured. + + + + Register the types in a list. + + Container builder. + The types to register. + Registration builder allowing the registration to be configured. + + + + Specifies a subset of types to register from a scanned assembly. + + Registration limit type. + Registration style. + Activator data type. + Registration to filter types from. + Predicate that returns true for types to register. + Registration builder allowing the registration to be configured. + + + + Specifies how a type from a scanned assembly is mapped to a service. + + Registration limit type. + Registration style. + Activator data type. + Registration to set service mapping on. + Function mapping types to services. + Registration builder allowing the registration to be configured. + + + + Specifies how a type from a scanned assembly is mapped to a service. + + Registration limit type. + Registration style. + Activator data type. + Registration to set service mapping on. + Function mapping types to services. + Registration builder allowing the registration to be configured. + + + + Specifies how a type from a scanned assembly is mapped to a service. + + Registration limit type. + Registration style. + Activator data type. + Registration to set service mapping on. + Function mapping types to services. + Registration builder allowing the registration to be configured. + + + + Specifies how a type from a scanned assembly is mapped to a service. + + Registration limit type. + Registration style. + Activator data type. + Registration to set service mapping on. + Function mapping types to services. + Registration builder allowing the registration to be configured. + + + + Specifies that a type from a scanned assembly provides its own concrete type as a service. + + Registration limit type. + Registration to set service mapping on. + Registration builder allowing the registration to be configured. + + + + Specifies that a type provides its own concrete type as a service. + + Registration limit type. + Activator data type. + Registration to set service mapping on. + Registration builder allowing the registration to be configured. + + + + Specifies that a type provides its own concrete type as a service. + + Registration limit type. + Registration to set service mapping on. + Registration builder allowing the registration to be configured. + + + + Specify how a type from a scanned assembly provides metadata. + + Registration limit type. + Registration style. + Activator data type. + Registration to set metadata on. + A function mapping the type to a list of metadata items. + Registration builder allowing the registration to be configured. + + + + Use the properties of an attribute (or interface implemented by an attribute) on the scanned type + to provide metadata values. + + Inherited attributes are supported; however, there must be at most one matching attribute + in the inheritance chain. + The attribute applied to the scanned type. + Registration to set metadata on. + Registration builder allowing the registration to be configured. + + + + Specify how a type from a scanned assembly provides metadata. + + Registration limit type. + Registration style. + Activator data type. + Registration to set service mapping on. + Key of the metadata item. + A function retrieving the value of the item from the component type. + Registration builder allowing the registration to be configured. + + + + Specifies how a type from a scanned assembly is mapped to a named service. + + Registration to set service mapping on. + Service type provided by the component. + Function mapping types to service names. + Registration builder allowing the registration to be configured. + + + + Specifies how a type from a scanned assembly is mapped to a named service. + + Registration limit type. + Registration style. + Activator data type. + Registration to set service mapping on. + Service type provided by the component. + Function mapping types to service names. + Registration builder allowing the registration to be configured. + + + + Specifies how a type from a scanned assembly is mapped to a keyed service. + + Registration to set service mapping on. + Service type provided by the component. + Function mapping types to service keys. + Registration builder allowing the registration to be configured. + + + + Specifies how a type from a scanned assembly is mapped to a keyed service. + + Registration limit type. + Registration style. + Activator data type. + Registration to set service mapping on. + Service type provided by the component. + Function mapping types to service keys. + Registration builder allowing the registration to be configured. + + + + Specifies that a type from a scanned assembly is registered as providing all of its + implemented interfaces. + + Registration limit type. + Registration to set service mapping on. + Registration builder allowing the registration to be configured. + + + + Specifies that a type is registered as providing all of its implemented interfaces. + + Registration limit type. + Activator data type. + Registration to set service mapping on. + Registration builder allowing the registration to be configured. + + + + Specifies that a type is registered as providing all of its implemented interfaces. + + Registration limit type. + Registration to set service mapping on. + Registration builder allowing the registration to be configured. + + + + Set the policy used to find candidate constructors on the implementation type. + + Registration limit type. + Activator data type. + Registration style. + Registration to set policy on. + Policy to be used when searching for constructors. + A registration builder allowing further configuration of the component. + + + + Set the policy used to find candidate constructors on the implementation type. + + Registration limit type. + Activator data type. + Registration style. + Registration to set policy on. + A function that returns the constructors to select from. + A registration builder allowing further configuration of the component. + + + + Set the policy used to select from available constructors on the implementation type. + + Registration limit type. + Activator data type. + Registration style. + Registration to set policy on. + Constructor signature to match. + A registration builder allowing further configuration of the component. + + + + Set the policy used to select from available constructors on the implementation type. + + Registration limit type. + Registration style. + Activator data type. + Registration to set policy on. + Policy to be used when selecting a constructor. + A registration builder allowing further configuration of the component. + + + + Set the policy used to select from available constructors on the implementation type. + + Registration limit type. + Activator data type. + Registration style. + Registration to set policy on. + Expression demonstrating how the constructor is called. + A registration builder allowing further configuration of the component. + + + + Configure an explicit value for a constructor parameter. + + Registration limit type. + Registration style. + Activator data type. + Registration to set parameter on. + Name of a constructor parameter on the target type. + Value to supply to the parameter. + A registration builder allowing further configuration of the component. + + + + Configure an explicit value for a constructor parameter. + + Registration limit type. + Registration style. + Activator data type. + Registration to set parameter on. + The parameter to supply to the constructor. + A registration builder allowing further configuration of the component. + + + + Configure an explicit value for a constructor parameter. + + Registration limit type. + Registration style. + Activator data type. + Registration to set parameter on. + A predicate selecting the parameter to set. + + A registration builder allowing further configuration of the component. + + + + Configure explicit values for constructor parameters. + + Registration limit type. + Registration style. + Activator data type. + Registration to set parameter on. + The parameters to supply to the constructor. + A registration builder allowing further configuration of the component. + + + + Configure an explicit value for a property. + + Registration limit type. + Registration style. + Activator data type. + Registration to set property on. + Name of a property on the target type. + Value to supply to the property. + A registration builder allowing further configuration of the component. + + + + Configure an explicit value for a property. + + Registration limit type. + Registration style. + Activator data type. + Registration to set parameter on. + The property to supply. + A registration builder allowing further configuration of the component. + + + + Configure explicit values for properties. + + Registration limit type. + Registration style. + Activator data type. + Registration to set parameter on. + The properties to supply. + A registration builder allowing further configuration of the component. + + + + Sets the target of the registration (used for metadata generation.) + + The type of the limit. + The type of the activator data. + Registration style + Registration to set target for. + The target. + + Registration builder allowing the registration to be configured. + + + Thrown if or is . + + + + + Provide a handler to be called when the component is registered. + + Registration limit type. + Registration style. + Activator data type. + Registration add handler to. + The handler. + Registration builder allowing the registration to be configured. + + + + Provide a handler to be called when the component is registred. + + Registration limit type. + Registration style. + Registration add handler to. + The handler. + Registration builder allowing the registration to be configured. + + + + Specifies that a type from a scanned assembly is registered if it implements an interface + that closes the provided open generic interface type. + + Registration limit type. + Registration style. + Activator data type. + Registration to set service mapping on. + The open generic interface or base class type for which implementations will be found. + Registration builder allowing the registration to be configured. + + + + Filters the scanned types to include only those assignable to the provided + type. + + Registration limit type. + Registration style. + Activator data type. + Registration to filter types from. + The type or interface which all classes must be assignable from. + Registration builder allowing the registration to be configured. + + + + Filters the scanned types to include only those assignable to the provided + type. + + Registration to filter types from. + The type or interface which all classes must be assignable from. + Registration builder allowing the registration to be configured. + + + + Filters the scanned types to exclude the provided type. + + Registration to filter types from. + The concrete type to exclude. + Registration builder allowing the registration to be configured. + + + + Filters the scanned types to exclude the provided type, providing specific configuration for + the excluded type. + + Registration to filter types from. + Registration for the excepted type. + The concrete type to exclude. + Registration builder allowing the registration to be configured. + + + + Filters the scanned types to include only those in the namespace of the provided type + or one of its sub-namespaces. + + Registration to filter types from. + A type in the target namespace. + Registration builder allowing the registration to be configured. + + + + Filters the scanned types to include only those in the provided namespace + or one of its sub-namespaces. + + Registration limit type. + Registration style. + Activator data type. + Registration to filter types from. + The namespace from which types will be selected. + Registration builder allowing the registration to be configured. + + + + Adapt all components implementing service + to provide using the provided + function. + + Service type to adapt from. + Service type to adapt to. Must not be the + same as . + Container builder. + Function adapting to + service , given the context and parameters. + + + + Adapt all components implementing service + to provide using the provided + function. + + Service type to adapt from. + Service type to adapt to. Must not be the + same as . + Container builder. + Function adapting to + service , given the context. + + + + Adapt all components implementing service + to provide using the provided + function. + + Service type to adapt from. + Service type to adapt to. Must not be the + same as . + Container builder. + Function adapting to + service . + + + + Decorate all components implementing open generic service . + The and parameters must be different values. + + Container builder. + Service type being decorated. Must be an open generic type. + Service key or name associated with the components being decorated. + Service key or name given to the decorated components. + The type of the decorator. Must be an open generic type, and accept a parameter + of type , which will be set to the instance being decorated. + + + + Decorate all components implementing service + using the provided function. + The and parameters must be different values. + + Service type being decorated. + Container builder. + Function decorating a component instance that provides + , given the context and parameters. + Service key or name associated with the components being decorated. + Service key or name given to the decorated components. + + + + Decorate all components implementing service + using the provided function. + The and parameters must be different values. + + Service type being decorated. + Container builder. + Function decorating a component instance that provides + , given the context. + Service key or name associated with the components being decorated. + Service key or name given to the decorated components. + + + + Decorate all components implementing service + using the provided function. + The and parameters must be different values. + + Service type being decorated. + Container builder. + Function decorating a component instance that provides + . + Service key or name associated with the components being decorated. + Service key or name given to the decorated components. + + + + Run a supplied action instead of disposing instances when they're no + longer required. + + Registration limit type. + Activator data type. + Registration style. + Registration to set release action for. + An action to perform instead of disposing the instance. + Registration builder allowing the registration to be configured. + Only one release action can be configured per registration. + + + + Wraps a registration in an implicit and automatically + activates the registration after the container is built. + + Registration to set release action for. + Registration limit type. + Activator data type. + Registration style. + A registration builder allowing further configuration of the component. + + + While you can implement an to perform some logic at + container build time, sometimes you need to just activate a registered component and + that's it. This extension allows you to automatically activate a registration on + container build. No additional logic is executed and the resolved instance is not held + so container disposal will end up disposing of the instance. + + + Depending on how you register the lifetime of the component, you may get an exception + when you build the container - components that are scoped to specific lifetimes (like + ASP.NET components scoped to a request lifetime) will fail to resolve because the + appropriate lifetime is not available. + + + + + + Share one instance of the component within the context of a single + web/HTTP/API request. Only available for integration that supports + per-request dependencies (e.g., MVC, Web API, web forms, etc.). + + Registration limit type. + Registration style. + Activator data type. + The registration to configure. + Additional tags applied for matching lifetime scopes. + A registration builder allowing further configuration of the component. + + Thrown if is . + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to The instance registration '{0}' can support SingleInstance() sharing only.. + + + + + Looks up a localized string similar to A metadata attribute of type {0} was not found on {1}.. + + + + + Looks up a localized string similar to More than one metadata attribute of type {0} was found on {1}.. + + + + + Looks up a localized string similar to No matching constructor exists on type '{0}'.. + + + + + An activator builder with no parameters. + + + + + Return the provided activator. + + The activator to return. + + + + Gets the activator. + + + + + Registration style for individual components. + + + + + The id used for the registration. + + + + + Handlers to notify of the component registration event. + + + + + By default, new registrations override existing registrations as defaults. + If set to true, new registrations will not change existing defaults. + + + + + The component upon which this registration is based. + + + + + Used to build an from component registrations. + + + + var builder = new ContainerBuilder(); + + builder.RegisterType<Logger>() + .As<ILogger>() + .SingleInstance(); + + builder.Register(c => new MessageHandler(c.Resolve<ILogger>())); + + var container = builder.Build(); + // resolve components from container... + + + Most functionality is accessed + via extension methods in . + + + + + + Register a callback that will be invoked when the container is configured. + + This is primarily for extending the builder syntax. + Callback to execute. + + + + Create a new container with the component registrations that have been made. + + Options that influence the way the container is initialised. + + Build can only be called once per + - this prevents ownership issues for provided instances. + Build enables support for the relationship types that come with Autofac (e.g. + Func, Owned, Meta, Lazy, IEnumerable.) To exclude support for these types, + first create the container, then call Update() on the builder. + + A new container with the configured component registrations. + + + + Configure an existing container with the component registrations + that have been made. + + + Update can only be called once per + - this prevents ownership issues for provided instances. + + An existing container to make the registrations in. + + + + Configure an existing container with the component registrations + that have been made and allows additional build options to be specified. + + + Update can only be called once per + - this prevents ownership issues for provided instances. + + An existing container to make the registrations in. + Options that influence the way the container is updated. + + + + Configure an existing registry with the component registrations + that have been made. + + + Update can only be called once per + - this prevents ownership issues for provided instances. + + An existing registry to make the registrations in. + + + + A parameter identified by name. When applied to a reflection-based + component, will be matched against + the name of the component's constructor arguments. When applied to + a delegate-based component, the parameter can be accessed using + . + + + Component with parameter: + + public class MyComponent + { + public MyComponent(int amount) { ... } + } + + Providing the parameter: + + var builder = new ContainerBuilder(); + builder.RegisterType<MyComponent>(); + var container = builder.Build(); + var myComponent = container.Resolve<MyComponent>(new NamedParameter("amount", 123)); + + + + + + Create a with the specified constant value. + + The name of the parameter. + The parameter value. + + + + The name of the parameter. + + + + + Extension methods that simplify extraction of parameter values from + an where T is . + Each method returns the first matching parameter value, or throws an exception if + none is provided. + + + At configuration time, delegate registrations can retrieve parameter values using + the methods , and : + + builder.Register((c, p) => new FtpClient(p.Named<string>("server"))); + + These parameters can be provided at resolution time: + + container.Resolve<FtpClient>(new NamedParameter("server", "ftp.example.com")); + + Alternatively, the parameters can be provided via a Generated Factory - http://code.google.com/p/autofac/wiki/DelegateFactories. + + + + + Retrieve a named parameter value from a instance. + + The type to which the returned value will be cast. + The available parameters to choose from. + The name of the parameter to select. + The value of the selected parameter. + + + + + Retrieve a positional parameter value from a instance. + + The type to which the returned value will be cast. + The available parameters to choose from. + The zero-based position of the parameter to select. + The value of the selected parameter. + The position value is the one associated with the parameter when + it was constructed, not its index into the + sequence. + + + + + Retrieve a typed parameter value from a instance. + + The type to which the returned value will be cast. + The available parameters to choose from. + The value of the selected parameter. + + + + + A parameter that is identified according to an integer representing its + position in an argument list. When applied to a reflection-based + component, will be matched against + the indices of the component's constructor arguments. When applied to + a delegate-based component, the parameter can be accessed using + . + + + Component with parameter: + + public class MyComponent + { + public MyComponent(int amount) { ... } + } + + Providing the parameter: + + var builder = new ContainerBuilder(); + builder.RegisterType<MyComponent>(); + var container = builder.Build(); + var myComponent = container.Resolve<MyComponent>(new PositionalParameter(0, 123)); + + + + + + Construct a positional parameter with the specified constant value. + + The zero-based position of the parameter. + The parameter value. + + + + The zero-based position of the parameter. + + + + + Adds syntactic convenience methods to the interface. + + + + + Set any properties on that can be + resolved in the context. + + Type of instance. Used only to provide method chaining. + The context from which to resolve the service. + The instance to inject properties into. + . + + + + Set any null-valued properties on that can be + resolved by the container. + + Type of instance. Used only to provide method chaining. + The context from which to resolve the service. + The instance to inject properties into. + . + + + + Retrieve a service from the context. + + The type to which the result will be cast. + The context from which to resolve the service. + Name of the service. + + The component instance that provides the service. + + + + + + + Retrieve a service from the context. + + The type to which the result will be cast. + The context from which to resolve the service. + Name of the service. + The parameters. + + The component instance that provides the service. + + + + + + + Retrieve a service from the context. + + The type to which the result will be cast. + The context from which to resolve the service. + Name of the service. + The parameters. + + The component instance that provides the service. + + + + + + + Retrieve a service from the context. + + The type to which the result will be cast. + The context from which to resolve the service. + Key of the service. + + The component instance that provides the service. + + + + + + + Retrieve a service from the context. + + The type to which the result will be cast. + The context from which to resolve the service. + Key of the service. + The parameters. + + The component instance that provides the service. + + + + + + + Retrieve a service from the context. + + The type to which the result will be cast. + The context from which to resolve the service. + Key of the service. + The parameters. + + The component instance that provides the service. + + + + + + + Retrieve a service from the context. + + The service to retrieve. + The context from which to resolve the service. + The component instance that provides the service. + + + + + + Retrieve a service from the context. + + The type to which the result will be cast. + The context from which to resolve the service. + Parameters for the service. + + The component instance that provides the service. + + + + + + + Retrieve a service from the context. + + The type to which the result will be cast. + The context from which to resolve the service. + Parameters for the service. + + The component instance that provides the service. + + + + + + + Retrieve a service from the context. + + The context from which to resolve the service. + The service type. + + The component instance that provides the service. + + + + + + + Retrieve a service from the context. + + The context from which to resolve the service. + Parameters for the service. + The service type. + + The component instance that provides the service. + + + + + + + Retrieve a service from the context. + + The context from which to resolve the service. + Parameters for the service. + The service type. + + The component instance that provides the service. + + + + + + + Retrieve a service from the context. + + The context from which to resolve the service. + The service name. + Type of the service. + + The component instance that provides the service. + + + + + + + Retrieve a service from the context. + + The context from which to resolve the service. + Parameters for the service. + The service name. + Type of the service. + + The component instance that provides the service. + + + + + + + Retrieve a service from the context. + + The context from which to resolve the service. + Parameters for the service. + The service name. + Type of the service. + + The component instance that provides the service. + + + + + + + Retrieve a service from the context. + + The context from which to resolve the service. + Key of the service. + Type of the service. + + The component instance that provides the service. + + + + + + + Retrieve a service from the context. + + The context from which to resolve the service. + Key of the service. + Type of the service. + The parameters. + + The component instance that provides the service. + + + + + + + Retrieve a service from the context. + + The context from which to resolve the service. + Key of the service. + Type of the service. + The parameters. + + The component instance that provides the service. + + + + + + + Retrieve a service from the context. + + The context from which to resolve the service. + The service to resolve. + + The component instance that provides the service. + + + + + + + Retrieve a service from the context. + + The context from which to resolve the service. + Parameters for the service. + The service to resolve. + + The component instance that provides the service. + + + + + + + Retrieve a service from the context. + + The context from which to resolve the service. + Parameters for the service. + The service to resolve. + + The component instance that provides the service. + + + + + + + Retrieve a service from the context, or null if the service is not + registered. + + The context from which to resolve the service. + The service to resolve. + + The component instance that provides the service, or null. + + + + + + Retrieve a service from the context, or null if the service is not + registered. + + The context from which to resolve the service. + Parameters for the service. + The service to resolve. + + The component instance that provides the service, or null. + + + + + + Retrieve a service from the context, or null if the service is not + registered. + + The context from which to resolve the service. + Parameters for the service. + The service to resolve. + + The component instance that provides the service, or null. + + + + + + Retrieve a service from the context, or null if the service is not + registered. + + The context from which to resolve the service. + The name of the service. + The service to resolve. + + The component instance that provides the service, or null. + + + + + + Retrieve a service from the context, or null if the service is not + registered. + + The context from which to resolve the service. + Parameters for the service. + The name of the service. + The service to resolve. + + The component instance that provides the service, or null. + + + + + + Retrieve a service from the context, or null if the service is not + registered. + + The context from which to resolve the service. + Parameters for the service. + The name of the service. + The service to resolve. + + The component instance that provides the service, or null. + + + + + + Retrieve a service from the context, or null if the service is not + registered. + + The context from which to resolve the service. + The name of the service. + The service to resolve. + + The component instance that provides the service, or null. + + + + + + Retrieve a service from the context, or null if the service is not + registered. + + The context from which to resolve the service. + Parameters for the service. + The name of the service. + The service to resolve. + + The component instance that provides the service, or null. + + + + + + Retrieve a service from the context, or null if the service is not + registered. + + The context from which to resolve the service. + Parameters for the service. + The key of the service. + The service to resolve. + + The component instance that provides the service, or null. + + + + + + Retrieve a service from the context, or null if the service is not + registered. + + The context from which to resolve the service. + The type of the service. + + The component instance that provides the service, or null. + + + + + + Retrieve a service from the context, or null if the service is not + registered. + + The context from which to resolve the service. + Parameters for the service. + The type of the service. + + The component instance that provides the service, or null. + + + + + + Retrieve a service from the context, or null if the service is not + registered. + + The context from which to resolve the service. + Parameters for the service. + The type of the service. + + The component instance that provides the service, or null. + + + + + + Retrieve a service from the context, or null if the service is not + registered. + + The context from which to resolve the service. + The service. + + The component instance that provides the service, or null. + + + + + + Retrieve a service from the context, or null if the service is not + registered. + + The context from which to resolve the service. + The service. + Parameters for the service. + + The component instance that provides the service, or null. + + + + + + Retrieve a service from the context, or null if the service is not + registered. + + The context from which to resolve the service. + The service. + Parameters for the service. + + The component instance that provides the service, or null. + + + + + + Determine whether the specified service is available in the context. + + The context from which to resolve the service. + The service to test for the registration of. + True if the service is registered. + + + + Determine whether the specified service is available in the context. + + The context from which to resolve the service. + The service to test for the registration of. + True if the service is registered. + + + + Determine whether the specified service is available in the context. + + The context from which to resolve the service. + The name of the service to test for the registration of. + Type type of the service to test for the registration of. + True if the service is registered. + + + + Determine whether the specified service is available in the context. + + The context from which to resolve the service. + The name of the service to test for the registration of. + Type type of the service to test for the registration of. + True if the service is registered. + + + + Determine whether the specified service is available in the context. + + The context from which to resolve the service. + The key of the service to test for the registration of. + Type type of the service to test for the registration of. + True if the service is registered. + + + + Determine whether the specified service is available in the context. + + The context from which to resolve the service. + The key of the service to test for the registration of. + Type type of the service to test for the registration of. + True if the service is registered. + + + + Determine whether the specified service is available in the context. + + The context from which to resolve the service. + The service to test for the registration of. + True if the service is registered. + + + + Try to retrieve a service from the context. + + The context from which to resolve the service. + The service to resolve. + The resulting component instance providing the service, or null. + The parameters. + + True if a component providing the service is available. + + + + Thrown if is . + + + + + Try to retrieve a service from the context. + + The context from which to resolve the service. + The service to resolve. + The resulting component instance providing the service, or null. + + True if a component providing the service is available. + + + + + + Try to retrieve a service from the context. + + The context from which to resolve the service. + The service type to resolve. + The resulting component instance providing the service, or null. + + True if a component providing the service is available. + + + + + + Try to retrieve a service from the context. + + The service type to resolve. + The context from which to resolve the service. + The resulting component instance providing the service, or default(T). + + True if a component providing the service is available. + + + + + + Try to retrieve a service from the context. + + The context from which to resolve the service. + The name of the service to resolve. + The type of the service to resolve. + The resulting component instance providing the service, or null. + + True if a component providing the service is available. + + + + + + Try to retrieve a service from the context. + + The context from which to resolve the service. + The key of the service to resolve. + The type of the service to resolve. + The resulting component instance providing the service, or null. + + True if a component providing the service is available. + + + + + + Flexible parameter type allows arbitrary values to be retrieved + from the resolution context. + + + + + Create an instance of the ResolvedParameter class. + + A predicate that determines which parameters on a constructor will be supplied by this instance. + A function that supplies the parameter value given the context. + + + + Returns true if the parameter is able to provide a value to a particular site. + + Constructor, method, or property-mutator parameter. + The component context in which the value is being provided. + If the result is true, the valueProvider parameter will + be set to a function that will lazily retrieve the parameter value. If the result is false, + will be set to null. + True if a value can be supplied; otherwise, false. + + + + Construct a that will match parameters of type + and resolve for those parameters an implementation + registered with the name . + + The type of the parameter to match. + The name of the matching service to resolve. + A configured instance. + + + + + + Construct a that will match parameters of type + and resolve for those parameters an implementation + registered with the key . + + The type of the parameter to match. + The key of the matching service to resolve. + A configured instance. + + + + A parameter that can supply values to sites that exactly + match a specified type. When applied to a reflection-based + component, will be matched against + the types of the component's constructor arguments. When applied to + a delegate-based component, the parameter can be accessed using + . + + + Component with parameter: + + public class MyComponent + { + public MyComponent(int amount) { ... } + } + + Providing the parameter: + + var builder = new ContainerBuilder(); + builder.RegisterType<MyComponent>(); + var container = builder.Build(); + var myComponent = container.Resolve<MyComponent>(new TypedParameter(typeof(int), 123)); + + + + + + Create a typed parameter with the specified constant value. + + The exact type to match. + The parameter value. + + + + Shortcut for creating + by using the + + type to be used for the parameter + The parameter value. + new typed parameter + + + + The type against which targets are matched. + + + + + Extends with methods that are useful in + building scanning rules for . + + + + + Returns true if this type is in the namespace + or one of its sub-namespaces. + + The type to test. + The namespace to test. + True if this type is in the namespace + or one of its sub-namespaces; otherwise, false. + + + + Returns true if this type is in the same namespace as + or one of its sub-namespaces. + + The type to test. + True if this type is in the same namespace as + or one of its sub-namespaces; otherwise, false. + + + Determines whether the candidate type supports any base or + interface that closes the provided generic type. + + + + + + + Determines whether this type is assignable to . + + The type to test assignability to. + True if this type is assignable to references of type + ; otherwise, False. + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to The type '{0}' is not an open generic class or interface type.. + + + + + Extension methods for . + + + + + Safely returns the set of loadable types from an assembly. + + The from which to load types. + + The set of types from the , or the subset + of types that could be loaded if there was any error. + + + Thrown if is . + + + + + Helper methods used throughout the codebase. + + + + + Enforce that an argument is not null. Returns the + value if valid so that it can be used inline in + base initialiser syntax. + + + + + + + + + Enforce that sequence does not contain null. Returns the + value if valid so that it can be used inline in + base initialiser syntax. + + + The value. + The name. + + + + + Enforces that the provided object is non-null. + + + The value. + + + + + Enforce that an argument is not null or empty. Returns the + value if valid so that it can be used inline in + base initialiser syntax. + + The value. + The description. + + + + + Enforce that the argument is a delegate type. + + The type to test. + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to The argument '{0}' cannot be empty.. + + + + + Looks up a localized string similar to The object of type '{0}' cannot be null.. + + + + + Looks up a localized string similar to Type {0} returns void.. + + + + + Looks up a localized string similar to The sequence provided as argument '{0}' cannot contain null elements.. + + + + + Looks up a localized string similar to Type {0} is not a delegate type.. + + + + + Extension methods for reflection-related types. + + + + + Maps from a property-set-value parameter to the declaring property. + + Parameter to the property setter. + The property info on which the setter is specified. + True if the parameter is a property setter. + + + + Get a PropertyInfo object from an expression of the form + x => x.P. + + Type declaring the property. + The type of the property. + Expression mapping an instance of the + declaring type to the property value. + Property info. + + + + Get the MethodInfo for a method called in the + expression. + + Type on which the method is called. + Expression demonstrating how the method appears. + The method info for the called method. + + + + Gets the for the new operation called in the expression. + + The type on which the constructor is called. + Expression demonstrating how the constructor is called. + The for the called constructor. + + + + Retrieves a custom attribute of a specified type that is applied to a specified member, + and optionally inspects the ancestors of that member. + + The type of attribute to search for. + The member to inspect. + true to inspect the ancestors of element; otherwise, false. + A custom attribute that matches , or null if no such attribute is found. + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to The provided expression must be of the form () =>new X(), but the provided expression was {0}.. + + + + + Looks up a localized string similar to The provided expression must be of the form x =>x.M(), but the provided expression was {0}.. + + + + + Looks up a localized string similar to The provided expression must be of the form x =>x.P, but the provided expression was {0}.. + + + + + Adapts an action to the interface. + + + + + Joins the strings into one single string interspersing the elements with the separator (a-la + System.String.Join()). + + The elements. + The separator. + The joined string. + + + + Appends the item to the specified sequence. + + + The sequence. + The trailing item. + + + + + Prepends the item to the specified sequence. + + + The sequence. + The leading item. + + + + Returns the first concrete interface supported by the candidate type that + closes the provided open generic service type. + The type that is being checked for the interface. + The open generic type to locate. + The type of the interface. + + + + Looks for an interface on the candidate type that closes the provided open generic interface type. + + The type that is being checked for the interface. + The open generic service type to locate. + True if a closed implementation was found; otherwise false. + + + + Retrieve registrations for an unregistered service, to be used + by the container. + + The service that was requested. + A function that will return existing registrations for a service. + Registrations providing the service. + + + + Signal attribute for static analysis that indicates a helper method is + validating arguments for . + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Unable to generate a function to return type '{0}' with input parameter types [{1}]. The input parameter type list has duplicate types. Try registering a custom delegate type instead of using a generic Func relationship.. + + + + + Looks up a localized string similar to Delegate Support (Func<T>and Custom Delegates). + + + + diff --git a/lib/autofac/License.txt b/lib/autofac/License.txt index 593b440e1a5..54ab1fbdbe5 100644 --- a/lib/autofac/License.txt +++ b/lib/autofac/License.txt @@ -1,27 +1,27 @@ -Autofac IoC Container -Copyright (c) 2007-2012 Autofac Contributors -http://code.google.com/p/autofac/wiki/Contributing - -Other software included in this distribution is owned and -licensed separately, see the included license files for details. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +Autofac IoC Container +Copyright (c) 2007-2012 Autofac Contributors +http://code.google.com/p/autofac/wiki/Contributing + +Other software included in this distribution is owned and +licensed separately, see the included license files for details. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/lib/dlr/LICENSE.APACHE.html b/lib/dlr/LICENSE.APACHE.html index d0ab55ef59f..7b8e3f76932 100644 --- a/lib/dlr/LICENSE.APACHE.html +++ b/lib/dlr/LICENSE.APACHE.html @@ -1,214 +1,214 @@ - - - -Apache License, Version 2.0 - - - - -
-

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

-

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

-

1. Definitions.

-

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

-

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

-

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

-

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

-

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

-

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

-

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

-

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

-

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

-

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

-

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

-

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

-

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

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

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

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

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

-

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

-

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

-

7. Disclaimer of Warranty. -Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. -

-

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

-

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

-
- -

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

- - - - + + + +Apache License, Version 2.0 + + + + +
+

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

+

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

+

1. Definitions.

+

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

+

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

+

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

+

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

+

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

+

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

+

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

+

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

+

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

+

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

+

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

+

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

+

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

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

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

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

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

+

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

+

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

+

7. Disclaimer of Warranty. +Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. +

+

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

+

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

+
+ +

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

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

- This is the version using unrolled loops. -

-
- - Method "mainQSort3", file "blocksort.c", BZip2 1.0.2 - - - - The number of uncompressed bytes being held in the buffer. - - - - I am thinking this may be useful in a Stream that uses this - compressor class. In the Close() method on the stream it could - check this value to see if anything has been written at all. You - may think the stream could easily track the number of bytes it - wrote, which would eliminate the need for this. But, there is the - case where the stream writes a complete block, and it is full, and - then writes no more. In that case the stream may want to check. - - - - - Array instance identical to sfmap, both are used only - temporarily and independently, so we do not need to allocate - additional memory. - - - - A read-only decorator stream that performs BZip2 decompression on Read. - - - - - Create a BZip2InputStream, wrapping it around the given input Stream. - - - - The input stream will be closed when the BZip2InputStream is closed. - - - The stream from which to read compressed data - - - - Create a BZip2InputStream with the given stream, and - specifying whether to leave the wrapped stream open when - the BZip2InputStream is closed. - - The stream from which to read compressed data - - Whether to leave the input stream open, when the BZip2InputStream closes. - - - - - This example reads a bzip2-compressed file, decompresses it, - and writes the decompressed data into a newly created file. - - - var fname = "logfile.log.bz2"; - using (var fs = File.OpenRead(fname)) - { - using (var decompressor = new Ionic.BZip2.BZip2InputStream(fs)) - { - var outFname = fname + ".decompressed"; - using (var output = File.Create(outFname)) - { - byte[] buffer = new byte[2048]; - int n; - while ((n = decompressor.Read(buffer, 0, buffer.Length)) > 0) - { - output.Write(buffer, 0, n); - } - } - } - } - - - - - - Read data from the stream. - - - - - To decompress a BZip2 data stream, create a BZip2InputStream, - providing a stream that reads compressed data. Then call Read() on - that BZip2InputStream, and the data read will be decompressed - as you read. - - - - A BZip2InputStream can be used only for Read(), not for Write(). - - - - The buffer into which the read data should be placed. - the offset within that data array to put the first byte read. - the number of bytes to read. - the number of bytes actually read - - - - Read a single byte from the stream. - - the byte read from the stream, or -1 if EOF - - - - Flush the stream. - - - - - Calling this method always throws a . - - this is irrelevant, since it will always throw! - this is irrelevant, since it will always throw! - irrelevant! - - - - Calling this method always throws a . - - this is irrelevant, since it will always throw! - - - - Calling this method always throws a . - - this parameter is never used - this parameter is never used - this parameter is never used - - - - Dispose the stream. - - - indicates whether the Dispose method was invoked by user code. - - - - - Close the stream. - - - - - Read n bits from input, right justifying the result. - - - - For example, if you read 1 bit, the result is either 0 - or 1. - - - - The number of bits to read, always between 1 and 32. - - - - Called by createHuffmanDecodingTables() exclusively. - - - Called by recvDecodingTables() exclusively. - - - - Indicates whether the stream can be read. - - - The return value depends on whether the captive stream supports reading. - - - - - Indicates whether the stream supports Seek operations. - - - Always returns false. - - - - - Indicates whether the stream can be written. - - - The return value depends on whether the captive stream supports writing. - - - - - Reading this property always throws a . - - - - - The position of the stream pointer. - - - - Setting this property always throws a . Reading will return the - total number of uncompressed bytes read in. - - - - - Compressor State - - - - Freq table collected to save a pass over the data during - decompression. - - - Initializes the tt array. - - This method is called when the required length of the array is known. - I don't initialize it at construction time to avoid unneccessary - memory allocation when compressing small files. - - - - A write-only decorator stream that compresses data as it is - written using the BZip2 algorithm. - - - - - Constructs a new BZip2OutputStream, that sends its - compressed output to the given output stream. - - - - The destination stream, to which compressed output will be sent. - - - - - This example reads a file, then compresses it with bzip2 file, - and writes the compressed data into a newly created file. - - - var fname = "logfile.log"; - using (var fs = File.OpenRead(fname)) - { - var outFname = fname + ".bz2"; - using (var output = File.Create(outFname)) - { - using (var compressor = new Ionic.BZip2.BZip2OutputStream(output)) - { - byte[] buffer = new byte[2048]; - int n; - while ((n = fs.Read(buffer, 0, buffer.Length)) > 0) - { - compressor.Write(buffer, 0, n); - } - } - } - } - - - - - - Constructs a new BZip2OutputStream with specified blocksize. - - the destination stream. - - The blockSize in units of 100000 bytes. - The valid range is 1..9. - - - - - Constructs a new BZip2OutputStream. - - the destination stream. - - whether to leave the captive stream open upon closing this stream. - - - - - Constructs a new BZip2OutputStream with specified blocksize, - and explicitly specifies whether to leave the wrapped stream open. - - - the destination stream. - - The blockSize in units of 100000 bytes. - The valid range is 1..9. - - - whether to leave the captive stream open upon closing this stream. - - - - - Close the stream. - - - - This may or may not close the underlying stream. Check the - constructors that accept a bool value. - - - - - - Flush the stream. - - - - - Write data to the stream. - - - - - Use the BZip2OutputStream to compress data while writing: - create a BZip2OutputStream with a writable output stream. - Then call Write() on that BZip2OutputStream, providing - uncompressed data as input. The data sent to the output stream will - be the compressed form of the input data. - - - - A BZip2OutputStream can be used only for Write() not for Read(). - - - - - The buffer holding data to write to the stream. - the offset within that data array to find the first byte to write. - the number of bytes to write. - - - - Calling this method always throws a . - - this is irrelevant, since it will always throw! - this is irrelevant, since it will always throw! - irrelevant! - - - - Calling this method always throws a . - - this is irrelevant, since it will always throw! - - - - Calling this method always throws a . - - this parameter is never used - this parameter is never used - this parameter is never used - never returns anything; always throws - - - - The blocksize parameter specified at construction time. - - - - - Indicates whether the stream can be read. - - - The return value is always false. - - - - - Indicates whether the stream supports Seek operations. - - - Always returns false. - - - - - Indicates whether the stream can be written. - - - The return value should always be true, unless and until the - object is disposed and closed. - - - - - Reading this property always throws a . - - - - - The position of the stream pointer. - - - - Setting this property always throws a . Reading will return the - total number of uncompressed bytes written through. - - - - - A write-only decorator stream that compresses data as it is - written using the BZip2 algorithm. This stream compresses by - block using multiple threads. - - - This class performs BZIP2 compression through writing. For - more information on the BZIP2 algorithm, see - . - - - - This class is similar to , - except that this implementation uses an approach that employs multiple - worker threads to perform the compression. On a multi-cpu or multi-core - computer, the performance of this class can be significantly higher than - the single-threaded BZip2OutputStream, particularly for larger streams. - How large? Anything over 10mb is a good candidate for parallel - compression. - - - - The tradeoff is that this class uses more memory and more CPU than the - vanilla BZip2OutputStream. Also, for small files, the - ParallelBZip2OutputStream can be much slower than the vanilla - BZip2OutputStream, because of the overhead associated to using the - thread pool. - - - - - - - Constructs a new ParallelBZip2OutputStream, that sends its - compressed output to the given output stream. - - - - The destination stream, to which compressed output will be sent. - - - - - This example reads a file, then compresses it with bzip2 file, - and writes the compressed data into a newly created file. - - - var fname = "logfile.log"; - using (var fs = File.OpenRead(fname)) - { - var outFname = fname + ".bz2"; - using (var output = File.Create(outFname)) - { - using (var compressor = new Ionic.BZip2.ParallelBZip2OutputStream(output)) - { - byte[] buffer = new byte[2048]; - int n; - while ((n = fs.Read(buffer, 0, buffer.Length)) > 0) - { - compressor.Write(buffer, 0, n); - } - } - } - } - - - - - - Constructs a new ParallelBZip2OutputStream with specified blocksize. - - the destination stream. - - The blockSize in units of 100000 bytes. - The valid range is 1..9. - - - - - Constructs a new ParallelBZip2OutputStream. - - the destination stream. - - whether to leave the captive stream open upon closing this stream. - - - - - Constructs a new ParallelBZip2OutputStream with specified blocksize, - and explicitly specifies whether to leave the wrapped stream open. - - - the destination stream. - - The blockSize in units of 100000 bytes. - The valid range is 1..9. - - - whether to leave the captive stream open upon closing this stream. - - - - - Close the stream. - - - - This may or may not close the underlying stream. Check the - constructors that accept a bool value. - - - - - - Flush the stream. - - - - - Write data to the stream. - - - - - Use the ParallelBZip2OutputStream to compress data while - writing: create a ParallelBZip2OutputStream with a writable - output stream. Then call Write() on that - ParallelBZip2OutputStream, providing uncompressed data as - input. The data sent to the output stream will be the compressed - form of the input data. - - - - A ParallelBZip2OutputStream can be used only for - Write() not for Read(). - - - - - The buffer holding data to write to the stream. - the offset within that data array to find the first byte to write. - the number of bytes to write. - - - - Calling this method always throws a . - - this is irrelevant, since it will always throw! - this is irrelevant, since it will always throw! - irrelevant! - - - - Calling this method always throws a . - - this is irrelevant, since it will always throw! - - - - Calling this method always throws a . - - this parameter is never used - this parameter is never used - this parameter is never used - never returns anything; always throws - - - - The maximum number of concurrent compression worker threads to use. - - - - - This property sets an upper limit on the number of concurrent worker - threads to employ for compression. The implementation of this stream - employs multiple threads from the .NET thread pool, via - ThreadPool.QueueUserWorkItem(), to compress the incoming data by - block. As each block of data is compressed, this stream re-orders the - compressed blocks and writes them to the output stream. - - - - A higher number of workers enables a higher degree of - parallelism, which tends to increase the speed of compression on - multi-cpu computers. On the other hand, a higher number of buffer - pairs also implies a larger memory consumption, more active worker - threads, and a higher cpu utilization for any compression. This - property enables the application to limit its memory consumption and - CPU utilization behavior depending on requirements. - - - - By default, DotNetZip allocates 4 workers per CPU core, subject to the - upper limit specified in this property. For example, suppose the - application sets this property to 16. Then, on a machine with 2 - cores, DotNetZip will use 8 workers; that number does not exceed the - upper limit specified by this property, so the actual number of - workers used will be 4 * 2 = 8. On a machine with 4 cores, DotNetZip - will use 16 workers; again, the limit does not apply. On a machine - with 8 cores, DotNetZip will use 16 workers, because of the limit. - - - - For each compression "worker thread" that occurs in parallel, there is - up to 2mb of memory allocated, for buffering and processing. The - actual number depends on the property. - - - - CPU utilization will also go up with additional workers, because a - larger number of buffer pairs allows a larger number of background - threads to compress in parallel. If you find that parallel - compression is consuming too much memory or CPU, you can adjust this - value downward. - - - - The default value is 16. Different values may deliver better or - worse results, depending on your priorities and the dynamic - performance characteristics of your storage and compute resources. - - - - The application can set this value at any time, but it is effective - only before the first call to Write(), which is when the buffers are - allocated. - - - - - - The blocksize parameter specified at construction time. - - - - - Indicates whether the stream can be read. - - - The return value is always false. - - - - - Indicates whether the stream supports Seek operations. - - - Always returns false. - - - - - Indicates whether the stream can be written. - - - The return value depends on whether the captive stream supports writing. - - - - - Reading this property always throws a . - - - - - The position of the stream pointer. - - - - Setting this property always throws a . Reading will return the - total number of uncompressed bytes written through. - - - - - The total number of bytes written out by the stream. - - - This value is meaningful only after a call to Close(). - - - - - Returns the "random" number at a specific index. - - the index - the random number - - - - A class for compressing and decompressing streams using the Deflate algorithm. - - - - - - The DeflateStream is a Decorator on a . It adds DEFLATE compression or decompression to any - stream. - - - - Using this stream, applications can compress or decompress data via stream - Read and Write operations. Either compresssion or decompression - can occur through either reading or writing. The compression format used is - DEFLATE, which is documented in IETF RFC 1951, "DEFLATE - Compressed Data Format Specification version 1.3.". - - - - This class is similar to , except that - ZlibStream adds the RFC - 1950 - ZLIB framing bytes to a compressed stream when compressing, or - expects the RFC1950 framing bytes when decompressing. The DeflateStream - does not. - - - - - - - - - - Create a DeflateStream using the specified CompressionMode. - - - - When mode is CompressionMode.Compress, the DeflateStream will use - the default compression level. The "captive" stream will be closed when - the DeflateStream is closed. - - - - This example uses a DeflateStream to compress data from a file, and writes - the compressed data to another file. - - using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - { - using (var raw = System.IO.File.Create(fileToCompress + ".deflated")) - { - using (Stream compressor = new DeflateStream(raw, CompressionMode.Compress)) - { - byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - int n; - while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - { - compressor.Write(buffer, 0, n); - } - } - } - } - - - - Using input As Stream = File.OpenRead(fileToCompress) - Using raw As FileStream = File.Create(fileToCompress & ".deflated") - Using compressor As Stream = New DeflateStream(raw, CompressionMode.Compress) - Dim buffer As Byte() = New Byte(4096) {} - Dim n As Integer = -1 - Do While (n <> 0) - If (n > 0) Then - compressor.Write(buffer, 0, n) - End If - n = input.Read(buffer, 0, buffer.Length) - Loop - End Using - End Using - End Using - - - The stream which will be read or written. - Indicates whether the DeflateStream will compress or decompress. - - - - Create a DeflateStream using the specified CompressionMode and the specified CompressionLevel. - - - - - - When mode is CompressionMode.Decompress, the level parameter is - ignored. The "captive" stream will be closed when the DeflateStream is - closed. - - - - - - - This example uses a DeflateStream to compress data from a file, and writes - the compressed data to another file. - - - using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - { - using (var raw = System.IO.File.Create(fileToCompress + ".deflated")) - { - using (Stream compressor = new DeflateStream(raw, - CompressionMode.Compress, - CompressionLevel.BestCompression)) - { - byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - int n= -1; - while (n != 0) - { - if (n > 0) - compressor.Write(buffer, 0, n); - n= input.Read(buffer, 0, buffer.Length); - } - } - } - } - - - - Using input As Stream = File.OpenRead(fileToCompress) - Using raw As FileStream = File.Create(fileToCompress & ".deflated") - Using compressor As Stream = New DeflateStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) - Dim buffer As Byte() = New Byte(4096) {} - Dim n As Integer = -1 - Do While (n <> 0) - If (n > 0) Then - compressor.Write(buffer, 0, n) - End If - n = input.Read(buffer, 0, buffer.Length) - Loop - End Using - End Using - End Using - - - The stream to be read or written while deflating or inflating. - Indicates whether the DeflateStream will compress or decompress. - A tuning knob to trade speed for effectiveness. - - - - Create a DeflateStream using the specified - CompressionMode, and explicitly specify whether the - stream should be left open after Deflation or Inflation. - - - - - - This constructor allows the application to request that the captive stream - remain open after the deflation or inflation occurs. By default, after - Close() is called on the stream, the captive stream is also - closed. In some cases this is not desired, for example if the stream is a - memory stream that will be re-read after compression. Specify true for - the parameter to leave the stream open. - - - - The DeflateStream will use the default compression level. - - - - See the other overloads of this constructor for example code. - - - - - The stream which will be read or written. This is called the - "captive" stream in other places in this documentation. - - - - Indicates whether the DeflateStream will compress or decompress. - - - true if the application would like the stream to - remain open after inflation/deflation. - - - - Create a DeflateStream using the specified CompressionMode - and the specified CompressionLevel, and explicitly specify whether - the stream should be left open after Deflation or Inflation. - - - - - - When mode is CompressionMode.Decompress, the level parameter is ignored. - - - - This constructor allows the application to request that the captive stream - remain open after the deflation or inflation occurs. By default, after - Close() is called on the stream, the captive stream is also - closed. In some cases this is not desired, for example if the stream is a - that will be re-read after - compression. Specify true for the parameter - to leave the stream open. - - - - - - - This example shows how to use a DeflateStream to compress data from - a file, and store the compressed data into another file. - - - using (var output = System.IO.File.Create(fileToCompress + ".deflated")) - { - using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - { - using (Stream compressor = new DeflateStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, true)) - { - byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - int n= -1; - while (n != 0) - { - if (n > 0) - compressor.Write(buffer, 0, n); - n= input.Read(buffer, 0, buffer.Length); - } - } - } - // can write additional data to the output stream here - } - - - - Using output As FileStream = File.Create(fileToCompress & ".deflated") - Using input As Stream = File.OpenRead(fileToCompress) - Using compressor As Stream = New DeflateStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, True) - Dim buffer As Byte() = New Byte(4096) {} - Dim n As Integer = -1 - Do While (n <> 0) - If (n > 0) Then - compressor.Write(buffer, 0, n) - End If - n = input.Read(buffer, 0, buffer.Length) - Loop - End Using - End Using - ' can write additional data to the output stream here. - End Using - - - The stream which will be read or written. - Indicates whether the DeflateStream will compress or decompress. - true if the application would like the stream to remain open after inflation/deflation. - A tuning knob to trade speed for effectiveness. - - - - Dispose the stream. - - - - This may or may not result in a Close() call on the captive - stream. See the constructors that have a leaveOpen parameter - for more information. - - - Application code won't call this code directly. This method may be - invoked in two distinct scenarios. If disposing == true, the method - has been called directly or indirectly by a user's code, for example - via the public Dispose() method. In this case, both managed and - unmanaged resources can be referenced and disposed. If disposing == - false, the method has been called by the runtime from inside the - object finalizer and this method should not reference other objects; - in that case only unmanaged resources must be referenced or - disposed. - - - - true if the Dispose method was invoked by user code. - - - - - Flush the stream. - - - - - Read data from the stream. - - - - - If you wish to use the DeflateStream to compress data while - reading, you can create a DeflateStream with - CompressionMode.Compress, providing an uncompressed data stream. - Then call Read() on that DeflateStream, and the data read will be - compressed as you read. If you wish to use the DeflateStream to - decompress data while reading, you can create a DeflateStream with - CompressionMode.Decompress, providing a readable compressed data - stream. Then call Read() on that DeflateStream, and the data read - will be decompressed as you read. - - - - A DeflateStream can be used for Read() or Write(), but not both. - - - - The buffer into which the read data should be placed. - the offset within that data array to put the first byte read. - the number of bytes to read. - the number of bytes actually read - - - - Calling this method always throws a . - - this is irrelevant, since it will always throw! - this is irrelevant, since it will always throw! - irrelevant! - - - - Calling this method always throws a . - - this is irrelevant, since it will always throw! - - - - Write data to the stream. - - - - - If you wish to use the DeflateStream to compress data while - writing, you can create a DeflateStream with - CompressionMode.Compress, and a writable output stream. Then call - Write() on that DeflateStream, providing uncompressed data - as input. The data sent to the output stream will be the compressed form - of the data written. If you wish to use the DeflateStream to - decompress data while writing, you can create a DeflateStream with - CompressionMode.Decompress, and a writable output stream. Then - call Write() on that stream, providing previously compressed - data. The data sent to the output stream will be the decompressed form of - the data written. - - - - A DeflateStream can be used for Read() or Write(), - but not both. - - - - - The buffer holding data to write to the stream. - the offset within that data array to find the first byte to write. - the number of bytes to write. - - - - Compress a string into a byte array using DEFLATE (RFC 1951). - - - - Uncompress it with . - - - DeflateStream.UncompressString(byte[]) - DeflateStream.CompressBuffer(byte[]) - GZipStream.CompressString(string) - ZlibStream.CompressString(string) - - - A string to compress. The string will first be encoded - using UTF8, then compressed. - - - The string in compressed form - - - - Compress a byte array into a new byte array using DEFLATE. - - - - Uncompress it with . - - - DeflateStream.CompressString(string) - DeflateStream.UncompressBuffer(byte[]) - GZipStream.CompressBuffer(byte[]) - ZlibStream.CompressBuffer(byte[]) - - - A buffer to compress. - - - The data in compressed form - - - - Uncompress a DEFLATE'd byte array into a single string. - - - DeflateStream.CompressString(String) - DeflateStream.UncompressBuffer(byte[]) - GZipStream.UncompressString(byte[]) - ZlibStream.UncompressString(byte[]) - - - A buffer containing DEFLATE-compressed data. - - - The uncompressed string - - - - Uncompress a DEFLATE'd byte array into a byte array. - - - DeflateStream.CompressBuffer(byte[]) - DeflateStream.UncompressString(byte[]) - GZipStream.UncompressBuffer(byte[]) - ZlibStream.UncompressBuffer(byte[]) - - - A buffer containing data that has been compressed with DEFLATE. - - - The data in uncompressed form - - - - This property sets the flush behavior on the stream. - - See the ZLIB documentation for the meaning of the flush behavior. - - - - - The size of the working buffer for the compression codec. - - - - - The working buffer is used for all stream operations. The default size is - 1024 bytes. The minimum size is 128 bytes. You may get better performance - with a larger buffer. Then again, you might not. You would have to test - it. - - - - Set this before the first call to Read() or Write() on the - stream. If you try to set it afterwards, it will throw. - - - - - - The ZLIB strategy to be used during compression. - - - - By tweaking this parameter, you may be able to optimize the compression for - data with particular characteristics. - - - - Returns the total number of bytes input so far. - - - Returns the total number of bytes output so far. - - - - Indicates whether the stream can be read. - - - The return value depends on whether the captive stream supports reading. - - - - - Indicates whether the stream supports Seek operations. - - - Always returns false. - - - - - Indicates whether the stream can be written. - - - The return value depends on whether the captive stream supports writing. - - - - - Reading this property always throws a . - - - - - The position of the stream pointer. - - - - Setting this property always throws a . Reading will return the total bytes - written out, if used in writing, or the total bytes read in, if used in - reading. The count may refer to compressed bytes or uncompressed bytes, - depending on how you've used the stream. - - - - - A class for compressing and decompressing GZIP streams. - - - - - The GZipStream is a Decorator on a - . It adds GZIP compression or decompression to any - stream. - - - - Like the System.IO.Compression.GZipStream in the .NET Base Class Library, the - Ionic.Zlib.GZipStream can compress while writing, or decompress while - reading, but not vice versa. The compression method used is GZIP, which is - documented in IETF RFC - 1952, "GZIP file format specification version 4.3". - - - A GZipStream can be used to decompress data (through Read()) or - to compress data (through Write()), but not both. - - - - If you wish to use the GZipStream to compress data, you must wrap it - around a write-able stream. As you call Write() on the GZipStream, the - data will be compressed into the GZIP format. If you want to decompress data, - you must wrap the GZipStream around a readable stream that contains an - IETF RFC 1952-compliant stream. The data will be decompressed as you call - Read() on the GZipStream. - - - - Though the GZIP format allows data from multiple files to be concatenated - together, this stream handles only a single segment of GZIP format, typically - representing a single file. - - - - This class is similar to and . - ZlibStream handles RFC1950-compliant streams. - handles RFC1951-compliant streams. This class handles RFC1952-compliant streams. - - - - - - - - - - The last modified time for the GZIP stream. - - - - GZIP allows the storage of a last modified time with each GZIP entry. - When compressing data, you can set this before the first call to - Write(). When decompressing, you can retrieve this value any time - after the first call to Read(). - - - - - Create a GZipStream using the specified CompressionMode. - - - - - When mode is CompressionMode.Compress, the GZipStream will use the - default compression level. - - - - As noted in the class documentation, the CompressionMode (Compress - or Decompress) also establishes the "direction" of the stream. A - GZipStream with CompressionMode.Compress works only through - Write(). A GZipStream with - CompressionMode.Decompress works only through Read(). - - - - - - This example shows how to use a GZipStream to compress data. - - using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - { - using (var raw = System.IO.File.Create(outputFile)) - { - using (Stream compressor = new GZipStream(raw, CompressionMode.Compress)) - { - byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - int n; - while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - { - compressor.Write(buffer, 0, n); - } - } - } - } - - - Dim outputFile As String = (fileToCompress & ".compressed") - Using input As Stream = File.OpenRead(fileToCompress) - Using raw As FileStream = File.Create(outputFile) - Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress) - Dim buffer As Byte() = New Byte(4096) {} - Dim n As Integer = -1 - Do While (n <> 0) - If (n > 0) Then - compressor.Write(buffer, 0, n) - End If - n = input.Read(buffer, 0, buffer.Length) - Loop - End Using - End Using - End Using - - - - - This example shows how to use a GZipStream to uncompress a file. - - private void GunZipFile(string filename) - { - if (!filename.EndsWith(".gz)) - throw new ArgumentException("filename"); - var DecompressedFile = filename.Substring(0,filename.Length-3); - byte[] working = new byte[WORKING_BUFFER_SIZE]; - int n= 1; - using (System.IO.Stream input = System.IO.File.OpenRead(filename)) - { - using (Stream decompressor= new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, true)) - { - using (var output = System.IO.File.Create(DecompressedFile)) - { - while (n !=0) - { - n= decompressor.Read(working, 0, working.Length); - if (n > 0) - { - output.Write(working, 0, n); - } - } - } - } - } - } - - - - Private Sub GunZipFile(ByVal filename as String) - If Not (filename.EndsWith(".gz)) Then - Throw New ArgumentException("filename") - End If - Dim DecompressedFile as String = filename.Substring(0,filename.Length-3) - Dim working(WORKING_BUFFER_SIZE) as Byte - Dim n As Integer = 1 - Using input As Stream = File.OpenRead(filename) - Using decompressor As Stream = new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, True) - Using output As Stream = File.Create(UncompressedFile) - Do - n= decompressor.Read(working, 0, working.Length) - If n > 0 Then - output.Write(working, 0, n) - End IF - Loop While (n > 0) - End Using - End Using - End Using - End Sub - - - - The stream which will be read or written. - Indicates whether the GZipStream will compress or decompress. - - - - Create a GZipStream using the specified CompressionMode and - the specified CompressionLevel. - - - - - The CompressionMode (Compress or Decompress) also establishes the - "direction" of the stream. A GZipStream with - CompressionMode.Compress works only through Write(). A - GZipStream with CompressionMode.Decompress works only - through Read(). - - - - - - - This example shows how to use a GZipStream to compress a file into a .gz file. - - - using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - { - using (var raw = System.IO.File.Create(fileToCompress + ".gz")) - { - using (Stream compressor = new GZipStream(raw, - CompressionMode.Compress, - CompressionLevel.BestCompression)) - { - byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - int n; - while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - { - compressor.Write(buffer, 0, n); - } - } - } - } - - - - Using input As Stream = File.OpenRead(fileToCompress) - Using raw As FileStream = File.Create(fileToCompress & ".gz") - Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) - Dim buffer As Byte() = New Byte(4096) {} - Dim n As Integer = -1 - Do While (n <> 0) - If (n > 0) Then - compressor.Write(buffer, 0, n) - End If - n = input.Read(buffer, 0, buffer.Length) - Loop - End Using - End Using - End Using - - - The stream to be read or written while deflating or inflating. - Indicates whether the GZipStream will compress or decompress. - A tuning knob to trade speed for effectiveness. - - - - Create a GZipStream using the specified CompressionMode, and - explicitly specify whether the stream should be left open after Deflation - or Inflation. - - - - - This constructor allows the application to request that the captive stream - remain open after the deflation or inflation occurs. By default, after - Close() is called on the stream, the captive stream is also - closed. In some cases this is not desired, for example if the stream is a - memory stream that will be re-read after compressed data has been written - to it. Specify true for the parameter to leave - the stream open. - - - - The (Compress or Decompress) also - establishes the "direction" of the stream. A GZipStream with - CompressionMode.Compress works only through Write(). A GZipStream - with CompressionMode.Decompress works only through Read(). - - - - The GZipStream will use the default compression level. If you want - to specify the compression level, see . - - - - See the other overloads of this constructor for example code. - - - - - - The stream which will be read or written. This is called the "captive" - stream in other places in this documentation. - - - Indicates whether the GZipStream will compress or decompress. - - - - true if the application would like the base stream to remain open after - inflation/deflation. - - - - - Create a GZipStream using the specified CompressionMode and the - specified CompressionLevel, and explicitly specify whether the - stream should be left open after Deflation or Inflation. - - - - - - This constructor allows the application to request that the captive stream - remain open after the deflation or inflation occurs. By default, after - Close() is called on the stream, the captive stream is also - closed. In some cases this is not desired, for example if the stream is a - memory stream that will be re-read after compressed data has been written - to it. Specify true for the parameter to - leave the stream open. - - - - As noted in the class documentation, the CompressionMode (Compress - or Decompress) also establishes the "direction" of the stream. A - GZipStream with CompressionMode.Compress works only through - Write(). A GZipStream with CompressionMode.Decompress works only - through Read(). - - - - - - This example shows how to use a GZipStream to compress data. - - using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - { - using (var raw = System.IO.File.Create(outputFile)) - { - using (Stream compressor = new GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression, true)) - { - byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - int n; - while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - { - compressor.Write(buffer, 0, n); - } - } - } - } - - - Dim outputFile As String = (fileToCompress & ".compressed") - Using input As Stream = File.OpenRead(fileToCompress) - Using raw As FileStream = File.Create(outputFile) - Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression, True) - Dim buffer As Byte() = New Byte(4096) {} - Dim n As Integer = -1 - Do While (n <> 0) - If (n > 0) Then - compressor.Write(buffer, 0, n) - End If - n = input.Read(buffer, 0, buffer.Length) - Loop - End Using - End Using - End Using - - - The stream which will be read or written. - Indicates whether the GZipStream will compress or decompress. - true if the application would like the stream to remain open after inflation/deflation. - A tuning knob to trade speed for effectiveness. - - - - Dispose the stream. - - - - This may or may not result in a Close() call on the captive - stream. See the constructors that have a leaveOpen parameter - for more information. - - - This method may be invoked in two distinct scenarios. If disposing - == true, the method has been called directly or indirectly by a - user's code, for example via the public Dispose() method. In this - case, both managed and unmanaged resources can be referenced and - disposed. If disposing == false, the method has been called by the - runtime from inside the object finalizer and this method should not - reference other objects; in that case only unmanaged resources must - be referenced or disposed. - - - - indicates whether the Dispose method was invoked by user code. - - - - - Flush the stream. - - - - - Read and decompress data from the source stream. - - - - With a GZipStream, decompression is done through reading. - - - - - byte[] working = new byte[WORKING_BUFFER_SIZE]; - using (System.IO.Stream input = System.IO.File.OpenRead(_CompressedFile)) - { - using (Stream decompressor= new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, true)) - { - using (var output = System.IO.File.Create(_DecompressedFile)) - { - int n; - while ((n= decompressor.Read(working, 0, working.Length)) !=0) - { - output.Write(working, 0, n); - } - } - } - } - - - The buffer into which the decompressed data should be placed. - the offset within that data array to put the first byte read. - the number of bytes to read. - the number of bytes actually read - - - - Calling this method always throws a . - - irrelevant; it will always throw! - irrelevant; it will always throw! - irrelevant! - - - - Calling this method always throws a . - - irrelevant; this method will always throw! - - - - Write data to the stream. - - - - - If you wish to use the GZipStream to compress data while writing, - you can create a GZipStream with CompressionMode.Compress, and a - writable output stream. Then call Write() on that GZipStream, - providing uncompressed data as input. The data sent to the output stream - will be the compressed form of the data written. - - - - A GZipStream can be used for Read() or Write(), but not - both. Writing implies compression. Reading implies decompression. - - - - The buffer holding data to write to the stream. - the offset within that data array to find the first byte to write. - the number of bytes to write. - - - - Compress a string into a byte array using GZip. - - - - Uncompress it with . - - - - - - - A string to compress. The string will first be encoded - using UTF8, then compressed. - - - The string in compressed form - - - - Compress a byte array into a new byte array using GZip. - - - - Uncompress it with . - - - - - - - A buffer to compress. - - - The data in compressed form - - - - Uncompress a GZip'ed byte array into a single string. - - - - - - - A buffer containing GZIP-compressed data. - - - The uncompressed string - - - - Uncompress a GZip'ed byte array into a byte array. - - - - - - - A buffer containing data that has been compressed with GZip. - - - The data in uncompressed form - - - - The comment on the GZIP stream. - - - - - The GZIP format allows for each file to optionally have an associated - comment stored with the file. The comment is encoded with the ISO-8859-1 - code page. To include a comment in a GZIP stream you create, set this - property before calling Write() for the first time on the - GZipStream. - - - - When using GZipStream to decompress, you can retrieve this property - after the first call to Read(). If no comment has been set in the - GZIP bytestream, the Comment property will return null - (Nothing in VB). - - - - - - The FileName for the GZIP stream. - - - - - - The GZIP format optionally allows each file to have an associated - filename. When compressing data (through Write()), set this - FileName before calling Write() the first time on the GZipStream. - The actual filename is encoded into the GZIP bytestream with the - ISO-8859-1 code page, according to RFC 1952. It is the application's - responsibility to insure that the FileName can be encoded and decoded - correctly with this code page. - - - - When decompressing (through Read()), you can retrieve this value - any time after the first Read(). In the case where there was no filename - encoded into the GZIP bytestream, the property will return null (Nothing - in VB). - - - - - - The CRC on the GZIP stream. - - - This is used for internal error checking. You probably don't need to look at this property. - - - - - This property sets the flush behavior on the stream. - - - - - The size of the working buffer for the compression codec. - - - - - The working buffer is used for all stream operations. The default size is - 1024 bytes. The minimum size is 128 bytes. You may get better performance - with a larger buffer. Then again, you might not. You would have to test - it. - - - - Set this before the first call to Read() or Write() on the - stream. If you try to set it afterwards, it will throw. - - - - - Returns the total number of bytes input so far. - - - Returns the total number of bytes output so far. - - - - Indicates whether the stream can be read. - - - The return value depends on whether the captive stream supports reading. - - - - - Indicates whether the stream supports Seek operations. - - - Always returns false. - - - - - Indicates whether the stream can be written. - - - The return value depends on whether the captive stream supports writing. - - - - - Reading this property always throws a . - - - - - The position of the stream pointer. - - - - Setting this property always throws a . Reading will return the total bytes - written out, if used in writing, or the total bytes read in, if used in - reading. The count may refer to compressed bytes or uncompressed bytes, - depending on how you've used the stream. - - - - - A class for compressing streams using the - Deflate algorithm with multiple threads. - - - - - This class performs DEFLATE compression through writing. For - more information on the Deflate algorithm, see IETF RFC 1951, - "DEFLATE Compressed Data Format Specification version 1.3." - - - - This class is similar to , except - that this class is for compression only, and this implementation uses an - approach that employs multiple worker threads to perform the DEFLATE. On - a multi-cpu or multi-core computer, the performance of this class can be - significantly higher than the single-threaded DeflateStream, particularly - for larger streams. How large? Anything over 10mb is a good candidate - for parallel compression. - - - - The tradeoff is that this class uses more memory and more CPU than the - vanilla DeflateStream, and also is less efficient as a compressor. For - large files the size of the compressed data stream can be less than 1% - larger than the size of a compressed data stream from the vanialla - DeflateStream. For smaller files the difference can be larger. The - difference will also be larger if you set the BufferSize to be lower than - the default value. Your mileage may vary. Finally, for small files, the - ParallelDeflateOutputStream can be much slower than the vanilla - DeflateStream, because of the overhead associated to using the thread - pool. - - - - - - - - Create a ParallelDeflateOutputStream. - - - - - This stream compresses data written into it via the DEFLATE - algorithm (see RFC 1951), and writes out the compressed byte stream. - - - - The instance will use the default compression level, the default - buffer sizes and the default number of threads and buffers per - thread. - - - - This class is similar to , - except that this implementation uses an approach that employs - multiple worker threads to perform the DEFLATE. On a multi-cpu or - multi-core computer, the performance of this class can be - significantly higher than the single-threaded DeflateStream, - particularly for larger streams. How large? Anything over 10mb is - a good candidate for parallel compression. - - - - - - - This example shows how to use a ParallelDeflateOutputStream to compress - data. It reads a file, compresses it, and writes the compressed data to - a second, output file. - - - byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - int n= -1; - String outputFile = fileToCompress + ".compressed"; - using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - { - using (var raw = System.IO.File.Create(outputFile)) - { - using (Stream compressor = new ParallelDeflateOutputStream(raw)) - { - while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - { - compressor.Write(buffer, 0, n); - } - } - } - } - - - Dim buffer As Byte() = New Byte(4096) {} - Dim n As Integer = -1 - Dim outputFile As String = (fileToCompress & ".compressed") - Using input As Stream = File.OpenRead(fileToCompress) - Using raw As FileStream = File.Create(outputFile) - Using compressor As Stream = New ParallelDeflateOutputStream(raw) - Do While (n <> 0) - If (n > 0) Then - compressor.Write(buffer, 0, n) - End If - n = input.Read(buffer, 0, buffer.Length) - Loop - End Using - End Using - End Using - - - The stream to which compressed data will be written. - - - - Create a ParallelDeflateOutputStream using the specified CompressionLevel. - - - See the - constructor for example code. - - The stream to which compressed data will be written. - A tuning knob to trade speed for effectiveness. - - - - Create a ParallelDeflateOutputStream and specify whether to leave the captive stream open - when the ParallelDeflateOutputStream is closed. - - - See the - constructor for example code. - - The stream to which compressed data will be written. - - true if the application would like the stream to remain open after inflation/deflation. - - - - - Create a ParallelDeflateOutputStream and specify whether to leave the captive stream open - when the ParallelDeflateOutputStream is closed. - - - See the - constructor for example code. - - The stream to which compressed data will be written. - A tuning knob to trade speed for effectiveness. - - true if the application would like the stream to remain open after inflation/deflation. - - - - - Create a ParallelDeflateOutputStream using the specified - CompressionLevel and CompressionStrategy, and specifying whether to - leave the captive stream open when the ParallelDeflateOutputStream is - closed. - - - See the - constructor for example code. - - The stream to which compressed data will be written. - A tuning knob to trade speed for effectiveness. - - By tweaking this parameter, you may be able to optimize the compression for - data with particular characteristics. - - - true if the application would like the stream to remain open after inflation/deflation. - - - - - Write data to the stream. - - - - - - To use the ParallelDeflateOutputStream to compress data, create a - ParallelDeflateOutputStream with CompressionMode.Compress, passing a - writable output stream. Then call Write() on that - ParallelDeflateOutputStream, providing uncompressed data as input. The - data sent to the output stream will be the compressed form of the data - written. - - - - To decompress data, use the class. - - - - The buffer holding data to write to the stream. - the offset within that data array to find the first byte to write. - the number of bytes to write. - - - - Flush the stream. - - - - - Close the stream. - - - You must call Close on the stream to guarantee that all of the data written in has - been compressed, and the compressed data has been written out. - - - - Dispose the object - - - Because ParallelDeflateOutputStream is IDisposable, the - application must call this method when finished using the instance. - - - This method is generally called implicitly upon exit from - a using scope in C# (Using in VB). - - - - - The Dispose method - - indicates whether the Dispose method was invoked by user code. - - - - - Resets the stream for use with another stream. - - - Because the ParallelDeflateOutputStream is expensive to create, it - has been designed so that it can be recycled and re-used. You have - to call Close() on the stream first, then you can call Reset() on - it, to use it again on another stream. - - - - The new output stream for this era. - - - - - ParallelDeflateOutputStream deflater = null; - foreach (var inputFile in listOfFiles) - { - string outputFile = inputFile + ".compressed"; - using (System.IO.Stream input = System.IO.File.OpenRead(inputFile)) - { - using (var outStream = System.IO.File.Create(outputFile)) - { - if (deflater == null) - deflater = new ParallelDeflateOutputStream(outStream, - CompressionLevel.Best, - CompressionStrategy.Default, - true); - deflater.Reset(outStream); - - while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - { - deflater.Write(buffer, 0, n); - } - } - } - } - - - - - - This method always throws a NotSupportedException. - - - The buffer into which data would be read, IF THIS METHOD - ACTUALLY DID ANYTHING. - - - The offset within that data array at which to insert the - data that is read, IF THIS METHOD ACTUALLY DID - ANYTHING. - - - The number of bytes to write, IF THIS METHOD ACTUALLY DID - ANYTHING. - - nothing. - - - - This method always throws a NotSupportedException. - - - The offset to seek to.... - IF THIS METHOD ACTUALLY DID ANYTHING. - - - The reference specifying how to apply the offset.... IF - THIS METHOD ACTUALLY DID ANYTHING. - - nothing. It always throws. - - - - This method always throws a NotSupportedException. - - - The new value for the stream length.... IF - THIS METHOD ACTUALLY DID ANYTHING. - - - - - The ZLIB strategy to be used during compression. - - - - - - The maximum number of buffer pairs to use. - - - - - This property sets an upper limit on the number of memory buffer - pairs to create. The implementation of this stream allocates - multiple buffers to facilitate parallel compression. As each buffer - fills up, this stream uses - ThreadPool.QueueUserWorkItem() - to compress those buffers in a background threadpool thread. After a - buffer is compressed, it is re-ordered and written to the output - stream. - - - - A higher number of buffer pairs enables a higher degree of - parallelism, which tends to increase the speed of compression on - multi-cpu computers. On the other hand, a higher number of buffer - pairs also implies a larger memory consumption, more active worker - threads, and a higher cpu utilization for any compression. This - property enables the application to limit its memory consumption and - CPU utilization behavior depending on requirements. - - - - For each compression "task" that occurs in parallel, there are 2 - buffers allocated: one for input and one for output. This property - sets a limit for the number of pairs. The total amount of storage - space allocated for buffering will then be (N*S*2), where N is the - number of buffer pairs, S is the size of each buffer (). By default, DotNetZip allocates 4 buffer - pairs per CPU core, so if your machine has 4 cores, and you retain - the default buffer size of 128k, then the - ParallelDeflateOutputStream will use 4 * 4 * 2 * 128kb of buffer - memory in total, or 4mb, in blocks of 128kb. If you then set this - property to 8, then the number will be 8 * 2 * 128kb of buffer - memory, or 2mb. - - - - CPU utilization will also go up with additional buffers, because a - larger number of buffer pairs allows a larger number of background - threads to compress in parallel. If you find that parallel - compression is consuming too much memory or CPU, you can adjust this - value downward. - - - - The default value is 16. Different values may deliver better or - worse results, depending on your priorities and the dynamic - performance characteristics of your storage and compute resources. - - - - This property is not the number of buffer pairs to use; it is an - upper limit. An illustration: Suppose you have an application that - uses the default value of this property (which is 16), and it runs - on a machine with 2 CPU cores. In that case, DotNetZip will allocate - 4 buffer pairs per CPU core, for a total of 8 pairs. The upper - limit specified by this property has no effect. - - - - The application can set this value at any time, but it is effective - only before the first call to Write(), which is when the buffers are - allocated. - - - - - - The size of the buffers used by the compressor threads. - - - - - The default buffer size is 128k. The application can set this value - at any time, but it is effective only before the first Write(). - - - - Larger buffer sizes implies larger memory consumption but allows - more efficient compression. Using smaller buffer sizes consumes less - memory but may result in less effective compression. For example, - using the default buffer size of 128k, the compression delivered is - within 1% of the compression delivered by the single-threaded . On the other hand, using a - BufferSize of 8k can result in a compressed data stream that is 5% - larger than that delivered by the single-threaded - DeflateStream. Excessively small buffer sizes can also cause - the speed of the ParallelDeflateOutputStream to drop, because of - larger thread scheduling overhead dealing with many many small - buffers. - - - - The total amount of storage space allocated for buffering will be - (N*S*2), where N is the number of buffer pairs, and S is the size of - each buffer (this property). There are 2 buffers used by the - compressor, one for input and one for output. By default, DotNetZip - allocates 4 buffer pairs per CPU core, so if your machine has 4 - cores, then the number of buffer pairs used will be 16. If you - accept the default value of this property, 128k, then the - ParallelDeflateOutputStream will use 16 * 2 * 128kb of buffer memory - in total, or 4mb, in blocks of 128kb. If you set this property to - 64kb, then the number will be 16 * 2 * 64kb of buffer memory, or - 2mb. - - - - - - - The CRC32 for the data that was written out, prior to compression. - - - This value is meaningful only after a call to Close(). - - - - - The total number of uncompressed bytes processed by the ParallelDeflateOutputStream. - - - This value is meaningful only after a call to Close(). - - - - - Indicates whether the stream supports Seek operations. - - - Always returns false. - - - - - Indicates whether the stream supports Read operations. - - - Always returns false. - - - - - Indicates whether the stream supports Write operations. - - - Returns true if the provided stream is writable. - - - - - Reading this property always throws a NotSupportedException. - - - - - Returns the current position of the output stream. - - - - Because the output gets written by a background thread, - the value may change asynchronously. Setting this - property always throws a NotSupportedException. - - - - - - Map from a distance to a distance code. - - - No side effects. _dist_code[256] and _dist_code[257] are never used. - - - - - Describes how to flush the current deflate operation. - - - The different FlushType values are useful when using a Deflate in a streaming application. - - - - No flush at all. - - - Closes the current block, but doesn't flush it to - the output. Used internally only in hypothetical - scenarios. This was supposed to be removed by Zlib, but it is - still in use in some edge cases. - - - - - Use this during compression to specify that all pending output should be - flushed to the output buffer and the output should be aligned on a byte - boundary. You might use this in a streaming communication scenario, so that - the decompressor can get all input data available so far. When using this - with a ZlibCodec, AvailableBytesIn will be zero after the call if - enough output space has been provided before the call. Flushing will - degrade compression and so it should be used only when necessary. - - - - - Use this during compression to specify that all output should be flushed, as - with FlushType.Sync, but also, the compression state should be reset - so that decompression can restart from this point if previous compressed - data has been damaged or if random access is desired. Using - FlushType.Full too often can significantly degrade the compression. - - - - Signals the end of the compression/decompression stream. - - - - The compression level to be used when using a DeflateStream or ZlibStream with CompressionMode.Compress. - - - - - None means that the data will be simply stored, with no change at all. - If you are producing ZIPs for use on Mac OSX, be aware that archives produced with CompressionLevel.None - cannot be opened with the default zip reader. Use a different CompressionLevel. - - - - - Same as None. - - - - - The fastest but least effective compression. - - - - - A synonym for BestSpeed. - - - - - A little slower, but better, than level 1. - - - - - A little slower, but better, than level 2. - - - - - A little slower, but better, than level 3. - - - - - A little slower than level 4, but with better compression. - - - - - The default compression level, with a good balance of speed and compression efficiency. - - - - - A synonym for Default. - - - - - Pretty good compression! - - - - - Better compression than Level7! - - - - - The "best" compression, where best means greatest reduction in size of the input data stream. - This is also the slowest compression. - - - - - A synonym for BestCompression. - - - - - Describes options for how the compression algorithm is executed. Different strategies - work better on different sorts of data. The strategy parameter can affect the compression - ratio and the speed of compression but not the correctness of the compresssion. - - - - - The default strategy is probably the best for normal data. - - - - - The Filtered strategy is intended to be used most effectively with data produced by a - filter or predictor. By this definition, filtered data consists mostly of small - values with a somewhat random distribution. In this case, the compression algorithm - is tuned to compress them better. The effect of Filtered is to force more Huffman - coding and less string matching; it is a half-step between Default and HuffmanOnly. - - - - - Using HuffmanOnly will force the compressor to do Huffman encoding only, with no - string matching. - - - - - An enum to specify the direction of transcoding - whether to compress or decompress. - - - - - Used to specify that the stream should compress the data. - - - - - Used to specify that the stream should decompress the data. - - - - - A general purpose exception class for exceptions in the Zlib library. - - - - - The ZlibException class captures exception information generated - by the Zlib library. - - - - - This ctor collects a message attached to the exception. - - the message for the exception. - - - - Performs an unsigned bitwise right shift with the specified number - - Number to operate on - Ammount of bits to shift - The resulting number from the shift operation - - - - Reads a number of characters from the current source TextReader and writes - the data to the target array at the specified index. - - - The source TextReader to read from - Contains the array of characteres read from the source TextReader. - The starting index of the target array. - The maximum number of characters to read from the source TextReader. - - - The number of characters read. The number will be less than or equal to - count depending on the data available in the source TextReader. Returns -1 - if the end of the stream is reached. - - - - - Computes an Adler-32 checksum. - - - The Adler checksum is similar to a CRC checksum, but faster to compute, though less - reliable. It is used in producing RFC1950 compressed streams. The Adler checksum - is a required part of the "ZLIB" standard. Applications will almost never need to - use this class directly. - - - - - - - Calculates the Adler32 checksum. - - - - This is used within ZLIB. You probably don't need to use this directly. - - - - To compute an Adler32 checksum on a byte array: - - var adler = Adler.Adler32(0, null, 0, 0); - adler = Adler.Adler32(adler, buffer, index, length); - - - - - - Encoder and Decoder for ZLIB and DEFLATE (IETF RFC1950 and RFC1951). - - - - This class compresses and decompresses data according to the Deflate algorithm - and optionally, the ZLIB format, as documented in RFC 1950 - ZLIB and RFC 1951 - DEFLATE. - - - - - The buffer from which data is taken. - - - - - An index into the InputBuffer array, indicating where to start reading. - - - - - The number of bytes available in the InputBuffer, starting at NextIn. - - - Generally you should set this to InputBuffer.Length before the first Inflate() or Deflate() call. - The class will update this number as calls to Inflate/Deflate are made. - - - - - Total number of bytes read so far, through all calls to Inflate()/Deflate(). - - - - - Buffer to store output data. - - - - - An index into the OutputBuffer array, indicating where to start writing. - - - - - The number of bytes available in the OutputBuffer, starting at NextOut. - - - Generally you should set this to OutputBuffer.Length before the first Inflate() or Deflate() call. - The class will update this number as calls to Inflate/Deflate are made. - - - - - Total number of bytes written to the output so far, through all calls to Inflate()/Deflate(). - - - - - used for diagnostics, when something goes wrong! - - - - - The compression level to use in this codec. Useful only in compression mode. - - - - - The number of Window Bits to use. - - - This gauges the size of the sliding window, and hence the - compression effectiveness as well as memory consumption. It's best to just leave this - setting alone if you don't know what it is. The maximum value is 15 bits, which implies - a 32k window. - - - - - The compression strategy to use. - - - This is only effective in compression. The theory offered by ZLIB is that different - strategies could potentially produce significant differences in compression behavior - for different data sets. Unfortunately I don't have any good recommendations for how - to set it differently. When I tested changing the strategy I got minimally different - compression performance. It's best to leave this property alone if you don't have a - good feel for it. Or, you may want to produce a test harness that runs through the - different strategy options and evaluates them on different file types. If you do that, - let me know your results. - - - - - Create a ZlibCodec. - - - If you use this default constructor, you will later have to explicitly call - InitializeInflate() or InitializeDeflate() before using the ZlibCodec to compress - or decompress. - - - - - Create a ZlibCodec that either compresses or decompresses. - - - Indicates whether the codec should compress (deflate) or decompress (inflate). - - - - - Initialize the inflation state. - - - It is not necessary to call this before using the ZlibCodec to inflate data; - It is implicitly called when you call the constructor. - - Z_OK if everything goes well. - - - - Initialize the inflation state with an explicit flag to - govern the handling of RFC1950 header bytes. - - - - By default, the ZLIB header defined in RFC 1950 is expected. If - you want to read a zlib stream you should specify true for - expectRfc1950Header. If you have a deflate stream, you will want to specify - false. It is only necessary to invoke this initializer explicitly if you - want to specify false. - - - whether to expect an RFC1950 header byte - pair when reading the stream of data to be inflated. - - Z_OK if everything goes well. - - - - Initialize the ZlibCodec for inflation, with the specified number of window bits. - - The number of window bits to use. If you need to ask what that is, - then you shouldn't be calling this initializer. - Z_OK if all goes well. - - - - Initialize the inflation state with an explicit flag to govern the handling of - RFC1950 header bytes. - - - - If you want to read a zlib stream you should specify true for - expectRfc1950Header. In this case, the library will expect to find a ZLIB - header, as defined in RFC - 1950, in the compressed stream. If you will be reading a DEFLATE or - GZIP stream, which does not have such a header, you will want to specify - false. - - - whether to expect an RFC1950 header byte pair when reading - the stream of data to be inflated. - The number of window bits to use. If you need to ask what that is, - then you shouldn't be calling this initializer. - Z_OK if everything goes well. - - - - Inflate the data in the InputBuffer, placing the result in the OutputBuffer. - - - You must have set InputBuffer and OutputBuffer, NextIn and NextOut, and AvailableBytesIn and - AvailableBytesOut before calling this method. - - - - private void InflateBuffer() - { - int bufferSize = 1024; - byte[] buffer = new byte[bufferSize]; - ZlibCodec decompressor = new ZlibCodec(); - - Console.WriteLine("\n============================================"); - Console.WriteLine("Size of Buffer to Inflate: {0} bytes.", CompressedBytes.Length); - MemoryStream ms = new MemoryStream(DecompressedBytes); - - int rc = decompressor.InitializeInflate(); - - decompressor.InputBuffer = CompressedBytes; - decompressor.NextIn = 0; - decompressor.AvailableBytesIn = CompressedBytes.Length; - - decompressor.OutputBuffer = buffer; - - // pass 1: inflate - do - { - decompressor.NextOut = 0; - decompressor.AvailableBytesOut = buffer.Length; - rc = decompressor.Inflate(FlushType.None); - - if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) - throw new Exception("inflating: " + decompressor.Message); - - ms.Write(decompressor.OutputBuffer, 0, buffer.Length - decompressor.AvailableBytesOut); - } - while (decompressor.AvailableBytesIn > 0 || decompressor.AvailableBytesOut == 0); - - // pass 2: finish and flush - do - { - decompressor.NextOut = 0; - decompressor.AvailableBytesOut = buffer.Length; - rc = decompressor.Inflate(FlushType.Finish); - - if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) - throw new Exception("inflating: " + decompressor.Message); - - if (buffer.Length - decompressor.AvailableBytesOut > 0) - ms.Write(buffer, 0, buffer.Length - decompressor.AvailableBytesOut); - } - while (decompressor.AvailableBytesIn > 0 || decompressor.AvailableBytesOut == 0); - - decompressor.EndInflate(); - } - - - - The flush to use when inflating. - Z_OK if everything goes well. - - - - Ends an inflation session. - - - Call this after successively calling Inflate(). This will cause all buffers to be flushed. - After calling this you cannot call Inflate() without a intervening call to one of the - InitializeInflate() overloads. - - Z_OK if everything goes well. - - - - I don't know what this does! - - Z_OK if everything goes well. - - - - Initialize the ZlibCodec for deflation operation. - - - The codec will use the MAX window bits and the default level of compression. - - - - int bufferSize = 40000; - byte[] CompressedBytes = new byte[bufferSize]; - byte[] DecompressedBytes = new byte[bufferSize]; - - ZlibCodec compressor = new ZlibCodec(); - - compressor.InitializeDeflate(CompressionLevel.Default); - - compressor.InputBuffer = System.Text.ASCIIEncoding.ASCII.GetBytes(TextToCompress); - compressor.NextIn = 0; - compressor.AvailableBytesIn = compressor.InputBuffer.Length; - - compressor.OutputBuffer = CompressedBytes; - compressor.NextOut = 0; - compressor.AvailableBytesOut = CompressedBytes.Length; - - while (compressor.TotalBytesIn != TextToCompress.Length && compressor.TotalBytesOut < bufferSize) - { - compressor.Deflate(FlushType.None); - } - - while (true) - { - int rc= compressor.Deflate(FlushType.Finish); - if (rc == ZlibConstants.Z_STREAM_END) break; - } - - compressor.EndDeflate(); - - - - Z_OK if all goes well. You generally don't need to check the return code. - - - - Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel. - - - The codec will use the maximum window bits (15) and the specified - CompressionLevel. It will emit a ZLIB stream as it compresses. - - The compression level for the codec. - Z_OK if all goes well. - - - - Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel, - and the explicit flag governing whether to emit an RFC1950 header byte pair. - - - The codec will use the maximum window bits (15) and the specified CompressionLevel. - If you want to generate a zlib stream, you should specify true for - wantRfc1950Header. In this case, the library will emit a ZLIB - header, as defined in RFC - 1950, in the compressed stream. - - The compression level for the codec. - whether to emit an initial RFC1950 byte pair in the compressed stream. - Z_OK if all goes well. - - - - Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel, - and the specified number of window bits. - - - The codec will use the specified number of window bits and the specified CompressionLevel. - - The compression level for the codec. - the number of window bits to use. If you don't know what this means, don't use this method. - Z_OK if all goes well. - - - - Initialize the ZlibCodec for deflation operation, using the specified - CompressionLevel, the specified number of window bits, and the explicit flag - governing whether to emit an RFC1950 header byte pair. - - - The compression level for the codec. - whether to emit an initial RFC1950 byte pair in the compressed stream. - the number of window bits to use. If you don't know what this means, don't use this method. - Z_OK if all goes well. - - - - Deflate one batch of data. - - - You must have set InputBuffer and OutputBuffer before calling this method. - - - - private void DeflateBuffer(CompressionLevel level) - { - int bufferSize = 1024; - byte[] buffer = new byte[bufferSize]; - ZlibCodec compressor = new ZlibCodec(); - - Console.WriteLine("\n============================================"); - Console.WriteLine("Size of Buffer to Deflate: {0} bytes.", UncompressedBytes.Length); - MemoryStream ms = new MemoryStream(); - - int rc = compressor.InitializeDeflate(level); - - compressor.InputBuffer = UncompressedBytes; - compressor.NextIn = 0; - compressor.AvailableBytesIn = UncompressedBytes.Length; - - compressor.OutputBuffer = buffer; - - // pass 1: deflate - do - { - compressor.NextOut = 0; - compressor.AvailableBytesOut = buffer.Length; - rc = compressor.Deflate(FlushType.None); - - if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) - throw new Exception("deflating: " + compressor.Message); - - ms.Write(compressor.OutputBuffer, 0, buffer.Length - compressor.AvailableBytesOut); - } - while (compressor.AvailableBytesIn > 0 || compressor.AvailableBytesOut == 0); - - // pass 2: finish and flush - do - { - compressor.NextOut = 0; - compressor.AvailableBytesOut = buffer.Length; - rc = compressor.Deflate(FlushType.Finish); - - if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) - throw new Exception("deflating: " + compressor.Message); - - if (buffer.Length - compressor.AvailableBytesOut > 0) - ms.Write(buffer, 0, buffer.Length - compressor.AvailableBytesOut); - } - while (compressor.AvailableBytesIn > 0 || compressor.AvailableBytesOut == 0); - - compressor.EndDeflate(); - - ms.Seek(0, SeekOrigin.Begin); - CompressedBytes = new byte[compressor.TotalBytesOut]; - ms.Read(CompressedBytes, 0, CompressedBytes.Length); - } - - - whether to flush all data as you deflate. Generally you will want to - use Z_NO_FLUSH here, in a series of calls to Deflate(), and then call EndDeflate() to - flush everything. - - Z_OK if all goes well. - - - - End a deflation session. - - - Call this after making a series of one or more calls to Deflate(). All buffers are flushed. - - Z_OK if all goes well. - - - - Reset a codec for another deflation session. - - - Call this to reset the deflation state. For example if a thread is deflating - non-consecutive blocks, you can call Reset() after the Deflate(Sync) of the first - block and before the next Deflate(None) of the second block. - - Z_OK if all goes well. - - - - Set the CompressionStrategy and CompressionLevel for a deflation session. - - the level of compression to use. - the strategy to use for compression. - Z_OK if all goes well. - - - - Set the dictionary to be used for either Inflation or Deflation. - - The dictionary bytes to use. - Z_OK if all goes well. - - - - The Adler32 checksum on the data transferred through the codec so far. You probably don't need to look at this. - - - - - A bunch of constants used in the Zlib interface. - - - - - The maximum number of window bits for the Deflate algorithm. - - - - - The default number of window bits for the Deflate algorithm. - - - - - indicates everything is A-OK - - - - - Indicates that the last operation reached the end of the stream. - - - - - The operation ended in need of a dictionary. - - - - - There was an error with the stream - not enough data, not open and readable, etc. - - - - - There was an error with the data - not enough data, bad data, etc. - - - - - There was an error with the working buffer. - - - - - The size of the working buffer used in the ZlibCodec class. Defaults to 8192 bytes. - - - - - The minimum size of the working buffer used in the ZlibCodec class. Currently it is 128 bytes. - - - - - Represents a Zlib stream for compression or decompression. - - - - - The ZlibStream is a Decorator on a . It adds ZLIB compression or decompression to any - stream. - - - Using this stream, applications can compress or decompress data via - stream Read() and Write() operations. Either compresssion or - decompression can occur through either reading or writing. The compression - format used is ZLIB, which is documented in IETF RFC 1950, "ZLIB Compressed - Data Format Specification version 3.3". This implementation of ZLIB always uses - DEFLATE as the compression method. (see IETF RFC 1951, "DEFLATE - Compressed Data Format Specification version 1.3.") - - - The ZLIB format allows for varying compression methods, window sizes, and dictionaries. - This implementation always uses the DEFLATE compression method, a preset dictionary, - and 15 window bits by default. - - - - This class is similar to , except that it adds the - RFC1950 header and trailer bytes to a compressed stream when compressing, or expects - the RFC1950 header and trailer bytes when decompressing. It is also similar to the - . - - - - - - - - Create a ZlibStream using the specified CompressionMode. - - - - - When mode is CompressionMode.Compress, the ZlibStream - will use the default compression level. The "captive" stream will be - closed when the ZlibStream is closed. - - - - - - This example uses a ZlibStream to compress a file, and writes the - compressed data to another file. - - using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - { - using (var raw = System.IO.File.Create(fileToCompress + ".zlib")) - { - using (Stream compressor = new ZlibStream(raw, CompressionMode.Compress)) - { - byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - int n; - while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - { - compressor.Write(buffer, 0, n); - } - } - } - } - - - Using input As Stream = File.OpenRead(fileToCompress) - Using raw As FileStream = File.Create(fileToCompress & ".zlib") - Using compressor As Stream = New ZlibStream(raw, CompressionMode.Compress) - Dim buffer As Byte() = New Byte(4096) {} - Dim n As Integer = -1 - Do While (n <> 0) - If (n > 0) Then - compressor.Write(buffer, 0, n) - End If - n = input.Read(buffer, 0, buffer.Length) - Loop - End Using - End Using - End Using - - - - The stream which will be read or written. - Indicates whether the ZlibStream will compress or decompress. - - - - Create a ZlibStream using the specified CompressionMode and - the specified CompressionLevel. - - - - - - When mode is CompressionMode.Decompress, the level parameter is ignored. - The "captive" stream will be closed when the ZlibStream is closed. - - - - - - This example uses a ZlibStream to compress data from a file, and writes the - compressed data to another file. - - - using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - { - using (var raw = System.IO.File.Create(fileToCompress + ".zlib")) - { - using (Stream compressor = new ZlibStream(raw, - CompressionMode.Compress, - CompressionLevel.BestCompression)) - { - byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - int n; - while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - { - compressor.Write(buffer, 0, n); - } - } - } - } - - - - Using input As Stream = File.OpenRead(fileToCompress) - Using raw As FileStream = File.Create(fileToCompress & ".zlib") - Using compressor As Stream = New ZlibStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) - Dim buffer As Byte() = New Byte(4096) {} - Dim n As Integer = -1 - Do While (n <> 0) - If (n > 0) Then - compressor.Write(buffer, 0, n) - End If - n = input.Read(buffer, 0, buffer.Length) - Loop - End Using - End Using - End Using - - - - The stream to be read or written while deflating or inflating. - Indicates whether the ZlibStream will compress or decompress. - A tuning knob to trade speed for effectiveness. - - - - Create a ZlibStream using the specified CompressionMode, and - explicitly specify whether the captive stream should be left open after - Deflation or Inflation. - - - - - - When mode is CompressionMode.Compress, the ZlibStream will use - the default compression level. - - - - This constructor allows the application to request that the captive stream - remain open after the deflation or inflation occurs. By default, after - Close() is called on the stream, the captive stream is also - closed. In some cases this is not desired, for example if the stream is a - that will be re-read after - compression. Specify true for the parameter to leave the stream - open. - - - - See the other overloads of this constructor for example code. - - - - - The stream which will be read or written. This is called the - "captive" stream in other places in this documentation. - Indicates whether the ZlibStream will compress or decompress. - true if the application would like the stream to remain - open after inflation/deflation. - - - - Create a ZlibStream using the specified CompressionMode - and the specified CompressionLevel, and explicitly specify - whether the stream should be left open after Deflation or Inflation. - - - - - - This constructor allows the application to request that the captive - stream remain open after the deflation or inflation occurs. By - default, after Close() is called on the stream, the captive - stream is also closed. In some cases this is not desired, for example - if the stream is a that will be - re-read after compression. Specify true for the parameter to leave the stream open. - - - - When mode is CompressionMode.Decompress, the level parameter is - ignored. - - - - - - - This example shows how to use a ZlibStream to compress the data from a file, - and store the result into another file. The filestream remains open to allow - additional data to be written to it. - - - using (var output = System.IO.File.Create(fileToCompress + ".zlib")) - { - using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) - { - using (Stream compressor = new ZlibStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, true)) - { - byte[] buffer = new byte[WORKING_BUFFER_SIZE]; - int n; - while ((n= input.Read(buffer, 0, buffer.Length)) != 0) - { - compressor.Write(buffer, 0, n); - } - } - } - // can write additional data to the output stream here - } - - - Using output As FileStream = File.Create(fileToCompress & ".zlib") - Using input As Stream = File.OpenRead(fileToCompress) - Using compressor As Stream = New ZlibStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, True) - Dim buffer As Byte() = New Byte(4096) {} - Dim n As Integer = -1 - Do While (n <> 0) - If (n > 0) Then - compressor.Write(buffer, 0, n) - End If - n = input.Read(buffer, 0, buffer.Length) - Loop - End Using - End Using - ' can write additional data to the output stream here. - End Using - - - - The stream which will be read or written. - - Indicates whether the ZlibStream will compress or decompress. - - - true if the application would like the stream to remain open after - inflation/deflation. - - - - A tuning knob to trade speed for effectiveness. This parameter is - effective only when mode is CompressionMode.Compress. - - - - - Dispose the stream. - - - - This may or may not result in a Close() call on the captive - stream. See the constructors that have a leaveOpen parameter - for more information. - - - This method may be invoked in two distinct scenarios. If disposing - == true, the method has been called directly or indirectly by a - user's code, for example via the public Dispose() method. In this - case, both managed and unmanaged resources can be referenced and - disposed. If disposing == false, the method has been called by the - runtime from inside the object finalizer and this method should not - reference other objects; in that case only unmanaged resources must - be referenced or disposed. - - - - indicates whether the Dispose method was invoked by user code. - - - - - Flush the stream. - - - - - Read data from the stream. - - - - - - If you wish to use the ZlibStream to compress data while reading, - you can create a ZlibStream with CompressionMode.Compress, - providing an uncompressed data stream. Then call Read() on that - ZlibStream, and the data read will be compressed. If you wish to - use the ZlibStream to decompress data while reading, you can create - a ZlibStream with CompressionMode.Decompress, providing a - readable compressed data stream. Then call Read() on that - ZlibStream, and the data will be decompressed as it is read. - - - - A ZlibStream can be used for Read() or Write(), but - not both. - - - - - - The buffer into which the read data should be placed. - - - the offset within that data array to put the first byte read. - - the number of bytes to read. - - the number of bytes read - - - - Calling this method always throws a . - - - The offset to seek to.... - IF THIS METHOD ACTUALLY DID ANYTHING. - - - The reference specifying how to apply the offset.... IF - THIS METHOD ACTUALLY DID ANYTHING. - - - nothing. This method always throws. - - - - Calling this method always throws a . - - - The new value for the stream length.... IF - THIS METHOD ACTUALLY DID ANYTHING. - - - - - Write data to the stream. - - - - - - If you wish to use the ZlibStream to compress data while writing, - you can create a ZlibStream with CompressionMode.Compress, - and a writable output stream. Then call Write() on that - ZlibStream, providing uncompressed data as input. The data sent to - the output stream will be the compressed form of the data written. If you - wish to use the ZlibStream to decompress data while writing, you - can create a ZlibStream with CompressionMode.Decompress, and a - writable output stream. Then call Write() on that stream, - providing previously compressed data. The data sent to the output stream - will be the decompressed form of the data written. - - - - A ZlibStream can be used for Read() or Write(), but not both. - - - The buffer holding data to write to the stream. - the offset within that data array to find the first byte to write. - the number of bytes to write. - - - - Compress a string into a byte array using ZLIB. - - - - Uncompress it with . - - - - - - - - A string to compress. The string will first be encoded - using UTF8, then compressed. - - - The string in compressed form - - - - Compress a byte array into a new byte array using ZLIB. - - - - Uncompress it with . - - - - - - - A buffer to compress. - - - The data in compressed form - - - - Uncompress a ZLIB-compressed byte array into a single string. - - - - - - - A buffer containing ZLIB-compressed data. - - - The uncompressed string - - - - Uncompress a ZLIB-compressed byte array into a byte array. - - - - - - - A buffer containing ZLIB-compressed data. - - - The data in uncompressed form - - - - This property sets the flush behavior on the stream. - Sorry, though, not sure exactly how to describe all the various settings. - - - - - The size of the working buffer for the compression codec. - - - - - The working buffer is used for all stream operations. The default size is - 1024 bytes. The minimum size is 128 bytes. You may get better performance - with a larger buffer. Then again, you might not. You would have to test - it. - - - - Set this before the first call to Read() or Write() on the - stream. If you try to set it afterwards, it will throw. - - - - - Returns the total number of bytes input so far. - - - Returns the total number of bytes output so far. - - - - Indicates whether the stream can be read. - - - The return value depends on whether the captive stream supports reading. - - - - - Indicates whether the stream supports Seek operations. - - - Always returns false. - - - - - Indicates whether the stream can be written. - - - The return value depends on whether the captive stream supports writing. - - - - - Reading this property always throws a . - - - - - The position of the stream pointer. - - - - Setting this property always throws a . Reading will return the total bytes - written out, if used in writing, or the total bytes read in, if used in - reading. The count may refer to compressed bytes or uncompressed bytes, - depending on how you've used the stream. - - - - - Computes a CRC-32. The CRC-32 algorithm is parameterized - you - can set the polynomial and enable or disable bit - reversal. This can be used for GZIP, BZip2, or ZIP. - - - This type is used internally by DotNetZip; it is generally not used - directly by applications wishing to create, read, or manipulate zip - archive files. - - - - - Returns the CRC32 for the specified stream. - - The stream over which to calculate the CRC32 - the CRC32 calculation - - - - Returns the CRC32 for the specified stream, and writes the input into the - output stream. - - The stream over which to calculate the CRC32 - The stream into which to deflate the input - the CRC32 calculation - - - - Get the CRC32 for the given (word,byte) combo. This is a - computation defined by PKzip for PKZIP 2.0 (weak) encryption. - - The word to start with. - The byte to combine it with. - The CRC-ized result. - - - - Update the value for the running CRC32 using the given block of bytes. - This is useful when using the CRC32() class in a Stream. - - block of bytes to slurp - starting point in the block - how many bytes within the block to slurp - - - - Process one byte in the CRC. - - the byte to include into the CRC . - - - - Process a run of N identical bytes into the CRC. - - - - This method serves as an optimization for updating the CRC when a - run of identical bytes is found. Rather than passing in a buffer of - length n, containing all identical bytes b, this method accepts the - byte value and the length of the (virtual) buffer - the length of - the run. - - - the byte to include into the CRC. - the number of times that byte should be repeated. - - - - Combines the given CRC32 value with the current running total. - - - This is useful when using a divide-and-conquer approach to - calculating a CRC. Multiple threads can each calculate a - CRC32 on a segment of the data, and then combine the - individual CRC32 values at the end. - - the crc value to be combined with this one - the length of data the CRC value was calculated on - - - - Create an instance of the CRC32 class using the default settings: no - bit reversal, and a polynomial of 0xEDB88320. - - - - - Create an instance of the CRC32 class, specifying whether to reverse - data bits or not. - - - specify true if the instance should reverse data bits. - - - - In the CRC-32 used by BZip2, the bits are reversed. Therefore if you - want a CRC32 with compatibility with BZip2, you should pass true - here. In the CRC-32 used by GZIP and PKZIP, the bits are not - reversed; Therefore if you want a CRC32 with compatibility with - those, you should pass false. - - - - - - Create an instance of the CRC32 class, specifying the polynomial and - whether to reverse data bits or not. - - - The polynomial to use for the CRC, expressed in the reversed (LSB) - format: the highest ordered bit in the polynomial value is the - coefficient of the 0th power; the second-highest order bit is the - coefficient of the 1 power, and so on. Expressed this way, the - polynomial for the CRC-32C used in IEEE 802.3, is 0xEDB88320. - - - specify true if the instance should reverse data bits. - - - - - In the CRC-32 used by BZip2, the bits are reversed. Therefore if you - want a CRC32 with compatibility with BZip2, you should pass true - here for the reverseBits parameter. In the CRC-32 used by - GZIP and PKZIP, the bits are not reversed; Therefore if you want a - CRC32 with compatibility with those, you should pass false for the - reverseBits parameter. - - - - - - Reset the CRC-32 class - clear the CRC "remainder register." - - - - Use this when employing a single instance of this class to compute - multiple, distinct CRCs on multiple, distinct data blocks. - - - - - - Indicates the total number of bytes applied to the CRC. - - - - - Indicates the current CRC for all blocks slurped in. - - - - - A Stream that calculates a CRC32 (a checksum) on all bytes read, - or on all bytes written. - - - - - This class can be used to verify the CRC of a ZipEntry when - reading from a stream, or to calculate a CRC when writing to a - stream. The stream should be used to either read, or write, but - not both. If you intermix reads and writes, the results are not - defined. - - - - This class is intended primarily for use internally by the - DotNetZip library. - - - - - - The default constructor. - - - - Instances returned from this constructor will leave the underlying - stream open upon Close(). The stream uses the default CRC32 - algorithm, which implies a polynomial of 0xEDB88320. - - - The underlying stream - - - - The constructor allows the caller to specify how to handle the - underlying stream at close. - - - - The stream uses the default CRC32 algorithm, which implies a - polynomial of 0xEDB88320. - - - The underlying stream - true to leave the underlying stream - open upon close of the CrcCalculatorStream; false otherwise. - - - - A constructor allowing the specification of the length of the stream - to read. - - - - The stream uses the default CRC32 algorithm, which implies a - polynomial of 0xEDB88320. - - - Instances returned from this constructor will leave the underlying - stream open upon Close(). - - - The underlying stream - The length of the stream to slurp - - - - A constructor allowing the specification of the length of the stream - to read, as well as whether to keep the underlying stream open upon - Close(). - - - - The stream uses the default CRC32 algorithm, which implies a - polynomial of 0xEDB88320. - - - The underlying stream - The length of the stream to slurp - true to leave the underlying stream - open upon close of the CrcCalculatorStream; false otherwise. - - - - A constructor allowing the specification of the length of the stream - to read, as well as whether to keep the underlying stream open upon - Close(), and the CRC32 instance to use. - - - - The stream uses the specified CRC32 instance, which allows the - application to specify how the CRC gets calculated. - - - The underlying stream - The length of the stream to slurp - true to leave the underlying stream - open upon close of the CrcCalculatorStream; false otherwise. - the CRC32 instance to use to calculate the CRC32 - - - - Read from the stream - - the buffer to read - the offset at which to start - the number of bytes to read - the number of bytes actually read - - - - Write to the stream. - - the buffer from which to write - the offset at which to start writing - the number of bytes to write - - - - Flush the stream. - - - - - Seeking is not supported on this stream. This method always throws - - - N/A - N/A - N/A - - - - This method always throws - - - N/A - - - - Closes the stream. - - - - - Gets the total number of bytes run through the CRC32 calculator. - - - - This is either the total number of bytes read, or the total number of - bytes written, depending on the direction of this stream. - - - - - Provides the current CRC for all blocks slurped in. - - - - The running total of the CRC is kept as data is written or read - through the stream. read this property after all reads or writes to - get an accurate CRC for the entire stream. - - - - - - Indicates whether the underlying stream will be left open when the - CrcCalculatorStream is Closed. - - - - Set this at any point before calling . - - - - - - Indicates whether the stream supports reading. - - - - - Indicates whether the stream supports seeking. - - - - Always returns false. - - - - - - Indicates whether the stream supports writing. - - - - - Returns the length of the underlying stream. - - - - - The getter for this property returns the total bytes read. - If you use the setter, it will throw - . - - -
-
+ + + + Ionic.Zip + + + + + An enum that specifies the source of the ZipEntry. + + + + + Default value. Invalid on a bonafide ZipEntry. + + + + + The entry was instantiated by calling AddFile() or another method that + added an entry from the filesystem. + + + + + The entry was instantiated via or + . + + + + + The ZipEntry was instantiated by reading a zipfile. + + + + + The content for the ZipEntry will be or was provided by the WriteDelegate. + + + + + The content for the ZipEntry will be obtained from the stream dispensed by the OpenDelegate. + The entry was instantiated via . + + + + + The content for the ZipEntry will be or was obtained from a ZipOutputStream. + + + + + Provides a stream metaphor for generating zip files. + + + + + This class writes zip files, as defined in the specification + for zip files described by PKWare. The compression for this + implementation is provided by a managed-code version of Zlib, included with + DotNetZip in the classes in the Ionic.Zlib namespace. + + + + This class provides an alternative programming model to the one enabled by the + class. Use this when creating zip files, as an + alternative to the class, when you would like to use a + Stream type to write the zip file. + + + + Both the ZipOutputStream class and the ZipFile class can be used + to create zip files. Both of them support many of the common zip features, + including Unicode, different compression levels, and ZIP64. They provide + very similar performance when creating zip files. + + + + The ZipFile class is generally easier to use than + ZipOutputStream and should be considered a higher-level interface. For + example, when creating a zip file via calls to the PutNextEntry() and + Write() methods on the ZipOutputStream class, the caller is + responsible for opening the file, reading the bytes from the file, writing + those bytes into the ZipOutputStream, setting the attributes on the + ZipEntry, and setting the created, last modified, and last accessed + timestamps on the zip entry. All of these things are done automatically by a + call to ZipFile.AddFile(). + For this reason, the ZipOutputStream is generally recommended for use + only when your application emits arbitrary data, not necessarily data from a + filesystem file, directly into a zip file, and does so using a Stream + metaphor. + + + + Aside from the differences in programming model, there are other + differences in capability between the two classes. + + + + + ZipFile can be used to read and extract zip files, in addition to + creating zip files. ZipOutputStream cannot read zip files. If you want + to use a stream to read zip files, check out the class. + + + + ZipOutputStream does not support the creation of segmented or spanned + zip files. + + + + ZipOutputStream cannot produce a self-extracting archive. + + + + + Be aware that the ZipOutputStream class implements the interface. In order for + ZipOutputStream to produce a valid zip file, you use use it within + a using clause (Using in VB), or call the Dispose() method + explicitly. See the examples for how to employ a using clause. + + + + Also, a note regarding compression performance: On the desktop .NET + Framework, DotNetZip can use a multi-threaded compression implementation + that provides significant speed increases on large files, over 300k or so, + at the cost of increased memory use at runtime. (The output of the + compression is almost exactly the same size). But, the multi-threaded + approach incurs a performance hit on smaller files. There's no way for the + ZipOutputStream to know whether parallel compression will be beneficial, + because the ZipOutputStream does not know how much data you will write + through the stream. You may wish to set the property to zero, if you are compressing + large files through ZipOutputStream. This will cause parallel + compression to be used, always. + + + + + + Create a ZipOutputStream, wrapping an existing stream. + + + + + The class is generally easier to use when creating + zip files. The ZipOutputStream offers a different metaphor for creating a + zip file, based on the class. + + + + + + The stream to wrap. It must be writable. This stream will be closed at + the time the ZipOutputStream is closed. + + + + + This example shows how to create a zip file, using the + ZipOutputStream class. + + + private void Zipup() + { + if (filesToZip.Count == 0) + { + System.Console.WriteLine("Nothing to do."); + return; + } + + using (var raw = File.Open(_outputFileName, FileMode.Create, FileAccess.ReadWrite )) + { + using (var output= new ZipOutputStream(raw)) + { + output.Password = "VerySecret!"; + output.Encryption = EncryptionAlgorithm.WinZipAes256; + + foreach (string inputFileName in filesToZip) + { + System.Console.WriteLine("file: {0}", inputFileName); + + output.PutNextEntry(inputFileName); + using (var input = File.Open(inputFileName, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Write )) + { + byte[] buffer= new byte[2048]; + int n; + while ((n= input.Read(buffer,0,buffer.Length)) > 0) + { + output.Write(buffer,0,n); + } + } + } + } + } + } + + + + Private Sub Zipup() + Dim outputFileName As String = "XmlData.zip" + Dim filesToZip As String() = Directory.GetFiles(".", "*.xml") + If (filesToZip.Length = 0) Then + Console.WriteLine("Nothing to do.") + Else + Using raw As FileStream = File.Open(outputFileName, FileMode.Create, FileAccess.ReadWrite) + Using output As ZipOutputStream = New ZipOutputStream(raw) + output.Password = "VerySecret!" + output.Encryption = EncryptionAlgorithm.WinZipAes256 + Dim inputFileName As String + For Each inputFileName In filesToZip + Console.WriteLine("file: {0}", inputFileName) + output.PutNextEntry(inputFileName) + Using input As FileStream = File.Open(inputFileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) + Dim n As Integer + Dim buffer As Byte() = New Byte(2048) {} + Do While (n = input.Read(buffer, 0, buffer.Length) > 0) + output.Write(buffer, 0, n) + Loop + End Using + Next + End Using + End Using + End If + End Sub + + + + + + Create a ZipOutputStream that writes to a filesystem file. + + + + The class is generally easier to use when creating + zip files. The ZipOutputStream offers a different metaphor for creating a + zip file, based on the class. + + + + The name of the zip file to create. + + + + + This example shows how to create a zip file, using the + ZipOutputStream class. + + + private void Zipup() + { + if (filesToZip.Count == 0) + { + System.Console.WriteLine("Nothing to do."); + return; + } + + using (var output= new ZipOutputStream(outputFileName)) + { + output.Password = "VerySecret!"; + output.Encryption = EncryptionAlgorithm.WinZipAes256; + + foreach (string inputFileName in filesToZip) + { + System.Console.WriteLine("file: {0}", inputFileName); + + output.PutNextEntry(inputFileName); + using (var input = File.Open(inputFileName, FileMode.Open, FileAccess.Read, + FileShare.Read | FileShare.Write )) + { + byte[] buffer= new byte[2048]; + int n; + while ((n= input.Read(buffer,0,buffer.Length)) > 0) + { + output.Write(buffer,0,n); + } + } + } + } + } + + + + Private Sub Zipup() + Dim outputFileName As String = "XmlData.zip" + Dim filesToZip As String() = Directory.GetFiles(".", "*.xml") + If (filesToZip.Length = 0) Then + Console.WriteLine("Nothing to do.") + Else + Using output As ZipOutputStream = New ZipOutputStream(outputFileName) + output.Password = "VerySecret!" + output.Encryption = EncryptionAlgorithm.WinZipAes256 + Dim inputFileName As String + For Each inputFileName In filesToZip + Console.WriteLine("file: {0}", inputFileName) + output.PutNextEntry(inputFileName) + Using input As FileStream = File.Open(inputFileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) + Dim n As Integer + Dim buffer As Byte() = New Byte(2048) {} + Do While (n = input.Read(buffer, 0, buffer.Length) > 0) + output.Write(buffer, 0, n) + Loop + End Using + Next + End Using + End If + End Sub + + + + + + Create a ZipOutputStream. + + + + See the documentation for the ZipOutputStream(Stream) + constructor for an example. + + + + The stream to wrap. It must be writable. + + + + true if the application would like the stream + to remain open after the ZipOutputStream has been closed. + + + + Provides a string representation of the instance. + + + This can be useful for debugging purposes. + + + a string representation of the instance. + + + + Returns true if an entry by the given name has already been written + to the ZipOutputStream. + + + + The name of the entry to scan for. + + + + true if an entry by the given name has already been written. + + + + + Write the data from the buffer to the stream. + + + + As the application writes data into this stream, the data may be + compressed and encrypted before being written out to the underlying + stream, depending on the settings of the + and the properties. + + + The buffer holding data to write to the stream. + the offset within that data array to find the first byte to write. + the number of bytes to write. + + + + Specify the name of the next entry that will be written to the zip file. + + + + + Call this method just before calling , to + specify the name of the entry that the next set of bytes written to + the ZipOutputStream belongs to. All subsequent calls to Write, + until the next call to PutNextEntry, + will be inserted into the named entry in the zip file. + + + + If the used in PutNextEntry() ends in + a slash, then the entry added is marked as a directory. Because directory + entries do not contain data, a call to Write(), before an + intervening additional call to PutNextEntry(), will throw an + exception. + + + + If you don't call Write() between two calls to + PutNextEntry(), the first entry is inserted into the zip file as a + file of zero size. This may be what you want. + + + + Because PutNextEntry() closes out the prior entry, if any, this + method may throw if there is a problem with the prior entry. + + + + This method returns the ZipEntry. You can modify public properties + on the ZipEntry, such as , , and so on, until the first call to + ZipOutputStream.Write(), or until the next call to + PutNextEntry(). If you modify the ZipEntry after + having called Write(), you may get a runtime exception, or you may + silently get an invalid zip archive. + + + + + + + This example shows how to create a zip file, using the + ZipOutputStream class. + + + private void Zipup() + { + using (FileStream fs raw = File.Open(_outputFileName, FileMode.Create, FileAccess.ReadWrite )) + { + using (var output= new ZipOutputStream(fs)) + { + output.Password = "VerySecret!"; + output.Encryption = EncryptionAlgorithm.WinZipAes256; + output.PutNextEntry("entry1.txt"); + byte[] buffer= System.Text.Encoding.ASCII.GetBytes("This is the content for entry #1."); + output.Write(buffer,0,buffer.Length); + output.PutNextEntry("entry2.txt"); // this will be zero length + output.PutNextEntry("entry3.txt"); + buffer= System.Text.Encoding.ASCII.GetBytes("This is the content for entry #3."); + output.Write(buffer,0,buffer.Length); + } + } + } + + + + + The name of the entry to be added, including any path to be used + within the zip file. + + + + The ZipEntry created. + + + + + + Dispose the stream + + + + + This method writes the Zip Central directory, then closes the stream. The + application must call Dispose() (or Close) in order to produce a valid zip file. + + + + Typically the application will call Dispose() implicitly, via a using + statement in C#, or a Using statement in VB. + + + + + set this to true, always. + + + + This is a no-op. + + + + + This method always throws a NotSupportedException. + + ignored + ignored + ignored + nothing + + + + This method always throws a NotSupportedException. + + ignored + ignored + nothing + + + + This method always throws a NotSupportedException. + + ignored + + + + Sets the password to be used on the ZipOutputStream instance. + + + + + + When writing a zip archive, this password is applied to the entries, not + to the zip archive itself. It applies to any ZipEntry subsequently + written to the ZipOutputStream. + + + + Using a password does not encrypt or protect the "directory" of the + archive - the list of entries contained in the archive. If you set the + Password property, the password actually applies to individual + entries that are added to the archive, subsequent to the setting of this + property. The list of filenames in the archive that is eventually created + will appear in clear text, but the contents of the individual files are + encrypted. This is how Zip encryption works. + + + + If you set this property, and then add a set of entries to the archive via + calls to PutNextEntry, then each entry is encrypted with that + password. You may also want to change the password between adding + different entries. If you set the password, add an entry, then set the + password to null (Nothing in VB), and add another entry, the + first entry is encrypted and the second is not. + + + + When setting the Password, you may also want to explicitly set the property, to specify how to encrypt the entries added + to the ZipFile. If you set the Password to a non-null value and do not + set , then PKZip 2.0 ("Weak") encryption is used. + This encryption is relatively weak but is very interoperable. If + you set the password to a null value (Nothing in VB), + Encryption is reset to None. + + + + Special case: if you wrap a ZipOutputStream around a non-seekable stream, + and use encryption, and emit an entry of zero bytes, the Close() or + PutNextEntry() following the entry will throw an exception. + + + + + + + The Encryption to use for entries added to the ZipOutputStream. + + + + + The specified Encryption is applied to the entries subsequently + written to the ZipOutputStream instance. + + + + If you set this to something other than + EncryptionAlgorithm.None, you will also need to set the + to a non-null, non-empty value in + order to actually get encryption on the entry. + + + + + ZipOutputStream.Password + ZipEntry.Encryption + + + + Size of the work buffer to use for the ZLIB codec during compression. + + + + Setting this may affect performance. For larger files, setting this to a + larger size may improve performance, but I'm not sure. Sorry, I don't + currently have good recommendations on how to set it. You can test it if + you like. + + + + + The compression strategy to use for all entries. + + + + Set the Strategy used by the ZLIB-compatible compressor, when compressing + data for the entries in the zip archive. Different compression strategies + work better on different sorts of data. The strategy parameter can affect + the compression ratio and the speed of compression but not the correctness + of the compresssion. For more information see . + + + + + The type of timestamp attached to the ZipEntry. + + + + Set this in order to specify the kind of timestamp that should be emitted + into the zip file for each entry. + + + + + Sets the compression level to be used for entries subsequently added to + the zip archive. + + + + + Varying the compression level used on entries can affect the + size-vs-speed tradeoff when compression and decompressing data streams + or files. + + + + As with some other properties on the ZipOutputStream class, like , and , + setting this property on a ZipOutputStream + instance will cause the specified CompressionLevel to be used on all + items that are subsequently added to the + ZipOutputStream instance. + + + + If you do not set this property, the default compression level is used, + which normally gives a good balance of compression efficiency and + compression speed. In some tests, using BestCompression can + double the time it takes to compress, while delivering just a small + increase in compression efficiency. This behavior will vary with the + type of data you compress. If you are in doubt, just leave this setting + alone, and accept the default. + + + + + + The compression method used on each entry added to the ZipOutputStream. + + + + + A comment attached to the zip archive. + + + + + + The application sets this property to specify a comment to be embedded + into the generated zip archive. + + + + According to PKWARE's + zip specification, the comment is not encrypted, even if there is a + password set on the zip file. + + + + The specification does not describe how to indicate the encoding used + on a comment string. Many "compliant" zip tools and libraries use + IBM437 as the code page for comments; DotNetZip, too, follows that + practice. On the other hand, there are situations where you want a + Comment to be encoded with something else, for example using code page + 950 "Big-5 Chinese". To fill that need, DotNetZip will encode the + comment following the same procedure it follows for encoding + filenames: (a) if is + Never, it uses the default encoding (IBM437). (b) if is Always, it always uses the + alternate encoding (). (c) if is AsNecessary, it uses the + alternate encoding only if the default encoding is not sufficient for + encoding the comment - in other words if decoding the result does not + produce the original string. This decision is taken at the time of + the call to ZipFile.Save(). + + + + + + + Specify whether to use ZIP64 extensions when saving a zip archive. + + + + + The default value for the property is . is + safest, in the sense that you will not get an Exception if a + pre-ZIP64 limit is exceeded. + + + + You must set this property before calling Write(). + + + + + + + Indicates whether ZIP64 extensions were used when saving the zip archive. + + + + The value is defined only after the ZipOutputStream has been closed. + + + + + Whether the ZipOutputStream should use case-insensitive comparisons when + checking for uniqueness of zip entries. + + + + + Though the zip specification doesn't prohibit zipfiles with duplicate + entries, Sane zip files have no duplicates, and the DotNetZip library + cannot create zip files with duplicate entries. If an application attempts + to call with a name that duplicates one + already used within the archive, the library will throw an Exception. + + + This property allows the application to specify whether the + ZipOutputStream instance considers ordinal case when checking for + uniqueness of zip entries. + + + + + + Indicates whether to encode entry filenames and entry comments using + Unicode (UTF-8). + + + + + The + PKWare zip specification provides for encoding file names and file + comments in either the IBM437 code page, or in UTF-8. This flag selects + the encoding according to that specification. By default, this flag is + false, and filenames and comments are encoded into the zip file in the + IBM437 codepage. Setting this flag to true will specify that filenames + and comments that cannot be encoded with IBM437 will be encoded with + UTF-8. + + + + Zip files created with strict adherence to the PKWare specification with + respect to UTF-8 encoding can contain entries with filenames containing + any combination of Unicode characters, including the full range of + characters from Chinese, Latin, Hebrew, Greek, Cyrillic, and many other + alphabets. However, because at this time, the UTF-8 portion of the PKWare + specification is not broadly supported by other zip libraries and + utilities, such zip files may not be readable by your favorite zip tool or + archiver. In other words, interoperability will decrease if you set this + flag to true. + + + + In particular, Zip files created with strict adherence to the PKWare + specification with respect to UTF-8 encoding will not work well with + Explorer in Windows XP or Windows Vista, because Windows compressed + folders, as far as I know, do not support UTF-8 in zip files. Vista can + read the zip files, but shows the filenames incorrectly. Unpacking from + Windows Vista Explorer will result in filenames that have rubbish + characters in place of the high-order UTF-8 bytes. + + + + Also, zip files that use UTF-8 encoding will not work well with Java + applications that use the java.util.zip classes, as of v5.0 of the Java + runtime. The Java runtime does not correctly implement the PKWare + specification in this regard. + + + + As a result, we have the unfortunate situation that "correct" behavior by + the DotNetZip library with regard to Unicode encoding of filenames during + zip creation will result in zip files that are readable by strictly + compliant and current tools (for example the most recent release of the + commercial WinZip tool); but these zip files will not be readable by + various other tools or libraries, including Windows Explorer. + + + + The DotNetZip library can read and write zip files with UTF8-encoded + entries, according to the PKware spec. If you use DotNetZip for both + creating and reading the zip file, and you use UTF-8, there will be no + loss of information in the filenames. For example, using a self-extractor + created by this library will allow you to unpack files correctly with no + loss of information in the filenames. + + + + If you do not set this flag, it will remain false. If this flag is false, + the ZipOutputStream will encode all filenames and comments using + the IBM437 codepage. This can cause "loss of information" on some + filenames, but the resulting zipfile will be more interoperable with other + utilities. As an example of the loss of information, diacritics can be + lost. The o-tilde character will be down-coded to plain o. The c with a + cedilla (Unicode 0xE7) used in Portugese will be downcoded to a c. + Likewise, the O-stroke character (Unicode 248), used in Danish and + Norwegian, will be down-coded to plain o. Chinese characters cannot be + represented in codepage IBM437; when using the default encoding, Chinese + characters in filenames will be represented as ?. These are all examples + of "information loss". + + + + The loss of information associated to the use of the IBM437 encoding is + inconvenient, and can also lead to runtime errors. For example, using + IBM437, any sequence of 4 Chinese characters will be encoded as ????. If + your application creates a ZipOutputStream, does not set the + encoding, then adds two files, each with names of four Chinese characters + each, this will result in a duplicate filename exception. In the case + where you add a single file with a name containing four Chinese + characters, the zipfile will save properly, but extracting that file + later, with any zip tool, will result in an error, because the question + mark is not legal for use within filenames on Windows. These are just a + few examples of the problems associated to loss of information. + + + + This flag is independent of the encoding of the content within the entries + in the zip file. Think of the zip file as a container - it supports an + encoding. Within the container are other "containers" - the file entries + themselves. The encoding within those entries is independent of the + encoding of the zip archive container for those entries. + + + + Rather than specify the encoding in a binary fashion using this flag, an + application can specify an arbitrary encoding via the property. Setting the encoding + explicitly when creating zip archives will result in non-compliant zip + files that, curiously, are fairly interoperable. The challenge is, the + PKWare specification does not provide for a way to specify that an entry + in a zip archive uses a code page that is neither IBM437 nor UTF-8. + Therefore if you set the encoding explicitly when creating a zip archive, + you must take care upon reading the zip archive to use the same code page. + If you get it wrong, the behavior is undefined and may result in incorrect + filenames, exceptions, stomach upset, hair loss, and acne. + + + + + + + The text encoding to use when emitting entries into the zip archive, for + those entries whose filenames or comments cannot be encoded with the + default (IBM437) encoding. + + + + + In its + zip specification, PKWare describes two options for encoding + filenames and comments: using IBM437 or UTF-8. But, some archiving tools + or libraries do not follow the specification, and instead encode + characters using the system default code page. For example, WinRAR when + run on a machine in Shanghai may encode filenames with the Big-5 Chinese + (950) code page. This behavior is contrary to the Zip specification, but + it occurs anyway. + + + + When using DotNetZip to write zip archives that will be read by one of + these other archivers, set this property to specify the code page to use + when encoding the and for each ZipEntry in the zip file, for + values that cannot be encoded with the default codepage for zip files, + IBM437. This is why this property is "provisional". In all cases, IBM437 + is used where possible, in other words, where no loss of data would + result. It is possible, therefore, to have a given entry with a + Comment encoded in IBM437 and a FileName encoded with the + specified "provisional" codepage. + + + + Be aware that a zip file created after you've explicitly set the + ProvisionalAlternateEncoding property to a value other than + IBM437 may not be compliant to the PKWare specification, and may not be + readable by compliant archivers. On the other hand, many (most?) + archivers are non-compliant and can read zip files created in arbitrary + code pages. The trick is to use or specify the proper codepage when + reading the zip. + + + + When creating a zip archive using this library, it is possible to change + the value of ProvisionalAlternateEncoding between each entry you + add, and between adding entries and the call to Close(). Don't do + this. It will likely result in a zipfile that is not readable. For best + interoperability, either leave ProvisionalAlternateEncoding + alone, or specify it only once, before adding any entries to the + ZipOutputStream instance. There is one exception to this + recommendation, described later. + + + + When using an arbitrary, non-UTF8 code page for encoding, there is no + standard way for the creator application - whether DotNetZip, WinZip, + WinRar, or something else - to formally specify in the zip file which + codepage has been used for the entries. As a result, readers of zip files + are not able to inspect the zip file and determine the codepage that was + used for the entries contained within it. It is left to the application + or user to determine the necessary codepage when reading zip files encoded + this way. If you use an incorrect codepage when reading a zipfile, you + will get entries with filenames that are incorrect, and the incorrect + filenames may even contain characters that are not legal for use within + filenames in Windows. Extracting entries with illegal characters in the + filenames will lead to exceptions. It's too bad, but this is just the way + things are with code pages in zip files. Caveat Emptor. + + + + One possible approach for specifying the code page for a given zip file is + to describe the code page in a human-readable form in the Zip comment. For + example, the comment may read "Entries in this archive are encoded in the + Big5 code page". For maximum interoperability, the zip comment in this + case should be encoded in the default, IBM437 code page. In this case, + the zip comment is encoded using a different page than the filenames. To + do this, Specify ProvisionalAlternateEncoding to your desired + region-specific code page, once before adding any entries, and then set + the property and reset + ProvisionalAlternateEncoding to IBM437 before calling Close(). + + + + + + A Text Encoding to use when encoding the filenames and comments for + all the ZipEntry items, during a ZipFile.Save() operation. + + + + Whether the encoding specified here is used during the save depends + on . + + + + + + A flag that tells if and when this instance should apply + AlternateEncoding to encode the filenames and comments associated to + of ZipEntry objects contained within this instance. + + + + + The default text encoding used in zip archives. It is numeric 437, also + known as IBM437. + + + + + + The size threshold for an entry, above which a parallel deflate is used. + + + + + + DotNetZip will use multiple threads to compress any ZipEntry, when + the CompressionMethod is Deflate, and if the entry is + larger than the given size. Zero means "always use parallel + deflate", while -1 means "never use parallel deflate". + + + + If the entry size cannot be known before compression, as with any entry + added via a ZipOutputStream, then Parallel deflate will never be + performed, unless the value of this property is zero. + + + + A parallel deflate operations will speed up the compression of + large files, on computers with multiple CPUs or multiple CPU + cores. For files above 1mb, on a dual core or dual-cpu (2p) + machine, the time required to compress the file can be 70% of the + single-threaded deflate. For very large files on 4p machines the + compression can be done in 30% of the normal time. The downside + is that parallel deflate consumes extra memory during the deflate, + and the deflation is slightly less effective. + + + + Parallel deflate tends to not be as effective as single-threaded deflate + because the original data stream is split into multiple independent + buffers, each of which is compressed in parallel. But because they are + treated independently, there is no opportunity to share compression + dictionaries, and additional framing bytes must be added to the output + stream. For that reason, a deflated stream may be slightly larger when + compressed using parallel deflate, as compared to a traditional + single-threaded deflate. For files of about 512k, the increase over the + normal deflate is as much as 5% of the total compressed size. For larger + files, the difference can be as small as 0.1%. + + + + Multi-threaded compression does not give as much an advantage when using + Encryption. This is primarily because encryption tends to slow down + the entire pipeline. Also, multi-threaded compression gives less of an + advantage when using lower compression levels, for example . You may have to perform + some tests to determine the best approach for your situation. + + + + The default value for this property is -1, which means parallel + compression will not be performed unless you set it to zero. + + + + + + + The maximum number of buffer pairs to use when performing + parallel compression. + + + + + This property sets an upper limit on the number of memory + buffer pairs to create when performing parallel + compression. The implementation of the parallel + compression stream allocates multiple buffers to + facilitate parallel compression. As each buffer fills up, + the stream uses + ThreadPool.QueueUserWorkItem() to compress those + buffers in a background threadpool thread. After a buffer + is compressed, it is re-ordered and written to the output + stream. + + + + A higher number of buffer pairs enables a higher degree of + parallelism, which tends to increase the speed of compression on + multi-cpu computers. On the other hand, a higher number of buffer + pairs also implies a larger memory consumption, more active worker + threads, and a higher cpu utilization for any compression. This + property enables the application to limit its memory consumption and + CPU utilization behavior depending on requirements. + + + + For each compression "task" that occurs in parallel, there are 2 + buffers allocated: one for input and one for output. This property + sets a limit for the number of pairs. The total amount of storage + space allocated for buffering will then be (N*S*2), where N is the + number of buffer pairs, S is the size of each buffer (). By default, DotNetZip allocates 4 buffer + pairs per CPU core, so if your machine has 4 cores, and you retain + the default buffer size of 128k, then the + ParallelDeflateOutputStream will use 4 * 4 * 2 * 128kb of buffer + memory in total, or 4mb, in blocks of 128kb. If you then set this + property to 8, then the number will be 8 * 2 * 128kb of buffer + memory, or 2mb. + + + + CPU utilization will also go up with additional buffers, because a + larger number of buffer pairs allows a larger number of background + threads to compress in parallel. If you find that parallel + compression is consuming too much memory or CPU, you can adjust this + value downward. + + + + The default value is 16. Different values may deliver better or + worse results, depending on your priorities and the dynamic + performance characteristics of your storage and compute resources. + + + + This property is not the number of buffer pairs to use; it is an + upper limit. An illustration: Suppose you have an application that + uses the default value of this property (which is 16), and it runs + on a machine with 2 CPU cores. In that case, DotNetZip will allocate + 4 buffer pairs per CPU core, for a total of 8 pairs. The upper + limit specified by this property has no effect. + + + + The application can set this value at any time, but it is + effective only if set before calling + ZipOutputStream.Write() for the first time. + + + + + + + + + Always returns false. + + + + + Always returns false. + + + + + Always returns true. + + + + + Always returns a NotSupportedException. + + + + + Setting this property always returns a NotSupportedException. Getting it + returns the value of the Position on the underlying stream. + + + + + Provides a stream metaphor for reading zip files. + + + + + This class provides an alternative programming model for reading zip files to + the one enabled by the class. Use this when reading zip + files, as an alternative to the class, when you would + like to use a Stream class to read the file. + + + + Some application designs require a readable stream for input. This stream can + be used to read a zip file, and extract entries. + + + + Both the ZipInputStream class and the ZipFile class can be used + to read and extract zip files. Both of them support many of the common zip + features, including Unicode, different compression levels, and ZIP64. The + programming models differ. For example, when extracting entries via calls to + the GetNextEntry() and Read() methods on the + ZipInputStream class, the caller is responsible for creating the file, + writing the bytes into the file, setting the attributes on the file, and + setting the created, last modified, and last accessed timestamps on the + file. All of these things are done automatically by a call to ZipEntry.Extract(). For this reason, the + ZipInputStream is generally recommended for when your application wants + to extract the data, without storing that data into a file. + + + + Aside from the obvious differences in programming model, there are some + differences in capability between the ZipFile class and the + ZipInputStream class. + + + + + ZipFile can be used to create or update zip files, or read and + extract zip files. ZipInputStream can be used only to read and + extract zip files. If you want to use a stream to create zip files, check + out the . + + + + ZipInputStream cannot read segmented or spanned + zip files. + + + + ZipInputStream will not read Zip file comments. + + + + When reading larger files, ZipInputStream will always underperform + ZipFile. This is because the ZipInputStream does a full scan on the + zip file, while the ZipFile class reads the central directory of the + zip file. + + + + + + + + + Create a ZipInputStream, wrapping it around an existing stream. + + + + + + While the class is generally easier + to use, this class provides an alternative to those + applications that want to read from a zipfile directly, + using a . + + + + Both the ZipInputStream class and the ZipFile class can be used + to read and extract zip files. Both of them support many of the common zip + features, including Unicode, different compression levels, and ZIP64. The + programming models differ. For example, when extracting entries via calls to + the GetNextEntry() and Read() methods on the + ZipInputStream class, the caller is responsible for creating the file, + writing the bytes into the file, setting the attributes on the file, and + setting the created, last modified, and last accessed timestamps on the + file. All of these things are done automatically by a call to ZipEntry.Extract(). For this reason, the + ZipInputStream is generally recommended for when your application wants + to extract the data, without storing that data into a file. + + + + Aside from the obvious differences in programming model, there are some + differences in capability between the ZipFile class and the + ZipInputStream class. + + + + + ZipFile can be used to create or update zip files, or read and extract + zip files. ZipInputStream can be used only to read and extract zip + files. If you want to use a stream to create zip files, check out the . + + + + ZipInputStream cannot read segmented or spanned + zip files. + + + + ZipInputStream will not read Zip file comments. + + + + When reading larger files, ZipInputStream will always underperform + ZipFile. This is because the ZipInputStream does a full scan on the + zip file, while the ZipFile class reads the central directory of the + zip file. + + + + + + + + The stream to read. It must be readable. This stream will be closed at + the time the ZipInputStream is closed. + + + + + This example shows how to read a zip file, and extract entries, using the + ZipInputStream class. + + + private void Unzip() + { + byte[] buffer= new byte[2048]; + int n; + using (var raw = File.Open(inputFileName, FileMode.Open, FileAccess.Read)) + { + using (var input= new ZipInputStream(raw)) + { + ZipEntry e; + while (( e = input.GetNextEntry()) != null) + { + if (e.IsDirectory) continue; + string outputPath = Path.Combine(extractDir, e.FileName); + using (var output = File.Open(outputPath, FileMode.Create, FileAccess.ReadWrite)) + { + while ((n= input.Read(buffer, 0, buffer.Length)) > 0) + { + output.Write(buffer,0,n); + } + } + } + } + } + } + + + + Private Sub UnZip() + Dim inputFileName As String = "MyArchive.zip" + Dim extractDir As String = "extract" + Dim buffer As Byte() = New Byte(2048) {} + Using raw As FileStream = File.Open(inputFileName, FileMode.Open, FileAccess.Read) + Using input As ZipInputStream = New ZipInputStream(raw) + Dim e As ZipEntry + Do While (Not e = input.GetNextEntry Is Nothing) + If Not e.IsDirectory Then + Using output As FileStream = File.Open(Path.Combine(extractDir, e.FileName), _ + FileMode.Create, FileAccess.ReadWrite) + Dim n As Integer + Do While (n = input.Read(buffer, 0, buffer.Length) > 0) + output.Write(buffer, 0, n) + Loop + End Using + End If + Loop + End Using + End Using + End Sub + + + + + + Create a ZipInputStream, given the name of an existing zip file. + + + + + + This constructor opens a FileStream for the given zipfile, and + wraps a ZipInputStream around that. See the documentation for the + constructor for full details. + + + + While the class is generally easier + to use, this class provides an alternative to those + applications that want to read from a zipfile directly, + using a . + + + + + + The name of the filesystem file to read. + + + + + This example shows how to read a zip file, and extract entries, using the + ZipInputStream class. + + + private void Unzip() + { + byte[] buffer= new byte[2048]; + int n; + using (var input= new ZipInputStream(inputFileName)) + { + ZipEntry e; + while (( e = input.GetNextEntry()) != null) + { + if (e.IsDirectory) continue; + string outputPath = Path.Combine(extractDir, e.FileName); + using (var output = File.Open(outputPath, FileMode.Create, FileAccess.ReadWrite)) + { + while ((n= input.Read(buffer, 0, buffer.Length)) > 0) + { + output.Write(buffer,0,n); + } + } + } + } + } + + + + Private Sub UnZip() + Dim inputFileName As String = "MyArchive.zip" + Dim extractDir As String = "extract" + Dim buffer As Byte() = New Byte(2048) {} + Using input As ZipInputStream = New ZipInputStream(inputFileName) + Dim e As ZipEntry + Do While (Not e = input.GetNextEntry Is Nothing) + If Not e.IsDirectory Then + Using output As FileStream = File.Open(Path.Combine(extractDir, e.FileName), _ + FileMode.Create, FileAccess.ReadWrite) + Dim n As Integer + Do While (n = input.Read(buffer, 0, buffer.Length) > 0) + output.Write(buffer, 0, n) + Loop + End Using + End If + Loop + End Using + End Sub + + + + + + Create a ZipInputStream, explicitly specifying whether to + keep the underlying stream open. + + + + See the documentation for the ZipInputStream(Stream) + constructor for a discussion of the class, and an example of how to use the class. + + + + The stream to read from. It must be readable. + + + + true if the application would like the stream + to remain open after the ZipInputStream has been closed. + + + + Provides a string representation of the instance. + + + This can be useful for debugging purposes. + + + a string representation of the instance. + + + + Read the data from the stream into the buffer. + + + + + The data for the zipentry will be decrypted and uncompressed, as + necessary, before being copied into the buffer. + + + + You must set the property before calling + Read() the first time for an encrypted entry. To determine if an + entry is encrypted and requires a password, check the ZipEntry.Encryption property. + + + + The buffer to hold the data read from the stream. + the offset within the buffer to copy the first byte read. + the number of bytes to read. + the number of bytes read, after decryption and decompression. + + + + Read the next entry from the zip file. + + + + + Call this method just before calling , + to position the pointer in the zip file to the next entry that can be + read. Subsequent calls to Read(), will decrypt and decompress the + data in the zip file, until Read() returns 0. + + + + Each time you call GetNextEntry(), the pointer in the wrapped + stream is moved to the next entry in the zip file. If you call , and thus re-position the pointer within + the file, you will need to call GetNextEntry() again, to insure + that the file pointer is positioned at the beginning of a zip entry. + + + + This method returns the ZipEntry. Using a stream approach, you will + read the raw bytes for an entry in a zip file via calls to Read(). + Alternatively, you can extract an entry into a file, or a stream, by + calling , or one of its siblings. + + + + + + The ZipEntry read. Returns null (or Nothing in VB) if there are no more + entries in the zip file. + + + + + + Dispose the stream. + + + + + This method disposes the ZipInputStream. It may also close the + underlying stream, depending on which constructor was used. + + + + Typically the application will call Dispose() implicitly, via + a using statement in C#, or a Using statement in VB. + + + + Application code won't call this code directly. This method may + be invoked in two distinct scenarios. If disposing == true, the + method has been called directly or indirectly by a user's code, + for example via the public Dispose() method. In this case, both + managed and unmanaged resources can be referenced and disposed. + If disposing == false, the method has been called by the runtime + from inside the object finalizer and this method should not + reference other objects; in that case only unmanaged resources + must be referenced or disposed. + + + + + true if the Dispose method was invoked by user code. + + + + + This is a no-op. + + + + + This method always throws a NotSupportedException. + + ignored + ignored + ignored + + + + This method seeks in the underlying stream. + + + + + Call this method if you want to seek around within the zip file for random access. + + + + Applications can intermix calls to Seek() with calls to . After a call to Seek(), + GetNextEntry() will get the next ZipEntry that falls after + the current position in the input stream. You're on your own for finding + out just where to seek in the stream, to get to the various entries. + + + + + the offset point to seek to + the reference point from which to seek + The new position + + + + This method always throws a NotSupportedException. + + ignored + + + + The text encoding to use when reading entries into the zip archive, for + those entries whose filenames or comments cannot be encoded with the + default (IBM437) encoding. + + + + + In its + zip specification, PKWare describes two options for encoding + filenames and comments: using IBM437 or UTF-8. But, some archiving tools + or libraries do not follow the specification, and instead encode + characters using the system default code page. For example, WinRAR when + run on a machine in Shanghai may encode filenames with the Big-5 Chinese + (950) code page. This behavior is contrary to the Zip specification, but + it occurs anyway. + + + + When using DotNetZip to read zip archives that use something other than + UTF-8 or IBM437, set this property to specify the code page to use when + reading encoded filenames and comments for each ZipEntry in the zip + file. + + + + This property is "provisional". When the entry in the zip archive is not + explicitly marked as using UTF-8, then IBM437 is used to decode filenames + and comments. If a loss of data would result from using IBM436 - + specifically when encoding and decoding is not reflexive - the codepage + specified here is used. It is possible, therefore, to have a given entry + with a Comment encoded in IBM437 and a FileName encoded with + the specified "provisional" codepage. + + + + When a zip file uses an arbitrary, non-UTF8 code page for encoding, there + is no standard way for the reader application - whether DotNetZip, WinZip, + WinRar, or something else - to know which codepage has been used for the + entries. Readers of zip files are not able to inspect the zip file and + determine the codepage that was used for the entries contained within it. + It is left to the application or user to determine the necessary codepage + when reading zip files encoded this way. If you use an incorrect codepage + when reading a zipfile, you will get entries with filenames that are + incorrect, and the incorrect filenames may even contain characters that + are not legal for use within filenames in Windows. Extracting entries with + illegal characters in the filenames will lead to exceptions. It's too bad, + but this is just the way things are with code pages in zip files. Caveat + Emptor. + + + + + + + Size of the work buffer to use for the ZLIB codec during decompression. + + + + Setting this affects the performance and memory efficiency of compression + and decompression. For larger files, setting this to a larger size may + improve performance, but the exact numbers vary depending on available + memory, and a bunch of other variables. I don't have good firm + recommendations on how to set it. You'll have to test it yourself. Or + just leave it alone and accept the default. + + + + + Sets the password to be used on the ZipInputStream instance. + + + + + + When reading a zip archive, this password is used to read and decrypt the + entries that are encrypted within the zip file. When entries within a zip + file use different passwords, set the appropriate password for the entry + before the first call to Read() for each entry. + + + + When reading an entry that is not encrypted, the value of this property is + ignored. + + + + + + + This example uses the ZipInputStream to read and extract entries from a + zip file, using a potentially different password for each entry. + + + byte[] buffer= new byte[2048]; + int n; + using (var raw = File.Open(_inputFileName, FileMode.Open, FileAccess.Read )) + { + using (var input= new ZipInputStream(raw)) + { + ZipEntry e; + while (( e = input.GetNextEntry()) != null) + { + input.Password = PasswordForEntry(e.FileName); + if (e.IsDirectory) continue; + string outputPath = Path.Combine(_extractDir, e.FileName); + using (var output = File.Open(outputPath, FileMode.Create, FileAccess.ReadWrite)) + { + while ((n= input.Read(buffer,0,buffer.Length)) > 0) + { + output.Write(buffer,0,n); + } + } + } + } + } + + + + + + + Always returns true. + + + + + Returns the value of CanSeek for the underlying (wrapped) stream. + + + + + Always returns false. + + + + + Returns the length of the underlying stream. + + + + + Gets or sets the position of the underlying stream. + + + Setting the position is equivalent to calling Seek(value, SeekOrigin.Begin). + + + + + Sort-of like a factory method, ForUpdate is used only when + the application needs to update the zip entry metadata for + a segmented zip file, when the starting segment is earlier + than the ending segment, for a particular entry. + + + + The update is always contiguous, never rolls over. As a + result, this method doesn't need to return a ZSS; it can + simply return a FileStream. That's why it's "sort of" + like a Factory method. + + + Caller must Close/Dispose the stream object returned by + this method. + + + + + + Read from the stream + + the buffer to read + the offset at which to start + the number of bytes to read + the number of bytes actually read + + + + Write to the stream. + + the buffer from which to write + the offset at which to start writing + the number of bytes to write + + + + Name of the filesystem file corresponding to the current segment. + + + + The name is not always the name currently being used in the + filesystem. When rwMode is RwMode.Write, the filesystem file has a + temporary name until the stream is closed or until the next segment is + started. + + + + + + This class exposes a set of COM-accessible wrappers for static + methods available on the ZipFile class. You don't need this + class unless you are using DotNetZip from a COM environment. + + + + + A wrapper for ZipFile.IsZipFile(string) + + The filename to of the zip file to check. + true if the file contains a valid zip file. + + + + A wrapper for ZipFile.IsZipFile(string, bool) + + + We cannot use "overloaded" Method names in COM interop. + So, here, we use a unique name. + + The filename to of the zip file to check. + true if the file contains a valid zip file. + + + + A wrapper for ZipFile.CheckZip(string) + + The filename to of the zip file to check. + + true if the named zip file checks OK. Otherwise, false. + + + + A COM-friendly wrapper for the static method . + + + The filename to of the zip file to check. + + The password to check. + + true if the named zip file checks OK. Otherwise, false. + + + + A wrapper for ZipFile.FixZipDirectory(string) + + The filename to of the zip file to fix. + + + + A wrapper for ZipFile.LibraryVersion + + + the version number on the DotNetZip assembly, formatted as a string. + + + + + An enum providing the options when an error occurs during opening or reading + of a file or directory that is being saved to a zip file. + + + + + This enum describes the actions that the library can take when an error occurs + opening or reading a file, as it is being saved into a Zip archive. + + + + In some cases an error will occur when DotNetZip tries to open a file to be + added to the zip archive. In other cases, an error might occur after the + file has been successfully opened, while DotNetZip is reading the file. + + + + The first problem might occur when calling AddDirectory() on a directory + that contains a Clipper .dbf file; the file is locked by Clipper and + cannot be opened by another process. An example of the second problem is + the ERROR_LOCK_VIOLATION that results when a file is opened by another + process, but not locked, and a range lock has been taken on the file. + Microsoft Outlook takes range locks on .PST files. + + + + + + Throw an exception when an error occurs while zipping. This is the default + behavior. (For COM clients, this is a 0 (zero).) + + + + + When an error occurs during zipping, for example a file cannot be opened, + skip the file causing the error, and continue zipping. (For COM clients, + this is a 1.) + + + + + When an error occurs during zipping, for example a file cannot be opened, + retry the operation that caused the error. Be careful with this option. If + the error is not temporary, the library will retry forever. (For COM + clients, this is a 2.) + + + + + When an error occurs, invoke the zipError event. The event type used is + . A typical use of this option: + a GUI application may wish to pop up a dialog to allow the user to view the + error that occurred, and choose an appropriate action. After your + processing in the error event, if you want to skip the file, set on the + ZipProgressEventArgs.CurrentEntry to Skip. If you want the + exception to be thrown, set ZipErrorAction on the CurrentEntry + to Throw. If you want to cancel the zip, set + ZipProgressEventArgs.Cancel to true. Cancelling differs from using + Skip in that a cancel will not save any further entries, if there are any. + (For COM clients, the value of this enum is a 3.) + + + + + An enum that provides the various encryption algorithms supported by this + library. + + + + + + PkzipWeak implies the use of Zip 2.0 encryption, which is known to be + weak and subvertible. + + + + A note on interoperability: Values of PkzipWeak and None are + specified in PKWARE's zip + specification, and are considered to be "standard". Zip archives + produced using these options will be interoperable with many other zip tools + and libraries, including Windows Explorer. + + + + Values of WinZipAes128 and WinZipAes256 are not part of the Zip + specification, but rather imply the use of a vendor-specific extension from + WinZip. If you want to produce interoperable Zip archives, do not use these + values. For example, if you produce a zip archive using WinZipAes256, you + will be able to open it in Windows Explorer on Windows XP and Vista, but you + will not be able to extract entries; trying this will lead to an "unspecified + error". For this reason, some people have said that a zip archive that uses + WinZip's AES encryption is not actually a zip archive at all. A zip archive + produced this way will be readable with the WinZip tool (Version 11 and + beyond). + + + + There are other third-party tools and libraries, both commercial and + otherwise, that support WinZip's AES encryption. These will be able to read + AES-encrypted zip archives produced by DotNetZip, and conversely applications + that use DotNetZip to read zip archives will be able to read AES-encrypted + archives produced by those tools or libraries. Consult the documentation for + those other tools and libraries to find out if WinZip's AES encryption is + supported. + + + + In case you care: According to the WinZip specification, the + actual AES key used is derived from the via an + algorithm that complies with RFC 2898, using an iteration + count of 1000. The algorithm is sometimes referred to as PBKDF2, which stands + for "Password Based Key Derivation Function #2". + + + + A word about password strength and length: The AES encryption technology is + very good, but any system is only as secure as the weakest link. If you want + to secure your data, be sure to use a password that is hard to guess. To make + it harder to guess (increase its "entropy"), you should make it longer. If + you use normal characters from an ASCII keyboard, a password of length 20 will + be strong enough that it will be impossible to guess. For more information on + that, I'd encourage you to read this + article. + + + + The WinZip AES algorithms are not supported with the version of DotNetZip that + runs on the .NET Compact Framework. This is because .NET CF lacks the + HMACSHA1 class that is required for producing the archive. + + + + + + No encryption at all. + + + + + Traditional or Classic pkzip encryption. + + + + + WinZip AES encryption (128 key bits). + + + + + WinZip AES encryption (256 key bits). + + + + + An encryption algorithm that is not supported by DotNetZip. + + + + + An enum for the options when extracting an entry would overwrite an existing file. + + + + + This enum describes the actions that the library can take when an + Extract() or ExtractWithPassword() method is called to extract an + entry to a filesystem, and the extraction would overwrite an existing filesystem + file. + + + + + + + Throw an exception when extraction would overwrite an existing file. (For + COM clients, this is a 0 (zero).) + + + + + When extraction would overwrite an existing file, overwrite the file silently. + The overwrite will happen even if the target file is marked as read-only. + (For COM clients, this is a 1.) + + + + + When extraction would overwrite an existing file, don't overwrite the file, silently. + (For COM clients, this is a 2.) + + + + + When extraction would overwrite an existing file, invoke the ExtractProgress + event, using an event type of . In + this way, the application can decide, just-in-time, whether to overwrite the + file. For example, a GUI application may wish to pop up a dialog to allow + the user to choose. You may want to examine the property before making + the decision. If, after your processing in the Extract progress event, you + want to NOT extract the file, set + on the ZipProgressEventArgs.CurrentEntry to DoNotOverwrite. + If you do want to extract the file, set ZipEntry.ExtractExistingFile + to OverwriteSilently. If you want to cancel the Extraction, set + ZipProgressEventArgs.Cancel to true. Cancelling differs from using + DoNotOverwrite in that a cancel will not extract any further entries, if + there are any. (For COM clients, the value of this enum is a 3.) + + + + + Enumerates the options for a logical conjunction. This enum is intended for use + internally by the FileSelector class. + + + + + FileSelector encapsulates logic that selects files from a source - a zip file + or the filesystem - based on a set of criteria. This class is used internally + by the DotNetZip library, in particular for the AddSelectedFiles() methods. + This class can also be used independently of the zip capability in DotNetZip. + + + + + + The FileSelector class is used internally by the ZipFile class for selecting + files for inclusion into the ZipFile, when the method, or one of + its overloads, is called. It's also used for the methods. Typically, an + application that creates or manipulates Zip archives will not directly + interact with the FileSelector class. + + + + Some applications may wish to use the FileSelector class directly, to + select files from disk volumes based on a set of criteria, without creating or + querying Zip archives. The file selection criteria include: a pattern to + match the filename; the last modified, created, or last accessed time of the + file; the size of the file; and the attributes of the file. + + + + Consult the documentation for + for more information on specifying the selection criteria. + + + + + + + Constructor that allows the caller to specify file selection criteria. + + + + + This constructor allows the caller to specify a set of criteria for + selection of files. + + + + See for a description of + the syntax of the selectionCriteria string. + + + + By default the FileSelector will traverse NTFS Reparse Points. To + change this, use FileSelector(String, bool). + + + + The criteria for file selection. + + + + Constructor that allows the caller to specify file selection criteria. + + + + + This constructor allows the caller to specify a set of criteria for + selection of files. + + + + See for a description of + the syntax of the selectionCriteria string. + + + + The criteria for file selection. + + whether to traverse NTFS reparse points (junctions). + + + + + Returns a string representation of the FileSelector object. + + The string representation of the boolean logic statement of the file + selection criteria for this instance. + + + + Returns the names of the files in the specified directory + that fit the selection criteria specified in the FileSelector. + + + + This is equivalent to calling + with recurseDirectories = false. + + + + The name of the directory over which to apply the FileSelector + criteria. + + + + A collection of strings containing fully-qualified pathnames of files + that match the criteria specified in the FileSelector instance. + + + + + Returns the names of the files in the specified directory that fit the + selection criteria specified in the FileSelector, optionally recursing + through subdirectories. + + + + This method applies the file selection criteria contained in the + FileSelector to the files contained in the given directory, and + returns the names of files that conform to the criteria. + + + + The name of the directory over which to apply the FileSelector + criteria. + + + + Whether to recurse through subdirectories when applying the file + selection criteria. + + + + A collection of strings containing fully-qualified pathnames of files + that match the criteria specified in the FileSelector instance. + + + + + Retrieve the ZipEntry items in the ZipFile that conform to the specified criteria. + + + + + This method applies the criteria set in the FileSelector instance (as described in + the ) to the specified ZipFile. Using this + method, for example, you can retrieve all entries from the given ZipFile that + have filenames ending in .txt. + + + + Normally, applications would not call this method directly. This method is used + by the ZipFile class. + + + + Using the appropriate SelectionCriteria, you can retrieve entries based on size, + time, and attributes. See for a + description of the syntax of the SelectionCriteria string. + + + + + The ZipFile from which to retrieve entries. + + a collection of ZipEntry objects that conform to the criteria. + + + + Retrieve the ZipEntry items in the ZipFile that conform to the specified criteria. + + + + + This method applies the criteria set in the FileSelector instance (as described in + the ) to the specified ZipFile. Using this + method, for example, you can retrieve all entries from the given ZipFile that + have filenames ending in .txt. + + + + Normally, applications would not call this method directly. This method is used + by the ZipFile class. + + + + This overload allows the selection of ZipEntry instances from the ZipFile to be restricted + to entries contained within a particular directory in the ZipFile. + + + + Using the appropriate SelectionCriteria, you can retrieve entries based on size, + time, and attributes. See for a + description of the syntax of the SelectionCriteria string. + + + + + The ZipFile from which to retrieve entries. + + + the directory in the archive from which to select entries. If null, then + all directories in the archive are used. + + + a collection of ZipEntry objects that conform to the criteria. + + + + The string specifying which files to include when retrieving. + + + + + Specify the criteria in statements of 3 elements: a noun, an operator, + and a value. Consider the string "name != *.doc" . The noun is + "name". The operator is "!=", implying "Not Equal". The value is + "*.doc". That criterion, in English, says "all files with a name that + does not end in the .doc extension." + + + + Supported nouns include "name" (or "filename") for the filename; + "atime", "mtime", and "ctime" for last access time, last modfied time, + and created time of the file, respectively; "attributes" (or "attrs") + for the file attributes; "size" (or "length") for the file length + (uncompressed); and "type" for the type of object, either a file or a + directory. The "attributes", "type", and "name" nouns all support = + and != as operators. The "size", "atime", "mtime", and "ctime" nouns + support = and !=, and >, >=, <, <= as well. The times are + taken to be expressed in local time. + + + + Specify values for the file attributes as a string with one or more of + the characters H,R,S,A,I,L in any order, implying file attributes of + Hidden, ReadOnly, System, Archive, NotContextIndexed, and ReparsePoint + (symbolic link) respectively. + + + + To specify a time, use YYYY-MM-DD-HH:mm:ss or YYYY/MM/DD-HH:mm:ss as + the format. If you omit the HH:mm:ss portion, it is assumed to be + 00:00:00 (midnight). + + + + The value for a size criterion is expressed in integer quantities of + bytes, kilobytes (use k or kb after the number), megabytes (m or mb), + or gigabytes (g or gb). + + + + The value for a name is a pattern to match against the filename, + potentially including wildcards. The pattern follows CMD.exe glob + rules: * implies one or more of any character, while ? implies one + character. If the name pattern contains any slashes, it is matched to + the entire filename, including the path; otherwise, it is matched + against only the filename without the path. This means a pattern of + "*\*.*" matches all files one directory level deep, while a pattern of + "*.*" matches all files in all directories. + + + + To specify a name pattern that includes spaces, use single quotes + around the pattern. A pattern of "'* *.*'" will match all files that + have spaces in the filename. The full criteria string for that would + be "name = '* *.*'" . + + + + The value for a type criterion is either F (implying a file) or D + (implying a directory). + + + + Some examples: + + + + + criteria + Files retrieved + + + + name != *.xls + any file with an extension that is not .xls + + + + + name = *.mp3 + any file with a .mp3 extension. + + + + + *.mp3 + (same as above) any file with a .mp3 extension. + + + + + attributes = A + all files whose attributes include the Archive bit. + + + + + attributes != H + all files whose attributes do not include the Hidden bit. + + + + + mtime > 2009-01-01 + all files with a last modified time after January 1st, 2009. + + + + + ctime > 2009/01/01-03:00:00 + all files with a created time after 3am (local time), + on January 1st, 2009. + + + + + size > 2gb + all files whose uncompressed size is greater than 2gb. + + + + + type = D + all directories in the filesystem. + + + + + + You can combine criteria with the conjunctions AND, OR, and XOR. Using + a string like "name = *.txt AND size >= 100k" for the + selectionCriteria retrieves entries whose names end in .txt, and whose + uncompressed size is greater than or equal to 100 kilobytes. + + + + For more complex combinations of criteria, you can use parenthesis to + group clauses in the boolean logic. Absent parenthesis, the + precedence of the criterion atoms is determined by order of + appearance. Unlike the C# language, the AND conjunction does not take + precendence over the logical OR. This is important only in strings + that contain 3 or more criterion atoms. In other words, "name = *.txt + and size > 1000 or attributes = H" implies "((name = *.txt AND size + > 1000) OR attributes = H)" while "attributes = H OR name = *.txt + and size > 1000" evaluates to "((attributes = H OR name = *.txt) + AND size > 1000)". When in doubt, use parenthesis. + + + + Using time properties requires some extra care. If you want to + retrieve all entries that were last updated on 2009 February 14, + specify "mtime >= 2009-02-14 AND mtime < 2009-02-15". Read this + to say: all files updated after 12:00am on February 14th, until + 12:00am on February 15th. You can use the same bracketing approach to + specify any time period - a year, a month, a week, and so on. + + + + The syntax allows one special case: if you provide a string with no + spaces, it is treated as a pattern to match for the filename. + Therefore a string like "*.xls" will be equivalent to specifying "name + = *.xls". This "shorthand" notation does not work with compound + criteria. + + + + There is no logic in this class that insures that the inclusion + criteria are internally consistent. For example, it's possible to + specify criteria that says the file must have a size of less than 100 + bytes, as well as a size that is greater than 1000 bytes. Obviously + no file will ever satisfy such criteria, but this class does not check + for or detect such inconsistencies. + + + + + + Thrown in the setter if the value has an invalid syntax. + + + + + Indicates whether searches will traverse NTFS reparse points, like Junctions. + + + + + Summary description for EnumUtil. + + + + + Returns the value of the DescriptionAttribute if the specified Enum + value has one. If not, returns the ToString() representation of the + Enum value. + + The Enum to get the description for + + + + + Converts the string representation of the name or numeric value of one + or more enumerated constants to an equivalent enumerated object. + Note: use the DescriptionAttribute on enum values to enable this. + + The System.Type of the enumeration. + + A string containing the name or value to convert. + + + + + + Converts the string representation of the name or numeric value of one + or more enumerated constants to an equivalent enumerated object. A + parameter specified whether the operation is case-sensitive. Note: + use the DescriptionAttribute on enum values to enable this. + + The System.Type of the enumeration. + + A string containing the name or value to convert. + + + Whether the operation is case-sensitive or not. + + + + + This is a helper class supporting WinZip AES encryption. + This class is intended for use only by the DotNetZip library. + + + + Most uses of the DotNetZip library will not involve direct calls into + the WinZipAesCrypto class. Instead, the WinZipAesCrypto class is + instantiated and used by the ZipEntry() class when WinZip AES + encryption or decryption on an entry is employed. + + + + + A stream that encrypts as it writes, or decrypts as it reads. The + Crypto is AES in CTR (counter) mode, which is compatible with the AES + encryption employed by WinZip 12.0. + + + + The AES/CTR encryption protocol used by WinZip works like this: + + - start with a counter, initialized to zero. + + - to encrypt, take the data by 16-byte blocks. For each block: + - apply the transform to the counter + - increement the counter + - XOR the result of the transform with the plaintext to + get the ciphertext. + - compute the mac on the encrypted bytes + - when finished with all blocks, store the computed MAC. + + - to decrypt, take the data by 16-byte blocks. For each block: + - compute the mac on the encrypted bytes, + - apply the transform to the counter + - increement the counter + - XOR the result of the transform with the ciphertext to + get the plaintext. + - when finished with all blocks, compare the computed MAC against + the stored MAC + + + + + + + The constructor. + + The underlying stream + To either encrypt or decrypt. + The pre-initialized WinZipAesCrypto object. + The maximum number of bytes to read from the stream. + + + + Close the stream. + + + + + Flush the content in the stream. + + + + + This method throws a NotImplementedException. + + + + + This method throws a NotImplementedException. + + + + + Returns the final HMAC-SHA1-80 for the data that was encrypted. + + + + + Returns true if the stream can be read. + + + + + Always returns false. + + + + + Returns true if the CryptoMode is Encrypt. + + + + + Getting this property throws a NotImplementedException. + + + + + Getting or Setting this property throws a NotImplementedException. + + + + + Issued when an ZipEntry.ExtractWithPassword() method is invoked + with an incorrect password. + + + + + Base class for all exceptions defined by and throw by the Zip library. + + + + + Default ctor. + + + + + Come on, you know how exceptions work. Why are you looking at this documentation? + + The message in the exception. + + + + Come on, you know how exceptions work. Why are you looking at this documentation? + + The message in the exception. + The innerException for this exception. + + + + Come on, you know how exceptions work. Why are you looking at this documentation? + + The serialization info for the exception. + The streaming context from which to deserialize. + + + + Default ctor. + + + + + Come on, you know how exceptions work. Why are you looking at this documentation? + + The message in the exception. + + + + Come on, you know how exceptions work. Why are you looking at this documentation? + + The message in the exception. + The innerException for this exception. + + + + Come on, you know how exceptions work. Why are you looking at this documentation? + + The serialization info for the exception. + The streaming context from which to deserialize. + + + + Indicates that a read was attempted on a stream, and bad or incomplete data was + received. + + + + + Default ctor. + + + + + Come on, you know how exceptions work. Why are you looking at this documentation? + + The message in the exception. + + + + Come on, you know how exceptions work. Why are you looking at this documentation? + + The message in the exception. + The innerException for this exception. + + + + Come on, you know how exceptions work. Why are you looking at this documentation? + + The serialization info for the exception. + The streaming context from which to deserialize. + + + + Issued when an CRC check fails upon extracting an entry from a zip archive. + + + + + Default ctor. + + + + + Come on, you know how exceptions work. Why are you looking at this documentation? + + The message in the exception. + + + + Come on, you know how exceptions work. Why are you looking at this documentation? + + The serialization info for the exception. + The streaming context from which to deserialize. + + + + Issued when errors occur saving a self-extracting archive. + + + + + Default ctor. + + + + + Come on, you know how exceptions work. Why are you looking at this documentation? + + The message in the exception. + + + + Come on, you know how exceptions work. Why are you looking at this documentation? + + The serialization info for the exception. + The streaming context from which to deserialize. + + + + Indicates that an operation was attempted on a ZipFile which was not possible + given the state of the instance. For example, if you call Save() on a ZipFile + which has no filename set, you can get this exception. + + + + + Default ctor. + + + + + Come on, you know how exceptions work. Why are you looking at this documentation? + + The message in the exception. + + + + Come on, you know how exceptions work. Why are you looking at this documentation? + + The message in the exception. + The innerException for this exception. + + + + Come on, you know how exceptions work. Why are you looking at this documentation? + + The serialization info for the exception. + The streaming context from which to deserialize. + + + + Collects general purpose utility methods. + + + + private null constructor + + + + Utility routine for transforming path names from filesystem format (on Windows that means backslashes) to + a format suitable for use within zipfiles. This means trimming the volume letter and colon (if any) And + swapping backslashes for forward slashes. + + source path. + transformed path + + + + Finds a signature in the zip stream. This is useful for finding + the end of a zip entry, for example, or the beginning of the next ZipEntry. + + + + + Scans through 64k at a time. + + + + If the method fails to find the requested signature, the stream Position + after completion of this method is unchanged. If the method succeeds in + finding the requested signature, the stream position after completion is + direct AFTER the signature found in the stream. + + + + The stream to search + The 4-byte signature to find + The number of bytes read + + + + Create a pseudo-random filename, suitable for use as a temporary + file, and open it. + + + + The System.IO.Path.GetRandomFileName() method is not available on + the Compact Framework, so this library provides its own substitute + on NETCF. + + + This method produces a filename of the form + DotNetZip-xxxxxxxx.tmp, where xxxxxxxx is replaced by randomly + chosen characters, and creates that file. + + + + + + Workitem 7889: handle ERROR_LOCK_VIOLATION during read + + + This could be gracefully handled with an extension attribute, but + This assembly is built for .NET 2.0, so I cannot use them. + + + + + A decorator stream. It wraps another stream, and performs bookkeeping + to keep track of the stream Position. + + + + In some cases, it is not possible to get the Position of a stream, let's + say, on a write-only output stream like ASP.NET's + Response.OutputStream, or on a different write-only stream + provided as the destination for the zip by the application. In this + case, programmers can use this counting stream to count the bytes read + or written. + + + Consider the scenario of an application that saves a self-extracting + archive (SFX), that uses a custom SFX stub. + + + Saving to a filesystem file, the application would open the + filesystem file (getting a FileStream), save the custom sfx stub + into it, and then call ZipFile.Save(), specifying the same + FileStream. ZipFile.Save() does the right thing for the zipentry + offsets, by inquiring the Position of the FileStream before writing + any data, and then adding that initial offset into any ZipEntry + offsets in the zip directory. Everything works fine. + + + Now suppose the application is an ASPNET application and it saves + directly to Response.OutputStream. It's not possible for DotNetZip to + inquire the Position, so the offsets for the SFX will be wrong. + + + The workaround is for the application to use this class to wrap + HttpResponse.OutputStream, then write the SFX stub and the ZipFile + into that wrapper stream. Because ZipFile.Save() can inquire the + Position, it will then do the right thing with the offsets. + + + + + + The constructor. + + The underlying stream + + + + Adjust the byte count on the stream. + + + + the number of bytes to subtract from the count. + + + + + Subtract delta from the count of bytes written to the stream. + This is necessary when seeking back, and writing additional data, + as happens in some cases when saving Zip files. + + + + + + The read method. + + The buffer to hold the data read from the stream. + the offset within the buffer to copy the first byte read. + the number of bytes to read. + the number of bytes read, after decryption and decompression. + + + + Write data into the stream. + + The buffer holding data to write to the stream. + the offset within that data array to find the first byte to write. + the number of bytes to write. + + + + Flushes the underlying stream. + + + + + Seek in the stream. + + the offset point to seek to + the reference point from which to seek + The new position + + + + Set the length of the underlying stream. Be careful with this! + + + the length to set on the underlying stream. + + + + Gets the wrapped stream. + + + + + The count of bytes written out to the stream. + + + + + the count of bytes that have been read from the stream. + + + + + Whether the stream can be read. + + + + + Whether it is possible to call Seek() on the stream. + + + + + Whether it is possible to call Write() on the stream. + + + + + The length of the underlying stream. + + + + + Returns the sum of number of bytes written, plus the initial + offset before writing. + + + + + The Position of the stream. + + + + + This class implements the "traditional" or "classic" PKZip encryption, + which today is considered to be weak. On the other hand it is + ubiquitous. This class is intended for use only by the DotNetZip + library. + + + + Most uses of the DotNetZip library will not involve direct calls into + the ZipCrypto class. Instead, the ZipCrypto class is instantiated and + used by the ZipEntry() class when encryption or decryption on an entry + is employed. If for some reason you really wanted to use a weak + encryption algorithm in some other application, you might use this + library. But you would be much better off using one of the built-in + strong encryption libraries in the .NET Framework, like the AES + algorithm or SHA. + + + + + The default constructor for ZipCrypto. + + + + This class is intended for internal use by the library only. It's + probably not useful to you. Seriously. Stop reading this + documentation. It's a waste of your time. Go do something else. + Check the football scores. Go get an ice cream with a friend. + Seriously. + + + + + + Call this method on a cipher text to render the plaintext. You must + first initialize the cipher with a call to InitCipher. + + + + + var cipher = new ZipCrypto(); + cipher.InitCipher(Password); + // Decrypt the header. This has a side effect of "further initializing the + // encryption keys" in the traditional zip encryption. + byte[] DecryptedMessage = cipher.DecryptMessage(EncryptedMessage); + + + + The encrypted buffer. + + The number of bytes to encrypt. + Should be less than or equal to CipherText.Length. + + + The plaintext. + + + + This is the converse of DecryptMessage. It encrypts the plaintext + and produces a ciphertext. + + + The plain text buffer. + + + The number of bytes to encrypt. + Should be less than or equal to plainText.Length. + + + The ciphertext. + + + + This initializes the cipher with the given password. + See AppNote.txt for details. + + + + The passphrase for encrypting or decrypting with this cipher. + + + + + Step 1 - Initializing the encryption keys + ----------------------------------------- + Start with these keys: + Key(0) := 305419896 (0x12345678) + Key(1) := 591751049 (0x23456789) + Key(2) := 878082192 (0x34567890) + + Then, initialize the keys with a password: + + loop for i from 0 to length(password)-1 + update_keys(password(i)) + end loop + + Where update_keys() is defined as: + + update_keys(char): + Key(0) := crc32(key(0),char) + Key(1) := Key(1) + (Key(0) bitwiseAND 000000ffH) + Key(1) := Key(1) * 134775813 + 1 + Key(2) := crc32(key(2),key(1) rightshift 24) + end update_keys + + Where crc32(old_crc,char) is a routine that given a CRC value and a + character, returns an updated CRC value after applying the CRC-32 + algorithm described elsewhere in this document. + + + + + After the keys are initialized, then you can use the cipher to + encrypt the plaintext. + + + + Essentially we encrypt the password with the keys, then discard the + ciphertext for the password. This initializes the keys for later use. + + + + + + + From AppNote.txt: + unsigned char decrypt_byte() + local unsigned short temp + temp :=- Key(2) | 2 + decrypt_byte := (temp * (temp ^ 1)) bitshift-right 8 + end decrypt_byte + + + + + A Stream for reading and concurrently decrypting data from a zip file, + or for writing and concurrently encrypting data to a zip file. + + + + The constructor. + The underlying stream + To either encrypt or decrypt. + The pre-initialized ZipCrypto object. + + + + Delegate in which the application writes the ZipEntry content for the named entry. + + + The name of the entry that must be written. + The stream to which the entry data should be written. + + + When you add an entry and specify a WriteDelegate, via , the application + code provides the logic that writes the entry data directly into the zip file. + + + + + This example shows how to define a WriteDelegate that obtains a DataSet, and then + writes the XML for the DataSet into the zip archive. There's no need to + save the XML to a disk file first. + + + private void WriteEntry (String filename, Stream output) + { + DataSet ds1 = ObtainDataSet(); + ds1.WriteXml(output); + } + + private void Run() + { + using (var zip = new ZipFile()) + { + zip.AddEntry(zipEntryName, WriteEntry); + zip.Save(zipFileName); + } + } + + + + Private Sub WriteEntry (ByVal filename As String, ByVal output As Stream) + DataSet ds1 = ObtainDataSet() + ds1.WriteXml(stream) + End Sub + + Public Sub Run() + Using zip = New ZipFile + zip.AddEntry(zipEntryName, New WriteDelegate(AddressOf WriteEntry)) + zip.Save(zipFileName) + End Using + End Sub + + + + + + + Delegate in which the application opens the stream, just-in-time, for the named entry. + + + + The name of the ZipEntry that the application should open the stream for. + + + + When you add an entry via , the application code provides the logic that + opens and closes the stream for the given ZipEntry. + + + + + + + Delegate in which the application closes the stream, just-in-time, for the named entry. + + + + The name of the ZipEntry that the application should close the stream for. + + + The stream to be closed. + + + When you add an entry via , the application code provides the logic that + opens and closes the stream for the given ZipEntry. + + + + + + + Delegate for the callback by which the application tells the + library the CompressionLevel to use for a file. + + + + + Using this callback, the application can, for example, specify that + previously-compressed files (.mp3, .png, .docx, etc) should use a + CompressionLevel of None, or can set the compression level based + on any other factor. + + + + + + + In an EventArgs type, indicates which sort of progress event is being + reported. + + + There are events for reading, events for saving, and events for + extracting. This enumeration allows a single EventArgs type to be sued to + describe one of multiple subevents. For example, a SaveProgress event is + invoked before, after, and during the saving of a single entry. The value + of an enum with this type, specifies which event is being triggered. The + same applies to Extraction, Reading and Adding events. + + + + + Indicates that a Add() operation has started. + + + + + Indicates that an individual entry in the archive has been added. + + + + + Indicates that a Add() operation has completed. + + + + + Indicates that a Read() operation has started. + + + + + Indicates that an individual entry in the archive is about to be read. + + + + + Indicates that an individual entry in the archive has just been read. + + + + + Indicates that a Read() operation has completed. + + + + + The given event reports the number of bytes read so far + during a Read() operation. + + + + + Indicates that a Save() operation has started. + + + + + Indicates that an individual entry in the archive is about to be written. + + + + + Indicates that an individual entry in the archive has just been saved. + + + + + Indicates that a Save() operation has completed. + + + + + Indicates that the zip archive has been created in a + temporary location during a Save() operation. + + + + + Indicates that the temporary file is about to be renamed to the final archive + name during a Save() operation. + + + + + Indicates that the temporary file is has just been renamed to the final archive + name during a Save() operation. + + + + + Indicates that the self-extracting archive has been compiled + during a Save() operation. + + + + + The given event is reporting the number of source bytes that have run through the compressor so far + during a Save() operation. + + + + + Indicates that an entry is about to be extracted. + + + + + Indicates that an entry has just been extracted. + + + + + Indicates that extraction of an entry would overwrite an existing + filesystem file. You must use + + ExtractExistingFileAction.InvokeExtractProgressEvent in the call + to ZipEntry.Extract() in order to receive this event. + + + + + The given event is reporting the number of bytes written so far for + the current entry during an Extract() operation. + + + + + Indicates that an ExtractAll operation is about to begin. + + + + + Indicates that an ExtractAll operation has completed. + + + + + Indicates that an error has occurred while saving a zip file. + This generally means the file cannot be opened, because it has been + removed, or because it is locked by another process. It can also + mean that the file cannot be Read, because of a range lock conflict. + + + + + Provides information about the progress of a save, read, or extract operation. + This is a base class; you will probably use one of the classes derived from this one. + + + + + The total number of entries to be saved or extracted. + + + + + The name of the last entry saved or extracted. + + + + + In an event handler, set this to cancel the save or extract + operation that is in progress. + + + + + The type of event being reported. + + + + + Returns the archive name associated to this event. + + + + + The number of bytes read or written so far for this entry. + + + + + Total number of bytes that will be read or written for this entry. + This number will be -1 if the value cannot be determined. + + + + + Provides information about the progress of a Read operation. + + + + + Provides information about the progress of a Add operation. + + + + + Provides information about the progress of a save operation. + + + + + Constructor for the SaveProgressEventArgs. + + the name of the zip archive. + whether this is before saving the entry, or after + The total number of entries in the zip archive. + Number of entries that have been saved. + The entry involved in the event. + + + + Number of entries saved so far. + + + + + Provides information about the progress of the extract operation. + + + + + Constructor for the ExtractProgressEventArgs. + + the name of the zip archive. + whether this is before saving the entry, or after + The total number of entries in the zip archive. + Number of entries that have been extracted. + The entry involved in the event. + The location to which entries are extracted. + + + + Number of entries extracted so far. This is set only if the + EventType is Extracting_BeforeExtractEntry or Extracting_AfterExtractEntry, and + the Extract() is occurring witin the scope of a call to ExtractAll(). + + + + + Returns the extraction target location, a filesystem path. + + + + + Provides information about the an error that occurred while zipping. + + + + + Returns the exception that occurred, if any. + + + + + Returns the name of the file that caused the exception, if any. + + + + + Represents a single entry in a ZipFile. Typically, applications get a ZipEntry + by enumerating the entries within a ZipFile, or by adding an entry to a ZipFile. + + + + + Reads one entry from the zip directory structure in the zip file. + + + + The zipfile for which a directory entry will be read. From this param, the + method gets the ReadStream and the expected text encoding + (ProvisionalAlternateEncoding) which is used if the entry is not marked + UTF-8. + + + + a list of previously seen entry names; used to prevent duplicates. + + + the entry read from the archive. + + + + Returns true if the passed-in value is a valid signature for a ZipDirEntry. + + the candidate 4-byte signature value. + true, if the signature is valid according to the PKWare spec. + + + + Default constructor. + + + Applications should never need to call this directly. It is exposed to + support COM Automation environments. + + + + + Sets the NTFS Creation, Access, and Modified times for the given entry. + + + + + When adding an entry from a file or directory, the Creation, Access, and + Modified times for the given entry are automatically set from the + filesystem values. When adding an entry from a stream or string, the + values are implicitly set to DateTime.Now. The application may wish to + set these values to some arbitrary value, before saving the archive, and + can do so using the various setters. If you want to set all of the times, + this method is more efficient. + + + + The values you set here will be retrievable with the , and properties. + + + + When this method is called, if both and are false, then the + EmitTimesInWindowsFormatWhenSaving flag is automatically set. + + + + DateTime values provided here without a DateTimeKind are assumed to be Local Time. + + + + the creation time of the entry. + the last access time of the entry. + the last modified time of the entry. + + + + + + + + + Provides a string representation of the instance. + a string representation of the instance. + + + + Extract the entry to the filesystem, starting at the current + working directory. + + + + This method has a bunch of overloads! One of them is sure to + be the right one for you... If you don't like these, check + out the ExtractWithPassword() methods. + + + + + + + + + This method extracts an entry from a zip file into the current + working directory. The path of the entry as extracted is the full + path as specified in the zip archive, relative to the current + working directory. After the file is extracted successfully, the + file attributes and timestamps are set. + + + + The action taken when extraction an entry would overwrite an + existing file is determined by the property. + + + + Within the call to Extract(), the content for the entry is + written into a filesystem file, and then the last modified time of the + file is set according to the property on + the entry. See the remarks the property for + some details about the last modified time. + + + + + + + Extract the entry to a file in the filesystem, using the specified + behavior when extraction would overwrite an existing file. + + + + + See the remarks on the property, for some + details about how the last modified time of the file is set after + extraction. + + + + + The action to take if extraction would overwrite an existing file. + + + + + Extracts the entry to the specified stream. + + + + + The caller can specify any write-able stream, for example a , a , or ASP.NET's + Response.OutputStream. The content will be decrypted and + decompressed as necessary. If the entry is encrypted and no password + is provided, this method will throw. + + + The position on the stream is not reset by this method before it extracts. + You may want to call stream.Seek() before calling ZipEntry.Extract(). + + + + + the stream to which the entry should be extracted. + + + + + + Extract the entry to the filesystem, starting at the specified base + directory. + + + the pathname of the base directory + + + + + + This example extracts only the entries in a zip file that are .txt files, + into a directory called "textfiles". + + using (ZipFile zip = ZipFile.Read("PackedDocuments.zip")) + { + foreach (string s1 in zip.EntryFilenames) + { + if (s1.EndsWith(".txt")) + { + zip[s1].Extract("textfiles"); + } + } + } + + + Using zip As ZipFile = ZipFile.Read("PackedDocuments.zip") + Dim s1 As String + For Each s1 In zip.EntryFilenames + If s1.EndsWith(".txt") Then + zip(s1).Extract("textfiles") + End If + Next + End Using + + + + + + + Using this method, existing entries in the filesystem will not be + overwritten. If you would like to force the overwrite of existing + files, see the property, or call + . + + + + See the remarks on the property, for some + details about how the last modified time of the created file is set. + + + + + + Extract the entry to the filesystem, starting at the specified base + directory, and using the specified behavior when extraction would + overwrite an existing file. + + + + + See the remarks on the property, for some + details about how the last modified time of the created file is set. + + + + + + String sZipPath = "Airborne.zip"; + String sFilePath = "Readme.txt"; + String sRootFolder = "Digado"; + using (ZipFile zip = ZipFile.Read(sZipPath)) + { + if (zip.EntryFileNames.Contains(sFilePath)) + { + // use the string indexer on the zip file + zip[sFileName].Extract(sRootFolder, + ExtractExistingFileAction.OverwriteSilently); + } + } + + + + Dim sZipPath as String = "Airborne.zip" + Dim sFilePath As String = "Readme.txt" + Dim sRootFolder As String = "Digado" + Using zip As ZipFile = ZipFile.Read(sZipPath) + If zip.EntryFileNames.Contains(sFilePath) + ' use the string indexer on the zip file + zip(sFilePath).Extract(sRootFolder, _ + ExtractExistingFileAction.OverwriteSilently) + End If + End Using + + + + the pathname of the base directory + + The action to take if extraction would overwrite an existing file. + + + + + Extract the entry to the filesystem, using the current working directory + and the specified password. + + + + This method has a bunch of overloads! One of them is sure to be + the right one for you... + + + + + + + + + Existing entries in the filesystem will not be overwritten. If you + would like to force the overwrite of existing files, see the property, or call + . + + + + See the remarks on the property for some + details about how the "last modified" time of the created file is + set. + + + + + In this example, entries that use encryption are extracted using a + particular password. + + using (var zip = ZipFile.Read(FilePath)) + { + foreach (ZipEntry e in zip) + { + if (e.UsesEncryption) + e.ExtractWithPassword("Secret!"); + else + e.Extract(); + } + } + + + Using zip As ZipFile = ZipFile.Read(FilePath) + Dim e As ZipEntry + For Each e In zip + If (e.UsesEncryption) + e.ExtractWithPassword("Secret!") + Else + e.Extract + End If + Next + End Using + + + The Password to use for decrypting the entry. + + + + Extract the entry to the filesystem, starting at the specified base + directory, and using the specified password. + + + + + + + + Existing entries in the filesystem will not be overwritten. If you + would like to force the overwrite of existing files, see the property, or call + . + + + + See the remarks on the property, for some + details about how the last modified time of the created file is set. + + + + The pathname of the base directory. + The Password to use for decrypting the entry. + + + + Extract the entry to a file in the filesystem, relative to the + current directory, using the specified behavior when extraction + would overwrite an existing file. + + + + + See the remarks on the property, for some + details about how the last modified time of the created file is set. + + + + The Password to use for decrypting the entry. + + + The action to take if extraction would overwrite an existing file. + + + + + Extract the entry to the filesystem, starting at the specified base + directory, and using the specified behavior when extraction would + overwrite an existing file. + + + + See the remarks on the property, for some + details about how the last modified time of the created file is set. + + + the pathname of the base directory + + The action to take if extraction would + overwrite an existing file. + + The Password to use for decrypting the entry. + + + + Extracts the entry to the specified stream, using the specified + Password. For example, the caller could extract to Console.Out, or + to a MemoryStream. + + + + + The caller can specify any write-able stream, for example a , a , or ASP.NET's + Response.OutputStream. The content will be decrypted and + decompressed as necessary. If the entry is encrypted and no password + is provided, this method will throw. + + + The position on the stream is not reset by this method before it extracts. + You may want to call stream.Seek() before calling ZipEntry.Extract(). + + + + + + the stream to which the entry should be extracted. + + + The password to use for decrypting the entry. + + + + + Opens a readable stream corresponding to the zip entry in the + archive. The stream decompresses and decrypts as necessary, as it + is read. + + + + + + DotNetZip offers a variety of ways to extract entries from a zip + file. This method allows an application to extract an entry by + reading a . + + + + The return value is of type . Use it as you would any + stream for reading. When an application calls on that stream, it will + receive data from the zip entry that is decrypted and decompressed + as necessary. + + + + CrcCalculatorStream adds one additional feature: it keeps a + CRC32 checksum on the bytes of the stream as it is read. The CRC + value is available in the property on the + CrcCalculatorStream. When the read is complete, your + application + should check this CRC against the + property on the ZipEntry to validate the content of the + ZipEntry. You don't have to validate the entry using the CRC, but + you should, to verify integrity. Check the example for how to do + this. + + + + If the entry is protected with a password, then you need to provide + a password prior to calling , either by + setting the property on the entry, or the + property on the ZipFile + itself. Or, you can use , the + overload of OpenReader that accepts a password parameter. + + + + If you want to extract entry data into a write-able stream that is + already opened, like a , do not + use this method. Instead, use . + + + + Your application may use only one stream created by OpenReader() at + a time, and you should not call other Extract methods before + completing your reads on a stream obtained from OpenReader(). This + is because there is really only one source stream for the compressed + content. A call to OpenReader() seeks in the source stream, to the + beginning of the compressed content. A subsequent call to + OpenReader() on a different entry will seek to a different position + in the source stream, as will a call to Extract() or one of its + overloads. This will corrupt the state for the decompressing stream + from the original call to OpenReader(). + + + + The OpenReader() method works only when the ZipEntry is + obtained from an instance of ZipFile. This method will throw + an exception if the ZipEntry is obtained from a . + + + + + This example shows how to open a zip archive, then read in a named + entry via a stream. After the read loop is complete, the code + compares the calculated during the read loop with the expected CRC + on the ZipEntry, to verify the extraction. + + using (ZipFile zip = new ZipFile(ZipFileToRead)) + { + ZipEntry e1= zip["Elevation.mp3"]; + using (Ionic.Zlib.CrcCalculatorStream s = e1.OpenReader()) + { + byte[] buffer = new byte[4096]; + int n, totalBytesRead= 0; + do { + n = s.Read(buffer,0, buffer.Length); + totalBytesRead+=n; + } while (n>0); + if (s.Crc32 != e1.Crc32) + throw new Exception(string.Format("The Zip Entry failed the CRC Check. (0x{0:X8}!=0x{1:X8})", s.Crc32, e1.Crc32)); + if (totalBytesRead != e1.UncompressedSize) + throw new Exception(string.Format("We read an unexpected number of bytes. ({0}!={1})", totalBytesRead, e1.UncompressedSize)); + } + } + + + Using zip As New ZipFile(ZipFileToRead) + Dim e1 As ZipEntry = zip.Item("Elevation.mp3") + Using s As Ionic.Zlib.CrcCalculatorStream = e1.OpenReader + Dim n As Integer + Dim buffer As Byte() = New Byte(4096) {} + Dim totalBytesRead As Integer = 0 + Do + n = s.Read(buffer, 0, buffer.Length) + totalBytesRead = (totalBytesRead + n) + Loop While (n > 0) + If (s.Crc32 <> e1.Crc32) Then + Throw New Exception(String.Format("The Zip Entry failed the CRC Check. (0x{0:X8}!=0x{1:X8})", s.Crc32, e1.Crc32)) + End If + If (totalBytesRead <> e1.UncompressedSize) Then + Throw New Exception(String.Format("We read an unexpected number of bytes. ({0}!={1})", totalBytesRead, e1.UncompressedSize)) + End If + End Using + End Using + + + + The Stream for reading. + + + + Opens a readable stream for an encrypted zip entry in the archive. + The stream decompresses and decrypts as necessary, as it is read. + + + + + See the documentation on the method for + full details. This overload allows the application to specify a + password for the ZipEntry to be read. + + + + The password to use for decrypting the entry. + The Stream for reading. + + + + Validates that the args are consistent. + + + Only one of {baseDir, outStream} can be non-null. + If baseDir is non-null, then the outputFile is created. + + + + + Reads one ZipEntry from the given stream. The content for + the entry does not get decompressed or decrypted. This method + basically reads metadata, and seeks. + + the ZipContainer this entry belongs to. + + true of this is the first entry being read from the stream. + + the ZipEntry read from the stream. + + + + Finds a particular segment in the given extra field. + This is used when modifying a previously-generated + extra field, in particular when removing the AES crypto + segment in the extra field. + + + + + At current cursor position in the stream, read the extra + field, and set the properties on the ZipEntry instance + appropriately. This can be called when processing the + Extra field in the Central Directory, or in the local + header. + + + + + generate and return a byte array that encodes the filename + for the entry. + + + + side effects: generate and store into _CommentBytes the + byte array for any comment attached to the entry. Also + sets _actualEncoding to indicate the actual encoding + used. The same encoding is used for both filename and + comment. + + + + + + Stores the position of the entry source stream, or, if the position is + already stored, seeks to that position. + + + + + This method is called in prep for reading the source stream. If PKZIP + encryption is used, then we need to calc the CRC32 before doing the + encryption, because the CRC is used in the 12th byte of the PKZIP + encryption header. So, we need to be able to seek backward in the source + when saving the ZipEntry. This method is called from the place that + calculates the CRC, and also from the method that does the encryption of + the file data. + + + + The first time through, this method sets the _sourceStreamOriginalPosition + field. Subsequent calls to this method seek to that position. + + + + + + Copy metadata that may have been changed by the app. We do this when + resetting the zipFile instance. If the app calls Save() on a ZipFile, then + tries to party on that file some more, we may need to Reset() it , which + means re-reading the entries and then copying the metadata. I think. + + + + + Set the input stream and get its length, if possible. The length is + used for progress updates, AND, to allow an optimization in case of + a stream/file of zero length. In that case we skip the Encrypt and + compression Stream. (like DeflateStream or BZip2OutputStream) + + + + + Prepare the given stream for output - wrap it in a CountingStream, and + then in a CRC stream, and an encryptor and deflator as appropriate. + + + + Previously this was used in ZipEntry.Write(), but in an effort to + introduce some efficiencies in that method I've refactored to put the + code inline. This method still gets called by ZipOutputStream. + + + + + + True if the referenced entry is a directory. + + + + + Provides a human-readable string with information about the ZipEntry. + + + + + The time and date at which the file indicated by the ZipEntry was + last modified. + + + + + The DotNetZip library sets the LastModified value for an entry, equal to + the Last Modified time of the file in the filesystem. If an entry is + added from a stream, the library uses System.DateTime.Now for this + value, for the given entry. + + + + This property allows the application to retrieve and possibly set the + LastModified value on an entry, to an arbitrary value. values with a + setting of DateTimeKind.Unspecified are taken to be expressed as + DateTimeKind.Local. + + + + Be aware that because of the way PKWare's + Zip specification describes how times are stored in the zip file, + the full precision of the System.DateTime datatype is not stored + for the last modified time when saving zip files. For more information on + how times are formatted, see the PKZip specification. + + + + The actual last modified time of a file can be stored in multiple ways in + the zip file, and they are not mutually exclusive: + + + + + In the so-called "DOS" format, which has a 2-second precision. Values + are rounded to the nearest even second. For example, if the time on the + file is 12:34:43, then it will be stored as 12:34:44. This first value + is accessible via the LastModified property. This value is always + present in the metadata for each zip entry. In some cases the value is + invalid, or zero. + + + + In the so-called "Windows" or "NTFS" format, as an 8-byte integer + quantity expressed as the number of 1/10 milliseconds (in other words + the number of 100 nanosecond units) since January 1, 1601 (UTC). This + format is how Windows represents file times. This time is accessible + via the ModifiedTime property. + + + + In the "Unix" format, a 4-byte quantity specifying the number of seconds since + January 1, 1970 UTC. + + + + In an older format, now deprecated but still used by some current + tools. This format is also a 4-byte quantity specifying the number of + seconds since January 1, 1970 UTC. + + + + + + Zip tools and libraries will always at least handle (read or write) the + DOS time, and may also handle the other time formats. Keep in mind that + while the names refer to particular operating systems, there is nothing in + the time formats themselves that prevents their use on other operating + systems. + + + + When reading ZIP files, the DotNetZip library reads the Windows-formatted + time, if it is stored in the entry, and sets both LastModified and + ModifiedTime to that value. When writing ZIP files, the DotNetZip + library by default will write both time quantities. It can also emit the + Unix-formatted time if desired (See .) + + + + The last modified time of the file created upon a call to + ZipEntry.Extract() may be adjusted during extraction to compensate + for differences in how the .NET Base Class Library deals with daylight + saving time (DST) versus how the Windows filesystem deals with daylight + saving time. Raymond Chen provides + some good context. + + + + In a nutshell: Daylight savings time rules change regularly. In 2007, for + example, the inception week of DST changed. In 1977, DST was in place all + year round. In 1945, likewise. And so on. Win32 does not attempt to + guess which time zone rules were in effect at the time in question. It + will render a time as "standard time" and allow the app to change to DST + as necessary. .NET makes a different choice. + + + + Compare the output of FileInfo.LastWriteTime.ToString("f") with what you + see in the Windows Explorer property sheet for a file that was last + written to on the other side of the DST transition. For example, suppose + the file was last modified on October 17, 2003, during DST but DST is not + currently in effect. Explorer's file properties reports Thursday, October + 17, 2003, 8:45:38 AM, but .NETs FileInfo reports Thursday, October 17, + 2003, 9:45 AM. + + + + Win32 says, "Thursday, October 17, 2002 8:45:38 AM PST". Note: Pacific + STANDARD Time. Even though October 17 of that year occurred during Pacific + Daylight Time, Win32 displays the time as standard time because that's + what time it is NOW. + + + + .NET BCL assumes that the current DST rules were in place at the time in + question. So, .NET says, "Well, if the rules in effect now were also in + effect on October 17, 2003, then that would be daylight time" so it + displays "Thursday, October 17, 2003, 9:45 AM PDT" - daylight time. + + + + So .NET gives a value which is more intuitively correct, but is also + potentially incorrect, and which is not invertible. Win32 gives a value + which is intuitively incorrect, but is strictly correct. + + + + Because of this funkiness, this library adds one hour to the LastModified + time on the extracted file, if necessary. That is to say, if the time in + question had occurred in what the .NET Base Class Library assumed to be + DST. This assumption may be wrong given the constantly changing DST rules, + but it is the best we can do. + + + + + + + + Last Modified time for the file represented by the entry. + + + + + + This value corresponds to the "last modified" time in the NTFS file times + as described in the Zip + specification. When getting this property, the value may be + different from . When setting the property, + the property also gets set, but with a lower + precision. + + + + Let me explain. It's going to take a while, so get + comfortable. Originally, waaaaay back in 1989 when the ZIP specification + was originally described by the esteemed Mr. Phil Katz, the dominant + operating system of the time was MS-DOS. MSDOS stored file times with a + 2-second precision, because, c'mon, who is ever going to need better + resolution than THAT? And so ZIP files, regardless of the platform on + which the zip file was created, store file times in exactly the same format that DOS used + in 1989. + + + + Since then, the ZIP spec has evolved, but the internal format for file + timestamps remains the same. Despite the fact that the way times are + stored in a zip file is rooted in DOS heritage, any program on any + operating system can format a time in this way, and most zip tools and + libraries DO - they round file times to the nearest even second and store + it just like DOS did 25+ years ago. + + + + PKWare extended the ZIP specification to allow a zip file to store what + are called "NTFS Times" and "Unix(tm) times" for a file. These are the + last write, last access, and file creation + times of a particular file. These metadata are not actually specific + to NTFS or Unix. They are tracked for each file by NTFS and by various + Unix filesystems, but they are also tracked by other filesystems, too. + The key point is that the times are formatted in the zip file + in the same way that NTFS formats the time (ticks since win32 epoch), + or in the same way that Unix formats the time (seconds since Unix + epoch). As with the DOS time, any tool or library running on any + operating system is capable of formatting a time in one of these ways + and embedding it into the zip file. + + + + These extended times are higher precision quantities than the DOS time. + As described above, the (DOS) LastModified has a precision of 2 seconds. + The Unix time is stored with a precision of 1 second. The NTFS time is + stored with a precision of 0.0000001 seconds. The quantities are easily + convertible, except for the loss of precision you may incur. + + + + A zip archive can store the {C,A,M} times in NTFS format, in Unix format, + or not at all. Often a tool running on Unix or Mac will embed the times + in Unix format (1 second precision), while WinZip running on Windows might + embed the times in NTFS format (precision of of 0.0000001 seconds). When + reading a zip file with these "extended" times, in either format, + DotNetZip represents the values with the + ModifiedTime, AccessedTime and CreationTime + properties on the ZipEntry. + + + + While any zip application or library, regardless of the platform it + runs on, could use any of the time formats allowed by the ZIP + specification, not all zip tools or libraries do support all these + formats. Storing the higher-precision times for each entry is + optional for zip files, and many tools and libraries don't use the + higher precision quantities at all. The old DOS time, represented by + , is guaranteed to be present, though it + sometimes unset. + + + + Ok, getting back to the question about how the LastModified + property relates to this ModifiedTime + property... LastModified is always set, while + ModifiedTime is not. (The other times stored in the NTFS + times extension, CreationTime and AccessedTime also + may not be set on an entry that is read from an existing zip file.) + When reading a zip file, then LastModified takes the DOS time + that is stored with the file. If the DOS time has been stored as zero + in the zipfile, then this library will use DateTime.Now for the + LastModified value. If the ZIP file was created by an evolved + tool, then there will also be higher precision NTFS or Unix times in + the zip file. In that case, this library will read those times, and + set LastModified and ModifiedTime to the same value, the + one corresponding to the last write time of the file. If there are no + higher precision times stored for the entry, then ModifiedTime + remains unset (likewise AccessedTime and CreationTime), + and LastModified keeps its DOS time. + + + + When creating zip files with this library, by default the extended time + properties (ModifiedTime, AccessedTime, and + CreationTime) are set on the ZipEntry instance, and these data are + stored in the zip archive for each entry, in NTFS format. If you add an + entry from an actual filesystem file, then the entry gets the actual file + times for that file, to NTFS-level precision. If you add an entry from a + stream, or a string, then the times get the value DateTime.Now. In + this case LastModified and ModifiedTime will be identical, + to 2 seconds of precision. You can explicitly set the + CreationTime, AccessedTime, and ModifiedTime of an + entry using the property setters. If you want to set all of those + quantities, it's more efficient to use the method. Those + changes are not made permanent in the zip file until you call or one of its cousins. + + + + When creating a zip file, you can override the default behavior of + this library for formatting times in the zip file, disabling the + embedding of file times in NTFS format or enabling the storage of file + times in Unix format, or both. You may want to do this, for example, + when creating a zip file on Windows, that will be consumed on a Mac, + by an application that is not hip to the "NTFS times" format. To do + this, use the and + properties. A valid zip + file may store the file times in both formats. But, there are no + guarantees that a program running on Mac or Linux will gracefully + handle the NTFS-formatted times when Unix times are present, or that a + non-DotNetZip-powered application running on Windows will be able to + handle file times in Unix format. DotNetZip will always do something + reasonable; other libraries or tools may not. When in doubt, test. + + + + I'll bet you didn't think one person could type so much about time, eh? + And reading it was so enjoyable, too! Well, in appreciation, maybe you + should donate? + + + + + + + + + + + Last Access time for the file represented by the entry. + + + This value may or may not be meaningful. If the ZipEntry was read from an existing + Zip archive, this information may not be available. For an explanation of why, see + . + + + + + + + + The file creation time for the file represented by the entry. + + + + This value may or may not be meaningful. If the ZipEntry was read + from an existing zip archive, and the creation time was not set on the entry + when the zip file was created, then this property may be meaningless. For an + explanation of why, see . + + + + + + + + Specifies whether the Creation, Access, and Modified times for the given + entry will be emitted in "Windows format" when the zip archive is saved. + + + + + An application creating a zip archive can use this flag to explicitly + specify that the file times for the entry should or should not be stored + in the zip archive in the format used by Windows. The default value of + this property is true. + + + + When adding an entry from a file or directory, the Creation (), Access (), and Modified + () times for the given entry are automatically + set from the filesystem values. When adding an entry from a stream or + string, all three values are implicitly set to DateTime.Now. Applications + can also explicitly set those times by calling . + + + + PKWARE's + zip specification describes multiple ways to format these times in a + zip file. One is the format Windows applications normally use: 100ns ticks + since Jan 1, 1601 UTC. The other is a format Unix applications typically + use: seconds since January 1, 1970 UTC. Each format can be stored in an + "extra field" in the zip entry when saving the zip archive. The former + uses an extra field with a Header Id of 0x000A, while the latter uses a + header ID of 0x5455. + + + + Not all zip tools and libraries can interpret these fields. Windows + compressed folders is one that can read the Windows Format timestamps, + while I believe the Infozip + tools can read the Unix format timestamps. Although the time values are + easily convertible, subject to a loss of precision, some tools and + libraries may be able to read only one or the other. DotNetZip can read or + write times in either or both formats. + + + + The times stored are taken from , , and . + + + + This property is not mutually exclusive from the property. It is + possible that a zip entry can embed the timestamps in both forms, one + form, or neither. But, there are no guarantees that a program running on + Mac or Linux will gracefully handle NTFS Formatted times, or that a + non-DotNetZip-powered application running on Windows will be able to + handle file times in Unix format. When in doubt, test. + + + + Normally you will use the ZipFile.EmitTimesInWindowsFormatWhenSaving + property, to specify the behavior for all entries in a zip, rather than + the property on each individual entry. + + + + + + + + + + + + + Specifies whether the Creation, Access, and Modified times for the given + entry will be emitted in "Unix(tm) format" when the zip archive is saved. + + + + + An application creating a zip archive can use this flag to explicitly + specify that the file times for the entry should or should not be stored + in the zip archive in the format used by Unix. By default this flag is + false, meaning the Unix-format times are not stored in the zip + archive. + + + + When adding an entry from a file or directory, the Creation (), Access (), and Modified + () times for the given entry are automatically + set from the filesystem values. When adding an entry from a stream or + string, all three values are implicitly set to DateTime.Now. Applications + can also explicitly set those times by calling . + + + + PKWARE's + zip specification describes multiple ways to format these times in a + zip file. One is the format Windows applications normally use: 100ns ticks + since Jan 1, 1601 UTC. The other is a format Unix applications typically + use: seconds since Jan 1, 1970 UTC. Each format can be stored in an + "extra field" in the zip entry when saving the zip archive. The former + uses an extra field with a Header Id of 0x000A, while the latter uses a + header ID of 0x5455. + + + + Not all tools and libraries can interpret these fields. Windows + compressed folders is one that can read the Windows Format timestamps, + while I believe the Infozip + tools can read the Unix format timestamps. Although the time values are + easily convertible, subject to a loss of precision, some tools and + libraries may be able to read only one or the other. DotNetZip can read or + write times in either or both formats. + + + + The times stored are taken from , , and . + + + + This property is not mutually exclusive from the property. It is + possible that a zip entry can embed the timestamps in both forms, one + form, or neither. But, there are no guarantees that a program running on + Mac or Linux will gracefully handle NTFS Formatted times, or that a + non-DotNetZip-powered application running on Windows will be able to + handle file times in Unix format. When in doubt, test. + + + + Normally you will use the ZipFile.EmitTimesInUnixFormatWhenSaving + property, to specify the behavior for all entries, rather than the + property on each individual entry. + + + + + + + + + + + + + The type of timestamp attached to the ZipEntry. + + + + This property is valid only for a ZipEntry that was read from a zip archive. + It indicates the type of timestamp attached to the entry. + + + + + + + + The file attributes for the entry. + + + + + + The attributes in NTFS include + ReadOnly, Archive, Hidden, System, and Indexed. When adding a + ZipEntry to a ZipFile, these attributes are set implicitly when + adding an entry from the filesystem. When adding an entry from a stream + or string, the Attributes are not set implicitly. Regardless of the way + an entry was added to a ZipFile, you can set the attributes + explicitly if you like. + + + + When reading a ZipEntry from a ZipFile, the attributes are + set according to the data stored in the ZipFile. If you extract the + entry from the archive to a filesystem file, DotNetZip will set the + attributes on the resulting file accordingly. + + + + The attributes can be set explicitly by the application. For example the + application may wish to set the FileAttributes.ReadOnly bit for all + entries added to an archive, so that on unpack, this attribute will be set + on the extracted file. Any changes you make to this property are made + permanent only when you call a Save() method on the ZipFile + instance that contains the ZipEntry. + + + + For example, an application may wish to zip up a directory and set the + ReadOnly bit on every file in the archive, so that upon later extraction, + the resulting files will be marked as ReadOnly. Not every extraction tool + respects these attributes, but if you unpack with DotNetZip, as for + example in a self-extracting archive, then the attributes will be set as + they are stored in the ZipFile. + + + + These attributes may not be interesting or useful if the resulting archive + is extracted on a non-Windows platform. How these attributes get used + upon extraction depends on the platform and tool used. + + + + This property is only partially supported in the Silverlight version + of the library: applications can read attributes on entries within + ZipFiles. But extracting entries within Silverlight will not set the + attributes on the extracted files. + + + + + + + The name of the filesystem file, referred to by the ZipEntry. + + + + + This property specifies the thing-to-be-zipped on disk, and is set only + when the ZipEntry is being created from a filesystem file. If the + ZipFile is instantiated by reading an existing .zip archive, then + the LocalFileName will be null (Nothing in VB). + + + + When it is set, the value of this property may be different than , which is the path used in the archive itself. If you + call Zip.AddFile("foop.txt", AlternativeDirectory), then the path + used for the ZipEntry within the zip archive will be different + than this path. + + + + If the entry is being added from a stream, then this is null (Nothing in VB). + + + + + + + + The name of the file contained in the ZipEntry. + + + + + + This is the name of the entry in the ZipFile itself. When creating + a zip archive, if the ZipEntry has been created from a filesystem + file, via a call to or , or a related overload, the value + of this property is derived from the name of that file. The + FileName property does not include drive letters, and may include a + different directory path, depending on the value of the + directoryPathInArchive parameter used when adding the entry into + the ZipFile. + + + + In some cases there is no related filesystem file - for example when a + ZipEntry is created using or one of the similar overloads. In this case, the value of + this property is derived from the fileName and the directory path passed + to that method. + + + + When reading a zip file, this property takes the value of the entry name + as stored in the zip file. If you extract such an entry, the extracted + file will take the name given by this property. + + + + Applications can set this property when creating new zip archives or when + reading existing archives. When setting this property, the actual value + that is set will replace backslashes with forward slashes, in accordance + with the Zip + specification, for compatibility with Unix(tm) and ... get + this.... Amiga! + + + + If an application reads a ZipFile via or a related overload, and then explicitly + sets the FileName on an entry contained within the ZipFile, and + then calls , the application will effectively + rename the entry within the zip archive. + + + + If an application sets the value of FileName, then calls + Extract() on the entry, the entry is extracted to a file using the + newly set value as the filename. The FileName value is made + permanent in the zip archive only after a call to one of the + ZipFile.Save() methods on the ZipFile that contains the + ZipEntry. + + + + If an application attempts to set the FileName to a value that + would result in a duplicate entry in the ZipFile, an exception is + thrown. + + + + When a ZipEntry is contained within a ZipFile, applications + cannot rename the entry within the context of a foreach (For + Each in VB) loop, because of the way the ZipFile stores + entries. If you need to enumerate through all the entries and rename one + or more of them, use ZipFile.EntriesSorted as the + collection. See also, ZipFile.GetEnumerator(). + + + + + + + The stream that provides content for the ZipEntry. + + + + + + The application can use this property to set the input stream for an + entry on a just-in-time basis. Imagine a scenario where the application + creates a ZipFile comprised of content obtained from hundreds of + files, via calls to AddFile(). The DotNetZip library opens streams + on these files on a just-in-time basis, only when writing the entry out to + an external store within the scope of a ZipFile.Save() call. Only + one input stream is opened at a time, as each entry is being written out. + + + + Now imagine a different application that creates a ZipFile + with content obtained from hundreds of streams, added through . Normally the + application would supply an open stream to that call. But when large + numbers of streams are being added, this can mean many open streams at one + time, unnecessarily. + + + + To avoid this, call and specify delegates that open and close the stream at + the time of Save. + + + + + Setting the value of this property when the entry was not added from a + stream (for example, when the ZipEntry was added with or , or when the entry was added by + reading an existing zip archive) will throw an exception. + + + + + + + + A flag indicating whether the InputStream was provided Just-in-time. + + + + + + When creating a zip archive, an application can obtain content for one or + more of the ZipEntry instances from streams, using the method. At the time + of calling that method, the application can supply null as the value of + the stream parameter. By doing so, the application indicates to the + library that it will provide a stream for the entry on a just-in-time + basis, at the time one of the ZipFile.Save() methods is called and + the data for the various entries are being compressed and written out. + + + + In this case, the application can set the + property, typically within the SaveProgress event (event type: ) for that entry. + + + + The application will later want to call Close() and Dispose() on that + stream. In the SaveProgress event, when the event type is , the application can + do so. This flag indicates that the stream has been provided by the + application on a just-in-time basis and that it is the application's + responsibility to call Close/Dispose on that stream. + + + + + + + + An enum indicating the source of the ZipEntry. + + + + + The version of the zip engine needed to read the ZipEntry. + + + + + This is a readonly property, indicating the version of the Zip + specification that the extracting tool or library must support to + extract the given entry. Generally higher versions indicate newer + features. Older zip engines obviously won't know about new features, and + won't be able to extract entries that depend on those newer features. + + + + + value + Features + + + + 20 + a basic Zip Entry, potentially using PKZIP encryption. + + + + + 45 + The ZIP64 extension is used on the entry. + + + + + 46 + File is compressed using BZIP2 compression* + + + + 50 + File is encrypted using PkWare's DES, 3DES, (broken) RC2 or RC4 + + + + 51 + File is encrypted using PKWare's AES encryption or corrected RC2 encryption. + + + + 52 + File is encrypted using corrected RC2-64 encryption** + + + + 61 + File is encrypted using non-OAEP key wrapping*** + + + + 63 + File is compressed using LZMA, PPMd+, Blowfish, or Twofish + + + + + + There are other values possible, not listed here. DotNetZip supports + regular PKZip encryption, and ZIP64 extensions. DotNetZip cannot extract + entries that require a zip engine higher than 45. + + + + This value is set upon reading an existing zip file, or after saving a zip + archive. + + + + + + The comment attached to the ZipEntry. + + + + + Each entry in a zip file can optionally have a comment associated to + it. The comment might be displayed by a zip tool during extraction, for + example. + + + + By default, the Comment is encoded in IBM437 code page. You can + specify an alternative with and + . + + + + + + + + Indicates whether the entry requires ZIP64 extensions. + + + + + + This property is null (Nothing in VB) until a Save() method on the + containing instance has been called. The property is + non-null (HasValue is true) only after a Save() method has + been called. + + + + After the containing ZipFile has been saved, the Value of this + property is true if any of the following three conditions holds: the + uncompressed size of the entry is larger than 0xFFFFFFFF; the compressed + size of the entry is larger than 0xFFFFFFFF; the relative offset of the + entry within the zip archive is larger than 0xFFFFFFFF. These quantities + are not known until a Save() is attempted on the zip archive and + the compression is applied. + + + + If none of the three conditions holds, then the Value is false. + + + + A Value of false does not indicate that the entry, as saved in the + zip archive, does not use ZIP64. It merely indicates that ZIP64 is + not required. An entry may use ZIP64 even when not required if + the property on the containing + ZipFile instance is set to , or if + the property on the containing + ZipFile instance is set to + and the output stream was not seekable. + + + + + + + + Indicates whether the entry actually used ZIP64 extensions, as it was most + recently written to the output file or stream. + + + + + + This Nullable property is null (Nothing in VB) until a Save() + method on the containing instance has been + called. HasValue is true only after a Save() method has been + called. + + + + The value of this property for a particular ZipEntry may change + over successive calls to Save() methods on the containing ZipFile, + even if the file that corresponds to the ZipEntry does not. This + may happen if other entries contained in the ZipFile expand, + causing the offset for this particular entry to exceed 0xFFFFFFFF. + + + + + + + The bitfield for the entry as defined in the zip spec. You probably + never need to look at this. + + + + + You probably do not need to concern yourself with the contents of this + property, but in case you do: + + + + + bit + meaning + + + + 0 + set if encryption is used. + + + + 1-2 + + set to determine whether normal, max, fast deflation. DotNetZip library + always leaves these bits unset when writing (indicating "normal" + deflation"), but can read an entry with any value here. + + + + + 3 + + Indicates that the Crc32, Compressed and Uncompressed sizes are zero in the + local header. This bit gets set on an entry during writing a zip file, when + it is saved to a non-seekable output stream. + + + + + + 4 + reserved for "enhanced deflating". This library doesn't do enhanced deflating. + + + + 5 + set to indicate the zip is compressed patched data. This library doesn't do that. + + + + 6 + + set if PKWare's strong encryption is used (must also set bit 1 if bit 6 is + set). This bit is not set if WinZip's AES encryption is set. + + + + 7 + not used + + + + 8 + not used + + + + 9 + not used + + + + 10 + not used + + + + 11 + + Language encoding flag (EFS). If this bit is set, the filename and comment + fields for this file must be encoded using UTF-8. This library currently + does not support UTF-8. + + + + + 12 + Reserved by PKWARE for enhanced compression. + + + + 13 + + Used when encrypting the Central Directory to indicate selected data + values in the Local Header are masked to hide their actual values. See + the section in the Zip + specification describing the Strong Encryption Specification for + details. + + + + + 14 + Reserved by PKWARE. + + + + 15 + Reserved by PKWARE. + + + + + + + + + The compression method employed for this ZipEntry. + + + + + + The + Zip specification allows a variety of compression methods. This + library supports just two: 0x08 = Deflate. 0x00 = Store (no compression), + for reading or writing. + + + + When reading an entry from an existing zipfile, the value you retrieve + here indicates the compression method used on the entry by the original + creator of the zip. When writing a zipfile, you can specify either 0x08 + (Deflate) or 0x00 (None). If you try setting something else, you will get + an exception. + + + + You may wish to set CompressionMethod to CompressionMethod.None (0) + when zipping already-compressed data like a jpg, png, or mp3 file. + This can save time and cpu cycles. + + + + When setting this property on a ZipEntry that is read from an + existing zip file, calling ZipFile.Save() will cause the new + CompressionMethod to be used on the entry in the newly saved zip file. + + + + Setting this property may have the side effect of modifying the + CompressionLevel property. If you set the CompressionMethod to a + value other than None, and CompressionLevel is previously + set to None, then CompressionLevel will be set to + Default. + + + + + + + In this example, the first entry added to the zip archive uses the default + behavior - compression is used where it makes sense. The second entry, + the MP3 file, is added to the archive without being compressed. + + using (ZipFile zip = new ZipFile(ZipFileToCreate)) + { + ZipEntry e1= zip.AddFile(@"notes\Readme.txt"); + ZipEntry e2= zip.AddFile(@"music\StopThisTrain.mp3"); + e2.CompressionMethod = CompressionMethod.None; + zip.Save(); + } + + + + Using zip As New ZipFile(ZipFileToCreate) + zip.AddFile("notes\Readme.txt") + Dim e2 as ZipEntry = zip.AddFile("music\StopThisTrain.mp3") + e2.CompressionMethod = CompressionMethod.None + zip.Save + End Using + + + + + + Sets the compression level to be used for the entry when saving the zip + archive. This applies only for CompressionMethod = DEFLATE. + + + + + When using the DEFLATE compression method, Varying the compression + level used on entries can affect the size-vs-speed tradeoff when + compression and decompressing data streams or files. + + + + If you do not set this property, the default compression level is used, + which normally gives a good balance of compression efficiency and + compression speed. In some tests, using BestCompression can + double the time it takes to compress, while delivering just a small + increase in compression efficiency. This behavior will vary with the + type of data you compress. If you are in doubt, just leave this setting + alone, and accept the default. + + + + When setting this property on a ZipEntry that is read from an + existing zip file, calling ZipFile.Save() will cause the new + CompressionLevel to be used on the entry in the newly saved zip file. + + + + Setting this property may have the side effect of modifying the + CompressionMethod property. If you set the CompressionLevel + to a value other than None, CompressionMethod will be set + to Deflate, if it was previously None. + + + + Setting this property has no effect if the CompressionMethod is something + other than Deflate or None. + + + + + + + + The compressed size of the file, in bytes, within the zip archive. + + + + When reading a ZipFile, this value is read in from the existing + zip file. When creating or updating a ZipFile, the compressed + size is computed during compression. Therefore the value on a + ZipEntry is valid after a call to Save() (or one of its + overloads) in that case. + + + + + + + The size of the file, in bytes, before compression, or after extraction. + + + + When reading a ZipFile, this value is read in from the existing + zip file. When creating or updating a ZipFile, the uncompressed + size is computed during compression. Therefore the value on a + ZipEntry is valid after a call to Save() (or one of its + overloads) in that case. + + + + + + + The ratio of compressed size to uncompressed size of the ZipEntry. + + + + + This is a ratio of the compressed size to the uncompressed size of the + entry, expressed as a double in the range of 0 to 100+. A value of 100 + indicates no compression at all. It could be higher than 100 when the + compression algorithm actually inflates the data, as may occur for small + files, or uncompressible data that is encrypted. + + + + You could format it for presentation to a user via a format string of + "{3,5:F0}%" to see it as a percentage. + + + + If the size of the original uncompressed file is 0, implying a + denominator of 0, the return value will be zero. + + + + This property is valid after reading in an existing zip file, or after + saving the ZipFile that contains the ZipEntry. You cannot know the + effect of a compression transform until you try it. + + + + + + + The 32-bit CRC (Cyclic Redundancy Check) on the contents of the ZipEntry. + + + + + You probably don't need to concern yourself with this. It is used + internally by DotNetZip to verify files or streams upon extraction. + + The value is a 32-bit + CRC using 0xEDB88320 for the polynomial. This is the same CRC-32 used in + PNG, MPEG-2, and other protocols and formats. It is a read-only property; when + creating a Zip archive, the CRC for each entry is set only after a call to + Save() on the containing ZipFile. When reading an existing zip file, the value + of this property reflects the stored CRC for the entry. + + + + + + True if the entry is a directory (not a file). + This is a readonly property on the entry. + + + + + A derived property that is true if the entry uses encryption. + + + + + This is a readonly property on the entry. When reading a zip file, + the value for the ZipEntry is determined by the data read + from the zip file. After saving a ZipFile, the value of this + property for each ZipEntry indicates whether encryption was + actually used (which will have been true if the was set and the property + was something other than . + + + + + + Set this to specify which encryption algorithm to use for the entry when + saving it to a zip archive. + + + + + + Set this property in order to encrypt the entry when the ZipFile is + saved. When setting this property, you must also set a on the entry. If you set a value other than on this property and do not set a + Password then the entry will not be encrypted. The ZipEntry + data is encrypted as the ZipFile is saved, when you call or one of its cousins on the containing + ZipFile instance. You do not need to specify the Encryption + when extracting entries from an archive. + + + + The Zip specification from PKWare defines a set of encryption algorithms, + and the data formats for the zip archive that support them, and PKWare + supports those algorithms in the tools it produces. Other vendors of tools + and libraries, such as WinZip or Xceed, typically support a + subset of the algorithms specified by PKWare. These tools can + sometimes support additional different encryption algorithms and data + formats, not specified by PKWare. The AES Encryption specified and + supported by WinZip is the most popular example. This library supports a + subset of the complete set of algorithms specified by PKWare and other + vendors. + + + + There is no common, ubiquitous multi-vendor standard for strong encryption + within zip files. There is broad support for so-called "traditional" Zip + encryption, sometimes called Zip 2.0 encryption, as specified + by PKWare, but this encryption is considered weak and + breakable. This library currently supports the Zip 2.0 "weak" encryption, + and also a stronger WinZip-compatible AES encryption, using either 128-bit + or 256-bit key strength. If you want DotNetZip to support an algorithm + that is not currently supported, call the author of this library and maybe + we can talk business. + + + + The class also has a property. In most cases you will use + that property when setting encryption. This property takes + precedence over any Encryption set on the ZipFile itself. + Typically, you would use the per-entry Encryption when most entries in the + zip archive use one encryption algorithm, and a few entries use a + different one. If all entries in the zip file use the same Encryption, + then it is simpler to just set this property on the ZipFile itself, when + creating a zip archive. + + + + Some comments on updating archives: If you read a ZipFile, you can + modify the Encryption on an encrypted entry: you can remove encryption + from an entry that was encrypted; you can encrypt an entry that was not + encrypted previously; or, you can change the encryption algorithm. The + changes in encryption are not made permanent until you call Save() on the + ZipFile. To effect changes in encryption, the entry content is + streamed through several transformations, depending on the modification + the application has requested. For example if the entry is not encrypted + and the application sets Encryption to PkzipWeak, then at + the time of Save(), the original entry is read and decompressed, + then re-compressed and encrypted. Conversely, if the original entry is + encrypted with PkzipWeak encryption, and the application sets the + Encryption property to WinZipAes128, then at the time of + Save(), the original entry is decrypted via PKZIP encryption and + decompressed, then re-compressed and re-encrypted with AES. This all + happens automatically within the library, but it can be time-consuming for + large entries. + + + + Additionally, when updating archives, it is not possible to change the + password when changing the encryption algorithm. To change both the + algorithm and the password, you need to Save() the zipfile twice. First + set the Encryption to None, then call Save(). Then set the + Encryption to the new value (not "None"), then call Save() + once again. + + + + The WinZip AES encryption algorithms are not supported on the .NET Compact + Framework. + + + + + + This example creates a zip archive that uses encryption, and then extracts + entries from the archive. When creating the zip archive, the ReadMe.txt + file is zipped without using a password or encryption. The other file + uses encryption. + + + // Create a zip archive with AES Encryption. + using (ZipFile zip = new ZipFile()) + { + zip.AddFile("ReadMe.txt") + ZipEntry e1= zip.AddFile("2008-Regional-Sales-Report.pdf"); + e1.Encryption= EncryptionAlgorithm.WinZipAes256; + e1.Password= "Top.Secret.No.Peeking!"; + zip.Save("EncryptedArchive.zip"); + } + + // Extract a zip archive that uses AES Encryption. + // You do not need to specify the algorithm during extraction. + using (ZipFile zip = ZipFile.Read("EncryptedArchive.zip")) + { + // Specify the password that is used during extraction, for + // all entries that require a password: + zip.Password= "Top.Secret.No.Peeking!"; + zip.ExtractAll("extractDirectory"); + } + + + + ' Create a zip that uses Encryption. + Using zip As New ZipFile() + zip.AddFile("ReadMe.txt") + Dim e1 as ZipEntry + e1= zip.AddFile("2008-Regional-Sales-Report.pdf") + e1.Encryption= EncryptionAlgorithm.WinZipAes256 + e1.Password= "Top.Secret.No.Peeking!" + zip.Save("EncryptedArchive.zip") + End Using + + ' Extract a zip archive that uses AES Encryption. + ' You do not need to specify the algorithm during extraction. + Using (zip as ZipFile = ZipFile.Read("EncryptedArchive.zip")) + ' Specify the password that is used during extraction, for + ' all entries that require a password: + zip.Password= "Top.Secret.No.Peeking!" + zip.ExtractAll("extractDirectory") + End Using + + + + + + Thrown in the setter if EncryptionAlgorithm.Unsupported is specified. + + + ZipEntry.Password + ZipFile.Encryption + + + + The Password to be used when encrypting a ZipEntry upon + ZipFile.Save(), or when decrypting an entry upon Extract(). + + + + + This is a write-only property on the entry. Set this to request that the + entry be encrypted when writing the zip archive, or set it to specify the + password to be used when extracting an existing entry that is encrypted. + + + + The password set here is implicitly used to encrypt the entry during the + operation, or to decrypt during the or operation. If you set + the Password on a ZipEntry after calling Save(), there is no + effect. + + + + Consider setting the property when using a + password. Answering concerns that the standard password protection + supported by all zip tools is weak, WinZip has extended the ZIP + specification with a way to use AES Encryption to protect entries in the + Zip file. Unlike the "PKZIP 2.0" encryption specified in the PKZIP + specification, AES + Encryption uses a standard, strong, tested, encryption + algorithm. DotNetZip can create zip archives that use WinZip-compatible + AES encryption, if you set the property. But, + archives created that use AES encryption may not be readable by all other + tools and libraries. For example, Windows Explorer cannot read a + "compressed folder" (a zip file) that uses AES encryption, though it can + read a zip file that uses "PKZIP encryption." + + + + The class also has a + property. This property takes precedence over any password set on the + ZipFile itself. Typically, you would use the per-entry Password when most + entries in the zip archive use one password, and a few entries use a + different password. If all entries in the zip file use the same password, + then it is simpler to just set this property on the ZipFile itself, + whether creating a zip archive or extracting a zip archive. + + + + Some comments on updating archives: If you read a ZipFile, you + cannot modify the password on any encrypted entry, except by extracting + the entry with the original password (if any), removing the original entry + via , and then adding a new + entry with a new Password. + + + + For example, suppose you read a ZipFile, and there is an encrypted + entry. Setting the Password property on that ZipEntry and then + calling Save() on the ZipFile does not update the password + on that entry in the archive. Neither is an exception thrown. Instead, + what happens during the Save() is the existing entry is copied + through to the new zip archive, in its original encrypted form. Upon + re-reading that archive, the entry can be decrypted with its original + password. + + + + If you read a ZipFile, and there is an un-encrypted entry, you can set the + Password on the entry and then call Save() on the ZipFile, and get + encryption on that entry. + + + + + + + This example creates a zip file with two entries, and then extracts the + entries from the zip file. When creating the zip file, the two files are + added to the zip file using password protection. Each entry uses a + different password. During extraction, each file is extracted with the + appropriate password. + + + // create a file with encryption + using (ZipFile zip = new ZipFile()) + { + ZipEntry entry; + entry= zip.AddFile("Declaration.txt"); + entry.Password= "123456!"; + entry = zip.AddFile("Report.xls"); + entry.Password= "1Secret!"; + zip.Save("EncryptedArchive.zip"); + } + + // extract entries that use encryption + using (ZipFile zip = ZipFile.Read("EncryptedArchive.zip")) + { + ZipEntry entry; + entry = zip["Declaration.txt"]; + entry.Password = "123456!"; + entry.Extract("extractDir"); + entry = zip["Report.xls"]; + entry.Password = "1Secret!"; + entry.Extract("extractDir"); + } + + + + + Using zip As New ZipFile + Dim entry as ZipEntry + entry= zip.AddFile("Declaration.txt") + entry.Password= "123456!" + entry = zip.AddFile("Report.xls") + entry.Password= "1Secret!" + zip.Save("EncryptedArchive.zip") + End Using + + + ' extract entries that use encryption + Using (zip as ZipFile = ZipFile.Read("EncryptedArchive.zip")) + Dim entry as ZipEntry + entry = zip("Declaration.txt") + entry.Password = "123456!" + entry.Extract("extractDir") + entry = zip("Report.xls") + entry.Password = "1Secret!" + entry.Extract("extractDir") + End Using + + + + + + + ZipFile.Password + + + + The action the library should take when extracting a file that already exists. + + + + + This property affects the behavior of the Extract methods (one of the + Extract() or ExtractWithPassword() overloads), when + extraction would would overwrite an existing filesystem file. If you do + not set this property, the library throws an exception when extracting + an entry would overwrite an existing file. + + + + This property has no effect when extracting to a stream, or when the file to be + extracted does not already exist. + + + + + + + This example shows how to set the ExtractExistingFile property in + an ExtractProgress event, in response to user input. The + ExtractProgress event is invoked if and only if the + ExtractExistingFile property was previously set to + ExtractExistingFileAction.InvokeExtractProgressEvent. + + public static void ExtractProgress(object sender, ExtractProgressEventArgs e) + { + if (e.EventType == ZipProgressEventType.Extracting_BeforeExtractEntry) + Console.WriteLine("extract {0} ", e.CurrentEntry.FileName); + + else if (e.EventType == ZipProgressEventType.Extracting_ExtractEntryWouldOverwrite) + { + ZipEntry entry = e.CurrentEntry; + string response = null; + // Ask the user if he wants overwrite the file + do + { + Console.Write("Overwrite {0} in {1} ? (y/n/C) ", entry.FileName, e.ExtractLocation); + response = Console.ReadLine(); + Console.WriteLine(); + + } while (response != null && response[0]!='Y' && + response[0]!='N' && response[0]!='C'); + + if (response[0]=='C') + e.Cancel = true; + else if (response[0]=='Y') + entry.ExtractExistingFile = ExtractExistingFileAction.OverwriteSilently; + else + entry.ExtractExistingFile= ExtractExistingFileAction.DoNotOverwrite; + } + } + + + + + + The action to take when an error is encountered while + opening or reading files as they are saved into a zip archive. + + + + + Errors can occur within a call to ZipFile.Save, as the various files contained + in a ZipFile are being saved into the zip archive. During the + Save, DotNetZip will perform a File.Open on the file + associated to the ZipEntry, and then will read the entire contents of + the file as it is zipped. Either the open or the Read may fail, because + of lock conflicts or other reasons. Using this property, you can + specify the action to take when such errors occur. + + + + Typically you will NOT set this property on individual ZipEntry + instances. Instead, you will set the ZipFile.ZipErrorAction property on + the ZipFile instance, before adding any entries to the + ZipFile. If you do this, errors encountered on behalf of any of + the entries in the ZipFile will be handled the same way. + + + + But, if you use a handler, you will want + to set this property on the ZipEntry within the handler, to + communicate back to DotNetZip what you would like to do with the + particular error. + + + + + + + + + Indicates whether the entry was included in the most recent save. + + + An entry can be excluded or skipped from a save if there is an error + opening or reading the entry. + + + + + + A callback that allows the application to specify the compression to use + for a given entry that is about to be added to the zip archive. + + + + + See + + + + + + Set to indicate whether to use UTF-8 encoding for filenames and comments. + + + + + + If this flag is set, the comment and filename for the entry will be + encoded with UTF-8, as described in the Zip + specification, if necessary. "Necessary" means, the filename or + entry comment (if any) cannot be reflexively encoded and decoded using the + default code page, IBM437. + + + + Setting this flag to true is equivalent to setting to System.Text.Encoding.UTF8. + + + + This flag has no effect or relation to the text encoding used within the + file itself. + + + + + + + The text encoding to use for the FileName and Comment on this ZipEntry, + when the default encoding is insufficient. + + + + + + Don't use this property. See . + + + + + + + Specifies the alternate text encoding used by this ZipEntry + + + + The default text encoding used in Zip files for encoding filenames and + comments is IBM437, which is something like a superset of ASCII. In + cases where this is insufficient, applications can specify an + alternate encoding. + + + When creating a zip file, the usage of the alternate encoding is + governed by the property. + Typically you would set both properties to tell DotNetZip to employ an + encoding that is not IBM437 in the zipfile you are creating. + + + Keep in mind that because the ZIP specification states that the only + valid encodings to use are IBM437 and UTF-8, if you use something + other than that, then zip tools and libraries may not be able to + successfully read the zip archive you generate. + + + The zip specification states that applications should presume that + IBM437 is in use, except when a special bit is set, which indicates + UTF-8. There is no way to specify an arbitrary code page, within the + zip file itself. When you create a zip file encoded with gb2312 or + ibm861 or anything other than IBM437 or UTF-8, then the application + that reads the zip file needs to "know" which code page to use. In + some cases, the code page used when reading is chosen implicitly. For + example, WinRar uses the ambient code page for the host desktop + operating system. The pitfall here is that if you create a zip in + Copenhagen and send it to Tokyo, the reader of the zipfile may not be + able to decode successfully. + + + + This example shows how to create a zipfile encoded with a + language-specific encoding: + + using (var zip = new ZipFile()) + { + zip.AlternateEnoding = System.Text.Encoding.GetEncoding("ibm861"); + zip.AlternateEnodingUsage = ZipOption.Always; + zip.AddFileS(arrayOfFiles); + zip.Save("Myarchive-Encoded-in-IBM861.zip"); + } + + + + + + + Describes if and when this instance should apply + AlternateEncoding to encode the FileName and Comment, when + saving. + + + + + + Indicates whether an entry is marked as a text file. Be careful when + using on this property. Unless you have a good reason, you should + probably ignore this property. + + + + + The ZIP format includes a provision for specifying whether an entry in + the zip archive is a text or binary file. This property exposes that + metadata item. Be careful when using this property: It's not clear + that this property as a firm meaning, across tools and libraries. + + + + To be clear, when reading a zip file, the property value may or may + not be set, and its value may or may not be valid. Not all entries + that you may think of as "text" entries will be so marked, and entries + marked as "text" are not guaranteed in any way to be text entries. + Whether the value is set and set correctly depends entirely on the + application that produced the zip file. + + + + There are many zip tools available, and when creating zip files, some + of them "respect" the IsText metadata field, and some of them do not. + Unfortunately, even when an application tries to do "the right thing", + it's not always clear what "the right thing" is. + + + + There's no firm definition of just what it means to be "a text file", + and the zip specification does not help in this regard. Twenty years + ago, text was ASCII, each byte was less than 127. IsText meant, all + bytes in the file were less than 127. These days, it is not the case + that all text files have all bytes less than 127. Any unicode file + may have bytes that are above 0x7f. The zip specification has nothing + to say on this topic. Therefore, it's not clear what IsText really + means. + + + + This property merely tells a reading application what is stored in the + metadata for an entry, without guaranteeing its validity or its + meaning. + + + + When DotNetZip is used to create a zipfile, it attempts to set this + field "correctly." For example, if a file ends in ".txt", this field + will be set. Your application may override that default setting. When + writing a zip file, you must set the property before calling + Save() on the ZipFile. + + + + When reading a zip file, a more general way to decide just what kind + of file is contained in a particular entry is to use the file type + database stored in the operating system. The operating system stores + a table that says, a file with .jpg extension is a JPG image file, a + file with a .xml extension is an XML document, a file with a .txt is a + pure ASCII text document, and so on. To get this information on + Windows, you + need to read and parse the registry. + + + + + using (var zip = new ZipFile()) + { + var e = zip.UpdateFile("Descriptions.mme", ""); + e.IsText = true; + zip.Save(zipPath); + } + + + + Using zip As New ZipFile + Dim e2 as ZipEntry = zip.AddFile("Descriptions.mme", "") + e.IsText= True + zip.Save(zipPath) + End Using + + + + + + An enum that specifies the type of timestamp available on the ZipEntry. + + + + + + The last modified time of a file can be stored in multiple ways in + a zip file, and they are not mutually exclusive: + + + + + In the so-called "DOS" format, which has a 2-second precision. Values + are rounded to the nearest even second. For example, if the time on the + file is 12:34:43, then it will be stored as 12:34:44. This first value + is accessible via the LastModified property. This value is always + present in the metadata for each zip entry. In some cases the value is + invalid, or zero. + + + + In the so-called "Windows" or "NTFS" format, as an 8-byte integer + quantity expressed as the number of 1/10 milliseconds (in other words + the number of 100 nanosecond units) since January 1, 1601 (UTC). This + format is how Windows represents file times. This time is accessible + via the ModifiedTime property. + + + + In the "Unix" format, a 4-byte quantity specifying the number of seconds since + January 1, 1970 UTC. + + + + In an older format, now deprecated but still used by some current + tools. This format is also a 4-byte quantity specifying the number of + seconds since January 1, 1970 UTC. + + + + + + This bit field describes which of the formats were found in a ZipEntry that was read. + + + + + + + Default value. + + + + + A DOS timestamp with 2-second precision. + + + + + A Windows timestamp with 100-ns precision. + + + + + A Unix timestamp with 1-second precision. + + + + + A Unix timestamp with 1-second precision, stored in InfoZip v1 format. This + format is outdated and is supported for reading archives only. + + + + + The method of compression to use for a particular ZipEntry. + + + + PKWare's + ZIP Specification describes a number of distinct + cmopression methods that can be used within a zip + file. DotNetZip supports a subset of them. + + + + + No compression at all. For COM environments, the value is 0 (zero). + + + + + DEFLATE compression, as described in IETF RFC + 1951. This is the "normal" compression used in zip + files. For COM environments, the value is 8. + + + + + BZip2 compression, a compression algorithm developed by Julian Seward. + For COM environments, the value is 12. + + + + + The ZipFile type represents a zip archive file. + + + + + This is the main type in the DotNetZip class library. This class reads and + writes zip files, as defined in the specification + for zip files described by PKWare. The compression for this + implementation is provided by a managed-code version of Zlib, included with + DotNetZip in the classes in the Ionic.Zlib namespace. + + + + This class provides a general purpose zip file capability. Use it to read, + create, or update zip files. When you want to create zip files using a + Stream type to write the zip file, you may want to consider the class. + + + + Both the ZipOutputStream class and the ZipFile class can + be used to create zip files. Both of them support many of the common zip + features, including Unicode, different compression methods and levels, + and ZIP64. They provide very similar performance when creating zip + files. + + + + The ZipFile class is generally easier to use than + ZipOutputStream and should be considered a higher-level interface. For + example, when creating a zip file via calls to the PutNextEntry() and + Write() methods on the ZipOutputStream class, the caller is + responsible for opening the file, reading the bytes from the file, writing + those bytes into the ZipOutputStream, setting the attributes on the + ZipEntry, and setting the created, last modified, and last accessed + timestamps on the zip entry. All of these things are done automatically by a + call to ZipFile.AddFile(). + For this reason, the ZipOutputStream is generally recommended for use + only when your application emits arbitrary data, not necessarily data from a + filesystem file, directly into a zip file, and does so using a Stream + metaphor. + + + + Aside from the differences in programming model, there are other + differences in capability between the two classes. + + + + + ZipFile can be used to read and extract zip files, in addition to + creating zip files. ZipOutputStream cannot read zip files. If you want + to use a stream to read zip files, check out the class. + + + + ZipOutputStream does not support the creation of segmented or spanned + zip files. + + + + ZipOutputStream cannot produce a self-extracting archive. + + + + + Be aware that the ZipFile class implements the interface. In order for ZipFile to + produce a valid zip file, you use use it within a using clause (Using + in VB), or call the Dispose() method explicitly. See the examples + for how to employ a using clause. + + + + + + + Adds an item, either a file or a directory, to a zip file archive. + + + + + This method is handy if you are adding things to zip archive and don't + want to bother distinguishing between directories or files. Any files are + added as single entries. A directory added through this method is added + recursively: all files and subdirectories contained within the directory + are added to the ZipFile. + + + + The name of the item may be a relative path or a fully-qualified + path. Remember, the items contained in ZipFile instance get written + to the disk only when you call or a similar + save method. + + + + The directory name used for the file within the archive is the same + as the directory name (potentially a relative path) specified in the + . + + + + For ZipFile properties including , , , , , + , and , their + respective values at the time of this call will be applied to the + ZipEntry added. + + + + + + + + + This method has two overloads. + + the name of the file or directory to add. + + The ZipEntry added. + + + + Adds an item, either a file or a directory, to a zip file archive, + explicitly specifying the directory path to be used in the archive. + + + + + If adding a directory, the add is recursive on all files and + subdirectories contained within it. + + + The name of the item may be a relative path or a fully-qualified path. + The item added by this call to the ZipFile is not read from the + disk nor written to the zip file archive until the application calls + Save() on the ZipFile. + + + + This version of the method allows the caller to explicitly specify the + directory path to be used in the archive, which would override the + "natural" path of the filesystem file. + + + + Encryption will be used on the file data if the Password has + been set on the ZipFile object, prior to calling this method. + + + + For ZipFile properties including , , , , , + , and , their + respective values at the time of this call will be applied to the + ZipEntry added. + + + + + + Thrown if the file or directory passed in does not exist. + + + the name of the file or directory to add. + + + + The name of the directory path to use within the zip archive. This path + need not refer to an extant directory in the current filesystem. If the + files within the zip are later extracted, this is the path used for the + extracted file. Passing null (Nothing in VB) will use the + path on the fileOrDirectoryName. Passing the empty string ("") will + insert the item at the root path within the archive. + + + + + + + + This example shows how to zip up a set of files into a flat hierarchy, + regardless of where in the filesystem the files originated. The resulting + zip archive will contain a toplevel directory named "flat", which itself + will contain files Readme.txt, MyProposal.docx, and Image1.jpg. A + subdirectory under "flat" called SupportFiles will contain all the files + in the "c:\SupportFiles" directory on disk. + + + String[] itemnames= { + "c:\\fixedContent\\Readme.txt", + "MyProposal.docx", + "c:\\SupportFiles", // a directory + "images\\Image1.jpg" + }; + + try + { + using (ZipFile zip = new ZipFile()) + { + for (int i = 1; i < itemnames.Length; i++) + { + // will add Files or Dirs, recurses and flattens subdirectories + zip.AddItem(itemnames[i],"flat"); + } + zip.Save(ZipToCreate); + } + } + catch (System.Exception ex1) + { + System.Console.Error.WriteLine("exception: {0}", ex1); + } + + + + Dim itemnames As String() = _ + New String() { "c:\fixedContent\Readme.txt", _ + "MyProposal.docx", _ + "SupportFiles", _ + "images\Image1.jpg" } + Try + Using zip As New ZipFile + Dim i As Integer + For i = 1 To itemnames.Length - 1 + ' will add Files or Dirs, recursing and flattening subdirectories. + zip.AddItem(itemnames(i), "flat") + Next i + zip.Save(ZipToCreate) + End Using + Catch ex1 As Exception + Console.Error.WriteLine("exception: {0}", ex1.ToString()) + End Try + + + The ZipEntry added. + + + + Adds a File to a Zip file archive. + + + + + This call collects metadata for the named file in the filesystem, + including the file attributes and the timestamp, and inserts that metadata + into the resulting ZipEntry. Only when the application calls Save() on + the ZipFile, does DotNetZip read the file from the filesystem and + then write the content to the zip file archive. + + + + This method will throw an exception if an entry with the same name already + exists in the ZipFile. + + + + For ZipFile properties including , , , , , + , and , their + respective values at the time of this call will be applied to the + ZipEntry added. + + + + + + + In this example, three files are added to a Zip archive. The ReadMe.txt + file will be placed in the root of the archive. The .png file will be + placed in a folder within the zip called photos\personal. The pdf file + will be included into a folder within the zip called Desktop. + + + try + { + using (ZipFile zip = new ZipFile()) + { + zip.AddFile("c:\\photos\\personal\\7440-N49th.png"); + zip.AddFile("c:\\Desktop\\2008-Regional-Sales-Report.pdf"); + zip.AddFile("ReadMe.txt"); + + zip.Save("Package.zip"); + } + } + catch (System.Exception ex1) + { + System.Console.Error.WriteLine("exception: " + ex1); + } + + + + Try + Using zip As ZipFile = New ZipFile + zip.AddFile("c:\photos\personal\7440-N49th.png") + zip.AddFile("c:\Desktop\2008-Regional-Sales-Report.pdf") + zip.AddFile("ReadMe.txt") + zip.Save("Package.zip") + End Using + Catch ex1 As Exception + Console.Error.WriteLine("exception: {0}", ex1.ToString) + End Try + + + + This method has two overloads. + + + + + + + The name of the file to add. It should refer to a file in the filesystem. + The name of the file may be a relative path or a fully-qualified path. + + The ZipEntry corresponding to the File added. + + + + Adds a File to a Zip file archive, potentially overriding the path to be + used within the zip archive. + + + + + The file added by this call to the ZipFile is not written to the + zip file archive until the application calls Save() on the ZipFile. + + + + This method will throw an exception if an entry with the same name already + exists in the ZipFile. + + + + This version of the method allows the caller to explicitly specify the + directory path to be used in the archive. + + + + For ZipFile properties including , , , , , + , and , their + respective values at the time of this call will be applied to the + ZipEntry added. + + + + + + + In this example, three files are added to a Zip archive. The ReadMe.txt + file will be placed in the root of the archive. The .png file will be + placed in a folder within the zip called images. The pdf file will be + included into a folder within the zip called files\docs, and will be + encrypted with the given password. + + + try + { + using (ZipFile zip = new ZipFile()) + { + // the following entry will be inserted at the root in the archive. + zip.AddFile("c:\\datafiles\\ReadMe.txt", ""); + // this image file will be inserted into the "images" directory in the archive. + zip.AddFile("c:\\photos\\personal\\7440-N49th.png", "images"); + // the following will result in a password-protected file called + // files\\docs\\2008-Regional-Sales-Report.pdf in the archive. + zip.Password = "EncryptMe!"; + zip.AddFile("c:\\Desktop\\2008-Regional-Sales-Report.pdf", "files\\docs"); + zip.Save("Archive.zip"); + } + } + catch (System.Exception ex1) + { + System.Console.Error.WriteLine("exception: {0}", ex1); + } + + + + Try + Using zip As ZipFile = New ZipFile + ' the following entry will be inserted at the root in the archive. + zip.AddFile("c:\datafiles\ReadMe.txt", "") + ' this image file will be inserted into the "images" directory in the archive. + zip.AddFile("c:\photos\personal\7440-N49th.png", "images") + ' the following will result in a password-protected file called + ' files\\docs\\2008-Regional-Sales-Report.pdf in the archive. + zip.Password = "EncryptMe!" + zip.AddFile("c:\Desktop\2008-Regional-Sales-Report.pdf", "files\documents") + zip.Save("Archive.zip") + End Using + Catch ex1 As Exception + Console.Error.WriteLine("exception: {0}", ex1) + End Try + + + + + + + + + The name of the file to add. The name of the file may be a relative path + or a fully-qualified path. + + + + Specifies a directory path to use to override any path in the fileName. + This path may, or may not, correspond to a real directory in the current + filesystem. If the files within the zip are later extracted, this is the + path used for the extracted file. Passing null (Nothing in + VB) will use the path on the fileName, if any. Passing the empty string + ("") will insert the item at the root path within the archive. + + + The ZipEntry corresponding to the file added. + + + + This method removes a collection of entries from the ZipFile. + + + + A collection of ZipEntry instances from this zip file to be removed. For + example, you can pass in an array of ZipEntry instances; or you can call + SelectEntries(), and then add or remove entries from that + ICollection<ZipEntry> (ICollection(Of ZipEntry) in VB), and pass + that ICollection to this method. + + + + + + + + This method removes a collection of entries from the ZipFile, by name. + + + + A collection of strings that refer to names of entries to be removed + from the ZipFile. For example, you can pass in an array or a + List of Strings that provide the names of entries to be removed. + + + + + + + + This method adds a set of files to the ZipFile. + + + + + Use this method to add a set of files to the zip archive, in one call. + For example, a list of files received from + System.IO.Directory.GetFiles() can be added to a zip archive in one + call. + + + + For ZipFile properties including , , , , , + , and , their + respective values at the time of this call will be applied to each + ZipEntry added. + + + + + The collection of names of the files to add. Each string should refer to a + file in the filesystem. The name of the file may be a relative path or a + fully-qualified path. + + + + This example shows how to create a zip file, and add a few files into it. + + String ZipFileToCreate = "archive1.zip"; + String DirectoryToZip = "c:\\reports"; + using (ZipFile zip = new ZipFile()) + { + // Store all files found in the top level directory, into the zip archive. + String[] filenames = System.IO.Directory.GetFiles(DirectoryToZip); + zip.AddFiles(filenames); + zip.Save(ZipFileToCreate); + } + + + + Dim ZipFileToCreate As String = "archive1.zip" + Dim DirectoryToZip As String = "c:\reports" + Using zip As ZipFile = New ZipFile + ' Store all files found in the top level directory, into the zip archive. + Dim filenames As String() = System.IO.Directory.GetFiles(DirectoryToZip) + zip.AddFiles(filenames) + zip.Save(ZipFileToCreate) + End Using + + + + + + + + Adds or updates a set of files in the ZipFile. + + + + + Any files that already exist in the archive are updated. Any files that + don't yet exist in the archive are added. + + + + For ZipFile properties including , , , , , + , and , their + respective values at the time of this call will be applied to each + ZipEntry added. + + + + + The collection of names of the files to update. Each string should refer to a file in + the filesystem. The name of the file may be a relative path or a fully-qualified path. + + + + + + Adds a set of files to the ZipFile, using the + specified directory path in the archive. + + + + + Any directory structure that may be present in the + filenames contained in the list is "flattened" in the + archive. Each file in the list is added to the archive in + the specified top-level directory. + + + + For ZipFile properties including , , , , , , and , their respective values at the + time of this call will be applied to each ZipEntry added. + + + + + The names of the files to add. Each string should refer to + a file in the filesystem. The name of the file may be a + relative path or a fully-qualified path. + + + + Specifies a directory path to use to override any path in the file name. + Th is path may, or may not, correspond to a real directory in the current + filesystem. If the files within the zip are later extracted, this is the + path used for the extracted file. Passing null (Nothing in + VB) will use the path on each of the fileNames, if any. Passing + the empty string ("") will insert the item at the root path within the + archive. + + + + + + + Adds a set of files to the ZipFile, using the specified directory + path in the archive, and preserving the full directory structure in the + filenames. + + + + + If preserveDirHierarchy is true, any directory structure present in the + filenames contained in the list is preserved in the archive. On the other + hand, if preserveDirHierarchy is false, any directory structure that may + be present in the filenames contained in the list is "flattened" in the + archive; Each file in the list is added to the archive in the specified + top-level directory. + + + + For ZipFile properties including , , , , , + , and , their + respective values at the time of this call will be applied to each + ZipEntry added. + + + + + + The names of the files to add. Each string should refer to a file in the + filesystem. The name of the file may be a relative path or a + fully-qualified path. + + + + Specifies a directory path to use to override any path in the file name. + This path may, or may not, correspond to a real directory in the current + filesystem. If the files within the zip are later extracted, this is the + path used for the extracted file. Passing null (Nothing in + VB) will use the path on each of the fileNames, if any. Passing + the empty string ("") will insert the item at the root path within the + archive. + + + + whether the entries in the zip archive will reflect the directory + hierarchy that is present in the various filenames. For example, if + includes two paths, \Animalia\Chordata\Mammalia\Info.txt and + \Plantae\Magnoliophyta\Dicotyledon\Info.txt, then calling this method with + = false will result in an + exception because of a duplicate entry name, while calling this method + with = true will result in the + full direcory paths being included in the entries added to the ZipFile. + + + + + + Adds or updates a set of files to the ZipFile, using the specified + directory path in the archive. + + + + + + Any files that already exist in the archive are updated. Any files that + don't yet exist in the archive are added. + + + + For ZipFile properties including , , , , , + , and , their + respective values at the time of this call will be applied to each + ZipEntry added. + + + + + The names of the files to add or update. Each string should refer to a + file in the filesystem. The name of the file may be a relative path or a + fully-qualified path. + + + + Specifies a directory path to use to override any path in the file name. + This path may, or may not, correspond to a real directory in the current + filesystem. If the files within the zip are later extracted, this is the + path used for the extracted file. Passing null (Nothing in + VB) will use the path on each of the fileNames, if any. Passing + the empty string ("") will insert the item at the root path within the + archive. + + + + + + + Adds or Updates a File in a Zip file archive. + + + + + This method adds a file to a zip archive, or, if the file already exists + in the zip archive, this method Updates the content of that given filename + in the zip archive. The UpdateFile method might more accurately be + called "AddOrUpdateFile". + + + + Upon success, there is no way for the application to learn whether the file + was added versus updated. + + + + For ZipFile properties including , , , , , + , and , their + respective values at the time of this call will be applied to the + ZipEntry added. + + + + + + This example shows how to Update an existing entry in a zipfile. The first + call to UpdateFile adds the file to the newly-created zip archive. The + second call to UpdateFile updates the content for that file in the zip + archive. + + + using (ZipFile zip1 = new ZipFile()) + { + // UpdateFile might more accurately be called "AddOrUpdateFile" + zip1.UpdateFile("MyDocuments\\Readme.txt"); + zip1.UpdateFile("CustomerList.csv"); + zip1.Comment = "This zip archive has been created."; + zip1.Save("Content.zip"); + } + + using (ZipFile zip2 = ZipFile.Read("Content.zip")) + { + zip2.UpdateFile("Updates\\Readme.txt"); + zip2.Comment = "This zip archive has been updated: The Readme.txt file has been changed."; + zip2.Save(); + } + + + + Using zip1 As New ZipFile + ' UpdateFile might more accurately be called "AddOrUpdateFile" + zip1.UpdateFile("MyDocuments\Readme.txt") + zip1.UpdateFile("CustomerList.csv") + zip1.Comment = "This zip archive has been created." + zip1.Save("Content.zip") + End Using + + Using zip2 As ZipFile = ZipFile.Read("Content.zip") + zip2.UpdateFile("Updates\Readme.txt") + zip2.Comment = "This zip archive has been updated: The Readme.txt file has been changed." + zip2.Save + End Using + + + + + + + + + The name of the file to add or update. It should refer to a file in the + filesystem. The name of the file may be a relative path or a + fully-qualified path. + + + + The ZipEntry corresponding to the File that was added or updated. + + + + + Adds or Updates a File in a Zip file archive. + + + + + This method adds a file to a zip archive, or, if the file already exists + in the zip archive, this method Updates the content of that given filename + in the zip archive. + + + + This version of the method allows the caller to explicitly specify the + directory path to be used in the archive. The entry to be added or + updated is found by using the specified directory path, combined with the + basename of the specified filename. + + + + Upon success, there is no way for the application to learn if the file was + added versus updated. + + + + For ZipFile properties including , , , , , + , and , their + respective values at the time of this call will be applied to the + ZipEntry added. + + + + + + + + + The name of the file to add or update. It should refer to a file in the + filesystem. The name of the file may be a relative path or a + fully-qualified path. + + + + Specifies a directory path to use to override any path in the + fileName. This path may, or may not, correspond to a real + directory in the current filesystem. If the files within the zip are + later extracted, this is the path used for the extracted file. Passing + null (Nothing in VB) will use the path on the + fileName, if any. Passing the empty string ("") will insert the + item at the root path within the archive. + + + + The ZipEntry corresponding to the File that was added or updated. + + + + + Add or update a directory in a zip archive. + + + + If the specified directory does not exist in the archive, then this method + is equivalent to calling AddDirectory(). If the specified + directory already exists in the archive, then this method updates any + existing entries, and adds any new entries. Any entries that are in the + zip archive but not in the specified directory, are left alone. In other + words, the contents of the zip file will be a union of the previous + contents and the new files. + + + + + + + + The path to the directory to be added to the zip archive, or updated in + the zip archive. + + + + The ZipEntry corresponding to the Directory that was added or updated. + + + + + Add or update a directory in the zip archive at the specified root + directory in the archive. + + + + If the specified directory does not exist in the archive, then this method + is equivalent to calling AddDirectory(). If the specified + directory already exists in the archive, then this method updates any + existing entries, and adds any new entries. Any entries that are in the + zip archive but not in the specified directory, are left alone. In other + words, the contents of the zip file will be a union of the previous + contents and the new files. + + + + + + + + The path to the directory to be added to the zip archive, or updated + in the zip archive. + + + + Specifies a directory path to use to override any path in the + directoryName. This path may, or may not, correspond to a real + directory in the current filesystem. If the files within the zip are + later extracted, this is the path used for the extracted file. Passing + null (Nothing in VB) will use the path on the + directoryName, if any. Passing the empty string ("") will insert + the item at the root path within the archive. + + + + The ZipEntry corresponding to the Directory that was added or updated. + + + + + Add or update a file or directory in the zip archive. + + + + + This is useful when the application is not sure or does not care if the + item to be added is a file or directory, and does not know or does not + care if the item already exists in the ZipFile. Calling this method + is equivalent to calling RemoveEntry() if an entry by the same name + already exists, followed calling by AddItem(). + + + + For ZipFile properties including , , , , , + , and , their + respective values at the time of this call will be applied to the + ZipEntry added. + + + + + + + + + the path to the file or directory to be added or updated. + + + + + Add or update a file or directory. + + + + + This method is useful when the application is not sure or does not care if + the item to be added is a file or directory, and does not know or does not + care if the item already exists in the ZipFile. Calling this method + is equivalent to calling RemoveEntry(), if an entry by that name + exists, and then calling AddItem(). + + + + This version of the method allows the caller to explicitly specify the + directory path to be used for the item being added to the archive. The + entry or entries that are added or updated will use the specified + DirectoryPathInArchive. Extracting the entry from the archive will + result in a file stored in that directory path. + + + + For ZipFile properties including , , , , , + , and , their + respective values at the time of this call will be applied to the + ZipEntry added. + + + + + + + + + The path for the File or Directory to be added or updated. + + + Specifies a directory path to use to override any path in the + itemName. This path may, or may not, correspond to a real + directory in the current filesystem. If the files within the zip are + later extracted, this is the path used for the extracted file. Passing + null (Nothing in VB) will use the path on the + itemName, if any. Passing the empty string ("") will insert the + item at the root path within the archive. + + + + + Adds a named entry into the zip archive, taking content for the entry + from a string. + + + + Calling this method creates an entry using the given fileName and + directory path within the archive. There is no need for a file by the + given name to exist in the filesystem; the name is used within the zip + archive only. The content for the entry is encoded using the default text + encoding for the machine, or on Silverlight, using UTF-8. + + + + The content of the file, should it be extracted from the zip. + + + + The name, including any path, to use for the entry within the archive. + + + The ZipEntry added. + + + + This example shows how to add an entry to the zipfile, using a string as + content for that entry. + + + string Content = "This string will be the content of the Readme.txt file in the zip archive."; + using (ZipFile zip1 = new ZipFile()) + { + zip1.AddFile("MyDocuments\\Resume.doc", "files"); + zip1.AddEntry("Readme.txt", Content); + zip1.Comment = "This zip file was created at " + System.DateTime.Now.ToString("G"); + zip1.Save("Content.zip"); + } + + + + Public Sub Run() + Dim Content As String = "This string will be the content of the Readme.txt file in the zip archive." + Using zip1 As ZipFile = New ZipFile + zip1.AddEntry("Readme.txt", Content) + zip1.AddFile("MyDocuments\Resume.doc", "files") + zip1.Comment = ("This zip file was created at " & DateTime.Now.ToString("G")) + zip1.Save("Content.zip") + End Using + End Sub + + + + + + Adds a named entry into the zip archive, taking content for the entry + from a string, and using the specified text encoding. + + + + + + Calling this method creates an entry using the given fileName and + directory path within the archive. There is no need for a file by the + given name to exist in the filesystem; the name is used within the zip + archive only. + + + + The content for the entry, a string value, is encoded using the given + text encoding. A BOM (byte-order-mark) is emitted into the file, if the + Encoding parameter is set for that. + + + + Most Encoding classes support a constructor that accepts a boolean, + indicating whether to emit a BOM or not. For example see . + + + + + + The name, including any path, to use within the archive for the entry. + + + + The content of the file, should it be extracted from the zip. + + + + The text encoding to use when encoding the string. Be aware: This is + distinct from the text encoding used to encode the fileName, as specified + in . + + + The ZipEntry added. + + + + + Create an entry in the ZipFile using the given Stream + as input. The entry will have the given filename. + + + + + + The application should provide an open, readable stream; in this case it + will be read during the call to or one of + its overloads. + + + + The passed stream will be read from its current position. If + necessary, callers should set the position in the stream before + calling AddEntry(). This might be appropriate when using this method + with a MemoryStream, for example. + + + + In cases where a large number of streams will be added to the + ZipFile, the application may wish to avoid maintaining all of the + streams open simultaneously. To handle this situation, the application + should use the + overload. + + + + For ZipFile properties including , , , , , + , and , their + respective values at the time of this call will be applied to the + ZipEntry added. + + + + + + + This example adds a single entry to a ZipFile via a Stream. + + + + String zipToCreate = "Content.zip"; + String fileNameInArchive = "Content-From-Stream.bin"; + using (System.IO.Stream streamToRead = MyStreamOpener()) + { + using (ZipFile zip = new ZipFile()) + { + ZipEntry entry= zip.AddEntry(fileNameInArchive, streamToRead); + zip.AddFile("Readme.txt"); + zip.Save(zipToCreate); // the stream is read implicitly here + } + } + + + + Dim zipToCreate As String = "Content.zip" + Dim fileNameInArchive As String = "Content-From-Stream.bin" + Using streamToRead as System.IO.Stream = MyStreamOpener() + Using zip As ZipFile = New ZipFile() + Dim entry as ZipEntry = zip.AddEntry(fileNameInArchive, streamToRead) + zip.AddFile("Readme.txt") + zip.Save(zipToCreate) '' the stream is read implicitly, here + End Using + End Using + + + + + + + The name, including any path, which is shown in the zip file for the added + entry. + + + The input stream from which to grab content for the file + + The ZipEntry added. + + + + Add a ZipEntry for which content is written directly by the application. + + + + + When the application needs to write the zip entry data, use this + method to add the ZipEntry. For example, in the case that the + application wishes to write the XML representation of a DataSet into + a ZipEntry, the application can use this method to do so. + + + + For ZipFile properties including , , , , , + , and , their + respective values at the time of this call will be applied to the + ZipEntry added. + + + + About progress events: When using the WriteDelegate, DotNetZip does + not issue any SaveProgress events with EventType = + Saving_EntryBytesRead. (This is because it is the + application's code that runs in WriteDelegate - there's no way for + DotNetZip to know when to issue a EntryBytesRead event.) + Applications that want to update a progress bar or similar status + indicator should do so from within the WriteDelegate + itself. DotNetZip will issue the other SaveProgress events, + including + Saving_Started, + + Saving_BeforeWriteEntry, and + Saving_AfterWriteEntry. + + + + Note: When you use PKZip encryption, it's normally necessary to + compute the CRC of the content to be encrypted, before compressing or + encrypting it. Therefore, when using PKZip encryption with a + WriteDelegate, the WriteDelegate CAN BE called twice: once to compute + the CRC, and the second time to potentially compress and + encrypt. Surprising, but true. This is because PKWARE specified that + the encryption initialization data depends on the CRC. + If this happens, for each call of the delegate, your + application must stream the same entry data in its entirety. If your + application writes different data during the second call, it will + result in a corrupt zip file. + + + + The double-read behavior happens with all types of entries, not only + those that use WriteDelegate. It happens if you add an entry from a + filesystem file, or using a string, or a stream, or an opener/closer + pair. But in those cases, DotNetZip takes care of reading twice; in + the case of the WriteDelegate, the application code gets invoked + twice. Be aware. + + + + As you can imagine, this can cause performance problems for large + streams, and it can lead to correctness problems when you use a + WriteDelegate. This is a pretty big pitfall. There are two + ways to avoid it. First, and most preferred: don't use PKZIP + encryption. If you use the WinZip AES encryption, this problem + doesn't occur, because the encryption protocol doesn't require the CRC + up front. Second: if you do choose to use PKZIP encryption, write out + to a non-seekable stream (like standard output, or the + Response.OutputStream in an ASP.NET application). In this case, + DotNetZip will use an alternative encryption protocol that does not + rely on the CRC of the content. This also implies setting bit 3 in + the zip entry, which still presents problems for some zip tools. + + + + In the future I may modify DotNetZip to *always* use bit 3 when PKZIP + encryption is in use. This seems like a win overall, but there will + be some work involved. If you feel strongly about it, visit the + DotNetZip forums and vote up the Workitem + tracking this issue. + + + + + the name of the entry to add + the delegate which will write the entry content + the ZipEntry added + + + + This example shows an application filling a DataSet, then saving the + contents of that DataSet as XML, into a ZipEntry in a ZipFile, using an + anonymous delegate in C#. The DataSet XML is never saved to a disk file. + + + var c1= new System.Data.SqlClient.SqlConnection(connstring1); + var da = new System.Data.SqlClient.SqlDataAdapter() + { + SelectCommand= new System.Data.SqlClient.SqlCommand(strSelect, c1) + }; + + DataSet ds1 = new DataSet(); + da.Fill(ds1, "Invoices"); + + using(Ionic.Zip.ZipFile zip = new Ionic.Zip.ZipFile()) + { + zip.AddEntry(zipEntryName, (name,stream) => ds1.WriteXml(stream) ); + zip.Save(zipFileName); + } + + + + + + This example uses an anonymous method in C# as the WriteDelegate to provide + the data for the ZipEntry. The example is a bit contrived - the + AddFile() method is a simpler way to insert the contents of a file + into an entry in a zip file. On the other hand, if there is some sort of + processing or transformation of the file contents required before writing, + the application could use the WriteDelegate to do it, in this way. + + + using (var input = File.Open(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite )) + { + using(Ionic.Zip.ZipFile zip = new Ionic.Zip.ZipFile()) + { + zip.AddEntry(zipEntryName, (name,output) => + { + byte[] buffer = new byte[BufferSize]; + int n; + while ((n = input.Read(buffer, 0, buffer.Length)) != 0) + { + // could transform the data here... + output.Write(buffer, 0, n); + // could update a progress bar here + } + }); + + zip.Save(zipFileName); + } + } + + + + + + This example uses a named delegate in VB to write data for the given + ZipEntry (VB9 does not have anonymous delegates). The example here is a bit + contrived - a simpler way to add the contents of a file to a ZipEntry is to + simply use the appropriate AddFile() method. The key scenario for + which the WriteDelegate makes sense is saving a DataSet, in XML + format, to the zip file. The DataSet can write XML to a stream, and the + WriteDelegate is the perfect place to write into the zip file. There may be + other data structures that can write to a stream, but cannot be read as a + stream. The WriteDelegate would be appropriate for those cases as + well. + + + Private Sub WriteEntry (ByVal name As String, ByVal output As Stream) + Using input As FileStream = File.Open(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) + Dim n As Integer = -1 + Dim buffer As Byte() = New Byte(BufferSize){} + Do While n <> 0 + n = input.Read(buffer, 0, buffer.Length) + output.Write(buffer, 0, n) + Loop + End Using + End Sub + + Public Sub Run() + Using zip = New ZipFile + zip.AddEntry(zipEntryName, New WriteDelegate(AddressOf WriteEntry)) + zip.Save(zipFileName) + End Using + End Sub + + + + + + Add an entry, for which the application will provide a stream, + just-in-time. + + + + + In cases where the application wishes to open the stream that holds + the content for the ZipEntry, on a just-in-time basis, the application + can use this method and provide delegates to open and close the + stream. + + + + For ZipFile properties including , , , , , + , and , their + respective values at the time of this call will be applied to the + ZipEntry added. + + + + + + + This example uses anonymous methods in C# to open and close the + source stream for the content for a zip entry. In a real + application, the logic for the OpenDelegate would probably be more + involved. + + + using(Ionic.Zip.ZipFile zip = new Ionic.Zip.ZipFile()) + { + zip.AddEntry(zipEntryName, + (name) => File.Open(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite ), + (name, stream) => stream.Close() + ); + + zip.Save(zipFileName); + } + + + + + + + This example uses delegates in VB.NET to open and close the + the source stream for the content for a zip entry. VB 9.0 lacks + support for "Sub" lambda expressions, and so the CloseDelegate must + be an actual, named Sub. + + + + Function MyStreamOpener(ByVal entryName As String) As Stream + '' This simply opens a file. You probably want to do somethinig + '' more involved here: open a stream to read from a database, + '' open a stream on an HTTP connection, and so on. + Return File.OpenRead(entryName) + End Function + + Sub MyStreamCloser(entryName As String, stream As Stream) + stream.Close() + End Sub + + Public Sub Run() + Dim dirToZip As String = "fodder" + Dim zipFileToCreate As String = "Archive.zip" + Dim opener As OpenDelegate = AddressOf MyStreamOpener + Dim closer As CloseDelegate = AddressOf MyStreamCloser + Dim numFilestoAdd As Int32 = 4 + Using zip As ZipFile = New ZipFile + Dim i As Integer + For i = 0 To numFilesToAdd - 1 + zip.AddEntry(String.Format("content-{0:000}.txt"), opener, closer) + Next i + zip.Save(zipFileToCreate) + End Using + End Sub + + + + + the name of the entry to add + + the delegate that will be invoked to open the stream + + + the delegate that will be invoked to close the stream + + the ZipEntry added + + + + + Updates the given entry in the ZipFile, using the given + string as content for the ZipEntry. + + + + + + Calling this method is equivalent to removing the ZipEntry for + the given file name and directory path, if it exists, and then calling + . See the documentation for + that method for further explanation. The string content is encoded + using the default encoding for the machine, or on Silverlight, using + UTF-8. This encoding is distinct from the encoding used for the + filename itself. See . + + + + + + The name, including any path, to use within the archive for the entry. + + + + The content of the file, should it be extracted from the zip. + + + The ZipEntry added. + + + + + Updates the given entry in the ZipFile, using the given string as + content for the ZipEntry. + + + + Calling this method is equivalent to removing the ZipEntry for the + given file name and directory path, if it exists, and then calling . See the + documentation for that method for further explanation. + + + + The name, including any path, to use within the archive for the entry. + + + + The content of the file, should it be extracted from the zip. + + + + The text encoding to use when encoding the string. Be aware: This is + distinct from the text encoding used to encode the filename. See . + + + The ZipEntry added. + + + + + Updates the given entry in the ZipFile, using the given delegate + as the source for content for the ZipEntry. + + + + Calling this method is equivalent to removing the ZipEntry for the + given file name and directory path, if it exists, and then calling . See the + documentation for that method for further explanation. + + + + The name, including any path, to use within the archive for the entry. + + + the delegate which will write the entry content. + + The ZipEntry added. + + + + + Updates the given entry in the ZipFile, using the given delegates + to open and close the stream that provides the content for the ZipEntry. + + + + Calling this method is equivalent to removing the ZipEntry for the + given file name and directory path, if it exists, and then calling . See the + documentation for that method for further explanation. + + + + The name, including any path, to use within the archive for the entry. + + + + the delegate that will be invoked to open the stream + + + the delegate that will be invoked to close the stream + + + The ZipEntry added or updated. + + + + + Updates the given entry in the ZipFile, using the given stream as + input, and the given filename and given directory Path. + + + + + Calling the method is equivalent to calling RemoveEntry() if an + entry by the same name already exists, and then calling AddEntry() + with the given fileName and stream. + + + + The stream must be open and readable during the call to + ZipFile.Save. You can dispense the stream on a just-in-time basis + using the property. Check the + documentation of that property for more information. + + + + For ZipFile properties including , , , , , + , and , their + respective values at the time of this call will be applied to the + ZipEntry added. + + + + + + + + + The name, including any path, to use within the archive for the entry. + + + The input stream from which to read file data. + The ZipEntry added. + + + + Add an entry into the zip archive using the given filename and + directory path within the archive, and the given content for the + file. No file is created in the filesystem. + + + The data to use for the entry. + + + The name, including any path, to use within the archive for the entry. + + + The ZipEntry added. + + + + Updates the given entry in the ZipFile, using the given byte + array as content for the entry. + + + + Calling this method is equivalent to removing the ZipEntry + for the given filename and directory path, if it exists, and then + calling . See the + documentation for that method for further explanation. + + + + The name, including any path, to use within the archive for the entry. + + + The content to use for the ZipEntry. + + The ZipEntry added. + + + + + Adds the contents of a filesystem directory to a Zip file archive. + + + + + + The name of the directory may be a relative path or a fully-qualified + path. Any files within the named directory are added to the archive. Any + subdirectories within the named directory are also added to the archive, + recursively. + + + + Top-level entries in the named directory will appear as top-level entries + in the zip archive. Entries in subdirectories in the named directory will + result in entries in subdirectories in the zip archive. + + + + If you want the entries to appear in a containing directory in the zip + archive itself, then you should call the AddDirectory() overload that + allows you to explicitly specify a directory path for use in the archive. + + + + For ZipFile properties including , , , , , + , and , their + respective values at the time of this call will be applied to each + ZipEntry added. + + + + + + + + + + This method has 2 overloads. + + The name of the directory to add. + The ZipEntry added. + + + + Adds the contents of a filesystem directory to a Zip file archive, + overriding the path to be used for entries in the archive. + + + + + The name of the directory may be a relative path or a fully-qualified + path. The add operation is recursive, so that any files or subdirectories + within the name directory are also added to the archive. + + + + Top-level entries in the named directory will appear as top-level entries + in the zip archive. Entries in subdirectories in the named directory will + result in entries in subdirectories in the zip archive. + + + + For ZipFile properties including , , , , , + , and , their + respective values at the time of this call will be applied to each + ZipEntry added. + + + + + + + In this code, calling the ZipUp() method with a value of "c:\reports" for + the directory parameter will result in a zip file structure in which all + entries are contained in a toplevel "reports" directory. + + + + public void ZipUp(string targetZip, string directory) + { + using (var zip = new ZipFile()) + { + zip.AddDirectory(directory, System.IO.Path.GetFileName(directory)); + zip.Save(targetZip); + } + } + + + + + + + + The name of the directory to add. + + + Specifies a directory path to use to override any path in the + DirectoryName. This path may, or may not, correspond to a real directory + in the current filesystem. If the zip is later extracted, this is the + path used for the extracted file or directory. Passing null + (Nothing in VB) or the empty string ("") will insert the items at + the root path within the archive. + + + The ZipEntry added. + + + + Creates a directory in the zip archive. + + + + + + Use this when you want to create a directory in the archive but there is + no corresponding filesystem representation for that directory. + + + + You will probably not need to do this in your code. One of the only times + you will want to do this is if you want an empty directory in the zip + archive. The reason: if you add a file to a zip archive that is stored + within a multi-level directory, all of the directory tree is implicitly + created in the zip archive. + + + + + + The name of the directory to create in the archive. + + The ZipEntry added. + + + + Checks a zip file to see if its directory is consistent. + + + + + + In cases of data error, the directory within a zip file can get out + of synch with the entries in the zip file. This method checks the + given zip file and returns true if this has occurred. + + + This method may take a long time to run for large zip files. + + + This method is not supported in the Reduced or Compact Framework + versions of DotNetZip. + + + + Developers using COM can use the ComHelper.CheckZip(String) + method. + + + + + The filename to of the zip file to check. + + true if the named zip file checks OK. Otherwise, false. + + + + + + + Checks a zip file to see if its directory is consistent, + and optionally fixes the directory if necessary. + + + + + + In cases of data error, the directory within a zip file can get out of + synch with the entries in the zip file. This method checks the given + zip file, and returns true if this has occurred. It also optionally + fixes the zipfile, saving the fixed copy in Name_Fixed.zip. + + + + This method may take a long time to run for large zip files. It + will take even longer if the file actually needs to be fixed, and if + fixIfNecessary is true. + + + + This method is not supported in the Reduced or Compact + Framework versions of DotNetZip. + + + + + The filename to of the zip file to check. + + If true, the method will fix the zip file if + necessary. + + + a TextWriter in which messages generated while checking will be written. + + + true if the named zip is OK; false if the file needs to be fixed. + + + + + + + Rewrite the directory within a zipfile. + + + + + + In cases of data error, the directory in a zip file can get out of + synch with the entries in the zip file. This method attempts to fix + the zip file if this has occurred. + + + This can take a long time for large zip files. + + This won't work if the zip file uses a non-standard + code page - neither IBM437 nor UTF-8. + + + This method is not supported in the Reduced or Compact Framework + versions of DotNetZip. + + + + Developers using COM can use the ComHelper.FixZipDirectory(String) + method. + + + + + The filename to of the zip file to fix. + + + + + + + Verify the password on a zip file. + + + + + Keep in mind that passwords in zipfiles are applied to + zip entries, not to the entire zip file. So testing a + zipfile for a particular password doesn't work in the + general case. On the other hand, it's often the case + that a single password will be used on all entries in a + zip file. This method works for that case. + + + There is no way to check a password without doing the + decryption. So this code decrypts and extracts the given + zipfile into + + + + The filename to of the zip file to fix. + + The password to check. + + a bool indicating whether the password matches. + + + + Returns true if an entry by the given name exists in the ZipFile. + + + the name of the entry to find + true if an entry with the given name exists; otherwise false. + + + + Provides a string representation of the instance. + a string representation of the instance. + + + + Creates a new ZipFile instance, using the specified filename. + + + + + Applications can use this constructor to create a new ZipFile for writing, + or to slurp in an existing zip archive for read and update purposes. + + + + To create a new zip archive, an application can call this constructor, + passing the name of a file that does not exist. The name may be a fully + qualified path. Then the application can add directories or files to the + ZipFile via AddDirectory(), AddFile(), AddItem() + and then write the zip archive to the disk by calling Save(). The + zip file is not actually opened and written to the disk until the + application calls ZipFile.Save(). At that point the new zip file + with the given name is created. + + + + If you won't know the name of the Zipfile until the time you call + ZipFile.Save(), or if you plan to save to a stream (which has no + name), then you should use the no-argument constructor. + + + + The application can also call this constructor to read an existing zip + archive. passing the name of a valid zip file that does exist. But, it's + better form to use the static method, + passing the name of the zip file, because using ZipFile.Read() in + your code communicates very clearly what you are doing. In either case, + the file is then read into the ZipFile instance. The app can then + enumerate the entries or can modify the zip file, for example adding + entries, removing entries, changing comments, and so on. + + + + One advantage to this parameterized constructor: it allows applications to + use the same code to add items to a zip archive, regardless of whether the + zip file exists. + + + + Instances of the ZipFile class are not multi-thread safe. You may + not party on a single instance with multiple threads. You may have + multiple threads that each use a distinct ZipFile instance, or you + can synchronize multi-thread access to a single instance. + + + + By the way, since DotNetZip is so easy to use, don't you think you should + donate $5 or $10? + + + + + + Thrown if name refers to an existing file that is not a valid zip file. + + + + This example shows how to create a zipfile, and add a few files into it. + + String ZipFileToCreate = "archive1.zip"; + String DirectoryToZip = "c:\\reports"; + using (ZipFile zip = new ZipFile()) + { + // Store all files found in the top level directory, into the zip archive. + String[] filenames = System.IO.Directory.GetFiles(DirectoryToZip); + zip.AddFiles(filenames, "files"); + zip.Save(ZipFileToCreate); + } + + + + Dim ZipFileToCreate As String = "archive1.zip" + Dim DirectoryToZip As String = "c:\reports" + Using zip As ZipFile = New ZipFile() + Dim filenames As String() = System.IO.Directory.GetFiles(DirectoryToZip) + zip.AddFiles(filenames, "files") + zip.Save(ZipFileToCreate) + End Using + + + + The filename to use for the new zip archive. + + + + + Creates a new ZipFile instance, using the specified name for the + filename, and the specified Encoding. + + + + + See the documentation on the ZipFile + constructor that accepts a single string argument for basic + information on all the ZipFile constructors. + + + + The Encoding is used as the default alternate encoding for entries with + filenames or comments that cannot be encoded with the IBM437 code page. + This is equivalent to setting the property on the ZipFile + instance after construction. + + + + Instances of the ZipFile class are not multi-thread safe. You may + not party on a single instance with multiple threads. You may have + multiple threads that each use a distinct ZipFile instance, or you + can synchronize multi-thread access to a single instance. + + + + + + Thrown if name refers to an existing file that is not a valid zip file. + + + The filename to use for the new zip archive. + The Encoding is used as the default alternate + encoding for entries with filenames or comments that cannot be encoded + with the IBM437 code page. + + + + Create a zip file, without specifying a target filename or stream to save to. + + + + + See the documentation on the ZipFile + constructor that accepts a single string argument for basic + information on all the ZipFile constructors. + + + + After instantiating with this constructor and adding entries to the + archive, the application should call or + to save to a file or a + stream, respectively. The application can also set the + property and then call the no-argument method. (This + is the preferred approach for applications that use the library through + COM interop.) If you call the no-argument method + without having set the Name of the ZipFile, either through + the parameterized constructor or through the explicit property , the + Save() will throw, because there is no place to save the file. + + + Instances of the ZipFile class are not multi-thread safe. You may + have multiple threads that each use a distinct ZipFile instance, or + you can synchronize multi-thread access to a single instance. + + + + + This example creates a Zip archive called Backup.zip, containing all the files + in the directory DirectoryToZip. Files within subdirectories are not zipped up. + + using (ZipFile zip = new ZipFile()) + { + // Store all files found in the top level directory, into the zip archive. + // note: this code does not recurse subdirectories! + String[] filenames = System.IO.Directory.GetFiles(DirectoryToZip); + zip.AddFiles(filenames, "files"); + zip.Save("Backup.zip"); + } + + + + Using zip As New ZipFile + ' Store all files found in the top level directory, into the zip archive. + ' note: this code does not recurse subdirectories! + Dim filenames As String() = System.IO.Directory.GetFiles(DirectoryToZip) + zip.AddFiles(filenames, "files") + zip.Save("Backup.zip") + End Using + + + + + + Create a zip file, specifying a text Encoding, but without specifying a + target filename or stream to save to. + + + + + See the documentation on the ZipFile + constructor that accepts a single string argument for basic + information on all the ZipFile constructors. + + + + + + The Encoding is used as the default alternate encoding for entries with + filenames or comments that cannot be encoded with the IBM437 code page. + + + + + Creates a new ZipFile instance, using the specified name for the + filename, and the specified status message writer. + + + + + See the documentation on the ZipFile + constructor that accepts a single string argument for basic + information on all the ZipFile constructors. + + + + This version of the constructor allows the caller to pass in a TextWriter, + to which verbose messages will be written during extraction or creation of + the zip archive. A console application may wish to pass + System.Console.Out to get messages on the Console. A graphical or headless + application may wish to capture the messages in a different + TextWriter, for example, a StringWriter, and then display + the messages in a TextBox, or generate an audit log of ZipFile operations. + + + + To encrypt the data for the files added to the ZipFile instance, + set the Password property after creating the ZipFile instance. + + + + Instances of the ZipFile class are not multi-thread safe. You may + not party on a single instance with multiple threads. You may have + multiple threads that each use a distinct ZipFile instance, or you + can synchronize multi-thread access to a single instance. + + + + + + Thrown if name refers to an existing file that is not a valid zip file. + + + + + using (ZipFile zip = new ZipFile("Backup.zip", Console.Out)) + { + // Store all files found in the top level directory, into the zip archive. + // note: this code does not recurse subdirectories! + // Status messages will be written to Console.Out + String[] filenames = System.IO.Directory.GetFiles(DirectoryToZip); + zip.AddFiles(filenames); + zip.Save(); + } + + + + Using zip As New ZipFile("Backup.zip", Console.Out) + ' Store all files found in the top level directory, into the zip archive. + ' note: this code does not recurse subdirectories! + ' Status messages will be written to Console.Out + Dim filenames As String() = System.IO.Directory.GetFiles(DirectoryToZip) + zip.AddFiles(filenames) + zip.Save() + End Using + + + + The filename to use for the new zip archive. + A TextWriter to use for writing + verbose status messages. + + + + Creates a new ZipFile instance, using the specified name for the + filename, the specified status message writer, and the specified Encoding. + + + + + This constructor works like the ZipFile + constructor that accepts a single string argument. See that + reference for detail on what this constructor does. + + + + This version of the constructor allows the caller to pass in a + TextWriter, and an Encoding. The TextWriter will collect + verbose messages that are generated by the library during extraction or + creation of the zip archive. A console application may wish to pass + System.Console.Out to get messages on the Console. A graphical or + headless application may wish to capture the messages in a different + TextWriter, for example, a StringWriter, and then display + the messages in a TextBox, or generate an audit log of + ZipFile operations. + + + + The Encoding is used as the default alternate encoding for entries + with filenames or comments that cannot be encoded with the IBM437 code + page. This is a equivalent to setting the property on the ZipFile + instance after construction. + + + + To encrypt the data for the files added to the ZipFile instance, + set the Password property after creating the ZipFile + instance. + + + + Instances of the ZipFile class are not multi-thread safe. You may + not party on a single instance with multiple threads. You may have + multiple threads that each use a distinct ZipFile instance, or you + can synchronize multi-thread access to a single instance. + + + + + + Thrown if fileName refers to an existing file that is not a valid zip file. + + + The filename to use for the new zip archive. + A TextWriter to use for writing verbose + status messages. + + The Encoding is used as the default alternate encoding for entries with + filenames or comments that cannot be encoded with the IBM437 code page. + + + + + Initialize a ZipFile instance by reading in a zip file. + + + + + + This method is primarily useful from COM Automation environments, when + reading or extracting zip files. In COM, it is not possible to invoke + parameterized constructors for a class. A COM Automation application can + update a zip file by using the default (no argument) + constructor, then calling Initialize() to read the contents + of an on-disk zip archive into the ZipFile instance. + + + + .NET applications are encouraged to use the ZipFile.Read() methods + for better clarity. + + + + the name of the existing zip file to read in. + + + + Removes the given ZipEntry from the zip archive. + + + + + After calling RemoveEntry, the application must call Save to + make the changes permanent. + + + + + Thrown if the specified ZipEntry does not exist in the ZipFile. + + + + In this example, all entries in the zip archive dating from before + December 31st, 2007, are removed from the archive. This is actually much + easier if you use the RemoveSelectedEntries method. But I needed an + example for RemoveEntry, so here it is. + + String ZipFileToRead = "ArchiveToModify.zip"; + System.DateTime Threshold = new System.DateTime(2007,12,31); + using (ZipFile zip = ZipFile.Read(ZipFileToRead)) + { + var EntriesToRemove = new System.Collections.Generic.List<ZipEntry>(); + foreach (ZipEntry e in zip) + { + if (e.LastModified < Threshold) + { + // We cannot remove the entry from the list, within the context of + // an enumeration of said list. + // So we add the doomed entry to a list to be removed later. + EntriesToRemove.Add(e); + } + } + + // actually remove the doomed entries. + foreach (ZipEntry zombie in EntriesToRemove) + zip.RemoveEntry(zombie); + + zip.Comment= String.Format("This zip archive was updated at {0}.", + System.DateTime.Now.ToString("G")); + + // save with a different name + zip.Save("Archive-Updated.zip"); + } + + + + Dim ZipFileToRead As String = "ArchiveToModify.zip" + Dim Threshold As New DateTime(2007, 12, 31) + Using zip As ZipFile = ZipFile.Read(ZipFileToRead) + Dim EntriesToRemove As New System.Collections.Generic.List(Of ZipEntry) + Dim e As ZipEntry + For Each e In zip + If (e.LastModified < Threshold) Then + ' We cannot remove the entry from the list, within the context of + ' an enumeration of said list. + ' So we add the doomed entry to a list to be removed later. + EntriesToRemove.Add(e) + End If + Next + + ' actually remove the doomed entries. + Dim zombie As ZipEntry + For Each zombie In EntriesToRemove + zip.RemoveEntry(zombie) + Next + zip.Comment = String.Format("This zip archive was updated at {0}.", DateTime.Now.ToString("G")) + 'save as a different name + zip.Save("Archive-Updated.zip") + End Using + + + + + The ZipEntry to remove from the zip. + + + + + + + + Removes the ZipEntry with the given filename from the zip archive. + + + + + After calling RemoveEntry, the application must call Save to + make the changes permanent. + + + + + + Thrown if the ZipFile is not updatable. + + + + Thrown if a ZipEntry with the specified filename does not exist in + the ZipFile. + + + + + This example shows one way to remove an entry with a given filename from + an existing zip archive. + + + String zipFileToRead= "PackedDocuments.zip"; + string candidate = "DatedMaterial.xps"; + using (ZipFile zip = ZipFile.Read(zipFileToRead)) + { + if (zip.EntryFilenames.Contains(candidate)) + { + zip.RemoveEntry(candidate); + zip.Comment= String.Format("The file '{0}' has been removed from this archive.", + Candidate); + zip.Save(); + } + } + + + Dim zipFileToRead As String = "PackedDocuments.zip" + Dim candidate As String = "DatedMaterial.xps" + Using zip As ZipFile = ZipFile.Read(zipFileToRead) + If zip.EntryFilenames.Contains(candidate) Then + zip.RemoveEntry(candidate) + zip.Comment = String.Format("The file '{0}' has been removed from this archive.", Candidate) + zip.Save + End If + End Using + + + + + The name of the file, including any directory path, to remove from the zip. + The filename match is not case-sensitive by default; you can use the + CaseSensitiveRetrieval property to change this behavior. The + pathname can use forward-slashes or backward slashes. + + + + + + Closes the read and write streams associated + to the ZipFile, if necessary. + + + + The Dispose() method is generally employed implicitly, via a using(..) {..} + statement. (Using...End Using in VB) If you do not employ a using + statement, insure that your application calls Dispose() explicitly. For + example, in a Powershell application, or an application that uses the COM + interop interface, you must call Dispose() explicitly. + + + + This example extracts an entry selected by name, from the Zip file to the + Console. + + using (ZipFile zip = ZipFile.Read(zipfile)) + { + foreach (ZipEntry e in zip) + { + if (WantThisEntry(e.FileName)) + zip.Extract(e.FileName, Console.OpenStandardOutput()); + } + } // Dispose() is called implicitly here. + + + + Using zip As ZipFile = ZipFile.Read(zipfile) + Dim e As ZipEntry + For Each e In zip + If WantThisEntry(e.FileName) Then + zip.Extract(e.FileName, Console.OpenStandardOutput()) + End If + Next + End Using ' Dispose is implicity called here + + + + + + Disposes any managed resources, if the flag is set, then marks the + instance disposed. This method is typically not called explicitly from + application code. + + + + Applications should call the no-arg Dispose method. + + + + indicates whether the method should dispose streams or not. + + + + + Default size of the buffer used for IO. + + + + + Extracts all of the items in the zip archive, to the specified path in the + filesystem. The path can be relative or fully-qualified. + + + + + This method will extract all entries in the ZipFile to the + specified path. + + + + If an extraction of a file from the zip archive would overwrite an + existing file in the filesystem, the action taken is dictated by the + ExtractExistingFile property, which overrides any setting you may have + made on individual ZipEntry instances. By default, if you have not + set that property on the ZipFile instance, the entry will not + be extracted, the existing file will not be overwritten and an + exception will be thrown. To change this, set the property, or use the + overload that allows you to + specify an ExtractExistingFileAction parameter. + + + + The action to take when an extract would overwrite an existing file + applies to all entries. If you want to set this on a per-entry basis, + then you must use one of the ZipEntry.Extract methods. + + + + This method will send verbose output messages to the , if it is set on the ZipFile + instance. + + + + You may wish to take advantage of the ExtractProgress event. + + + + About timestamps: When extracting a file entry from a zip archive, the + extracted file gets the last modified time of the entry as stored in + the archive. The archive may also store extended file timestamp + information, including last accessed and created times. If these are + present in the ZipEntry, then the extracted file will also get + these times. + + + + A Directory entry is somewhat different. It will get the times as + described for a file entry, but, if there are file entries in the zip + archive that, when extracted, appear in the just-created directory, + then when those file entries are extracted, the last modified and last + accessed times of the directory will change, as a side effect. The + result is that after an extraction of a directory and a number of + files within the directory, the last modified and last accessed + timestamps on the directory will reflect the time that the last file + was extracted into the directory, rather than the time stored in the + zip archive for the directory. + + + + To compensate, when extracting an archive with ExtractAll, + DotNetZip will extract all the file and directory entries as described + above, but it will then make a second pass on the directories, and + reset the times on the directories to reflect what is stored in the + zip archive. + + + + This compensation is performed only within the context of an + ExtractAll. If you call ZipEntry.Extract on a directory + entry, the timestamps on directory in the filesystem will reflect the + times stored in the zip. If you then call ZipEntry.Extract on + a file entry, which is extracted into the directory, the timestamps on + the directory will be updated to the current time. + + + + + This example extracts all the entries in a zip archive file, to the + specified target directory. The extraction will overwrite any + existing files silently. + + + String TargetDirectory= "unpack"; + using(ZipFile zip= ZipFile.Read(ZipFileToExtract)) + { + zip.ExtractExistingFile= ExtractExistingFileAction.OverwriteSilently; + zip.ExtractAll(TargetDirectory); + } + + + + Dim TargetDirectory As String = "unpack" + Using zip As ZipFile = ZipFile.Read(ZipFileToExtract) + zip.ExtractExistingFile= ExtractExistingFileAction.OverwriteSilently + zip.ExtractAll(TargetDirectory) + End Using + + + + + + + + The path to which the contents of the zipfile will be extracted. + The path can be relative or fully-qualified. + + + + + + Extracts all of the items in the zip archive, to the specified path in the + filesystem, using the specified behavior when extraction would overwrite an + existing file. + + + + + + This method will extract all entries in the ZipFile to the specified + path. For an extraction that would overwrite an existing file, the behavior + is dictated by , which overrides any + setting you may have made on individual ZipEntry instances. + + + + The action to take when an extract would overwrite an existing file + applies to all entries. If you want to set this on a per-entry basis, + then you must use or one of the similar methods. + + + + Calling this method is equivalent to setting the property and then calling . + + + + This method will send verbose output messages to the + , if it is set on the ZipFile instance. + + + + + This example extracts all the entries in a zip archive file, to the + specified target directory. It does not overwrite any existing files. + + String TargetDirectory= "c:\\unpack"; + using(ZipFile zip= ZipFile.Read(ZipFileToExtract)) + { + zip.ExtractAll(TargetDirectory, ExtractExistingFileAction.DontOverwrite); + } + + + + Dim TargetDirectory As String = "c:\unpack" + Using zip As ZipFile = ZipFile.Read(ZipFileToExtract) + zip.ExtractAll(TargetDirectory, ExtractExistingFileAction.DontOverwrite) + End Using + + + + + The path to which the contents of the zipfile will be extracted. + The path can be relative or fully-qualified. + + + + The action to take if extraction would overwrite an existing file. + + + + + + Reads a zip file archive and returns the instance. + + + + + The stream is read using the default System.Text.Encoding, which is the + IBM437 codepage. + + + + + Thrown if the ZipFile cannot be read. The implementation of this method + relies on System.IO.File.OpenRead, which can throw a variety of exceptions, + including specific exceptions if a file is not found, an unauthorized access + exception, exceptions for poorly formatted filenames, and so on. + + + + The name of the zip archive to open. This can be a fully-qualified or relative + pathname. + + + . + + The instance read from the zip archive. + + + + + Reads a zip file archive from the named filesystem file using the + specified options. + + + + + This version of the Read() method allows the caller to pass + in a TextWriter an Encoding, via an instance of the + ReadOptions class. The ZipFile is read in using the + specified encoding for entries where UTF-8 encoding is not + explicitly specified. + + + + + + + This example shows how to read a zip file using the Big-5 Chinese + code page (950), and extract each entry in the zip file, while + sending status messages out to the Console. + + + + For this code to work as intended, the zipfile must have been + created using the big5 code page (CP950). This is typical, for + example, when using WinRar on a machine with CP950 set as the + default code page. In that case, the names of entries within the + Zip archive will be stored in that code page, and reading the zip + archive must be done using that code page. If the application did + not use the correct code page in ZipFile.Read(), then names of + entries within the zip archive would not be correctly retrieved. + + + + string zipToExtract = "MyArchive.zip"; + string extractDirectory = "extract"; + var options = new ReadOptions + { + StatusMessageWriter = System.Console.Out, + Encoding = System.Text.Encoding.GetEncoding(950) + }; + using (ZipFile zip = ZipFile.Read(zipToExtract, options)) + { + foreach (ZipEntry e in zip) + { + e.Extract(extractDirectory); + } + } + + + + + Dim zipToExtract as String = "MyArchive.zip" + Dim extractDirectory as String = "extract" + Dim options as New ReadOptions + options.Encoding = System.Text.Encoding.GetEncoding(950) + options.StatusMessageWriter = System.Console.Out + Using zip As ZipFile = ZipFile.Read(zipToExtract, options) + Dim e As ZipEntry + For Each e In zip + e.Extract(extractDirectory) + Next + End Using + + + + + + + + This example shows how to read a zip file using the default + code page, to remove entries that have a modified date before a given threshold, + sending status messages out to a StringWriter. + + + + var options = new ReadOptions + { + StatusMessageWriter = new System.IO.StringWriter() + }; + using (ZipFile zip = ZipFile.Read("PackedDocuments.zip", options)) + { + var Threshold = new DateTime(2007,7,4); + // We cannot remove the entry from the list, within the context of + // an enumeration of said list. + // So we add the doomed entry to a list to be removed later. + // pass 1: mark the entries for removal + var MarkedEntries = new System.Collections.Generic.List<ZipEntry>(); + foreach (ZipEntry e in zip) + { + if (e.LastModified < Threshold) + MarkedEntries.Add(e); + } + // pass 2: actually remove the entry. + foreach (ZipEntry zombie in MarkedEntries) + zip.RemoveEntry(zombie); + zip.Comment = "This archive has been updated."; + zip.Save(); + } + // can now use contents of sw, eg store in an audit log + + + + Dim options as New ReadOptions + options.StatusMessageWriter = New System.IO.StringWriter + Using zip As ZipFile = ZipFile.Read("PackedDocuments.zip", options) + Dim Threshold As New DateTime(2007, 7, 4) + ' We cannot remove the entry from the list, within the context of + ' an enumeration of said list. + ' So we add the doomed entry to a list to be removed later. + ' pass 1: mark the entries for removal + Dim MarkedEntries As New System.Collections.Generic.List(Of ZipEntry) + Dim e As ZipEntry + For Each e In zip + If (e.LastModified < Threshold) Then + MarkedEntries.Add(e) + End If + Next + ' pass 2: actually remove the entry. + Dim zombie As ZipEntry + For Each zombie In MarkedEntries + zip.RemoveEntry(zombie) + Next + zip.Comment = "This archive has been updated." + zip.Save + End Using + ' can now use contents of sw, eg store in an audit log + + + + + Thrown if the zipfile cannot be read. The implementation of + this method relies on System.IO.File.OpenRead, which + can throw a variety of exceptions, including specific + exceptions if a file is not found, an unauthorized access + exception, exceptions for poorly formatted filenames, and so + on. + + + + The name of the zip archive to open. + This can be a fully-qualified or relative pathname. + + + + The set of options to use when reading the zip file. + + + The ZipFile instance read from the zip archive. + + + + + + + Reads a zip file archive using the specified text encoding, the specified + TextWriter for status messages, and the specified ReadProgress event handler, + and returns the instance. + + + + The name of the zip archive to open. + This can be a fully-qualified or relative pathname. + + + + An event handler for Read operations. + + + + The System.IO.TextWriter to use for writing verbose status messages + during operations on the zip archive. A console application may wish to + pass System.Console.Out to get messages on the Console. A graphical + or headless application may wish to capture the messages in a different + TextWriter, such as a System.IO.StringWriter. + + + + The System.Text.Encoding to use when reading in the zip archive. Be + careful specifying the encoding. If the value you use here is not the same + as the Encoding used when the zip archive was created (possibly by a + different archiver) you will get unexpected results and possibly exceptions. + + + The instance read from the zip archive. + + + + + Reads a zip archive from a stream. + + + + + + When reading from a file, it's probably easier to just use + ZipFile.Read(String, ReadOptions). This + overload is useful when when the zip archive content is + available from an already-open stream. The stream must be + open and readable and seekable when calling this method. The + stream is left open when the reading is completed. + + + + Using this overload, the stream is read using the default + System.Text.Encoding, which is the IBM437 + codepage. If you want to specify the encoding to use when + reading the zipfile content, see + ZipFile.Read(Stream, ReadOptions). This + + + + Reading of zip content begins at the current position in the + stream. This means if you have a stream that concatenates + regular data and zip data, if you position the open, readable + stream at the start of the zip data, you will be able to read + the zip archive using this constructor, or any of the ZipFile + constructors that accept a as + input. Some examples of where this might be useful: the zip + content is concatenated at the end of a regular EXE file, as + some self-extracting archives do. (Note: SFX files produced + by DotNetZip do not work this way; they can be read as normal + ZIP files). Another example might be a stream being read from + a database, where the zip content is embedded within an + aggregate stream of data. + + + + + + + This example shows how to Read zip content from a stream, and + extract one entry into a different stream. In this example, + the filename "NameOfEntryInArchive.doc", refers only to the + name of the entry within the zip archive. A file by that + name is not created in the filesystem. The I/O is done + strictly with the given streams. + + + + using (ZipFile zip = ZipFile.Read(InputStream)) + { + zip.Extract("NameOfEntryInArchive.doc", OutputStream); + } + + + + Using zip as ZipFile = ZipFile.Read(InputStream) + zip.Extract("NameOfEntryInArchive.doc", OutputStream) + End Using + + + + the stream containing the zip data. + + The ZipFile instance read from the stream + + + + + Reads a zip file archive from the given stream using the + specified options. + + + + + + When reading from a file, it's probably easier to just use + ZipFile.Read(String, ReadOptions). This + overload is useful when when the zip archive content is + available from an already-open stream. The stream must be + open and readable and seekable when calling this method. The + stream is left open when the reading is completed. + + + + Reading of zip content begins at the current position in the + stream. This means if you have a stream that concatenates + regular data and zip data, if you position the open, readable + stream at the start of the zip data, you will be able to read + the zip archive using this constructor, or any of the ZipFile + constructors that accept a as + input. Some examples of where this might be useful: the zip + content is concatenated at the end of a regular EXE file, as + some self-extracting archives do. (Note: SFX files produced + by DotNetZip do not work this way; they can be read as normal + ZIP files). Another example might be a stream being read from + a database, where the zip content is embedded within an + aggregate stream of data. + + + + the stream containing the zip data. + + + The set of options to use when reading the zip file. + + + + Thrown if the zip archive cannot be read. + + + The ZipFile instance read from the stream. + + + + + + + Reads a zip archive from a stream, using the specified text Encoding, the + specified TextWriter for status messages, + and the specified ReadProgress event handler. + + + + + Reading of zip content begins at the current position in the stream. This + means if you have a stream that concatenates regular data and zip data, if + you position the open, readable stream at the start of the zip data, you + will be able to read the zip archive using this constructor, or any of the + ZipFile constructors that accept a as + input. Some examples of where this might be useful: the zip content is + concatenated at the end of a regular EXE file, as some self-extracting + archives do. (Note: SFX files produced by DotNetZip do not work this + way). Another example might be a stream being read from a database, where + the zip content is embedded within an aggregate stream of data. + + + + the stream containing the zip data. + + + The System.IO.TextWriter to which verbose status messages are written + during operations on the ZipFile. For example, in a console + application, System.Console.Out works, and will get a message for each entry + added to the ZipFile. If the TextWriter is null, no verbose messages + are written. + + + + The text encoding to use when reading entries that do not have the UTF-8 + encoding bit set. Be careful specifying the encoding. If the value you use + here is not the same as the Encoding used when the zip archive was created + (possibly by a different archiver) you will get unexpected results and + possibly exceptions. See the + property for more information. + + + + An event handler for Read operations. + + + an instance of ZipFile + + + + Checks the given file to see if it appears to be a valid zip file. + + + + + Calling this method is equivalent to calling with the testExtract parameter set to false. + + + + The file to check. + true if the file appears to be a zip file. + + + + Checks a file to see if it is a valid zip file. + + + + + This method opens the specified zip file, reads in the zip archive, + verifying the ZIP metadata as it reads. + + + + If everything succeeds, then the method returns true. If anything fails - + for example if an incorrect signature or CRC is found, indicating a + corrupt file, the the method returns false. This method also returns + false for a file that does not exist. + + + + If is true, as part of its check, this + method reads in the content for each entry, expands it, and checks CRCs. + This provides an additional check beyond verifying the zip header and + directory data. + + + + If is true, and if any of the zip entries + are protected with a password, this method will return false. If you want + to verify a ZipFile that has entries which are protected with a + password, you will need to do that manually. + + + + + The zip file to check. + true if the caller wants to extract each entry. + true if the file contains a valid zip file. + + + + Checks a stream to see if it contains a valid zip archive. + + + + + This method reads the zip archive contained in the specified stream, verifying + the ZIP metadata as it reads. If testExtract is true, this method also extracts + each entry in the archive, dumping all the bits into . + + + + If everything succeeds, then the method returns true. If anything fails - + for example if an incorrect signature or CRC is found, indicating a corrupt + file, the the method returns false. This method also returns false for a + file that does not exist. + + + + If testExtract is true, this method reads in the content for each + entry, expands it, and checks CRCs. This provides an additional check + beyond verifying the zip header data. + + + + If testExtract is true, and if any of the zip entries are protected + with a password, this method will return false. If you want to verify a + ZipFile that has entries which are protected with a password, you will need + to do that manually. + + + + + + The stream to check. + true if the caller wants to extract each entry. + true if the stream contains a valid zip archive. + + + + Delete file with retry on UnauthorizedAccessException. + + + + + When calling File.Delete() on a file that has been "recently" + created, the call sometimes fails with + UnauthorizedAccessException. This method simply retries the Delete 3 + times with a sleep between tries. + + + + the name of the file to be deleted + + + + Saves the Zip archive to a file, specified by the Name property of the + ZipFile. + + + + + The ZipFile instance is written to storage, typically a zip file + in a filesystem, only when the caller calls Save. In the typical + case, the Save operation writes the zip content to a temporary file, and + then renames the temporary file to the desired name. If necessary, this + method will delete a pre-existing file before the rename. + + + + The property is specified either explicitly, + or implicitly using one of the parameterized ZipFile constructors. For + COM Automation clients, the Name property must be set explicitly, + because COM Automation clients cannot call parameterized constructors. + + + + When using a filesystem file for the Zip output, it is possible to call + Save multiple times on the ZipFile instance. With each + call the zip content is re-written to the same output file. + + + + Data for entries that have been added to the ZipFile instance is + written to the output when the Save method is called. This means + that the input streams for those entries must be available at the time + the application calls Save. If, for example, the application + adds entries with AddEntry using a dynamically-allocated + MemoryStream, the memory stream must not have been disposed + before the call to Save. See the property for more discussion of the + availability requirements of the input stream for an entry, and an + approach for providing just-in-time stream lifecycle management. + + + + + + + + Thrown if you haven't specified a location or stream for saving the zip, + either in the constructor or by setting the Name property, or if you try + to save a regular zip archive to a filename with a .exe extension. + + + + Thrown if is non-zero, and the number + of segments that would be generated for the spanned zip file during the + save operation exceeds 99. If this happens, you need to increase the + segment size. + + + + + + Save the file to a new zipfile, with the given name. + + + + + This method allows the application to explicitly specify the name of the zip + file when saving. Use this when creating a new zip file, or when + updating a zip archive. + + + + An application can also save a zip archive in several places by calling this + method multiple times in succession, with different filenames. + + + + The ZipFile instance is written to storage, typically a zip file in a + filesystem, only when the caller calls Save. The Save operation writes + the zip content to a temporary file, and then renames the temporary file + to the desired name. If necessary, this method will delete a pre-existing file + before the rename. + + + + + + Thrown if you specify a directory for the filename. + + + + The name of the zip archive to save to. Existing files will + be overwritten with great prejudice. + + + + This example shows how to create and Save a zip file. + + using (ZipFile zip = new ZipFile()) + { + zip.AddDirectory(@"c:\reports\January"); + zip.Save("January.zip"); + } + + + + Using zip As New ZipFile() + zip.AddDirectory("c:\reports\January") + zip.Save("January.zip") + End Using + + + + + + This example shows how to update a zip file. + + using (ZipFile zip = ZipFile.Read("ExistingArchive.zip")) + { + zip.AddFile("NewData.csv"); + zip.Save("UpdatedArchive.zip"); + } + + + + Using zip As ZipFile = ZipFile.Read("ExistingArchive.zip") + zip.AddFile("NewData.csv") + zip.Save("UpdatedArchive.zip") + End Using + + + + + + + Save the zip archive to the specified stream. + + + + + The ZipFile instance is written to storage - typically a zip file + in a filesystem, but using this overload, the storage can be anything + accessible via a writable stream - only when the caller calls Save. + + + + Use this method to save the zip content to a stream directly. A common + scenario is an ASP.NET application that dynamically generates a zip file + and allows the browser to download it. The application can call + Save(Response.OutputStream) to write a zipfile directly to the + output stream, without creating a zip file on the disk on the ASP.NET + server. + + + + Be careful when saving a file to a non-seekable stream, including + Response.OutputStream. When DotNetZip writes to a non-seekable + stream, the zip archive is formatted in such a way that may not be + compatible with all zip tools on all platforms. It's a perfectly legal + and compliant zip file, but some people have reported problems opening + files produced this way using the Mac OS archive utility. + + + + + + + This example saves the zipfile content into a MemoryStream, and + then gets the array of bytes from that MemoryStream. + + + using (var zip = new Ionic.Zip.ZipFile()) + { + zip.CompressionLevel= Ionic.Zlib.CompressionLevel.BestCompression; + zip.Password = "VerySecret."; + zip.Encryption = EncryptionAlgorithm.WinZipAes128; + zip.AddFile(sourceFileName); + MemoryStream output = new MemoryStream(); + zip.Save(output); + + byte[] zipbytes = output.ToArray(); + } + + + + + + This example shows a pitfall you should avoid. DO NOT read + from a stream, then try to save to the same stream. DO + NOT DO THIS: + + + + using (var fs = new FileSteeam(filename, FileMode.Open)) + { + using (var zip = Ionic.Zip.ZipFile.Read(inputStream)) + { + zip.AddEntry("Name1.txt", "this is the content"); + zip.Save(inputStream); // NO NO NO!! + } + } + + + + Better like this: + + + + using (var zip = Ionic.Zip.ZipFile.Read(filename)) + { + zip.AddEntry("Name1.txt", "this is the content"); + zip.Save(); // YES! + } + + + + + + The System.IO.Stream to write to. It must be + writable. If you created the ZipFile instanct by calling + ZipFile.Read(), this stream must not be the same stream + you passed to ZipFile.Read(). + + + + + Adds to the ZipFile a set of files from the current working directory on + disk, that conform to the specified criteria. + + + + + This method selects files from the the current working directory matching + the specified criteria, and adds them to the ZipFile. + + + + Specify the criteria in statements of 3 elements: a noun, an operator, and + a value. Consider the string "name != *.doc" . The noun is "name". The + operator is "!=", implying "Not Equal". The value is "*.doc". That + criterion, in English, says "all files with a name that does not end in + the .doc extension." + + + + Supported nouns include "name" (or "filename") for the filename; "atime", + "mtime", and "ctime" for last access time, last modfied time, and created + time of the file, respectively; "attributes" (or "attrs") for the file + attributes; "size" (or "length") for the file length (uncompressed), and + "type" for the type of object, either a file or a directory. The + "attributes", "name" and "type" nouns both support = and != as operators. + The "size", "atime", "mtime", and "ctime" nouns support = and !=, and + >, >=, <, <= as well. The times are taken to be expressed in + local time. + + + + Specify values for the file attributes as a string with one or more of the + characters H,R,S,A,I,L in any order, implying file attributes of Hidden, + ReadOnly, System, Archive, NotContextIndexed, and ReparsePoint (symbolic + link) respectively. + + + + To specify a time, use YYYY-MM-DD-HH:mm:ss or YYYY/MM/DD-HH:mm:ss as the + format. If you omit the HH:mm:ss portion, it is assumed to be 00:00:00 + (midnight). + + + + The value for a size criterion is expressed in integer quantities of bytes, + kilobytes (use k or kb after the number), megabytes (m or mb), or gigabytes + (g or gb). + + + + The value for a name is a pattern to match against the filename, potentially + including wildcards. The pattern follows CMD.exe glob rules: * implies one + or more of any character, while ? implies one character. If the name + pattern contains any slashes, it is matched to the entire filename, + including the path; otherwise, it is matched against only the filename + without the path. This means a pattern of "*\*.*" matches all files one + directory level deep, while a pattern of "*.*" matches all files in all + directories. + + + + To specify a name pattern that includes spaces, use single quotes around the + pattern. A pattern of "'* *.*'" will match all files that have spaces in + the filename. The full criteria string for that would be "name = '* *.*'" . + + + + The value for a type criterion is either F (implying a file) or D (implying + a directory). + + + + Some examples: + + + + + criteria + Files retrieved + + + + name != *.xls + any file with an extension that is not .xls + + + + + name = *.mp3 + any file with a .mp3 extension. + + + + + *.mp3 + (same as above) any file with a .mp3 extension. + + + + + attributes = A + all files whose attributes include the Archive bit. + + + + + attributes != H + all files whose attributes do not include the Hidden bit. + + + + + mtime > 2009-01-01 + all files with a last modified time after January 1st, 2009. + + + + + size > 2gb + all files whose uncompressed size is greater than 2gb. + + + + + type = D + all directories in the filesystem. + + + + + + You can combine criteria with the conjunctions AND or OR. Using a string + like "name = *.txt AND size >= 100k" for the selectionCriteria retrieves + entries whose names end in .txt, and whose uncompressed size is greater than + or equal to 100 kilobytes. + + + + For more complex combinations of criteria, you can use parenthesis to group + clauses in the boolean logic. Without parenthesis, the precedence of the + criterion atoms is determined by order of appearance. Unlike the C# + language, the AND conjunction does not take precendence over the logical OR. + This is important only in strings that contain 3 or more criterion atoms. + In other words, "name = *.txt and size > 1000 or attributes = H" implies + "((name = *.txt AND size > 1000) OR attributes = H)" while "attributes = + H OR name = *.txt and size > 1000" evaluates to "((attributes = H OR name + = *.txt) AND size > 1000)". When in doubt, use parenthesis. + + + + Using time properties requires some extra care. If you want to retrieve all + entries that were last updated on 2009 February 14, specify a time range + like so:"mtime >= 2009-02-14 AND mtime < 2009-02-15". Read this to + say: all files updated after 12:00am on February 14th, until 12:00am on + February 15th. You can use the same bracketing approach to specify any time + period - a year, a month, a week, and so on. + + + + The syntax allows one special case: if you provide a string with no spaces, it is + treated as a pattern to match for the filename. Therefore a string like "*.xls" + will be equivalent to specifying "name = *.xls". + + + + There is no logic in this method that insures that the file inclusion + criteria are internally consistent. For example, it's possible to specify + criteria that says the file must have a size of less than 100 bytes, as well + as a size that is greater than 1000 bytes. Obviously no file will ever + satisfy such criteria, but this method does not detect such logical + inconsistencies. The caller is responsible for insuring the criteria are + sensible. + + + + Using this method, the file selection does not recurse into + subdirectories, and the full path of the selected files is included in the + entries added into the zip archive. If you don't like these behaviors, + see the other overloads of this method. + + + + + This example zips up all *.csv files in the current working directory. + + using (ZipFile zip = new ZipFile()) + { + // To just match on filename wildcards, + // use the shorthand form of the selectionCriteria string. + zip.AddSelectedFiles("*.csv"); + zip.Save(PathToZipArchive); + } + + + Using zip As ZipFile = New ZipFile() + zip.AddSelectedFiles("*.csv") + zip.Save(PathToZipArchive) + End Using + + + + The criteria for file selection + + + + Adds to the ZipFile a set of files from the disk that conform to the + specified criteria, optionally recursing into subdirectories. + + + + + This method selects files from the the current working directory matching + the specified criteria, and adds them to the ZipFile. If + recurseDirectories is true, files are also selected from + subdirectories, and the directory structure in the filesystem is + reproduced in the zip archive, rooted at the current working directory. + + + + Using this method, the full path of the selected files is included in the + entries added into the zip archive. If you don't want this behavior, use + one of the overloads of this method that allows the specification of a + directoryInArchive. + + + + For details on the syntax for the selectionCriteria parameter, see . + + + + + + + This example zips up all *.xml files in the current working directory, or any + subdirectory, that are larger than 1mb. + + + using (ZipFile zip = new ZipFile()) + { + // Use a compound expression in the selectionCriteria string. + zip.AddSelectedFiles("name = *.xml and size > 1024kb", true); + zip.Save(PathToZipArchive); + } + + + Using zip As ZipFile = New ZipFile() + ' Use a compound expression in the selectionCriteria string. + zip.AddSelectedFiles("name = *.xml and size > 1024kb", true) + zip.Save(PathToZipArchive) + End Using + + + + The criteria for file selection + + + If true, the file selection will recurse into subdirectories. + + + + + Adds to the ZipFile a set of files from a specified directory in the + filesystem, that conform to the specified criteria. + + + + + This method selects files that conform to the specified criteria, from the + the specified directory on disk, and adds them to the ZipFile. The search + does not recurse into subdirectores. + + + + Using this method, the full filesystem path of the files on disk is + reproduced on the entries added to the zip file. If you don't want this + behavior, use one of the other overloads of this method. + + + + For details on the syntax for the selectionCriteria parameter, see . + + + + + + + This example zips up all *.xml files larger than 1mb in the directory + given by "d:\rawdata". + + + using (ZipFile zip = new ZipFile()) + { + // Use a compound expression in the selectionCriteria string. + zip.AddSelectedFiles("name = *.xml and size > 1024kb", "d:\\rawdata"); + zip.Save(PathToZipArchive); + } + + + + Using zip As ZipFile = New ZipFile() + ' Use a compound expression in the selectionCriteria string. + zip.AddSelectedFiles("name = *.xml and size > 1024kb", "d:\rawdata) + zip.Save(PathToZipArchive) + End Using + + + + The criteria for file selection + + + The name of the directory on the disk from which to select files. + + + + + Adds to the ZipFile a set of files from the specified directory on disk, + that conform to the specified criteria. + + + + + + This method selects files from the the specified disk directory matching + the specified selection criteria, and adds them to the ZipFile. If + recurseDirectories is true, files are also selected from + subdirectories. + + + + The full directory structure in the filesystem is reproduced on the + entries added to the zip archive. If you don't want this behavior, use + one of the overloads of this method that allows the specification of a + directoryInArchive. + + + + For details on the syntax for the selectionCriteria parameter, see . + + + + + + This example zips up all *.csv files in the "files" directory, or any + subdirectory, that have been saved since 2009 February 14th. + + + using (ZipFile zip = new ZipFile()) + { + // Use a compound expression in the selectionCriteria string. + zip.AddSelectedFiles("name = *.csv and mtime > 2009-02-14", "files", true); + zip.Save(PathToZipArchive); + } + + + Using zip As ZipFile = New ZipFile() + ' Use a compound expression in the selectionCriteria string. + zip.AddSelectedFiles("name = *.csv and mtime > 2009-02-14", "files", true) + zip.Save(PathToZipArchive) + End Using + + + + + This example zips up all files in the current working + directory, and all its child directories, except those in + the excludethis subdirectory. + + Using Zip As ZipFile = New ZipFile(zipfile) + Zip.AddSelectedFfiles("name != 'excludethis\*.*'", datapath, True) + Zip.Save() + End Using + + + + The criteria for file selection + + + The filesystem path from which to select files. + + + + If true, the file selection will recurse into subdirectories. + + + + + Adds to the ZipFile a selection of files from the specified directory on + disk, that conform to the specified criteria, and using a specified root + path for entries added to the zip archive. + + + + + This method selects files from the specified disk directory matching the + specified selection criteria, and adds those files to the ZipFile, using + the specified directory path in the archive. The search does not recurse + into subdirectories. For details on the syntax for the selectionCriteria + parameter, see . + + + + + + + This example zips up all *.psd files in the "photos" directory that have + been saved since 2009 February 14th, and puts them all in a zip file, + using the directory name of "content" in the zip archive itself. When the + zip archive is unzipped, the folder containing the .psd files will be + named "content". + + + using (ZipFile zip = new ZipFile()) + { + // Use a compound expression in the selectionCriteria string. + zip.AddSelectedFiles("name = *.psd and mtime > 2009-02-14", "photos", "content"); + zip.Save(PathToZipArchive); + } + + + Using zip As ZipFile = New ZipFile + zip.AddSelectedFiles("name = *.psd and mtime > 2009-02-14", "photos", "content") + zip.Save(PathToZipArchive) + End Using + + + + + The criteria for selection of files to add to the ZipFile. + + + + The path to the directory in the filesystem from which to select files. + + + + Specifies a directory path to use to in place of the + directoryOnDisk. This path may, or may not, correspond to a real + directory in the current filesystem. If the files within the zip are + later extracted, this is the path used for the extracted file. Passing + null (nothing in VB) will use the path on the file name, if any; in other + words it would use directoryOnDisk, plus any subdirectory. Passing + the empty string ("") will insert the item at the root path within the + archive. + + + + + Adds to the ZipFile a selection of files from the specified directory on + disk, that conform to the specified criteria, optionally recursing through + subdirectories, and using a specified root path for entries added to the + zip archive. + + + + This method selects files from the specified disk directory that match the + specified selection criteria, and adds those files to the ZipFile, using + the specified directory path in the archive. If recurseDirectories + is true, files are also selected from subdirectories, and the directory + structure in the filesystem is reproduced in the zip archive, rooted at + the directory specified by directoryOnDisk. For details on the + syntax for the selectionCriteria parameter, see . + + + + + This example zips up all files that are NOT *.pst files, in the current + working directory and any subdirectories. + + + using (ZipFile zip = new ZipFile()) + { + zip.AddSelectedFiles("name != *.pst", SourceDirectory, "backup", true); + zip.Save(PathToZipArchive); + } + + + Using zip As ZipFile = New ZipFile + zip.AddSelectedFiles("name != *.pst", SourceDirectory, "backup", true) + zip.Save(PathToZipArchive) + End Using + + + + + The criteria for selection of files to add to the ZipFile. + + + + The path to the directory in the filesystem from which to select files. + + + + Specifies a directory path to use to in place of the + directoryOnDisk. This path may, or may not, correspond to a real + directory in the current filesystem. If the files within the zip are + later extracted, this is the path used for the extracted file. Passing + null (nothing in VB) will use the path on the file name, if any; in other + words it would use directoryOnDisk, plus any subdirectory. Passing + the empty string ("") will insert the item at the root path within the + archive. + + + + If true, the method also scans subdirectories for files matching the + criteria. + + + + + Updates the ZipFile with a selection of files from the disk that conform + to the specified criteria. + + + + This method selects files from the specified disk directory that match the + specified selection criteria, and Updates the ZipFile with those + files, using the specified directory path in the archive. If + recurseDirectories is true, files are also selected from + subdirectories, and the directory structure in the filesystem is + reproduced in the zip archive, rooted at the directory specified by + directoryOnDisk. For details on the syntax for the + selectionCriteria parameter, see . + + + + The criteria for selection of files to add to the ZipFile. + + + + The path to the directory in the filesystem from which to select files. + + + + Specifies a directory path to use to in place of the + directoryOnDisk. This path may, or may not, correspond to a + real directory in the current filesystem. If the files within the zip + are later extracted, this is the path used for the extracted file. + Passing null (nothing in VB) will use the path on the file name, if + any; in other words it would use directoryOnDisk, plus any + subdirectory. Passing the empty string ("") will insert the item at + the root path within the archive. + + + + If true, the method also scans subdirectories for files matching the criteria. + + + + + + + Retrieve entries from the zipfile by specified criteria. + + + + + This method allows callers to retrieve the collection of entries from the zipfile + that fit the specified criteria. The criteria are described in a string format, and + can include patterns for the filename; constraints on the size of the entry; + constraints on the last modified, created, or last accessed time for the file + described by the entry; or the attributes of the entry. + + + + For details on the syntax for the selectionCriteria parameter, see . + + + + This method is intended for use with a ZipFile that has been read from storage. + When creating a new ZipFile, this method will work only after the ZipArchive has + been Saved to the disk (the ZipFile class subsequently and implicitly reads the Zip + archive from storage.) Calling SelectEntries on a ZipFile that has not yet been + saved will deliver undefined results. + + + + + Thrown if selectionCriteria has an invalid syntax. + + + + This example selects all the PhotoShop files from within an archive, and extracts them + to the current working directory. + + using (ZipFile zip1 = ZipFile.Read(ZipFileName)) + { + var PhotoShopFiles = zip1.SelectEntries("*.psd"); + foreach (ZipEntry psd in PhotoShopFiles) + { + psd.Extract(); + } + } + + + Using zip1 As ZipFile = ZipFile.Read(ZipFileName) + Dim PhotoShopFiles as ICollection(Of ZipEntry) + PhotoShopFiles = zip1.SelectEntries("*.psd") + Dim psd As ZipEntry + For Each psd In PhotoShopFiles + psd.Extract + Next + End Using + + + the string that specifies which entries to select + a collection of ZipEntry objects that conform to the inclusion spec + + + + Retrieve entries from the zipfile by specified criteria. + + + + + This method allows callers to retrieve the collection of entries from the zipfile + that fit the specified criteria. The criteria are described in a string format, and + can include patterns for the filename; constraints on the size of the entry; + constraints on the last modified, created, or last accessed time for the file + described by the entry; or the attributes of the entry. + + + + For details on the syntax for the selectionCriteria parameter, see . + + + + This method is intended for use with a ZipFile that has been read from storage. + When creating a new ZipFile, this method will work only after the ZipArchive has + been Saved to the disk (the ZipFile class subsequently and implicitly reads the Zip + archive from storage.) Calling SelectEntries on a ZipFile that has not yet been + saved will deliver undefined results. + + + + + Thrown if selectionCriteria has an invalid syntax. + + + + + using (ZipFile zip1 = ZipFile.Read(ZipFileName)) + { + var UpdatedPhotoShopFiles = zip1.SelectEntries("*.psd", "UpdatedFiles"); + foreach (ZipEntry e in UpdatedPhotoShopFiles) + { + // prompt for extract here + if (WantExtract(e.FileName)) + e.Extract(); + } + } + + + Using zip1 As ZipFile = ZipFile.Read(ZipFileName) + Dim UpdatedPhotoShopFiles As ICollection(Of ZipEntry) = zip1.SelectEntries("*.psd", "UpdatedFiles") + Dim e As ZipEntry + For Each e In UpdatedPhotoShopFiles + ' prompt for extract here + If Me.WantExtract(e.FileName) Then + e.Extract + End If + Next + End Using + + + the string that specifies which entries to select + + + the directory in the archive from which to select entries. If null, then + all directories in the archive are used. + + + a collection of ZipEntry objects that conform to the inclusion spec + + + + Remove entries from the zipfile by specified criteria. + + + + + This method allows callers to remove the collection of entries from the zipfile + that fit the specified criteria. The criteria are described in a string format, and + can include patterns for the filename; constraints on the size of the entry; + constraints on the last modified, created, or last accessed time for the file + described by the entry; or the attributes of the entry. + + + + For details on the syntax for the selectionCriteria parameter, see . + + + + This method is intended for use with a ZipFile that has been read from storage. + When creating a new ZipFile, this method will work only after the ZipArchive has + been Saved to the disk (the ZipFile class subsequently and implicitly reads the Zip + archive from storage.) Calling SelectEntries on a ZipFile that has not yet been + saved will deliver undefined results. + + + + + Thrown if selectionCriteria has an invalid syntax. + + + + This example removes all entries in a zip file that were modified prior to January 1st, 2008. + + using (ZipFile zip1 = ZipFile.Read(ZipFileName)) + { + // remove all entries from prior to Jan 1, 2008 + zip1.RemoveEntries("mtime < 2008-01-01"); + // don't forget to save the archive! + zip1.Save(); + } + + + Using zip As ZipFile = ZipFile.Read(ZipFileName) + ' remove all entries from prior to Jan 1, 2008 + zip1.RemoveEntries("mtime < 2008-01-01") + ' do not forget to save the archive! + zip1.Save + End Using + + + the string that specifies which entries to select + the number of entries removed + + + + Remove entries from the zipfile by specified criteria, and within the specified + path in the archive. + + + + + This method allows callers to remove the collection of entries from the zipfile + that fit the specified criteria. The criteria are described in a string format, and + can include patterns for the filename; constraints on the size of the entry; + constraints on the last modified, created, or last accessed time for the file + described by the entry; or the attributes of the entry. + + + + For details on the syntax for the selectionCriteria parameter, see . + + + + This method is intended for use with a ZipFile that has been read from storage. + When creating a new ZipFile, this method will work only after the ZipArchive has + been Saved to the disk (the ZipFile class subsequently and implicitly reads the Zip + archive from storage.) Calling SelectEntries on a ZipFile that has not yet been + saved will deliver undefined results. + + + + + Thrown if selectionCriteria has an invalid syntax. + + + + + using (ZipFile zip1 = ZipFile.Read(ZipFileName)) + { + // remove all entries from prior to Jan 1, 2008 + zip1.RemoveEntries("mtime < 2008-01-01", "documents"); + // a call to ZipFile.Save will make the modifications permanent + zip1.Save(); + } + + + Using zip As ZipFile = ZipFile.Read(ZipFileName) + ' remove all entries from prior to Jan 1, 2008 + zip1.RemoveEntries("mtime < 2008-01-01", "documents") + ' a call to ZipFile.Save will make the modifications permanent + zip1.Save + End Using + + + + the string that specifies which entries to select + + the directory in the archive from which to select entries. If null, then + all directories in the archive are used. + + the number of entries removed + + + + Selects and Extracts a set of Entries from the ZipFile. + + + + + The entries are extracted into the current working directory. + + + + If any of the files to be extracted already exist, then the action taken is as + specified in the property on the + corresponding ZipEntry instance. By default, the action taken in this case is to + throw an exception. + + + + For information on the syntax of the selectionCriteria string, + see . + + + + + This example shows how extract all XML files modified after 15 January 2009. + + using (ZipFile zip = ZipFile.Read(zipArchiveName)) + { + zip.ExtractSelectedEntries("name = *.xml and mtime > 2009-01-15"); + } + + + the selection criteria for entries to extract. + + + + + + Selects and Extracts a set of Entries from the ZipFile. + + + + + The entries are extracted into the current working directory. When extraction would would + overwrite an existing filesystem file, the action taken is as specified in the + parameter. + + + + For information on the syntax of the string describing the entry selection criteria, + see . + + + + + This example shows how extract all XML files modified after 15 January 2009, + overwriting any existing files. + + using (ZipFile zip = ZipFile.Read(zipArchiveName)) + { + zip.ExtractSelectedEntries("name = *.xml and mtime > 2009-01-15", + ExtractExistingFileAction.OverwriteSilently); + } + + + + the selection criteria for entries to extract. + + + The action to take if extraction would overwrite an existing file. + + + + + Selects and Extracts a set of Entries from the ZipFile. + + + + + The entries are selected from the specified directory within the archive, and then + extracted into the current working directory. + + + + If any of the files to be extracted already exist, then the action taken is as + specified in the property on the + corresponding ZipEntry instance. By default, the action taken in this case is to + throw an exception. + + + + For information on the syntax of the string describing the entry selection criteria, + see . + + + + + This example shows how extract all XML files modified after 15 January 2009, + and writes them to the "unpack" directory. + + using (ZipFile zip = ZipFile.Read(zipArchiveName)) + { + zip.ExtractSelectedEntries("name = *.xml and mtime > 2009-01-15","unpack"); + } + + + + the selection criteria for entries to extract. + + + the directory in the archive from which to select entries. If null, then + all directories in the archive are used. + + + + + + + Selects and Extracts a set of Entries from the ZipFile. + + + + + The entries are extracted into the specified directory. If any of the files to be + extracted already exist, an exception will be thrown. + + + For information on the syntax of the string describing the entry selection criteria, + see . + + + + the selection criteria for entries to extract. + + + the directory in the archive from which to select entries. If null, then + all directories in the archive are used. + + + + the directory on the disk into which to extract. It will be created + if it does not exist. + + + + + Selects and Extracts a set of Entries from the ZipFile. + + + + + The entries are extracted into the specified directory. When extraction would would + overwrite an existing filesystem file, the action taken is as specified in the + parameter. + + + + For information on the syntax of the string describing the entry selection criteria, + see . + + + + + This example shows how extract all files with an XML extension or with a size larger than 100,000 bytes, + and puts them in the unpack directory. For any files that already exist in + that destination directory, they will not be overwritten. + + using (ZipFile zip = ZipFile.Read(zipArchiveName)) + { + zip.ExtractSelectedEntries("name = *.xml or size > 100000", + null, + "unpack", + ExtractExistingFileAction.DontOverwrite); + } + + + + the selection criteria for entries to extract. + + + The directory on the disk into which to extract. It will be created if it does not exist. + + + + The directory in the archive from which to select entries. If null, then + all directories in the archive are used. + + + + The action to take if extraction would overwrite an existing file. + + + + + + Saves the ZipFile instance to a self-extracting zip archive. + + + + + + The generated exe image will execute on any machine that has the .NET + Framework 2.0 installed on it. The generated exe image is also a + valid ZIP file, readable with DotNetZip or another Zip library or tool + such as WinZip. + + + + There are two "flavors" of self-extracting archive. The + WinFormsApplication version will pop up a GUI and allow the + user to select a target directory into which to extract. There's also + a checkbox allowing the user to specify to overwrite existing files, + and another checkbox to allow the user to request that Explorer be + opened to see the extracted files after extraction. The other flavor + is ConsoleApplication. A self-extractor generated with that + flavor setting will run from the command line. It accepts command-line + options to set the overwrite behavior, and to specify the target + extraction directory. + + + + There are a few temporary files created during the saving to a + self-extracting zip. These files are created in the directory pointed + to by , which defaults to . These temporary files are + removed upon successful completion of this method. + + + + When a user runs the WinForms SFX, the user's personal directory (Environment.SpecialFolder.Personal) + will be used as the default extract location. If you want to set the + default extract location, you should use the other overload of + SaveSelfExtractor()/ The user who runs the SFX will have the + opportunity to change the extract directory before extracting. When + the user runs the Command-Line SFX, the user must explicitly specify + the directory to which to extract. The .NET Framework 2.0 is required + on the computer when the self-extracting archive is run. + + + + NB: This method is not available in the version of DotNetZip build for + the .NET Compact Framework, nor in the "Reduced" DotNetZip library. + + + + + + + string DirectoryPath = "c:\\Documents\\Project7"; + using (ZipFile zip = new ZipFile()) + { + zip.AddDirectory(DirectoryPath, System.IO.Path.GetFileName(DirectoryPath)); + zip.Comment = "This will be embedded into a self-extracting console-based exe"; + zip.SaveSelfExtractor("archive.exe", SelfExtractorFlavor.ConsoleApplication); + } + + + Dim DirectoryPath As String = "c:\Documents\Project7" + Using zip As New ZipFile() + zip.AddDirectory(DirectoryPath, System.IO.Path.GetFileName(DirectoryPath)) + zip.Comment = "This will be embedded into a self-extracting console-based exe" + zip.SaveSelfExtractor("archive.exe", SelfExtractorFlavor.ConsoleApplication) + End Using + + + + + a pathname, possibly fully qualified, to be created. Typically it + will end in an .exe extension. + + Indicates whether a Winforms or Console self-extractor is + desired. + + + + Saves the ZipFile instance to a self-extracting zip archive, using + the specified save options. + + + + + This method saves a self extracting archive, using the specified save + options. These options include the flavor of the SFX, the default extract + directory, the icon file, and so on. See the documentation + for for more + details. + + + + The user who runs the SFX will have the opportunity to change the extract + directory before extracting. If at the time of extraction, the specified + directory does not exist, the SFX will create the directory before + extracting the files. + + + + + + This example saves a WinForms-based self-extracting archive EXE that + will use c:\ExtractHere as the default extract location. The C# code + shows syntax for .NET 3.0, which uses an object initializer for + the SelfExtractorOptions object. + + string DirectoryPath = "c:\\Documents\\Project7"; + using (ZipFile zip = new ZipFile()) + { + zip.AddDirectory(DirectoryPath, System.IO.Path.GetFileName(DirectoryPath)); + zip.Comment = "This will be embedded into a self-extracting WinForms-based exe"; + var options = new SelfExtractorOptions + { + Flavor = SelfExtractorFlavor.WinFormsApplication, + DefaultExtractDirectory = "%USERPROFILE%\\ExtractHere", + PostExtractCommandLine = ExeToRunAfterExtract, + SfxExeWindowTitle = "My Custom Window Title", + RemoveUnpackedFilesAfterExecute = true + }; + zip.SaveSelfExtractor("archive.exe", options); + } + + + Dim DirectoryPath As String = "c:\Documents\Project7" + Using zip As New ZipFile() + zip.AddDirectory(DirectoryPath, System.IO.Path.GetFileName(DirectoryPath)) + zip.Comment = "This will be embedded into a self-extracting console-based exe" + Dim options As New SelfExtractorOptions() + options.Flavor = SelfExtractorFlavor.WinFormsApplication + options.DefaultExtractDirectory = "%USERPROFILE%\\ExtractHere" + options.PostExtractCommandLine = ExeToRunAfterExtract + options.SfxExeWindowTitle = "My Custom Window Title" + options.RemoveUnpackedFilesAfterExecute = True + zip.SaveSelfExtractor("archive.exe", options) + End Using + + + + The name of the EXE to generate. + provides the options for creating the + Self-extracting archive. + + + + Generic IEnumerator support, for use of a ZipFile in an enumeration. + + + + You probably do not want to call GetEnumerator explicitly. Instead + it is implicitly called when you use a loop in C#, or a + For Each loop in VB.NET. + + + + This example reads a zipfile of a given name, then enumerates the + entries in that zip file, and displays the information about each + entry on the Console. + + using (ZipFile zip = ZipFile.Read(zipfile)) + { + bool header = true; + foreach (ZipEntry e in zip) + { + if (header) + { + System.Console.WriteLine("Zipfile: {0}", zip.Name); + System.Console.WriteLine("Version Needed: 0x{0:X2}", e.VersionNeeded); + System.Console.WriteLine("BitField: 0x{0:X2}", e.BitField); + System.Console.WriteLine("Compression Method: 0x{0:X2}", e.CompressionMethod); + System.Console.WriteLine("\n{1,-22} {2,-6} {3,4} {4,-8} {0}", + "Filename", "Modified", "Size", "Ratio", "Packed"); + System.Console.WriteLine(new System.String('-', 72)); + header = false; + } + + System.Console.WriteLine("{1,-22} {2,-6} {3,4:F0}% {4,-8} {0}", + e.FileName, + e.LastModified.ToString("yyyy-MM-dd HH:mm:ss"), + e.UncompressedSize, + e.CompressionRatio, + e.CompressedSize); + + e.Extract(); + } + } + + + + Dim ZipFileToExtract As String = "c:\foo.zip" + Using zip As ZipFile = ZipFile.Read(ZipFileToExtract) + Dim header As Boolean = True + Dim e As ZipEntry + For Each e In zip + If header Then + Console.WriteLine("Zipfile: {0}", zip.Name) + Console.WriteLine("Version Needed: 0x{0:X2}", e.VersionNeeded) + Console.WriteLine("BitField: 0x{0:X2}", e.BitField) + Console.WriteLine("Compression Method: 0x{0:X2}", e.CompressionMethod) + Console.WriteLine(ChrW(10) & "{1,-22} {2,-6} {3,4} {4,-8} {0}", _ + "Filename", "Modified", "Size", "Ratio", "Packed" ) + Console.WriteLine(New String("-"c, 72)) + header = False + End If + Console.WriteLine("{1,-22} {2,-6} {3,4:F0}% {4,-8} {0}", _ + e.FileName, _ + e.LastModified.ToString("yyyy-MM-dd HH:mm:ss"), _ + e.UncompressedSize, _ + e.CompressionRatio, _ + e.CompressedSize ) + e.Extract + Next + End Using + + + + A generic enumerator suitable for use within a foreach loop. + + + + An IEnumerator, for use of a ZipFile in a foreach construct. + + + + This method is included for COM support. An application generally does not call + this method directly. It is called implicitly by COM clients when enumerating + the entries in the ZipFile instance. In VBScript, this is done with a For Each + statement. In Javascript, this is done with new Enumerator(zipfile). + + + + The IEnumerator over the entries in the ZipFile. + + + + + Provides a human-readable string with information about the ZipFile. + + + + + The information string contains 10 lines or so, about each ZipEntry, + describing whether encryption is in use, the compressed and uncompressed + length of the entry, the offset of the entry, and so on. As a result the + information string can be very long for zip files that contain many + entries. + + + This information is mostly useful for diagnostic purposes. + + + + + + Indicates whether to perform a full scan of the zip file when reading it. + + + + + + You almost never want to use this property. + + + + When reading a zip file, if this flag is true (True in + VB), the entire zip archive will be scanned and searched for entries. + For large archives, this can take a very, long time. The much more + efficient default behavior is to read the zip directory, which is + stored at the end of the zip file. But, in some cases the directory is + corrupted and you need to perform a full scan of the zip file to + determine the contents of the zip file. This property lets you do + that, when necessary. + + + + This flag is effective only when calling . Normally you would read a ZipFile with the + static ZipFile.Read + method. But you can't set the FullScan property on the + ZipFile instance when you use a static factory method like + ZipFile.Read. + + + + + + + This example shows how to read a zip file using the full scan approach, + and then save it, thereby producing a corrected zip file. + + + using (var zip = new ZipFile()) + { + zip.FullScan = true; + zip.Initialize(zipFileName); + zip.Save(newName); + } + + + + Using zip As New ZipFile + zip.FullScan = True + zip.Initialize(zipFileName) + zip.Save(newName) + End Using + + + + + + + Whether to sort the ZipEntries before saving the file. + + + + The default is false. If you have a large number of zip entries, the sort + alone can consume significant time. + + + + + using (var zip = new ZipFile()) + { + zip.AddFiles(filesToAdd); + zip.SortEntriesBeforeSaving = true; + zip.Save(name); + } + + + + Using zip As New ZipFile + zip.AddFiles(filesToAdd) + zip.SortEntriesBeforeSaving = True + zip.Save(name) + End Using + + + + + + + Indicates whether NTFS Reparse Points, like junctions, should be + traversed during calls to AddDirectory(). + + + + By default, calls to AddDirectory() will traverse NTFS reparse + points, like mounted volumes, and directory junctions. An example + of a junction is the "My Music" directory in Windows Vista. In some + cases you may not want DotNetZip to traverse those directories. In + that case, set this property to false. + + + + + using (var zip = new ZipFile()) + { + zip.AddDirectoryWillTraverseReparsePoints = false; + zip.AddDirectory(dirToZip,"fodder"); + zip.Save(zipFileToCreate); + } + + + + + + Size of the IO buffer used while saving. + + + + + + First, let me say that you really don't need to bother with this. It is + here to allow for optimizations that you probably won't make! It will work + fine if you don't set or get this property at all. Ok? + + + + Now that we have that out of the way, the fine print: This + property affects the size of the buffer that is used for I/O for each + entry contained in the zip file. When a file is read in to be compressed, + it uses a buffer given by the size here. When you update a zip file, the + data for unmodified entries is copied from the first zip file to the + other, through a buffer given by the size here. + + + + Changing the buffer size affects a few things: first, for larger buffer + sizes, the memory used by the ZipFile, obviously, will be larger + during I/O operations. This may make operations faster for very much + larger files. Last, for any given entry, when you use a larger buffer + there will be fewer progress events during I/O operations, because there's + one progress event generated for each time the buffer is filled and then + emptied. + + + + The default buffer size is 8k. Increasing the buffer size may speed + things up as you compress larger files. But there are no hard-and-fast + rules here, eh? You won't know til you test it. And there will be a + limit where ever larger buffers actually slow things down. So as I said + in the beginning, it's probably best if you don't set or get this property + at all. + + + + + + This example shows how you might set a large buffer size for efficiency when + dealing with zip entries that are larger than 1gb. + + using (ZipFile zip = new ZipFile()) + { + zip.SaveProgress += this.zip1_SaveProgress; + zip.AddDirectory(directoryToZip, ""); + zip.UseZip64WhenSaving = Zip64Option.Always; + zip.BufferSize = 65536*8; // 65536 * 8 = 512k + zip.Save(ZipFileToCreate); + } + + + + + + Size of the work buffer to use for the ZLIB codec during compression. + + + + + When doing ZLIB or Deflate compression, the library fills a buffer, + then passes it to the compressor for compression. Then the library + reads out the compressed bytes. This happens repeatedly until there + is no more uncompressed data to compress. This property sets the + size of the buffer that will be used for chunk-wise compression. In + order for the setting to take effect, your application needs to set + this property before calling one of the ZipFile.Save() + overloads. + + + Setting this affects the performance and memory efficiency of + compression and decompression. For larger files, setting this to a + larger size may improve compression performance, but the exact + numbers vary depending on available memory, the size of the streams + you are compressing, and a bunch of other variables. I don't have + good firm recommendations on how to set it. You'll have to test it + yourself. Or just leave it alone and accept the default. + + + + + + Indicates whether extracted files should keep their paths as + stored in the zip archive. + + + + + This property affects Extraction. It is not used when creating zip + archives. + + + + With this property set to false, the default, extracting entries + from a zip file will create files in the filesystem that have the full + path associated to the entry within the zip file. With this property set + to true, extracting entries from the zip file results in files + with no path: the folders are "flattened." + + + + An example: suppose the zip file contains entries /directory1/file1.txt and + /directory2/file2.txt. With FlattenFoldersOnExtract set to false, + the files created will be \directory1\file1.txt and \directory2\file2.txt. + With the property set to true, the files created are file1.txt and file2.txt. + + + + + + + The compression strategy to use for all entries. + + + + Set the Strategy used by the ZLIB-compatible compressor, when + compressing entries using the DEFLATE method. Different compression + strategies work better on different sorts of data. The strategy + parameter can affect the compression ratio and the speed of + compression but not the correctness of the compresssion. For more + information see Ionic.Zlib.CompressionStrategy. + + + + + The name of the ZipFile, on disk. + + + + + + When the ZipFile instance was created by reading an archive using + one of the ZipFile.Read methods, this property represents the name + of the zip file that was read. When the ZipFile instance was + created by using the no-argument constructor, this value is null + (Nothing in VB). + + + + If you use the no-argument constructor, and you then explicitly set this + property, when you call , this name will + specify the name of the zip file created. Doing so is equivalent to + calling . When instantiating a + ZipFile by reading from a stream or byte array, the Name + property remains null. When saving to a stream, the Name + property is implicitly set to null. + + + + + + Sets the compression level to be used for entries subsequently added to + the zip archive. + + + + + Varying the compression level used on entries can affect the + size-vs-speed tradeoff when compression and decompressing data streams + or files. + + + + As with some other properties on the ZipFile class, like , , and , setting this property on a ZipFile + instance will cause the specified CompressionLevel to be used on all + items that are subsequently added to the + ZipFile instance. If you set this property after you have added + items to the ZipFile, but before you have called Save(), + those items will not use the specified compression level. + + + + If you do not set this property, the default compression level is used, + which normally gives a good balance of compression efficiency and + compression speed. In some tests, using BestCompression can + double the time it takes to compress, while delivering just a small + increase in compression efficiency. This behavior will vary with the + type of data you compress. If you are in doubt, just leave this setting + alone, and accept the default. + + + + + + The compression method for the zipfile. + + + + By default, the compression method is CompressionMethod.Deflate. + + + + + + + A comment attached to the zip archive. + + + + + + This property is read/write. It allows the application to specify a + comment for the ZipFile, or read the comment for the + ZipFile. After setting this property, changes are only made + permanent when you call a Save() method. + + + + According to PKWARE's + zip specification, the comment is not encrypted, even if there is a + password set on the zip file. + + + + The specification does not describe how to indicate the encoding used + on a comment string. Many "compliant" zip tools and libraries use + IBM437 as the code page for comments; DotNetZip, too, follows that + practice. On the other hand, there are situations where you want a + Comment to be encoded with something else, for example using code page + 950 "Big-5 Chinese". To fill that need, DotNetZip will encode the + comment following the same procedure it follows for encoding + filenames: (a) if is + Never, it uses the default encoding (IBM437). (b) if is Always, it always uses the + alternate encoding (). (c) if is AsNecessary, it uses the + alternate encoding only if the default encoding is not sufficient for + encoding the comment - in other words if decoding the result does not + produce the original string. This decision is taken at the time of + the call to ZipFile.Save(). + + + + When creating a zip archive using this library, it is possible to change + the value of between each + entry you add, and between adding entries and the call to + Save(). Don't do this. It will likely result in a zip file that is + not readable by any tool or application. For best interoperability, leave + alone, or specify it only + once, before adding any entries to the ZipFile instance. + + + + + + + Specifies whether the Creation, Access, and Modified times for entries + added to the zip file will be emitted in “Windows format” + when the zip archive is saved. + + + + + An application creating a zip archive can use this flag to explicitly + specify that the file times for the entries should or should not be stored + in the zip archive in the format used by Windows. By default this flag is + true, meaning the Windows-format times are stored in the zip + archive. + + + + When adding an entry from a file or directory, the Creation (), Access (), and Modified () times for the given entry are + automatically set from the filesystem values. When adding an entry from a + stream or string, all three values are implicitly set to + DateTime.Now. Applications can also explicitly set those times by + calling . + + + + PKWARE's + zip specification describes multiple ways to format these times in a + zip file. One is the format Windows applications normally use: 100ns ticks + since January 1, 1601 UTC. The other is a format Unix applications typically + use: seconds since January 1, 1970 UTC. Each format can be stored in an + "extra field" in the zip entry when saving the zip archive. The former + uses an extra field with a Header Id of 0x000A, while the latter uses a + header ID of 0x5455, although you probably don't need to know that. + + + + Not all tools and libraries can interpret these fields. Windows + compressed folders is one that can read the Windows Format timestamps, + while I believe the Infozip + tools can read the Unix format timestamps. Some tools and libraries + may be able to read only one or the other. DotNetZip can read or write + times in either or both formats. + + + + The times stored are taken from , , and . + + + + The value set here applies to all entries subsequently added to the + ZipFile. + + + + This property is not mutually exclusive of the property. It is possible and + legal and valid to produce a zip file that contains timestamps encoded in + the Unix format as well as in the Windows format, in addition to the LastModified time attached to each + entry in the archive, a time that is always stored in "DOS format". And, + notwithstanding the names PKWare uses for these time formats, any of them + can be read and written by any computer, on any operating system. But, + there are no guarantees that a program running on Mac or Linux will + gracefully handle a zip file with "Windows" formatted times, or that an + application that does not use DotNetZip but runs on Windows will be able to + handle file times in Unix format. + + + + When in doubt, test. Sorry, I haven't got a complete list of tools and + which sort of timestamps they can use and will tolerate. If you get any + good information and would like to pass it on, please do so and I will + include that information in this documentation. + + + + + This example shows how to save a zip file that contains file timestamps + in a format normally used by Unix. + + using (var zip = new ZipFile()) + { + // produce a zip file the Mac will like + zip.EmitTimesInWindowsFormatWhenSaving = false; + zip.EmitTimesInUnixFormatWhenSaving = true; + zip.AddDirectory(directoryToZip, "files"); + zip.Save(outputFile); + } + + + + Using zip As New ZipFile + '' produce a zip file the Mac will like + zip.EmitTimesInWindowsFormatWhenSaving = False + zip.EmitTimesInUnixFormatWhenSaving = True + zip.AddDirectory(directoryToZip, "files") + zip.Save(outputFile) + End Using + + + + + + + + + Specifies whether the Creation, Access, and Modified times + for entries added to the zip file will be emitted in "Unix(tm) + format" when the zip archive is saved. + + + + + An application creating a zip archive can use this flag to explicitly + specify that the file times for the entries should or should not be stored + in the zip archive in the format used by Unix. By default this flag is + false, meaning the Unix-format times are not stored in the zip + archive. + + + + When adding an entry from a file or directory, the Creation (), Access (), and Modified () times for the given entry are + automatically set from the filesystem values. When adding an entry from a + stream or string, all three values are implicitly set to DateTime.Now. + Applications can also explicitly set those times by calling . + + + + PKWARE's + zip specification describes multiple ways to format these times in a + zip file. One is the format Windows applications normally use: 100ns ticks + since January 1, 1601 UTC. The other is a format Unix applications + typically use: seconds since January 1, 1970 UTC. Each format can be + stored in an "extra field" in the zip entry when saving the zip + archive. The former uses an extra field with a Header Id of 0x000A, while + the latter uses a header ID of 0x5455, although you probably don't need to + know that. + + + + Not all tools and libraries can interpret these fields. Windows + compressed folders is one that can read the Windows Format timestamps, + while I believe the Infozip + tools can read the Unix format timestamps. Some tools and libraries may be + able to read only one or the other. DotNetZip can read or write times in + either or both formats. + + + + The times stored are taken from , , and . + + + + This property is not mutually exclusive of the property. It is possible and + legal and valid to produce a zip file that contains timestamps encoded in + the Unix format as well as in the Windows format, in addition to the LastModified time attached to each + entry in the zip archive, a time that is always stored in "DOS + format". And, notwithstanding the names PKWare uses for these time + formats, any of them can be read and written by any computer, on any + operating system. But, there are no guarantees that a program running on + Mac or Linux will gracefully handle a zip file with "Windows" formatted + times, or that an application that does not use DotNetZip but runs on + Windows will be able to handle file times in Unix format. + + + + When in doubt, test. Sorry, I haven't got a complete list of tools and + which sort of timestamps they can use and will tolerate. If you get any + good information and would like to pass it on, please do so and I will + include that information in this documentation. + + + + + + + + + Indicates whether verbose output is sent to the during AddXxx() and + ReadXxx() operations. + + + + This is a synthetic property. It returns true if the is non-null. + + + + + Indicates whether to perform case-sensitive matching on the filename when + retrieving entries in the zipfile via the string-based indexer. + + + + The default value is false, which means don't do case-sensitive + matching. In other words, retrieving zip["ReadMe.Txt"] is the same as + zip["readme.txt"]. It really makes sense to set this to true only + if you are not running on Windows, which has case-insensitive + filenames. But since this library is not built for non-Windows platforms, + in most cases you should just leave this property alone. + + + + + Indicates whether to encode entry filenames and entry comments using Unicode + (UTF-8). + + + + + The + PKWare zip specification provides for encoding file names and file + comments in either the IBM437 code page, or in UTF-8. This flag selects + the encoding according to that specification. By default, this flag is + false, and filenames and comments are encoded into the zip file in the + IBM437 codepage. Setting this flag to true will specify that filenames + and comments that cannot be encoded with IBM437 will be encoded with + UTF-8. + + + + Zip files created with strict adherence to the PKWare specification with + respect to UTF-8 encoding can contain entries with filenames containing + any combination of Unicode characters, including the full range of + characters from Chinese, Latin, Hebrew, Greek, Cyrillic, and many other + alphabets. However, because at this time, the UTF-8 portion of the PKWare + specification is not broadly supported by other zip libraries and + utilities, such zip files may not be readable by your favorite zip tool or + archiver. In other words, interoperability will decrease if you set this + flag to true. + + + + In particular, Zip files created with strict adherence to the PKWare + specification with respect to UTF-8 encoding will not work well with + Explorer in Windows XP or Windows Vista, because Windows compressed + folders, as far as I know, do not support UTF-8 in zip files. Vista can + read the zip files, but shows the filenames incorrectly. Unpacking from + Windows Vista Explorer will result in filenames that have rubbish + characters in place of the high-order UTF-8 bytes. + + + + Also, zip files that use UTF-8 encoding will not work well with Java + applications that use the java.util.zip classes, as of v5.0 of the Java + runtime. The Java runtime does not correctly implement the PKWare + specification in this regard. + + + + As a result, we have the unfortunate situation that "correct" behavior by + the DotNetZip library with regard to Unicode encoding of filenames during + zip creation will result in zip files that are readable by strictly + compliant and current tools (for example the most recent release of the + commercial WinZip tool); but these zip files will not be readable by + various other tools or libraries, including Windows Explorer. + + + + The DotNetZip library can read and write zip files with UTF8-encoded + entries, according to the PKware spec. If you use DotNetZip for both + creating and reading the zip file, and you use UTF-8, there will be no + loss of information in the filenames. For example, using a self-extractor + created by this library will allow you to unpack files correctly with no + loss of information in the filenames. + + + + If you do not set this flag, it will remain false. If this flag is false, + your ZipFile will encode all filenames and comments using the + IBM437 codepage. This can cause "loss of information" on some filenames, + but the resulting zipfile will be more interoperable with other + utilities. As an example of the loss of information, diacritics can be + lost. The o-tilde character will be down-coded to plain o. The c with a + cedilla (Unicode 0xE7) used in Portugese will be downcoded to a c. + Likewise, the O-stroke character (Unicode 248), used in Danish and + Norwegian, will be down-coded to plain o. Chinese characters cannot be + represented in codepage IBM437; when using the default encoding, Chinese + characters in filenames will be represented as ?. These are all examples + of "information loss". + + + + The loss of information associated to the use of the IBM437 encoding is + inconvenient, and can also lead to runtime errors. For example, using + IBM437, any sequence of 4 Chinese characters will be encoded as ????. If + your application creates a ZipFile, then adds two files, each with + names of four Chinese characters each, this will result in a duplicate + filename exception. In the case where you add a single file with a name + containing four Chinese characters, calling Extract() on the entry that + has question marks in the filename will result in an exception, because + the question mark is not legal for use within filenames on Windows. These + are just a few examples of the problems associated to loss of information. + + + + This flag is independent of the encoding of the content within the entries + in the zip file. Think of the zip file as a container - it supports an + encoding. Within the container are other "containers" - the file entries + themselves. The encoding within those entries is independent of the + encoding of the zip archive container for those entries. + + + + Rather than specify the encoding in a binary fashion using this flag, an + application can specify an arbitrary encoding via the property. Setting the encoding + explicitly when creating zip archives will result in non-compliant zip + files that, curiously, are fairly interoperable. The challenge is, the + PKWare specification does not provide for a way to specify that an entry + in a zip archive uses a code page that is neither IBM437 nor UTF-8. + Therefore if you set the encoding explicitly when creating a zip archive, + you must take care upon reading the zip archive to use the same code page. + If you get it wrong, the behavior is undefined and may result in incorrect + filenames, exceptions, stomach upset, hair loss, and acne. + + + + + + + Specify whether to use ZIP64 extensions when saving a zip archive. + + + + + + When creating a zip file, the default value for the property is . is + safest, in the sense that you will not get an Exception if a pre-ZIP64 + limit is exceeded. + + + + You may set the property at any time before calling Save(). + + + + When reading a zip file via the Zipfile.Read() method, DotNetZip + will properly read ZIP64-endowed zip archives, regardless of the value of + this property. DotNetZip will always read ZIP64 archives. This property + governs only whether DotNetZip will write them. Therefore, when updating + archives, be careful about setting this property after reading an archive + that may use ZIP64 extensions. + + + + An interesting question is, if you have set this property to + AsNecessary, and then successfully saved, does the resulting + archive use ZIP64 extensions or not? To learn this, check the property, after calling Save(). + + + + Have you thought about + donating? + + + + + + + + Indicates whether the archive requires ZIP64 extensions. + + + + + + This property is null (or Nothing in VB) if the archive has + not been saved, and there are fewer than 65334 ZipEntry items + contained in the archive. + + + + The Value is true if any of the following four conditions holds: + the uncompressed size of any entry is larger than 0xFFFFFFFF; the + compressed size of any entry is larger than 0xFFFFFFFF; the relative + offset of any entry within the zip archive is larger than 0xFFFFFFFF; or + there are more than 65534 entries in the archive. (0xFFFFFFFF = + 4,294,967,295). The result may not be known until a Save() is attempted + on the zip archive. The Value of this + property may be set only AFTER one of the Save() methods has been called. + + + + If none of the four conditions holds, and the archive has been saved, then + the Value is false. + + + + A Value of false does not indicate that the zip archive, as saved, + does not use ZIP64. It merely indicates that ZIP64 is not required. An + archive may use ZIP64 even when not required if the property is set to , or if the property is set to and the output stream was not + seekable. Use the property to determine if + the most recent Save() method resulted in an archive that utilized + the ZIP64 extensions. + + + + + + + + + Indicates whether the most recent Save() operation used ZIP64 extensions. + + + + + The use of ZIP64 extensions within an archive is not always necessary, and + for interoperability concerns, it may be desired to NOT use ZIP64 if + possible. The property can be + set to use ZIP64 extensions only when necessary. In those cases, + Sometimes applications want to know whether a Save() actually used ZIP64 + extensions. Applications can query this read-only property to learn + whether ZIP64 has been used in a just-saved ZipFile. + + + + The value is null (or Nothing in VB) if the archive has not + been saved. + + + + Non-null values (HasValue is true) indicate whether ZIP64 + extensions were used during the most recent Save() operation. The + ZIP64 extensions may have been used as required by any particular entry + because of its uncompressed or compressed size, or because the archive is + larger than 4294967295 bytes, or because there are more than 65534 entries + in the archive, or because the UseZip64WhenSaving property was set + to , or because the + UseZip64WhenSaving property was set to and the output stream was not seekable. + The value of this property does not indicate the reason the ZIP64 + extensions were used. + + + + + + + + + Indicates whether the most recent Read() operation read a zip file that uses + ZIP64 extensions. + + + + This property will return null (Nothing in VB) if you've added an entry after reading + the zip file. + + + + + The text encoding to use when writing new entries to the ZipFile, + for those entries that cannot be encoded with the default (IBM437) + encoding; or, the text encoding that was used when reading the entries + from the ZipFile. + + + + + In its + zip specification, PKWare describes two options for encoding + filenames and comments: using IBM437 or UTF-8. But, some archiving tools + or libraries do not follow the specification, and instead encode + characters using the system default code page. For example, WinRAR when + run on a machine in Shanghai may encode filenames with the Big-5 Chinese + (950) code page. This behavior is contrary to the Zip specification, but + it occurs anyway. + + + + When using DotNetZip to write zip archives that will be read by one of + these other archivers, set this property to specify the code page to use + when encoding the and for each ZipEntry in the zip file, for + values that cannot be encoded with the default codepage for zip files, + IBM437. This is why this property is "provisional". In all cases, IBM437 + is used where possible, in other words, where no loss of data would + result. It is possible, therefore, to have a given entry with a + Comment encoded in IBM437 and a FileName encoded with the + specified "provisional" codepage. + + + + Be aware that a zip file created after you've explicitly set the property to a value other than + IBM437 may not be compliant to the PKWare specification, and may not be + readable by compliant archivers. On the other hand, many (most?) + archivers are non-compliant and can read zip files created in arbitrary + code pages. The trick is to use or specify the proper codepage when + reading the zip. + + + + When creating a zip archive using this library, it is possible to change + the value of between each + entry you add, and between adding entries and the call to + Save(). Don't do this. It will likely result in a zipfile that is + not readable. For best interoperability, either leave alone, or specify it only once, + before adding any entries to the ZipFile instance. There is one + exception to this recommendation, described later. + + + + When using an arbitrary, non-UTF8 code page for encoding, there is no + standard way for the creator application - whether DotNetZip, WinZip, + WinRar, or something else - to formally specify in the zip file which + codepage has been used for the entries. As a result, readers of zip files + are not able to inspect the zip file and determine the codepage that was + used for the entries contained within it. It is left to the application + or user to determine the necessary codepage when reading zip files encoded + this way. In other words, if you explicitly specify the codepage when you + create the zipfile, you must explicitly specify the same codepage when + reading the zipfile. + + + + The way you specify the code page to use when reading a zip file varies + depending on the tool or library you use to read the zip. In DotNetZip, + you use a ZipFile.Read() method that accepts an encoding parameter. It + isn't possible with Windows Explorer, as far as I know, to specify an + explicit codepage to use when reading a zip. If you use an incorrect + codepage when reading a zipfile, you will get entries with filenames that + are incorrect, and the incorrect filenames may even contain characters + that are not legal for use within filenames in Windows. Extracting entries + with illegal characters in the filenames will lead to exceptions. It's too + bad, but this is just the way things are with code pages in zip + files. Caveat Emptor. + + + + Example: Suppose you create a zipfile that contains entries with + filenames that have Danish characters. If you use equal to "iso-8859-1" (cp 28591), + the filenames will be correctly encoded in the zip. But, to read that + zipfile correctly, you have to specify the same codepage at the time you + read it. If try to read that zip file with Windows Explorer or another + application that is not flexible with respect to the codepage used to + decode filenames in zipfiles, you will get a filename like "Inf°.txt". + + + + When using DotNetZip to read a zip archive, and the zip archive uses an + arbitrary code page, you must specify the encoding to use before or when + the Zipfile is READ. This means you must use a ZipFile.Read() + method that allows you to specify a System.Text.Encoding parameter. Setting + the ProvisionalAlternateEncoding property after your application has read in + the zip archive will not affect the entry names of entries that have already + been read in. + + + + And now, the exception to the rule described above. One strategy for + specifying the code page for a given zip file is to describe the code page + in a human-readable form in the Zip comment. For example, the comment may + read "Entries in this archive are encoded in the Big5 code page". For + maximum interoperability, the zip comment in this case should be encoded + in the default, IBM437 code page. In this case, the zip comment is + encoded using a different page than the filenames. To do this, Specify + ProvisionalAlternateEncoding to your desired region-specific code + page, once before adding any entries, and then reset + ProvisionalAlternateEncoding to IBM437 before setting the property and calling Save(). + + + + + This example shows how to read a zip file using the Big-5 Chinese code page + (950), and extract each entry in the zip file. For this code to work as + desired, the Zipfile must have been created using the big5 code page + (CP950). This is typical, for example, when using WinRar on a machine with + CP950 set as the default code page. In that case, the names of entries + within the Zip archive will be stored in that code page, and reading the zip + archive must be done using that code page. If the application did not use + the correct code page in ZipFile.Read(), then names of entries within the + zip archive would not be correctly retrieved. + + using (var zip = ZipFile.Read(zipFileName, System.Text.Encoding.GetEncoding("big5"))) + { + // retrieve and extract an entry using a name encoded with CP950 + zip[MyDesiredEntry].Extract("unpack"); + } + + + + Using zip As ZipFile = ZipFile.Read(ZipToExtract, System.Text.Encoding.GetEncoding("big5")) + ' retrieve and extract an entry using a name encoded with CP950 + zip(MyDesiredEntry).Extract("unpack") + End Using + + + + DefaultEncoding + + + + A Text Encoding to use when encoding the filenames and comments for + all the ZipEntry items, during a ZipFile.Save() operation. + + + + Whether the encoding specified here is used during the save depends + on . + + + + + + A flag that tells if and when this instance should apply + AlternateEncoding to encode the filenames and comments associated to + of ZipEntry objects contained within this instance. + + + + + The default text encoding used in zip archives. It is numeric 437, also + known as IBM437. + + + + + + Gets or sets the TextWriter to which status messages are delivered + for the instance. + + + + If the TextWriter is set to a non-null value, then verbose output is sent + to the TextWriter during Add, Read, Save and + Extract operations. Typically, console applications might use + Console.Out and graphical or headless applications might use a + System.IO.StringWriter. The output of this is suitable for viewing + by humans. + + + + + In this example, a console application instantiates a ZipFile, then + sets the StatusMessageTextWriter to Console.Out. At that + point, all verbose status messages for that ZipFile are sent to the + console. + + + + using (ZipFile zip= ZipFile.Read(FilePath)) + { + zip.StatusMessageTextWriter= System.Console.Out; + // messages are sent to the console during extraction + zip.ExtractAll(); + } + + + + Using zip As ZipFile = ZipFile.Read(FilePath) + zip.StatusMessageTextWriter= System.Console.Out + 'Status Messages will be sent to the console during extraction + zip.ExtractAll() + End Using + + + + In this example, a Windows Forms application instantiates a + ZipFile, then sets the StatusMessageTextWriter to a + StringWriter. At that point, all verbose status messages for that + ZipFile are sent to the StringWriter. + + + + var sw = new System.IO.StringWriter(); + using (ZipFile zip= ZipFile.Read(FilePath)) + { + zip.StatusMessageTextWriter= sw; + zip.ExtractAll(); + } + Console.WriteLine("{0}", sw.ToString()); + + + + Dim sw as New System.IO.StringWriter + Using zip As ZipFile = ZipFile.Read(FilePath) + zip.StatusMessageTextWriter= sw + zip.ExtractAll() + End Using + 'Status Messages are now available in sw + + + + + + + Gets or sets the name for the folder to store the temporary file + this library writes when saving a zip archive. + + + + + This library will create a temporary file when saving a Zip archive to a + file. This file is written when calling one of the Save() methods + that does not save to a stream, or one of the SaveSelfExtractor() + methods. + + + + By default, the library will create the temporary file in the directory + specified for the file itself, via the property or via + the method. + + + + Setting this property allows applications to override this default + behavior, so that the library will create the temporary file in the + specified folder. For example, to have the library create the temporary + file in the current working directory, regardless where the ZipFile + is saved, specfy ".". To revert to the default behavior, set this + property to null (Nothing in VB). + + + + When setting the property to a non-null value, the folder specified must + exist; if it does not an exception is thrown. The application should have + write and delete permissions on the folder. The permissions are not + explicitly checked ahead of time; if the application does not have the + appropriate rights, an exception will be thrown at the time Save() + is called. + + + + There is no temporary file created when reading a zip archive. When + saving to a Stream, there is no temporary file created. For example, if + the application is an ASP.NET application and calls Save() + specifying the Response.OutputStream as the output stream, there is + no temporary file created. + + + + + Thrown when setting the property if the directory does not exist. + + + + + + Sets the password to be used on the ZipFile instance. + + + + + + When writing a zip archive, this password is applied to the entries, not + to the zip archive itself. It applies to any ZipEntry subsequently + added to the ZipFile, using one of the AddFile, + AddDirectory, AddEntry, or AddItem methods, etc. + When reading a zip archive, this property applies to any entry + subsequently extracted from the ZipFile using one of the Extract + methods on the ZipFile class. + + + + When writing a zip archive, keep this in mind: though the password is set + on the ZipFile object, according to the Zip spec, the "directory" of the + archive - in other words the list of entries or files contained in the archive - is + not encrypted with the password, or protected in any way. If you set the + Password property, the password actually applies to individual entries + that are added to the archive, subsequent to the setting of this property. + The list of filenames in the archive that is eventually created will + appear in clear text, but the contents of the individual files are + encrypted. This is how Zip encryption works. + + + + One simple way around this limitation is to simply double-wrap sensitive + filenames: Store the files in a zip file, and then store that zip file + within a second, "outer" zip file. If you apply a password to the outer + zip file, then readers will be able to see that the outer zip file + contains an inner zip file. But readers will not be able to read the + directory or file list of the inner zip file. + + + + If you set the password on the ZipFile, and then add a set of files + to the archive, then each entry is encrypted with that password. You may + also want to change the password between adding different entries. If you + set the password, add an entry, then set the password to null + (Nothing in VB), and add another entry, the first entry is + encrypted and the second is not. If you call AddFile(), then set + the Password property, then call ZipFile.Save, the file + added will not be password-protected, and no warning will be generated. + + + + When setting the Password, you may also want to explicitly set the property, to specify how to encrypt the entries added + to the ZipFile. If you set the Password to a non-null value and do not + set , then PKZip 2.0 ("Weak") encryption is used. + This encryption is relatively weak but is very interoperable. If you set + the password to a null value (Nothing in VB), Encryption is + reset to None. + + + + All of the preceding applies to writing zip archives, in other words when + you use one of the Save methods. To use this property when reading or an + existing ZipFile, do the following: set the Password property on the + ZipFile, then call one of the Extract() overloads on the . In this case, the entry is extracted using the + Password that is specified on the ZipFile instance. If you + have not set the Password property, then the password is + null, and the entry is extracted with no password. + + + + If you set the Password property on the ZipFile, then call + Extract() an entry that has not been encrypted with a password, the + password is not used for that entry, and the ZipEntry is extracted + as normal. In other words, the password is used only if necessary. + + + + The class also has a Password property. It takes precedence + over this property on the ZipFile. Typically, you would use the + per-entry Password when most entries in the zip archive use one password, + and a few entries use a different password. If all entries in the zip + file use the same password, then it is simpler to just set this property + on the ZipFile itself, whether creating a zip archive or extracting + a zip archive. + + + + + + + This example creates a zip file, using password protection for the + entries, and then extracts the entries from the zip file. When creating + the zip file, the Readme.txt file is not protected with a password, but + the other two are password-protected as they are saved. During extraction, + each file is extracted with the appropriate password. + + + // create a file with encryption + using (ZipFile zip = new ZipFile()) + { + zip.AddFile("ReadMe.txt"); + zip.Password= "!Secret1"; + zip.AddFile("MapToTheSite-7440-N49th.png"); + zip.AddFile("2008-Regional-Sales-Report.pdf"); + zip.Save("EncryptedArchive.zip"); + } + + // extract entries that use encryption + using (ZipFile zip = ZipFile.Read("EncryptedArchive.zip")) + { + zip.Password= "!Secret1"; + zip.ExtractAll("extractDir"); + } + + + + + Using zip As New ZipFile + zip.AddFile("ReadMe.txt") + zip.Password = "123456!" + zip.AddFile("MapToTheSite-7440-N49th.png") + zip.Password= "!Secret1"; + zip.AddFile("2008-Regional-Sales-Report.pdf") + zip.Save("EncryptedArchive.zip") + End Using + + + ' extract entries that use encryption + Using (zip as ZipFile = ZipFile.Read("EncryptedArchive.zip")) + zip.Password= "!Secret1" + zip.ExtractAll("extractDir") + End Using + + + + + + ZipFile.Encryption + ZipEntry.Password + + + + The action the library should take when extracting a file that already + exists. + + + + + This property affects the behavior of the Extract methods (one of the + Extract() or ExtractWithPassword() overloads), when + extraction would would overwrite an existing filesystem file. If you do + not set this property, the library throws an exception when extracting an + entry would overwrite an existing file. + + + + This property has no effect when extracting to a stream, or when the file + to be extracted does not already exist. + + + + + + + The action the library should take when an error is encountered while + opening or reading files as they are saved into a zip archive. + + + + + Errors can occur as a file is being saved to the zip archive. For + example, the File.Open may fail, or a File.Read may fail, because of + lock conflicts or other reasons. + + + + The first problem might occur after having called AddDirectory() on a + directory that contains a Clipper .dbf file; the file is locked by + Clipper and cannot be opened for read by another process. An example of + the second problem might occur when trying to zip a .pst file that is in + use by Microsoft Outlook. Outlook locks a range on the file, which allows + other processes to open the file, but not read it in its entirety. + + + + This property tells DotNetZip what you would like to do in the case of + these errors. The primary options are: ZipErrorAction.Throw to + throw an exception (this is the default behavior if you don't set this + property); ZipErrorAction.Skip to Skip the file for which there + was an error and continue saving; ZipErrorAction.Retry to Retry + the entry that caused the problem; or + ZipErrorAction.InvokeErrorEvent to invoke an event handler. + + + + This property is implicitly set to ZipErrorAction.InvokeErrorEvent + if you add a handler to the event. If you set + this property to something other than + ZipErrorAction.InvokeErrorEvent, then the ZipError + event is implicitly cleared. What it means is you can set one or the + other (or neither), depending on what you want, but you never need to set + both. + + + + As with some other properties on the ZipFile class, like , , and , setting this property on a ZipFile + instance will cause the specified ZipErrorAction to be used on all + items that are subsequently added to the + ZipFile instance. If you set this property after you have added + items to the ZipFile, but before you have called Save(), + those items will not use the specified error handling action. + + + + If you want to handle any errors that occur with any entry in the zip + file in the same way, then set this property once, before adding any + entries to the zip archive. + + + + If you set this property to ZipErrorAction.Skip and you'd like to + learn which files may have been skipped after a Save(), you can + set the on the ZipFile before + calling Save(). A message will be emitted into that writer for + each skipped file, if any. + + + + + + This example shows how to tell DotNetZip to skip any files for which an + error is generated during the Save(). + + Public Sub SaveZipFile() + Dim SourceFolder As String = "fodder" + Dim DestFile As String = "eHandler.zip" + Dim sw as New StringWriter + Using zipArchive As ZipFile = New ZipFile + ' Tell DotNetZip to skip any files for which it encounters an error + zipArchive.ZipErrorAction = ZipErrorAction.Skip + zipArchive.StatusMessageTextWriter = sw + zipArchive.AddDirectory(SourceFolder) + zipArchive.Save(DestFile) + End Using + ' examine sw here to see any messages + End Sub + + + + + + + + + + The Encryption to use for entries added to the ZipFile. + + + + + Set this when creating a zip archive, or when updating a zip archive. The + specified Encryption is applied to the entries subsequently added to the + ZipFile instance. Applications do not need to set the + Encryption property when reading or extracting a zip archive. + + + + If you set this to something other than EncryptionAlgorithm.None, you + will also need to set the . + + + + As with some other properties on the ZipFile class, like and , setting this + property on a ZipFile instance will cause the specified + EncryptionAlgorithm to be used on all items + that are subsequently added to the ZipFile instance. In other + words, if you set this property after you have added items to the + ZipFile, but before you have called Save(), those items will + not be encrypted or protected with a password in the resulting zip + archive. To get a zip archive with encrypted entries, set this property, + along with the property, before calling + AddFile, AddItem, or AddDirectory (etc.) on the + ZipFile instance. + + + + If you read a ZipFile, you can modify the Encryption on an + encrypted entry, only by setting the Encryption property on the + ZipEntry itself. Setting the Encryption property on the + ZipFile, once it has been created via a call to + ZipFile.Read(), does not affect entries that were previously read. + + + + For example, suppose you read a ZipFile, and there is an encrypted + entry. Setting the Encryption property on that ZipFile and + then calling Save() on the ZipFile does not update the + Encryption used for the entries in the archive. Neither is an + exception thrown. Instead, what happens during the Save() is that + all previously existing entries are copied through to the new zip archive, + with whatever encryption and password that was used when originally + creating the zip archive. Upon re-reading that archive, to extract + entries, applications should use the original password or passwords, if + any. + + + + Suppose an application reads a ZipFile, and there is an encrypted + entry. Setting the Encryption property on that ZipFile and + then adding new entries (via AddFile(), AddEntry(), etc) + and then calling Save() on the ZipFile does not update the + Encryption on any of the entries that had previously been in the + ZipFile. The Encryption property applies only to the + newly-added entries. + + + + + + + This example creates a zip archive that uses encryption, and then extracts + entries from the archive. When creating the zip archive, the ReadMe.txt + file is zipped without using a password or encryption. The other files + use encryption. + + + + // Create a zip archive with AES Encryption. + using (ZipFile zip = new ZipFile()) + { + zip.AddFile("ReadMe.txt"); + zip.Encryption= EncryptionAlgorithm.WinZipAes256; + zip.Password= "Top.Secret.No.Peeking!"; + zip.AddFile("7440-N49th.png"); + zip.AddFile("2008-Regional-Sales-Report.pdf"); + zip.Save("EncryptedArchive.zip"); + } + + // Extract a zip archive that uses AES Encryption. + // You do not need to specify the algorithm during extraction. + using (ZipFile zip = ZipFile.Read("EncryptedArchive.zip")) + { + zip.Password= "Top.Secret.No.Peeking!"; + zip.ExtractAll("extractDirectory"); + } + + + + ' Create a zip that uses Encryption. + Using zip As New ZipFile() + zip.Encryption= EncryptionAlgorithm.WinZipAes256 + zip.Password= "Top.Secret.No.Peeking!" + zip.AddFile("ReadMe.txt") + zip.AddFile("7440-N49th.png") + zip.AddFile("2008-Regional-Sales-Report.pdf") + zip.Save("EncryptedArchive.zip") + End Using + + ' Extract a zip archive that uses AES Encryption. + ' You do not need to specify the algorithm during extraction. + Using (zip as ZipFile = ZipFile.Read("EncryptedArchive.zip")) + zip.Password= "Top.Secret.No.Peeking!" + zip.ExtractAll("extractDirectory") + End Using + + + + + ZipFile.Password + ZipEntry.Encryption + + + + A callback that allows the application to specify the compression level + to use for entries subsequently added to the zip archive. + + + + + + With this callback, the DotNetZip library allows the application to + determine whether compression will be used, at the time of the + Save. This may be useful if the application wants to favor + speed over size, and wants to defer the decision until the time of + Save. + + + + Typically applications set the property on + the ZipFile or on each ZipEntry to determine the level of + compression used. This is done at the time the entry is added to the + ZipFile. Setting the property to + Ionic.Zlib.CompressionLevel.None means no compression will be used. + + + + This callback allows the application to defer the decision on the + CompressionLevel to use, until the time of the call to + ZipFile.Save(). The callback is invoked once per ZipEntry, + at the time the data for the entry is being written out as part of a + Save() operation. The application can use whatever criteria it + likes in determining the level to return. For example, an application may + wish that no .mp3 files should be compressed, because they are already + compressed and the extra compression is not worth the CPU time incurred, + and so can return None for all .mp3 entries. + + + + The library determines whether compression will be attempted for an entry + this way: If the entry is a zero length file, or a directory, no + compression is used. Otherwise, if this callback is set, it is invoked + and the CompressionLevel is set to the return value. If this + callback has not been set, then the previously set value for + CompressionLevel is used. + + + + + + + The maximum size of an output segment, when saving a split Zip file. + + + + Set this to a non-zero value before calling or to specify that the ZipFile should be saved as a + split archive, also sometimes called a spanned archive. Some also + call them multi-file archives. + + + + A split zip archive is saved in a set of discrete filesystem files, + rather than in a single file. This is handy when transmitting the + archive in email or some other mechanism that has a limit to the size of + each file. The first file in a split archive will be named + basename.z01, the second will be named basename.z02, and + so on. The final file is named basename.zip. According to the zip + specification from PKWare, the minimum value is 65536, for a 64k segment + size. The maximum number of segments allows in a split archive is 99. + + + + The value of this property determines the maximum size of a split + segment when writing a split archive. For example, suppose you have a + ZipFile that would save to a single file of 200k. If you set the + MaxOutputSegmentSize to 65536 before calling Save(), you + will get four distinct output files. On the other hand if you set this + property to 256k, then you will get a single-file archive for that + ZipFile. + + + + The size of each split output file will be as large as possible, up to + the maximum size set here. The zip specification requires that some data + fields in a zip archive may not span a split boundary, and an output + segment may be smaller than the maximum if necessary to avoid that + problem. Also, obviously the final segment of the archive may be smaller + than the maximum segment size. Segments will never be larger than the + value set with this property. + + + + You can save a split Zip file only when saving to a regular filesystem + file. It's not possible to save a split zip file as a self-extracting + archive, nor is it possible to save a split zip file to a stream. When + saving to a SFX or to a Stream, this property is ignored. + + + + About interoperability: Split or spanned zip files produced by DotNetZip + can be read by WinZip or PKZip, and vice-versa. Segmented zip files may + not be readable by other tools, if those other tools don't support zip + spanning or splitting. When in doubt, test. I don't believe Windows + Explorer can extract a split archive. + + + + This property has no effect when reading a split archive. You can read + a split archive in the normal way with DotNetZip. + + + + When saving a zip file, if you want a regular zip file rather than a + split zip file, don't set this property, or set it to Zero. + + + + If you read a split archive, with and + then subsequently call ZipFile.Save(), unless you set this + property before calling Save(), you will get a normal, + single-file archive. + + + + + + + + Returns the number of segments used in the most recent Save() operation. + + + + This is normally zero, unless you have set the property. If you have set , and then you save a file, after the call to + Save() completes, you can read this value to learn the number of segments that + were created. + + + If you call Save("Archive.zip"), and it creates 5 segments, then you + will have filesystem files named Archive.z01, Archive.z02, Archive.z03, + Archive.z04, and Archive.zip, and the value of this property will be 5. + + + + + + + The size threshold for an entry, above which a parallel deflate is used. + + + + + + DotNetZip will use multiple threads to compress any ZipEntry, + if the entry is larger than the given size. Zero means "always + use parallel deflate", while -1 means "never use parallel + deflate". The default value for this property is 512k. Aside + from the special values of 0 and 1, the minimum value is 65536. + + + + If the entry size cannot be known before compression, as with a + read-forward stream, then Parallel deflate will never be + performed, unless the value of this property is zero. + + + + A parallel deflate operations will speed up the compression of + large files, on computers with multiple CPUs or multiple CPU + cores. For files above 1mb, on a dual core or dual-cpu (2p) + machine, the time required to compress the file can be 70% of the + single-threaded deflate. For very large files on 4p machines the + compression can be done in 30% of the normal time. The downside + is that parallel deflate consumes extra memory during the deflate, + and the deflation is not as effective. + + + + Parallel deflate tends to yield slightly less compression when + compared to as single-threaded deflate; this is because the original + data stream is split into multiple independent buffers, each of which + is compressed in parallel. But because they are treated + independently, there is no opportunity to share compression + dictionaries. For that reason, a deflated stream may be slightly + larger when compressed using parallel deflate, as compared to a + traditional single-threaded deflate. Sometimes the increase over the + normal deflate is as much as 5% of the total compressed size. For + larger files it can be as small as 0.1%. + + + + Multi-threaded compression does not give as much an advantage when + using Encryption. This is primarily because encryption tends to slow + down the entire pipeline. Also, multi-threaded compression gives less + of an advantage when using lower compression levels, for example . You may have to + perform some tests to determine the best approach for your situation. + + + + + + + + + + The maximum number of buffer pairs to use when performing + parallel compression. + + + + + This property sets an upper limit on the number of memory + buffer pairs to create when performing parallel + compression. The implementation of the parallel + compression stream allocates multiple buffers to + facilitate parallel compression. As each buffer fills up, + the stream uses + ThreadPool.QueueUserWorkItem() to compress those + buffers in a background threadpool thread. After a buffer + is compressed, it is re-ordered and written to the output + stream. + + + + A higher number of buffer pairs enables a higher degree of + parallelism, which tends to increase the speed of compression on + multi-cpu computers. On the other hand, a higher number of buffer + pairs also implies a larger memory consumption, more active worker + threads, and a higher cpu utilization for any compression. This + property enables the application to limit its memory consumption and + CPU utilization behavior depending on requirements. + + + + For each compression "task" that occurs in parallel, there are 2 + buffers allocated: one for input and one for output. This property + sets a limit for the number of pairs. The total amount of storage + space allocated for buffering will then be (N*S*2), where N is the + number of buffer pairs, S is the size of each buffer (). By default, DotNetZip allocates 4 buffer + pairs per CPU core, so if your machine has 4 cores, and you retain + the default buffer size of 128k, then the + ParallelDeflateOutputStream will use 4 * 4 * 2 * 128kb of buffer + memory in total, or 4mb, in blocks of 128kb. If you then set this + property to 8, then the number will be 8 * 2 * 128kb of buffer + memory, or 2mb. + + + + CPU utilization will also go up with additional buffers, because a + larger number of buffer pairs allows a larger number of background + threads to compress in parallel. If you find that parallel + compression is consuming too much memory or CPU, you can adjust this + value downward. + + + + The default value is 16. Different values may deliver better or + worse results, depending on your priorities and the dynamic + performance characteristics of your storage and compute resources. + + + + This property is not the number of buffer pairs to use; it is an + upper limit. An illustration: Suppose you have an application that + uses the default value of this property (which is 16), and it runs + on a machine with 2 CPU cores. In that case, DotNetZip will allocate + 4 buffer pairs per CPU core, for a total of 8 pairs. The upper + limit specified by this property has no effect. + + + + The application can set this value at any time + before calling ZipFile.Save(). + + + + + + + + + Returns the version number on the DotNetZip assembly. + + + + + This property is exposed as a convenience. Callers could also get the + version value by retrieving GetName().Version on the + System.Reflection.Assembly object pointing to the DotNetZip + assembly. But sometimes it is not clear which assembly is being loaded. + This property makes it clear. + + + This static property is primarily useful for diagnostic purposes. + + + + + + This is an integer indexer into the Zip archive. + + + + + This property is read-only. + + + + Internally, the ZipEntry instances that belong to the + ZipFile are stored in a Dictionary. When you use this + indexer the first time, it creates a read-only + List<ZipEntry> from the Dictionary.Values Collection. + If at any time you modify the set of entries in the ZipFile, + either by adding an entry, removing an entry, or renaming an + entry, a new List will be created, and the numeric indexes for the + remaining entries may be different. + + + + This means you cannot rename any ZipEntry from + inside an enumeration of the zip file. + + + + The index value. + + + + + + The ZipEntry within the Zip archive at the specified index. If the + entry does not exist in the archive, this indexer throws. + + + + + + This is a name-based indexer into the Zip archive. + + + + + This property is read-only. + + + + The property on the ZipFile + determines whether retrieval via this indexer is done via case-sensitive + comparisons. By default, retrieval is not case sensitive. This makes + sense on Windows, in which filesystems are not case sensitive. + + + + Regardless of case-sensitivity, it is not always the case that + this[value].FileName == value. In other words, the FileName + property of the ZipEntry retrieved with this indexer, may or may + not be equal to the index value. + + + + This is because DotNetZip performs a normalization of filenames passed to + this indexer, before attempting to retrieve the item. That normalization + includes: removal of a volume letter and colon, swapping backward slashes + for forward slashes. So, zip["dir1\\entry1.txt"].FileName == + "dir1/entry.txt". + + + + Directory entries in the zip file may be retrieved via this indexer only + with names that have a trailing slash. DotNetZip automatically appends a + trailing slash to the names of any directory entries added to a zip. + + + + + + This example extracts only the entries in a zip file that are .txt files. + + using (ZipFile zip = ZipFile.Read("PackedDocuments.zip")) + { + foreach (string s1 in zip.EntryFilenames) + { + if (s1.EndsWith(".txt")) + zip[s1].Extract("textfiles"); + } + } + + + Using zip As ZipFile = ZipFile.Read("PackedDocuments.zip") + Dim s1 As String + For Each s1 In zip.EntryFilenames + If s1.EndsWith(".txt") Then + zip(s1).Extract("textfiles") + End If + Next + End Using + + + + + + Thrown if the caller attempts to assign a non-null value to the indexer. + + + + The name of the file, including any directory path, to retrieve from the + zip. The filename match is not case-sensitive by default; you can use the + property to change this behavior. The + pathname can use forward-slashes or backward slashes. + + + + The ZipEntry within the Zip archive, given by the specified + filename. If the named entry does not exist in the archive, this indexer + returns null (Nothing in VB). + + + + + + The list of filenames for the entries contained within the zip archive. + + + + According to the ZIP specification, the names of the entries use forward + slashes in pathnames. If you are scanning through the list, you may have + to swap forward slashes for backslashes. + + + + + + This example shows one way to test if a filename is already contained + within a zip archive. + + String zipFileToRead= "PackedDocuments.zip"; + string candidate = "DatedMaterial.xps"; + using (ZipFile zip = new ZipFile(zipFileToRead)) + { + if (zip.EntryFilenames.Contains(candidate)) + Console.WriteLine("The file '{0}' exists in the zip archive '{1}'", + candidate, + zipFileName); + else + Console.WriteLine("The file, '{0}', does not exist in the zip archive '{1}'", + candidate, + zipFileName); + Console.WriteLine(); + } + + + Dim zipFileToRead As String = "PackedDocuments.zip" + Dim candidate As String = "DatedMaterial.xps" + Using zip As ZipFile.Read(ZipFileToRead) + If zip.EntryFilenames.Contains(candidate) Then + Console.WriteLine("The file '{0}' exists in the zip archive '{1}'", _ + candidate, _ + zipFileName) + Else + Console.WriteLine("The file, '{0}', does not exist in the zip archive '{1}'", _ + candidate, _ + zipFileName) + End If + Console.WriteLine + End Using + + + + + The list of strings for the filenames contained within the Zip archive. + + + + + + Returns the readonly collection of entries in the Zip archive. + + + + + + If there are no entries in the current ZipFile, the value returned is a + non-null zero-element collection. If there are entries in the zip file, + the elements are returned in no particular order. + + + This is the implied enumerator on the ZipFile class. If you use a + ZipFile instance in a context that expects an enumerator, you will + get this collection. + + + + + + + Returns a readonly collection of entries in the Zip archive, sorted by FileName. + + + + If there are no entries in the current ZipFile, the value returned + is a non-null zero-element collection. If there are entries in the zip + file, the elements are returned sorted by the name of the entry. + + + + + This example fills a Windows Forms ListView with the entries in a zip file. + + + using (ZipFile zip = ZipFile.Read(zipFile)) + { + foreach (ZipEntry entry in zip.EntriesSorted) + { + ListViewItem item = new ListViewItem(n.ToString()); + n++; + string[] subitems = new string[] { + entry.FileName.Replace("/","\\"), + entry.LastModified.ToString("yyyy-MM-dd HH:mm:ss"), + entry.UncompressedSize.ToString(), + String.Format("{0,5:F0}%", entry.CompressionRatio), + entry.CompressedSize.ToString(), + (entry.UsesEncryption) ? "Y" : "N", + String.Format("{0:X8}", entry.Crc)}; + + foreach (String s in subitems) + { + ListViewItem.ListViewSubItem subitem = new ListViewItem.ListViewSubItem(); + subitem.Text = s; + item.SubItems.Add(subitem); + } + + this.listView1.Items.Add(item); + } + } + + + + + + + + Returns the number of entries in the Zip archive. + + + + + An event handler invoked when a Save() starts, before and after each + entry has been written to the archive, when a Save() completes, and + during other Save events. + + + + + Depending on the particular event, different properties on the parameter are set. The following + table summarizes the available EventTypes and the conditions under + which this event handler is invoked with a + SaveProgressEventArgs with the given EventType. + + + + + value of EntryType + Meaning and conditions + + + + ZipProgressEventType.Saving_Started + Fired when ZipFile.Save() begins. + + + + + ZipProgressEventType.Saving_BeforeSaveEntry + + Fired within ZipFile.Save(), just before writing data for each + particular entry. + + + + + ZipProgressEventType.Saving_AfterSaveEntry + + Fired within ZipFile.Save(), just after having finished writing data + for each particular entry. + + + + + ZipProgressEventType.Saving_Completed + Fired when ZipFile.Save() has completed. + + + + + ZipProgressEventType.Saving_AfterSaveTempArchive + + Fired after the temporary file has been created. This happens only + when saving to a disk file. This event will not be invoked when + saving to a stream. + + + + + ZipProgressEventType.Saving_BeforeRenameTempArchive + + Fired just before renaming the temporary file to the permanent + location. This happens only when saving to a disk file. This event + will not be invoked when saving to a stream. + + + + + ZipProgressEventType.Saving_AfterRenameTempArchive + + Fired just after renaming the temporary file to the permanent + location. This happens only when saving to a disk file. This event + will not be invoked when saving to a stream. + + + + + ZipProgressEventType.Saving_AfterCompileSelfExtractor + + Fired after a self-extracting archive has finished compiling. This + EventType is used only within SaveSelfExtractor(). + + + + + ZipProgressEventType.Saving_BytesRead + + Set during the save of a particular entry, to update progress of the + Save(). When this EventType is set, the BytesTransferred is the + number of bytes that have been read from the source stream. The + TotalBytesToTransfer is the number of bytes in the uncompressed + file. + + + + + + + + + This example uses an anonymous method to handle the + SaveProgress event, by updating a progress bar. + + + progressBar1.Value = 0; + progressBar1.Max = listbox1.Items.Count; + using (ZipFile zip = new ZipFile()) + { + // listbox1 contains a list of filenames + zip.AddFiles(listbox1.Items); + + // do the progress bar: + zip.SaveProgress += (sender, e) => { + if (e.EventType == ZipProgressEventType.Saving_BeforeWriteEntry) { + progressBar1.PerformStep(); + } + }; + + zip.Save(fs); + } + + + + + This example uses a named method as the + SaveProgress event handler, to update the user, in a + console-based application. + + + static bool justHadByteUpdate= false; + public static void SaveProgress(object sender, SaveProgressEventArgs e) + { + if (e.EventType == ZipProgressEventType.Saving_Started) + Console.WriteLine("Saving: {0}", e.ArchiveName); + + else if (e.EventType == ZipProgressEventType.Saving_Completed) + { + justHadByteUpdate= false; + Console.WriteLine(); + Console.WriteLine("Done: {0}", e.ArchiveName); + } + + else if (e.EventType == ZipProgressEventType.Saving_BeforeWriteEntry) + { + if (justHadByteUpdate) + Console.WriteLine(); + Console.WriteLine(" Writing: {0} ({1}/{2})", + e.CurrentEntry.FileName, e.EntriesSaved, e.EntriesTotal); + justHadByteUpdate= false; + } + + else if (e.EventType == ZipProgressEventType.Saving_EntryBytesRead) + { + if (justHadByteUpdate) + Console.SetCursorPosition(0, Console.CursorTop); + Console.Write(" {0}/{1} ({2:N0}%)", e.BytesTransferred, e.TotalBytesToTransfer, + e.BytesTransferred / (0.01 * e.TotalBytesToTransfer )); + justHadByteUpdate= true; + } + } + + public static ZipUp(string targetZip, string directory) + { + using (var zip = new ZipFile()) { + zip.SaveProgress += SaveProgress; + zip.AddDirectory(directory); + zip.Save(targetZip); + } + } + + + + + Public Sub ZipUp(ByVal targetZip As String, ByVal directory As String) + Using zip As ZipFile = New ZipFile + AddHandler zip.SaveProgress, AddressOf MySaveProgress + zip.AddDirectory(directory) + zip.Save(targetZip) + End Using + End Sub + + Private Shared justHadByteUpdate As Boolean = False + + Public Shared Sub MySaveProgress(ByVal sender As Object, ByVal e As SaveProgressEventArgs) + If (e.EventType Is ZipProgressEventType.Saving_Started) Then + Console.WriteLine("Saving: {0}", e.ArchiveName) + + ElseIf (e.EventType Is ZipProgressEventType.Saving_Completed) Then + justHadByteUpdate = False + Console.WriteLine + Console.WriteLine("Done: {0}", e.ArchiveName) + + ElseIf (e.EventType Is ZipProgressEventType.Saving_BeforeWriteEntry) Then + If justHadByteUpdate Then + Console.WriteLine + End If + Console.WriteLine(" Writing: {0} ({1}/{2})", e.CurrentEntry.FileName, e.EntriesSaved, e.EntriesTotal) + justHadByteUpdate = False + + ElseIf (e.EventType Is ZipProgressEventType.Saving_EntryBytesRead) Then + If justHadByteUpdate Then + Console.SetCursorPosition(0, Console.CursorTop) + End If + Console.Write(" {0}/{1} ({2:N0}%)", e.BytesTransferred, _ + e.TotalBytesToTransfer, _ + (CDbl(e.BytesTransferred) / (0.01 * e.TotalBytesToTransfer))) + justHadByteUpdate = True + End If + End Sub + + + + + + This is a more complete example of using the SaveProgress + events in a Windows Forms application, with a + Thread object. + + + delegate void SaveEntryProgress(SaveProgressEventArgs e); + delegate void ButtonClick(object sender, EventArgs e); + + public class WorkerOptions + { + public string ZipName; + public string Folder; + public string Encoding; + public string Comment; + public int ZipFlavor; + public Zip64Option Zip64; + } + + private int _progress2MaxFactor; + private bool _saveCanceled; + private long _totalBytesBeforeCompress; + private long _totalBytesAfterCompress; + private Thread _workerThread; + + + private void btnZipup_Click(object sender, EventArgs e) + { + KickoffZipup(); + } + + private void btnCancel_Click(object sender, EventArgs e) + { + if (this.lblStatus.InvokeRequired) + { + this.lblStatus.Invoke(new ButtonClick(this.btnCancel_Click), new object[] { sender, e }); + } + else + { + _saveCanceled = true; + lblStatus.Text = "Canceled..."; + ResetState(); + } + } + + private void KickoffZipup() + { + _folderName = tbDirName.Text; + + if (_folderName == null || _folderName == "") return; + if (this.tbZipName.Text == null || this.tbZipName.Text == "") return; + + // check for existence of the zip file: + if (System.IO.File.Exists(this.tbZipName.Text)) + { + var dlgResult = MessageBox.Show(String.Format("The file you have specified ({0}) already exists." + + " Do you want to overwrite this file?", this.tbZipName.Text), + "Confirmation is Required", MessageBoxButtons.YesNo, MessageBoxIcon.Question); + if (dlgResult != DialogResult.Yes) return; + System.IO.File.Delete(this.tbZipName.Text); + } + + _saveCanceled = false; + _nFilesCompleted = 0; + _totalBytesAfterCompress = 0; + _totalBytesBeforeCompress = 0; + this.btnOk.Enabled = false; + this.btnOk.Text = "Zipping..."; + this.btnCancel.Enabled = true; + lblStatus.Text = "Zipping..."; + + var options = new WorkerOptions + { + ZipName = this.tbZipName.Text, + Folder = _folderName, + Encoding = "ibm437" + }; + + if (this.comboBox1.SelectedIndex != 0) + { + options.Encoding = this.comboBox1.SelectedItem.ToString(); + } + + if (this.radioFlavorSfxCmd.Checked) + options.ZipFlavor = 2; + else if (this.radioFlavorSfxGui.Checked) + options.ZipFlavor = 1; + else options.ZipFlavor = 0; + + if (this.radioZip64AsNecessary.Checked) + options.Zip64 = Zip64Option.AsNecessary; + else if (this.radioZip64Always.Checked) + options.Zip64 = Zip64Option.Always; + else options.Zip64 = Zip64Option.Never; + + options.Comment = String.Format("Encoding:{0} || Flavor:{1} || ZIP64:{2}\r\nCreated at {3} || {4}\r\n", + options.Encoding, + FlavorToString(options.ZipFlavor), + options.Zip64.ToString(), + System.DateTime.Now.ToString("yyyy-MMM-dd HH:mm:ss"), + this.Text); + + if (this.tbComment.Text != TB_COMMENT_NOTE) + options.Comment += this.tbComment.Text; + + _workerThread = new Thread(this.DoSave); + _workerThread.Name = "Zip Saver thread"; + _workerThread.Start(options); + this.Cursor = Cursors.WaitCursor; + } + + + private void DoSave(Object p) + { + WorkerOptions options = p as WorkerOptions; + try + { + using (var zip1 = new ZipFile()) + { + zip1.ProvisionalAlternateEncoding = System.Text.Encoding.GetEncoding(options.Encoding); + zip1.Comment = options.Comment; + zip1.AddDirectory(options.Folder); + _entriesToZip = zip1.EntryFileNames.Count; + SetProgressBars(); + zip1.SaveProgress += this.zip1_SaveProgress; + + zip1.UseZip64WhenSaving = options.Zip64; + + if (options.ZipFlavor == 1) + zip1.SaveSelfExtractor(options.ZipName, SelfExtractorFlavor.WinFormsApplication); + else if (options.ZipFlavor == 2) + zip1.SaveSelfExtractor(options.ZipName, SelfExtractorFlavor.ConsoleApplication); + else + zip1.Save(options.ZipName); + } + } + catch (System.Exception exc1) + { + MessageBox.Show(String.Format("Exception while zipping: {0}", exc1.Message)); + btnCancel_Click(null, null); + } + } + + + + void zip1_SaveProgress(object sender, SaveProgressEventArgs e) + { + switch (e.EventType) + { + case ZipProgressEventType.Saving_AfterWriteEntry: + StepArchiveProgress(e); + break; + case ZipProgressEventType.Saving_EntryBytesRead: + StepEntryProgress(e); + break; + case ZipProgressEventType.Saving_Completed: + SaveCompleted(); + break; + case ZipProgressEventType.Saving_AfterSaveTempArchive: + // this event only occurs when saving an SFX file + TempArchiveSaved(); + break; + } + if (_saveCanceled) + e.Cancel = true; + } + + + + private void StepArchiveProgress(SaveProgressEventArgs e) + { + if (this.progressBar1.InvokeRequired) + { + this.progressBar1.Invoke(new SaveEntryProgress(this.StepArchiveProgress), new object[] { e }); + } + else + { + if (!_saveCanceled) + { + _nFilesCompleted++; + this.progressBar1.PerformStep(); + _totalBytesAfterCompress += e.CurrentEntry.CompressedSize; + _totalBytesBeforeCompress += e.CurrentEntry.UncompressedSize; + + // reset the progress bar for the entry: + this.progressBar2.Value = this.progressBar2.Maximum = 1; + + this.Update(); + } + } + } + + + private void StepEntryProgress(SaveProgressEventArgs e) + { + if (this.progressBar2.InvokeRequired) + { + this.progressBar2.Invoke(new SaveEntryProgress(this.StepEntryProgress), new object[] { e }); + } + else + { + if (!_saveCanceled) + { + if (this.progressBar2.Maximum == 1) + { + // reset + Int64 max = e.TotalBytesToTransfer; + _progress2MaxFactor = 0; + while (max > System.Int32.MaxValue) + { + max /= 2; + _progress2MaxFactor++; + } + this.progressBar2.Maximum = (int)max; + lblStatus.Text = String.Format("{0} of {1} files...({2})", + _nFilesCompleted + 1, _entriesToZip, e.CurrentEntry.FileName); + } + + int xferred = e.BytesTransferred >> _progress2MaxFactor; + + this.progressBar2.Value = (xferred >= this.progressBar2.Maximum) + ? this.progressBar2.Maximum + : xferred; + + this.Update(); + } + } + } + + private void SaveCompleted() + { + if (this.lblStatus.InvokeRequired) + { + this.lblStatus.Invoke(new MethodInvoker(this.SaveCompleted)); + } + else + { + lblStatus.Text = String.Format("Done, Compressed {0} files, {1:N0}% of original.", + _nFilesCompleted, (100.00 * _totalBytesAfterCompress) / _totalBytesBeforeCompress); + ResetState(); + } + } + + private void ResetState() + { + this.btnCancel.Enabled = false; + this.btnOk.Enabled = true; + this.btnOk.Text = "Zip it!"; + this.progressBar1.Value = 0; + this.progressBar2.Value = 0; + this.Cursor = Cursors.Default; + if (!_workerThread.IsAlive) + _workerThread.Join(); + } + + + + + + + + + + + An event handler invoked before, during, and after the reading of a zip archive. + + + + + Depending on the particular event being signaled, different properties on the + parameter are set. The following table + summarizes the available EventTypes and the conditions under which this + event handler is invoked with a ReadProgressEventArgs with the given EventType. + + + + + value of EntryType + Meaning and conditions + + + + ZipProgressEventType.Reading_Started + Fired just as ZipFile.Read() begins. Meaningful properties: ArchiveName. + + + + + ZipProgressEventType.Reading_Completed + Fired when ZipFile.Read() has completed. Meaningful properties: ArchiveName. + + + + + ZipProgressEventType.Reading_ArchiveBytesRead + Fired while reading, updates the number of bytes read for the entire archive. + Meaningful properties: ArchiveName, CurrentEntry, BytesTransferred, TotalBytesToTransfer. + + + + + ZipProgressEventType.Reading_BeforeReadEntry + Indicates an entry is about to be read from the archive. + Meaningful properties: ArchiveName, EntriesTotal. + + + + + ZipProgressEventType.Reading_AfterReadEntry + Indicates an entry has just been read from the archive. + Meaningful properties: ArchiveName, EntriesTotal, CurrentEntry. + + + + + + + + + + + + + An event handler invoked before, during, and after extraction of + entries in the zip archive. + + + + + Depending on the particular event, different properties on the parameter are set. The following + table summarizes the available EventTypes and the conditions under + which this event handler is invoked with a + ExtractProgressEventArgs with the given EventType. + + + + + value of EntryType + Meaning and conditions + + + + ZipProgressEventType.Extracting_BeforeExtractAll + + Set when ExtractAll() begins. The ArchiveName, Overwrite, and + ExtractLocation properties are meaningful. + + + + ZipProgressEventType.Extracting_AfterExtractAll + + Set when ExtractAll() has completed. The ArchiveName, Overwrite, + and ExtractLocation properties are meaningful. + + + + + ZipProgressEventType.Extracting_BeforeExtractEntry + + Set when an Extract() on an entry in the ZipFile has begun. + Properties that are meaningful: ArchiveName, EntriesTotal, + CurrentEntry, Overwrite, ExtractLocation, EntriesExtracted. + + + + + ZipProgressEventType.Extracting_AfterExtractEntry + + Set when an Extract() on an entry in the ZipFile has completed. + Properties that are meaningful: ArchiveName, EntriesTotal, + CurrentEntry, Overwrite, ExtractLocation, EntriesExtracted. + + + + + ZipProgressEventType.Extracting_EntryBytesWritten + + Set within a call to Extract() on an entry in the ZipFile, as data + is extracted for the entry. Properties that are meaningful: + ArchiveName, CurrentEntry, BytesTransferred, TotalBytesToTransfer. + + + + + ZipProgressEventType.Extracting_ExtractEntryWouldOverwrite + + Set within a call to Extract() on an entry in the ZipFile, when the + extraction would overwrite an existing file. This event type is used + only when ExtractExistingFileAction on the ZipFile or + ZipEntry is set to InvokeExtractProgressEvent. + + + + + + + + + + private static bool justHadByteUpdate = false; + public static void ExtractProgress(object sender, ExtractProgressEventArgs e) + { + if(e.EventType == ZipProgressEventType.Extracting_EntryBytesWritten) + { + if (justHadByteUpdate) + Console.SetCursorPosition(0, Console.CursorTop); + + Console.Write(" {0}/{1} ({2:N0}%)", e.BytesTransferred, e.TotalBytesToTransfer, + e.BytesTransferred / (0.01 * e.TotalBytesToTransfer )); + justHadByteUpdate = true; + } + else if(e.EventType == ZipProgressEventType.Extracting_BeforeExtractEntry) + { + if (justHadByteUpdate) + Console.WriteLine(); + Console.WriteLine("Extracting: {0}", e.CurrentEntry.FileName); + justHadByteUpdate= false; + } + } + + public static ExtractZip(string zipToExtract, string directory) + { + string TargetDirectory= "extract"; + using (var zip = ZipFile.Read(zipToExtract)) { + zip.ExtractProgress += ExtractProgress; + foreach (var e in zip1) + { + e.Extract(TargetDirectory, true); + } + } + } + + + + Public Shared Sub Main(ByVal args As String()) + Dim ZipToUnpack As String = "C1P3SML.zip" + Dim TargetDir As String = "ExtractTest_Extract" + Console.WriteLine("Extracting file {0} to {1}", ZipToUnpack, TargetDir) + Using zip1 As ZipFile = ZipFile.Read(ZipToUnpack) + AddHandler zip1.ExtractProgress, AddressOf MyExtractProgress + Dim e As ZipEntry + For Each e In zip1 + e.Extract(TargetDir, True) + Next + End Using + End Sub + + Private Shared justHadByteUpdate As Boolean = False + + Public Shared Sub MyExtractProgress(ByVal sender As Object, ByVal e As ExtractProgressEventArgs) + If (e.EventType = ZipProgressEventType.Extracting_EntryBytesWritten) Then + If ExtractTest.justHadByteUpdate Then + Console.SetCursorPosition(0, Console.CursorTop) + End If + Console.Write(" {0}/{1} ({2:N0}%)", e.BytesTransferred, e.TotalBytesToTransfer, (CDbl(e.BytesTransferred) / (0.01 * e.TotalBytesToTransfer))) + ExtractTest.justHadByteUpdate = True + ElseIf (e.EventType = ZipProgressEventType.Extracting_BeforeExtractEntry) Then + If ExtractTest.justHadByteUpdate Then + Console.WriteLine + End If + Console.WriteLine("Extracting: {0}", e.CurrentEntry.FileName) + ExtractTest.justHadByteUpdate = False + End If + End Sub + + + + + + + + + + An event handler invoked before, during, and after Adding entries to a zip archive. + + + + Adding a large number of entries to a zip file can take a long + time. For example, when calling on a + directory that contains 50,000 files, it could take 3 minutes or so. + This event handler allws an application to track the progress of the Add + operation, and to optionally cancel a lengthy Add operation. + + + + + + int _numEntriesToAdd= 0; + int _numEntriesAdded= 0; + void AddProgressHandler(object sender, AddProgressEventArgs e) + { + switch (e.EventType) + { + case ZipProgressEventType.Adding_Started: + Console.WriteLine("Adding files to the zip..."); + break; + case ZipProgressEventType.Adding_AfterAddEntry: + _numEntriesAdded++; + Console.WriteLine(String.Format("Adding file {0}/{1} :: {2}", + _numEntriesAdded, _numEntriesToAdd, e.CurrentEntry.FileName)); + break; + case ZipProgressEventType.Adding_Completed: + Console.WriteLine("Added all files"); + break; + } + } + + void CreateTheZip() + { + using (ZipFile zip = new ZipFile()) + { + zip.AddProgress += AddProgressHandler; + zip.AddDirectory(System.IO.Path.GetFileName(DirToZip)); + zip.Save(ZipFileToCreate); + } + } + + + + + + Private Sub AddProgressHandler(ByVal sender As Object, ByVal e As AddProgressEventArgs) + Select Case e.EventType + Case ZipProgressEventType.Adding_Started + Console.WriteLine("Adding files to the zip...") + Exit Select + Case ZipProgressEventType.Adding_AfterAddEntry + Console.WriteLine(String.Format("Adding file {0}", e.CurrentEntry.FileName)) + Exit Select + Case ZipProgressEventType.Adding_Completed + Console.WriteLine("Added all files") + Exit Select + End Select + End Sub + + Sub CreateTheZip() + Using zip as ZipFile = New ZipFile + AddHandler zip.AddProgress, AddressOf AddProgressHandler + zip.AddDirectory(System.IO.Path.GetFileName(DirToZip)) + zip.Save(ZipFileToCreate); + End Using + End Sub + + + + + + + + + + + + An event that is raised when an error occurs during open or read of files + while saving a zip archive. + + + + + Errors can occur as a file is being saved to the zip archive. For + example, the File.Open may fail, or a File.Read may fail, because of + lock conflicts or other reasons. If you add a handler to this event, + you can handle such errors in your own code. If you don't add a + handler, the library will throw an exception if it encounters an I/O + error during a call to Save(). + + + + Setting a handler implicitly sets to + ZipErrorAction.InvokeErrorEvent. + + + + The handler you add applies to all items that are + subsequently added to the ZipFile instance. If you set this + property after you have added items to the ZipFile, but before you + have called Save(), errors that occur while saving those items + will not cause the error handler to be invoked. + + + + If you want to handle any errors that occur with any entry in the zip + file using the same error handler, then add your error handler once, + before adding any entries to the zip archive. + + + + In the error handler method, you need to set the property on the + ZipErrorEventArgs.CurrentEntry. This communicates back to + DotNetZip what you would like to do with this particular error. Within + an error handler, if you set the ZipEntry.ZipErrorAction property + on the ZipEntry to ZipErrorAction.InvokeErrorEvent or if + you don't set it at all, the library will throw the exception. (It is the + same as if you had set the ZipEntry.ZipErrorAction property on the + ZipEntry to ZipErrorAction.Throw.) If you set the + ZipErrorEventArgs.Cancel to true, the entire Save() will be + canceled. + + + + In the case that you use ZipErrorAction.Skip, implying that + you want to skip the entry for which there's been an error, DotNetZip + tries to seek backwards in the output stream, and truncate all bytes + written on behalf of that particular entry. This works only if the + output stream is seekable. It will not work, for example, when using + ASPNET's Response.OutputStream. + + + + + + + This example shows how to use an event handler to handle + errors during save of the zip file. + + + public static void MyZipError(object sender, ZipErrorEventArgs e) + { + Console.WriteLine("Error saving {0}...", e.FileName); + Console.WriteLine(" Exception: {0}", e.exception); + ZipEntry entry = e.CurrentEntry; + string response = null; + // Ask the user whether he wants to skip this error or not + do + { + Console.Write("Retry, Skip, Throw, or Cancel ? (R/S/T/C) "); + response = Console.ReadLine(); + Console.WriteLine(); + + } while (response != null && + response[0]!='S' && response[0]!='s' && + response[0]!='R' && response[0]!='r' && + response[0]!='T' && response[0]!='t' && + response[0]!='C' && response[0]!='c'); + + e.Cancel = (response[0]=='C' || response[0]=='c'); + + if (response[0]=='S' || response[0]=='s') + entry.ZipErrorAction = ZipErrorAction.Skip; + else if (response[0]=='R' || response[0]=='r') + entry.ZipErrorAction = ZipErrorAction.Retry; + else if (response[0]=='T' || response[0]=='t') + entry.ZipErrorAction = ZipErrorAction.Throw; + } + + public void SaveTheFile() + { + string directoryToZip = "fodder"; + string directoryInArchive = "files"; + string zipFileToCreate = "Archive.zip"; + using (var zip = new ZipFile()) + { + // set the event handler before adding any entries + zip.ZipError += MyZipError; + zip.AddDirectory(directoryToZip, directoryInArchive); + zip.Save(zipFileToCreate); + } + } + + + + Private Sub MyZipError(ByVal sender As Object, ByVal e As Ionic.Zip.ZipErrorEventArgs) + ' At this point, the application could prompt the user for an action to take. + ' But in this case, this application will simply automatically skip the file, in case of error. + Console.WriteLine("Zip Error, entry {0}", e.CurrentEntry.FileName) + Console.WriteLine(" Exception: {0}", e.exception) + ' set the desired ZipErrorAction on the CurrentEntry to communicate that to DotNetZip + e.CurrentEntry.ZipErrorAction = Zip.ZipErrorAction.Skip + End Sub + + Public Sub SaveTheFile() + Dim directoryToZip As String = "fodder" + Dim directoryInArchive As String = "files" + Dim zipFileToCreate as String = "Archive.zip" + Using zipArchive As ZipFile = New ZipFile + ' set the event handler before adding any entries + AddHandler zipArchive.ZipError, AddressOf MyZipError + zipArchive.AddDirectory(directoryToZip, directoryInArchive) + zipArchive.Save(zipFileToCreate) + End Using + End Sub + + + + + + + + + Options for using ZIP64 extensions when saving zip archives. + + + + + + Designed many years ago, the original zip + specification from PKWARE allowed for 32-bit quantities for the + compressed and uncompressed sizes of zip entries, as well as a 32-bit quantity + for specifying the length of the zip archive itself, and a maximum of 65535 + entries. These limits are now regularly exceeded in many backup and archival + scenarios. Recently, PKWare added extensions to the original zip spec, called + "ZIP64 extensions", to raise those limitations. This property governs whether + DotNetZip will use those extensions when writing zip archives. The use of + these extensions is optional and explicit in DotNetZip because, despite the + status of ZIP64 as a bona fide standard, many other zip tools and libraries do + not support ZIP64, and therefore a zip file with ZIP64 extensions may be + unreadable by some of those other tools. + + + + Set this property to to always use ZIP64 + extensions when saving, regardless of whether your zip archive needs it. + Suppose you add 5 files, each under 100k, to a ZipFile. If you specify Always + for this flag, you will get a ZIP64 archive, though the archive does not need + to use ZIP64 because none of the original zip limits had been exceeded. + + + + Set this property to to tell the DotNetZip + library to never use ZIP64 extensions. This is useful for maximum + compatibility and interoperability, at the expense of the capability of + handling large files or large archives. NB: Windows Explorer in Windows XP + and Windows Vista cannot currently extract files from a zip64 archive, so if + you want to guarantee that a zip archive produced by this library will work in + Windows Explorer, use Never. If you set this property to , and your application creates a zip that would + exceed one of the Zip limits, the library will throw an exception while saving + the zip file. + + + + Set this property to to tell the + DotNetZip library to use the ZIP64 extensions when required by the + entry. After the file is compressed, the original and compressed sizes are + checked, and if they exceed the limits described above, then zip64 can be + used. That is the general idea, but there is an additional wrinkle when saving + to a non-seekable device, like the ASP.NET Response.OutputStream, or + Console.Out. When using non-seekable streams for output, the entry + header - which indicates whether zip64 is in use - is emitted before it is + known if zip64 is necessary. It is only after all entries have been saved + that it can be known if ZIP64 will be required. On seekable output streams, + after saving all entries, the library can seek backward and re-emit the zip + file header to be consistent with the actual ZIP64 requirement. But using a + non-seekable output stream, the library cannot seek backward, so the header + can never be changed. In other words, the archive's use of ZIP64 extensions is + not alterable after the header is emitted. Therefore, when saving to + non-seekable streams, using is the same + as using : it will always produce a zip + archive that uses ZIP64 extensions. + + + + + + + The default behavior, which is "Never". + (For COM clients, this is a 0 (zero).) + + + + + Do not use ZIP64 extensions when writing zip archives. + (For COM clients, this is a 0 (zero).) + + + + + Use ZIP64 extensions when writing zip archives, as necessary. + For example, when a single entry exceeds 0xFFFFFFFF in size, or when the archive as a whole + exceeds 0xFFFFFFFF in size, or when there are more than 65535 entries in an archive. + (For COM clients, this is a 1.) + + + + + Always use ZIP64 extensions when writing zip archives, even when unnecessary. + (For COM clients, this is a 2.) + + + + + An enum representing the values on a three-way toggle switch + for various options in the library. This might be used to + specify whether to employ a particular text encoding, or to use + ZIP64 extensions, or some other option. + + + + + The default behavior. This is the same as "Never". + (For COM clients, this is a 0 (zero).) + + + + + Never use the associated option. + (For COM clients, this is a 0 (zero).) + + + + + Use the associated behavior "as necessary." + (For COM clients, this is a 1.) + + + + + Use the associated behavior Always, whether necessary or not. + (For COM clients, this is a 2.) + + + + + A class for collecting the various options that can be used when + Reading zip files for extraction or update. + + + + + When reading a zip file, there are several options an + application can set, to modify how the file is read, or what + the library does while reading. This class collects those + options into one container. + + + + Pass an instance of the ReadOptions class into the + ZipFile.Read() method. + + + . + . + + + + + An event handler for Read operations. When opening large zip + archives, you may want to display a progress bar or other + indicator of status progress while reading. This parameter + allows you to specify a ReadProgress Event Handler directly. + When you call Read(), the progress event is invoked as + necessary. + + + + + The System.IO.TextWriter to use for writing verbose status messages + during operations on the zip archive. A console application may wish to + pass System.Console.Out to get messages on the Console. A graphical + or headless application may wish to capture the messages in a different + TextWriter, such as a System.IO.StringWriter. + + + + + The System.Text.Encoding to use when reading in the zip archive. Be + careful specifying the encoding. If the value you use here is not the same + as the Encoding used when the zip archive was created (possibly by a + different archiver) you will get unexpected results and possibly exceptions. + + + + + + + + An enum that provides the different self-extractor flavors + + + + + A self-extracting zip archive that runs from the console or + command line. + + + + + A self-extracting zip archive that presents a graphical user + interface when it is executed. + + + + + The options for generating a self-extracting archive. + + + + + The type of SFX to create. + + + + + The command to run after extraction. + + + + + This is optional. Leave it empty (null in C# or Nothing in + VB) to run no command after extraction. + + + + If it is non-empty, the SFX will execute the command specified in this + string on the user's machine, and using the extract directory as the + working directory for the process, after unpacking the archive. The + program to execute can include a path, if you like. If you want to execute + a program that accepts arguments, specify the program name, followed by a + space, and then the arguments for the program, each separated by a space, + just as you would on a normal command line. Example: program.exe arg1 + arg2. The string prior to the first space will be taken as the + program name, and the string following the first space specifies the + arguments to the program. + + + + If you want to execute a program that has a space in the name or path of + the file, surround the program name in double-quotes. The first character + of the command line should be a double-quote character, and there must be + a matching double-quote following the end of the program file name. Any + optional arguments to the program follow that, separated by + spaces. Example: "c:\project files\program name.exe" arg1 arg2. + + + + If the flavor of the SFX is SelfExtractorFlavor.ConsoleApplication, + then the SFX starts a new process, using this string as the post-extract + command line. The SFX waits for the process to exit. The exit code of + the post-extract command line is returned as the exit code of the + command-line self-extractor exe. A non-zero exit code is typically used to + indicated a failure by the program. In the case of an SFX, a non-zero exit + code may indicate a failure during extraction, OR, it may indicate a + failure of the run-after-extract program if specified, OR, it may indicate + the run-after-extract program could not be fuond. There is no way to + distinguish these conditions from the calling shell, aside from parsing + the output of the SFX. If you have Quiet set to true, you may not + see error messages, if a problem occurs. + + + + If the flavor of the SFX is + SelfExtractorFlavor.WinFormsApplication, then the SFX starts a new + process, using this string as the post-extract command line, and using the + extract directory as the working directory for the process. The SFX does + not wait for the command to complete, and does not check the exit code of + the program. If the run-after-extract program cannot be fuond, a message + box is displayed indicating that fact. + + + + You can specify environment variables within this string, with a format like + %NAME%. The value of these variables will be expanded at the time + the SFX is run. Example: %WINDIR%\system32\xcopy.exe may expand at + runtime to c:\Windows\System32\xcopy.exe. + + + + By combining this with the RemoveUnpackedFilesAfterExecute + flag, you can create an SFX that extracts itself, runs a file that + was extracted, then deletes all the files that were extracted. If + you want it to run "invisibly" then set Flavor to + SelfExtractorFlavor.ConsoleApplication, and set Quiet + to true. The user running such an EXE will see a console window + appear, then disappear quickly. You may also want to specify the + default extract location, with DefaultExtractDirectory. + + + + If you set Flavor to + SelfExtractorFlavor.WinFormsApplication, and set Quiet to + true, then a GUI with progressbars is displayed, but it is + "non-interactive" - it accepts no input from the user. Instead the SFX + just automatically unpacks and exits. + + + + + + + The default extract directory the user will see when + running the self-extracting archive. + + + + + Passing null (or Nothing in VB) here will cause the Self Extractor to use + the the user's personal directory () for the default extract + location. + + + + This is only a default location. The actual extract location will be + settable on the command line when the SFX is executed. + + + + You can specify environment variables within this string, + with %NAME%. The value of these variables will be + expanded at the time the SFX is run. Example: + %USERPROFILE%\Documents\unpack may expand at runtime to + c:\users\melvin\Documents\unpack. + + + + + + The name of an .ico file in the filesystem to use for the application icon + for the generated SFX. + + + + + Normally, DotNetZip will embed an "zipped folder" icon into the generated + SFX. If you prefer to use a different icon, you can specify it here. It + should be a .ico file. This file is passed as the /win32icon + option to the csc.exe compiler when constructing the SFX file. + + + + + + + Whether the ConsoleApplication SFX will be quiet during extraction. + + + + + This option affects the way the generated SFX runs. By default it is + false. When you set it to true,... + + + + + Flavor + Behavior + + + + ConsoleApplication + no messages will be emitted during successful + operation. Double-clicking the SFX in Windows + Explorer or as an attachment in an email will cause a console + window to appear briefly, before it disappears. If you run the + ConsoleApplication SFX from the cmd.exe prompt, it runs as a + normal console app; by default, because it is quiet, it displays + no messages to the console. If you pass the -v+ command line + argument to the Console SFX when you run it, you will get verbose + messages to the console. + + + + + WinFormsApplication + the SFX extracts automatically when the application + is launched, with no additional user input. + + + + + + + When you set it to false,... + + + + + Flavor + Behavior + + + + ConsoleApplication + the extractor will emit a + message to the console for each entry extracted. + + When double-clicking to launch the SFX, the console window will + remain, and the SFX will emit a message for each file as it + extracts. The messages fly by quickly, they won't be easily + readable, unless the extracted files are fairly large. + + + + + + WinFormsApplication + the SFX presents a forms UI and allows the user to select + options before extracting. + + + + + + + + + + Specify what the self-extractor will do when extracting an entry + would overwrite an existing file. + + + + The default behavvior is to Throw. + + + + + + Whether to remove the files that have been unpacked, after executing the + PostExtractCommandLine. + + + + + If true, and if there is a + PostExtractCommandLine, and if the command runs successfully, + then the files that the SFX unpacked will be removed, afterwards. If + the command does not complete successfully (non-zero return code), + that is interpreted as a failure, and the extracted files will not be + removed. + + + + Setting this flag, and setting Flavor to + SelfExtractorFlavor.ConsoleApplication, and setting Quiet to + true, results in an SFX that extracts itself, runs a file that was + extracted, then deletes all the files that were extracted, with no + intervention by the user. You may also want to specify the default + extract location, with DefaultExtractDirectory. + + + + + + + The file version number to embed into the generated EXE. It will show up, for + example, during a mouseover in Windows Explorer. + + + + + + The product version to embed into the generated EXE. It will show up, for + example, during a mouseover in Windows Explorer. + + + + You can use any arbitrary string, but a human-readable version number is + recommended. For example "v1.2 alpha" or "v4.2 RC2". If you specify nothing, + then there is no product version embedded into the EXE. + + + + + + The copyright notice, if any, to embed into the generated EXE. + + + + It will show up, for example, while viewing properties of the file in + Windows Explorer. You can use any arbitrary string, but typically you + want something like "Copyright © Dino Chiesa 2011". + + + + + + The description to embed into the generated EXE. + + + + Use any arbitrary string. This text will be displayed during a + mouseover in Windows Explorer. If you specify nothing, then the string + "DotNetZip SFX Archive" is embedded into the EXE as the description. + + + + + + The product name to embed into the generated EXE. + + + + Use any arbitrary string. This text will be displayed + while viewing properties of the EXE file in + Windows Explorer. + + + + + + The title to display in the Window of a GUI SFX, while it extracts. + + + + + By default the title show in the GUI window of a self-extractor + is "DotNetZip Self-extractor (http://DotNetZip.codeplex.com/)". + You can change that by setting this property before saving the SFX. + + + + This property has an effect only when producing a Self-extractor + of flavor SelfExtractorFlavor.WinFormsApplication. + + + + + + + Additional options for the csc.exe compiler, when producing the SFX + EXE. + + + + + + Reset the BitWriter. + + + + This is useful when the BitWriter writes into a MemoryStream, and + is used by a BZip2Compressor, which itself is re-used for multiple + distinct data blocks. + + + + + + Write some number of bits from the given value, into the output. + + + + The nbits value should be a max of 25, for safety. For performance + reasons, this method does not check! + + + + + + Write a full 8-bit byte into the output. + + + + + Write four 8-bit bytes into the output. + + + + + Write all available byte-aligned bytes. + + + + This method writes no new output, but flushes any accumulated + bits. At completion, the accumulator may contain up to 7 + bits. + + + This is necessary when re-assembling output from N independent + compressors, one for each of N blocks. The output of any + particular compressor will in general have some fragment of a byte + remaining. This fragment needs to be accumulated into the + parent BZip2OutputStream. + + + + + + Writes all available bytes, and emits padding for the final byte as + necessary. This must be the last method invoked on an instance of + BitWriter. + + + + + Delivers the remaining bits, left-aligned, in a byte. + + + + This is valid only if NumRemainingBits is less than 8; + in other words it is valid only after a call to Flush(). + + + + + Knuth's increments seem to work better than Incerpi-Sedgewick here. + Possibly because the number of elems to sort is usually small, typically + <= 20. + + + + BZip2Compressor writes its compressed data out via a BitWriter. This + is necessary because BZip2 does byte shredding. + + + + + Accept new bytes into the compressor data buffer + + + + This method does the first-level (cheap) run-length encoding, and + stores the encoded data into the rle block. + + + + + + Process one input byte into the block. + + + + + To "process" the byte means to do the run-length encoding. + There are 3 possible return values: + + 0 - the byte was not written, in other words, not + encoded into the block. This happens when the + byte b would require the start of a new run, and + the block has no more room for new runs. + + 1 - the byte was written, and the block is not full. + + 2 - the byte was written, and the block is full. + + + + 0 if the byte was not written, non-zero if written. + + + + Append one run to the output block. + + + + + This compressor does run-length-encoding before BWT and etc. This + method simply appends a run to the output block. The append always + succeeds. The return value indicates whether the block is full: + false (not full) implies that at least one additional run could be + processed. + + + true if the block is now full; otherwise false. + + + + Compress the data that has been placed (Run-length-encoded) into the + block. The compressed data goes into the CompressedBytes array. + + + + Side effects: 1. fills the CompressedBytes array. 2. sets the + AvailableBytesOut property. + + + + + This is the most hammered method of this class. + +

+ This is the version using unrolled loops. +

+
+ + Method "mainQSort3", file "blocksort.c", BZip2 1.0.2 + + + + The number of uncompressed bytes being held in the buffer. + + + + I am thinking this may be useful in a Stream that uses this + compressor class. In the Close() method on the stream it could + check this value to see if anything has been written at all. You + may think the stream could easily track the number of bytes it + wrote, which would eliminate the need for this. But, there is the + case where the stream writes a complete block, and it is full, and + then writes no more. In that case the stream may want to check. + + + + + Array instance identical to sfmap, both are used only + temporarily and independently, so we do not need to allocate + additional memory. + + + + A read-only decorator stream that performs BZip2 decompression on Read. + + + + + Create a BZip2InputStream, wrapping it around the given input Stream. + + + + The input stream will be closed when the BZip2InputStream is closed. + + + The stream from which to read compressed data + + + + Create a BZip2InputStream with the given stream, and + specifying whether to leave the wrapped stream open when + the BZip2InputStream is closed. + + The stream from which to read compressed data + + Whether to leave the input stream open, when the BZip2InputStream closes. + + + + + This example reads a bzip2-compressed file, decompresses it, + and writes the decompressed data into a newly created file. + + + var fname = "logfile.log.bz2"; + using (var fs = File.OpenRead(fname)) + { + using (var decompressor = new Ionic.BZip2.BZip2InputStream(fs)) + { + var outFname = fname + ".decompressed"; + using (var output = File.Create(outFname)) + { + byte[] buffer = new byte[2048]; + int n; + while ((n = decompressor.Read(buffer, 0, buffer.Length)) > 0) + { + output.Write(buffer, 0, n); + } + } + } + } + + + + + + Read data from the stream. + + + + + To decompress a BZip2 data stream, create a BZip2InputStream, + providing a stream that reads compressed data. Then call Read() on + that BZip2InputStream, and the data read will be decompressed + as you read. + + + + A BZip2InputStream can be used only for Read(), not for Write(). + + + + The buffer into which the read data should be placed. + the offset within that data array to put the first byte read. + the number of bytes to read. + the number of bytes actually read + + + + Read a single byte from the stream. + + the byte read from the stream, or -1 if EOF + + + + Flush the stream. + + + + + Calling this method always throws a . + + this is irrelevant, since it will always throw! + this is irrelevant, since it will always throw! + irrelevant! + + + + Calling this method always throws a . + + this is irrelevant, since it will always throw! + + + + Calling this method always throws a . + + this parameter is never used + this parameter is never used + this parameter is never used + + + + Dispose the stream. + + + indicates whether the Dispose method was invoked by user code. + + + + + Close the stream. + + + + + Read n bits from input, right justifying the result. + + + + For example, if you read 1 bit, the result is either 0 + or 1. + + + + The number of bits to read, always between 1 and 32. + + + + Called by createHuffmanDecodingTables() exclusively. + + + Called by recvDecodingTables() exclusively. + + + + Indicates whether the stream can be read. + + + The return value depends on whether the captive stream supports reading. + + + + + Indicates whether the stream supports Seek operations. + + + Always returns false. + + + + + Indicates whether the stream can be written. + + + The return value depends on whether the captive stream supports writing. + + + + + Reading this property always throws a . + + + + + The position of the stream pointer. + + + + Setting this property always throws a . Reading will return the + total number of uncompressed bytes read in. + + + + + Compressor State + + + + Freq table collected to save a pass over the data during + decompression. + + + Initializes the tt array. + + This method is called when the required length of the array is known. + I don't initialize it at construction time to avoid unneccessary + memory allocation when compressing small files. + + + + A write-only decorator stream that compresses data as it is + written using the BZip2 algorithm. + + + + + Constructs a new BZip2OutputStream, that sends its + compressed output to the given output stream. + + + + The destination stream, to which compressed output will be sent. + + + + + This example reads a file, then compresses it with bzip2 file, + and writes the compressed data into a newly created file. + + + var fname = "logfile.log"; + using (var fs = File.OpenRead(fname)) + { + var outFname = fname + ".bz2"; + using (var output = File.Create(outFname)) + { + using (var compressor = new Ionic.BZip2.BZip2OutputStream(output)) + { + byte[] buffer = new byte[2048]; + int n; + while ((n = fs.Read(buffer, 0, buffer.Length)) > 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + + + + Constructs a new BZip2OutputStream with specified blocksize. + + the destination stream. + + The blockSize in units of 100000 bytes. + The valid range is 1..9. + + + + + Constructs a new BZip2OutputStream. + + the destination stream. + + whether to leave the captive stream open upon closing this stream. + + + + + Constructs a new BZip2OutputStream with specified blocksize, + and explicitly specifies whether to leave the wrapped stream open. + + + the destination stream. + + The blockSize in units of 100000 bytes. + The valid range is 1..9. + + + whether to leave the captive stream open upon closing this stream. + + + + + Close the stream. + + + + This may or may not close the underlying stream. Check the + constructors that accept a bool value. + + + + + + Flush the stream. + + + + + Write data to the stream. + + + + + Use the BZip2OutputStream to compress data while writing: + create a BZip2OutputStream with a writable output stream. + Then call Write() on that BZip2OutputStream, providing + uncompressed data as input. The data sent to the output stream will + be the compressed form of the input data. + + + + A BZip2OutputStream can be used only for Write() not for Read(). + + + + + The buffer holding data to write to the stream. + the offset within that data array to find the first byte to write. + the number of bytes to write. + + + + Calling this method always throws a . + + this is irrelevant, since it will always throw! + this is irrelevant, since it will always throw! + irrelevant! + + + + Calling this method always throws a . + + this is irrelevant, since it will always throw! + + + + Calling this method always throws a . + + this parameter is never used + this parameter is never used + this parameter is never used + never returns anything; always throws + + + + The blocksize parameter specified at construction time. + + + + + Indicates whether the stream can be read. + + + The return value is always false. + + + + + Indicates whether the stream supports Seek operations. + + + Always returns false. + + + + + Indicates whether the stream can be written. + + + The return value should always be true, unless and until the + object is disposed and closed. + + + + + Reading this property always throws a . + + + + + The position of the stream pointer. + + + + Setting this property always throws a . Reading will return the + total number of uncompressed bytes written through. + + + + + A write-only decorator stream that compresses data as it is + written using the BZip2 algorithm. This stream compresses by + block using multiple threads. + + + This class performs BZIP2 compression through writing. For + more information on the BZIP2 algorithm, see + . + + + + This class is similar to , + except that this implementation uses an approach that employs multiple + worker threads to perform the compression. On a multi-cpu or multi-core + computer, the performance of this class can be significantly higher than + the single-threaded BZip2OutputStream, particularly for larger streams. + How large? Anything over 10mb is a good candidate for parallel + compression. + + + + The tradeoff is that this class uses more memory and more CPU than the + vanilla BZip2OutputStream. Also, for small files, the + ParallelBZip2OutputStream can be much slower than the vanilla + BZip2OutputStream, because of the overhead associated to using the + thread pool. + + + + + + + Constructs a new ParallelBZip2OutputStream, that sends its + compressed output to the given output stream. + + + + The destination stream, to which compressed output will be sent. + + + + + This example reads a file, then compresses it with bzip2 file, + and writes the compressed data into a newly created file. + + + var fname = "logfile.log"; + using (var fs = File.OpenRead(fname)) + { + var outFname = fname + ".bz2"; + using (var output = File.Create(outFname)) + { + using (var compressor = new Ionic.BZip2.ParallelBZip2OutputStream(output)) + { + byte[] buffer = new byte[2048]; + int n; + while ((n = fs.Read(buffer, 0, buffer.Length)) > 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + + + + Constructs a new ParallelBZip2OutputStream with specified blocksize. + + the destination stream. + + The blockSize in units of 100000 bytes. + The valid range is 1..9. + + + + + Constructs a new ParallelBZip2OutputStream. + + the destination stream. + + whether to leave the captive stream open upon closing this stream. + + + + + Constructs a new ParallelBZip2OutputStream with specified blocksize, + and explicitly specifies whether to leave the wrapped stream open. + + + the destination stream. + + The blockSize in units of 100000 bytes. + The valid range is 1..9. + + + whether to leave the captive stream open upon closing this stream. + + + + + Close the stream. + + + + This may or may not close the underlying stream. Check the + constructors that accept a bool value. + + + + + + Flush the stream. + + + + + Write data to the stream. + + + + + Use the ParallelBZip2OutputStream to compress data while + writing: create a ParallelBZip2OutputStream with a writable + output stream. Then call Write() on that + ParallelBZip2OutputStream, providing uncompressed data as + input. The data sent to the output stream will be the compressed + form of the input data. + + + + A ParallelBZip2OutputStream can be used only for + Write() not for Read(). + + + + + The buffer holding data to write to the stream. + the offset within that data array to find the first byte to write. + the number of bytes to write. + + + + Calling this method always throws a . + + this is irrelevant, since it will always throw! + this is irrelevant, since it will always throw! + irrelevant! + + + + Calling this method always throws a . + + this is irrelevant, since it will always throw! + + + + Calling this method always throws a . + + this parameter is never used + this parameter is never used + this parameter is never used + never returns anything; always throws + + + + The maximum number of concurrent compression worker threads to use. + + + + + This property sets an upper limit on the number of concurrent worker + threads to employ for compression. The implementation of this stream + employs multiple threads from the .NET thread pool, via + ThreadPool.QueueUserWorkItem(), to compress the incoming data by + block. As each block of data is compressed, this stream re-orders the + compressed blocks and writes them to the output stream. + + + + A higher number of workers enables a higher degree of + parallelism, which tends to increase the speed of compression on + multi-cpu computers. On the other hand, a higher number of buffer + pairs also implies a larger memory consumption, more active worker + threads, and a higher cpu utilization for any compression. This + property enables the application to limit its memory consumption and + CPU utilization behavior depending on requirements. + + + + By default, DotNetZip allocates 4 workers per CPU core, subject to the + upper limit specified in this property. For example, suppose the + application sets this property to 16. Then, on a machine with 2 + cores, DotNetZip will use 8 workers; that number does not exceed the + upper limit specified by this property, so the actual number of + workers used will be 4 * 2 = 8. On a machine with 4 cores, DotNetZip + will use 16 workers; again, the limit does not apply. On a machine + with 8 cores, DotNetZip will use 16 workers, because of the limit. + + + + For each compression "worker thread" that occurs in parallel, there is + up to 2mb of memory allocated, for buffering and processing. The + actual number depends on the property. + + + + CPU utilization will also go up with additional workers, because a + larger number of buffer pairs allows a larger number of background + threads to compress in parallel. If you find that parallel + compression is consuming too much memory or CPU, you can adjust this + value downward. + + + + The default value is 16. Different values may deliver better or + worse results, depending on your priorities and the dynamic + performance characteristics of your storage and compute resources. + + + + The application can set this value at any time, but it is effective + only before the first call to Write(), which is when the buffers are + allocated. + + + + + + The blocksize parameter specified at construction time. + + + + + Indicates whether the stream can be read. + + + The return value is always false. + + + + + Indicates whether the stream supports Seek operations. + + + Always returns false. + + + + + Indicates whether the stream can be written. + + + The return value depends on whether the captive stream supports writing. + + + + + Reading this property always throws a . + + + + + The position of the stream pointer. + + + + Setting this property always throws a . Reading will return the + total number of uncompressed bytes written through. + + + + + The total number of bytes written out by the stream. + + + This value is meaningful only after a call to Close(). + + + + + Returns the "random" number at a specific index. + + the index + the random number + + + + A class for compressing and decompressing streams using the Deflate algorithm. + + + + + + The DeflateStream is a Decorator on a . It adds DEFLATE compression or decompression to any + stream. + + + + Using this stream, applications can compress or decompress data via stream + Read and Write operations. Either compresssion or decompression + can occur through either reading or writing. The compression format used is + DEFLATE, which is documented in IETF RFC 1951, "DEFLATE + Compressed Data Format Specification version 1.3.". + + + + This class is similar to , except that + ZlibStream adds the RFC + 1950 - ZLIB framing bytes to a compressed stream when compressing, or + expects the RFC1950 framing bytes when decompressing. The DeflateStream + does not. + + + + + + + + + + Create a DeflateStream using the specified CompressionMode. + + + + When mode is CompressionMode.Compress, the DeflateStream will use + the default compression level. The "captive" stream will be closed when + the DeflateStream is closed. + + + + This example uses a DeflateStream to compress data from a file, and writes + the compressed data to another file. + + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(fileToCompress + ".deflated")) + { + using (Stream compressor = new DeflateStream(raw, CompressionMode.Compress)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n; + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(fileToCompress & ".deflated") + Using compressor As Stream = New DeflateStream(raw, CompressionMode.Compress) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + The stream which will be read or written. + Indicates whether the DeflateStream will compress or decompress. + + + + Create a DeflateStream using the specified CompressionMode and the specified CompressionLevel. + + + + + + When mode is CompressionMode.Decompress, the level parameter is + ignored. The "captive" stream will be closed when the DeflateStream is + closed. + + + + + + + This example uses a DeflateStream to compress data from a file, and writes + the compressed data to another file. + + + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(fileToCompress + ".deflated")) + { + using (Stream compressor = new DeflateStream(raw, + CompressionMode.Compress, + CompressionLevel.BestCompression)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n= -1; + while (n != 0) + { + if (n > 0) + compressor.Write(buffer, 0, n); + n= input.Read(buffer, 0, buffer.Length); + } + } + } + } + + + + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(fileToCompress & ".deflated") + Using compressor As Stream = New DeflateStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + The stream to be read or written while deflating or inflating. + Indicates whether the DeflateStream will compress or decompress. + A tuning knob to trade speed for effectiveness. + + + + Create a DeflateStream using the specified + CompressionMode, and explicitly specify whether the + stream should be left open after Deflation or Inflation. + + + + + + This constructor allows the application to request that the captive stream + remain open after the deflation or inflation occurs. By default, after + Close() is called on the stream, the captive stream is also + closed. In some cases this is not desired, for example if the stream is a + memory stream that will be re-read after compression. Specify true for + the parameter to leave the stream open. + + + + The DeflateStream will use the default compression level. + + + + See the other overloads of this constructor for example code. + + + + + The stream which will be read or written. This is called the + "captive" stream in other places in this documentation. + + + + Indicates whether the DeflateStream will compress or decompress. + + + true if the application would like the stream to + remain open after inflation/deflation. + + + + Create a DeflateStream using the specified CompressionMode + and the specified CompressionLevel, and explicitly specify whether + the stream should be left open after Deflation or Inflation. + + + + + + When mode is CompressionMode.Decompress, the level parameter is ignored. + + + + This constructor allows the application to request that the captive stream + remain open after the deflation or inflation occurs. By default, after + Close() is called on the stream, the captive stream is also + closed. In some cases this is not desired, for example if the stream is a + that will be re-read after + compression. Specify true for the parameter + to leave the stream open. + + + + + + + This example shows how to use a DeflateStream to compress data from + a file, and store the compressed data into another file. + + + using (var output = System.IO.File.Create(fileToCompress + ".deflated")) + { + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (Stream compressor = new DeflateStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, true)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n= -1; + while (n != 0) + { + if (n > 0) + compressor.Write(buffer, 0, n); + n= input.Read(buffer, 0, buffer.Length); + } + } + } + // can write additional data to the output stream here + } + + + + Using output As FileStream = File.Create(fileToCompress & ".deflated") + Using input As Stream = File.OpenRead(fileToCompress) + Using compressor As Stream = New DeflateStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, True) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + ' can write additional data to the output stream here. + End Using + + + The stream which will be read or written. + Indicates whether the DeflateStream will compress or decompress. + true if the application would like the stream to remain open after inflation/deflation. + A tuning knob to trade speed for effectiveness. + + + + Dispose the stream. + + + + This may or may not result in a Close() call on the captive + stream. See the constructors that have a leaveOpen parameter + for more information. + + + Application code won't call this code directly. This method may be + invoked in two distinct scenarios. If disposing == true, the method + has been called directly or indirectly by a user's code, for example + via the public Dispose() method. In this case, both managed and + unmanaged resources can be referenced and disposed. If disposing == + false, the method has been called by the runtime from inside the + object finalizer and this method should not reference other objects; + in that case only unmanaged resources must be referenced or + disposed. + + + + true if the Dispose method was invoked by user code. + + + + + Flush the stream. + + + + + Read data from the stream. + + + + + If you wish to use the DeflateStream to compress data while + reading, you can create a DeflateStream with + CompressionMode.Compress, providing an uncompressed data stream. + Then call Read() on that DeflateStream, and the data read will be + compressed as you read. If you wish to use the DeflateStream to + decompress data while reading, you can create a DeflateStream with + CompressionMode.Decompress, providing a readable compressed data + stream. Then call Read() on that DeflateStream, and the data read + will be decompressed as you read. + + + + A DeflateStream can be used for Read() or Write(), but not both. + + + + The buffer into which the read data should be placed. + the offset within that data array to put the first byte read. + the number of bytes to read. + the number of bytes actually read + + + + Calling this method always throws a . + + this is irrelevant, since it will always throw! + this is irrelevant, since it will always throw! + irrelevant! + + + + Calling this method always throws a . + + this is irrelevant, since it will always throw! + + + + Write data to the stream. + + + + + If you wish to use the DeflateStream to compress data while + writing, you can create a DeflateStream with + CompressionMode.Compress, and a writable output stream. Then call + Write() on that DeflateStream, providing uncompressed data + as input. The data sent to the output stream will be the compressed form + of the data written. If you wish to use the DeflateStream to + decompress data while writing, you can create a DeflateStream with + CompressionMode.Decompress, and a writable output stream. Then + call Write() on that stream, providing previously compressed + data. The data sent to the output stream will be the decompressed form of + the data written. + + + + A DeflateStream can be used for Read() or Write(), + but not both. + + + + + The buffer holding data to write to the stream. + the offset within that data array to find the first byte to write. + the number of bytes to write. + + + + Compress a string into a byte array using DEFLATE (RFC 1951). + + + + Uncompress it with . + + + DeflateStream.UncompressString(byte[]) + DeflateStream.CompressBuffer(byte[]) + GZipStream.CompressString(string) + ZlibStream.CompressString(string) + + + A string to compress. The string will first be encoded + using UTF8, then compressed. + + + The string in compressed form + + + + Compress a byte array into a new byte array using DEFLATE. + + + + Uncompress it with . + + + DeflateStream.CompressString(string) + DeflateStream.UncompressBuffer(byte[]) + GZipStream.CompressBuffer(byte[]) + ZlibStream.CompressBuffer(byte[]) + + + A buffer to compress. + + + The data in compressed form + + + + Uncompress a DEFLATE'd byte array into a single string. + + + DeflateStream.CompressString(String) + DeflateStream.UncompressBuffer(byte[]) + GZipStream.UncompressString(byte[]) + ZlibStream.UncompressString(byte[]) + + + A buffer containing DEFLATE-compressed data. + + + The uncompressed string + + + + Uncompress a DEFLATE'd byte array into a byte array. + + + DeflateStream.CompressBuffer(byte[]) + DeflateStream.UncompressString(byte[]) + GZipStream.UncompressBuffer(byte[]) + ZlibStream.UncompressBuffer(byte[]) + + + A buffer containing data that has been compressed with DEFLATE. + + + The data in uncompressed form + + + + This property sets the flush behavior on the stream. + + See the ZLIB documentation for the meaning of the flush behavior. + + + + + The size of the working buffer for the compression codec. + + + + + The working buffer is used for all stream operations. The default size is + 1024 bytes. The minimum size is 128 bytes. You may get better performance + with a larger buffer. Then again, you might not. You would have to test + it. + + + + Set this before the first call to Read() or Write() on the + stream. If you try to set it afterwards, it will throw. + + + + + + The ZLIB strategy to be used during compression. + + + + By tweaking this parameter, you may be able to optimize the compression for + data with particular characteristics. + + + + Returns the total number of bytes input so far. + + + Returns the total number of bytes output so far. + + + + Indicates whether the stream can be read. + + + The return value depends on whether the captive stream supports reading. + + + + + Indicates whether the stream supports Seek operations. + + + Always returns false. + + + + + Indicates whether the stream can be written. + + + The return value depends on whether the captive stream supports writing. + + + + + Reading this property always throws a . + + + + + The position of the stream pointer. + + + + Setting this property always throws a . Reading will return the total bytes + written out, if used in writing, or the total bytes read in, if used in + reading. The count may refer to compressed bytes or uncompressed bytes, + depending on how you've used the stream. + + + + + A class for compressing and decompressing GZIP streams. + + + + + The GZipStream is a Decorator on a + . It adds GZIP compression or decompression to any + stream. + + + + Like the System.IO.Compression.GZipStream in the .NET Base Class Library, the + Ionic.Zlib.GZipStream can compress while writing, or decompress while + reading, but not vice versa. The compression method used is GZIP, which is + documented in IETF RFC + 1952, "GZIP file format specification version 4.3". + + + A GZipStream can be used to decompress data (through Read()) or + to compress data (through Write()), but not both. + + + + If you wish to use the GZipStream to compress data, you must wrap it + around a write-able stream. As you call Write() on the GZipStream, the + data will be compressed into the GZIP format. If you want to decompress data, + you must wrap the GZipStream around a readable stream that contains an + IETF RFC 1952-compliant stream. The data will be decompressed as you call + Read() on the GZipStream. + + + + Though the GZIP format allows data from multiple files to be concatenated + together, this stream handles only a single segment of GZIP format, typically + representing a single file. + + + + This class is similar to and . + ZlibStream handles RFC1950-compliant streams. + handles RFC1951-compliant streams. This class handles RFC1952-compliant streams. + + + + + + + + + + The last modified time for the GZIP stream. + + + + GZIP allows the storage of a last modified time with each GZIP entry. + When compressing data, you can set this before the first call to + Write(). When decompressing, you can retrieve this value any time + after the first call to Read(). + + + + + Create a GZipStream using the specified CompressionMode. + + + + + When mode is CompressionMode.Compress, the GZipStream will use the + default compression level. + + + + As noted in the class documentation, the CompressionMode (Compress + or Decompress) also establishes the "direction" of the stream. A + GZipStream with CompressionMode.Compress works only through + Write(). A GZipStream with + CompressionMode.Decompress works only through Read(). + + + + + + This example shows how to use a GZipStream to compress data. + + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(outputFile)) + { + using (Stream compressor = new GZipStream(raw, CompressionMode.Compress)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n; + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + Dim outputFile As String = (fileToCompress & ".compressed") + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(outputFile) + Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + + + This example shows how to use a GZipStream to uncompress a file. + + private void GunZipFile(string filename) + { + if (!filename.EndsWith(".gz)) + throw new ArgumentException("filename"); + var DecompressedFile = filename.Substring(0,filename.Length-3); + byte[] working = new byte[WORKING_BUFFER_SIZE]; + int n= 1; + using (System.IO.Stream input = System.IO.File.OpenRead(filename)) + { + using (Stream decompressor= new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, true)) + { + using (var output = System.IO.File.Create(DecompressedFile)) + { + while (n !=0) + { + n= decompressor.Read(working, 0, working.Length); + if (n > 0) + { + output.Write(working, 0, n); + } + } + } + } + } + } + + + + Private Sub GunZipFile(ByVal filename as String) + If Not (filename.EndsWith(".gz)) Then + Throw New ArgumentException("filename") + End If + Dim DecompressedFile as String = filename.Substring(0,filename.Length-3) + Dim working(WORKING_BUFFER_SIZE) as Byte + Dim n As Integer = 1 + Using input As Stream = File.OpenRead(filename) + Using decompressor As Stream = new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, True) + Using output As Stream = File.Create(UncompressedFile) + Do + n= decompressor.Read(working, 0, working.Length) + If n > 0 Then + output.Write(working, 0, n) + End IF + Loop While (n > 0) + End Using + End Using + End Using + End Sub + + + + The stream which will be read or written. + Indicates whether the GZipStream will compress or decompress. + + + + Create a GZipStream using the specified CompressionMode and + the specified CompressionLevel. + + + + + The CompressionMode (Compress or Decompress) also establishes the + "direction" of the stream. A GZipStream with + CompressionMode.Compress works only through Write(). A + GZipStream with CompressionMode.Decompress works only + through Read(). + + + + + + + This example shows how to use a GZipStream to compress a file into a .gz file. + + + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(fileToCompress + ".gz")) + { + using (Stream compressor = new GZipStream(raw, + CompressionMode.Compress, + CompressionLevel.BestCompression)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n; + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(fileToCompress & ".gz") + Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + The stream to be read or written while deflating or inflating. + Indicates whether the GZipStream will compress or decompress. + A tuning knob to trade speed for effectiveness. + + + + Create a GZipStream using the specified CompressionMode, and + explicitly specify whether the stream should be left open after Deflation + or Inflation. + + + + + This constructor allows the application to request that the captive stream + remain open after the deflation or inflation occurs. By default, after + Close() is called on the stream, the captive stream is also + closed. In some cases this is not desired, for example if the stream is a + memory stream that will be re-read after compressed data has been written + to it. Specify true for the parameter to leave + the stream open. + + + + The (Compress or Decompress) also + establishes the "direction" of the stream. A GZipStream with + CompressionMode.Compress works only through Write(). A GZipStream + with CompressionMode.Decompress works only through Read(). + + + + The GZipStream will use the default compression level. If you want + to specify the compression level, see . + + + + See the other overloads of this constructor for example code. + + + + + + The stream which will be read or written. This is called the "captive" + stream in other places in this documentation. + + + Indicates whether the GZipStream will compress or decompress. + + + + true if the application would like the base stream to remain open after + inflation/deflation. + + + + + Create a GZipStream using the specified CompressionMode and the + specified CompressionLevel, and explicitly specify whether the + stream should be left open after Deflation or Inflation. + + + + + + This constructor allows the application to request that the captive stream + remain open after the deflation or inflation occurs. By default, after + Close() is called on the stream, the captive stream is also + closed. In some cases this is not desired, for example if the stream is a + memory stream that will be re-read after compressed data has been written + to it. Specify true for the parameter to + leave the stream open. + + + + As noted in the class documentation, the CompressionMode (Compress + or Decompress) also establishes the "direction" of the stream. A + GZipStream with CompressionMode.Compress works only through + Write(). A GZipStream with CompressionMode.Decompress works only + through Read(). + + + + + + This example shows how to use a GZipStream to compress data. + + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(outputFile)) + { + using (Stream compressor = new GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression, true)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n; + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + Dim outputFile As String = (fileToCompress & ".compressed") + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(outputFile) + Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression, True) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + The stream which will be read or written. + Indicates whether the GZipStream will compress or decompress. + true if the application would like the stream to remain open after inflation/deflation. + A tuning knob to trade speed for effectiveness. + + + + Dispose the stream. + + + + This may or may not result in a Close() call on the captive + stream. See the constructors that have a leaveOpen parameter + for more information. + + + This method may be invoked in two distinct scenarios. If disposing + == true, the method has been called directly or indirectly by a + user's code, for example via the public Dispose() method. In this + case, both managed and unmanaged resources can be referenced and + disposed. If disposing == false, the method has been called by the + runtime from inside the object finalizer and this method should not + reference other objects; in that case only unmanaged resources must + be referenced or disposed. + + + + indicates whether the Dispose method was invoked by user code. + + + + + Flush the stream. + + + + + Read and decompress data from the source stream. + + + + With a GZipStream, decompression is done through reading. + + + + + byte[] working = new byte[WORKING_BUFFER_SIZE]; + using (System.IO.Stream input = System.IO.File.OpenRead(_CompressedFile)) + { + using (Stream decompressor= new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, true)) + { + using (var output = System.IO.File.Create(_DecompressedFile)) + { + int n; + while ((n= decompressor.Read(working, 0, working.Length)) !=0) + { + output.Write(working, 0, n); + } + } + } + } + + + The buffer into which the decompressed data should be placed. + the offset within that data array to put the first byte read. + the number of bytes to read. + the number of bytes actually read + + + + Calling this method always throws a . + + irrelevant; it will always throw! + irrelevant; it will always throw! + irrelevant! + + + + Calling this method always throws a . + + irrelevant; this method will always throw! + + + + Write data to the stream. + + + + + If you wish to use the GZipStream to compress data while writing, + you can create a GZipStream with CompressionMode.Compress, and a + writable output stream. Then call Write() on that GZipStream, + providing uncompressed data as input. The data sent to the output stream + will be the compressed form of the data written. + + + + A GZipStream can be used for Read() or Write(), but not + both. Writing implies compression. Reading implies decompression. + + + + The buffer holding data to write to the stream. + the offset within that data array to find the first byte to write. + the number of bytes to write. + + + + Compress a string into a byte array using GZip. + + + + Uncompress it with . + + + + + + + A string to compress. The string will first be encoded + using UTF8, then compressed. + + + The string in compressed form + + + + Compress a byte array into a new byte array using GZip. + + + + Uncompress it with . + + + + + + + A buffer to compress. + + + The data in compressed form + + + + Uncompress a GZip'ed byte array into a single string. + + + + + + + A buffer containing GZIP-compressed data. + + + The uncompressed string + + + + Uncompress a GZip'ed byte array into a byte array. + + + + + + + A buffer containing data that has been compressed with GZip. + + + The data in uncompressed form + + + + The comment on the GZIP stream. + + + + + The GZIP format allows for each file to optionally have an associated + comment stored with the file. The comment is encoded with the ISO-8859-1 + code page. To include a comment in a GZIP stream you create, set this + property before calling Write() for the first time on the + GZipStream. + + + + When using GZipStream to decompress, you can retrieve this property + after the first call to Read(). If no comment has been set in the + GZIP bytestream, the Comment property will return null + (Nothing in VB). + + + + + + The FileName for the GZIP stream. + + + + + + The GZIP format optionally allows each file to have an associated + filename. When compressing data (through Write()), set this + FileName before calling Write() the first time on the GZipStream. + The actual filename is encoded into the GZIP bytestream with the + ISO-8859-1 code page, according to RFC 1952. It is the application's + responsibility to insure that the FileName can be encoded and decoded + correctly with this code page. + + + + When decompressing (through Read()), you can retrieve this value + any time after the first Read(). In the case where there was no filename + encoded into the GZIP bytestream, the property will return null (Nothing + in VB). + + + + + + The CRC on the GZIP stream. + + + This is used for internal error checking. You probably don't need to look at this property. + + + + + This property sets the flush behavior on the stream. + + + + + The size of the working buffer for the compression codec. + + + + + The working buffer is used for all stream operations. The default size is + 1024 bytes. The minimum size is 128 bytes. You may get better performance + with a larger buffer. Then again, you might not. You would have to test + it. + + + + Set this before the first call to Read() or Write() on the + stream. If you try to set it afterwards, it will throw. + + + + + Returns the total number of bytes input so far. + + + Returns the total number of bytes output so far. + + + + Indicates whether the stream can be read. + + + The return value depends on whether the captive stream supports reading. + + + + + Indicates whether the stream supports Seek operations. + + + Always returns false. + + + + + Indicates whether the stream can be written. + + + The return value depends on whether the captive stream supports writing. + + + + + Reading this property always throws a . + + + + + The position of the stream pointer. + + + + Setting this property always throws a . Reading will return the total bytes + written out, if used in writing, or the total bytes read in, if used in + reading. The count may refer to compressed bytes or uncompressed bytes, + depending on how you've used the stream. + + + + + A class for compressing streams using the + Deflate algorithm with multiple threads. + + + + + This class performs DEFLATE compression through writing. For + more information on the Deflate algorithm, see IETF RFC 1951, + "DEFLATE Compressed Data Format Specification version 1.3." + + + + This class is similar to , except + that this class is for compression only, and this implementation uses an + approach that employs multiple worker threads to perform the DEFLATE. On + a multi-cpu or multi-core computer, the performance of this class can be + significantly higher than the single-threaded DeflateStream, particularly + for larger streams. How large? Anything over 10mb is a good candidate + for parallel compression. + + + + The tradeoff is that this class uses more memory and more CPU than the + vanilla DeflateStream, and also is less efficient as a compressor. For + large files the size of the compressed data stream can be less than 1% + larger than the size of a compressed data stream from the vanialla + DeflateStream. For smaller files the difference can be larger. The + difference will also be larger if you set the BufferSize to be lower than + the default value. Your mileage may vary. Finally, for small files, the + ParallelDeflateOutputStream can be much slower than the vanilla + DeflateStream, because of the overhead associated to using the thread + pool. + + + + + + + + Create a ParallelDeflateOutputStream. + + + + + This stream compresses data written into it via the DEFLATE + algorithm (see RFC 1951), and writes out the compressed byte stream. + + + + The instance will use the default compression level, the default + buffer sizes and the default number of threads and buffers per + thread. + + + + This class is similar to , + except that this implementation uses an approach that employs + multiple worker threads to perform the DEFLATE. On a multi-cpu or + multi-core computer, the performance of this class can be + significantly higher than the single-threaded DeflateStream, + particularly for larger streams. How large? Anything over 10mb is + a good candidate for parallel compression. + + + + + + + This example shows how to use a ParallelDeflateOutputStream to compress + data. It reads a file, compresses it, and writes the compressed data to + a second, output file. + + + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n= -1; + String outputFile = fileToCompress + ".compressed"; + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(outputFile)) + { + using (Stream compressor = new ParallelDeflateOutputStream(raw)) + { + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Dim outputFile As String = (fileToCompress & ".compressed") + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(outputFile) + Using compressor As Stream = New ParallelDeflateOutputStream(raw) + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + The stream to which compressed data will be written. + + + + Create a ParallelDeflateOutputStream using the specified CompressionLevel. + + + See the + constructor for example code. + + The stream to which compressed data will be written. + A tuning knob to trade speed for effectiveness. + + + + Create a ParallelDeflateOutputStream and specify whether to leave the captive stream open + when the ParallelDeflateOutputStream is closed. + + + See the + constructor for example code. + + The stream to which compressed data will be written. + + true if the application would like the stream to remain open after inflation/deflation. + + + + + Create a ParallelDeflateOutputStream and specify whether to leave the captive stream open + when the ParallelDeflateOutputStream is closed. + + + See the + constructor for example code. + + The stream to which compressed data will be written. + A tuning knob to trade speed for effectiveness. + + true if the application would like the stream to remain open after inflation/deflation. + + + + + Create a ParallelDeflateOutputStream using the specified + CompressionLevel and CompressionStrategy, and specifying whether to + leave the captive stream open when the ParallelDeflateOutputStream is + closed. + + + See the + constructor for example code. + + The stream to which compressed data will be written. + A tuning knob to trade speed for effectiveness. + + By tweaking this parameter, you may be able to optimize the compression for + data with particular characteristics. + + + true if the application would like the stream to remain open after inflation/deflation. + + + + + Write data to the stream. + + + + + + To use the ParallelDeflateOutputStream to compress data, create a + ParallelDeflateOutputStream with CompressionMode.Compress, passing a + writable output stream. Then call Write() on that + ParallelDeflateOutputStream, providing uncompressed data as input. The + data sent to the output stream will be the compressed form of the data + written. + + + + To decompress data, use the class. + + + + The buffer holding data to write to the stream. + the offset within that data array to find the first byte to write. + the number of bytes to write. + + + + Flush the stream. + + + + + Close the stream. + + + You must call Close on the stream to guarantee that all of the data written in has + been compressed, and the compressed data has been written out. + + + + Dispose the object + + + Because ParallelDeflateOutputStream is IDisposable, the + application must call this method when finished using the instance. + + + This method is generally called implicitly upon exit from + a using scope in C# (Using in VB). + + + + + The Dispose method + + indicates whether the Dispose method was invoked by user code. + + + + + Resets the stream for use with another stream. + + + Because the ParallelDeflateOutputStream is expensive to create, it + has been designed so that it can be recycled and re-used. You have + to call Close() on the stream first, then you can call Reset() on + it, to use it again on another stream. + + + + The new output stream for this era. + + + + + ParallelDeflateOutputStream deflater = null; + foreach (var inputFile in listOfFiles) + { + string outputFile = inputFile + ".compressed"; + using (System.IO.Stream input = System.IO.File.OpenRead(inputFile)) + { + using (var outStream = System.IO.File.Create(outputFile)) + { + if (deflater == null) + deflater = new ParallelDeflateOutputStream(outStream, + CompressionLevel.Best, + CompressionStrategy.Default, + true); + deflater.Reset(outStream); + + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + deflater.Write(buffer, 0, n); + } + } + } + } + + + + + + This method always throws a NotSupportedException. + + + The buffer into which data would be read, IF THIS METHOD + ACTUALLY DID ANYTHING. + + + The offset within that data array at which to insert the + data that is read, IF THIS METHOD ACTUALLY DID + ANYTHING. + + + The number of bytes to write, IF THIS METHOD ACTUALLY DID + ANYTHING. + + nothing. + + + + This method always throws a NotSupportedException. + + + The offset to seek to.... + IF THIS METHOD ACTUALLY DID ANYTHING. + + + The reference specifying how to apply the offset.... IF + THIS METHOD ACTUALLY DID ANYTHING. + + nothing. It always throws. + + + + This method always throws a NotSupportedException. + + + The new value for the stream length.... IF + THIS METHOD ACTUALLY DID ANYTHING. + + + + + The ZLIB strategy to be used during compression. + + + + + + The maximum number of buffer pairs to use. + + + + + This property sets an upper limit on the number of memory buffer + pairs to create. The implementation of this stream allocates + multiple buffers to facilitate parallel compression. As each buffer + fills up, this stream uses + ThreadPool.QueueUserWorkItem() + to compress those buffers in a background threadpool thread. After a + buffer is compressed, it is re-ordered and written to the output + stream. + + + + A higher number of buffer pairs enables a higher degree of + parallelism, which tends to increase the speed of compression on + multi-cpu computers. On the other hand, a higher number of buffer + pairs also implies a larger memory consumption, more active worker + threads, and a higher cpu utilization for any compression. This + property enables the application to limit its memory consumption and + CPU utilization behavior depending on requirements. + + + + For each compression "task" that occurs in parallel, there are 2 + buffers allocated: one for input and one for output. This property + sets a limit for the number of pairs. The total amount of storage + space allocated for buffering will then be (N*S*2), where N is the + number of buffer pairs, S is the size of each buffer (). By default, DotNetZip allocates 4 buffer + pairs per CPU core, so if your machine has 4 cores, and you retain + the default buffer size of 128k, then the + ParallelDeflateOutputStream will use 4 * 4 * 2 * 128kb of buffer + memory in total, or 4mb, in blocks of 128kb. If you then set this + property to 8, then the number will be 8 * 2 * 128kb of buffer + memory, or 2mb. + + + + CPU utilization will also go up with additional buffers, because a + larger number of buffer pairs allows a larger number of background + threads to compress in parallel. If you find that parallel + compression is consuming too much memory or CPU, you can adjust this + value downward. + + + + The default value is 16. Different values may deliver better or + worse results, depending on your priorities and the dynamic + performance characteristics of your storage and compute resources. + + + + This property is not the number of buffer pairs to use; it is an + upper limit. An illustration: Suppose you have an application that + uses the default value of this property (which is 16), and it runs + on a machine with 2 CPU cores. In that case, DotNetZip will allocate + 4 buffer pairs per CPU core, for a total of 8 pairs. The upper + limit specified by this property has no effect. + + + + The application can set this value at any time, but it is effective + only before the first call to Write(), which is when the buffers are + allocated. + + + + + + The size of the buffers used by the compressor threads. + + + + + The default buffer size is 128k. The application can set this value + at any time, but it is effective only before the first Write(). + + + + Larger buffer sizes implies larger memory consumption but allows + more efficient compression. Using smaller buffer sizes consumes less + memory but may result in less effective compression. For example, + using the default buffer size of 128k, the compression delivered is + within 1% of the compression delivered by the single-threaded . On the other hand, using a + BufferSize of 8k can result in a compressed data stream that is 5% + larger than that delivered by the single-threaded + DeflateStream. Excessively small buffer sizes can also cause + the speed of the ParallelDeflateOutputStream to drop, because of + larger thread scheduling overhead dealing with many many small + buffers. + + + + The total amount of storage space allocated for buffering will be + (N*S*2), where N is the number of buffer pairs, and S is the size of + each buffer (this property). There are 2 buffers used by the + compressor, one for input and one for output. By default, DotNetZip + allocates 4 buffer pairs per CPU core, so if your machine has 4 + cores, then the number of buffer pairs used will be 16. If you + accept the default value of this property, 128k, then the + ParallelDeflateOutputStream will use 16 * 2 * 128kb of buffer memory + in total, or 4mb, in blocks of 128kb. If you set this property to + 64kb, then the number will be 16 * 2 * 64kb of buffer memory, or + 2mb. + + + + + + + The CRC32 for the data that was written out, prior to compression. + + + This value is meaningful only after a call to Close(). + + + + + The total number of uncompressed bytes processed by the ParallelDeflateOutputStream. + + + This value is meaningful only after a call to Close(). + + + + + Indicates whether the stream supports Seek operations. + + + Always returns false. + + + + + Indicates whether the stream supports Read operations. + + + Always returns false. + + + + + Indicates whether the stream supports Write operations. + + + Returns true if the provided stream is writable. + + + + + Reading this property always throws a NotSupportedException. + + + + + Returns the current position of the output stream. + + + + Because the output gets written by a background thread, + the value may change asynchronously. Setting this + property always throws a NotSupportedException. + + + + + + Map from a distance to a distance code. + + + No side effects. _dist_code[256] and _dist_code[257] are never used. + + + + + Describes how to flush the current deflate operation. + + + The different FlushType values are useful when using a Deflate in a streaming application. + + + + No flush at all. + + + Closes the current block, but doesn't flush it to + the output. Used internally only in hypothetical + scenarios. This was supposed to be removed by Zlib, but it is + still in use in some edge cases. + + + + + Use this during compression to specify that all pending output should be + flushed to the output buffer and the output should be aligned on a byte + boundary. You might use this in a streaming communication scenario, so that + the decompressor can get all input data available so far. When using this + with a ZlibCodec, AvailableBytesIn will be zero after the call if + enough output space has been provided before the call. Flushing will + degrade compression and so it should be used only when necessary. + + + + + Use this during compression to specify that all output should be flushed, as + with FlushType.Sync, but also, the compression state should be reset + so that decompression can restart from this point if previous compressed + data has been damaged or if random access is desired. Using + FlushType.Full too often can significantly degrade the compression. + + + + Signals the end of the compression/decompression stream. + + + + The compression level to be used when using a DeflateStream or ZlibStream with CompressionMode.Compress. + + + + + None means that the data will be simply stored, with no change at all. + If you are producing ZIPs for use on Mac OSX, be aware that archives produced with CompressionLevel.None + cannot be opened with the default zip reader. Use a different CompressionLevel. + + + + + Same as None. + + + + + The fastest but least effective compression. + + + + + A synonym for BestSpeed. + + + + + A little slower, but better, than level 1. + + + + + A little slower, but better, than level 2. + + + + + A little slower, but better, than level 3. + + + + + A little slower than level 4, but with better compression. + + + + + The default compression level, with a good balance of speed and compression efficiency. + + + + + A synonym for Default. + + + + + Pretty good compression! + + + + + Better compression than Level7! + + + + + The "best" compression, where best means greatest reduction in size of the input data stream. + This is also the slowest compression. + + + + + A synonym for BestCompression. + + + + + Describes options for how the compression algorithm is executed. Different strategies + work better on different sorts of data. The strategy parameter can affect the compression + ratio and the speed of compression but not the correctness of the compresssion. + + + + + The default strategy is probably the best for normal data. + + + + + The Filtered strategy is intended to be used most effectively with data produced by a + filter or predictor. By this definition, filtered data consists mostly of small + values with a somewhat random distribution. In this case, the compression algorithm + is tuned to compress them better. The effect of Filtered is to force more Huffman + coding and less string matching; it is a half-step between Default and HuffmanOnly. + + + + + Using HuffmanOnly will force the compressor to do Huffman encoding only, with no + string matching. + + + + + An enum to specify the direction of transcoding - whether to compress or decompress. + + + + + Used to specify that the stream should compress the data. + + + + + Used to specify that the stream should decompress the data. + + + + + A general purpose exception class for exceptions in the Zlib library. + + + + + The ZlibException class captures exception information generated + by the Zlib library. + + + + + This ctor collects a message attached to the exception. + + the message for the exception. + + + + Performs an unsigned bitwise right shift with the specified number + + Number to operate on + Ammount of bits to shift + The resulting number from the shift operation + + + + Reads a number of characters from the current source TextReader and writes + the data to the target array at the specified index. + + + The source TextReader to read from + Contains the array of characteres read from the source TextReader. + The starting index of the target array. + The maximum number of characters to read from the source TextReader. + + + The number of characters read. The number will be less than or equal to + count depending on the data available in the source TextReader. Returns -1 + if the end of the stream is reached. + + + + + Computes an Adler-32 checksum. + + + The Adler checksum is similar to a CRC checksum, but faster to compute, though less + reliable. It is used in producing RFC1950 compressed streams. The Adler checksum + is a required part of the "ZLIB" standard. Applications will almost never need to + use this class directly. + + + + + + + Calculates the Adler32 checksum. + + + + This is used within ZLIB. You probably don't need to use this directly. + + + + To compute an Adler32 checksum on a byte array: + + var adler = Adler.Adler32(0, null, 0, 0); + adler = Adler.Adler32(adler, buffer, index, length); + + + + + + Encoder and Decoder for ZLIB and DEFLATE (IETF RFC1950 and RFC1951). + + + + This class compresses and decompresses data according to the Deflate algorithm + and optionally, the ZLIB format, as documented in RFC 1950 - ZLIB and RFC 1951 - DEFLATE. + + + + + The buffer from which data is taken. + + + + + An index into the InputBuffer array, indicating where to start reading. + + + + + The number of bytes available in the InputBuffer, starting at NextIn. + + + Generally you should set this to InputBuffer.Length before the first Inflate() or Deflate() call. + The class will update this number as calls to Inflate/Deflate are made. + + + + + Total number of bytes read so far, through all calls to Inflate()/Deflate(). + + + + + Buffer to store output data. + + + + + An index into the OutputBuffer array, indicating where to start writing. + + + + + The number of bytes available in the OutputBuffer, starting at NextOut. + + + Generally you should set this to OutputBuffer.Length before the first Inflate() or Deflate() call. + The class will update this number as calls to Inflate/Deflate are made. + + + + + Total number of bytes written to the output so far, through all calls to Inflate()/Deflate(). + + + + + used for diagnostics, when something goes wrong! + + + + + The compression level to use in this codec. Useful only in compression mode. + + + + + The number of Window Bits to use. + + + This gauges the size of the sliding window, and hence the + compression effectiveness as well as memory consumption. It's best to just leave this + setting alone if you don't know what it is. The maximum value is 15 bits, which implies + a 32k window. + + + + + The compression strategy to use. + + + This is only effective in compression. The theory offered by ZLIB is that different + strategies could potentially produce significant differences in compression behavior + for different data sets. Unfortunately I don't have any good recommendations for how + to set it differently. When I tested changing the strategy I got minimally different + compression performance. It's best to leave this property alone if you don't have a + good feel for it. Or, you may want to produce a test harness that runs through the + different strategy options and evaluates them on different file types. If you do that, + let me know your results. + + + + + Create a ZlibCodec. + + + If you use this default constructor, you will later have to explicitly call + InitializeInflate() or InitializeDeflate() before using the ZlibCodec to compress + or decompress. + + + + + Create a ZlibCodec that either compresses or decompresses. + + + Indicates whether the codec should compress (deflate) or decompress (inflate). + + + + + Initialize the inflation state. + + + It is not necessary to call this before using the ZlibCodec to inflate data; + It is implicitly called when you call the constructor. + + Z_OK if everything goes well. + + + + Initialize the inflation state with an explicit flag to + govern the handling of RFC1950 header bytes. + + + + By default, the ZLIB header defined in RFC 1950 is expected. If + you want to read a zlib stream you should specify true for + expectRfc1950Header. If you have a deflate stream, you will want to specify + false. It is only necessary to invoke this initializer explicitly if you + want to specify false. + + + whether to expect an RFC1950 header byte + pair when reading the stream of data to be inflated. + + Z_OK if everything goes well. + + + + Initialize the ZlibCodec for inflation, with the specified number of window bits. + + The number of window bits to use. If you need to ask what that is, + then you shouldn't be calling this initializer. + Z_OK if all goes well. + + + + Initialize the inflation state with an explicit flag to govern the handling of + RFC1950 header bytes. + + + + If you want to read a zlib stream you should specify true for + expectRfc1950Header. In this case, the library will expect to find a ZLIB + header, as defined in RFC + 1950, in the compressed stream. If you will be reading a DEFLATE or + GZIP stream, which does not have such a header, you will want to specify + false. + + + whether to expect an RFC1950 header byte pair when reading + the stream of data to be inflated. + The number of window bits to use. If you need to ask what that is, + then you shouldn't be calling this initializer. + Z_OK if everything goes well. + + + + Inflate the data in the InputBuffer, placing the result in the OutputBuffer. + + + You must have set InputBuffer and OutputBuffer, NextIn and NextOut, and AvailableBytesIn and + AvailableBytesOut before calling this method. + + + + private void InflateBuffer() + { + int bufferSize = 1024; + byte[] buffer = new byte[bufferSize]; + ZlibCodec decompressor = new ZlibCodec(); + + Console.WriteLine("\n============================================"); + Console.WriteLine("Size of Buffer to Inflate: {0} bytes.", CompressedBytes.Length); + MemoryStream ms = new MemoryStream(DecompressedBytes); + + int rc = decompressor.InitializeInflate(); + + decompressor.InputBuffer = CompressedBytes; + decompressor.NextIn = 0; + decompressor.AvailableBytesIn = CompressedBytes.Length; + + decompressor.OutputBuffer = buffer; + + // pass 1: inflate + do + { + decompressor.NextOut = 0; + decompressor.AvailableBytesOut = buffer.Length; + rc = decompressor.Inflate(FlushType.None); + + if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) + throw new Exception("inflating: " + decompressor.Message); + + ms.Write(decompressor.OutputBuffer, 0, buffer.Length - decompressor.AvailableBytesOut); + } + while (decompressor.AvailableBytesIn > 0 || decompressor.AvailableBytesOut == 0); + + // pass 2: finish and flush + do + { + decompressor.NextOut = 0; + decompressor.AvailableBytesOut = buffer.Length; + rc = decompressor.Inflate(FlushType.Finish); + + if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) + throw new Exception("inflating: " + decompressor.Message); + + if (buffer.Length - decompressor.AvailableBytesOut > 0) + ms.Write(buffer, 0, buffer.Length - decompressor.AvailableBytesOut); + } + while (decompressor.AvailableBytesIn > 0 || decompressor.AvailableBytesOut == 0); + + decompressor.EndInflate(); + } + + + + The flush to use when inflating. + Z_OK if everything goes well. + + + + Ends an inflation session. + + + Call this after successively calling Inflate(). This will cause all buffers to be flushed. + After calling this you cannot call Inflate() without a intervening call to one of the + InitializeInflate() overloads. + + Z_OK if everything goes well. + + + + I don't know what this does! + + Z_OK if everything goes well. + + + + Initialize the ZlibCodec for deflation operation. + + + The codec will use the MAX window bits and the default level of compression. + + + + int bufferSize = 40000; + byte[] CompressedBytes = new byte[bufferSize]; + byte[] DecompressedBytes = new byte[bufferSize]; + + ZlibCodec compressor = new ZlibCodec(); + + compressor.InitializeDeflate(CompressionLevel.Default); + + compressor.InputBuffer = System.Text.ASCIIEncoding.ASCII.GetBytes(TextToCompress); + compressor.NextIn = 0; + compressor.AvailableBytesIn = compressor.InputBuffer.Length; + + compressor.OutputBuffer = CompressedBytes; + compressor.NextOut = 0; + compressor.AvailableBytesOut = CompressedBytes.Length; + + while (compressor.TotalBytesIn != TextToCompress.Length && compressor.TotalBytesOut < bufferSize) + { + compressor.Deflate(FlushType.None); + } + + while (true) + { + int rc= compressor.Deflate(FlushType.Finish); + if (rc == ZlibConstants.Z_STREAM_END) break; + } + + compressor.EndDeflate(); + + + + Z_OK if all goes well. You generally don't need to check the return code. + + + + Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel. + + + The codec will use the maximum window bits (15) and the specified + CompressionLevel. It will emit a ZLIB stream as it compresses. + + The compression level for the codec. + Z_OK if all goes well. + + + + Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel, + and the explicit flag governing whether to emit an RFC1950 header byte pair. + + + The codec will use the maximum window bits (15) and the specified CompressionLevel. + If you want to generate a zlib stream, you should specify true for + wantRfc1950Header. In this case, the library will emit a ZLIB + header, as defined in RFC + 1950, in the compressed stream. + + The compression level for the codec. + whether to emit an initial RFC1950 byte pair in the compressed stream. + Z_OK if all goes well. + + + + Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel, + and the specified number of window bits. + + + The codec will use the specified number of window bits and the specified CompressionLevel. + + The compression level for the codec. + the number of window bits to use. If you don't know what this means, don't use this method. + Z_OK if all goes well. + + + + Initialize the ZlibCodec for deflation operation, using the specified + CompressionLevel, the specified number of window bits, and the explicit flag + governing whether to emit an RFC1950 header byte pair. + + + The compression level for the codec. + whether to emit an initial RFC1950 byte pair in the compressed stream. + the number of window bits to use. If you don't know what this means, don't use this method. + Z_OK if all goes well. + + + + Deflate one batch of data. + + + You must have set InputBuffer and OutputBuffer before calling this method. + + + + private void DeflateBuffer(CompressionLevel level) + { + int bufferSize = 1024; + byte[] buffer = new byte[bufferSize]; + ZlibCodec compressor = new ZlibCodec(); + + Console.WriteLine("\n============================================"); + Console.WriteLine("Size of Buffer to Deflate: {0} bytes.", UncompressedBytes.Length); + MemoryStream ms = new MemoryStream(); + + int rc = compressor.InitializeDeflate(level); + + compressor.InputBuffer = UncompressedBytes; + compressor.NextIn = 0; + compressor.AvailableBytesIn = UncompressedBytes.Length; + + compressor.OutputBuffer = buffer; + + // pass 1: deflate + do + { + compressor.NextOut = 0; + compressor.AvailableBytesOut = buffer.Length; + rc = compressor.Deflate(FlushType.None); + + if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) + throw new Exception("deflating: " + compressor.Message); + + ms.Write(compressor.OutputBuffer, 0, buffer.Length - compressor.AvailableBytesOut); + } + while (compressor.AvailableBytesIn > 0 || compressor.AvailableBytesOut == 0); + + // pass 2: finish and flush + do + { + compressor.NextOut = 0; + compressor.AvailableBytesOut = buffer.Length; + rc = compressor.Deflate(FlushType.Finish); + + if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) + throw new Exception("deflating: " + compressor.Message); + + if (buffer.Length - compressor.AvailableBytesOut > 0) + ms.Write(buffer, 0, buffer.Length - compressor.AvailableBytesOut); + } + while (compressor.AvailableBytesIn > 0 || compressor.AvailableBytesOut == 0); + + compressor.EndDeflate(); + + ms.Seek(0, SeekOrigin.Begin); + CompressedBytes = new byte[compressor.TotalBytesOut]; + ms.Read(CompressedBytes, 0, CompressedBytes.Length); + } + + + whether to flush all data as you deflate. Generally you will want to + use Z_NO_FLUSH here, in a series of calls to Deflate(), and then call EndDeflate() to + flush everything. + + Z_OK if all goes well. + + + + End a deflation session. + + + Call this after making a series of one or more calls to Deflate(). All buffers are flushed. + + Z_OK if all goes well. + + + + Reset a codec for another deflation session. + + + Call this to reset the deflation state. For example if a thread is deflating + non-consecutive blocks, you can call Reset() after the Deflate(Sync) of the first + block and before the next Deflate(None) of the second block. + + Z_OK if all goes well. + + + + Set the CompressionStrategy and CompressionLevel for a deflation session. + + the level of compression to use. + the strategy to use for compression. + Z_OK if all goes well. + + + + Set the dictionary to be used for either Inflation or Deflation. + + The dictionary bytes to use. + Z_OK if all goes well. + + + + The Adler32 checksum on the data transferred through the codec so far. You probably don't need to look at this. + + + + + A bunch of constants used in the Zlib interface. + + + + + The maximum number of window bits for the Deflate algorithm. + + + + + The default number of window bits for the Deflate algorithm. + + + + + indicates everything is A-OK + + + + + Indicates that the last operation reached the end of the stream. + + + + + The operation ended in need of a dictionary. + + + + + There was an error with the stream - not enough data, not open and readable, etc. + + + + + There was an error with the data - not enough data, bad data, etc. + + + + + There was an error with the working buffer. + + + + + The size of the working buffer used in the ZlibCodec class. Defaults to 8192 bytes. + + + + + The minimum size of the working buffer used in the ZlibCodec class. Currently it is 128 bytes. + + + + + Represents a Zlib stream for compression or decompression. + + + + + The ZlibStream is a Decorator on a . It adds ZLIB compression or decompression to any + stream. + + + Using this stream, applications can compress or decompress data via + stream Read() and Write() operations. Either compresssion or + decompression can occur through either reading or writing. The compression + format used is ZLIB, which is documented in IETF RFC 1950, "ZLIB Compressed + Data Format Specification version 3.3". This implementation of ZLIB always uses + DEFLATE as the compression method. (see IETF RFC 1951, "DEFLATE + Compressed Data Format Specification version 1.3.") + + + The ZLIB format allows for varying compression methods, window sizes, and dictionaries. + This implementation always uses the DEFLATE compression method, a preset dictionary, + and 15 window bits by default. + + + + This class is similar to , except that it adds the + RFC1950 header and trailer bytes to a compressed stream when compressing, or expects + the RFC1950 header and trailer bytes when decompressing. It is also similar to the + . + + + + + + + + Create a ZlibStream using the specified CompressionMode. + + + + + When mode is CompressionMode.Compress, the ZlibStream + will use the default compression level. The "captive" stream will be + closed when the ZlibStream is closed. + + + + + + This example uses a ZlibStream to compress a file, and writes the + compressed data to another file. + + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(fileToCompress + ".zlib")) + { + using (Stream compressor = new ZlibStream(raw, CompressionMode.Compress)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n; + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(fileToCompress & ".zlib") + Using compressor As Stream = New ZlibStream(raw, CompressionMode.Compress) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + + The stream which will be read or written. + Indicates whether the ZlibStream will compress or decompress. + + + + Create a ZlibStream using the specified CompressionMode and + the specified CompressionLevel. + + + + + + When mode is CompressionMode.Decompress, the level parameter is ignored. + The "captive" stream will be closed when the ZlibStream is closed. + + + + + + This example uses a ZlibStream to compress data from a file, and writes the + compressed data to another file. + + + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (var raw = System.IO.File.Create(fileToCompress + ".zlib")) + { + using (Stream compressor = new ZlibStream(raw, + CompressionMode.Compress, + CompressionLevel.BestCompression)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n; + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + } + + + + Using input As Stream = File.OpenRead(fileToCompress) + Using raw As FileStream = File.Create(fileToCompress & ".zlib") + Using compressor As Stream = New ZlibStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + End Using + + + + The stream to be read or written while deflating or inflating. + Indicates whether the ZlibStream will compress or decompress. + A tuning knob to trade speed for effectiveness. + + + + Create a ZlibStream using the specified CompressionMode, and + explicitly specify whether the captive stream should be left open after + Deflation or Inflation. + + + + + + When mode is CompressionMode.Compress, the ZlibStream will use + the default compression level. + + + + This constructor allows the application to request that the captive stream + remain open after the deflation or inflation occurs. By default, after + Close() is called on the stream, the captive stream is also + closed. In some cases this is not desired, for example if the stream is a + that will be re-read after + compression. Specify true for the parameter to leave the stream + open. + + + + See the other overloads of this constructor for example code. + + + + + The stream which will be read or written. This is called the + "captive" stream in other places in this documentation. + Indicates whether the ZlibStream will compress or decompress. + true if the application would like the stream to remain + open after inflation/deflation. + + + + Create a ZlibStream using the specified CompressionMode + and the specified CompressionLevel, and explicitly specify + whether the stream should be left open after Deflation or Inflation. + + + + + + This constructor allows the application to request that the captive + stream remain open after the deflation or inflation occurs. By + default, after Close() is called on the stream, the captive + stream is also closed. In some cases this is not desired, for example + if the stream is a that will be + re-read after compression. Specify true for the parameter to leave the stream open. + + + + When mode is CompressionMode.Decompress, the level parameter is + ignored. + + + + + + + This example shows how to use a ZlibStream to compress the data from a file, + and store the result into another file. The filestream remains open to allow + additional data to be written to it. + + + using (var output = System.IO.File.Create(fileToCompress + ".zlib")) + { + using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + { + using (Stream compressor = new ZlibStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, true)) + { + byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + int n; + while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + { + compressor.Write(buffer, 0, n); + } + } + } + // can write additional data to the output stream here + } + + + Using output As FileStream = File.Create(fileToCompress & ".zlib") + Using input As Stream = File.OpenRead(fileToCompress) + Using compressor As Stream = New ZlibStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, True) + Dim buffer As Byte() = New Byte(4096) {} + Dim n As Integer = -1 + Do While (n <> 0) + If (n > 0) Then + compressor.Write(buffer, 0, n) + End If + n = input.Read(buffer, 0, buffer.Length) + Loop + End Using + End Using + ' can write additional data to the output stream here. + End Using + + + + The stream which will be read or written. + + Indicates whether the ZlibStream will compress or decompress. + + + true if the application would like the stream to remain open after + inflation/deflation. + + + + A tuning knob to trade speed for effectiveness. This parameter is + effective only when mode is CompressionMode.Compress. + + + + + Dispose the stream. + + + + This may or may not result in a Close() call on the captive + stream. See the constructors that have a leaveOpen parameter + for more information. + + + This method may be invoked in two distinct scenarios. If disposing + == true, the method has been called directly or indirectly by a + user's code, for example via the public Dispose() method. In this + case, both managed and unmanaged resources can be referenced and + disposed. If disposing == false, the method has been called by the + runtime from inside the object finalizer and this method should not + reference other objects; in that case only unmanaged resources must + be referenced or disposed. + + + + indicates whether the Dispose method was invoked by user code. + + + + + Flush the stream. + + + + + Read data from the stream. + + + + + + If you wish to use the ZlibStream to compress data while reading, + you can create a ZlibStream with CompressionMode.Compress, + providing an uncompressed data stream. Then call Read() on that + ZlibStream, and the data read will be compressed. If you wish to + use the ZlibStream to decompress data while reading, you can create + a ZlibStream with CompressionMode.Decompress, providing a + readable compressed data stream. Then call Read() on that + ZlibStream, and the data will be decompressed as it is read. + + + + A ZlibStream can be used for Read() or Write(), but + not both. + + + + + + The buffer into which the read data should be placed. + + + the offset within that data array to put the first byte read. + + the number of bytes to read. + + the number of bytes read + + + + Calling this method always throws a . + + + The offset to seek to.... + IF THIS METHOD ACTUALLY DID ANYTHING. + + + The reference specifying how to apply the offset.... IF + THIS METHOD ACTUALLY DID ANYTHING. + + + nothing. This method always throws. + + + + Calling this method always throws a . + + + The new value for the stream length.... IF + THIS METHOD ACTUALLY DID ANYTHING. + + + + + Write data to the stream. + + + + + + If you wish to use the ZlibStream to compress data while writing, + you can create a ZlibStream with CompressionMode.Compress, + and a writable output stream. Then call Write() on that + ZlibStream, providing uncompressed data as input. The data sent to + the output stream will be the compressed form of the data written. If you + wish to use the ZlibStream to decompress data while writing, you + can create a ZlibStream with CompressionMode.Decompress, and a + writable output stream. Then call Write() on that stream, + providing previously compressed data. The data sent to the output stream + will be the decompressed form of the data written. + + + + A ZlibStream can be used for Read() or Write(), but not both. + + + The buffer holding data to write to the stream. + the offset within that data array to find the first byte to write. + the number of bytes to write. + + + + Compress a string into a byte array using ZLIB. + + + + Uncompress it with . + + + + + + + + A string to compress. The string will first be encoded + using UTF8, then compressed. + + + The string in compressed form + + + + Compress a byte array into a new byte array using ZLIB. + + + + Uncompress it with . + + + + + + + A buffer to compress. + + + The data in compressed form + + + + Uncompress a ZLIB-compressed byte array into a single string. + + + + + + + A buffer containing ZLIB-compressed data. + + + The uncompressed string + + + + Uncompress a ZLIB-compressed byte array into a byte array. + + + + + + + A buffer containing ZLIB-compressed data. + + + The data in uncompressed form + + + + This property sets the flush behavior on the stream. + Sorry, though, not sure exactly how to describe all the various settings. + + + + + The size of the working buffer for the compression codec. + + + + + The working buffer is used for all stream operations. The default size is + 1024 bytes. The minimum size is 128 bytes. You may get better performance + with a larger buffer. Then again, you might not. You would have to test + it. + + + + Set this before the first call to Read() or Write() on the + stream. If you try to set it afterwards, it will throw. + + + + + Returns the total number of bytes input so far. + + + Returns the total number of bytes output so far. + + + + Indicates whether the stream can be read. + + + The return value depends on whether the captive stream supports reading. + + + + + Indicates whether the stream supports Seek operations. + + + Always returns false. + + + + + Indicates whether the stream can be written. + + + The return value depends on whether the captive stream supports writing. + + + + + Reading this property always throws a . + + + + + The position of the stream pointer. + + + + Setting this property always throws a . Reading will return the total bytes + written out, if used in writing, or the total bytes read in, if used in + reading. The count may refer to compressed bytes or uncompressed bytes, + depending on how you've used the stream. + + + + + Computes a CRC-32. The CRC-32 algorithm is parameterized - you + can set the polynomial and enable or disable bit + reversal. This can be used for GZIP, BZip2, or ZIP. + + + This type is used internally by DotNetZip; it is generally not used + directly by applications wishing to create, read, or manipulate zip + archive files. + + + + + Returns the CRC32 for the specified stream. + + The stream over which to calculate the CRC32 + the CRC32 calculation + + + + Returns the CRC32 for the specified stream, and writes the input into the + output stream. + + The stream over which to calculate the CRC32 + The stream into which to deflate the input + the CRC32 calculation + + + + Get the CRC32 for the given (word,byte) combo. This is a + computation defined by PKzip for PKZIP 2.0 (weak) encryption. + + The word to start with. + The byte to combine it with. + The CRC-ized result. + + + + Update the value for the running CRC32 using the given block of bytes. + This is useful when using the CRC32() class in a Stream. + + block of bytes to slurp + starting point in the block + how many bytes within the block to slurp + + + + Process one byte in the CRC. + + the byte to include into the CRC . + + + + Process a run of N identical bytes into the CRC. + + + + This method serves as an optimization for updating the CRC when a + run of identical bytes is found. Rather than passing in a buffer of + length n, containing all identical bytes b, this method accepts the + byte value and the length of the (virtual) buffer - the length of + the run. + + + the byte to include into the CRC. + the number of times that byte should be repeated. + + + + Combines the given CRC32 value with the current running total. + + + This is useful when using a divide-and-conquer approach to + calculating a CRC. Multiple threads can each calculate a + CRC32 on a segment of the data, and then combine the + individual CRC32 values at the end. + + the crc value to be combined with this one + the length of data the CRC value was calculated on + + + + Create an instance of the CRC32 class using the default settings: no + bit reversal, and a polynomial of 0xEDB88320. + + + + + Create an instance of the CRC32 class, specifying whether to reverse + data bits or not. + + + specify true if the instance should reverse data bits. + + + + In the CRC-32 used by BZip2, the bits are reversed. Therefore if you + want a CRC32 with compatibility with BZip2, you should pass true + here. In the CRC-32 used by GZIP and PKZIP, the bits are not + reversed; Therefore if you want a CRC32 with compatibility with + those, you should pass false. + + + + + + Create an instance of the CRC32 class, specifying the polynomial and + whether to reverse data bits or not. + + + The polynomial to use for the CRC, expressed in the reversed (LSB) + format: the highest ordered bit in the polynomial value is the + coefficient of the 0th power; the second-highest order bit is the + coefficient of the 1 power, and so on. Expressed this way, the + polynomial for the CRC-32C used in IEEE 802.3, is 0xEDB88320. + + + specify true if the instance should reverse data bits. + + + + + In the CRC-32 used by BZip2, the bits are reversed. Therefore if you + want a CRC32 with compatibility with BZip2, you should pass true + here for the reverseBits parameter. In the CRC-32 used by + GZIP and PKZIP, the bits are not reversed; Therefore if you want a + CRC32 with compatibility with those, you should pass false for the + reverseBits parameter. + + + + + + Reset the CRC-32 class - clear the CRC "remainder register." + + + + Use this when employing a single instance of this class to compute + multiple, distinct CRCs on multiple, distinct data blocks. + + + + + + Indicates the total number of bytes applied to the CRC. + + + + + Indicates the current CRC for all blocks slurped in. + + + + + A Stream that calculates a CRC32 (a checksum) on all bytes read, + or on all bytes written. + + + + + This class can be used to verify the CRC of a ZipEntry when + reading from a stream, or to calculate a CRC when writing to a + stream. The stream should be used to either read, or write, but + not both. If you intermix reads and writes, the results are not + defined. + + + + This class is intended primarily for use internally by the + DotNetZip library. + + + + + + The default constructor. + + + + Instances returned from this constructor will leave the underlying + stream open upon Close(). The stream uses the default CRC32 + algorithm, which implies a polynomial of 0xEDB88320. + + + The underlying stream + + + + The constructor allows the caller to specify how to handle the + underlying stream at close. + + + + The stream uses the default CRC32 algorithm, which implies a + polynomial of 0xEDB88320. + + + The underlying stream + true to leave the underlying stream + open upon close of the CrcCalculatorStream; false otherwise. + + + + A constructor allowing the specification of the length of the stream + to read. + + + + The stream uses the default CRC32 algorithm, which implies a + polynomial of 0xEDB88320. + + + Instances returned from this constructor will leave the underlying + stream open upon Close(). + + + The underlying stream + The length of the stream to slurp + + + + A constructor allowing the specification of the length of the stream + to read, as well as whether to keep the underlying stream open upon + Close(). + + + + The stream uses the default CRC32 algorithm, which implies a + polynomial of 0xEDB88320. + + + The underlying stream + The length of the stream to slurp + true to leave the underlying stream + open upon close of the CrcCalculatorStream; false otherwise. + + + + A constructor allowing the specification of the length of the stream + to read, as well as whether to keep the underlying stream open upon + Close(), and the CRC32 instance to use. + + + + The stream uses the specified CRC32 instance, which allows the + application to specify how the CRC gets calculated. + + + The underlying stream + The length of the stream to slurp + true to leave the underlying stream + open upon close of the CrcCalculatorStream; false otherwise. + the CRC32 instance to use to calculate the CRC32 + + + + Read from the stream + + the buffer to read + the offset at which to start + the number of bytes to read + the number of bytes actually read + + + + Write to the stream. + + the buffer from which to write + the offset at which to start writing + the number of bytes to write + + + + Flush the stream. + + + + + Seeking is not supported on this stream. This method always throws + + + N/A + N/A + N/A + + + + This method always throws + + + N/A + + + + Closes the stream. + + + + + Gets the total number of bytes run through the CRC32 calculator. + + + + This is either the total number of bytes read, or the total number of + bytes written, depending on the direction of this stream. + + + + + Provides the current CRC for all blocks slurped in. + + + + The running total of the CRC is kept as data is written or read + through the stream. read this property after all reads or writes to + get an accurate CRC for the entire stream. + + + + + + Indicates whether the underlying stream will be left open when the + CrcCalculatorStream is Closed. + + + + Set this at any point before calling . + + + + + + Indicates whether the stream supports reading. + + + + + Indicates whether the stream supports seeking. + + + + Always returns false. + + + + + + Indicates whether the stream supports writing. + + + + + Returns the length of the underlying stream. + + + + + The getter for this property returns the total bytes read. + If you use the setter, it will throw + . + + +
+
diff --git a/lib/dotnetzip/License.txt b/lib/dotnetzip/License.txt index a82dcd3b56d..c3103fd07de 100644 --- a/lib/dotnetzip/License.txt +++ b/lib/dotnetzip/License.txt @@ -1,33 +1,33 @@ -Microsoft Public License (Ms-PL) - -This license governs use of the accompanying software, the DotNetZip library ("the software"). If you use the software, you accept this license. If you do not accept the license, do not use the software. - -1. Definitions - -The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. - -A "contribution" is the original software, or any additions or changes to the software. - -A "contributor" is any person that distributes its contribution under this license. - -"Licensed patents" are a contributor's patent claims that read directly on its contribution. - -2. Grant of Rights - -(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. - -(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. - -3. Conditions and Limitations - -(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. - -(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. - -(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. - -(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. - -(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. - - +Microsoft Public License (Ms-PL) + +This license governs use of the accompanying software, the DotNetZip library ("the software"). If you use the software, you accept this license. If you do not accept the license, do not use the software. + +1. Definitions + +The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. + +A "contribution" is the original software, or any additions or changes to the software. + +A "contributor" is any person that distributes its contribution under this license. + +"Licensed patents" are a contributor's patent claims that read directly on its contribution. + +2. Grant of Rights + +(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. + +(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. + +3. Conditions and Limitations + +(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. + +(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. + +(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. + +(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. + +(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. + + diff --git a/lib/fluentpath/license.txt b/lib/fluentpath/license.txt index a4cc1d54ff1..a7380237913 100644 --- a/lib/fluentpath/license.txt +++ b/lib/fluentpath/license.txt @@ -1,23 +1,23 @@ -Microsoft Public License (Ms-PL) - - -This license governs use of the accompanying software. If you use the software, you -accept this license. If you do not accept the license, do not use the software. - -1. Definitions -The terms "reproduce," "reproduction," "derivative works," and "distribution" have the -same meaning here as under U.S. copyright law. -A "contribution" is the original software, or any additions or changes to the software. -A "contributor" is any person that distributes its contribution under this license. -"Licensed patents" are a contributor's patent claims that read directly on its contribution. - -2. Grant of Rights -(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. -(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. - -3. Conditions and Limitations -(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. -(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. -(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. -(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. +Microsoft Public License (Ms-PL) + + +This license governs use of the accompanying software. If you use the software, you +accept this license. If you do not accept the license, do not use the software. + +1. Definitions +The terms "reproduce," "reproduction," "derivative works," and "distribution" have the +same meaning here as under U.S. copyright law. +A "contribution" is the original software, or any additions or changes to the software. +A "contributor" is any person that distributes its contribution under this license. +"Licensed patents" are a contributor's patent claims that read directly on its contribution. + +2. Grant of Rights +(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. +(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. + +3. Conditions and Limitations +(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. +(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. +(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. +(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. \ No newline at end of file diff --git a/lib/html5shim/html5.js b/lib/html5shim/html5.js index 421ad639941..852646e46ac 100644 --- a/lib/html5shim/html5.js +++ b/lib/html5shim/html5.js @@ -1,3 +1,3 @@ -// html5shiv MIT @rem remysharp.com/html5-enabling-script -// iepp v1.5.1 MIT @jon_neal iecss.com/print-protector +// html5shiv MIT @rem remysharp.com/html5-enabling-script +// iepp v1.5.1 MIT @jon_neal iecss.com/print-protector /*@cc_on(function(p,e){var q=e.createElement("div");q.innerHTML="i";q.childNodes.length!==1&&function(){function r(a,b){if(g[a])g[a].styleSheet.cssText+=b;else{var c=s[l],d=e[j]("style");d.media=a;c.insertBefore(d,c[l]);g[a]=d;r(a,b)}}function t(a,b){for(var c=new RegExp("\\b("+m+")\\b(?!.*[;}])","gi"),d=function(k){return".iepp_"+k},h=-1;++h\\s*$","i");i.innerHTML=a.outerHTML.replace(/\r|\n/g," ").replace(c,a.currentStyle.display=="block"?"":"");c=i.childNodes[0];c.className+=" iepp_"+d;c=f[f.length]=[a,c];a.parentNode.replaceChild(c[1],c[0])}t(e.styleSheets,"all")});p.attachEvent("onafterprint",function(){for(var a=-1,b;++a - - - HtmlAgilityPack - - - - - Represents an HTML navigator on an HTML document seen as a data store. - - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream. - - The input stream. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream. - - The input stream. - Indicates whether to look for byte order marks at the beginning of the stream. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream. - - The input stream. - The character encoding to use. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream. - - The input stream. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the stream. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream. - - The input stream. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the stream. - The minimum buffer size. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a TextReader. - - The TextReader used to feed the HTML data into the document. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a file. - - The complete file path to be read. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a file. - - The complete file path to be read. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a file. - - The complete file path to be read. - The character encoding to use. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a file. - - The complete file path to be read. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Initializes a new instance of the HtmlNavigator and loads an HTML document from a file. - - The complete file path to be read. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - The minimum buffer size. - - - - Creates a new HtmlNavigator positioned at the same node as this HtmlNavigator. - - A new HtmlNavigator object positioned at the same node as the original HtmlNavigator. - - - - Gets the value of the HTML attribute with the specified LocalName and NamespaceURI. - - The local name of the HTML attribute. - The namespace URI of the attribute. Unsupported with the HtmlNavigator implementation. - The value of the specified HTML attribute. String.Empty or null if a matching attribute is not found or if the navigator is not positioned on an element node. - - - - Returns the value of the namespace node corresponding to the specified local name. - Always returns string.Empty for the HtmlNavigator implementation. - - The local name of the namespace node. - Always returns string.Empty for the HtmlNavigator implementation. - - - - Determines whether the current HtmlNavigator is at the same position as the specified HtmlNavigator. - - The HtmlNavigator that you want to compare against. - true if the two navigators have the same position, otherwise, false. - - - - Moves to the same position as the specified HtmlNavigator. - - The HtmlNavigator positioned on the node that you want to move to. - true if successful, otherwise false. If false, the position of the navigator is unchanged. - - - - Moves to the HTML attribute with matching LocalName and NamespaceURI. - - The local name of the HTML attribute. - The namespace URI of the attribute. Unsupported with the HtmlNavigator implementation. - true if the HTML attribute is found, otherwise, false. If false, the position of the navigator does not change. - - - - Moves to the first sibling of the current node. - - true if the navigator is successful moving to the first sibling node, false if there is no first sibling or if the navigator is currently positioned on an attribute node. - - - - Moves to the first HTML attribute. - - true if the navigator is successful moving to the first HTML attribute, otherwise, false. - - - - Moves to the first child of the current node. - - true if there is a first child node, otherwise false. - - - - Moves the XPathNavigator to the first namespace node of the current element. - Always returns false for the HtmlNavigator implementation. - - An XPathNamespaceScope value describing the namespace scope. - Always returns false for the HtmlNavigator implementation. - - - - Moves to the node that has an attribute of type ID whose value matches the specified string. - - A string representing the ID value of the node to which you want to move. This argument does not need to be atomized. - true if the move was successful, otherwise false. If false, the position of the navigator is unchanged. - - - - Moves the XPathNavigator to the namespace node with the specified local name. - Always returns false for the HtmlNavigator implementation. - - The local name of the namespace node. - Always returns false for the HtmlNavigator implementation. - - - - Moves to the next sibling of the current node. - - true if the navigator is successful moving to the next sibling node, false if there are no more siblings or if the navigator is currently positioned on an attribute node. If false, the position of the navigator is unchanged. - - - - Moves to the next HTML attribute. - - - - - - Moves the XPathNavigator to the next namespace node. - Always returns falsefor the HtmlNavigator implementation. - - An XPathNamespaceScope value describing the namespace scope. - Always returns false for the HtmlNavigator implementation. - - - - Moves to the parent of the current node. - - true if there is a parent node, otherwise false. - - - - Moves to the previous sibling of the current node. - - true if the navigator is successful moving to the previous sibling node, false if there is no previous sibling or if the navigator is currently positioned on an attribute node. - - - - Moves to the root node to which the current node belongs. - - - - - Gets the base URI for the current node. - Always returns string.Empty in the case of HtmlNavigator implementation. - - - - - Gets the current HTML document. - - - - - Gets the current HTML node. - - - - - Gets a value indicating whether the current node has child nodes. - - - - - Gets a value indicating whether the current node has child nodes. - - - - - Gets a value indicating whether the current node is an empty element. - - - - - Gets the name of the current HTML node without the namespace prefix. - - - - - Gets the qualified name of the current node. - - - - - Gets the namespace URI (as defined in the W3C Namespace Specification) of the current node. - Always returns string.Empty in the case of HtmlNavigator implementation. - - - - - Gets the associated with this implementation. - - - - - Gets the type of the current node. - - - - - Gets the prefix associated with the current node. - Always returns string.Empty in the case of HtmlNavigator implementation. - - - - - Gets the text value of the current node. - - - - - Gets the xml:lang scope for the current node. - Always returns string.Empty in the case of HtmlNavigator implementation. - - - - - Represents a complete HTML document. - - - - - Adds Debugging attributes to node. Default is false. - - - - - Defines if closing for non closed nodes must be done at the end or directly in the document. - Setting this to true can actually change how browsers render the page. Default is false. - - - - - Defines if non closed nodes will be checked at the end of parsing. Default is true. - - - - - Defines if a checksum must be computed for the document while parsing. Default is false. - - - - - Defines the default stream encoding to use. Default is System.Text.Encoding.Default. - - - - - Defines if source text must be extracted while parsing errors. - If the document has a lot of errors, or cascading errors, parsing performance can be dramatically affected if set to true. - Default is false. - - - - - Defines the maximum length of source text or parse errors. Default is 100. - - - - - Defines if LI, TR, TH, TD tags must be partially fixed when nesting errors are detected. Default is false. - - - - - Defines if output must conform to XML, instead of HTML. - - - - - Defines if attribute value output must be optimized (not bound with double quotes if it is possible). Default is false. - - - - - Defines if name must be output with it's original case. Useful for asp.net tags and attributes - - - - - Defines if name must be output in uppercase. Default is false. - - - - - Defines if declared encoding must be read from the document. - Declared encoding is determined using the meta http-equiv="content-type" content="text/html;charset=XXXXX" html node. - Default is true. - - - - - Defines the name of a node that will throw the StopperNodeException when found as an end node. Default is null. - - - - - Defines if the 'id' attribute must be specifically used. Default is true. - - - - - Defines if empty nodes must be written as closed during output. Default is false. - - - - - Creates an instance of an HTML document. - - - - - Creates a new XPathNavigator object for navigating this HTML document. - - An XPathNavigator object. The XPathNavigator is positioned on the root of the document. - - - - Gets a valid XML name. - - Any text. - A string that is a valid XML name. - - - - Applies HTML encoding to a specified string. - - The input string to encode. May not be null. - The encoded string. - - - - Determines if the specified character is considered as a whitespace character. - - The character to check. - true if if the specified character is considered as a whitespace character. - - - - Creates an HTML attribute with the specified name. - - The name of the attribute. May not be null. - The new HTML attribute. - - - - Creates an HTML attribute with the specified name. - - The name of the attribute. May not be null. - The value of the attribute. - The new HTML attribute. - - - - Creates an HTML comment node. - - The new HTML comment node. - - - - Creates an HTML comment node with the specified comment text. - - The comment text. May not be null. - The new HTML comment node. - - - - Creates an HTML element node with the specified name. - - The qualified name of the element. May not be null. - The new HTML node. - - - - Creates an HTML text node. - - The new HTML text node. - - - - Creates an HTML text node with the specified text. - - The text of the node. May not be null. - The new HTML text node. - - - - Detects the encoding of an HTML stream. - - The input stream. May not be null. - The detected encoding. - - - - Detects the encoding of an HTML file. - - Path for the file containing the HTML document to detect. May not be null. - The detected encoding. - - - - Detects the encoding of an HTML text provided on a TextReader. - - The TextReader used to feed the HTML. May not be null. - The detected encoding. - - - - Detects the encoding of an HTML document from a file first, and then loads the file. - - The complete file path to be read. - - - - Detects the encoding of an HTML document from a file first, and then loads the file. - - The complete file path to be read. May not be null. - true to detect encoding, false otherwise. - - - - Detects the encoding of an HTML text. - - The input html text. May not be null. - The detected encoding. - - - - Gets the HTML node with the specified 'id' attribute value. - - The attribute id to match. May not be null. - The HTML node with the matching id or null if not found. - - - - Loads an HTML document from a stream. - - The input stream. - - - - Loads an HTML document from a stream. - - The input stream. - Indicates whether to look for byte order marks at the beginning of the stream. - - - - Loads an HTML document from a stream. - - The input stream. - The character encoding to use. - - - - Loads an HTML document from a stream. - - The input stream. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the stream. - - - - Loads an HTML document from a stream. - - The input stream. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the stream. - The minimum buffer size. - - - - Loads an HTML document from a file. - - The complete file path to be read. May not be null. - - - - Loads an HTML document from a file. - - The complete file path to be read. May not be null. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Loads an HTML document from a file. - - The complete file path to be read. May not be null. - The character encoding to use. May not be null. - - - - Loads an HTML document from a file. - - The complete file path to be read. May not be null. - The character encoding to use. May not be null. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Loads an HTML document from a file. - - The complete file path to be read. May not be null. - The character encoding to use. May not be null. - Indicates whether to look for byte order marks at the beginning of the file. - The minimum buffer size. - - - - Loads the HTML document from the specified TextReader. - - The TextReader used to feed the HTML data into the document. May not be null. - - - - Loads the HTML document from the specified string. - - String containing the HTML document to load. May not be null. - - - - Saves the HTML document to the specified stream. - - The stream to which you want to save. - - - - Saves the HTML document to the specified stream. - - The stream to which you want to save. May not be null. - The character encoding to use. May not be null. - - - - Saves the mixed document to the specified file. - - The location of the file where you want to save the document. - - - - Saves the mixed document to the specified file. - - The location of the file where you want to save the document. May not be null. - The character encoding to use. May not be null. - - - - Saves the HTML document to the specified StreamWriter. - - The StreamWriter to which you want to save. - - - - Saves the HTML document to the specified TextWriter. - - The TextWriter to which you want to save. May not be null. - - - - Saves the HTML document to the specified XmlWriter. - - The XmlWriter to which you want to save. - - - - Gets the document CRC32 checksum if OptionComputeChecksum was set to true before parsing, 0 otherwise. - - - - - Gets the document's declared encoding. - Declared encoding is determined using the meta http-equiv="content-type" content="text/html;charset=XXXXX" html node. - - - - - Gets the root node of the document. - - - - - Gets the document's output encoding. - - - - - Gets a list of parse errors found in the document. - - - - - Gets the remaining text. - Will always be null if OptionStopperNodeName is null. - - - - - Gets the offset of Remainder in the original Html text. - If OptionStopperNodeName is null, this will return the length of the original Html text. - - - - - Gets the document's stream encoding. - - - - - A utility class to get HTML document from HTTP. - - - - - Occurs after an HTTP request has been executed. - - - - - Occurs before an HTML document is handled. - - - - - Occurs before an HTTP request is executed. - - - - - Gets the MIME content type for a given path extension. - - The input path extension. - The default content type to return if any error occurs. - The path extension's MIME content type. - - - - Gets the path extension for a given MIME content type. - - The input MIME content type. - The default path extension to return if any error occurs. - The MIME content type's path extension. - - - - Creates an instance of the given type from the specified Internet resource. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The requested type. - An newly created instance. - - - - Creates an instance of the given type from the specified Internet resource. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The URL that specifies the XSLT stylesheet to load. - An containing the namespace-qualified arguments used as input to the transform. - The requested type. - An newly created instance. - - - - Creates an instance of the given type from the specified Internet resource. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The URL that specifies the XSLT stylesheet to load. - An containing the namespace-qualified arguments used as input to the transform. - The requested type. - A file path where the temporary XML before transformation will be saved. Mostly used for debugging purposes. - An newly created instance. - - - - Gets an HTML document from an Internet resource and saves it to the specified file. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The location of the file where you want to save the document. - - - - Gets an HTML document from an Internet resource and saves it to the specified file. - Proxy aware - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The location of the file where you want to save the document. - - - - - - Gets an HTML document from an Internet resource and saves it to the specified file. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The location of the file where you want to save the document. - The HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND. - - - - Gets an HTML document from an Internet resource and saves it to the specified file. Understands Proxies - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The location of the file where you want to save the document. - - The HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND. - - - - - Gets the cache file path for a specified url. - - The url fo which to retrieve the cache path. May not be null. - The cache file path. - - - - Gets an HTML document from an Internet resource. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - A new HTML document. - - - - Gets an HTML document from an Internet resource. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - Host to use for Proxy - Port the Proxy is on - User Id for Authentication - Password for Authentication - A new HTML document. - - - - Loads an HTML document from an Internet resource. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND. - A new HTML document. - - - - Loads an HTML document from an Internet resource. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND. - Proxy to use with this request - Credentials to use when authenticating - A new HTML document. - - - - Loads an HTML document from an Internet resource and saves it to the specified XmlTextWriter. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The XmlTextWriter to which you want to save. - - - - Loads an HTML document from an Internet resource and saves it to the specified XmlTextWriter, after an XSLT transformation. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". - The URL that specifies the XSLT stylesheet to load. - An XsltArgumentList containing the namespace-qualified arguments used as input to the transform. - The XmlTextWriter to which you want to save. - - - - Loads an HTML document from an Internet resource and saves it to the specified XmlTextWriter, after an XSLT transformation. - - The requested URL, such as "http://Myserver/Mypath/Myfile.asp". May not be null. - The URL that specifies the XSLT stylesheet to load. - An XsltArgumentList containing the namespace-qualified arguments used as input to the transform. - The XmlTextWriter to which you want to save. - A file path where the temporary XML before transformation will be saved. Mostly used for debugging purposes. - - - - Gets or Sets a value indicating if document encoding must be automatically detected. - - - - - Gets or Sets a value indicating whether to get document only from the cache. - If this is set to true and document is not found in the cache, nothing will be loaded. - - - - - Gets or Sets the cache path. If null, no caching mechanism will be used. - - - - - Gets a value indicating if the last document was retrieved from the cache. - - - - - Gets the last request duration in milliseconds. - - - - - Gets the URI of the Internet resource that actually responded to the request. - - - - - Gets the last request status. - - - - - Gets or Sets the size of the buffer used for memory operations. - - - - - Gets or Sets a value indicating if cookies will be stored. - - - - - Gets or Sets a value indicating whether the caching mechanisms should be used or not. - - - - - Represents the method that will handle the PostResponse event. - - - - - Represents the method that will handle the PreHandleDocument event. - - - - - Represents the method that will handle the PreRequest event. - - - - - Represents the type of fragment in a mixed code document. - - - - - The fragment contains code. - - - - - The fragment contains text. - - - - - Represents a combined list and collection of HTML nodes. - - - - - Adds supplied item to collection - - - - - - Explicit clear - - - - - Retreives existence of supplied item - - - - - - - Copies collection to array - - - - - - - Get Explicit enumerator - - - - - - Explicit non-generic enumerator - - - - - - Retrieves the index for the supplied item, -1 if not found - - - - - - - Inserts given item into collection at supplied index - - - - - - - Explicit collection remove - - - - - - - Removes the attribute at the specified index. - - The index of the attribute to remove. - - - - Adds a new attribute to the collection with the given values - - - - - - - Inserts the specified attribute as the last attribute in the collection. - - The attribute to insert. May not be null. - The appended attribute. - - - - Creates and inserts a new attribute as the last attribute in the collection. - - The name of the attribute to insert. - The appended attribute. - - - - Creates and inserts a new attribute as the last attribute in the collection. - - The name of the attribute to insert. - The value of the attribute to insert. - The appended attribute. - - - - Checks for existance of attribute with given name - - - - - - - Inserts the specified attribute as the first node in the collection. - - The attribute to insert. May not be null. - The prepended attribute. - - - - Removes a given attribute from the list. - - The attribute to remove. May not be null. - - - - Removes an attribute from the list, using its name. If there are more than one attributes with this name, they will all be removed. - - The attribute's name. May not be null. - - - - Remove all attributes in the list. - - - - - Returns all attributes with specified name. Handles case insentivity - - Name of the attribute - - - - - Removes all attributes from the collection - - - - - Clears the attribute collection - - - - - Gets a given attribute from the list using its name. - - - - - Gets the number of elements actually contained in the list. - - - - - Gets readonly status of colelction - - - - - Gets the attribute at the specified index. - - - - - Flags that describe the behavior of an Element node. - - - - - The node is a CDATA node. - - - - - The node is empty. META or IMG are example of such nodes. - - - - - The node will automatically be closed during parsing. - - - - - The node can overlap. - - - - - Represents a combined list and collection of HTML nodes. - - - - - Initialize the HtmlNodeCollection with the base parent node - - The base node of the collection - - - - Add node to the collection - - - - - - Clears out the collection of HtmlNodes. Removes each nodes reference to parentnode, nextnode and prevnode - - - - - Gets existence of node in collection - - - - - - - Copy collection to array - - - - - - - Get Enumerator - - - - - - Get Explicit Enumerator - - - - - - Get index of node - - - - - - - Insert node at index - - - - - - - Remove node - - - - - - - Remove at index - - - - - - Get first instance of node in supplied collection - - - - - - - - Add node to the end of the collection - - - - - - Get first instance of node with name - - - - - - - Get index of node - - - - - - - Add node to the beginning of the collection - - - - - - Remove node at index - - - - - - - Replace node at index - - - - - - - Get all node descended from this collection - - - - - - Get all node descended from this collection - - - - - - Get all node descended from this collection with matching name - - - - - - Gets all first generation elements in collection - - - - - - Gets all first generation elements matching name - - - - - - - All first generation nodes in collection - - - - - - Gets a given node from the list. - - - - - Get node with tag name - - - - - - - Gets the number of elements actually contained in the list. - - - - - Is collection read only - - - - - Gets the node at the specified index. - - - - - A utility class to compute CRC32. - - - - - Compute a checksum for a given array of bytes. - - The array of bytes to compute the checksum for. - The computed checksum. - - - - Compute a checksum for a given string. - - The string to compute the checksum for. - The computed checksum. - - - - Represents an HTML node. - - - - - Gets the name of a comment node. It is actually defined as '#comment'. - - - - - Gets the name of the document node. It is actually defined as '#document'. - - - - - Gets the name of a text node. It is actually defined as '#text'. - - - - - Gets a collection of flags that define specific behaviors for specific element nodes. - The table contains a DictionaryEntry list with the lowercase tag name as the Key, and a combination of HtmlElementFlags as the Value. - - - - - Initialize HtmlNode. Builds a list of all tags that have special allowances - - - - - Initializes HtmlNode, providing type, owner and where it exists in a collection - - - - - - - - Creates a new XPathNavigator object for navigating this HTML node. - - An XPathNavigator object. The XPathNavigator is positioned on the node from which the method was called. It is not positioned on the root of the document. - - - - Determines if an element node can be kept overlapped. - - The name of the element node to check. May not be null. - true if the name is the name of an element node that can be kept overlapped, false otherwise. - - - - Creates an HTML node from a string representing literal HTML. - - The HTML text. - The newly created node instance. - - - - Determines if an element node is a CDATA element node. - - The name of the element node to check. May not be null. - true if the name is the name of a CDATA element node, false otherwise. - - - - Determines if an element node is closed. - - The name of the element node to check. May not be null. - true if the name is the name of a closed element node, false otherwise. - - - - Determines if an element node is defined as empty. - - The name of the element node to check. May not be null. - true if the name is the name of an empty element node, false otherwise. - - - - Determines if a text corresponds to the closing tag of an node that can be kept overlapped. - - The text to check. May not be null. - true or false. - - - - Returns a collection of all ancestor nodes of this element. - - - - - - Get Ancestors with matching name - - - - - - - Returns a collection of all ancestor nodes of this element. - - - - - - Gets all anscestor nodes and the current node - - - - - - - Adds the specified node to the end of the list of children of this node. - - The node to add. May not be null. - The node added. - - - - Adds the specified node to the end of the list of children of this node. - - The node list to add. May not be null. - - - - Gets all Attributes with name - - - - - - - Creates a duplicate of the node - - - - - - Creates a duplicate of the node and changes its name at the same time. - - The new name of the cloned node. May not be null. - The cloned node. - - - - Creates a duplicate of the node and changes its name at the same time. - - The new name of the cloned node. May not be null. - true to recursively clone the subtree under the specified node; false to clone only the node itself. - The cloned node. - - - - Creates a duplicate of the node. - - true to recursively clone the subtree under the specified node; false to clone only the node itself. - The cloned node. - - - - Creates a duplicate of the node and the subtree under it. - - The node to duplicate. May not be null. - - - - Creates a duplicate of the node. - - The node to duplicate. May not be null. - true to recursively clone the subtree under the specified node, false to clone only the node itself. - - - - Creates an XPathNavigator using the root of this document. - - - - - - Gets all Descendant nodes for this node and each of child nodes - - - - - - Returns a collection of all descendant nodes of this element, in document order - - - - - - Gets all Descendant nodes in enumerated list - - - - - - Get all descendant nodes with matching name - - - - - - - Returns a collection of all descendant nodes of this element, in document order - - - - - - Gets all descendant nodes including this node - - - - - - - Gets first generation child node matching name - - - - - - - Gets matching first generation child nodes matching name - - - - - - - Helper method to get the value of an attribute of this node. If the attribute is not found, the default value will be returned. - - The name of the attribute to get. May not be null. - The default value to return if not found. - The value of the attribute if found, the default value if not found. - - - - Helper method to get the value of an attribute of this node. If the attribute is not found, the default value will be returned. - - The name of the attribute to get. May not be null. - The default value to return if not found. - The value of the attribute if found, the default value if not found. - - - - Helper method to get the value of an attribute of this node. If the attribute is not found, the default value will be returned. - - The name of the attribute to get. May not be null. - The default value to return if not found. - The value of the attribute if found, the default value if not found. - - - - Inserts the specified node immediately after the specified reference node. - - The node to insert. May not be null. - The node that is the reference node. The newNode is placed after the refNode. - The node being inserted. - - - - Inserts the specified node immediately before the specified reference node. - - The node to insert. May not be null. - The node that is the reference node. The newChild is placed before this node. - The node being inserted. - - - - Adds the specified node to the beginning of the list of children of this node. - - The node to add. May not be null. - The node added. - - - - Adds the specified node list to the beginning of the list of children of this node. - - The node list to add. May not be null. - - - - Removes node from parent collection - - - - - Removes all the children and/or attributes of the current node. - - - - - Removes all the children of the current node. - - - - - Removes the specified child node. - - The node being removed. May not be null. - The node removed. - - - - Removes the specified child node. - - The node being removed. May not be null. - true to keep grand children of the node, false otherwise. - The node removed. - - - - Replaces the child node oldChild with newChild node. - - The new node to put in the child list. - The node being replaced in the list. - The node replaced. - - - - Selects a list of nodes matching the expression. - - The XPath expression. - An containing a collection of nodes matching the query, or null if no node matched the XPath expression. - - - - Selects the first XmlNode that matches the XPath expression. - - The XPath expression. May not be null. - The first that matches the XPath query or a null reference if no matching node was found. - - - - Helper method to set the value of an attribute of this node. If the attribute is not found, it will be created automatically. - - The name of the attribute to set. May not be null. - The value for the attribute. - The corresponding attribute instance. - - - - Saves all the children of the node to the specified TextWriter. - - The TextWriter to which you want to save. - - - - Saves all the children of the node to a string. - - The saved string. - - - - Saves the current node to the specified TextWriter. - - The TextWriter to which you want to save. - - - - Saves the current node to the specified XmlWriter. - - The XmlWriter to which you want to save. - - - - Saves the current node to a string. - - The saved string. - - - - Gets the collection of HTML attributes for this node. May not be null. - - - - - Gets all the children of the node. - - - - - Gets a value indicating if this node has been closed or not. - - - - - Gets the collection of HTML attributes for the closing tag. May not be null. - - - - - Gets the first child of the node. - - - - - Gets a value indicating whether the current node has any attributes. - - - - - Gets a value indicating whether this node has any child nodes. - - - - - Gets a value indicating whether the current node has any attributes on the closing tag. - - - - - Gets or sets the value of the 'id' HTML attribute. The document must have been parsed using the OptionUseIdAttribute set to true. - - - - - Gets or Sets the HTML between the start and end tags of the object. - - - - - Gets or Sets the text between the start and end tags of the object. - - - - - Gets the last child of the node. - - - - - Gets the line number of this node in the document. - - - - - Gets the column number of this node in the document. - - - - - Gets or sets this node's name. - - - - - Gets the HTML node immediately following this element. - - - - - Gets the type of this node. - - - - - The original unaltered name of the tag - - - - - Gets or Sets the object and its content in HTML. - - - - - Gets the to which this node belongs. - - - - - Gets the parent of this node (for nodes that can have parents). - - - - - Gets the node immediately preceding this node. - - - - - Gets the stream position of this node in the document, relative to the start of the document. - - - - - Gets a valid XPath string that points to this node - - - - - Represents an HTML attribute. - - - - - Compares the current instance with another attribute. Comparison is based on attributes' name. - - An attribute to compare with this instance. - A 32-bit signed integer that indicates the relative order of the names comparison. - - - - Creates a duplicate of this attribute. - - The cloned attribute. - - - - Removes this attribute from it's parents collection - - - - - Gets the line number of this attribute in the document. - - - - - Gets the column number of this attribute in the document. - - - - - Gets the qualified name of the attribute. - - - - - Name of attribute with original case - - - - - Gets the HTML document to which this attribute belongs. - - - - - Gets the HTML node to which this attribute belongs. - - - - - Specifies what type of quote the data should be wrapped in - - - - - Gets the stream position of this attribute in the document, relative to the start of the document. - - - - - Gets or sets the value of the attribute. - - - - - Gets a valid XPath string that points to this Attribute - - - - - An Enum representing different types of Quotes used for surrounding attribute values - - - - - A single quote mark ' - - - - - A double quote mark " - - - - - A utility class to replace special characters by entities and vice-versa. - Follows HTML 4.0 specification found at http://www.w3.org/TR/html4/sgml/entities.html - - - - - Replace known entities by characters. - - The source text. - The result text. - - - - Clone and entitize an HtmlNode. This will affect attribute values and nodes' text. It will also entitize all child nodes. - - The node to entitize. - An entitized cloned node. - - - - Replace characters above 127 by entities. - - The source text. - The result text. - - - - Replace characters above 127 by entities. - - The source text. - If set to false, the function will not use known entities name. Default is true. - The result text. - - - - Replace characters above 127 by entities. - - The source text. - If set to false, the function will not use known entities name. Default is true. - If set to true, the [quote], [ampersand], [lower than] and [greather than] characters will be entitized. - The result text - - - - A collection of entities indexed by name. - - - - - A collection of entities indexed by value. - - - - - Represents a fragment of text in a mixed code document. - - - - - Represents a base class for fragments in a mixed code document. - - - - - Gets the fragement text. - - - - - Gets the type of fragment. - - - - - Gets the line number of the fragment. - - - - - Gets the line position (column) of the fragment. - - - - - Gets the fragment position in the document's stream. - - - - - Gets the fragment text. - - - - - Represents an exception thrown by the HtmlWeb utility class. - - - - - Creates an instance of the HtmlWebException. - - The exception's message. - - - - Represents the type of parsing error. - - - - - A tag was not closed. - - - - - A tag was not opened. - - - - - There is a charset mismatch between stream and declared (META) encoding. - - - - - An end tag was not required. - - - - - An end tag is invalid at this position. - - - - - Represents an HTML comment. - - - - - Gets or Sets the comment text of the node. - - - - - Gets or Sets the HTML between the start and end tags of the object. In the case of a text node, it is equals to OuterHtml. - - - - - Gets or Sets the object and its content in HTML. - - - - - Represents a document with mixed code and text. ASP, ASPX, JSP, are good example of such documents. - - - - - Gets or sets the token representing code end. - - - - - Gets or sets the token representing code start. - - - - - Gets or sets the token representing code directive. - - - - - Gets or sets the token representing response write directive. - - - - - Creates a mixed code document instance. - - - - - Create a code fragment instances. - - The newly created code fragment instance. - - - - Create a text fragment instances. - - The newly created text fragment instance. - - - - Loads a mixed code document from a stream. - - The input stream. - - - - Loads a mixed code document from a stream. - - The input stream. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Loads a mixed code document from a stream. - - The input stream. - The character encoding to use. - - - - Loads a mixed code document from a stream. - - The input stream. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Loads a mixed code document from a stream. - - The input stream. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - The minimum buffer size. - - - - Loads a mixed code document from a file. - - The complete file path to be read. - - - - Loads a mixed code document from a file. - - The complete file path to be read. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Loads a mixed code document from a file. - - The complete file path to be read. - The character encoding to use. - - - - Loads a mixed code document from a file. - - The complete file path to be read. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - - - - Loads a mixed code document from a file. - - The complete file path to be read. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - The minimum buffer size. - - - - Loads the mixed code document from the specified TextReader. - - The TextReader used to feed the HTML data into the document. - - - - Loads a mixed document from a text - - The text to load. - - - - Saves the mixed document to the specified stream. - - The stream to which you want to save. - - - - Saves the mixed document to the specified stream. - - The stream to which you want to save. - The character encoding to use. - - - - Saves the mixed document to the specified file. - - The location of the file where you want to save the document. - - - - Saves the mixed document to the specified file. - - The location of the file where you want to save the document. - The character encoding to use. - - - - Saves the mixed document to the specified StreamWriter. - - The StreamWriter to which you want to save. - - - - Saves the mixed document to the specified TextWriter. - - The TextWriter to which you want to save. - - - - Gets the code represented by the mixed code document seen as a template. - - - - - Gets the list of code fragments in the document. - - - - - Gets the list of all fragments in the document. - - - - - Gets the encoding of the stream used to read the document. - - - - - Gets the list of text fragments in the document. - - - - - Represents a parsing error found during document parsing. - - - - - Gets the type of error. - - - - - Gets the line number of this error in the document. - - - - - Gets the column number of this error in the document. - - - - - Gets a description for the error. - - - - - Gets the the full text of the line containing the error. - - - - - Gets the absolute stream position of this error in the document, relative to the start of the document. - - - - - Represents a fragment of code in a mixed code document. - - - - - Gets the fragment code text. - - - - - Represents the type of a node. - - - - - The root of a document. - - - - - An HTML element. - - - - - An HTML comment. - - - - - A text node is always the child of an element or a document node. - - - - - Represents a list of mixed code fragments. - - - - - Gets an enumerator that can iterate through the fragment list. - - - - - Appends a fragment to the list of fragments. - - The fragment to append. May not be null. - - - - Gets an enumerator that can iterate through the fragment list. - - - - - Prepends a fragment to the list of fragments. - - The fragment to append. May not be null. - - - - Remove a fragment from the list of fragments. If this fragment was not in the list, an exception will be raised. - - The fragment to remove. May not be null. - - - - Remove all fragments from the list. - - - - - Remove a fragment from the list of fragments, using its index in the list. - - The index of the fragment to remove. - - - - Gets the Document - - - - - Gets the number of fragments contained in the list. - - - - - Gets a fragment from the list using its index. - - - - - Represents a fragment enumerator. - - - - - Advances the enumerator to the next element of the collection. - - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - - - - Sets the enumerator to its initial position, which is before the first element in the collection. - - - - - Gets the current element in the collection. - - - - - Gets the current element in the collection. - - - - - Represents an HTML text node. - - - - - Gets or Sets the HTML between the start and end tags of the object. In the case of a text node, it is equals to OuterHtml. - - - - - Gets or Sets the object and its content in HTML. - - - - - Gets or Sets the text of the node. - - - - + + + + HtmlAgilityPack + + + + + Represents an HTML navigator on an HTML document seen as a data store. + + + + + Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream. + + The input stream. + + + + Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream. + + The input stream. + Indicates whether to look for byte order marks at the beginning of the stream. + + + + Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream. + + The input stream. + The character encoding to use. + + + + Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream. + + The input stream. + The character encoding to use. + Indicates whether to look for byte order marks at the beginning of the stream. + + + + Initializes a new instance of the HtmlNavigator and loads an HTML document from a stream. + + The input stream. + The character encoding to use. + Indicates whether to look for byte order marks at the beginning of the stream. + The minimum buffer size. + + + + Initializes a new instance of the HtmlNavigator and loads an HTML document from a TextReader. + + The TextReader used to feed the HTML data into the document. + + + + Initializes a new instance of the HtmlNavigator and loads an HTML document from a file. + + The complete file path to be read. + + + + Initializes a new instance of the HtmlNavigator and loads an HTML document from a file. + + The complete file path to be read. + Indicates whether to look for byte order marks at the beginning of the file. + + + + Initializes a new instance of the HtmlNavigator and loads an HTML document from a file. + + The complete file path to be read. + The character encoding to use. + + + + Initializes a new instance of the HtmlNavigator and loads an HTML document from a file. + + The complete file path to be read. + The character encoding to use. + Indicates whether to look for byte order marks at the beginning of the file. + + + + Initializes a new instance of the HtmlNavigator and loads an HTML document from a file. + + The complete file path to be read. + The character encoding to use. + Indicates whether to look for byte order marks at the beginning of the file. + The minimum buffer size. + + + + Creates a new HtmlNavigator positioned at the same node as this HtmlNavigator. + + A new HtmlNavigator object positioned at the same node as the original HtmlNavigator. + + + + Gets the value of the HTML attribute with the specified LocalName and NamespaceURI. + + The local name of the HTML attribute. + The namespace URI of the attribute. Unsupported with the HtmlNavigator implementation. + The value of the specified HTML attribute. String.Empty or null if a matching attribute is not found or if the navigator is not positioned on an element node. + + + + Returns the value of the namespace node corresponding to the specified local name. + Always returns string.Empty for the HtmlNavigator implementation. + + The local name of the namespace node. + Always returns string.Empty for the HtmlNavigator implementation. + + + + Determines whether the current HtmlNavigator is at the same position as the specified HtmlNavigator. + + The HtmlNavigator that you want to compare against. + true if the two navigators have the same position, otherwise, false. + + + + Moves to the same position as the specified HtmlNavigator. + + The HtmlNavigator positioned on the node that you want to move to. + true if successful, otherwise false. If false, the position of the navigator is unchanged. + + + + Moves to the HTML attribute with matching LocalName and NamespaceURI. + + The local name of the HTML attribute. + The namespace URI of the attribute. Unsupported with the HtmlNavigator implementation. + true if the HTML attribute is found, otherwise, false. If false, the position of the navigator does not change. + + + + Moves to the first sibling of the current node. + + true if the navigator is successful moving to the first sibling node, false if there is no first sibling or if the navigator is currently positioned on an attribute node. + + + + Moves to the first HTML attribute. + + true if the navigator is successful moving to the first HTML attribute, otherwise, false. + + + + Moves to the first child of the current node. + + true if there is a first child node, otherwise false. + + + + Moves the XPathNavigator to the first namespace node of the current element. + Always returns false for the HtmlNavigator implementation. + + An XPathNamespaceScope value describing the namespace scope. + Always returns false for the HtmlNavigator implementation. + + + + Moves to the node that has an attribute of type ID whose value matches the specified string. + + A string representing the ID value of the node to which you want to move. This argument does not need to be atomized. + true if the move was successful, otherwise false. If false, the position of the navigator is unchanged. + + + + Moves the XPathNavigator to the namespace node with the specified local name. + Always returns false for the HtmlNavigator implementation. + + The local name of the namespace node. + Always returns false for the HtmlNavigator implementation. + + + + Moves to the next sibling of the current node. + + true if the navigator is successful moving to the next sibling node, false if there are no more siblings or if the navigator is currently positioned on an attribute node. If false, the position of the navigator is unchanged. + + + + Moves to the next HTML attribute. + + + + + + Moves the XPathNavigator to the next namespace node. + Always returns falsefor the HtmlNavigator implementation. + + An XPathNamespaceScope value describing the namespace scope. + Always returns false for the HtmlNavigator implementation. + + + + Moves to the parent of the current node. + + true if there is a parent node, otherwise false. + + + + Moves to the previous sibling of the current node. + + true if the navigator is successful moving to the previous sibling node, false if there is no previous sibling or if the navigator is currently positioned on an attribute node. + + + + Moves to the root node to which the current node belongs. + + + + + Gets the base URI for the current node. + Always returns string.Empty in the case of HtmlNavigator implementation. + + + + + Gets the current HTML document. + + + + + Gets the current HTML node. + + + + + Gets a value indicating whether the current node has child nodes. + + + + + Gets a value indicating whether the current node has child nodes. + + + + + Gets a value indicating whether the current node is an empty element. + + + + + Gets the name of the current HTML node without the namespace prefix. + + + + + Gets the qualified name of the current node. + + + + + Gets the namespace URI (as defined in the W3C Namespace Specification) of the current node. + Always returns string.Empty in the case of HtmlNavigator implementation. + + + + + Gets the associated with this implementation. + + + + + Gets the type of the current node. + + + + + Gets the prefix associated with the current node. + Always returns string.Empty in the case of HtmlNavigator implementation. + + + + + Gets the text value of the current node. + + + + + Gets the xml:lang scope for the current node. + Always returns string.Empty in the case of HtmlNavigator implementation. + + + + + Represents a complete HTML document. + + + + + Adds Debugging attributes to node. Default is false. + + + + + Defines if closing for non closed nodes must be done at the end or directly in the document. + Setting this to true can actually change how browsers render the page. Default is false. + + + + + Defines if non closed nodes will be checked at the end of parsing. Default is true. + + + + + Defines if a checksum must be computed for the document while parsing. Default is false. + + + + + Defines the default stream encoding to use. Default is System.Text.Encoding.Default. + + + + + Defines if source text must be extracted while parsing errors. + If the document has a lot of errors, or cascading errors, parsing performance can be dramatically affected if set to true. + Default is false. + + + + + Defines the maximum length of source text or parse errors. Default is 100. + + + + + Defines if LI, TR, TH, TD tags must be partially fixed when nesting errors are detected. Default is false. + + + + + Defines if output must conform to XML, instead of HTML. + + + + + Defines if attribute value output must be optimized (not bound with double quotes if it is possible). Default is false. + + + + + Defines if name must be output with it's original case. Useful for asp.net tags and attributes + + + + + Defines if name must be output in uppercase. Default is false. + + + + + Defines if declared encoding must be read from the document. + Declared encoding is determined using the meta http-equiv="content-type" content="text/html;charset=XXXXX" html node. + Default is true. + + + + + Defines the name of a node that will throw the StopperNodeException when found as an end node. Default is null. + + + + + Defines if the 'id' attribute must be specifically used. Default is true. + + + + + Defines if empty nodes must be written as closed during output. Default is false. + + + + + Creates an instance of an HTML document. + + + + + Creates a new XPathNavigator object for navigating this HTML document. + + An XPathNavigator object. The XPathNavigator is positioned on the root of the document. + + + + Gets a valid XML name. + + Any text. + A string that is a valid XML name. + + + + Applies HTML encoding to a specified string. + + The input string to encode. May not be null. + The encoded string. + + + + Determines if the specified character is considered as a whitespace character. + + The character to check. + true if if the specified character is considered as a whitespace character. + + + + Creates an HTML attribute with the specified name. + + The name of the attribute. May not be null. + The new HTML attribute. + + + + Creates an HTML attribute with the specified name. + + The name of the attribute. May not be null. + The value of the attribute. + The new HTML attribute. + + + + Creates an HTML comment node. + + The new HTML comment node. + + + + Creates an HTML comment node with the specified comment text. + + The comment text. May not be null. + The new HTML comment node. + + + + Creates an HTML element node with the specified name. + + The qualified name of the element. May not be null. + The new HTML node. + + + + Creates an HTML text node. + + The new HTML text node. + + + + Creates an HTML text node with the specified text. + + The text of the node. May not be null. + The new HTML text node. + + + + Detects the encoding of an HTML stream. + + The input stream. May not be null. + The detected encoding. + + + + Detects the encoding of an HTML file. + + Path for the file containing the HTML document to detect. May not be null. + The detected encoding. + + + + Detects the encoding of an HTML text provided on a TextReader. + + The TextReader used to feed the HTML. May not be null. + The detected encoding. + + + + Detects the encoding of an HTML document from a file first, and then loads the file. + + The complete file path to be read. + + + + Detects the encoding of an HTML document from a file first, and then loads the file. + + The complete file path to be read. May not be null. + true to detect encoding, false otherwise. + + + + Detects the encoding of an HTML text. + + The input html text. May not be null. + The detected encoding. + + + + Gets the HTML node with the specified 'id' attribute value. + + The attribute id to match. May not be null. + The HTML node with the matching id or null if not found. + + + + Loads an HTML document from a stream. + + The input stream. + + + + Loads an HTML document from a stream. + + The input stream. + Indicates whether to look for byte order marks at the beginning of the stream. + + + + Loads an HTML document from a stream. + + The input stream. + The character encoding to use. + + + + Loads an HTML document from a stream. + + The input stream. + The character encoding to use. + Indicates whether to look for byte order marks at the beginning of the stream. + + + + Loads an HTML document from a stream. + + The input stream. + The character encoding to use. + Indicates whether to look for byte order marks at the beginning of the stream. + The minimum buffer size. + + + + Loads an HTML document from a file. + + The complete file path to be read. May not be null. + + + + Loads an HTML document from a file. + + The complete file path to be read. May not be null. + Indicates whether to look for byte order marks at the beginning of the file. + + + + Loads an HTML document from a file. + + The complete file path to be read. May not be null. + The character encoding to use. May not be null. + + + + Loads an HTML document from a file. + + The complete file path to be read. May not be null. + The character encoding to use. May not be null. + Indicates whether to look for byte order marks at the beginning of the file. + + + + Loads an HTML document from a file. + + The complete file path to be read. May not be null. + The character encoding to use. May not be null. + Indicates whether to look for byte order marks at the beginning of the file. + The minimum buffer size. + + + + Loads the HTML document from the specified TextReader. + + The TextReader used to feed the HTML data into the document. May not be null. + + + + Loads the HTML document from the specified string. + + String containing the HTML document to load. May not be null. + + + + Saves the HTML document to the specified stream. + + The stream to which you want to save. + + + + Saves the HTML document to the specified stream. + + The stream to which you want to save. May not be null. + The character encoding to use. May not be null. + + + + Saves the mixed document to the specified file. + + The location of the file where you want to save the document. + + + + Saves the mixed document to the specified file. + + The location of the file where you want to save the document. May not be null. + The character encoding to use. May not be null. + + + + Saves the HTML document to the specified StreamWriter. + + The StreamWriter to which you want to save. + + + + Saves the HTML document to the specified TextWriter. + + The TextWriter to which you want to save. May not be null. + + + + Saves the HTML document to the specified XmlWriter. + + The XmlWriter to which you want to save. + + + + Gets the document CRC32 checksum if OptionComputeChecksum was set to true before parsing, 0 otherwise. + + + + + Gets the document's declared encoding. + Declared encoding is determined using the meta http-equiv="content-type" content="text/html;charset=XXXXX" html node. + + + + + Gets the root node of the document. + + + + + Gets the document's output encoding. + + + + + Gets a list of parse errors found in the document. + + + + + Gets the remaining text. + Will always be null if OptionStopperNodeName is null. + + + + + Gets the offset of Remainder in the original Html text. + If OptionStopperNodeName is null, this will return the length of the original Html text. + + + + + Gets the document's stream encoding. + + + + + A utility class to get HTML document from HTTP. + + + + + Occurs after an HTTP request has been executed. + + + + + Occurs before an HTML document is handled. + + + + + Occurs before an HTTP request is executed. + + + + + Gets the MIME content type for a given path extension. + + The input path extension. + The default content type to return if any error occurs. + The path extension's MIME content type. + + + + Gets the path extension for a given MIME content type. + + The input MIME content type. + The default path extension to return if any error occurs. + The MIME content type's path extension. + + + + Creates an instance of the given type from the specified Internet resource. + + The requested URL, such as "http://Myserver/Mypath/Myfile.asp". + The requested type. + An newly created instance. + + + + Creates an instance of the given type from the specified Internet resource. + + The requested URL, such as "http://Myserver/Mypath/Myfile.asp". + The URL that specifies the XSLT stylesheet to load. + An containing the namespace-qualified arguments used as input to the transform. + The requested type. + An newly created instance. + + + + Creates an instance of the given type from the specified Internet resource. + + The requested URL, such as "http://Myserver/Mypath/Myfile.asp". + The URL that specifies the XSLT stylesheet to load. + An containing the namespace-qualified arguments used as input to the transform. + The requested type. + A file path where the temporary XML before transformation will be saved. Mostly used for debugging purposes. + An newly created instance. + + + + Gets an HTML document from an Internet resource and saves it to the specified file. + + The requested URL, such as "http://Myserver/Mypath/Myfile.asp". + The location of the file where you want to save the document. + + + + Gets an HTML document from an Internet resource and saves it to the specified file. - Proxy aware + + The requested URL, such as "http://Myserver/Mypath/Myfile.asp". + The location of the file where you want to save the document. + + + + + + Gets an HTML document from an Internet resource and saves it to the specified file. + + The requested URL, such as "http://Myserver/Mypath/Myfile.asp". + The location of the file where you want to save the document. + The HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND. + + + + Gets an HTML document from an Internet resource and saves it to the specified file. Understands Proxies + + The requested URL, such as "http://Myserver/Mypath/Myfile.asp". + The location of the file where you want to save the document. + + The HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND. + + + + + Gets the cache file path for a specified url. + + The url fo which to retrieve the cache path. May not be null. + The cache file path. + + + + Gets an HTML document from an Internet resource. + + The requested URL, such as "http://Myserver/Mypath/Myfile.asp". + A new HTML document. + + + + Gets an HTML document from an Internet resource. + + The requested URL, such as "http://Myserver/Mypath/Myfile.asp". + Host to use for Proxy + Port the Proxy is on + User Id for Authentication + Password for Authentication + A new HTML document. + + + + Loads an HTML document from an Internet resource. + + The requested URL, such as "http://Myserver/Mypath/Myfile.asp". + The HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND. + A new HTML document. + + + + Loads an HTML document from an Internet resource. + + The requested URL, such as "http://Myserver/Mypath/Myfile.asp". + The HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND. + Proxy to use with this request + Credentials to use when authenticating + A new HTML document. + + + + Loads an HTML document from an Internet resource and saves it to the specified XmlTextWriter. + + The requested URL, such as "http://Myserver/Mypath/Myfile.asp". + The XmlTextWriter to which you want to save. + + + + Loads an HTML document from an Internet resource and saves it to the specified XmlTextWriter, after an XSLT transformation. + + The requested URL, such as "http://Myserver/Mypath/Myfile.asp". + The URL that specifies the XSLT stylesheet to load. + An XsltArgumentList containing the namespace-qualified arguments used as input to the transform. + The XmlTextWriter to which you want to save. + + + + Loads an HTML document from an Internet resource and saves it to the specified XmlTextWriter, after an XSLT transformation. + + The requested URL, such as "http://Myserver/Mypath/Myfile.asp". May not be null. + The URL that specifies the XSLT stylesheet to load. + An XsltArgumentList containing the namespace-qualified arguments used as input to the transform. + The XmlTextWriter to which you want to save. + A file path where the temporary XML before transformation will be saved. Mostly used for debugging purposes. + + + + Gets or Sets a value indicating if document encoding must be automatically detected. + + + + + Gets or Sets a value indicating whether to get document only from the cache. + If this is set to true and document is not found in the cache, nothing will be loaded. + + + + + Gets or Sets the cache path. If null, no caching mechanism will be used. + + + + + Gets a value indicating if the last document was retrieved from the cache. + + + + + Gets the last request duration in milliseconds. + + + + + Gets the URI of the Internet resource that actually responded to the request. + + + + + Gets the last request status. + + + + + Gets or Sets the size of the buffer used for memory operations. + + + + + Gets or Sets a value indicating if cookies will be stored. + + + + + Gets or Sets a value indicating whether the caching mechanisms should be used or not. + + + + + Represents the method that will handle the PostResponse event. + + + + + Represents the method that will handle the PreHandleDocument event. + + + + + Represents the method that will handle the PreRequest event. + + + + + Represents the type of fragment in a mixed code document. + + + + + The fragment contains code. + + + + + The fragment contains text. + + + + + Represents a combined list and collection of HTML nodes. + + + + + Adds supplied item to collection + + + + + + Explicit clear + + + + + Retreives existence of supplied item + + + + + + + Copies collection to array + + + + + + + Get Explicit enumerator + + + + + + Explicit non-generic enumerator + + + + + + Retrieves the index for the supplied item, -1 if not found + + + + + + + Inserts given item into collection at supplied index + + + + + + + Explicit collection remove + + + + + + + Removes the attribute at the specified index. + + The index of the attribute to remove. + + + + Adds a new attribute to the collection with the given values + + + + + + + Inserts the specified attribute as the last attribute in the collection. + + The attribute to insert. May not be null. + The appended attribute. + + + + Creates and inserts a new attribute as the last attribute in the collection. + + The name of the attribute to insert. + The appended attribute. + + + + Creates and inserts a new attribute as the last attribute in the collection. + + The name of the attribute to insert. + The value of the attribute to insert. + The appended attribute. + + + + Checks for existance of attribute with given name + + + + + + + Inserts the specified attribute as the first node in the collection. + + The attribute to insert. May not be null. + The prepended attribute. + + + + Removes a given attribute from the list. + + The attribute to remove. May not be null. + + + + Removes an attribute from the list, using its name. If there are more than one attributes with this name, they will all be removed. + + The attribute's name. May not be null. + + + + Remove all attributes in the list. + + + + + Returns all attributes with specified name. Handles case insentivity + + Name of the attribute + + + + + Removes all attributes from the collection + + + + + Clears the attribute collection + + + + + Gets a given attribute from the list using its name. + + + + + Gets the number of elements actually contained in the list. + + + + + Gets readonly status of colelction + + + + + Gets the attribute at the specified index. + + + + + Flags that describe the behavior of an Element node. + + + + + The node is a CDATA node. + + + + + The node is empty. META or IMG are example of such nodes. + + + + + The node will automatically be closed during parsing. + + + + + The node can overlap. + + + + + Represents a combined list and collection of HTML nodes. + + + + + Initialize the HtmlNodeCollection with the base parent node + + The base node of the collection + + + + Add node to the collection + + + + + + Clears out the collection of HtmlNodes. Removes each nodes reference to parentnode, nextnode and prevnode + + + + + Gets existence of node in collection + + + + + + + Copy collection to array + + + + + + + Get Enumerator + + + + + + Get Explicit Enumerator + + + + + + Get index of node + + + + + + + Insert node at index + + + + + + + Remove node + + + + + + + Remove at index + + + + + + Get first instance of node in supplied collection + + + + + + + + Add node to the end of the collection + + + + + + Get first instance of node with name + + + + + + + Get index of node + + + + + + + Add node to the beginning of the collection + + + + + + Remove node at index + + + + + + + Replace node at index + + + + + + + Get all node descended from this collection + + + + + + Get all node descended from this collection + + + + + + Get all node descended from this collection with matching name + + + + + + Gets all first generation elements in collection + + + + + + Gets all first generation elements matching name + + + + + + + All first generation nodes in collection + + + + + + Gets a given node from the list. + + + + + Get node with tag name + + + + + + + Gets the number of elements actually contained in the list. + + + + + Is collection read only + + + + + Gets the node at the specified index. + + + + + A utility class to compute CRC32. + + + + + Compute a checksum for a given array of bytes. + + The array of bytes to compute the checksum for. + The computed checksum. + + + + Compute a checksum for a given string. + + The string to compute the checksum for. + The computed checksum. + + + + Represents an HTML node. + + + + + Gets the name of a comment node. It is actually defined as '#comment'. + + + + + Gets the name of the document node. It is actually defined as '#document'. + + + + + Gets the name of a text node. It is actually defined as '#text'. + + + + + Gets a collection of flags that define specific behaviors for specific element nodes. + The table contains a DictionaryEntry list with the lowercase tag name as the Key, and a combination of HtmlElementFlags as the Value. + + + + + Initialize HtmlNode. Builds a list of all tags that have special allowances + + + + + Initializes HtmlNode, providing type, owner and where it exists in a collection + + + + + + + + Creates a new XPathNavigator object for navigating this HTML node. + + An XPathNavigator object. The XPathNavigator is positioned on the node from which the method was called. It is not positioned on the root of the document. + + + + Determines if an element node can be kept overlapped. + + The name of the element node to check. May not be null. + true if the name is the name of an element node that can be kept overlapped, false otherwise. + + + + Creates an HTML node from a string representing literal HTML. + + The HTML text. + The newly created node instance. + + + + Determines if an element node is a CDATA element node. + + The name of the element node to check. May not be null. + true if the name is the name of a CDATA element node, false otherwise. + + + + Determines if an element node is closed. + + The name of the element node to check. May not be null. + true if the name is the name of a closed element node, false otherwise. + + + + Determines if an element node is defined as empty. + + The name of the element node to check. May not be null. + true if the name is the name of an empty element node, false otherwise. + + + + Determines if a text corresponds to the closing tag of an node that can be kept overlapped. + + The text to check. May not be null. + true or false. + + + + Returns a collection of all ancestor nodes of this element. + + + + + + Get Ancestors with matching name + + + + + + + Returns a collection of all ancestor nodes of this element. + + + + + + Gets all anscestor nodes and the current node + + + + + + + Adds the specified node to the end of the list of children of this node. + + The node to add. May not be null. + The node added. + + + + Adds the specified node to the end of the list of children of this node. + + The node list to add. May not be null. + + + + Gets all Attributes with name + + + + + + + Creates a duplicate of the node + + + + + + Creates a duplicate of the node and changes its name at the same time. + + The new name of the cloned node. May not be null. + The cloned node. + + + + Creates a duplicate of the node and changes its name at the same time. + + The new name of the cloned node. May not be null. + true to recursively clone the subtree under the specified node; false to clone only the node itself. + The cloned node. + + + + Creates a duplicate of the node. + + true to recursively clone the subtree under the specified node; false to clone only the node itself. + The cloned node. + + + + Creates a duplicate of the node and the subtree under it. + + The node to duplicate. May not be null. + + + + Creates a duplicate of the node. + + The node to duplicate. May not be null. + true to recursively clone the subtree under the specified node, false to clone only the node itself. + + + + Creates an XPathNavigator using the root of this document. + + + + + + Gets all Descendant nodes for this node and each of child nodes + + + + + + Returns a collection of all descendant nodes of this element, in document order + + + + + + Gets all Descendant nodes in enumerated list + + + + + + Get all descendant nodes with matching name + + + + + + + Returns a collection of all descendant nodes of this element, in document order + + + + + + Gets all descendant nodes including this node + + + + + + + Gets first generation child node matching name + + + + + + + Gets matching first generation child nodes matching name + + + + + + + Helper method to get the value of an attribute of this node. If the attribute is not found, the default value will be returned. + + The name of the attribute to get. May not be null. + The default value to return if not found. + The value of the attribute if found, the default value if not found. + + + + Helper method to get the value of an attribute of this node. If the attribute is not found, the default value will be returned. + + The name of the attribute to get. May not be null. + The default value to return if not found. + The value of the attribute if found, the default value if not found. + + + + Helper method to get the value of an attribute of this node. If the attribute is not found, the default value will be returned. + + The name of the attribute to get. May not be null. + The default value to return if not found. + The value of the attribute if found, the default value if not found. + + + + Inserts the specified node immediately after the specified reference node. + + The node to insert. May not be null. + The node that is the reference node. The newNode is placed after the refNode. + The node being inserted. + + + + Inserts the specified node immediately before the specified reference node. + + The node to insert. May not be null. + The node that is the reference node. The newChild is placed before this node. + The node being inserted. + + + + Adds the specified node to the beginning of the list of children of this node. + + The node to add. May not be null. + The node added. + + + + Adds the specified node list to the beginning of the list of children of this node. + + The node list to add. May not be null. + + + + Removes node from parent collection + + + + + Removes all the children and/or attributes of the current node. + + + + + Removes all the children of the current node. + + + + + Removes the specified child node. + + The node being removed. May not be null. + The node removed. + + + + Removes the specified child node. + + The node being removed. May not be null. + true to keep grand children of the node, false otherwise. + The node removed. + + + + Replaces the child node oldChild with newChild node. + + The new node to put in the child list. + The node being replaced in the list. + The node replaced. + + + + Selects a list of nodes matching the expression. + + The XPath expression. + An containing a collection of nodes matching the query, or null if no node matched the XPath expression. + + + + Selects the first XmlNode that matches the XPath expression. + + The XPath expression. May not be null. + The first that matches the XPath query or a null reference if no matching node was found. + + + + Helper method to set the value of an attribute of this node. If the attribute is not found, it will be created automatically. + + The name of the attribute to set. May not be null. + The value for the attribute. + The corresponding attribute instance. + + + + Saves all the children of the node to the specified TextWriter. + + The TextWriter to which you want to save. + + + + Saves all the children of the node to a string. + + The saved string. + + + + Saves the current node to the specified TextWriter. + + The TextWriter to which you want to save. + + + + Saves the current node to the specified XmlWriter. + + The XmlWriter to which you want to save. + + + + Saves the current node to a string. + + The saved string. + + + + Gets the collection of HTML attributes for this node. May not be null. + + + + + Gets all the children of the node. + + + + + Gets a value indicating if this node has been closed or not. + + + + + Gets the collection of HTML attributes for the closing tag. May not be null. + + + + + Gets the first child of the node. + + + + + Gets a value indicating whether the current node has any attributes. + + + + + Gets a value indicating whether this node has any child nodes. + + + + + Gets a value indicating whether the current node has any attributes on the closing tag. + + + + + Gets or sets the value of the 'id' HTML attribute. The document must have been parsed using the OptionUseIdAttribute set to true. + + + + + Gets or Sets the HTML between the start and end tags of the object. + + + + + Gets or Sets the text between the start and end tags of the object. + + + + + Gets the last child of the node. + + + + + Gets the line number of this node in the document. + + + + + Gets the column number of this node in the document. + + + + + Gets or sets this node's name. + + + + + Gets the HTML node immediately following this element. + + + + + Gets the type of this node. + + + + + The original unaltered name of the tag + + + + + Gets or Sets the object and its content in HTML. + + + + + Gets the to which this node belongs. + + + + + Gets the parent of this node (for nodes that can have parents). + + + + + Gets the node immediately preceding this node. + + + + + Gets the stream position of this node in the document, relative to the start of the document. + + + + + Gets a valid XPath string that points to this node + + + + + Represents an HTML attribute. + + + + + Compares the current instance with another attribute. Comparison is based on attributes' name. + + An attribute to compare with this instance. + A 32-bit signed integer that indicates the relative order of the names comparison. + + + + Creates a duplicate of this attribute. + + The cloned attribute. + + + + Removes this attribute from it's parents collection + + + + + Gets the line number of this attribute in the document. + + + + + Gets the column number of this attribute in the document. + + + + + Gets the qualified name of the attribute. + + + + + Name of attribute with original case + + + + + Gets the HTML document to which this attribute belongs. + + + + + Gets the HTML node to which this attribute belongs. + + + + + Specifies what type of quote the data should be wrapped in + + + + + Gets the stream position of this attribute in the document, relative to the start of the document. + + + + + Gets or sets the value of the attribute. + + + + + Gets a valid XPath string that points to this Attribute + + + + + An Enum representing different types of Quotes used for surrounding attribute values + + + + + A single quote mark ' + + + + + A double quote mark " + + + + + A utility class to replace special characters by entities and vice-versa. + Follows HTML 4.0 specification found at http://www.w3.org/TR/html4/sgml/entities.html + + + + + Replace known entities by characters. + + The source text. + The result text. + + + + Clone and entitize an HtmlNode. This will affect attribute values and nodes' text. It will also entitize all child nodes. + + The node to entitize. + An entitized cloned node. + + + + Replace characters above 127 by entities. + + The source text. + The result text. + + + + Replace characters above 127 by entities. + + The source text. + If set to false, the function will not use known entities name. Default is true. + The result text. + + + + Replace characters above 127 by entities. + + The source text. + If set to false, the function will not use known entities name. Default is true. + If set to true, the [quote], [ampersand], [lower than] and [greather than] characters will be entitized. + The result text + + + + A collection of entities indexed by name. + + + + + A collection of entities indexed by value. + + + + + Represents a fragment of text in a mixed code document. + + + + + Represents a base class for fragments in a mixed code document. + + + + + Gets the fragement text. + + + + + Gets the type of fragment. + + + + + Gets the line number of the fragment. + + + + + Gets the line position (column) of the fragment. + + + + + Gets the fragment position in the document's stream. + + + + + Gets the fragment text. + + + + + Represents an exception thrown by the HtmlWeb utility class. + + + + + Creates an instance of the HtmlWebException. + + The exception's message. + + + + Represents the type of parsing error. + + + + + A tag was not closed. + + + + + A tag was not opened. + + + + + There is a charset mismatch between stream and declared (META) encoding. + + + + + An end tag was not required. + + + + + An end tag is invalid at this position. + + + + + Represents an HTML comment. + + + + + Gets or Sets the comment text of the node. + + + + + Gets or Sets the HTML between the start and end tags of the object. In the case of a text node, it is equals to OuterHtml. + + + + + Gets or Sets the object and its content in HTML. + + + + + Represents a document with mixed code and text. ASP, ASPX, JSP, are good example of such documents. + + + + + Gets or sets the token representing code end. + + + + + Gets or sets the token representing code start. + + + + + Gets or sets the token representing code directive. + + + + + Gets or sets the token representing response write directive. + + + + + Creates a mixed code document instance. + + + + + Create a code fragment instances. + + The newly created code fragment instance. + + + + Create a text fragment instances. + + The newly created text fragment instance. + + + + Loads a mixed code document from a stream. + + The input stream. + + + + Loads a mixed code document from a stream. + + The input stream. + Indicates whether to look for byte order marks at the beginning of the file. + + + + Loads a mixed code document from a stream. + + The input stream. + The character encoding to use. + + + + Loads a mixed code document from a stream. + + The input stream. + The character encoding to use. + Indicates whether to look for byte order marks at the beginning of the file. + + + + Loads a mixed code document from a stream. + + The input stream. + The character encoding to use. + Indicates whether to look for byte order marks at the beginning of the file. + The minimum buffer size. + + + + Loads a mixed code document from a file. + + The complete file path to be read. + + + + Loads a mixed code document from a file. + + The complete file path to be read. + Indicates whether to look for byte order marks at the beginning of the file. + + + + Loads a mixed code document from a file. + + The complete file path to be read. + The character encoding to use. + + + + Loads a mixed code document from a file. + + The complete file path to be read. + The character encoding to use. + Indicates whether to look for byte order marks at the beginning of the file. + + + + Loads a mixed code document from a file. + + The complete file path to be read. + The character encoding to use. + Indicates whether to look for byte order marks at the beginning of the file. + The minimum buffer size. + + + + Loads the mixed code document from the specified TextReader. + + The TextReader used to feed the HTML data into the document. + + + + Loads a mixed document from a text + + The text to load. + + + + Saves the mixed document to the specified stream. + + The stream to which you want to save. + + + + Saves the mixed document to the specified stream. + + The stream to which you want to save. + The character encoding to use. + + + + Saves the mixed document to the specified file. + + The location of the file where you want to save the document. + + + + Saves the mixed document to the specified file. + + The location of the file where you want to save the document. + The character encoding to use. + + + + Saves the mixed document to the specified StreamWriter. + + The StreamWriter to which you want to save. + + + + Saves the mixed document to the specified TextWriter. + + The TextWriter to which you want to save. + + + + Gets the code represented by the mixed code document seen as a template. + + + + + Gets the list of code fragments in the document. + + + + + Gets the list of all fragments in the document. + + + + + Gets the encoding of the stream used to read the document. + + + + + Gets the list of text fragments in the document. + + + + + Represents a parsing error found during document parsing. + + + + + Gets the type of error. + + + + + Gets the line number of this error in the document. + + + + + Gets the column number of this error in the document. + + + + + Gets a description for the error. + + + + + Gets the the full text of the line containing the error. + + + + + Gets the absolute stream position of this error in the document, relative to the start of the document. + + + + + Represents a fragment of code in a mixed code document. + + + + + Gets the fragment code text. + + + + + Represents the type of a node. + + + + + The root of a document. + + + + + An HTML element. + + + + + An HTML comment. + + + + + A text node is always the child of an element or a document node. + + + + + Represents a list of mixed code fragments. + + + + + Gets an enumerator that can iterate through the fragment list. + + + + + Appends a fragment to the list of fragments. + + The fragment to append. May not be null. + + + + Gets an enumerator that can iterate through the fragment list. + + + + + Prepends a fragment to the list of fragments. + + The fragment to append. May not be null. + + + + Remove a fragment from the list of fragments. If this fragment was not in the list, an exception will be raised. + + The fragment to remove. May not be null. + + + + Remove all fragments from the list. + + + + + Remove a fragment from the list of fragments, using its index in the list. + + The index of the fragment to remove. + + + + Gets the Document + + + + + Gets the number of fragments contained in the list. + + + + + Gets a fragment from the list using its index. + + + + + Represents a fragment enumerator. + + + + + Advances the enumerator to the next element of the collection. + + true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. + + + + Sets the enumerator to its initial position, which is before the first element in the collection. + + + + + Gets the current element in the collection. + + + + + Gets the current element in the collection. + + + + + Represents an HTML text node. + + + + + Gets or Sets the HTML between the start and end tags of the object. In the case of a text node, it is equals to OuterHtml. + + + + + Gets or Sets the object and its content in HTML. + + + + + Gets or Sets the text of the node. + + + + diff --git a/lib/imageresizer/license.txt b/lib/imageresizer/license.txt index 3df1107af46..38064af2cd6 100644 --- a/lib/imageresizer/license.txt +++ b/lib/imageresizer/license.txt @@ -1,23 +1,23 @@ -Please visit the web page at -http://imageresizing.net/licenses/ - -The core and 18 plugins are free and open-source, under a modified MIT license called the Freedom license. -See http://imageresizing.net/licenses/freedom - -The following DLLs are under the Freedom license: - -* ImageResizer.dll -* ImageResizer.Mvc.dll -* ImageResizer.Plugins.Logging.dll - - -Development of this project is funded by people purchasing Pro and Enterprise licenses -to the 4 paid plugin bundles. Both Pro and Enterprise licenses are as MIT-like as possible, -allowing redistribution, modification, and sub-licensing. - -The free trial license permits use of the paid plugins for development and testing purposes, but not for production use. -http://imageresizing.net/licenses/trial - -Once you begin using them on a production server, you will need a Pro or Enterprise-wide license. - +Please visit the web page at +http://imageresizing.net/licenses/ + +The core and 18 plugins are free and open-source, under a modified MIT license called the Freedom license. +See http://imageresizing.net/licenses/freedom + +The following DLLs are under the Freedom license: + +* ImageResizer.dll +* ImageResizer.Mvc.dll +* ImageResizer.Plugins.Logging.dll + + +Development of this project is funded by people purchasing Pro and Enterprise licenses +to the 4 paid plugin bundles. Both Pro and Enterprise licenses are as MIT-like as possible, +allowing redistribution, modification, and sub-licensing. + +The free trial license permits use of the paid plugins for development and testing purposes, but not for production use. +http://imageresizing.net/licenses/trial + +Once you begin using them on a production server, you will need a Pro or Enterprise-wide license. + See http://imageresizing.net/plugins for information on buying licuenses. \ No newline at end of file diff --git a/lib/jquery-utils/jquery.utils.js b/lib/jquery-utils/jquery.utils.js index 8765f67d76d..b189f9e441b 100644 --- a/lib/jquery-utils/jquery.utils.js +++ b/lib/jquery-utils/jquery.utils.js @@ -1,2777 +1,2777 @@ -/* - jQuery utils - 0.8.5 - http://code.google.com/p/jquery-utils/ - - (c) Maxime Haineault - http://haineault.com - - MIT License (http://www.opensource.org/licenses/mit-license.php - -*/ - -(function($){ - $.extend($.expr[':'], { - // case insensitive version of :contains - icontains: function(a,i,m){return (a.textContent||a.innerText||jQuery(a).text()||"").toLowerCase().indexOf(m[3].toLowerCase())>=0;} - }); - - $.iterators = { - getText: function() { return $(this).text(); }, - parseInt: function(v){ return parseInt(v, 10); } - }; - - $.extend({ - - // Returns a range object - // Author: Matthias Miller - // Site: http://blog.outofhanwell.com/2006/03/29/javascript-range-function/ - range: function() { - if (!arguments.length) { return []; } - var min, max, step; - if (arguments.length == 1) { - min = 0; - max = arguments[0]-1; - step = 1; - } - else { - // default step to 1 if it's zero or undefined - min = arguments[0]; - max = arguments[1]-1; - step = arguments[2] || 1; - } - // convert negative steps to positive and reverse min/max - if (step < 0 && min >= max) { - step *= -1; - var tmp = min; - min = max; - max = tmp; - min += ((max-min) % step); - } - var a = []; - for (var i = min; i <= max; i += step) { a.push(i); } - return a; - }, - - // Taken from ui.core.js. - // Why are you keeping this gem for yourself guys ? :| - keyCode: { - BACKSPACE: 8, CAPS_LOCK: 20, COMMA: 188, CONTROL: 17, DELETE: 46, DOWN: 40, - END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37, - NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, - NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, - PERIOD: 190, RIGHT: 39, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38 - }, - - // Takes a keyboard event and return true if the keycode match the specified keycode - keyIs: function(k, e) { - return parseInt($.keyCode[k.toUpperCase()], 10) == parseInt((typeof(e) == 'number' )? e: e.keyCode, 10); - }, - - // Returns the key of an array - keys: function(arr) { - var o = []; - for (k in arr) { o.push(k); } - return o; - }, - - // Redirect to a specified url - redirect: function(url) { - window.location.href = url; - return url; - }, - - // Stop event shorthand - stop: function(e, preventDefault, stopPropagation) { - if (preventDefault) { e.preventDefault(); } - if (stopPropagation) { e.stopPropagation(); } - return preventDefault && false || true; - }, - - // Returns the basename of a path - basename: function(path) { - var t = path.split('/'); - return t[t.length] === '' && s || t.slice(0, t.length).join('/'); - }, - - // Returns the filename of a path - filename: function(path) { - return path.split('/').pop(); - }, - - // Returns a formated file size - filesizeformat: function(bytes, suffixes){ - var b = parseInt(bytes, 10); - var s = suffixes || ['byte', 'bytes', 'KB', 'MB', 'GB']; - if (isNaN(b) || b === 0) { return '0 ' + s[0]; } - if (b == 1) { return '1 ' + s[0]; } - if (b < 1024) { return b.toFixed(2) + ' ' + s[1]; } - if (b < 1048576) { return (b / 1024).toFixed(2) + ' ' + s[2]; } - if (b < 1073741824) { return (b / 1048576).toFixed(2) + ' '+ s[3]; } - else { return (b / 1073741824).toFixed(2) + ' '+ s[4]; } - }, - - fileExtension: function(s) { - var tokens = s.split('.'); - return tokens[tokens.length-1] || false; - }, - - // Returns true if an object is a String - isString: function(o) { - return typeof(o) == 'string' && true || false; - }, - - // Returns true if an object is a RegExp - isRegExp: function(o) { - return o && o.constructor.toString().indexOf('RegExp()') != -1 || false; - }, - - isObject: function(o) { - return (typeof(o) == 'object'); - }, - - // Convert input to currency (two decimal fixed number) - toCurrency: function(i) { - i = parseFloat(i, 10).toFixed(2); - return (i=='NaN') ? '0.00' : i; - }, - - /*-------------------------------------------------------------------- - * javascript method: "pxToEm" - * by: - Scott Jehl (scott@filamentgroup.com) - Maggie Wachs (maggie@filamentgroup.com) - http://www.filamentgroup.com - * - * Copyright (c) 2008 Filament Group - * Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses. - * - * Description: pxToEm converts a pixel value to ems depending on inherited font size. - * Article: http://www.filamentgroup.com/lab/retaining_scalable_interfaces_with_pixel_to_em_conversion/ - * Demo: http://www.filamentgroup.com/examples/pxToEm/ - * - * Options: - scope: string or jQuery selector for font-size scoping - reverse: Boolean, true reverses the conversion to em-px - * Dependencies: jQuery library - * Usage Example: myPixelValue.pxToEm(); or myPixelValue.pxToEm({'scope':'#navigation', reverse: true}); - * - * Version: 2.1, 18.12.2008 - * Changelog: - * 08.02.2007 initial Version 1.0 - * 08.01.2008 - fixed font-size calculation for IE - * 18.12.2008 - removed native object prototyping to stay in jQuery's spirit, jsLinted (Maxime Haineault ) - --------------------------------------------------------------------*/ - - pxToEm: function(i, settings){ - //set defaults - settings = jQuery.extend({ - scope: 'body', - reverse: false - }, settings); - - var pxVal = (i === '') ? 0 : parseFloat(i); - var scopeVal; - var getWindowWidth = function(){ - var de = document.documentElement; - return self.innerWidth || (de && de.clientWidth) || document.body.clientWidth; - }; - - /* When a percentage-based font-size is set on the body, IE returns that percent of the window width as the font-size. - For example, if the body font-size is 62.5% and the window width is 1000px, IE will return 625px as the font-size. - When this happens, we calculate the correct body font-size (%) and multiply it by 16 (the standard browser font size) - to get an accurate em value. */ - - if (settings.scope == 'body' && $.browser.msie && (parseFloat($('body').css('font-size')) / getWindowWidth()).toFixed(1) > 0.0) { - var calcFontSize = function(){ - return (parseFloat($('body').css('font-size'))/getWindowWidth()).toFixed(3) * 16; - }; - scopeVal = calcFontSize(); - } - else { scopeVal = parseFloat(jQuery(settings.scope).css("font-size")); } - - var result = (settings.reverse === true) ? (pxVal * scopeVal).toFixed(2) + 'px' : (pxVal / scopeVal).toFixed(2) + 'em'; - return result; - } - }); - - $.extend($.fn, { - type: function() { - try { return $(this).get(0).nodeName.toLowerCase(); } - catch(e) { return false; } - }, - // Select a text range in a textarea - selectRange: function(start, end){ - // use only the first one since only one input can be focused - if ($(this).get(0).createTextRange) { - var range = $(this).get(0).createTextRange(); - range.collapse(true); - range.moveEnd('character', end); - range.moveStart('character', start); - range.select(); - } - else if ($(this).get(0).setSelectionRange) { - $(this).bind('focus', function(e){ - e.preventDefault(); - }).get(0).setSelectionRange(start, end); - } - return $(this); - }, - - /*-------------------------------------------------------------------- - * JQuery Plugin: "EqualHeights" - * by: Scott Jehl, Todd Parker, Maggie Costello Wachs (http://www.filamentgroup.com) - * - * Copyright (c) 2008 Filament Group - * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php) - * - * Description: Compares the heights or widths of the top-level children of a provided element - and sets their min-height to the tallest height (or width to widest width). Sets in em units - by default if pxToEm() method is available. - * Dependencies: jQuery library, pxToEm method (article: - http://www.filamentgroup.com/lab/retaining_scalable_interfaces_with_pixel_to_em_conversion/) - * Usage Example: $(element).equalHeights(); - Optional: to set min-height in px, pass a true argument: $(element).equalHeights(true); - * Version: 2.1, 18.12.2008 - * - * Note: Changed pxToEm call to call $.pxToEm instead, jsLinted (Maxime Haineault ) - --------------------------------------------------------------------*/ - - equalHeights: function(px){ - $(this).each(function(){ - var currentTallest = 0; - $(this).children().each(function(i){ - if ($(this).height() > currentTallest) { currentTallest = $(this).height(); } - }); - if (!px || !$.pxToEm) { currentTallest = $.pxToEm(currentTallest); } //use ems unless px is specified - // for ie6, set height since min-height isn't supported - if ($.browser.msie && $.browser.version == 6.0) { $(this).children().css({'height': currentTallest}); } - $(this).children().css({'min-height': currentTallest}); - }); - return this; - }, - - // Copyright (c) 2009 James Padolsey - // http://james.padolsey.com/javascript/jquery-delay-plugin/ - delay: function(time, callback){ - jQuery.fx.step.delay = function(){}; - return this.animate({delay:1}, time, callback); - } - }); -})(jQuery); -/* - jQuery strings - 0.3 - http://code.google.com/p/jquery-utils/ - - (c) Maxime Haineault - http://haineault.com - - MIT License (http://www.opensource.org/licenses/mit-license.php) - - Implementation of Python3K advanced string formatting - http://www.python.org/dev/peps/pep-3101/ - - Documentation: http://code.google.com/p/jquery-utils/wiki/StringFormat - -*/ -(function($){ - var strings = { - strConversion: { - // tries to translate any objects type into string gracefully - __repr: function(i){ - switch(this.__getType(i)) { - case 'array':case 'date':case 'number': - return i.toString(); - case 'object': - var o = []; - for (x=0; x 0) { - o = new Array(Math.ceil(l / p.length)).join(p).substr(0, t = !t ? l : t == 1 ? 0 : Math.ceil(l / 2)) + str + p.substr(0, l - t); - } - return o; - }, - __getInput: function(arg, args) { - var key = arg.getKey(); - switch(this.__getType(args)){ - case 'object': // Thanks to Jonathan Works for the patch - var keys = key.split('.'); - var obj = args; - for(var subkey = 0; subkey < keys.length; subkey++){ - obj = obj[keys[subkey]]; - } - if (typeof(obj) != 'undefined') { - if (strings.strConversion.__getType(obj) == 'array') { - return arg.getFormat().match(/\.\*/) && obj[1] || obj; - } - return obj; - } - else { - // TODO: try by numerical index - } - break; - case 'array': - key = parseInt(key, 10); - if (arg.getFormat().match(/\.\*/) && typeof args[key+1] != 'undefined') { return args[key+1]; } - else if (typeof args[key] != 'undefined') { return args[key]; } - else { return key; } - break; - } - return '{'+key+'}'; - }, - __formatToken: function(token, args) { - var arg = new Argument(token, args); - return strings.strConversion[arg.getFormat().slice(-1)](this.__getInput(arg, args), arg); - }, - - // Signed integer decimal. - d: function(input, arg){ - var o = parseInt(input, 10); // enforce base 10 - var p = arg.getPaddingLength(); - if (p) { return this.__pad(o.toString(), p, arg.getPaddingString(), 0); } - else { return o; } - }, - // Signed integer decimal. - i: function(input, args){ - return this.d(input, args); - }, - // Unsigned octal - o: function(input, arg){ - var o = input.toString(8); - if (arg.isAlternate()) { o = this.__pad(o, o.length+1, '0', 0); } - return this.__pad(o, arg.getPaddingLength(), arg.getPaddingString(), 0); - }, - // Unsigned decimal - u: function(input, args) { - return Math.abs(this.d(input, args)); - }, - // Unsigned hexadecimal (lowercase) - x: function(input, arg){ - var o = parseInt(input, 10).toString(16); - o = this.__pad(o, arg.getPaddingLength(), arg.getPaddingString(),0); - return arg.isAlternate() ? '0x'+o : o; - }, - // Unsigned hexadecimal (uppercase) - X: function(input, arg){ - return this.x(input, arg).toUpperCase(); - }, - // Floating point exponential format (lowercase) - e: function(input, arg){ - return parseFloat(input, 10).toExponential(arg.getPrecision()); - }, - // Floating point exponential format (uppercase) - E: function(input, arg){ - return this.e(input, arg).toUpperCase(); - }, - // Floating point decimal format - f: function(input, arg){ - return this.__pad(parseFloat(input, 10).toFixed(arg.getPrecision()), arg.getPaddingLength(), arg.getPaddingString(),0); - }, - // Floating point decimal format (alias) - F: function(input, args){ - return this.f(input, args); - }, - // Floating point format. Uses exponential format if exponent is greater than -4 or less than precision, decimal format otherwise - g: function(input, arg){ - var o = parseFloat(input, 10); - return (o.toString().length > 6) ? Math.round(o.toExponential(arg.getPrecision())): o; - }, - // Floating point format. Uses exponential format if exponent is greater than -4 or less than precision, decimal format otherwise - G: function(input, args){ - return this.g(input, args); - }, - // Single character (accepts integer or single character string). - c: function(input, args) { - var match = input.match(/\w|\d/); - return match && match[0] || ''; - }, - // String (converts any JavaScript object to anotated format) - r: function(input, args) { - return this.__repr(input); - }, - // String (converts any JavaScript object using object.toString()) - s: function(input, args) { - return input.toString && input.toString() || ''+input; - } - }, - - format: function(str, args) { - var end = 0; - var start = 0; - var match = false; - var buffer = []; - var token = ''; - var tmp = (str||'').split(''); - for(start=0; start < tmp.length; start++) { - if (tmp[start] == '{' && tmp[start+1] !='{') { - end = str.indexOf('}', start); - token = tmp.slice(start+1, end).join(''); - if (tmp[start-1] != '{' && tmp[end+1] != '}') { - var tokenArgs = (typeof arguments[1] != 'object')? arguments2Array(arguments, 2): args || []; - buffer.push(strings.strConversion.__formatToken(token, tokenArgs)); - } - else { - buffer.push(token); - } - } - else if (start > end || buffer.length < 1) { buffer.push(tmp[start]); } - } - return (buffer.length > 1)? buffer.join(''): buffer[0]; - }, - - calc: function(str, args) { - return eval(format(str, args)); - }, - - repeat: function(s, n) { - return new Array(n+1).join(s); - }, - - UTF8encode: function(s) { - return unescape(encodeURIComponent(s)); - }, - - UTF8decode: function(s) { - return decodeURIComponent(escape(s)); - }, - - tpl: function() { - var out = ''; - var render = true; - // Set - // $.tpl('ui.test', ['', helloWorld ,'']); - if (arguments.length == 2 && $.isArray(arguments[1])) { - this[arguments[0]] = arguments[1].join(''); - return $(this[arguments[0]]); - } - // $.tpl('ui.test', 'hello world'); - if (arguments.length == 2 && $.isString(arguments[1])) { - this[arguments[0]] = arguments[1]; - return $(this[arguments[0]]); - } - // Call - // $.tpl('ui.test'); - if (arguments.length == 1) { - return $(this[arguments[0]]); - } - // $.tpl('ui.test', false); - if (arguments.length == 2 && arguments[1] == false) { - return this[arguments[0]]; - } - // $.tpl('ui.test', {value:blah}); - if (arguments.length == 2 && $.isObject(arguments[1])) { - return $($.format(this[arguments[0]], arguments[1])); - } - // $.tpl('ui.test', {value:blah}, false); - if (arguments.length == 3 && $.isObject(arguments[1])) { - return (arguments[2] == true) - ? $.format(this[arguments[0]], arguments[1]) - : $($.format(this[arguments[0]], arguments[1])); - } - } - }; - - var Argument = function(arg, args) { - this.__arg = arg; - this.__args = args; - this.__max_precision = parseFloat('1.'+ (new Array(32)).join('1'), 10).toString().length-3; - this.__def_precision = 6; - this.getString = function(){ - return this.__arg; - }; - this.getKey = function(){ - return this.__arg.split(':')[0]; - }; - this.getFormat = function(){ - var match = this.getString().split(':'); - return (match && match[1])? match[1]: 's'; - }; - this.getPrecision = function(){ - var match = this.getFormat().match(/\.(\d+|\*)/g); - if (!match) { return this.__def_precision; } - else { - match = match[0].slice(1); - if (match != '*') { return parseInt(match, 10); } - else if(strings.strConversion.__getType(this.__args) == 'array') { - return this.__args[1] && this.__args[0] || this.__def_precision; - } - else if(strings.strConversion.__getType(this.__args) == 'object') { - return this.__args[this.getKey()] && this.__args[this.getKey()][0] || this.__def_precision; - } - else { return this.__def_precision; } - } - }; - this.getPaddingLength = function(){ - var match = false; - if (this.isAlternate()) { - match = this.getString().match(/0?#0?(\d+)/); - if (match && match[1]) { return parseInt(match[1], 10); } - } - match = this.getString().match(/(0|\.)(\d+|\*)/g); - return match && parseInt(match[0].slice(1), 10) || 0; - }; - this.getPaddingString = function(){ - var o = ''; - if (this.isAlternate()) { o = ' '; } - // 0 take precedence on alternate format - if (this.getFormat().match(/#0|0#|^0|\.\d+/)) { o = '0'; } - return o; - }; - this.getFlags = function(){ - var match = this.getString().matc(/^(0|\#|\-|\+|\s)+/); - return match && match[0].split('') || []; - }; - this.isAlternate = function() { - return !!this.getFormat().match(/^0?#/); - }; - }; - - var arguments2Array = function(args, shift) { - var o = []; - for (l=args.length, x=(shift || 0)-1; x - http://haineault.com - - MIT License (http://www.opensource.org/licenses/mit-license.php) - -*/ - -(function($){ - var hash = window.location.hash; - var handlers = []; - var opt = {}; - - $.extend({ - anchorHandler: { - apply: function() { - $.map(handlers, function(handler){ - var match = hash.match(handler.r) && hash.match(handler.r)[0] || false; - if (match) { handler.cb.apply($('a[href*='+match+']').get(0), [handler.r, hash || '']); } - }); - return $.anchorHandler; - }, - add: function(regexp, callback, options) { - var opt = $.extend({handleClick: true, preserveHash: true}, options); - if (opt.handleClick) { - $('a[href*=#]').each(function(i, a){ - if (a.href.match(regexp)) { - $(a).bind('click.anchorHandler', function(){ - if (opt.preserveHash) { window.location.hash = a.hash; } - return callback.apply(this, [regexp, a.href]); - }); - } - }); - } - handlers.push({r: regexp, cb: callback}); - $($.anchorHandler.apply); - return $.anchorHandler; - } - } - }); -})(jQuery); -/** - * Cookie plugin - * - * Copyright (c) 2006 Klaus Hartl (stilbuero.de) - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - * - */ - -/** - * Create a cookie with the given name and value and other optional parameters. - * - * @example $.cookie('the_cookie', 'the_value'); - * @desc Set the value of a cookie. - * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true }); - * @desc Create a cookie with all available options. - * @example $.cookie('the_cookie', 'the_value'); - * @desc Create a session cookie. - * @example $.cookie('the_cookie', null); - * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain - * used when the cookie was set. - * - * @param String name The name of the cookie. - * @param String value The value of the cookie. - * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. - * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. - * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. - * If set to null or omitted, the cookie will be a session cookie and will not be retained - * when the the browser exits. - * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). - * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). - * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will - * require a secure protocol (like HTTPS). - * @type undefined - * - * @name $.cookie - * @cat Plugins/Cookie - * @author Klaus Hartl/klaus.hartl@stilbuero.de - */ - -/** - * Get the value of a cookie with the given name. - * - * @example $.cookie('the_cookie'); - * @desc Get the value of a cookie. - * - * @param String name The name of the cookie. - * @return The value of the cookie. - * @type String - * - * @name $.cookie - * @cat Plugins/Cookie - * @author Klaus Hartl/klaus.hartl@stilbuero.de - */ -jQuery.cookie = function(name, value, options) { - if (typeof value != 'undefined') { // name and value given, set cookie - options = options || {}; - if (value === null) { - value = ''; - options.expires = -1; - } - var expires = ''; - if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { - var date; - if (typeof options.expires == 'number') { - date = new Date(); - date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); - } else { - date = options.expires; - } - expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE - } - // CAUTION: Needed to parenthesize options.path and options.domain - // in the following expressions, otherwise they evaluate to undefined - // in the packed version for some reason... - var path = options.path ? '; path=' + (options.path) : ''; - var domain = options.domain ? '; domain=' + (options.domain) : ''; - var secure = options.secure ? '; secure' : ''; - document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); - } else { // only name given, get cookie - var cookieValue = null; - if (document.cookie && document.cookie != '') { - var cookies = document.cookie.split(';'); - for (var i = 0; i < cookies.length; i++) { - var cookie = jQuery.trim(cookies[i]); - // Does this cookie string begin with the name we want? - if (cookie.substring(0, name.length + 1) == (name + '=')) { - cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); - break; - } - } - } - return cookieValue; - } -}; -/* - jQuery countdown - 0.2 - http://code.google.com/p/jquery-utils/ - - (c) Maxime Haineault - http://haineault.com - - MIT License (http://www.opensource.org/licenses/mit-license.php) - -*/ - -(function($) { - function countdown(el, options) { - var calc = function (target, current) { - /* Return true if the target date has arrived, - * an object of the time left otherwise. - */ - var current = current || new Date(); - if (current >= target) { return true; } - - var o = {}; - var remain = Math.floor((target.getTime() - current.getTime()) / 1000); - - o.days = Math.floor(remain / 86400); - remain %= 86400; - o.hours = Math.floor(remain / 3600); - remain %= 3600; - o.minutes = Math.floor(remain / 60); - remain %= 60; - o.seconds = remain; - o.years = Math.floor(o.days / 365); - o.months = Math.floor(o.days / 30); - o.weeks = Math.floor(o.days / 7); - - return o; - }; - - var getWeek = function(date) { - var onejan = new Date(date.getFullYear(),0,1); - return Math.ceil((((date - onejan) / 86400000) + onejan.getDay())/7); - }; - - var options = $.extend({ - date: new Date(), - modifiers: [], - interval: 1000, - msgFormat: '%d [day|days] %hh %mm %ss', - msgNow: 'Now !' - }, options); - - var tokens = { - y: new RegExp ('\\%y(.+?)\\[(\\w+)\\|(\\w+)\\]', 'g'), // years - M: new RegExp ('\\%M(.+?)\\[(\\w+)\\|(\\w+)\\]', 'g'), // months - w: new RegExp ('\\%w(.+?)\\[(\\w+)\\|(\\w+)\\]', 'g'), // weeks - d: new RegExp ('\\%d(.+?)\\[(\\w+)\\|(\\w+)\\]', 'g'), // days - h: new RegExp ('\\%h(.+?)\\[(\\w+)\\|(\\w+)\\]', 'g'), // hours - m: new RegExp ('\\%m(.+?)\\[(\\w+)\\|(\\w+)\\]', 'g'), // minutes - s: new RegExp ('\\%s(.+?)\\[(\\w+)\\|(\\w+)\\]', 'g') // seconds - }; - - var formatToken = function(str, token, val) { - return (!tokens[token])? '': str.match(/\[|\]/g) - && (str.replace(tokens[token], val+'$1'+ ((parseInt(val, 10)<2)?'$2':'$3')) || '') - || str.replace('%'+token, val); - }; - - var format = function(str, obj) { - var o = str; - o = formatToken(o, 'y', obj.years); - o = formatToken(o, 'M', obj.months); - o = formatToken(o, 'w', obj.weeks); - o = formatToken(o, 'd', obj.days); - o = formatToken(o, 'h', obj.hours); - o = formatToken(o, 'm', obj.minutes); - o = formatToken(o, 's', obj.seconds); - return o; - }; - - var update = function() { - var date_obj = calc(cd.date); - if (date_obj === true) { - cd.stop(); clearInterval(cd.id); - $(cd.el).html(options.msgNow); - return true; - } - else { - $(cd.el).text(format(options.msgFormat, date_obj)); - } - }; - - var apply_modifiers = function (modifiers, date) { - if (modifiers.length === 0) { - return date; - } - - var modifier_re = /^([+-]\d+)([yMdhms])$/; - var conversions = { - s: 1000, - m: 60 * 1000, - h: 60 * 60 * 1000, - d: 24 * 60 * 60 * 1000, - M: 30 * 24 * 60 * 60 * 1000, - y: 365 * 24 * 60 * 60 * 1000 - }; - - var displacement = 0; - for (var i = 0, n = modifiers.length; i < n; ++i) { - var match = modifiers[i].match(modifier_re); - if (match !== null) { - displacement += parseInt(match[1], 10) * conversions[match[2]]; - } - } - return new Date(date.getTime() + displacement); - }; - - var cd = { - id : setInterval(update, options.interval), - el : el, - start : function(){ return new countdown($(this.el), options); }, - stop : function(){ return clearInterval(this.id); }, - date : apply_modifiers(options.modifiers, options.date) - }; - $(el).data('countdown', cd); - update(); - return $(el).data('countdown'); - } - $.fn.countdown = function(args) { if(this.get(0)) return new countdown(this.get(0), args); }; -})(jQuery); -/* - * jQuery Cycle Plugin for light-weight slideshows - * Examples and documentation at: http://malsup.com/jquery/cycle/ - * Copyright (c) 2007-2008 M. Alsup - * Version: 2.24 (07/30/2008) - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - * Requires: jQuery v1.2.3 or later - * - * Based on the work of: - * 1) Matt Oakes (http://portfolio.gizone.co.uk/applications/slideshow/) - * 2) Torsten Baldes (http://medienfreunde.com/lab/innerfade/) - * 3) Benjamin Sterling (http://www.benjaminsterling.com/experiments/jqShuffle/) - */ -;(function($) { - -var ver = '2.24'; -var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent); - -function log() { - if (window.console && window.console.log) - window.console.log('[cycle] ' + Array.prototype.join.call(arguments,'')); -}; - -$.fn.cycle = function(options) { - return this.each(function() { - if (options === undefined || options === null) - options = {}; - if (options.constructor == String) { - switch(options) { - case 'stop': - if (this.cycleTimeout) clearTimeout(this.cycleTimeout); - this.cycleTimeout = 0; - $(this).data('cycle.opts', ''); - return; - case 'pause': - this.cyclePause = 1; - return; - case 'resume': - this.cyclePause = 0; - return; - default: - options = { fx: options }; - }; - } - else if (options.constructor == Number) { - // go to the requested slide slide - var num = options; - options = $(this).data('cycle.opts'); - if (!options) { - log('options not found, can not advance slide'); - return; - } - if (num < 0 || num >= options.elements.length) { - log('invalid slide index: ' + num); - return; - } - options.nextSlide = num; - if (this.cycleTimeout) { - clearTimeout(this.cycleTimeout); - this.cycleTimeout = 0; - } - go(options.elements, options, 1, 1); - return; - } - - // stop existing slideshow for this container (if there is one) - if (this.cycleTimeout) clearTimeout(this.cycleTimeout); - this.cycleTimeout = 0; - this.cyclePause = 0; - - var $cont = $(this); - var $slides = options.slideExpr ? $(options.slideExpr, this) : $cont.children(); - var els = $slides.get(); - if (els.length < 2) { - log('terminating; too few slides: ' + els.length); - return; // don't bother - } - - // support metadata plugin (v1.0 and v2.0) - var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {}); - if (opts.autostop) - opts.countdown = opts.autostopCount || els.length; - - $cont.data('cycle.opts', opts); - opts.container = this; - - opts.elements = els; - opts.before = opts.before ? [opts.before] : []; - opts.after = opts.after ? [opts.after] : []; - opts.after.unshift(function(){ opts.busy=0; }); - if (opts.continuous) - opts.after.push(function() { go(els,opts,0,!opts.rev); }); - - // clearType corrections - if (ie6 && opts.cleartype && !opts.cleartypeNoBg) - clearTypeFix($slides); - - // allow shorthand overrides of width, height and timeout - var cls = this.className; - opts.width = parseInt((cls.match(/w:(\d+)/)||[])[1]) || opts.width; - opts.height = parseInt((cls.match(/h:(\d+)/)||[])[1]) || opts.height; - opts.timeout = parseInt((cls.match(/t:(\d+)/)||[])[1]) || opts.timeout; - - if ($cont.css('position') == 'static') - $cont.css('position', 'relative'); - if (opts.width) - $cont.width(opts.width); - if (opts.height && opts.height != 'auto') - $cont.height(opts.height); - - if (opts.random) { - opts.randomMap = []; - for (var i = 0; i < els.length; i++) - opts.randomMap.push(i); - opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;}); - opts.randomIndex = 0; - opts.startingSlide = opts.randomMap[0]; - } - else if (opts.startingSlide >= els.length) - opts.startingSlide = 0; // catch bogus input - var first = opts.startingSlide || 0; - $slides.css({position: 'absolute', top:0, left:0}).hide().each(function(i) { - var z = first ? i >= first ? els.length - (i-first) : first-i : els.length-i; - $(this).css('z-index', z) - }); - - $(els[first]).css('opacity',1).show(); // opacity bit needed to handle reinit case - if ($.browser.msie) els[first].style.removeAttribute('filter'); - - if (opts.fit && opts.width) - $slides.width(opts.width); - if (opts.fit && opts.height && opts.height != 'auto') - $slides.height(opts.height); - if (opts.pause) - $cont.hover(function(){this.cyclePause=1;},function(){this.cyclePause=0;}); - - // run transition init fn - var init = $.fn.cycle.transitions[opts.fx]; - if ($.isFunction(init)) - init($cont, $slides, opts); - else if (opts.fx != 'custom') - log('unknown transition: ' + opts.fx); - - $slides.each(function() { - var $el = $(this); - this.cycleH = (opts.fit && opts.height) ? opts.height : $el.height(); - this.cycleW = (opts.fit && opts.width) ? opts.width : $el.width(); - }); - - opts.cssBefore = opts.cssBefore || {}; - opts.animIn = opts.animIn || {}; - opts.animOut = opts.animOut || {}; - - $slides.not(':eq('+first+')').css(opts.cssBefore); - if (opts.cssFirst) - $($slides[first]).css(opts.cssFirst); - - if (opts.timeout) { - // ensure that timeout and speed settings are sane - if (opts.speed.constructor == String) - opts.speed = {slow: 600, fast: 200}[opts.speed] || 400; - if (!opts.sync) - opts.speed = opts.speed / 2; - while((opts.timeout - opts.speed) < 250) - opts.timeout += opts.speed; - } - if (opts.easing) - opts.easeIn = opts.easeOut = opts.easing; - if (!opts.speedIn) - opts.speedIn = opts.speed; - if (!opts.speedOut) - opts.speedOut = opts.speed; - - opts.slideCount = els.length; - opts.currSlide = first; - if (opts.random) { - opts.nextSlide = opts.currSlide; - if (++opts.randomIndex == els.length) - opts.randomIndex = 0; - opts.nextSlide = opts.randomMap[opts.randomIndex]; - } - else - opts.nextSlide = opts.startingSlide >= (els.length-1) ? 0 : opts.startingSlide+1; - - // fire artificial events - var e0 = $slides[first]; - if (opts.before.length) - opts.before[0].apply(e0, [e0, e0, opts, true]); - if (opts.after.length > 1) - opts.after[1].apply(e0, [e0, e0, opts, true]); - - if (opts.click && !opts.next) - opts.next = opts.click; - if (opts.next) - $(opts.next).bind('click', function(){return advance(els,opts,opts.rev?-1:1)}); - if (opts.prev) - $(opts.prev).bind('click', function(){return advance(els,opts,opts.rev?1:-1)}); - if (opts.pager) - buildPager(els,opts); - - // expose fn for adding slides after the show has started - opts.addSlide = function(newSlide) { - var $s = $(newSlide), s = $s[0]; - if (!opts.autostopCount) - opts.countdown++; - els.push(s); - if (opts.els) - opts.els.push(s); // shuffle needs this - opts.slideCount = els.length; - - $s.css('position','absolute').appendTo($cont); - - if (ie6 && opts.cleartype && !opts.cleartypeNoBg) - clearTypeFix($s); - - if (opts.fit && opts.width) - $s.width(opts.width); - if (opts.fit && opts.height && opts.height != 'auto') - $slides.height(opts.height); - s.cycleH = (opts.fit && opts.height) ? opts.height : $s.height(); - s.cycleW = (opts.fit && opts.width) ? opts.width : $s.width(); - - $s.css(opts.cssBefore); - - if (opts.pager) - $.fn.cycle.createPagerAnchor(els.length-1, s, $(opts.pager), els, opts); - - if (typeof opts.onAddSlide == 'function') - opts.onAddSlide($s); - }; - - if (opts.timeout || opts.continuous) - this.cycleTimeout = setTimeout( - function(){go(els,opts,0,!opts.rev)}, - opts.continuous ? 10 : opts.timeout + (opts.delay||0)); - }); -}; - -function go(els, opts, manual, fwd) { - if (opts.busy) return; - var p = opts.container, curr = els[opts.currSlide], next = els[opts.nextSlide]; - if (p.cycleTimeout === 0 && !manual) - return; - - if (!manual && !p.cyclePause && - ((opts.autostop && (--opts.countdown <= 0)) || - (opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide))) { - if (opts.end) - opts.end(opts); - return; - } - - if (manual || !p.cyclePause) { - if (opts.before.length) - $.each(opts.before, function(i,o) { o.apply(next, [curr, next, opts, fwd]); }); - var after = function() { - if ($.browser.msie && opts.cleartype) - this.style.removeAttribute('filter'); - $.each(opts.after, function(i,o) { o.apply(next, [curr, next, opts, fwd]); }); - }; - - if (opts.nextSlide != opts.currSlide) { - opts.busy = 1; - if (opts.fxFn) - opts.fxFn(curr, next, opts, after, fwd); - else if ($.isFunction($.fn.cycle[opts.fx])) - $.fn.cycle[opts.fx](curr, next, opts, after); - else - $.fn.cycle.custom(curr, next, opts, after); - } - if (opts.random) { - opts.currSlide = opts.nextSlide; - if (++opts.randomIndex == els.length) - opts.randomIndex = 0; - opts.nextSlide = opts.randomMap[opts.randomIndex]; - } - else { // sequence - var roll = (opts.nextSlide + 1) == els.length; - opts.nextSlide = roll ? 0 : opts.nextSlide+1; - opts.currSlide = roll ? els.length-1 : opts.nextSlide-1; - } - if (opts.pager) - $.fn.cycle.updateActivePagerLink(opts.pager, opts.currSlide); - } - if (opts.timeout && !opts.continuous) - p.cycleTimeout = setTimeout(function() { go(els,opts,0,!opts.rev) }, opts.timeout); - else if (opts.continuous && p.cyclePause) - p.cycleTimeout = setTimeout(function() { go(els,opts,0,!opts.rev) }, 10); -}; - -$.fn.cycle.updateActivePagerLink = function(pager, currSlide) { - $(pager).find('a').removeClass('activeSlide').filter('a:eq('+currSlide+')').addClass('activeSlide'); -}; - -// advance slide forward or back -function advance(els, opts, val) { - var p = opts.container, timeout = p.cycleTimeout; - if (timeout) { - clearTimeout(timeout); - p.cycleTimeout = 0; - } - if (opts.random && val < 0) { - // move back to the previously display slide - opts.randomIndex--; - if (--opts.randomIndex == -2) - opts.randomIndex = els.length-2; - else if (opts.randomIndex == -1) - opts.randomIndex = els.length-1; - opts.nextSlide = opts.randomMap[opts.randomIndex]; - } - else if (opts.random) { - if (++opts.randomIndex == els.length) - opts.randomIndex = 0; - opts.nextSlide = opts.randomMap[opts.randomIndex]; - } - else { - opts.nextSlide = opts.currSlide + val; - if (opts.nextSlide < 0) { - if (opts.nowrap) return false; - opts.nextSlide = els.length - 1; - } - else if (opts.nextSlide >= els.length) { - if (opts.nowrap) return false; - opts.nextSlide = 0; - } - } - -log('nextSlide: ' + opts.nextSlide + '; randomIndex: ' + opts.randomIndex); - if (opts.prevNextClick && typeof opts.prevNextClick == 'function') - opts.prevNextClick(val > 0, opts.nextSlide, els[opts.nextSlide]); - go(els, opts, 1, val>=0); - return false; -}; - -function buildPager(els, opts) { - var $p = $(opts.pager); - $.each(els, function(i,o) { - $.fn.cycle.createPagerAnchor(i,o,$p,els,opts); - }); - $.fn.cycle.updateActivePagerLink(opts.pager, opts.startingSlide); -}; - -$.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) { - var $a = (typeof opts.pagerAnchorBuilder == 'function') - ? $(opts.pagerAnchorBuilder(i,el)) - : $(''+(i+1)+''); - - // don't reparent if anchor is in the dom - if ($a.parents('body').length == 0) - $a.appendTo($p); - - $a.bind(opts.pagerEvent, function() { - opts.nextSlide = i; - var p = opts.container, timeout = p.cycleTimeout; - if (timeout) { - clearTimeout(timeout); - p.cycleTimeout = 0; - } - if (typeof opts.pagerClick == 'function') - opts.pagerClick(opts.nextSlide, els[opts.nextSlide]); - go(els,opts,1,opts.currSlide < i); - return false; - }); -}; - - -// this fixes clearType problems in ie6 by setting an explicit bg color -function clearTypeFix($slides) { - function hex(s) { - var s = parseInt(s).toString(16); - return s.length < 2 ? '0'+s : s; - }; - function getBg(e) { - for ( ; e && e.nodeName.toLowerCase() != 'html'; e = e.parentNode) { - var v = $.css(e,'background-color'); - if (v.indexOf('rgb') >= 0 ) { - var rgb = v.match(/\d+/g); - return '#'+ hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]); - } - if (v && v != 'transparent') - return v; - } - return '#ffffff'; - }; - $slides.each(function() { $(this).css('background-color', getBg(this)); }); -}; - - -$.fn.cycle.custom = function(curr, next, opts, cb) { - var $l = $(curr), $n = $(next); - $n.css(opts.cssBefore); - var fn = function() {$n.animate(opts.animIn, opts.speedIn, opts.easeIn, cb)}; - $l.animate(opts.animOut, opts.speedOut, opts.easeOut, function() { - if (opts.cssAfter) $l.css(opts.cssAfter); - if (!opts.sync) fn(); - }); - if (opts.sync) fn(); -}; - -$.fn.cycle.transitions = { - fade: function($cont, $slides, opts) { - $slides.not(':eq('+opts.startingSlide+')').css('opacity',0); - opts.before.push(function() { $(this).show() }); - opts.animIn = { opacity: 1 }; - opts.animOut = { opacity: 0 }; - opts.cssBefore = { opacity: 0 }; - opts.cssAfter = { display: 'none' }; - } -}; - -$.fn.cycle.ver = function() { return ver; }; - -// override these globally if you like (they are all optional) -$.fn.cycle.defaults = { - fx: 'fade', // one of: fade, shuffle, zoom, scrollLeft, etc - timeout: 4000, // milliseconds between slide transitions (0 to disable auto advance) - continuous: 0, // true to start next transition immediately after current one completes - speed: 1000, // speed of the transition (any valid fx speed value) - speedIn: null, // speed of the 'in' transition - speedOut: null, // speed of the 'out' transition - next: null, // id of element to use as click trigger for next slide - prev: null, // id of element to use as click trigger for previous slide - prevNextClick: null, // callback fn for prev/next clicks: function(isNext, zeroBasedSlideIndex, slideElement) - pager: null, // id of element to use as pager container - pagerClick: null, // callback fn for pager clicks: function(zeroBasedSlideIndex, slideElement) - pagerEvent: 'click', // event which drives the pager navigation - pagerAnchorBuilder: null, // callback fn for building anchor links - before: null, // transition callback (scope set to element to be shown) - after: null, // transition callback (scope set to element that was shown) - end: null, // callback invoked when the slideshow terminates (use with autostop or nowrap options) - easing: null, // easing method for both in and out transitions - easeIn: null, // easing for "in" transition - easeOut: null, // easing for "out" transition - shuffle: null, // coords for shuffle animation, ex: { top:15, left: 200 } - animIn: null, // properties that define how the slide animates in - animOut: null, // properties that define how the slide animates out - cssBefore: null, // properties that define the initial state of the slide before transitioning in - cssAfter: null, // properties that defined the state of the slide after transitioning out - fxFn: null, // function used to control the transition - height: 'auto', // container height - startingSlide: 0, // zero-based index of the first slide to be displayed - sync: 1, // true if in/out transitions should occur simultaneously - random: 0, // true for random, false for sequence (not applicable to shuffle fx) - fit: 0, // force slides to fit container - pause: 0, // true to enable "pause on hover" - autostop: 0, // true to end slideshow after X transitions (where X == slide count) - autostopCount: 0, // number of transitions (optionally used with autostop to define X) - delay: 0, // additional delay (in ms) for first transition (hint: can be negative) - slideExpr: null, // expression for selecting slides (if something other than all children is required) - cleartype: 0, // true if clearType corrections should be applied (for IE) - nowrap: 0 // true to prevent slideshow from wrapping -}; - -})(jQuery); - - -/* - * jQuery Cycle Plugin Transition Definitions - * This script is a plugin for the jQuery Cycle Plugin - * Examples and documentation at: http://malsup.com/jquery/cycle/ - * Copyright (c) 2007-2008 M. Alsup - * Version: 2.22 - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - */ -(function($) { - -// -// These functions define one-time slide initialization for the named -// transitions. To save file size feel free to remove any of these that you -// don't need. -// - -// scrollUp/Down/Left/Right -$.fn.cycle.transitions.scrollUp = function($cont, $slides, opts) { - $cont.css('overflow','hidden'); - opts.before.push(function(curr, next, opts) { - $(this).show(); - opts.cssBefore.top = next.offsetHeight; - opts.animOut.top = 0-curr.offsetHeight; - }); - opts.cssFirst = { top: 0 }; - opts.animIn = { top: 0 }; - opts.cssAfter = { display: 'none' }; -}; -$.fn.cycle.transitions.scrollDown = function($cont, $slides, opts) { - $cont.css('overflow','hidden'); - opts.before.push(function(curr, next, opts) { - $(this).show(); - opts.cssBefore.top = 0-next.offsetHeight; - opts.animOut.top = curr.offsetHeight; - }); - opts.cssFirst = { top: 0 }; - opts.animIn = { top: 0 }; - opts.cssAfter = { display: 'none' }; -}; -$.fn.cycle.transitions.scrollLeft = function($cont, $slides, opts) { - $cont.css('overflow','hidden'); - opts.before.push(function(curr, next, opts) { - $(this).show(); - opts.cssBefore.left = next.offsetWidth; - opts.animOut.left = 0-curr.offsetWidth; - }); - opts.cssFirst = { left: 0 }; - opts.animIn = { left: 0 }; -}; -$.fn.cycle.transitions.scrollRight = function($cont, $slides, opts) { - $cont.css('overflow','hidden'); - opts.before.push(function(curr, next, opts) { - $(this).show(); - opts.cssBefore.left = 0-next.offsetWidth; - opts.animOut.left = curr.offsetWidth; - }); - opts.cssFirst = { left: 0 }; - opts.animIn = { left: 0 }; -}; -$.fn.cycle.transitions.scrollHorz = function($cont, $slides, opts) { - $cont.css('overflow','hidden').width(); -// $slides.show(); - opts.before.push(function(curr, next, opts, fwd) { - $(this).show(); - var currW = curr.offsetWidth, nextW = next.offsetWidth; - opts.cssBefore = fwd ? { left: nextW } : { left: -nextW }; - opts.animIn.left = 0; - opts.animOut.left = fwd ? -currW : currW; - $slides.not(curr).css(opts.cssBefore); - }); - opts.cssFirst = { left: 0 }; - opts.cssAfter = { display: 'none' } -}; -$.fn.cycle.transitions.scrollVert = function($cont, $slides, opts) { - $cont.css('overflow','hidden'); -// $slides.show(); - opts.before.push(function(curr, next, opts, fwd) { - $(this).show(); - var currH = curr.offsetHeight, nextH = next.offsetHeight; - opts.cssBefore = fwd ? { top: -nextH } : { top: nextH }; - opts.animIn.top = 0; - opts.animOut.top = fwd ? currH : -currH; - $slides.not(curr).css(opts.cssBefore); - }); - opts.cssFirst = { top: 0 }; - opts.cssAfter = { display: 'none' } -}; - -// slideX/slideY -$.fn.cycle.transitions.slideX = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - $(curr).css('zIndex',1); - }); - opts.onAddSlide = function($s) { $s.hide(); }; - opts.cssBefore = { zIndex: 2 }; - opts.animIn = { width: 'show' }; - opts.animOut = { width: 'hide' }; -}; -$.fn.cycle.transitions.slideY = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - $(curr).css('zIndex',1); - }); - opts.onAddSlide = function($s) { $s.hide(); }; - opts.cssBefore = { zIndex: 2 }; - opts.animIn = { height: 'show' }; - opts.animOut = { height: 'hide' }; -}; - -// shuffle -$.fn.cycle.transitions.shuffle = function($cont, $slides, opts) { - var w = $cont.css('overflow', 'visible').width(); - $slides.css({left: 0, top: 0}); - opts.before.push(function() { $(this).show() }); - opts.speed = opts.speed / 2; // shuffle has 2 transitions - opts.random = 0; - opts.shuffle = opts.shuffle || {left:-w, top:15}; - opts.els = []; - for (var i=0; i < $slides.length; i++) - opts.els.push($slides[i]); - - for (var i=0; i < opts.startingSlide; i++) - opts.els.push(opts.els.shift()); - - // custom transition fn (hat tip to Benjamin Sterling for this bit of sweetness!) - opts.fxFn = function(curr, next, opts, cb, fwd) { - var $el = fwd ? $(curr) : $(next); - $el.animate(opts.shuffle, opts.speedIn, opts.easeIn, function() { - fwd ? opts.els.push(opts.els.shift()) : opts.els.unshift(opts.els.pop()); - if (fwd) - for (var i=0, len=opts.els.length; i < len; i++) - $(opts.els[i]).css('z-index', len-i); - else { - var z = $(curr).css('z-index'); - $el.css('z-index', parseInt(z)+1); - } - $el.animate({left:0, top:0}, opts.speedOut, opts.easeOut, function() { - $(fwd ? this : curr).hide(); - if (cb) cb(); - }); - }); - }; - opts.onAddSlide = function($s) { $s.hide(); }; -}; - -// turnUp/Down/Left/Right -$.fn.cycle.transitions.turnUp = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - $(this).show(); - opts.cssBefore.top = next.cycleH; - opts.animIn.height = next.cycleH; - }); - opts.onAddSlide = function($s) { $s.hide(); }; - opts.cssFirst = { top: 0 }; - opts.cssBefore = { height: 0 }; - opts.animIn = { top: 0 }; - opts.animOut = { height: 0 }; - opts.cssAfter = { display: 'none' }; -}; -$.fn.cycle.transitions.turnDown = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - $(this).show(); - opts.animIn.height = next.cycleH; - opts.animOut.top = curr.cycleH; - }); - opts.onAddSlide = function($s) { $s.hide(); }; - opts.cssFirst = { top: 0 }; - opts.cssBefore = { top: 0, height: 0 }; - opts.animOut = { height: 0 }; - opts.cssAfter = { display: 'none' }; -}; -$.fn.cycle.transitions.turnLeft = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - $(this).show(); - opts.cssBefore.left = next.cycleW; - opts.animIn.width = next.cycleW; - }); - opts.onAddSlide = function($s) { $s.hide(); }; - opts.cssBefore = { width: 0 }; - opts.animIn = { left: 0 }; - opts.animOut = { width: 0 }; - opts.cssAfter = { display: 'none' }; -}; -$.fn.cycle.transitions.turnRight = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - $(this).show(); - opts.animIn.width = next.cycleW; - opts.animOut.left = curr.cycleW; - }); - opts.onAddSlide = function($s) { $s.hide(); }; - opts.cssBefore = { left: 0, width: 0 }; - opts.animIn = { left: 0 }; - opts.animOut = { width: 0 }; - opts.cssAfter = { display: 'none' }; -}; - -// zoom -$.fn.cycle.transitions.zoom = function($cont, $slides, opts) { - opts.cssFirst = { top:0, left: 0 }; - opts.cssAfter = { display: 'none' }; - - opts.before.push(function(curr, next, opts) { - $(this).show(); - opts.cssBefore = { width: 0, height: 0, top: next.cycleH/2, left: next.cycleW/2 }; - opts.cssAfter = { display: 'none' }; - opts.animIn = { top: 0, left: 0, width: next.cycleW, height: next.cycleH }; - opts.animOut = { width: 0, height: 0, top: curr.cycleH/2, left: curr.cycleW/2 }; - $(curr).css('zIndex',2); - $(next).css('zIndex',1); - }); - opts.onAddSlide = function($s) { $s.hide(); }; -}; - -// fadeZoom -$.fn.cycle.transitions.fadeZoom = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - opts.cssBefore = { width: 0, height: 0, opacity: 1, left: next.cycleW/2, top: next.cycleH/2, zIndex: 1 }; - opts.animIn = { top: 0, left: 0, width: next.cycleW, height: next.cycleH }; - }); - opts.animOut = { opacity: 0 }; - opts.cssAfter = { zIndex: 0 }; -}; - -// blindX -$.fn.cycle.transitions.blindX = function($cont, $slides, opts) { - var w = $cont.css('overflow','hidden').width(); - $slides.show(); - opts.before.push(function(curr, next, opts) { - $(curr).css('zIndex',1); - }); - opts.cssBefore = { left: w, zIndex: 2 }; - opts.cssAfter = { zIndex: 1 }; - opts.animIn = { left: 0 }; - opts.animOut = { left: w }; -}; -// blindY -$.fn.cycle.transitions.blindY = function($cont, $slides, opts) { - var h = $cont.css('overflow','hidden').height(); - $slides.show(); - opts.before.push(function(curr, next, opts) { - $(curr).css('zIndex',1); - }); - opts.cssBefore = { top: h, zIndex: 2 }; - opts.cssAfter = { zIndex: 1 }; - opts.animIn = { top: 0 }; - opts.animOut = { top: h }; -}; -// blindZ -$.fn.cycle.transitions.blindZ = function($cont, $slides, opts) { - var h = $cont.css('overflow','hidden').height(); - var w = $cont.width(); - $slides.show(); - opts.before.push(function(curr, next, opts) { - $(curr).css('zIndex',1); - }); - opts.cssBefore = { top: h, left: w, zIndex: 2 }; - opts.cssAfter = { zIndex: 1 }; - opts.animIn = { top: 0, left: 0 }; - opts.animOut = { top: h, left: w }; -}; - -// growX - grow horizontally from centered 0 width -$.fn.cycle.transitions.growX = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - opts.cssBefore = { left: this.cycleW/2, width: 0, zIndex: 2 }; - opts.animIn = { left: 0, width: this.cycleW }; - opts.animOut = { left: 0 }; - $(curr).css('zIndex',1); - }); - opts.onAddSlide = function($s) { $s.hide().css('zIndex',1); }; -}; -// growY - grow vertically from centered 0 height -$.fn.cycle.transitions.growY = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - opts.cssBefore = { top: this.cycleH/2, height: 0, zIndex: 2 }; - opts.animIn = { top: 0, height: this.cycleH }; - opts.animOut = { top: 0 }; - $(curr).css('zIndex',1); - }); - opts.onAddSlide = function($s) { $s.hide().css('zIndex',1); }; -}; - -// curtainX - squeeze in both edges horizontally -$.fn.cycle.transitions.curtainX = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - opts.cssBefore = { left: next.cycleW/2, width: 0, zIndex: 1, display: 'block' }; - opts.animIn = { left: 0, width: this.cycleW }; - opts.animOut = { left: curr.cycleW/2, width: 0 }; - $(curr).css('zIndex',2); - }); - opts.onAddSlide = function($s) { $s.hide(); }; - opts.cssAfter = { zIndex: 1, display: 'none' }; -}; -// curtainY - squeeze in both edges vertically -$.fn.cycle.transitions.curtainY = function($cont, $slides, opts) { - opts.before.push(function(curr, next, opts) { - opts.cssBefore = { top: next.cycleH/2, height: 0, zIndex: 1, display: 'block' }; - opts.animIn = { top: 0, height: this.cycleH }; - opts.animOut = { top: curr.cycleH/2, height: 0 }; - $(curr).css('zIndex',2); - }); - opts.onAddSlide = function($s) { $s.hide(); }; - opts.cssAfter = { zIndex: 1, display: 'none' }; -}; - -// cover - curr slide covered by next slide -$.fn.cycle.transitions.cover = function($cont, $slides, opts) { - var d = opts.direction || 'left'; - var w = $cont.css('overflow','hidden').width(); - var h = $cont.height(); - opts.before.push(function(curr, next, opts) { - opts.cssBefore = opts.cssBefore || {}; - opts.cssBefore.zIndex = 2; - opts.cssBefore.display = 'block'; - - if (d == 'right') - opts.cssBefore.left = -w; - else if (d == 'up') - opts.cssBefore.top = h; - else if (d == 'down') - opts.cssBefore.top = -h; - else - opts.cssBefore.left = w; - $(curr).css('zIndex',1); - }); - if (!opts.animIn) opts.animIn = { left: 0, top: 0 }; - if (!opts.animOut) opts.animOut = { left: 0, top: 0 }; - opts.cssAfter = opts.cssAfter || {}; - opts.cssAfter.zIndex = 2; - opts.cssAfter.display = 'none'; -}; - -// uncover - curr slide moves off next slide -$.fn.cycle.transitions.uncover = function($cont, $slides, opts) { - var d = opts.direction || 'left'; - var w = $cont.css('overflow','hidden').width(); - var h = $cont.height(); - opts.before.push(function(curr, next, opts) { - opts.cssBefore.display = 'block'; - if (d == 'right') - opts.animOut.left = w; - else if (d == 'up') - opts.animOut.top = -h; - else if (d == 'down') - opts.animOut.top = h; - else - opts.animOut.left = -w; - $(curr).css('zIndex',2); - $(next).css('zIndex',1); - }); - opts.onAddSlide = function($s) { $s.hide(); }; - if (!opts.animIn) opts.animIn = { left: 0, top: 0 }; - opts.cssBefore = opts.cssBefore || {}; - opts.cssBefore.top = 0; - opts.cssBefore.left = 0; - - opts.cssAfter = opts.cssAfter || {}; - opts.cssAfter.zIndex = 1; - opts.cssAfter.display = 'none'; -}; - -// toss - move top slide and fade away -$.fn.cycle.transitions.toss = function($cont, $slides, opts) { - var w = $cont.css('overflow','visible').width(); - var h = $cont.height(); - opts.before.push(function(curr, next, opts) { - $(curr).css('zIndex',2); - opts.cssBefore.display = 'block'; - // provide default toss settings if animOut not provided - if (!opts.animOut.left && !opts.animOut.top) - opts.animOut = { left: w*2, top: -h/2, opacity: 0 }; - else - opts.animOut.opacity = 0; - }); - opts.onAddSlide = function($s) { $s.hide(); }; - opts.cssBefore = { left: 0, top: 0, zIndex: 1, opacity: 1 }; - opts.animIn = { left: 0 }; - opts.cssAfter = { zIndex: 2, display: 'none' }; -}; - -// wipe - clip animation -$.fn.cycle.transitions.wipe = function($cont, $slides, opts) { - var w = $cont.css('overflow','hidden').width(); - var h = $cont.height(); - opts.cssBefore = opts.cssBefore || {}; - var clip; - if (opts.clip) { - if (/l2r/.test(opts.clip)) - clip = 'rect(0px 0px '+h+'px 0px)'; - else if (/r2l/.test(opts.clip)) - clip = 'rect(0px '+w+'px '+h+'px '+w+'px)'; - else if (/t2b/.test(opts.clip)) - clip = 'rect(0px '+w+'px 0px 0px)'; - else if (/b2t/.test(opts.clip)) - clip = 'rect('+h+'px '+w+'px '+h+'px 0px)'; - else if (/zoom/.test(opts.clip)) { - var t = parseInt(h/2); - var l = parseInt(w/2); - clip = 'rect('+t+'px '+l+'px '+t+'px '+l+'px)'; - } - } - - opts.cssBefore.clip = opts.cssBefore.clip || clip || 'rect(0px 0px 0px 0px)'; - - var d = opts.cssBefore.clip.match(/(\d+)/g); - var t = parseInt(d[0]), r = parseInt(d[1]), b = parseInt(d[2]), l = parseInt(d[3]); - - opts.before.push(function(curr, next, opts) { - if (curr == next) return; - var $curr = $(curr).css('zIndex',2); - var $next = $(next).css({ - zIndex: 3, - display: 'block' - }); - - var step = 1, count = parseInt((opts.speedIn / 13)) - 1; - function f() { - var tt = t ? t - parseInt(step * (t/count)) : 0; - var ll = l ? l - parseInt(step * (l/count)) : 0; - var bb = b < h ? b + parseInt(step * ((h-b)/count || 1)) : h; - var rr = r < w ? r + parseInt(step * ((w-r)/count || 1)) : w; - $next.css({ clip: 'rect('+tt+'px '+rr+'px '+bb+'px '+ll+'px)' }); - (step++ <= count) ? setTimeout(f, 13) : $curr.css('display', 'none'); - } - f(); - }); - opts.cssAfter = { }; - opts.animIn = { left: 0 }; - opts.animOut = { left: 0 }; -}; - -})(jQuery); -/* - jQuery delayed observer - 0.8 - http://code.google.com/p/jquery-utils/ - - (c) Maxime Haineault - http://haineault.com - - MIT License (http://www.opensource.org/licenses/mit-license.php) - -*/ - -(function($){ - $.extend($.fn, { - delayedObserver: function(callback, delay, options){ - return this.each(function(){ - var el = $(this); - var op = options || {}; - el.data('oldval', el.val()) - .data('delay', delay || 0.5) - .data('condition', op.condition || function() { return ($(this).data('oldval') == $(this).val()); }) - .data('callback', callback) - [(op.event||'keyup')](function(){ - if (el.data('condition').apply(el)) { return; } - else { - if (el.data('timer')) { clearTimeout(el.data('timer')); } - el.data('timer', setTimeout(function(){ - el.data('callback').apply(el); - }, el.data('delay') * 1000)); - el.data('oldval', el.val()); - } - }); - }); - } - }); -})(jQuery); -/** - * Flash (http://jquery.lukelutman.com/plugins/flash) - * A jQuery plugin for embedding Flash movies. - * - * Version 1.0 - * November 9th, 2006 - * - * Copyright (c) 2006 Luke Lutman (http://www.lukelutman.com) - * Dual licensed under the MIT and GPL licenses. - * http://www.opensource.org/licenses/mit-license.php - * http://www.opensource.org/licenses/gpl-license.php - * - * Inspired by: - * SWFObject (http://blog.deconcept.com/swfobject/) - * UFO (http://www.bobbyvandersluis.com/ufo/) - * sIFR (http://www.mikeindustries.com/sifr/) - * - * IMPORTANT: - * The packed version of jQuery breaks ActiveX control - * activation in Internet Explorer. Use JSMin to minifiy - * jQuery (see: http://jquery.lukelutman.com/plugins/flash#activex). - * - **/ -;(function(){ - -var $$; - -/** - * - * @desc Replace matching elements with a flash movie. - * @author Luke Lutman - * @version 1.0.1 - * - * @name flash - * @param Hash htmlOptions Options for the embed/object tag. - * @param Hash pluginOptions Options for detecting/updating the Flash plugin (optional). - * @param Function replace Custom block called for each matched element if flash is installed (optional). - * @param Function update Custom block called for each matched if flash isn't installed (optional). - * @type jQuery - * - * @cat plugins/flash - * - * @example $('#hello').flash({ src: 'hello.swf' }); - * @desc Embed a Flash movie. - * - * @example $('#hello').flash({ src: 'hello.swf' }, { version: 8 }); - * @desc Embed a Flash 8 movie. - * - * @example $('#hello').flash({ src: 'hello.swf' }, { expressInstall: true }); - * @desc Embed a Flash movie using Express Install if flash isn't installed. - * - * @example $('#hello').flash({ src: 'hello.swf' }, { update: false }); - * @desc Embed a Flash movie, don't show an update message if Flash isn't installed. - * -**/ -$$ = jQuery.fn.flash = function(htmlOptions, pluginOptions, replace, update) { - - // Set the default block. - var block = replace || $$.replace; - - // Merge the default and passed plugin options. - pluginOptions = $$.copy($$.pluginOptions, pluginOptions); - - // Detect Flash. - if(!$$.hasFlash(pluginOptions.version)) { - // Use Express Install (if specified and Flash plugin 6,0,65 or higher is installed). - if(pluginOptions.expressInstall && $$.hasFlash(6,0,65)) { - // Add the necessary flashvars (merged later). - var expressInstallOptions = { - flashvars: { - MMredirectURL: location, - MMplayerType: 'PlugIn', - MMdoctitle: jQuery('title').text() - } - }; - // Ask the user to update (if specified). - } else if (pluginOptions.update) { - // Change the block to insert the update message instead of the flash movie. - block = update || $$.update; - // Fail - } else { - // The required version of flash isn't installed. - // Express Install is turned off, or flash 6,0,65 isn't installed. - // Update is turned off. - // Return without doing anything. - return this; - } - } - - // Merge the default, express install and passed html options. - htmlOptions = $$.copy($$.htmlOptions, expressInstallOptions, htmlOptions); - - // Invoke $block (with a copy of the merged html options) for each element. - return this.each(function(){ - block.call(this, $$.copy(htmlOptions)); - }); - -}; -/** - * - * @name flash.copy - * @desc Copy an arbitrary number of objects into a new object. - * @type Object - * - * @example $$.copy({ foo: 1 }, { bar: 2 }); - * @result { foo: 1, bar: 2 }; - * -**/ -$$.copy = function() { - var options = {}, flashvars = {}; - for(var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - if(arg == undefined) continue; - jQuery.extend(options, arg); - // don't clobber one flash vars object with another - // merge them instead - if(arg.flashvars == undefined) continue; - jQuery.extend(flashvars, arg.flashvars); - } - options.flashvars = flashvars; - return options; -}; -/* - * @name flash.hasFlash - * @desc Check if a specific version of the Flash plugin is installed - * @type Boolean - * -**/ -$$.hasFlash = function() { - // look for a flag in the query string to bypass flash detection - if(/hasFlash\=true/.test(location)) return true; - if(/hasFlash\=false/.test(location)) return false; - var pv = $$.hasFlash.playerVersion().match(/\d+/g); - var rv = String([arguments[0], arguments[1], arguments[2]]).match(/\d+/g) || String($$.pluginOptions.version).match(/\d+/g); - for(var i = 0; i < 3; i++) { - pv[i] = parseInt(pv[i] || 0); - rv[i] = parseInt(rv[i] || 0); - // player is less than required - if(pv[i] < rv[i]) return false; - // player is greater than required - if(pv[i] > rv[i]) return true; - } - // major version, minor version and revision match exactly - return true; -}; -/** - * - * @name flash.hasFlash.playerVersion - * @desc Get the version of the installed Flash plugin. - * @type String - * -**/ -$$.hasFlash.playerVersion = function() { - // ie - try { - try { - // avoid fp6 minor version lookup issues - // see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/ - var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6'); - try { axo.AllowScriptAccess = 'always'; } - catch(e) { return '6,0,0'; } - } catch(e) {} - return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1]; - // other browsers - } catch(e) { - try { - if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){ - return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1]; - } - } catch(e) {} - } - return '0,0,0'; -}; -/** - * - * @name flash.htmlOptions - * @desc The default set of options for the object or embed tag. - * -**/ -$$.htmlOptions = { - height: 240, - flashvars: {}, - pluginspage: 'http://www.adobe.com/go/getflashplayer', - src: '#', - type: 'application/x-shockwave-flash', - width: 320 -}; -/** - * - * @name flash.pluginOptions - * @desc The default set of options for checking/updating the flash Plugin. - * -**/ -$$.pluginOptions = { - expressInstall: false, - update: true, - version: '6.0.65' -}; -/** - * - * @name flash.replace - * @desc The default method for replacing an element with a Flash movie. - * -**/ -$$.replace = function(htmlOptions) { - this.innerHTML = '
'+this.innerHTML+'
'; - jQuery(this) - .addClass('flash-replaced') - .prepend($$.transform(htmlOptions)); -}; -/** - * - * @name flash.update - * @desc The default method for replacing an element with an update message. - * -**/ -$$.update = function(htmlOptions) { - var url = String(location).split('?'); - url.splice(1,0,'?hasFlash=true&'); - url = url.join(''); - var msg = '

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

'; - this.innerHTML = ''+this.innerHTML+''; - jQuery(this) - .addClass('flash-update') - .prepend(msg); -}; -/** - * - * @desc Convert a hash of html options to a string of attributes, using Function.apply(). - * @example toAttributeString.apply(htmlOptions) - * @result foo="bar" foo="bar" - * -**/ -function toAttributeString() { - var s = ''; - for(var key in this) - if(typeof this[key] != 'function') - s += key+'="'+this[key]+'" '; - return s; -}; -/** - * - * @desc Convert a hash of flashvars to a url-encoded string, using Function.apply(). - * @example toFlashvarsString.apply(flashvarsObject) - * @result foo=bar&foo=bar - * -**/ -function toFlashvarsString() { - var s = ''; - for(var key in this) - if(typeof this[key] != 'function') - s += key+'='+encodeURIComponent(this[key])+'&'; - return s.replace(/&$/, ''); -}; -/** - * - * @name flash.transform - * @desc Transform a set of html options into an embed tag. - * @type String - * - * @example $$.transform(htmlOptions) - * @result - * - * Note: The embed tag is NOT standards-compliant, but it - * works in all current browsers. flash.transform can be - * overwritten with a custom function to generate more - * standards-compliant markup. - * -**/ -$$.transform = function(htmlOptions) { - htmlOptions.toString = toAttributeString; - if(htmlOptions.flashvars) htmlOptions.flashvars.toString = toFlashvarsString; - return ''; -}; - -/** - * - * Flash Player 9 Fix (http://blog.deconcept.com/2006/07/28/swfobject-143-released/) - * -**/ -if (window.attachEvent) { - window.attachEvent("onbeforeunload", function(){ - __flash_unloadHandler = function() {}; - __flash_savedUnloadHandler = function() {}; - }); -} - -})(); -(function($){ - $._i18n = { trans: {}, 'default': 'en', language: 'en' }; - $.i18n = function() { - var getTrans = function(ns, str) { - var trans = false; - // check if string exists in translation - if ($._i18n.trans[$._i18n.language] - && $._i18n.trans[$._i18n.language][ns] - && $._i18n.trans[$._i18n.language][ns][str]) { - trans = $._i18n.trans[$._i18n.language][ns][str]; - } - // or exists in default - else if ($._i18n.trans[$._i18n['default']] - && $._i18n.trans[$._i18n['default']][ns] - && $._i18n.trans[$._i18n['default']][ns][str]) { - trans = $._i18n.trans[$._i18n['default']][ns][str]; - } - // return trans or original string - return trans || str; - }; - // Set language (accepted formats: en or en-US) - if (arguments.length < 2) { - $._i18n.language = arguments[0]; - return $._i18n.language; - } - else { - // get translation - if (typeof(arguments[1]) == 'string') { - var trans = getTrans(arguments[0], arguments[1]); - // has variables for string formating - if (arguments[2] && typeof(arguments[2]) == 'object') { - return $.format(trans, arguments[2]); - } - else { - return trans; - } - } - // set translation - else { - var tmp = arguments[0].split('.'); - var lang = tmp[0]; - var ns = tmp[1] || 'jQuery'; - if (!$._i18n.trans[lang]) { - $._i18n.trans[lang] = {}; - $._i18n.trans[lang][ns] = arguments[1]; - } - else { - $.extend($._i18n.trans[lang][ns], arguments[1]); - } - } - } - }; -})(jQuery); -/* - * Copyright (c) 2007-2008 Josh Bush (digitalbush.com) - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * Version: 1.1.3 - * Release: 2008-04-16 - */ -(function($) { - - //Helper Function for Caret positioning - $.fn.caret=function(begin,end){ - if(this.length==0) return; - if (typeof begin == 'number') { - end = (typeof end == 'number')?end:begin; - return this.each(function(){ - if(this.setSelectionRange){ - this.focus(); - this.setSelectionRange(begin,end); - }else if (this.createTextRange){ - var range = this.createTextRange(); - range.collapse(true); - range.moveEnd('character', end); - range.moveStart('character', begin); - range.select(); - } - }); - } else { - if (this[0].setSelectionRange){ - begin = this[0].selectionStart; - end = this[0].selectionEnd; - }else if (document.selection && document.selection.createRange){ - var range = document.selection.createRange(); - begin = 0 - range.duplicate().moveStart('character', -100000); - end = begin + range.text.length; - } - return {begin:begin,end:end}; - } - }; - - //Predefined character definitions - var charMap={ - '9':"[0-9]", - 'a':"[A-Za-z]", - '*':"[A-Za-z0-9]" - }; - - //Helper method to inject character definitions - $.mask={ - addPlaceholder : function(c,r){ - charMap[c]=r; - } - }; - - $.fn.unmask=function(){ - return this.trigger("unmask"); - }; - - //Main Method - $.fn.mask = function(mask,settings) { - settings = $.extend({ - placeholder: "_", - completed: null - }, settings); - - //Build Regex for format validation - var re = new RegExp("^"+ - $.map( mask.split(""), function(c,i){ - return charMap[c]||((/[A-Za-z0-9]/.test(c)?"":"\\")+c); - }).join('')+ - "$"); - - return this.each(function(){ - var input=$(this); - var buffer=new Array(mask.length); - var locked=new Array(mask.length); - var valid=false; - var ignore=false; //Variable for ignoring control keys - var firstNonMaskPos=null; - - //Build buffer layout from mask & determine the first non masked character - $.each( mask.split(""), function(i,c){ - locked[i]=(charMap[c]==null); - buffer[i]=locked[i]?c:settings.placeholder; - if(!locked[i] && firstNonMaskPos==null) - firstNonMaskPos=i; - }); - - function focusEvent(){ - checkVal(); - writeBuffer(); - setTimeout(function(){ - $(input[0]).caret(valid?mask.length:firstNonMaskPos); - },0); - }; - - function keydownEvent(e){ - var pos=$(this).caret(); - var k = e.keyCode; - ignore=(k < 16 || (k > 16 && k < 32 ) || (k > 32 && k < 41)); - - //delete selection before proceeding - if((pos.begin-pos.end)!=0 && (!ignore || k==8 || k==46)){ - clearBuffer(pos.begin,pos.end); - } - //backspace and delete get special treatment - if(k==8){//backspace - while(pos.begin-->=0){ - if(!locked[pos.begin]){ - buffer[pos.begin]=settings.placeholder; - if($.browser.opera){ - //Opera won't let you cancel the backspace, so we'll let it backspace over a dummy character. - s=writeBuffer(); - input.val(s.substring(0,pos.begin)+" "+s.substring(pos.begin)); - $(this).caret(pos.begin+1); - }else{ - writeBuffer(); - $(this).caret(Math.max(firstNonMaskPos,pos.begin)); - } - return false; - } - } - }else if(k==46){//delete - clearBuffer(pos.begin,pos.begin+1); - writeBuffer(); - $(this).caret(Math.max(firstNonMaskPos,pos.begin)); - return false; - }else if (k==27){//escape - clearBuffer(0,mask.length); - writeBuffer(); - $(this).caret(firstNonMaskPos); - return false; - } - }; - - function keypressEvent(e){ - if(ignore){ - ignore=false; - //Fixes Mac FF bug on backspace - return (e.keyCode == 8)? false: null; - } - e=e||window.event; - var k=e.charCode||e.keyCode||e.which; - var pos=$(this).caret(); - - if(e.ctrlKey || e.altKey){//Ignore - return true; - }else if ((k>=41 && k<=122) ||k==32 || k>186){//typeable characters - var p=seekNext(pos.begin-1); - if(p - MIT-style license. -*/ - -(function($) { - - // Global variables, accessible to Slimbox only - var win = $(window), options, images, activeImage = -1, activeURL, prevImage, nextImage, compatibleOverlay, middle, centerWidth, centerHeight, ie6 = !window.XMLHttpRequest, - operaFix = window.opera && (document.compatMode == "CSS1Compat") && ($.browser.version >= 9.3), documentElement = document.documentElement, - - // Preload images - preload = {}, preloadPrev = new Image(), preloadNext = new Image(), - - // DOM elements - overlay, center, image, sizer, prevLink, nextLink, bottomContainer, bottom, caption, number; - - /* - Initialization - */ - - $(function() { - // Append the Slimbox HTML code at the bottom of the document - $("body").append( - $([ - overlay = $('
')[0], - center = $('
')[0], - bottomContainer = $('
')[0] - ]).css("display", "none") - ); - - image = $('
').appendTo(center).append( - sizer = $('
').append([ - prevLink = $('').click(previous)[0], - nextLink = $('').click(next)[0] - ])[0] - )[0]; - - bottom = $('
').appendTo(bottomContainer).append([ - $('').add(overlay).click(close)[0], - caption = $('
')[0], - number = $('
')[0], - $('
')[0] - ])[0]; - }); - - - /* - API - */ - - // Open Slimbox with the specified parameters - $.slimbox = function(_images, startImage, _options) { - options = $.extend({ - loop: false, // Allows to navigate between first and last images - overlayOpacity: 0.8, // 1 is opaque, 0 is completely transparent (change the color in the CSS file) - overlayFadeDuration: 400, // Duration of the overlay fade-in and fade-out animations (in milliseconds) - resizeDuration: 400, // Duration of each of the box resize animations (in milliseconds) - resizeEasing: "swing", // "swing" is jQuery's default easing - initialWidth: 250, // Initial width of the box (in pixels) - initialHeight: 250, // Initial height of the box (in pixels) - imageFadeDuration: 400, // Duration of the image fade-in animation (in milliseconds) - captionAnimationDuration: 400, // Duration of the caption animation (in milliseconds) - counterText: "Image {x} of {y}", // Translate or change as you wish, or set it to false to disable counter text for image groups - closeKeys: [27, 88, 67], // Array of keycodes to close Slimbox, default: Esc (27), 'x' (88), 'c' (67) - previousKeys: [37, 80], // Array of keycodes to navigate to the previous image, default: Left arrow (37), 'p' (80) - nextKeys: [39, 78] // Array of keycodes to navigate to the next image, default: Right arrow (39), 'n' (78) - }, _options); - - // The function is called for a single image, with URL and Title as first two arguments - if (typeof _images == "string") { - _images = [[_images, startImage]]; - startImage = 0; - } - - middle = win.scrollTop() + ((operaFix ? documentElement.clientHeight : win.height()) / 2); - centerWidth = options.initialWidth; - centerHeight = options.initialHeight; - $(center).css({top: Math.max(0, middle - (centerHeight / 2)), width: centerWidth, height: centerHeight, marginLeft: -centerWidth/2}).show(); - compatibleOverlay = ie6 || (overlay.currentStyle && (overlay.currentStyle.position != "fixed")); - if (compatibleOverlay) overlay.style.position = "absolute"; - $(overlay).css("opacity", options.overlayOpacity).fadeIn(options.overlayFadeDuration); - position(); - setup(1); - - images = _images; - options.loop = options.loop && (images.length > 1); - return changeImage(startImage); - }; - - /* - options: Optional options object, see jQuery.slimbox() - linkMapper: Optional function taking a link DOM element and an index as arguments and returning an array containing 2 elements: - the image URL and the image caption (may contain HTML) - linksFilter: Optional function taking a link DOM element and an index as arguments and returning true if the element is part of - the image collection that will be shown on click, false if not. "this" refers to the element that was clicked. - This function must always return true when the DOM element argument is "this". - */ - $.fn.slimbox = function(_options, linkMapper, linksFilter) { - linkMapper = linkMapper || function(el) { - return [el.href, el.title]; - }; - - linksFilter = linksFilter || function() { - return true; - }; - - var links = this; - - return links.unbind("click").click(function() { - // Build the list of images that will be displayed - var link = this, startIndex = 0, filteredLinks, i = 0, length; - filteredLinks = $.grep(links, function(el, i) { - return linksFilter.call(link, el, i); - }); - - // We cannot use jQuery.map() because it flattens the returned array - for (length = filteredLinks.length; i < length; ++i) { - if (filteredLinks[i] == link) startIndex = i; - filteredLinks[i] = linkMapper(filteredLinks[i], i); - } - - return $.slimbox(filteredLinks, startIndex, _options); - }); - }; - - - /* - Internal functions - */ - - function position() { - var l = win.scrollLeft(), w = operaFix ? documentElement.clientWidth : win.width(); - $([center, bottomContainer]).css("left", l + (w / 2)); - if (compatibleOverlay) $(overlay).css({left: l, top: win.scrollTop(), width: w, height: win.height()}); - } - - function setup(open) { - $("object").add(ie6 ? "select" : "embed").each(function(index, el) { - if (open) $.data(el, "slimbox", el.style.visibility); - el.style.visibility = open ? "hidden" : $.data(el, "slimbox"); - }); - var fn = open ? "bind" : "unbind"; - win[fn]("scroll resize", position); - $(document)[fn]("keydown", keyDown); - } - - function keyDown(event) { - var code = event.keyCode, fn = $.inArray; - // Prevent default keyboard action (like navigating inside the page) - return (fn(code, options.closeKeys) >= 0) ? close() - : (fn(code, options.nextKeys) >= 0) ? next() - : (fn(code, options.previousKeys) >= 0) ? previous() - : false; - } - - function previous() { - return changeImage(prevImage); - } - - function next() { - return changeImage(nextImage); - } - - function changeImage(imageIndex) { - if (imageIndex >= 0) { - activeImage = imageIndex; - activeURL = images[activeImage][0]; - prevImage = (activeImage || (options.loop ? images.length : 0)) - 1; - nextImage = ((activeImage + 1) % images.length) || (options.loop ? 0 : -1); - - stop(); - center.className = "lbLoading"; - - preload = new Image(); - preload.onload = animateBox; - preload.src = activeURL; - } - - return false; - } - - function animateBox() { - center.className = ""; - $(image).css({backgroundImage: "url(" + activeURL + ")", visibility: "hidden", display: ""}); - $(sizer).width(preload.width); - $([sizer, prevLink, nextLink]).height(preload.height); - - $(caption).html(images[activeImage][1] || ""); - $(number).html((((images.length > 1) && options.counterText) || "").replace(/{x}/, activeImage + 1).replace(/{y}/, images.length)); - - if (prevImage >= 0) preloadPrev.src = images[prevImage][0]; - if (nextImage >= 0) preloadNext.src = images[nextImage][0]; - - centerWidth = image.offsetWidth; - centerHeight = image.offsetHeight; - var top = Math.max(0, middle - (centerHeight / 2)); - if (center.offsetHeight != centerHeight) { - $(center).animate({height: centerHeight, top: top}, options.resizeDuration, options.resizeEasing); - } - if (center.offsetWidth != centerWidth) { - $(center).animate({width: centerWidth, marginLeft: -centerWidth/2}, options.resizeDuration, options.resizeEasing); - } - $(center).queue(function() { - $(bottomContainer).css({width: centerWidth, top: top + centerHeight, marginLeft: -centerWidth/2, visibility: "hidden", display: ""}); - $(image).css({display: "none", visibility: "", opacity: ""}).fadeIn(options.imageFadeDuration, animateCaption); - }); - } - - - function animateCaption() { - if (prevImage >= 0) $(prevLink).show(); - if (nextImage >= 0) $(nextLink).show(); - $(bottom).css("marginTop", -bottom.offsetHeight).animate({marginTop: 0}, options.captionAnimationDuration); - bottomContainer.style.visibility = ""; - } - - function stop() { - preload.onload = null; - preload.src = preloadPrev.src = preloadNext.src = activeURL; - $([center, image, bottom]).stop(true); - $([prevLink, nextLink, image, bottomContainer]).hide(); - } - - function close() { - if (activeImage >= 0) { - stop(); - activeImage = prevImage = nextImage = -1; - $(center).hide(); - $(overlay).stop().fadeOut(options.overlayFadeDuration, setup); - } - - return false; - } - -})(jQuery); -/* - * timeago: a jQuery plugin, version: 0.5.1 (08/20/2008) - * @requires jQuery v1.2 or later - * - * Timeago is a jQuery plugin that makes it easy to support automatically - * updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago"). - * - * For usage and examples, visit: - * http://timeago.yarp.com/ - * - * Licensed under the MIT: - * http://www.opensource.org/licenses/mit-license.php - * - * Copyright (c) 2008, Ryan McGeary (ryanonjavascript -[at]- mcgeary [*dot*] org) - */ -(function($) { - $.timeago = function(timestamp) { - if (timestamp instanceof Date) return inWords(timestamp); - else if (typeof timestamp == "string") return inWords($.timeago.parse(timestamp)); - else return inWords($.timeago.parse($(timestamp).attr("title"))); - }; - var $t = $.timeago; - - $.extend($.timeago, { - settings: { - refreshMillis: 60000, - allowFuture: false, - strings: { - ago: "ago", - fromNow: "from now", - seconds: "less than a minute", - minute: "about a minute", - minutes: "%d minutes", - hour: "about an hour", - hours: "about %d hours", - day: "a day", - days: "%d days", - month: "about a month", - months: "%d months", - year: "about a year", - years: "%d years" - } - }, - inWords: function(distanceMillis) { - var $l = this.settings.strings; - var suffix = $l.ago; - if (this.settings.allowFuture) { - if (distanceMillis < 0) suffix = $l.fromNow; - distanceMillis = Math.abs(distanceMillis); - } - - var seconds = distanceMillis / 1000; - var minutes = seconds / 60; - var hours = minutes / 60; - var days = hours / 24; - var years = days / 365; - - var words = seconds < 45 && sprintf($l.seconds, Math.round(seconds)) || - seconds < 90 && $l.minute || - minutes < 45 && sprintf($l.minutes, Math.round(minutes)) || - minutes < 90 && $l.hour || - hours < 24 && sprintf($l.hours, Math.round(hours)) || - hours < 48 && $l.day || - days < 30 && sprintf($l.days, Math.floor(days)) || - days < 60 && $l.month || - days < 365 && sprintf($l.months, Math.floor(days / 30)) || - years < 2 && $l.year || - sprintf($l.years, Math.floor(years)); - - return words + " " + suffix; - }, - parse: function(iso8601) { - var s = $.trim(iso8601); - s = s.replace(/-/,"/").replace(/-/,"/"); - s = s.replace(/T/," ").replace(/Z/," UTC"); - s = s.replace(/([\+-]\d\d)\:?(\d\d)/," $1$2"); // -04:00 -> -0400 - return new Date(s); - } - }); - - $.fn.timeago = function() { - var self = this; - self.each(refresh); - - var $s = $t.settings; - if ($s.refreshMillis > 0) { - setInterval(function() { self.each(refresh); }, $s.refreshMillis); - } - return self; - }; - - function refresh() { - var date = $t.parse(this.title); - if (!isNaN(date)) { - $(this).text(inWords(date)); - } - return this; - } - - function inWords(date) { - return $t.inWords(distance(date)); - } - - function distance(date) { - return (new Date().getTime() - date.getTime()); - } - - // lame sprintf implementation - function sprintf(string, value) { - return string.replace(/%d/i, value); - } - - // fix for IE6 suckage - if ($.browser.msie && $.browser.version < 7.0) { - document.createElement('abbr'); - } -})(jQuery); - +/* + jQuery utils - 0.8.5 + http://code.google.com/p/jquery-utils/ + + (c) Maxime Haineault + http://haineault.com + + MIT License (http://www.opensource.org/licenses/mit-license.php + +*/ + +(function($){ + $.extend($.expr[':'], { + // case insensitive version of :contains + icontains: function(a,i,m){return (a.textContent||a.innerText||jQuery(a).text()||"").toLowerCase().indexOf(m[3].toLowerCase())>=0;} + }); + + $.iterators = { + getText: function() { return $(this).text(); }, + parseInt: function(v){ return parseInt(v, 10); } + }; + + $.extend({ + + // Returns a range object + // Author: Matthias Miller + // Site: http://blog.outofhanwell.com/2006/03/29/javascript-range-function/ + range: function() { + if (!arguments.length) { return []; } + var min, max, step; + if (arguments.length == 1) { + min = 0; + max = arguments[0]-1; + step = 1; + } + else { + // default step to 1 if it's zero or undefined + min = arguments[0]; + max = arguments[1]-1; + step = arguments[2] || 1; + } + // convert negative steps to positive and reverse min/max + if (step < 0 && min >= max) { + step *= -1; + var tmp = min; + min = max; + max = tmp; + min += ((max-min) % step); + } + var a = []; + for (var i = min; i <= max; i += step) { a.push(i); } + return a; + }, + + // Taken from ui.core.js. + // Why are you keeping this gem for yourself guys ? :| + keyCode: { + BACKSPACE: 8, CAPS_LOCK: 20, COMMA: 188, CONTROL: 17, DELETE: 46, DOWN: 40, + END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37, + NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, + NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, + PERIOD: 190, RIGHT: 39, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38 + }, + + // Takes a keyboard event and return true if the keycode match the specified keycode + keyIs: function(k, e) { + return parseInt($.keyCode[k.toUpperCase()], 10) == parseInt((typeof(e) == 'number' )? e: e.keyCode, 10); + }, + + // Returns the key of an array + keys: function(arr) { + var o = []; + for (k in arr) { o.push(k); } + return o; + }, + + // Redirect to a specified url + redirect: function(url) { + window.location.href = url; + return url; + }, + + // Stop event shorthand + stop: function(e, preventDefault, stopPropagation) { + if (preventDefault) { e.preventDefault(); } + if (stopPropagation) { e.stopPropagation(); } + return preventDefault && false || true; + }, + + // Returns the basename of a path + basename: function(path) { + var t = path.split('/'); + return t[t.length] === '' && s || t.slice(0, t.length).join('/'); + }, + + // Returns the filename of a path + filename: function(path) { + return path.split('/').pop(); + }, + + // Returns a formated file size + filesizeformat: function(bytes, suffixes){ + var b = parseInt(bytes, 10); + var s = suffixes || ['byte', 'bytes', 'KB', 'MB', 'GB']; + if (isNaN(b) || b === 0) { return '0 ' + s[0]; } + if (b == 1) { return '1 ' + s[0]; } + if (b < 1024) { return b.toFixed(2) + ' ' + s[1]; } + if (b < 1048576) { return (b / 1024).toFixed(2) + ' ' + s[2]; } + if (b < 1073741824) { return (b / 1048576).toFixed(2) + ' '+ s[3]; } + else { return (b / 1073741824).toFixed(2) + ' '+ s[4]; } + }, + + fileExtension: function(s) { + var tokens = s.split('.'); + return tokens[tokens.length-1] || false; + }, + + // Returns true if an object is a String + isString: function(o) { + return typeof(o) == 'string' && true || false; + }, + + // Returns true if an object is a RegExp + isRegExp: function(o) { + return o && o.constructor.toString().indexOf('RegExp()') != -1 || false; + }, + + isObject: function(o) { + return (typeof(o) == 'object'); + }, + + // Convert input to currency (two decimal fixed number) + toCurrency: function(i) { + i = parseFloat(i, 10).toFixed(2); + return (i=='NaN') ? '0.00' : i; + }, + + /*-------------------------------------------------------------------- + * javascript method: "pxToEm" + * by: + Scott Jehl (scott@filamentgroup.com) + Maggie Wachs (maggie@filamentgroup.com) + http://www.filamentgroup.com + * + * Copyright (c) 2008 Filament Group + * Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses. + * + * Description: pxToEm converts a pixel value to ems depending on inherited font size. + * Article: http://www.filamentgroup.com/lab/retaining_scalable_interfaces_with_pixel_to_em_conversion/ + * Demo: http://www.filamentgroup.com/examples/pxToEm/ + * + * Options: + scope: string or jQuery selector for font-size scoping + reverse: Boolean, true reverses the conversion to em-px + * Dependencies: jQuery library + * Usage Example: myPixelValue.pxToEm(); or myPixelValue.pxToEm({'scope':'#navigation', reverse: true}); + * + * Version: 2.1, 18.12.2008 + * Changelog: + * 08.02.2007 initial Version 1.0 + * 08.01.2008 - fixed font-size calculation for IE + * 18.12.2008 - removed native object prototyping to stay in jQuery's spirit, jsLinted (Maxime Haineault ) + --------------------------------------------------------------------*/ + + pxToEm: function(i, settings){ + //set defaults + settings = jQuery.extend({ + scope: 'body', + reverse: false + }, settings); + + var pxVal = (i === '') ? 0 : parseFloat(i); + var scopeVal; + var getWindowWidth = function(){ + var de = document.documentElement; + return self.innerWidth || (de && de.clientWidth) || document.body.clientWidth; + }; + + /* When a percentage-based font-size is set on the body, IE returns that percent of the window width as the font-size. + For example, if the body font-size is 62.5% and the window width is 1000px, IE will return 625px as the font-size. + When this happens, we calculate the correct body font-size (%) and multiply it by 16 (the standard browser font size) + to get an accurate em value. */ + + if (settings.scope == 'body' && $.browser.msie && (parseFloat($('body').css('font-size')) / getWindowWidth()).toFixed(1) > 0.0) { + var calcFontSize = function(){ + return (parseFloat($('body').css('font-size'))/getWindowWidth()).toFixed(3) * 16; + }; + scopeVal = calcFontSize(); + } + else { scopeVal = parseFloat(jQuery(settings.scope).css("font-size")); } + + var result = (settings.reverse === true) ? (pxVal * scopeVal).toFixed(2) + 'px' : (pxVal / scopeVal).toFixed(2) + 'em'; + return result; + } + }); + + $.extend($.fn, { + type: function() { + try { return $(this).get(0).nodeName.toLowerCase(); } + catch(e) { return false; } + }, + // Select a text range in a textarea + selectRange: function(start, end){ + // use only the first one since only one input can be focused + if ($(this).get(0).createTextRange) { + var range = $(this).get(0).createTextRange(); + range.collapse(true); + range.moveEnd('character', end); + range.moveStart('character', start); + range.select(); + } + else if ($(this).get(0).setSelectionRange) { + $(this).bind('focus', function(e){ + e.preventDefault(); + }).get(0).setSelectionRange(start, end); + } + return $(this); + }, + + /*-------------------------------------------------------------------- + * JQuery Plugin: "EqualHeights" + * by: Scott Jehl, Todd Parker, Maggie Costello Wachs (http://www.filamentgroup.com) + * + * Copyright (c) 2008 Filament Group + * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php) + * + * Description: Compares the heights or widths of the top-level children of a provided element + and sets their min-height to the tallest height (or width to widest width). Sets in em units + by default if pxToEm() method is available. + * Dependencies: jQuery library, pxToEm method (article: + http://www.filamentgroup.com/lab/retaining_scalable_interfaces_with_pixel_to_em_conversion/) + * Usage Example: $(element).equalHeights(); + Optional: to set min-height in px, pass a true argument: $(element).equalHeights(true); + * Version: 2.1, 18.12.2008 + * + * Note: Changed pxToEm call to call $.pxToEm instead, jsLinted (Maxime Haineault ) + --------------------------------------------------------------------*/ + + equalHeights: function(px){ + $(this).each(function(){ + var currentTallest = 0; + $(this).children().each(function(i){ + if ($(this).height() > currentTallest) { currentTallest = $(this).height(); } + }); + if (!px || !$.pxToEm) { currentTallest = $.pxToEm(currentTallest); } //use ems unless px is specified + // for ie6, set height since min-height isn't supported + if ($.browser.msie && $.browser.version == 6.0) { $(this).children().css({'height': currentTallest}); } + $(this).children().css({'min-height': currentTallest}); + }); + return this; + }, + + // Copyright (c) 2009 James Padolsey + // http://james.padolsey.com/javascript/jquery-delay-plugin/ + delay: function(time, callback){ + jQuery.fx.step.delay = function(){}; + return this.animate({delay:1}, time, callback); + } + }); +})(jQuery); +/* + jQuery strings - 0.3 + http://code.google.com/p/jquery-utils/ + + (c) Maxime Haineault + http://haineault.com + + MIT License (http://www.opensource.org/licenses/mit-license.php) + + Implementation of Python3K advanced string formatting + http://www.python.org/dev/peps/pep-3101/ + + Documentation: http://code.google.com/p/jquery-utils/wiki/StringFormat + +*/ +(function($){ + var strings = { + strConversion: { + // tries to translate any objects type into string gracefully + __repr: function(i){ + switch(this.__getType(i)) { + case 'array':case 'date':case 'number': + return i.toString(); + case 'object': + var o = []; + for (x=0; x 0) { + o = new Array(Math.ceil(l / p.length)).join(p).substr(0, t = !t ? l : t == 1 ? 0 : Math.ceil(l / 2)) + str + p.substr(0, l - t); + } + return o; + }, + __getInput: function(arg, args) { + var key = arg.getKey(); + switch(this.__getType(args)){ + case 'object': // Thanks to Jonathan Works for the patch + var keys = key.split('.'); + var obj = args; + for(var subkey = 0; subkey < keys.length; subkey++){ + obj = obj[keys[subkey]]; + } + if (typeof(obj) != 'undefined') { + if (strings.strConversion.__getType(obj) == 'array') { + return arg.getFormat().match(/\.\*/) && obj[1] || obj; + } + return obj; + } + else { + // TODO: try by numerical index + } + break; + case 'array': + key = parseInt(key, 10); + if (arg.getFormat().match(/\.\*/) && typeof args[key+1] != 'undefined') { return args[key+1]; } + else if (typeof args[key] != 'undefined') { return args[key]; } + else { return key; } + break; + } + return '{'+key+'}'; + }, + __formatToken: function(token, args) { + var arg = new Argument(token, args); + return strings.strConversion[arg.getFormat().slice(-1)](this.__getInput(arg, args), arg); + }, + + // Signed integer decimal. + d: function(input, arg){ + var o = parseInt(input, 10); // enforce base 10 + var p = arg.getPaddingLength(); + if (p) { return this.__pad(o.toString(), p, arg.getPaddingString(), 0); } + else { return o; } + }, + // Signed integer decimal. + i: function(input, args){ + return this.d(input, args); + }, + // Unsigned octal + o: function(input, arg){ + var o = input.toString(8); + if (arg.isAlternate()) { o = this.__pad(o, o.length+1, '0', 0); } + return this.__pad(o, arg.getPaddingLength(), arg.getPaddingString(), 0); + }, + // Unsigned decimal + u: function(input, args) { + return Math.abs(this.d(input, args)); + }, + // Unsigned hexadecimal (lowercase) + x: function(input, arg){ + var o = parseInt(input, 10).toString(16); + o = this.__pad(o, arg.getPaddingLength(), arg.getPaddingString(),0); + return arg.isAlternate() ? '0x'+o : o; + }, + // Unsigned hexadecimal (uppercase) + X: function(input, arg){ + return this.x(input, arg).toUpperCase(); + }, + // Floating point exponential format (lowercase) + e: function(input, arg){ + return parseFloat(input, 10).toExponential(arg.getPrecision()); + }, + // Floating point exponential format (uppercase) + E: function(input, arg){ + return this.e(input, arg).toUpperCase(); + }, + // Floating point decimal format + f: function(input, arg){ + return this.__pad(parseFloat(input, 10).toFixed(arg.getPrecision()), arg.getPaddingLength(), arg.getPaddingString(),0); + }, + // Floating point decimal format (alias) + F: function(input, args){ + return this.f(input, args); + }, + // Floating point format. Uses exponential format if exponent is greater than -4 or less than precision, decimal format otherwise + g: function(input, arg){ + var o = parseFloat(input, 10); + return (o.toString().length > 6) ? Math.round(o.toExponential(arg.getPrecision())): o; + }, + // Floating point format. Uses exponential format if exponent is greater than -4 or less than precision, decimal format otherwise + G: function(input, args){ + return this.g(input, args); + }, + // Single character (accepts integer or single character string). + c: function(input, args) { + var match = input.match(/\w|\d/); + return match && match[0] || ''; + }, + // String (converts any JavaScript object to anotated format) + r: function(input, args) { + return this.__repr(input); + }, + // String (converts any JavaScript object using object.toString()) + s: function(input, args) { + return input.toString && input.toString() || ''+input; + } + }, + + format: function(str, args) { + var end = 0; + var start = 0; + var match = false; + var buffer = []; + var token = ''; + var tmp = (str||'').split(''); + for(start=0; start < tmp.length; start++) { + if (tmp[start] == '{' && tmp[start+1] !='{') { + end = str.indexOf('}', start); + token = tmp.slice(start+1, end).join(''); + if (tmp[start-1] != '{' && tmp[end+1] != '}') { + var tokenArgs = (typeof arguments[1] != 'object')? arguments2Array(arguments, 2): args || []; + buffer.push(strings.strConversion.__formatToken(token, tokenArgs)); + } + else { + buffer.push(token); + } + } + else if (start > end || buffer.length < 1) { buffer.push(tmp[start]); } + } + return (buffer.length > 1)? buffer.join(''): buffer[0]; + }, + + calc: function(str, args) { + return eval(format(str, args)); + }, + + repeat: function(s, n) { + return new Array(n+1).join(s); + }, + + UTF8encode: function(s) { + return unescape(encodeURIComponent(s)); + }, + + UTF8decode: function(s) { + return decodeURIComponent(escape(s)); + }, + + tpl: function() { + var out = ''; + var render = true; + // Set + // $.tpl('ui.test', ['', helloWorld ,'']); + if (arguments.length == 2 && $.isArray(arguments[1])) { + this[arguments[0]] = arguments[1].join(''); + return $(this[arguments[0]]); + } + // $.tpl('ui.test', 'hello world'); + if (arguments.length == 2 && $.isString(arguments[1])) { + this[arguments[0]] = arguments[1]; + return $(this[arguments[0]]); + } + // Call + // $.tpl('ui.test'); + if (arguments.length == 1) { + return $(this[arguments[0]]); + } + // $.tpl('ui.test', false); + if (arguments.length == 2 && arguments[1] == false) { + return this[arguments[0]]; + } + // $.tpl('ui.test', {value:blah}); + if (arguments.length == 2 && $.isObject(arguments[1])) { + return $($.format(this[arguments[0]], arguments[1])); + } + // $.tpl('ui.test', {value:blah}, false); + if (arguments.length == 3 && $.isObject(arguments[1])) { + return (arguments[2] == true) + ? $.format(this[arguments[0]], arguments[1]) + : $($.format(this[arguments[0]], arguments[1])); + } + } + }; + + var Argument = function(arg, args) { + this.__arg = arg; + this.__args = args; + this.__max_precision = parseFloat('1.'+ (new Array(32)).join('1'), 10).toString().length-3; + this.__def_precision = 6; + this.getString = function(){ + return this.__arg; + }; + this.getKey = function(){ + return this.__arg.split(':')[0]; + }; + this.getFormat = function(){ + var match = this.getString().split(':'); + return (match && match[1])? match[1]: 's'; + }; + this.getPrecision = function(){ + var match = this.getFormat().match(/\.(\d+|\*)/g); + if (!match) { return this.__def_precision; } + else { + match = match[0].slice(1); + if (match != '*') { return parseInt(match, 10); } + else if(strings.strConversion.__getType(this.__args) == 'array') { + return this.__args[1] && this.__args[0] || this.__def_precision; + } + else if(strings.strConversion.__getType(this.__args) == 'object') { + return this.__args[this.getKey()] && this.__args[this.getKey()][0] || this.__def_precision; + } + else { return this.__def_precision; } + } + }; + this.getPaddingLength = function(){ + var match = false; + if (this.isAlternate()) { + match = this.getString().match(/0?#0?(\d+)/); + if (match && match[1]) { return parseInt(match[1], 10); } + } + match = this.getString().match(/(0|\.)(\d+|\*)/g); + return match && parseInt(match[0].slice(1), 10) || 0; + }; + this.getPaddingString = function(){ + var o = ''; + if (this.isAlternate()) { o = ' '; } + // 0 take precedence on alternate format + if (this.getFormat().match(/#0|0#|^0|\.\d+/)) { o = '0'; } + return o; + }; + this.getFlags = function(){ + var match = this.getString().matc(/^(0|\#|\-|\+|\s)+/); + return match && match[0].split('') || []; + }; + this.isAlternate = function() { + return !!this.getFormat().match(/^0?#/); + }; + }; + + var arguments2Array = function(args, shift) { + var o = []; + for (l=args.length, x=(shift || 0)-1; x + http://haineault.com + + MIT License (http://www.opensource.org/licenses/mit-license.php) + +*/ + +(function($){ + var hash = window.location.hash; + var handlers = []; + var opt = {}; + + $.extend({ + anchorHandler: { + apply: function() { + $.map(handlers, function(handler){ + var match = hash.match(handler.r) && hash.match(handler.r)[0] || false; + if (match) { handler.cb.apply($('a[href*='+match+']').get(0), [handler.r, hash || '']); } + }); + return $.anchorHandler; + }, + add: function(regexp, callback, options) { + var opt = $.extend({handleClick: true, preserveHash: true}, options); + if (opt.handleClick) { + $('a[href*=#]').each(function(i, a){ + if (a.href.match(regexp)) { + $(a).bind('click.anchorHandler', function(){ + if (opt.preserveHash) { window.location.hash = a.hash; } + return callback.apply(this, [regexp, a.href]); + }); + } + }); + } + handlers.push({r: regexp, cb: callback}); + $($.anchorHandler.apply); + return $.anchorHandler; + } + } + }); +})(jQuery); +/** + * Cookie plugin + * + * Copyright (c) 2006 Klaus Hartl (stilbuero.de) + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + */ + +/** + * Create a cookie with the given name and value and other optional parameters. + * + * @example $.cookie('the_cookie', 'the_value'); + * @desc Set the value of a cookie. + * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true }); + * @desc Create a cookie with all available options. + * @example $.cookie('the_cookie', 'the_value'); + * @desc Create a session cookie. + * @example $.cookie('the_cookie', null); + * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain + * used when the cookie was set. + * + * @param String name The name of the cookie. + * @param String value The value of the cookie. + * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. + * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. + * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. + * If set to null or omitted, the cookie will be a session cookie and will not be retained + * when the the browser exits. + * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). + * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). + * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will + * require a secure protocol (like HTTPS). + * @type undefined + * + * @name $.cookie + * @cat Plugins/Cookie + * @author Klaus Hartl/klaus.hartl@stilbuero.de + */ + +/** + * Get the value of a cookie with the given name. + * + * @example $.cookie('the_cookie'); + * @desc Get the value of a cookie. + * + * @param String name The name of the cookie. + * @return The value of the cookie. + * @type String + * + * @name $.cookie + * @cat Plugins/Cookie + * @author Klaus Hartl/klaus.hartl@stilbuero.de + */ +jQuery.cookie = function(name, value, options) { + if (typeof value != 'undefined') { // name and value given, set cookie + options = options || {}; + if (value === null) { + value = ''; + options.expires = -1; + } + var expires = ''; + if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { + var date; + if (typeof options.expires == 'number') { + date = new Date(); + date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); + } else { + date = options.expires; + } + expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE + } + // CAUTION: Needed to parenthesize options.path and options.domain + // in the following expressions, otherwise they evaluate to undefined + // in the packed version for some reason... + var path = options.path ? '; path=' + (options.path) : ''; + var domain = options.domain ? '; domain=' + (options.domain) : ''; + var secure = options.secure ? '; secure' : ''; + document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); + } else { // only name given, get cookie + var cookieValue = null; + if (document.cookie && document.cookie != '') { + var cookies = document.cookie.split(';'); + for (var i = 0; i < cookies.length; i++) { + var cookie = jQuery.trim(cookies[i]); + // Does this cookie string begin with the name we want? + if (cookie.substring(0, name.length + 1) == (name + '=')) { + cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); + break; + } + } + } + return cookieValue; + } +}; +/* + jQuery countdown - 0.2 + http://code.google.com/p/jquery-utils/ + + (c) Maxime Haineault + http://haineault.com + + MIT License (http://www.opensource.org/licenses/mit-license.php) + +*/ + +(function($) { + function countdown(el, options) { + var calc = function (target, current) { + /* Return true if the target date has arrived, + * an object of the time left otherwise. + */ + var current = current || new Date(); + if (current >= target) { return true; } + + var o = {}; + var remain = Math.floor((target.getTime() - current.getTime()) / 1000); + + o.days = Math.floor(remain / 86400); + remain %= 86400; + o.hours = Math.floor(remain / 3600); + remain %= 3600; + o.minutes = Math.floor(remain / 60); + remain %= 60; + o.seconds = remain; + o.years = Math.floor(o.days / 365); + o.months = Math.floor(o.days / 30); + o.weeks = Math.floor(o.days / 7); + + return o; + }; + + var getWeek = function(date) { + var onejan = new Date(date.getFullYear(),0,1); + return Math.ceil((((date - onejan) / 86400000) + onejan.getDay())/7); + }; + + var options = $.extend({ + date: new Date(), + modifiers: [], + interval: 1000, + msgFormat: '%d [day|days] %hh %mm %ss', + msgNow: 'Now !' + }, options); + + var tokens = { + y: new RegExp ('\\%y(.+?)\\[(\\w+)\\|(\\w+)\\]', 'g'), // years + M: new RegExp ('\\%M(.+?)\\[(\\w+)\\|(\\w+)\\]', 'g'), // months + w: new RegExp ('\\%w(.+?)\\[(\\w+)\\|(\\w+)\\]', 'g'), // weeks + d: new RegExp ('\\%d(.+?)\\[(\\w+)\\|(\\w+)\\]', 'g'), // days + h: new RegExp ('\\%h(.+?)\\[(\\w+)\\|(\\w+)\\]', 'g'), // hours + m: new RegExp ('\\%m(.+?)\\[(\\w+)\\|(\\w+)\\]', 'g'), // minutes + s: new RegExp ('\\%s(.+?)\\[(\\w+)\\|(\\w+)\\]', 'g') // seconds + }; + + var formatToken = function(str, token, val) { + return (!tokens[token])? '': str.match(/\[|\]/g) + && (str.replace(tokens[token], val+'$1'+ ((parseInt(val, 10)<2)?'$2':'$3')) || '') + || str.replace('%'+token, val); + }; + + var format = function(str, obj) { + var o = str; + o = formatToken(o, 'y', obj.years); + o = formatToken(o, 'M', obj.months); + o = formatToken(o, 'w', obj.weeks); + o = formatToken(o, 'd', obj.days); + o = formatToken(o, 'h', obj.hours); + o = formatToken(o, 'm', obj.minutes); + o = formatToken(o, 's', obj.seconds); + return o; + }; + + var update = function() { + var date_obj = calc(cd.date); + if (date_obj === true) { + cd.stop(); clearInterval(cd.id); + $(cd.el).html(options.msgNow); + return true; + } + else { + $(cd.el).text(format(options.msgFormat, date_obj)); + } + }; + + var apply_modifiers = function (modifiers, date) { + if (modifiers.length === 0) { + return date; + } + + var modifier_re = /^([+-]\d+)([yMdhms])$/; + var conversions = { + s: 1000, + m: 60 * 1000, + h: 60 * 60 * 1000, + d: 24 * 60 * 60 * 1000, + M: 30 * 24 * 60 * 60 * 1000, + y: 365 * 24 * 60 * 60 * 1000 + }; + + var displacement = 0; + for (var i = 0, n = modifiers.length; i < n; ++i) { + var match = modifiers[i].match(modifier_re); + if (match !== null) { + displacement += parseInt(match[1], 10) * conversions[match[2]]; + } + } + return new Date(date.getTime() + displacement); + }; + + var cd = { + id : setInterval(update, options.interval), + el : el, + start : function(){ return new countdown($(this.el), options); }, + stop : function(){ return clearInterval(this.id); }, + date : apply_modifiers(options.modifiers, options.date) + }; + $(el).data('countdown', cd); + update(); + return $(el).data('countdown'); + } + $.fn.countdown = function(args) { if(this.get(0)) return new countdown(this.get(0), args); }; +})(jQuery); +/* + * jQuery Cycle Plugin for light-weight slideshows + * Examples and documentation at: http://malsup.com/jquery/cycle/ + * Copyright (c) 2007-2008 M. Alsup + * Version: 2.24 (07/30/2008) + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * Requires: jQuery v1.2.3 or later + * + * Based on the work of: + * 1) Matt Oakes (http://portfolio.gizone.co.uk/applications/slideshow/) + * 2) Torsten Baldes (http://medienfreunde.com/lab/innerfade/) + * 3) Benjamin Sterling (http://www.benjaminsterling.com/experiments/jqShuffle/) + */ +;(function($) { + +var ver = '2.24'; +var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent); + +function log() { + if (window.console && window.console.log) + window.console.log('[cycle] ' + Array.prototype.join.call(arguments,'')); +}; + +$.fn.cycle = function(options) { + return this.each(function() { + if (options === undefined || options === null) + options = {}; + if (options.constructor == String) { + switch(options) { + case 'stop': + if (this.cycleTimeout) clearTimeout(this.cycleTimeout); + this.cycleTimeout = 0; + $(this).data('cycle.opts', ''); + return; + case 'pause': + this.cyclePause = 1; + return; + case 'resume': + this.cyclePause = 0; + return; + default: + options = { fx: options }; + }; + } + else if (options.constructor == Number) { + // go to the requested slide slide + var num = options; + options = $(this).data('cycle.opts'); + if (!options) { + log('options not found, can not advance slide'); + return; + } + if (num < 0 || num >= options.elements.length) { + log('invalid slide index: ' + num); + return; + } + options.nextSlide = num; + if (this.cycleTimeout) { + clearTimeout(this.cycleTimeout); + this.cycleTimeout = 0; + } + go(options.elements, options, 1, 1); + return; + } + + // stop existing slideshow for this container (if there is one) + if (this.cycleTimeout) clearTimeout(this.cycleTimeout); + this.cycleTimeout = 0; + this.cyclePause = 0; + + var $cont = $(this); + var $slides = options.slideExpr ? $(options.slideExpr, this) : $cont.children(); + var els = $slides.get(); + if (els.length < 2) { + log('terminating; too few slides: ' + els.length); + return; // don't bother + } + + // support metadata plugin (v1.0 and v2.0) + var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {}); + if (opts.autostop) + opts.countdown = opts.autostopCount || els.length; + + $cont.data('cycle.opts', opts); + opts.container = this; + + opts.elements = els; + opts.before = opts.before ? [opts.before] : []; + opts.after = opts.after ? [opts.after] : []; + opts.after.unshift(function(){ opts.busy=0; }); + if (opts.continuous) + opts.after.push(function() { go(els,opts,0,!opts.rev); }); + + // clearType corrections + if (ie6 && opts.cleartype && !opts.cleartypeNoBg) + clearTypeFix($slides); + + // allow shorthand overrides of width, height and timeout + var cls = this.className; + opts.width = parseInt((cls.match(/w:(\d+)/)||[])[1]) || opts.width; + opts.height = parseInt((cls.match(/h:(\d+)/)||[])[1]) || opts.height; + opts.timeout = parseInt((cls.match(/t:(\d+)/)||[])[1]) || opts.timeout; + + if ($cont.css('position') == 'static') + $cont.css('position', 'relative'); + if (opts.width) + $cont.width(opts.width); + if (opts.height && opts.height != 'auto') + $cont.height(opts.height); + + if (opts.random) { + opts.randomMap = []; + for (var i = 0; i < els.length; i++) + opts.randomMap.push(i); + opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;}); + opts.randomIndex = 0; + opts.startingSlide = opts.randomMap[0]; + } + else if (opts.startingSlide >= els.length) + opts.startingSlide = 0; // catch bogus input + var first = opts.startingSlide || 0; + $slides.css({position: 'absolute', top:0, left:0}).hide().each(function(i) { + var z = first ? i >= first ? els.length - (i-first) : first-i : els.length-i; + $(this).css('z-index', z) + }); + + $(els[first]).css('opacity',1).show(); // opacity bit needed to handle reinit case + if ($.browser.msie) els[first].style.removeAttribute('filter'); + + if (opts.fit && opts.width) + $slides.width(opts.width); + if (opts.fit && opts.height && opts.height != 'auto') + $slides.height(opts.height); + if (opts.pause) + $cont.hover(function(){this.cyclePause=1;},function(){this.cyclePause=0;}); + + // run transition init fn + var init = $.fn.cycle.transitions[opts.fx]; + if ($.isFunction(init)) + init($cont, $slides, opts); + else if (opts.fx != 'custom') + log('unknown transition: ' + opts.fx); + + $slides.each(function() { + var $el = $(this); + this.cycleH = (opts.fit && opts.height) ? opts.height : $el.height(); + this.cycleW = (opts.fit && opts.width) ? opts.width : $el.width(); + }); + + opts.cssBefore = opts.cssBefore || {}; + opts.animIn = opts.animIn || {}; + opts.animOut = opts.animOut || {}; + + $slides.not(':eq('+first+')').css(opts.cssBefore); + if (opts.cssFirst) + $($slides[first]).css(opts.cssFirst); + + if (opts.timeout) { + // ensure that timeout and speed settings are sane + if (opts.speed.constructor == String) + opts.speed = {slow: 600, fast: 200}[opts.speed] || 400; + if (!opts.sync) + opts.speed = opts.speed / 2; + while((opts.timeout - opts.speed) < 250) + opts.timeout += opts.speed; + } + if (opts.easing) + opts.easeIn = opts.easeOut = opts.easing; + if (!opts.speedIn) + opts.speedIn = opts.speed; + if (!opts.speedOut) + opts.speedOut = opts.speed; + + opts.slideCount = els.length; + opts.currSlide = first; + if (opts.random) { + opts.nextSlide = opts.currSlide; + if (++opts.randomIndex == els.length) + opts.randomIndex = 0; + opts.nextSlide = opts.randomMap[opts.randomIndex]; + } + else + opts.nextSlide = opts.startingSlide >= (els.length-1) ? 0 : opts.startingSlide+1; + + // fire artificial events + var e0 = $slides[first]; + if (opts.before.length) + opts.before[0].apply(e0, [e0, e0, opts, true]); + if (opts.after.length > 1) + opts.after[1].apply(e0, [e0, e0, opts, true]); + + if (opts.click && !opts.next) + opts.next = opts.click; + if (opts.next) + $(opts.next).bind('click', function(){return advance(els,opts,opts.rev?-1:1)}); + if (opts.prev) + $(opts.prev).bind('click', function(){return advance(els,opts,opts.rev?1:-1)}); + if (opts.pager) + buildPager(els,opts); + + // expose fn for adding slides after the show has started + opts.addSlide = function(newSlide) { + var $s = $(newSlide), s = $s[0]; + if (!opts.autostopCount) + opts.countdown++; + els.push(s); + if (opts.els) + opts.els.push(s); // shuffle needs this + opts.slideCount = els.length; + + $s.css('position','absolute').appendTo($cont); + + if (ie6 && opts.cleartype && !opts.cleartypeNoBg) + clearTypeFix($s); + + if (opts.fit && opts.width) + $s.width(opts.width); + if (opts.fit && opts.height && opts.height != 'auto') + $slides.height(opts.height); + s.cycleH = (opts.fit && opts.height) ? opts.height : $s.height(); + s.cycleW = (opts.fit && opts.width) ? opts.width : $s.width(); + + $s.css(opts.cssBefore); + + if (opts.pager) + $.fn.cycle.createPagerAnchor(els.length-1, s, $(opts.pager), els, opts); + + if (typeof opts.onAddSlide == 'function') + opts.onAddSlide($s); + }; + + if (opts.timeout || opts.continuous) + this.cycleTimeout = setTimeout( + function(){go(els,opts,0,!opts.rev)}, + opts.continuous ? 10 : opts.timeout + (opts.delay||0)); + }); +}; + +function go(els, opts, manual, fwd) { + if (opts.busy) return; + var p = opts.container, curr = els[opts.currSlide], next = els[opts.nextSlide]; + if (p.cycleTimeout === 0 && !manual) + return; + + if (!manual && !p.cyclePause && + ((opts.autostop && (--opts.countdown <= 0)) || + (opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide))) { + if (opts.end) + opts.end(opts); + return; + } + + if (manual || !p.cyclePause) { + if (opts.before.length) + $.each(opts.before, function(i,o) { o.apply(next, [curr, next, opts, fwd]); }); + var after = function() { + if ($.browser.msie && opts.cleartype) + this.style.removeAttribute('filter'); + $.each(opts.after, function(i,o) { o.apply(next, [curr, next, opts, fwd]); }); + }; + + if (opts.nextSlide != opts.currSlide) { + opts.busy = 1; + if (opts.fxFn) + opts.fxFn(curr, next, opts, after, fwd); + else if ($.isFunction($.fn.cycle[opts.fx])) + $.fn.cycle[opts.fx](curr, next, opts, after); + else + $.fn.cycle.custom(curr, next, opts, after); + } + if (opts.random) { + opts.currSlide = opts.nextSlide; + if (++opts.randomIndex == els.length) + opts.randomIndex = 0; + opts.nextSlide = opts.randomMap[opts.randomIndex]; + } + else { // sequence + var roll = (opts.nextSlide + 1) == els.length; + opts.nextSlide = roll ? 0 : opts.nextSlide+1; + opts.currSlide = roll ? els.length-1 : opts.nextSlide-1; + } + if (opts.pager) + $.fn.cycle.updateActivePagerLink(opts.pager, opts.currSlide); + } + if (opts.timeout && !opts.continuous) + p.cycleTimeout = setTimeout(function() { go(els,opts,0,!opts.rev) }, opts.timeout); + else if (opts.continuous && p.cyclePause) + p.cycleTimeout = setTimeout(function() { go(els,opts,0,!opts.rev) }, 10); +}; + +$.fn.cycle.updateActivePagerLink = function(pager, currSlide) { + $(pager).find('a').removeClass('activeSlide').filter('a:eq('+currSlide+')').addClass('activeSlide'); +}; + +// advance slide forward or back +function advance(els, opts, val) { + var p = opts.container, timeout = p.cycleTimeout; + if (timeout) { + clearTimeout(timeout); + p.cycleTimeout = 0; + } + if (opts.random && val < 0) { + // move back to the previously display slide + opts.randomIndex--; + if (--opts.randomIndex == -2) + opts.randomIndex = els.length-2; + else if (opts.randomIndex == -1) + opts.randomIndex = els.length-1; + opts.nextSlide = opts.randomMap[opts.randomIndex]; + } + else if (opts.random) { + if (++opts.randomIndex == els.length) + opts.randomIndex = 0; + opts.nextSlide = opts.randomMap[opts.randomIndex]; + } + else { + opts.nextSlide = opts.currSlide + val; + if (opts.nextSlide < 0) { + if (opts.nowrap) return false; + opts.nextSlide = els.length - 1; + } + else if (opts.nextSlide >= els.length) { + if (opts.nowrap) return false; + opts.nextSlide = 0; + } + } + +log('nextSlide: ' + opts.nextSlide + '; randomIndex: ' + opts.randomIndex); + if (opts.prevNextClick && typeof opts.prevNextClick == 'function') + opts.prevNextClick(val > 0, opts.nextSlide, els[opts.nextSlide]); + go(els, opts, 1, val>=0); + return false; +}; + +function buildPager(els, opts) { + var $p = $(opts.pager); + $.each(els, function(i,o) { + $.fn.cycle.createPagerAnchor(i,o,$p,els,opts); + }); + $.fn.cycle.updateActivePagerLink(opts.pager, opts.startingSlide); +}; + +$.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) { + var $a = (typeof opts.pagerAnchorBuilder == 'function') + ? $(opts.pagerAnchorBuilder(i,el)) + : $(''+(i+1)+''); + + // don't reparent if anchor is in the dom + if ($a.parents('body').length == 0) + $a.appendTo($p); + + $a.bind(opts.pagerEvent, function() { + opts.nextSlide = i; + var p = opts.container, timeout = p.cycleTimeout; + if (timeout) { + clearTimeout(timeout); + p.cycleTimeout = 0; + } + if (typeof opts.pagerClick == 'function') + opts.pagerClick(opts.nextSlide, els[opts.nextSlide]); + go(els,opts,1,opts.currSlide < i); + return false; + }); +}; + + +// this fixes clearType problems in ie6 by setting an explicit bg color +function clearTypeFix($slides) { + function hex(s) { + var s = parseInt(s).toString(16); + return s.length < 2 ? '0'+s : s; + }; + function getBg(e) { + for ( ; e && e.nodeName.toLowerCase() != 'html'; e = e.parentNode) { + var v = $.css(e,'background-color'); + if (v.indexOf('rgb') >= 0 ) { + var rgb = v.match(/\d+/g); + return '#'+ hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]); + } + if (v && v != 'transparent') + return v; + } + return '#ffffff'; + }; + $slides.each(function() { $(this).css('background-color', getBg(this)); }); +}; + + +$.fn.cycle.custom = function(curr, next, opts, cb) { + var $l = $(curr), $n = $(next); + $n.css(opts.cssBefore); + var fn = function() {$n.animate(opts.animIn, opts.speedIn, opts.easeIn, cb)}; + $l.animate(opts.animOut, opts.speedOut, opts.easeOut, function() { + if (opts.cssAfter) $l.css(opts.cssAfter); + if (!opts.sync) fn(); + }); + if (opts.sync) fn(); +}; + +$.fn.cycle.transitions = { + fade: function($cont, $slides, opts) { + $slides.not(':eq('+opts.startingSlide+')').css('opacity',0); + opts.before.push(function() { $(this).show() }); + opts.animIn = { opacity: 1 }; + opts.animOut = { opacity: 0 }; + opts.cssBefore = { opacity: 0 }; + opts.cssAfter = { display: 'none' }; + } +}; + +$.fn.cycle.ver = function() { return ver; }; + +// override these globally if you like (they are all optional) +$.fn.cycle.defaults = { + fx: 'fade', // one of: fade, shuffle, zoom, scrollLeft, etc + timeout: 4000, // milliseconds between slide transitions (0 to disable auto advance) + continuous: 0, // true to start next transition immediately after current one completes + speed: 1000, // speed of the transition (any valid fx speed value) + speedIn: null, // speed of the 'in' transition + speedOut: null, // speed of the 'out' transition + next: null, // id of element to use as click trigger for next slide + prev: null, // id of element to use as click trigger for previous slide + prevNextClick: null, // callback fn for prev/next clicks: function(isNext, zeroBasedSlideIndex, slideElement) + pager: null, // id of element to use as pager container + pagerClick: null, // callback fn for pager clicks: function(zeroBasedSlideIndex, slideElement) + pagerEvent: 'click', // event which drives the pager navigation + pagerAnchorBuilder: null, // callback fn for building anchor links + before: null, // transition callback (scope set to element to be shown) + after: null, // transition callback (scope set to element that was shown) + end: null, // callback invoked when the slideshow terminates (use with autostop or nowrap options) + easing: null, // easing method for both in and out transitions + easeIn: null, // easing for "in" transition + easeOut: null, // easing for "out" transition + shuffle: null, // coords for shuffle animation, ex: { top:15, left: 200 } + animIn: null, // properties that define how the slide animates in + animOut: null, // properties that define how the slide animates out + cssBefore: null, // properties that define the initial state of the slide before transitioning in + cssAfter: null, // properties that defined the state of the slide after transitioning out + fxFn: null, // function used to control the transition + height: 'auto', // container height + startingSlide: 0, // zero-based index of the first slide to be displayed + sync: 1, // true if in/out transitions should occur simultaneously + random: 0, // true for random, false for sequence (not applicable to shuffle fx) + fit: 0, // force slides to fit container + pause: 0, // true to enable "pause on hover" + autostop: 0, // true to end slideshow after X transitions (where X == slide count) + autostopCount: 0, // number of transitions (optionally used with autostop to define X) + delay: 0, // additional delay (in ms) for first transition (hint: can be negative) + slideExpr: null, // expression for selecting slides (if something other than all children is required) + cleartype: 0, // true if clearType corrections should be applied (for IE) + nowrap: 0 // true to prevent slideshow from wrapping +}; + +})(jQuery); + + +/* + * jQuery Cycle Plugin Transition Definitions + * This script is a plugin for the jQuery Cycle Plugin + * Examples and documentation at: http://malsup.com/jquery/cycle/ + * Copyright (c) 2007-2008 M. Alsup + * Version: 2.22 + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ +(function($) { + +// +// These functions define one-time slide initialization for the named +// transitions. To save file size feel free to remove any of these that you +// don't need. +// + +// scrollUp/Down/Left/Right +$.fn.cycle.transitions.scrollUp = function($cont, $slides, opts) { + $cont.css('overflow','hidden'); + opts.before.push(function(curr, next, opts) { + $(this).show(); + opts.cssBefore.top = next.offsetHeight; + opts.animOut.top = 0-curr.offsetHeight; + }); + opts.cssFirst = { top: 0 }; + opts.animIn = { top: 0 }; + opts.cssAfter = { display: 'none' }; +}; +$.fn.cycle.transitions.scrollDown = function($cont, $slides, opts) { + $cont.css('overflow','hidden'); + opts.before.push(function(curr, next, opts) { + $(this).show(); + opts.cssBefore.top = 0-next.offsetHeight; + opts.animOut.top = curr.offsetHeight; + }); + opts.cssFirst = { top: 0 }; + opts.animIn = { top: 0 }; + opts.cssAfter = { display: 'none' }; +}; +$.fn.cycle.transitions.scrollLeft = function($cont, $slides, opts) { + $cont.css('overflow','hidden'); + opts.before.push(function(curr, next, opts) { + $(this).show(); + opts.cssBefore.left = next.offsetWidth; + opts.animOut.left = 0-curr.offsetWidth; + }); + opts.cssFirst = { left: 0 }; + opts.animIn = { left: 0 }; +}; +$.fn.cycle.transitions.scrollRight = function($cont, $slides, opts) { + $cont.css('overflow','hidden'); + opts.before.push(function(curr, next, opts) { + $(this).show(); + opts.cssBefore.left = 0-next.offsetWidth; + opts.animOut.left = curr.offsetWidth; + }); + opts.cssFirst = { left: 0 }; + opts.animIn = { left: 0 }; +}; +$.fn.cycle.transitions.scrollHorz = function($cont, $slides, opts) { + $cont.css('overflow','hidden').width(); +// $slides.show(); + opts.before.push(function(curr, next, opts, fwd) { + $(this).show(); + var currW = curr.offsetWidth, nextW = next.offsetWidth; + opts.cssBefore = fwd ? { left: nextW } : { left: -nextW }; + opts.animIn.left = 0; + opts.animOut.left = fwd ? -currW : currW; + $slides.not(curr).css(opts.cssBefore); + }); + opts.cssFirst = { left: 0 }; + opts.cssAfter = { display: 'none' } +}; +$.fn.cycle.transitions.scrollVert = function($cont, $slides, opts) { + $cont.css('overflow','hidden'); +// $slides.show(); + opts.before.push(function(curr, next, opts, fwd) { + $(this).show(); + var currH = curr.offsetHeight, nextH = next.offsetHeight; + opts.cssBefore = fwd ? { top: -nextH } : { top: nextH }; + opts.animIn.top = 0; + opts.animOut.top = fwd ? currH : -currH; + $slides.not(curr).css(opts.cssBefore); + }); + opts.cssFirst = { top: 0 }; + opts.cssAfter = { display: 'none' } +}; + +// slideX/slideY +$.fn.cycle.transitions.slideX = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + $(curr).css('zIndex',1); + }); + opts.onAddSlide = function($s) { $s.hide(); }; + opts.cssBefore = { zIndex: 2 }; + opts.animIn = { width: 'show' }; + opts.animOut = { width: 'hide' }; +}; +$.fn.cycle.transitions.slideY = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + $(curr).css('zIndex',1); + }); + opts.onAddSlide = function($s) { $s.hide(); }; + opts.cssBefore = { zIndex: 2 }; + opts.animIn = { height: 'show' }; + opts.animOut = { height: 'hide' }; +}; + +// shuffle +$.fn.cycle.transitions.shuffle = function($cont, $slides, opts) { + var w = $cont.css('overflow', 'visible').width(); + $slides.css({left: 0, top: 0}); + opts.before.push(function() { $(this).show() }); + opts.speed = opts.speed / 2; // shuffle has 2 transitions + opts.random = 0; + opts.shuffle = opts.shuffle || {left:-w, top:15}; + opts.els = []; + for (var i=0; i < $slides.length; i++) + opts.els.push($slides[i]); + + for (var i=0; i < opts.startingSlide; i++) + opts.els.push(opts.els.shift()); + + // custom transition fn (hat tip to Benjamin Sterling for this bit of sweetness!) + opts.fxFn = function(curr, next, opts, cb, fwd) { + var $el = fwd ? $(curr) : $(next); + $el.animate(opts.shuffle, opts.speedIn, opts.easeIn, function() { + fwd ? opts.els.push(opts.els.shift()) : opts.els.unshift(opts.els.pop()); + if (fwd) + for (var i=0, len=opts.els.length; i < len; i++) + $(opts.els[i]).css('z-index', len-i); + else { + var z = $(curr).css('z-index'); + $el.css('z-index', parseInt(z)+1); + } + $el.animate({left:0, top:0}, opts.speedOut, opts.easeOut, function() { + $(fwd ? this : curr).hide(); + if (cb) cb(); + }); + }); + }; + opts.onAddSlide = function($s) { $s.hide(); }; +}; + +// turnUp/Down/Left/Right +$.fn.cycle.transitions.turnUp = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + $(this).show(); + opts.cssBefore.top = next.cycleH; + opts.animIn.height = next.cycleH; + }); + opts.onAddSlide = function($s) { $s.hide(); }; + opts.cssFirst = { top: 0 }; + opts.cssBefore = { height: 0 }; + opts.animIn = { top: 0 }; + opts.animOut = { height: 0 }; + opts.cssAfter = { display: 'none' }; +}; +$.fn.cycle.transitions.turnDown = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + $(this).show(); + opts.animIn.height = next.cycleH; + opts.animOut.top = curr.cycleH; + }); + opts.onAddSlide = function($s) { $s.hide(); }; + opts.cssFirst = { top: 0 }; + opts.cssBefore = { top: 0, height: 0 }; + opts.animOut = { height: 0 }; + opts.cssAfter = { display: 'none' }; +}; +$.fn.cycle.transitions.turnLeft = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + $(this).show(); + opts.cssBefore.left = next.cycleW; + opts.animIn.width = next.cycleW; + }); + opts.onAddSlide = function($s) { $s.hide(); }; + opts.cssBefore = { width: 0 }; + opts.animIn = { left: 0 }; + opts.animOut = { width: 0 }; + opts.cssAfter = { display: 'none' }; +}; +$.fn.cycle.transitions.turnRight = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + $(this).show(); + opts.animIn.width = next.cycleW; + opts.animOut.left = curr.cycleW; + }); + opts.onAddSlide = function($s) { $s.hide(); }; + opts.cssBefore = { left: 0, width: 0 }; + opts.animIn = { left: 0 }; + opts.animOut = { width: 0 }; + opts.cssAfter = { display: 'none' }; +}; + +// zoom +$.fn.cycle.transitions.zoom = function($cont, $slides, opts) { + opts.cssFirst = { top:0, left: 0 }; + opts.cssAfter = { display: 'none' }; + + opts.before.push(function(curr, next, opts) { + $(this).show(); + opts.cssBefore = { width: 0, height: 0, top: next.cycleH/2, left: next.cycleW/2 }; + opts.cssAfter = { display: 'none' }; + opts.animIn = { top: 0, left: 0, width: next.cycleW, height: next.cycleH }; + opts.animOut = { width: 0, height: 0, top: curr.cycleH/2, left: curr.cycleW/2 }; + $(curr).css('zIndex',2); + $(next).css('zIndex',1); + }); + opts.onAddSlide = function($s) { $s.hide(); }; +}; + +// fadeZoom +$.fn.cycle.transitions.fadeZoom = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + opts.cssBefore = { width: 0, height: 0, opacity: 1, left: next.cycleW/2, top: next.cycleH/2, zIndex: 1 }; + opts.animIn = { top: 0, left: 0, width: next.cycleW, height: next.cycleH }; + }); + opts.animOut = { opacity: 0 }; + opts.cssAfter = { zIndex: 0 }; +}; + +// blindX +$.fn.cycle.transitions.blindX = function($cont, $slides, opts) { + var w = $cont.css('overflow','hidden').width(); + $slides.show(); + opts.before.push(function(curr, next, opts) { + $(curr).css('zIndex',1); + }); + opts.cssBefore = { left: w, zIndex: 2 }; + opts.cssAfter = { zIndex: 1 }; + opts.animIn = { left: 0 }; + opts.animOut = { left: w }; +}; +// blindY +$.fn.cycle.transitions.blindY = function($cont, $slides, opts) { + var h = $cont.css('overflow','hidden').height(); + $slides.show(); + opts.before.push(function(curr, next, opts) { + $(curr).css('zIndex',1); + }); + opts.cssBefore = { top: h, zIndex: 2 }; + opts.cssAfter = { zIndex: 1 }; + opts.animIn = { top: 0 }; + opts.animOut = { top: h }; +}; +// blindZ +$.fn.cycle.transitions.blindZ = function($cont, $slides, opts) { + var h = $cont.css('overflow','hidden').height(); + var w = $cont.width(); + $slides.show(); + opts.before.push(function(curr, next, opts) { + $(curr).css('zIndex',1); + }); + opts.cssBefore = { top: h, left: w, zIndex: 2 }; + opts.cssAfter = { zIndex: 1 }; + opts.animIn = { top: 0, left: 0 }; + opts.animOut = { top: h, left: w }; +}; + +// growX - grow horizontally from centered 0 width +$.fn.cycle.transitions.growX = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + opts.cssBefore = { left: this.cycleW/2, width: 0, zIndex: 2 }; + opts.animIn = { left: 0, width: this.cycleW }; + opts.animOut = { left: 0 }; + $(curr).css('zIndex',1); + }); + opts.onAddSlide = function($s) { $s.hide().css('zIndex',1); }; +}; +// growY - grow vertically from centered 0 height +$.fn.cycle.transitions.growY = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + opts.cssBefore = { top: this.cycleH/2, height: 0, zIndex: 2 }; + opts.animIn = { top: 0, height: this.cycleH }; + opts.animOut = { top: 0 }; + $(curr).css('zIndex',1); + }); + opts.onAddSlide = function($s) { $s.hide().css('zIndex',1); }; +}; + +// curtainX - squeeze in both edges horizontally +$.fn.cycle.transitions.curtainX = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + opts.cssBefore = { left: next.cycleW/2, width: 0, zIndex: 1, display: 'block' }; + opts.animIn = { left: 0, width: this.cycleW }; + opts.animOut = { left: curr.cycleW/2, width: 0 }; + $(curr).css('zIndex',2); + }); + opts.onAddSlide = function($s) { $s.hide(); }; + opts.cssAfter = { zIndex: 1, display: 'none' }; +}; +// curtainY - squeeze in both edges vertically +$.fn.cycle.transitions.curtainY = function($cont, $slides, opts) { + opts.before.push(function(curr, next, opts) { + opts.cssBefore = { top: next.cycleH/2, height: 0, zIndex: 1, display: 'block' }; + opts.animIn = { top: 0, height: this.cycleH }; + opts.animOut = { top: curr.cycleH/2, height: 0 }; + $(curr).css('zIndex',2); + }); + opts.onAddSlide = function($s) { $s.hide(); }; + opts.cssAfter = { zIndex: 1, display: 'none' }; +}; + +// cover - curr slide covered by next slide +$.fn.cycle.transitions.cover = function($cont, $slides, opts) { + var d = opts.direction || 'left'; + var w = $cont.css('overflow','hidden').width(); + var h = $cont.height(); + opts.before.push(function(curr, next, opts) { + opts.cssBefore = opts.cssBefore || {}; + opts.cssBefore.zIndex = 2; + opts.cssBefore.display = 'block'; + + if (d == 'right') + opts.cssBefore.left = -w; + else if (d == 'up') + opts.cssBefore.top = h; + else if (d == 'down') + opts.cssBefore.top = -h; + else + opts.cssBefore.left = w; + $(curr).css('zIndex',1); + }); + if (!opts.animIn) opts.animIn = { left: 0, top: 0 }; + if (!opts.animOut) opts.animOut = { left: 0, top: 0 }; + opts.cssAfter = opts.cssAfter || {}; + opts.cssAfter.zIndex = 2; + opts.cssAfter.display = 'none'; +}; + +// uncover - curr slide moves off next slide +$.fn.cycle.transitions.uncover = function($cont, $slides, opts) { + var d = opts.direction || 'left'; + var w = $cont.css('overflow','hidden').width(); + var h = $cont.height(); + opts.before.push(function(curr, next, opts) { + opts.cssBefore.display = 'block'; + if (d == 'right') + opts.animOut.left = w; + else if (d == 'up') + opts.animOut.top = -h; + else if (d == 'down') + opts.animOut.top = h; + else + opts.animOut.left = -w; + $(curr).css('zIndex',2); + $(next).css('zIndex',1); + }); + opts.onAddSlide = function($s) { $s.hide(); }; + if (!opts.animIn) opts.animIn = { left: 0, top: 0 }; + opts.cssBefore = opts.cssBefore || {}; + opts.cssBefore.top = 0; + opts.cssBefore.left = 0; + + opts.cssAfter = opts.cssAfter || {}; + opts.cssAfter.zIndex = 1; + opts.cssAfter.display = 'none'; +}; + +// toss - move top slide and fade away +$.fn.cycle.transitions.toss = function($cont, $slides, opts) { + var w = $cont.css('overflow','visible').width(); + var h = $cont.height(); + opts.before.push(function(curr, next, opts) { + $(curr).css('zIndex',2); + opts.cssBefore.display = 'block'; + // provide default toss settings if animOut not provided + if (!opts.animOut.left && !opts.animOut.top) + opts.animOut = { left: w*2, top: -h/2, opacity: 0 }; + else + opts.animOut.opacity = 0; + }); + opts.onAddSlide = function($s) { $s.hide(); }; + opts.cssBefore = { left: 0, top: 0, zIndex: 1, opacity: 1 }; + opts.animIn = { left: 0 }; + opts.cssAfter = { zIndex: 2, display: 'none' }; +}; + +// wipe - clip animation +$.fn.cycle.transitions.wipe = function($cont, $slides, opts) { + var w = $cont.css('overflow','hidden').width(); + var h = $cont.height(); + opts.cssBefore = opts.cssBefore || {}; + var clip; + if (opts.clip) { + if (/l2r/.test(opts.clip)) + clip = 'rect(0px 0px '+h+'px 0px)'; + else if (/r2l/.test(opts.clip)) + clip = 'rect(0px '+w+'px '+h+'px '+w+'px)'; + else if (/t2b/.test(opts.clip)) + clip = 'rect(0px '+w+'px 0px 0px)'; + else if (/b2t/.test(opts.clip)) + clip = 'rect('+h+'px '+w+'px '+h+'px 0px)'; + else if (/zoom/.test(opts.clip)) { + var t = parseInt(h/2); + var l = parseInt(w/2); + clip = 'rect('+t+'px '+l+'px '+t+'px '+l+'px)'; + } + } + + opts.cssBefore.clip = opts.cssBefore.clip || clip || 'rect(0px 0px 0px 0px)'; + + var d = opts.cssBefore.clip.match(/(\d+)/g); + var t = parseInt(d[0]), r = parseInt(d[1]), b = parseInt(d[2]), l = parseInt(d[3]); + + opts.before.push(function(curr, next, opts) { + if (curr == next) return; + var $curr = $(curr).css('zIndex',2); + var $next = $(next).css({ + zIndex: 3, + display: 'block' + }); + + var step = 1, count = parseInt((opts.speedIn / 13)) - 1; + function f() { + var tt = t ? t - parseInt(step * (t/count)) : 0; + var ll = l ? l - parseInt(step * (l/count)) : 0; + var bb = b < h ? b + parseInt(step * ((h-b)/count || 1)) : h; + var rr = r < w ? r + parseInt(step * ((w-r)/count || 1)) : w; + $next.css({ clip: 'rect('+tt+'px '+rr+'px '+bb+'px '+ll+'px)' }); + (step++ <= count) ? setTimeout(f, 13) : $curr.css('display', 'none'); + } + f(); + }); + opts.cssAfter = { }; + opts.animIn = { left: 0 }; + opts.animOut = { left: 0 }; +}; + +})(jQuery); +/* + jQuery delayed observer - 0.8 + http://code.google.com/p/jquery-utils/ + + (c) Maxime Haineault + http://haineault.com + + MIT License (http://www.opensource.org/licenses/mit-license.php) + +*/ + +(function($){ + $.extend($.fn, { + delayedObserver: function(callback, delay, options){ + return this.each(function(){ + var el = $(this); + var op = options || {}; + el.data('oldval', el.val()) + .data('delay', delay || 0.5) + .data('condition', op.condition || function() { return ($(this).data('oldval') == $(this).val()); }) + .data('callback', callback) + [(op.event||'keyup')](function(){ + if (el.data('condition').apply(el)) { return; } + else { + if (el.data('timer')) { clearTimeout(el.data('timer')); } + el.data('timer', setTimeout(function(){ + el.data('callback').apply(el); + }, el.data('delay') * 1000)); + el.data('oldval', el.val()); + } + }); + }); + } + }); +})(jQuery); +/** + * Flash (http://jquery.lukelutman.com/plugins/flash) + * A jQuery plugin for embedding Flash movies. + * + * Version 1.0 + * November 9th, 2006 + * + * Copyright (c) 2006 Luke Lutman (http://www.lukelutman.com) + * Dual licensed under the MIT and GPL licenses. + * http://www.opensource.org/licenses/mit-license.php + * http://www.opensource.org/licenses/gpl-license.php + * + * Inspired by: + * SWFObject (http://blog.deconcept.com/swfobject/) + * UFO (http://www.bobbyvandersluis.com/ufo/) + * sIFR (http://www.mikeindustries.com/sifr/) + * + * IMPORTANT: + * The packed version of jQuery breaks ActiveX control + * activation in Internet Explorer. Use JSMin to minifiy + * jQuery (see: http://jquery.lukelutman.com/plugins/flash#activex). + * + **/ +;(function(){ + +var $$; + +/** + * + * @desc Replace matching elements with a flash movie. + * @author Luke Lutman + * @version 1.0.1 + * + * @name flash + * @param Hash htmlOptions Options for the embed/object tag. + * @param Hash pluginOptions Options for detecting/updating the Flash plugin (optional). + * @param Function replace Custom block called for each matched element if flash is installed (optional). + * @param Function update Custom block called for each matched if flash isn't installed (optional). + * @type jQuery + * + * @cat plugins/flash + * + * @example $('#hello').flash({ src: 'hello.swf' }); + * @desc Embed a Flash movie. + * + * @example $('#hello').flash({ src: 'hello.swf' }, { version: 8 }); + * @desc Embed a Flash 8 movie. + * + * @example $('#hello').flash({ src: 'hello.swf' }, { expressInstall: true }); + * @desc Embed a Flash movie using Express Install if flash isn't installed. + * + * @example $('#hello').flash({ src: 'hello.swf' }, { update: false }); + * @desc Embed a Flash movie, don't show an update message if Flash isn't installed. + * +**/ +$$ = jQuery.fn.flash = function(htmlOptions, pluginOptions, replace, update) { + + // Set the default block. + var block = replace || $$.replace; + + // Merge the default and passed plugin options. + pluginOptions = $$.copy($$.pluginOptions, pluginOptions); + + // Detect Flash. + if(!$$.hasFlash(pluginOptions.version)) { + // Use Express Install (if specified and Flash plugin 6,0,65 or higher is installed). + if(pluginOptions.expressInstall && $$.hasFlash(6,0,65)) { + // Add the necessary flashvars (merged later). + var expressInstallOptions = { + flashvars: { + MMredirectURL: location, + MMplayerType: 'PlugIn', + MMdoctitle: jQuery('title').text() + } + }; + // Ask the user to update (if specified). + } else if (pluginOptions.update) { + // Change the block to insert the update message instead of the flash movie. + block = update || $$.update; + // Fail + } else { + // The required version of flash isn't installed. + // Express Install is turned off, or flash 6,0,65 isn't installed. + // Update is turned off. + // Return without doing anything. + return this; + } + } + + // Merge the default, express install and passed html options. + htmlOptions = $$.copy($$.htmlOptions, expressInstallOptions, htmlOptions); + + // Invoke $block (with a copy of the merged html options) for each element. + return this.each(function(){ + block.call(this, $$.copy(htmlOptions)); + }); + +}; +/** + * + * @name flash.copy + * @desc Copy an arbitrary number of objects into a new object. + * @type Object + * + * @example $$.copy({ foo: 1 }, { bar: 2 }); + * @result { foo: 1, bar: 2 }; + * +**/ +$$.copy = function() { + var options = {}, flashvars = {}; + for(var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if(arg == undefined) continue; + jQuery.extend(options, arg); + // don't clobber one flash vars object with another + // merge them instead + if(arg.flashvars == undefined) continue; + jQuery.extend(flashvars, arg.flashvars); + } + options.flashvars = flashvars; + return options; +}; +/* + * @name flash.hasFlash + * @desc Check if a specific version of the Flash plugin is installed + * @type Boolean + * +**/ +$$.hasFlash = function() { + // look for a flag in the query string to bypass flash detection + if(/hasFlash\=true/.test(location)) return true; + if(/hasFlash\=false/.test(location)) return false; + var pv = $$.hasFlash.playerVersion().match(/\d+/g); + var rv = String([arguments[0], arguments[1], arguments[2]]).match(/\d+/g) || String($$.pluginOptions.version).match(/\d+/g); + for(var i = 0; i < 3; i++) { + pv[i] = parseInt(pv[i] || 0); + rv[i] = parseInt(rv[i] || 0); + // player is less than required + if(pv[i] < rv[i]) return false; + // player is greater than required + if(pv[i] > rv[i]) return true; + } + // major version, minor version and revision match exactly + return true; +}; +/** + * + * @name flash.hasFlash.playerVersion + * @desc Get the version of the installed Flash plugin. + * @type String + * +**/ +$$.hasFlash.playerVersion = function() { + // ie + try { + try { + // avoid fp6 minor version lookup issues + // see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/ + var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6'); + try { axo.AllowScriptAccess = 'always'; } + catch(e) { return '6,0,0'; } + } catch(e) {} + return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1]; + // other browsers + } catch(e) { + try { + if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){ + return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1]; + } + } catch(e) {} + } + return '0,0,0'; +}; +/** + * + * @name flash.htmlOptions + * @desc The default set of options for the object or embed tag. + * +**/ +$$.htmlOptions = { + height: 240, + flashvars: {}, + pluginspage: 'http://www.adobe.com/go/getflashplayer', + src: '#', + type: 'application/x-shockwave-flash', + width: 320 +}; +/** + * + * @name flash.pluginOptions + * @desc The default set of options for checking/updating the flash Plugin. + * +**/ +$$.pluginOptions = { + expressInstall: false, + update: true, + version: '6.0.65' +}; +/** + * + * @name flash.replace + * @desc The default method for replacing an element with a Flash movie. + * +**/ +$$.replace = function(htmlOptions) { + this.innerHTML = '
'+this.innerHTML+'
'; + jQuery(this) + .addClass('flash-replaced') + .prepend($$.transform(htmlOptions)); +}; +/** + * + * @name flash.update + * @desc The default method for replacing an element with an update message. + * +**/ +$$.update = function(htmlOptions) { + var url = String(location).split('?'); + url.splice(1,0,'?hasFlash=true&'); + url = url.join(''); + var msg = '

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

'; + this.innerHTML = ''+this.innerHTML+''; + jQuery(this) + .addClass('flash-update') + .prepend(msg); +}; +/** + * + * @desc Convert a hash of html options to a string of attributes, using Function.apply(). + * @example toAttributeString.apply(htmlOptions) + * @result foo="bar" foo="bar" + * +**/ +function toAttributeString() { + var s = ''; + for(var key in this) + if(typeof this[key] != 'function') + s += key+'="'+this[key]+'" '; + return s; +}; +/** + * + * @desc Convert a hash of flashvars to a url-encoded string, using Function.apply(). + * @example toFlashvarsString.apply(flashvarsObject) + * @result foo=bar&foo=bar + * +**/ +function toFlashvarsString() { + var s = ''; + for(var key in this) + if(typeof this[key] != 'function') + s += key+'='+encodeURIComponent(this[key])+'&'; + return s.replace(/&$/, ''); +}; +/** + * + * @name flash.transform + * @desc Transform a set of html options into an embed tag. + * @type String + * + * @example $$.transform(htmlOptions) + * @result + * + * Note: The embed tag is NOT standards-compliant, but it + * works in all current browsers. flash.transform can be + * overwritten with a custom function to generate more + * standards-compliant markup. + * +**/ +$$.transform = function(htmlOptions) { + htmlOptions.toString = toAttributeString; + if(htmlOptions.flashvars) htmlOptions.flashvars.toString = toFlashvarsString; + return ''; +}; + +/** + * + * Flash Player 9 Fix (http://blog.deconcept.com/2006/07/28/swfobject-143-released/) + * +**/ +if (window.attachEvent) { + window.attachEvent("onbeforeunload", function(){ + __flash_unloadHandler = function() {}; + __flash_savedUnloadHandler = function() {}; + }); +} + +})(); +(function($){ + $._i18n = { trans: {}, 'default': 'en', language: 'en' }; + $.i18n = function() { + var getTrans = function(ns, str) { + var trans = false; + // check if string exists in translation + if ($._i18n.trans[$._i18n.language] + && $._i18n.trans[$._i18n.language][ns] + && $._i18n.trans[$._i18n.language][ns][str]) { + trans = $._i18n.trans[$._i18n.language][ns][str]; + } + // or exists in default + else if ($._i18n.trans[$._i18n['default']] + && $._i18n.trans[$._i18n['default']][ns] + && $._i18n.trans[$._i18n['default']][ns][str]) { + trans = $._i18n.trans[$._i18n['default']][ns][str]; + } + // return trans or original string + return trans || str; + }; + // Set language (accepted formats: en or en-US) + if (arguments.length < 2) { + $._i18n.language = arguments[0]; + return $._i18n.language; + } + else { + // get translation + if (typeof(arguments[1]) == 'string') { + var trans = getTrans(arguments[0], arguments[1]); + // has variables for string formating + if (arguments[2] && typeof(arguments[2]) == 'object') { + return $.format(trans, arguments[2]); + } + else { + return trans; + } + } + // set translation + else { + var tmp = arguments[0].split('.'); + var lang = tmp[0]; + var ns = tmp[1] || 'jQuery'; + if (!$._i18n.trans[lang]) { + $._i18n.trans[lang] = {}; + $._i18n.trans[lang][ns] = arguments[1]; + } + else { + $.extend($._i18n.trans[lang][ns], arguments[1]); + } + } + } + }; +})(jQuery); +/* + * Copyright (c) 2007-2008 Josh Bush (digitalbush.com) + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * Version: 1.1.3 + * Release: 2008-04-16 + */ +(function($) { + + //Helper Function for Caret positioning + $.fn.caret=function(begin,end){ + if(this.length==0) return; + if (typeof begin == 'number') { + end = (typeof end == 'number')?end:begin; + return this.each(function(){ + if(this.setSelectionRange){ + this.focus(); + this.setSelectionRange(begin,end); + }else if (this.createTextRange){ + var range = this.createTextRange(); + range.collapse(true); + range.moveEnd('character', end); + range.moveStart('character', begin); + range.select(); + } + }); + } else { + if (this[0].setSelectionRange){ + begin = this[0].selectionStart; + end = this[0].selectionEnd; + }else if (document.selection && document.selection.createRange){ + var range = document.selection.createRange(); + begin = 0 - range.duplicate().moveStart('character', -100000); + end = begin + range.text.length; + } + return {begin:begin,end:end}; + } + }; + + //Predefined character definitions + var charMap={ + '9':"[0-9]", + 'a':"[A-Za-z]", + '*':"[A-Za-z0-9]" + }; + + //Helper method to inject character definitions + $.mask={ + addPlaceholder : function(c,r){ + charMap[c]=r; + } + }; + + $.fn.unmask=function(){ + return this.trigger("unmask"); + }; + + //Main Method + $.fn.mask = function(mask,settings) { + settings = $.extend({ + placeholder: "_", + completed: null + }, settings); + + //Build Regex for format validation + var re = new RegExp("^"+ + $.map( mask.split(""), function(c,i){ + return charMap[c]||((/[A-Za-z0-9]/.test(c)?"":"\\")+c); + }).join('')+ + "$"); + + return this.each(function(){ + var input=$(this); + var buffer=new Array(mask.length); + var locked=new Array(mask.length); + var valid=false; + var ignore=false; //Variable for ignoring control keys + var firstNonMaskPos=null; + + //Build buffer layout from mask & determine the first non masked character + $.each( mask.split(""), function(i,c){ + locked[i]=(charMap[c]==null); + buffer[i]=locked[i]?c:settings.placeholder; + if(!locked[i] && firstNonMaskPos==null) + firstNonMaskPos=i; + }); + + function focusEvent(){ + checkVal(); + writeBuffer(); + setTimeout(function(){ + $(input[0]).caret(valid?mask.length:firstNonMaskPos); + },0); + }; + + function keydownEvent(e){ + var pos=$(this).caret(); + var k = e.keyCode; + ignore=(k < 16 || (k > 16 && k < 32 ) || (k > 32 && k < 41)); + + //delete selection before proceeding + if((pos.begin-pos.end)!=0 && (!ignore || k==8 || k==46)){ + clearBuffer(pos.begin,pos.end); + } + //backspace and delete get special treatment + if(k==8){//backspace + while(pos.begin-->=0){ + if(!locked[pos.begin]){ + buffer[pos.begin]=settings.placeholder; + if($.browser.opera){ + //Opera won't let you cancel the backspace, so we'll let it backspace over a dummy character. + s=writeBuffer(); + input.val(s.substring(0,pos.begin)+" "+s.substring(pos.begin)); + $(this).caret(pos.begin+1); + }else{ + writeBuffer(); + $(this).caret(Math.max(firstNonMaskPos,pos.begin)); + } + return false; + } + } + }else if(k==46){//delete + clearBuffer(pos.begin,pos.begin+1); + writeBuffer(); + $(this).caret(Math.max(firstNonMaskPos,pos.begin)); + return false; + }else if (k==27){//escape + clearBuffer(0,mask.length); + writeBuffer(); + $(this).caret(firstNonMaskPos); + return false; + } + }; + + function keypressEvent(e){ + if(ignore){ + ignore=false; + //Fixes Mac FF bug on backspace + return (e.keyCode == 8)? false: null; + } + e=e||window.event; + var k=e.charCode||e.keyCode||e.which; + var pos=$(this).caret(); + + if(e.ctrlKey || e.altKey){//Ignore + return true; + }else if ((k>=41 && k<=122) ||k==32 || k>186){//typeable characters + var p=seekNext(pos.begin-1); + if(p + MIT-style license. +*/ + +(function($) { + + // Global variables, accessible to Slimbox only + var win = $(window), options, images, activeImage = -1, activeURL, prevImage, nextImage, compatibleOverlay, middle, centerWidth, centerHeight, ie6 = !window.XMLHttpRequest, + operaFix = window.opera && (document.compatMode == "CSS1Compat") && ($.browser.version >= 9.3), documentElement = document.documentElement, + + // Preload images + preload = {}, preloadPrev = new Image(), preloadNext = new Image(), + + // DOM elements + overlay, center, image, sizer, prevLink, nextLink, bottomContainer, bottom, caption, number; + + /* + Initialization + */ + + $(function() { + // Append the Slimbox HTML code at the bottom of the document + $("body").append( + $([ + overlay = $('
')[0], + center = $('
')[0], + bottomContainer = $('
')[0] + ]).css("display", "none") + ); + + image = $('
').appendTo(center).append( + sizer = $('
').append([ + prevLink = $('').click(previous)[0], + nextLink = $('').click(next)[0] + ])[0] + )[0]; + + bottom = $('
').appendTo(bottomContainer).append([ + $('').add(overlay).click(close)[0], + caption = $('
')[0], + number = $('
')[0], + $('
')[0] + ])[0]; + }); + + + /* + API + */ + + // Open Slimbox with the specified parameters + $.slimbox = function(_images, startImage, _options) { + options = $.extend({ + loop: false, // Allows to navigate between first and last images + overlayOpacity: 0.8, // 1 is opaque, 0 is completely transparent (change the color in the CSS file) + overlayFadeDuration: 400, // Duration of the overlay fade-in and fade-out animations (in milliseconds) + resizeDuration: 400, // Duration of each of the box resize animations (in milliseconds) + resizeEasing: "swing", // "swing" is jQuery's default easing + initialWidth: 250, // Initial width of the box (in pixels) + initialHeight: 250, // Initial height of the box (in pixels) + imageFadeDuration: 400, // Duration of the image fade-in animation (in milliseconds) + captionAnimationDuration: 400, // Duration of the caption animation (in milliseconds) + counterText: "Image {x} of {y}", // Translate or change as you wish, or set it to false to disable counter text for image groups + closeKeys: [27, 88, 67], // Array of keycodes to close Slimbox, default: Esc (27), 'x' (88), 'c' (67) + previousKeys: [37, 80], // Array of keycodes to navigate to the previous image, default: Left arrow (37), 'p' (80) + nextKeys: [39, 78] // Array of keycodes to navigate to the next image, default: Right arrow (39), 'n' (78) + }, _options); + + // The function is called for a single image, with URL and Title as first two arguments + if (typeof _images == "string") { + _images = [[_images, startImage]]; + startImage = 0; + } + + middle = win.scrollTop() + ((operaFix ? documentElement.clientHeight : win.height()) / 2); + centerWidth = options.initialWidth; + centerHeight = options.initialHeight; + $(center).css({top: Math.max(0, middle - (centerHeight / 2)), width: centerWidth, height: centerHeight, marginLeft: -centerWidth/2}).show(); + compatibleOverlay = ie6 || (overlay.currentStyle && (overlay.currentStyle.position != "fixed")); + if (compatibleOverlay) overlay.style.position = "absolute"; + $(overlay).css("opacity", options.overlayOpacity).fadeIn(options.overlayFadeDuration); + position(); + setup(1); + + images = _images; + options.loop = options.loop && (images.length > 1); + return changeImage(startImage); + }; + + /* + options: Optional options object, see jQuery.slimbox() + linkMapper: Optional function taking a link DOM element and an index as arguments and returning an array containing 2 elements: + the image URL and the image caption (may contain HTML) + linksFilter: Optional function taking a link DOM element and an index as arguments and returning true if the element is part of + the image collection that will be shown on click, false if not. "this" refers to the element that was clicked. + This function must always return true when the DOM element argument is "this". + */ + $.fn.slimbox = function(_options, linkMapper, linksFilter) { + linkMapper = linkMapper || function(el) { + return [el.href, el.title]; + }; + + linksFilter = linksFilter || function() { + return true; + }; + + var links = this; + + return links.unbind("click").click(function() { + // Build the list of images that will be displayed + var link = this, startIndex = 0, filteredLinks, i = 0, length; + filteredLinks = $.grep(links, function(el, i) { + return linksFilter.call(link, el, i); + }); + + // We cannot use jQuery.map() because it flattens the returned array + for (length = filteredLinks.length; i < length; ++i) { + if (filteredLinks[i] == link) startIndex = i; + filteredLinks[i] = linkMapper(filteredLinks[i], i); + } + + return $.slimbox(filteredLinks, startIndex, _options); + }); + }; + + + /* + Internal functions + */ + + function position() { + var l = win.scrollLeft(), w = operaFix ? documentElement.clientWidth : win.width(); + $([center, bottomContainer]).css("left", l + (w / 2)); + if (compatibleOverlay) $(overlay).css({left: l, top: win.scrollTop(), width: w, height: win.height()}); + } + + function setup(open) { + $("object").add(ie6 ? "select" : "embed").each(function(index, el) { + if (open) $.data(el, "slimbox", el.style.visibility); + el.style.visibility = open ? "hidden" : $.data(el, "slimbox"); + }); + var fn = open ? "bind" : "unbind"; + win[fn]("scroll resize", position); + $(document)[fn]("keydown", keyDown); + } + + function keyDown(event) { + var code = event.keyCode, fn = $.inArray; + // Prevent default keyboard action (like navigating inside the page) + return (fn(code, options.closeKeys) >= 0) ? close() + : (fn(code, options.nextKeys) >= 0) ? next() + : (fn(code, options.previousKeys) >= 0) ? previous() + : false; + } + + function previous() { + return changeImage(prevImage); + } + + function next() { + return changeImage(nextImage); + } + + function changeImage(imageIndex) { + if (imageIndex >= 0) { + activeImage = imageIndex; + activeURL = images[activeImage][0]; + prevImage = (activeImage || (options.loop ? images.length : 0)) - 1; + nextImage = ((activeImage + 1) % images.length) || (options.loop ? 0 : -1); + + stop(); + center.className = "lbLoading"; + + preload = new Image(); + preload.onload = animateBox; + preload.src = activeURL; + } + + return false; + } + + function animateBox() { + center.className = ""; + $(image).css({backgroundImage: "url(" + activeURL + ")", visibility: "hidden", display: ""}); + $(sizer).width(preload.width); + $([sizer, prevLink, nextLink]).height(preload.height); + + $(caption).html(images[activeImage][1] || ""); + $(number).html((((images.length > 1) && options.counterText) || "").replace(/{x}/, activeImage + 1).replace(/{y}/, images.length)); + + if (prevImage >= 0) preloadPrev.src = images[prevImage][0]; + if (nextImage >= 0) preloadNext.src = images[nextImage][0]; + + centerWidth = image.offsetWidth; + centerHeight = image.offsetHeight; + var top = Math.max(0, middle - (centerHeight / 2)); + if (center.offsetHeight != centerHeight) { + $(center).animate({height: centerHeight, top: top}, options.resizeDuration, options.resizeEasing); + } + if (center.offsetWidth != centerWidth) { + $(center).animate({width: centerWidth, marginLeft: -centerWidth/2}, options.resizeDuration, options.resizeEasing); + } + $(center).queue(function() { + $(bottomContainer).css({width: centerWidth, top: top + centerHeight, marginLeft: -centerWidth/2, visibility: "hidden", display: ""}); + $(image).css({display: "none", visibility: "", opacity: ""}).fadeIn(options.imageFadeDuration, animateCaption); + }); + } + + + function animateCaption() { + if (prevImage >= 0) $(prevLink).show(); + if (nextImage >= 0) $(nextLink).show(); + $(bottom).css("marginTop", -bottom.offsetHeight).animate({marginTop: 0}, options.captionAnimationDuration); + bottomContainer.style.visibility = ""; + } + + function stop() { + preload.onload = null; + preload.src = preloadPrev.src = preloadNext.src = activeURL; + $([center, image, bottom]).stop(true); + $([prevLink, nextLink, image, bottomContainer]).hide(); + } + + function close() { + if (activeImage >= 0) { + stop(); + activeImage = prevImage = nextImage = -1; + $(center).hide(); + $(overlay).stop().fadeOut(options.overlayFadeDuration, setup); + } + + return false; + } + +})(jQuery); +/* + * timeago: a jQuery plugin, version: 0.5.1 (08/20/2008) + * @requires jQuery v1.2 or later + * + * Timeago is a jQuery plugin that makes it easy to support automatically + * updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago"). + * + * For usage and examples, visit: + * http://timeago.yarp.com/ + * + * Licensed under the MIT: + * http://www.opensource.org/licenses/mit-license.php + * + * Copyright (c) 2008, Ryan McGeary (ryanonjavascript -[at]- mcgeary [*dot*] org) + */ +(function($) { + $.timeago = function(timestamp) { + if (timestamp instanceof Date) return inWords(timestamp); + else if (typeof timestamp == "string") return inWords($.timeago.parse(timestamp)); + else return inWords($.timeago.parse($(timestamp).attr("title"))); + }; + var $t = $.timeago; + + $.extend($.timeago, { + settings: { + refreshMillis: 60000, + allowFuture: false, + strings: { + ago: "ago", + fromNow: "from now", + seconds: "less than a minute", + minute: "about a minute", + minutes: "%d minutes", + hour: "about an hour", + hours: "about %d hours", + day: "a day", + days: "%d days", + month: "about a month", + months: "%d months", + year: "about a year", + years: "%d years" + } + }, + inWords: function(distanceMillis) { + var $l = this.settings.strings; + var suffix = $l.ago; + if (this.settings.allowFuture) { + if (distanceMillis < 0) suffix = $l.fromNow; + distanceMillis = Math.abs(distanceMillis); + } + + var seconds = distanceMillis / 1000; + var minutes = seconds / 60; + var hours = minutes / 60; + var days = hours / 24; + var years = days / 365; + + var words = seconds < 45 && sprintf($l.seconds, Math.round(seconds)) || + seconds < 90 && $l.minute || + minutes < 45 && sprintf($l.minutes, Math.round(minutes)) || + minutes < 90 && $l.hour || + hours < 24 && sprintf($l.hours, Math.round(hours)) || + hours < 48 && $l.day || + days < 30 && sprintf($l.days, Math.floor(days)) || + days < 60 && $l.month || + days < 365 && sprintf($l.months, Math.floor(days / 30)) || + years < 2 && $l.year || + sprintf($l.years, Math.floor(years)); + + return words + " " + suffix; + }, + parse: function(iso8601) { + var s = $.trim(iso8601); + s = s.replace(/-/,"/").replace(/-/,"/"); + s = s.replace(/T/," ").replace(/Z/," UTC"); + s = s.replace(/([\+-]\d\d)\:?(\d\d)/," $1$2"); // -04:00 -> -0400 + return new Date(s); + } + }); + + $.fn.timeago = function() { + var self = this; + self.each(refresh); + + var $s = $t.settings; + if ($s.refreshMillis > 0) { + setInterval(function() { self.each(refresh); }, $s.refreshMillis); + } + return self; + }; + + function refresh() { + var date = $t.parse(this.title); + if (!isNaN(date)) { + $(this).text(inWords(date)); + } + return this; + } + + function inWords(date) { + return $t.inWords(distance(date)); + } + + function distance(date) { + return (new Date().getTime() - date.getTime()); + } + + // lame sprintf implementation + function sprintf(string, value) { + return string.replace(/%d/i, value); + } + + // fix for IE6 suckage + if ($.browser.msie && $.browser.version < 7.0) { + document.createElement('abbr'); + } +})(jQuery); + diff --git a/lib/jquery-utils/ui.timepickr.js b/lib/jquery-utils/ui.timepickr.js index ca0da3c1ca6..b9460e91219 100644 --- a/lib/jquery-utils/ui.timepickr.js +++ b/lib/jquery-utils/ui.timepickr.js @@ -1,387 +1,387 @@ -/* - jQuery ui.timepickr - @VERSION - http://code.google.com/p/jquery-utils/ - - (c) Maxime Haineault - http://haineault.com - - MIT License (http://www.opensource.org/licenses/mit-license.php - - Note: if you want the original experimental plugin checkout the rev 224 - - Dependencies - ------------ - - jquery.utils.js - - jquery.strings.js - - jquery.ui.js - -*/ - -(function($) { - - $.tpl('timepickr.menu', '
'); //todo: (heskew) make the corner an option just like the items - $.tpl('timepickr.row', '
    '); - $.tpl('timepickr.button', '
  1. {label:s}
  2. '); - - $.widget('ui.timepickr', { - options: { - convention: 12, // 24, 12 - trigger: 'focus', - format12: '{h:02.d}:{m:02.d} {z}', - format24: '{h:02.d}:{m:02.d}', - hours: true, - prefix: ['AM', 'PM'], - suffix: ['AM', 'PM'], - prefixVal: false, - suffixVal: true, - rangeHour12: $.range(1, 13), - rangeHour24: [$.range(0, 12), $.range(12, 24)], - rangeMin: $.range(0, 60, 15), - rangeSec: $.range(0, 60, 15), - corners: 'all', - // plugins - core: true, - minutes: true, - seconds: false, - val: false, - updateLive: true, - resetOnBlur: true, - keyboardnav: true, - handle: false, - handleEvent: 'click' - }, - - plugins: {}, - - _create: function() { - this._dom = { - menu: $.tpl('timepickr.menu'), - row: $.tpl('timepickr.menu') - }; - this._trigger('start'); - this._trigger('initialized'); - }, - - _trigger: function(type, e, ui) { - var ui = ui || this; - $.ui.plugin.call(this, type, [e, ui]); - return $.Widget.prototype._trigger.call(this, type, e, ui); - }, - - _createButton: function(i, format, className) { - var o = format && $.format(format, i) || i; - var cn = className && 'ui-timepickr-button ' + className || 'ui-timepickr-button'; - return $.tpl('timepickr.button', { className: cn, label: o }).data('id', i) - .bind('mouseover', function() { - $(this).siblings().find('span') - .removeClass('ui-state-hover').end().end() - .find('span').addClass('ui-state-hover'); - }); - - }, - - _addRow: function(range, format, className, insertAfter) { - var ui = this; - var btn = false; - var row = $.tpl('timepickr.row').bind('mouseover', function() { - $(this).next().slideDown(200); - }); - $.each(range, function(idx, val) { - ui._createButton(val, format || false).appendTo(row); - }); - if (className) { - $(row).addClass(className); - } - if (this.options.corners) { - row.find('span').addClass('ui-corner-' + this.options.corners); - } - if (insertAfter) { - row.insertAfter(insertAfter); - } - else { - ui._dom.menu.append(row); - } - return row; - }, - - _setVal: function(val) { - val = val || this._getVal(); - this.element.data('timepickr.initialValue', val); - this.element.val(this._formatVal(val)); - if (this._dom.menu.is(':hidden')) { - this.element.trigger('change'); - } - }, - - _getVal: function() { - var ols = this._dom.menu.find('ol'); - function get(unit) { - var u = ols.filter('.' + unit).find('.ui-state-hover:first').text(); - return u || ols.filter('.' + unit + 'li:first span').text(); - } - return { - h: get('hours'), - m: get('minutes'), - s: get('seconds'), - a: get('prefix'), - z: get('suffix'), - f: this.options['format' + this.c], - c: this.c - }; - }, - - _formatVal: function(ival) { - var val = ival || this._getVal(); - - if (!val.h) return; - - val.c = this.options.convention; - val.f = val.c === 12 && this.options.format12 || this.options.format24; - return (new Time(val)).getTime(); - }, - - blur: function() { - return this.element.blur(); - }, - - focus: function() { - return this.element.focus(); - }, - show: function() { - this._trigger('show'); - this._dom.menu.slideDown(200);; //todo: (heskew) make show effect an option - }, - hide: function() { - this._trigger('hide'); - this._dom.menu.slideUp(200); - } - - }); - - // These properties are shared accross every instances of timepickr - $.extend($.ui.timepickr, { - version: '@VERSION' - }); - - $.ui.plugin.add('timepickr', 'core', { - start: function(e, ui) { - var menu = ui._dom.menu; - var pos = ui.element.position(); - menu.insertAfter(ui.element).css('left', pos.left - 225); //todo: (heskew) right-align better and have alignment an option - - if (!$.boxModel) { // IE alignement fix - menu.css('margin-top', ui.element.height() + 8); - } - - ui.element - .bind(ui.options.trigger, function() { - ui._dom.menu.find('ol:first').show(); - ui._dom.menu.slideDown(200); - ui._trigger('focus'); - if (ui.options.trigger != 'focus') { - ui.element.focus(); - } - ui._trigger('focus'); - }) - .bind('blur', function() { - ui.hide(); - ui._trigger('blur'); - }); - - menu.find('li').bind('mouseover.timepickr', function() { - ui._trigger('refresh'); - }); - }, - refresh: function(e, ui) { - // Realign each menu layers - ui._dom.menu.find('ol').each(function() { - var p = $(this).prev('ol'); - try { // .. to not fuckup IE - $(this).css('left', p.position().left + p.find('.ui-state-hover').position().left); - } catch (e) { }; - }); - } - }); - - $.ui.plugin.add('timepickr', 'hours', { - start: function(e, ui) { - if (ui.options.convention === 24) { - // prefix is required in 24h mode - ui._dom.prefix = ui._addRow(ui.options.prefix, false, 'prefix'); - - // split-range - if ($.isArray(ui.options.rangeHour24[0])) { - var range = []; - $.merge(range, ui.options.rangeHour24[0]); - $.merge(range, ui.options.rangeHour24[1]); - ui._dom.hours = ui._addRow(range, '{0:0.2d}', 'hours'); - ui._dom.hours.find('li').slice(ui.options.rangeHour24[0].length, -1).hide(); - var lis = ui._dom.hours.find('li'); - - var show = [ - function() { - lis.slice(ui.options.rangeHour24[0].length).hide().end() - .slice(0, ui.options.rangeHour24[0].length).show() - .filter(':visible:first').trigger('mouseover'); - - }, - function() { - lis.slice(0, ui.options.rangeHour24[0].length).hide().end() - .slice(ui.options.rangeHour24[0].length).show() - .filter(':visible:first').trigger('mouseover'); - } - ]; - - ui._dom.prefix.find('li').bind('mouseover.timepickr', function() { - var index = ui._dom.menu.find('.prefix li').index(this); - show[index].call(); - }); - } - else { - ui._dom.hours = ui._addRow(ui.options.rangeHour24, '{0:0.2d}', 'hours'); - ui._dom.hours.find('li').slice(12, -1).hide(); - } - } - else { - ui._dom.hours = ui._addRow(ui.options.rangeHour12, '{0:0.2d}', 'hours'); - // suffix is required in 12h mode - ui._dom.suffix = ui._addRow(ui.options.suffix, false, 'suffix'); - } - } - }); - - $.ui.plugin.add('timepickr', 'minutes', { - start: function(e, ui) { - var p = ui._dom.hours && ui._dom.hours || false; - ui._dom.minutes = ui._addRow(ui.options.rangeMin, '{0:0.2d}', 'minutes', p); - } - }); - - $.ui.plugin.add('timepickr', 'seconds', { - start: function(e, ui) { - var p = ui._dom.minutes && ui._dom.minutes || false; - ui._dom.seconds = ui._addRow(ui.options.rangeSec, '{0:0.2d}', 'seconds', p); - } - }); - - $.ui.plugin.add('timepickr', 'val', { - start: function(e, ui) { - ui._setVal(ui.options.val); - } - }); - - $.ui.plugin.add('timepickr', 'updateLive', { - refresh: function(e, ui) { - ui._setVal(); - } - }); - - $.ui.plugin.add('timepickr', 'resetOnBlur', { - start: function(e, ui) { - ui.element.data('timepickr.initialValue', ui._getVal()); - ui._dom.menu.find('li > span').bind('mousedown.timepickr', function() { - ui.element.data('timepickr.initialValue', ui._getVal()); - }); - }, - blur: function(e, ui) { - ui._setVal(ui.element.data('timepickr.initialValue')); - } - }); - - $.ui.plugin.add('timepickr', 'handle', { - start: function(e, ui) { - $(ui.options.handle).bind(ui.options.handleEvent + '.timepickr', function() { - ui.show(); - }); - } - }); - - $.ui.plugin.add('timepickr', 'keyboardnav', { - start: function(e, ui) { - ui.element - .bind('keydown', function(e) { - if ($.keyIs('enter', e)) { - ui._setVal(); - ui.blur(); - } - else if ($.keyIs('escape', e)) { - ui.blur(); - } - }); - } - }); - - var Time = function() { // arguments: h, m, s, c, z, f || time string - if (!(this instanceof arguments.callee)) { - throw Error("Constructor called as a function"); - } - // arguments as literal object - if (arguments.length == 1 && $.isObject(arguments[0])) { - this.h = arguments[0].h || 0; - this.m = arguments[0].m || 0; - this.s = arguments[0].s || 0; - this.c = arguments[0].c && ($.inArray(arguments[0].c, [12, 24]) >= 0) && arguments[0].c || 24; - this.f = arguments[0].f || ((this.c == 12) && '{h:02.d}:{m:02.d} {z:02.d}' || '{h:02.d}:{m:02.d}'); - this.z = arguments[0].z || 'am'; - } - // arguments as string - else if (arguments.length < 4 && $.isString(arguments[1])) { - this.c = arguments[2] && ($.inArray(arguments[0], [12, 24]) >= 0) && arguments[0] || 24; - this.f = arguments[3] || ((this.c == 12) && '{h:02.d}:{m:02.d} {z:02.d}' || '{h:02.d}:{m:02.d}'); - this.z = arguments[4] || 'am'; - - this.h = arguments[1] || 0; // parse - this.m = arguments[1] || 0; // parse - this.s = arguments[1] || 0; // parse - } - // no arguments (now) - else if (arguments.length === 0) { - // now - } - // standards arguments - else { - this.h = arguments[0] || 0; - this.m = arguments[1] || 0; - this.s = arguments[2] || 0; - this.c = arguments[3] && ($.inArray(arguments[3], [12, 24]) >= 0) && arguments[3] || 24; - this.f = this.f || ((this.c == 12) && '{h:02.d}:{m:02.d} {z:02.d}' || '{h:02.d}:{m:02.d}'); - this.z = 'am'; - } - return this; - }; - - Time.prototype.get = function(p, f, u) { return u && this.h || $.format(f, this.h); }; - Time.prototype.getHours = function(unformated) { return this.get('h', '{0:02.d}', unformated); }; - Time.prototype.getMinutes = function(unformated) { return this.get('m', '{0:02.d}', unformated); }; - Time.prototype.getSeconds = function(unformated) { return this.get('s', '{0:02.d}', unformated); }; - Time.prototype.setFormat = function(format) { return this.f = format; }; - Time.prototype.getObject = function() { return { h: this.h, m: this.m, s: this.s, c: this.c, f: this.f, z: this.z }; }; - Time.prototype.getTime = function() { return $.format(this.f, { h: this.h, m: this.m, z: this.z }); }; - Time.prototype.parse = function(str) { - // 12h formats - if (this.c === 12) { - // Supported formats: (can't find any *official* standards for 12h..) - // - [hh]:[mm]:[ss] [zz] | [hh]:[mm] [zz] | [hh] [zz] - // - [hh]:[mm]:[ss] [z.z.] | [hh]:[mm] [z.z.] | [hh] [z.z.] - this.tokens = str.split(/\s|:/); - this.h = this.tokens[0] || 0; - this.m = this.tokens[1] || 0; - this.s = this.tokens[2] || 0; - this.z = this.tokens[3] || ''; - return this.getObject(); - } - // 24h formats - else { - // Supported formats: - // - ISO 8601: [hh][mm][ss] | [hh][mm] | [hh] - // - ISO 8601 extended: [hh]:[mm]:[ss] | [hh]:[mm] | [hh] - this.tokens = /:/.test(str) && str.split(/:/) || str.match(/[0-9]{2}/g); - this.h = this.tokens[0] || 0; - this.m = this.tokens[1] || 0; - this.s = this.tokens[2] || 0; - this.z = this.tokens[3] || ''; - return this.getObject(); - } - }; - -})(jQuery); +/* + jQuery ui.timepickr - @VERSION + http://code.google.com/p/jquery-utils/ + + (c) Maxime Haineault + http://haineault.com + + MIT License (http://www.opensource.org/licenses/mit-license.php + + Note: if you want the original experimental plugin checkout the rev 224 + + Dependencies + ------------ + - jquery.utils.js + - jquery.strings.js + - jquery.ui.js + +*/ + +(function($) { + + $.tpl('timepickr.menu', '
    '); //todo: (heskew) make the corner an option just like the items + $.tpl('timepickr.row', '
      '); + $.tpl('timepickr.button', '
    1. {label:s}
    2. '); + + $.widget('ui.timepickr', { + options: { + convention: 12, // 24, 12 + trigger: 'focus', + format12: '{h:02.d}:{m:02.d} {z}', + format24: '{h:02.d}:{m:02.d}', + hours: true, + prefix: ['AM', 'PM'], + suffix: ['AM', 'PM'], + prefixVal: false, + suffixVal: true, + rangeHour12: $.range(1, 13), + rangeHour24: [$.range(0, 12), $.range(12, 24)], + rangeMin: $.range(0, 60, 15), + rangeSec: $.range(0, 60, 15), + corners: 'all', + // plugins + core: true, + minutes: true, + seconds: false, + val: false, + updateLive: true, + resetOnBlur: true, + keyboardnav: true, + handle: false, + handleEvent: 'click' + }, + + plugins: {}, + + _create: function() { + this._dom = { + menu: $.tpl('timepickr.menu'), + row: $.tpl('timepickr.menu') + }; + this._trigger('start'); + this._trigger('initialized'); + }, + + _trigger: function(type, e, ui) { + var ui = ui || this; + $.ui.plugin.call(this, type, [e, ui]); + return $.Widget.prototype._trigger.call(this, type, e, ui); + }, + + _createButton: function(i, format, className) { + var o = format && $.format(format, i) || i; + var cn = className && 'ui-timepickr-button ' + className || 'ui-timepickr-button'; + return $.tpl('timepickr.button', { className: cn, label: o }).data('id', i) + .bind('mouseover', function() { + $(this).siblings().find('span') + .removeClass('ui-state-hover').end().end() + .find('span').addClass('ui-state-hover'); + }); + + }, + + _addRow: function(range, format, className, insertAfter) { + var ui = this; + var btn = false; + var row = $.tpl('timepickr.row').bind('mouseover', function() { + $(this).next().slideDown(200); + }); + $.each(range, function(idx, val) { + ui._createButton(val, format || false).appendTo(row); + }); + if (className) { + $(row).addClass(className); + } + if (this.options.corners) { + row.find('span').addClass('ui-corner-' + this.options.corners); + } + if (insertAfter) { + row.insertAfter(insertAfter); + } + else { + ui._dom.menu.append(row); + } + return row; + }, + + _setVal: function(val) { + val = val || this._getVal(); + this.element.data('timepickr.initialValue', val); + this.element.val(this._formatVal(val)); + if (this._dom.menu.is(':hidden')) { + this.element.trigger('change'); + } + }, + + _getVal: function() { + var ols = this._dom.menu.find('ol'); + function get(unit) { + var u = ols.filter('.' + unit).find('.ui-state-hover:first').text(); + return u || ols.filter('.' + unit + 'li:first span').text(); + } + return { + h: get('hours'), + m: get('minutes'), + s: get('seconds'), + a: get('prefix'), + z: get('suffix'), + f: this.options['format' + this.c], + c: this.c + }; + }, + + _formatVal: function(ival) { + var val = ival || this._getVal(); + + if (!val.h) return; + + val.c = this.options.convention; + val.f = val.c === 12 && this.options.format12 || this.options.format24; + return (new Time(val)).getTime(); + }, + + blur: function() { + return this.element.blur(); + }, + + focus: function() { + return this.element.focus(); + }, + show: function() { + this._trigger('show'); + this._dom.menu.slideDown(200);; //todo: (heskew) make show effect an option + }, + hide: function() { + this._trigger('hide'); + this._dom.menu.slideUp(200); + } + + }); + + // These properties are shared accross every instances of timepickr + $.extend($.ui.timepickr, { + version: '@VERSION' + }); + + $.ui.plugin.add('timepickr', 'core', { + start: function(e, ui) { + var menu = ui._dom.menu; + var pos = ui.element.position(); + menu.insertAfter(ui.element).css('left', pos.left - 225); //todo: (heskew) right-align better and have alignment an option + + if (!$.boxModel) { // IE alignement fix + menu.css('margin-top', ui.element.height() + 8); + } + + ui.element + .bind(ui.options.trigger, function() { + ui._dom.menu.find('ol:first').show(); + ui._dom.menu.slideDown(200); + ui._trigger('focus'); + if (ui.options.trigger != 'focus') { + ui.element.focus(); + } + ui._trigger('focus'); + }) + .bind('blur', function() { + ui.hide(); + ui._trigger('blur'); + }); + + menu.find('li').bind('mouseover.timepickr', function() { + ui._trigger('refresh'); + }); + }, + refresh: function(e, ui) { + // Realign each menu layers + ui._dom.menu.find('ol').each(function() { + var p = $(this).prev('ol'); + try { // .. to not fuckup IE + $(this).css('left', p.position().left + p.find('.ui-state-hover').position().left); + } catch (e) { }; + }); + } + }); + + $.ui.plugin.add('timepickr', 'hours', { + start: function(e, ui) { + if (ui.options.convention === 24) { + // prefix is required in 24h mode + ui._dom.prefix = ui._addRow(ui.options.prefix, false, 'prefix'); + + // split-range + if ($.isArray(ui.options.rangeHour24[0])) { + var range = []; + $.merge(range, ui.options.rangeHour24[0]); + $.merge(range, ui.options.rangeHour24[1]); + ui._dom.hours = ui._addRow(range, '{0:0.2d}', 'hours'); + ui._dom.hours.find('li').slice(ui.options.rangeHour24[0].length, -1).hide(); + var lis = ui._dom.hours.find('li'); + + var show = [ + function() { + lis.slice(ui.options.rangeHour24[0].length).hide().end() + .slice(0, ui.options.rangeHour24[0].length).show() + .filter(':visible:first').trigger('mouseover'); + + }, + function() { + lis.slice(0, ui.options.rangeHour24[0].length).hide().end() + .slice(ui.options.rangeHour24[0].length).show() + .filter(':visible:first').trigger('mouseover'); + } + ]; + + ui._dom.prefix.find('li').bind('mouseover.timepickr', function() { + var index = ui._dom.menu.find('.prefix li').index(this); + show[index].call(); + }); + } + else { + ui._dom.hours = ui._addRow(ui.options.rangeHour24, '{0:0.2d}', 'hours'); + ui._dom.hours.find('li').slice(12, -1).hide(); + } + } + else { + ui._dom.hours = ui._addRow(ui.options.rangeHour12, '{0:0.2d}', 'hours'); + // suffix is required in 12h mode + ui._dom.suffix = ui._addRow(ui.options.suffix, false, 'suffix'); + } + } + }); + + $.ui.plugin.add('timepickr', 'minutes', { + start: function(e, ui) { + var p = ui._dom.hours && ui._dom.hours || false; + ui._dom.minutes = ui._addRow(ui.options.rangeMin, '{0:0.2d}', 'minutes', p); + } + }); + + $.ui.plugin.add('timepickr', 'seconds', { + start: function(e, ui) { + var p = ui._dom.minutes && ui._dom.minutes || false; + ui._dom.seconds = ui._addRow(ui.options.rangeSec, '{0:0.2d}', 'seconds', p); + } + }); + + $.ui.plugin.add('timepickr', 'val', { + start: function(e, ui) { + ui._setVal(ui.options.val); + } + }); + + $.ui.plugin.add('timepickr', 'updateLive', { + refresh: function(e, ui) { + ui._setVal(); + } + }); + + $.ui.plugin.add('timepickr', 'resetOnBlur', { + start: function(e, ui) { + ui.element.data('timepickr.initialValue', ui._getVal()); + ui._dom.menu.find('li > span').bind('mousedown.timepickr', function() { + ui.element.data('timepickr.initialValue', ui._getVal()); + }); + }, + blur: function(e, ui) { + ui._setVal(ui.element.data('timepickr.initialValue')); + } + }); + + $.ui.plugin.add('timepickr', 'handle', { + start: function(e, ui) { + $(ui.options.handle).bind(ui.options.handleEvent + '.timepickr', function() { + ui.show(); + }); + } + }); + + $.ui.plugin.add('timepickr', 'keyboardnav', { + start: function(e, ui) { + ui.element + .bind('keydown', function(e) { + if ($.keyIs('enter', e)) { + ui._setVal(); + ui.blur(); + } + else if ($.keyIs('escape', e)) { + ui.blur(); + } + }); + } + }); + + var Time = function() { // arguments: h, m, s, c, z, f || time string + if (!(this instanceof arguments.callee)) { + throw Error("Constructor called as a function"); + } + // arguments as literal object + if (arguments.length == 1 && $.isObject(arguments[0])) { + this.h = arguments[0].h || 0; + this.m = arguments[0].m || 0; + this.s = arguments[0].s || 0; + this.c = arguments[0].c && ($.inArray(arguments[0].c, [12, 24]) >= 0) && arguments[0].c || 24; + this.f = arguments[0].f || ((this.c == 12) && '{h:02.d}:{m:02.d} {z:02.d}' || '{h:02.d}:{m:02.d}'); + this.z = arguments[0].z || 'am'; + } + // arguments as string + else if (arguments.length < 4 && $.isString(arguments[1])) { + this.c = arguments[2] && ($.inArray(arguments[0], [12, 24]) >= 0) && arguments[0] || 24; + this.f = arguments[3] || ((this.c == 12) && '{h:02.d}:{m:02.d} {z:02.d}' || '{h:02.d}:{m:02.d}'); + this.z = arguments[4] || 'am'; + + this.h = arguments[1] || 0; // parse + this.m = arguments[1] || 0; // parse + this.s = arguments[1] || 0; // parse + } + // no arguments (now) + else if (arguments.length === 0) { + // now + } + // standards arguments + else { + this.h = arguments[0] || 0; + this.m = arguments[1] || 0; + this.s = arguments[2] || 0; + this.c = arguments[3] && ($.inArray(arguments[3], [12, 24]) >= 0) && arguments[3] || 24; + this.f = this.f || ((this.c == 12) && '{h:02.d}:{m:02.d} {z:02.d}' || '{h:02.d}:{m:02.d}'); + this.z = 'am'; + } + return this; + }; + + Time.prototype.get = function(p, f, u) { return u && this.h || $.format(f, this.h); }; + Time.prototype.getHours = function(unformated) { return this.get('h', '{0:02.d}', unformated); }; + Time.prototype.getMinutes = function(unformated) { return this.get('m', '{0:02.d}', unformated); }; + Time.prototype.getSeconds = function(unformated) { return this.get('s', '{0:02.d}', unformated); }; + Time.prototype.setFormat = function(format) { return this.f = format; }; + Time.prototype.getObject = function() { return { h: this.h, m: this.m, s: this.s, c: this.c, f: this.f, z: this.z }; }; + Time.prototype.getTime = function() { return $.format(this.f, { h: this.h, m: this.m, z: this.z }); }; + Time.prototype.parse = function(str) { + // 12h formats + if (this.c === 12) { + // Supported formats: (can't find any *official* standards for 12h..) + // - [hh]:[mm]:[ss] [zz] | [hh]:[mm] [zz] | [hh] [zz] + // - [hh]:[mm]:[ss] [z.z.] | [hh]:[mm] [z.z.] | [hh] [z.z.] + this.tokens = str.split(/\s|:/); + this.h = this.tokens[0] || 0; + this.m = this.tokens[1] || 0; + this.s = this.tokens[2] || 0; + this.z = this.tokens[3] || ''; + return this.getObject(); + } + // 24h formats + else { + // Supported formats: + // - ISO 8601: [hh][mm][ss] | [hh][mm] | [hh] + // - ISO 8601 extended: [hh]:[mm]:[ss] | [hh]:[mm] | [hh] + this.tokens = /:/.test(str) && str.split(/:/) || str.match(/[0-9]{2}/g); + this.h = this.tokens[0] || 0; + this.m = this.tokens[1] || 0; + this.s = this.tokens[2] || 0; + this.z = this.tokens[3] || ''; + return this.getObject(); + } + }; + +})(jQuery); diff --git a/lib/log4net/log4net.xml b/lib/log4net/log4net.xml index 2584cd897d1..55a19f255f2 100644 --- a/lib/log4net/log4net.xml +++ b/lib/log4net/log4net.xml @@ -1,31814 +1,31814 @@ - - - - log4net - - - - - Appender that logs to a database. - - - - appends logging events to a table within a - database. The appender can be configured to specify the connection - string by setting the property. - The connection type (provider) can be specified by setting the - property. For more information on database connection strings for - your specific database see
      http://www.connectionstrings.com/. - - - Records are written into the database either using a prepared - statement or a stored procedure. The property - is set to (System.Data.CommandType.Text) to specify a prepared statement - or to (System.Data.CommandType.StoredProcedure) to specify a stored - procedure. - - - The prepared statement text or the name of the stored procedure - must be set in the property. - - - The prepared statement or stored procedure can take a number - of parameters. Parameters are added using the - method. This adds a single to the - ordered list of parameters. The - type may be subclassed if required to provide database specific - functionality. The specifies - the parameter name, database type, size, and how the value should - be generated using a . - - - - An example of a SQL Server table that could be logged to: - - CREATE TABLE [dbo].[Log] ( - [ID] [int] IDENTITY (1, 1) NOT NULL , - [Date] [datetime] NOT NULL , - [Thread] [varchar] (255) NOT NULL , - [Level] [varchar] (20) NOT NULL , - [Logger] [varchar] (255) NOT NULL , - [Message] [varchar] (4000) NOT NULL - ) ON [PRIMARY] - - - - An example configuration to log to the above table: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Julian Biddle - Nicko Cadell - Gert Driesen - Lance Nehring - - - - Abstract base class implementation of that - buffers events in a fixed size buffer. - - - - This base class should be used by appenders that need to buffer a - number of events before logging them. For example the - buffers events and then submits the entire contents of the buffer to - the underlying database in one go. - - - Subclasses should override the - method to deliver the buffered events. - - The BufferingAppenderSkeleton maintains a fixed size cyclic - buffer of events. The size of the buffer is set using - the property. - - A is used to inspect - each event as it arrives in the appender. If the - triggers, then the current buffer is sent immediately - (see ). Otherwise the event - is stored in the buffer. For example, an evaluator can be used to - deliver the events immediately when an ERROR event arrives. - - - The buffering appender can be configured in a mode. - By default the appender is NOT lossy. When the buffer is full all - the buffered events are sent with . - If the property is set to true then the - buffer will not be sent when it is full, and new events arriving - in the appender will overwrite the oldest event in the buffer. - In lossy mode the buffer will only be sent when the - triggers. This can be useful behavior when you need to know about - ERROR events but not about events with a lower level, configure an - evaluator that will trigger when an ERROR event arrives, the whole - buffer will be sent which gives a history of events leading up to - the ERROR event. - - - Nicko Cadell - Gert Driesen - - - - Abstract base class implementation of . - - - - This class provides the code for common functionality, such - as support for threshold filtering and support for general filters. - - - Appenders can also implement the interface. Therefore - they would require that the method - be called after the appenders properties have been configured. - - - Nicko Cadell - Gert Driesen - - - - Implement this interface for your own strategies for printing log statements. - - - - Implementors should consider extending the - class which provides a default implementation of this interface. - - - Appenders can also implement the interface. Therefore - they would require that the method - be called after the appenders properties have been configured. - - - Nicko Cadell - Gert Driesen - - - - Closes the appender and releases resources. - - - - Releases any resources allocated within the appender such as file handles, - network connections, etc. - - - It is a programming error to append to a closed appender. - - - - - - Log the logging event in Appender specific way. - - The event to log - - - This method is called to log a message into this appender. - - - - - - Gets or sets the name of this appender. - - The name of the appender. - - The name uniquely identifies the appender. - - - - - Interface for appenders that support bulk logging. - - - - This interface extends the interface to - support bulk logging of objects. Appenders - should only implement this interface if they can bulk log efficiently. - - - Nicko Cadell - - - - Log the array of logging events in Appender specific way. - - The events to log - - - This method is called to log an array of events into this appender. - - - - - - Interface used to delay activate a configured object. - - - - This allows an object to defer activation of its options until all - options have been set. This is required for components which have - related options that remain ambiguous until all are set. - - - If a component implements this interface then the method - must be called by the container after its all the configured properties have been set - and before the component can be used. - - - Nicko Cadell - - - - Activate the options that were previously set with calls to properties. - - - - This allows an object to defer activation of its options until all - options have been set. This is required for components which have - related options that remain ambiguous until all are set. - - - If a component implements this interface then this method must be called - after its properties have been set before the component can be used. - - - - - - Initial buffer size - - - - - Maximum buffer size before it is recycled - - - - - Default constructor - - - Empty default constructor - - - - - Finalizes this appender by calling the implementation's - method. - - - - If this appender has not been closed then the Finalize method - will call . - - - - - - Initialize the appender based on the options set - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - - - - Closes the appender and release resources. - - - - Release any resources allocated within the appender such as file handles, - network connections, etc. - - - It is a programming error to append to a closed appender. - - - This method cannot be overridden by subclasses. This method - delegates the closing of the appender to the - method which must be overridden in the subclass. - - - - - - Performs threshold checks and invokes filters before - delegating actual logging to the subclasses specific - method. - - The event to log. - - - This method cannot be overridden by derived classes. A - derived class should override the method - which is called by this method. - - - The implementation of this method is as follows: - - - - - - Checks that the severity of the - is greater than or equal to the of this - appender. - - - - Checks that the chain accepts the - . - - - - - Calls and checks that - it returns true. - - - - - If all of the above steps succeed then the - will be passed to the abstract method. - - - - - - Performs threshold checks and invokes filters before - delegating actual logging to the subclasses specific - method. - - The array of events to log. - - - This method cannot be overridden by derived classes. A - derived class should override the method - which is called by this method. - - - The implementation of this method is as follows: - - - - - - Checks that the severity of the - is greater than or equal to the of this - appender. - - - - Checks that the chain accepts the - . - - - - - Calls and checks that - it returns true. - - - - - If all of the above steps succeed then the - will be passed to the method. - - - - - - Test if the logging event should we output by this appender - - the event to test - true if the event should be output, false if the event should be ignored - - - This method checks the logging event against the threshold level set - on this appender and also against the filters specified on this - appender. - - - The implementation of this method is as follows: - - - - - - Checks that the severity of the - is greater than or equal to the of this - appender. - - - - Checks that the chain accepts the - . - - - - - - - - - Adds a filter to the end of the filter chain. - - the filter to add to this appender - - - The Filters are organized in a linked list. - - - Setting this property causes the new filter to be pushed onto the - back of the filter chain. - - - - - - Clears the filter list for this appender. - - - - Clears the filter list for this appender. - - - - - - Checks if the message level is below this appender's threshold. - - to test against. - - - If there is no threshold set, then the return value is always true. - - - - true if the meets the - requirements of this appender. - - - - - Is called when the appender is closed. Derived classes should override - this method if resources need to be released. - - - - Releases any resources allocated within the appender such as file handles, - network connections, etc. - - - It is a programming error to append to a closed appender. - - - - - - Subclasses of should implement this method - to perform actual logging. - - The event to append. - - - A subclass must implement this method to perform - logging of the . - - This method will be called by - if all the conditions listed for that method are met. - - - To restrict the logging of events in the appender - override the method. - - - - - - Append a bulk array of logging events. - - the array of logging events - - - This base class implementation calls the - method for each element in the bulk array. - - - A sub class that can better process a bulk array of events should - override this method in addition to . - - - - - - Called before as a precondition. - - - - This method is called by - before the call to the abstract method. - - - This method can be overridden in a subclass to extend the checks - made before the event is passed to the method. - - - A subclass should ensure that they delegate this call to - this base class if it is overridden. - - - true if the call to should proceed. - - - - Renders the to a string. - - The event to render. - The event rendered as a string. - - - Helper method to render a to - a string. This appender must have a - set to render the to - a string. - - If there is exception data in the logging event and - the layout does not process the exception, this method - will append the exception text to the rendered string. - - - Where possible use the alternative version of this method - . - That method streams the rendering onto an existing Writer - which can give better performance if the caller already has - a open and ready for writing. - - - - - - Renders the to a string. - - The event to render. - The TextWriter to write the formatted event to - - - Helper method to render a to - a string. This appender must have a - set to render the to - a string. - - If there is exception data in the logging event and - the layout does not process the exception, this method - will append the exception text to the rendered string. - - - Use this method in preference to - where possible. If, however, the caller needs to render the event - to a string then does - provide an efficient mechanism for doing so. - - - - - - The layout of this appender. - - - See for more information. - - - - - The name of this appender. - - - See for more information. - - - - - The level threshold of this appender. - - - - There is no level threshold filtering by default. - - - See for more information. - - - - - - It is assumed and enforced that errorHandler is never null. - - - - It is assumed and enforced that errorHandler is never null. - - - See for more information. - - - - - - The first filter in the filter chain. - - - - Set to null initially. - - - See for more information. - - - - - - The last filter in the filter chain. - - - See for more information. - - - - - Flag indicating if this appender is closed. - - - See for more information. - - - - - The guard prevents an appender from repeatedly calling its own DoAppend method - - - - - StringWriter used to render events - - - - - The fully qualified type of the AppenderSkeleton class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Gets or sets the threshold of this appender. - - - The threshold of the appender. - - - - All log events with lower level than the threshold level are ignored - by the appender. - - - In configuration files this option is specified by setting the - value of the option to a level - string, such as "DEBUG", "INFO" and so on. - - - - - - Gets or sets the for this appender. - - The of the appender - - - The provides a default - implementation for the property. - - - - - - The filter chain. - - The head of the filter chain filter chain. - - - Returns the head Filter. The Filters are organized in a linked list - and so all Filters on this Appender are available through the result. - - - - - - Gets or sets the for this appender. - - The layout of the appender. - - - See for more information. - - - - - - - Gets or sets the name of this appender. - - The name of the appender. - - - The name uniquely identifies the appender. - - - - - - Tests if this appender requires a to be set. - - - - In the rather exceptional case, where the appender - implementation admits a layout but can also work without it, - then the appender should return true. - - - This default implementation always returns false. - - - - true if the appender requires a layout object, otherwise false. - - - - - The default buffer size. - - - The default size of the cyclic buffer used to store events. - This is set to 512 by default. - - - - - Initializes a new instance of the class. - - - - Protected default constructor to allow subclassing. - - - - - - Initializes a new instance of the class. - - the events passed through this appender must be - fixed by the time that they arrive in the derived class' SendBuffer method. - - - Protected constructor to allow subclassing. - - - The should be set if the subclass - expects the events delivered to be fixed even if the - is set to zero, i.e. when no buffering occurs. - - - - - - Flush the currently buffered events - - - - Flushes any events that have been buffered. - - - If the appender is buffering in mode then the contents - of the buffer will NOT be flushed to the appender. - - - - - - Flush the currently buffered events - - set to true to flush the buffer of lossy events - - - Flushes events that have been buffered. If is - false then events will only be flushed if this buffer is non-lossy mode. - - - If the appender is buffering in mode then the contents - of the buffer will only be flushed if is true. - In this case the contents of the buffer will be tested against the - and if triggering will be output. All other buffered - events will be discarded. - - - If is true then the buffer will always - be emptied by calling this method. - - - - - - Initialize the appender based on the options set - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - - - - Close this appender instance. - - - - Close this appender instance. If this appender is marked - as not then the remaining events in - the buffer must be sent when the appender is closed. - - - - - - This method is called by the method. - - the event to log - - - Stores the in the cyclic buffer. - - - The buffer will be sent (i.e. passed to the - method) if one of the following conditions is met: - - - - The cyclic buffer is full and this appender is - marked as not lossy (see ) - - - An is set and - it is triggered for the - specified. - - - - Before the event is stored in the buffer it is fixed - (see ) to ensure that - any data referenced by the event will be valid when the buffer - is processed. - - - - - - Sends the contents of the buffer. - - The first logging event. - The buffer containing the events that need to be send. - - - The subclass must override . - - - - - - Sends the events. - - The events that need to be send. - - - The subclass must override this method to process the buffered events. - - - - - - The size of the cyclic buffer used to hold the logging events. - - - Set to by default. - - - - - The cyclic buffer used to store the logging events. - - - - - The triggering event evaluator that causes the buffer to be sent immediately. - - - The object that is used to determine if an event causes the entire - buffer to be sent immediately. This field can be null, which - indicates that event triggering is not to be done. The evaluator - can be set using the property. If this appender - has the ( property) set to - true then an must be set. - - - - - Indicates if the appender should overwrite events in the cyclic buffer - when it becomes full, or if the buffer should be flushed when the - buffer is full. - - - If this field is set to true then an must - be set. - - - - - The triggering event evaluator filters discarded events. - - - The object that is used to determine if an event that is discarded should - really be discarded or if it should be sent to the appenders. - This field can be null, which indicates that all discarded events will - be discarded. - - - - - Value indicating which fields in the event should be fixed - - - By default all fields are fixed - - - - - The events delivered to the subclass must be fixed. - - - - - Gets or sets a value that indicates whether the appender is lossy. - - - true if the appender is lossy, otherwise false. The default is false. - - - - This appender uses a buffer to store logging events before - delivering them. A triggering event causes the whole buffer - to be send to the remote sink. If the buffer overruns before - a triggering event then logging events could be lost. Set - to false to prevent logging events - from being lost. - - If is set to true then an - must be specified. - - - - - Gets or sets the size of the cyclic buffer used to hold the - logging events. - - - The size of the cyclic buffer used to hold the logging events. - - - - The option takes a positive integer - representing the maximum number of logging events to collect in - a cyclic buffer. When the is reached, - oldest events are deleted as new events are added to the - buffer. By default the size of the cyclic buffer is 512 events. - - - If the is set to a value less than - or equal to 1 then no buffering will occur. The logging event - will be delivered synchronously (depending on the - and properties). Otherwise the event will - be buffered. - - - - - - Gets or sets the that causes the - buffer to be sent immediately. - - - The that causes the buffer to be - sent immediately. - - - - The evaluator will be called for each event that is appended to this - appender. If the evaluator triggers then the current buffer will - immediately be sent (see ). - - If is set to true then an - must be specified. - - - - - Gets or sets the value of the to use. - - - The value of the to use. - - - - The evaluator will be called for each event that is discarded from this - appender. If the evaluator triggers then the current buffer will immediately - be sent (see ). - - - - - - Gets or sets a value indicating if only part of the logging event data - should be fixed. - - - true if the appender should only fix part of the logging event - data, otherwise false. The default is false. - - - - Setting this property to true will cause only part of the - event data to be fixed and serialized. This will improve performance. - - - See for more information. - - - - - - Gets or sets a the fields that will be fixed in the event - - - The event fields that will be fixed before the event is buffered - - - - The logging event needs to have certain thread specific values - captured before it can be buffered. See - for details. - - - - - - - Initializes a new instance of the class. - - - Public default constructor to initialize a new instance of this class. - - - - - Initialize the appender based on the options set - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - - - - Override the parent method to close the database - - - - Closes the database command and database connection. - - - - - - Inserts the events into the database. - - The events to insert into the database. - - - Insert all the events specified in the - array into the database. - - - - - - Adds a parameter to the command. - - The parameter to add to the command. - - - Adds a parameter to the ordered list of command parameters. - - - - - - Writes the events to the database using the transaction specified. - - The transaction that the events will be executed under. - The array of events to insert into the database. - - - The transaction argument can be null if the appender has been - configured not to use transactions. See - property for more information. - - - - - - Formats the log message into database statement text. - - The event being logged. - - This method can be overridden by subclasses to provide - more control over the format of the database statement. - - - Text that can be passed to a . - - - - - Creates an instance used to connect to the database. - - - This method is called whenever a new IDbConnection is needed (i.e. when a reconnect is necessary). - - The of the object. - The connectionString output from the ResolveConnectionString method. - An instance with a valid connection string. - - - - Resolves the connection string from the ConnectionString, ConnectionStringName, or AppSettingsKey - property. - - - ConnectiongStringName is only supported on .NET 2.0 and higher. - - Additional information describing the connection string. - A connection string used to connect to the database. - - - - Retrieves the class type of the ADO.NET provider. - - - - Gets the Type of the ADO.NET provider to use to connect to the - database. This method resolves the type specified in the - property. - - - Subclasses can override this method to return a different type - if necessary. - - - The of the ADO.NET provider - - - - Prepares the database command and initialize the parameters. - - - - - Connects to the database. - - - - - Cleanup the existing command. - - - If true, a message will be written using LogLog.Warn if an exception is encountered when calling Dispose. - - - - - Cleanup the existing connection. - - - Calls the IDbConnection's method. - - - - - Flag to indicate if we are using a command object - - - - Set to true when the appender is to use a prepared - statement or stored procedure to insert into the database. - - - - - - The list of objects. - - - - The list of objects. - - - - - - The security context to use for privileged calls - - - - - The that will be used - to insert logging events into a database. - - - - - The database command. - - - - - Database connection string. - - - - - The appSettings key from App.Config that contains the connection string. - - - - - The connectionStrings key from App.Config that contains the connection string. - - - - - String type name of the type name. - - - - - The text of the command. - - - - - The command type. - - - - - Indicates whether to use transactions when writing to the database. - - - - - Indicates whether to use transactions when writing to the database. - - - - - The fully qualified type of the AdoNetAppender class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Gets or sets the database connection string that is used to connect to - the database. - - - The database connection string used to connect to the database. - - - - The connections string is specific to the connection type. - See for more information. - - - Connection string for MS Access via ODBC: - "DSN=MS Access Database;UID=admin;PWD=;SystemDB=C:\data\System.mdw;SafeTransactions = 0;FIL=MS Access;DriverID = 25;DBQ=C:\data\train33.mdb" - - Another connection string for MS Access via ODBC: - "Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\Work\cvs_root\log4net-1.2\access.mdb;UID=;PWD=;" - - Connection string for MS Access via OLE DB: - "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Work\cvs_root\log4net-1.2\access.mdb;User Id=;Password=;" - - - - - The appSettings key from App.Config that contains the connection string. - - - - - The connectionStrings key from App.Config that contains the connection string. - - - This property requires at least .NET 2.0. - - - - - Gets or sets the type name of the connection - that should be created. - - - The type name of the connection. - - - - The type name of the ADO.NET provider to use. - - - The default is to use the OLE DB provider. - - - Use the OLE DB Provider. This is the default value. - System.Data.OleDb.OleDbConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Use the MS SQL Server Provider. - System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Use the ODBC Provider. - Microsoft.Data.Odbc.OdbcConnection,Microsoft.Data.Odbc,version=1.0.3300.0,publicKeyToken=b77a5c561934e089,culture=neutral - This is an optional package that you can download from - http://msdn.microsoft.com/downloads - search for ODBC .NET Data Provider. - - Use the Oracle Provider. - System.Data.OracleClient.OracleConnection, System.Data.OracleClient, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - This is an optional package that you can download from - http://msdn.microsoft.com/downloads - search for .NET Managed Provider for Oracle. - - - - - Gets or sets the command text that is used to insert logging events - into the database. - - - The command text used to insert logging events into the database. - - - - Either the text of the prepared statement or the - name of the stored procedure to execute to write into - the database. - - - The property determines if - this text is a prepared statement or a stored procedure. - - - - - - Gets or sets the command type to execute. - - - The command type to execute. - - - - This value may be either (System.Data.CommandType.Text) to specify - that the is a prepared statement to execute, - or (System.Data.CommandType.StoredProcedure) to specify that the - property is the name of a stored procedure - to execute. - - - The default value is (System.Data.CommandType.Text). - - - - - - Should transactions be used to insert logging events in the database. - - - true if transactions should be used to insert logging events in - the database, otherwise false. The default value is true. - - - - Gets or sets a value that indicates whether transactions should be used - to insert logging events in the database. - - - When set a single transaction will be used to insert the buffered events - into the database. Otherwise each event will be inserted without using - an explicit transaction. - - - - - - Gets or sets the used to call the NetSend method. - - - The used to call the NetSend method. - - - - Unless a specified here for this appender - the is queried for the - security context to use. The default behavior is to use the security context - of the current thread. - - - - - - Should this appender try to reconnect to the database on error. - - - true if the appender should try to reconnect to the database after an - error has occurred, otherwise false. The default value is false, - i.e. not to try to reconnect. - - - - The default behaviour is for the appender not to try to reconnect to the - database if an error occurs. Subsequent logging events are discarded. - - - To force the appender to attempt to reconnect to the database set this - property to true. - - - When the appender attempts to connect to the database there may be a - delay of up to the connection timeout specified in the connection string. - This delay will block the calling application's thread. - Until the connection can be reestablished this potential delay may occur multiple times. - - - - - - Gets or sets the underlying . - - - The underlying . - - - creates a to insert - logging events into a database. Classes deriving from - can use this property to get or set this . Use the - underlying returned from if - you require access beyond that which provides. - - - - - Parameter type used by the . - - - - This class provides the basic database parameter properties - as defined by the interface. - - This type can be subclassed to provide database specific - functionality. The two methods that are called externally are - and . - - - - - - Initializes a new instance of the class. - - - Default constructor for the AdoNetAppenderParameter class. - - - - - Prepare the specified database command object. - - The command to prepare. - - - Prepares the database command object by adding - this parameter to its collection of parameters. - - - - - - Renders the logging event and set the parameter value in the command. - - The command containing the parameter. - The event to be rendered. - - - Renders the logging event using this parameters layout - object. Sets the value of the parameter on the command object. - - - - - - The name of this parameter. - - - - - The database type for this parameter. - - - - - Flag to infer type rather than use the DbType - - - - - The precision for this parameter. - - - - - The scale for this parameter. - - - - - The size for this parameter. - - - - - The to use to render the - logging event into an object for this parameter. - - - - - Gets or sets the name of this parameter. - - - The name of this parameter. - - - - The name of this parameter. The parameter name - must match up to a named parameter to the SQL stored procedure - or prepared statement. - - - - - - Gets or sets the database type for this parameter. - - - The database type for this parameter. - - - - The database type for this parameter. This property should - be set to the database type from the - enumeration. See . - - - This property is optional. If not specified the ADO.NET provider - will attempt to infer the type from the value. - - - - - - - Gets or sets the precision for this parameter. - - - The precision for this parameter. - - - - The maximum number of digits used to represent the Value. - - - This property is optional. If not specified the ADO.NET provider - will attempt to infer the precision from the value. - - - - - - - Gets or sets the scale for this parameter. - - - The scale for this parameter. - - - - The number of decimal places to which Value is resolved. - - - This property is optional. If not specified the ADO.NET provider - will attempt to infer the scale from the value. - - - - - - - Gets or sets the size for this parameter. - - - The size for this parameter. - - - - The maximum size, in bytes, of the data within the column. - - - This property is optional. If not specified the ADO.NET provider - will attempt to infer the size from the value. - - - For BLOB data types like VARCHAR(max) it may be impossible to infer the value automatically, use -1 as the size in this case. - - - - - - - Gets or sets the to use to - render the logging event into an object for this - parameter. - - - The used to render the - logging event into an object for this parameter. - - - - The that renders the value for this - parameter. - - - The can be used to adapt - any into a - for use in the property. - - - - - - Appends logging events to the terminal using ANSI color escape sequences. - - - - AnsiColorTerminalAppender appends log events to the standard output stream - or the error output stream using a layout specified by the - user. It also allows the color of a specific level of message to be set. - - - This appender expects the terminal to understand the VT100 control set - in order to interpret the color codes. If the terminal or console does not - understand the control codes the behavior is not defined. - - - By default, all output is written to the console's standard output stream. - The property can be set to direct the output to the - error stream. - - - NOTE: This appender writes each message to the System.Console.Out or - System.Console.Error that is set at the time the event is appended. - Therefore it is possible to programmatically redirect the output of this appender - (for example NUnit does this to capture program output). While this is the desired - behavior of this appender it may have security implications in your application. - - - When configuring the ANSI colored terminal appender, a mapping should be - specified to map a logging level to a color. For example: - - - - - - - - - - - - - - - The Level is the standard log4net logging level and ForeColor and BackColor can be any - of the following values: - - Blue - Green - Red - White - Yellow - Purple - Cyan - - These color values cannot be combined together to make new colors. - - - The attributes can be any combination of the following: - - Brightforeground is brighter - Dimforeground is dimmer - Underscoremessage is underlined - Blinkforeground is blinking (does not work on all terminals) - Reverseforeground and background are reversed - Hiddenoutput is hidden - Strikethroughmessage has a line through it - - While any of these attributes may be combined together not all combinations - work well together, for example setting both Bright and Dim attributes makes - no sense. - - - Patrick Wagstrom - Nicko Cadell - - - - The to use when writing to the Console - standard output stream. - - - - The to use when writing to the Console - standard output stream. - - - - - - The to use when writing to the Console - standard error output stream. - - - - The to use when writing to the Console - standard error output stream. - - - - - - Ansi code to reset terminal - - - - - Initializes a new instance of the class. - - - The instance of the class is set up to write - to the standard output stream. - - - - - Add a mapping of level to color - - The mapping to add - - - Add a mapping to this appender. - Each mapping defines the foreground and background colours - for a level. - - - - - - This method is called by the method. - - The event to log. - - - Writes the event to the console. - - - The format of the output will depend on the appender's layout. - - - - - - Initialize the options for this appender - - - - Initialize the level to color mappings set on this appender. - - - - - - Flag to write output to the error stream rather than the standard output stream - - - - - Mapping from level object to color value - - - - - Target is the value of the console output stream. - - - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". - - - - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". - - - - - - This appender requires a to be set. - - true - - - This appender requires a to be set. - - - - - - The enum of possible display attributes - - - - The following flags can be combined together to - form the ANSI color attributes. - - - - - - - text is bright - - - - - text is dim - - - - - text is underlined - - - - - text is blinking - - - Not all terminals support this attribute - - - - - text and background colors are reversed - - - - - text is hidden - - - - - text is displayed with a strikethrough - - - - - text color is light - - - - - The enum of possible foreground or background color values for - use with the color mapping method - - - - The output can be in one for the following ANSI colors. - - - - - - - color is black - - - - - color is red - - - - - color is green - - - - - color is yellow - - - - - color is blue - - - - - color is magenta - - - - - color is cyan - - - - - color is white - - - - - A class to act as a mapping between the level that a logging call is made at and - the color it should be displayed as. - - - - Defines the mapping between a level and the color it should be displayed in. - - - - - - An entry in the - - - - This is an abstract base class for types that are stored in the - object. - - - Nicko Cadell - - - - Default protected constructor - - - - Default protected constructor - - - - - - Initialize any options defined on this entry - - - - Should be overridden by any classes that need to initialise based on their options - - - - - - The level that is the key for this mapping - - - The that is the key for this mapping - - - - Get or set the that is the key for this - mapping subclass. - - - - - - Initialize the options for the object - - - - Combine the and together - and append the attributes. - - - - - - The mapped foreground color for the specified level - - - - Required property. - The mapped foreground color for the specified level - - - - - - The mapped background color for the specified level - - - - Required property. - The mapped background color for the specified level - - - - - - The color attributes for the specified level - - - - Required property. - The color attributes for the specified level - - - - - - The combined , and - suitable for setting the ansi terminal color. - - - - - A strongly-typed collection of objects. - - Nicko Cadell - - - - Creates a read-only wrapper for a AppenderCollection instance. - - list to create a readonly wrapper arround - - An AppenderCollection wrapper that is read-only. - - - - - An empty readonly static AppenderCollection - - - - - Initializes a new instance of the AppenderCollection class - that is empty and has the default initial capacity. - - - - - Initializes a new instance of the AppenderCollection class - that has the specified initial capacity. - - - The number of elements that the new AppenderCollection is initially capable of storing. - - - - - Initializes a new instance of the AppenderCollection class - that contains elements copied from the specified AppenderCollection. - - The AppenderCollection whose elements are copied to the new collection. - - - - Initializes a new instance of the AppenderCollection class - that contains elements copied from the specified array. - - The array whose elements are copied to the new list. - - - - Initializes a new instance of the AppenderCollection class - that contains elements copied from the specified collection. - - The collection whose elements are copied to the new list. - - - - Allow subclasses to avoid our default constructors - - - - - - - Copies the entire AppenderCollection to a one-dimensional - array. - - The one-dimensional array to copy to. - - - - Copies the entire AppenderCollection to a one-dimensional - array, starting at the specified index of the target array. - - The one-dimensional array to copy to. - The zero-based index in at which copying begins. - - - - Adds a to the end of the AppenderCollection. - - The to be added to the end of the AppenderCollection. - The index at which the value has been added. - - - - Removes all elements from the AppenderCollection. - - - - - Creates a shallow copy of the . - - A new with a shallow copy of the collection data. - - - - Determines whether a given is in the AppenderCollection. - - The to check for. - true if is found in the AppenderCollection; otherwise, false. - - - - Returns the zero-based index of the first occurrence of a - in the AppenderCollection. - - The to locate in the AppenderCollection. - - The zero-based index of the first occurrence of - in the entire AppenderCollection, if found; otherwise, -1. - - - - - Inserts an element into the AppenderCollection at the specified index. - - The zero-based index at which should be inserted. - The to insert. - - is less than zero - -or- - is equal to or greater than . - - - - - Removes the first occurrence of a specific from the AppenderCollection. - - The to remove from the AppenderCollection. - - The specified was not found in the AppenderCollection. - - - - - Removes the element at the specified index of the AppenderCollection. - - The zero-based index of the element to remove. - - is less than zero - -or- - is equal to or greater than . - - - - - Returns an enumerator that can iterate through the AppenderCollection. - - An for the entire AppenderCollection. - - - - Adds the elements of another AppenderCollection to the current AppenderCollection. - - The AppenderCollection whose elements should be added to the end of the current AppenderCollection. - The new of the AppenderCollection. - - - - Adds the elements of a array to the current AppenderCollection. - - The array whose elements should be added to the end of the AppenderCollection. - The new of the AppenderCollection. - - - - Adds the elements of a collection to the current AppenderCollection. - - The collection whose elements should be added to the end of the AppenderCollection. - The new of the AppenderCollection. - - - - Sets the capacity to the actual number of elements. - - - - - Return the collection elements as an array - - the array - - - - is less than zero - -or- - is equal to or greater than . - - - - - is less than zero - -or- - is equal to or greater than . - - - - - Gets the number of elements actually contained in the AppenderCollection. - - - - - Gets a value indicating whether access to the collection is synchronized (thread-safe). - - true if access to the ICollection is synchronized (thread-safe); otherwise, false. - - - - Gets an object that can be used to synchronize access to the collection. - - - - - Gets or sets the at the specified index. - - The zero-based index of the element to get or set. - - is less than zero - -or- - is equal to or greater than . - - - - - Gets a value indicating whether the collection has a fixed size. - - true if the collection has a fixed size; otherwise, false. The default is false - - - - Gets a value indicating whether the IList is read-only. - - true if the collection is read-only; otherwise, false. The default is false - - - - Gets or sets the number of elements the AppenderCollection can contain. - - - - - Supports type-safe iteration over a . - - - - - - Advances the enumerator to the next element in the collection. - - - true if the enumerator was successfully advanced to the next element; - false if the enumerator has passed the end of the collection. - - - The collection was modified after the enumerator was created. - - - - - Sets the enumerator to its initial position, before the first element in the collection. - - - - - Gets the current element in the collection. - - - - - Type visible only to our subclasses - Used to access protected constructor - - - - - - A value - - - - - Supports simple iteration over a . - - - - - - Initializes a new instance of the Enumerator class. - - - - - - Advances the enumerator to the next element in the collection. - - - true if the enumerator was successfully advanced to the next element; - false if the enumerator has passed the end of the collection. - - - The collection was modified after the enumerator was created. - - - - - Sets the enumerator to its initial position, before the first element in the collection. - - - - - Gets the current element in the collection. - - - - - - - - - Appends log events to the ASP.NET system. - - - - - Diagnostic information and tracing messages that you specify are appended to the output - of the page that is sent to the requesting browser. Optionally, you can view this information - from a separate trace viewer (Trace.axd) that displays trace information for every page in a - given application. - - - Trace statements are processed and displayed only when tracing is enabled. You can control - whether tracing is displayed to a page, to the trace viewer, or both. - - - The logging event is passed to the or - method depending on the level of the logging event. - The event's logger name is the default value for the category parameter of the Write/Warn method. - - - Nicko Cadell - Gert Driesen - Ron Grabowski - - - - Initializes a new instance of the class. - - - - Default constructor. - - - - - - Write the logging event to the ASP.NET trace - - the event to log - - - Write the logging event to the ASP.NET trace - HttpContext.Current.Trace - (). - - - - - - Defaults to %logger - - - - - This appender requires a to be set. - - true - - - This appender requires a to be set. - - - - - - The category parameter sent to the Trace method. - - - - Defaults to %logger which will use the logger name of the current - as the category parameter. - - - - - - - - Buffers events and then forwards them to attached appenders. - - - - The events are buffered in this appender until conditions are - met to allow the appender to deliver the events to the attached - appenders. See for the - conditions that cause the buffer to be sent. - - The forwarding appender can be used to specify different - thresholds and filters for the same appender at different locations - within the hierarchy. - - - Nicko Cadell - Gert Driesen - - - - Interface for attaching appenders to objects. - - - - Interface for attaching, removing and retrieving appenders. - - - Nicko Cadell - Gert Driesen - - - - Attaches an appender. - - The appender to add. - - - Add the specified appender. The implementation may - choose to allow or deny duplicate appenders. - - - - - - Gets an attached appender with the specified name. - - The name of the appender to get. - - The appender with the name specified, or null if no appender with the - specified name is found. - - - - Returns an attached appender with the specified. - If no appender with the specified name is found null will be - returned. - - - - - - Removes all attached appenders. - - - - Removes and closes all attached appenders - - - - - - Removes the specified appender from the list of attached appenders. - - The appender to remove. - The appender removed from the list - - - The appender removed is not closed. - If you are discarding the appender you must call - on the appender removed. - - - - - - Removes the appender with the specified name from the list of appenders. - - The name of the appender to remove. - The appender removed from the list - - - The appender removed is not closed. - If you are discarding the appender you must call - on the appender removed. - - - - - - Gets all attached appenders. - - - A collection of attached appenders. - - - - Gets a collection of attached appenders. - If there are no attached appenders the - implementation should return an empty - collection rather than null. - - - - - - Initializes a new instance of the class. - - - - Default constructor. - - - - - - Closes the appender and releases resources. - - - - Releases any resources allocated within the appender such as file handles, - network connections, etc. - - - It is a programming error to append to a closed appender. - - - - - - Send the events. - - The events that need to be send. - - - Forwards the events to the attached appenders. - - - - - - Adds an to the list of appenders of this - instance. - - The to add to this appender. - - - If the specified is already in the list of - appenders, then it won't be added again. - - - - - - Looks for the appender with the specified name. - - The name of the appender to lookup. - - The appender with the specified name, or null. - - - - Get the named appender attached to this buffering appender. - - - - - - Removes all previously added appenders from this appender. - - - - This is useful when re-reading configuration information. - - - - - - Removes the specified appender from the list of appenders. - - The appender to remove. - The appender removed from the list - - The appender removed is not closed. - If you are discarding the appender you must call - on the appender removed. - - - - - Removes the appender with the specified name from the list of appenders. - - The name of the appender to remove. - The appender removed from the list - - The appender removed is not closed. - If you are discarding the appender you must call - on the appender removed. - - - - - Implementation of the interface - - - - - Gets the appenders contained in this appender as an - . - - - If no appenders can be found, then an - is returned. - - - A collection of the appenders in this appender. - - - - - Appends logging events to the console. - - - - ColoredConsoleAppender appends log events to the standard output stream - or the error output stream using a layout specified by the - user. It also allows the color of a specific type of message to be set. - - - By default, all output is written to the console's standard output stream. - The property can be set to direct the output to the - error stream. - - - NOTE: This appender writes directly to the application's attached console - not to the System.Console.Out or System.Console.Error TextWriter. - The System.Console.Out and System.Console.Error streams can be - programmatically redirected (for example NUnit does this to capture program output). - This appender will ignore these redirections because it needs to use Win32 - API calls to colorize the output. To respect these redirections the - must be used. - - - When configuring the colored console appender, mapping should be - specified to map a logging level to a color. For example: - - - - - - - - - - - - - - The Level is the standard log4net logging level and ForeColor and BackColor can be any - combination of the following values: - - Blue - Green - Red - White - Yellow - Purple - Cyan - HighIntensity - - - - Rick Hobbs - Nicko Cadell - - - - The to use when writing to the Console - standard output stream. - - - - The to use when writing to the Console - standard output stream. - - - - - - The to use when writing to the Console - standard error output stream. - - - - The to use when writing to the Console - standard error output stream. - - - - - - Initializes a new instance of the class. - - - The instance of the class is set up to write - to the standard output stream. - - - - - Initializes a new instance of the class - with the specified layout. - - the layout to use for this appender - - The instance of the class is set up to write - to the standard output stream. - - - - - Initializes a new instance of the class - with the specified layout. - - the layout to use for this appender - flag set to true to write to the console error stream - - When is set to true, output is written to - the standard error output stream. Otherwise, output is written to the standard - output stream. - - - - - Add a mapping of level to color - done by the config file - - The mapping to add - - - Add a mapping to this appender. - Each mapping defines the foreground and background colors - for a level. - - - - - - This method is called by the method. - - The event to log. - - - Writes the event to the console. - - - The format of the output will depend on the appender's layout. - - - - - - Initialize the options for this appender - - - - Initialize the level to color mappings set on this appender. - - - - - - Flag to write output to the error stream rather than the standard output stream - - - - - Mapping from level object to color value - - - - - The console output stream writer to write to - - - - This writer is not thread safe. - - - - - - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". - - - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". - - - - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". - - - - - - This appender requires a to be set. - - true - - - This appender requires a to be set. - - - - - - The enum of possible color values for use with the color mapping method - - - - The following flags can be combined together to - form the colors. - - - - - - - color is blue - - - - - color is green - - - - - color is red - - - - - color is white - - - - - color is yellow - - - - - color is purple - - - - - color is cyan - - - - - color is intensified - - - - - A class to act as a mapping between the level that a logging call is made at and - the color it should be displayed as. - - - - Defines the mapping between a level and the color it should be displayed in. - - - - - - Initialize the options for the object - - - - Combine the and together. - - - - - - The mapped foreground color for the specified level - - - - Required property. - The mapped foreground color for the specified level. - - - - - - The mapped background color for the specified level - - - - Required property. - The mapped background color for the specified level. - - - - - - The combined and suitable for - setting the console color. - - - - - Appends logging events to the console. - - - - ConsoleAppender appends log events to the standard output stream - or the error output stream using a layout specified by the - user. - - - By default, all output is written to the console's standard output stream. - The property can be set to direct the output to the - error stream. - - - NOTE: This appender writes each message to the System.Console.Out or - System.Console.Error that is set at the time the event is appended. - Therefore it is possible to programmatically redirect the output of this appender - (for example NUnit does this to capture program output). While this is the desired - behavior of this appender it may have security implications in your application. - - - Nicko Cadell - Gert Driesen - - - - The to use when writing to the Console - standard output stream. - - - - The to use when writing to the Console - standard output stream. - - - - - - The to use when writing to the Console - standard error output stream. - - - - The to use when writing to the Console - standard error output stream. - - - - - - Initializes a new instance of the class. - - - The instance of the class is set up to write - to the standard output stream. - - - - - Initializes a new instance of the class - with the specified layout. - - the layout to use for this appender - - The instance of the class is set up to write - to the standard output stream. - - - - - Initializes a new instance of the class - with the specified layout. - - the layout to use for this appender - flag set to true to write to the console error stream - - When is set to true, output is written to - the standard error output stream. Otherwise, output is written to the standard - output stream. - - - - - This method is called by the method. - - The event to log. - - - Writes the event to the console. - - - The format of the output will depend on the appender's layout. - - - - - - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". - - - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". - - - - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". - - - - - - This appender requires a to be set. - - true - - - This appender requires a to be set. - - - - - - Appends log events to the system. - - - - The application configuration file can be used to control what listeners - are actually used. See the MSDN documentation for the - class for details on configuring the - debug system. - - - Events are written using the - method. The event's logger name is passed as the value for the category name to the Write method. - - - Nicko Cadell - - - - Initializes a new instance of the . - - - - Default constructor. - - - - - - Initializes a new instance of the - with a specified layout. - - The layout to use with this appender. - - - Obsolete constructor. - - - - - - Writes the logging event to the system. - - The event to log. - - - Writes the logging event to the system. - If is true then the - is called. - - - - - - Immediate flush means that the underlying writer or output stream - will be flushed at the end of each append operation. - - - - Immediate flush is slower but ensures that each append request is - actually written. If is set to - false, then there is a good chance that the last few - logs events are not actually written to persistent media if and - when the application crashes. - - - The default value is true. - - - - - Gets or sets a value that indicates whether the appender will - flush at the end of each write. - - - The default behavior is to flush at the end of each - write. If the option is set tofalse, then the underlying - stream can defer writing to physical medium to a later time. - - - Avoiding the flush operation at the end of each append results - in a performance gain of 10 to 20 percent. However, there is safety - trade-off involved in skipping flushing. Indeed, when flushing is - skipped, then it is likely that the last few log events will not - be recorded on disk when the application exits. This is a high - price to pay even for a 20% performance gain. - - - - - - This appender requires a to be set. - - true - - - This appender requires a to be set. - - - - - - Writes events to the system event log. - - - - The appender will fail if you try to write using an event source that doesn't exist unless it is running with local administrator privileges. - See also http://logging.apache.org/log4net/release/faq.html#trouble-EventLog - - - The EventID of the event log entry can be - set using the EventID property () - on the . - - - The Category of the event log entry can be - set using the Category property () - on the . - - - There is a limit of 32K characters for an event log message - - - When configuring the EventLogAppender a mapping can be - specified to map a logging level to an event log entry type. For example: - - - <mapping> - <level value="ERROR" /> - <eventLogEntryType value="Error" /> - </mapping> - <mapping> - <level value="DEBUG" /> - <eventLogEntryType value="Information" /> - </mapping> - - - The Level is the standard log4net logging level and eventLogEntryType can be any value - from the enum, i.e.: - - Erroran error event - Warninga warning event - Informationan informational event - - - - Aspi Havewala - Douglas de la Torre - Nicko Cadell - Gert Driesen - Thomas Voss - - - - Initializes a new instance of the class. - - - - Default constructor. - - - - - - Initializes a new instance of the class - with the specified . - - The to use with this appender. - - - Obsolete constructor. - - - - - - Add a mapping of level to - done by the config file - - The mapping to add - - - Add a mapping to this appender. - Each mapping defines the event log entry type for a level. - - - - - - Initialize the appender based on the options set - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - - - - Create an event log source - - - Uses different API calls under NET_2_0 - - - - - This method is called by the - method. - - the event to log - - Writes the event to the system event log using the - . - - If the event has an EventID property (see ) - set then this integer will be used as the event log event id. - - - There is a limit of 32K characters for an event log message - - - - - - Get the equivalent for a - - the Level to convert to an EventLogEntryType - The equivalent for a - - Because there are fewer applicable - values to use in logging levels than there are in the - this is a one way mapping. There is - a loss of information during the conversion. - - - - - The log name is the section in the event logs where the messages - are stored. - - - - - Name of the application to use when logging. This appears in the - application column of the event log named by . - - - - - The name of the machine which holds the event log. This is - currently only allowed to be '.' i.e. the current machine. - - - - - Mapping from level object to EventLogEntryType - - - - - The security context to use for privileged calls - - - - - The event ID to use unless one is explicitly specified via the LoggingEvent's properties. - - - - - The event category to use unless one is explicitly specified via the LoggingEvent's properties. - - - - - The fully qualified type of the EventLogAppender class. - - - Used by the internal logger to record the Type of the - log message. - - - - - The maximum size supported by default. - - - http://msdn.microsoft.com/en-us/library/xzwc042w(v=vs.100).aspx - The 32766 documented max size is two bytes shy of 32K (I'm assuming 32766 - may leave space for a two byte null terminator of #0#0). The 32766 max - length is what the .NET 4.0 source code checks for, but this is WRONG! - Strings with a length > 31839 on Windows Vista or higher can CORRUPT - the event log! See: System.Diagnostics.EventLogInternal.InternalWriteEvent() - for the use of the 32766 max size. - - - - - The maximum size supported by a windows operating system that is vista - or newer. - - - See ReportEvent API: - http://msdn.microsoft.com/en-us/library/aa363679(VS.85).aspx - ReportEvent's lpStrings parameter: - "A pointer to a buffer containing an array of - null-terminated strings that are merged into the message before Event Viewer - displays the string to the user. This parameter must be a valid pointer - (or NULL), even if wNumStrings is zero. Each string is limited to 31,839 characters." - - Going beyond the size of 31839 will (at some point) corrupt the event log on Windows - Vista or higher! It may succeed for a while...but you will eventually run into the - error: "System.ComponentModel.Win32Exception : A device attached to the system is - not functioning", and the event log will then be corrupt (I was able to corrupt - an event log using a length of 31877 on Windows 7). - - The max size for Windows Vista or higher is documented here: - http://msdn.microsoft.com/en-us/library/xzwc042w(v=vs.100).aspx. - Going over this size may succeed a few times but the buffer will overrun and - eventually corrupt the log (based on testing). - - The maxEventMsgSize size is based on the max buffer size of the lpStrings parameter of the ReportEvent API. - The documented max size for EventLog.WriteEntry for Windows Vista and higher is 31839, but I'm leaving room for a - terminator of #0#0, as we cannot see the source of ReportEvent (though we could use an API monitor to examine the - buffer, given enough time). - - - - - The maximum size that the operating system supports for - a event log message. - - - Used to determine the maximum string length that can be written - to the operating system event log and eventually truncate a string - that exceeds the limits. - - - - - This method determines the maximum event log message size allowed for - the current environment. - - - - - - The name of the log where messages will be stored. - - - The string name of the log where messages will be stored. - - - This is the name of the log as it appears in the Event Viewer - tree. The default value is to log into the Application - log, this is where most applications write their events. However - if you need a separate log for your application (or applications) - then you should set the appropriately. - This should not be used to distinguish your event log messages - from those of other applications, the - property should be used to distinguish events. This property should be - used to group together events into a single log. - - - - - - Property used to set the Application name. This appears in the - event logs when logging. - - - The string used to distinguish events from different sources. - - - Sets the event log source property. - - - - - This property is used to return the name of the computer to use - when accessing the event logs. Currently, this is the current - computer, denoted by a dot "." - - - The string name of the machine holding the event log that - will be logged into. - - - This property cannot be changed. It is currently set to '.' - i.e. the local machine. This may be changed in future. - - - - - Gets or sets the used to write to the EventLog. - - - The used to write to the EventLog. - - - - The system security context used to write to the EventLog. - - - Unless a specified here for this appender - the is queried for the - security context to use. The default behavior is to use the security context - of the current thread. - - - - - - Gets or sets the EventId to use unless one is explicitly specified via the LoggingEvent's properties. - - - - The EventID of the event log entry will normally be - set using the EventID property () - on the . - This property provides the fallback value which defaults to 0. - - - - - - Gets or sets the Category to use unless one is explicitly specified via the LoggingEvent's properties. - - - - The Category of the event log entry will normally be - set using the Category property () - on the . - This property provides the fallback value which defaults to 0. - - - - - - This appender requires a to be set. - - true - - - This appender requires a to be set. - - - - - - A class to act as a mapping between the level that a logging call is made at and - the color it should be displayed as. - - - - Defines the mapping between a level and its event log entry type. - - - - - - The for this entry - - - - Required property. - The for this entry - - - - - - Appends logging events to a file. - - - - Logging events are sent to the file specified by - the property. - - - The file can be opened in either append or overwrite mode - by specifying the property. - If the file path is relative it is taken as relative from - the application base directory. The file encoding can be - specified by setting the property. - - - The layout's and - values will be written each time the file is opened and closed - respectively. If the property is - then the file may contain multiple copies of the header and footer. - - - This appender will first try to open the file for writing when - is called. This will typically be during configuration. - If the file cannot be opened for writing the appender will attempt - to open the file again each time a message is logged to the appender. - If the file cannot be opened for writing when a message is logged then - the message will be discarded by this appender. - - - The supports pluggable file locking models via - the property. - The default behavior, implemented by - is to obtain an exclusive write lock on the file until this appender is closed. - The alternative models only hold a - write lock while the appender is writing a logging event () - or synchronize by using a named system wide Mutex (). - - - All locking strategies have issues and you should seriously consider using a different strategy that - avoids having multiple processes logging to the same file. - - - Nicko Cadell - Gert Driesen - Rodrigo B. de Oliveira - Douglas de la Torre - Niall Daley - - - - Sends logging events to a . - - - - An Appender that writes to a . - - - This appender may be used stand alone if initialized with an appropriate - writer, however it is typically used as a base class for an appender that - can open a to write to. - - - Nicko Cadell - Gert Driesen - Douglas de la Torre - - - - Initializes a new instance of the class. - - - - Default constructor. - - - - - - Initializes a new instance of the class and - sets the output destination to a new initialized - with the specified . - - The layout to use with this appender. - The to output to. - - - Obsolete constructor. - - - - - - Initializes a new instance of the class and sets - the output destination to the specified . - - The layout to use with this appender - The to output to - - The must have been previously opened. - - - - Obsolete constructor. - - - - - - This method determines if there is a sense in attempting to append. - - - - This method checks if an output target has been set and if a - layout has been set. - - - false if any of the preconditions fail. - - - - This method is called by the - method. - - The event to log. - - - Writes a log statement to the output stream if the output stream exists - and is writable. - - - The format of the output will depend on the appender's layout. - - - - - - This method is called by the - method. - - The array of events to log. - - - This method writes all the bulk logged events to the output writer - before flushing the stream. - - - - - - Close this appender instance. The underlying stream or writer is also closed. - - - Closed appenders cannot be reused. - - - - - Writes the footer and closes the underlying . - - - - Writes the footer and closes the underlying . - - - - - - Closes the underlying . - - - - Closes the underlying . - - - - - - Clears internal references to the underlying - and other variables. - - - - Subclasses can override this method for an alternate closing behavior. - - - - - - Writes a footer as produced by the embedded layout's property. - - - - Writes a footer as produced by the embedded layout's property. - - - - - - Writes a header produced by the embedded layout's property. - - - - Writes a header produced by the embedded layout's property. - - - - - - Called to allow a subclass to lazily initialize the writer - - - - This method is called when an event is logged and the or - have not been set. This allows a subclass to - attempt to initialize the writer multiple times. - - - - - - This is the where logging events - will be written to. - - - - - Immediate flush means that the underlying - or output stream will be flushed at the end of each append operation. - - - - Immediate flush is slower but ensures that each append request is - actually written. If is set to - false, then there is a good chance that the last few - logging events are not actually persisted if and when the application - crashes. - - - The default value is true. - - - - - - The fully qualified type of the TextWriterAppender class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Gets or set whether the appender will flush at the end - of each append operation. - - - - The default behavior is to flush at the end of each - append operation. - - - If this option is set to false, then the underlying - stream can defer persisting the logging event to a later - time. - - - - Avoiding the flush operation at the end of each append results in - a performance gain of 10 to 20 percent. However, there is safety - trade-off involved in skipping flushing. Indeed, when flushing is - skipped, then it is likely that the last few log events will not - be recorded on disk when the application exits. This is a high - price to pay even for a 20% performance gain. - - - - - Sets the where the log output will go. - - - - The specified must be open and writable. - - - The will be closed when the appender - instance is closed. - - - Note: Logging to an unopened will fail. - - - - - - Gets or set the and the underlying - , if any, for this appender. - - - The for this appender. - - - - - This appender requires a to be set. - - true - - - This appender requires a to be set. - - - - - - Gets or sets the where logging events - will be written to. - - - The where logging events are written. - - - - This is the where logging events - will be written to. - - - - - - Default constructor - - - - Default constructor - - - - - - Construct a new appender using the layout, file and append mode. - - the layout to use with this appender - the full path to the file to write to - flag to indicate if the file should be appended to - - - Obsolete constructor. - - - - - - Construct a new appender using the layout and file specified. - The file will be appended to. - - the layout to use with this appender - the full path to the file to write to - - - Obsolete constructor. - - - - - - Activate the options on the file appender. - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - This will cause the file to be opened. - - - - - - Closes any previously opened file and calls the parent's . - - - - Resets the filename and the file stream. - - - - - - Called to initialize the file writer - - - - Will be called for each logged message until the file is - successfully opened. - - - - - - This method is called by the - method. - - The event to log. - - - Writes a log statement to the output stream if the output stream exists - and is writable. - - - The format of the output will depend on the appender's layout. - - - - - - This method is called by the - method. - - The array of events to log. - - - Acquires the output file locks once before writing all the events to - the stream. - - - - - - Writes a footer as produced by the embedded layout's property. - - - - Writes a footer as produced by the embedded layout's property. - - - - - - Writes a header produced by the embedded layout's property. - - - - Writes a header produced by the embedded layout's property. - - - - - - Closes the underlying . - - - - Closes the underlying . - - - - - - Closes the previously opened file. - - - - Writes the to the file and then - closes the file. - - - - - - Sets and opens the file where the log output will go. The specified file must be writable. - - The path to the log file. Must be a fully qualified path. - If true will append to fileName. Otherwise will truncate fileName - - - Calls but guarantees not to throw an exception. - Errors are passed to the . - - - - - - Sets and opens the file where the log output will go. The specified file must be writable. - - The path to the log file. Must be a fully qualified path. - If true will append to fileName. Otherwise will truncate fileName - - - If there was already an opened file, then the previous file - is closed first. - - - This method will ensure that the directory structure - for the specified exists. - - - - - - Sets the quiet writer used for file output - - the file stream that has been opened for writing - - - This implementation of creates a - over the and passes it to the - method. - - - This method can be overridden by sub classes that want to wrap the - in some way, for example to encrypt the output - data using a System.Security.Cryptography.CryptoStream. - - - - - - Sets the quiet writer being used. - - the writer over the file stream that has been opened for writing - - - This method can be overridden by sub classes that want to - wrap the in some way. - - - - - - Convert a path into a fully qualified path. - - The path to convert. - The fully qualified path. - - - Converts the path specified to a fully - qualified path. If the path is relative it is - taken as relative from the application base - directory. - - - - - - Flag to indicate if we should append to the file - or overwrite the file. The default is to append. - - - - - The name of the log file. - - - - - The encoding to use for the file stream. - - - - - The security context to use for privileged calls - - - - - The stream to log to. Has added locking semantics - - - - - The locking model to use - - - - - The fully qualified type of the FileAppender class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Gets or sets the path to the file that logging will be written to. - - - The path to the file that logging will be written to. - - - - If the path is relative it is taken as relative from - the application base directory. - - - - - - Gets or sets a flag that indicates whether the file should be - appended to or overwritten. - - - Indicates whether the file should be appended to or overwritten. - - - - If the value is set to false then the file will be overwritten, if - it is set to true then the file will be appended to. - - The default value is true. - - - - - Gets or sets used to write to the file. - - - The used to write to the file. - - - - The default encoding set is - which is the encoding for the system's current ANSI code page. - - - - - - Gets or sets the used to write to the file. - - - The used to write to the file. - - - - Unless a specified here for this appender - the is queried for the - security context to use. The default behavior is to use the security context - of the current thread. - - - - - - Gets or sets the used to handle locking of the file. - - - The used to lock the file. - - - - Gets or sets the used to handle locking of the file. - - - There are three built in locking models, , and . - The first locks the file from the start of logging to the end, the - second locks only for the minimal amount of time when logging each message - and the last synchronizes processes using a named system wide Mutex. - - - The default locking model is the . - - - - - - Write only that uses the - to manage access to an underlying resource. - - - - - True asynchronous writes are not supported, the implementation forces a synchronous write. - - - - - Exception base type for log4net. - - - - This type extends . It - does not add any new functionality but does differentiate the - type of exception being thrown. - - - Nicko Cadell - Gert Driesen - - - - Constructor - - - - Initializes a new instance of the class. - - - - - - Constructor - - A message to include with the exception. - - - Initializes a new instance of the class with - the specified message. - - - - - - Constructor - - A message to include with the exception. - A nested exception to include. - - - Initializes a new instance of the class - with the specified message and inner exception. - - - - - - Serialization constructor - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class - with serialized data. - - - - - - Locking model base class - - - - Base class for the locking models available to the derived loggers. - - - - - - Open the output file - - The filename to use - Whether to append to the file, or overwrite - The encoding to use - - - Open the file specified and prepare for logging. - No writes will be made until is called. - Must be called before any calls to , - and . - - - - - - Close the file - - - - Close the file. No further writes will be made. - - - - - - Acquire the lock on the file - - A stream that is ready to be written to. - - - Acquire the lock on the file in preparation for writing to it. - Return a stream pointing to the file. - must be called to release the lock on the output file. - - - - - - Release the lock on the file - - - - Release the lock on the file. No further writes will be made to the - stream until is called again. - - - - - - Helper method that creates a FileStream under CurrentAppender's SecurityContext. - - - - Typically called during OpenFile or AcquireLock. - - - If the directory portion of the does not exist, it is created - via Directory.CreateDirecctory. - - - - - - - - - - Helper method to close under CurrentAppender's SecurityContext. - - - Does not set to null. - - - - - - Gets or sets the for this LockingModel - - - The for this LockingModel - - - - The file appender this locking model is attached to and working on - behalf of. - - - The file appender is used to locate the security context and the error handler to use. - - - The value of this property will be set before is - called. - - - - - - Hold an exclusive lock on the output file - - - - Open the file once for writing and hold it open until is called. - Maintains an exclusive lock on the file during this time. - - - - - - Open the file specified and prepare for logging. - - The filename to use - Whether to append to the file, or overwrite - The encoding to use - - - Open the file specified and prepare for logging. - No writes will be made until is called. - Must be called before any calls to , - and . - - - - - - Close the file - - - - Close the file. No further writes will be made. - - - - - - Acquire the lock on the file - - A stream that is ready to be written to. - - - Does nothing. The lock is already taken - - - - - - Release the lock on the file - - - - Does nothing. The lock will be released when the file is closed. - - - - - - Acquires the file lock for each write - - - - Opens the file once for each / cycle, - thus holding the lock for the minimal amount of time. This method of locking - is considerably slower than but allows - other processes to move/delete the log file whilst logging continues. - - - - - - Prepares to open the file when the first message is logged. - - The filename to use - Whether to append to the file, or overwrite - The encoding to use - - - Open the file specified and prepare for logging. - No writes will be made until is called. - Must be called before any calls to , - and . - - - - - - Close the file - - - - Close the file. No further writes will be made. - - - - - - Acquire the lock on the file - - A stream that is ready to be written to. - - - Acquire the lock on the file in preparation for writing to it. - Return a stream pointing to the file. - must be called to release the lock on the output file. - - - - - - Release the lock on the file - - - - Release the lock on the file. No further writes will be made to the - stream until is called again. - - - - - - Provides cross-process file locking. - - Ron Grabowski - Steve Wranovsky - - - - Open the file specified and prepare for logging. - - The filename to use - Whether to append to the file, or overwrite - The encoding to use - - - Open the file specified and prepare for logging. - No writes will be made until is called. - Must be called before any calls to , - - and . - - - - - - Close the file - - - - Close the file. No further writes will be made. - - - - - - Acquire the lock on the file - - A stream that is ready to be written to. - - - Does nothing. The lock is already taken - - - - - - - - - - - This appender forwards logging events to attached appenders. - - - - The forwarding appender can be used to specify different thresholds - and filters for the same appender at different locations within the hierarchy. - - - Nicko Cadell - Gert Driesen - - - - Initializes a new instance of the class. - - - - Default constructor. - - - - - - Closes the appender and releases resources. - - - - Releases any resources allocated within the appender such as file handles, - network connections, etc. - - - It is a programming error to append to a closed appender. - - - - - - Forward the logging event to the attached appenders - - The event to log. - - - Delivers the logging event to all the attached appenders. - - - - - - Forward the logging events to the attached appenders - - The array of events to log. - - - Delivers the logging events to all the attached appenders. - - - - - - Adds an to the list of appenders of this - instance. - - The to add to this appender. - - - If the specified is already in the list of - appenders, then it won't be added again. - - - - - - Looks for the appender with the specified name. - - The name of the appender to lookup. - - The appender with the specified name, or null. - - - - Get the named appender attached to this appender. - - - - - - Removes all previously added appenders from this appender. - - - - This is useful when re-reading configuration information. - - - - - - Removes the specified appender from the list of appenders. - - The appender to remove. - The appender removed from the list - - The appender removed is not closed. - If you are discarding the appender you must call - on the appender removed. - - - - - Removes the appender with the specified name from the list of appenders. - - The name of the appender to remove. - The appender removed from the list - - The appender removed is not closed. - If you are discarding the appender you must call - on the appender removed. - - - - - Implementation of the interface - - - - - Gets the appenders contained in this appender as an - . - - - If no appenders can be found, then an - is returned. - - - A collection of the appenders in this appender. - - - - - Logs events to a local syslog service. - - - - This appender uses the POSIX libc library functions openlog, syslog, and closelog. - If these functions are not available on the local system then this appender will not work! - - - The functions openlog, syslog, and closelog are specified in SUSv2 and - POSIX 1003.1-2001 standards. These are used to log messages to the local syslog service. - - - This appender talks to a local syslog service. If you need to log to a remote syslog - daemon and you cannot configure your local syslog service to do this you may be - able to use the to log via UDP. - - - Syslog messages must have a facility and and a severity. The severity - is derived from the Level of the logging event. - The facility must be chosen from the set of defined syslog - values. The facilities list is predefined - and cannot be extended. - - - An identifier is specified with each log message. This can be specified - by setting the property. The identity (also know - as the tag) must not contain white space. The default value for the - identity is the application name (from ). - - - Rob Lyon - Nicko Cadell - - - - Initializes a new instance of the class. - - - This instance of the class is set up to write - to a local syslog service. - - - - - Add a mapping of level to severity - - The mapping to add - - - Adds a to this appender. - - - - - - Initialize the appender based on the options set. - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - - - - This method is called by the method. - - The event to log. - - - Writes the event to a remote syslog daemon. - - - The format of the output will depend on the appender's layout. - - - - - - Close the syslog when the appender is closed - - - - Close the syslog when the appender is closed - - - - - - Translates a log4net level to a syslog severity. - - A log4net level. - A syslog severity. - - - Translates a log4net level to a syslog severity. - - - - - - Generate a syslog priority. - - The syslog facility. - The syslog severity. - A syslog priority. - - - - The facility. The default facility is . - - - - - The message identity - - - - - Marshaled handle to the identity string. We have to hold on to the - string as the openlog and syslog APIs just hold the - pointer to the ident and dereference it for each log message. - - - - - Mapping from level object to syslog severity - - - - - Open connection to system logger. - - - - - Generate a log message. - - - - The libc syslog method takes a format string and a variable argument list similar - to the classic printf function. As this type of vararg list is not supported - by C# we need to specify the arguments explicitly. Here we have specified the - format string with a single message argument. The caller must set the format - string to "%s". - - - - - - Close descriptor used to write to system logger. - - - - - Message identity - - - - An identifier is specified with each log message. This can be specified - by setting the property. The identity (also know - as the tag) must not contain white space. The default value for the - identity is the application name (from ). - - - - - - Syslog facility - - - Set to one of the values. The list of - facilities is predefined and cannot be extended. The default value - is . - - - - - This appender requires a to be set. - - true - - - This appender requires a to be set. - - - - - - syslog severities - - - - The log4net Level maps to a syslog severity using the - method and the - class. The severity is set on . - - - - - - system is unusable - - - - - action must be taken immediately - - - - - critical conditions - - - - - error conditions - - - - - warning conditions - - - - - normal but significant condition - - - - - informational - - - - - debug-level messages - - - - - syslog facilities - - - - The syslog facility defines which subsystem the logging comes from. - This is set on the property. - - - - - - kernel messages - - - - - random user-level messages - - - - - mail system - - - - - system daemons - - - - - security/authorization messages - - - - - messages generated internally by syslogd - - - - - line printer subsystem - - - - - network news subsystem - - - - - UUCP subsystem - - - - - clock (cron/at) daemon - - - - - security/authorization messages (private) - - - - - ftp daemon - - - - - NTP subsystem - - - - - log audit - - - - - log alert - - - - - clock daemon - - - - - reserved for local use - - - - - reserved for local use - - - - - reserved for local use - - - - - reserved for local use - - - - - reserved for local use - - - - - reserved for local use - - - - - reserved for local use - - - - - reserved for local use - - - - - A class to act as a mapping between the level that a logging call is made at and - the syslog severity that is should be logged at. - - - - A class to act as a mapping between the level that a logging call is made at and - the syslog severity that is should be logged at. - - - - - - The mapped syslog severity for the specified level - - - - Required property. - The mapped syslog severity for the specified level - - - - - - Appends colorful logging events to the console, using the .NET 2 - built-in capabilities. - - - - ManagedColoredConsoleAppender appends log events to the standard output stream - or the error output stream using a layout specified by the - user. It also allows the color of a specific type of message to be set. - - - By default, all output is written to the console's standard output stream. - The property can be set to direct the output to the - error stream. - - - When configuring the colored console appender, mappings should be - specified to map logging levels to colors. For example: - - - - - - - - - - - - - - - - - - - - - - The Level is the standard log4net logging level while - ForeColor and BackColor are the values of - enumeration. - - - Based on the ColoredConsoleAppender - - - Rick Hobbs - Nicko Cadell - Pavlos Touboulidis - - - - The to use when writing to the Console - standard output stream. - - - - The to use when writing to the Console - standard output stream. - - - - - - The to use when writing to the Console - standard error output stream. - - - - The to use when writing to the Console - standard error output stream. - - - - - - Initializes a new instance of the class. - - - The instance of the class is set up to write - to the standard output stream. - - - - - Add a mapping of level to color - done by the config file - - The mapping to add - - - Add a mapping to this appender. - Each mapping defines the foreground and background colors - for a level. - - - - - - This method is called by the method. - - The event to log. - - - Writes the event to the console. - - - The format of the output will depend on the appender's layout. - - - - - - Initialize the options for this appender - - - - Initialize the level to color mappings set on this appender. - - - - - - Flag to write output to the error stream rather than the standard output stream - - - - - Mapping from level object to color value - - - - - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". - - - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". - - - - Target is the value of the console output stream. - This is either "Console.Out" or "Console.Error". - - - - - - This appender requires a to be set. - - true - - - This appender requires a to be set. - - - - - - A class to act as a mapping between the level that a logging call is made at and - the color it should be displayed as. - - - - Defines the mapping between a level and the color it should be displayed in. - - - - - - The mapped foreground color for the specified level - - - - Required property. - The mapped foreground color for the specified level. - - - - - - The mapped background color for the specified level - - - - Required property. - The mapped background color for the specified level. - - - - - - Stores logging events in an array. - - - - The memory appender stores all the logging events - that are appended in an in-memory array. - - - Use the method to get - the current list of events that have been appended. - - - Use the method to clear the - current list of events. - - - Julian Biddle - Nicko Cadell - Gert Driesen - - - - Initializes a new instance of the class. - - - - Default constructor. - - - - - - Gets the events that have been logged. - - The events that have been logged - - - Gets the events that have been logged. - - - - - - This method is called by the method. - - the event to log - - Stores the in the events list. - - - - - Clear the list of events - - - Clear the list of events - - - - - The list of events that have been appended. - - - - - Value indicating which fields in the event should be fixed - - - By default all fields are fixed - - - - - Gets or sets a value indicating whether only part of the logging event - data should be fixed. - - - true if the appender should only fix part of the logging event - data, otherwise false. The default is false. - - - - Setting this property to true will cause only part of the event - data to be fixed and stored in the appender, hereby improving performance. - - - See for more information. - - - - - - Gets or sets the fields that will be fixed in the event - - - - The logging event needs to have certain thread specific values - captured before it can be buffered. See - for details. - - - - - - Logs entries by sending network messages using the - native function. - - - - You can send messages only to names that are active - on the network. If you send the message to a user name, - that user must be logged on and running the Messenger - service to receive the message. - - - The receiver will get a top most window displaying the - messages one at a time, therefore this appender should - not be used to deliver a high volume of messages. - - - The following table lists some possible uses for this appender : - - - - - Action - Property Value(s) - - - Send a message to a user account on the local machine - - - = <name of the local machine> - - - = <user name> - - - - - Send a message to a user account on a remote machine - - - = <name of the remote machine> - - - = <user name> - - - - - Send a message to a domain user account - - - = <name of a domain controller | uninitialized> - - - = <user name> - - - - - Send a message to all the names in a workgroup or domain - - - = <workgroup name | domain name>* - - - - - Send a message from the local machine to a remote machine - - - = <name of the local machine | uninitialized> - - - = <name of the remote machine> - - - - - - - Note : security restrictions apply for sending - network messages, see - for more information. - - - - - An example configuration section to log information - using this appender from the local machine, named - LOCAL_PC, to machine OPERATOR_PC : - - - - - - - - - - Nicko Cadell - Gert Driesen - - - - The DNS or NetBIOS name of the server on which the function is to execute. - - - - - The sender of the network message. - - - - - The message alias to which the message should be sent. - - - - - The security context to use for privileged calls - - - - - Initializes the appender. - - - The default constructor initializes all fields to their default values. - - - - - Initialize the appender based on the options set. - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - The appender will be ignored if no was specified. - - - The required property was not specified. - - - - This method is called by the method. - - The event to log. - - - Sends the event using a network message. - - - - - - Sends a buffer of information to a registered message alias. - - The DNS or NetBIOS name of the server on which the function is to execute. - The message alias to which the message buffer should be sent - The originator of the message. - The message text. - The length, in bytes, of the message text. - - - The following restrictions apply for sending network messages: - - - - - Platform - Requirements - - - Windows NT - - - No special group membership is required to send a network message. - - - Admin, Accounts, Print, or Server Operator group membership is required to - successfully send a network message on a remote server. - - - - - Windows 2000 or later - - - If you send a message on a domain controller that is running Active Directory, - access is allowed or denied based on the access control list (ACL) for the securable - object. The default ACL permits only Domain Admins and Account Operators to send a network message. - - - On a member server or workstation, only Administrators and Server Operators can send a network message. - - - - - - - For more information see Security Requirements for the Network Management Functions. - - - - - If the function succeeds, the return value is zero. - - - - - - Gets or sets the sender of the message. - - - The sender of the message. - - - If this property is not specified, the message is sent from the local computer. - - - - - Gets or sets the message alias to which the message should be sent. - - - The recipient of the message. - - - This property should always be specified in order to send a message. - - - - - Gets or sets the DNS or NetBIOS name of the remote server on which the function is to execute. - - - DNS or NetBIOS name of the remote server on which the function is to execute. - - - - For Windows NT 4.0 and earlier, the string should begin with \\. - - - If this property is not specified, the local computer is used. - - - - - - Gets or sets the used to call the NetSend method. - - - The used to call the NetSend method. - - - - Unless a specified here for this appender - the is queried for the - security context to use. The default behavior is to use the security context - of the current thread. - - - - - - This appender requires a to be set. - - true - - - This appender requires a to be set. - - - - - - Appends log events to the OutputDebugString system. - - - - OutputDebugStringAppender appends log events to the - OutputDebugString system. - - - The string is passed to the native OutputDebugString - function. - - - Nicko Cadell - Gert Driesen - - - - Initializes a new instance of the class. - - - - Default constructor. - - - - - - Write the logging event to the output debug string API - - the event to log - - - Write the logging event to the output debug string API - - - - - - Stub for OutputDebugString native method - - the string to output - - - Stub for OutputDebugString native method - - - - - - This appender requires a to be set. - - true - - - This appender requires a to be set. - - - - - - Logs events to a remote syslog daemon. - - - - The BSD syslog protocol is used to remotely log to - a syslog daemon. The syslogd listens for for messages - on UDP port 514. - - - The syslog UDP protocol is not authenticated. Most syslog daemons - do not accept remote log messages because of the security implications. - You may be able to use the LocalSyslogAppender to talk to a local - syslog service. - - - There is an RFC 3164 that claims to document the BSD Syslog Protocol. - This RFC can be seen here: http://www.faqs.org/rfcs/rfc3164.html. - This appender generates what the RFC calls an "Original Device Message", - i.e. does not include the TIMESTAMP or HOSTNAME fields. By observation - this format of message will be accepted by all current syslog daemon - implementations. The daemon will attach the current time and the source - hostname or IP address to any messages received. - - - Syslog messages must have a facility and and a severity. The severity - is derived from the Level of the logging event. - The facility must be chosen from the set of defined syslog - values. The facilities list is predefined - and cannot be extended. - - - An identifier is specified with each log message. This can be specified - by setting the property. The identity (also know - as the tag) must not contain white space. The default value for the - identity is the application name (from ). - - - Rob Lyon - Nicko Cadell - - - - Sends logging events as connectionless UDP datagrams to a remote host or a - multicast group using an . - - - - UDP guarantees neither that messages arrive, nor that they arrive in the correct order. - - - To view the logging results, a custom application can be developed that listens for logging - events. - - - When decoding events send via this appender remember to use the same encoding - to decode the events as was used to send the events. See the - property to specify the encoding to use. - - - - This example shows how to log receive logging events that are sent - on IP address 244.0.0.1 and port 8080 to the console. The event is - encoded in the packet as a unicode string and it is decoded as such. - - IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Any, 0); - UdpClient udpClient; - byte[] buffer; - string loggingEvent; - - try - { - udpClient = new UdpClient(8080); - - while(true) - { - buffer = udpClient.Receive(ref remoteEndPoint); - loggingEvent = System.Text.Encoding.Unicode.GetString(buffer); - Console.WriteLine(loggingEvent); - } - } - catch(Exception e) - { - Console.WriteLine(e.ToString()); - } - - - Dim remoteEndPoint as IPEndPoint - Dim udpClient as UdpClient - Dim buffer as Byte() - Dim loggingEvent as String - - Try - remoteEndPoint = new IPEndPoint(IPAddress.Any, 0) - udpClient = new UdpClient(8080) - - While True - buffer = udpClient.Receive(ByRef remoteEndPoint) - loggingEvent = System.Text.Encoding.Unicode.GetString(buffer) - Console.WriteLine(loggingEvent) - Wend - Catch e As Exception - Console.WriteLine(e.ToString()) - End Try - - - An example configuration section to log information using this appender to the - IP 224.0.0.1 on port 8080: - - - - - - - - - - Gert Driesen - Nicko Cadell - - - - Initializes a new instance of the class. - - - The default constructor initializes all fields to their default values. - - - - - Initialize the appender based on the options set. - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - The appender will be ignored if no was specified or - an invalid remote or local TCP port number was specified. - - - The required property was not specified. - The TCP port number assigned to or is less than or greater than . - - - - This method is called by the method. - - The event to log. - - - Sends the event using an UDP datagram. - - - Exceptions are passed to the . - - - - - - Closes the UDP connection and releases all resources associated with - this instance. - - - - Disables the underlying and releases all managed - and unmanaged resources associated with the . - - - - - - Initializes the underlying connection. - - - - The underlying is initialized and binds to the - port number from which you intend to communicate. - - - Exceptions are passed to the . - - - - - - The IP address of the remote host or multicast group to which - the logging event will be sent. - - - - - The TCP port number of the remote host or multicast group to - which the logging event will be sent. - - - - - The cached remote endpoint to which the logging events will be sent. - - - - - The TCP port number from which the will communicate. - - - - - The instance that will be used for sending the - logging events. - - - - - The encoding to use for the packet. - - - - - Gets or sets the IP address of the remote host or multicast group to which - the underlying should sent the logging event. - - - The IP address of the remote host or multicast group to which the logging event - will be sent. - - - - Multicast addresses are identified by IP class D addresses (in the range 224.0.0.0 to - 239.255.255.255). Multicast packets can pass across different networks through routers, so - it is possible to use multicasts in an Internet scenario as long as your network provider - supports multicasting. - - - Hosts that want to receive particular multicast messages must register their interest by joining - the multicast group. Multicast messages are not sent to networks where no host has joined - the multicast group. Class D IP addresses are used for multicast groups, to differentiate - them from normal host addresses, allowing nodes to easily detect if a message is of interest. - - - Static multicast addresses that are needed globally are assigned by IANA. A few examples are listed in the table below: - - - - - IP Address - Description - - - 224.0.0.1 - - - Sends a message to all system on the subnet. - - - - - 224.0.0.2 - - - Sends a message to all routers on the subnet. - - - - - 224.0.0.12 - - - The DHCP server answers messages on the IP address 224.0.0.12, but only on a subnet. - - - - - - - A complete list of actually reserved multicast addresses and their owners in the ranges - defined by RFC 3171 can be found at the IANA web site. - - - The address range 239.0.0.0 to 239.255.255.255 is reserved for administrative scope-relative - addresses. These addresses can be reused with other local groups. Routers are typically - configured with filters to prevent multicast traffic in this range from flowing outside - of the local network. - - - - - - Gets or sets the TCP port number of the remote host or multicast group to which - the underlying should sent the logging event. - - - An integer value in the range to - indicating the TCP port number of the remote host or multicast group to which the logging event - will be sent. - - - The underlying will send messages to this TCP port number - on the remote host or multicast group. - - The value specified is less than or greater than . - - - - Gets or sets the TCP port number from which the underlying will communicate. - - - An integer value in the range to - indicating the TCP port number from which the underlying will communicate. - - - - The underlying will bind to this port for sending messages. - - - Setting the value to 0 (the default) will cause the udp client not to bind to - a local port. - - - The value specified is less than or greater than . - - - - Gets or sets used to write the packets. - - - The used to write the packets. - - - - The used to write the packets. - - - - - - Gets or sets the underlying . - - - The underlying . - - - creates a to send logging events - over a network. Classes deriving from can use this - property to get or set this . Use the underlying - returned from if you require access beyond that which - provides. - - - - - Gets or sets the cached remote endpoint to which the logging events should be sent. - - - The cached remote endpoint to which the logging events will be sent. - - - The method will initialize the remote endpoint - with the values of the and - properties. - - - - - This appender requires a to be set. - - true - - - This appender requires a to be set. - - - - - - Syslog port 514 - - - - - Initial buffer size - - - - - Maximum buffer size before it is recycled - - - - - Initializes a new instance of the class. - - - This instance of the class is set up to write - to a remote syslog daemon. - - - - - Add a mapping of level to severity - - The mapping to add - - - Add a mapping to this appender. - - - - - - This method is called by the method. - - The event to log. - - - Writes the event to a remote syslog daemon. - - - The format of the output will depend on the appender's layout. - - - - - - Initialize the options for this appender - - - - Initialize the level to syslog severity mappings set on this appender. - - - - - - Translates a log4net level to a syslog severity. - - A log4net level. - A syslog severity. - - - Translates a log4net level to a syslog severity. - - - - - - Generate a syslog priority. - - The syslog facility. - The syslog severity. - A syslog priority. - - - Generate a syslog priority. - - - - - - The facility. The default facility is . - - - - - The message identity - - - - - Mapping from level object to syslog severity - - - - - Message identity - - - - An identifier is specified with each log message. This can be specified - by setting the property. The identity (also know - as the tag) must not contain white space. The default value for the - identity is the application name (from ). - - - - - - Syslog facility - - - Set to one of the values. The list of - facilities is predefined and cannot be extended. The default value - is . - - - - - syslog severities - - - - The syslog severities. - - - - - - system is unusable - - - - - action must be taken immediately - - - - - critical conditions - - - - - error conditions - - - - - warning conditions - - - - - normal but significant condition - - - - - informational - - - - - debug-level messages - - - - - syslog facilities - - - - The syslog facilities - - - - - - kernel messages - - - - - random user-level messages - - - - - mail system - - - - - system daemons - - - - - security/authorization messages - - - - - messages generated internally by syslogd - - - - - line printer subsystem - - - - - network news subsystem - - - - - UUCP subsystem - - - - - clock (cron/at) daemon - - - - - security/authorization messages (private) - - - - - ftp daemon - - - - - NTP subsystem - - - - - log audit - - - - - log alert - - - - - clock daemon - - - - - reserved for local use - - - - - reserved for local use - - - - - reserved for local use - - - - - reserved for local use - - - - - reserved for local use - - - - - reserved for local use - - - - - reserved for local use - - - - - reserved for local use - - - - - A class to act as a mapping between the level that a logging call is made at and - the syslog severity that is should be logged at. - - - - A class to act as a mapping between the level that a logging call is made at and - the syslog severity that is should be logged at. - - - - - - The mapped syslog severity for the specified level - - - - Required property. - The mapped syslog severity for the specified level - - - - - - Delivers logging events to a remote logging sink. - - - - This Appender is designed to deliver events to a remote sink. - That is any object that implements the - interface. It delivers the events using .NET remoting. The - object to deliver events to is specified by setting the - appenders property. - - The RemotingAppender buffers events before sending them. This allows it to - make more efficient use of the remoting infrastructure. - - Once the buffer is full the events are still not sent immediately. - They are scheduled to be sent using a pool thread. The effect is that - the send occurs asynchronously. This is very important for a - number of non obvious reasons. The remoting infrastructure will - flow thread local variables (stored in the ), - if they are marked as , across the - remoting boundary. If the server is not contactable then - the remoting infrastructure will clear the - objects from the . To prevent a logging failure from - having side effects on the calling application the remoting call must be made - from a separate thread to the one used by the application. A - thread is used for this. If no thread is available then - the events will block in the thread pool manager until a thread is available. - - Because the events are sent asynchronously using pool threads it is possible to close - this appender before all the queued events have been sent. - When closing the appender attempts to wait until all the queued events have been sent, but - this will timeout after 30 seconds regardless. - - If this appender is being closed because the - event has fired it may not be possible to send all the queued events. During process - exit the runtime limits the time that a - event handler is allowed to run for. If the runtime terminates the threads before - the queued events have been sent then they will be lost. To ensure that all events - are sent the appender must be closed before the application exits. See - for details on how to shutdown - log4net programmatically. - - - Nicko Cadell - Gert Driesen - Daniel Cazzulino - - - - Initializes a new instance of the class. - - - - Default constructor. - - - - - - Initialize the appender based on the options set - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - - - - Send the contents of the buffer to the remote sink. - - - The events are not sent immediately. They are scheduled to be sent - using a pool thread. The effect is that the send occurs asynchronously. - This is very important for a number of non obvious reasons. The remoting - infrastructure will flow thread local variables (stored in the ), - if they are marked as , across the - remoting boundary. If the server is not contactable then - the remoting infrastructure will clear the - objects from the . To prevent a logging failure from - having side effects on the calling application the remoting call must be made - from a separate thread to the one used by the application. A - thread is used for this. If no thread is available then - the events will block in the thread pool manager until a thread is available. - - The events to send. - - - - Override base class close. - - - - This method waits while there are queued work items. The events are - sent asynchronously using work items. These items - will be sent once a thread pool thread is available to send them, therefore - it is possible to close the appender before all the queued events have been - sent. - - This method attempts to wait until all the queued events have been sent, but this - method will timeout after 30 seconds regardless. - - If the appender is being closed because the - event has fired it may not be possible to send all the queued events. During process - exit the runtime limits the time that a - event handler is allowed to run for. - - - - - A work item is being queued into the thread pool - - - - - A work item from the thread pool has completed - - - - - Send the contents of the buffer to the remote sink. - - - This method is designed to be used with the . - This method expects to be passed an array of - objects in the state param. - - the logging events to send - - - - The URL of the remote sink. - - - - - The local proxy (.NET remoting) for the remote logging sink. - - - - - The number of queued callbacks currently waiting or executing - - - - - Event used to signal when there are no queued work items - - - This event is set when there are no queued work items. In this - state it is safe to close the appender. - - - - - Gets or sets the URL of the well-known object that will accept - the logging events. - - - The well-known URL of the remote sink. - - - - The URL of the remoting sink that will accept logging events. - The sink must implement the - interface. - - - - - - Interface used to deliver objects to a remote sink. - - - This interface must be implemented by a remoting sink - if the is to be used - to deliver logging events to the sink. - - - - - Delivers logging events to the remote sink - - Array of events to log. - - - Delivers logging events to the remote sink - - - - - - Appender that rolls log files based on size or date or both. - - - - RollingFileAppender can roll log files based on size or date or both - depending on the setting of the property. - When set to the log file will be rolled - once its size exceeds the . - When set to the log file will be rolled - once the date boundary specified in the property - is crossed. - When set to the log file will be - rolled once the date boundary specified in the property - is crossed, but within a date boundary the file will also be rolled - once its size exceeds the . - When set to the log file will be rolled when - the appender is configured. This effectively means that the log file can be - rolled once per program execution. - - - A of few additional optional features have been added: - - Attach date pattern for current log file - Backup number increments for newer files - Infinite number of backups by file size - - - - - - For large or infinite numbers of backup files a - greater than zero is highly recommended, otherwise all the backup files need - to be renamed each time a new backup is created. - - - When Date/Time based rolling is used setting - to will reduce the number of file renamings to few or none. - - - - - - Changing or without clearing - the log file directory of backup files will cause unexpected and unwanted side effects. - - - - - If Date/Time based rolling is enabled this appender will attempt to roll existing files - in the directory without a Date/Time tag based on the last write date of the base log file. - The appender only rolls the log file when a message is logged. If Date/Time based rolling - is enabled then the appender will not roll the log file at the Date/Time boundary but - at the point when the next message is logged after the boundary has been crossed. - - - - The extends the and - has the same behavior when opening the log file. - The appender will first try to open the file for writing when - is called. This will typically be during configuration. - If the file cannot be opened for writing the appender will attempt - to open the file again each time a message is logged to the appender. - If the file cannot be opened for writing when a message is logged then - the message will be discarded by this appender. - - - When rolling a backup file necessitates deleting an older backup file the - file to be deleted is moved to a temporary name before being deleted. - - - - - A maximum number of backup files when rolling on date/time boundaries is not supported. - - - - Nicko Cadell - Gert Driesen - Aspi Havewala - Douglas de la Torre - Edward Smit - - - - Initializes a new instance of the class. - - - - Default constructor. - - - - - - The fully qualified type of the RollingFileAppender class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Sets the quiet writer being used. - - - This method can be overridden by sub classes. - - the writer to set - - - - Write out a logging event. - - the event to write to file. - - - Handles append time behavior for RollingFileAppender. This checks - if a roll over either by date (checked first) or time (checked second) - is need and then appends to the file last. - - - - - - Write out an array of logging events. - - the events to write to file. - - - Handles append time behavior for RollingFileAppender. This checks - if a roll over either by date (checked first) or time (checked second) - is need and then appends to the file last. - - - - - - Performs any required rolling before outputting the next event - - - - Handles append time behavior for RollingFileAppender. This checks - if a roll over either by date (checked first) or time (checked second) - is need and then appends to the file last. - - - - - - Creates and opens the file for logging. If - is false then the fully qualified name is determined and used. - - the name of the file to open - true to append to existing file - - This method will ensure that the directory structure - for the specified exists. - - - - - Get the current output file name - - the base file name - the output file name - - The output file name is based on the base fileName specified. - If is set then the output - file name is the same as the base file passed in. Otherwise - the output file depends on the date pattern, on the count - direction or both. - - - - - Determines curSizeRollBackups (only within the current roll point) - - - - - Generates a wildcard pattern that can be used to find all files - that are similar to the base file name. - - - - - - - Builds a list of filenames for all files matching the base filename plus a file - pattern. - - - - - - - Initiates a roll over if needed for crossing a date boundary since the last run. - - - - - Initializes based on existing conditions at time of . - - - - Initializes based on existing conditions at time of . - The following is done - - determine curSizeRollBackups (only within the current roll point) - initiates a roll over if needed for crossing a date boundary since the last run. - - - - - - - Does the work of bumping the 'current' file counter higher - to the highest count when an incremental file name is seen. - The highest count is either the first file (when count direction - is greater than 0) or the last file (when count direction less than 0). - In either case, we want to know the highest count that is present. - - - - - - - Attempts to extract a number from the end of the file name that indicates - the number of the times the file has been rolled over. - - - Certain date pattern extensions like yyyyMMdd will be parsed as valid backup indexes. - - - - - - - Takes a list of files and a base file name, and looks for - 'incremented' versions of the base file. Bumps the max - count up to the highest count seen. - - - - - - - Calculates the RollPoint for the datePattern supplied. - - the date pattern to calculate the check period for - The RollPoint that is most accurate for the date pattern supplied - - Essentially the date pattern is examined to determine what the - most suitable roll point is. The roll point chosen is the roll point - with the smallest period that can be detected using the date pattern - supplied. i.e. if the date pattern only outputs the year, month, day - and hour then the smallest roll point that can be detected would be - and hourly roll point as minutes could not be detected. - - - - - Initialize the appender based on the options set - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - Sets initial conditions including date/time roll over information, first check, - scheduledFilename, and calls to initialize - the current number of backups. - - - - - - - - - .1, .2, .3, etc. - - - - - Rollover the file(s) to date/time tagged file(s). - - set to true if the file to be rolled is currently open - - - Rollover the file(s) to date/time tagged file(s). - Resets curSizeRollBackups. - If fileIsOpen is set then the new file is opened (through SafeOpenFile). - - - - - - Renames file to file . - - Name of existing file to roll. - New name for file. - - - Renames file to file . It - also checks for existence of target file and deletes if it does. - - - - - - Test if a file exists at a specified path - - the path to the file - true if the file exists - - - Test if a file exists at a specified path - - - - - - Deletes the specified file if it exists. - - The file to delete. - - - Delete a file if is exists. - The file is first moved to a new filename then deleted. - This allows the file to be removed even when it cannot - be deleted, but it still can be moved. - - - - - - Implements file roll base on file size. - - - - If the maximum number of size based backups is reached - (curSizeRollBackups == maxSizeRollBackups) then the oldest - file is deleted -- its index determined by the sign of countDirection. - If countDirection < 0, then files - {File.1, ..., File.curSizeRollBackups -1} - are renamed to {File.2, ..., - File.curSizeRollBackups}. Moreover, File is - renamed File.1 and closed. - - - A new file is created to receive further log output. - - - If maxSizeRollBackups is equal to zero, then the - File is truncated with no backup files created. - - - If maxSizeRollBackups < 0, then File is - renamed if needed and no files are deleted. - - - - - - Implements file roll. - - the base name to rename - - - If the maximum number of size based backups is reached - (curSizeRollBackups == maxSizeRollBackups) then the oldest - file is deleted -- its index determined by the sign of countDirection. - If countDirection < 0, then files - {File.1, ..., File.curSizeRollBackups -1} - are renamed to {File.2, ..., - File.curSizeRollBackups}. - - - If maxSizeRollBackups is equal to zero, then the - File is truncated with no backup files created. - - - If maxSizeRollBackups < 0, then File is - renamed if needed and no files are deleted. - - - This is called by to rename the files. - - - - - - Get the start time of the next window for the current rollpoint - - the current date - the type of roll point we are working with - the start time for the next roll point an interval after the currentDateTime date - - - Returns the date of the next roll point after the currentDateTime date passed to the method. - - - The basic strategy is to subtract the time parts that are less significant - than the rollpoint from the current time. This should roll the time back to - the start of the time window for the current rollpoint. Then we add 1 window - worth of time and get the start time of the next window for the rollpoint. - - - - - - This object supplies the current date/time. Allows test code to plug in - a method to control this class when testing date/time based rolling. The default - implementation uses the underlying value of DateTime.Now. - - - - - The date pattern. By default, the pattern is set to ".yyyy-MM-dd" - meaning daily rollover. - - - - - The actual formatted filename that is currently being written to - or will be the file transferred to on roll over - (based on staticLogFileName). - - - - - The timestamp when we shall next recompute the filename. - - - - - Holds date of last roll over - - - - - The type of rolling done - - - - - The default maximum file size is 10MB - - - - - There is zero backup files by default - - - - - How many sized based backups have been made so far - - - - - The rolling file count direction. - - - - - The rolling mode used in this appender. - - - - - Cache flag set if we are rolling by date. - - - - - Cache flag set if we are rolling by size. - - - - - Value indicating whether to always log to the same file. - - - - - Value indicating whether to preserve the file name extension when rolling. - - - - - FileName provided in configuration. Used for rolling properly - - - - - The 1st of January 1970 in UTC - - - - - Gets or sets the strategy for determining the current date and time. The default - implementation is to use LocalDateTime which internally calls through to DateTime.Now. - DateTime.UtcNow may be used on frameworks newer than .NET 1.0 by specifying - . - - - An implementation of the interface which returns the current date and time. - - - - Gets or sets the used to return the current date and time. - - - There are two built strategies for determining the current date and time, - - and . - - - The default strategy is . - - - - - - Gets or sets the date pattern to be used for generating file names - when rolling over on date. - - - The date pattern to be used for generating file names when rolling - over on date. - - - - Takes a string in the same format as expected by - . - - - This property determines the rollover schedule when rolling over - on date. - - - - - - Gets or sets the maximum number of backup files that are kept before - the oldest is erased. - - - The maximum number of backup files that are kept before the oldest is - erased. - - - - If set to zero, then there will be no backup files and the log file - will be truncated when it reaches . - - - If a negative number is supplied then no deletions will be made. Note - that this could result in very slow performance as a large number of - files are rolled over unless is used. - - - The maximum applies to each time based group of files and - not the total. - - - - - - Gets or sets the maximum size that the output file is allowed to reach - before being rolled over to backup files. - - - The maximum size in bytes that the output file is allowed to reach before being - rolled over to backup files. - - - - This property is equivalent to except - that it is required for differentiating the setter taking a - argument from the setter taking a - argument. - - - The default maximum file size is 10MB (10*1024*1024). - - - - - - Gets or sets the maximum size that the output file is allowed to reach - before being rolled over to backup files. - - - The maximum size that the output file is allowed to reach before being - rolled over to backup files. - - - - This property allows you to specify the maximum size with the - suffixes "KB", "MB" or "GB" so that the size is interpreted being - expressed respectively in kilobytes, megabytes or gigabytes. - - - For example, the value "10KB" will be interpreted as 10240 bytes. - - - The default maximum file size is 10MB. - - - If you have the option to set the maximum file size programmatically - consider using the property instead as this - allows you to set the size in bytes as a . - - - - - - Gets or sets the rolling file count direction. - - - The rolling file count direction. - - - - Indicates if the current file is the lowest numbered file or the - highest numbered file. - - - By default newer files have lower numbers ( < 0), - i.e. log.1 is most recent, log.5 is the 5th backup, etc... - - - >= 0 does the opposite i.e. - log.1 is the first backup made, log.5 is the 5th backup made, etc. - For infinite backups use >= 0 to reduce - rollover costs. - - The default file count direction is -1. - - - - - Gets or sets the rolling style. - - The rolling style. - - - The default rolling style is . - - - When set to this appender's - property is set to false, otherwise - the appender would append to a single file rather than rolling - the file each time it is opened. - - - - - - Gets or sets a value indicating whether to preserve the file name extension when rolling. - - - true if the file name extension should be preserved. - - - - By default file.log is rolled to file.log.yyyy-MM-dd or file.log.curSizeRollBackup. - However, under Windows the new file name will loose any program associations as the - extension is changed. Optionally file.log can be renamed to file.yyyy-MM-dd.log or - file.curSizeRollBackup.log to maintain any program associations. - - - - - - Gets or sets a value indicating whether to always log to - the same file. - - - true if always should be logged to the same file, otherwise false. - - - - By default file.log is always the current file. Optionally - file.log.yyyy-mm-dd for current formatted datePattern can by the currently - logging file (or file.log.curSizeRollBackup or even - file.log.yyyy-mm-dd.curSizeRollBackup). - - - This will make time based rollovers with a large number of backups - much faster as the appender it won't have to rename all the backups! - - - - - - Style of rolling to use - - - - Style of rolling to use - - - - - - Roll files once per program execution - - - - Roll files once per program execution. - Well really once each time this appender is - configured. - - - Setting this option also sets AppendToFile to - false on the RollingFileAppender, otherwise - this appender would just be a normal file appender. - - - - - - Roll files based only on the size of the file - - - - - Roll files based only on the date - - - - - Roll files based on both the size and date of the file - - - - - The code assumes that the following 'time' constants are in a increasing sequence. - - - - The code assumes that the following 'time' constants are in a increasing sequence. - - - - - - Roll the log not based on the date - - - - - Roll the log for each minute - - - - - Roll the log for each hour - - - - - Roll the log twice a day (midday and midnight) - - - - - Roll the log each day (midnight) - - - - - Roll the log each week - - - - - Roll the log each month - - - - - This interface is used to supply Date/Time information to the . - - - This interface is used to supply Date/Time information to the . - Used primarily to allow test classes to plug themselves in so they can - supply test date/times. - - - - - Gets the current time. - - The current time. - - - Gets the current time. - - - - - - Default implementation of that returns the current time. - - - - - Gets the current time. - - The current time. - - - Gets the current time. - - - - - - Implementation of that returns the current time as the coordinated universal time (UTC). - - - - - Gets the current time. - - The current time. - - - Gets the current time. - - - - - - Send an e-mail when a specific logging event occurs, typically on errors - or fatal errors. - - - - The number of logging events delivered in this e-mail depend on - the value of option. The - keeps only the last - logging events in its - cyclic buffer. This keeps memory requirements at a reasonable level while - still delivering useful application context. - - - Authentication and setting the server Port are only available on the MS .NET 1.1 runtime. - For these features to be enabled you need to ensure that you are using a version of - the log4net assembly that is built against the MS .NET 1.1 framework and that you are - running the your application on the MS .NET 1.1 runtime. On all other platforms only sending - unauthenticated messages to a server listening on port 25 (the default) is supported. - - - Authentication is supported by setting the property to - either or . - If using authentication then the - and properties must also be set. - - - To set the SMTP server port use the property. The default port is 25. - - - Nicko Cadell - Gert Driesen - - - - Default constructor - - - - Default constructor - - - - - - Sends the contents of the cyclic buffer as an e-mail message. - - The logging events to send. - - - - Send the email message - - the body text to include in the mail - - - - Gets or sets a comma- or semicolon-delimited list of recipient e-mail addresses (use semicolon on .NET 1.1 and comma for later versions). - - - - For .NET 1.1 (System.Web.Mail): A semicolon-delimited list of e-mail addresses. - - - For .NET 2.0 (System.Net.Mail): A comma-delimited list of e-mail addresses. - - - - - For .NET 1.1 (System.Web.Mail): A semicolon-delimited list of e-mail addresses. - - - For .NET 2.0 (System.Net.Mail): A comma-delimited list of e-mail addresses. - - - - - - Gets or sets a comma- or semicolon-delimited list of recipient e-mail addresses - that will be carbon copied (use semicolon on .NET 1.1 and comma for later versions). - - - - For .NET 1.1 (System.Web.Mail): A semicolon-delimited list of e-mail addresses. - - - For .NET 2.0 (System.Net.Mail): A comma-delimited list of e-mail addresses. - - - - - For .NET 1.1 (System.Web.Mail): A semicolon-delimited list of e-mail addresses. - - - For .NET 2.0 (System.Net.Mail): A comma-delimited list of e-mail addresses. - - - - - - Gets or sets a semicolon-delimited list of recipient e-mail addresses - that will be blind carbon copied. - - - A semicolon-delimited list of e-mail addresses. - - - - A semicolon-delimited list of recipient e-mail addresses. - - - - - - Gets or sets the e-mail address of the sender. - - - The e-mail address of the sender. - - - - The e-mail address of the sender. - - - - - - Gets or sets the subject line of the e-mail message. - - - The subject line of the e-mail message. - - - - The subject line of the e-mail message. - - - - - - Gets or sets the name of the SMTP relay mail server to use to send - the e-mail messages. - - - The name of the e-mail relay server. If SmtpServer is not set, the - name of the local SMTP server is used. - - - - The name of the e-mail relay server. If SmtpServer is not set, the - name of the local SMTP server is used. - - - - - - Obsolete - - - Use the BufferingAppenderSkeleton Fix methods instead - - - - Obsolete property. - - - - - - The mode to use to authentication with the SMTP server - - - Authentication is only available on the MS .NET 1.1 runtime. - - Valid Authentication mode values are: , - , and . - The default value is . When using - you must specify the - and to use to authenticate. - When using the Windows credentials for the current - thread, if impersonating, or the process will be used to authenticate. - - - - - - The username to use to authenticate with the SMTP server - - - Authentication is only available on the MS .NET 1.1 runtime. - - A and must be specified when - is set to , - otherwise the username will be ignored. - - - - - - The password to use to authenticate with the SMTP server - - - Authentication is only available on the MS .NET 1.1 runtime. - - A and must be specified when - is set to , - otherwise the password will be ignored. - - - - - - The port on which the SMTP server is listening - - - Server Port is only available on the MS .NET 1.1 runtime. - - The port on which the SMTP server is listening. The default - port is 25. The Port can only be changed when running on - the MS .NET 1.1 runtime. - - - - - - Gets or sets the priority of the e-mail message - - - One of the values. - - - - Sets the priority of the e-mails generated by this - appender. The default priority is . - - - If you are using this appender to report errors then - you may want to set the priority to . - - - - - - Enable or disable use of SSL when sending e-mail message - - - This is available on MS .NET 2.0 runtime and higher - - - - - Gets or sets the reply-to e-mail address. - - - This is available on MS .NET 2.0 runtime and higher - - - - - Gets or sets the subject encoding to be used. - - - The default encoding is the operating system's current ANSI codepage. - - - - - Gets or sets the body encoding to be used. - - - The default encoding is the operating system's current ANSI codepage. - - - - - This appender requires a to be set. - - true - - - This appender requires a to be set. - - - - - - Values for the property. - - - - SMTP authentication modes. - - - - - - No authentication - - - - - Basic authentication. - - - Requires a username and password to be supplied - - - - - Integrated authentication - - - Uses the Windows credentials from the current thread or process to authenticate. - - - - - Send an email when a specific logging event occurs, typically on errors - or fatal errors. Rather than sending via smtp it writes a file into the - directory specified by . This allows services such - as the IIS SMTP agent to manage sending the messages. - - - - The configuration for this appender is identical to that of the SMTPAppender, - except that instead of specifying the SMTPAppender.SMTPHost you specify - . - - - The number of logging events delivered in this e-mail depend on - the value of option. The - keeps only the last - logging events in its - cyclic buffer. This keeps memory requirements at a reasonable level while - still delivering useful application context. - - - Niall Daley - Nicko Cadell - - - - Default constructor - - - - Default constructor - - - - - - Sends the contents of the cyclic buffer as an e-mail message. - - The logging events to send. - - - Sends the contents of the cyclic buffer as an e-mail message. - - - - - - Activate the options on this appender. - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - - - - Convert a path into a fully qualified path. - - The path to convert. - The fully qualified path. - - - Converts the path specified to a fully - qualified path. If the path is relative it is - taken as relative from the application base - directory. - - - - - - The security context to use for privileged calls - - - - - Gets or sets a semicolon-delimited list of recipient e-mail addresses. - - - A semicolon-delimited list of e-mail addresses. - - - - A semicolon-delimited list of e-mail addresses. - - - - - - Gets or sets the e-mail address of the sender. - - - The e-mail address of the sender. - - - - The e-mail address of the sender. - - - - - - Gets or sets the subject line of the e-mail message. - - - The subject line of the e-mail message. - - - - The subject line of the e-mail message. - - - - - - Gets or sets the path to write the messages to. - - - - Gets or sets the path to write the messages to. This should be the same - as that used by the agent sending the messages. - - - - - - Gets or sets the used to write to the pickup directory. - - - The used to write to the pickup directory. - - - - Unless a specified here for this appender - the is queried for the - security context to use. The default behavior is to use the security context - of the current thread. - - - - - - This appender requires a to be set. - - true - - - This appender requires a to be set. - - - - - - Appender that allows clients to connect via Telnet to receive log messages - - - - The TelnetAppender accepts socket connections and streams logging messages - back to the client. - The output is provided in a telnet-friendly way so that a log can be monitored - over a TCP/IP socket. - This allows simple remote monitoring of application logging. - - - The default is 23 (the telnet port). - - - Keith Long - Nicko Cadell - - - - Default constructor - - - - Default constructor - - - - - - The fully qualified type of the TelnetAppender class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Overrides the parent method to close the socket handler - - - - Closes all the outstanding connections. - - - - - - Initialize the appender based on the options set. - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - Create the socket handler and wait for connections - - - - - - Writes the logging event to each connected client. - - The event to log. - - - Writes the logging event to each connected client. - - - - - - Gets or sets the TCP port number on which this will listen for connections. - - - An integer value in the range to - indicating the TCP port number on which this will listen for connections. - - - - The default value is 23 (the telnet port). - - - The value specified is less than - or greater than . - - - - This appender requires a to be set. - - true - - - This appender requires a to be set. - - - - - - Helper class to manage connected clients - - - - The SocketHandler class is used to accept connections from - clients. It is threaded so that clients can connect/disconnect - asynchronously. - - - - - - Opens a new server port on - - the local port to listen on for connections - - - Creates a socket handler on the specified local server port. - - - - - - Sends a string message to each of the connected clients - - the text to send - - - Sends a string message to each of the connected clients - - - - - - Add a client to the internal clients list - - client to add - - - - Remove a client from the internal clients list - - client to remove - - - - Callback used to accept a connection on the server socket - - The result of the asynchronous operation - - - On connection adds to the list of connections - if there are two many open connections you will be disconnected - - - - - - Close all network connections - - - - Make sure we close all network connections - - - - - - Test if this handler has active connections - - - true if this handler has active connections - - - - This property will be true while this handler has - active connections, that is at least one connection that - the handler will attempt to send a message to. - - - - - - Class that represents a client connected to this handler - - - - Class that represents a client connected to this handler - - - - - - Create this for the specified - - the client's socket - - - Opens a stream writer on the socket. - - - - - - Write a string to the client - - string to send - - - Write a string to the client - - - - - - Cleanup the clients connection - - - - Close the socket connection. - - - - - - Appends log events to the system. - - - - The application configuration file can be used to control what listeners - are actually used. See the MSDN documentation for the - class for details on configuring the - trace system. - - - Events are written using the System.Diagnostics.Trace.Write(string,string) - method. The event's logger name is the default value for the category parameter - of the Write method. - - - Compact Framework
      - The Compact Framework does not support the - class for any operation except Assert. When using the Compact Framework this - appender will write to the system rather than - the Trace system. This appender will therefore behave like the . -
      -
      - Douglas de la Torre - Nicko Cadell - Gert Driesen - Ron Grabowski -
      - - - Initializes a new instance of the . - - - - Default constructor. - - - - - - Initializes a new instance of the - with a specified layout. - - The layout to use with this appender. - - - Obsolete constructor. - - - - - - Writes the logging event to the system. - - The event to log. - - - Writes the logging event to the system. - - - - - - Immediate flush means that the underlying writer or output stream - will be flushed at the end of each append operation. - - - - Immediate flush is slower but ensures that each append request is - actually written. If is set to - false, then there is a good chance that the last few - logs events are not actually written to persistent media if and - when the application crashes. - - - The default value is true. - - - - - Defaults to %logger - - - - - Gets or sets a value that indicates whether the appender will - flush at the end of each write. - - - The default behavior is to flush at the end of each - write. If the option is set tofalse, then the underlying - stream can defer writing to physical medium to a later time. - - - Avoiding the flush operation at the end of each append results - in a performance gain of 10 to 20 percent. However, there is safety - trade-off involved in skipping flushing. Indeed, when flushing is - skipped, then it is likely that the last few log events will not - be recorded on disk when the application exits. This is a high - price to pay even for a 20% performance gain. - - - - - - The category parameter sent to the Trace method. - - - - Defaults to %logger which will use the logger name of the current - as the category parameter. - - - - - - - - This appender requires a to be set. - - true - - - This appender requires a to be set. - - - - - - Assembly level attribute that specifies a domain to alias to this assembly's repository. - - - - AliasDomainAttribute is obsolete. Use AliasRepositoryAttribute instead of AliasDomainAttribute. - - - An assembly's logger repository is defined by its , - however this can be overridden by an assembly loaded before the target assembly. - - - An assembly can alias another assembly's domain to its repository by - specifying this attribute with the name of the target domain. - - - This attribute can only be specified on the assembly and may be used - as many times as necessary to alias all the required domains. - - - Nicko Cadell - Gert Driesen - - - - Assembly level attribute that specifies a repository to alias to this assembly's repository. - - - - An assembly's logger repository is defined by its , - however this can be overridden by an assembly loaded before the target assembly. - - - An assembly can alias another assembly's repository to its repository by - specifying this attribute with the name of the target repository. - - - This attribute can only be specified on the assembly and may be used - as many times as necessary to alias all the required repositories. - - - Nicko Cadell - Gert Driesen - - - - Initializes a new instance of the class with - the specified repository to alias to this assembly's repository. - - The repository to alias to this assemby's repository. - - - Initializes a new instance of the class with - the specified repository to alias to this assembly's repository. - - - - - - Gets or sets the repository to alias to this assemby's repository. - - - The repository to alias to this assemby's repository. - - - - The name of the repository to alias to this assemby's repository. - - - - - - Initializes a new instance of the class with - the specified domain to alias to this assembly's repository. - - The domain to alias to this assemby's repository. - - - Obsolete. Use instead of . - - - - - - Use this class to quickly configure a . - - - - Allows very simple programmatic configuration of log4net. - - - Only one appender can be configured using this configurator. - The appender is set at the root of the hierarchy and all logging - events will be delivered to that appender. - - - Appenders can also implement the interface. Therefore - they would require that the method - be called after the appenders properties have been configured. - - - Nicko Cadell - Gert Driesen - - - - The fully qualified type of the BasicConfigurator class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Initializes a new instance of the class. - - - - Uses a private access modifier to prevent instantiation of this class. - - - - - - Initializes the log4net system with a default configuration. - - - - Initializes the log4net logging system using a - that will write to Console.Out. The log messages are - formatted using the layout object - with the - layout style. - - - - - - Initializes the log4net system using the specified appender. - - The appender to use to log all logging events. - - - Initializes the log4net system using the specified appender. - - - - - - Initializes the log4net system using the specified appenders. - - The appenders to use to log all logging events. - - - Initializes the log4net system using the specified appenders. - - - - - - Initializes the with a default configuration. - - The repository to configure. - - - Initializes the specified repository using a - that will write to Console.Out. The log messages are - formatted using the layout object - with the - layout style. - - - - - - Initializes the using the specified appender. - - The repository to configure. - The appender to use to log all logging events. - - - Initializes the using the specified appender. - - - - - - Initializes the using the specified appenders. - - The repository to configure. - The appenders to use to log all logging events. - - - Initializes the using the specified appender. - - - - - - Base class for all log4net configuration attributes. - - - This is an abstract class that must be extended by - specific configurators. This attribute allows the - configurator to be parameterized by an assembly level - attribute. - - Nicko Cadell - Gert Driesen - - - - Constructor used by subclasses. - - the ordering priority for this configurator - - - The is used to order the configurator - attributes before they are invoked. Higher priority configurators are executed - before lower priority ones. - - - - - - Configures the for the specified assembly. - - The assembly that this attribute was defined on. - The repository to configure. - - - Abstract method implemented by a subclass. When this method is called - the subclass should configure the . - - - - - - Compare this instance to another ConfiguratorAttribute - - the object to compare to - see - - - Compares the priorities of the two instances. - Sorts by priority in descending order. Objects with the same priority are - randomly ordered. - - - - - - Assembly level attribute that specifies the logging domain for the assembly. - - - - DomainAttribute is obsolete. Use RepositoryAttribute instead of DomainAttribute. - - - Assemblies are mapped to logging domains. Each domain has its own - logging repository. This attribute specified on the assembly controls - the configuration of the domain. The property specifies the name - of the domain that this assembly is a part of. The - specifies the type of the repository objects to create for the domain. If - this attribute is not specified and a is not specified - then the assembly will be part of the default shared logging domain. - - - This attribute can only be specified on the assembly and may only be used - once per assembly. - - - Nicko Cadell - Gert Driesen - - - - Assembly level attribute that specifies the logging repository for the assembly. - - - - Assemblies are mapped to logging repository. This attribute specified - on the assembly controls - the configuration of the repository. The property specifies the name - of the repository that this assembly is a part of. The - specifies the type of the object - to create for the assembly. If this attribute is not specified or a - is not specified then the assembly will be part of the default shared logging repository. - - - This attribute can only be specified on the assembly and may only be used - once per assembly. - - - Nicko Cadell - Gert Driesen - - - - Initializes a new instance of the class. - - - - Default constructor. - - - - - - Initialize a new instance of the class - with the name of the repository. - - The name of the repository. - - - Initialize the attribute with the name for the assembly's repository. - - - - - - Gets or sets the name of the logging repository. - - - The string name to use as the name of the repository associated with this - assembly. - - - - This value does not have to be unique. Several assemblies can share the - same repository. They will share the logging configuration of the repository. - - - - - - Gets or sets the type of repository to create for this assembly. - - - The type of repository to create for this assembly. - - - - The type of the repository to create for the assembly. - The type must implement the - interface. - - - This will be the type of repository created when - the repository is created. If multiple assemblies reference the - same repository then the repository is only created once using the - of the first assembly to call into the - repository. - - - - - - Initializes a new instance of the class. - - - - Obsolete. Use RepositoryAttribute instead of DomainAttribute. - - - - - - Initialize a new instance of the class - with the name of the domain. - - The name of the domain. - - - Obsolete. Use RepositoryAttribute instead of DomainAttribute. - - - - - - Use this class to initialize the log4net environment using an Xml tree. - - - - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. - - - Configures a using an Xml tree. - - - Nicko Cadell - Gert Driesen - - - - Private constructor - - - - - Automatically configures the log4net system based on the - application's configuration settings. - - - - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. - - Each application has a configuration file. This has the - same name as the application with '.config' appended. - This file is XML and calling this function prompts the - configurator to look in that file for a section called - log4net that contains the configuration data. - - - - - Automatically configures the using settings - stored in the application's configuration file. - - - - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. - - Each application has a configuration file. This has the - same name as the application with '.config' appended. - This file is XML and calling this function prompts the - configurator to look in that file for a section called - log4net that contains the configuration data. - - The repository to configure. - - - - Configures log4net using a log4net element - - - - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. - - Loads the log4net configuration from the XML element - supplied as . - - The element to parse. - - - - Configures the using the specified XML - element. - - - - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. - - Loads the log4net configuration from the XML element - supplied as . - - The repository to configure. - The element to parse. - - - - Configures log4net using the specified configuration file. - - The XML file to load the configuration from. - - - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. - - - The configuration file must be valid XML. It must contain - at least one element called log4net that holds - the log4net configuration data. - - - The log4net configuration file can possible be specified in the application's - configuration file (either MyAppName.exe.config for a - normal application on Web.config for an ASP.NET application). - - - The following example configures log4net using a configuration file, of which the - location is stored in the application's configuration file : - - - using log4net.Config; - using System.IO; - using System.Configuration; - - ... - - DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); - - - In the .config file, the path to the log4net can be specified like this : - - - - - - - - - - - - - Configures log4net using the specified configuration file. - - A stream to load the XML configuration from. - - - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. - - - The configuration data must be valid XML. It must contain - at least one element called log4net that holds - the log4net configuration data. - - - Note that this method will NOT close the stream parameter. - - - - - - Configures the using the specified configuration - file. - - The repository to configure. - The XML file to load the configuration from. - - - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. - - - The configuration file must be valid XML. It must contain - at least one element called log4net that holds - the configuration data. - - - The log4net configuration file can possible be specified in the application's - configuration file (either MyAppName.exe.config for a - normal application on Web.config for an ASP.NET application). - - - The following example configures log4net using a configuration file, of which the - location is stored in the application's configuration file : - - - using log4net.Config; - using System.IO; - using System.Configuration; - - ... - - DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); - - - In the .config file, the path to the log4net can be specified like this : - - - - - - - - - - - - - Configures the using the specified configuration - file. - - The repository to configure. - The stream to load the XML configuration from. - - - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. - - - The configuration data must be valid XML. It must contain - at least one element called log4net that holds - the configuration data. - - - Note that this method will NOT close the stream parameter. - - - - - - Configures log4net using the file specified, monitors the file for changes - and reloads the configuration if a change is detected. - - The XML file to load the configuration from. - - - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. - - - The configuration file must be valid XML. It must contain - at least one element called log4net that holds - the configuration data. - - - The configuration file will be monitored using a - and depends on the behavior of that class. - - - For more information on how to configure log4net using - a separate configuration file, see . - - - - - - - Configures the using the file specified, - monitors the file for changes and reloads the configuration if a change - is detected. - - The repository to configure. - The XML file to load the configuration from. - - - DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. - - - The configuration file must be valid XML. It must contain - at least one element called log4net that holds - the configuration data. - - - The configuration file will be monitored using a - and depends on the behavior of that class. - - - For more information on how to configure log4net using - a separate configuration file, see . - - - - - - - Assembly level attribute to configure the . - - - - AliasDomainAttribute is obsolete. Use AliasRepositoryAttribute instead of AliasDomainAttribute. - - - This attribute may only be used at the assembly scope and can only - be used once per assembly. - - - Use this attribute to configure the - without calling one of the - methods. - - - Nicko Cadell - Gert Driesen - - - - Assembly level attribute to configure the . - - - - This attribute may only be used at the assembly scope and can only - be used once per assembly. - - - Use this attribute to configure the - without calling one of the - methods. - - - If neither of the or - properties are set the configuration is loaded from the application's .config file. - If set the property takes priority over the - property. The property - specifies a path to a file to load the config from. The path is relative to the - application's base directory; . - The property is used as a postfix to the assembly file name. - The config file must be located in the application's base directory; . - For example in a console application setting the to - config has the same effect as not specifying the or - properties. - - - The property can be set to cause the - to watch the configuration file for changes. - - - - Log4net will only look for assembly level configuration attributes once. - When using the log4net assembly level attributes to control the configuration - of log4net you must ensure that the first call to any of the - methods is made from the assembly with the configuration - attributes. - - - If you cannot guarantee the order in which log4net calls will be made from - different assemblies you must use programmatic configuration instead, i.e. - call the method directly. - - - - Nicko Cadell - Gert Driesen - - - - Default constructor - - - - Default constructor - - - - - - Configures the for the specified assembly. - - The assembly that this attribute was defined on. - The repository to configure. - - - Configure the repository using the . - The specified must extend the - class otherwise the will not be able to - configure it. - - - The does not extend . - - - - Attempt to load configuration from the local file system - - The assembly that this attribute was defined on. - The repository to configure. - - - - Configure the specified repository using a - - The repository to configure. - the FileInfo pointing to the config file - - - - Attempt to load configuration from a URI - - The assembly that this attribute was defined on. - The repository to configure. - - - - The fully qualified type of the XmlConfiguratorAttribute class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Gets or sets the filename of the configuration file. - - - The filename of the configuration file. - - - - If specified, this is the name of the configuration file to use with - the . This file path is relative to the - application base directory (). - - - The takes priority over the . - - - - - - Gets or sets the extension of the configuration file. - - - The extension of the configuration file. - - - - If specified this is the extension for the configuration file. - The path to the config file is built by using the application - base directory (), - the assembly file name and the config file extension. - - - If the is set to MyExt then - possible config file names would be: MyConsoleApp.exe.MyExt or - MyClassLibrary.dll.MyExt. - - - The takes priority over the . - - - - - - Gets or sets a value indicating whether to watch the configuration file. - - - true if the configuration should be watched, false otherwise. - - - - If this flag is specified and set to true then the framework - will watch the configuration file and will reload the config each time - the file is modified. - - - The config file can only be watched if it is loaded from local disk. - In a No-Touch (Smart Client) deployment where the application is downloaded - from a web server the config file may not reside on the local disk - and therefore it may not be able to watch it. - - - Watching configuration is not supported on the SSCLI. - - - - - - Class to register for the log4net section of the configuration file - - - The log4net section of the configuration file needs to have a section - handler registered. This is the section handler used. It simply returns - the XML element that is the root of the section. - - - Example of registering the log4net section handler : - - - -
      - - - log4net configuration XML goes here - - - - - Nicko Cadell - Gert Driesen - - - - Initializes a new instance of the class. - - - - Default constructor. - - - - - - Parses the configuration section. - - The configuration settings in a corresponding parent configuration section. - The configuration context when called from the ASP.NET configuration system. Otherwise, this parameter is reserved and is a null reference. - The for the log4net section. - The for the log4net section. - - - Returns the containing the configuration data, - - - - - - Assembly level attribute that specifies a plugin to attach to - the repository. - - - - Specifies the type of a plugin to create and attach to the - assembly's repository. The plugin type must implement the - interface. - - - Nicko Cadell - Gert Driesen - - - - Interface used to create plugins. - - - - Interface used to create a plugin. - - - Nicko Cadell - Gert Driesen - - - - Creates the plugin object. - - the new plugin instance - - - Create and return a new plugin instance. - - - - - - Initializes a new instance of the class - with the specified type. - - The type name of plugin to create. - - - Create the attribute with the plugin type specified. - - - Where possible use the constructor that takes a . - - - - - - Initializes a new instance of the class - with the specified type. - - The type of plugin to create. - - - Create the attribute with the plugin type specified. - - - - - - Creates the plugin object defined by this attribute. - - - - Creates the instance of the object as - specified by this attribute. - - - The plugin object. - - - - Returns a representation of the properties of this object. - - - - Overrides base class method to - return a representation of the properties of this object. - - - A representation of the properties of this object - - - - Gets or sets the type for the plugin. - - - The type for the plugin. - - - - The type for the plugin. - - - - - - Gets or sets the type name for the plugin. - - - The type name for the plugin. - - - - The type name for the plugin. - - - Where possible use the property instead. - - - - - - Assembly level attribute to configure the . - - - - This attribute may only be used at the assembly scope and can only - be used once per assembly. - - - Use this attribute to configure the - without calling one of the - methods. - - - Nicko Cadell - - - - Construct provider attribute with type specified - - the type of the provider to use - - - The provider specified must subclass the - class. - - - - - - Configures the SecurityContextProvider - - The assembly that this attribute was defined on. - The repository to configure. - - - Creates a provider instance from the specified. - Sets this as the default security context provider . - - - - - - The fully qualified type of the SecurityContextProviderAttribute class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Gets or sets the type of the provider to use. - - - the type of the provider to use. - - - - The provider specified must subclass the - class. - - - - - - Use this class to initialize the log4net environment using an Xml tree. - - - - Configures a using an Xml tree. - - - Nicko Cadell - Gert Driesen - - - - Private constructor - - - - - Automatically configures the log4net system based on the - application's configuration settings. - - - - Each application has a configuration file. This has the - same name as the application with '.config' appended. - This file is XML and calling this function prompts the - configurator to look in that file for a section called - log4net that contains the configuration data. - - - To use this method to configure log4net you must specify - the section - handler for the log4net configuration section. See the - for an example. - - - - - - - Automatically configures the using settings - stored in the application's configuration file. - - - - Each application has a configuration file. This has the - same name as the application with '.config' appended. - This file is XML and calling this function prompts the - configurator to look in that file for a section called - log4net that contains the configuration data. - - - To use this method to configure log4net you must specify - the section - handler for the log4net configuration section. See the - for an example. - - - The repository to configure. - - - - Configures log4net using a log4net element - - - - Loads the log4net configuration from the XML element - supplied as . - - - The element to parse. - - - - Configures the using the specified XML - element. - - - Loads the log4net configuration from the XML element - supplied as . - - The repository to configure. - The element to parse. - - - - Configures log4net using the specified configuration file. - - The XML file to load the configuration from. - - - The configuration file must be valid XML. It must contain - at least one element called log4net that holds - the log4net configuration data. - - - The log4net configuration file can possible be specified in the application's - configuration file (either MyAppName.exe.config for a - normal application on Web.config for an ASP.NET application). - - - The first element matching <configuration> will be read as the - configuration. If this file is also a .NET .config file then you must specify - a configuration section for the log4net element otherwise .NET will - complain. Set the type for the section handler to , for example: - - -
      - - - - - The following example configures log4net using a configuration file, of which the - location is stored in the application's configuration file : - - - using log4net.Config; - using System.IO; - using System.Configuration; - - ... - - XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); - - - In the .config file, the path to the log4net can be specified like this : - - - - - - - - - - - - - Configures log4net using the specified configuration URI. - - A URI to load the XML configuration from. - - - The configuration data must be valid XML. It must contain - at least one element called log4net that holds - the log4net configuration data. - - - The must support the URI scheme specified. - - - - - - Configures log4net using the specified configuration data stream. - - A stream to load the XML configuration from. - - - The configuration data must be valid XML. It must contain - at least one element called log4net that holds - the log4net configuration data. - - - Note that this method will NOT close the stream parameter. - - - - - - Configures the using the specified configuration - file. - - The repository to configure. - The XML file to load the configuration from. - - - The configuration file must be valid XML. It must contain - at least one element called log4net that holds - the configuration data. - - - The log4net configuration file can possible be specified in the application's - configuration file (either MyAppName.exe.config for a - normal application on Web.config for an ASP.NET application). - - - The first element matching <configuration> will be read as the - configuration. If this file is also a .NET .config file then you must specify - a configuration section for the log4net element otherwise .NET will - complain. Set the type for the section handler to , for example: - - -
      - - - - - The following example configures log4net using a configuration file, of which the - location is stored in the application's configuration file : - - - using log4net.Config; - using System.IO; - using System.Configuration; - - ... - - XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); - - - In the .config file, the path to the log4net can be specified like this : - - - - - - - - - - - - - Configures the using the specified configuration - URI. - - The repository to configure. - A URI to load the XML configuration from. - - - The configuration data must be valid XML. It must contain - at least one element called log4net that holds - the configuration data. - - - The must support the URI scheme specified. - - - - - - Configures the using the specified configuration - file. - - The repository to configure. - The stream to load the XML configuration from. - - - The configuration data must be valid XML. It must contain - at least one element called log4net that holds - the configuration data. - - - Note that this method will NOT close the stream parameter. - - - - - - Configures log4net using the file specified, monitors the file for changes - and reloads the configuration if a change is detected. - - The XML file to load the configuration from. - - - The configuration file must be valid XML. It must contain - at least one element called log4net that holds - the configuration data. - - - The configuration file will be monitored using a - and depends on the behavior of that class. - - - For more information on how to configure log4net using - a separate configuration file, see . - - - - - - - Configures the using the file specified, - monitors the file for changes and reloads the configuration if a change - is detected. - - The repository to configure. - The XML file to load the configuration from. - - - The configuration file must be valid XML. It must contain - at least one element called log4net that holds - the configuration data. - - - The configuration file will be monitored using a - and depends on the behavior of that class. - - - For more information on how to configure log4net using - a separate configuration file, see . - - - - - - - Configures the specified repository using a log4net element. - - The hierarchy to configure. - The element to parse. - - - Loads the log4net configuration from the XML element - supplied as . - - - This method is ultimately called by one of the Configure methods - to load the configuration from an . - - - - - - Maps repository names to ConfigAndWatchHandler instances to allow a particular - ConfigAndWatchHandler to dispose of its FileSystemWatcher when a repository is - reconfigured. - - - - - The fully qualified type of the XmlConfigurator class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Class used to watch config files. - - - - Uses the to monitor - changes to a specified file. Because multiple change notifications - may be raised when the file is modified, a timer is used to - compress the notifications into a single event. The timer - waits for time before delivering - the event notification. If any further - change notifications arrive while the timer is waiting it - is reset and waits again for to - elapse. - - - - - - The default amount of time to wait after receiving notification - before reloading the config file. - - - - - Holds the FileInfo used to configure the XmlConfigurator - - - - - Holds the repository being configured. - - - - - The timer used to compress the notification events. - - - - - Watches file for changes. This object should be disposed when no longer - needed to free system handles on the watched resources. - - - - - Initializes a new instance of the class to - watch a specified config file used to configure a repository. - - The repository to configure. - The configuration file to watch. - - - Initializes a new instance of the class. - - - - - - Event handler used by . - - The firing the event. - The argument indicates the file that caused the event to be fired. - - - This handler reloads the configuration from the file when the event is fired. - - - - - - Event handler used by . - - The firing the event. - The argument indicates the file that caused the event to be fired. - - - This handler reloads the configuration from the file when the event is fired. - - - - - - Called by the timer when the configuration has been updated. - - null - - - - Release the handles held by the watcher and timer. - - - - - The implementation of the interface suitable - for use with the compact framework - - - - This implementation is a simple - mapping between repository name and - object. - - - The .NET Compact Framework 1.0 does not support retrieving assembly - level attributes therefore unlike the DefaultRepositorySelector - this selector does not examine the calling assembly for attributes. - - - Nicko Cadell - - - - Interface used by the to select the . - - - - The uses a - to specify the policy for selecting the correct - to return to the caller. - - - Nicko Cadell - Gert Driesen - - - - Gets the for the specified assembly. - - The assembly to use to lookup to the - The for the assembly. - - - Gets the for the specified assembly. - - - How the association between and - is made is not defined. The implementation may choose any method for - this association. The results of this method must be repeatable, i.e. - when called again with the same arguments the result must be the - save value. - - - - - - Gets the named . - - The name to use to lookup to the . - The named - - Lookup a named . This is the repository created by - calling . - - - - - Creates a new repository for the assembly specified. - - The assembly to use to create the domain to associate with the . - The type of repository to create, must implement . - The repository created. - - - The created will be associated with the domain - specified such that a call to with the - same assembly specified will return the same repository instance. - - - How the association between and - is made is not defined. The implementation may choose any method for - this association. - - - - - - Creates a new repository with the name specified. - - The name to associate with the . - The type of repository to create, must implement . - The repository created. - - - The created will be associated with the name - specified such that a call to with the - same name will return the same repository instance. - - - - - - Test if a named repository exists - - the named repository to check - true if the repository exists - - - Test if a named repository exists. Use - to create a new repository and to retrieve - a repository. - - - - - - Gets an array of all currently defined repositories. - - - An array of the instances created by - this . - - - Gets an array of all of the repositories created by this selector. - - - - - - Event to notify that a logger repository has been created. - - - Event to notify that a logger repository has been created. - - - - Event raised when a new repository is created. - The event source will be this selector. The event args will - be a which - holds the newly created . - - - - - - Create a new repository selector - - the type of the repositories to create, must implement - - - Create an new compact repository selector. - The default type for repositories must be specified, - an appropriate value would be . - - - throw if is null - throw if does not implement - - - - Get the for the specified assembly - - not used - The default - - - The argument is not used. This selector does not create a - separate repository for each assembly. - - - As a named repository is not specified the default repository is - returned. The default repository is named log4net-default-repository. - - - - - - Get the named - - the name of the repository to lookup - The named - - - Get the named . The default - repository is log4net-default-repository. Other repositories - must be created using the . - If the named repository does not exist an exception is thrown. - - - throw if is null - throw if the does not exist - - - - Create a new repository for the assembly specified - - not used - the type of repository to create, must implement - the repository created - - - The argument is not used. This selector does not create a - separate repository for each assembly. - - - If the is null then the - default repository type specified to the constructor is used. - - - As a named repository is not specified the default repository is - returned. The default repository is named log4net-default-repository. - - - - - - Create a new repository for the repository specified - - the repository to associate with the - the type of repository to create, must implement . - If this param is null then the default repository type is used. - the repository created - - - The created will be associated with the repository - specified such that a call to with the - same repository specified will return the same repository instance. - - - If the named repository already exists an exception will be thrown. - - - If is null then the default - repository type specified to the constructor is used. - - - throw if is null - throw if the already exists - - - - Test if a named repository exists - - the named repository to check - true if the repository exists - - - Test if a named repository exists. Use - to create a new repository and to retrieve - a repository. - - - - - - Gets a list of objects - - an array of all known objects - - - Gets an array of all of the repositories created by this selector. - - - - - - The fully qualified type of the CompactRepositorySelector class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Notify the registered listeners that the repository has been created - - The repository that has been created - - - Raises the LoggerRepositoryCreatedEvent - event. - - - - - - Event to notify that a logger repository has been created. - - - Event to notify that a logger repository has been created. - - - - Event raised when a new repository is created. - The event source will be this selector. The event args will - be a which - holds the newly created . - - - - - - The default implementation of the interface. - - - - Uses attributes defined on the calling assembly to determine how to - configure the hierarchy for the repository. - - - Nicko Cadell - Gert Driesen - - - - Creates a new repository selector. - - The type of the repositories to create, must implement - - - Create an new repository selector. - The default type for repositories must be specified, - an appropriate value would be . - - - is . - does not implement . - - - - Gets the for the specified assembly. - - The assembly use to lookup the . - - - The type of the created and the repository - to create can be overridden by specifying the - attribute on the . - - - The default values are to use the - implementation of the interface and to use the - as the name of the repository. - - - The created will be automatically configured using - any attributes defined on - the . - - - The for the assembly - is . - - - - Gets the for the specified repository. - - The repository to use to lookup the . - The for the specified repository. - - - Returns the named repository. If is null - a is thrown. If the repository - does not exist a is thrown. - - - Use to create a repository. - - - is . - does not exist. - - - - Create a new repository for the assembly specified - - the assembly to use to create the repository to associate with the . - The type of repository to create, must implement . - The repository created. - - - The created will be associated with the repository - specified such that a call to with the - same assembly specified will return the same repository instance. - - - The type of the created and - the repository to create can be overridden by specifying the - attribute on the - . The default values are to use the - implementation of the - interface and to use the - as the name of the repository. - - - The created will be automatically - configured using any - attributes defined on the . - - - If a repository for the already exists - that repository will be returned. An error will not be raised and that - repository may be of a different type to that specified in . - Also the attribute on the - assembly may be used to override the repository type specified in - . - - - is . - - - - Creates a new repository for the assembly specified. - - the assembly to use to create the repository to associate with the . - The type of repository to create, must implement . - The name to assign to the created repository - Set to true to read and apply the assembly attributes - The repository created. - - - The created will be associated with the repository - specified such that a call to with the - same assembly specified will return the same repository instance. - - - The type of the created and - the repository to create can be overridden by specifying the - attribute on the - . The default values are to use the - implementation of the - interface and to use the - as the name of the repository. - - - The created will be automatically - configured using any - attributes defined on the . - - - If a repository for the already exists - that repository will be returned. An error will not be raised and that - repository may be of a different type to that specified in . - Also the attribute on the - assembly may be used to override the repository type specified in - . - - - is . - - - - Creates a new repository for the specified repository. - - The repository to associate with the . - The type of repository to create, must implement . - If this param is then the default repository type is used. - The new repository. - - - The created will be associated with the repository - specified such that a call to with the - same repository specified will return the same repository instance. - - - is . - already exists. - - - - Test if a named repository exists - - the named repository to check - true if the repository exists - - - Test if a named repository exists. Use - to create a new repository and to retrieve - a repository. - - - - - - Gets a list of objects - - an array of all known objects - - - Gets an array of all of the repositories created by this selector. - - - - - - Aliases a repository to an existing repository. - - The repository to alias. - The repository that the repository is aliased to. - - - The repository specified will be aliased to the repository when created. - The repository must not already exist. - - - When the repository is created it must utilize the same repository type as - the repository it is aliased to, otherwise the aliasing will fail. - - - - is . - -or- - is . - - - - - Notifies the registered listeners that the repository has been created. - - The repository that has been created. - - - Raises the event. - - - - - - Gets the repository name and repository type for the specified assembly. - - The assembly that has a . - in/out param to hold the repository name to use for the assembly, caller should set this to the default value before calling. - in/out param to hold the type of the repository to create for the assembly, caller should set this to the default value before calling. - is . - - - - Configures the repository using information from the assembly. - - The assembly containing - attributes which define the configuration for the repository. - The repository to configure. - - is . - -or- - is . - - - - - Loads the attribute defined plugins on the assembly. - - The assembly that contains the attributes. - The repository to add the plugins to. - - is . - -or- - is . - - - - - Loads the attribute defined aliases on the assembly. - - The assembly that contains the attributes. - The repository to alias to. - - is . - -or- - is . - - - - - The fully qualified type of the DefaultRepositorySelector class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Event to notify that a logger repository has been created. - - - Event to notify that a logger repository has been created. - - - - Event raised when a new repository is created. - The event source will be this selector. The event args will - be a which - holds the newly created . - - - - - - Defined error codes that can be passed to the method. - - - - Values passed to the method. - - - Nicko Cadell - - - - A general error - - - - - Error while writing output - - - - - Failed to flush file - - - - - Failed to close file - - - - - Unable to open output file - - - - - No layout specified - - - - - Failed to parse address - - - - - An evaluator that triggers on an Exception type - - - - This evaluator will trigger if the type of the Exception - passed to - is equal to a Type in . /// - - - Drew Schaeffer - - - - Test if an triggers an action - - - - Implementations of this interface allow certain appenders to decide - when to perform an appender specific action. - - - The action or behavior triggered is defined by the implementation. - - - Nicko Cadell - - - - Test if this event triggers the action - - The event to check - true if this event triggers the action, otherwise false - - - Return true if this event triggers the action - - - - - - The type that causes the trigger to fire. - - - - - Causes subclasses of to cause the trigger to fire. - - - - - Default ctor to allow dynamic creation through a configurator. - - - - - Constructs an evaluator and initializes to trigger on - - the type that triggers this evaluator. - If true, this evaluator will trigger on subclasses of . - - - - Is this the triggering event? - - The event to check - This method returns true, if the logging event Exception - Type is . - Otherwise it returns false - - - This evaluator will trigger if the Exception Type of the event - passed to - is . - - - - - - The type that triggers this evaluator. - - - - - If true, this evaluator will trigger on subclasses of . - - - - - Appenders may delegate their error handling to an . - - - - Error handling is a particularly tedious to get right because by - definition errors are hard to predict and to reproduce. - - - Nicko Cadell - Gert Driesen - - - - Handles the error and information about the error condition is passed as - a parameter. - - The message associated with the error. - The that was thrown when the error occurred. - The error code associated with the error. - - - Handles the error and information about the error condition is passed as - a parameter. - - - - - - Prints the error message passed as a parameter. - - The message associated with the error. - The that was thrown when the error occurred. - - - See . - - - - - - Prints the error message passed as a parameter. - - The message associated with the error. - - - See . - - - - - - Interface for objects that require fixing. - - - - Interface that indicates that the object requires fixing before it - can be taken outside the context of the appender's - method. - - - When objects that implement this interface are stored - in the context properties maps - and - are fixed - (see ) the - method will be called. - - - Nicko Cadell - - - - Get a portable version of this object - - the portable instance of this object - - - Get a portable instance object that represents the current - state of this object. The portable object can be stored - and logged from any thread with identical results. - - - - - - Interface that all loggers implement - - - - This interface supports logging events and testing if a level - is enabled for logging. - - - These methods will not throw exceptions. Note to implementor, ensure - that the implementation of these methods cannot allow an exception - to be thrown to the caller. - - - Nicko Cadell - Gert Driesen - - - - This generic form is intended to be used by wrappers. - - The declaring type of the method that is - the stack boundary into the logging system for this call. - The level of the message to be logged. - The message object to log. - the exception to log, including its stack trace. Pass null to not log an exception. - - - Generates a logging event for the specified using - the and . - - - - - - This is the most generic printing method that is intended to be used - by wrappers. - - The event being logged. - - - Logs the specified logging event through this logger. - - - - - - Checks if this logger is enabled for a given passed as parameter. - - The level to check. - - true if this logger is enabled for level, otherwise false. - - - - Test if this logger is going to log events of the specified . - - - - - - Gets the name of the logger. - - - The name of the logger. - - - - The name of this logger - - - - - - Gets the where this - Logger instance is attached to. - - - The that this logger belongs to. - - - - Gets the where this - Logger instance is attached to. - - - - - - Base interface for all wrappers - - - - Base interface for all wrappers. - - - All wrappers must implement this interface. - - - Nicko Cadell - - - - Get the implementation behind this wrapper object. - - - The object that in implementing this object. - - - - The object that in implementing this - object. The Logger object may not - be the same object as this object because of logger decorators. - This gets the actual underlying objects that is used to process - the log events. - - - - - - Delegate used to handle logger repository creation event notifications - - The which created the repository. - The event args - that holds the instance that has been created. - - - Delegate used to handle logger repository creation event notifications. - - - - - - Provides data for the event. - - - - A - event is raised every time a is created. - - - - - - The created - - - - - Construct instance using specified - - the that has been created - - - Construct instance using specified - - - - - - The that has been created - - - The that has been created - - - - The that has been created - - - - - - Defines the default set of levels recognized by the system. - - - - Each has an associated . - - - Levels have a numeric that defines the relative - ordering between levels. Two Levels with the same - are deemed to be equivalent. - - - The levels that are recognized by log4net are set for each - and each repository can have different levels defined. The levels are stored - in the on the repository. Levels are - looked up by name from the . - - - When logging at level INFO the actual level used is not but - the value of LoggerRepository.LevelMap["INFO"]. The default value for this is - , but this can be changed by reconfiguring the level map. - - - Each level has a in addition to its . The - is the string that is written into the output log. By default - the display name is the same as the level name, but this can be used to alias levels - or to localize the log output. - - - Some of the predefined levels recognized by the system are: - - - - . - - - . - - - . - - - . - - - . - - - . - - - . - - - - Nicko Cadell - Gert Driesen - - - - Constructor - - Integer value for this level, higher values represent more severe levels. - The string name of this level. - The display name for this level. This may be localized or otherwise different from the name - - - Initializes a new instance of the class with - the specified level name and value. - - - - - - Constructor - - Integer value for this level, higher values represent more severe levels. - The string name of this level. - - - Initializes a new instance of the class with - the specified level name and value. - - - - - - Returns the representation of the current - . - - - A representation of the current . - - - - Returns the level . - - - - - - Compares levels. - - The object to compare against. - true if the objects are equal. - - - Compares the levels of instances, and - defers to base class if the target object is not a - instance. - - - - - - Returns a hash code - - A hash code for the current . - - - Returns a hash code suitable for use in hashing algorithms and data - structures like a hash table. - - - Returns the hash code of the level . - - - - - - Compares this instance to a specified object and returns an - indication of their relative values. - - A instance or to compare with this instance. - - A 32-bit signed integer that indicates the relative order of the - values compared. The return value has these meanings: - - - Value - Meaning - - - Less than zero - This instance is less than . - - - Zero - This instance is equal to . - - - Greater than zero - - This instance is greater than . - -or- - is . - - - - - - - must be an instance of - or ; otherwise, an exception is thrown. - - - is not a . - - - - Returns a value indicating whether a specified - is greater than another specified . - - A - A - - true if is greater than - ; otherwise, false. - - - - Compares two levels. - - - - - - Returns a value indicating whether a specified - is less than another specified . - - A - A - - true if is less than - ; otherwise, false. - - - - Compares two levels. - - - - - - Returns a value indicating whether a specified - is greater than or equal to another specified . - - A - A - - true if is greater than or equal to - ; otherwise, false. - - - - Compares two levels. - - - - - - Returns a value indicating whether a specified - is less than or equal to another specified . - - A - A - - true if is less than or equal to - ; otherwise, false. - - - - Compares two levels. - - - - - - Returns a value indicating whether two specified - objects have the same value. - - A or . - A or . - - true if the value of is the same as the - value of ; otherwise, false. - - - - Compares two levels. - - - - - - Returns a value indicating whether two specified - objects have different values. - - A or . - A or . - - true if the value of is different from - the value of ; otherwise, false. - - - - Compares two levels. - - - - - - Compares two specified instances. - - The first to compare. - The second to compare. - - A 32-bit signed integer that indicates the relative order of the - two values compared. The return value has these meanings: - - - Value - Meaning - - - Less than zero - is less than . - - - Zero - is equal to . - - - Greater than zero - is greater than . - - - - - - Compares two levels. - - - - - - The level designates a higher level than all the rest. - - - - - The level designates very severe error events. - System unusable, emergencies. - - - - - The level designates very severe error events. - System unusable, emergencies. - - - - - The level designates very severe error events - that will presumably lead the application to abort. - - - - - The level designates very severe error events. - Take immediate action, alerts. - - - - - The level designates very severe error events. - Critical condition, critical. - - - - - The level designates very severe error events. - - - - - The level designates error events that might - still allow the application to continue running. - - - - - The level designates potentially harmful - situations. - - - - - The level designates informational messages - that highlight the progress of the application at the highest level. - - - - - The level designates informational messages that - highlight the progress of the application at coarse-grained level. - - - - - The level designates fine-grained informational - events that are most useful to debug an application. - - - - - The level designates fine-grained informational - events that are most useful to debug an application. - - - - - The level designates fine-grained informational - events that are most useful to debug an application. - - - - - The level designates fine-grained informational - events that are most useful to debug an application. - - - - - The level designates fine-grained informational - events that are most useful to debug an application. - - - - - The level designates fine-grained informational - events that are most useful to debug an application. - - - - - The level designates the lowest level possible. - - - - - Gets the name of this level. - - - The name of this level. - - - - Gets the name of this level. - - - - - - Gets the value of this level. - - - The value of this level. - - - - Gets the value of this level. - - - - - - Gets the display name of this level. - - - The display name of this level. - - - - Gets the display name of this level. - - - - - - A strongly-typed collection of objects. - - Nicko Cadell - - - - Creates a read-only wrapper for a LevelCollection instance. - - list to create a readonly wrapper arround - - A LevelCollection wrapper that is read-only. - - - - - Initializes a new instance of the LevelCollection class - that is empty and has the default initial capacity. - - - - - Initializes a new instance of the LevelCollection class - that has the specified initial capacity. - - - The number of elements that the new LevelCollection is initially capable of storing. - - - - - Initializes a new instance of the LevelCollection class - that contains elements copied from the specified LevelCollection. - - The LevelCollection whose elements are copied to the new collection. - - - - Initializes a new instance of the LevelCollection class - that contains elements copied from the specified array. - - The array whose elements are copied to the new list. - - - - Initializes a new instance of the LevelCollection class - that contains elements copied from the specified collection. - - The collection whose elements are copied to the new list. - - - - Allow subclasses to avoid our default constructors - - - - - - Copies the entire LevelCollection to a one-dimensional - array. - - The one-dimensional array to copy to. - - - - Copies the entire LevelCollection to a one-dimensional - array, starting at the specified index of the target array. - - The one-dimensional array to copy to. - The zero-based index in at which copying begins. - - - - Adds a to the end of the LevelCollection. - - The to be added to the end of the LevelCollection. - The index at which the value has been added. - - - - Removes all elements from the LevelCollection. - - - - - Creates a shallow copy of the . - - A new with a shallow copy of the collection data. - - - - Determines whether a given is in the LevelCollection. - - The to check for. - true if is found in the LevelCollection; otherwise, false. - - - - Returns the zero-based index of the first occurrence of a - in the LevelCollection. - - The to locate in the LevelCollection. - - The zero-based index of the first occurrence of - in the entire LevelCollection, if found; otherwise, -1. - - - - - Inserts an element into the LevelCollection at the specified index. - - The zero-based index at which should be inserted. - The to insert. - - is less than zero - -or- - is equal to or greater than . - - - - - Removes the first occurrence of a specific from the LevelCollection. - - The to remove from the LevelCollection. - - The specified was not found in the LevelCollection. - - - - - Removes the element at the specified index of the LevelCollection. - - The zero-based index of the element to remove. - - is less than zero - -or- - is equal to or greater than . - - - - - Returns an enumerator that can iterate through the LevelCollection. - - An for the entire LevelCollection. - - - - Adds the elements of another LevelCollection to the current LevelCollection. - - The LevelCollection whose elements should be added to the end of the current LevelCollection. - The new of the LevelCollection. - - - - Adds the elements of a array to the current LevelCollection. - - The array whose elements should be added to the end of the LevelCollection. - The new of the LevelCollection. - - - - Adds the elements of a collection to the current LevelCollection. - - The collection whose elements should be added to the end of the LevelCollection. - The new of the LevelCollection. - - - - Sets the capacity to the actual number of elements. - - - - - is less than zero - -or- - is equal to or greater than . - - - - - is less than zero - -or- - is equal to or greater than . - - - - - Gets the number of elements actually contained in the LevelCollection. - - - - - Gets a value indicating whether access to the collection is synchronized (thread-safe). - - true if access to the ICollection is synchronized (thread-safe); otherwise, false. - - - - Gets an object that can be used to synchronize access to the collection. - - - - - Gets or sets the at the specified index. - - The zero-based index of the element to get or set. - - is less than zero - -or- - is equal to or greater than . - - - - - Gets a value indicating whether the collection has a fixed size. - - true if the collection has a fixed size; otherwise, false. The default is false - - - - Gets a value indicating whether the IList is read-only. - - true if the collection is read-only; otherwise, false. The default is false - - - - Gets or sets the number of elements the LevelCollection can contain. - - - - - Supports type-safe iteration over a . - - - - - Advances the enumerator to the next element in the collection. - - - true if the enumerator was successfully advanced to the next element; - false if the enumerator has passed the end of the collection. - - - The collection was modified after the enumerator was created. - - - - - Sets the enumerator to its initial position, before the first element in the collection. - - - - - Gets the current element in the collection. - - - - - Type visible only to our subclasses - Used to access protected constructor - - - - - A value - - - - - Supports simple iteration over a . - - - - - Initializes a new instance of the Enumerator class. - - - - - - Advances the enumerator to the next element in the collection. - - - true if the enumerator was successfully advanced to the next element; - false if the enumerator has passed the end of the collection. - - - The collection was modified after the enumerator was created. - - - - - Sets the enumerator to its initial position, before the first element in the collection. - - - - - Gets the current element in the collection. - - - - - An evaluator that triggers at a threshold level - - - - This evaluator will trigger if the level of the event - passed to - is equal to or greater than the - level. - - - Nicko Cadell - - - - The threshold for triggering - - - - - Create a new evaluator using the threshold. - - - - Create a new evaluator using the threshold. - - - This evaluator will trigger if the level of the event - passed to - is equal to or greater than the - level. - - - - - - Create a new evaluator using the specified threshold. - - the threshold to trigger at - - - Create a new evaluator using the specified threshold. - - - This evaluator will trigger if the level of the event - passed to - is equal to or greater than the - level. - - - - - - Is this the triggering event? - - The event to check - This method returns true, if the event level - is equal or higher than the . - Otherwise it returns false - - - This evaluator will trigger if the level of the event - passed to - is equal to or greater than the - level. - - - - - - the threshold to trigger at - - - The that will cause this evaluator to trigger - - - - This evaluator will trigger if the level of the event - passed to - is equal to or greater than the - level. - - - - - - Mapping between string name and Level object - - - - Mapping between string name and object. - This mapping is held separately for each . - The level name is case insensitive. - - - Nicko Cadell - - - - Mapping from level name to Level object. The - level name is case insensitive - - - - - Construct the level map - - - - Construct the level map. - - - - - - Clear the internal maps of all levels - - - - Clear the internal maps of all levels - - - - - - Create a new Level and add it to the map - - the string to display for the Level - the level value to give to the Level - - - Create a new Level and add it to the map - - - - - - - Create a new Level and add it to the map - - the string to display for the Level - the level value to give to the Level - the display name to give to the Level - - - Create a new Level and add it to the map - - - - - - Add a Level to the map - - the Level to add - - - Add a Level to the map - - - - - - Lookup a named level from the map - - the name of the level to lookup is taken from this level. - If the level is not set on the map then this level is added - the level in the map with the name specified - - - Lookup a named level from the map. The name of the level to lookup is taken - from the property of the - argument. - - - If no level with the specified name is found then the - argument is added to the level map - and returned. - - - - - - Lookup a by name - - The name of the Level to lookup - a Level from the map with the name specified - - - Returns the from the - map with the name specified. If the no level is - found then null is returned. - - - - - - Return all possible levels as a list of Level objects. - - all possible levels as a list of Level objects - - - Return all possible levels as a list of Level objects. - - - - - - The internal representation of caller location information. - - - - This class uses the System.Diagnostics.StackTrace class to generate - a call stack. The caller's information is then extracted from this stack. - - - The System.Diagnostics.StackTrace class is not supported on the - .NET Compact Framework 1.0 therefore caller location information is not - available on that framework. - - - The System.Diagnostics.StackTrace class has this to say about Release builds: - - - "StackTrace information will be most informative with Debug build configurations. - By default, Debug builds include debug symbols, while Release builds do not. The - debug symbols contain most of the file, method name, line number, and column - information used in constructing StackFrame and StackTrace objects. StackTrace - might not report as many method calls as expected, due to code transformations - that occur during optimization." - - - This means that in a Release build the caller information may be incomplete or may - not exist at all! Therefore caller location information cannot be relied upon in a Release build. - - - Nicko Cadell - Gert Driesen - - - - When location information is not available the constant - NA is returned. Current value of this string - constant is ?. - - - - - Constructor - - The declaring type of the method that is - the stack boundary into the logging system for this call. - - - Initializes a new instance of the - class based on the current thread. - - - - - - Constructor - - The fully qualified class name. - The method name. - The file name. - The line number of the method within the file. - - - Initializes a new instance of the - class with the specified data. - - - - - - The fully qualified type of the LocationInfo class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Gets the fully qualified class name of the caller making the logging - request. - - - The fully qualified class name of the caller making the logging - request. - - - - Gets the fully qualified class name of the caller making the logging - request. - - - - - - Gets the file name of the caller. - - - The file name of the caller. - - - - Gets the file name of the caller. - - - - - - Gets the line number of the caller. - - - The line number of the caller. - - - - Gets the line number of the caller. - - - - - - Gets the method name of the caller. - - - The method name of the caller. - - - - Gets the method name of the caller. - - - - - - Gets all available caller information - - - All available caller information, in the format - fully.qualified.classname.of.caller.methodName(Filename:line) - - - - Gets all available caller information, in the format - fully.qualified.classname.of.caller.methodName(Filename:line) - - - - - - Gets the stack frames from the stack trace of the caller making the log request - - - - - Static manager that controls the creation of repositories - - - - Static manager that controls the creation of repositories - - - This class is used by the wrapper managers (e.g. ) - to provide access to the objects. - - - This manager also holds the that is used to - lookup and create repositories. The selector can be set either programmatically using - the property, or by setting the log4net.RepositorySelector - AppSetting in the applications config file to the fully qualified type name of the - selector to use. - - - Nicko Cadell - Gert Driesen - - - - Private constructor to prevent instances. Only static methods should be used. - - - - Private constructor to prevent instances. Only static methods should be used. - - - - - - Hook the shutdown event - - - - On the full .NET runtime, the static constructor hooks up the - AppDomain.ProcessExit and AppDomain.DomainUnload> events. - These are used to shutdown the log4net system as the application exits. - - - - - - Register for ProcessExit and DomainUnload events on the AppDomain - - - - This needs to be in a separate method because the events make - a LinkDemand for the ControlAppDomain SecurityPermission. Because - this is a LinkDemand it is demanded at JIT time. Therefore we cannot - catch the exception in the method itself, we have to catch it in the - caller. - - - - - - Return the default instance. - - the repository to lookup in - Return the default instance - - - Gets the for the repository specified - by the argument. - - - - - - Returns the default instance. - - The assembly to use to lookup the repository. - The default instance. - - - - Return the default instance. - - the repository to lookup in - Return the default instance - - - Gets the for the repository specified - by the argument. - - - - - - Returns the default instance. - - The assembly to use to lookup the repository. - The default instance. - - - Returns the default instance. - - - - - - Returns the named logger if it exists. - - The repository to lookup in. - The fully qualified logger name to look for. - - The logger found, or null if the named logger does not exist in the - specified repository. - - - - If the named logger exists (in the specified repository) then it - returns a reference to the logger, otherwise it returns - null. - - - - - - Returns the named logger if it exists. - - The assembly to use to lookup the repository. - The fully qualified logger name to look for. - - The logger found, or null if the named logger does not exist in the - specified assembly's repository. - - - - If the named logger exists (in the specified assembly's repository) then it - returns a reference to the logger, otherwise it returns - null. - - - - - - Returns all the currently defined loggers in the specified repository. - - The repository to lookup in. - All the defined loggers. - - - The root logger is not included in the returned array. - - - - - - Returns all the currently defined loggers in the specified assembly's repository. - - The assembly to use to lookup the repository. - All the defined loggers. - - - The root logger is not included in the returned array. - - - - - - Retrieves or creates a named logger. - - The repository to lookup in. - The name of the logger to retrieve. - The logger with the name specified. - - - Retrieves a logger named as the - parameter. If the named logger already exists, then the - existing instance will be returned. Otherwise, a new instance is - created. - - - By default, loggers do not have a set level but inherit - it from the hierarchy. This is one of the central features of - log4net. - - - - - - Retrieves or creates a named logger. - - The assembly to use to lookup the repository. - The name of the logger to retrieve. - The logger with the name specified. - - - Retrieves a logger named as the - parameter. If the named logger already exists, then the - existing instance will be returned. Otherwise, a new instance is - created. - - - By default, loggers do not have a set level but inherit - it from the hierarchy. This is one of the central features of - log4net. - - - - - - Shorthand for . - - The repository to lookup in. - The of which the fullname will be used as the name of the logger to retrieve. - The logger with the name specified. - - - Gets the logger for the fully qualified name of the type specified. - - - - - - Shorthand for . - - the assembly to use to lookup the repository - The of which the fullname will be used as the name of the logger to retrieve. - The logger with the name specified. - - - Gets the logger for the fully qualified name of the type specified. - - - - - - Shuts down the log4net system. - - - - Calling this method will safely close and remove all - appenders in all the loggers including root contained in all the - default repositories. - - - Some appenders need to be closed before the application exists. - Otherwise, pending logging events might be lost. - - - The shutdown method is careful to close nested - appenders before closing regular appenders. This is allows - configurations where a regular appender is attached to a logger - and again to a nested appender. - - - - - - Shuts down the repository for the repository specified. - - The repository to shutdown. - - - Calling this method will safely close and remove all - appenders in all the loggers including root contained in the - repository for the specified. - - - Some appenders need to be closed before the application exists. - Otherwise, pending logging events might be lost. - - - The shutdown method is careful to close nested - appenders before closing regular appenders. This is allows - configurations where a regular appender is attached to a logger - and again to a nested appender. - - - - - - Shuts down the repository for the repository specified. - - The assembly to use to lookup the repository. - - - Calling this method will safely close and remove all - appenders in all the loggers including root contained in the - repository for the repository. The repository is looked up using - the specified. - - - Some appenders need to be closed before the application exists. - Otherwise, pending logging events might be lost. - - - The shutdown method is careful to close nested - appenders before closing regular appenders. This is allows - configurations where a regular appender is attached to a logger - and again to a nested appender. - - - - - - Resets all values contained in this repository instance to their defaults. - - The repository to reset. - - - Resets all values contained in the repository instance to their - defaults. This removes all appenders from all loggers, sets - the level of all non-root loggers to null, - sets their additivity flag to true and sets the level - of the root logger to . Moreover, - message disabling is set its default "off" value. - - - - - - Resets all values contained in this repository instance to their defaults. - - The assembly to use to lookup the repository to reset. - - - Resets all values contained in the repository instance to their - defaults. This removes all appenders from all loggers, sets - the level of all non-root loggers to null, - sets their additivity flag to true and sets the level - of the root logger to . Moreover, - message disabling is set its default "off" value. - - - - - - Creates a repository with the specified name. - - The name of the repository, this must be unique amongst repositories. - The created for the repository. - - - CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. - - - Creates the default type of which is a - object. - - - The name must be unique. Repositories cannot be redefined. - An will be thrown if the repository already exists. - - - The specified repository already exists. - - - - Creates a repository with the specified name. - - The name of the repository, this must be unique amongst repositories. - The created for the repository. - - - Creates the default type of which is a - object. - - - The name must be unique. Repositories cannot be redefined. - An will be thrown if the repository already exists. - - - The specified repository already exists. - - - - Creates a repository with the specified name and repository type. - - The name of the repository, this must be unique to the repository. - A that implements - and has a no arg constructor. An instance of this type will be created to act - as the for the repository specified. - The created for the repository. - - - CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. - - - The name must be unique. Repositories cannot be redefined. - An Exception will be thrown if the repository already exists. - - - The specified repository already exists. - - - - Creates a repository with the specified name and repository type. - - The name of the repository, this must be unique to the repository. - A that implements - and has a no arg constructor. An instance of this type will be created to act - as the for the repository specified. - The created for the repository. - - - The name must be unique. Repositories cannot be redefined. - An Exception will be thrown if the repository already exists. - - - The specified repository already exists. - - - - Creates a repository for the specified assembly and repository type. - - The assembly to use to get the name of the repository. - A that implements - and has a no arg constructor. An instance of this type will be created to act - as the for the repository specified. - The created for the repository. - - - CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. - - - The created will be associated with the repository - specified such that a call to with the - same assembly specified will return the same repository instance. - - - - - - Creates a repository for the specified assembly and repository type. - - The assembly to use to get the name of the repository. - A that implements - and has a no arg constructor. An instance of this type will be created to act - as the for the repository specified. - The created for the repository. - - - The created will be associated with the repository - specified such that a call to with the - same assembly specified will return the same repository instance. - - - - - - Gets an array of all currently defined repositories. - - An array of all the known objects. - - - Gets an array of all currently defined repositories. - - - - - - Internal method to get pertinent version info. - - A string of version info. - - - - Called when the event fires - - the that is exiting - null - - - Called when the event fires. - - - When the event is triggered the log4net system is . - - - - - - Called when the event fires - - the that is exiting - null - - - Called when the event fires. - - - When the event is triggered the log4net system is . - - - - - - The fully qualified type of the LoggerManager class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Initialize the default repository selector - - - - - Gets or sets the repository selector used by the . - - - The repository selector used by the . - - - - The repository selector () is used by - the to create and select repositories - (). - - - The caller to supplies either a string name - or an assembly (if not supplied the assembly is inferred using - ). - - - This context is used by the selector to lookup a specific repository. - - - For the full .NET Framework, the default repository is DefaultRepositorySelector; - for the .NET Compact Framework CompactRepositorySelector is the default - repository. - - - - - - Implementation of the interface. - - - - This class should be used as the base for all wrapper implementations. - - - Nicko Cadell - Gert Driesen - - - - Constructs a new wrapper for the specified logger. - - The logger to wrap. - - - Constructs a new wrapper for the specified logger. - - - - - - The logger that this object is wrapping - - - - - Gets the implementation behind this wrapper object. - - - The object that this object is implementing. - - - - The Logger object may not be the same object as this object - because of logger decorators. - - - This gets the actual underlying objects that is used to process - the log events. - - - - - - Portable data structure used by - - - - Portable data structure used by - - - Nicko Cadell - - - - The logger name. - - - - The logger name. - - - - - - Level of logging event. - - - - Level of logging event. Level cannot be Serializable - because it is a flyweight. Due to its special serialization it - cannot be declared final either. - - - - - - The application supplied message. - - - - The application supplied message of logging event. - - - - - - The name of thread - - - - The name of thread in which this logging event was generated - - - - - - The time the event was logged - - - - The TimeStamp is stored in the local time zone for this computer. - - - - - - Location information for the caller. - - - - Location information for the caller. - - - - - - String representation of the user - - - - String representation of the user's windows name, - like DOMAIN\username - - - - - - String representation of the identity. - - - - String representation of the current thread's principal identity. - - - - - - The string representation of the exception - - - - The string representation of the exception - - - - - - String representation of the AppDomain. - - - - String representation of the AppDomain. - - - - - - Additional event specific properties - - - - A logger or an appender may attach additional - properties to specific events. These properties - have a string key and an object value. - - - - - - Flags passed to the property - - - - Flags passed to the property - - - Nicko Cadell - - - - Fix the MDC - - - - - Fix the NDC - - - - - Fix the rendered message - - - - - Fix the thread name - - - - - Fix the callers location information - - - CAUTION: Very slow to generate - - - - - Fix the callers windows user name - - - CAUTION: Slow to generate - - - - - Fix the domain friendly name - - - - - Fix the callers principal name - - - CAUTION: May be slow to generate - - - - - Fix the exception text - - - - - Fix the event properties. Active properties must implement in order to be eligible for fixing. - - - - - No fields fixed - - - - - All fields fixed - - - - - Partial fields fixed - - - - This set of partial fields gives good performance. The following fields are fixed: - - - - - - - - - - - - - The internal representation of logging events. - - - - When an affirmative decision is made to log then a - instance is created. This instance - is passed around to the different log4net components. - - - This class is of concern to those wishing to extend log4net. - - - Some of the values in instances of - are considered volatile, that is the values are correct at the - time the event is delivered to appenders, but will not be consistent - at any time afterwards. If an event is to be stored and then processed - at a later time these volatile values must be fixed by calling - . There is a performance penalty - for incurred by calling but it - is essential to maintaining data consistency. - - - Nicko Cadell - Gert Driesen - Douglas de la Torre - Daniel Cazzulino - - - - The key into the Properties map for the host name value. - - - - - The key into the Properties map for the thread identity value. - - - - - The key into the Properties map for the user name value. - - - - - Initializes a new instance of the class - from the supplied parameters. - - The declaring type of the method that is - the stack boundary into the logging system for this call. - The repository this event is logged in. - The name of the logger of this event. - The level of this event. - The message of this event. - The exception for this event. - - - Except , and , - all fields of LoggingEvent are filled when actually needed. Call - to cache all data locally - to prevent inconsistencies. - - This method is called by the log4net framework - to create a logging event. - - - - - - Initializes a new instance of the class - using specific data. - - The declaring type of the method that is - the stack boundary into the logging system for this call. - The repository this event is logged in. - Data used to initialize the logging event. - The fields in the struct that have already been fixed. - - - This constructor is provided to allow a - to be created independently of the log4net framework. This can - be useful if you require a custom serialization scheme. - - - Use the method to obtain an - instance of the class. - - - The parameter should be used to specify which fields in the - struct have been preset. Fields not specified in the - will be captured from the environment if requested or fixed. - - - - - - Initializes a new instance of the class - using specific data. - - The declaring type of the method that is - the stack boundary into the logging system for this call. - The repository this event is logged in. - Data used to initialize the logging event. - - - This constructor is provided to allow a - to be created independently of the log4net framework. This can - be useful if you require a custom serialization scheme. - - - Use the method to obtain an - instance of the class. - - - This constructor sets this objects flags to , - this assumes that all the data relating to this event is passed in via the - parameter and no other data should be captured from the environment. - - - - - - Initializes a new instance of the class - using specific data. - - Data used to initialize the logging event. - - - This constructor is provided to allow a - to be created independently of the log4net framework. This can - be useful if you require a custom serialization scheme. - - - Use the method to obtain an - instance of the class. - - - This constructor sets this objects flags to , - this assumes that all the data relating to this event is passed in via the - parameter and no other data should be captured from the environment. - - - - - - Serialization constructor - - The that holds the serialized object data. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class - with serialized data. - - - - - - Ensure that the repository is set. - - the value for the repository - - - - Write the rendered message to a TextWriter - - the writer to write the message to - - - Unlike the property this method - does store the message data in the internal cache. Therefore - if called only once this method should be faster than the - property, however if the message is - to be accessed multiple times then the property will be more efficient. - - - - - - Serializes this object into the provided. - - The to populate with data. - The destination for this serialization. - - - The data in this event must be fixed before it can be serialized. - - - The method must be called during the - method call if this event - is to be used outside that method. - - - - - - Gets the portable data for this . - - The for this event. - - - A new can be constructed using a - instance. - - - Does a fix of the data - in the logging event before returning the event data. - - - - - - Gets the portable data for this . - - The set of data to ensure is fixed in the LoggingEventData - The for this event. - - - A new can be constructed using a - instance. - - - - - - Returns this event's exception's rendered using the - . - - - This event's exception's rendered using the . - - - - Obsolete. Use instead. - - - - - - Returns this event's exception's rendered using the - . - - - This event's exception's rendered using the . - - - - Returns this event's exception's rendered using the - . - - - - - - Fix instance fields that hold volatile data. - - - - Some of the values in instances of - are considered volatile, that is the values are correct at the - time the event is delivered to appenders, but will not be consistent - at any time afterwards. If an event is to be stored and then processed - at a later time these volatile values must be fixed by calling - . There is a performance penalty - incurred by calling but it - is essential to maintaining data consistency. - - - Calling is equivalent to - calling passing the parameter - false. - - - See for more - information. - - - - - - Fixes instance fields that hold volatile data. - - Set to true to not fix data that takes a long time to fix. - - - Some of the values in instances of - are considered volatile, that is the values are correct at the - time the event is delivered to appenders, but will not be consistent - at any time afterwards. If an event is to be stored and then processed - at a later time these volatile values must be fixed by calling - . There is a performance penalty - for incurred by calling but it - is essential to maintaining data consistency. - - - The param controls the data that - is fixed. Some of the data that can be fixed takes a long time to - generate, therefore if you do not require those settings to be fixed - they can be ignored by setting the param - to true. This setting will ignore the - and settings. - - - Set to false to ensure that all - settings are fixed. - - - - - - Fix the fields specified by the parameter - - the fields to fix - - - Only fields specified in the will be fixed. - Fields will not be fixed if they have previously been fixed. - It is not possible to 'unfix' a field. - - - - - - Lookup a composite property in this event - - the key for the property to lookup - the value for the property - - - This event has composite properties that combine together properties from - several different contexts in the following order: - - - this events properties - - This event has that can be set. These - properties are specific to this event only. - - - - the thread properties - - The that are set on the current - thread. These properties are shared by all events logged on this thread. - - - - the global properties - - The that are set globally. These - properties are shared by all the threads in the AppDomain. - - - - - - - - - Get all the composite properties in this event - - the containing all the properties - - - See for details of the composite properties - stored by the event. - - - This method returns a single containing all the - properties defined for this event. - - - - - - The internal logging event data. - - - - - The internal logging event data. - - - - - The internal logging event data. - - - - - The fully qualified Type of the calling - logger class in the stack frame (i.e. the declaring type of the method). - - - - - The application supplied message of logging event. - - - - - The exception that was thrown. - - - This is not serialized. The string representation - is serialized instead. - - - - - The repository that generated the logging event - - - This is not serialized. - - - - - The fix state for this event - - - These flags indicate which fields have been fixed. - Not serialized. - - - - - Indicated that the internal cache is updateable (ie not fixed) - - - This is a seperate flag to m_fixFlags as it allows incrementel fixing and simpler - changes in the caching strategy. - - - - - Gets the time when the current process started. - - - This is the time when this process started. - - - - The TimeStamp is stored in the local time zone for this computer. - - - Tries to get the start time for the current process. - Failing that it returns the time of the first call to - this property. - - - Note that AppDomains may be loaded and unloaded within the - same process without the process terminating and therefore - without the process start time being reset. - - - - - - Gets the of the logging event. - - - The of the logging event. - - - - Gets the of the logging event. - - - - - - Gets the time of the logging event. - - - The time of the logging event. - - - - The TimeStamp is stored in the local time zone for this computer. - - - - - - Gets the name of the logger that logged the event. - - - The name of the logger that logged the event. - - - - Gets the name of the logger that logged the event. - - - - - - Gets the location information for this logging event. - - - The location information for this logging event. - - - - The collected information is cached for future use. - - - See the class for more information on - supported frameworks and the different behavior in Debug and - Release builds. - - - - - - Gets the message object used to initialize this event. - - - The message object used to initialize this event. - - - - Gets the message object used to initialize this event. - Note that this event may not have a valid message object. - If the event is serialized the message object will not - be transferred. To get the text of the message the - property must be used - not this property. - - - If there is no defined message object for this event then - null will be returned. - - - - - - Gets the exception object used to initialize this event. - - - The exception object used to initialize this event. - - - - Gets the exception object used to initialize this event. - Note that this event may not have a valid exception object. - If the event is serialized the exception object will not - be transferred. To get the text of the exception the - method must be used - not this property. - - - If there is no defined exception object for this event then - null will be returned. - - - - - - The that this event was created in. - - - - The that this event was created in. - - - - - - Gets the message, rendered through the . - - - The message rendered through the . - - - - The collected information is cached for future use. - - - - - - Gets the name of the current thread. - - - The name of the current thread, or the thread ID when - the name is not available. - - - - The collected information is cached for future use. - - - - - - Gets the name of the current user. - - - The name of the current user, or NOT AVAILABLE when the - underlying runtime has no support for retrieving the name of the - current user. - - - - Calls WindowsIdentity.GetCurrent().Name to get the name of - the current windows user. - - - To improve performance, we could cache the string representation of - the name, and reuse that as long as the identity stayed constant. - Once the identity changed, we would need to re-assign and re-render - the string. - - - However, the WindowsIdentity.GetCurrent() call seems to - return different objects every time, so the current implementation - doesn't do this type of caching. - - - Timing for these operations: - - - - Method - Results - - - WindowsIdentity.GetCurrent() - 10000 loops, 00:00:00.2031250 seconds - - - WindowsIdentity.GetCurrent().Name - 10000 loops, 00:00:08.0468750 seconds - - - - This means we could speed things up almost 40 times by caching the - value of the WindowsIdentity.GetCurrent().Name property, since - this takes (8.04-0.20) = 7.84375 seconds. - - - - - - Gets the identity of the current thread principal. - - - The string name of the identity of the current thread principal. - - - - Calls System.Threading.Thread.CurrentPrincipal.Identity.Name to get - the name of the current thread principal. - - - - - - Gets the AppDomain friendly name. - - - The AppDomain friendly name. - - - - Gets the AppDomain friendly name. - - - - - - Additional event specific properties. - - - Additional event specific properties. - - - - A logger or an appender may attach additional - properties to specific events. These properties - have a string key and an object value. - - - This property is for events that have been added directly to - this event. The aggregate properties (which include these - event properties) can be retrieved using - and . - - - Once the properties have been fixed this property - returns the combined cached properties. This ensures that updates to - this property are always reflected in the underlying storage. When - returning the combined properties there may be more keys in the - Dictionary than expected. - - - - - - The fixed fields in this event - - - The set of fields that are fixed in this event - - - - Fields will not be fixed if they have previously been fixed. - It is not possible to 'unfix' a field. - - - - - - Implementation of wrapper interface. - - - - This implementation of the interface - forwards to the held by the base class. - - - This logger has methods to allow the caller to log at the following - levels: - - - - DEBUG - - The and methods log messages - at the DEBUG level. That is the level with that name defined in the - repositories . The default value - for this level is . The - property tests if this level is enabled for logging. - - - - INFO - - The and methods log messages - at the INFO level. That is the level with that name defined in the - repositories . The default value - for this level is . The - property tests if this level is enabled for logging. - - - - WARN - - The and methods log messages - at the WARN level. That is the level with that name defined in the - repositories . The default value - for this level is . The - property tests if this level is enabled for logging. - - - - ERROR - - The and methods log messages - at the ERROR level. That is the level with that name defined in the - repositories . The default value - for this level is . The - property tests if this level is enabled for logging. - - - - FATAL - - The and methods log messages - at the FATAL level. That is the level with that name defined in the - repositories . The default value - for this level is . The - property tests if this level is enabled for logging. - - - - - The values for these levels and their semantic meanings can be changed by - configuring the for the repository. - - - Nicko Cadell - Gert Driesen - - - - The ILog interface is use by application to log messages into - the log4net framework. - - - - Use the to obtain logger instances - that implement this interface. The - static method is used to get logger instances. - - - This class contains methods for logging at different levels and also - has properties for determining if those logging levels are - enabled in the current configuration. - - - This interface can be implemented in different ways. This documentation - specifies reasonable behavior that a caller can expect from the actual - implementation, however different implementations reserve the right to - do things differently. - - - Simple example of logging messages - - ILog log = LogManager.GetLogger("application-log"); - - log.Info("Application Start"); - log.Debug("This is a debug message"); - - if (log.IsDebugEnabled) - { - log.Debug("This is another debug message"); - } - - - - - Nicko Cadell - Gert Driesen - - - Log a message object with the level. - - Log a message object with the level. - - The message object to log. - - - This method first checks if this logger is DEBUG - enabled by comparing the level of this logger with the - level. If this logger is - DEBUG enabled, then it converts the message object - (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. - - - - - - - - Log a message object with the level including - the stack trace of the passed - as a parameter. - - The message object to log. - The exception to log, including its stack trace. - - - See the form for more detailed information. - - - - - - - Log a formatted string with the level. - - Logs a formatted message string with the level. - - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - A String containing zero or more format items - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - A String containing zero or more format items - An Object to format - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - A String containing zero or more format items - An Object to format - An Object to format - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - An that supplies culture-specific formatting information - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - Log a message object with the level. - - Logs a message object with the level. - - - - This method first checks if this logger is INFO - enabled by comparing the level of this logger with the - level. If this logger is - INFO enabled, then it converts the message object - (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of the - additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. - - - The message object to log. - - - - - - Logs a message object with the INFO level including - the stack trace of the passed - as a parameter. - - The message object to log. - The exception to log, including its stack trace. - - - See the form for more detailed information. - - - - - - - Log a formatted message string with the level. - - Logs a formatted message string with the level. - - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - A String containing zero or more format items - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - A String containing zero or more format items - An Object to format - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - A String containing zero or more format items - An Object to format - An Object to format - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - An that supplies culture-specific formatting information - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - Log a message object with the level. - - Log a message object with the level. - - - - This method first checks if this logger is WARN - enabled by comparing the level of this logger with the - level. If this logger is - WARN enabled, then it converts the message object - (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of the - additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. - - - The message object to log. - - - - - - Log a message object with the level including - the stack trace of the passed - as a parameter. - - The message object to log. - The exception to log, including its stack trace. - - - See the form for more detailed information. - - - - - - - Log a formatted message string with the level. - - Logs a formatted message string with the level. - - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - A String containing zero or more format items - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - A String containing zero or more format items - An Object to format - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - A String containing zero or more format items - An Object to format - An Object to format - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - An that supplies culture-specific formatting information - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - Log a message object with the level. - - Logs a message object with the level. - - The message object to log. - - - This method first checks if this logger is ERROR - enabled by comparing the level of this logger with the - level. If this logger is - ERROR enabled, then it converts the message object - (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of the - additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. - - - - - - - - Log a message object with the level including - the stack trace of the passed - as a parameter. - - The message object to log. - The exception to log, including its stack trace. - - - See the form for more detailed information. - - - - - - - Log a formatted message string with the level. - - Logs a formatted message string with the level. - - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - A String containing zero or more format items - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - A String containing zero or more format items - An Object to format - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - A String containing zero or more format items - An Object to format - An Object to format - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - An that supplies culture-specific formatting information - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - Log a message object with the level. - - Log a message object with the level. - - - - This method first checks if this logger is FATAL - enabled by comparing the level of this logger with the - level. If this logger is - FATAL enabled, then it converts the message object - (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of the - additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. - - - The message object to log. - - - - - - Log a message object with the level including - the stack trace of the passed - as a parameter. - - The message object to log. - The exception to log, including its stack trace. - - - See the form for more detailed information. - - - - - - - Log a formatted message string with the level. - - Logs a formatted message string with the level. - - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - A String containing zero or more format items - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - A String containing zero or more format items - An Object to format - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - A String containing zero or more format items - An Object to format - An Object to format - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - An that supplies culture-specific formatting information - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Checks if this logger is enabled for the level. - - - true if this logger is enabled for events, false otherwise. - - - - This function is intended to lessen the computational cost of - disabled log debug statements. - - For some ILog interface log, when you write: - - log.Debug("This is entry number: " + i ); - - - You incur the cost constructing the message, string construction and concatenation in - this case, regardless of whether the message is logged or not. - - - If you are worried about speed (who isn't), then you should write: - - - if (log.IsDebugEnabled) - { - log.Debug("This is entry number: " + i ); - } - - - This way you will not incur the cost of parameter - construction if debugging is disabled for log. On - the other hand, if the log is debug enabled, you - will incur the cost of evaluating whether the logger is debug - enabled twice. Once in and once in - the . This is an insignificant overhead - since evaluating a logger takes about 1% of the time it - takes to actually log. This is the preferred style of logging. - - Alternatively if your logger is available statically then the is debug - enabled state can be stored in a static variable like this: - - - private static readonly bool isDebugEnabled = log.IsDebugEnabled; - - - Then when you come to log you can write: - - - if (isDebugEnabled) - { - log.Debug("This is entry number: " + i ); - } - - - This way the debug enabled state is only queried once - when the class is loaded. Using a private static readonly - variable is the most efficient because it is a run time constant - and can be heavily optimized by the JIT compiler. - - - Of course if you use a static readonly variable to - hold the enabled state of the logger then you cannot - change the enabled state at runtime to vary the logging - that is produced. You have to decide if you need absolute - speed or runtime flexibility. - - - - - - - - Checks if this logger is enabled for the level. - - - true if this logger is enabled for events, false otherwise. - - - For more information see . - - - - - - - - Checks if this logger is enabled for the level. - - - true if this logger is enabled for events, false otherwise. - - - For more information see . - - - - - - - - Checks if this logger is enabled for the level. - - - true if this logger is enabled for events, false otherwise. - - - For more information see . - - - - - - - - Checks if this logger is enabled for the level. - - - true if this logger is enabled for events, false otherwise. - - - For more information see . - - - - - - - - Construct a new wrapper for the specified logger. - - The logger to wrap. - - - Construct a new wrapper for the specified logger. - - - - - - Virtual method called when the configuration of the repository changes - - the repository holding the levels - - - Virtual method called when the configuration of the repository changes - - - - - - Logs a message object with the DEBUG level. - - The message object to log. - - - This method first checks if this logger is DEBUG - enabled by comparing the level of this logger with the - DEBUG level. If this logger is - DEBUG enabled, then it converts the message object - (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of the - additivity flag. - - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. - - - - - - Logs a message object with the DEBUG level - - The message object to log. - The exception to log, including its stack trace. - - - Logs a message object with the DEBUG level including - the stack trace of the passed - as a parameter. - - - See the form for more detailed information. - - - - - - - Logs a formatted message string with the DEBUG level. - - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a formatted message string with the DEBUG level. - - A String containing zero or more format items - An Object to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a formatted message string with the DEBUG level. - - A String containing zero or more format items - An Object to format - An Object to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a formatted message string with the DEBUG level. - - A String containing zero or more format items - An Object to format - An Object to format - An Object to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a formatted message string with the DEBUG level. - - An that supplies culture-specific formatting information - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a message object with the INFO level. - - The message object to log. - - - This method first checks if this logger is INFO - enabled by comparing the level of this logger with the - INFO level. If this logger is - INFO enabled, then it converts the message object - (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. - - - - - - Logs a message object with the INFO level. - - The message object to log. - The exception to log, including its stack trace. - - - Logs a message object with the INFO level including - the stack trace of the - passed as a parameter. - - - See the form for more detailed information. - - - - - - - Logs a formatted message string with the INFO level. - - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a formatted message string with the INFO level. - - A String containing zero or more format items - An Object to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a formatted message string with the INFO level. - - A String containing zero or more format items - An Object to format - An Object to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a formatted message string with the INFO level. - - A String containing zero or more format items - An Object to format - An Object to format - An Object to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a formatted message string with the INFO level. - - An that supplies culture-specific formatting information - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a message object with the WARN level. - - the message object to log - - - This method first checks if this logger is WARN - enabled by comparing the level of this logger with the - WARN level. If this logger is - WARN enabled, then it converts the message object - (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger and - also higher in the hierarchy depending on the value of the - additivity flag. - - - WARNING Note that passing an to this - method will print the name of the but no - stack trace. To print a stack trace use the - form instead. - - - - - - Logs a message object with the WARN level - - The message object to log. - The exception to log, including its stack trace. - - - Logs a message object with the WARN level including - the stack trace of the - passed as a parameter. - - - See the form for more detailed information. - - - - - - - Logs a formatted message string with the WARN level. - - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a formatted message string with the WARN level. - - A String containing zero or more format items - An Object to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a formatted message string with the WARN level. - - A String containing zero or more format items - An Object to format - An Object to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a formatted message string with the WARN level. - - A String containing zero or more format items - An Object to format - An Object to format - An Object to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a formatted message string with the WARN level. - - An that supplies culture-specific formatting information - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a message object with the ERROR level. - - The message object to log. - - - This method first checks if this logger is ERROR - enabled by comparing the level of this logger with the - ERROR level. If this logger is - ERROR enabled, then it converts the message object - (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger and - also higher in the hierarchy depending on the value of the - additivity flag. - - - WARNING Note that passing an to this - method will print the name of the but no - stack trace. To print a stack trace use the - form instead. - - - - - - Logs a message object with the ERROR level - - The message object to log. - The exception to log, including its stack trace. - - - Logs a message object with the ERROR level including - the stack trace of the - passed as a parameter. - - - See the form for more detailed information. - - - - - - - Logs a formatted message string with the ERROR level. - - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a formatted message string with the ERROR level. - - A String containing zero or more format items - An Object to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a formatted message string with the ERROR level. - - A String containing zero or more format items - An Object to format - An Object to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a formatted message string with the ERROR level. - - A String containing zero or more format items - An Object to format - An Object to format - An Object to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a formatted message string with the ERROR level. - - An that supplies culture-specific formatting information - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a message object with the FATAL level. - - The message object to log. - - - This method first checks if this logger is FATAL - enabled by comparing the level of this logger with the - FATAL level. If this logger is - FATAL enabled, then it converts the message object - (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger and - also higher in the hierarchy depending on the value of the - additivity flag. - - - WARNING Note that passing an to this - method will print the name of the but no - stack trace. To print a stack trace use the - form instead. - - - - - - Logs a message object with the FATAL level - - The message object to log. - The exception to log, including its stack trace. - - - Logs a message object with the FATAL level including - the stack trace of the - passed as a parameter. - - - See the form for more detailed information. - - - - - - - Logs a formatted message string with the FATAL level. - - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a formatted message string with the FATAL level. - - A String containing zero or more format items - An Object to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a formatted message string with the FATAL level. - - A String containing zero or more format items - An Object to format - An Object to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a formatted message string with the FATAL level. - - A String containing zero or more format items - An Object to format - An Object to format - An Object to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - The string is formatted using the - format provider. To specify a localized provider use the - method. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Logs a formatted message string with the FATAL level. - - An that supplies culture-specific formatting information - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the method. See - String.Format for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - Event handler for the event - - the repository - Empty - - - - The fully qualified name of this declaring type not the type of any subclass. - - - - - Checks if this logger is enabled for the DEBUG - level. - - - true if this logger is enabled for DEBUG events, - false otherwise. - - - - This function is intended to lessen the computational cost of - disabled log debug statements. - - - For some log Logger object, when you write: - - - log.Debug("This is entry number: " + i ); - - - You incur the cost constructing the message, concatenation in - this case, regardless of whether the message is logged or not. - - - If you are worried about speed, then you should write: - - - if (log.IsDebugEnabled()) - { - log.Debug("This is entry number: " + i ); - } - - - This way you will not incur the cost of parameter - construction if debugging is disabled for log. On - the other hand, if the log is debug enabled, you - will incur the cost of evaluating whether the logger is debug - enabled twice. Once in IsDebugEnabled and once in - the Debug. This is an insignificant overhead - since evaluating a logger takes about 1% of the time it - takes to actually log. - - - - - - Checks if this logger is enabled for the INFO level. - - - true if this logger is enabled for INFO events, - false otherwise. - - - - See for more information and examples - of using this method. - - - - - - - Checks if this logger is enabled for the WARN level. - - - true if this logger is enabled for WARN events, - false otherwise. - - - - See for more information and examples - of using this method. - - - - - - - Checks if this logger is enabled for the ERROR level. - - - true if this logger is enabled for ERROR events, - false otherwise. - - - - See for more information and examples of using this method. - - - - - - - Checks if this logger is enabled for the FATAL level. - - - true if this logger is enabled for FATAL events, - false otherwise. - - - - See for more information and examples of using this method. - - - - - - - provides method information without actually referencing a System.Reflection.MethodBase - as that would require that the containing assembly is loaded. - - - - - - When location information is not available the constant - NA is returned. Current value of this string - constant is ?. - - - - - constructs a method item for an unknown method. - - - - - constructs a method item from the name of the method. - - - - - - constructs a method item from the name of the method and its parameters. - - - - - - - constructs a method item from a method base by determining the method name and its parameters. - - - - - - The fully qualified type of the StackFrameItem class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Gets the method name of the caller making the logging - request. - - - The method name of the caller making the logging - request. - - - - Gets the method name of the caller making the logging - request. - - - - - - Gets the method parameters of the caller making - the logging request. - - - The method parameters of the caller making - the logging request - - - - Gets the method parameters of the caller making - the logging request. - - - - - - A SecurityContext used by log4net when interacting with protected resources - - - - A SecurityContext used by log4net when interacting with protected resources - for example with operating system services. This can be used to impersonate - a principal that has been granted privileges on the system resources. - - - Nicko Cadell - - - - Impersonate this SecurityContext - - State supplied by the caller - An instance that will - revoke the impersonation of this SecurityContext, or null - - - Impersonate this security context. Further calls on the current - thread should now be made in the security context provided - by this object. When the result - method is called the security - context of the thread should be reverted to the state it was in - before was called. - - - - - - The providers default instances. - - - - A configured component that interacts with potentially protected system - resources uses a to provide the elevated - privileges required. If the object has - been not been explicitly provided to the component then the component - will request one from this . - - - By default the is - an instance of which returns only - objects. This is a reasonable default - where the privileges required are not know by the system. - - - This default behavior can be overridden by subclassing the - and overriding the method to return - the desired objects. The default provider - can be replaced by programmatically setting the value of the - property. - - - An alternative is to use the log4net.Config.SecurityContextProviderAttribute - This attribute can be applied to an assembly in the same way as the - log4net.Config.XmlConfiguratorAttribute". The attribute takes - the type to use as the as an argument. - - - Nicko Cadell - - - - The default provider - - - - - Protected default constructor to allow subclassing - - - - Protected default constructor to allow subclassing - - - - - - Create a SecurityContext for a consumer - - The consumer requesting the SecurityContext - An impersonation context - - - The default implementation is to return a . - - - Subclasses should override this method to provide their own - behavior. - - - - - - Gets or sets the default SecurityContextProvider - - - The default SecurityContextProvider - - - - The default provider is used by configured components that - require a and have not had one - given to them. - - - By default this is an instance of - that returns objects. - - - The default provider can be set programmatically by setting - the value of this property to a sub class of - that has the desired behavior. - - - - - - provides stack frame information without actually referencing a System.Diagnostics.StackFrame - as that would require that the containing assembly is loaded. - - - - - - When location information is not available the constant - NA is returned. Current value of this string - constant is ?. - - - - - returns a stack frame item from a stack frame. This - - - - - - - The fully qualified type of the StackFrameItem class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Gets the fully qualified class name of the caller making the logging - request. - - - The fully qualified class name of the caller making the logging - request. - - - - Gets the fully qualified class name of the caller making the logging - request. - - - - - - Gets the file name of the caller. - - - The file name of the caller. - - - - Gets the file name of the caller. - - - - - - Gets the line number of the caller. - - - The line number of the caller. - - - - Gets the line number of the caller. - - - - - - Gets the method name of the caller. - - - The method name of the caller. - - - - Gets the method name of the caller. - - - - - - Gets all available caller information - - - All available caller information, in the format - fully.qualified.classname.of.caller.methodName(Filename:line) - - - - Gets all available caller information, in the format - fully.qualified.classname.of.caller.methodName(Filename:line) - - - - - - An evaluator that triggers after specified number of seconds. - - - - This evaluator will trigger if the specified time period - has passed since last check. - - - Robert Sevcik - - - - The default time threshold for triggering in seconds. Zero means it won't trigger at all. - - - - - The time threshold for triggering in seconds. Zero means it won't trigger at all. - - - - - The time of last check. This gets updated when the object is created and when the evaluator triggers. - - - - - Create a new evaluator using the time threshold in seconds. - - - - Create a new evaluator using the time threshold in seconds. - - - This evaluator will trigger if the specified time period - has passed since last check. - - - - - - Create a new evaluator using the specified time threshold in seconds. - - - The time threshold in seconds to trigger after. - Zero means it won't trigger at all. - - - - Create a new evaluator using the specified time threshold in seconds. - - - This evaluator will trigger if the specified time period - has passed since last check. - - - - - - Is this the triggering event? - - The event to check - This method returns true, if the specified time period - has passed since last check.. - Otherwise it returns false - - - This evaluator will trigger if the specified time period - has passed since last check. - - - - - - The time threshold in seconds to trigger after - - - The time threshold in seconds to trigger after. - Zero means it won't trigger at all. - - - - This evaluator will trigger if the specified time period - has passed since last check. - - - - - - Delegate used to handle creation of new wrappers. - - The logger to wrap in a wrapper. - - - Delegate used to handle creation of new wrappers. This delegate - is called from the - method to construct the wrapper for the specified logger. - - - The delegate to use is supplied to the - constructor. - - - - - - Maps between logger objects and wrapper objects. - - - - This class maintains a mapping between objects and - objects. Use the method to - lookup the for the specified . - - - New wrapper instances are created by the - method. The default behavior is for this method to delegate construction - of the wrapper to the delegate supplied - to the constructor. This allows specialization of the behavior without - requiring subclassing of this type. - - - Nicko Cadell - Gert Driesen - - - - Initializes a new instance of the - - The handler to use to create the wrapper objects. - - - Initializes a new instance of the class with - the specified handler to create the wrapper objects. - - - - - - Gets the wrapper object for the specified logger. - - The wrapper object for the specified logger - - - If the logger is null then the corresponding wrapper is null. - - - Looks up the wrapper it it has previously been requested and - returns it. If the wrapper has never been requested before then - the virtual method is - called. - - - - - - Creates the wrapper object for the specified logger. - - The logger to wrap in a wrapper. - The wrapper object for the logger. - - - This implementation uses the - passed to the constructor to create the wrapper. This method - can be overridden in a subclass. - - - - - - Called when a monitored repository shutdown event is received. - - The that is shutting down - - - This method is called when a that this - is holding loggers for has signaled its shutdown - event . The default - behavior of this method is to release the references to the loggers - and their wrappers generated for this repository. - - - - - - Event handler for repository shutdown event. - - The sender of the event. - The event args. - - - - Map of logger repositories to hashtables of ILogger to ILoggerWrapper mappings - - - - - The handler to use to create the extension wrapper objects. - - - - - Internal reference to the delegate used to register for repository shutdown events. - - - - - Gets the map of logger repositories. - - - Map of logger repositories. - - - - Gets the hashtable that is keyed on . The - values are hashtables keyed on with the - value being the corresponding . - - - - - - Formats a as "HH:mm:ss,fff". - - - - Formats a in the format "HH:mm:ss,fff" for example, "15:49:37,459". - - - Nicko Cadell - Gert Driesen - - - - Render a as a string. - - - - Interface to abstract the rendering of a - instance into a string. - - - The method is used to render the - date to a text writer. - - - Nicko Cadell - Gert Driesen - - - - Formats the specified date as a string. - - The date to format. - The writer to write to. - - - Format the as a string and write it - to the provided. - - - - - - String constant used to specify AbsoluteTimeDateFormat in layouts. Current value is ABSOLUTE. - - - - - String constant used to specify DateTimeDateFormat in layouts. Current value is DATE. - - - - - String constant used to specify ISO8601DateFormat in layouts. Current value is ISO8601. - - - - - Renders the date into a string. Format is "HH:mm:ss". - - The date to render into a string. - The string builder to write to. - - - Subclasses should override this method to render the date - into a string using a precision up to the second. This method - will be called at most once per second and the result will be - reused if it is needed again during the same second. - - - - - - Renders the date into a string. Format is "HH:mm:ss,fff". - - The date to render into a string. - The writer to write to. - - - Uses the method to generate the - time string up to the seconds and then appends the current - milliseconds. The results from are - cached and is called at most once - per second. - - - Sub classes should override - rather than . - - - - - - Last stored time with precision up to the second. - - - - - Last stored time with precision up to the second, formatted - as a string. - - - - - Last stored time with precision up to the second, formatted - as a string. - - - - - Formats a as "dd MMM yyyy HH:mm:ss,fff" - - - - Formats a in the format - "dd MMM yyyy HH:mm:ss,fff" for example, - "06 Nov 1994 15:49:37,459". - - - Nicko Cadell - Gert Driesen - Angelika Schnagl - - - - Default constructor. - - - - Initializes a new instance of the class. - - - - - - Formats the date without the milliseconds part - - The date to format. - The string builder to write to. - - - Formats a DateTime in the format "dd MMM yyyy HH:mm:ss" - for example, "06 Nov 1994 15:49:37". - - - The base class will append the ",fff" milliseconds section. - This method will only be called at most once per second. - - - - - - The format info for the invariant culture. - - - - - Formats the as "yyyy-MM-dd HH:mm:ss,fff". - - - - Formats the specified as a string: "yyyy-MM-dd HH:mm:ss,fff". - - - Nicko Cadell - Gert Driesen - - - - Default constructor - - - - Initializes a new instance of the class. - - - - - - Formats the date without the milliseconds part - - The date to format. - The string builder to write to. - - - Formats the date specified as a string: "yyyy-MM-dd HH:mm:ss". - - - The base class will append the ",fff" milliseconds section. - This method will only be called at most once per second. - - - - - - Formats the using the method. - - - - Formats the using the method. - - - Nicko Cadell - Gert Driesen - - - - Constructor - - The format string. - - - Initializes a new instance of the class - with the specified format string. - - - The format string must be compatible with the options - that can be supplied to . - - - - - - Formats the date using . - - The date to convert to a string. - The writer to write to. - - - Uses the date format string supplied to the constructor to call - the method to format the date. - - - - - - The format string used to format the . - - - - The format string must be compatible with the options - that can be supplied to . - - - - - - This filter drops all . - - - - You can add this filter to the end of a filter chain to - switch from the default "accept all unless instructed otherwise" - filtering behavior to a "deny all unless instructed otherwise" - behavior. - - - Nicko Cadell - Gert Driesen - - - - Subclass this type to implement customized logging event filtering - - - - Users should extend this class to implement customized logging - event filtering. Note that and - , the parent class of all standard - appenders, have built-in filtering rules. It is suggested that you - first use and understand the built-in rules before rushing to write - your own custom filters. - - - This abstract class assumes and also imposes that filters be - organized in a linear chain. The - method of each filter is called sequentially, in the order of their - addition to the chain. - - - The method must return one - of the integer constants , - or . - - - If the value is returned, then the log event is dropped - immediately without consulting with the remaining filters. - - - If the value is returned, then the next filter - in the chain is consulted. If there are no more filters in the - chain, then the log event is logged. Thus, in the presence of no - filters, the default behavior is to log all logging events. - - - If the value is returned, then the log - event is logged without consulting the remaining filters. - - - The philosophy of log4net filters is largely inspired from the - Linux ipchains. - - - Nicko Cadell - Gert Driesen - - - - Implement this interface to provide customized logging event filtering - - - - Users should implement this interface to implement customized logging - event filtering. Note that and - , the parent class of all standard - appenders, have built-in filtering rules. It is suggested that you - first use and understand the built-in rules before rushing to write - your own custom filters. - - - This abstract class assumes and also imposes that filters be - organized in a linear chain. The - method of each filter is called sequentially, in the order of their - addition to the chain. - - - The method must return one - of the integer constants , - or . - - - If the value is returned, then the log event is dropped - immediately without consulting with the remaining filters. - - - If the value is returned, then the next filter - in the chain is consulted. If there are no more filters in the - chain, then the log event is logged. Thus, in the presence of no - filters, the default behavior is to log all logging events. - - - If the value is returned, then the log - event is logged without consulting the remaining filters. - - - The philosophy of log4net filters is largely inspired from the - Linux ipchains. - - - Nicko Cadell - Gert Driesen - - - - Decide if the logging event should be logged through an appender. - - The LoggingEvent to decide upon - The decision of the filter - - - If the decision is , then the event will be - dropped. If the decision is , then the next - filter, if any, will be invoked. If the decision is then - the event will be logged without consulting with other filters in - the chain. - - - - - - Property to get and set the next filter - - - The next filter in the chain - - - - Filters are typically composed into chains. This property allows the next filter in - the chain to be accessed. - - - - - - Points to the next filter in the filter chain. - - - - See for more information. - - - - - - Initialize the filter with the options set - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - Typically filter's options become active immediately on set, - however this method must still be called. - - - - - - Decide if the should be logged through an appender. - - The to decide upon - The decision of the filter - - - If the decision is , then the event will be - dropped. If the decision is , then the next - filter, if any, will be invoked. If the decision is then - the event will be logged without consulting with other filters in - the chain. - - - This method is marked abstract and must be implemented - in a subclass. - - - - - - Property to get and set the next filter - - - The next filter in the chain - - - - Filters are typically composed into chains. This property allows the next filter in - the chain to be accessed. - - - - - - Default constructor - - - - - Always returns the integer constant - - the LoggingEvent to filter - Always returns - - - Ignores the event being logged and just returns - . This can be used to change the default filter - chain behavior from to . This filter - should only be used as the last filter in the chain - as any further filters will be ignored! - - - - - - The return result from - - - - The return result from - - - - - - The log event must be dropped immediately without - consulting with the remaining filters, if any, in the chain. - - - - - This filter is neutral with respect to the log event. - The remaining filters, if any, should be consulted for a final decision. - - - - - The log event must be logged immediately without - consulting with the remaining filters, if any, in the chain. - - - - - This is a very simple filter based on matching. - - - - The filter admits two options and - . If there is an exact match between the value - of the option and the of the - , then the method returns in - case the option value is set - to true, if it is false then - is returned. If the does not match then - the result will be . - - - Nicko Cadell - Gert Driesen - - - - flag to indicate if the filter should on a match - - - - - the to match against - - - - - Default constructor - - - - - Tests if the of the logging event matches that of the filter - - the event to filter - see remarks - - - If the of the event matches the level of the - filter then the result of the function depends on the - value of . If it is true then - the function will return , it it is false then it - will return . If the does not match then - the result will be . - - - - - - when matching - - - - The property is a flag that determines - the behavior when a matching is found. If the - flag is set to true then the filter will the - logging event, otherwise it will the event. - - - The default is true i.e. to the event. - - - - - - The that the filter will match - - - - The level that this filter will attempt to match against the - level. If a match is found then - the result depends on the value of . - - - - - - This is a simple filter based on matching. - - - - The filter admits three options and - that determine the range of priorities that are matched, and - . If there is a match between the range - of priorities and the of the , then the - method returns in case the - option value is set to true, if it is false - then is returned. If there is no match, is returned. - - - Nicko Cadell - Gert Driesen - - - - Flag to indicate the behavior when matching a - - - - - the minimum value to match - - - - - the maximum value to match - - - - - Default constructor - - - - - Check if the event should be logged. - - the logging event to check - see remarks - - - If the of the logging event is outside the range - matched by this filter then - is returned. If the is matched then the value of - is checked. If it is true then - is returned, otherwise - is returned. - - - - - - when matching and - - - - The property is a flag that determines - the behavior when a matching is found. If the - flag is set to true then the filter will the - logging event, otherwise it will the event. - - - The default is true i.e. to the event. - - - - - - Set the minimum matched - - - - The minimum level that this filter will attempt to match against the - level. If a match is found then - the result depends on the value of . - - - - - - Sets the maximum matched - - - - The maximum level that this filter will attempt to match against the - level. If a match is found then - the result depends on the value of . - - - - - - Simple filter to match a string in the event's logger name. - - - - The works very similar to the . It admits two - options and . If the - of the starts - with the value of the option, then the - method returns in - case the option value is set to true, - if it is false then is returned. - - - Daniel Cazzulino - - - - Flag to indicate the behavior when we have a match - - - - - The logger name string to substring match against the event - - - - - Default constructor - - - - - Check if this filter should allow the event to be logged - - the event being logged - see remarks - - - The rendered message is matched against the . - If the equals the beginning of - the incoming () - then a match will have occurred. If no match occurs - this function will return - allowing other filters to check the event. If a match occurs then - the value of is checked. If it is - true then is returned otherwise - is returned. - - - - - - when matching - - - - The property is a flag that determines - the behavior when a matching is found. If the - flag is set to true then the filter will the - logging event, otherwise it will the event. - - - The default is true i.e. to the event. - - - - - - The that the filter will match - - - - This filter will attempt to match this value against logger name in - the following way. The match will be done against the beginning of the - logger name (using ). The match is - case sensitive. If a match is found then - the result depends on the value of . - - - - - - Simple filter to match a keyed string in the - - - - Simple filter to match a keyed string in the - - - As the MDC has been replaced with layered properties the - should be used instead. - - - Nicko Cadell - Gert Driesen - - - - Simple filter to match a string an event property - - - - Simple filter to match a string in the value for a - specific event property - - - Nicko Cadell - - - - Simple filter to match a string in the rendered message - - - - Simple filter to match a string in the rendered message - - - Nicko Cadell - Gert Driesen - - - - Flag to indicate the behavior when we have a match - - - - - The string to substring match against the message - - - - - A string regex to match - - - - - A regex object to match (generated from m_stringRegexToMatch) - - - - - Default constructor - - - - - Initialize and precompile the Regex if required - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - - - - Check if this filter should allow the event to be logged - - the event being logged - see remarks - - - The rendered message is matched against the . - If the occurs as a substring within - the message then a match will have occurred. If no match occurs - this function will return - allowing other filters to check the event. If a match occurs then - the value of is checked. If it is - true then is returned otherwise - is returned. - - - - - - when matching or - - - - The property is a flag that determines - the behavior when a matching is found. If the - flag is set to true then the filter will the - logging event, otherwise it will the event. - - - The default is true i.e. to the event. - - - - - - Sets the static string to match - - - - The string that will be substring matched against - the rendered message. If the message contains this - string then the filter will match. If a match is found then - the result depends on the value of . - - - One of or - must be specified. - - - - - - Sets the regular expression to match - - - - The regular expression pattern that will be matched against - the rendered message. If the message matches this - pattern then the filter will match. If a match is found then - the result depends on the value of . - - - One of or - must be specified. - - - - - - The key to use to lookup the string from the event properties - - - - - Default constructor - - - - - Check if this filter should allow the event to be logged - - the event being logged - see remarks - - - The event property for the is matched against - the . - If the occurs as a substring within - the property value then a match will have occurred. If no match occurs - this function will return - allowing other filters to check the event. If a match occurs then - the value of is checked. If it is - true then is returned otherwise - is returned. - - - - - - The key to lookup in the event properties and then match against. - - - - The key name to use to lookup in the properties map of the - . The match will be performed against - the value of this property if it exists. - - - - - - Simple filter to match a string in the - - - - Simple filter to match a string in the - - - As the MDC has been replaced with named stacks stored in the - properties collections the should - be used instead. - - - Nicko Cadell - Gert Driesen - - - - Default constructor - - - - Sets the to "NDC". - - - - - - Write the event appdomain name to the output - - - - Writes the to the output writer. - - - Daniel Cazzulino - Nicko Cadell - - - - Abstract class that provides the formatting functionality that - derived classes need. - - - Conversion specifiers in a conversion patterns are parsed to - individual PatternConverters. Each of which is responsible for - converting a logging event in a converter specific manner. - - Nicko Cadell - - - - Abstract class that provides the formatting functionality that - derived classes need. - - - - Conversion specifiers in a conversion patterns are parsed to - individual PatternConverters. Each of which is responsible for - converting a logging event in a converter specific manner. - - - Nicko Cadell - Gert Driesen - - - - Initial buffer size - - - - - Maximum buffer size before it is recycled - - - - - Protected constructor - - - - Initializes a new instance of the class. - - - - - - Evaluate this pattern converter and write the output to a writer. - - that will receive the formatted result. - The state object on which the pattern converter should be executed. - - - Derived pattern converters must override this method in order to - convert conversion specifiers in the appropriate way. - - - - - - Set the next pattern converter in the chains - - the pattern converter that should follow this converter in the chain - the next converter - - - The PatternConverter can merge with its neighbor during this method (or a sub class). - Therefore the return value may or may not be the value of the argument passed in. - - - - - - Write the pattern converter to the writer with appropriate formatting - - that will receive the formatted result. - The state object on which the pattern converter should be executed. - - - This method calls to allow the subclass to perform - appropriate conversion of the pattern converter. If formatting options have - been specified via the then this method will - apply those formattings before writing the output. - - - - - - Fast space padding method. - - to which the spaces will be appended. - The number of spaces to be padded. - - - Fast space padding method. - - - - - - The option string to the converter - - - - - Write an dictionary to a - - the writer to write to - a to use for object conversion - the value to write to the writer - - - Writes the to a writer in the form: - - - {key1=value1, key2=value2, key3=value3} - - - If the specified - is not null then it is used to render the key and value to text, otherwise - the object's ToString method is called. - - - - - - Write an dictionary to a - - the writer to write to - a to use for object conversion - the value to write to the writer - - - Writes the to a writer in the form: - - - {key1=value1, key2=value2, key3=value3} - - - If the specified - is not null then it is used to render the key and value to text, otherwise - the object's ToString method is called. - - - - - - Write an object to a - - the writer to write to - a to use for object conversion - the value to write to the writer - - - Writes the Object to a writer. If the specified - is not null then it is used to render the object to text, otherwise - the object's ToString method is called. - - - - - - Get the next pattern converter in the chain - - - the next pattern converter in the chain - - - - Get the next pattern converter in the chain - - - - - - Gets or sets the formatting info for this converter - - - The formatting info for this converter - - - - Gets or sets the formatting info for this converter - - - - - - Gets or sets the option value for this converter - - - The option for this converter - - - - Gets or sets the option value for this converter - - - - - - - - - - - Initializes a new instance of the class. - - - - - Derived pattern converters must override this method in order to - convert conversion specifiers in the correct way. - - that will receive the formatted result. - The on which the pattern converter should be executed. - - - - Derived pattern converters must override this method in order to - convert conversion specifiers in the correct way. - - that will receive the formatted result. - The state object on which the pattern converter should be executed. - - - - Flag indicating if this converter handles exceptions - - - false if this converter handles exceptions - - - - - Flag indicating if this converter handles the logging event exception - - false if this converter handles the logging event exception - - - If this converter handles the exception object contained within - , then this property should be set to - false. Otherwise, if the layout ignores the exception - object, then the property should be set to true. - - - Set this value to override a this default setting. The default - value is true, this converter does not handle the exception. - - - - - - Write the event appdomain name to the output - - that will receive the formatted result. - the event being logged - - - Writes the to the output . - - - - - - Converter for items in the ASP.Net Cache. - - - - Outputs an item from the . - - - Ron Grabowski - - - - Abstract class that provides access to the current HttpContext () that - derived classes need. - - - This class handles the case when HttpContext.Current is null by writing - to the writer. - - Ron Grabowski - - - - Derived pattern converters must override this method in order to - convert conversion specifiers in the correct way. - - that will receive the formatted result. - The on which the pattern converter should be executed. - The under which the ASP.Net request is running. - - - - Write the ASP.Net Cache item to the output - - that will receive the formatted result. - The on which the pattern converter should be executed. - The under which the ASP.Net request is running. - - - Writes out the value of a named property. The property name - should be set in the - property. If no property has been set, all key value pairs from the Cache will - be written to the output. - - - - - - Converter for items in the . - - - - Outputs an item from the . - - - Ron Grabowski - - - - Write the ASP.Net HttpContext item to the output - - that will receive the formatted result. - The on which the pattern converter should be executed. - The under which the ASP.Net request is running. - - - Writes out the value of a named property. The property name - should be set in the - property. - - - - - - Converter for items in the ASP.Net Cache. - - - - Outputs an item from the . - - - Ron Grabowski - - - - Write the ASP.Net Cache item to the output - - that will receive the formatted result. - The on which the pattern converter should be executed. - The under which the ASP.Net request is running. - - - Writes out the value of a named property. The property name - should be set in the - property. - - - - - - Converter for items in the ASP.Net Cache. - - - - Outputs an item from the . - - - Ron Grabowski - - - - Write the ASP.Net Cache item to the output - - that will receive the formatted result. - The on which the pattern converter should be executed. - The under which the ASP.Net request is running. - - - Writes out the value of a named property. The property name - should be set in the - property. If no property has been set, all key value pairs from the Session will - be written to the output. - - - - - - Date pattern converter, uses a to format - the date of a . - - - - Render the to the writer as a string. - - - The value of the determines - the formatting of the date. The following values are allowed: - - - Option value - Output - - - ISO8601 - - Uses the formatter. - Formats using the "yyyy-MM-dd HH:mm:ss,fff" pattern. - - - - DATE - - Uses the formatter. - Formats using the "dd MMM yyyy HH:mm:ss,fff" for example, "06 Nov 1994 15:49:37,459". - - - - ABSOLUTE - - Uses the formatter. - Formats using the "HH:mm:ss,yyyy" for example, "15:49:37,459". - - - - other - - Any other pattern string uses the formatter. - This formatter passes the pattern string to the - method. - For details on valid patterns see - DateTimeFormatInfo Class. - - - - - - The is in the local time zone and is rendered in that zone. - To output the time in Universal time see . - - - Nicko Cadell - - - - The used to render the date to a string - - - - The used to render the date to a string - - - - - - Initialize the converter pattern based on the property. - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - - - - Convert the pattern into the rendered message - - that will receive the formatted result. - the event being logged - - - Pass the to the - for it to render it to the writer. - - - The passed is in the local time zone. - - - - - - The fully qualified type of the DatePatternConverter class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Write the exception text to the output - - - - If an exception object is stored in the logging event - it will be rendered into the pattern output with a - trailing newline. - - - If there is no exception then nothing will be output - and no trailing newline will be appended. - It is typical to put a newline before the exception - and to have the exception as the last data in the pattern. - - - Nicko Cadell - - - - Default constructor - - - - - Write the exception text to the output - - that will receive the formatted result. - the event being logged - - - If an exception object is stored in the logging event - it will be rendered into the pattern output with a - trailing newline. - - - If there is no exception or the exception property specified - by the Option value does not exist then nothing will be output - and no trailing newline will be appended. - It is typical to put a newline before the exception - and to have the exception as the last data in the pattern. - - - Recognized values for the Option parameter are: - - - - Message - - - Source - - - StackTrace - - - TargetSite - - - HelpLink - - - - - - - Writes the caller location file name to the output - - - - Writes the value of the for - the event to the output writer. - - - Nicko Cadell - - - - Write the caller location file name to the output - - that will receive the formatted result. - the event being logged - - - Writes the value of the for - the to the output . - - - - - - Write the caller location info to the output - - - - Writes the to the output writer. - - - Nicko Cadell - - - - Write the caller location info to the output - - that will receive the formatted result. - the event being logged - - - Writes the to the output writer. - - - - - - Writes the event identity to the output - - - - Writes the value of the to - the output writer. - - - Daniel Cazzulino - Nicko Cadell - - - - Writes the event identity to the output - - that will receive the formatted result. - the event being logged - - - Writes the value of the - to - the output . - - - - - - Write the event level to the output - - - - Writes the display name of the event - to the writer. - - - Nicko Cadell - - - - Write the event level to the output - - that will receive the formatted result. - the event being logged - - - Writes the of the - to the . - - - - - - Write the caller location line number to the output - - - - Writes the value of the for - the event to the output writer. - - - Nicko Cadell - - - - Write the caller location line number to the output - - that will receive the formatted result. - the event being logged - - - Writes the value of the for - the to the output . - - - - - - Converter for logger name - - - - Outputs the of the event. - - - Nicko Cadell - - - - Converter to output and truncate '.' separated strings - - - - This abstract class supports truncating a '.' separated string - to show a specified number of elements from the right hand side. - This is used to truncate class names that are fully qualified. - - - Subclasses should override the method to - return the fully qualified string. - - - Nicko Cadell - - - - Initialize the converter - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - - - - Get the fully qualified string data - - the event being logged - the fully qualified name - - - Overridden by subclasses to get the fully qualified name before the - precision is applied to it. - - - Return the fully qualified '.' (dot/period) separated string. - - - - - - Convert the pattern to the rendered message - - that will receive the formatted result. - the event being logged - - Render the to the precision - specified by the property. - - - - - The fully qualified type of the NamedPatternConverter class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Gets the fully qualified name of the logger - - the event being logged - The fully qualified logger name - - - Returns the of the . - - - - - - Writes the event message to the output - - - - Uses the method - to write out the event message. - - - Nicko Cadell - - - - Writes the event message to the output - - that will receive the formatted result. - the event being logged - - - Uses the method - to write out the event message. - - - - - - Write the method name to the output - - - - Writes the caller location to - the output. - - - Nicko Cadell - - - - Write the method name to the output - - that will receive the formatted result. - the event being logged - - - Writes the caller location to - the output. - - - - - - Converter to include event NDC - - - - Outputs the value of the event property named NDC. - - - The should be used instead. - - - Nicko Cadell - - - - Write the event NDC to the output - - that will receive the formatted result. - the event being logged - - - As the thread context stacks are now stored in named event properties - this converter simply looks up the value of the NDC property. - - - The should be used instead. - - - - - - Property pattern converter - - - - Writes out the value of a named property. The property name - should be set in the - property. - - - If the is set to null - then all the properties are written as key value pairs. - - - Nicko Cadell - - - - Write the property value to the output - - that will receive the formatted result. - the event being logged - - - Writes out the value of a named property. The property name - should be set in the - property. - - - If the is set to null - then all the properties are written as key value pairs. - - - - - - Converter to output the relative time of the event - - - - Converter to output the time of the event relative to the start of the program. - - - Nicko Cadell - - - - Write the relative time to the output - - that will receive the formatted result. - the event being logged - - - Writes out the relative time of the event in milliseconds. - That is the number of milliseconds between the event - and the . - - - - - - Helper method to get the time difference between two DateTime objects - - start time (in the current local time zone) - end time (in the current local time zone) - the time difference in milliseconds - - - - Write the caller stack frames to the output - - - - Writes the to the output writer, using format: - type3.MethodCall3(type param,...) > type2.MethodCall2(type param,...) > type1.MethodCall1(type param,...) - - - Adam Davies - - - - Write the caller stack frames to the output - - - - Writes the to the output writer, using format: - type3.MethodCall3 > type2.MethodCall2 > type1.MethodCall1 - - - Michael Cromwell - - - - Initialize the converter - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - - - - Write the strack frames to the output - - that will receive the formatted result. - the event being logged - - - Writes the to the output writer. - - - - - - Returns the Name of the method - - - This method was created, so this class could be used as a base class for StackTraceDetailPatternConverter - string - - - - The fully qualified type of the StackTracePatternConverter class. - - - Used by the internal logger to record the Type of the - log message. - - - - - The fully qualified type of the StackTraceDetailPatternConverter class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Converter to include event thread name - - - - Writes the to the output. - - - Nicko Cadell - - - - Write the ThreadName to the output - - that will receive the formatted result. - the event being logged - - - Writes the to the . - - - - - - Pattern converter for the class name - - - - Outputs the of the event. - - - Nicko Cadell - - - - Gets the fully qualified name of the class - - the event being logged - The fully qualified type name for the caller location - - - Returns the of the . - - - - - - Converter to include event user name - - Douglas de la Torre - Nicko Cadell - - - - Convert the pattern to the rendered message - - that will receive the formatted result. - the event being logged - - - - Write the TimeStamp to the output - - - - Date pattern converter, uses a to format - the date of a . - - - Uses a to format the - in Universal time. - - - See the for details on the date pattern syntax. - - - - Nicko Cadell - - - - Write the TimeStamp to the output - - that will receive the formatted result. - the event being logged - - - Pass the to the - for it to render it to the writer. - - - The passed is in the local time zone, this is converted - to Universal time before it is rendered. - - - - - - - The fully qualified type of the UtcDatePatternConverter class. - - - Used by the internal logger to record the Type of the - log message. - - - - - A flexible layout configurable with pattern string that re-evaluates on each call. - - - This class is built on and provides all the - features and capabilities of PatternLayout. PatternLayout is a 'static' class - in that its layout is done once at configuration time. This class will recreate - the layout on each reference. - One important difference between PatternLayout and DynamicPatternLayout is the - treatment of the Header and Footer parameters in the configuration. The Header and Footer - parameters for DynamicPatternLayout must be syntactically in the form of a PatternString, - but should not be marked as type log4net.Util.PatternString. Doing so causes the - pattern to be statically converted at configuration time and causes DynamicPatternLayout - to perform the same as PatternLayout. - Please see for complete documentation. - - <layout type="log4net.Layout.DynamicPatternLayout"> - <param name="Header" value="%newline**** Trace Opened Local: %date{yyyy-MM-dd HH:mm:ss.fff} UTC: %utcdate{yyyy-MM-dd HH:mm:ss.fff} ****%newline" /> - <param name="Footer" value="**** Trace Closed %date{yyyy-MM-dd HH:mm:ss.fff} ****%newline" /> - </layout> - - - - - - A flexible layout configurable with pattern string. - - - - The goal of this class is to a - as a string. The results - depend on the conversion pattern. - - - The conversion pattern is closely related to the conversion - pattern of the printf function in C. A conversion pattern is - composed of literal text and format control expressions called - conversion specifiers. - - - You are free to insert any literal text within the conversion - pattern. - - - Each conversion specifier starts with a percent sign (%) and is - followed by optional format modifiers and a conversion - pattern name. The conversion pattern name specifies the type of - data, e.g. logger, level, date, thread name. The format - modifiers control such things as field width, padding, left and - right justification. The following is a simple example. - - - Let the conversion pattern be "%-5level [%thread]: %message%newline" and assume - that the log4net environment was set to use a PatternLayout. Then the - statements - - - ILog log = LogManager.GetLogger(typeof(TestApp)); - log.Debug("Message 1"); - log.Warn("Message 2"); - - would yield the output - - DEBUG [main]: Message 1 - WARN [main]: Message 2 - - - Note that there is no explicit separator between text and - conversion specifiers. The pattern parser knows when it has reached - the end of a conversion specifier when it reads a conversion - character. In the example above the conversion specifier - %-5level means the level of the logging event should be left - justified to a width of five characters. - - - The recognized conversion pattern names are: - - - - Conversion Pattern Name - Effect - - - a - Equivalent to appdomain - - - appdomain - - Used to output the friendly name of the AppDomain where the - logging event was generated. - - - - aspnet-cache - - - Used to output all cache items in the case of %aspnet-cache or just one named item if used as %aspnet-cache{key} - - - This pattern is not available for Compact Framework or Client Profile assemblies. - - - - - aspnet-context - - - Used to output all context items in the case of %aspnet-context or just one named item if used as %aspnet-context{key} - - - This pattern is not available for Compact Framework or Client Profile assemblies. - - - - - aspnet-request - - - Used to output all request parameters in the case of %aspnet-request or just one named param if used as %aspnet-request{key} - - - This pattern is not available for Compact Framework or Client Profile assemblies. - - - - - aspnet-session - - - Used to output all session items in the case of %aspnet-session or just one named item if used as %aspnet-session{key} - - - This pattern is not available for Compact Framework or Client Profile assemblies. - - - - - c - Equivalent to logger - - - C - Equivalent to type - - - class - Equivalent to type - - - d - Equivalent to date - - - date - - - Used to output the date of the logging event in the local time zone. - To output the date in universal time use the %utcdate pattern. - The date conversion - specifier may be followed by a date format specifier enclosed - between braces. For example, %date{HH:mm:ss,fff} or - %date{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is - given then ISO8601 format is - assumed (). - - - The date format specifier admits the same syntax as the - time pattern string of the . - - - For better results it is recommended to use the log4net date - formatters. These can be specified using one of the strings - "ABSOLUTE", "DATE" and "ISO8601" for specifying - , - and respectively - . For example, - %date{ISO8601} or %date{ABSOLUTE}. - - - These dedicated date formatters perform significantly - better than . - - - - - exception - - - Used to output the exception passed in with the log message. - - - If an exception object is stored in the logging event - it will be rendered into the pattern output with a - trailing newline. - If there is no exception then nothing will be output - and no trailing newline will be appended. - It is typical to put a newline before the exception - and to have the exception as the last data in the pattern. - - - - - F - Equivalent to file - - - file - - - Used to output the file name where the logging request was - issued. - - - WARNING Generating caller location information is - extremely slow. Its use should be avoided unless execution speed - is not an issue. - - - See the note below on the availability of caller location information. - - - - - identity - - - Used to output the user name for the currently active user - (Principal.Identity.Name). - - - WARNING Generating caller information is - extremely slow. Its use should be avoided unless execution speed - is not an issue. - - - - - l - Equivalent to location - - - L - Equivalent to line - - - location - - - Used to output location information of the caller which generated - the logging event. - - - The location information depends on the CLI implementation but - usually consists of the fully qualified name of the calling - method followed by the callers source the file name and line - number between parentheses. - - - The location information can be very useful. However, its - generation is extremely slow. Its use should be avoided - unless execution speed is not an issue. - - - See the note below on the availability of caller location information. - - - - - level - - - Used to output the level of the logging event. - - - - - line - - - Used to output the line number from where the logging request - was issued. - - - WARNING Generating caller location information is - extremely slow. Its use should be avoided unless execution speed - is not an issue. - - - See the note below on the availability of caller location information. - - - - - logger - - - Used to output the logger of the logging event. The - logger conversion specifier can be optionally followed by - precision specifier, that is a decimal constant in - brackets. - - - If a precision specifier is given, then only the corresponding - number of right most components of the logger name will be - printed. By default the logger name is printed in full. - - - For example, for the logger name "a.b.c" the pattern - %logger{2} will output "b.c". - - - - - m - Equivalent to message - - - M - Equivalent to method - - - message - - - Used to output the application supplied message associated with - the logging event. - - - - - mdc - - - The MDC (old name for the ThreadContext.Properties) is now part of the - combined event properties. This pattern is supported for compatibility - but is equivalent to property. - - - - - method - - - Used to output the method name where the logging request was - issued. - - - WARNING Generating caller location information is - extremely slow. Its use should be avoided unless execution speed - is not an issue. - - - See the note below on the availability of caller location information. - - - - - n - Equivalent to newline - - - newline - - - Outputs the platform dependent line separator character or - characters. - - - This conversion pattern offers the same performance as using - non-portable line separator strings such as "\n", or "\r\n". - Thus, it is the preferred way of specifying a line separator. - - - - - ndc - - - Used to output the NDC (nested diagnostic context) associated - with the thread that generated the logging event. - - - - - p - Equivalent to level - - - P - Equivalent to property - - - properties - Equivalent to property - - - property - - - Used to output the an event specific property. The key to - lookup must be specified within braces and directly following the - pattern specifier, e.g. %property{user} would include the value - from the property that is keyed by the string 'user'. Each property value - that is to be included in the log must be specified separately. - Properties are added to events by loggers or appenders. By default - the log4net:HostName property is set to the name of machine on - which the event was originally logged. - - - If no key is specified, e.g. %property then all the keys and their - values are printed in a comma separated list. - - - The properties of an event are combined from a number of different - contexts. These are listed below in the order in which they are searched. - - - - the event properties - - The event has that can be set. These - properties are specific to this event only. - - - - the thread properties - - The that are set on the current - thread. These properties are shared by all events logged on this thread. - - - - the global properties - - The that are set globally. These - properties are shared by all the threads in the AppDomain. - - - - - - - - r - Equivalent to timestamp - - - stacktrace - - - Used to output the stack trace of the logging event - The stack trace level specifier may be enclosed - between braces. For example, %stacktrace{level}. - If no stack trace level specifier is given then 1 is assumed - - - Output uses the format: - type3.MethodCall3 > type2.MethodCall2 > type1.MethodCall1 - - - This pattern is not available for Compact Framework assemblies. - - - - - stacktracedetail - - - Used to output the stack trace of the logging event - The stack trace level specifier may be enclosed - between braces. For example, %stacktracedetail{level}. - If no stack trace level specifier is given then 1 is assumed - - - Output uses the format: - type3.MethodCall3(type param,...) > type2.MethodCall2(type param,...) > type1.MethodCall1(type param,...) - - - This pattern is not available for Compact Framework assemblies. - - - - - t - Equivalent to thread - - - timestamp - - - Used to output the number of milliseconds elapsed since the start - of the application until the creation of the logging event. - - - - - thread - - - Used to output the name of the thread that generated the - logging event. Uses the thread number if no name is available. - - - - - type - - - Used to output the fully qualified type name of the caller - issuing the logging request. This conversion specifier - can be optionally followed by precision specifier, that - is a decimal constant in brackets. - - - If a precision specifier is given, then only the corresponding - number of right most components of the class name will be - printed. By default the class name is output in fully qualified form. - - - For example, for the class name "log4net.Layout.PatternLayout", the - pattern %type{1} will output "PatternLayout". - - - WARNING Generating the caller class information is - slow. Thus, its use should be avoided unless execution speed is - not an issue. - - - See the note below on the availability of caller location information. - - - - - u - Equivalent to identity - - - username - - - Used to output the WindowsIdentity for the currently - active user. - - - WARNING Generating caller WindowsIdentity information is - extremely slow. Its use should be avoided unless execution speed - is not an issue. - - - - - utcdate - - - Used to output the date of the logging event in universal time. - The date conversion - specifier may be followed by a date format specifier enclosed - between braces. For example, %utcdate{HH:mm:ss,fff} or - %utcdate{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is - given then ISO8601 format is - assumed (). - - - The date format specifier admits the same syntax as the - time pattern string of the . - - - For better results it is recommended to use the log4net date - formatters. These can be specified using one of the strings - "ABSOLUTE", "DATE" and "ISO8601" for specifying - , - and respectively - . For example, - %utcdate{ISO8601} or %utcdate{ABSOLUTE}. - - - These dedicated date formatters perform significantly - better than . - - - - - w - Equivalent to username - - - x - Equivalent to ndc - - - X - Equivalent to mdc - - - % - - - The sequence %% outputs a single percent sign. - - - - - - The single letter patterns are deprecated in favor of the - longer more descriptive pattern names. - - - By default the relevant information is output as is. However, - with the aid of format modifiers it is possible to change the - minimum field width, the maximum field width and justification. - - - The optional format modifier is placed between the percent sign - and the conversion pattern name. - - - The first optional format modifier is the left justification - flag which is just the minus (-) character. Then comes the - optional minimum field width modifier. This is a decimal - constant that represents the minimum number of characters to - output. If the data item requires fewer characters, it is padded on - either the left or the right until the minimum width is - reached. The default is to pad on the left (right justify) but you - can specify right padding with the left justification flag. The - padding character is space. If the data item is larger than the - minimum field width, the field is expanded to accommodate the - data. The value is never truncated. - - - This behavior can be changed using the maximum field - width modifier which is designated by a period followed by a - decimal constant. If the data item is longer than the maximum - field, then the extra characters are removed from the - beginning of the data item and not from the end. For - example, it the maximum field width is eight and the data item is - ten characters long, then the first two characters of the data item - are dropped. This behavior deviates from the printf function in C - where truncation is done from the end. - - - Below are various format modifier examples for the logger - conversion specifier. - -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Format modifierleft justifyminimum widthmaximum widthcomment
      %20loggerfalse20none - - Left pad with spaces if the logger name is less than 20 - characters long. - -
      %-20loggertrue20none - - Right pad with spaces if the logger - name is less than 20 characters long. - -
      %.30loggerNAnone30 - - Truncate from the beginning if the logger - name is longer than 30 characters. - -
      %20.30loggerfalse2030 - - Left pad with spaces if the logger name is shorter than 20 - characters. However, if logger name is longer than 30 characters, - then truncate from the beginning. - -
      %-20.30loggertrue2030 - - Right pad with spaces if the logger name is shorter than 20 - characters. However, if logger name is longer than 30 characters, - then truncate from the beginning. - -
      -
      - - Note about caller location information.
      - The following patterns %type %file %line %method %location %class %C %F %L %l %M - all generate caller location information. - Location information uses the System.Diagnostics.StackTrace class to generate - a call stack. The caller's information is then extracted from this stack. -
      - - - The System.Diagnostics.StackTrace class is not supported on the - .NET Compact Framework 1.0 therefore caller location information is not - available on that framework. - - - - - The System.Diagnostics.StackTrace class has this to say about Release builds: - - - "StackTrace information will be most informative with Debug build configurations. - By default, Debug builds include debug symbols, while Release builds do not. The - debug symbols contain most of the file, method name, line number, and column - information used in constructing StackFrame and StackTrace objects. StackTrace - might not report as many method calls as expected, due to code transformations - that occur during optimization." - - - This means that in a Release build the caller information may be incomplete or may - not exist at all! Therefore caller location information cannot be relied upon in a Release build. - - - - Additional pattern converters may be registered with a specific - instance using the method. - -
      - - This is a more detailed pattern. - %timestamp [%thread] %level %logger %ndc - %message%newline - - - A similar pattern except that the relative time is - right padded if less than 6 digits, thread name is right padded if - less than 15 characters and truncated if longer and the logger - name is left padded if shorter than 30 characters and truncated if - longer. - %-6timestamp [%15.15thread] %-5level %30.30logger %ndc - %message%newline - - Nicko Cadell - Gert Driesen - Douglas de la Torre - Daniel Cazzulino -
      - - - Extend this abstract class to create your own log layout format. - - - - This is the base implementation of the - interface. Most layout objects should extend this class. - - - - - - Subclasses must implement the - method. - - - Subclasses should set the in their default - constructor. - - - - Nicko Cadell - Gert Driesen - - - - Interface implemented by layout objects - - - - An object is used to format a - as text. The method is called by an - appender to transform the into a string. - - - The layout can also supply and - text that is appender before any events and after all the events respectively. - - - Nicko Cadell - Gert Driesen - - - - Implement this method to create your own layout format. - - The TextWriter to write the formatted event to - The event to format - - - This method is called by an appender to format - the as text and output to a writer. - - - If the caller does not have a and prefers the - event to be formatted as a then the following - code can be used to format the event into a . - - - StringWriter writer = new StringWriter(); - Layout.Format(writer, loggingEvent); - string formattedEvent = writer.ToString(); - - - - - - The content type output by this layout. - - The content type - - - The content type output by this layout. - - - This is a MIME type e.g. "text/plain". - - - - - - The header for the layout format. - - the layout header - - - The Header text will be appended before any logging events - are formatted and appended. - - - - - - The footer for the layout format. - - the layout footer - - - The Footer text will be appended after all the logging events - have been formatted and appended. - - - - - - Flag indicating if this layout handle exceptions - - false if this layout handles exceptions - - - If this layout handles the exception object contained within - , then the layout should return - false. Otherwise, if the layout ignores the exception - object, then the layout should return true. - - - - - - The header text - - - - See for more information. - - - - - - The footer text - - - - See for more information. - - - - - - Flag indicating if this layout handles exceptions - - - - false if this layout handles exceptions - - - - - - Empty default constructor - - - - Empty default constructor - - - - - - Activate component options - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - This method must be implemented by the subclass. - - - - - - Implement this method to create your own layout format. - - The TextWriter to write the formatted event to - The event to format - - - This method is called by an appender to format - the as text. - - - - - - Convenience method for easily formatting the logging event into a string variable. - - - - Creates a new StringWriter instance to store the formatted logging event. - - - - - The content type output by this layout. - - The content type is "text/plain" - - - The content type output by this layout. - - - This base class uses the value "text/plain". - To change this value a subclass must override this - property. - - - - - - The header for the layout format. - - the layout header - - - The Header text will be appended before any logging events - are formatted and appended. - - - - - - The footer for the layout format. - - the layout footer - - - The Footer text will be appended after all the logging events - have been formatted and appended. - - - - - - Flag indicating if this layout handles exceptions - - false if this layout handles exceptions - - - If this layout handles the exception object contained within - , then the layout should return - false. Otherwise, if the layout ignores the exception - object, then the layout should return true. - - - Set this value to override a this default setting. The default - value is true, this layout does not handle the exception. - - - - - - Default pattern string for log output. - - - - Default pattern string for log output. - Currently set to the string "%message%newline" - which just prints the application supplied message. - - - - - - A detailed conversion pattern - - - - A conversion pattern which includes Time, Thread, Logger, and Nested Context. - Current value is %timestamp [%thread] %level %logger %ndc - %message%newline. - - - - - - Internal map of converter identifiers to converter types. - - - - This static map is overridden by the m_converterRegistry instance map - - - - - - the pattern - - - - - the head of the pattern converter chain - - - - - patterns defined on this PatternLayout only - - - - - Initialize the global registry - - - - Defines the builtin global rules. - - - - - - Constructs a PatternLayout using the DefaultConversionPattern - - - - The default pattern just produces the application supplied message. - - - Note to Inheritors: This constructor calls the virtual method - . If you override this method be - aware that it will be called before your is called constructor. - - - As per the contract the - method must be called after the properties on this object have been - configured. - - - - - - Constructs a PatternLayout using the supplied conversion pattern - - the pattern to use - - - Note to Inheritors: This constructor calls the virtual method - . If you override this method be - aware that it will be called before your is called constructor. - - - When using this constructor the method - need not be called. This may not be the case when using a subclass. - - - - - - Create the pattern parser instance - - the pattern to parse - The that will format the event - - - Creates the used to parse the conversion string. Sets the - global and instance rules on the . - - - - - - Initialize layout options - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - - - - Produces a formatted string as specified by the conversion pattern. - - the event being logged - The TextWriter to write the formatted event to - - - Parse the using the patter format - specified in the property. - - - - - - Add a converter to this PatternLayout - - the converter info - - - This version of the method is used by the configurator. - Programmatic users should use the alternative method. - - - - - - Add a converter to this PatternLayout - - the name of the conversion pattern for this converter - the type of the converter - - - Add a named pattern converter to this instance. This - converter will be used in the formatting of the event. - This method must be called before . - - - The specified must extend the - type. - - - - - - The pattern formatting string - - - - The ConversionPattern option. This is the string which - controls formatting and consists of a mix of literal content and - conversion specifiers. - - - - - - The header PatternString - - - - - The footer PatternString - - - - - Constructs a DynamicPatternLayout using the DefaultConversionPattern - - - - The default pattern just produces the application supplied message. - - - - - - Constructs a DynamicPatternLayout using the supplied conversion pattern - - the pattern to use - - - - - - The header for the layout format. - - the layout header - - - The Header text will be appended before any logging events - are formatted and appended. - - The pattern will be formatted on each get operation. - - - - - The footer for the layout format. - - the layout footer - - - The Footer text will be appended after all the logging events - have been formatted and appended. - - The pattern will be formatted on each get operation. - - - - - A Layout that renders only the Exception text from the logging event - - - - A Layout that renders only the Exception text from the logging event. - - - This Layout should only be used with appenders that utilize multiple - layouts (e.g. ). - - - Nicko Cadell - Gert Driesen - - - - Default constructor - - - - Constructs a ExceptionLayout - - - - - - Activate component options - - - - Part of the component activation - framework. - - - This method does nothing as options become effective immediately. - - - - - - Gets the exception text from the logging event - - The TextWriter to write the formatted event to - the event being logged - - - Write the exception string to the . - The exception string is retrieved from . - - - - - - Interface for raw layout objects - - - - Interface used to format a - to an object. - - - This interface should not be confused with the - interface. This interface is used in - only certain specialized situations where a raw object is - required rather than a formatted string. The - is not generally useful than this interface. - - - Nicko Cadell - Gert Driesen - - - - Implement this method to create your own layout format. - - The event to format - returns the formatted event - - - Implement this method to create your own layout format. - - - - - - Adapts any to a - - - - Where an is required this adapter - allows a to be specified. - - - Nicko Cadell - Gert Driesen - - - - The layout to adapt - - - - - Construct a new adapter - - the layout to adapt - - - Create the adapter for the specified . - - - - - - Format the logging event as an object. - - The event to format - returns the formatted event - - - Format the logging event as an object. - - - Uses the object supplied to - the constructor to perform the formatting. - - - - - - Type converter for the interface - - - - Used to convert objects to the interface. - Supports converting from the interface to - the interface using the . - - - Nicko Cadell - Gert Driesen - - - - Interface supported by type converters - - - - This interface supports conversion from arbitrary types - to a single target type. See . - - - Nicko Cadell - Gert Driesen - - - - Can the source type be converted to the type supported by this object - - the type to convert - true if the conversion is possible - - - Test if the can be converted to the - type supported by this converter. - - - - - - Convert the source object to the type supported by this object - - the object to convert - the converted object - - - Converts the to the type supported - by this converter. - - - - - - Can the sourceType be converted to an - - the source to be to be converted - true if the source type can be converted to - - - Test if the can be converted to a - . Only is supported - as the . - - - - - - Convert the value to a object - - the value to convert - the object - - - Convert the object to a - object. If the object - is a then the - is used to adapt between the two interfaces, otherwise an - exception is thrown. - - - - - - Extract the value of a property from the - - - - Extract the value of a property from the - - - Nicko Cadell - - - - Constructs a RawPropertyLayout - - - - - Lookup the property for - - The event to format - returns property value - - - Looks up and returns the object value of the property - named . If there is no property defined - with than name then null will be returned. - - - - - - The name of the value to lookup in the LoggingEvent Properties collection. - - - Value to lookup in the LoggingEvent Properties collection - - - - String name of the property to lookup in the . - - - - - - Extract the date from the - - - - Extract the date from the - - - Nicko Cadell - Gert Driesen - - - - Constructs a RawTimeStampLayout - - - - - Gets the as a . - - The event to format - returns the time stamp - - - Gets the as a . - - - The time stamp is in local time. To format the time stamp - in universal time use . - - - - - - Extract the date from the - - - - Extract the date from the - - - Nicko Cadell - Gert Driesen - - - - Constructs a RawUtcTimeStampLayout - - - - - Gets the as a . - - The event to format - returns the time stamp - - - Gets the as a . - - - The time stamp is in universal time. To format the time stamp - in local time use . - - - - - - A very simple layout - - - - SimpleLayout consists of the level of the log statement, - followed by " - " and then the log message itself. For example, - - DEBUG - Hello world - - - - Nicko Cadell - Gert Driesen - - - - Constructs a SimpleLayout - - - - - Initialize layout options - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - - - - Produces a simple formatted output. - - the event being logged - The TextWriter to write the formatted event to - - - Formats the event as the level of the even, - followed by " - " and then the log message itself. The - output is terminated by a newline. - - - - - - Layout that formats the log events as XML elements. - - - - The output of the consists of a series of - log4net:event elements. It does not output a complete well-formed XML - file. The output is designed to be included as an external entity - in a separate file to form a correct XML file. - - - For example, if abc is the name of the file where - the output goes, then a well-formed XML file would - be: - - - <?xml version="1.0" ?> - - <!DOCTYPE log4net:events SYSTEM "log4net-events.dtd" [<!ENTITY data SYSTEM "abc">]> - - <log4net:events version="1.2" xmlns:log4net="http://logging.apache.org/log4net/schemas/log4net-events-1.2> - &data; - </log4net:events> - - - This approach enforces the independence of the - and the appender where it is embedded. - - - The version attribute helps components to correctly - interpret output generated by . The value of - this attribute should be "1.2" for release 1.2 and later. - - - Alternatively the Header and Footer properties can be - configured to output the correct XML header, open tag and close tag. - When setting the Header and Footer properties it is essential - that the underlying data store not be appendable otherwise the data - will become invalid XML. - - - Nicko Cadell - Gert Driesen - - - - Layout that formats the log events as XML elements. - - - - This is an abstract class that must be subclassed by an implementation - to conform to a specific schema. - - - Deriving classes must implement the method. - - - Nicko Cadell - Gert Driesen - - - - Protected constructor to support subclasses - - - - Initializes a new instance of the class - with no location info. - - - - - - Protected constructor to support subclasses - - - - The parameter determines whether - location information will be output by the layout. If - is set to true, then the - file name and line number of the statement at the origin of the log - statement will be output. - - - If you are embedding this layout within an SMTPAppender - then make sure to set the LocationInfo option of that - appender as well. - - - - - - Initialize layout options - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - - - - Produces a formatted string. - - The event being logged. - The TextWriter to write the formatted event to - - - Format the and write it to the . - - - This method creates an that writes to the - . The is passed - to the method. Subclasses should override the - method rather than this method. - - - - - - Does the actual writing of the XML. - - The writer to use to output the event to. - The event to write. - - - Subclasses should override this method to format - the as XML. - - - - - - Flag to indicate if location information should be included in - the XML events. - - - - - The string to replace invalid chars with - - - - - Gets a value indicating whether to include location information in - the XML events. - - - true if location information should be included in the XML - events; otherwise, false. - - - - If is set to true, then the file - name and line number of the statement at the origin of the log - statement will be output. - - - If you are embedding this layout within an SMTPAppender - then make sure to set the LocationInfo option of that - appender as well. - - - - - - The string to replace characters that can not be expressed in XML with. - - - Not all characters may be expressed in XML. This property contains the - string to replace those that can not with. This defaults to a ?. Set it - to the empty string to simply remove offending characters. For more - details on the allowed character ranges see http://www.w3.org/TR/REC-xml/#charsets - Character replacement will occur in the log message, the property names - and the property values. - - - - - - - Gets the content type output by this layout. - - - As this is the XML layout, the value is always "text/xml". - - - - As this is the XML layout, the value is always "text/xml". - - - - - - Constructs an XmlLayout - - - - - Constructs an XmlLayout. - - - - The LocationInfo option takes a boolean value. By - default, it is set to false which means there will be no location - information output by this layout. If the the option is set to - true, then the file name and line number of the statement - at the origin of the log statement will be output. - - - If you are embedding this layout within an SmtpAppender - then make sure to set the LocationInfo option of that - appender as well. - - - - - - Initialize layout options - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - Builds a cache of the element names - - - - - - Does the actual writing of the XML. - - The writer to use to output the event to. - The event to write. - - - Override the base class method - to write the to the . - - - - - - The prefix to use for all generated element names - - - - - The prefix to use for all element names - - - - The default prefix is log4net. Set this property - to change the prefix. If the prefix is set to an empty string - then no prefix will be written. - - - - - - Set whether or not to base64 encode the message. - - - - By default the log message will be written as text to the xml - output. This can cause problems when the message contains binary - data. By setting this to true the contents of the message will be - base64 encoded. If this is set then invalid character replacement - (see ) will not be performed - on the log message. - - - - - - Set whether or not to base64 encode the property values. - - - - By default the properties will be written as text to the xml - output. This can cause problems when one or more properties contain - binary data. By setting this to true the values of the properties - will be base64 encoded. If this is set then invalid character replacement - (see ) will not be performed - on the property values. - - - - - - Layout that formats the log events as XML elements compatible with the log4j schema - - - - Formats the log events according to the http://logging.apache.org/log4j schema. - - - Nicko Cadell - - - - The 1st of January 1970 in UTC - - - - - Constructs an XMLLayoutSchemaLog4j - - - - - Constructs an XMLLayoutSchemaLog4j. - - - - The LocationInfo option takes a boolean value. By - default, it is set to false which means there will be no location - information output by this layout. If the the option is set to - true, then the file name and line number of the statement - at the origin of the log statement will be output. - - - If you are embedding this layout within an SMTPAppender - then make sure to set the LocationInfo option of that - appender as well. - - - - - - Actually do the writing of the xml - - the writer to use - the event to write - - - Generate XML that is compatible with the log4j schema. - - - - - - The version of the log4j schema to use. - - - - Only version 1.2 of the log4j schema is supported. - - - - - - The default object Renderer. - - - - The default renderer supports rendering objects and collections to strings. - - - See the method for details of the output. - - - Nicko Cadell - Gert Driesen - - - - Implement this interface in order to render objects as strings - - - - Certain types require special case conversion to - string form. This conversion is done by an object renderer. - Object renderers implement the - interface. - - - Nicko Cadell - Gert Driesen - - - - Render the object to a string - - The map used to lookup renderers - The object to render - The writer to render to - - - Render the object to a - string. - - - The parameter is - provided to lookup and render other objects. This is - very useful where contains - nested objects of unknown type. The - method can be used to render these objects. - - - - - - Default constructor - - - - Default constructor - - - - - - Render the object to a string - - The map used to lookup renderers - The object to render - The writer to render to - - - Render the object to a string. - - - The parameter is - provided to lookup and render other objects. This is - very useful where contains - nested objects of unknown type. The - method can be used to render these objects. - - - The default renderer supports rendering objects to strings as follows: - - - - Value - Rendered String - - - null - - "(null)" - - - - - - - For a one dimensional array this is the - array type name, an open brace, followed by a comma - separated list of the elements (using the appropriate - renderer), followed by a close brace. - - - For example: int[] {1, 2, 3}. - - - If the array is not one dimensional the - Array.ToString() is returned. - - - - - , & - - - Rendered as an open brace, followed by a comma - separated list of the elements (using the appropriate - renderer), followed by a close brace. - - - For example: {a, b, c}. - - - All collection classes that implement its subclasses, - or generic equivalents all implement the interface. - - - - - - - - Rendered as the key, an equals sign ('='), and the value (using the appropriate - renderer). - - - For example: key=value. - - - - - other - - Object.ToString() - - - - - - - - Render the array argument into a string - - The map used to lookup renderers - the array to render - The writer to render to - - - For a one dimensional array this is the - array type name, an open brace, followed by a comma - separated list of the elements (using the appropriate - renderer), followed by a close brace. For example: - int[] {1, 2, 3}. - - - If the array is not one dimensional the - Array.ToString() is returned. - - - - - - Render the enumerator argument into a string - - The map used to lookup renderers - the enumerator to render - The writer to render to - - - Rendered as an open brace, followed by a comma - separated list of the elements (using the appropriate - renderer), followed by a close brace. For example: - {a, b, c}. - - - - - - Render the DictionaryEntry argument into a string - - The map used to lookup renderers - the DictionaryEntry to render - The writer to render to - - - Render the key, an equals sign ('='), and the value (using the appropriate - renderer). For example: key=value. - - - - - - Map class objects to an . - - - - Maintains a mapping between types that require special - rendering and the that - is used to render them. - - - The method is used to render an - object using the appropriate renderers defined in this map. - - - Nicko Cadell - Gert Driesen - - - - Default Constructor - - - - Default constructor. - - - - - - Render using the appropriate renderer. - - the object to render to a string - the object rendered as a string - - - This is a convenience method used to render an object to a string. - The alternative method - should be used when streaming output to a . - - - - - - Render using the appropriate renderer. - - the object to render to a string - The writer to render to - - - Find the appropriate renderer for the type of the - parameter. This is accomplished by calling the - method. Once a renderer is found, it is - applied on the object and the result is returned - as a . - - - - - - Gets the renderer for the specified object type - - the object to lookup the renderer for - the renderer for - - - Gets the renderer for the specified object type. - - - Syntactic sugar method that calls - with the type of the object parameter. - - - - - - Gets the renderer for the specified type - - the type to lookup the renderer for - the renderer for the specified type - - - Returns the renderer for the specified type. - If no specific renderer has been defined the - will be returned. - - - - - - Internal function to recursively search interfaces - - the type to lookup the renderer for - the renderer for the specified type - - - - Clear the map of renderers - - - - Clear the custom renderers defined by using - . The - cannot be removed. - - - - - - Register an for . - - the type that will be rendered by - the renderer for - - - Register an object renderer for a specific source type. - This renderer will be returned from a call to - specifying the same as an argument. - - - - - - Get the default renderer instance - - the default renderer - - - Get the default renderer - - - - - - Interface implemented by logger repository plugins. - - - - Plugins define additional behavior that can be associated - with a . - The held by the - property is used to store the plugins for a repository. - - - The log4net.Config.PluginAttribute can be used to - attach plugins to repositories created using configuration - attributes. - - - Nicko Cadell - Gert Driesen - - - - Attaches the plugin to the specified . - - The that this plugin should be attached to. - - - A plugin may only be attached to a single repository. - - - This method is called when the plugin is attached to the repository. - - - - - - Is called when the plugin is to shutdown. - - - - This method is called to notify the plugin that - it should stop operating and should detach from - the repository. - - - - - - Gets the name of the plugin. - - - The name of the plugin. - - - - Plugins are stored in the - keyed by name. Each plugin instance attached to a - repository must be a unique name. - - - - - - A strongly-typed collection of objects. - - Nicko Cadell - - - - Creates a read-only wrapper for a PluginCollection instance. - - list to create a readonly wrapper arround - - A PluginCollection wrapper that is read-only. - - - - - Initializes a new instance of the PluginCollection class - that is empty and has the default initial capacity. - - - - - Initializes a new instance of the PluginCollection class - that has the specified initial capacity. - - - The number of elements that the new PluginCollection is initially capable of storing. - - - - - Initializes a new instance of the PluginCollection class - that contains elements copied from the specified PluginCollection. - - The PluginCollection whose elements are copied to the new collection. - - - - Initializes a new instance of the PluginCollection class - that contains elements copied from the specified array. - - The array whose elements are copied to the new list. - - - - Initializes a new instance of the PluginCollection class - that contains elements copied from the specified collection. - - The collection whose elements are copied to the new list. - - - - Allow subclasses to avoid our default constructors - - - - - - - Copies the entire PluginCollection to a one-dimensional - array. - - The one-dimensional array to copy to. - - - - Copies the entire PluginCollection to a one-dimensional - array, starting at the specified index of the target array. - - The one-dimensional array to copy to. - The zero-based index in at which copying begins. - - - - Adds a to the end of the PluginCollection. - - The to be added to the end of the PluginCollection. - The index at which the value has been added. - - - - Removes all elements from the PluginCollection. - - - - - Creates a shallow copy of the . - - A new with a shallow copy of the collection data. - - - - Determines whether a given is in the PluginCollection. - - The to check for. - true if is found in the PluginCollection; otherwise, false. - - - - Returns the zero-based index of the first occurrence of a - in the PluginCollection. - - The to locate in the PluginCollection. - - The zero-based index of the first occurrence of - in the entire PluginCollection, if found; otherwise, -1. - - - - - Inserts an element into the PluginCollection at the specified index. - - The zero-based index at which should be inserted. - The to insert. - - is less than zero - -or- - is equal to or greater than . - - - - - Removes the first occurrence of a specific from the PluginCollection. - - The to remove from the PluginCollection. - - The specified was not found in the PluginCollection. - - - - - Removes the element at the specified index of the PluginCollection. - - The zero-based index of the element to remove. - - is less than zero. - -or- - is equal to or greater than . - - - - - Returns an enumerator that can iterate through the PluginCollection. - - An for the entire PluginCollection. - - - - Adds the elements of another PluginCollection to the current PluginCollection. - - The PluginCollection whose elements should be added to the end of the current PluginCollection. - The new of the PluginCollection. - - - - Adds the elements of a array to the current PluginCollection. - - The array whose elements should be added to the end of the PluginCollection. - The new of the PluginCollection. - - - - Adds the elements of a collection to the current PluginCollection. - - The collection whose elements should be added to the end of the PluginCollection. - The new of the PluginCollection. - - - - Sets the capacity to the actual number of elements. - - - - - is less than zero. - -or- - is equal to or greater than . - - - - - is less than zero. - -or- - is equal to or greater than . - - - - - Gets the number of elements actually contained in the PluginCollection. - - - - - Gets a value indicating whether access to the collection is synchronized (thread-safe). - - true if access to the ICollection is synchronized (thread-safe); otherwise, false. - - - - Gets an object that can be used to synchronize access to the collection. - - - An object that can be used to synchronize access to the collection. - - - - - Gets or sets the at the specified index. - - - The at the specified index. - - The zero-based index of the element to get or set. - - is less than zero. - -or- - is equal to or greater than . - - - - - Gets a value indicating whether the collection has a fixed size. - - true if the collection has a fixed size; otherwise, false. The default is false. - - - - Gets a value indicating whether the IList is read-only. - - true if the collection is read-only; otherwise, false. The default is false. - - - - Gets or sets the number of elements the PluginCollection can contain. - - - The number of elements the PluginCollection can contain. - - - - - Supports type-safe iteration over a . - - - - - - Advances the enumerator to the next element in the collection. - - - true if the enumerator was successfully advanced to the next element; - false if the enumerator has passed the end of the collection. - - - The collection was modified after the enumerator was created. - - - - - Sets the enumerator to its initial position, before the first element in the collection. - - - - - Gets the current element in the collection. - - - - - Type visible only to our subclasses - Used to access protected constructor - - - - - - A value - - - - - Supports simple iteration over a . - - - - - - Initializes a new instance of the Enumerator class. - - - - - - Advances the enumerator to the next element in the collection. - - - true if the enumerator was successfully advanced to the next element; - false if the enumerator has passed the end of the collection. - - - The collection was modified after the enumerator was created. - - - - - Sets the enumerator to its initial position, before the first element in the collection. - - - - - Gets the current element in the collection. - - - The current element in the collection. - - - - - - - - Map of repository plugins. - - - - This class is a name keyed map of the plugins that are - attached to a repository. - - - Nicko Cadell - Gert Driesen - - - - Constructor - - The repository that the plugins should be attached to. - - - Initialize a new instance of the class with a - repository that the plugins should be attached to. - - - - - - Adds a to the map. - - The to add to the map. - - - The will be attached to the repository when added. - - - If there already exists a plugin with the same name - attached to the repository then the old plugin will - be and replaced with - the new plugin. - - - - - - Removes a from the map. - - The to remove from the map. - - - Remove a specific plugin from this map. - - - - - - Gets a by name. - - The name of the to lookup. - - The from the map with the name specified, or - null if no plugin is found. - - - - Lookup a plugin by name. If the plugin is not found null - will be returned. - - - - - - Gets all possible plugins as a list of objects. - - All possible plugins as a list of objects. - - - Get a collection of all the plugins defined in this map. - - - - - - Base implementation of - - - - Default abstract implementation of the - interface. This base class can be used by implementors - of the interface. - - - Nicko Cadell - Gert Driesen - - - - Constructor - - the name of the plugin - - Initializes a new Plugin with the specified name. - - - - - Attaches this plugin to a . - - The that this plugin should be attached to. - - - A plugin may only be attached to a single repository. - - - This method is called when the plugin is attached to the repository. - - - - - - Is called when the plugin is to shutdown. - - - - This method is called to notify the plugin that - it should stop operating and should detach from - the repository. - - - - - - The name of this plugin. - - - - - The repository this plugin is attached to. - - - - - Gets or sets the name of the plugin. - - - The name of the plugin. - - - - Plugins are stored in the - keyed by name. Each plugin instance attached to a - repository must be a unique name. - - - The name of the plugin must not change one the - plugin has been attached to a repository. - - - - - - The repository for this plugin - - - The that this plugin is attached to. - - - - Gets or sets the that this plugin is - attached to. - - - - - - Plugin that listens for events from the - - - - This plugin publishes an instance of - on a specified . This listens for logging events delivered from - a remote . - - - When an event is received it is relogged within the attached repository - as if it had been raised locally. - - - Nicko Cadell - Gert Driesen - - - - Default constructor - - - - Initializes a new instance of the class. - - - The property must be set. - - - - - - Construct with sink Uri. - - The name to publish the sink under in the remoting infrastructure. - See for more details. - - - Initializes a new instance of the class - with specified name. - - - - - - Attaches this plugin to a . - - The that this plugin should be attached to. - - - A plugin may only be attached to a single repository. - - - This method is called when the plugin is attached to the repository. - - - - - - Is called when the plugin is to shutdown. - - - - When the plugin is shutdown the remote logging - sink is disconnected. - - - - - - The fully qualified type of the RemoteLoggingServerPlugin class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Gets or sets the URI of this sink. - - - The URI of this sink. - - - - This is the name under which the object is marshaled. - - - - - - - Delivers objects to a remote sink. - - - - Internal class used to listen for logging events - and deliver them to the local repository. - - - - - - Constructor - - The repository to log to. - - - Initializes a new instance of the for the - specified . - - - - - - Logs the events to the repository. - - The events to log. - - - The events passed are logged to the - - - - - - Obtains a lifetime service object to control the lifetime - policy for this instance. - - null to indicate that this instance should live forever. - - - Obtains a lifetime service object to control the lifetime - policy for this instance. This object should live forever - therefore this implementation returns null. - - - - - - The underlying that events should - be logged to. - - - - - Default implementation of - - - - This default implementation of the - interface is used to create the default subclass - of the object. - - - Nicko Cadell - Gert Driesen - - - - Interface abstracts creation of instances - - - - This interface is used by the to - create new objects. - - - The method is called - to create a named . - - - Implement this interface to create new subclasses of . - - - Nicko Cadell - Gert Driesen - - - - Create a new instance - - The that will own the . - The name of the . - The instance for the specified name. - - - Create a new instance with the - specified name. - - - Called by the to create - new named instances. - - - If the is null then the root logger - must be returned. - - - - - - Default constructor - - - - Initializes a new instance of the class. - - - - - - Create a new instance - - The that will own the . - The name of the . - The instance for the specified name. - - - Create a new instance with the - specified name. - - - Called by the to create - new named instances. - - - If the is null then the root logger - must be returned. - - - - - - Default internal subclass of - - - - This subclass has no additional behavior over the - class but does allow instances - to be created. - - - - - - Implementation of used by - - - - Internal class used to provide implementation of - interface. Applications should use to get - logger instances. - - - This is one of the central classes in the log4net implementation. One of the - distinctive features of log4net are hierarchical loggers and their - evaluation. The organizes the - instances into a rooted tree hierarchy. - - - The class is abstract. Only concrete subclasses of - can be created. The - is used to create instances of this type for the . - - - Nicko Cadell - Gert Driesen - Aspi Havewala - Douglas de la Torre - - - - This constructor created a new instance and - sets its name. - - The name of the . - - - This constructor is protected and designed to be used by - a subclass that is not abstract. - - - Loggers are constructed by - objects. See for the default - logger creator. - - - - - - Add to the list of appenders of this - Logger instance. - - An appender to add to this logger - - - Add to the list of appenders of this - Logger instance. - - - If is already in the list of - appenders, then it won't be added again. - - - - - - Look for the appender named as name - - The name of the appender to lookup - The appender with the name specified, or null. - - - Returns the named appender, or null if the appender is not found. - - - - - - Remove all previously added appenders from this Logger instance. - - - - Remove all previously added appenders from this Logger instance. - - - This is useful when re-reading configuration information. - - - - - - Remove the appender passed as parameter form the list of appenders. - - The appender to remove - The appender removed from the list - - - Remove the appender passed as parameter form the list of appenders. - The appender removed is not closed. - If you are discarding the appender you must call - on the appender removed. - - - - - - Remove the appender passed as parameter form the list of appenders. - - The name of the appender to remove - The appender removed from the list - - - Remove the named appender passed as parameter form the list of appenders. - The appender removed is not closed. - If you are discarding the appender you must call - on the appender removed. - - - - - - This generic form is intended to be used by wrappers. - - The declaring type of the method that is - the stack boundary into the logging system for this call. - The level of the message to be logged. - The message object to log. - The exception to log, including its stack trace. - - - Generate a logging event for the specified using - the and . - - - This method must not throw any exception to the caller. - - - - - - This is the most generic printing method that is intended to be used - by wrappers. - - The event being logged. - - - Logs the specified logging event through this logger. - - - This method must not throw any exception to the caller. - - - - - - Checks if this logger is enabled for a given passed as parameter. - - The level to check. - - true if this logger is enabled for level, otherwise false. - - - - Test if this logger is going to log events of the specified . - - - This method must not throw any exception to the caller. - - - - - - Deliver the to the attached appenders. - - The event to log. - - - Call the appenders in the hierarchy starting at - this. If no appenders could be found, emit a - warning. - - - This method calls all the appenders inherited from the - hierarchy circumventing any evaluation of whether to log or not - to log the particular log request. - - - - - - Closes all attached appenders implementing the interface. - - - - Used to ensure that the appenders are correctly shutdown. - - - - - - This is the most generic printing method. This generic form is intended to be used by wrappers - - The level of the message to be logged. - The message object to log. - The exception to log, including its stack trace. - - - Generate a logging event for the specified using - the . - - - - - - Creates a new logging event and logs the event without further checks. - - The declaring type of the method that is - the stack boundary into the logging system for this call. - The level of the message to be logged. - The message object to log. - The exception to log, including its stack trace. - - - Generates a logging event and delivers it to the attached - appenders. - - - - - - Creates a new logging event and logs the event without further checks. - - The event being logged. - - - Delivers the logging event to the attached appenders. - - - - - - The fully qualified type of the Logger class. - - - - - The name of this logger. - - - - - The assigned level of this logger. - - - - The level variable need not be - assigned a value in which case it is inherited - form the hierarchy. - - - - - - The parent of this logger. - - - - The parent of this logger. - All loggers have at least one ancestor which is the root logger. - - - - - - Loggers need to know what Hierarchy they are in. - - - - Loggers need to know what Hierarchy they are in. - The hierarchy that this logger is a member of is stored - here. - - - - - - Helper implementation of the interface - - - - - Flag indicating if child loggers inherit their parents appenders - - - - Additivity is set to true by default, that is children inherit - the appenders of their ancestors by default. If this variable is - set to false then the appenders found in the - ancestors of this logger are not used. However, the children - of this logger will inherit its appenders, unless the children - have their additivity flag set to false too. See - the user manual for more details. - - - - - - Lock to protect AppenderAttachedImpl variable m_appenderAttachedImpl - - - - - Gets or sets the parent logger in the hierarchy. - - - The parent logger in the hierarchy. - - - - Part of the Composite pattern that makes the hierarchy. - The hierarchy is parent linked rather than child linked. - - - - - - Gets or sets a value indicating if child loggers inherit their parent's appenders. - - - true if child loggers inherit their parent's appenders. - - - - Additivity is set to true by default, that is children inherit - the appenders of their ancestors by default. If this variable is - set to false then the appenders found in the - ancestors of this logger are not used. However, the children - of this logger will inherit its appenders, unless the children - have their additivity flag set to false too. See - the user manual for more details. - - - - - - Gets the effective level for this logger. - - The nearest level in the logger hierarchy. - - - Starting from this logger, searches the logger hierarchy for a - non-null level and returns it. Otherwise, returns the level of the - root logger. - - The Logger class is designed so that this method executes as - quickly as possible. - - - - - Gets or sets the where this - Logger instance is attached to. - - The hierarchy that this logger belongs to. - - - This logger must be attached to a single . - - - - - - Gets or sets the assigned , if any, for this Logger. - - - The of this logger. - - - - The assigned can be null. - - - - - - Get the appenders contained in this logger as an - . - - A collection of the appenders in this logger - - - Get the appenders contained in this logger as an - . If no appenders - can be found, then a is returned. - - - - - - Gets the logger name. - - - The name of the logger. - - - - The name of this logger - - - - - - Gets the where this - Logger instance is attached to. - - - The that this logger belongs to. - - - - Gets the where this - Logger instance is attached to. - - - - - - Construct a new Logger - - the name of the logger - - - Initializes a new instance of the class - with the specified name. - - - - - - Delegate used to handle logger creation event notifications. - - The in which the has been created. - The event args that hold the instance that has been created. - - - Delegate used to handle logger creation event notifications. - - - - - - Provides data for the event. - - - - A event is raised every time a - is created. - - - - - - The created - - - - - Constructor - - The that has been created. - - - Initializes a new instance of the event argument - class,with the specified . - - - - - - Gets the that has been created. - - - The that has been created. - - - - The that has been created. - - - - - - Hierarchical organization of loggers - - - - The casual user should not have to deal with this class - directly. - - - This class is specialized in retrieving loggers by name and - also maintaining the logger hierarchy. Implements the - interface. - - - The structure of the logger hierarchy is maintained by the - method. The hierarchy is such that children - link to their parent but parents do not have any references to their - children. Moreover, loggers can be instantiated in any order, in - particular descendant before ancestor. - - - In case a descendant is created before a particular ancestor, - then it creates a provision node for the ancestor and adds itself - to the provision node. Other descendants of the same ancestor add - themselves to the previously created provision node. - - - Nicko Cadell - Gert Driesen - - - - Base implementation of - - - - Default abstract implementation of the interface. - - - Skeleton implementation of the interface. - All types can extend this type. - - - Nicko Cadell - Gert Driesen - - - - Interface implemented by logger repositories. - - - - This interface is implemented by logger repositories. e.g. - . - - - This interface is used by the - to obtain interfaces. - - - Nicko Cadell - Gert Driesen - - - - Check if the named logger exists in the repository. If so return - its reference, otherwise returns null. - - The name of the logger to lookup - The Logger object with the name specified - - - If the names logger exists it is returned, otherwise - null is returned. - - - - - - Returns all the currently defined loggers as an Array. - - All the defined loggers - - - Returns all the currently defined loggers as an Array. - - - - - - Returns a named logger instance - - The name of the logger to retrieve - The logger object with the name specified - - - Returns a named logger instance. - - - If a logger of that name already exists, then it will be - returned. Otherwise, a new logger will be instantiated and - then linked with its existing ancestors as well as children. - - - - - Shutdown the repository - - - Shutting down a repository will safely close and remove - all appenders in all loggers including the root logger. - - - Some appenders need to be closed before the - application exists. Otherwise, pending logging events might be - lost. - - - The method is careful to close nested - appenders before closing regular appenders. This is allows - configurations where a regular appender is attached to a logger - and again to a nested appender. - - - - - - Reset the repositories configuration to a default state - - - - Reset all values contained in this instance to their - default state. - - - Existing loggers are not removed. They are just reset. - - - This method should be used sparingly and with care as it will - block all logging until it is completed. - - - - - - Log the through this repository. - - the event to log - - - This method should not normally be used to log. - The interface should be used - for routine logging. This interface can be obtained - using the method. - - - The logEvent is delivered to the appropriate logger and - that logger is then responsible for logging the event. - - - - - - Returns all the Appenders that are configured as an Array. - - All the Appenders - - - Returns all the Appenders that are configured as an Array. - - - - - - The name of the repository - - - The name of the repository - - - - The name of the repository. - - - - - - RendererMap accesses the object renderer map for this repository. - - - RendererMap accesses the object renderer map for this repository. - - - - RendererMap accesses the object renderer map for this repository. - - - The RendererMap holds a mapping between types and - objects. - - - - - - The plugin map for this repository. - - - The plugin map for this repository. - - - - The plugin map holds the instances - that have been attached to this repository. - - - - - - Get the level map for the Repository. - - - - Get the level map for the Repository. - - - The level map defines the mappings between - level names and objects in - this repository. - - - - - - The threshold for all events in this repository - - - The threshold for all events in this repository - - - - The threshold for all events in this repository. - - - - - - Flag indicates if this repository has been configured. - - - Flag indicates if this repository has been configured. - - - - Flag indicates if this repository has been configured. - - - - - - Collection of internal messages captured during the most - recent configuration process. - - - - - Event to notify that the repository has been shutdown. - - - Event to notify that the repository has been shutdown. - - - - Event raised when the repository has been shutdown. - - - - - - Event to notify that the repository has had its configuration reset. - - - Event to notify that the repository has had its configuration reset. - - - - Event raised when the repository's configuration has been - reset to default. - - - - - - Event to notify that the repository has had its configuration changed. - - - Event to notify that the repository has had its configuration changed. - - - - Event raised when the repository's configuration has been changed. - - - - - - Repository specific properties - - - Repository specific properties - - - - These properties can be specified on a repository specific basis. - - - - - - Default Constructor - - - - Initializes the repository with default (empty) properties. - - - - - - Construct the repository using specific properties - - the properties to set for this repository - - - Initializes the repository with specified properties. - - - - - - Test if logger exists - - The name of the logger to lookup - The Logger object with the name specified - - - Check if the named logger exists in the repository. If so return - its reference, otherwise returns null. - - - - - - Returns all the currently defined loggers in the repository - - All the defined loggers - - - Returns all the currently defined loggers in the repository as an Array. - - - - - - Return a new logger instance - - The name of the logger to retrieve - The logger object with the name specified - - - Return a new logger instance. - - - If a logger of that name already exists, then it will be - returned. Otherwise, a new logger will be instantiated and - then linked with its existing ancestors as well as children. - - - - - - Shutdown the repository - - - - Shutdown the repository. Can be overridden in a subclass. - This base class implementation notifies the - listeners and all attached plugins of the shutdown event. - - - - - - Reset the repositories configuration to a default state - - - - Reset all values contained in this instance to their - default state. - - - Existing loggers are not removed. They are just reset. - - - This method should be used sparingly and with care as it will - block all logging until it is completed. - - - - - - Log the logEvent through this repository. - - the event to log - - - This method should not normally be used to log. - The interface should be used - for routine logging. This interface can be obtained - using the method. - - - The logEvent is delivered to the appropriate logger and - that logger is then responsible for logging the event. - - - - - - Returns all the Appenders that are configured as an Array. - - All the Appenders - - - Returns all the Appenders that are configured as an Array. - - - - - - The fully qualified type of the LoggerRepositorySkeleton class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Adds an object renderer for a specific class. - - The type that will be rendered by the renderer supplied. - The object renderer used to render the object. - - - Adds an object renderer for a specific class. - - - - - - Notify the registered listeners that the repository is shutting down - - Empty EventArgs - - - Notify any listeners that this repository is shutting down. - - - - - - Notify the registered listeners that the repository has had its configuration reset - - Empty EventArgs - - - Notify any listeners that this repository's configuration has been reset. - - - - - - Notify the registered listeners that the repository has had its configuration changed - - Empty EventArgs - - - Notify any listeners that this repository's configuration has changed. - - - - - - Raise a configuration changed event on this repository - - EventArgs.Empty - - - Applications that programmatically change the configuration of the repository should - raise this event notification to notify listeners. - - - - - - The name of the repository - - - The string name of the repository - - - - The name of this repository. The name is - used to store and lookup the repositories - stored by the . - - - - - - The threshold for all events in this repository - - - The threshold for all events in this repository - - - - The threshold for all events in this repository - - - - - - RendererMap accesses the object renderer map for this repository. - - - RendererMap accesses the object renderer map for this repository. - - - - RendererMap accesses the object renderer map for this repository. - - - The RendererMap holds a mapping between types and - objects. - - - - - - The plugin map for this repository. - - - The plugin map for this repository. - - - - The plugin map holds the instances - that have been attached to this repository. - - - - - - Get the level map for the Repository. - - - - Get the level map for the Repository. - - - The level map defines the mappings between - level names and objects in - this repository. - - - - - - Flag indicates if this repository has been configured. - - - Flag indicates if this repository has been configured. - - - - Flag indicates if this repository has been configured. - - - - - - Contains a list of internal messages captures during the - last configuration. - - - - - Event to notify that the repository has been shutdown. - - - Event to notify that the repository has been shutdown. - - - - Event raised when the repository has been shutdown. - - - - - - Event to notify that the repository has had its configuration reset. - - - Event to notify that the repository has had its configuration reset. - - - - Event raised when the repository's configuration has been - reset to default. - - - - - - Event to notify that the repository has had its configuration changed. - - - Event to notify that the repository has had its configuration changed. - - - - Event raised when the repository's configuration has been changed. - - - - - - Repository specific properties - - - Repository specific properties - - - These properties can be specified on a repository specific basis - - - - - Basic Configurator interface for repositories - - - - Interface used by basic configurator to configure a - with a default . - - - A should implement this interface to support - configuration by the . - - - Nicko Cadell - Gert Driesen - - - - Initialize the repository using the specified appender - - the appender to use to log all logging events - - - Configure the repository to route all logging events to the - specified appender. - - - - - - Initialize the repository using the specified appenders - - the appenders to use to log all logging events - - - Configure the repository to route all logging events to the - specified appenders. - - - - - - Configure repository using XML - - - - Interface used by Xml configurator to configure a . - - - A should implement this interface to support - configuration by the . - - - Nicko Cadell - Gert Driesen - - - - Initialize the repository using the specified config - - the element containing the root of the config - - - The schema for the XML configuration data is defined by - the implementation. - - - - - - Default constructor - - - - Initializes a new instance of the class. - - - - - - Construct with properties - - The properties to pass to this repository. - - - Initializes a new instance of the class. - - - - - - Construct with a logger factory - - The factory to use to create new logger instances. - - - Initializes a new instance of the class with - the specified . - - - - - - Construct with properties and a logger factory - - The properties to pass to this repository. - The factory to use to create new logger instances. - - - Initializes a new instance of the class with - the specified . - - - - - - Test if a logger exists - - The name of the logger to lookup - The Logger object with the name specified - - - Check if the named logger exists in the hierarchy. If so return - its reference, otherwise returns null. - - - - - - Returns all the currently defined loggers in the hierarchy as an Array - - All the defined loggers - - - Returns all the currently defined loggers in the hierarchy as an Array. - The root logger is not included in the returned - enumeration. - - - - - - Return a new logger instance named as the first parameter using - the default factory. - - - - Return a new logger instance named as the first parameter using - the default factory. - - - If a logger of that name already exists, then it will be - returned. Otherwise, a new logger will be instantiated and - then linked with its existing ancestors as well as children. - - - The name of the logger to retrieve - The logger object with the name specified - - - - Shutting down a hierarchy will safely close and remove - all appenders in all loggers including the root logger. - - - - Shutting down a hierarchy will safely close and remove - all appenders in all loggers including the root logger. - - - Some appenders need to be closed before the - application exists. Otherwise, pending logging events might be - lost. - - - The Shutdown method is careful to close nested - appenders before closing regular appenders. This is allows - configurations where a regular appender is attached to a logger - and again to a nested appender. - - - - - - Reset all values contained in this hierarchy instance to their default. - - - - Reset all values contained in this hierarchy instance to their - default. This removes all appenders from all loggers, sets - the level of all non-root loggers to null, - sets their additivity flag to true and sets the level - of the root logger to . Moreover, - message disabling is set its default "off" value. - - - Existing loggers are not removed. They are just reset. - - - This method should be used sparingly and with care as it will - block all logging until it is completed. - - - - - - Log the logEvent through this hierarchy. - - the event to log - - - This method should not normally be used to log. - The interface should be used - for routine logging. This interface can be obtained - using the method. - - - The logEvent is delivered to the appropriate logger and - that logger is then responsible for logging the event. - - - - - - Returns all the Appenders that are currently configured - - An array containing all the currently configured appenders - - - Returns all the instances that are currently configured. - All the loggers are searched for appenders. The appenders may also be containers - for appenders and these are also searched for additional loggers. - - - The list returned is unordered but does not contain duplicates. - - - - - - Collect the appenders from an . - The appender may also be a container. - - - - - - - Collect the appenders from an container - - - - - - - Initialize the log4net system using the specified appender - - the appender to use to log all logging events - - - - Initialize the log4net system using the specified appenders - - the appenders to use to log all logging events - - - - Initialize the log4net system using the specified appenders - - the appenders to use to log all logging events - - - This method provides the same functionality as the - method implemented - on this object, but it is protected and therefore can be called by subclasses. - - - - - - Initialize the log4net system using the specified config - - the element containing the root of the config - - - - Initialize the log4net system using the specified config - - the element containing the root of the config - - - This method provides the same functionality as the - method implemented - on this object, but it is protected and therefore can be called by subclasses. - - - - - - Test if this hierarchy is disabled for the specified . - - The level to check against. - - true if the repository is disabled for the level argument, false otherwise. - - - - If this hierarchy has not been configured then this method will - always return true. - - - This method will return true if this repository is - disabled for level object passed as parameter and - false otherwise. - - - See also the property. - - - - - - Clear all logger definitions from the internal hashtable - - - - This call will clear all logger definitions from the internal - hashtable. Invoking this method will irrevocably mess up the - logger hierarchy. - - - You should really know what you are doing before - invoking this method. - - - - - - Return a new logger instance named as the first parameter using - . - - The name of the logger to retrieve - The factory that will make the new logger instance - The logger object with the name specified - - - If a logger of that name already exists, then it will be - returned. Otherwise, a new logger will be instantiated by the - parameter and linked with its existing - ancestors as well as children. - - - - - - Sends a logger creation event to all registered listeners - - The newly created logger - - Raises the logger creation event. - - - - - Updates all the parents of the specified logger - - The logger to update the parents for - - - This method loops through all the potential parents of - . There 3 possible cases: - - - - No entry for the potential parent of exists - - We create a ProvisionNode for this potential - parent and insert in that provision node. - - - - The entry is of type Logger for the potential parent. - - The entry is 's nearest existing parent. We - update 's parent field with this entry. We also break from - he loop because updating our parent's parent is our parent's - responsibility. - - - - The entry is of type ProvisionNode for this potential parent. - - We add to the list of children for this - potential parent. - - - - - - - - Replace a with a in the hierarchy. - - - - - - We update the links for all the children that placed themselves - in the provision node 'pn'. The second argument 'log' is a - reference for the newly created Logger, parent of all the - children in 'pn'. - - - We loop on all the children 'c' in 'pn'. - - - If the child 'c' has been already linked to a child of - 'log' then there is no need to update 'c'. - - - Otherwise, we set log's parent field to c's parent and set - c's parent field to log. - - - - - - Define or redefine a Level using the values in the argument - - the level values - - - Define or redefine a Level using the values in the argument - - - Supports setting levels via the configuration file. - - - - - - Set a Property using the values in the argument - - the property value - - - Set a Property using the values in the argument. - - - Supports setting property values via the configuration file. - - - - - - The fully qualified type of the Hierarchy class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Event used to notify that a logger has been created. - - - - Event raised when a logger is created. - - - - - - Has no appender warning been emitted - - - - Flag to indicate if we have already issued a warning - about not having an appender warning. - - - - - - Get the root of this hierarchy - - - - Get the root of this hierarchy. - - - - - - Gets or sets the default instance. - - The default - - - The logger factory is used to create logger instances. - - - - - - A class to hold the value, name and display name for a level - - - - A class to hold the value, name and display name for a level - - - - - - Override Object.ToString to return sensible debug info - - string info about this object - - - - Value of the level - - - - If the value is not set (defaults to -1) the value will be looked - up for the current level with the same name. - - - - - - Name of the level - - - The name of the level - - - - The name of the level. - - - - - - Display name for the level - - - The display name of the level - - - - The display name of the level. - - - - - - Used internally to accelerate hash table searches. - - - - Internal class used to improve performance of - string keyed hashtables. - - - The hashcode of the string is cached for reuse. - The string is stored as an interned value. - When comparing two objects for equality - the reference equality of the interned strings is compared. - - - Nicko Cadell - Gert Driesen - - - - Construct key with string name - - - - Initializes a new instance of the class - with the specified name. - - - Stores the hashcode of the string and interns - the string key to optimize comparisons. - - - The Compact Framework 1.0 the - method does not work. On the Compact Framework - the string keys are not interned nor are they - compared by reference. - - - The name of the logger. - - - - Returns a hash code for the current instance. - - A hash code for the current instance. - - - Returns the cached hashcode. - - - - - - Determines whether two instances - are equal. - - The to compare with the current . - - true if the specified is equal to the current ; otherwise, false. - - - - Compares the references of the interned strings. - - - - - - Provision nodes are used where no logger instance has been specified - - - - instances are used in the - when there is no specified - for that node. - - - A provision node holds a list of child loggers on behalf of - a logger that does not exist. - - - Nicko Cadell - Gert Driesen - - - - Create a new provision node with child node - - A child logger to add to this node. - - - Initializes a new instance of the class - with the specified child logger. - - - - - - The sits at the root of the logger hierarchy tree. - - - - The is a regular except - that it provides several guarantees. - - - First, it cannot be assigned a null - level. Second, since the root logger cannot have a parent, the - property always returns the value of the - level field without walking the hierarchy. - - - Nicko Cadell - Gert Driesen - - - - Construct a - - The level to assign to the root logger. - - - Initializes a new instance of the class with - the specified logging level. - - - The root logger names itself as "root". However, the root - logger cannot be retrieved by name. - - - - - - The fully qualified type of the RootLogger class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Gets the assigned level value without walking the logger hierarchy. - - The assigned level value without walking the logger hierarchy. - - - Because the root logger cannot have a parent and its level - must not be null this property just returns the - value of . - - - - - - Gets or sets the assigned for the root logger. - - - The of the root logger. - - - - Setting the level of the root logger to a null reference - may have catastrophic results. We prevent this here. - - - - - - Initializes the log4net environment using an XML DOM. - - - - Configures a using an XML DOM. - - - Nicko Cadell - Gert Driesen - - - - Construct the configurator for a hierarchy - - The hierarchy to build. - - - Initializes a new instance of the class - with the specified . - - - - - - Configure the hierarchy by parsing a DOM tree of XML elements. - - The root element to parse. - - - Configure the hierarchy by parsing a DOM tree of XML elements. - - - - - - Parse appenders by IDREF. - - The appender ref element. - The instance of the appender that the ref refers to. - - - Parse an XML element that represents an appender and return - the appender. - - - - - - Parses an appender element. - - The appender element. - The appender instance or null when parsing failed. - - - Parse an XML element that represents an appender and return - the appender instance. - - - - - - Parses a logger element. - - The logger element. - - - Parse an XML element that represents a logger. - - - - - - Parses the root logger element. - - The root element. - - - Parse an XML element that represents the root logger. - - - - - - Parses the children of a logger element. - - The category element. - The logger instance. - Flag to indicate if the logger is the root logger. - - - Parse the child elements of a <logger> element. - - - - - - Parses an object renderer. - - The renderer element. - - - Parse an XML element that represents a renderer. - - - - - - Parses a level element. - - The level element. - The logger object to set the level on. - Flag to indicate if the logger is the root logger. - - - Parse an XML element that represents a level. - - - - - - Sets a parameter on an object. - - The parameter element. - The object to set the parameter on. - - The parameter name must correspond to a writable property - on the object. The value of the parameter is a string, - therefore this function will attempt to set a string - property first. If unable to set a string property it - will inspect the property and its argument type. It will - attempt to call a static method called Parse on the - type of the property. This method will take a single - string argument and return a value that can be used to - set the property. - - - - - Test if an element has no attributes or child elements - - the element to inspect - true if the element has any attributes or child elements, false otherwise - - - - Test if a is constructible with Activator.CreateInstance. - - the type to inspect - true if the type is creatable using a default constructor, false otherwise - - - - Look for a method on the that matches the supplied - - the type that has the method - the name of the method - the method info found - - - The method must be a public instance method on the . - The method must be named or "Add" followed by . - The method must take a single parameter. - - - - - - Converts a string value to a target type. - - The type of object to convert the string to. - The string value to use as the value of the object. - - - An object of type with value or - null when the conversion could not be performed. - - - - - - Creates an object as specified in XML. - - The XML element that contains the definition of the object. - The object type to use if not explicitly specified. - The type that the returned object must be or must inherit from. - The object or null - - - Parse an XML element and create an object instance based on the configuration - data. - - - The type of the instance may be specified in the XML. If not - specified then the is used - as the type. However the type is specified it must support the - type. - - - - - - key: appenderName, value: appender. - - - - - The Hierarchy being configured. - - - - - The fully qualified type of the XmlHierarchyConfigurator class. - - - Used by the internal logger to record the Type of the - log message. - - - - - - - - - - - - - - - - - - - - - Delegate used to handle logger repository shutdown event notifications - - The that is shutting down. - Empty event args - - - Delegate used to handle logger repository shutdown event notifications. - - - - - - Delegate used to handle logger repository configuration reset event notifications - - The that has had its configuration reset. - Empty event args - - - Delegate used to handle logger repository configuration reset event notifications. - - - - - - Delegate used to handle event notifications for logger repository configuration changes. - - The that has had its configuration changed. - Empty event arguments. - - - Delegate used to handle event notifications for logger repository configuration changes. - - - - - - Write the name of the current AppDomain to the output - - - - Write the name of the current AppDomain to the output writer - - - Nicko Cadell - - - - Write the name of the current AppDomain to the output - - the writer to write to - null, state is not set - - - Writes name of the current AppDomain to the output . - - - - - - Write the current date to the output - - - - Date pattern converter, uses a to format - the current date and time to the writer as a string. - - - The value of the determines - the formatting of the date. The following values are allowed: - - - Option value - Output - - - ISO8601 - - Uses the formatter. - Formats using the "yyyy-MM-dd HH:mm:ss,fff" pattern. - - - - DATE - - Uses the formatter. - Formats using the "dd MMM yyyy HH:mm:ss,fff" for example, "06 Nov 1994 15:49:37,459". - - - - ABSOLUTE - - Uses the formatter. - Formats using the "HH:mm:ss,fff" for example, "15:49:37,459". - - - - other - - Any other pattern string uses the formatter. - This formatter passes the pattern string to the - method. - For details on valid patterns see - DateTimeFormatInfo Class. - - - - - - The date and time is in the local time zone and is rendered in that zone. - To output the time in Universal time see . - - - Nicko Cadell - - - - The used to render the date to a string - - - - The used to render the date to a string - - - - - - Initialize the converter options - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - - - - Write the current date to the output - - that will receive the formatted result. - null, state is not set - - - Pass the current date and time to the - for it to render it to the writer. - - - The date and time passed is in the local time zone. - - - - - - The fully qualified type of the DatePatternConverter class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Write an folder path to the output - - - - Write an special path environment folder path to the output writer. - The value of the determines - the name of the variable to output. - should be a value in the enumeration. - - - Ron Grabowski - - - - Write an special path environment folder path to the output - - the writer to write to - null, state is not set - - - Writes the special path environment folder path to the output . - The name of the special path environment folder path to output must be set - using the - property. - - - - - - The fully qualified type of the EnvironmentFolderPathPatternConverter class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Write an environment variable to the output - - - - Write an environment variable to the output writer. - The value of the determines - the name of the variable to output. - - - Nicko Cadell - - - - Write an environment variable to the output - - the writer to write to - null, state is not set - - - Writes the environment variable to the output . - The name of the environment variable to output must be set - using the - property. - - - - - - The fully qualified type of the EnvironmentPatternConverter class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Write the current thread identity to the output - - - - Write the current thread identity to the output writer - - - Nicko Cadell - - - - Write the current thread identity to the output - - the writer to write to - null, state is not set - - - Writes the current thread identity to the output . - - - - - - The fully qualified type of the IdentityPatternConverter class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Pattern converter for literal string instances in the pattern - - - - Writes the literal string value specified in the - property to - the output. - - - Nicko Cadell - - - - Set the next converter in the chain - - The next pattern converter in the chain - The next pattern converter - - - Special case the building of the pattern converter chain - for instances. Two adjacent - literals in the pattern can be represented by a single combined - pattern converter. This implementation detects when a - is added to the chain - after this converter and combines its value with this converter's - literal value. - - - - - - Write the literal to the output - - the writer to write to - null, not set - - - Override the formatting behavior to ignore the FormattingInfo - because we have a literal instead. - - - Writes the value of - to the output . - - - - - - Convert this pattern into the rendered message - - that will receive the formatted result. - null, not set - - - This method is not used. - - - - - - Writes a newline to the output - - - - Writes the system dependent line terminator to the output. - This behavior can be overridden by setting the : - - - - Option Value - Output - - - DOS - DOS or Windows line terminator "\r\n" - - - UNIX - UNIX line terminator "\n" - - - - Nicko Cadell - - - - Initialize the converter - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - - - - Write the current process ID to the output - - - - Write the current process ID to the output writer - - - Nicko Cadell - - - - Write the current process ID to the output - - the writer to write to - null, state is not set - - - Write the current process ID to the output . - - - - - - The fully qualified type of the ProcessIdPatternConverter class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Property pattern converter - - - - This pattern converter reads the thread and global properties. - The thread properties take priority over global properties. - See for details of the - thread properties. See for - details of the global properties. - - - If the is specified then that will be used to - lookup a single property. If no is specified - then all properties will be dumped as a list of key value pairs. - - - Nicko Cadell - - - - Write the property value to the output - - that will receive the formatted result. - null, state is not set - - - Writes out the value of a named property. The property name - should be set in the - property. - - - If the is set to null - then all the properties are written as key value pairs. - - - - - - A Pattern converter that generates a string of random characters - - - - The converter generates a string of random characters. By default - the string is length 4. This can be changed by setting the - to the string value of the length required. - - - The random characters in the string are limited to uppercase letters - and numbers only. - - - The random number generator used by this class is not cryptographically secure. - - - Nicko Cadell - - - - Shared random number generator - - - - - Length of random string to generate. Default length 4. - - - - - Initialize the converter options - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - - - - Write a randoim string to the output - - the writer to write to - null, state is not set - - - Write a randoim string to the output . - - - - - - The fully qualified type of the RandomStringPatternConverter class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Write the current threads username to the output - - - - Write the current threads username to the output writer - - - Nicko Cadell - - - - Write the current threads username to the output - - the writer to write to - null, state is not set - - - Write the current threads username to the output . - - - - - - The fully qualified type of the UserNamePatternConverter class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Write the UTC date time to the output - - - - Date pattern converter, uses a to format - the current date and time in Universal time. - - - See the for details on the date pattern syntax. - - - - Nicko Cadell - - - - Write the current date and time to the output - - that will receive the formatted result. - null, state is not set - - - Pass the current date and time to the - for it to render it to the writer. - - - The date is in Universal time when it is rendered. - - - - - - - The fully qualified type of the UtcDatePatternConverter class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Type converter for Boolean. - - - - Supports conversion from string to bool type. - - - - - - Nicko Cadell - Gert Driesen - - - - Can the source type be converted to the type supported by this object - - the type to convert - true if the conversion is possible - - - Returns true if the is - the type. - - - - - - Convert the source object to the type supported by this object - - the object to convert - the converted object - - - Uses the method to convert the - argument to a . - - - - The object cannot be converted to the - target type. To check for this condition use the - method. - - - - - Exception base type for conversion errors. - - - - This type extends . It - does not add any new functionality but does differentiate the - type of exception being thrown. - - - Nicko Cadell - Gert Driesen - - - - Constructor - - - - Initializes a new instance of the class. - - - - - - Constructor - - A message to include with the exception. - - - Initializes a new instance of the class - with the specified message. - - - - - - Constructor - - A message to include with the exception. - A nested exception to include. - - - Initializes a new instance of the class - with the specified message and inner exception. - - - - - - Serialization constructor - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class - with serialized data. - - - - - - Creates a new instance of the class. - - The conversion destination type. - The value to convert. - An instance of the . - - - Creates a new instance of the class. - - - - - - Creates a new instance of the class. - - The conversion destination type. - The value to convert. - A nested exception to include. - An instance of the . - - - Creates a new instance of the class. - - - - - - Register of type converters for specific types. - - - - Maintains a registry of type converters used to convert between - types. - - - Use the and - methods to register new converters. - The and methods - lookup appropriate converters to use. - - - - - Nicko Cadell - Gert Driesen - - - - Private constructor - - - Initializes a new instance of the class. - - - - - Static constructor. - - - - This constructor defines the intrinsic type converters. - - - - - - Adds a converter for a specific type. - - The type being converted to. - The type converter to use to convert to the destination type. - - - Adds a converter instance for a specific type. - - - - - - Adds a converter for a specific type. - - The type being converted to. - The type of the type converter to use to convert to the destination type. - - - Adds a converter for a specific type. - - - - - - Gets the type converter to use to convert values to the destination type. - - The type being converted from. - The type being converted to. - - The type converter instance to use for type conversions or null - if no type converter is found. - - - - Gets the type converter to use to convert values to the destination type. - - - - - - Gets the type converter to use to convert values to the destination type. - - The type being converted to. - - The type converter instance to use for type conversions or null - if no type converter is found. - - - - Gets the type converter to use to convert values to the destination type. - - - - - - Lookups the type converter to use as specified by the attributes on the - destination type. - - The type being converted to. - - The type converter instance to use for type conversions or null - if no type converter is found. - - - - - Creates the instance of the type converter. - - The type of the type converter. - - The type converter instance to use for type conversions or null - if no type converter is found. - - - - The type specified for the type converter must implement - the or interfaces - and must have a public default (no argument) constructor. - - - - - - The fully qualified type of the ConverterRegistry class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Mapping from to type converter. - - - - - Supports conversion from string to type. - - - - Supports conversion from string to type. - - - - - - Nicko Cadell - Gert Driesen - - - - Can the source type be converted to the type supported by this object - - the type to convert - true if the conversion is possible - - - Returns true if the is - the type. - - - - - - Overrides the ConvertFrom method of IConvertFrom. - - the object to convert to an encoding - the encoding - - - Uses the method to - convert the argument to an . - - - - The object cannot be converted to the - target type. To check for this condition use the - method. - - - - - Interface supported by type converters - - - - This interface supports conversion from a single type to arbitrary types. - See . - - - Nicko Cadell - - - - Returns whether this converter can convert the object to the specified type - - A Type that represents the type you want to convert to - true if the conversion is possible - - - Test if the type supported by this converter can be converted to the - . - - - - - - Converts the given value object to the specified type, using the arguments - - the object to convert - The Type to convert the value parameter to - the converted object - - - Converts the (which must be of the type supported - by this converter) to the specified.. - - - - - - Supports conversion from string to type. - - - - Supports conversion from string to type. - - - - - Nicko Cadell - - - - Can the source type be converted to the type supported by this object - - the type to convert - true if the conversion is possible - - - Returns true if the is - the type. - - - - - - Overrides the ConvertFrom method of IConvertFrom. - - the object to convert to an IPAddress - the IPAddress - - - Uses the method to convert the - argument to an . - If that fails then the string is resolved as a DNS hostname. - - - - The object cannot be converted to the - target type. To check for this condition use the - method. - - - - - Valid characters in an IPv4 or IPv6 address string. (Does not support subnets) - - - - - Supports conversion from string to type. - - - - Supports conversion from string to type. - - - The string is used as the - of the . - - - - - - Nicko Cadell - - - - Can the source type be converted to the type supported by this object - - the type to convert - true if the conversion is possible - - - Returns true if the is - the type. - - - - - - Overrides the ConvertFrom method of IConvertFrom. - - the object to convert to a PatternLayout - the PatternLayout - - - Creates and returns a new using - the as the - . - - - - The object cannot be converted to the - target type. To check for this condition use the - method. - - - - - Convert between string and - - - - Supports conversion from string to type, - and from a type to a string. - - - The string is used as the - of the . - - - - - - Nicko Cadell - - - - Can the target type be converted to the type supported by this object - - A that represents the type you want to convert to - true if the conversion is possible - - - Returns true if the is - assignable from a type. - - - - - - Converts the given value object to the specified type, using the arguments - - the object to convert - The Type to convert the value parameter to - the converted object - - - Uses the method to convert the - argument to a . - - - - The object cannot be converted to the - . To check for this condition use the - method. - - - - - Can the source type be converted to the type supported by this object - - the type to convert - true if the conversion is possible - - - Returns true if the is - the type. - - - - - - Overrides the ConvertFrom method of IConvertFrom. - - the object to convert to a PatternString - the PatternString - - - Creates and returns a new using - the as the - . - - - - The object cannot be converted to the - target type. To check for this condition use the - method. - - - - - Supports conversion from string to type. - - - - Supports conversion from string to type. - - - - - - Nicko Cadell - - - - Can the source type be converted to the type supported by this object - - the type to convert - true if the conversion is possible - - - Returns true if the is - the type. - - - - - - Overrides the ConvertFrom method of IConvertFrom. - - the object to convert to a Type - the Type - - - Uses the method to convert the - argument to a . - Additional effort is made to locate partially specified types - by searching the loaded assemblies. - - - - The object cannot be converted to the - target type. To check for this condition use the - method. - - - - - Attribute used to associate a type converter - - - - Class and Interface level attribute that specifies a type converter - to use with the associated type. - - - To associate a type converter with a target type apply a - TypeConverterAttribute to the target type. Specify the - type of the type converter on the attribute. - - - Nicko Cadell - Gert Driesen - - - - The string type name of the type converter - - - - - Default constructor - - - - Default constructor - - - - - - Create a new type converter attribute for the specified type name - - The string type name of the type converter - - - The type specified must implement the - or the interfaces. - - - - - - Create a new type converter attribute for the specified type - - The type of the type converter - - - The type specified must implement the - or the interfaces. - - - - - - The string type name of the type converter - - - The string type name of the type converter - - - - The type specified must implement the - or the interfaces. - - - - - - A straightforward implementation of the interface. - - - - This is the default implementation of the - interface. Implementors of the interface - should aggregate an instance of this type. - - - Nicko Cadell - Gert Driesen - - - - Constructor - - - - Initializes a new instance of the class. - - - - - - Append on on all attached appenders. - - The event being logged. - The number of appenders called. - - - Calls the method on all - attached appenders. - - - - - - Append on on all attached appenders. - - The array of events being logged. - The number of appenders called. - - - Calls the method on all - attached appenders. - - - - - - Calls the DoAppende method on the with - the objects supplied. - - The appender - The events - - - If the supports the - interface then the will be passed - through using that interface. Otherwise the - objects in the array will be passed one at a time. - - - - - - Attaches an appender. - - The appender to add. - - - If the appender is already in the list it won't be added again. - - - - - - Gets an attached appender with the specified name. - - The name of the appender to get. - - The appender with the name specified, or null if no appender with the - specified name is found. - - - - Lookup an attached appender by name. - - - - - - Removes all attached appenders. - - - - Removes and closes all attached appenders - - - - - - Removes the specified appender from the list of attached appenders. - - The appender to remove. - The appender removed from the list - - - The appender removed is not closed. - If you are discarding the appender you must call - on the appender removed. - - - - - - Removes the appender with the specified name from the list of appenders. - - The name of the appender to remove. - The appender removed from the list - - - The appender removed is not closed. - If you are discarding the appender you must call - on the appender removed. - - - - - - List of appenders - - - - - Array of appenders, used to cache the m_appenderList - - - - - The fully qualified type of the AppenderAttachedImpl class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Gets all attached appenders. - - - A collection of attached appenders, or null if there - are no attached appenders. - - - - The read only collection of all currently attached appenders. - - - - - - This class aggregates several PropertiesDictionary collections together. - - - - Provides a dictionary style lookup over an ordered list of - collections. - - - Nicko Cadell - - - - Constructor - - - - Initializes a new instance of the class. - - - - - - Add a Properties Dictionary to this composite collection - - the properties to add - - - Properties dictionaries added first take precedence over dictionaries added - later. - - - - - - Flatten this composite collection into a single properties dictionary - - the flattened dictionary - - - Reduces the collection of ordered dictionaries to a single dictionary - containing the resultant values for the keys. - - - - - - Gets the value of a property - - - The value for the property with the specified key - - - - Looks up the value for the specified. - The collections are searched - in the order in which they were added to this collection. The value - returned is the value held by the first collection that contains - the specified key. - - - If none of the collections contain the specified key then - null is returned. - - - - - - Base class for Context Properties implementations - - - - This class defines a basic property get set accessor - - - Nicko Cadell - - - - Gets or sets the value of a property - - - The value for the property with the specified key - - - - Gets or sets the value of a property - - - - - - Wrapper class used to map converter names to converter types - - - - Pattern converter info class used during configuration by custom - PatternString and PatternLayer converters. - - - - - - default constructor - - - - - - - - - - - Gets or sets the name of the conversion pattern - - - - The name of the pattern in the format string - - - - - - Gets or sets the type of the converter - - - - The value specified must extend the - type. - - - - - - - - - - - Subclass of that maintains a count of - the number of bytes written. - - - - This writer counts the number of bytes written. - - - Nicko Cadell - Gert Driesen - - - - that does not leak exceptions - - - - does not throw exceptions when things go wrong. - Instead, it delegates error handling to its . - - - Nicko Cadell - Gert Driesen - - - - Adapter that extends and forwards all - messages to an instance of . - - - - Adapter that extends and forwards all - messages to an instance of . - - - Nicko Cadell - - - - The writer to forward messages to - - - - - Create an instance of that forwards all - messages to a . - - The to forward to - - - Create an instance of that forwards all - messages to a . - - - - - - Closes the writer and releases any system resources associated with the writer - - - - - - - - - Dispose this writer - - flag indicating if we are being disposed - - - Dispose this writer - - - - - - Flushes any buffered output - - - - Clears all buffers for the writer and causes any buffered data to be written - to the underlying device - - - - - - Writes a character to the wrapped TextWriter - - the value to write to the TextWriter - - - Writes a character to the wrapped TextWriter - - - - - - Writes a character buffer to the wrapped TextWriter - - the data buffer - the start index - the number of characters to write - - - Writes a character buffer to the wrapped TextWriter - - - - - - Writes a string to the wrapped TextWriter - - the value to write to the TextWriter - - - Writes a string to the wrapped TextWriter - - - - - - Gets or sets the underlying . - - - The underlying . - - - - Gets or sets the underlying . - - - - - - The Encoding in which the output is written - - - The - - - - The Encoding in which the output is written - - - - - - Gets an object that controls formatting - - - The format provider - - - - Gets an object that controls formatting - - - - - - Gets or sets the line terminator string used by the TextWriter - - - The line terminator to use - - - - Gets or sets the line terminator string used by the TextWriter - - - - - - Constructor - - the writer to actually write to - the error handler to report error to - - - Create a new QuietTextWriter using a writer and error handler - - - - - - Writes a character to the underlying writer - - the char to write - - - Writes a character to the underlying writer - - - - - - Writes a buffer to the underlying writer - - the buffer to write - the start index to write from - the number of characters to write - - - Writes a buffer to the underlying writer - - - - - - Writes a string to the output. - - The string data to write to the output. - - - Writes a string to the output. - - - - - - Closes the underlying output writer. - - - - Closes the underlying output writer. - - - - - - The error handler instance to pass all errors to - - - - - Flag to indicate if this writer is closed - - - - - Gets or sets the error handler that all errors are passed to. - - - The error handler that all errors are passed to. - - - - Gets or sets the error handler that all errors are passed to. - - - - - - Gets a value indicating whether this writer is closed. - - - true if this writer is closed, otherwise false. - - - - Gets a value indicating whether this writer is closed. - - - - - - Constructor - - The to actually write to. - The to report errors to. - - - Creates a new instance of the class - with the specified and . - - - - - - Writes a character to the underlying writer and counts the number of bytes written. - - the char to write - - - Overrides implementation of . Counts - the number of bytes written. - - - - - - Writes a buffer to the underlying writer and counts the number of bytes written. - - the buffer to write - the start index to write from - the number of characters to write - - - Overrides implementation of . Counts - the number of bytes written. - - - - - - Writes a string to the output and counts the number of bytes written. - - The string data to write to the output. - - - Overrides implementation of . Counts - the number of bytes written. - - - - - - Total number of bytes written. - - - - - Gets or sets the total number of bytes written. - - - The total number of bytes written. - - - - Gets or sets the total number of bytes written. - - - - - - A fixed size rolling buffer of logging events. - - - - An array backed fixed size leaky bucket. - - - Nicko Cadell - Gert Driesen - - - - Constructor - - The maximum number of logging events in the buffer. - - - Initializes a new instance of the class with - the specified maximum number of buffered logging events. - - - The argument is not a positive integer. - - - - Appends a to the buffer. - - The event to append to the buffer. - The event discarded from the buffer, if the buffer is full, otherwise null. - - - Append an event to the buffer. If the buffer still contains free space then - null is returned. If the buffer is full then an event will be dropped - to make space for the new event, the event dropped is returned. - - - - - - Get and remove the oldest event in the buffer. - - The oldest logging event in the buffer - - - Gets the oldest (first) logging event in the buffer and removes it - from the buffer. - - - - - - Pops all the logging events from the buffer into an array. - - An array of all the logging events in the buffer. - - - Get all the events in the buffer and clear the buffer. - - - - - - Clear the buffer - - - - Clear the buffer of all events. The events in the buffer are lost. - - - - - - Gets the th oldest event currently in the buffer. - - The th oldest event currently in the buffer. - - - If is outside the range 0 to the number of events - currently in the buffer, then null is returned. - - - - - - Gets the maximum size of the buffer. - - The maximum size of the buffer. - - - Gets the maximum size of the buffer - - - - - - Gets the number of logging events in the buffer. - - The number of logging events in the buffer. - - - This number is guaranteed to be in the range 0 to - (inclusive). - - - - - - An always empty . - - - - A singleton implementation of the - interface that always represents an empty collection. - - - Nicko Cadell - Gert Driesen - - - - Initializes a new instance of the class. - - - - Uses a private access modifier to enforce the singleton pattern. - - - - - - Copies the elements of the to an - , starting at a particular Array index. - - The one-dimensional - that is the destination of the elements copied from - . The Array must have zero-based - indexing. - The zero-based index in array at which - copying begins. - - - As the collection is empty no values are copied into the array. - - - - - - Returns an enumerator that can iterate through a collection. - - - An that can be used to - iterate through the collection. - - - - As the collection is empty a is returned. - - - - - - The singleton instance of the empty collection. - - - - - Gets the singleton instance of the empty collection. - - The singleton instance of the empty collection. - - - Gets the singleton instance of the empty collection. - - - - - - Gets a value indicating if access to the is synchronized (thread-safe). - - - true if access to the is synchronized (thread-safe); otherwise, false. - - - - For the this property is always true. - - - - - - Gets the number of elements contained in the . - - - The number of elements contained in the . - - - - As the collection is empty the is always 0. - - - - - - Gets an object that can be used to synchronize access to the . - - - An object that can be used to synchronize access to the . - - - - As the collection is empty and thread safe and synchronized this instance is also - the object. - - - - - - An always empty . - - - - A singleton implementation of the - interface that always represents an empty collection. - - - Nicko Cadell - Gert Driesen - - - - Initializes a new instance of the class. - - - - Uses a private access modifier to enforce the singleton pattern. - - - - - - Copies the elements of the to an - , starting at a particular Array index. - - The one-dimensional - that is the destination of the elements copied from - . The Array must have zero-based - indexing. - The zero-based index in array at which - copying begins. - - - As the collection is empty no values are copied into the array. - - - - - - Returns an enumerator that can iterate through a collection. - - - An that can be used to - iterate through the collection. - - - - As the collection is empty a is returned. - - - - - - Adds an element with the provided key and value to the - . - - The to use as the key of the element to add. - The to use as the value of the element to add. - - - As the collection is empty no new values can be added. A - is thrown if this method is called. - - - This dictionary is always empty and cannot be modified. - - - - Removes all elements from the . - - - - As the collection is empty no values can be removed. A - is thrown if this method is called. - - - This dictionary is always empty and cannot be modified. - - - - Determines whether the contains an element - with the specified key. - - The key to locate in the . - false - - - As the collection is empty the method always returns false. - - - - - - Returns an enumerator that can iterate through a collection. - - - An that can be used to - iterate through the collection. - - - - As the collection is empty a is returned. - - - - - - Removes the element with the specified key from the . - - The key of the element to remove. - - - As the collection is empty no values can be removed. A - is thrown if this method is called. - - - This dictionary is always empty and cannot be modified. - - - - The singleton instance of the empty dictionary. - - - - - Gets the singleton instance of the . - - The singleton instance of the . - - - Gets the singleton instance of the . - - - - - - Gets a value indicating if access to the is synchronized (thread-safe). - - - true if access to the is synchronized (thread-safe); otherwise, false. - - - - For the this property is always true. - - - - - - Gets the number of elements contained in the - - - The number of elements contained in the . - - - - As the collection is empty the is always 0. - - - - - - Gets an object that can be used to synchronize access to the . - - - An object that can be used to synchronize access to the . - - - - As the collection is empty and thread safe and synchronized this instance is also - the object. - - - - - - Gets a value indicating whether the has a fixed size. - - true - - - As the collection is empty always returns true. - - - - - - Gets a value indicating whether the is read-only. - - true - - - As the collection is empty always returns true. - - - - - - Gets an containing the keys of the . - - An containing the keys of the . - - - As the collection is empty a is returned. - - - - - - Gets an containing the values of the . - - An containing the values of the . - - - As the collection is empty a is returned. - - - - - - Gets or sets the element with the specified key. - - The key of the element to get or set. - null - - - As the collection is empty no values can be looked up or stored. - If the index getter is called then null is returned. - A is thrown if the setter is called. - - - This dictionary is always empty and cannot be modified. - - - - Contain the information obtained when parsing formatting modifiers - in conversion modifiers. - - - - Holds the formatting information extracted from the format string by - the . This is used by the - objects when rendering the output. - - - Nicko Cadell - Gert Driesen - - - - Defaut Constructor - - - - Initializes a new instance of the class. - - - - - - Constructor - - - - Initializes a new instance of the class - with the specified parameters. - - - - - - Gets or sets the minimum value. - - - The minimum value. - - - - Gets or sets the minimum value. - - - - - - Gets or sets the maximum value. - - - The maximum value. - - - - Gets or sets the maximum value. - - - - - - Gets or sets a flag indicating whether left align is enabled - or not. - - - A flag indicating whether left align is enabled or not. - - - - Gets or sets a flag indicating whether left align is enabled or not. - - - - - - Implementation of Properties collection for the - - - - This class implements a properties collection that is thread safe and supports both - storing properties and capturing a read only copy of the current propertied. - - - This class is optimized to the scenario where the properties are read frequently - and are modified infrequently. - - - Nicko Cadell - - - - The read only copy of the properties. - - - - This variable is declared volatile to prevent the compiler and JIT from - reordering reads and writes of this thread performed on different threads. - - - - - - Lock object used to synchronize updates within this instance - - - - - Constructor - - - - Initializes a new instance of the class. - - - - - - Remove a property from the global context - - the key for the entry to remove - - - Removing an entry from the global context properties is relatively expensive compared - with reading a value. - - - - - - Clear the global context properties - - - - - Get a readonly immutable copy of the properties - - the current global context properties - - - This implementation is fast because the GlobalContextProperties class - stores a readonly copy of the properties. - - - - - - Gets or sets the value of a property - - - The value for the property with the specified key - - - - Reading the value for a key is faster than setting the value. - When the value is written a new read only copy of - the properties is created. - - - - - - The static class ILogExtensions contains a set of widely used - methods that ease the interaction with the ILog interface implementations. - - - - This class contains methods for logging at different levels and checks the - properties for determining if those logging levels are enabled in the current - configuration. - - - Simple example of logging messages - - using log4net.Util; - - ILog log = LogManager.GetLogger("application-log"); - - log.InfoExt("Application Start"); - log.DebugExt("This is a debug message"); - - - - - - The fully qualified type of the Logger class. - - - - - Log a message object with the level. - - The logger on which the message is logged. - The lambda expression that gets the object to log. - - - This method first checks if this logger is INFO - enabled by reading the value property. - This check happens always and does not depend on the - implementation. If this logger is INFO enabled, then it converts - the message object (retrieved by invocation of the provided callback) to a - string by invoking the appropriate . - It then proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. - - - - - - - - Log a message object with the level including - the stack trace of the passed - as a parameter. - - The logger on which the message is logged. - The lambda expression that gets the object to log. - The exception to log, including its stack trace. - - - See the form for more detailed information. - - - - - - - Log a message object with the level. //TODO - - Log a message object with the level. - - The logger on which the message is logged. - The message object to log. - - - This method first checks if this logger is INFO - enabled by reading the value property. - This check happens always and does not depend on the - implementation. If this logger is INFO enabled, then it converts - the message object (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. - - - - - - - - Log a message object with the level including - the stack trace of the passed - as a parameter. - - The logger on which the message is logged. - The message object to log. - The exception to log, including its stack trace. - - - See the form for more detailed information. - - - - - - - - Logs a formatted message string with the level. - - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - The logger on which the message is logged. - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - An that supplies culture-specific formatting information - The logger on which the message is logged. - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - An Object to format - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Log a message object with the level. - - The logger on which the message is logged. - The lambda expression that gets the object to log. - - - This method first checks if this logger is INFO - enabled by reading the value property. - This check happens always and does not depend on the - implementation. If this logger is INFO enabled, then it converts - the message object (retrieved by invocation of the provided callback) to a - string by invoking the appropriate . - It then proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. - - - - - - - - Log a message object with the level including - the stack trace of the passed - as a parameter. - - The logger on which the message is logged. - The lambda expression that gets the object to log. - The exception to log, including its stack trace. - - - See the form for more detailed information. - - - - - - - Log a message object with the level. //TODO - - Log a message object with the level. - - The logger on which the message is logged. - The message object to log. - - - This method first checks if this logger is INFO - enabled by reading the value property. - This check happens always and does not depend on the - implementation. If this logger is INFO enabled, then it converts - the message object (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. - - - - - - - - Log a message object with the level including - the stack trace of the passed - as a parameter. - - The logger on which the message is logged. - The message object to log. - The exception to log, including its stack trace. - - - See the form for more detailed information. - - - - - - - - Logs a formatted message string with the level. - - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - The logger on which the message is logged. - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - An that supplies culture-specific formatting information - The logger on which the message is logged. - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - An Object to format - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Log a message object with the level. - - The logger on which the message is logged. - The lambda expression that gets the object to log. - - - This method first checks if this logger is WARN - enabled by reading the value property. - This check happens always and does not depend on the - implementation. If this logger is WARN enabled, then it converts - the message object (retrieved by invocation of the provided callback) to a - string by invoking the appropriate . - It then proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. - - - - - - - - Log a message object with the level including - the stack trace of the passed - as a parameter. - - The logger on which the message is logged. - The lambda expression that gets the object to log. - The exception to log, including its stack trace. - - - See the form for more detailed information. - - - - - - - Log a message object with the level. //TODO - - Log a message object with the level. - - The logger on which the message is logged. - The message object to log. - - - This method first checks if this logger is WARN - enabled by reading the value property. - This check happens always and does not depend on the - implementation. If this logger is WARN enabled, then it converts - the message object (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. - - - - - - - - Log a message object with the level including - the stack trace of the passed - as a parameter. - - The logger on which the message is logged. - The message object to log. - The exception to log, including its stack trace. - - - See the form for more detailed information. - - - - - - - - Logs a formatted message string with the level. - - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - The logger on which the message is logged. - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - An that supplies culture-specific formatting information - The logger on which the message is logged. - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - An Object to format - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Log a message object with the level. - - The logger on which the message is logged. - The lambda expression that gets the object to log. - - - This method first checks if this logger is ERROR - enabled by reading the value property. - This check happens always and does not depend on the - implementation. If this logger is ERROR enabled, then it converts - the message object (retrieved by invocation of the provided callback) to a - string by invoking the appropriate . - It then proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. - - - - - - - - Log a message object with the level including - the stack trace of the passed - as a parameter. - - The logger on which the message is logged. - The lambda expression that gets the object to log. - The exception to log, including its stack trace. - - - See the form for more detailed information. - - - - - - - Log a message object with the level. //TODO - - Log a message object with the level. - - The logger on which the message is logged. - The message object to log. - - - This method first checks if this logger is ERROR - enabled by reading the value property. - This check happens always and does not depend on the - implementation. If this logger is ERROR enabled, then it converts - the message object (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. - - - - - - - - Log a message object with the level including - the stack trace of the passed - as a parameter. - - The logger on which the message is logged. - The message object to log. - The exception to log, including its stack trace. - - - See the form for more detailed information. - - - - - - - - Logs a formatted message string with the level. - - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - The logger on which the message is logged. - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - An that supplies culture-specific formatting information - The logger on which the message is logged. - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - An Object to format - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Log a message object with the level. - - The logger on which the message is logged. - The lambda expression that gets the object to log. - - - This method first checks if this logger is FATAL - enabled by reading the value property. - This check happens always and does not depend on the - implementation. If this logger is FATAL enabled, then it converts - the message object (retrieved by invocation of the provided callback) to a - string by invoking the appropriate . - It then proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. - - - - - - - - Log a message object with the level including - the stack trace of the passed - as a parameter. - - The logger on which the message is logged. - The lambda expression that gets the object to log. - The exception to log, including its stack trace. - - - See the form for more detailed information. - - - - - - - Log a message object with the level. //TODO - - Log a message object with the level. - - The logger on which the message is logged. - The message object to log. - - - This method first checks if this logger is FATAL - enabled by reading the value property. - This check happens always and does not depend on the - implementation. If this logger is FATAL enabled, then it converts - the message object (passed as parameter) to a string by invoking the appropriate - . It then - proceeds to call all the registered appenders in this logger - and also higher in the hierarchy depending on the value of - the additivity flag. - - WARNING Note that passing an - to this method will print the name of the - but no stack trace. To print a stack trace use the - form instead. - - - - - - - - Log a message object with the level including - the stack trace of the passed - as a parameter. - - The logger on which the message is logged. - The message object to log. - The exception to log, including its stack trace. - - - See the form for more detailed information. - - - - - - - - Logs a formatted message string with the level. - - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - The logger on which the message is logged. - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - An that supplies culture-specific formatting information - The logger on which the message is logged. - A String containing zero or more format items - An Object array containing zero or more objects to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Logs a formatted message string with the level. - - The logger on which the message is logged. - A String containing zero or more format items - An Object to format - An Object to format - An Object to format - - - The message is formatted using the String.Format method. See - for details of the syntax of the format string and the behavior - of the formatting. - - - This method does not take an object to include in the - log event. To pass an use one of the - methods instead. - - - - - - - - Manages a mapping from levels to - - - - Manages an ordered mapping from instances - to subclasses. - - - Nicko Cadell - - - - Default constructor - - - - Initialise a new instance of . - - - - - - Add a to this mapping - - the entry to add - - - If a has previously been added - for the same then that entry will be - overwritten. - - - - - - Lookup the mapping for the specified level - - the level to lookup - the for the level or null if no mapping found - - - Lookup the value for the specified level. Finds the nearest - mapping value for the level that is equal to or less than the - specified. - - - If no mapping could be found then null is returned. - - - - - - Initialize options - - - - Caches the sorted list of in an array - - - - - - Implementation of Properties collection for the - - - - Class implements a collection of properties that is specific to each thread. - The class is not synchronized as each thread has its own . - - - This class stores its properties in a slot on the named - log4net.Util.LogicalThreadContextProperties. - - - The requires a link time - for the - . - If the calling code does not have this permission then this context will be disabled. - It will not store any property values set on it. - - - Nicko Cadell - - - - Flag used to disable this context if we don't have permission to access the CallContext. - - - - - Constructor - - - - Initializes a new instance of the class. - - - - - - Remove a property - - the key for the entry to remove - - - Remove the value for the specified from the context. - - - - - - Clear all the context properties - - - - Clear all the context properties - - - - - - Get the PropertiesDictionary stored in the LocalDataStoreSlot for this thread. - - create the dictionary if it does not exist, otherwise return null if is does not exist - the properties for this thread - - - The collection returned is only to be used on the calling thread. If the - caller needs to share the collection between different threads then the - caller must clone the collection before doings so. - - - - - - Gets the call context get data. - - The peroperties dictionary stored in the call context - - The method has a - security link demand, therfore we must put the method call in a seperate method - that we can wrap in an exception handler. - - - - - Sets the call context data. - - The properties. - - The method has a - security link demand, therfore we must put the method call in a seperate method - that we can wrap in an exception handler. - - - - - The fully qualified type of the LogicalThreadContextProperties class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Gets or sets the value of a property - - - The value for the property with the specified key - - - - Get or set the property value for the specified. - - - - - - - - - - - - - Outputs log statements from within the log4net assembly. - - - - Log4net components cannot make log4net logging calls. However, it is - sometimes useful for the user to learn about what log4net is - doing. - - - All log4net internal debug calls go to the standard output stream - whereas internal error messages are sent to the standard error output - stream. - - - Nicko Cadell - Gert Driesen - - - - Formats Prefix, Source, and Message in the same format as the value - sent to Console.Out and Trace.Write. - - - - - - Initializes a new instance of the class. - - - - - - - - - Static constructor that initializes logging by reading - settings from the application configuration file. - - - - The log4net.Internal.Debug application setting - controls internal debugging. This setting should be set - to true to enable debugging. - - - The log4net.Internal.Quiet application setting - suppresses all internal logging including error messages. - This setting should be set to true to enable message - suppression. - - - - - - Raises the LogReceived event when an internal messages is received. - - - - - - - - - Writes log4net internal debug messages to the - standard output stream. - - - The message to log. - - - All internal debug messages are prepended with - the string "log4net: ". - - - - - - Writes log4net internal debug messages to the - standard output stream. - - The Type that generated this message. - The message to log. - An exception to log. - - - All internal debug messages are prepended with - the string "log4net: ". - - - - - - Writes log4net internal warning messages to the - standard error stream. - - The Type that generated this message. - The message to log. - - - All internal warning messages are prepended with - the string "log4net:WARN ". - - - - - - Writes log4net internal warning messages to the - standard error stream. - - The Type that generated this message. - The message to log. - An exception to log. - - - All internal warning messages are prepended with - the string "log4net:WARN ". - - - - - - Writes log4net internal error messages to the - standard error stream. - - The Type that generated this message. - The message to log. - - - All internal error messages are prepended with - the string "log4net:ERROR ". - - - - - - Writes log4net internal error messages to the - standard error stream. - - The Type that generated this message. - The message to log. - An exception to log. - - - All internal debug messages are prepended with - the string "log4net:ERROR ". - - - - - - Writes output to the standard output stream. - - The message to log. - - - Writes to both Console.Out and System.Diagnostics.Trace. - Note that the System.Diagnostics.Trace is not supported - on the Compact Framework. - - - If the AppDomain is not configured with a config file then - the call to System.Diagnostics.Trace may fail. This is only - an issue if you are programmatically creating your own AppDomains. - - - - - - Writes output to the standard error stream. - - The message to log. - - - Writes to both Console.Error and System.Diagnostics.Trace. - Note that the System.Diagnostics.Trace is not supported - on the Compact Framework. - - - If the AppDomain is not configured with a config file then - the call to System.Diagnostics.Trace may fail. This is only - an issue if you are programmatically creating your own AppDomains. - - - - - - Default debug level - - - - - In quietMode not even errors generate any output. - - - - - The event raised when an internal message has been received. - - - - - The Type that generated the internal message. - - - - - The DateTime stamp of when the internal message was received. - - - - - A string indicating the severity of the internal message. - - - "log4net: ", - "log4net:ERROR ", - "log4net:WARN " - - - - - The internal log message. - - - - - The Exception related to the message. - - - Optional. Will be null if no Exception was passed. - - - - - Gets or sets a value indicating whether log4net internal logging - is enabled or disabled. - - - true if log4net internal logging is enabled, otherwise - false. - - - - When set to true, internal debug level logging will be - displayed. - - - This value can be set by setting the application setting - log4net.Internal.Debug in the application configuration - file. - - - The default value is false, i.e. debugging is - disabled. - - - - - The following example enables internal debugging using the - application configuration file : - - - - - - - - - - - - - Gets or sets a value indicating whether log4net should generate no output - from internal logging, not even for errors. - - - true if log4net should generate no output at all from internal - logging, otherwise false. - - - - When set to true will cause internal logging at all levels to be - suppressed. This means that no warning or error reports will be logged. - This option overrides the setting and - disables all debug also. - - This value can be set by setting the application setting - log4net.Internal.Quiet in the application configuration file. - - - The default value is false, i.e. internal logging is not - disabled. - - - - The following example disables internal logging using the - application configuration file : - - - - - - - - - - - - - - - - - Test if LogLog.Debug is enabled for output. - - - true if Debug is enabled - - - - Test if LogLog.Debug is enabled for output. - - - - - - Test if LogLog.Warn is enabled for output. - - - true if Warn is enabled - - - - Test if LogLog.Warn is enabled for output. - - - - - - Test if LogLog.Error is enabled for output. - - - true if Error is enabled - - - - Test if LogLog.Error is enabled for output. - - - - - - Subscribes to the LogLog.LogReceived event and stores messages - to the supplied IList instance. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Represents a native error code and message. - - - - Represents a Win32 platform native error. - - - Nicko Cadell - Gert Driesen - - - - Create an instance of the class with the specified - error number and message. - - The number of the native error. - The message of the native error. - - - Create an instance of the class with the specified - error number and message. - - - - - - Create a new instance of the class for the last Windows error. - - - An instance of the class for the last windows error. - - - - The message for the error number is lookup up using the - native Win32 FormatMessage function. - - - - - - Create a new instance of the class. - - the error number for the native error - - An instance of the class for the specified - error number. - - - - The message for the specified error number is lookup up using the - native Win32 FormatMessage function. - - - - - - Retrieves the message corresponding with a Win32 message identifier. - - Message identifier for the requested message. - - The message corresponding with the specified message identifier. - - - - The message will be searched for in system message-table resource(s) - using the native FormatMessage function. - - - - - - Return error information string - - error information string - - - Return error information string - - - - - - Formats a message string. - - Formatting options, and how to interpret the parameter. - Location of the message definition. - Message identifier for the requested message. - Language identifier for the requested message. - If includes FORMAT_MESSAGE_ALLOCATE_BUFFER, the function allocates a buffer using the LocalAlloc function, and places the pointer to the buffer at the address specified in . - If the FORMAT_MESSAGE_ALLOCATE_BUFFER flag is not set, this parameter specifies the maximum number of TCHARs that can be stored in the output buffer. If FORMAT_MESSAGE_ALLOCATE_BUFFER is set, this parameter specifies the minimum number of TCHARs to allocate for an output buffer. - Pointer to an array of values that are used as insert values in the formatted message. - - - The function requires a message definition as input. The message definition can come from a - buffer passed into the function. It can come from a message table resource in an - already-loaded module. Or the caller can ask the function to search the system's message - table resource(s) for the message definition. The function finds the message definition - in a message table resource based on a message identifier and a language identifier. - The function copies the formatted message text to an output buffer, processing any embedded - insert sequences if requested. - - - To prevent the usage of unsafe code, this stub does not support inserting values in the formatted message. - - - - - If the function succeeds, the return value is the number of TCHARs stored in the output - buffer, excluding the terminating null character. - - - If the function fails, the return value is zero. To get extended error information, - call . - - - - - - Gets the number of the native error. - - - The number of the native error. - - - - Gets the number of the native error. - - - - - - Gets the message of the native error. - - - The message of the native error. - - - - - Gets the message of the native error. - - - - - An always empty . - - - - A singleton implementation of the over a collection - that is empty and not modifiable. - - - Nicko Cadell - Gert Driesen - - - - Initializes a new instance of the class. - - - - Uses a private access modifier to enforce the singleton pattern. - - - - - - Test if the enumerator can advance, if so advance. - - false as the cannot advance. - - - As the enumerator is over an empty collection its - value cannot be moved over a valid position, therefore - will always return false. - - - - - - Resets the enumerator back to the start. - - - - As the enumerator is over an empty collection does nothing. - - - - - - The singleton instance of the . - - - - - Gets the singleton instance of the . - - The singleton instance of the . - - - Gets the singleton instance of the . - - - - - - Gets the current object from the enumerator. - - - Throws an because the - never has a current value. - - - - As the enumerator is over an empty collection its - value cannot be moved over a valid position, therefore - will throw an . - - - The collection is empty and - cannot be positioned over a valid location. - - - - Gets the current key from the enumerator. - - - Throws an exception because the - never has a current value. - - - - As the enumerator is over an empty collection its - value cannot be moved over a valid position, therefore - will throw an . - - - The collection is empty and - cannot be positioned over a valid location. - - - - Gets the current value from the enumerator. - - The current value from the enumerator. - - Throws an because the - never has a current value. - - - - As the enumerator is over an empty collection its - value cannot be moved over a valid position, therefore - will throw an . - - - The collection is empty and - cannot be positioned over a valid location. - - - - Gets the current entry from the enumerator. - - - Throws an because the - never has a current entry. - - - - As the enumerator is over an empty collection its - value cannot be moved over a valid position, therefore - will throw an . - - - The collection is empty and - cannot be positioned over a valid location. - - - - An always empty . - - - - A singleton implementation of the over a collection - that is empty and not modifiable. - - - Nicko Cadell - Gert Driesen - - - - Initializes a new instance of the class. - - - - Uses a private access modifier to enforce the singleton pattern. - - - - - - Test if the enumerator can advance, if so advance - - false as the cannot advance. - - - As the enumerator is over an empty collection its - value cannot be moved over a valid position, therefore - will always return false. - - - - - - Resets the enumerator back to the start. - - - - As the enumerator is over an empty collection does nothing. - - - - - - The singleton instance of the . - - - - - Get the singleton instance of the . - - The singleton instance of the . - - - Gets the singleton instance of the . - - - - - - Gets the current object from the enumerator. - - - Throws an because the - never has a current value. - - - - As the enumerator is over an empty collection its - value cannot be moved over a valid position, therefore - will throw an . - - - The collection is empty and - cannot be positioned over a valid location. - - - - A SecurityContext used when a SecurityContext is not required - - - - The is a no-op implementation of the - base class. It is used where a - is required but one has not been provided. - - - Nicko Cadell - - - - Singleton instance of - - - - Singleton instance of - - - - - - Private constructor - - - - Private constructor for singleton pattern. - - - - - - Impersonate this SecurityContext - - State supplied by the caller - null - - - No impersonation is done and null is always returned. - - - - - - Implements log4net's default error handling policy which consists - of emitting a message for the first error in an appender and - ignoring all subsequent errors. - - - - The error message is processed using the LogLog sub-system by default. - - - This policy aims at protecting an otherwise working application - from being flooded with error messages when logging fails. - - - Nicko Cadell - Gert Driesen - Ron Grabowski - - - - Default Constructor - - - - Initializes a new instance of the class. - - - - - - Constructor - - The prefix to use for each message. - - - Initializes a new instance of the class - with the specified prefix. - - - - - - Reset the error handler back to its initial disabled state. - - - - - Log an Error - - The error message. - The exception. - The internal error code. - - - Invokes if and only if this is the first error or the first error after has been called. - - - - - - Log the very first error - - The error message. - The exception. - The internal error code. - - - Sends the error information to 's Error method. - - - - - - Log an Error - - The error message. - The exception. - - - Invokes if and only if this is the first error or the first error after has been called. - - - - - - Log an error - - The error message. - - - Invokes if and only if this is the first error or the first error after has been called. - - - - - - The date the error was recorded. - - - - - Flag to indicate if it is the first error - - - - - The message recorded during the first error. - - - - - The exception recorded during the first error. - - - - - The error code recorded during the first error. - - - - - String to prefix each message with - - - - - The fully qualified type of the OnlyOnceErrorHandler class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Is error logging enabled - - - - Is error logging enabled. Logging is only enabled for the - first error delivered to the . - - - - - - The date the first error that trigged this error handler occured. - - - - - The message from the first error that trigged this error handler. - - - - - The exception from the first error that trigged this error handler. - - - May be . - - - - - The error code from the first error that trigged this error handler. - - - Defaults to - - - - - A convenience class to convert property values to specific types. - - - - Utility functions for converting types and parsing values. - - - Nicko Cadell - Gert Driesen - - - - Initializes a new instance of the class. - - - - Uses a private access modifier to prevent instantiation of this class. - - - - - - Converts a string to a value. - - String to convert. - The default value. - The value of . - - - If is "true", then true is returned. - If is "false", then false is returned. - Otherwise, is returned. - - - - - - Parses a file size into a number. - - String to parse. - The default value. - The value of . - - - Parses a file size of the form: number[KB|MB|GB] into a - long value. It is scaled with the appropriate multiplier. - - - is returned when - cannot be converted to a value. - - - - - - Converts a string to an object. - - The target type to convert to. - The string to convert to an object. - - The object converted from a string or null when the - conversion failed. - - - - Converts a string to an object. Uses the converter registry to try - to convert the string value into the specified target type. - - - - - - Checks if there is an appropriate type conversion from the source type to the target type. - - The type to convert from. - The type to convert to. - true if there is a conversion from the source type to the target type. - - Checks if there is an appropriate type conversion from the source type to the target type. - - - - - - - Converts an object to the target type. - - The object to convert to the target type. - The type to convert to. - The converted object. - - - Converts an object to the target type. - - - - - - Instantiates an object given a class name. - - The fully qualified class name of the object to instantiate. - The class to which the new object should belong. - The object to return in case of non-fulfillment. - - An instance of the or - if the object could not be instantiated. - - - - Checks that the is a subclass of - . If that test fails or the object could - not be instantiated, then is returned. - - - - - - Performs variable substitution in string from the - values of keys found in . - - The string on which variable substitution is performed. - The dictionary to use to lookup variables. - The result of the substitutions. - - - The variable substitution delimiters are ${ and }. - - - For example, if props contains key=value, then the call - - - - string s = OptionConverter.SubstituteVariables("Value of key is ${key}."); - - - - will set the variable s to "Value of key is value.". - - - If no value could be found for the specified key, then substitution - defaults to an empty string. - - - For example, if system properties contains no value for the key - "nonExistentKey", then the call - - - - string s = OptionConverter.SubstituteVariables("Value of nonExistentKey is [${nonExistentKey}]"); - - - - will set s to "Value of nonExistentKey is []". - - - An Exception is thrown if contains a start - delimiter "${" which is not balanced by a stop delimiter "}". - - - - - - Converts the string representation of the name or numeric value of one or - more enumerated constants to an equivalent enumerated object. - - The type to convert to. - The enum string value. - If true, ignore case; otherwise, regard case. - An object of type whose value is represented by . - - - - The fully qualified type of the OptionConverter class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Most of the work of the class - is delegated to the PatternParser class. - - - - The PatternParser processes a pattern string and - returns a chain of objects. - - - Nicko Cadell - Gert Driesen - - - - Constructor - - The pattern to parse. - - - Initializes a new instance of the class - with the specified pattern string. - - - - - - Parses the pattern into a chain of pattern converters. - - The head of a chain of pattern converters. - - - Parses the pattern into a chain of pattern converters. - - - - - - Build the unified cache of converters from the static and instance maps - - the list of all the converter names - - - Build the unified cache of converters from the static and instance maps - - - - - - Internal method to parse the specified pattern to find specified matches - - the pattern to parse - the converter names to match in the pattern - - - The matches param must be sorted such that longer strings come before shorter ones. - - - - - - Process a parsed literal - - the literal text - - - - Process a parsed converter pattern - - the name of the converter - the optional option for the converter - the formatting info for the converter - - - - Resets the internal state of the parser and adds the specified pattern converter - to the chain. - - The pattern converter to add. - - - - The first pattern converter in the chain - - - - - the last pattern converter in the chain - - - - - The pattern - - - - - Internal map of converter identifiers to converter types - - - - This map overrides the static s_globalRulesRegistry map. - - - - - - The fully qualified type of the PatternParser class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Get the converter registry used by this parser - - - The converter registry used by this parser - - - - Get the converter registry used by this parser - - - - - - Sort strings by length - - - - that orders strings by string length. - The longest strings are placed first - - - - - - This class implements a patterned string. - - - - This string has embedded patterns that are resolved and expanded - when the string is formatted. - - - This class functions similarly to the - in that it accepts a pattern and renders it to a string. Unlike the - however the PatternString - does not render the properties of a specific but - of the process in general. - - - The recognized conversion pattern names are: - - - - Conversion Pattern Name - Effect - - - appdomain - - - Used to output the friendly name of the current AppDomain. - - - - - date - - - Used to output the current date and time in the local time zone. - To output the date in universal time use the %utcdate pattern. - The date conversion - specifier may be followed by a date format specifier enclosed - between braces. For example, %date{HH:mm:ss,fff} or - %date{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is - given then ISO8601 format is - assumed (). - - - The date format specifier admits the same syntax as the - time pattern string of the . - - - For better results it is recommended to use the log4net date - formatters. These can be specified using one of the strings - "ABSOLUTE", "DATE" and "ISO8601" for specifying - , - and respectively - . For example, - %date{ISO8601} or %date{ABSOLUTE}. - - - These dedicated date formatters perform significantly - better than . - - - - - env - - - Used to output the a specific environment variable. The key to - lookup must be specified within braces and directly following the - pattern specifier, e.g. %env{COMPUTERNAME} would include the value - of the COMPUTERNAME environment variable. - - - The env pattern is not supported on the .NET Compact Framework. - - - - - identity - - - Used to output the user name for the currently active user - (Principal.Identity.Name). - - - - - newline - - - Outputs the platform dependent line separator character or - characters. - - - This conversion pattern name offers the same performance as using - non-portable line separator strings such as "\n", or "\r\n". - Thus, it is the preferred way of specifying a line separator. - - - - - processid - - - Used to output the system process ID for the current process. - - - - - property - - - Used to output a specific context property. The key to - lookup must be specified within braces and directly following the - pattern specifier, e.g. %property{user} would include the value - from the property that is keyed by the string 'user'. Each property value - that is to be included in the log must be specified separately. - Properties are stored in logging contexts. By default - the log4net:HostName property is set to the name of machine on - which the event was originally logged. - - - If no key is specified, e.g. %property then all the keys and their - values are printed in a comma separated list. - - - The properties of an event are combined from a number of different - contexts. These are listed below in the order in which they are searched. - - - - the thread properties - - The that are set on the current - thread. These properties are shared by all events logged on this thread. - - - - the global properties - - The that are set globally. These - properties are shared by all the threads in the AppDomain. - - - - - - - random - - - Used to output a random string of characters. The string is made up of - uppercase letters and numbers. By default the string is 4 characters long. - The length of the string can be specified within braces directly following the - pattern specifier, e.g. %random{8} would output an 8 character string. - - - - - username - - - Used to output the WindowsIdentity for the currently - active user. - - - - - utcdate - - - Used to output the date of the logging event in universal time. - The date conversion - specifier may be followed by a date format specifier enclosed - between braces. For example, %utcdate{HH:mm:ss,fff} or - %utcdate{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is - given then ISO8601 format is - assumed (). - - - The date format specifier admits the same syntax as the - time pattern string of the . - - - For better results it is recommended to use the log4net date - formatters. These can be specified using one of the strings - "ABSOLUTE", "DATE" and "ISO8601" for specifying - , - and respectively - . For example, - %utcdate{ISO8601} or %utcdate{ABSOLUTE}. - - - These dedicated date formatters perform significantly - better than . - - - - - % - - - The sequence %% outputs a single percent sign. - - - - - - Additional pattern converters may be registered with a specific - instance using or - . - - - See the for details on the - format modifiers supported by the patterns. - - - Nicko Cadell - - - - Internal map of converter identifiers to converter types. - - - - - the pattern - - - - - the head of the pattern converter chain - - - - - patterns defined on this PatternString only - - - - - Initialize the global registry - - - - - Default constructor - - - - Initialize a new instance of - - - - - - Constructs a PatternString - - The pattern to use with this PatternString - - - Initialize a new instance of with the pattern specified. - - - - - - Initialize object options - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - - - - Create the used to parse the pattern - - the pattern to parse - The - - - Returns PatternParser used to parse the conversion string. Subclasses - may override this to return a subclass of PatternParser which recognize - custom conversion pattern name. - - - - - - Produces a formatted string as specified by the conversion pattern. - - The TextWriter to write the formatted event to - - - Format the pattern to the . - - - - - - Format the pattern as a string - - the pattern formatted as a string - - - Format the pattern to a string. - - - - - - Add a converter to this PatternString - - the converter info - - - This version of the method is used by the configurator. - Programmatic users should use the alternative method. - - - - - - Add a converter to this PatternString - - the name of the conversion pattern for this converter - the type of the converter - - - Add a converter to this PatternString - - - - - - Gets or sets the pattern formatting string - - - The pattern formatting string - - - - The ConversionPattern option. This is the string which - controls formatting and consists of a mix of literal content and - conversion specifiers. - - - - - - String keyed object map. - - - - While this collection is serializable only member - objects that are serializable will - be serialized along with this collection. - - - Nicko Cadell - Gert Driesen - - - - String keyed object map that is read only. - - - - This collection is readonly and cannot be modified. - - - While this collection is serializable only member - objects that are serializable will - be serialized along with this collection. - - - Nicko Cadell - Gert Driesen - - - - The Hashtable used to store the properties data - - - - - Constructor - - - - Initializes a new instance of the class. - - - - - - Copy Constructor - - properties to copy - - - Initializes a new instance of the class. - - - - - - Deserialization constructor - - The that holds the serialized object data. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class - with serialized data. - - - - - - Gets the key names. - - An array of all the keys. - - - Gets the key names. - - - - - - Test if the dictionary contains a specified key - - the key to look for - true if the dictionary contains the specified key - - - Test if the dictionary contains a specified key - - - - - - Serializes this object into the provided. - - The to populate with data. - The destination for this serialization. - - - Serializes this object into the provided. - - - - - - See - - - - - See - - - - - - See - - - - - - - Remove all properties from the properties collection - - - - - See - - - - - - - See - - - - - - - See - - - - - Gets or sets the value of the property with the specified key. - - - The value of the property with the specified key. - - The key of the property to get or set. - - - The property value will only be serialized if it is serializable. - If it cannot be serialized it will be silently ignored if - a serialization operation is performed. - - - - - - The hashtable used to store the properties - - - The internal collection used to store the properties - - - - The hashtable used to store the properties - - - - - - See - - - - - See - - - - - See - - - - - See - - - - - See - - - - - See - - - - - The number of properties in this collection - - - - - See - - - - - Constructor - - - - Initializes a new instance of the class. - - - - - - Constructor - - properties to copy - - - Initializes a new instance of the class. - - - - - - Initializes a new instance of the class - with serialized data. - - The that holds the serialized object data. - The that contains contextual information about the source or destination. - - - Because this class is sealed the serialization constructor is private. - - - - - - Remove the entry with the specified key from this dictionary - - the key for the entry to remove - - - Remove the entry with the specified key from this dictionary - - - - - - See - - an enumerator - - - Returns a over the contest of this collection. - - - - - - See - - the key to remove - - - Remove the entry with the specified key from this dictionary - - - - - - See - - the key to lookup in the collection - true if the collection contains the specified key - - - Test if this collection contains a specified key. - - - - - - Remove all properties from the properties collection - - - - Remove all properties from the properties collection - - - - - - See - - the key - the value to store for the key - - - Store a value for the specified . - - - Thrown if the is not a string - - - - See - - - - - - - See - - - - - Gets or sets the value of the property with the specified key. - - - The value of the property with the specified key. - - The key of the property to get or set. - - - The property value will only be serialized if it is serializable. - If it cannot be serialized it will be silently ignored if - a serialization operation is performed. - - - - - - See - - - false - - - - This collection is modifiable. This property always - returns false. - - - - - - See - - - The value for the key specified. - - - - Get or set a value for the specified . - - - Thrown if the is not a string - - - - See - - - - - See - - - - - See - - - - - See - - - - - See - - - - - A class to hold the key and data for a property set in the config file - - - - A class to hold the key and data for a property set in the config file - - - - - - Override Object.ToString to return sensible debug info - - string info about this object - - - - Property Key - - - Property Key - - - - Property Key. - - - - - - Property Value - - - Property Value - - - - Property Value. - - - - - - A that ignores the message - - - - This writer is used in special cases where it is necessary - to protect a writer from being closed by a client. - - - Nicko Cadell - - - - Constructor - - the writer to actually write to - - - Create a new ProtectCloseTextWriter using a writer - - - - - - Attach this instance to a different underlying - - the writer to attach to - - - Attach this instance to a different underlying - - - - - - Does not close the underlying output writer. - - - - Does not close the underlying output writer. - This method does nothing. - - - - - - Defines a lock that supports single writers and multiple readers - - - - ReaderWriterLock is used to synchronize access to a resource. - At any given time, it allows either concurrent read access for - multiple threads, or write access for a single thread. In a - situation where a resource is changed infrequently, a - ReaderWriterLock provides better throughput than a simple - one-at-a-time lock, such as . - - - If a platform does not support a System.Threading.ReaderWriterLock - implementation then all readers and writers are serialized. Therefore - the caller must not rely on multiple simultaneous readers. - - - Nicko Cadell - - - - Constructor - - - - Initializes a new instance of the class. - - - - - - Acquires a reader lock - - - - blocks if a different thread has the writer - lock, or if at least one thread is waiting for the writer lock. - - - - - - Decrements the lock count - - - - decrements the lock count. When the count - reaches zero, the lock is released. - - - - - - Acquires the writer lock - - - - This method blocks if another thread has a reader lock or writer lock. - - - - - - Decrements the lock count on the writer lock - - - - ReleaseWriterLock decrements the writer lock count. - When the count reaches zero, the writer lock is released. - - - - - - A that can be and reused - - - - A that can be and reused. - This uses a single buffer for string operations. - - - Nicko Cadell - - - - Create an instance of - - the format provider to use - - - Create an instance of - - - - - - Override Dispose to prevent closing of writer - - flag - - - Override Dispose to prevent closing of writer - - - - - - Reset this string writer so that it can be reused. - - the maximum buffer capacity before it is trimmed - the default size to make the buffer - - - Reset this string writer so that it can be reused. - The internal buffers are cleared and reset. - - - - - - Utility class for system specific information. - - - - Utility class of static methods for system specific information. - - - Nicko Cadell - Gert Driesen - Alexey Solofnenko - - - - Private constructor to prevent instances. - - - - Only static methods are exposed from this type. - - - - - - Initialize default values for private static fields. - - - - Only static methods are exposed from this type. - - - - - - Gets the assembly location path for the specified assembly. - - The assembly to get the location for. - The location of the assembly. - - - This method does not guarantee to return the correct path - to the assembly. If only tries to give an indication as to - where the assembly was loaded from. - - - - - - Gets the fully qualified name of the , including - the name of the assembly from which the was - loaded. - - The to get the fully qualified name for. - The fully qualified name for the . - - - This is equivalent to the Type.AssemblyQualifiedName property, - but this method works on the .NET Compact Framework 1.0 as well as - the full .NET runtime. - - - - - - Gets the short name of the . - - The to get the name for. - The short name of the . - - - The short name of the assembly is the - without the version, culture, or public key. i.e. it is just the - assembly's file name without the extension. - - - Use this rather than Assembly.GetName().Name because that - is not available on the Compact Framework. - - - Because of a FileIOPermission security demand we cannot do - the obvious Assembly.GetName().Name. We are allowed to get - the of the assembly so we - start from there and strip out just the assembly name. - - - - - - Gets the file name portion of the , including the extension. - - The to get the file name for. - The file name of the assembly. - - - Gets the file name portion of the , including the extension. - - - - - - Loads the type specified in the type string. - - A sibling type to use to load the type. - The name of the type to load. - Flag set to true to throw an exception if the type cannot be loaded. - true to ignore the case of the type name; otherwise, false - The type loaded or null if it could not be loaded. - - - If the type name is fully qualified, i.e. if contains an assembly name in - the type name, the type will be loaded from the system using - . - - - If the type name is not fully qualified, it will be loaded from the assembly - containing the specified relative type. If the type is not found in the assembly - then all the loaded assemblies will be searched for the type. - - - - - - Loads the type specified in the type string. - - The name of the type to load. - Flag set to true to throw an exception if the type cannot be loaded. - true to ignore the case of the type name; otherwise, false - The type loaded or null if it could not be loaded. - - - If the type name is fully qualified, i.e. if contains an assembly name in - the type name, the type will be loaded from the system using - . - - - If the type name is not fully qualified it will be loaded from the - assembly that is directly calling this method. If the type is not found - in the assembly then all the loaded assemblies will be searched for the type. - - - - - - Loads the type specified in the type string. - - An assembly to load the type from. - The name of the type to load. - Flag set to true to throw an exception if the type cannot be loaded. - true to ignore the case of the type name; otherwise, false - The type loaded or null if it could not be loaded. - - - If the type name is fully qualified, i.e. if contains an assembly name in - the type name, the type will be loaded from the system using - . - - - If the type name is not fully qualified it will be loaded from the specified - assembly. If the type is not found in the assembly then all the loaded assemblies - will be searched for the type. - - - - - - Generate a new guid - - A new Guid - - - Generate a new guid - - - - - - Create an - - The name of the parameter that caused the exception - The value of the argument that causes this exception - The message that describes the error - the ArgumentOutOfRangeException object - - - Create a new instance of the class - with a specified error message, the parameter name, and the value - of the argument. - - - The Compact Framework does not support the 3 parameter constructor for the - type. This method provides an - implementation that works for all platforms. - - - - - - Parse a string into an value - - the string to parse - out param where the parsed value is placed - true if the string was able to be parsed into an integer - - - Attempts to parse the string into an integer. If the string cannot - be parsed then this method returns false. The method does not throw an exception. - - - - - - Parse a string into an value - - the string to parse - out param where the parsed value is placed - true if the string was able to be parsed into an integer - - - Attempts to parse the string into an integer. If the string cannot - be parsed then this method returns false. The method does not throw an exception. - - - - - - Parse a string into an value - - the string to parse - out param where the parsed value is placed - true if the string was able to be parsed into an integer - - - Attempts to parse the string into an integer. If the string cannot - be parsed then this method returns false. The method does not throw an exception. - - - - - - Lookup an application setting - - the application settings key to lookup - the value for the key, or null - - - Configuration APIs are not supported under the Compact Framework - - - - - - Convert a path into a fully qualified local file path. - - The path to convert. - The fully qualified path. - - - Converts the path specified to a fully - qualified path. If the path is relative it is - taken as relative from the application base - directory. - - - The path specified must be a local file path, a URI is not supported. - - - - - - Creates a new case-insensitive instance of the class with the default initial capacity. - - A new case-insensitive instance of the class with the default initial capacity - - - The new Hashtable instance uses the default load factor, the CaseInsensitiveHashCodeProvider, and the CaseInsensitiveComparer. - - - - - - Gets an empty array of types. - - - - The Type.EmptyTypes field is not available on - the .NET Compact Framework 1.0. - - - - - - The fully qualified type of the SystemInfo class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Cache the host name for the current machine - - - - - Cache the application friendly name - - - - - Text to output when a null is encountered. - - - - - Text to output when an unsupported feature is requested. - - - - - Start time for the current process. - - - - - Gets the system dependent line terminator. - - - The system dependent line terminator. - - - - Gets the system dependent line terminator. - - - - - - Gets the base directory for this . - - The base directory path for the current . - - - Gets the base directory for this . - - - The value returned may be either a local file path or a URI. - - - - - - Gets the path to the configuration file for the current . - - The path to the configuration file for the current . - - - The .NET Compact Framework 1.0 does not have a concept of a configuration - file. For this runtime, we use the entry assembly location as the root for - the configuration file name. - - - The value returned may be either a local file path or a URI. - - - - - - Gets the path to the file that first executed in the current . - - The path to the entry assembly. - - - Gets the path to the file that first executed in the current . - - - - - - Gets the ID of the current thread. - - The ID of the current thread. - - - On the .NET framework, the AppDomain.GetCurrentThreadId method - is used to obtain the thread ID for the current thread. This is the - operating system ID for the thread. - - - On the .NET Compact Framework 1.0 it is not possible to get the - operating system thread ID for the current thread. The native method - GetCurrentThreadId is implemented inline in a header file - and cannot be called. - - - On the .NET Framework 2.0 the Thread.ManagedThreadId is used as this - gives a stable id unrelated to the operating system thread ID which may - change if the runtime is using fibers. - - - - - - Get the host name or machine name for the current machine - - - The hostname or machine name - - - - Get the host name or machine name for the current machine - - - The host name () or - the machine name (Environment.MachineName) for - the current machine, or if neither of these are available - then NOT AVAILABLE is returned. - - - - - - Get this application's friendly name - - - The friendly name of this application as a string - - - - If available the name of the application is retrieved from - the AppDomain using AppDomain.CurrentDomain.FriendlyName. - - - Otherwise the file name of the entry assembly is used. - - - - - - Get the start time for the current process. - - - - This is the time at which the log4net library was loaded into the - AppDomain. Due to reports of a hang in the call to System.Diagnostics.Process.StartTime - this is not the start time for the current process. - - - The log4net library should be loaded by an application early during its - startup, therefore this start time should be a good approximation for - the actual start time. - - - Note that AppDomains may be loaded and unloaded within the - same process without the process terminating, however this start time - will be set per AppDomain. - - - - - - Text to output when a null is encountered. - - - - Use this value to indicate a null has been encountered while - outputting a string representation of an item. - - - The default value is (null). This value can be overridden by specifying - a value for the log4net.NullText appSetting in the application's - .config file. - - - - - - Text to output when an unsupported feature is requested. - - - - Use this value when an unsupported feature is requested. - - - The default value is NOT AVAILABLE. This value can be overridden by specifying - a value for the log4net.NotAvailableText appSetting in the application's - .config file. - - - - - - Utility class that represents a format string. - - - - Utility class that represents a format string. - - - Nicko Cadell - - - - Initialise the - - An that supplies culture-specific formatting information. - A containing zero or more format items. - An array containing zero or more objects to format. - - - - Format the string and arguments - - the formatted string - - - - Replaces the format item in a specified with the text equivalent - of the value of a corresponding instance in a specified array. - A specified parameter supplies culture-specific formatting information. - - An that supplies culture-specific formatting information. - A containing zero or more format items. - An array containing zero or more objects to format. - - A copy of format in which the format items have been replaced by the - equivalent of the corresponding instances of in args. - - - - This method does not throw exceptions. If an exception thrown while formatting the result the - exception and arguments are returned in the result string. - - - - - - Process an error during StringFormat - - - - - Dump the contents of an array into a string builder - - - - - Dump an object to a string - - - - - The fully qualified type of the SystemStringFormat class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Implementation of Properties collection for the - - - - Class implements a collection of properties that is specific to each thread. - The class is not synchronized as each thread has its own . - - - Nicko Cadell - - - - Each thread will automatically have its instance. - - - - - Internal constructor - - - - Initializes a new instance of the class. - - - - - - Remove a property - - the key for the entry to remove - - - Remove a property - - - - - - Get the keys stored in the properties. - - - Gets the keys stored in the properties. - - a set of the defined keys - - - - Clear all properties - - - - Clear all properties - - - - - - Get the PropertiesDictionary for this thread. - - create the dictionary if it does not exist, otherwise return null if does not exist - the properties for this thread - - - The collection returned is only to be used on the calling thread. If the - caller needs to share the collection between different threads then the - caller must clone the collection before doing so. - - - - - - Gets or sets the value of a property - - - The value for the property with the specified key - - - - Gets or sets the value of a property - - - - - - Implementation of Stack for the - - - - Implementation of Stack for the - - - Nicko Cadell - - - - The stack store. - - - - - Internal constructor - - - - Initializes a new instance of the class. - - - - - - Clears all the contextual information held in this stack. - - - - Clears all the contextual information held in this stack. - Only call this if you think that this tread is being reused after - a previous call execution which may not have completed correctly. - You do not need to use this method if you always guarantee to call - the method of the - returned from even in exceptional circumstances, - for example by using the using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message")) - syntax. - - - - - - Removes the top context from this stack. - - The message in the context that was removed from the top of this stack. - - - Remove the top context from this stack, and return - it to the caller. If this stack is empty then an - empty string (not ) is returned. - - - - - - Pushes a new context message into this stack. - - The new context message. - - An that can be used to clean up the context stack. - - - - Pushes a new context onto this stack. An - is returned that can be used to clean up this stack. This - can be easily combined with the using keyword to scope the - context. - - - Simple example of using the Push method with the using keyword. - - using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message")) - { - log.Warn("This should have an ThreadContext Stack message"); - } - - - - - - Gets the current context information for this stack. - - The current context information. - - - - Gets the current context information for this stack. - - Gets the current context information - - - Gets the current context information for this stack. - - - - - - Get a portable version of this object - - the portable instance of this object - - - Get a cross thread portable version of this object - - - - - - The number of messages in the stack - - - The current number of messages in the stack - - - - The current number of messages in the stack. That is - the number of times has been called - minus the number of times has been called. - - - - - - Gets and sets the internal stack used by this - - The internal storage stack - - - This property is provided only to support backward compatability - of the . Tytpically the internal stack should not - be modified. - - - - - - Inner class used to represent a single context frame in the stack. - - - - Inner class used to represent a single context frame in the stack. - - - - - - Constructor - - The message for this context. - The parent context in the chain. - - - Initializes a new instance of the class - with the specified message and parent context. - - - - - - Get the message. - - The message. - - - Get the message. - - - - - - Gets the full text of the context down to the root level. - - - The full text of the context down to the root level. - - - - Gets the full text of the context down to the root level. - - - - - - Struct returned from the method. - - - - This struct implements the and is designed to be used - with the pattern to remove the stack frame at the end of the scope. - - - - - - The ThreadContextStack internal stack - - - - - The depth to trim the stack to when this instance is disposed - - - - - Constructor - - The internal stack used by the ThreadContextStack. - The depth to return the stack to when this object is disposed. - - - Initializes a new instance of the class with - the specified stack and return depth. - - - - - - Returns the stack to the correct depth. - - - - Returns the stack to the correct depth. - - - - - - Implementation of Stacks collection for the - - - - Implementation of Stacks collection for the - - - Nicko Cadell - - - - Internal constructor - - - - Initializes a new instance of the class. - - - - - - The fully qualified type of the ThreadContextStacks class. - - - Used by the internal logger to record the Type of the - log message. - - - - - Gets the named thread context stack - - - The named stack - - - - Gets the named thread context stack - - - - - - Utility class for transforming strings. - - - - Utility class for transforming strings. - - - Nicko Cadell - Gert Driesen - - - - Initializes a new instance of the class. - - - - Uses a private access modifier to prevent instantiation of this class. - - - - - - Write a string to an - - the writer to write to - the string to write - The string to replace non XML compliant chars with - - - The test is escaped either using XML escape entities - or using CDATA sections. - - - - - - Replace invalid XML characters in text string - - the XML text input string - the string to use in place of invalid characters - A string that does not contain invalid XML characters. - - - Certain Unicode code points are not allowed in the XML InfoSet, for - details see: http://www.w3.org/TR/REC-xml/#charsets. - - - This method replaces any illegal characters in the input string - with the mask string specified. - - - - - - Count the number of times that the substring occurs in the text - - the text to search - the substring to find - the number of times the substring occurs in the text - - - The substring is assumed to be non repeating within itself. - - - - - - Characters illegal in XML 1.0 - - - - - Impersonate a Windows Account - - - - This impersonates a Windows account. - - - How the impersonation is done depends on the value of . - This allows the context to either impersonate a set of user credentials specified - using username, domain name and password or to revert to the process credentials. - - - - - - Default constructor - - - - Default constructor - - - - - - Initialize the SecurityContext based on the options set. - - - - This is part of the delayed object - activation scheme. The method must - be called on this object after the configuration properties have - been set. Until is called this - object is in an undefined state and must not be used. - - - If any of the configuration properties are modified then - must be called again. - - - The security context will try to Logon the specified user account and - capture a primary token for impersonation. - - - The required , - or properties were not specified. - - - - Impersonate the Windows account specified by the and properties. - - caller provided state - - An instance that will revoke the impersonation of this SecurityContext - - - - Depending on the property either - impersonate a user using credentials supplied or revert - to the process credentials. - - - - - - Create a given the userName, domainName and password. - - the user name - the domain name - the password - the for the account specified - - - Uses the Windows API call LogonUser to get a principal token for the account. This - token is used to initialize the WindowsIdentity. - - - - - - Gets or sets the impersonation mode for this security context - - - The impersonation mode for this security context - - - - Impersonate either a user with user credentials or - revert this thread to the credentials of the process. - The value is one of the - enum. - - - The default value is - - - When the mode is set to - the user's credentials are established using the - , and - values. - - - When the mode is set to - no other properties need to be set. If the calling thread is - impersonating then it will be reverted back to the process credentials. - - - - - - Gets or sets the Windows username for this security context - - - The Windows username for this security context - - - - This property must be set if - is set to (the default setting). - - - - - - Gets or sets the Windows domain name for this security context - - - The Windows domain name for this security context - - - - The default value for is the local machine name - taken from the property. - - - This property must be set if - is set to (the default setting). - - - - - - Sets the password for the Windows account specified by the and properties. - - - The password for the Windows account specified by the and properties. - - - - This property must be set if - is set to (the default setting). - - - - - - The impersonation modes for the - - - - See the property for - details. - - - - - - Impersonate a user using the credentials supplied - - - - - Revert this the thread to the credentials of the process - - - - - Adds to - - - - Helper class to expose the - through the interface. - - - - - - Constructor - - the impersonation context being wrapped - - - Constructor - - - - - - Revert the impersonation - - - - Revert the impersonation - - - - - - The log4net Global Context. - - - - The GlobalContext provides a location for global debugging - information to be stored. - - - The global context has a properties map and these properties can - be included in the output of log messages. The - supports selecting and outputing these properties. - - - By default the log4net:HostName property is set to the name of - the current machine. - - - - - GlobalContext.Properties["hostname"] = Environment.MachineName; - - - - Nicko Cadell - - - - Private Constructor. - - - Uses a private access modifier to prevent instantiation of this class. - - - - - The global context properties instance - - - - - The global properties map. - - - The global properties map. - - - - The global properties map. - - - - - - Provides information about the environment the assembly has - been built for. - - - - Version of the assembly - - - Version of the framework targeted - - - Type of framework targeted - - - Does it target a client profile? - - - - Identifies the version and target for this assembly. - - - - - The log4net Logical Thread Context. - - - - The LogicalThreadContext provides a location for specific debugging - information to be stored. - The LogicalThreadContext properties override any or - properties with the same name. - - - The Logical Thread Context has a properties map and a stack. - The properties and stack can - be included in the output of log messages. The - supports selecting and outputting these properties. - - - The Logical Thread Context provides a diagnostic context for the current call context. - This is an instrument for distinguishing interleaved log - output from different sources. Log output is typically interleaved - when a server handles multiple clients near-simultaneously. - - - The Logical Thread Context is managed on a per basis. - - - The requires a link time - for the - . - If the calling code does not have this permission then this context will be disabled. - It will not store any property values set on it. - - - Example of using the thread context properties to store a username. - - LogicalThreadContext.Properties["user"] = userName; - log.Info("This log message has a LogicalThreadContext Property called 'user'"); - - - Example of how to push a message into the context stack - - using(LogicalThreadContext.Stacks["LDC"].Push("my context message")) - { - log.Info("This log message has a LogicalThreadContext Stack message that includes 'my context message'"); - - } // at the end of the using block the message is automatically popped - - - - Nicko Cadell - - - - Private Constructor. - - - - Uses a private access modifier to prevent instantiation of this class. - - - - - - The thread context properties instance - - - - - The thread context stacks instance - - - - - The thread properties map - - - The thread properties map - - - - The LogicalThreadContext properties override any - or properties with the same name. - - - - - - The thread stacks - - - stack map - - - - The logical thread stacks. - - - - - - This class is used by client applications to request logger instances. - - - - This class has static methods that are used by a client to request - a logger instance. The method is - used to retrieve a logger. - - - See the interface for more details. - - - Simple example of logging messages - - ILog log = LogManager.GetLogger("application-log"); - - log.Info("Application Start"); - log.Debug("This is a debug message"); - - if (log.IsDebugEnabled) - { - log.Debug("This is another debug message"); - } - - - - - Nicko Cadell - Gert Driesen - - - - Initializes a new instance of the class. - - - Uses a private access modifier to prevent instantiation of this class. - - - - Returns the named logger if it exists. - - Returns the named logger if it exists. - - - - If the named logger exists (in the default repository) then it - returns a reference to the logger, otherwise it returns null. - - - The fully qualified logger name to look for. - The logger found, or null if no logger could be found. - - - - Returns the named logger if it exists. - - - - If the named logger exists (in the specified repository) then it - returns a reference to the logger, otherwise it returns - null. - - - The repository to lookup in. - The fully qualified logger name to look for. - - The logger found, or null if the logger doesn't exist in the specified - repository. - - - - - Returns the named logger if it exists. - - - - If the named logger exists (in the repository for the specified assembly) then it - returns a reference to the logger, otherwise it returns - null. - - - The assembly to use to lookup the repository. - The fully qualified logger name to look for. - - The logger, or null if the logger doesn't exist in the specified - assembly's repository. - - - - Get the currently defined loggers. - - Returns all the currently defined loggers in the default repository. - - - The root logger is not included in the returned array. - - All the defined loggers. - - - - Returns all the currently defined loggers in the specified repository. - - The repository to lookup in. - - The root logger is not included in the returned array. - - All the defined loggers. - - - - Returns all the currently defined loggers in the specified assembly's repository. - - The assembly to use to lookup the repository. - - The root logger is not included in the returned array. - - All the defined loggers. - - - Get or create a logger. - - Retrieves or creates a named logger. - - - - Retrieves a logger named as the - parameter. If the named logger already exists, then the - existing instance will be returned. Otherwise, a new instance is - created. - - By default, loggers do not have a set level but inherit - it from the hierarchy. This is one of the central features of - log4net. - - - The name of the logger to retrieve. - The logger with the name specified. - - - - Retrieves or creates a named logger. - - - - Retrieve a logger named as the - parameter. If the named logger already exists, then the - existing instance will be returned. Otherwise, a new instance is - created. - - - By default, loggers do not have a set level but inherit - it from the hierarchy. This is one of the central features of - log4net. - - - The repository to lookup in. - The name of the logger to retrieve. - The logger with the name specified. - - - - Retrieves or creates a named logger. - - - - Retrieve a logger named as the - parameter. If the named logger already exists, then the - existing instance will be returned. Otherwise, a new instance is - created. - - - By default, loggers do not have a set level but inherit - it from the hierarchy. This is one of the central features of - log4net. - - - The assembly to use to lookup the repository. - The name of the logger to retrieve. - The logger with the name specified. - - - - Shorthand for . - - - Get the logger for the fully qualified name of the type specified. - - The full name of will be used as the name of the logger to retrieve. - The logger with the name specified. - - - - Shorthand for . - - - Gets the logger for the fully qualified name of the type specified. - - The repository to lookup in. - The full name of will be used as the name of the logger to retrieve. - The logger with the name specified. - - - - Shorthand for . - - - Gets the logger for the fully qualified name of the type specified. - - The assembly to use to lookup the repository. - The full name of will be used as the name of the logger to retrieve. - The logger with the name specified. - - - - Shuts down the log4net system. - - - - Calling this method will safely close and remove all - appenders in all the loggers including root contained in all the - default repositories. - - - Some appenders need to be closed before the application exists. - Otherwise, pending logging events might be lost. - - The shutdown method is careful to close nested - appenders before closing regular appenders. This is allows - configurations where a regular appender is attached to a logger - and again to a nested appender. - - - - - Shutdown a logger repository. - - Shuts down the default repository. - - - - Calling this method will safely close and remove all - appenders in all the loggers including root contained in the - default repository. - - Some appenders need to be closed before the application exists. - Otherwise, pending logging events might be lost. - - The shutdown method is careful to close nested - appenders before closing regular appenders. This is allows - configurations where a regular appender is attached to a logger - and again to a nested appender. - - - - - - Shuts down the repository for the repository specified. - - - - Calling this method will safely close and remove all - appenders in all the loggers including root contained in the - specified. - - - Some appenders need to be closed before the application exists. - Otherwise, pending logging events might be lost. - - The shutdown method is careful to close nested - appenders before closing regular appenders. This is allows - configurations where a regular appender is attached to a logger - and again to a nested appender. - - - The repository to shutdown. - - - - Shuts down the repository specified. - - - - Calling this method will safely close and remove all - appenders in all the loggers including root contained in the - repository. The repository is looked up using - the specified. - - - Some appenders need to be closed before the application exists. - Otherwise, pending logging events might be lost. - - - The shutdown method is careful to close nested - appenders before closing regular appenders. This is allows - configurations where a regular appender is attached to a logger - and again to a nested appender. - - - The assembly to use to lookup the repository. - - - Reset the configuration of a repository - - Resets all values contained in this repository instance to their defaults. - - - - Resets all values contained in the repository instance to their - defaults. This removes all appenders from all loggers, sets - the level of all non-root loggers to null, - sets their additivity flag to true and sets the level - of the root logger to . Moreover, - message disabling is set to its default "off" value. - - - - - - Resets all values contained in this repository instance to their defaults. - - - - Reset all values contained in the repository instance to their - defaults. This removes all appenders from all loggers, sets - the level of all non-root loggers to null, - sets their additivity flag to true and sets the level - of the root logger to . Moreover, - message disabling is set to its default "off" value. - - - The repository to reset. - - - - Resets all values contained in this repository instance to their defaults. - - - - Reset all values contained in the repository instance to their - defaults. This removes all appenders from all loggers, sets - the level of all non-root loggers to null, - sets their additivity flag to true and sets the level - of the root logger to . Moreover, - message disabling is set to its default "off" value. - - - The assembly to use to lookup the repository to reset. - - - Get the logger repository. - - Returns the default instance. - - - - Gets the for the repository specified - by the callers assembly (). - - - The instance for the default repository. - - - - Returns the default instance. - - The default instance. - - - Gets the for the repository specified - by the argument. - - - The repository to lookup in. - - - - Returns the default instance. - - The default instance. - - - Gets the for the repository specified - by the argument. - - - The assembly to use to lookup the repository. - - - Get a logger repository. - - Returns the default instance. - - - - Gets the for the repository specified - by the callers assembly (). - - - The instance for the default repository. - - - - Returns the default instance. - - The default instance. - - - Gets the for the repository specified - by the argument. - - - The repository to lookup in. - - - - Returns the default instance. - - The default instance. - - - Gets the for the repository specified - by the argument. - - - The assembly to use to lookup the repository. - - - Create a domain - - Creates a repository with the specified repository type. - - - - CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. - - - The created will be associated with the repository - specified such that a call to will return - the same repository instance. - - - A that implements - and has a no arg constructor. An instance of this type will be created to act - as the for the repository specified. - The created for the repository. - - - Create a logger repository. - - Creates a repository with the specified repository type. - - A that implements - and has a no arg constructor. An instance of this type will be created to act - as the for the repository specified. - The created for the repository. - - - The created will be associated with the repository - specified such that a call to will return - the same repository instance. - - - - - - Creates a repository with the specified name. - - - - CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. - - - Creates the default type of which is a - object. - - - The name must be unique. Repositories cannot be redefined. - An will be thrown if the repository already exists. - - - The name of the repository, this must be unique amongst repositories. - The created for the repository. - The specified repository already exists. - - - - Creates a repository with the specified name. - - - - Creates the default type of which is a - object. - - - The name must be unique. Repositories cannot be redefined. - An will be thrown if the repository already exists. - - - The name of the repository, this must be unique amongst repositories. - The created for the repository. - The specified repository already exists. - - - - Creates a repository with the specified name and repository type. - - - - CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. - - - The name must be unique. Repositories cannot be redefined. - An will be thrown if the repository already exists. - - - The name of the repository, this must be unique to the repository. - A that implements - and has a no arg constructor. An instance of this type will be created to act - as the for the repository specified. - The created for the repository. - The specified repository already exists. - - - - Creates a repository with the specified name and repository type. - - - - The name must be unique. Repositories cannot be redefined. - An will be thrown if the repository already exists. - - - The name of the repository, this must be unique to the repository. - A that implements - and has a no arg constructor. An instance of this type will be created to act - as the for the repository specified. - The created for the repository. - The specified repository already exists. - - - - Creates a repository for the specified assembly and repository type. - - - - CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. - - - The created will be associated with the repository - specified such that a call to with the - same assembly specified will return the same repository instance. - - - The assembly to use to get the name of the repository. - A that implements - and has a no arg constructor. An instance of this type will be created to act - as the for the repository specified. - The created for the repository. - - - - Creates a repository for the specified assembly and repository type. - - - - The created will be associated with the repository - specified such that a call to with the - same assembly specified will return the same repository instance. - - - The assembly to use to get the name of the repository. - A that implements - and has a no arg constructor. An instance of this type will be created to act - as the for the repository specified. - The created for the repository. - - - - Gets the list of currently defined repositories. - - - - Get an array of all the objects that have been created. - - - An array of all the known objects. - - - - Looks up the wrapper object for the logger specified. - - The logger to get the wrapper for. - The wrapper for the logger specified. - - - - Looks up the wrapper objects for the loggers specified. - - The loggers to get the wrappers for. - The wrapper objects for the loggers specified. - - - - Create the objects used by - this manager. - - The logger to wrap. - The wrapper for the logger specified. - - - - The wrapper map to use to hold the objects. - - - - - Implementation of Mapped Diagnostic Contexts. - - - - - The MDC is deprecated and has been replaced by the . - The current MDC implementation forwards to the ThreadContext.Properties. - - - - The MDC class is similar to the class except that it is - based on a map instead of a stack. It provides mapped - diagnostic contexts. A Mapped Diagnostic Context, or - MDC in short, is an instrument for distinguishing interleaved log - output from different sources. Log output is typically interleaved - when a server handles multiple clients near-simultaneously. - - - The MDC is managed on a per thread basis. - - - - Nicko Cadell - Gert Driesen - - - - Initializes a new instance of the class. - - - Uses a private access modifier to prevent instantiation of this class. - - - - - Gets the context value identified by the parameter. - - The key to lookup in the MDC. - The string value held for the key, or a null reference if no corresponding value is found. - - - - The MDC is deprecated and has been replaced by the . - The current MDC implementation forwards to the ThreadContext.Properties. - - - - If the parameter does not look up to a - previously defined context then null will be returned. - - - - - - Add an entry to the MDC - - The key to store the value under. - The value to store. - - - - The MDC is deprecated and has been replaced by the . - The current MDC implementation forwards to the ThreadContext.Properties. - - - - Puts a context value (the parameter) as identified - with the parameter into the current thread's - context map. - - - If a value is already defined for the - specified then the value will be replaced. If the - is specified as null then the key value mapping will be removed. - - - - - - Removes the key value mapping for the key specified. - - The key to remove. - - - - The MDC is deprecated and has been replaced by the . - The current MDC implementation forwards to the ThreadContext.Properties. - - - - Remove the specified entry from this thread's MDC - - - - - - Clear all entries in the MDC - - - - - The MDC is deprecated and has been replaced by the . - The current MDC implementation forwards to the ThreadContext.Properties. - - - - Remove all the entries from this thread's MDC - - - - - - Implementation of Nested Diagnostic Contexts. - - - - - The NDC is deprecated and has been replaced by the . - The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. - - - - A Nested Diagnostic Context, or NDC in short, is an instrument - to distinguish interleaved log output from different sources. Log - output is typically interleaved when a server handles multiple - clients near-simultaneously. - - - Interleaved log output can still be meaningful if each log entry - from different contexts had a distinctive stamp. This is where NDCs - come into play. - - - Note that NDCs are managed on a per thread basis. The NDC class - is made up of static methods that operate on the context of the - calling thread. - - - How to push a message into the context - - using(NDC.Push("my context message")) - { - ... all log calls will have 'my context message' included ... - - } // at the end of the using block the message is automatically removed - - - - Nicko Cadell - Gert Driesen - - - - Initializes a new instance of the class. - - - Uses a private access modifier to prevent instantiation of this class. - - - - - Clears all the contextual information held on the current thread. - - - - - The NDC is deprecated and has been replaced by the . - The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. - - - - Clears the stack of NDC data held on the current thread. - - - - - - Creates a clone of the stack of context information. - - A clone of the context info for this thread. - - - - The NDC is deprecated and has been replaced by the . - The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. - - - - The results of this method can be passed to the - method to allow child threads to inherit the context of their - parent thread. - - - - - - Inherits the contextual information from another thread. - - The context stack to inherit. - - - - The NDC is deprecated and has been replaced by the . - The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. - - - - This thread will use the context information from the stack - supplied. This can be used to initialize child threads with - the same contextual information as their parent threads. These - contexts will NOT be shared. Any further contexts that - are pushed onto the stack will not be visible to the other. - Call to obtain a stack to pass to - this method. - - - - - - Removes the top context from the stack. - - - The message in the context that was removed from the top - of the stack. - - - - - The NDC is deprecated and has been replaced by the . - The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. - - - - Remove the top context from the stack, and return - it to the caller. If the stack is empty then an - empty string (not null) is returned. - - - - - - Pushes a new context message. - - The new context message. - - An that can be used to clean up - the context stack. - - - - - The NDC is deprecated and has been replaced by the . - The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. - - - - Pushes a new context onto the context stack. An - is returned that can be used to clean up the context stack. This - can be easily combined with the using keyword to scope the - context. - - - Simple example of using the Push method with the using keyword. - - using(log4net.NDC.Push("NDC_Message")) - { - log.Warn("This should have an NDC message"); - } - - - - - - Removes the context information for this thread. It is - not required to call this method. - - - - - The NDC is deprecated and has been replaced by the . - The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. - - - - This method is not implemented. - - - - - - Forces the stack depth to be at most . - - The maximum depth of the stack - - - - The NDC is deprecated and has been replaced by the . - The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. - - - - Forces the stack depth to be at most . - This may truncate the head of the stack. This only affects the - stack in the current thread. Also it does not prevent it from - growing, it only sets the maximum depth at the time of the - call. This can be used to return to a known context depth. - - - - - - Gets the current context depth. - - The current context depth. - - - - The NDC is deprecated and has been replaced by the . - The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. - - - - The number of context values pushed onto the context stack. - - - Used to record the current depth of the context. This can then - be restored using the method. - - - - - - - The log4net Thread Context. - - - - The ThreadContext provides a location for thread specific debugging - information to be stored. - The ThreadContext properties override any - properties with the same name. - - - The thread context has a properties map and a stack. - The properties and stack can - be included in the output of log messages. The - supports selecting and outputting these properties. - - - The Thread Context provides a diagnostic context for the current thread. - This is an instrument for distinguishing interleaved log - output from different sources. Log output is typically interleaved - when a server handles multiple clients near-simultaneously. - - - The Thread Context is managed on a per thread basis. - - - Example of using the thread context properties to store a username. - - ThreadContext.Properties["user"] = userName; - log.Info("This log message has a ThreadContext Property called 'user'"); - - - Example of how to push a message into the context stack - - using(ThreadContext.Stacks["NDC"].Push("my context message")) - { - log.Info("This log message has a ThreadContext Stack message that includes 'my context message'"); - - } // at the end of the using block the message is automatically popped - - - - Nicko Cadell - - - - Private Constructor. - - - - Uses a private access modifier to prevent instantiation of this class. - - - - - - The thread context properties instance - - - - - The thread context stacks instance - - - - - The thread properties map - - - The thread properties map - - - - The ThreadContext properties override any - properties with the same name. - - - - - - The thread stacks - - - stack map - - - - The thread local stacks. - - - - - + + + + log4net + + + + + Appender that logs to a database. + + + + appends logging events to a table within a + database. The appender can be configured to specify the connection + string by setting the property. + The connection type (provider) can be specified by setting the + property. For more information on database connection strings for + your specific database see http://www.connectionstrings.com/. + + + Records are written into the database either using a prepared + statement or a stored procedure. The property + is set to (System.Data.CommandType.Text) to specify a prepared statement + or to (System.Data.CommandType.StoredProcedure) to specify a stored + procedure. + + + The prepared statement text or the name of the stored procedure + must be set in the property. + + + The prepared statement or stored procedure can take a number + of parameters. Parameters are added using the + method. This adds a single to the + ordered list of parameters. The + type may be subclassed if required to provide database specific + functionality. The specifies + the parameter name, database type, size, and how the value should + be generated using a . + + + + An example of a SQL Server table that could be logged to: + + CREATE TABLE [dbo].[Log] ( + [ID] [int] IDENTITY (1, 1) NOT NULL , + [Date] [datetime] NOT NULL , + [Thread] [varchar] (255) NOT NULL , + [Level] [varchar] (20) NOT NULL , + [Logger] [varchar] (255) NOT NULL , + [Message] [varchar] (4000) NOT NULL + ) ON [PRIMARY] + + + + An example configuration to log to the above table: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Julian Biddle + Nicko Cadell + Gert Driesen + Lance Nehring + + + + Abstract base class implementation of that + buffers events in a fixed size buffer. + + + + This base class should be used by appenders that need to buffer a + number of events before logging them. For example the + buffers events and then submits the entire contents of the buffer to + the underlying database in one go. + + + Subclasses should override the + method to deliver the buffered events. + + The BufferingAppenderSkeleton maintains a fixed size cyclic + buffer of events. The size of the buffer is set using + the property. + + A is used to inspect + each event as it arrives in the appender. If the + triggers, then the current buffer is sent immediately + (see ). Otherwise the event + is stored in the buffer. For example, an evaluator can be used to + deliver the events immediately when an ERROR event arrives. + + + The buffering appender can be configured in a mode. + By default the appender is NOT lossy. When the buffer is full all + the buffered events are sent with . + If the property is set to true then the + buffer will not be sent when it is full, and new events arriving + in the appender will overwrite the oldest event in the buffer. + In lossy mode the buffer will only be sent when the + triggers. This can be useful behavior when you need to know about + ERROR events but not about events with a lower level, configure an + evaluator that will trigger when an ERROR event arrives, the whole + buffer will be sent which gives a history of events leading up to + the ERROR event. + + + Nicko Cadell + Gert Driesen + + + + Abstract base class implementation of . + + + + This class provides the code for common functionality, such + as support for threshold filtering and support for general filters. + + + Appenders can also implement the interface. Therefore + they would require that the method + be called after the appenders properties have been configured. + + + Nicko Cadell + Gert Driesen + + + + Implement this interface for your own strategies for printing log statements. + + + + Implementors should consider extending the + class which provides a default implementation of this interface. + + + Appenders can also implement the interface. Therefore + they would require that the method + be called after the appenders properties have been configured. + + + Nicko Cadell + Gert Driesen + + + + Closes the appender and releases resources. + + + + Releases any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + + + + + Log the logging event in Appender specific way. + + The event to log + + + This method is called to log a message into this appender. + + + + + + Gets or sets the name of this appender. + + The name of the appender. + + The name uniquely identifies the appender. + + + + + Interface for appenders that support bulk logging. + + + + This interface extends the interface to + support bulk logging of objects. Appenders + should only implement this interface if they can bulk log efficiently. + + + Nicko Cadell + + + + Log the array of logging events in Appender specific way. + + The events to log + + + This method is called to log an array of events into this appender. + + + + + + Interface used to delay activate a configured object. + + + + This allows an object to defer activation of its options until all + options have been set. This is required for components which have + related options that remain ambiguous until all are set. + + + If a component implements this interface then the method + must be called by the container after its all the configured properties have been set + and before the component can be used. + + + Nicko Cadell + + + + Activate the options that were previously set with calls to properties. + + + + This allows an object to defer activation of its options until all + options have been set. This is required for components which have + related options that remain ambiguous until all are set. + + + If a component implements this interface then this method must be called + after its properties have been set before the component can be used. + + + + + + Initial buffer size + + + + + Maximum buffer size before it is recycled + + + + + Default constructor + + + Empty default constructor + + + + + Finalizes this appender by calling the implementation's + method. + + + + If this appender has not been closed then the Finalize method + will call . + + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Closes the appender and release resources. + + + + Release any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + + This method cannot be overridden by subclasses. This method + delegates the closing of the appender to the + method which must be overridden in the subclass. + + + + + + Performs threshold checks and invokes filters before + delegating actual logging to the subclasses specific + method. + + The event to log. + + + This method cannot be overridden by derived classes. A + derived class should override the method + which is called by this method. + + + The implementation of this method is as follows: + + + + + + Checks that the severity of the + is greater than or equal to the of this + appender. + + + + Checks that the chain accepts the + . + + + + + Calls and checks that + it returns true. + + + + + If all of the above steps succeed then the + will be passed to the abstract method. + + + + + + Performs threshold checks and invokes filters before + delegating actual logging to the subclasses specific + method. + + The array of events to log. + + + This method cannot be overridden by derived classes. A + derived class should override the method + which is called by this method. + + + The implementation of this method is as follows: + + + + + + Checks that the severity of the + is greater than or equal to the of this + appender. + + + + Checks that the chain accepts the + . + + + + + Calls and checks that + it returns true. + + + + + If all of the above steps succeed then the + will be passed to the method. + + + + + + Test if the logging event should we output by this appender + + the event to test + true if the event should be output, false if the event should be ignored + + + This method checks the logging event against the threshold level set + on this appender and also against the filters specified on this + appender. + + + The implementation of this method is as follows: + + + + + + Checks that the severity of the + is greater than or equal to the of this + appender. + + + + Checks that the chain accepts the + . + + + + + + + + + Adds a filter to the end of the filter chain. + + the filter to add to this appender + + + The Filters are organized in a linked list. + + + Setting this property causes the new filter to be pushed onto the + back of the filter chain. + + + + + + Clears the filter list for this appender. + + + + Clears the filter list for this appender. + + + + + + Checks if the message level is below this appender's threshold. + + to test against. + + + If there is no threshold set, then the return value is always true. + + + + true if the meets the + requirements of this appender. + + + + + Is called when the appender is closed. Derived classes should override + this method if resources need to be released. + + + + Releases any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + + + + + Subclasses of should implement this method + to perform actual logging. + + The event to append. + + + A subclass must implement this method to perform + logging of the . + + This method will be called by + if all the conditions listed for that method are met. + + + To restrict the logging of events in the appender + override the method. + + + + + + Append a bulk array of logging events. + + the array of logging events + + + This base class implementation calls the + method for each element in the bulk array. + + + A sub class that can better process a bulk array of events should + override this method in addition to . + + + + + + Called before as a precondition. + + + + This method is called by + before the call to the abstract method. + + + This method can be overridden in a subclass to extend the checks + made before the event is passed to the method. + + + A subclass should ensure that they delegate this call to + this base class if it is overridden. + + + true if the call to should proceed. + + + + Renders the to a string. + + The event to render. + The event rendered as a string. + + + Helper method to render a to + a string. This appender must have a + set to render the to + a string. + + If there is exception data in the logging event and + the layout does not process the exception, this method + will append the exception text to the rendered string. + + + Where possible use the alternative version of this method + . + That method streams the rendering onto an existing Writer + which can give better performance if the caller already has + a open and ready for writing. + + + + + + Renders the to a string. + + The event to render. + The TextWriter to write the formatted event to + + + Helper method to render a to + a string. This appender must have a + set to render the to + a string. + + If there is exception data in the logging event and + the layout does not process the exception, this method + will append the exception text to the rendered string. + + + Use this method in preference to + where possible. If, however, the caller needs to render the event + to a string then does + provide an efficient mechanism for doing so. + + + + + + The layout of this appender. + + + See for more information. + + + + + The name of this appender. + + + See for more information. + + + + + The level threshold of this appender. + + + + There is no level threshold filtering by default. + + + See for more information. + + + + + + It is assumed and enforced that errorHandler is never null. + + + + It is assumed and enforced that errorHandler is never null. + + + See for more information. + + + + + + The first filter in the filter chain. + + + + Set to null initially. + + + See for more information. + + + + + + The last filter in the filter chain. + + + See for more information. + + + + + Flag indicating if this appender is closed. + + + See for more information. + + + + + The guard prevents an appender from repeatedly calling its own DoAppend method + + + + + StringWriter used to render events + + + + + The fully qualified type of the AppenderSkeleton class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the threshold of this appender. + + + The threshold of the appender. + + + + All log events with lower level than the threshold level are ignored + by the appender. + + + In configuration files this option is specified by setting the + value of the option to a level + string, such as "DEBUG", "INFO" and so on. + + + + + + Gets or sets the for this appender. + + The of the appender + + + The provides a default + implementation for the property. + + + + + + The filter chain. + + The head of the filter chain filter chain. + + + Returns the head Filter. The Filters are organized in a linked list + and so all Filters on this Appender are available through the result. + + + + + + Gets or sets the for this appender. + + The layout of the appender. + + + See for more information. + + + + + + + Gets or sets the name of this appender. + + The name of the appender. + + + The name uniquely identifies the appender. + + + + + + Tests if this appender requires a to be set. + + + + In the rather exceptional case, where the appender + implementation admits a layout but can also work without it, + then the appender should return true. + + + This default implementation always returns false. + + + + true if the appender requires a layout object, otherwise false. + + + + + The default buffer size. + + + The default size of the cyclic buffer used to store events. + This is set to 512 by default. + + + + + Initializes a new instance of the class. + + + + Protected default constructor to allow subclassing. + + + + + + Initializes a new instance of the class. + + the events passed through this appender must be + fixed by the time that they arrive in the derived class' SendBuffer method. + + + Protected constructor to allow subclassing. + + + The should be set if the subclass + expects the events delivered to be fixed even if the + is set to zero, i.e. when no buffering occurs. + + + + + + Flush the currently buffered events + + + + Flushes any events that have been buffered. + + + If the appender is buffering in mode then the contents + of the buffer will NOT be flushed to the appender. + + + + + + Flush the currently buffered events + + set to true to flush the buffer of lossy events + + + Flushes events that have been buffered. If is + false then events will only be flushed if this buffer is non-lossy mode. + + + If the appender is buffering in mode then the contents + of the buffer will only be flushed if is true. + In this case the contents of the buffer will be tested against the + and if triggering will be output. All other buffered + events will be discarded. + + + If is true then the buffer will always + be emptied by calling this method. + + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Close this appender instance. + + + + Close this appender instance. If this appender is marked + as not then the remaining events in + the buffer must be sent when the appender is closed. + + + + + + This method is called by the method. + + the event to log + + + Stores the in the cyclic buffer. + + + The buffer will be sent (i.e. passed to the + method) if one of the following conditions is met: + + + + The cyclic buffer is full and this appender is + marked as not lossy (see ) + + + An is set and + it is triggered for the + specified. + + + + Before the event is stored in the buffer it is fixed + (see ) to ensure that + any data referenced by the event will be valid when the buffer + is processed. + + + + + + Sends the contents of the buffer. + + The first logging event. + The buffer containing the events that need to be send. + + + The subclass must override . + + + + + + Sends the events. + + The events that need to be send. + + + The subclass must override this method to process the buffered events. + + + + + + The size of the cyclic buffer used to hold the logging events. + + + Set to by default. + + + + + The cyclic buffer used to store the logging events. + + + + + The triggering event evaluator that causes the buffer to be sent immediately. + + + The object that is used to determine if an event causes the entire + buffer to be sent immediately. This field can be null, which + indicates that event triggering is not to be done. The evaluator + can be set using the property. If this appender + has the ( property) set to + true then an must be set. + + + + + Indicates if the appender should overwrite events in the cyclic buffer + when it becomes full, or if the buffer should be flushed when the + buffer is full. + + + If this field is set to true then an must + be set. + + + + + The triggering event evaluator filters discarded events. + + + The object that is used to determine if an event that is discarded should + really be discarded or if it should be sent to the appenders. + This field can be null, which indicates that all discarded events will + be discarded. + + + + + Value indicating which fields in the event should be fixed + + + By default all fields are fixed + + + + + The events delivered to the subclass must be fixed. + + + + + Gets or sets a value that indicates whether the appender is lossy. + + + true if the appender is lossy, otherwise false. The default is false. + + + + This appender uses a buffer to store logging events before + delivering them. A triggering event causes the whole buffer + to be send to the remote sink. If the buffer overruns before + a triggering event then logging events could be lost. Set + to false to prevent logging events + from being lost. + + If is set to true then an + must be specified. + + + + + Gets or sets the size of the cyclic buffer used to hold the + logging events. + + + The size of the cyclic buffer used to hold the logging events. + + + + The option takes a positive integer + representing the maximum number of logging events to collect in + a cyclic buffer. When the is reached, + oldest events are deleted as new events are added to the + buffer. By default the size of the cyclic buffer is 512 events. + + + If the is set to a value less than + or equal to 1 then no buffering will occur. The logging event + will be delivered synchronously (depending on the + and properties). Otherwise the event will + be buffered. + + + + + + Gets or sets the that causes the + buffer to be sent immediately. + + + The that causes the buffer to be + sent immediately. + + + + The evaluator will be called for each event that is appended to this + appender. If the evaluator triggers then the current buffer will + immediately be sent (see ). + + If is set to true then an + must be specified. + + + + + Gets or sets the value of the to use. + + + The value of the to use. + + + + The evaluator will be called for each event that is discarded from this + appender. If the evaluator triggers then the current buffer will immediately + be sent (see ). + + + + + + Gets or sets a value indicating if only part of the logging event data + should be fixed. + + + true if the appender should only fix part of the logging event + data, otherwise false. The default is false. + + + + Setting this property to true will cause only part of the + event data to be fixed and serialized. This will improve performance. + + + See for more information. + + + + + + Gets or sets a the fields that will be fixed in the event + + + The event fields that will be fixed before the event is buffered + + + + The logging event needs to have certain thread specific values + captured before it can be buffered. See + for details. + + + + + + + Initializes a new instance of the class. + + + Public default constructor to initialize a new instance of this class. + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Override the parent method to close the database + + + + Closes the database command and database connection. + + + + + + Inserts the events into the database. + + The events to insert into the database. + + + Insert all the events specified in the + array into the database. + + + + + + Adds a parameter to the command. + + The parameter to add to the command. + + + Adds a parameter to the ordered list of command parameters. + + + + + + Writes the events to the database using the transaction specified. + + The transaction that the events will be executed under. + The array of events to insert into the database. + + + The transaction argument can be null if the appender has been + configured not to use transactions. See + property for more information. + + + + + + Formats the log message into database statement text. + + The event being logged. + + This method can be overridden by subclasses to provide + more control over the format of the database statement. + + + Text that can be passed to a . + + + + + Creates an instance used to connect to the database. + + + This method is called whenever a new IDbConnection is needed (i.e. when a reconnect is necessary). + + The of the object. + The connectionString output from the ResolveConnectionString method. + An instance with a valid connection string. + + + + Resolves the connection string from the ConnectionString, ConnectionStringName, or AppSettingsKey + property. + + + ConnectiongStringName is only supported on .NET 2.0 and higher. + + Additional information describing the connection string. + A connection string used to connect to the database. + + + + Retrieves the class type of the ADO.NET provider. + + + + Gets the Type of the ADO.NET provider to use to connect to the + database. This method resolves the type specified in the + property. + + + Subclasses can override this method to return a different type + if necessary. + + + The of the ADO.NET provider + + + + Prepares the database command and initialize the parameters. + + + + + Connects to the database. + + + + + Cleanup the existing command. + + + If true, a message will be written using LogLog.Warn if an exception is encountered when calling Dispose. + + + + + Cleanup the existing connection. + + + Calls the IDbConnection's method. + + + + + Flag to indicate if we are using a command object + + + + Set to true when the appender is to use a prepared + statement or stored procedure to insert into the database. + + + + + + The list of objects. + + + + The list of objects. + + + + + + The security context to use for privileged calls + + + + + The that will be used + to insert logging events into a database. + + + + + The database command. + + + + + Database connection string. + + + + + The appSettings key from App.Config that contains the connection string. + + + + + The connectionStrings key from App.Config that contains the connection string. + + + + + String type name of the type name. + + + + + The text of the command. + + + + + The command type. + + + + + Indicates whether to use transactions when writing to the database. + + + + + Indicates whether to use transactions when writing to the database. + + + + + The fully qualified type of the AdoNetAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the database connection string that is used to connect to + the database. + + + The database connection string used to connect to the database. + + + + The connections string is specific to the connection type. + See for more information. + + + Connection string for MS Access via ODBC: + "DSN=MS Access Database;UID=admin;PWD=;SystemDB=C:\data\System.mdw;SafeTransactions = 0;FIL=MS Access;DriverID = 25;DBQ=C:\data\train33.mdb" + + Another connection string for MS Access via ODBC: + "Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\Work\cvs_root\log4net-1.2\access.mdb;UID=;PWD=;" + + Connection string for MS Access via OLE DB: + "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Work\cvs_root\log4net-1.2\access.mdb;User Id=;Password=;" + + + + + The appSettings key from App.Config that contains the connection string. + + + + + The connectionStrings key from App.Config that contains the connection string. + + + This property requires at least .NET 2.0. + + + + + Gets or sets the type name of the connection + that should be created. + + + The type name of the connection. + + + + The type name of the ADO.NET provider to use. + + + The default is to use the OLE DB provider. + + + Use the OLE DB Provider. This is the default value. + System.Data.OleDb.OleDbConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Use the MS SQL Server Provider. + System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Use the ODBC Provider. + Microsoft.Data.Odbc.OdbcConnection,Microsoft.Data.Odbc,version=1.0.3300.0,publicKeyToken=b77a5c561934e089,culture=neutral + This is an optional package that you can download from + http://msdn.microsoft.com/downloads + search for ODBC .NET Data Provider. + + Use the Oracle Provider. + System.Data.OracleClient.OracleConnection, System.Data.OracleClient, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + This is an optional package that you can download from + http://msdn.microsoft.com/downloads + search for .NET Managed Provider for Oracle. + + + + + Gets or sets the command text that is used to insert logging events + into the database. + + + The command text used to insert logging events into the database. + + + + Either the text of the prepared statement or the + name of the stored procedure to execute to write into + the database. + + + The property determines if + this text is a prepared statement or a stored procedure. + + + + + + Gets or sets the command type to execute. + + + The command type to execute. + + + + This value may be either (System.Data.CommandType.Text) to specify + that the is a prepared statement to execute, + or (System.Data.CommandType.StoredProcedure) to specify that the + property is the name of a stored procedure + to execute. + + + The default value is (System.Data.CommandType.Text). + + + + + + Should transactions be used to insert logging events in the database. + + + true if transactions should be used to insert logging events in + the database, otherwise false. The default value is true. + + + + Gets or sets a value that indicates whether transactions should be used + to insert logging events in the database. + + + When set a single transaction will be used to insert the buffered events + into the database. Otherwise each event will be inserted without using + an explicit transaction. + + + + + + Gets or sets the used to call the NetSend method. + + + The used to call the NetSend method. + + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + + + + + + Should this appender try to reconnect to the database on error. + + + true if the appender should try to reconnect to the database after an + error has occurred, otherwise false. The default value is false, + i.e. not to try to reconnect. + + + + The default behaviour is for the appender not to try to reconnect to the + database if an error occurs. Subsequent logging events are discarded. + + + To force the appender to attempt to reconnect to the database set this + property to true. + + + When the appender attempts to connect to the database there may be a + delay of up to the connection timeout specified in the connection string. + This delay will block the calling application's thread. + Until the connection can be reestablished this potential delay may occur multiple times. + + + + + + Gets or sets the underlying . + + + The underlying . + + + creates a to insert + logging events into a database. Classes deriving from + can use this property to get or set this . Use the + underlying returned from if + you require access beyond that which provides. + + + + + Parameter type used by the . + + + + This class provides the basic database parameter properties + as defined by the interface. + + This type can be subclassed to provide database specific + functionality. The two methods that are called externally are + and . + + + + + + Initializes a new instance of the class. + + + Default constructor for the AdoNetAppenderParameter class. + + + + + Prepare the specified database command object. + + The command to prepare. + + + Prepares the database command object by adding + this parameter to its collection of parameters. + + + + + + Renders the logging event and set the parameter value in the command. + + The command containing the parameter. + The event to be rendered. + + + Renders the logging event using this parameters layout + object. Sets the value of the parameter on the command object. + + + + + + The name of this parameter. + + + + + The database type for this parameter. + + + + + Flag to infer type rather than use the DbType + + + + + The precision for this parameter. + + + + + The scale for this parameter. + + + + + The size for this parameter. + + + + + The to use to render the + logging event into an object for this parameter. + + + + + Gets or sets the name of this parameter. + + + The name of this parameter. + + + + The name of this parameter. The parameter name + must match up to a named parameter to the SQL stored procedure + or prepared statement. + + + + + + Gets or sets the database type for this parameter. + + + The database type for this parameter. + + + + The database type for this parameter. This property should + be set to the database type from the + enumeration. See . + + + This property is optional. If not specified the ADO.NET provider + will attempt to infer the type from the value. + + + + + + + Gets or sets the precision for this parameter. + + + The precision for this parameter. + + + + The maximum number of digits used to represent the Value. + + + This property is optional. If not specified the ADO.NET provider + will attempt to infer the precision from the value. + + + + + + + Gets or sets the scale for this parameter. + + + The scale for this parameter. + + + + The number of decimal places to which Value is resolved. + + + This property is optional. If not specified the ADO.NET provider + will attempt to infer the scale from the value. + + + + + + + Gets or sets the size for this parameter. + + + The size for this parameter. + + + + The maximum size, in bytes, of the data within the column. + + + This property is optional. If not specified the ADO.NET provider + will attempt to infer the size from the value. + + + For BLOB data types like VARCHAR(max) it may be impossible to infer the value automatically, use -1 as the size in this case. + + + + + + + Gets or sets the to use to + render the logging event into an object for this + parameter. + + + The used to render the + logging event into an object for this parameter. + + + + The that renders the value for this + parameter. + + + The can be used to adapt + any into a + for use in the property. + + + + + + Appends logging events to the terminal using ANSI color escape sequences. + + + + AnsiColorTerminalAppender appends log events to the standard output stream + or the error output stream using a layout specified by the + user. It also allows the color of a specific level of message to be set. + + + This appender expects the terminal to understand the VT100 control set + in order to interpret the color codes. If the terminal or console does not + understand the control codes the behavior is not defined. + + + By default, all output is written to the console's standard output stream. + The property can be set to direct the output to the + error stream. + + + NOTE: This appender writes each message to the System.Console.Out or + System.Console.Error that is set at the time the event is appended. + Therefore it is possible to programmatically redirect the output of this appender + (for example NUnit does this to capture program output). While this is the desired + behavior of this appender it may have security implications in your application. + + + When configuring the ANSI colored terminal appender, a mapping should be + specified to map a logging level to a color. For example: + + + + + + + + + + + + + + + The Level is the standard log4net logging level and ForeColor and BackColor can be any + of the following values: + + Blue + Green + Red + White + Yellow + Purple + Cyan + + These color values cannot be combined together to make new colors. + + + The attributes can be any combination of the following: + + Brightforeground is brighter + Dimforeground is dimmer + Underscoremessage is underlined + Blinkforeground is blinking (does not work on all terminals) + Reverseforeground and background are reversed + Hiddenoutput is hidden + Strikethroughmessage has a line through it + + While any of these attributes may be combined together not all combinations + work well together, for example setting both Bright and Dim attributes makes + no sense. + + + Patrick Wagstrom + Nicko Cadell + + + + The to use when writing to the Console + standard output stream. + + + + The to use when writing to the Console + standard output stream. + + + + + + The to use when writing to the Console + standard error output stream. + + + + The to use when writing to the Console + standard error output stream. + + + + + + Ansi code to reset terminal + + + + + Initializes a new instance of the class. + + + The instance of the class is set up to write + to the standard output stream. + + + + + Add a mapping of level to color + + The mapping to add + + + Add a mapping to this appender. + Each mapping defines the foreground and background colours + for a level. + + + + + + This method is called by the method. + + The event to log. + + + Writes the event to the console. + + + The format of the output will depend on the appender's layout. + + + + + + Initialize the options for this appender + + + + Initialize the level to color mappings set on this appender. + + + + + + Flag to write output to the error stream rather than the standard output stream + + + + + Mapping from level object to color value + + + + + Target is the value of the console output stream. + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + The enum of possible display attributes + + + + The following flags can be combined together to + form the ANSI color attributes. + + + + + + + text is bright + + + + + text is dim + + + + + text is underlined + + + + + text is blinking + + + Not all terminals support this attribute + + + + + text and background colors are reversed + + + + + text is hidden + + + + + text is displayed with a strikethrough + + + + + text color is light + + + + + The enum of possible foreground or background color values for + use with the color mapping method + + + + The output can be in one for the following ANSI colors. + + + + + + + color is black + + + + + color is red + + + + + color is green + + + + + color is yellow + + + + + color is blue + + + + + color is magenta + + + + + color is cyan + + + + + color is white + + + + + A class to act as a mapping between the level that a logging call is made at and + the color it should be displayed as. + + + + Defines the mapping between a level and the color it should be displayed in. + + + + + + An entry in the + + + + This is an abstract base class for types that are stored in the + object. + + + Nicko Cadell + + + + Default protected constructor + + + + Default protected constructor + + + + + + Initialize any options defined on this entry + + + + Should be overridden by any classes that need to initialise based on their options + + + + + + The level that is the key for this mapping + + + The that is the key for this mapping + + + + Get or set the that is the key for this + mapping subclass. + + + + + + Initialize the options for the object + + + + Combine the and together + and append the attributes. + + + + + + The mapped foreground color for the specified level + + + + Required property. + The mapped foreground color for the specified level + + + + + + The mapped background color for the specified level + + + + Required property. + The mapped background color for the specified level + + + + + + The color attributes for the specified level + + + + Required property. + The color attributes for the specified level + + + + + + The combined , and + suitable for setting the ansi terminal color. + + + + + A strongly-typed collection of objects. + + Nicko Cadell + + + + Creates a read-only wrapper for a AppenderCollection instance. + + list to create a readonly wrapper arround + + An AppenderCollection wrapper that is read-only. + + + + + An empty readonly static AppenderCollection + + + + + Initializes a new instance of the AppenderCollection class + that is empty and has the default initial capacity. + + + + + Initializes a new instance of the AppenderCollection class + that has the specified initial capacity. + + + The number of elements that the new AppenderCollection is initially capable of storing. + + + + + Initializes a new instance of the AppenderCollection class + that contains elements copied from the specified AppenderCollection. + + The AppenderCollection whose elements are copied to the new collection. + + + + Initializes a new instance of the AppenderCollection class + that contains elements copied from the specified array. + + The array whose elements are copied to the new list. + + + + Initializes a new instance of the AppenderCollection class + that contains elements copied from the specified collection. + + The collection whose elements are copied to the new list. + + + + Allow subclasses to avoid our default constructors + + + + + + + Copies the entire AppenderCollection to a one-dimensional + array. + + The one-dimensional array to copy to. + + + + Copies the entire AppenderCollection to a one-dimensional + array, starting at the specified index of the target array. + + The one-dimensional array to copy to. + The zero-based index in at which copying begins. + + + + Adds a to the end of the AppenderCollection. + + The to be added to the end of the AppenderCollection. + The index at which the value has been added. + + + + Removes all elements from the AppenderCollection. + + + + + Creates a shallow copy of the . + + A new with a shallow copy of the collection data. + + + + Determines whether a given is in the AppenderCollection. + + The to check for. + true if is found in the AppenderCollection; otherwise, false. + + + + Returns the zero-based index of the first occurrence of a + in the AppenderCollection. + + The to locate in the AppenderCollection. + + The zero-based index of the first occurrence of + in the entire AppenderCollection, if found; otherwise, -1. + + + + + Inserts an element into the AppenderCollection at the specified index. + + The zero-based index at which should be inserted. + The to insert. + + is less than zero + -or- + is equal to or greater than . + + + + + Removes the first occurrence of a specific from the AppenderCollection. + + The to remove from the AppenderCollection. + + The specified was not found in the AppenderCollection. + + + + + Removes the element at the specified index of the AppenderCollection. + + The zero-based index of the element to remove. + + is less than zero + -or- + is equal to or greater than . + + + + + Returns an enumerator that can iterate through the AppenderCollection. + + An for the entire AppenderCollection. + + + + Adds the elements of another AppenderCollection to the current AppenderCollection. + + The AppenderCollection whose elements should be added to the end of the current AppenderCollection. + The new of the AppenderCollection. + + + + Adds the elements of a array to the current AppenderCollection. + + The array whose elements should be added to the end of the AppenderCollection. + The new of the AppenderCollection. + + + + Adds the elements of a collection to the current AppenderCollection. + + The collection whose elements should be added to the end of the AppenderCollection. + The new of the AppenderCollection. + + + + Sets the capacity to the actual number of elements. + + + + + Return the collection elements as an array + + the array + + + + is less than zero + -or- + is equal to or greater than . + + + + + is less than zero + -or- + is equal to or greater than . + + + + + Gets the number of elements actually contained in the AppenderCollection. + + + + + Gets a value indicating whether access to the collection is synchronized (thread-safe). + + true if access to the ICollection is synchronized (thread-safe); otherwise, false. + + + + Gets an object that can be used to synchronize access to the collection. + + + + + Gets or sets the at the specified index. + + The zero-based index of the element to get or set. + + is less than zero + -or- + is equal to or greater than . + + + + + Gets a value indicating whether the collection has a fixed size. + + true if the collection has a fixed size; otherwise, false. The default is false + + + + Gets a value indicating whether the IList is read-only. + + true if the collection is read-only; otherwise, false. The default is false + + + + Gets or sets the number of elements the AppenderCollection can contain. + + + + + Supports type-safe iteration over a . + + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + + + Type visible only to our subclasses + Used to access protected constructor + + + + + + A value + + + + + Supports simple iteration over a . + + + + + + Initializes a new instance of the Enumerator class. + + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + + + + + + + Appends log events to the ASP.NET system. + + + + + Diagnostic information and tracing messages that you specify are appended to the output + of the page that is sent to the requesting browser. Optionally, you can view this information + from a separate trace viewer (Trace.axd) that displays trace information for every page in a + given application. + + + Trace statements are processed and displayed only when tracing is enabled. You can control + whether tracing is displayed to a page, to the trace viewer, or both. + + + The logging event is passed to the or + method depending on the level of the logging event. + The event's logger name is the default value for the category parameter of the Write/Warn method. + + + Nicko Cadell + Gert Driesen + Ron Grabowski + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Write the logging event to the ASP.NET trace + + the event to log + + + Write the logging event to the ASP.NET trace + HttpContext.Current.Trace + (). + + + + + + Defaults to %logger + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + The category parameter sent to the Trace method. + + + + Defaults to %logger which will use the logger name of the current + as the category parameter. + + + + + + + + Buffers events and then forwards them to attached appenders. + + + + The events are buffered in this appender until conditions are + met to allow the appender to deliver the events to the attached + appenders. See for the + conditions that cause the buffer to be sent. + + The forwarding appender can be used to specify different + thresholds and filters for the same appender at different locations + within the hierarchy. + + + Nicko Cadell + Gert Driesen + + + + Interface for attaching appenders to objects. + + + + Interface for attaching, removing and retrieving appenders. + + + Nicko Cadell + Gert Driesen + + + + Attaches an appender. + + The appender to add. + + + Add the specified appender. The implementation may + choose to allow or deny duplicate appenders. + + + + + + Gets an attached appender with the specified name. + + The name of the appender to get. + + The appender with the name specified, or null if no appender with the + specified name is found. + + + + Returns an attached appender with the specified. + If no appender with the specified name is found null will be + returned. + + + + + + Removes all attached appenders. + + + + Removes and closes all attached appenders + + + + + + Removes the specified appender from the list of attached appenders. + + The appender to remove. + The appender removed from the list + + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + Removes the appender with the specified name from the list of appenders. + + The name of the appender to remove. + The appender removed from the list + + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + Gets all attached appenders. + + + A collection of attached appenders. + + + + Gets a collection of attached appenders. + If there are no attached appenders the + implementation should return an empty + collection rather than null. + + + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Closes the appender and releases resources. + + + + Releases any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + + + + + Send the events. + + The events that need to be send. + + + Forwards the events to the attached appenders. + + + + + + Adds an to the list of appenders of this + instance. + + The to add to this appender. + + + If the specified is already in the list of + appenders, then it won't be added again. + + + + + + Looks for the appender with the specified name. + + The name of the appender to lookup. + + The appender with the specified name, or null. + + + + Get the named appender attached to this buffering appender. + + + + + + Removes all previously added appenders from this appender. + + + + This is useful when re-reading configuration information. + + + + + + Removes the specified appender from the list of appenders. + + The appender to remove. + The appender removed from the list + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + Removes the appender with the specified name from the list of appenders. + + The name of the appender to remove. + The appender removed from the list + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + Implementation of the interface + + + + + Gets the appenders contained in this appender as an + . + + + If no appenders can be found, then an + is returned. + + + A collection of the appenders in this appender. + + + + + Appends logging events to the console. + + + + ColoredConsoleAppender appends log events to the standard output stream + or the error output stream using a layout specified by the + user. It also allows the color of a specific type of message to be set. + + + By default, all output is written to the console's standard output stream. + The property can be set to direct the output to the + error stream. + + + NOTE: This appender writes directly to the application's attached console + not to the System.Console.Out or System.Console.Error TextWriter. + The System.Console.Out and System.Console.Error streams can be + programmatically redirected (for example NUnit does this to capture program output). + This appender will ignore these redirections because it needs to use Win32 + API calls to colorize the output. To respect these redirections the + must be used. + + + When configuring the colored console appender, mapping should be + specified to map a logging level to a color. For example: + + + + + + + + + + + + + + The Level is the standard log4net logging level and ForeColor and BackColor can be any + combination of the following values: + + Blue + Green + Red + White + Yellow + Purple + Cyan + HighIntensity + + + + Rick Hobbs + Nicko Cadell + + + + The to use when writing to the Console + standard output stream. + + + + The to use when writing to the Console + standard output stream. + + + + + + The to use when writing to the Console + standard error output stream. + + + + The to use when writing to the Console + standard error output stream. + + + + + + Initializes a new instance of the class. + + + The instance of the class is set up to write + to the standard output stream. + + + + + Initializes a new instance of the class + with the specified layout. + + the layout to use for this appender + + The instance of the class is set up to write + to the standard output stream. + + + + + Initializes a new instance of the class + with the specified layout. + + the layout to use for this appender + flag set to true to write to the console error stream + + When is set to true, output is written to + the standard error output stream. Otherwise, output is written to the standard + output stream. + + + + + Add a mapping of level to color - done by the config file + + The mapping to add + + + Add a mapping to this appender. + Each mapping defines the foreground and background colors + for a level. + + + + + + This method is called by the method. + + The event to log. + + + Writes the event to the console. + + + The format of the output will depend on the appender's layout. + + + + + + Initialize the options for this appender + + + + Initialize the level to color mappings set on this appender. + + + + + + Flag to write output to the error stream rather than the standard output stream + + + + + Mapping from level object to color value + + + + + The console output stream writer to write to + + + + This writer is not thread safe. + + + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + The enum of possible color values for use with the color mapping method + + + + The following flags can be combined together to + form the colors. + + + + + + + color is blue + + + + + color is green + + + + + color is red + + + + + color is white + + + + + color is yellow + + + + + color is purple + + + + + color is cyan + + + + + color is intensified + + + + + A class to act as a mapping between the level that a logging call is made at and + the color it should be displayed as. + + + + Defines the mapping between a level and the color it should be displayed in. + + + + + + Initialize the options for the object + + + + Combine the and together. + + + + + + The mapped foreground color for the specified level + + + + Required property. + The mapped foreground color for the specified level. + + + + + + The mapped background color for the specified level + + + + Required property. + The mapped background color for the specified level. + + + + + + The combined and suitable for + setting the console color. + + + + + Appends logging events to the console. + + + + ConsoleAppender appends log events to the standard output stream + or the error output stream using a layout specified by the + user. + + + By default, all output is written to the console's standard output stream. + The property can be set to direct the output to the + error stream. + + + NOTE: This appender writes each message to the System.Console.Out or + System.Console.Error that is set at the time the event is appended. + Therefore it is possible to programmatically redirect the output of this appender + (for example NUnit does this to capture program output). While this is the desired + behavior of this appender it may have security implications in your application. + + + Nicko Cadell + Gert Driesen + + + + The to use when writing to the Console + standard output stream. + + + + The to use when writing to the Console + standard output stream. + + + + + + The to use when writing to the Console + standard error output stream. + + + + The to use when writing to the Console + standard error output stream. + + + + + + Initializes a new instance of the class. + + + The instance of the class is set up to write + to the standard output stream. + + + + + Initializes a new instance of the class + with the specified layout. + + the layout to use for this appender + + The instance of the class is set up to write + to the standard output stream. + + + + + Initializes a new instance of the class + with the specified layout. + + the layout to use for this appender + flag set to true to write to the console error stream + + When is set to true, output is written to + the standard error output stream. Otherwise, output is written to the standard + output stream. + + + + + This method is called by the method. + + The event to log. + + + Writes the event to the console. + + + The format of the output will depend on the appender's layout. + + + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Appends log events to the system. + + + + The application configuration file can be used to control what listeners + are actually used. See the MSDN documentation for the + class for details on configuring the + debug system. + + + Events are written using the + method. The event's logger name is passed as the value for the category name to the Write method. + + + Nicko Cadell + + + + Initializes a new instance of the . + + + + Default constructor. + + + + + + Initializes a new instance of the + with a specified layout. + + The layout to use with this appender. + + + Obsolete constructor. + + + + + + Writes the logging event to the system. + + The event to log. + + + Writes the logging event to the system. + If is true then the + is called. + + + + + + Immediate flush means that the underlying writer or output stream + will be flushed at the end of each append operation. + + + + Immediate flush is slower but ensures that each append request is + actually written. If is set to + false, then there is a good chance that the last few + logs events are not actually written to persistent media if and + when the application crashes. + + + The default value is true. + + + + + Gets or sets a value that indicates whether the appender will + flush at the end of each write. + + + The default behavior is to flush at the end of each + write. If the option is set tofalse, then the underlying + stream can defer writing to physical medium to a later time. + + + Avoiding the flush operation at the end of each append results + in a performance gain of 10 to 20 percent. However, there is safety + trade-off involved in skipping flushing. Indeed, when flushing is + skipped, then it is likely that the last few log events will not + be recorded on disk when the application exits. This is a high + price to pay even for a 20% performance gain. + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Writes events to the system event log. + + + + The appender will fail if you try to write using an event source that doesn't exist unless it is running with local administrator privileges. + See also http://logging.apache.org/log4net/release/faq.html#trouble-EventLog + + + The EventID of the event log entry can be + set using the EventID property () + on the . + + + The Category of the event log entry can be + set using the Category property () + on the . + + + There is a limit of 32K characters for an event log message + + + When configuring the EventLogAppender a mapping can be + specified to map a logging level to an event log entry type. For example: + + + <mapping> + <level value="ERROR" /> + <eventLogEntryType value="Error" /> + </mapping> + <mapping> + <level value="DEBUG" /> + <eventLogEntryType value="Information" /> + </mapping> + + + The Level is the standard log4net logging level and eventLogEntryType can be any value + from the enum, i.e.: + + Erroran error event + Warninga warning event + Informationan informational event + + + + Aspi Havewala + Douglas de la Torre + Nicko Cadell + Gert Driesen + Thomas Voss + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Initializes a new instance of the class + with the specified . + + The to use with this appender. + + + Obsolete constructor. + + + + + + Add a mapping of level to - done by the config file + + The mapping to add + + + Add a mapping to this appender. + Each mapping defines the event log entry type for a level. + + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Create an event log source + + + Uses different API calls under NET_2_0 + + + + + This method is called by the + method. + + the event to log + + Writes the event to the system event log using the + . + + If the event has an EventID property (see ) + set then this integer will be used as the event log event id. + + + There is a limit of 32K characters for an event log message + + + + + + Get the equivalent for a + + the Level to convert to an EventLogEntryType + The equivalent for a + + Because there are fewer applicable + values to use in logging levels than there are in the + this is a one way mapping. There is + a loss of information during the conversion. + + + + + The log name is the section in the event logs where the messages + are stored. + + + + + Name of the application to use when logging. This appears in the + application column of the event log named by . + + + + + The name of the machine which holds the event log. This is + currently only allowed to be '.' i.e. the current machine. + + + + + Mapping from level object to EventLogEntryType + + + + + The security context to use for privileged calls + + + + + The event ID to use unless one is explicitly specified via the LoggingEvent's properties. + + + + + The event category to use unless one is explicitly specified via the LoggingEvent's properties. + + + + + The fully qualified type of the EventLogAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + The maximum size supported by default. + + + http://msdn.microsoft.com/en-us/library/xzwc042w(v=vs.100).aspx + The 32766 documented max size is two bytes shy of 32K (I'm assuming 32766 + may leave space for a two byte null terminator of #0#0). The 32766 max + length is what the .NET 4.0 source code checks for, but this is WRONG! + Strings with a length > 31839 on Windows Vista or higher can CORRUPT + the event log! See: System.Diagnostics.EventLogInternal.InternalWriteEvent() + for the use of the 32766 max size. + + + + + The maximum size supported by a windows operating system that is vista + or newer. + + + See ReportEvent API: + http://msdn.microsoft.com/en-us/library/aa363679(VS.85).aspx + ReportEvent's lpStrings parameter: + "A pointer to a buffer containing an array of + null-terminated strings that are merged into the message before Event Viewer + displays the string to the user. This parameter must be a valid pointer + (or NULL), even if wNumStrings is zero. Each string is limited to 31,839 characters." + + Going beyond the size of 31839 will (at some point) corrupt the event log on Windows + Vista or higher! It may succeed for a while...but you will eventually run into the + error: "System.ComponentModel.Win32Exception : A device attached to the system is + not functioning", and the event log will then be corrupt (I was able to corrupt + an event log using a length of 31877 on Windows 7). + + The max size for Windows Vista or higher is documented here: + http://msdn.microsoft.com/en-us/library/xzwc042w(v=vs.100).aspx. + Going over this size may succeed a few times but the buffer will overrun and + eventually corrupt the log (based on testing). + + The maxEventMsgSize size is based on the max buffer size of the lpStrings parameter of the ReportEvent API. + The documented max size for EventLog.WriteEntry for Windows Vista and higher is 31839, but I'm leaving room for a + terminator of #0#0, as we cannot see the source of ReportEvent (though we could use an API monitor to examine the + buffer, given enough time). + + + + + The maximum size that the operating system supports for + a event log message. + + + Used to determine the maximum string length that can be written + to the operating system event log and eventually truncate a string + that exceeds the limits. + + + + + This method determines the maximum event log message size allowed for + the current environment. + + + + + + The name of the log where messages will be stored. + + + The string name of the log where messages will be stored. + + + This is the name of the log as it appears in the Event Viewer + tree. The default value is to log into the Application + log, this is where most applications write their events. However + if you need a separate log for your application (or applications) + then you should set the appropriately. + This should not be used to distinguish your event log messages + from those of other applications, the + property should be used to distinguish events. This property should be + used to group together events into a single log. + + + + + + Property used to set the Application name. This appears in the + event logs when logging. + + + The string used to distinguish events from different sources. + + + Sets the event log source property. + + + + + This property is used to return the name of the computer to use + when accessing the event logs. Currently, this is the current + computer, denoted by a dot "." + + + The string name of the machine holding the event log that + will be logged into. + + + This property cannot be changed. It is currently set to '.' + i.e. the local machine. This may be changed in future. + + + + + Gets or sets the used to write to the EventLog. + + + The used to write to the EventLog. + + + + The system security context used to write to the EventLog. + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + + + + + + Gets or sets the EventId to use unless one is explicitly specified via the LoggingEvent's properties. + + + + The EventID of the event log entry will normally be + set using the EventID property () + on the . + This property provides the fallback value which defaults to 0. + + + + + + Gets or sets the Category to use unless one is explicitly specified via the LoggingEvent's properties. + + + + The Category of the event log entry will normally be + set using the Category property () + on the . + This property provides the fallback value which defaults to 0. + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + A class to act as a mapping between the level that a logging call is made at and + the color it should be displayed as. + + + + Defines the mapping between a level and its event log entry type. + + + + + + The for this entry + + + + Required property. + The for this entry + + + + + + Appends logging events to a file. + + + + Logging events are sent to the file specified by + the property. + + + The file can be opened in either append or overwrite mode + by specifying the property. + If the file path is relative it is taken as relative from + the application base directory. The file encoding can be + specified by setting the property. + + + The layout's and + values will be written each time the file is opened and closed + respectively. If the property is + then the file may contain multiple copies of the header and footer. + + + This appender will first try to open the file for writing when + is called. This will typically be during configuration. + If the file cannot be opened for writing the appender will attempt + to open the file again each time a message is logged to the appender. + If the file cannot be opened for writing when a message is logged then + the message will be discarded by this appender. + + + The supports pluggable file locking models via + the property. + The default behavior, implemented by + is to obtain an exclusive write lock on the file until this appender is closed. + The alternative models only hold a + write lock while the appender is writing a logging event () + or synchronize by using a named system wide Mutex (). + + + All locking strategies have issues and you should seriously consider using a different strategy that + avoids having multiple processes logging to the same file. + + + Nicko Cadell + Gert Driesen + Rodrigo B. de Oliveira + Douglas de la Torre + Niall Daley + + + + Sends logging events to a . + + + + An Appender that writes to a . + + + This appender may be used stand alone if initialized with an appropriate + writer, however it is typically used as a base class for an appender that + can open a to write to. + + + Nicko Cadell + Gert Driesen + Douglas de la Torre + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Initializes a new instance of the class and + sets the output destination to a new initialized + with the specified . + + The layout to use with this appender. + The to output to. + + + Obsolete constructor. + + + + + + Initializes a new instance of the class and sets + the output destination to the specified . + + The layout to use with this appender + The to output to + + The must have been previously opened. + + + + Obsolete constructor. + + + + + + This method determines if there is a sense in attempting to append. + + + + This method checks if an output target has been set and if a + layout has been set. + + + false if any of the preconditions fail. + + + + This method is called by the + method. + + The event to log. + + + Writes a log statement to the output stream if the output stream exists + and is writable. + + + The format of the output will depend on the appender's layout. + + + + + + This method is called by the + method. + + The array of events to log. + + + This method writes all the bulk logged events to the output writer + before flushing the stream. + + + + + + Close this appender instance. The underlying stream or writer is also closed. + + + Closed appenders cannot be reused. + + + + + Writes the footer and closes the underlying . + + + + Writes the footer and closes the underlying . + + + + + + Closes the underlying . + + + + Closes the underlying . + + + + + + Clears internal references to the underlying + and other variables. + + + + Subclasses can override this method for an alternate closing behavior. + + + + + + Writes a footer as produced by the embedded layout's property. + + + + Writes a footer as produced by the embedded layout's property. + + + + + + Writes a header produced by the embedded layout's property. + + + + Writes a header produced by the embedded layout's property. + + + + + + Called to allow a subclass to lazily initialize the writer + + + + This method is called when an event is logged and the or + have not been set. This allows a subclass to + attempt to initialize the writer multiple times. + + + + + + This is the where logging events + will be written to. + + + + + Immediate flush means that the underlying + or output stream will be flushed at the end of each append operation. + + + + Immediate flush is slower but ensures that each append request is + actually written. If is set to + false, then there is a good chance that the last few + logging events are not actually persisted if and when the application + crashes. + + + The default value is true. + + + + + + The fully qualified type of the TextWriterAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or set whether the appender will flush at the end + of each append operation. + + + + The default behavior is to flush at the end of each + append operation. + + + If this option is set to false, then the underlying + stream can defer persisting the logging event to a later + time. + + + + Avoiding the flush operation at the end of each append results in + a performance gain of 10 to 20 percent. However, there is safety + trade-off involved in skipping flushing. Indeed, when flushing is + skipped, then it is likely that the last few log events will not + be recorded on disk when the application exits. This is a high + price to pay even for a 20% performance gain. + + + + + Sets the where the log output will go. + + + + The specified must be open and writable. + + + The will be closed when the appender + instance is closed. + + + Note: Logging to an unopened will fail. + + + + + + Gets or set the and the underlying + , if any, for this appender. + + + The for this appender. + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Gets or sets the where logging events + will be written to. + + + The where logging events are written. + + + + This is the where logging events + will be written to. + + + + + + Default constructor + + + + Default constructor + + + + + + Construct a new appender using the layout, file and append mode. + + the layout to use with this appender + the full path to the file to write to + flag to indicate if the file should be appended to + + + Obsolete constructor. + + + + + + Construct a new appender using the layout and file specified. + The file will be appended to. + + the layout to use with this appender + the full path to the file to write to + + + Obsolete constructor. + + + + + + Activate the options on the file appender. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + This will cause the file to be opened. + + + + + + Closes any previously opened file and calls the parent's . + + + + Resets the filename and the file stream. + + + + + + Called to initialize the file writer + + + + Will be called for each logged message until the file is + successfully opened. + + + + + + This method is called by the + method. + + The event to log. + + + Writes a log statement to the output stream if the output stream exists + and is writable. + + + The format of the output will depend on the appender's layout. + + + + + + This method is called by the + method. + + The array of events to log. + + + Acquires the output file locks once before writing all the events to + the stream. + + + + + + Writes a footer as produced by the embedded layout's property. + + + + Writes a footer as produced by the embedded layout's property. + + + + + + Writes a header produced by the embedded layout's property. + + + + Writes a header produced by the embedded layout's property. + + + + + + Closes the underlying . + + + + Closes the underlying . + + + + + + Closes the previously opened file. + + + + Writes the to the file and then + closes the file. + + + + + + Sets and opens the file where the log output will go. The specified file must be writable. + + The path to the log file. Must be a fully qualified path. + If true will append to fileName. Otherwise will truncate fileName + + + Calls but guarantees not to throw an exception. + Errors are passed to the . + + + + + + Sets and opens the file where the log output will go. The specified file must be writable. + + The path to the log file. Must be a fully qualified path. + If true will append to fileName. Otherwise will truncate fileName + + + If there was already an opened file, then the previous file + is closed first. + + + This method will ensure that the directory structure + for the specified exists. + + + + + + Sets the quiet writer used for file output + + the file stream that has been opened for writing + + + This implementation of creates a + over the and passes it to the + method. + + + This method can be overridden by sub classes that want to wrap the + in some way, for example to encrypt the output + data using a System.Security.Cryptography.CryptoStream. + + + + + + Sets the quiet writer being used. + + the writer over the file stream that has been opened for writing + + + This method can be overridden by sub classes that want to + wrap the in some way. + + + + + + Convert a path into a fully qualified path. + + The path to convert. + The fully qualified path. + + + Converts the path specified to a fully + qualified path. If the path is relative it is + taken as relative from the application base + directory. + + + + + + Flag to indicate if we should append to the file + or overwrite the file. The default is to append. + + + + + The name of the log file. + + + + + The encoding to use for the file stream. + + + + + The security context to use for privileged calls + + + + + The stream to log to. Has added locking semantics + + + + + The locking model to use + + + + + The fully qualified type of the FileAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the path to the file that logging will be written to. + + + The path to the file that logging will be written to. + + + + If the path is relative it is taken as relative from + the application base directory. + + + + + + Gets or sets a flag that indicates whether the file should be + appended to or overwritten. + + + Indicates whether the file should be appended to or overwritten. + + + + If the value is set to false then the file will be overwritten, if + it is set to true then the file will be appended to. + + The default value is true. + + + + + Gets or sets used to write to the file. + + + The used to write to the file. + + + + The default encoding set is + which is the encoding for the system's current ANSI code page. + + + + + + Gets or sets the used to write to the file. + + + The used to write to the file. + + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + + + + + + Gets or sets the used to handle locking of the file. + + + The used to lock the file. + + + + Gets or sets the used to handle locking of the file. + + + There are three built in locking models, , and . + The first locks the file from the start of logging to the end, the + second locks only for the minimal amount of time when logging each message + and the last synchronizes processes using a named system wide Mutex. + + + The default locking model is the . + + + + + + Write only that uses the + to manage access to an underlying resource. + + + + + True asynchronous writes are not supported, the implementation forces a synchronous write. + + + + + Exception base type for log4net. + + + + This type extends . It + does not add any new functionality but does differentiate the + type of exception being thrown. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Constructor + + A message to include with the exception. + + + Initializes a new instance of the class with + the specified message. + + + + + + Constructor + + A message to include with the exception. + A nested exception to include. + + + Initializes a new instance of the class + with the specified message and inner exception. + + + + + + Serialization constructor + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + + + Initializes a new instance of the class + with serialized data. + + + + + + Locking model base class + + + + Base class for the locking models available to the derived loggers. + + + + + + Open the output file + + The filename to use + Whether to append to the file, or overwrite + The encoding to use + + + Open the file specified and prepare for logging. + No writes will be made until is called. + Must be called before any calls to , + and . + + + + + + Close the file + + + + Close the file. No further writes will be made. + + + + + + Acquire the lock on the file + + A stream that is ready to be written to. + + + Acquire the lock on the file in preparation for writing to it. + Return a stream pointing to the file. + must be called to release the lock on the output file. + + + + + + Release the lock on the file + + + + Release the lock on the file. No further writes will be made to the + stream until is called again. + + + + + + Helper method that creates a FileStream under CurrentAppender's SecurityContext. + + + + Typically called during OpenFile or AcquireLock. + + + If the directory portion of the does not exist, it is created + via Directory.CreateDirecctory. + + + + + + + + + + Helper method to close under CurrentAppender's SecurityContext. + + + Does not set to null. + + + + + + Gets or sets the for this LockingModel + + + The for this LockingModel + + + + The file appender this locking model is attached to and working on + behalf of. + + + The file appender is used to locate the security context and the error handler to use. + + + The value of this property will be set before is + called. + + + + + + Hold an exclusive lock on the output file + + + + Open the file once for writing and hold it open until is called. + Maintains an exclusive lock on the file during this time. + + + + + + Open the file specified and prepare for logging. + + The filename to use + Whether to append to the file, or overwrite + The encoding to use + + + Open the file specified and prepare for logging. + No writes will be made until is called. + Must be called before any calls to , + and . + + + + + + Close the file + + + + Close the file. No further writes will be made. + + + + + + Acquire the lock on the file + + A stream that is ready to be written to. + + + Does nothing. The lock is already taken + + + + + + Release the lock on the file + + + + Does nothing. The lock will be released when the file is closed. + + + + + + Acquires the file lock for each write + + + + Opens the file once for each / cycle, + thus holding the lock for the minimal amount of time. This method of locking + is considerably slower than but allows + other processes to move/delete the log file whilst logging continues. + + + + + + Prepares to open the file when the first message is logged. + + The filename to use + Whether to append to the file, or overwrite + The encoding to use + + + Open the file specified and prepare for logging. + No writes will be made until is called. + Must be called before any calls to , + and . + + + + + + Close the file + + + + Close the file. No further writes will be made. + + + + + + Acquire the lock on the file + + A stream that is ready to be written to. + + + Acquire the lock on the file in preparation for writing to it. + Return a stream pointing to the file. + must be called to release the lock on the output file. + + + + + + Release the lock on the file + + + + Release the lock on the file. No further writes will be made to the + stream until is called again. + + + + + + Provides cross-process file locking. + + Ron Grabowski + Steve Wranovsky + + + + Open the file specified and prepare for logging. + + The filename to use + Whether to append to the file, or overwrite + The encoding to use + + + Open the file specified and prepare for logging. + No writes will be made until is called. + Must be called before any calls to , + - and . + + + + + + Close the file + + + + Close the file. No further writes will be made. + + + + + + Acquire the lock on the file + + A stream that is ready to be written to. + + + Does nothing. The lock is already taken + + + + + + + + + + + This appender forwards logging events to attached appenders. + + + + The forwarding appender can be used to specify different thresholds + and filters for the same appender at different locations within the hierarchy. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Closes the appender and releases resources. + + + + Releases any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + + + + + Forward the logging event to the attached appenders + + The event to log. + + + Delivers the logging event to all the attached appenders. + + + + + + Forward the logging events to the attached appenders + + The array of events to log. + + + Delivers the logging events to all the attached appenders. + + + + + + Adds an to the list of appenders of this + instance. + + The to add to this appender. + + + If the specified is already in the list of + appenders, then it won't be added again. + + + + + + Looks for the appender with the specified name. + + The name of the appender to lookup. + + The appender with the specified name, or null. + + + + Get the named appender attached to this appender. + + + + + + Removes all previously added appenders from this appender. + + + + This is useful when re-reading configuration information. + + + + + + Removes the specified appender from the list of appenders. + + The appender to remove. + The appender removed from the list + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + Removes the appender with the specified name from the list of appenders. + + The name of the appender to remove. + The appender removed from the list + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + Implementation of the interface + + + + + Gets the appenders contained in this appender as an + . + + + If no appenders can be found, then an + is returned. + + + A collection of the appenders in this appender. + + + + + Logs events to a local syslog service. + + + + This appender uses the POSIX libc library functions openlog, syslog, and closelog. + If these functions are not available on the local system then this appender will not work! + + + The functions openlog, syslog, and closelog are specified in SUSv2 and + POSIX 1003.1-2001 standards. These are used to log messages to the local syslog service. + + + This appender talks to a local syslog service. If you need to log to a remote syslog + daemon and you cannot configure your local syslog service to do this you may be + able to use the to log via UDP. + + + Syslog messages must have a facility and and a severity. The severity + is derived from the Level of the logging event. + The facility must be chosen from the set of defined syslog + values. The facilities list is predefined + and cannot be extended. + + + An identifier is specified with each log message. This can be specified + by setting the property. The identity (also know + as the tag) must not contain white space. The default value for the + identity is the application name (from ). + + + Rob Lyon + Nicko Cadell + + + + Initializes a new instance of the class. + + + This instance of the class is set up to write + to a local syslog service. + + + + + Add a mapping of level to severity + + The mapping to add + + + Adds a to this appender. + + + + + + Initialize the appender based on the options set. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + This method is called by the method. + + The event to log. + + + Writes the event to a remote syslog daemon. + + + The format of the output will depend on the appender's layout. + + + + + + Close the syslog when the appender is closed + + + + Close the syslog when the appender is closed + + + + + + Translates a log4net level to a syslog severity. + + A log4net level. + A syslog severity. + + + Translates a log4net level to a syslog severity. + + + + + + Generate a syslog priority. + + The syslog facility. + The syslog severity. + A syslog priority. + + + + The facility. The default facility is . + + + + + The message identity + + + + + Marshaled handle to the identity string. We have to hold on to the + string as the openlog and syslog APIs just hold the + pointer to the ident and dereference it for each log message. + + + + + Mapping from level object to syslog severity + + + + + Open connection to system logger. + + + + + Generate a log message. + + + + The libc syslog method takes a format string and a variable argument list similar + to the classic printf function. As this type of vararg list is not supported + by C# we need to specify the arguments explicitly. Here we have specified the + format string with a single message argument. The caller must set the format + string to "%s". + + + + + + Close descriptor used to write to system logger. + + + + + Message identity + + + + An identifier is specified with each log message. This can be specified + by setting the property. The identity (also know + as the tag) must not contain white space. The default value for the + identity is the application name (from ). + + + + + + Syslog facility + + + Set to one of the values. The list of + facilities is predefined and cannot be extended. The default value + is . + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + syslog severities + + + + The log4net Level maps to a syslog severity using the + method and the + class. The severity is set on . + + + + + + system is unusable + + + + + action must be taken immediately + + + + + critical conditions + + + + + error conditions + + + + + warning conditions + + + + + normal but significant condition + + + + + informational + + + + + debug-level messages + + + + + syslog facilities + + + + The syslog facility defines which subsystem the logging comes from. + This is set on the property. + + + + + + kernel messages + + + + + random user-level messages + + + + + mail system + + + + + system daemons + + + + + security/authorization messages + + + + + messages generated internally by syslogd + + + + + line printer subsystem + + + + + network news subsystem + + + + + UUCP subsystem + + + + + clock (cron/at) daemon + + + + + security/authorization messages (private) + + + + + ftp daemon + + + + + NTP subsystem + + + + + log audit + + + + + log alert + + + + + clock daemon + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + A class to act as a mapping between the level that a logging call is made at and + the syslog severity that is should be logged at. + + + + A class to act as a mapping between the level that a logging call is made at and + the syslog severity that is should be logged at. + + + + + + The mapped syslog severity for the specified level + + + + Required property. + The mapped syslog severity for the specified level + + + + + + Appends colorful logging events to the console, using the .NET 2 + built-in capabilities. + + + + ManagedColoredConsoleAppender appends log events to the standard output stream + or the error output stream using a layout specified by the + user. It also allows the color of a specific type of message to be set. + + + By default, all output is written to the console's standard output stream. + The property can be set to direct the output to the + error stream. + + + When configuring the colored console appender, mappings should be + specified to map logging levels to colors. For example: + + + + + + + + + + + + + + + + + + + + + + The Level is the standard log4net logging level while + ForeColor and BackColor are the values of + enumeration. + + + Based on the ColoredConsoleAppender + + + Rick Hobbs + Nicko Cadell + Pavlos Touboulidis + + + + The to use when writing to the Console + standard output stream. + + + + The to use when writing to the Console + standard output stream. + + + + + + The to use when writing to the Console + standard error output stream. + + + + The to use when writing to the Console + standard error output stream. + + + + + + Initializes a new instance of the class. + + + The instance of the class is set up to write + to the standard output stream. + + + + + Add a mapping of level to color - done by the config file + + The mapping to add + + + Add a mapping to this appender. + Each mapping defines the foreground and background colors + for a level. + + + + + + This method is called by the method. + + The event to log. + + + Writes the event to the console. + + + The format of the output will depend on the appender's layout. + + + + + + Initialize the options for this appender + + + + Initialize the level to color mappings set on this appender. + + + + + + Flag to write output to the error stream rather than the standard output stream + + + + + Mapping from level object to color value + + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + A class to act as a mapping between the level that a logging call is made at and + the color it should be displayed as. + + + + Defines the mapping between a level and the color it should be displayed in. + + + + + + The mapped foreground color for the specified level + + + + Required property. + The mapped foreground color for the specified level. + + + + + + The mapped background color for the specified level + + + + Required property. + The mapped background color for the specified level. + + + + + + Stores logging events in an array. + + + + The memory appender stores all the logging events + that are appended in an in-memory array. + + + Use the method to get + the current list of events that have been appended. + + + Use the method to clear the + current list of events. + + + Julian Biddle + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Gets the events that have been logged. + + The events that have been logged + + + Gets the events that have been logged. + + + + + + This method is called by the method. + + the event to log + + Stores the in the events list. + + + + + Clear the list of events + + + Clear the list of events + + + + + The list of events that have been appended. + + + + + Value indicating which fields in the event should be fixed + + + By default all fields are fixed + + + + + Gets or sets a value indicating whether only part of the logging event + data should be fixed. + + + true if the appender should only fix part of the logging event + data, otherwise false. The default is false. + + + + Setting this property to true will cause only part of the event + data to be fixed and stored in the appender, hereby improving performance. + + + See for more information. + + + + + + Gets or sets the fields that will be fixed in the event + + + + The logging event needs to have certain thread specific values + captured before it can be buffered. See + for details. + + + + + + Logs entries by sending network messages using the + native function. + + + + You can send messages only to names that are active + on the network. If you send the message to a user name, + that user must be logged on and running the Messenger + service to receive the message. + + + The receiver will get a top most window displaying the + messages one at a time, therefore this appender should + not be used to deliver a high volume of messages. + + + The following table lists some possible uses for this appender : + + + + + Action + Property Value(s) + + + Send a message to a user account on the local machine + + + = <name of the local machine> + + + = <user name> + + + + + Send a message to a user account on a remote machine + + + = <name of the remote machine> + + + = <user name> + + + + + Send a message to a domain user account + + + = <name of a domain controller | uninitialized> + + + = <user name> + + + + + Send a message to all the names in a workgroup or domain + + + = <workgroup name | domain name>* + + + + + Send a message from the local machine to a remote machine + + + = <name of the local machine | uninitialized> + + + = <name of the remote machine> + + + + + + + Note : security restrictions apply for sending + network messages, see + for more information. + + + + + An example configuration section to log information + using this appender from the local machine, named + LOCAL_PC, to machine OPERATOR_PC : + + + + + + + + + + Nicko Cadell + Gert Driesen + + + + The DNS or NetBIOS name of the server on which the function is to execute. + + + + + The sender of the network message. + + + + + The message alias to which the message should be sent. + + + + + The security context to use for privileged calls + + + + + Initializes the appender. + + + The default constructor initializes all fields to their default values. + + + + + Initialize the appender based on the options set. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + The appender will be ignored if no was specified. + + + The required property was not specified. + + + + This method is called by the method. + + The event to log. + + + Sends the event using a network message. + + + + + + Sends a buffer of information to a registered message alias. + + The DNS or NetBIOS name of the server on which the function is to execute. + The message alias to which the message buffer should be sent + The originator of the message. + The message text. + The length, in bytes, of the message text. + + + The following restrictions apply for sending network messages: + + + + + Platform + Requirements + + + Windows NT + + + No special group membership is required to send a network message. + + + Admin, Accounts, Print, or Server Operator group membership is required to + successfully send a network message on a remote server. + + + + + Windows 2000 or later + + + If you send a message on a domain controller that is running Active Directory, + access is allowed or denied based on the access control list (ACL) for the securable + object. The default ACL permits only Domain Admins and Account Operators to send a network message. + + + On a member server or workstation, only Administrators and Server Operators can send a network message. + + + + + + + For more information see Security Requirements for the Network Management Functions. + + + + + If the function succeeds, the return value is zero. + + + + + + Gets or sets the sender of the message. + + + The sender of the message. + + + If this property is not specified, the message is sent from the local computer. + + + + + Gets or sets the message alias to which the message should be sent. + + + The recipient of the message. + + + This property should always be specified in order to send a message. + + + + + Gets or sets the DNS or NetBIOS name of the remote server on which the function is to execute. + + + DNS or NetBIOS name of the remote server on which the function is to execute. + + + + For Windows NT 4.0 and earlier, the string should begin with \\. + + + If this property is not specified, the local computer is used. + + + + + + Gets or sets the used to call the NetSend method. + + + The used to call the NetSend method. + + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Appends log events to the OutputDebugString system. + + + + OutputDebugStringAppender appends log events to the + OutputDebugString system. + + + The string is passed to the native OutputDebugString + function. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Write the logging event to the output debug string API + + the event to log + + + Write the logging event to the output debug string API + + + + + + Stub for OutputDebugString native method + + the string to output + + + Stub for OutputDebugString native method + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Logs events to a remote syslog daemon. + + + + The BSD syslog protocol is used to remotely log to + a syslog daemon. The syslogd listens for for messages + on UDP port 514. + + + The syslog UDP protocol is not authenticated. Most syslog daemons + do not accept remote log messages because of the security implications. + You may be able to use the LocalSyslogAppender to talk to a local + syslog service. + + + There is an RFC 3164 that claims to document the BSD Syslog Protocol. + This RFC can be seen here: http://www.faqs.org/rfcs/rfc3164.html. + This appender generates what the RFC calls an "Original Device Message", + i.e. does not include the TIMESTAMP or HOSTNAME fields. By observation + this format of message will be accepted by all current syslog daemon + implementations. The daemon will attach the current time and the source + hostname or IP address to any messages received. + + + Syslog messages must have a facility and and a severity. The severity + is derived from the Level of the logging event. + The facility must be chosen from the set of defined syslog + values. The facilities list is predefined + and cannot be extended. + + + An identifier is specified with each log message. This can be specified + by setting the property. The identity (also know + as the tag) must not contain white space. The default value for the + identity is the application name (from ). + + + Rob Lyon + Nicko Cadell + + + + Sends logging events as connectionless UDP datagrams to a remote host or a + multicast group using an . + + + + UDP guarantees neither that messages arrive, nor that they arrive in the correct order. + + + To view the logging results, a custom application can be developed that listens for logging + events. + + + When decoding events send via this appender remember to use the same encoding + to decode the events as was used to send the events. See the + property to specify the encoding to use. + + + + This example shows how to log receive logging events that are sent + on IP address 244.0.0.1 and port 8080 to the console. The event is + encoded in the packet as a unicode string and it is decoded as such. + + IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Any, 0); + UdpClient udpClient; + byte[] buffer; + string loggingEvent; + + try + { + udpClient = new UdpClient(8080); + + while(true) + { + buffer = udpClient.Receive(ref remoteEndPoint); + loggingEvent = System.Text.Encoding.Unicode.GetString(buffer); + Console.WriteLine(loggingEvent); + } + } + catch(Exception e) + { + Console.WriteLine(e.ToString()); + } + + + Dim remoteEndPoint as IPEndPoint + Dim udpClient as UdpClient + Dim buffer as Byte() + Dim loggingEvent as String + + Try + remoteEndPoint = new IPEndPoint(IPAddress.Any, 0) + udpClient = new UdpClient(8080) + + While True + buffer = udpClient.Receive(ByRef remoteEndPoint) + loggingEvent = System.Text.Encoding.Unicode.GetString(buffer) + Console.WriteLine(loggingEvent) + Wend + Catch e As Exception + Console.WriteLine(e.ToString()) + End Try + + + An example configuration section to log information using this appender to the + IP 224.0.0.1 on port 8080: + + + + + + + + + + Gert Driesen + Nicko Cadell + + + + Initializes a new instance of the class. + + + The default constructor initializes all fields to their default values. + + + + + Initialize the appender based on the options set. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + The appender will be ignored if no was specified or + an invalid remote or local TCP port number was specified. + + + The required property was not specified. + The TCP port number assigned to or is less than or greater than . + + + + This method is called by the method. + + The event to log. + + + Sends the event using an UDP datagram. + + + Exceptions are passed to the . + + + + + + Closes the UDP connection and releases all resources associated with + this instance. + + + + Disables the underlying and releases all managed + and unmanaged resources associated with the . + + + + + + Initializes the underlying connection. + + + + The underlying is initialized and binds to the + port number from which you intend to communicate. + + + Exceptions are passed to the . + + + + + + The IP address of the remote host or multicast group to which + the logging event will be sent. + + + + + The TCP port number of the remote host or multicast group to + which the logging event will be sent. + + + + + The cached remote endpoint to which the logging events will be sent. + + + + + The TCP port number from which the will communicate. + + + + + The instance that will be used for sending the + logging events. + + + + + The encoding to use for the packet. + + + + + Gets or sets the IP address of the remote host or multicast group to which + the underlying should sent the logging event. + + + The IP address of the remote host or multicast group to which the logging event + will be sent. + + + + Multicast addresses are identified by IP class D addresses (in the range 224.0.0.0 to + 239.255.255.255). Multicast packets can pass across different networks through routers, so + it is possible to use multicasts in an Internet scenario as long as your network provider + supports multicasting. + + + Hosts that want to receive particular multicast messages must register their interest by joining + the multicast group. Multicast messages are not sent to networks where no host has joined + the multicast group. Class D IP addresses are used for multicast groups, to differentiate + them from normal host addresses, allowing nodes to easily detect if a message is of interest. + + + Static multicast addresses that are needed globally are assigned by IANA. A few examples are listed in the table below: + + + + + IP Address + Description + + + 224.0.0.1 + + + Sends a message to all system on the subnet. + + + + + 224.0.0.2 + + + Sends a message to all routers on the subnet. + + + + + 224.0.0.12 + + + The DHCP server answers messages on the IP address 224.0.0.12, but only on a subnet. + + + + + + + A complete list of actually reserved multicast addresses and their owners in the ranges + defined by RFC 3171 can be found at the IANA web site. + + + The address range 239.0.0.0 to 239.255.255.255 is reserved for administrative scope-relative + addresses. These addresses can be reused with other local groups. Routers are typically + configured with filters to prevent multicast traffic in this range from flowing outside + of the local network. + + + + + + Gets or sets the TCP port number of the remote host or multicast group to which + the underlying should sent the logging event. + + + An integer value in the range to + indicating the TCP port number of the remote host or multicast group to which the logging event + will be sent. + + + The underlying will send messages to this TCP port number + on the remote host or multicast group. + + The value specified is less than or greater than . + + + + Gets or sets the TCP port number from which the underlying will communicate. + + + An integer value in the range to + indicating the TCP port number from which the underlying will communicate. + + + + The underlying will bind to this port for sending messages. + + + Setting the value to 0 (the default) will cause the udp client not to bind to + a local port. + + + The value specified is less than or greater than . + + + + Gets or sets used to write the packets. + + + The used to write the packets. + + + + The used to write the packets. + + + + + + Gets or sets the underlying . + + + The underlying . + + + creates a to send logging events + over a network. Classes deriving from can use this + property to get or set this . Use the underlying + returned from if you require access beyond that which + provides. + + + + + Gets or sets the cached remote endpoint to which the logging events should be sent. + + + The cached remote endpoint to which the logging events will be sent. + + + The method will initialize the remote endpoint + with the values of the and + properties. + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Syslog port 514 + + + + + Initial buffer size + + + + + Maximum buffer size before it is recycled + + + + + Initializes a new instance of the class. + + + This instance of the class is set up to write + to a remote syslog daemon. + + + + + Add a mapping of level to severity + + The mapping to add + + + Add a mapping to this appender. + + + + + + This method is called by the method. + + The event to log. + + + Writes the event to a remote syslog daemon. + + + The format of the output will depend on the appender's layout. + + + + + + Initialize the options for this appender + + + + Initialize the level to syslog severity mappings set on this appender. + + + + + + Translates a log4net level to a syslog severity. + + A log4net level. + A syslog severity. + + + Translates a log4net level to a syslog severity. + + + + + + Generate a syslog priority. + + The syslog facility. + The syslog severity. + A syslog priority. + + + Generate a syslog priority. + + + + + + The facility. The default facility is . + + + + + The message identity + + + + + Mapping from level object to syslog severity + + + + + Message identity + + + + An identifier is specified with each log message. This can be specified + by setting the property. The identity (also know + as the tag) must not contain white space. The default value for the + identity is the application name (from ). + + + + + + Syslog facility + + + Set to one of the values. The list of + facilities is predefined and cannot be extended. The default value + is . + + + + + syslog severities + + + + The syslog severities. + + + + + + system is unusable + + + + + action must be taken immediately + + + + + critical conditions + + + + + error conditions + + + + + warning conditions + + + + + normal but significant condition + + + + + informational + + + + + debug-level messages + + + + + syslog facilities + + + + The syslog facilities + + + + + + kernel messages + + + + + random user-level messages + + + + + mail system + + + + + system daemons + + + + + security/authorization messages + + + + + messages generated internally by syslogd + + + + + line printer subsystem + + + + + network news subsystem + + + + + UUCP subsystem + + + + + clock (cron/at) daemon + + + + + security/authorization messages (private) + + + + + ftp daemon + + + + + NTP subsystem + + + + + log audit + + + + + log alert + + + + + clock daemon + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + A class to act as a mapping between the level that a logging call is made at and + the syslog severity that is should be logged at. + + + + A class to act as a mapping between the level that a logging call is made at and + the syslog severity that is should be logged at. + + + + + + The mapped syslog severity for the specified level + + + + Required property. + The mapped syslog severity for the specified level + + + + + + Delivers logging events to a remote logging sink. + + + + This Appender is designed to deliver events to a remote sink. + That is any object that implements the + interface. It delivers the events using .NET remoting. The + object to deliver events to is specified by setting the + appenders property. + + The RemotingAppender buffers events before sending them. This allows it to + make more efficient use of the remoting infrastructure. + + Once the buffer is full the events are still not sent immediately. + They are scheduled to be sent using a pool thread. The effect is that + the send occurs asynchronously. This is very important for a + number of non obvious reasons. The remoting infrastructure will + flow thread local variables (stored in the ), + if they are marked as , across the + remoting boundary. If the server is not contactable then + the remoting infrastructure will clear the + objects from the . To prevent a logging failure from + having side effects on the calling application the remoting call must be made + from a separate thread to the one used by the application. A + thread is used for this. If no thread is available then + the events will block in the thread pool manager until a thread is available. + + Because the events are sent asynchronously using pool threads it is possible to close + this appender before all the queued events have been sent. + When closing the appender attempts to wait until all the queued events have been sent, but + this will timeout after 30 seconds regardless. + + If this appender is being closed because the + event has fired it may not be possible to send all the queued events. During process + exit the runtime limits the time that a + event handler is allowed to run for. If the runtime terminates the threads before + the queued events have been sent then they will be lost. To ensure that all events + are sent the appender must be closed before the application exits. See + for details on how to shutdown + log4net programmatically. + + + Nicko Cadell + Gert Driesen + Daniel Cazzulino + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Send the contents of the buffer to the remote sink. + + + The events are not sent immediately. They are scheduled to be sent + using a pool thread. The effect is that the send occurs asynchronously. + This is very important for a number of non obvious reasons. The remoting + infrastructure will flow thread local variables (stored in the ), + if they are marked as , across the + remoting boundary. If the server is not contactable then + the remoting infrastructure will clear the + objects from the . To prevent a logging failure from + having side effects on the calling application the remoting call must be made + from a separate thread to the one used by the application. A + thread is used for this. If no thread is available then + the events will block in the thread pool manager until a thread is available. + + The events to send. + + + + Override base class close. + + + + This method waits while there are queued work items. The events are + sent asynchronously using work items. These items + will be sent once a thread pool thread is available to send them, therefore + it is possible to close the appender before all the queued events have been + sent. + + This method attempts to wait until all the queued events have been sent, but this + method will timeout after 30 seconds regardless. + + If the appender is being closed because the + event has fired it may not be possible to send all the queued events. During process + exit the runtime limits the time that a + event handler is allowed to run for. + + + + + A work item is being queued into the thread pool + + + + + A work item from the thread pool has completed + + + + + Send the contents of the buffer to the remote sink. + + + This method is designed to be used with the . + This method expects to be passed an array of + objects in the state param. + + the logging events to send + + + + The URL of the remote sink. + + + + + The local proxy (.NET remoting) for the remote logging sink. + + + + + The number of queued callbacks currently waiting or executing + + + + + Event used to signal when there are no queued work items + + + This event is set when there are no queued work items. In this + state it is safe to close the appender. + + + + + Gets or sets the URL of the well-known object that will accept + the logging events. + + + The well-known URL of the remote sink. + + + + The URL of the remoting sink that will accept logging events. + The sink must implement the + interface. + + + + + + Interface used to deliver objects to a remote sink. + + + This interface must be implemented by a remoting sink + if the is to be used + to deliver logging events to the sink. + + + + + Delivers logging events to the remote sink + + Array of events to log. + + + Delivers logging events to the remote sink + + + + + + Appender that rolls log files based on size or date or both. + + + + RollingFileAppender can roll log files based on size or date or both + depending on the setting of the property. + When set to the log file will be rolled + once its size exceeds the . + When set to the log file will be rolled + once the date boundary specified in the property + is crossed. + When set to the log file will be + rolled once the date boundary specified in the property + is crossed, but within a date boundary the file will also be rolled + once its size exceeds the . + When set to the log file will be rolled when + the appender is configured. This effectively means that the log file can be + rolled once per program execution. + + + A of few additional optional features have been added: + + Attach date pattern for current log file + Backup number increments for newer files + Infinite number of backups by file size + + + + + + For large or infinite numbers of backup files a + greater than zero is highly recommended, otherwise all the backup files need + to be renamed each time a new backup is created. + + + When Date/Time based rolling is used setting + to will reduce the number of file renamings to few or none. + + + + + + Changing or without clearing + the log file directory of backup files will cause unexpected and unwanted side effects. + + + + + If Date/Time based rolling is enabled this appender will attempt to roll existing files + in the directory without a Date/Time tag based on the last write date of the base log file. + The appender only rolls the log file when a message is logged. If Date/Time based rolling + is enabled then the appender will not roll the log file at the Date/Time boundary but + at the point when the next message is logged after the boundary has been crossed. + + + + The extends the and + has the same behavior when opening the log file. + The appender will first try to open the file for writing when + is called. This will typically be during configuration. + If the file cannot be opened for writing the appender will attempt + to open the file again each time a message is logged to the appender. + If the file cannot be opened for writing when a message is logged then + the message will be discarded by this appender. + + + When rolling a backup file necessitates deleting an older backup file the + file to be deleted is moved to a temporary name before being deleted. + + + + + A maximum number of backup files when rolling on date/time boundaries is not supported. + + + + Nicko Cadell + Gert Driesen + Aspi Havewala + Douglas de la Torre + Edward Smit + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + The fully qualified type of the RollingFileAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Sets the quiet writer being used. + + + This method can be overridden by sub classes. + + the writer to set + + + + Write out a logging event. + + the event to write to file. + + + Handles append time behavior for RollingFileAppender. This checks + if a roll over either by date (checked first) or time (checked second) + is need and then appends to the file last. + + + + + + Write out an array of logging events. + + the events to write to file. + + + Handles append time behavior for RollingFileAppender. This checks + if a roll over either by date (checked first) or time (checked second) + is need and then appends to the file last. + + + + + + Performs any required rolling before outputting the next event + + + + Handles append time behavior for RollingFileAppender. This checks + if a roll over either by date (checked first) or time (checked second) + is need and then appends to the file last. + + + + + + Creates and opens the file for logging. If + is false then the fully qualified name is determined and used. + + the name of the file to open + true to append to existing file + + This method will ensure that the directory structure + for the specified exists. + + + + + Get the current output file name + + the base file name + the output file name + + The output file name is based on the base fileName specified. + If is set then the output + file name is the same as the base file passed in. Otherwise + the output file depends on the date pattern, on the count + direction or both. + + + + + Determines curSizeRollBackups (only within the current roll point) + + + + + Generates a wildcard pattern that can be used to find all files + that are similar to the base file name. + + + + + + + Builds a list of filenames for all files matching the base filename plus a file + pattern. + + + + + + + Initiates a roll over if needed for crossing a date boundary since the last run. + + + + + Initializes based on existing conditions at time of . + + + + Initializes based on existing conditions at time of . + The following is done + + determine curSizeRollBackups (only within the current roll point) + initiates a roll over if needed for crossing a date boundary since the last run. + + + + + + + Does the work of bumping the 'current' file counter higher + to the highest count when an incremental file name is seen. + The highest count is either the first file (when count direction + is greater than 0) or the last file (when count direction less than 0). + In either case, we want to know the highest count that is present. + + + + + + + Attempts to extract a number from the end of the file name that indicates + the number of the times the file has been rolled over. + + + Certain date pattern extensions like yyyyMMdd will be parsed as valid backup indexes. + + + + + + + Takes a list of files and a base file name, and looks for + 'incremented' versions of the base file. Bumps the max + count up to the highest count seen. + + + + + + + Calculates the RollPoint for the datePattern supplied. + + the date pattern to calculate the check period for + The RollPoint that is most accurate for the date pattern supplied + + Essentially the date pattern is examined to determine what the + most suitable roll point is. The roll point chosen is the roll point + with the smallest period that can be detected using the date pattern + supplied. i.e. if the date pattern only outputs the year, month, day + and hour then the smallest roll point that can be detected would be + and hourly roll point as minutes could not be detected. + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + Sets initial conditions including date/time roll over information, first check, + scheduledFilename, and calls to initialize + the current number of backups. + + + + + + + + + .1, .2, .3, etc. + + + + + Rollover the file(s) to date/time tagged file(s). + + set to true if the file to be rolled is currently open + + + Rollover the file(s) to date/time tagged file(s). + Resets curSizeRollBackups. + If fileIsOpen is set then the new file is opened (through SafeOpenFile). + + + + + + Renames file to file . + + Name of existing file to roll. + New name for file. + + + Renames file to file . It + also checks for existence of target file and deletes if it does. + + + + + + Test if a file exists at a specified path + + the path to the file + true if the file exists + + + Test if a file exists at a specified path + + + + + + Deletes the specified file if it exists. + + The file to delete. + + + Delete a file if is exists. + The file is first moved to a new filename then deleted. + This allows the file to be removed even when it cannot + be deleted, but it still can be moved. + + + + + + Implements file roll base on file size. + + + + If the maximum number of size based backups is reached + (curSizeRollBackups == maxSizeRollBackups) then the oldest + file is deleted -- its index determined by the sign of countDirection. + If countDirection < 0, then files + {File.1, ..., File.curSizeRollBackups -1} + are renamed to {File.2, ..., + File.curSizeRollBackups}. Moreover, File is + renamed File.1 and closed. + + + A new file is created to receive further log output. + + + If maxSizeRollBackups is equal to zero, then the + File is truncated with no backup files created. + + + If maxSizeRollBackups < 0, then File is + renamed if needed and no files are deleted. + + + + + + Implements file roll. + + the base name to rename + + + If the maximum number of size based backups is reached + (curSizeRollBackups == maxSizeRollBackups) then the oldest + file is deleted -- its index determined by the sign of countDirection. + If countDirection < 0, then files + {File.1, ..., File.curSizeRollBackups -1} + are renamed to {File.2, ..., + File.curSizeRollBackups}. + + + If maxSizeRollBackups is equal to zero, then the + File is truncated with no backup files created. + + + If maxSizeRollBackups < 0, then File is + renamed if needed and no files are deleted. + + + This is called by to rename the files. + + + + + + Get the start time of the next window for the current rollpoint + + the current date + the type of roll point we are working with + the start time for the next roll point an interval after the currentDateTime date + + + Returns the date of the next roll point after the currentDateTime date passed to the method. + + + The basic strategy is to subtract the time parts that are less significant + than the rollpoint from the current time. This should roll the time back to + the start of the time window for the current rollpoint. Then we add 1 window + worth of time and get the start time of the next window for the rollpoint. + + + + + + This object supplies the current date/time. Allows test code to plug in + a method to control this class when testing date/time based rolling. The default + implementation uses the underlying value of DateTime.Now. + + + + + The date pattern. By default, the pattern is set to ".yyyy-MM-dd" + meaning daily rollover. + + + + + The actual formatted filename that is currently being written to + or will be the file transferred to on roll over + (based on staticLogFileName). + + + + + The timestamp when we shall next recompute the filename. + + + + + Holds date of last roll over + + + + + The type of rolling done + + + + + The default maximum file size is 10MB + + + + + There is zero backup files by default + + + + + How many sized based backups have been made so far + + + + + The rolling file count direction. + + + + + The rolling mode used in this appender. + + + + + Cache flag set if we are rolling by date. + + + + + Cache flag set if we are rolling by size. + + + + + Value indicating whether to always log to the same file. + + + + + Value indicating whether to preserve the file name extension when rolling. + + + + + FileName provided in configuration. Used for rolling properly + + + + + The 1st of January 1970 in UTC + + + + + Gets or sets the strategy for determining the current date and time. The default + implementation is to use LocalDateTime which internally calls through to DateTime.Now. + DateTime.UtcNow may be used on frameworks newer than .NET 1.0 by specifying + . + + + An implementation of the interface which returns the current date and time. + + + + Gets or sets the used to return the current date and time. + + + There are two built strategies for determining the current date and time, + + and . + + + The default strategy is . + + + + + + Gets or sets the date pattern to be used for generating file names + when rolling over on date. + + + The date pattern to be used for generating file names when rolling + over on date. + + + + Takes a string in the same format as expected by + . + + + This property determines the rollover schedule when rolling over + on date. + + + + + + Gets or sets the maximum number of backup files that are kept before + the oldest is erased. + + + The maximum number of backup files that are kept before the oldest is + erased. + + + + If set to zero, then there will be no backup files and the log file + will be truncated when it reaches . + + + If a negative number is supplied then no deletions will be made. Note + that this could result in very slow performance as a large number of + files are rolled over unless is used. + + + The maximum applies to each time based group of files and + not the total. + + + + + + Gets or sets the maximum size that the output file is allowed to reach + before being rolled over to backup files. + + + The maximum size in bytes that the output file is allowed to reach before being + rolled over to backup files. + + + + This property is equivalent to except + that it is required for differentiating the setter taking a + argument from the setter taking a + argument. + + + The default maximum file size is 10MB (10*1024*1024). + + + + + + Gets or sets the maximum size that the output file is allowed to reach + before being rolled over to backup files. + + + The maximum size that the output file is allowed to reach before being + rolled over to backup files. + + + + This property allows you to specify the maximum size with the + suffixes "KB", "MB" or "GB" so that the size is interpreted being + expressed respectively in kilobytes, megabytes or gigabytes. + + + For example, the value "10KB" will be interpreted as 10240 bytes. + + + The default maximum file size is 10MB. + + + If you have the option to set the maximum file size programmatically + consider using the property instead as this + allows you to set the size in bytes as a . + + + + + + Gets or sets the rolling file count direction. + + + The rolling file count direction. + + + + Indicates if the current file is the lowest numbered file or the + highest numbered file. + + + By default newer files have lower numbers ( < 0), + i.e. log.1 is most recent, log.5 is the 5th backup, etc... + + + >= 0 does the opposite i.e. + log.1 is the first backup made, log.5 is the 5th backup made, etc. + For infinite backups use >= 0 to reduce + rollover costs. + + The default file count direction is -1. + + + + + Gets or sets the rolling style. + + The rolling style. + + + The default rolling style is . + + + When set to this appender's + property is set to false, otherwise + the appender would append to a single file rather than rolling + the file each time it is opened. + + + + + + Gets or sets a value indicating whether to preserve the file name extension when rolling. + + + true if the file name extension should be preserved. + + + + By default file.log is rolled to file.log.yyyy-MM-dd or file.log.curSizeRollBackup. + However, under Windows the new file name will loose any program associations as the + extension is changed. Optionally file.log can be renamed to file.yyyy-MM-dd.log or + file.curSizeRollBackup.log to maintain any program associations. + + + + + + Gets or sets a value indicating whether to always log to + the same file. + + + true if always should be logged to the same file, otherwise false. + + + + By default file.log is always the current file. Optionally + file.log.yyyy-mm-dd for current formatted datePattern can by the currently + logging file (or file.log.curSizeRollBackup or even + file.log.yyyy-mm-dd.curSizeRollBackup). + + + This will make time based rollovers with a large number of backups + much faster as the appender it won't have to rename all the backups! + + + + + + Style of rolling to use + + + + Style of rolling to use + + + + + + Roll files once per program execution + + + + Roll files once per program execution. + Well really once each time this appender is + configured. + + + Setting this option also sets AppendToFile to + false on the RollingFileAppender, otherwise + this appender would just be a normal file appender. + + + + + + Roll files based only on the size of the file + + + + + Roll files based only on the date + + + + + Roll files based on both the size and date of the file + + + + + The code assumes that the following 'time' constants are in a increasing sequence. + + + + The code assumes that the following 'time' constants are in a increasing sequence. + + + + + + Roll the log not based on the date + + + + + Roll the log for each minute + + + + + Roll the log for each hour + + + + + Roll the log twice a day (midday and midnight) + + + + + Roll the log each day (midnight) + + + + + Roll the log each week + + + + + Roll the log each month + + + + + This interface is used to supply Date/Time information to the . + + + This interface is used to supply Date/Time information to the . + Used primarily to allow test classes to plug themselves in so they can + supply test date/times. + + + + + Gets the current time. + + The current time. + + + Gets the current time. + + + + + + Default implementation of that returns the current time. + + + + + Gets the current time. + + The current time. + + + Gets the current time. + + + + + + Implementation of that returns the current time as the coordinated universal time (UTC). + + + + + Gets the current time. + + The current time. + + + Gets the current time. + + + + + + Send an e-mail when a specific logging event occurs, typically on errors + or fatal errors. + + + + The number of logging events delivered in this e-mail depend on + the value of option. The + keeps only the last + logging events in its + cyclic buffer. This keeps memory requirements at a reasonable level while + still delivering useful application context. + + + Authentication and setting the server Port are only available on the MS .NET 1.1 runtime. + For these features to be enabled you need to ensure that you are using a version of + the log4net assembly that is built against the MS .NET 1.1 framework and that you are + running the your application on the MS .NET 1.1 runtime. On all other platforms only sending + unauthenticated messages to a server listening on port 25 (the default) is supported. + + + Authentication is supported by setting the property to + either or . + If using authentication then the + and properties must also be set. + + + To set the SMTP server port use the property. The default port is 25. + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Default constructor + + + + + + Sends the contents of the cyclic buffer as an e-mail message. + + The logging events to send. + + + + Send the email message + + the body text to include in the mail + + + + Gets or sets a comma- or semicolon-delimited list of recipient e-mail addresses (use semicolon on .NET 1.1 and comma for later versions). + + + + For .NET 1.1 (System.Web.Mail): A semicolon-delimited list of e-mail addresses. + + + For .NET 2.0 (System.Net.Mail): A comma-delimited list of e-mail addresses. + + + + + For .NET 1.1 (System.Web.Mail): A semicolon-delimited list of e-mail addresses. + + + For .NET 2.0 (System.Net.Mail): A comma-delimited list of e-mail addresses. + + + + + + Gets or sets a comma- or semicolon-delimited list of recipient e-mail addresses + that will be carbon copied (use semicolon on .NET 1.1 and comma for later versions). + + + + For .NET 1.1 (System.Web.Mail): A semicolon-delimited list of e-mail addresses. + + + For .NET 2.0 (System.Net.Mail): A comma-delimited list of e-mail addresses. + + + + + For .NET 1.1 (System.Web.Mail): A semicolon-delimited list of e-mail addresses. + + + For .NET 2.0 (System.Net.Mail): A comma-delimited list of e-mail addresses. + + + + + + Gets or sets a semicolon-delimited list of recipient e-mail addresses + that will be blind carbon copied. + + + A semicolon-delimited list of e-mail addresses. + + + + A semicolon-delimited list of recipient e-mail addresses. + + + + + + Gets or sets the e-mail address of the sender. + + + The e-mail address of the sender. + + + + The e-mail address of the sender. + + + + + + Gets or sets the subject line of the e-mail message. + + + The subject line of the e-mail message. + + + + The subject line of the e-mail message. + + + + + + Gets or sets the name of the SMTP relay mail server to use to send + the e-mail messages. + + + The name of the e-mail relay server. If SmtpServer is not set, the + name of the local SMTP server is used. + + + + The name of the e-mail relay server. If SmtpServer is not set, the + name of the local SMTP server is used. + + + + + + Obsolete + + + Use the BufferingAppenderSkeleton Fix methods instead + + + + Obsolete property. + + + + + + The mode to use to authentication with the SMTP server + + + Authentication is only available on the MS .NET 1.1 runtime. + + Valid Authentication mode values are: , + , and . + The default value is . When using + you must specify the + and to use to authenticate. + When using the Windows credentials for the current + thread, if impersonating, or the process will be used to authenticate. + + + + + + The username to use to authenticate with the SMTP server + + + Authentication is only available on the MS .NET 1.1 runtime. + + A and must be specified when + is set to , + otherwise the username will be ignored. + + + + + + The password to use to authenticate with the SMTP server + + + Authentication is only available on the MS .NET 1.1 runtime. + + A and must be specified when + is set to , + otherwise the password will be ignored. + + + + + + The port on which the SMTP server is listening + + + Server Port is only available on the MS .NET 1.1 runtime. + + The port on which the SMTP server is listening. The default + port is 25. The Port can only be changed when running on + the MS .NET 1.1 runtime. + + + + + + Gets or sets the priority of the e-mail message + + + One of the values. + + + + Sets the priority of the e-mails generated by this + appender. The default priority is . + + + If you are using this appender to report errors then + you may want to set the priority to . + + + + + + Enable or disable use of SSL when sending e-mail message + + + This is available on MS .NET 2.0 runtime and higher + + + + + Gets or sets the reply-to e-mail address. + + + This is available on MS .NET 2.0 runtime and higher + + + + + Gets or sets the subject encoding to be used. + + + The default encoding is the operating system's current ANSI codepage. + + + + + Gets or sets the body encoding to be used. + + + The default encoding is the operating system's current ANSI codepage. + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Values for the property. + + + + SMTP authentication modes. + + + + + + No authentication + + + + + Basic authentication. + + + Requires a username and password to be supplied + + + + + Integrated authentication + + + Uses the Windows credentials from the current thread or process to authenticate. + + + + + Send an email when a specific logging event occurs, typically on errors + or fatal errors. Rather than sending via smtp it writes a file into the + directory specified by . This allows services such + as the IIS SMTP agent to manage sending the messages. + + + + The configuration for this appender is identical to that of the SMTPAppender, + except that instead of specifying the SMTPAppender.SMTPHost you specify + . + + + The number of logging events delivered in this e-mail depend on + the value of option. The + keeps only the last + logging events in its + cyclic buffer. This keeps memory requirements at a reasonable level while + still delivering useful application context. + + + Niall Daley + Nicko Cadell + + + + Default constructor + + + + Default constructor + + + + + + Sends the contents of the cyclic buffer as an e-mail message. + + The logging events to send. + + + Sends the contents of the cyclic buffer as an e-mail message. + + + + + + Activate the options on this appender. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Convert a path into a fully qualified path. + + The path to convert. + The fully qualified path. + + + Converts the path specified to a fully + qualified path. If the path is relative it is + taken as relative from the application base + directory. + + + + + + The security context to use for privileged calls + + + + + Gets or sets a semicolon-delimited list of recipient e-mail addresses. + + + A semicolon-delimited list of e-mail addresses. + + + + A semicolon-delimited list of e-mail addresses. + + + + + + Gets or sets the e-mail address of the sender. + + + The e-mail address of the sender. + + + + The e-mail address of the sender. + + + + + + Gets or sets the subject line of the e-mail message. + + + The subject line of the e-mail message. + + + + The subject line of the e-mail message. + + + + + + Gets or sets the path to write the messages to. + + + + Gets or sets the path to write the messages to. This should be the same + as that used by the agent sending the messages. + + + + + + Gets or sets the used to write to the pickup directory. + + + The used to write to the pickup directory. + + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Appender that allows clients to connect via Telnet to receive log messages + + + + The TelnetAppender accepts socket connections and streams logging messages + back to the client. + The output is provided in a telnet-friendly way so that a log can be monitored + over a TCP/IP socket. + This allows simple remote monitoring of application logging. + + + The default is 23 (the telnet port). + + + Keith Long + Nicko Cadell + + + + Default constructor + + + + Default constructor + + + + + + The fully qualified type of the TelnetAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Overrides the parent method to close the socket handler + + + + Closes all the outstanding connections. + + + + + + Initialize the appender based on the options set. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + Create the socket handler and wait for connections + + + + + + Writes the logging event to each connected client. + + The event to log. + + + Writes the logging event to each connected client. + + + + + + Gets or sets the TCP port number on which this will listen for connections. + + + An integer value in the range to + indicating the TCP port number on which this will listen for connections. + + + + The default value is 23 (the telnet port). + + + The value specified is less than + or greater than . + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Helper class to manage connected clients + + + + The SocketHandler class is used to accept connections from + clients. It is threaded so that clients can connect/disconnect + asynchronously. + + + + + + Opens a new server port on + + the local port to listen on for connections + + + Creates a socket handler on the specified local server port. + + + + + + Sends a string message to each of the connected clients + + the text to send + + + Sends a string message to each of the connected clients + + + + + + Add a client to the internal clients list + + client to add + + + + Remove a client from the internal clients list + + client to remove + + + + Callback used to accept a connection on the server socket + + The result of the asynchronous operation + + + On connection adds to the list of connections + if there are two many open connections you will be disconnected + + + + + + Close all network connections + + + + Make sure we close all network connections + + + + + + Test if this handler has active connections + + + true if this handler has active connections + + + + This property will be true while this handler has + active connections, that is at least one connection that + the handler will attempt to send a message to. + + + + + + Class that represents a client connected to this handler + + + + Class that represents a client connected to this handler + + + + + + Create this for the specified + + the client's socket + + + Opens a stream writer on the socket. + + + + + + Write a string to the client + + string to send + + + Write a string to the client + + + + + + Cleanup the clients connection + + + + Close the socket connection. + + + + + + Appends log events to the system. + + + + The application configuration file can be used to control what listeners + are actually used. See the MSDN documentation for the + class for details on configuring the + trace system. + + + Events are written using the System.Diagnostics.Trace.Write(string,string) + method. The event's logger name is the default value for the category parameter + of the Write method. + + + Compact Framework
      + The Compact Framework does not support the + class for any operation except Assert. When using the Compact Framework this + appender will write to the system rather than + the Trace system. This appender will therefore behave like the . +
      +
      + Douglas de la Torre + Nicko Cadell + Gert Driesen + Ron Grabowski +
      + + + Initializes a new instance of the . + + + + Default constructor. + + + + + + Initializes a new instance of the + with a specified layout. + + The layout to use with this appender. + + + Obsolete constructor. + + + + + + Writes the logging event to the system. + + The event to log. + + + Writes the logging event to the system. + + + + + + Immediate flush means that the underlying writer or output stream + will be flushed at the end of each append operation. + + + + Immediate flush is slower but ensures that each append request is + actually written. If is set to + false, then there is a good chance that the last few + logs events are not actually written to persistent media if and + when the application crashes. + + + The default value is true. + + + + + Defaults to %logger + + + + + Gets or sets a value that indicates whether the appender will + flush at the end of each write. + + + The default behavior is to flush at the end of each + write. If the option is set tofalse, then the underlying + stream can defer writing to physical medium to a later time. + + + Avoiding the flush operation at the end of each append results + in a performance gain of 10 to 20 percent. However, there is safety + trade-off involved in skipping flushing. Indeed, when flushing is + skipped, then it is likely that the last few log events will not + be recorded on disk when the application exits. This is a high + price to pay even for a 20% performance gain. + + + + + + The category parameter sent to the Trace method. + + + + Defaults to %logger which will use the logger name of the current + as the category parameter. + + + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Assembly level attribute that specifies a domain to alias to this assembly's repository. + + + + AliasDomainAttribute is obsolete. Use AliasRepositoryAttribute instead of AliasDomainAttribute. + + + An assembly's logger repository is defined by its , + however this can be overridden by an assembly loaded before the target assembly. + + + An assembly can alias another assembly's domain to its repository by + specifying this attribute with the name of the target domain. + + + This attribute can only be specified on the assembly and may be used + as many times as necessary to alias all the required domains. + + + Nicko Cadell + Gert Driesen + + + + Assembly level attribute that specifies a repository to alias to this assembly's repository. + + + + An assembly's logger repository is defined by its , + however this can be overridden by an assembly loaded before the target assembly. + + + An assembly can alias another assembly's repository to its repository by + specifying this attribute with the name of the target repository. + + + This attribute can only be specified on the assembly and may be used + as many times as necessary to alias all the required repositories. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class with + the specified repository to alias to this assembly's repository. + + The repository to alias to this assemby's repository. + + + Initializes a new instance of the class with + the specified repository to alias to this assembly's repository. + + + + + + Gets or sets the repository to alias to this assemby's repository. + + + The repository to alias to this assemby's repository. + + + + The name of the repository to alias to this assemby's repository. + + + + + + Initializes a new instance of the class with + the specified domain to alias to this assembly's repository. + + The domain to alias to this assemby's repository. + + + Obsolete. Use instead of . + + + + + + Use this class to quickly configure a . + + + + Allows very simple programmatic configuration of log4net. + + + Only one appender can be configured using this configurator. + The appender is set at the root of the hierarchy and all logging + events will be delivered to that appender. + + + Appenders can also implement the interface. Therefore + they would require that the method + be called after the appenders properties have been configured. + + + Nicko Cadell + Gert Driesen + + + + The fully qualified type of the BasicConfigurator class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to prevent instantiation of this class. + + + + + + Initializes the log4net system with a default configuration. + + + + Initializes the log4net logging system using a + that will write to Console.Out. The log messages are + formatted using the layout object + with the + layout style. + + + + + + Initializes the log4net system using the specified appender. + + The appender to use to log all logging events. + + + Initializes the log4net system using the specified appender. + + + + + + Initializes the log4net system using the specified appenders. + + The appenders to use to log all logging events. + + + Initializes the log4net system using the specified appenders. + + + + + + Initializes the with a default configuration. + + The repository to configure. + + + Initializes the specified repository using a + that will write to Console.Out. The log messages are + formatted using the layout object + with the + layout style. + + + + + + Initializes the using the specified appender. + + The repository to configure. + The appender to use to log all logging events. + + + Initializes the using the specified appender. + + + + + + Initializes the using the specified appenders. + + The repository to configure. + The appenders to use to log all logging events. + + + Initializes the using the specified appender. + + + + + + Base class for all log4net configuration attributes. + + + This is an abstract class that must be extended by + specific configurators. This attribute allows the + configurator to be parameterized by an assembly level + attribute. + + Nicko Cadell + Gert Driesen + + + + Constructor used by subclasses. + + the ordering priority for this configurator + + + The is used to order the configurator + attributes before they are invoked. Higher priority configurators are executed + before lower priority ones. + + + + + + Configures the for the specified assembly. + + The assembly that this attribute was defined on. + The repository to configure. + + + Abstract method implemented by a subclass. When this method is called + the subclass should configure the . + + + + + + Compare this instance to another ConfiguratorAttribute + + the object to compare to + see + + + Compares the priorities of the two instances. + Sorts by priority in descending order. Objects with the same priority are + randomly ordered. + + + + + + Assembly level attribute that specifies the logging domain for the assembly. + + + + DomainAttribute is obsolete. Use RepositoryAttribute instead of DomainAttribute. + + + Assemblies are mapped to logging domains. Each domain has its own + logging repository. This attribute specified on the assembly controls + the configuration of the domain. The property specifies the name + of the domain that this assembly is a part of. The + specifies the type of the repository objects to create for the domain. If + this attribute is not specified and a is not specified + then the assembly will be part of the default shared logging domain. + + + This attribute can only be specified on the assembly and may only be used + once per assembly. + + + Nicko Cadell + Gert Driesen + + + + Assembly level attribute that specifies the logging repository for the assembly. + + + + Assemblies are mapped to logging repository. This attribute specified + on the assembly controls + the configuration of the repository. The property specifies the name + of the repository that this assembly is a part of. The + specifies the type of the object + to create for the assembly. If this attribute is not specified or a + is not specified then the assembly will be part of the default shared logging repository. + + + This attribute can only be specified on the assembly and may only be used + once per assembly. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Initialize a new instance of the class + with the name of the repository. + + The name of the repository. + + + Initialize the attribute with the name for the assembly's repository. + + + + + + Gets or sets the name of the logging repository. + + + The string name to use as the name of the repository associated with this + assembly. + + + + This value does not have to be unique. Several assemblies can share the + same repository. They will share the logging configuration of the repository. + + + + + + Gets or sets the type of repository to create for this assembly. + + + The type of repository to create for this assembly. + + + + The type of the repository to create for the assembly. + The type must implement the + interface. + + + This will be the type of repository created when + the repository is created. If multiple assemblies reference the + same repository then the repository is only created once using the + of the first assembly to call into the + repository. + + + + + + Initializes a new instance of the class. + + + + Obsolete. Use RepositoryAttribute instead of DomainAttribute. + + + + + + Initialize a new instance of the class + with the name of the domain. + + The name of the domain. + + + Obsolete. Use RepositoryAttribute instead of DomainAttribute. + + + + + + Use this class to initialize the log4net environment using an Xml tree. + + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + Configures a using an Xml tree. + + + Nicko Cadell + Gert Driesen + + + + Private constructor + + + + + Automatically configures the log4net system based on the + application's configuration settings. + + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + Each application has a configuration file. This has the + same name as the application with '.config' appended. + This file is XML and calling this function prompts the + configurator to look in that file for a section called + log4net that contains the configuration data. + + + + + Automatically configures the using settings + stored in the application's configuration file. + + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + Each application has a configuration file. This has the + same name as the application with '.config' appended. + This file is XML and calling this function prompts the + configurator to look in that file for a section called + log4net that contains the configuration data. + + The repository to configure. + + + + Configures log4net using a log4net element + + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + Loads the log4net configuration from the XML element + supplied as . + + The element to parse. + + + + Configures the using the specified XML + element. + + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + Loads the log4net configuration from the XML element + supplied as . + + The repository to configure. + The element to parse. + + + + Configures log4net using the specified configuration file. + + The XML file to load the configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + The log4net configuration file can possible be specified in the application's + configuration file (either MyAppName.exe.config for a + normal application on Web.config for an ASP.NET application). + + + The following example configures log4net using a configuration file, of which the + location is stored in the application's configuration file : + + + using log4net.Config; + using System.IO; + using System.Configuration; + + ... + + DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); + + + In the .config file, the path to the log4net can be specified like this : + + + + + + + + + + + + + Configures log4net using the specified configuration file. + + A stream to load the XML configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + Note that this method will NOT close the stream parameter. + + + + + + Configures the using the specified configuration + file. + + The repository to configure. + The XML file to load the configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The log4net configuration file can possible be specified in the application's + configuration file (either MyAppName.exe.config for a + normal application on Web.config for an ASP.NET application). + + + The following example configures log4net using a configuration file, of which the + location is stored in the application's configuration file : + + + using log4net.Config; + using System.IO; + using System.Configuration; + + ... + + DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); + + + In the .config file, the path to the log4net can be specified like this : + + + + + + + + + + + + + Configures the using the specified configuration + file. + + The repository to configure. + The stream to load the XML configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + Note that this method will NOT close the stream parameter. + + + + + + Configures log4net using the file specified, monitors the file for changes + and reloads the configuration if a change is detected. + + The XML file to load the configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The configuration file will be monitored using a + and depends on the behavior of that class. + + + For more information on how to configure log4net using + a separate configuration file, see . + + + + + + + Configures the using the file specified, + monitors the file for changes and reloads the configuration if a change + is detected. + + The repository to configure. + The XML file to load the configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The configuration file will be monitored using a + and depends on the behavior of that class. + + + For more information on how to configure log4net using + a separate configuration file, see . + + + + + + + Assembly level attribute to configure the . + + + + AliasDomainAttribute is obsolete. Use AliasRepositoryAttribute instead of AliasDomainAttribute. + + + This attribute may only be used at the assembly scope and can only + be used once per assembly. + + + Use this attribute to configure the + without calling one of the + methods. + + + Nicko Cadell + Gert Driesen + + + + Assembly level attribute to configure the . + + + + This attribute may only be used at the assembly scope and can only + be used once per assembly. + + + Use this attribute to configure the + without calling one of the + methods. + + + If neither of the or + properties are set the configuration is loaded from the application's .config file. + If set the property takes priority over the + property. The property + specifies a path to a file to load the config from. The path is relative to the + application's base directory; . + The property is used as a postfix to the assembly file name. + The config file must be located in the application's base directory; . + For example in a console application setting the to + config has the same effect as not specifying the or + properties. + + + The property can be set to cause the + to watch the configuration file for changes. + + + + Log4net will only look for assembly level configuration attributes once. + When using the log4net assembly level attributes to control the configuration + of log4net you must ensure that the first call to any of the + methods is made from the assembly with the configuration + attributes. + + + If you cannot guarantee the order in which log4net calls will be made from + different assemblies you must use programmatic configuration instead, i.e. + call the method directly. + + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Default constructor + + + + + + Configures the for the specified assembly. + + The assembly that this attribute was defined on. + The repository to configure. + + + Configure the repository using the . + The specified must extend the + class otherwise the will not be able to + configure it. + + + The does not extend . + + + + Attempt to load configuration from the local file system + + The assembly that this attribute was defined on. + The repository to configure. + + + + Configure the specified repository using a + + The repository to configure. + the FileInfo pointing to the config file + + + + Attempt to load configuration from a URI + + The assembly that this attribute was defined on. + The repository to configure. + + + + The fully qualified type of the XmlConfiguratorAttribute class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the filename of the configuration file. + + + The filename of the configuration file. + + + + If specified, this is the name of the configuration file to use with + the . This file path is relative to the + application base directory (). + + + The takes priority over the . + + + + + + Gets or sets the extension of the configuration file. + + + The extension of the configuration file. + + + + If specified this is the extension for the configuration file. + The path to the config file is built by using the application + base directory (), + the assembly file name and the config file extension. + + + If the is set to MyExt then + possible config file names would be: MyConsoleApp.exe.MyExt or + MyClassLibrary.dll.MyExt. + + + The takes priority over the . + + + + + + Gets or sets a value indicating whether to watch the configuration file. + + + true if the configuration should be watched, false otherwise. + + + + If this flag is specified and set to true then the framework + will watch the configuration file and will reload the config each time + the file is modified. + + + The config file can only be watched if it is loaded from local disk. + In a No-Touch (Smart Client) deployment where the application is downloaded + from a web server the config file may not reside on the local disk + and therefore it may not be able to watch it. + + + Watching configuration is not supported on the SSCLI. + + + + + + Class to register for the log4net section of the configuration file + + + The log4net section of the configuration file needs to have a section + handler registered. This is the section handler used. It simply returns + the XML element that is the root of the section. + + + Example of registering the log4net section handler : + + + +
      + + + log4net configuration XML goes here + + + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Parses the configuration section. + + The configuration settings in a corresponding parent configuration section. + The configuration context when called from the ASP.NET configuration system. Otherwise, this parameter is reserved and is a null reference. + The for the log4net section. + The for the log4net section. + + + Returns the containing the configuration data, + + + + + + Assembly level attribute that specifies a plugin to attach to + the repository. + + + + Specifies the type of a plugin to create and attach to the + assembly's repository. The plugin type must implement the + interface. + + + Nicko Cadell + Gert Driesen + + + + Interface used to create plugins. + + + + Interface used to create a plugin. + + + Nicko Cadell + Gert Driesen + + + + Creates the plugin object. + + the new plugin instance + + + Create and return a new plugin instance. + + + + + + Initializes a new instance of the class + with the specified type. + + The type name of plugin to create. + + + Create the attribute with the plugin type specified. + + + Where possible use the constructor that takes a . + + + + + + Initializes a new instance of the class + with the specified type. + + The type of plugin to create. + + + Create the attribute with the plugin type specified. + + + + + + Creates the plugin object defined by this attribute. + + + + Creates the instance of the object as + specified by this attribute. + + + The plugin object. + + + + Returns a representation of the properties of this object. + + + + Overrides base class method to + return a representation of the properties of this object. + + + A representation of the properties of this object + + + + Gets or sets the type for the plugin. + + + The type for the plugin. + + + + The type for the plugin. + + + + + + Gets or sets the type name for the plugin. + + + The type name for the plugin. + + + + The type name for the plugin. + + + Where possible use the property instead. + + + + + + Assembly level attribute to configure the . + + + + This attribute may only be used at the assembly scope and can only + be used once per assembly. + + + Use this attribute to configure the + without calling one of the + methods. + + + Nicko Cadell + + + + Construct provider attribute with type specified + + the type of the provider to use + + + The provider specified must subclass the + class. + + + + + + Configures the SecurityContextProvider + + The assembly that this attribute was defined on. + The repository to configure. + + + Creates a provider instance from the specified. + Sets this as the default security context provider . + + + + + + The fully qualified type of the SecurityContextProviderAttribute class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the type of the provider to use. + + + the type of the provider to use. + + + + The provider specified must subclass the + class. + + + + + + Use this class to initialize the log4net environment using an Xml tree. + + + + Configures a using an Xml tree. + + + Nicko Cadell + Gert Driesen + + + + Private constructor + + + + + Automatically configures the log4net system based on the + application's configuration settings. + + + + Each application has a configuration file. This has the + same name as the application with '.config' appended. + This file is XML and calling this function prompts the + configurator to look in that file for a section called + log4net that contains the configuration data. + + + To use this method to configure log4net you must specify + the section + handler for the log4net configuration section. See the + for an example. + + + + + + + Automatically configures the using settings + stored in the application's configuration file. + + + + Each application has a configuration file. This has the + same name as the application with '.config' appended. + This file is XML and calling this function prompts the + configurator to look in that file for a section called + log4net that contains the configuration data. + + + To use this method to configure log4net you must specify + the section + handler for the log4net configuration section. See the + for an example. + + + The repository to configure. + + + + Configures log4net using a log4net element + + + + Loads the log4net configuration from the XML element + supplied as . + + + The element to parse. + + + + Configures the using the specified XML + element. + + + Loads the log4net configuration from the XML element + supplied as . + + The repository to configure. + The element to parse. + + + + Configures log4net using the specified configuration file. + + The XML file to load the configuration from. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + The log4net configuration file can possible be specified in the application's + configuration file (either MyAppName.exe.config for a + normal application on Web.config for an ASP.NET application). + + + The first element matching <configuration> will be read as the + configuration. If this file is also a .NET .config file then you must specify + a configuration section for the log4net element otherwise .NET will + complain. Set the type for the section handler to , for example: + + +
      + + + + + The following example configures log4net using a configuration file, of which the + location is stored in the application's configuration file : + + + using log4net.Config; + using System.IO; + using System.Configuration; + + ... + + XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); + + + In the .config file, the path to the log4net can be specified like this : + + + + + + + + + + + + + Configures log4net using the specified configuration URI. + + A URI to load the XML configuration from. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + The must support the URI scheme specified. + + + + + + Configures log4net using the specified configuration data stream. + + A stream to load the XML configuration from. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + Note that this method will NOT close the stream parameter. + + + + + + Configures the using the specified configuration + file. + + The repository to configure. + The XML file to load the configuration from. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The log4net configuration file can possible be specified in the application's + configuration file (either MyAppName.exe.config for a + normal application on Web.config for an ASP.NET application). + + + The first element matching <configuration> will be read as the + configuration. If this file is also a .NET .config file then you must specify + a configuration section for the log4net element otherwise .NET will + complain. Set the type for the section handler to , for example: + + +
      + + + + + The following example configures log4net using a configuration file, of which the + location is stored in the application's configuration file : + + + using log4net.Config; + using System.IO; + using System.Configuration; + + ... + + XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); + + + In the .config file, the path to the log4net can be specified like this : + + + + + + + + + + + + + Configures the using the specified configuration + URI. + + The repository to configure. + A URI to load the XML configuration from. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The must support the URI scheme specified. + + + + + + Configures the using the specified configuration + file. + + The repository to configure. + The stream to load the XML configuration from. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + Note that this method will NOT close the stream parameter. + + + + + + Configures log4net using the file specified, monitors the file for changes + and reloads the configuration if a change is detected. + + The XML file to load the configuration from. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The configuration file will be monitored using a + and depends on the behavior of that class. + + + For more information on how to configure log4net using + a separate configuration file, see . + + + + + + + Configures the using the file specified, + monitors the file for changes and reloads the configuration if a change + is detected. + + The repository to configure. + The XML file to load the configuration from. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The configuration file will be monitored using a + and depends on the behavior of that class. + + + For more information on how to configure log4net using + a separate configuration file, see . + + + + + + + Configures the specified repository using a log4net element. + + The hierarchy to configure. + The element to parse. + + + Loads the log4net configuration from the XML element + supplied as . + + + This method is ultimately called by one of the Configure methods + to load the configuration from an . + + + + + + Maps repository names to ConfigAndWatchHandler instances to allow a particular + ConfigAndWatchHandler to dispose of its FileSystemWatcher when a repository is + reconfigured. + + + + + The fully qualified type of the XmlConfigurator class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Class used to watch config files. + + + + Uses the to monitor + changes to a specified file. Because multiple change notifications + may be raised when the file is modified, a timer is used to + compress the notifications into a single event. The timer + waits for time before delivering + the event notification. If any further + change notifications arrive while the timer is waiting it + is reset and waits again for to + elapse. + + + + + + The default amount of time to wait after receiving notification + before reloading the config file. + + + + + Holds the FileInfo used to configure the XmlConfigurator + + + + + Holds the repository being configured. + + + + + The timer used to compress the notification events. + + + + + Watches file for changes. This object should be disposed when no longer + needed to free system handles on the watched resources. + + + + + Initializes a new instance of the class to + watch a specified config file used to configure a repository. + + The repository to configure. + The configuration file to watch. + + + Initializes a new instance of the class. + + + + + + Event handler used by . + + The firing the event. + The argument indicates the file that caused the event to be fired. + + + This handler reloads the configuration from the file when the event is fired. + + + + + + Event handler used by . + + The firing the event. + The argument indicates the file that caused the event to be fired. + + + This handler reloads the configuration from the file when the event is fired. + + + + + + Called by the timer when the configuration has been updated. + + null + + + + Release the handles held by the watcher and timer. + + + + + The implementation of the interface suitable + for use with the compact framework + + + + This implementation is a simple + mapping between repository name and + object. + + + The .NET Compact Framework 1.0 does not support retrieving assembly + level attributes therefore unlike the DefaultRepositorySelector + this selector does not examine the calling assembly for attributes. + + + Nicko Cadell + + + + Interface used by the to select the . + + + + The uses a + to specify the policy for selecting the correct + to return to the caller. + + + Nicko Cadell + Gert Driesen + + + + Gets the for the specified assembly. + + The assembly to use to lookup to the + The for the assembly. + + + Gets the for the specified assembly. + + + How the association between and + is made is not defined. The implementation may choose any method for + this association. The results of this method must be repeatable, i.e. + when called again with the same arguments the result must be the + save value. + + + + + + Gets the named . + + The name to use to lookup to the . + The named + + Lookup a named . This is the repository created by + calling . + + + + + Creates a new repository for the assembly specified. + + The assembly to use to create the domain to associate with the . + The type of repository to create, must implement . + The repository created. + + + The created will be associated with the domain + specified such that a call to with the + same assembly specified will return the same repository instance. + + + How the association between and + is made is not defined. The implementation may choose any method for + this association. + + + + + + Creates a new repository with the name specified. + + The name to associate with the . + The type of repository to create, must implement . + The repository created. + + + The created will be associated with the name + specified such that a call to with the + same name will return the same repository instance. + + + + + + Test if a named repository exists + + the named repository to check + true if the repository exists + + + Test if a named repository exists. Use + to create a new repository and to retrieve + a repository. + + + + + + Gets an array of all currently defined repositories. + + + An array of the instances created by + this . + + + Gets an array of all of the repositories created by this selector. + + + + + + Event to notify that a logger repository has been created. + + + Event to notify that a logger repository has been created. + + + + Event raised when a new repository is created. + The event source will be this selector. The event args will + be a which + holds the newly created . + + + + + + Create a new repository selector + + the type of the repositories to create, must implement + + + Create an new compact repository selector. + The default type for repositories must be specified, + an appropriate value would be . + + + throw if is null + throw if does not implement + + + + Get the for the specified assembly + + not used + The default + + + The argument is not used. This selector does not create a + separate repository for each assembly. + + + As a named repository is not specified the default repository is + returned. The default repository is named log4net-default-repository. + + + + + + Get the named + + the name of the repository to lookup + The named + + + Get the named . The default + repository is log4net-default-repository. Other repositories + must be created using the . + If the named repository does not exist an exception is thrown. + + + throw if is null + throw if the does not exist + + + + Create a new repository for the assembly specified + + not used + the type of repository to create, must implement + the repository created + + + The argument is not used. This selector does not create a + separate repository for each assembly. + + + If the is null then the + default repository type specified to the constructor is used. + + + As a named repository is not specified the default repository is + returned. The default repository is named log4net-default-repository. + + + + + + Create a new repository for the repository specified + + the repository to associate with the + the type of repository to create, must implement . + If this param is null then the default repository type is used. + the repository created + + + The created will be associated with the repository + specified such that a call to with the + same repository specified will return the same repository instance. + + + If the named repository already exists an exception will be thrown. + + + If is null then the default + repository type specified to the constructor is used. + + + throw if is null + throw if the already exists + + + + Test if a named repository exists + + the named repository to check + true if the repository exists + + + Test if a named repository exists. Use + to create a new repository and to retrieve + a repository. + + + + + + Gets a list of objects + + an array of all known objects + + + Gets an array of all of the repositories created by this selector. + + + + + + The fully qualified type of the CompactRepositorySelector class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Notify the registered listeners that the repository has been created + + The repository that has been created + + + Raises the LoggerRepositoryCreatedEvent + event. + + + + + + Event to notify that a logger repository has been created. + + + Event to notify that a logger repository has been created. + + + + Event raised when a new repository is created. + The event source will be this selector. The event args will + be a which + holds the newly created . + + + + + + The default implementation of the interface. + + + + Uses attributes defined on the calling assembly to determine how to + configure the hierarchy for the repository. + + + Nicko Cadell + Gert Driesen + + + + Creates a new repository selector. + + The type of the repositories to create, must implement + + + Create an new repository selector. + The default type for repositories must be specified, + an appropriate value would be . + + + is . + does not implement . + + + + Gets the for the specified assembly. + + The assembly use to lookup the . + + + The type of the created and the repository + to create can be overridden by specifying the + attribute on the . + + + The default values are to use the + implementation of the interface and to use the + as the name of the repository. + + + The created will be automatically configured using + any attributes defined on + the . + + + The for the assembly + is . + + + + Gets the for the specified repository. + + The repository to use to lookup the . + The for the specified repository. + + + Returns the named repository. If is null + a is thrown. If the repository + does not exist a is thrown. + + + Use to create a repository. + + + is . + does not exist. + + + + Create a new repository for the assembly specified + + the assembly to use to create the repository to associate with the . + The type of repository to create, must implement . + The repository created. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + The type of the created and + the repository to create can be overridden by specifying the + attribute on the + . The default values are to use the + implementation of the + interface and to use the + as the name of the repository. + + + The created will be automatically + configured using any + attributes defined on the . + + + If a repository for the already exists + that repository will be returned. An error will not be raised and that + repository may be of a different type to that specified in . + Also the attribute on the + assembly may be used to override the repository type specified in + . + + + is . + + + + Creates a new repository for the assembly specified. + + the assembly to use to create the repository to associate with the . + The type of repository to create, must implement . + The name to assign to the created repository + Set to true to read and apply the assembly attributes + The repository created. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + The type of the created and + the repository to create can be overridden by specifying the + attribute on the + . The default values are to use the + implementation of the + interface and to use the + as the name of the repository. + + + The created will be automatically + configured using any + attributes defined on the . + + + If a repository for the already exists + that repository will be returned. An error will not be raised and that + repository may be of a different type to that specified in . + Also the attribute on the + assembly may be used to override the repository type specified in + . + + + is . + + + + Creates a new repository for the specified repository. + + The repository to associate with the . + The type of repository to create, must implement . + If this param is then the default repository type is used. + The new repository. + + + The created will be associated with the repository + specified such that a call to with the + same repository specified will return the same repository instance. + + + is . + already exists. + + + + Test if a named repository exists + + the named repository to check + true if the repository exists + + + Test if a named repository exists. Use + to create a new repository and to retrieve + a repository. + + + + + + Gets a list of objects + + an array of all known objects + + + Gets an array of all of the repositories created by this selector. + + + + + + Aliases a repository to an existing repository. + + The repository to alias. + The repository that the repository is aliased to. + + + The repository specified will be aliased to the repository when created. + The repository must not already exist. + + + When the repository is created it must utilize the same repository type as + the repository it is aliased to, otherwise the aliasing will fail. + + + + is . + -or- + is . + + + + + Notifies the registered listeners that the repository has been created. + + The repository that has been created. + + + Raises the event. + + + + + + Gets the repository name and repository type for the specified assembly. + + The assembly that has a . + in/out param to hold the repository name to use for the assembly, caller should set this to the default value before calling. + in/out param to hold the type of the repository to create for the assembly, caller should set this to the default value before calling. + is . + + + + Configures the repository using information from the assembly. + + The assembly containing + attributes which define the configuration for the repository. + The repository to configure. + + is . + -or- + is . + + + + + Loads the attribute defined plugins on the assembly. + + The assembly that contains the attributes. + The repository to add the plugins to. + + is . + -or- + is . + + + + + Loads the attribute defined aliases on the assembly. + + The assembly that contains the attributes. + The repository to alias to. + + is . + -or- + is . + + + + + The fully qualified type of the DefaultRepositorySelector class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Event to notify that a logger repository has been created. + + + Event to notify that a logger repository has been created. + + + + Event raised when a new repository is created. + The event source will be this selector. The event args will + be a which + holds the newly created . + + + + + + Defined error codes that can be passed to the method. + + + + Values passed to the method. + + + Nicko Cadell + + + + A general error + + + + + Error while writing output + + + + + Failed to flush file + + + + + Failed to close file + + + + + Unable to open output file + + + + + No layout specified + + + + + Failed to parse address + + + + + An evaluator that triggers on an Exception type + + + + This evaluator will trigger if the type of the Exception + passed to + is equal to a Type in . /// + + + Drew Schaeffer + + + + Test if an triggers an action + + + + Implementations of this interface allow certain appenders to decide + when to perform an appender specific action. + + + The action or behavior triggered is defined by the implementation. + + + Nicko Cadell + + + + Test if this event triggers the action + + The event to check + true if this event triggers the action, otherwise false + + + Return true if this event triggers the action + + + + + + The type that causes the trigger to fire. + + + + + Causes subclasses of to cause the trigger to fire. + + + + + Default ctor to allow dynamic creation through a configurator. + + + + + Constructs an evaluator and initializes to trigger on + + the type that triggers this evaluator. + If true, this evaluator will trigger on subclasses of . + + + + Is this the triggering event? + + The event to check + This method returns true, if the logging event Exception + Type is . + Otherwise it returns false + + + This evaluator will trigger if the Exception Type of the event + passed to + is . + + + + + + The type that triggers this evaluator. + + + + + If true, this evaluator will trigger on subclasses of . + + + + + Appenders may delegate their error handling to an . + + + + Error handling is a particularly tedious to get right because by + definition errors are hard to predict and to reproduce. + + + Nicko Cadell + Gert Driesen + + + + Handles the error and information about the error condition is passed as + a parameter. + + The message associated with the error. + The that was thrown when the error occurred. + The error code associated with the error. + + + Handles the error and information about the error condition is passed as + a parameter. + + + + + + Prints the error message passed as a parameter. + + The message associated with the error. + The that was thrown when the error occurred. + + + See . + + + + + + Prints the error message passed as a parameter. + + The message associated with the error. + + + See . + + + + + + Interface for objects that require fixing. + + + + Interface that indicates that the object requires fixing before it + can be taken outside the context of the appender's + method. + + + When objects that implement this interface are stored + in the context properties maps + and + are fixed + (see ) the + method will be called. + + + Nicko Cadell + + + + Get a portable version of this object + + the portable instance of this object + + + Get a portable instance object that represents the current + state of this object. The portable object can be stored + and logged from any thread with identical results. + + + + + + Interface that all loggers implement + + + + This interface supports logging events and testing if a level + is enabled for logging. + + + These methods will not throw exceptions. Note to implementor, ensure + that the implementation of these methods cannot allow an exception + to be thrown to the caller. + + + Nicko Cadell + Gert Driesen + + + + This generic form is intended to be used by wrappers. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The level of the message to be logged. + The message object to log. + the exception to log, including its stack trace. Pass null to not log an exception. + + + Generates a logging event for the specified using + the and . + + + + + + This is the most generic printing method that is intended to be used + by wrappers. + + The event being logged. + + + Logs the specified logging event through this logger. + + + + + + Checks if this logger is enabled for a given passed as parameter. + + The level to check. + + true if this logger is enabled for level, otherwise false. + + + + Test if this logger is going to log events of the specified . + + + + + + Gets the name of the logger. + + + The name of the logger. + + + + The name of this logger + + + + + + Gets the where this + Logger instance is attached to. + + + The that this logger belongs to. + + + + Gets the where this + Logger instance is attached to. + + + + + + Base interface for all wrappers + + + + Base interface for all wrappers. + + + All wrappers must implement this interface. + + + Nicko Cadell + + + + Get the implementation behind this wrapper object. + + + The object that in implementing this object. + + + + The object that in implementing this + object. The Logger object may not + be the same object as this object because of logger decorators. + This gets the actual underlying objects that is used to process + the log events. + + + + + + Delegate used to handle logger repository creation event notifications + + The which created the repository. + The event args + that holds the instance that has been created. + + + Delegate used to handle logger repository creation event notifications. + + + + + + Provides data for the event. + + + + A + event is raised every time a is created. + + + + + + The created + + + + + Construct instance using specified + + the that has been created + + + Construct instance using specified + + + + + + The that has been created + + + The that has been created + + + + The that has been created + + + + + + Defines the default set of levels recognized by the system. + + + + Each has an associated . + + + Levels have a numeric that defines the relative + ordering between levels. Two Levels with the same + are deemed to be equivalent. + + + The levels that are recognized by log4net are set for each + and each repository can have different levels defined. The levels are stored + in the on the repository. Levels are + looked up by name from the . + + + When logging at level INFO the actual level used is not but + the value of LoggerRepository.LevelMap["INFO"]. The default value for this is + , but this can be changed by reconfiguring the level map. + + + Each level has a in addition to its . The + is the string that is written into the output log. By default + the display name is the same as the level name, but this can be used to alias levels + or to localize the log output. + + + Some of the predefined levels recognized by the system are: + + + + . + + + . + + + . + + + . + + + . + + + . + + + . + + + + Nicko Cadell + Gert Driesen + + + + Constructor + + Integer value for this level, higher values represent more severe levels. + The string name of this level. + The display name for this level. This may be localized or otherwise different from the name + + + Initializes a new instance of the class with + the specified level name and value. + + + + + + Constructor + + Integer value for this level, higher values represent more severe levels. + The string name of this level. + + + Initializes a new instance of the class with + the specified level name and value. + + + + + + Returns the representation of the current + . + + + A representation of the current . + + + + Returns the level . + + + + + + Compares levels. + + The object to compare against. + true if the objects are equal. + + + Compares the levels of instances, and + defers to base class if the target object is not a + instance. + + + + + + Returns a hash code + + A hash code for the current . + + + Returns a hash code suitable for use in hashing algorithms and data + structures like a hash table. + + + Returns the hash code of the level . + + + + + + Compares this instance to a specified object and returns an + indication of their relative values. + + A instance or to compare with this instance. + + A 32-bit signed integer that indicates the relative order of the + values compared. The return value has these meanings: + + + Value + Meaning + + + Less than zero + This instance is less than . + + + Zero + This instance is equal to . + + + Greater than zero + + This instance is greater than . + -or- + is . + + + + + + + must be an instance of + or ; otherwise, an exception is thrown. + + + is not a . + + + + Returns a value indicating whether a specified + is greater than another specified . + + A + A + + true if is greater than + ; otherwise, false. + + + + Compares two levels. + + + + + + Returns a value indicating whether a specified + is less than another specified . + + A + A + + true if is less than + ; otherwise, false. + + + + Compares two levels. + + + + + + Returns a value indicating whether a specified + is greater than or equal to another specified . + + A + A + + true if is greater than or equal to + ; otherwise, false. + + + + Compares two levels. + + + + + + Returns a value indicating whether a specified + is less than or equal to another specified . + + A + A + + true if is less than or equal to + ; otherwise, false. + + + + Compares two levels. + + + + + + Returns a value indicating whether two specified + objects have the same value. + + A or . + A or . + + true if the value of is the same as the + value of ; otherwise, false. + + + + Compares two levels. + + + + + + Returns a value indicating whether two specified + objects have different values. + + A or . + A or . + + true if the value of is different from + the value of ; otherwise, false. + + + + Compares two levels. + + + + + + Compares two specified instances. + + The first to compare. + The second to compare. + + A 32-bit signed integer that indicates the relative order of the + two values compared. The return value has these meanings: + + + Value + Meaning + + + Less than zero + is less than . + + + Zero + is equal to . + + + Greater than zero + is greater than . + + + + + + Compares two levels. + + + + + + The level designates a higher level than all the rest. + + + + + The level designates very severe error events. + System unusable, emergencies. + + + + + The level designates very severe error events. + System unusable, emergencies. + + + + + The level designates very severe error events + that will presumably lead the application to abort. + + + + + The level designates very severe error events. + Take immediate action, alerts. + + + + + The level designates very severe error events. + Critical condition, critical. + + + + + The level designates very severe error events. + + + + + The level designates error events that might + still allow the application to continue running. + + + + + The level designates potentially harmful + situations. + + + + + The level designates informational messages + that highlight the progress of the application at the highest level. + + + + + The level designates informational messages that + highlight the progress of the application at coarse-grained level. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates the lowest level possible. + + + + + Gets the name of this level. + + + The name of this level. + + + + Gets the name of this level. + + + + + + Gets the value of this level. + + + The value of this level. + + + + Gets the value of this level. + + + + + + Gets the display name of this level. + + + The display name of this level. + + + + Gets the display name of this level. + + + + + + A strongly-typed collection of objects. + + Nicko Cadell + + + + Creates a read-only wrapper for a LevelCollection instance. + + list to create a readonly wrapper arround + + A LevelCollection wrapper that is read-only. + + + + + Initializes a new instance of the LevelCollection class + that is empty and has the default initial capacity. + + + + + Initializes a new instance of the LevelCollection class + that has the specified initial capacity. + + + The number of elements that the new LevelCollection is initially capable of storing. + + + + + Initializes a new instance of the LevelCollection class + that contains elements copied from the specified LevelCollection. + + The LevelCollection whose elements are copied to the new collection. + + + + Initializes a new instance of the LevelCollection class + that contains elements copied from the specified array. + + The array whose elements are copied to the new list. + + + + Initializes a new instance of the LevelCollection class + that contains elements copied from the specified collection. + + The collection whose elements are copied to the new list. + + + + Allow subclasses to avoid our default constructors + + + + + + Copies the entire LevelCollection to a one-dimensional + array. + + The one-dimensional array to copy to. + + + + Copies the entire LevelCollection to a one-dimensional + array, starting at the specified index of the target array. + + The one-dimensional array to copy to. + The zero-based index in at which copying begins. + + + + Adds a to the end of the LevelCollection. + + The to be added to the end of the LevelCollection. + The index at which the value has been added. + + + + Removes all elements from the LevelCollection. + + + + + Creates a shallow copy of the . + + A new with a shallow copy of the collection data. + + + + Determines whether a given is in the LevelCollection. + + The to check for. + true if is found in the LevelCollection; otherwise, false. + + + + Returns the zero-based index of the first occurrence of a + in the LevelCollection. + + The to locate in the LevelCollection. + + The zero-based index of the first occurrence of + in the entire LevelCollection, if found; otherwise, -1. + + + + + Inserts an element into the LevelCollection at the specified index. + + The zero-based index at which should be inserted. + The to insert. + + is less than zero + -or- + is equal to or greater than . + + + + + Removes the first occurrence of a specific from the LevelCollection. + + The to remove from the LevelCollection. + + The specified was not found in the LevelCollection. + + + + + Removes the element at the specified index of the LevelCollection. + + The zero-based index of the element to remove. + + is less than zero + -or- + is equal to or greater than . + + + + + Returns an enumerator that can iterate through the LevelCollection. + + An for the entire LevelCollection. + + + + Adds the elements of another LevelCollection to the current LevelCollection. + + The LevelCollection whose elements should be added to the end of the current LevelCollection. + The new of the LevelCollection. + + + + Adds the elements of a array to the current LevelCollection. + + The array whose elements should be added to the end of the LevelCollection. + The new of the LevelCollection. + + + + Adds the elements of a collection to the current LevelCollection. + + The collection whose elements should be added to the end of the LevelCollection. + The new of the LevelCollection. + + + + Sets the capacity to the actual number of elements. + + + + + is less than zero + -or- + is equal to or greater than . + + + + + is less than zero + -or- + is equal to or greater than . + + + + + Gets the number of elements actually contained in the LevelCollection. + + + + + Gets a value indicating whether access to the collection is synchronized (thread-safe). + + true if access to the ICollection is synchronized (thread-safe); otherwise, false. + + + + Gets an object that can be used to synchronize access to the collection. + + + + + Gets or sets the at the specified index. + + The zero-based index of the element to get or set. + + is less than zero + -or- + is equal to or greater than . + + + + + Gets a value indicating whether the collection has a fixed size. + + true if the collection has a fixed size; otherwise, false. The default is false + + + + Gets a value indicating whether the IList is read-only. + + true if the collection is read-only; otherwise, false. The default is false + + + + Gets or sets the number of elements the LevelCollection can contain. + + + + + Supports type-safe iteration over a . + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + + + Type visible only to our subclasses + Used to access protected constructor + + + + + A value + + + + + Supports simple iteration over a . + + + + + Initializes a new instance of the Enumerator class. + + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + + + An evaluator that triggers at a threshold level + + + + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + + + Nicko Cadell + + + + The threshold for triggering + + + + + Create a new evaluator using the threshold. + + + + Create a new evaluator using the threshold. + + + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + + + + + + Create a new evaluator using the specified threshold. + + the threshold to trigger at + + + Create a new evaluator using the specified threshold. + + + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + + + + + + Is this the triggering event? + + The event to check + This method returns true, if the event level + is equal or higher than the . + Otherwise it returns false + + + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + + + + + + the threshold to trigger at + + + The that will cause this evaluator to trigger + + + + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + + + + + + Mapping between string name and Level object + + + + Mapping between string name and object. + This mapping is held separately for each . + The level name is case insensitive. + + + Nicko Cadell + + + + Mapping from level name to Level object. The + level name is case insensitive + + + + + Construct the level map + + + + Construct the level map. + + + + + + Clear the internal maps of all levels + + + + Clear the internal maps of all levels + + + + + + Create a new Level and add it to the map + + the string to display for the Level + the level value to give to the Level + + + Create a new Level and add it to the map + + + + + + + Create a new Level and add it to the map + + the string to display for the Level + the level value to give to the Level + the display name to give to the Level + + + Create a new Level and add it to the map + + + + + + Add a Level to the map + + the Level to add + + + Add a Level to the map + + + + + + Lookup a named level from the map + + the name of the level to lookup is taken from this level. + If the level is not set on the map then this level is added + the level in the map with the name specified + + + Lookup a named level from the map. The name of the level to lookup is taken + from the property of the + argument. + + + If no level with the specified name is found then the + argument is added to the level map + and returned. + + + + + + Lookup a by name + + The name of the Level to lookup + a Level from the map with the name specified + + + Returns the from the + map with the name specified. If the no level is + found then null is returned. + + + + + + Return all possible levels as a list of Level objects. + + all possible levels as a list of Level objects + + + Return all possible levels as a list of Level objects. + + + + + + The internal representation of caller location information. + + + + This class uses the System.Diagnostics.StackTrace class to generate + a call stack. The caller's information is then extracted from this stack. + + + The System.Diagnostics.StackTrace class is not supported on the + .NET Compact Framework 1.0 therefore caller location information is not + available on that framework. + + + The System.Diagnostics.StackTrace class has this to say about Release builds: + + + "StackTrace information will be most informative with Debug build configurations. + By default, Debug builds include debug symbols, while Release builds do not. The + debug symbols contain most of the file, method name, line number, and column + information used in constructing StackFrame and StackTrace objects. StackTrace + might not report as many method calls as expected, due to code transformations + that occur during optimization." + + + This means that in a Release build the caller information may be incomplete or may + not exist at all! Therefore caller location information cannot be relied upon in a Release build. + + + Nicko Cadell + Gert Driesen + + + + When location information is not available the constant + NA is returned. Current value of this string + constant is ?. + + + + + Constructor + + The declaring type of the method that is + the stack boundary into the logging system for this call. + + + Initializes a new instance of the + class based on the current thread. + + + + + + Constructor + + The fully qualified class name. + The method name. + The file name. + The line number of the method within the file. + + + Initializes a new instance of the + class with the specified data. + + + + + + The fully qualified type of the LocationInfo class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets the fully qualified class name of the caller making the logging + request. + + + The fully qualified class name of the caller making the logging + request. + + + + Gets the fully qualified class name of the caller making the logging + request. + + + + + + Gets the file name of the caller. + + + The file name of the caller. + + + + Gets the file name of the caller. + + + + + + Gets the line number of the caller. + + + The line number of the caller. + + + + Gets the line number of the caller. + + + + + + Gets the method name of the caller. + + + The method name of the caller. + + + + Gets the method name of the caller. + + + + + + Gets all available caller information + + + All available caller information, in the format + fully.qualified.classname.of.caller.methodName(Filename:line) + + + + Gets all available caller information, in the format + fully.qualified.classname.of.caller.methodName(Filename:line) + + + + + + Gets the stack frames from the stack trace of the caller making the log request + + + + + Static manager that controls the creation of repositories + + + + Static manager that controls the creation of repositories + + + This class is used by the wrapper managers (e.g. ) + to provide access to the objects. + + + This manager also holds the that is used to + lookup and create repositories. The selector can be set either programmatically using + the property, or by setting the log4net.RepositorySelector + AppSetting in the applications config file to the fully qualified type name of the + selector to use. + + + Nicko Cadell + Gert Driesen + + + + Private constructor to prevent instances. Only static methods should be used. + + + + Private constructor to prevent instances. Only static methods should be used. + + + + + + Hook the shutdown event + + + + On the full .NET runtime, the static constructor hooks up the + AppDomain.ProcessExit and AppDomain.DomainUnload> events. + These are used to shutdown the log4net system as the application exits. + + + + + + Register for ProcessExit and DomainUnload events on the AppDomain + + + + This needs to be in a separate method because the events make + a LinkDemand for the ControlAppDomain SecurityPermission. Because + this is a LinkDemand it is demanded at JIT time. Therefore we cannot + catch the exception in the method itself, we have to catch it in the + caller. + + + + + + Return the default instance. + + the repository to lookup in + Return the default instance + + + Gets the for the repository specified + by the argument. + + + + + + Returns the default instance. + + The assembly to use to lookup the repository. + The default instance. + + + + Return the default instance. + + the repository to lookup in + Return the default instance + + + Gets the for the repository specified + by the argument. + + + + + + Returns the default instance. + + The assembly to use to lookup the repository. + The default instance. + + + Returns the default instance. + + + + + + Returns the named logger if it exists. + + The repository to lookup in. + The fully qualified logger name to look for. + + The logger found, or null if the named logger does not exist in the + specified repository. + + + + If the named logger exists (in the specified repository) then it + returns a reference to the logger, otherwise it returns + null. + + + + + + Returns the named logger if it exists. + + The assembly to use to lookup the repository. + The fully qualified logger name to look for. + + The logger found, or null if the named logger does not exist in the + specified assembly's repository. + + + + If the named logger exists (in the specified assembly's repository) then it + returns a reference to the logger, otherwise it returns + null. + + + + + + Returns all the currently defined loggers in the specified repository. + + The repository to lookup in. + All the defined loggers. + + + The root logger is not included in the returned array. + + + + + + Returns all the currently defined loggers in the specified assembly's repository. + + The assembly to use to lookup the repository. + All the defined loggers. + + + The root logger is not included in the returned array. + + + + + + Retrieves or creates a named logger. + + The repository to lookup in. + The name of the logger to retrieve. + The logger with the name specified. + + + Retrieves a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + + + + Retrieves or creates a named logger. + + The assembly to use to lookup the repository. + The name of the logger to retrieve. + The logger with the name specified. + + + Retrieves a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + + + + Shorthand for . + + The repository to lookup in. + The of which the fullname will be used as the name of the logger to retrieve. + The logger with the name specified. + + + Gets the logger for the fully qualified name of the type specified. + + + + + + Shorthand for . + + the assembly to use to lookup the repository + The of which the fullname will be used as the name of the logger to retrieve. + The logger with the name specified. + + + Gets the logger for the fully qualified name of the type specified. + + + + + + Shuts down the log4net system. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in all the + default repositories. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Shuts down the repository for the repository specified. + + The repository to shutdown. + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + repository for the specified. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Shuts down the repository for the repository specified. + + The assembly to use to lookup the repository. + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + repository for the repository. The repository is looked up using + the specified. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Resets all values contained in this repository instance to their defaults. + + The repository to reset. + + + Resets all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set its default "off" value. + + + + + + Resets all values contained in this repository instance to their defaults. + + The assembly to use to lookup the repository to reset. + + + Resets all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set its default "off" value. + + + + + + Creates a repository with the specified name. + + The name of the repository, this must be unique amongst repositories. + The created for the repository. + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + Creates the default type of which is a + object. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The specified repository already exists. + + + + Creates a repository with the specified name. + + The name of the repository, this must be unique amongst repositories. + The created for the repository. + + + Creates the default type of which is a + object. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The specified repository already exists. + + + + Creates a repository with the specified name and repository type. + + The name of the repository, this must be unique to the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The name must be unique. Repositories cannot be redefined. + An Exception will be thrown if the repository already exists. + + + The specified repository already exists. + + + + Creates a repository with the specified name and repository type. + + The name of the repository, this must be unique to the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + The name must be unique. Repositories cannot be redefined. + An Exception will be thrown if the repository already exists. + + + The specified repository already exists. + + + + Creates a repository for the specified assembly and repository type. + + The assembly to use to get the name of the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + + + + Creates a repository for the specified assembly and repository type. + + The assembly to use to get the name of the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + + + + Gets an array of all currently defined repositories. + + An array of all the known objects. + + + Gets an array of all currently defined repositories. + + + + + + Internal method to get pertinent version info. + + A string of version info. + + + + Called when the event fires + + the that is exiting + null + + + Called when the event fires. + + + When the event is triggered the log4net system is . + + + + + + Called when the event fires + + the that is exiting + null + + + Called when the event fires. + + + When the event is triggered the log4net system is . + + + + + + The fully qualified type of the LoggerManager class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Initialize the default repository selector + + + + + Gets or sets the repository selector used by the . + + + The repository selector used by the . + + + + The repository selector () is used by + the to create and select repositories + (). + + + The caller to supplies either a string name + or an assembly (if not supplied the assembly is inferred using + ). + + + This context is used by the selector to lookup a specific repository. + + + For the full .NET Framework, the default repository is DefaultRepositorySelector; + for the .NET Compact Framework CompactRepositorySelector is the default + repository. + + + + + + Implementation of the interface. + + + + This class should be used as the base for all wrapper implementations. + + + Nicko Cadell + Gert Driesen + + + + Constructs a new wrapper for the specified logger. + + The logger to wrap. + + + Constructs a new wrapper for the specified logger. + + + + + + The logger that this object is wrapping + + + + + Gets the implementation behind this wrapper object. + + + The object that this object is implementing. + + + + The Logger object may not be the same object as this object + because of logger decorators. + + + This gets the actual underlying objects that is used to process + the log events. + + + + + + Portable data structure used by + + + + Portable data structure used by + + + Nicko Cadell + + + + The logger name. + + + + The logger name. + + + + + + Level of logging event. + + + + Level of logging event. Level cannot be Serializable + because it is a flyweight. Due to its special serialization it + cannot be declared final either. + + + + + + The application supplied message. + + + + The application supplied message of logging event. + + + + + + The name of thread + + + + The name of thread in which this logging event was generated + + + + + + The time the event was logged + + + + The TimeStamp is stored in the local time zone for this computer. + + + + + + Location information for the caller. + + + + Location information for the caller. + + + + + + String representation of the user + + + + String representation of the user's windows name, + like DOMAIN\username + + + + + + String representation of the identity. + + + + String representation of the current thread's principal identity. + + + + + + The string representation of the exception + + + + The string representation of the exception + + + + + + String representation of the AppDomain. + + + + String representation of the AppDomain. + + + + + + Additional event specific properties + + + + A logger or an appender may attach additional + properties to specific events. These properties + have a string key and an object value. + + + + + + Flags passed to the property + + + + Flags passed to the property + + + Nicko Cadell + + + + Fix the MDC + + + + + Fix the NDC + + + + + Fix the rendered message + + + + + Fix the thread name + + + + + Fix the callers location information + + + CAUTION: Very slow to generate + + + + + Fix the callers windows user name + + + CAUTION: Slow to generate + + + + + Fix the domain friendly name + + + + + Fix the callers principal name + + + CAUTION: May be slow to generate + + + + + Fix the exception text + + + + + Fix the event properties. Active properties must implement in order to be eligible for fixing. + + + + + No fields fixed + + + + + All fields fixed + + + + + Partial fields fixed + + + + This set of partial fields gives good performance. The following fields are fixed: + + + + + + + + + + + + + The internal representation of logging events. + + + + When an affirmative decision is made to log then a + instance is created. This instance + is passed around to the different log4net components. + + + This class is of concern to those wishing to extend log4net. + + + Some of the values in instances of + are considered volatile, that is the values are correct at the + time the event is delivered to appenders, but will not be consistent + at any time afterwards. If an event is to be stored and then processed + at a later time these volatile values must be fixed by calling + . There is a performance penalty + for incurred by calling but it + is essential to maintaining data consistency. + + + Nicko Cadell + Gert Driesen + Douglas de la Torre + Daniel Cazzulino + + + + The key into the Properties map for the host name value. + + + + + The key into the Properties map for the thread identity value. + + + + + The key into the Properties map for the user name value. + + + + + Initializes a new instance of the class + from the supplied parameters. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The repository this event is logged in. + The name of the logger of this event. + The level of this event. + The message of this event. + The exception for this event. + + + Except , and , + all fields of LoggingEvent are filled when actually needed. Call + to cache all data locally + to prevent inconsistencies. + + This method is called by the log4net framework + to create a logging event. + + + + + + Initializes a new instance of the class + using specific data. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The repository this event is logged in. + Data used to initialize the logging event. + The fields in the struct that have already been fixed. + + + This constructor is provided to allow a + to be created independently of the log4net framework. This can + be useful if you require a custom serialization scheme. + + + Use the method to obtain an + instance of the class. + + + The parameter should be used to specify which fields in the + struct have been preset. Fields not specified in the + will be captured from the environment if requested or fixed. + + + + + + Initializes a new instance of the class + using specific data. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The repository this event is logged in. + Data used to initialize the logging event. + + + This constructor is provided to allow a + to be created independently of the log4net framework. This can + be useful if you require a custom serialization scheme. + + + Use the method to obtain an + instance of the class. + + + This constructor sets this objects flags to , + this assumes that all the data relating to this event is passed in via the + parameter and no other data should be captured from the environment. + + + + + + Initializes a new instance of the class + using specific data. + + Data used to initialize the logging event. + + + This constructor is provided to allow a + to be created independently of the log4net framework. This can + be useful if you require a custom serialization scheme. + + + Use the method to obtain an + instance of the class. + + + This constructor sets this objects flags to , + this assumes that all the data relating to this event is passed in via the + parameter and no other data should be captured from the environment. + + + + + + Serialization constructor + + The that holds the serialized object data. + The that contains contextual information about the source or destination. + + + Initializes a new instance of the class + with serialized data. + + + + + + Ensure that the repository is set. + + the value for the repository + + + + Write the rendered message to a TextWriter + + the writer to write the message to + + + Unlike the property this method + does store the message data in the internal cache. Therefore + if called only once this method should be faster than the + property, however if the message is + to be accessed multiple times then the property will be more efficient. + + + + + + Serializes this object into the provided. + + The to populate with data. + The destination for this serialization. + + + The data in this event must be fixed before it can be serialized. + + + The method must be called during the + method call if this event + is to be used outside that method. + + + + + + Gets the portable data for this . + + The for this event. + + + A new can be constructed using a + instance. + + + Does a fix of the data + in the logging event before returning the event data. + + + + + + Gets the portable data for this . + + The set of data to ensure is fixed in the LoggingEventData + The for this event. + + + A new can be constructed using a + instance. + + + + + + Returns this event's exception's rendered using the + . + + + This event's exception's rendered using the . + + + + Obsolete. Use instead. + + + + + + Returns this event's exception's rendered using the + . + + + This event's exception's rendered using the . + + + + Returns this event's exception's rendered using the + . + + + + + + Fix instance fields that hold volatile data. + + + + Some of the values in instances of + are considered volatile, that is the values are correct at the + time the event is delivered to appenders, but will not be consistent + at any time afterwards. If an event is to be stored and then processed + at a later time these volatile values must be fixed by calling + . There is a performance penalty + incurred by calling but it + is essential to maintaining data consistency. + + + Calling is equivalent to + calling passing the parameter + false. + + + See for more + information. + + + + + + Fixes instance fields that hold volatile data. + + Set to true to not fix data that takes a long time to fix. + + + Some of the values in instances of + are considered volatile, that is the values are correct at the + time the event is delivered to appenders, but will not be consistent + at any time afterwards. If an event is to be stored and then processed + at a later time these volatile values must be fixed by calling + . There is a performance penalty + for incurred by calling but it + is essential to maintaining data consistency. + + + The param controls the data that + is fixed. Some of the data that can be fixed takes a long time to + generate, therefore if you do not require those settings to be fixed + they can be ignored by setting the param + to true. This setting will ignore the + and settings. + + + Set to false to ensure that all + settings are fixed. + + + + + + Fix the fields specified by the parameter + + the fields to fix + + + Only fields specified in the will be fixed. + Fields will not be fixed if they have previously been fixed. + It is not possible to 'unfix' a field. + + + + + + Lookup a composite property in this event + + the key for the property to lookup + the value for the property + + + This event has composite properties that combine together properties from + several different contexts in the following order: + + + this events properties + + This event has that can be set. These + properties are specific to this event only. + + + + the thread properties + + The that are set on the current + thread. These properties are shared by all events logged on this thread. + + + + the global properties + + The that are set globally. These + properties are shared by all the threads in the AppDomain. + + + + + + + + + Get all the composite properties in this event + + the containing all the properties + + + See for details of the composite properties + stored by the event. + + + This method returns a single containing all the + properties defined for this event. + + + + + + The internal logging event data. + + + + + The internal logging event data. + + + + + The internal logging event data. + + + + + The fully qualified Type of the calling + logger class in the stack frame (i.e. the declaring type of the method). + + + + + The application supplied message of logging event. + + + + + The exception that was thrown. + + + This is not serialized. The string representation + is serialized instead. + + + + + The repository that generated the logging event + + + This is not serialized. + + + + + The fix state for this event + + + These flags indicate which fields have been fixed. + Not serialized. + + + + + Indicated that the internal cache is updateable (ie not fixed) + + + This is a seperate flag to m_fixFlags as it allows incrementel fixing and simpler + changes in the caching strategy. + + + + + Gets the time when the current process started. + + + This is the time when this process started. + + + + The TimeStamp is stored in the local time zone for this computer. + + + Tries to get the start time for the current process. + Failing that it returns the time of the first call to + this property. + + + Note that AppDomains may be loaded and unloaded within the + same process without the process terminating and therefore + without the process start time being reset. + + + + + + Gets the of the logging event. + + + The of the logging event. + + + + Gets the of the logging event. + + + + + + Gets the time of the logging event. + + + The time of the logging event. + + + + The TimeStamp is stored in the local time zone for this computer. + + + + + + Gets the name of the logger that logged the event. + + + The name of the logger that logged the event. + + + + Gets the name of the logger that logged the event. + + + + + + Gets the location information for this logging event. + + + The location information for this logging event. + + + + The collected information is cached for future use. + + + See the class for more information on + supported frameworks and the different behavior in Debug and + Release builds. + + + + + + Gets the message object used to initialize this event. + + + The message object used to initialize this event. + + + + Gets the message object used to initialize this event. + Note that this event may not have a valid message object. + If the event is serialized the message object will not + be transferred. To get the text of the message the + property must be used + not this property. + + + If there is no defined message object for this event then + null will be returned. + + + + + + Gets the exception object used to initialize this event. + + + The exception object used to initialize this event. + + + + Gets the exception object used to initialize this event. + Note that this event may not have a valid exception object. + If the event is serialized the exception object will not + be transferred. To get the text of the exception the + method must be used + not this property. + + + If there is no defined exception object for this event then + null will be returned. + + + + + + The that this event was created in. + + + + The that this event was created in. + + + + + + Gets the message, rendered through the . + + + The message rendered through the . + + + + The collected information is cached for future use. + + + + + + Gets the name of the current thread. + + + The name of the current thread, or the thread ID when + the name is not available. + + + + The collected information is cached for future use. + + + + + + Gets the name of the current user. + + + The name of the current user, or NOT AVAILABLE when the + underlying runtime has no support for retrieving the name of the + current user. + + + + Calls WindowsIdentity.GetCurrent().Name to get the name of + the current windows user. + + + To improve performance, we could cache the string representation of + the name, and reuse that as long as the identity stayed constant. + Once the identity changed, we would need to re-assign and re-render + the string. + + + However, the WindowsIdentity.GetCurrent() call seems to + return different objects every time, so the current implementation + doesn't do this type of caching. + + + Timing for these operations: + + + + Method + Results + + + WindowsIdentity.GetCurrent() + 10000 loops, 00:00:00.2031250 seconds + + + WindowsIdentity.GetCurrent().Name + 10000 loops, 00:00:08.0468750 seconds + + + + This means we could speed things up almost 40 times by caching the + value of the WindowsIdentity.GetCurrent().Name property, since + this takes (8.04-0.20) = 7.84375 seconds. + + + + + + Gets the identity of the current thread principal. + + + The string name of the identity of the current thread principal. + + + + Calls System.Threading.Thread.CurrentPrincipal.Identity.Name to get + the name of the current thread principal. + + + + + + Gets the AppDomain friendly name. + + + The AppDomain friendly name. + + + + Gets the AppDomain friendly name. + + + + + + Additional event specific properties. + + + Additional event specific properties. + + + + A logger or an appender may attach additional + properties to specific events. These properties + have a string key and an object value. + + + This property is for events that have been added directly to + this event. The aggregate properties (which include these + event properties) can be retrieved using + and . + + + Once the properties have been fixed this property + returns the combined cached properties. This ensures that updates to + this property are always reflected in the underlying storage. When + returning the combined properties there may be more keys in the + Dictionary than expected. + + + + + + The fixed fields in this event + + + The set of fields that are fixed in this event + + + + Fields will not be fixed if they have previously been fixed. + It is not possible to 'unfix' a field. + + + + + + Implementation of wrapper interface. + + + + This implementation of the interface + forwards to the held by the base class. + + + This logger has methods to allow the caller to log at the following + levels: + + + + DEBUG + + The and methods log messages + at the DEBUG level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + INFO + + The and methods log messages + at the INFO level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + WARN + + The and methods log messages + at the WARN level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + ERROR + + The and methods log messages + at the ERROR level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + FATAL + + The and methods log messages + at the FATAL level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + + The values for these levels and their semantic meanings can be changed by + configuring the for the repository. + + + Nicko Cadell + Gert Driesen + + + + The ILog interface is use by application to log messages into + the log4net framework. + + + + Use the to obtain logger instances + that implement this interface. The + static method is used to get logger instances. + + + This class contains methods for logging at different levels and also + has properties for determining if those logging levels are + enabled in the current configuration. + + + This interface can be implemented in different ways. This documentation + specifies reasonable behavior that a caller can expect from the actual + implementation, however different implementations reserve the right to + do things differently. + + + Simple example of logging messages + + ILog log = LogManager.GetLogger("application-log"); + + log.Info("Application Start"); + log.Debug("This is a debug message"); + + if (log.IsDebugEnabled) + { + log.Debug("This is another debug message"); + } + + + + + Nicko Cadell + Gert Driesen + + + Log a message object with the level. + + Log a message object with the level. + + The message object to log. + + + This method first checks if this logger is DEBUG + enabled by comparing the level of this logger with the + level. If this logger is + DEBUG enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a formatted string with the level. + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + Log a message object with the level. + + Logs a message object with the level. + + + + This method first checks if this logger is INFO + enabled by comparing the level of this logger with the + level. If this logger is + INFO enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + The message object to log. + + + + + + Logs a message object with the INFO level including + the stack trace of the passed + as a parameter. + + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a formatted message string with the level. + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + Log a message object with the level. + + Log a message object with the level. + + + + This method first checks if this logger is WARN + enabled by comparing the level of this logger with the + level. If this logger is + WARN enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + The message object to log. + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a formatted message string with the level. + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + Log a message object with the level. + + Logs a message object with the level. + + The message object to log. + + + This method first checks if this logger is ERROR + enabled by comparing the level of this logger with the + level. If this logger is + ERROR enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a formatted message string with the level. + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + Log a message object with the level. + + Log a message object with the level. + + + + This method first checks if this logger is FATAL + enabled by comparing the level of this logger with the + level. If this logger is + FATAL enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + The message object to log. + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a formatted message string with the level. + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Checks if this logger is enabled for the level. + + + true if this logger is enabled for events, false otherwise. + + + + This function is intended to lessen the computational cost of + disabled log debug statements. + + For some ILog interface log, when you write: + + log.Debug("This is entry number: " + i ); + + + You incur the cost constructing the message, string construction and concatenation in + this case, regardless of whether the message is logged or not. + + + If you are worried about speed (who isn't), then you should write: + + + if (log.IsDebugEnabled) + { + log.Debug("This is entry number: " + i ); + } + + + This way you will not incur the cost of parameter + construction if debugging is disabled for log. On + the other hand, if the log is debug enabled, you + will incur the cost of evaluating whether the logger is debug + enabled twice. Once in and once in + the . This is an insignificant overhead + since evaluating a logger takes about 1% of the time it + takes to actually log. This is the preferred style of logging. + + Alternatively if your logger is available statically then the is debug + enabled state can be stored in a static variable like this: + + + private static readonly bool isDebugEnabled = log.IsDebugEnabled; + + + Then when you come to log you can write: + + + if (isDebugEnabled) + { + log.Debug("This is entry number: " + i ); + } + + + This way the debug enabled state is only queried once + when the class is loaded. Using a private static readonly + variable is the most efficient because it is a run time constant + and can be heavily optimized by the JIT compiler. + + + Of course if you use a static readonly variable to + hold the enabled state of the logger then you cannot + change the enabled state at runtime to vary the logging + that is produced. You have to decide if you need absolute + speed or runtime flexibility. + + + + + + + + Checks if this logger is enabled for the level. + + + true if this logger is enabled for events, false otherwise. + + + For more information see . + + + + + + + + Checks if this logger is enabled for the level. + + + true if this logger is enabled for events, false otherwise. + + + For more information see . + + + + + + + + Checks if this logger is enabled for the level. + + + true if this logger is enabled for events, false otherwise. + + + For more information see . + + + + + + + + Checks if this logger is enabled for the level. + + + true if this logger is enabled for events, false otherwise. + + + For more information see . + + + + + + + + Construct a new wrapper for the specified logger. + + The logger to wrap. + + + Construct a new wrapper for the specified logger. + + + + + + Virtual method called when the configuration of the repository changes + + the repository holding the levels + + + Virtual method called when the configuration of the repository changes + + + + + + Logs a message object with the DEBUG level. + + The message object to log. + + + This method first checks if this logger is DEBUG + enabled by comparing the level of this logger with the + DEBUG level. If this logger is + DEBUG enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + Logs a message object with the DEBUG level + + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the DEBUG level including + the stack trace of the passed + as a parameter. + + + See the form for more detailed information. + + + + + + + Logs a formatted message string with the DEBUG level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the DEBUG level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the DEBUG level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the DEBUG level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the DEBUG level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a message object with the INFO level. + + The message object to log. + + + This method first checks if this logger is INFO + enabled by comparing the level of this logger with the + INFO level. If this logger is + INFO enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + Logs a message object with the INFO level. + + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the INFO level including + the stack trace of the + passed as a parameter. + + + See the form for more detailed information. + + + + + + + Logs a formatted message string with the INFO level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the INFO level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the INFO level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the INFO level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the INFO level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a message object with the WARN level. + + the message object to log + + + This method first checks if this logger is WARN + enabled by comparing the level of this logger with the + WARN level. If this logger is + WARN enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger and + also higher in the hierarchy depending on the value of the + additivity flag. + + + WARNING Note that passing an to this + method will print the name of the but no + stack trace. To print a stack trace use the + form instead. + + + + + + Logs a message object with the WARN level + + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the WARN level including + the stack trace of the + passed as a parameter. + + + See the form for more detailed information. + + + + + + + Logs a formatted message string with the WARN level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the WARN level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the WARN level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the WARN level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the WARN level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a message object with the ERROR level. + + The message object to log. + + + This method first checks if this logger is ERROR + enabled by comparing the level of this logger with the + ERROR level. If this logger is + ERROR enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger and + also higher in the hierarchy depending on the value of the + additivity flag. + + + WARNING Note that passing an to this + method will print the name of the but no + stack trace. To print a stack trace use the + form instead. + + + + + + Logs a message object with the ERROR level + + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the ERROR level including + the stack trace of the + passed as a parameter. + + + See the form for more detailed information. + + + + + + + Logs a formatted message string with the ERROR level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the ERROR level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the ERROR level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the ERROR level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the ERROR level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a message object with the FATAL level. + + The message object to log. + + + This method first checks if this logger is FATAL + enabled by comparing the level of this logger with the + FATAL level. If this logger is + FATAL enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger and + also higher in the hierarchy depending on the value of the + additivity flag. + + + WARNING Note that passing an to this + method will print the name of the but no + stack trace. To print a stack trace use the + form instead. + + + + + + Logs a message object with the FATAL level + + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the FATAL level including + the stack trace of the + passed as a parameter. + + + See the form for more detailed information. + + + + + + + Logs a formatted message string with the FATAL level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the FATAL level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the FATAL level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the FATAL level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the FATAL level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Event handler for the event + + the repository + Empty + + + + The fully qualified name of this declaring type not the type of any subclass. + + + + + Checks if this logger is enabled for the DEBUG + level. + + + true if this logger is enabled for DEBUG events, + false otherwise. + + + + This function is intended to lessen the computational cost of + disabled log debug statements. + + + For some log Logger object, when you write: + + + log.Debug("This is entry number: " + i ); + + + You incur the cost constructing the message, concatenation in + this case, regardless of whether the message is logged or not. + + + If you are worried about speed, then you should write: + + + if (log.IsDebugEnabled()) + { + log.Debug("This is entry number: " + i ); + } + + + This way you will not incur the cost of parameter + construction if debugging is disabled for log. On + the other hand, if the log is debug enabled, you + will incur the cost of evaluating whether the logger is debug + enabled twice. Once in IsDebugEnabled and once in + the Debug. This is an insignificant overhead + since evaluating a logger takes about 1% of the time it + takes to actually log. + + + + + + Checks if this logger is enabled for the INFO level. + + + true if this logger is enabled for INFO events, + false otherwise. + + + + See for more information and examples + of using this method. + + + + + + + Checks if this logger is enabled for the WARN level. + + + true if this logger is enabled for WARN events, + false otherwise. + + + + See for more information and examples + of using this method. + + + + + + + Checks if this logger is enabled for the ERROR level. + + + true if this logger is enabled for ERROR events, + false otherwise. + + + + See for more information and examples of using this method. + + + + + + + Checks if this logger is enabled for the FATAL level. + + + true if this logger is enabled for FATAL events, + false otherwise. + + + + See for more information and examples of using this method. + + + + + + + provides method information without actually referencing a System.Reflection.MethodBase + as that would require that the containing assembly is loaded. + + + + + + When location information is not available the constant + NA is returned. Current value of this string + constant is ?. + + + + + constructs a method item for an unknown method. + + + + + constructs a method item from the name of the method. + + + + + + constructs a method item from the name of the method and its parameters. + + + + + + + constructs a method item from a method base by determining the method name and its parameters. + + + + + + The fully qualified type of the StackFrameItem class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets the method name of the caller making the logging + request. + + + The method name of the caller making the logging + request. + + + + Gets the method name of the caller making the logging + request. + + + + + + Gets the method parameters of the caller making + the logging request. + + + The method parameters of the caller making + the logging request + + + + Gets the method parameters of the caller making + the logging request. + + + + + + A SecurityContext used by log4net when interacting with protected resources + + + + A SecurityContext used by log4net when interacting with protected resources + for example with operating system services. This can be used to impersonate + a principal that has been granted privileges on the system resources. + + + Nicko Cadell + + + + Impersonate this SecurityContext + + State supplied by the caller + An instance that will + revoke the impersonation of this SecurityContext, or null + + + Impersonate this security context. Further calls on the current + thread should now be made in the security context provided + by this object. When the result + method is called the security + context of the thread should be reverted to the state it was in + before was called. + + + + + + The providers default instances. + + + + A configured component that interacts with potentially protected system + resources uses a to provide the elevated + privileges required. If the object has + been not been explicitly provided to the component then the component + will request one from this . + + + By default the is + an instance of which returns only + objects. This is a reasonable default + where the privileges required are not know by the system. + + + This default behavior can be overridden by subclassing the + and overriding the method to return + the desired objects. The default provider + can be replaced by programmatically setting the value of the + property. + + + An alternative is to use the log4net.Config.SecurityContextProviderAttribute + This attribute can be applied to an assembly in the same way as the + log4net.Config.XmlConfiguratorAttribute". The attribute takes + the type to use as the as an argument. + + + Nicko Cadell + + + + The default provider + + + + + Protected default constructor to allow subclassing + + + + Protected default constructor to allow subclassing + + + + + + Create a SecurityContext for a consumer + + The consumer requesting the SecurityContext + An impersonation context + + + The default implementation is to return a . + + + Subclasses should override this method to provide their own + behavior. + + + + + + Gets or sets the default SecurityContextProvider + + + The default SecurityContextProvider + + + + The default provider is used by configured components that + require a and have not had one + given to them. + + + By default this is an instance of + that returns objects. + + + The default provider can be set programmatically by setting + the value of this property to a sub class of + that has the desired behavior. + + + + + + provides stack frame information without actually referencing a System.Diagnostics.StackFrame + as that would require that the containing assembly is loaded. + + + + + + When location information is not available the constant + NA is returned. Current value of this string + constant is ?. + + + + + returns a stack frame item from a stack frame. This + + + + + + + The fully qualified type of the StackFrameItem class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets the fully qualified class name of the caller making the logging + request. + + + The fully qualified class name of the caller making the logging + request. + + + + Gets the fully qualified class name of the caller making the logging + request. + + + + + + Gets the file name of the caller. + + + The file name of the caller. + + + + Gets the file name of the caller. + + + + + + Gets the line number of the caller. + + + The line number of the caller. + + + + Gets the line number of the caller. + + + + + + Gets the method name of the caller. + + + The method name of the caller. + + + + Gets the method name of the caller. + + + + + + Gets all available caller information + + + All available caller information, in the format + fully.qualified.classname.of.caller.methodName(Filename:line) + + + + Gets all available caller information, in the format + fully.qualified.classname.of.caller.methodName(Filename:line) + + + + + + An evaluator that triggers after specified number of seconds. + + + + This evaluator will trigger if the specified time period + has passed since last check. + + + Robert Sevcik + + + + The default time threshold for triggering in seconds. Zero means it won't trigger at all. + + + + + The time threshold for triggering in seconds. Zero means it won't trigger at all. + + + + + The time of last check. This gets updated when the object is created and when the evaluator triggers. + + + + + Create a new evaluator using the time threshold in seconds. + + + + Create a new evaluator using the time threshold in seconds. + + + This evaluator will trigger if the specified time period + has passed since last check. + + + + + + Create a new evaluator using the specified time threshold in seconds. + + + The time threshold in seconds to trigger after. + Zero means it won't trigger at all. + + + + Create a new evaluator using the specified time threshold in seconds. + + + This evaluator will trigger if the specified time period + has passed since last check. + + + + + + Is this the triggering event? + + The event to check + This method returns true, if the specified time period + has passed since last check.. + Otherwise it returns false + + + This evaluator will trigger if the specified time period + has passed since last check. + + + + + + The time threshold in seconds to trigger after + + + The time threshold in seconds to trigger after. + Zero means it won't trigger at all. + + + + This evaluator will trigger if the specified time period + has passed since last check. + + + + + + Delegate used to handle creation of new wrappers. + + The logger to wrap in a wrapper. + + + Delegate used to handle creation of new wrappers. This delegate + is called from the + method to construct the wrapper for the specified logger. + + + The delegate to use is supplied to the + constructor. + + + + + + Maps between logger objects and wrapper objects. + + + + This class maintains a mapping between objects and + objects. Use the method to + lookup the for the specified . + + + New wrapper instances are created by the + method. The default behavior is for this method to delegate construction + of the wrapper to the delegate supplied + to the constructor. This allows specialization of the behavior without + requiring subclassing of this type. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the + + The handler to use to create the wrapper objects. + + + Initializes a new instance of the class with + the specified handler to create the wrapper objects. + + + + + + Gets the wrapper object for the specified logger. + + The wrapper object for the specified logger + + + If the logger is null then the corresponding wrapper is null. + + + Looks up the wrapper it it has previously been requested and + returns it. If the wrapper has never been requested before then + the virtual method is + called. + + + + + + Creates the wrapper object for the specified logger. + + The logger to wrap in a wrapper. + The wrapper object for the logger. + + + This implementation uses the + passed to the constructor to create the wrapper. This method + can be overridden in a subclass. + + + + + + Called when a monitored repository shutdown event is received. + + The that is shutting down + + + This method is called when a that this + is holding loggers for has signaled its shutdown + event . The default + behavior of this method is to release the references to the loggers + and their wrappers generated for this repository. + + + + + + Event handler for repository shutdown event. + + The sender of the event. + The event args. + + + + Map of logger repositories to hashtables of ILogger to ILoggerWrapper mappings + + + + + The handler to use to create the extension wrapper objects. + + + + + Internal reference to the delegate used to register for repository shutdown events. + + + + + Gets the map of logger repositories. + + + Map of logger repositories. + + + + Gets the hashtable that is keyed on . The + values are hashtables keyed on with the + value being the corresponding . + + + + + + Formats a as "HH:mm:ss,fff". + + + + Formats a in the format "HH:mm:ss,fff" for example, "15:49:37,459". + + + Nicko Cadell + Gert Driesen + + + + Render a as a string. + + + + Interface to abstract the rendering of a + instance into a string. + + + The method is used to render the + date to a text writer. + + + Nicko Cadell + Gert Driesen + + + + Formats the specified date as a string. + + The date to format. + The writer to write to. + + + Format the as a string and write it + to the provided. + + + + + + String constant used to specify AbsoluteTimeDateFormat in layouts. Current value is ABSOLUTE. + + + + + String constant used to specify DateTimeDateFormat in layouts. Current value is DATE. + + + + + String constant used to specify ISO8601DateFormat in layouts. Current value is ISO8601. + + + + + Renders the date into a string. Format is "HH:mm:ss". + + The date to render into a string. + The string builder to write to. + + + Subclasses should override this method to render the date + into a string using a precision up to the second. This method + will be called at most once per second and the result will be + reused if it is needed again during the same second. + + + + + + Renders the date into a string. Format is "HH:mm:ss,fff". + + The date to render into a string. + The writer to write to. + + + Uses the method to generate the + time string up to the seconds and then appends the current + milliseconds. The results from are + cached and is called at most once + per second. + + + Sub classes should override + rather than . + + + + + + Last stored time with precision up to the second. + + + + + Last stored time with precision up to the second, formatted + as a string. + + + + + Last stored time with precision up to the second, formatted + as a string. + + + + + Formats a as "dd MMM yyyy HH:mm:ss,fff" + + + + Formats a in the format + "dd MMM yyyy HH:mm:ss,fff" for example, + "06 Nov 1994 15:49:37,459". + + + Nicko Cadell + Gert Driesen + Angelika Schnagl + + + + Default constructor. + + + + Initializes a new instance of the class. + + + + + + Formats the date without the milliseconds part + + The date to format. + The string builder to write to. + + + Formats a DateTime in the format "dd MMM yyyy HH:mm:ss" + for example, "06 Nov 1994 15:49:37". + + + The base class will append the ",fff" milliseconds section. + This method will only be called at most once per second. + + + + + + The format info for the invariant culture. + + + + + Formats the as "yyyy-MM-dd HH:mm:ss,fff". + + + + Formats the specified as a string: "yyyy-MM-dd HH:mm:ss,fff". + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Initializes a new instance of the class. + + + + + + Formats the date without the milliseconds part + + The date to format. + The string builder to write to. + + + Formats the date specified as a string: "yyyy-MM-dd HH:mm:ss". + + + The base class will append the ",fff" milliseconds section. + This method will only be called at most once per second. + + + + + + Formats the using the method. + + + + Formats the using the method. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + The format string. + + + Initializes a new instance of the class + with the specified format string. + + + The format string must be compatible with the options + that can be supplied to . + + + + + + Formats the date using . + + The date to convert to a string. + The writer to write to. + + + Uses the date format string supplied to the constructor to call + the method to format the date. + + + + + + The format string used to format the . + + + + The format string must be compatible with the options + that can be supplied to . + + + + + + This filter drops all . + + + + You can add this filter to the end of a filter chain to + switch from the default "accept all unless instructed otherwise" + filtering behavior to a "deny all unless instructed otherwise" + behavior. + + + Nicko Cadell + Gert Driesen + + + + Subclass this type to implement customized logging event filtering + + + + Users should extend this class to implement customized logging + event filtering. Note that and + , the parent class of all standard + appenders, have built-in filtering rules. It is suggested that you + first use and understand the built-in rules before rushing to write + your own custom filters. + + + This abstract class assumes and also imposes that filters be + organized in a linear chain. The + method of each filter is called sequentially, in the order of their + addition to the chain. + + + The method must return one + of the integer constants , + or . + + + If the value is returned, then the log event is dropped + immediately without consulting with the remaining filters. + + + If the value is returned, then the next filter + in the chain is consulted. If there are no more filters in the + chain, then the log event is logged. Thus, in the presence of no + filters, the default behavior is to log all logging events. + + + If the value is returned, then the log + event is logged without consulting the remaining filters. + + + The philosophy of log4net filters is largely inspired from the + Linux ipchains. + + + Nicko Cadell + Gert Driesen + + + + Implement this interface to provide customized logging event filtering + + + + Users should implement this interface to implement customized logging + event filtering. Note that and + , the parent class of all standard + appenders, have built-in filtering rules. It is suggested that you + first use and understand the built-in rules before rushing to write + your own custom filters. + + + This abstract class assumes and also imposes that filters be + organized in a linear chain. The + method of each filter is called sequentially, in the order of their + addition to the chain. + + + The method must return one + of the integer constants , + or . + + + If the value is returned, then the log event is dropped + immediately without consulting with the remaining filters. + + + If the value is returned, then the next filter + in the chain is consulted. If there are no more filters in the + chain, then the log event is logged. Thus, in the presence of no + filters, the default behavior is to log all logging events. + + + If the value is returned, then the log + event is logged without consulting the remaining filters. + + + The philosophy of log4net filters is largely inspired from the + Linux ipchains. + + + Nicko Cadell + Gert Driesen + + + + Decide if the logging event should be logged through an appender. + + The LoggingEvent to decide upon + The decision of the filter + + + If the decision is , then the event will be + dropped. If the decision is , then the next + filter, if any, will be invoked. If the decision is then + the event will be logged without consulting with other filters in + the chain. + + + + + + Property to get and set the next filter + + + The next filter in the chain + + + + Filters are typically composed into chains. This property allows the next filter in + the chain to be accessed. + + + + + + Points to the next filter in the filter chain. + + + + See for more information. + + + + + + Initialize the filter with the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + Typically filter's options become active immediately on set, + however this method must still be called. + + + + + + Decide if the should be logged through an appender. + + The to decide upon + The decision of the filter + + + If the decision is , then the event will be + dropped. If the decision is , then the next + filter, if any, will be invoked. If the decision is then + the event will be logged without consulting with other filters in + the chain. + + + This method is marked abstract and must be implemented + in a subclass. + + + + + + Property to get and set the next filter + + + The next filter in the chain + + + + Filters are typically composed into chains. This property allows the next filter in + the chain to be accessed. + + + + + + Default constructor + + + + + Always returns the integer constant + + the LoggingEvent to filter + Always returns + + + Ignores the event being logged and just returns + . This can be used to change the default filter + chain behavior from to . This filter + should only be used as the last filter in the chain + as any further filters will be ignored! + + + + + + The return result from + + + + The return result from + + + + + + The log event must be dropped immediately without + consulting with the remaining filters, if any, in the chain. + + + + + This filter is neutral with respect to the log event. + The remaining filters, if any, should be consulted for a final decision. + + + + + The log event must be logged immediately without + consulting with the remaining filters, if any, in the chain. + + + + + This is a very simple filter based on matching. + + + + The filter admits two options and + . If there is an exact match between the value + of the option and the of the + , then the method returns in + case the option value is set + to true, if it is false then + is returned. If the does not match then + the result will be . + + + Nicko Cadell + Gert Driesen + + + + flag to indicate if the filter should on a match + + + + + the to match against + + + + + Default constructor + + + + + Tests if the of the logging event matches that of the filter + + the event to filter + see remarks + + + If the of the event matches the level of the + filter then the result of the function depends on the + value of . If it is true then + the function will return , it it is false then it + will return . If the does not match then + the result will be . + + + + + + when matching + + + + The property is a flag that determines + the behavior when a matching is found. If the + flag is set to true then the filter will the + logging event, otherwise it will the event. + + + The default is true i.e. to the event. + + + + + + The that the filter will match + + + + The level that this filter will attempt to match against the + level. If a match is found then + the result depends on the value of . + + + + + + This is a simple filter based on matching. + + + + The filter admits three options and + that determine the range of priorities that are matched, and + . If there is a match between the range + of priorities and the of the , then the + method returns in case the + option value is set to true, if it is false + then is returned. If there is no match, is returned. + + + Nicko Cadell + Gert Driesen + + + + Flag to indicate the behavior when matching a + + + + + the minimum value to match + + + + + the maximum value to match + + + + + Default constructor + + + + + Check if the event should be logged. + + the logging event to check + see remarks + + + If the of the logging event is outside the range + matched by this filter then + is returned. If the is matched then the value of + is checked. If it is true then + is returned, otherwise + is returned. + + + + + + when matching and + + + + The property is a flag that determines + the behavior when a matching is found. If the + flag is set to true then the filter will the + logging event, otherwise it will the event. + + + The default is true i.e. to the event. + + + + + + Set the minimum matched + + + + The minimum level that this filter will attempt to match against the + level. If a match is found then + the result depends on the value of . + + + + + + Sets the maximum matched + + + + The maximum level that this filter will attempt to match against the + level. If a match is found then + the result depends on the value of . + + + + + + Simple filter to match a string in the event's logger name. + + + + The works very similar to the . It admits two + options and . If the + of the starts + with the value of the option, then the + method returns in + case the option value is set to true, + if it is false then is returned. + + + Daniel Cazzulino + + + + Flag to indicate the behavior when we have a match + + + + + The logger name string to substring match against the event + + + + + Default constructor + + + + + Check if this filter should allow the event to be logged + + the event being logged + see remarks + + + The rendered message is matched against the . + If the equals the beginning of + the incoming () + then a match will have occurred. If no match occurs + this function will return + allowing other filters to check the event. If a match occurs then + the value of is checked. If it is + true then is returned otherwise + is returned. + + + + + + when matching + + + + The property is a flag that determines + the behavior when a matching is found. If the + flag is set to true then the filter will the + logging event, otherwise it will the event. + + + The default is true i.e. to the event. + + + + + + The that the filter will match + + + + This filter will attempt to match this value against logger name in + the following way. The match will be done against the beginning of the + logger name (using ). The match is + case sensitive. If a match is found then + the result depends on the value of . + + + + + + Simple filter to match a keyed string in the + + + + Simple filter to match a keyed string in the + + + As the MDC has been replaced with layered properties the + should be used instead. + + + Nicko Cadell + Gert Driesen + + + + Simple filter to match a string an event property + + + + Simple filter to match a string in the value for a + specific event property + + + Nicko Cadell + + + + Simple filter to match a string in the rendered message + + + + Simple filter to match a string in the rendered message + + + Nicko Cadell + Gert Driesen + + + + Flag to indicate the behavior when we have a match + + + + + The string to substring match against the message + + + + + A string regex to match + + + + + A regex object to match (generated from m_stringRegexToMatch) + + + + + Default constructor + + + + + Initialize and precompile the Regex if required + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Check if this filter should allow the event to be logged + + the event being logged + see remarks + + + The rendered message is matched against the . + If the occurs as a substring within + the message then a match will have occurred. If no match occurs + this function will return + allowing other filters to check the event. If a match occurs then + the value of is checked. If it is + true then is returned otherwise + is returned. + + + + + + when matching or + + + + The property is a flag that determines + the behavior when a matching is found. If the + flag is set to true then the filter will the + logging event, otherwise it will the event. + + + The default is true i.e. to the event. + + + + + + Sets the static string to match + + + + The string that will be substring matched against + the rendered message. If the message contains this + string then the filter will match. If a match is found then + the result depends on the value of . + + + One of or + must be specified. + + + + + + Sets the regular expression to match + + + + The regular expression pattern that will be matched against + the rendered message. If the message matches this + pattern then the filter will match. If a match is found then + the result depends on the value of . + + + One of or + must be specified. + + + + + + The key to use to lookup the string from the event properties + + + + + Default constructor + + + + + Check if this filter should allow the event to be logged + + the event being logged + see remarks + + + The event property for the is matched against + the . + If the occurs as a substring within + the property value then a match will have occurred. If no match occurs + this function will return + allowing other filters to check the event. If a match occurs then + the value of is checked. If it is + true then is returned otherwise + is returned. + + + + + + The key to lookup in the event properties and then match against. + + + + The key name to use to lookup in the properties map of the + . The match will be performed against + the value of this property if it exists. + + + + + + Simple filter to match a string in the + + + + Simple filter to match a string in the + + + As the MDC has been replaced with named stacks stored in the + properties collections the should + be used instead. + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Sets the to "NDC". + + + + + + Write the event appdomain name to the output + + + + Writes the to the output writer. + + + Daniel Cazzulino + Nicko Cadell + + + + Abstract class that provides the formatting functionality that + derived classes need. + + + Conversion specifiers in a conversion patterns are parsed to + individual PatternConverters. Each of which is responsible for + converting a logging event in a converter specific manner. + + Nicko Cadell + + + + Abstract class that provides the formatting functionality that + derived classes need. + + + + Conversion specifiers in a conversion patterns are parsed to + individual PatternConverters. Each of which is responsible for + converting a logging event in a converter specific manner. + + + Nicko Cadell + Gert Driesen + + + + Initial buffer size + + + + + Maximum buffer size before it is recycled + + + + + Protected constructor + + + + Initializes a new instance of the class. + + + + + + Evaluate this pattern converter and write the output to a writer. + + that will receive the formatted result. + The state object on which the pattern converter should be executed. + + + Derived pattern converters must override this method in order to + convert conversion specifiers in the appropriate way. + + + + + + Set the next pattern converter in the chains + + the pattern converter that should follow this converter in the chain + the next converter + + + The PatternConverter can merge with its neighbor during this method (or a sub class). + Therefore the return value may or may not be the value of the argument passed in. + + + + + + Write the pattern converter to the writer with appropriate formatting + + that will receive the formatted result. + The state object on which the pattern converter should be executed. + + + This method calls to allow the subclass to perform + appropriate conversion of the pattern converter. If formatting options have + been specified via the then this method will + apply those formattings before writing the output. + + + + + + Fast space padding method. + + to which the spaces will be appended. + The number of spaces to be padded. + + + Fast space padding method. + + + + + + The option string to the converter + + + + + Write an dictionary to a + + the writer to write to + a to use for object conversion + the value to write to the writer + + + Writes the to a writer in the form: + + + {key1=value1, key2=value2, key3=value3} + + + If the specified + is not null then it is used to render the key and value to text, otherwise + the object's ToString method is called. + + + + + + Write an dictionary to a + + the writer to write to + a to use for object conversion + the value to write to the writer + + + Writes the to a writer in the form: + + + {key1=value1, key2=value2, key3=value3} + + + If the specified + is not null then it is used to render the key and value to text, otherwise + the object's ToString method is called. + + + + + + Write an object to a + + the writer to write to + a to use for object conversion + the value to write to the writer + + + Writes the Object to a writer. If the specified + is not null then it is used to render the object to text, otherwise + the object's ToString method is called. + + + + + + Get the next pattern converter in the chain + + + the next pattern converter in the chain + + + + Get the next pattern converter in the chain + + + + + + Gets or sets the formatting info for this converter + + + The formatting info for this converter + + + + Gets or sets the formatting info for this converter + + + + + + Gets or sets the option value for this converter + + + The option for this converter + + + + Gets or sets the option value for this converter + + + + + + + + + + + Initializes a new instance of the class. + + + + + Derived pattern converters must override this method in order to + convert conversion specifiers in the correct way. + + that will receive the formatted result. + The on which the pattern converter should be executed. + + + + Derived pattern converters must override this method in order to + convert conversion specifiers in the correct way. + + that will receive the formatted result. + The state object on which the pattern converter should be executed. + + + + Flag indicating if this converter handles exceptions + + + false if this converter handles exceptions + + + + + Flag indicating if this converter handles the logging event exception + + false if this converter handles the logging event exception + + + If this converter handles the exception object contained within + , then this property should be set to + false. Otherwise, if the layout ignores the exception + object, then the property should be set to true. + + + Set this value to override a this default setting. The default + value is true, this converter does not handle the exception. + + + + + + Write the event appdomain name to the output + + that will receive the formatted result. + the event being logged + + + Writes the to the output . + + + + + + Converter for items in the ASP.Net Cache. + + + + Outputs an item from the . + + + Ron Grabowski + + + + Abstract class that provides access to the current HttpContext () that + derived classes need. + + + This class handles the case when HttpContext.Current is null by writing + to the writer. + + Ron Grabowski + + + + Derived pattern converters must override this method in order to + convert conversion specifiers in the correct way. + + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. + + + + Write the ASP.Net Cache item to the output + + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. + + + Writes out the value of a named property. The property name + should be set in the + property. If no property has been set, all key value pairs from the Cache will + be written to the output. + + + + + + Converter for items in the . + + + + Outputs an item from the . + + + Ron Grabowski + + + + Write the ASP.Net HttpContext item to the output + + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. + + + Writes out the value of a named property. The property name + should be set in the + property. + + + + + + Converter for items in the ASP.Net Cache. + + + + Outputs an item from the . + + + Ron Grabowski + + + + Write the ASP.Net Cache item to the output + + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. + + + Writes out the value of a named property. The property name + should be set in the + property. + + + + + + Converter for items in the ASP.Net Cache. + + + + Outputs an item from the . + + + Ron Grabowski + + + + Write the ASP.Net Cache item to the output + + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. + + + Writes out the value of a named property. The property name + should be set in the + property. If no property has been set, all key value pairs from the Session will + be written to the output. + + + + + + Date pattern converter, uses a to format + the date of a . + + + + Render the to the writer as a string. + + + The value of the determines + the formatting of the date. The following values are allowed: + + + Option value + Output + + + ISO8601 + + Uses the formatter. + Formats using the "yyyy-MM-dd HH:mm:ss,fff" pattern. + + + + DATE + + Uses the formatter. + Formats using the "dd MMM yyyy HH:mm:ss,fff" for example, "06 Nov 1994 15:49:37,459". + + + + ABSOLUTE + + Uses the formatter. + Formats using the "HH:mm:ss,yyyy" for example, "15:49:37,459". + + + + other + + Any other pattern string uses the formatter. + This formatter passes the pattern string to the + method. + For details on valid patterns see + DateTimeFormatInfo Class. + + + + + + The is in the local time zone and is rendered in that zone. + To output the time in Universal time see . + + + Nicko Cadell + + + + The used to render the date to a string + + + + The used to render the date to a string + + + + + + Initialize the converter pattern based on the property. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Convert the pattern into the rendered message + + that will receive the formatted result. + the event being logged + + + Pass the to the + for it to render it to the writer. + + + The passed is in the local time zone. + + + + + + The fully qualified type of the DatePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write the exception text to the output + + + + If an exception object is stored in the logging event + it will be rendered into the pattern output with a + trailing newline. + + + If there is no exception then nothing will be output + and no trailing newline will be appended. + It is typical to put a newline before the exception + and to have the exception as the last data in the pattern. + + + Nicko Cadell + + + + Default constructor + + + + + Write the exception text to the output + + that will receive the formatted result. + the event being logged + + + If an exception object is stored in the logging event + it will be rendered into the pattern output with a + trailing newline. + + + If there is no exception or the exception property specified + by the Option value does not exist then nothing will be output + and no trailing newline will be appended. + It is typical to put a newline before the exception + and to have the exception as the last data in the pattern. + + + Recognized values for the Option parameter are: + + + + Message + + + Source + + + StackTrace + + + TargetSite + + + HelpLink + + + + + + + Writes the caller location file name to the output + + + + Writes the value of the for + the event to the output writer. + + + Nicko Cadell + + + + Write the caller location file name to the output + + that will receive the formatted result. + the event being logged + + + Writes the value of the for + the to the output . + + + + + + Write the caller location info to the output + + + + Writes the to the output writer. + + + Nicko Cadell + + + + Write the caller location info to the output + + that will receive the formatted result. + the event being logged + + + Writes the to the output writer. + + + + + + Writes the event identity to the output + + + + Writes the value of the to + the output writer. + + + Daniel Cazzulino + Nicko Cadell + + + + Writes the event identity to the output + + that will receive the formatted result. + the event being logged + + + Writes the value of the + to + the output . + + + + + + Write the event level to the output + + + + Writes the display name of the event + to the writer. + + + Nicko Cadell + + + + Write the event level to the output + + that will receive the formatted result. + the event being logged + + + Writes the of the + to the . + + + + + + Write the caller location line number to the output + + + + Writes the value of the for + the event to the output writer. + + + Nicko Cadell + + + + Write the caller location line number to the output + + that will receive the formatted result. + the event being logged + + + Writes the value of the for + the to the output . + + + + + + Converter for logger name + + + + Outputs the of the event. + + + Nicko Cadell + + + + Converter to output and truncate '.' separated strings + + + + This abstract class supports truncating a '.' separated string + to show a specified number of elements from the right hand side. + This is used to truncate class names that are fully qualified. + + + Subclasses should override the method to + return the fully qualified string. + + + Nicko Cadell + + + + Initialize the converter + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Get the fully qualified string data + + the event being logged + the fully qualified name + + + Overridden by subclasses to get the fully qualified name before the + precision is applied to it. + + + Return the fully qualified '.' (dot/period) separated string. + + + + + + Convert the pattern to the rendered message + + that will receive the formatted result. + the event being logged + + Render the to the precision + specified by the property. + + + + + The fully qualified type of the NamedPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets the fully qualified name of the logger + + the event being logged + The fully qualified logger name + + + Returns the of the . + + + + + + Writes the event message to the output + + + + Uses the method + to write out the event message. + + + Nicko Cadell + + + + Writes the event message to the output + + that will receive the formatted result. + the event being logged + + + Uses the method + to write out the event message. + + + + + + Write the method name to the output + + + + Writes the caller location to + the output. + + + Nicko Cadell + + + + Write the method name to the output + + that will receive the formatted result. + the event being logged + + + Writes the caller location to + the output. + + + + + + Converter to include event NDC + + + + Outputs the value of the event property named NDC. + + + The should be used instead. + + + Nicko Cadell + + + + Write the event NDC to the output + + that will receive the formatted result. + the event being logged + + + As the thread context stacks are now stored in named event properties + this converter simply looks up the value of the NDC property. + + + The should be used instead. + + + + + + Property pattern converter + + + + Writes out the value of a named property. The property name + should be set in the + property. + + + If the is set to null + then all the properties are written as key value pairs. + + + Nicko Cadell + + + + Write the property value to the output + + that will receive the formatted result. + the event being logged + + + Writes out the value of a named property. The property name + should be set in the + property. + + + If the is set to null + then all the properties are written as key value pairs. + + + + + + Converter to output the relative time of the event + + + + Converter to output the time of the event relative to the start of the program. + + + Nicko Cadell + + + + Write the relative time to the output + + that will receive the formatted result. + the event being logged + + + Writes out the relative time of the event in milliseconds. + That is the number of milliseconds between the event + and the . + + + + + + Helper method to get the time difference between two DateTime objects + + start time (in the current local time zone) + end time (in the current local time zone) + the time difference in milliseconds + + + + Write the caller stack frames to the output + + + + Writes the to the output writer, using format: + type3.MethodCall3(type param,...) > type2.MethodCall2(type param,...) > type1.MethodCall1(type param,...) + + + Adam Davies + + + + Write the caller stack frames to the output + + + + Writes the to the output writer, using format: + type3.MethodCall3 > type2.MethodCall2 > type1.MethodCall1 + + + Michael Cromwell + + + + Initialize the converter + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Write the strack frames to the output + + that will receive the formatted result. + the event being logged + + + Writes the to the output writer. + + + + + + Returns the Name of the method + + + This method was created, so this class could be used as a base class for StackTraceDetailPatternConverter + string + + + + The fully qualified type of the StackTracePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + The fully qualified type of the StackTraceDetailPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Converter to include event thread name + + + + Writes the to the output. + + + Nicko Cadell + + + + Write the ThreadName to the output + + that will receive the formatted result. + the event being logged + + + Writes the to the . + + + + + + Pattern converter for the class name + + + + Outputs the of the event. + + + Nicko Cadell + + + + Gets the fully qualified name of the class + + the event being logged + The fully qualified type name for the caller location + + + Returns the of the . + + + + + + Converter to include event user name + + Douglas de la Torre + Nicko Cadell + + + + Convert the pattern to the rendered message + + that will receive the formatted result. + the event being logged + + + + Write the TimeStamp to the output + + + + Date pattern converter, uses a to format + the date of a . + + + Uses a to format the + in Universal time. + + + See the for details on the date pattern syntax. + + + + Nicko Cadell + + + + Write the TimeStamp to the output + + that will receive the formatted result. + the event being logged + + + Pass the to the + for it to render it to the writer. + + + The passed is in the local time zone, this is converted + to Universal time before it is rendered. + + + + + + + The fully qualified type of the UtcDatePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + A flexible layout configurable with pattern string that re-evaluates on each call. + + + This class is built on and provides all the + features and capabilities of PatternLayout. PatternLayout is a 'static' class + in that its layout is done once at configuration time. This class will recreate + the layout on each reference. + One important difference between PatternLayout and DynamicPatternLayout is the + treatment of the Header and Footer parameters in the configuration. The Header and Footer + parameters for DynamicPatternLayout must be syntactically in the form of a PatternString, + but should not be marked as type log4net.Util.PatternString. Doing so causes the + pattern to be statically converted at configuration time and causes DynamicPatternLayout + to perform the same as PatternLayout. + Please see for complete documentation. + + <layout type="log4net.Layout.DynamicPatternLayout"> + <param name="Header" value="%newline**** Trace Opened Local: %date{yyyy-MM-dd HH:mm:ss.fff} UTC: %utcdate{yyyy-MM-dd HH:mm:ss.fff} ****%newline" /> + <param name="Footer" value="**** Trace Closed %date{yyyy-MM-dd HH:mm:ss.fff} ****%newline" /> + </layout> + + + + + + A flexible layout configurable with pattern string. + + + + The goal of this class is to a + as a string. The results + depend on the conversion pattern. + + + The conversion pattern is closely related to the conversion + pattern of the printf function in C. A conversion pattern is + composed of literal text and format control expressions called + conversion specifiers. + + + You are free to insert any literal text within the conversion + pattern. + + + Each conversion specifier starts with a percent sign (%) and is + followed by optional format modifiers and a conversion + pattern name. The conversion pattern name specifies the type of + data, e.g. logger, level, date, thread name. The format + modifiers control such things as field width, padding, left and + right justification. The following is a simple example. + + + Let the conversion pattern be "%-5level [%thread]: %message%newline" and assume + that the log4net environment was set to use a PatternLayout. Then the + statements + + + ILog log = LogManager.GetLogger(typeof(TestApp)); + log.Debug("Message 1"); + log.Warn("Message 2"); + + would yield the output + + DEBUG [main]: Message 1 + WARN [main]: Message 2 + + + Note that there is no explicit separator between text and + conversion specifiers. The pattern parser knows when it has reached + the end of a conversion specifier when it reads a conversion + character. In the example above the conversion specifier + %-5level means the level of the logging event should be left + justified to a width of five characters. + + + The recognized conversion pattern names are: + + + + Conversion Pattern Name + Effect + + + a + Equivalent to appdomain + + + appdomain + + Used to output the friendly name of the AppDomain where the + logging event was generated. + + + + aspnet-cache + + + Used to output all cache items in the case of %aspnet-cache or just one named item if used as %aspnet-cache{key} + + + This pattern is not available for Compact Framework or Client Profile assemblies. + + + + + aspnet-context + + + Used to output all context items in the case of %aspnet-context or just one named item if used as %aspnet-context{key} + + + This pattern is not available for Compact Framework or Client Profile assemblies. + + + + + aspnet-request + + + Used to output all request parameters in the case of %aspnet-request or just one named param if used as %aspnet-request{key} + + + This pattern is not available for Compact Framework or Client Profile assemblies. + + + + + aspnet-session + + + Used to output all session items in the case of %aspnet-session or just one named item if used as %aspnet-session{key} + + + This pattern is not available for Compact Framework or Client Profile assemblies. + + + + + c + Equivalent to logger + + + C + Equivalent to type + + + class + Equivalent to type + + + d + Equivalent to date + + + date + + + Used to output the date of the logging event in the local time zone. + To output the date in universal time use the %utcdate pattern. + The date conversion + specifier may be followed by a date format specifier enclosed + between braces. For example, %date{HH:mm:ss,fff} or + %date{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is + given then ISO8601 format is + assumed (). + + + The date format specifier admits the same syntax as the + time pattern string of the . + + + For better results it is recommended to use the log4net date + formatters. These can be specified using one of the strings + "ABSOLUTE", "DATE" and "ISO8601" for specifying + , + and respectively + . For example, + %date{ISO8601} or %date{ABSOLUTE}. + + + These dedicated date formatters perform significantly + better than . + + + + + exception + + + Used to output the exception passed in with the log message. + + + If an exception object is stored in the logging event + it will be rendered into the pattern output with a + trailing newline. + If there is no exception then nothing will be output + and no trailing newline will be appended. + It is typical to put a newline before the exception + and to have the exception as the last data in the pattern. + + + + + F + Equivalent to file + + + file + + + Used to output the file name where the logging request was + issued. + + + WARNING Generating caller location information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + See the note below on the availability of caller location information. + + + + + identity + + + Used to output the user name for the currently active user + (Principal.Identity.Name). + + + WARNING Generating caller information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + + + l + Equivalent to location + + + L + Equivalent to line + + + location + + + Used to output location information of the caller which generated + the logging event. + + + The location information depends on the CLI implementation but + usually consists of the fully qualified name of the calling + method followed by the callers source the file name and line + number between parentheses. + + + The location information can be very useful. However, its + generation is extremely slow. Its use should be avoided + unless execution speed is not an issue. + + + See the note below on the availability of caller location information. + + + + + level + + + Used to output the level of the logging event. + + + + + line + + + Used to output the line number from where the logging request + was issued. + + + WARNING Generating caller location information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + See the note below on the availability of caller location information. + + + + + logger + + + Used to output the logger of the logging event. The + logger conversion specifier can be optionally followed by + precision specifier, that is a decimal constant in + brackets. + + + If a precision specifier is given, then only the corresponding + number of right most components of the logger name will be + printed. By default the logger name is printed in full. + + + For example, for the logger name "a.b.c" the pattern + %logger{2} will output "b.c". + + + + + m + Equivalent to message + + + M + Equivalent to method + + + message + + + Used to output the application supplied message associated with + the logging event. + + + + + mdc + + + The MDC (old name for the ThreadContext.Properties) is now part of the + combined event properties. This pattern is supported for compatibility + but is equivalent to property. + + + + + method + + + Used to output the method name where the logging request was + issued. + + + WARNING Generating caller location information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + See the note below on the availability of caller location information. + + + + + n + Equivalent to newline + + + newline + + + Outputs the platform dependent line separator character or + characters. + + + This conversion pattern offers the same performance as using + non-portable line separator strings such as "\n", or "\r\n". + Thus, it is the preferred way of specifying a line separator. + + + + + ndc + + + Used to output the NDC (nested diagnostic context) associated + with the thread that generated the logging event. + + + + + p + Equivalent to level + + + P + Equivalent to property + + + properties + Equivalent to property + + + property + + + Used to output the an event specific property. The key to + lookup must be specified within braces and directly following the + pattern specifier, e.g. %property{user} would include the value + from the property that is keyed by the string 'user'. Each property value + that is to be included in the log must be specified separately. + Properties are added to events by loggers or appenders. By default + the log4net:HostName property is set to the name of machine on + which the event was originally logged. + + + If no key is specified, e.g. %property then all the keys and their + values are printed in a comma separated list. + + + The properties of an event are combined from a number of different + contexts. These are listed below in the order in which they are searched. + + + + the event properties + + The event has that can be set. These + properties are specific to this event only. + + + + the thread properties + + The that are set on the current + thread. These properties are shared by all events logged on this thread. + + + + the global properties + + The that are set globally. These + properties are shared by all the threads in the AppDomain. + + + + + + + + r + Equivalent to timestamp + + + stacktrace + + + Used to output the stack trace of the logging event + The stack trace level specifier may be enclosed + between braces. For example, %stacktrace{level}. + If no stack trace level specifier is given then 1 is assumed + + + Output uses the format: + type3.MethodCall3 > type2.MethodCall2 > type1.MethodCall1 + + + This pattern is not available for Compact Framework assemblies. + + + + + stacktracedetail + + + Used to output the stack trace of the logging event + The stack trace level specifier may be enclosed + between braces. For example, %stacktracedetail{level}. + If no stack trace level specifier is given then 1 is assumed + + + Output uses the format: + type3.MethodCall3(type param,...) > type2.MethodCall2(type param,...) > type1.MethodCall1(type param,...) + + + This pattern is not available for Compact Framework assemblies. + + + + + t + Equivalent to thread + + + timestamp + + + Used to output the number of milliseconds elapsed since the start + of the application until the creation of the logging event. + + + + + thread + + + Used to output the name of the thread that generated the + logging event. Uses the thread number if no name is available. + + + + + type + + + Used to output the fully qualified type name of the caller + issuing the logging request. This conversion specifier + can be optionally followed by precision specifier, that + is a decimal constant in brackets. + + + If a precision specifier is given, then only the corresponding + number of right most components of the class name will be + printed. By default the class name is output in fully qualified form. + + + For example, for the class name "log4net.Layout.PatternLayout", the + pattern %type{1} will output "PatternLayout". + + + WARNING Generating the caller class information is + slow. Thus, its use should be avoided unless execution speed is + not an issue. + + + See the note below on the availability of caller location information. + + + + + u + Equivalent to identity + + + username + + + Used to output the WindowsIdentity for the currently + active user. + + + WARNING Generating caller WindowsIdentity information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + + + utcdate + + + Used to output the date of the logging event in universal time. + The date conversion + specifier may be followed by a date format specifier enclosed + between braces. For example, %utcdate{HH:mm:ss,fff} or + %utcdate{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is + given then ISO8601 format is + assumed (). + + + The date format specifier admits the same syntax as the + time pattern string of the . + + + For better results it is recommended to use the log4net date + formatters. These can be specified using one of the strings + "ABSOLUTE", "DATE" and "ISO8601" for specifying + , + and respectively + . For example, + %utcdate{ISO8601} or %utcdate{ABSOLUTE}. + + + These dedicated date formatters perform significantly + better than . + + + + + w + Equivalent to username + + + x + Equivalent to ndc + + + X + Equivalent to mdc + + + % + + + The sequence %% outputs a single percent sign. + + + + + + The single letter patterns are deprecated in favor of the + longer more descriptive pattern names. + + + By default the relevant information is output as is. However, + with the aid of format modifiers it is possible to change the + minimum field width, the maximum field width and justification. + + + The optional format modifier is placed between the percent sign + and the conversion pattern name. + + + The first optional format modifier is the left justification + flag which is just the minus (-) character. Then comes the + optional minimum field width modifier. This is a decimal + constant that represents the minimum number of characters to + output. If the data item requires fewer characters, it is padded on + either the left or the right until the minimum width is + reached. The default is to pad on the left (right justify) but you + can specify right padding with the left justification flag. The + padding character is space. If the data item is larger than the + minimum field width, the field is expanded to accommodate the + data. The value is never truncated. + + + This behavior can be changed using the maximum field + width modifier which is designated by a period followed by a + decimal constant. If the data item is longer than the maximum + field, then the extra characters are removed from the + beginning of the data item and not from the end. For + example, it the maximum field width is eight and the data item is + ten characters long, then the first two characters of the data item + are dropped. This behavior deviates from the printf function in C + where truncation is done from the end. + + + Below are various format modifier examples for the logger + conversion specifier. + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Format modifierleft justifyminimum widthmaximum widthcomment
      %20loggerfalse20none + + Left pad with spaces if the logger name is less than 20 + characters long. + +
      %-20loggertrue20none + + Right pad with spaces if the logger + name is less than 20 characters long. + +
      %.30loggerNAnone30 + + Truncate from the beginning if the logger + name is longer than 30 characters. + +
      %20.30loggerfalse2030 + + Left pad with spaces if the logger name is shorter than 20 + characters. However, if logger name is longer than 30 characters, + then truncate from the beginning. + +
      %-20.30loggertrue2030 + + Right pad with spaces if the logger name is shorter than 20 + characters. However, if logger name is longer than 30 characters, + then truncate from the beginning. + +
      +
      + + Note about caller location information.
      + The following patterns %type %file %line %method %location %class %C %F %L %l %M + all generate caller location information. + Location information uses the System.Diagnostics.StackTrace class to generate + a call stack. The caller's information is then extracted from this stack. +
      + + + The System.Diagnostics.StackTrace class is not supported on the + .NET Compact Framework 1.0 therefore caller location information is not + available on that framework. + + + + + The System.Diagnostics.StackTrace class has this to say about Release builds: + + + "StackTrace information will be most informative with Debug build configurations. + By default, Debug builds include debug symbols, while Release builds do not. The + debug symbols contain most of the file, method name, line number, and column + information used in constructing StackFrame and StackTrace objects. StackTrace + might not report as many method calls as expected, due to code transformations + that occur during optimization." + + + This means that in a Release build the caller information may be incomplete or may + not exist at all! Therefore caller location information cannot be relied upon in a Release build. + + + + Additional pattern converters may be registered with a specific + instance using the method. + +
      + + This is a more detailed pattern. + %timestamp [%thread] %level %logger %ndc - %message%newline + + + A similar pattern except that the relative time is + right padded if less than 6 digits, thread name is right padded if + less than 15 characters and truncated if longer and the logger + name is left padded if shorter than 30 characters and truncated if + longer. + %-6timestamp [%15.15thread] %-5level %30.30logger %ndc - %message%newline + + Nicko Cadell + Gert Driesen + Douglas de la Torre + Daniel Cazzulino +
      + + + Extend this abstract class to create your own log layout format. + + + + This is the base implementation of the + interface. Most layout objects should extend this class. + + + + + + Subclasses must implement the + method. + + + Subclasses should set the in their default + constructor. + + + + Nicko Cadell + Gert Driesen + + + + Interface implemented by layout objects + + + + An object is used to format a + as text. The method is called by an + appender to transform the into a string. + + + The layout can also supply and + text that is appender before any events and after all the events respectively. + + + Nicko Cadell + Gert Driesen + + + + Implement this method to create your own layout format. + + The TextWriter to write the formatted event to + The event to format + + + This method is called by an appender to format + the as text and output to a writer. + + + If the caller does not have a and prefers the + event to be formatted as a then the following + code can be used to format the event into a . + + + StringWriter writer = new StringWriter(); + Layout.Format(writer, loggingEvent); + string formattedEvent = writer.ToString(); + + + + + + The content type output by this layout. + + The content type + + + The content type output by this layout. + + + This is a MIME type e.g. "text/plain". + + + + + + The header for the layout format. + + the layout header + + + The Header text will be appended before any logging events + are formatted and appended. + + + + + + The footer for the layout format. + + the layout footer + + + The Footer text will be appended after all the logging events + have been formatted and appended. + + + + + + Flag indicating if this layout handle exceptions + + false if this layout handles exceptions + + + If this layout handles the exception object contained within + , then the layout should return + false. Otherwise, if the layout ignores the exception + object, then the layout should return true. + + + + + + The header text + + + + See for more information. + + + + + + The footer text + + + + See for more information. + + + + + + Flag indicating if this layout handles exceptions + + + + false if this layout handles exceptions + + + + + + Empty default constructor + + + + Empty default constructor + + + + + + Activate component options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + This method must be implemented by the subclass. + + + + + + Implement this method to create your own layout format. + + The TextWriter to write the formatted event to + The event to format + + + This method is called by an appender to format + the as text. + + + + + + Convenience method for easily formatting the logging event into a string variable. + + + + Creates a new StringWriter instance to store the formatted logging event. + + + + + The content type output by this layout. + + The content type is "text/plain" + + + The content type output by this layout. + + + This base class uses the value "text/plain". + To change this value a subclass must override this + property. + + + + + + The header for the layout format. + + the layout header + + + The Header text will be appended before any logging events + are formatted and appended. + + + + + + The footer for the layout format. + + the layout footer + + + The Footer text will be appended after all the logging events + have been formatted and appended. + + + + + + Flag indicating if this layout handles exceptions + + false if this layout handles exceptions + + + If this layout handles the exception object contained within + , then the layout should return + false. Otherwise, if the layout ignores the exception + object, then the layout should return true. + + + Set this value to override a this default setting. The default + value is true, this layout does not handle the exception. + + + + + + Default pattern string for log output. + + + + Default pattern string for log output. + Currently set to the string "%message%newline" + which just prints the application supplied message. + + + + + + A detailed conversion pattern + + + + A conversion pattern which includes Time, Thread, Logger, and Nested Context. + Current value is %timestamp [%thread] %level %logger %ndc - %message%newline. + + + + + + Internal map of converter identifiers to converter types. + + + + This static map is overridden by the m_converterRegistry instance map + + + + + + the pattern + + + + + the head of the pattern converter chain + + + + + patterns defined on this PatternLayout only + + + + + Initialize the global registry + + + + Defines the builtin global rules. + + + + + + Constructs a PatternLayout using the DefaultConversionPattern + + + + The default pattern just produces the application supplied message. + + + Note to Inheritors: This constructor calls the virtual method + . If you override this method be + aware that it will be called before your is called constructor. + + + As per the contract the + method must be called after the properties on this object have been + configured. + + + + + + Constructs a PatternLayout using the supplied conversion pattern + + the pattern to use + + + Note to Inheritors: This constructor calls the virtual method + . If you override this method be + aware that it will be called before your is called constructor. + + + When using this constructor the method + need not be called. This may not be the case when using a subclass. + + + + + + Create the pattern parser instance + + the pattern to parse + The that will format the event + + + Creates the used to parse the conversion string. Sets the + global and instance rules on the . + + + + + + Initialize layout options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Produces a formatted string as specified by the conversion pattern. + + the event being logged + The TextWriter to write the formatted event to + + + Parse the using the patter format + specified in the property. + + + + + + Add a converter to this PatternLayout + + the converter info + + + This version of the method is used by the configurator. + Programmatic users should use the alternative method. + + + + + + Add a converter to this PatternLayout + + the name of the conversion pattern for this converter + the type of the converter + + + Add a named pattern converter to this instance. This + converter will be used in the formatting of the event. + This method must be called before . + + + The specified must extend the + type. + + + + + + The pattern formatting string + + + + The ConversionPattern option. This is the string which + controls formatting and consists of a mix of literal content and + conversion specifiers. + + + + + + The header PatternString + + + + + The footer PatternString + + + + + Constructs a DynamicPatternLayout using the DefaultConversionPattern + + + + The default pattern just produces the application supplied message. + + + + + + Constructs a DynamicPatternLayout using the supplied conversion pattern + + the pattern to use + + + + + + The header for the layout format. + + the layout header + + + The Header text will be appended before any logging events + are formatted and appended. + + The pattern will be formatted on each get operation. + + + + + The footer for the layout format. + + the layout footer + + + The Footer text will be appended after all the logging events + have been formatted and appended. + + The pattern will be formatted on each get operation. + + + + + A Layout that renders only the Exception text from the logging event + + + + A Layout that renders only the Exception text from the logging event. + + + This Layout should only be used with appenders that utilize multiple + layouts (e.g. ). + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Constructs a ExceptionLayout + + + + + + Activate component options + + + + Part of the component activation + framework. + + + This method does nothing as options become effective immediately. + + + + + + Gets the exception text from the logging event + + The TextWriter to write the formatted event to + the event being logged + + + Write the exception string to the . + The exception string is retrieved from . + + + + + + Interface for raw layout objects + + + + Interface used to format a + to an object. + + + This interface should not be confused with the + interface. This interface is used in + only certain specialized situations where a raw object is + required rather than a formatted string. The + is not generally useful than this interface. + + + Nicko Cadell + Gert Driesen + + + + Implement this method to create your own layout format. + + The event to format + returns the formatted event + + + Implement this method to create your own layout format. + + + + + + Adapts any to a + + + + Where an is required this adapter + allows a to be specified. + + + Nicko Cadell + Gert Driesen + + + + The layout to adapt + + + + + Construct a new adapter + + the layout to adapt + + + Create the adapter for the specified . + + + + + + Format the logging event as an object. + + The event to format + returns the formatted event + + + Format the logging event as an object. + + + Uses the object supplied to + the constructor to perform the formatting. + + + + + + Type converter for the interface + + + + Used to convert objects to the interface. + Supports converting from the interface to + the interface using the . + + + Nicko Cadell + Gert Driesen + + + + Interface supported by type converters + + + + This interface supports conversion from arbitrary types + to a single target type. See . + + + Nicko Cadell + Gert Driesen + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Test if the can be converted to the + type supported by this converter. + + + + + + Convert the source object to the type supported by this object + + the object to convert + the converted object + + + Converts the to the type supported + by this converter. + + + + + + Can the sourceType be converted to an + + the source to be to be converted + true if the source type can be converted to + + + Test if the can be converted to a + . Only is supported + as the . + + + + + + Convert the value to a object + + the value to convert + the object + + + Convert the object to a + object. If the object + is a then the + is used to adapt between the two interfaces, otherwise an + exception is thrown. + + + + + + Extract the value of a property from the + + + + Extract the value of a property from the + + + Nicko Cadell + + + + Constructs a RawPropertyLayout + + + + + Lookup the property for + + The event to format + returns property value + + + Looks up and returns the object value of the property + named . If there is no property defined + with than name then null will be returned. + + + + + + The name of the value to lookup in the LoggingEvent Properties collection. + + + Value to lookup in the LoggingEvent Properties collection + + + + String name of the property to lookup in the . + + + + + + Extract the date from the + + + + Extract the date from the + + + Nicko Cadell + Gert Driesen + + + + Constructs a RawTimeStampLayout + + + + + Gets the as a . + + The event to format + returns the time stamp + + + Gets the as a . + + + The time stamp is in local time. To format the time stamp + in universal time use . + + + + + + Extract the date from the + + + + Extract the date from the + + + Nicko Cadell + Gert Driesen + + + + Constructs a RawUtcTimeStampLayout + + + + + Gets the as a . + + The event to format + returns the time stamp + + + Gets the as a . + + + The time stamp is in universal time. To format the time stamp + in local time use . + + + + + + A very simple layout + + + + SimpleLayout consists of the level of the log statement, + followed by " - " and then the log message itself. For example, + + DEBUG - Hello world + + + + Nicko Cadell + Gert Driesen + + + + Constructs a SimpleLayout + + + + + Initialize layout options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Produces a simple formatted output. + + the event being logged + The TextWriter to write the formatted event to + + + Formats the event as the level of the even, + followed by " - " and then the log message itself. The + output is terminated by a newline. + + + + + + Layout that formats the log events as XML elements. + + + + The output of the consists of a series of + log4net:event elements. It does not output a complete well-formed XML + file. The output is designed to be included as an external entity + in a separate file to form a correct XML file. + + + For example, if abc is the name of the file where + the output goes, then a well-formed XML file would + be: + + + <?xml version="1.0" ?> + + <!DOCTYPE log4net:events SYSTEM "log4net-events.dtd" [<!ENTITY data SYSTEM "abc">]> + + <log4net:events version="1.2" xmlns:log4net="http://logging.apache.org/log4net/schemas/log4net-events-1.2> + &data; + </log4net:events> + + + This approach enforces the independence of the + and the appender where it is embedded. + + + The version attribute helps components to correctly + interpret output generated by . The value of + this attribute should be "1.2" for release 1.2 and later. + + + Alternatively the Header and Footer properties can be + configured to output the correct XML header, open tag and close tag. + When setting the Header and Footer properties it is essential + that the underlying data store not be appendable otherwise the data + will become invalid XML. + + + Nicko Cadell + Gert Driesen + + + + Layout that formats the log events as XML elements. + + + + This is an abstract class that must be subclassed by an implementation + to conform to a specific schema. + + + Deriving classes must implement the method. + + + Nicko Cadell + Gert Driesen + + + + Protected constructor to support subclasses + + + + Initializes a new instance of the class + with no location info. + + + + + + Protected constructor to support subclasses + + + + The parameter determines whether + location information will be output by the layout. If + is set to true, then the + file name and line number of the statement at the origin of the log + statement will be output. + + + If you are embedding this layout within an SMTPAppender + then make sure to set the LocationInfo option of that + appender as well. + + + + + + Initialize layout options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Produces a formatted string. + + The event being logged. + The TextWriter to write the formatted event to + + + Format the and write it to the . + + + This method creates an that writes to the + . The is passed + to the method. Subclasses should override the + method rather than this method. + + + + + + Does the actual writing of the XML. + + The writer to use to output the event to. + The event to write. + + + Subclasses should override this method to format + the as XML. + + + + + + Flag to indicate if location information should be included in + the XML events. + + + + + The string to replace invalid chars with + + + + + Gets a value indicating whether to include location information in + the XML events. + + + true if location information should be included in the XML + events; otherwise, false. + + + + If is set to true, then the file + name and line number of the statement at the origin of the log + statement will be output. + + + If you are embedding this layout within an SMTPAppender + then make sure to set the LocationInfo option of that + appender as well. + + + + + + The string to replace characters that can not be expressed in XML with. + + + Not all characters may be expressed in XML. This property contains the + string to replace those that can not with. This defaults to a ?. Set it + to the empty string to simply remove offending characters. For more + details on the allowed character ranges see http://www.w3.org/TR/REC-xml/#charsets + Character replacement will occur in the log message, the property names + and the property values. + + + + + + + Gets the content type output by this layout. + + + As this is the XML layout, the value is always "text/xml". + + + + As this is the XML layout, the value is always "text/xml". + + + + + + Constructs an XmlLayout + + + + + Constructs an XmlLayout. + + + + The LocationInfo option takes a boolean value. By + default, it is set to false which means there will be no location + information output by this layout. If the the option is set to + true, then the file name and line number of the statement + at the origin of the log statement will be output. + + + If you are embedding this layout within an SmtpAppender + then make sure to set the LocationInfo option of that + appender as well. + + + + + + Initialize layout options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + Builds a cache of the element names + + + + + + Does the actual writing of the XML. + + The writer to use to output the event to. + The event to write. + + + Override the base class method + to write the to the . + + + + + + The prefix to use for all generated element names + + + + + The prefix to use for all element names + + + + The default prefix is log4net. Set this property + to change the prefix. If the prefix is set to an empty string + then no prefix will be written. + + + + + + Set whether or not to base64 encode the message. + + + + By default the log message will be written as text to the xml + output. This can cause problems when the message contains binary + data. By setting this to true the contents of the message will be + base64 encoded. If this is set then invalid character replacement + (see ) will not be performed + on the log message. + + + + + + Set whether or not to base64 encode the property values. + + + + By default the properties will be written as text to the xml + output. This can cause problems when one or more properties contain + binary data. By setting this to true the values of the properties + will be base64 encoded. If this is set then invalid character replacement + (see ) will not be performed + on the property values. + + + + + + Layout that formats the log events as XML elements compatible with the log4j schema + + + + Formats the log events according to the http://logging.apache.org/log4j schema. + + + Nicko Cadell + + + + The 1st of January 1970 in UTC + + + + + Constructs an XMLLayoutSchemaLog4j + + + + + Constructs an XMLLayoutSchemaLog4j. + + + + The LocationInfo option takes a boolean value. By + default, it is set to false which means there will be no location + information output by this layout. If the the option is set to + true, then the file name and line number of the statement + at the origin of the log statement will be output. + + + If you are embedding this layout within an SMTPAppender + then make sure to set the LocationInfo option of that + appender as well. + + + + + + Actually do the writing of the xml + + the writer to use + the event to write + + + Generate XML that is compatible with the log4j schema. + + + + + + The version of the log4j schema to use. + + + + Only version 1.2 of the log4j schema is supported. + + + + + + The default object Renderer. + + + + The default renderer supports rendering objects and collections to strings. + + + See the method for details of the output. + + + Nicko Cadell + Gert Driesen + + + + Implement this interface in order to render objects as strings + + + + Certain types require special case conversion to + string form. This conversion is done by an object renderer. + Object renderers implement the + interface. + + + Nicko Cadell + Gert Driesen + + + + Render the object to a string + + The map used to lookup renderers + The object to render + The writer to render to + + + Render the object to a + string. + + + The parameter is + provided to lookup and render other objects. This is + very useful where contains + nested objects of unknown type. The + method can be used to render these objects. + + + + + + Default constructor + + + + Default constructor + + + + + + Render the object to a string + + The map used to lookup renderers + The object to render + The writer to render to + + + Render the object to a string. + + + The parameter is + provided to lookup and render other objects. This is + very useful where contains + nested objects of unknown type. The + method can be used to render these objects. + + + The default renderer supports rendering objects to strings as follows: + + + + Value + Rendered String + + + null + + "(null)" + + + + + + + For a one dimensional array this is the + array type name, an open brace, followed by a comma + separated list of the elements (using the appropriate + renderer), followed by a close brace. + + + For example: int[] {1, 2, 3}. + + + If the array is not one dimensional the + Array.ToString() is returned. + + + + + , & + + + Rendered as an open brace, followed by a comma + separated list of the elements (using the appropriate + renderer), followed by a close brace. + + + For example: {a, b, c}. + + + All collection classes that implement its subclasses, + or generic equivalents all implement the interface. + + + + + + + + Rendered as the key, an equals sign ('='), and the value (using the appropriate + renderer). + + + For example: key=value. + + + + + other + + Object.ToString() + + + + + + + + Render the array argument into a string + + The map used to lookup renderers + the array to render + The writer to render to + + + For a one dimensional array this is the + array type name, an open brace, followed by a comma + separated list of the elements (using the appropriate + renderer), followed by a close brace. For example: + int[] {1, 2, 3}. + + + If the array is not one dimensional the + Array.ToString() is returned. + + + + + + Render the enumerator argument into a string + + The map used to lookup renderers + the enumerator to render + The writer to render to + + + Rendered as an open brace, followed by a comma + separated list of the elements (using the appropriate + renderer), followed by a close brace. For example: + {a, b, c}. + + + + + + Render the DictionaryEntry argument into a string + + The map used to lookup renderers + the DictionaryEntry to render + The writer to render to + + + Render the key, an equals sign ('='), and the value (using the appropriate + renderer). For example: key=value. + + + + + + Map class objects to an . + + + + Maintains a mapping between types that require special + rendering and the that + is used to render them. + + + The method is used to render an + object using the appropriate renderers defined in this map. + + + Nicko Cadell + Gert Driesen + + + + Default Constructor + + + + Default constructor. + + + + + + Render using the appropriate renderer. + + the object to render to a string + the object rendered as a string + + + This is a convenience method used to render an object to a string. + The alternative method + should be used when streaming output to a . + + + + + + Render using the appropriate renderer. + + the object to render to a string + The writer to render to + + + Find the appropriate renderer for the type of the + parameter. This is accomplished by calling the + method. Once a renderer is found, it is + applied on the object and the result is returned + as a . + + + + + + Gets the renderer for the specified object type + + the object to lookup the renderer for + the renderer for + + + Gets the renderer for the specified object type. + + + Syntactic sugar method that calls + with the type of the object parameter. + + + + + + Gets the renderer for the specified type + + the type to lookup the renderer for + the renderer for the specified type + + + Returns the renderer for the specified type. + If no specific renderer has been defined the + will be returned. + + + + + + Internal function to recursively search interfaces + + the type to lookup the renderer for + the renderer for the specified type + + + + Clear the map of renderers + + + + Clear the custom renderers defined by using + . The + cannot be removed. + + + + + + Register an for . + + the type that will be rendered by + the renderer for + + + Register an object renderer for a specific source type. + This renderer will be returned from a call to + specifying the same as an argument. + + + + + + Get the default renderer instance + + the default renderer + + + Get the default renderer + + + + + + Interface implemented by logger repository plugins. + + + + Plugins define additional behavior that can be associated + with a . + The held by the + property is used to store the plugins for a repository. + + + The log4net.Config.PluginAttribute can be used to + attach plugins to repositories created using configuration + attributes. + + + Nicko Cadell + Gert Driesen + + + + Attaches the plugin to the specified . + + The that this plugin should be attached to. + + + A plugin may only be attached to a single repository. + + + This method is called when the plugin is attached to the repository. + + + + + + Is called when the plugin is to shutdown. + + + + This method is called to notify the plugin that + it should stop operating and should detach from + the repository. + + + + + + Gets the name of the plugin. + + + The name of the plugin. + + + + Plugins are stored in the + keyed by name. Each plugin instance attached to a + repository must be a unique name. + + + + + + A strongly-typed collection of objects. + + Nicko Cadell + + + + Creates a read-only wrapper for a PluginCollection instance. + + list to create a readonly wrapper arround + + A PluginCollection wrapper that is read-only. + + + + + Initializes a new instance of the PluginCollection class + that is empty and has the default initial capacity. + + + + + Initializes a new instance of the PluginCollection class + that has the specified initial capacity. + + + The number of elements that the new PluginCollection is initially capable of storing. + + + + + Initializes a new instance of the PluginCollection class + that contains elements copied from the specified PluginCollection. + + The PluginCollection whose elements are copied to the new collection. + + + + Initializes a new instance of the PluginCollection class + that contains elements copied from the specified array. + + The array whose elements are copied to the new list. + + + + Initializes a new instance of the PluginCollection class + that contains elements copied from the specified collection. + + The collection whose elements are copied to the new list. + + + + Allow subclasses to avoid our default constructors + + + + + + + Copies the entire PluginCollection to a one-dimensional + array. + + The one-dimensional array to copy to. + + + + Copies the entire PluginCollection to a one-dimensional + array, starting at the specified index of the target array. + + The one-dimensional array to copy to. + The zero-based index in at which copying begins. + + + + Adds a to the end of the PluginCollection. + + The to be added to the end of the PluginCollection. + The index at which the value has been added. + + + + Removes all elements from the PluginCollection. + + + + + Creates a shallow copy of the . + + A new with a shallow copy of the collection data. + + + + Determines whether a given is in the PluginCollection. + + The to check for. + true if is found in the PluginCollection; otherwise, false. + + + + Returns the zero-based index of the first occurrence of a + in the PluginCollection. + + The to locate in the PluginCollection. + + The zero-based index of the first occurrence of + in the entire PluginCollection, if found; otherwise, -1. + + + + + Inserts an element into the PluginCollection at the specified index. + + The zero-based index at which should be inserted. + The to insert. + + is less than zero + -or- + is equal to or greater than . + + + + + Removes the first occurrence of a specific from the PluginCollection. + + The to remove from the PluginCollection. + + The specified was not found in the PluginCollection. + + + + + Removes the element at the specified index of the PluginCollection. + + The zero-based index of the element to remove. + + is less than zero. + -or- + is equal to or greater than . + + + + + Returns an enumerator that can iterate through the PluginCollection. + + An for the entire PluginCollection. + + + + Adds the elements of another PluginCollection to the current PluginCollection. + + The PluginCollection whose elements should be added to the end of the current PluginCollection. + The new of the PluginCollection. + + + + Adds the elements of a array to the current PluginCollection. + + The array whose elements should be added to the end of the PluginCollection. + The new of the PluginCollection. + + + + Adds the elements of a collection to the current PluginCollection. + + The collection whose elements should be added to the end of the PluginCollection. + The new of the PluginCollection. + + + + Sets the capacity to the actual number of elements. + + + + + is less than zero. + -or- + is equal to or greater than . + + + + + is less than zero. + -or- + is equal to or greater than . + + + + + Gets the number of elements actually contained in the PluginCollection. + + + + + Gets a value indicating whether access to the collection is synchronized (thread-safe). + + true if access to the ICollection is synchronized (thread-safe); otherwise, false. + + + + Gets an object that can be used to synchronize access to the collection. + + + An object that can be used to synchronize access to the collection. + + + + + Gets or sets the at the specified index. + + + The at the specified index. + + The zero-based index of the element to get or set. + + is less than zero. + -or- + is equal to or greater than . + + + + + Gets a value indicating whether the collection has a fixed size. + + true if the collection has a fixed size; otherwise, false. The default is false. + + + + Gets a value indicating whether the IList is read-only. + + true if the collection is read-only; otherwise, false. The default is false. + + + + Gets or sets the number of elements the PluginCollection can contain. + + + The number of elements the PluginCollection can contain. + + + + + Supports type-safe iteration over a . + + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + + + Type visible only to our subclasses + Used to access protected constructor + + + + + + A value + + + + + Supports simple iteration over a . + + + + + + Initializes a new instance of the Enumerator class. + + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + The current element in the collection. + + + + + + + + Map of repository plugins. + + + + This class is a name keyed map of the plugins that are + attached to a repository. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + The repository that the plugins should be attached to. + + + Initialize a new instance of the class with a + repository that the plugins should be attached to. + + + + + + Adds a to the map. + + The to add to the map. + + + The will be attached to the repository when added. + + + If there already exists a plugin with the same name + attached to the repository then the old plugin will + be and replaced with + the new plugin. + + + + + + Removes a from the map. + + The to remove from the map. + + + Remove a specific plugin from this map. + + + + + + Gets a by name. + + The name of the to lookup. + + The from the map with the name specified, or + null if no plugin is found. + + + + Lookup a plugin by name. If the plugin is not found null + will be returned. + + + + + + Gets all possible plugins as a list of objects. + + All possible plugins as a list of objects. + + + Get a collection of all the plugins defined in this map. + + + + + + Base implementation of + + + + Default abstract implementation of the + interface. This base class can be used by implementors + of the interface. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + the name of the plugin + + Initializes a new Plugin with the specified name. + + + + + Attaches this plugin to a . + + The that this plugin should be attached to. + + + A plugin may only be attached to a single repository. + + + This method is called when the plugin is attached to the repository. + + + + + + Is called when the plugin is to shutdown. + + + + This method is called to notify the plugin that + it should stop operating and should detach from + the repository. + + + + + + The name of this plugin. + + + + + The repository this plugin is attached to. + + + + + Gets or sets the name of the plugin. + + + The name of the plugin. + + + + Plugins are stored in the + keyed by name. Each plugin instance attached to a + repository must be a unique name. + + + The name of the plugin must not change one the + plugin has been attached to a repository. + + + + + + The repository for this plugin + + + The that this plugin is attached to. + + + + Gets or sets the that this plugin is + attached to. + + + + + + Plugin that listens for events from the + + + + This plugin publishes an instance of + on a specified . This listens for logging events delivered from + a remote . + + + When an event is received it is relogged within the attached repository + as if it had been raised locally. + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Initializes a new instance of the class. + + + The property must be set. + + + + + + Construct with sink Uri. + + The name to publish the sink under in the remoting infrastructure. + See for more details. + + + Initializes a new instance of the class + with specified name. + + + + + + Attaches this plugin to a . + + The that this plugin should be attached to. + + + A plugin may only be attached to a single repository. + + + This method is called when the plugin is attached to the repository. + + + + + + Is called when the plugin is to shutdown. + + + + When the plugin is shutdown the remote logging + sink is disconnected. + + + + + + The fully qualified type of the RemoteLoggingServerPlugin class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the URI of this sink. + + + The URI of this sink. + + + + This is the name under which the object is marshaled. + + + + + + + Delivers objects to a remote sink. + + + + Internal class used to listen for logging events + and deliver them to the local repository. + + + + + + Constructor + + The repository to log to. + + + Initializes a new instance of the for the + specified . + + + + + + Logs the events to the repository. + + The events to log. + + + The events passed are logged to the + + + + + + Obtains a lifetime service object to control the lifetime + policy for this instance. + + null to indicate that this instance should live forever. + + + Obtains a lifetime service object to control the lifetime + policy for this instance. This object should live forever + therefore this implementation returns null. + + + + + + The underlying that events should + be logged to. + + + + + Default implementation of + + + + This default implementation of the + interface is used to create the default subclass + of the object. + + + Nicko Cadell + Gert Driesen + + + + Interface abstracts creation of instances + + + + This interface is used by the to + create new objects. + + + The method is called + to create a named . + + + Implement this interface to create new subclasses of . + + + Nicko Cadell + Gert Driesen + + + + Create a new instance + + The that will own the . + The name of the . + The instance for the specified name. + + + Create a new instance with the + specified name. + + + Called by the to create + new named instances. + + + If the is null then the root logger + must be returned. + + + + + + Default constructor + + + + Initializes a new instance of the class. + + + + + + Create a new instance + + The that will own the . + The name of the . + The instance for the specified name. + + + Create a new instance with the + specified name. + + + Called by the to create + new named instances. + + + If the is null then the root logger + must be returned. + + + + + + Default internal subclass of + + + + This subclass has no additional behavior over the + class but does allow instances + to be created. + + + + + + Implementation of used by + + + + Internal class used to provide implementation of + interface. Applications should use to get + logger instances. + + + This is one of the central classes in the log4net implementation. One of the + distinctive features of log4net are hierarchical loggers and their + evaluation. The organizes the + instances into a rooted tree hierarchy. + + + The class is abstract. Only concrete subclasses of + can be created. The + is used to create instances of this type for the . + + + Nicko Cadell + Gert Driesen + Aspi Havewala + Douglas de la Torre + + + + This constructor created a new instance and + sets its name. + + The name of the . + + + This constructor is protected and designed to be used by + a subclass that is not abstract. + + + Loggers are constructed by + objects. See for the default + logger creator. + + + + + + Add to the list of appenders of this + Logger instance. + + An appender to add to this logger + + + Add to the list of appenders of this + Logger instance. + + + If is already in the list of + appenders, then it won't be added again. + + + + + + Look for the appender named as name + + The name of the appender to lookup + The appender with the name specified, or null. + + + Returns the named appender, or null if the appender is not found. + + + + + + Remove all previously added appenders from this Logger instance. + + + + Remove all previously added appenders from this Logger instance. + + + This is useful when re-reading configuration information. + + + + + + Remove the appender passed as parameter form the list of appenders. + + The appender to remove + The appender removed from the list + + + Remove the appender passed as parameter form the list of appenders. + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + Remove the appender passed as parameter form the list of appenders. + + The name of the appender to remove + The appender removed from the list + + + Remove the named appender passed as parameter form the list of appenders. + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + This generic form is intended to be used by wrappers. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The level of the message to be logged. + The message object to log. + The exception to log, including its stack trace. + + + Generate a logging event for the specified using + the and . + + + This method must not throw any exception to the caller. + + + + + + This is the most generic printing method that is intended to be used + by wrappers. + + The event being logged. + + + Logs the specified logging event through this logger. + + + This method must not throw any exception to the caller. + + + + + + Checks if this logger is enabled for a given passed as parameter. + + The level to check. + + true if this logger is enabled for level, otherwise false. + + + + Test if this logger is going to log events of the specified . + + + This method must not throw any exception to the caller. + + + + + + Deliver the to the attached appenders. + + The event to log. + + + Call the appenders in the hierarchy starting at + this. If no appenders could be found, emit a + warning. + + + This method calls all the appenders inherited from the + hierarchy circumventing any evaluation of whether to log or not + to log the particular log request. + + + + + + Closes all attached appenders implementing the interface. + + + + Used to ensure that the appenders are correctly shutdown. + + + + + + This is the most generic printing method. This generic form is intended to be used by wrappers + + The level of the message to be logged. + The message object to log. + The exception to log, including its stack trace. + + + Generate a logging event for the specified using + the . + + + + + + Creates a new logging event and logs the event without further checks. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The level of the message to be logged. + The message object to log. + The exception to log, including its stack trace. + + + Generates a logging event and delivers it to the attached + appenders. + + + + + + Creates a new logging event and logs the event without further checks. + + The event being logged. + + + Delivers the logging event to the attached appenders. + + + + + + The fully qualified type of the Logger class. + + + + + The name of this logger. + + + + + The assigned level of this logger. + + + + The level variable need not be + assigned a value in which case it is inherited + form the hierarchy. + + + + + + The parent of this logger. + + + + The parent of this logger. + All loggers have at least one ancestor which is the root logger. + + + + + + Loggers need to know what Hierarchy they are in. + + + + Loggers need to know what Hierarchy they are in. + The hierarchy that this logger is a member of is stored + here. + + + + + + Helper implementation of the interface + + + + + Flag indicating if child loggers inherit their parents appenders + + + + Additivity is set to true by default, that is children inherit + the appenders of their ancestors by default. If this variable is + set to false then the appenders found in the + ancestors of this logger are not used. However, the children + of this logger will inherit its appenders, unless the children + have their additivity flag set to false too. See + the user manual for more details. + + + + + + Lock to protect AppenderAttachedImpl variable m_appenderAttachedImpl + + + + + Gets or sets the parent logger in the hierarchy. + + + The parent logger in the hierarchy. + + + + Part of the Composite pattern that makes the hierarchy. + The hierarchy is parent linked rather than child linked. + + + + + + Gets or sets a value indicating if child loggers inherit their parent's appenders. + + + true if child loggers inherit their parent's appenders. + + + + Additivity is set to true by default, that is children inherit + the appenders of their ancestors by default. If this variable is + set to false then the appenders found in the + ancestors of this logger are not used. However, the children + of this logger will inherit its appenders, unless the children + have their additivity flag set to false too. See + the user manual for more details. + + + + + + Gets the effective level for this logger. + + The nearest level in the logger hierarchy. + + + Starting from this logger, searches the logger hierarchy for a + non-null level and returns it. Otherwise, returns the level of the + root logger. + + The Logger class is designed so that this method executes as + quickly as possible. + + + + + Gets or sets the where this + Logger instance is attached to. + + The hierarchy that this logger belongs to. + + + This logger must be attached to a single . + + + + + + Gets or sets the assigned , if any, for this Logger. + + + The of this logger. + + + + The assigned can be null. + + + + + + Get the appenders contained in this logger as an + . + + A collection of the appenders in this logger + + + Get the appenders contained in this logger as an + . If no appenders + can be found, then a is returned. + + + + + + Gets the logger name. + + + The name of the logger. + + + + The name of this logger + + + + + + Gets the where this + Logger instance is attached to. + + + The that this logger belongs to. + + + + Gets the where this + Logger instance is attached to. + + + + + + Construct a new Logger + + the name of the logger + + + Initializes a new instance of the class + with the specified name. + + + + + + Delegate used to handle logger creation event notifications. + + The in which the has been created. + The event args that hold the instance that has been created. + + + Delegate used to handle logger creation event notifications. + + + + + + Provides data for the event. + + + + A event is raised every time a + is created. + + + + + + The created + + + + + Constructor + + The that has been created. + + + Initializes a new instance of the event argument + class,with the specified . + + + + + + Gets the that has been created. + + + The that has been created. + + + + The that has been created. + + + + + + Hierarchical organization of loggers + + + + The casual user should not have to deal with this class + directly. + + + This class is specialized in retrieving loggers by name and + also maintaining the logger hierarchy. Implements the + interface. + + + The structure of the logger hierarchy is maintained by the + method. The hierarchy is such that children + link to their parent but parents do not have any references to their + children. Moreover, loggers can be instantiated in any order, in + particular descendant before ancestor. + + + In case a descendant is created before a particular ancestor, + then it creates a provision node for the ancestor and adds itself + to the provision node. Other descendants of the same ancestor add + themselves to the previously created provision node. + + + Nicko Cadell + Gert Driesen + + + + Base implementation of + + + + Default abstract implementation of the interface. + + + Skeleton implementation of the interface. + All types can extend this type. + + + Nicko Cadell + Gert Driesen + + + + Interface implemented by logger repositories. + + + + This interface is implemented by logger repositories. e.g. + . + + + This interface is used by the + to obtain interfaces. + + + Nicko Cadell + Gert Driesen + + + + Check if the named logger exists in the repository. If so return + its reference, otherwise returns null. + + The name of the logger to lookup + The Logger object with the name specified + + + If the names logger exists it is returned, otherwise + null is returned. + + + + + + Returns all the currently defined loggers as an Array. + + All the defined loggers + + + Returns all the currently defined loggers as an Array. + + + + + + Returns a named logger instance + + The name of the logger to retrieve + The logger object with the name specified + + + Returns a named logger instance. + + + If a logger of that name already exists, then it will be + returned. Otherwise, a new logger will be instantiated and + then linked with its existing ancestors as well as children. + + + + + Shutdown the repository + + + Shutting down a repository will safely close and remove + all appenders in all loggers including the root logger. + + + Some appenders need to be closed before the + application exists. Otherwise, pending logging events might be + lost. + + + The method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Reset the repositories configuration to a default state + + + + Reset all values contained in this instance to their + default state. + + + Existing loggers are not removed. They are just reset. + + + This method should be used sparingly and with care as it will + block all logging until it is completed. + + + + + + Log the through this repository. + + the event to log + + + This method should not normally be used to log. + The interface should be used + for routine logging. This interface can be obtained + using the method. + + + The logEvent is delivered to the appropriate logger and + that logger is then responsible for logging the event. + + + + + + Returns all the Appenders that are configured as an Array. + + All the Appenders + + + Returns all the Appenders that are configured as an Array. + + + + + + The name of the repository + + + The name of the repository + + + + The name of the repository. + + + + + + RendererMap accesses the object renderer map for this repository. + + + RendererMap accesses the object renderer map for this repository. + + + + RendererMap accesses the object renderer map for this repository. + + + The RendererMap holds a mapping between types and + objects. + + + + + + The plugin map for this repository. + + + The plugin map for this repository. + + + + The plugin map holds the instances + that have been attached to this repository. + + + + + + Get the level map for the Repository. + + + + Get the level map for the Repository. + + + The level map defines the mappings between + level names and objects in + this repository. + + + + + + The threshold for all events in this repository + + + The threshold for all events in this repository + + + + The threshold for all events in this repository. + + + + + + Flag indicates if this repository has been configured. + + + Flag indicates if this repository has been configured. + + + + Flag indicates if this repository has been configured. + + + + + + Collection of internal messages captured during the most + recent configuration process. + + + + + Event to notify that the repository has been shutdown. + + + Event to notify that the repository has been shutdown. + + + + Event raised when the repository has been shutdown. + + + + + + Event to notify that the repository has had its configuration reset. + + + Event to notify that the repository has had its configuration reset. + + + + Event raised when the repository's configuration has been + reset to default. + + + + + + Event to notify that the repository has had its configuration changed. + + + Event to notify that the repository has had its configuration changed. + + + + Event raised when the repository's configuration has been changed. + + + + + + Repository specific properties + + + Repository specific properties + + + + These properties can be specified on a repository specific basis. + + + + + + Default Constructor + + + + Initializes the repository with default (empty) properties. + + + + + + Construct the repository using specific properties + + the properties to set for this repository + + + Initializes the repository with specified properties. + + + + + + Test if logger exists + + The name of the logger to lookup + The Logger object with the name specified + + + Check if the named logger exists in the repository. If so return + its reference, otherwise returns null. + + + + + + Returns all the currently defined loggers in the repository + + All the defined loggers + + + Returns all the currently defined loggers in the repository as an Array. + + + + + + Return a new logger instance + + The name of the logger to retrieve + The logger object with the name specified + + + Return a new logger instance. + + + If a logger of that name already exists, then it will be + returned. Otherwise, a new logger will be instantiated and + then linked with its existing ancestors as well as children. + + + + + + Shutdown the repository + + + + Shutdown the repository. Can be overridden in a subclass. + This base class implementation notifies the + listeners and all attached plugins of the shutdown event. + + + + + + Reset the repositories configuration to a default state + + + + Reset all values contained in this instance to their + default state. + + + Existing loggers are not removed. They are just reset. + + + This method should be used sparingly and with care as it will + block all logging until it is completed. + + + + + + Log the logEvent through this repository. + + the event to log + + + This method should not normally be used to log. + The interface should be used + for routine logging. This interface can be obtained + using the method. + + + The logEvent is delivered to the appropriate logger and + that logger is then responsible for logging the event. + + + + + + Returns all the Appenders that are configured as an Array. + + All the Appenders + + + Returns all the Appenders that are configured as an Array. + + + + + + The fully qualified type of the LoggerRepositorySkeleton class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Adds an object renderer for a specific class. + + The type that will be rendered by the renderer supplied. + The object renderer used to render the object. + + + Adds an object renderer for a specific class. + + + + + + Notify the registered listeners that the repository is shutting down + + Empty EventArgs + + + Notify any listeners that this repository is shutting down. + + + + + + Notify the registered listeners that the repository has had its configuration reset + + Empty EventArgs + + + Notify any listeners that this repository's configuration has been reset. + + + + + + Notify the registered listeners that the repository has had its configuration changed + + Empty EventArgs + + + Notify any listeners that this repository's configuration has changed. + + + + + + Raise a configuration changed event on this repository + + EventArgs.Empty + + + Applications that programmatically change the configuration of the repository should + raise this event notification to notify listeners. + + + + + + The name of the repository + + + The string name of the repository + + + + The name of this repository. The name is + used to store and lookup the repositories + stored by the . + + + + + + The threshold for all events in this repository + + + The threshold for all events in this repository + + + + The threshold for all events in this repository + + + + + + RendererMap accesses the object renderer map for this repository. + + + RendererMap accesses the object renderer map for this repository. + + + + RendererMap accesses the object renderer map for this repository. + + + The RendererMap holds a mapping between types and + objects. + + + + + + The plugin map for this repository. + + + The plugin map for this repository. + + + + The plugin map holds the instances + that have been attached to this repository. + + + + + + Get the level map for the Repository. + + + + Get the level map for the Repository. + + + The level map defines the mappings between + level names and objects in + this repository. + + + + + + Flag indicates if this repository has been configured. + + + Flag indicates if this repository has been configured. + + + + Flag indicates if this repository has been configured. + + + + + + Contains a list of internal messages captures during the + last configuration. + + + + + Event to notify that the repository has been shutdown. + + + Event to notify that the repository has been shutdown. + + + + Event raised when the repository has been shutdown. + + + + + + Event to notify that the repository has had its configuration reset. + + + Event to notify that the repository has had its configuration reset. + + + + Event raised when the repository's configuration has been + reset to default. + + + + + + Event to notify that the repository has had its configuration changed. + + + Event to notify that the repository has had its configuration changed. + + + + Event raised when the repository's configuration has been changed. + + + + + + Repository specific properties + + + Repository specific properties + + + These properties can be specified on a repository specific basis + + + + + Basic Configurator interface for repositories + + + + Interface used by basic configurator to configure a + with a default . + + + A should implement this interface to support + configuration by the . + + + Nicko Cadell + Gert Driesen + + + + Initialize the repository using the specified appender + + the appender to use to log all logging events + + + Configure the repository to route all logging events to the + specified appender. + + + + + + Initialize the repository using the specified appenders + + the appenders to use to log all logging events + + + Configure the repository to route all logging events to the + specified appenders. + + + + + + Configure repository using XML + + + + Interface used by Xml configurator to configure a . + + + A should implement this interface to support + configuration by the . + + + Nicko Cadell + Gert Driesen + + + + Initialize the repository using the specified config + + the element containing the root of the config + + + The schema for the XML configuration data is defined by + the implementation. + + + + + + Default constructor + + + + Initializes a new instance of the class. + + + + + + Construct with properties + + The properties to pass to this repository. + + + Initializes a new instance of the class. + + + + + + Construct with a logger factory + + The factory to use to create new logger instances. + + + Initializes a new instance of the class with + the specified . + + + + + + Construct with properties and a logger factory + + The properties to pass to this repository. + The factory to use to create new logger instances. + + + Initializes a new instance of the class with + the specified . + + + + + + Test if a logger exists + + The name of the logger to lookup + The Logger object with the name specified + + + Check if the named logger exists in the hierarchy. If so return + its reference, otherwise returns null. + + + + + + Returns all the currently defined loggers in the hierarchy as an Array + + All the defined loggers + + + Returns all the currently defined loggers in the hierarchy as an Array. + The root logger is not included in the returned + enumeration. + + + + + + Return a new logger instance named as the first parameter using + the default factory. + + + + Return a new logger instance named as the first parameter using + the default factory. + + + If a logger of that name already exists, then it will be + returned. Otherwise, a new logger will be instantiated and + then linked with its existing ancestors as well as children. + + + The name of the logger to retrieve + The logger object with the name specified + + + + Shutting down a hierarchy will safely close and remove + all appenders in all loggers including the root logger. + + + + Shutting down a hierarchy will safely close and remove + all appenders in all loggers including the root logger. + + + Some appenders need to be closed before the + application exists. Otherwise, pending logging events might be + lost. + + + The Shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Reset all values contained in this hierarchy instance to their default. + + + + Reset all values contained in this hierarchy instance to their + default. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set its default "off" value. + + + Existing loggers are not removed. They are just reset. + + + This method should be used sparingly and with care as it will + block all logging until it is completed. + + + + + + Log the logEvent through this hierarchy. + + the event to log + + + This method should not normally be used to log. + The interface should be used + for routine logging. This interface can be obtained + using the method. + + + The logEvent is delivered to the appropriate logger and + that logger is then responsible for logging the event. + + + + + + Returns all the Appenders that are currently configured + + An array containing all the currently configured appenders + + + Returns all the instances that are currently configured. + All the loggers are searched for appenders. The appenders may also be containers + for appenders and these are also searched for additional loggers. + + + The list returned is unordered but does not contain duplicates. + + + + + + Collect the appenders from an . + The appender may also be a container. + + + + + + + Collect the appenders from an container + + + + + + + Initialize the log4net system using the specified appender + + the appender to use to log all logging events + + + + Initialize the log4net system using the specified appenders + + the appenders to use to log all logging events + + + + Initialize the log4net system using the specified appenders + + the appenders to use to log all logging events + + + This method provides the same functionality as the + method implemented + on this object, but it is protected and therefore can be called by subclasses. + + + + + + Initialize the log4net system using the specified config + + the element containing the root of the config + + + + Initialize the log4net system using the specified config + + the element containing the root of the config + + + This method provides the same functionality as the + method implemented + on this object, but it is protected and therefore can be called by subclasses. + + + + + + Test if this hierarchy is disabled for the specified . + + The level to check against. + + true if the repository is disabled for the level argument, false otherwise. + + + + If this hierarchy has not been configured then this method will + always return true. + + + This method will return true if this repository is + disabled for level object passed as parameter and + false otherwise. + + + See also the property. + + + + + + Clear all logger definitions from the internal hashtable + + + + This call will clear all logger definitions from the internal + hashtable. Invoking this method will irrevocably mess up the + logger hierarchy. + + + You should really know what you are doing before + invoking this method. + + + + + + Return a new logger instance named as the first parameter using + . + + The name of the logger to retrieve + The factory that will make the new logger instance + The logger object with the name specified + + + If a logger of that name already exists, then it will be + returned. Otherwise, a new logger will be instantiated by the + parameter and linked with its existing + ancestors as well as children. + + + + + + Sends a logger creation event to all registered listeners + + The newly created logger + + Raises the logger creation event. + + + + + Updates all the parents of the specified logger + + The logger to update the parents for + + + This method loops through all the potential parents of + . There 3 possible cases: + + + + No entry for the potential parent of exists + + We create a ProvisionNode for this potential + parent and insert in that provision node. + + + + The entry is of type Logger for the potential parent. + + The entry is 's nearest existing parent. We + update 's parent field with this entry. We also break from + he loop because updating our parent's parent is our parent's + responsibility. + + + + The entry is of type ProvisionNode for this potential parent. + + We add to the list of children for this + potential parent. + + + + + + + + Replace a with a in the hierarchy. + + + + + + We update the links for all the children that placed themselves + in the provision node 'pn'. The second argument 'log' is a + reference for the newly created Logger, parent of all the + children in 'pn'. + + + We loop on all the children 'c' in 'pn'. + + + If the child 'c' has been already linked to a child of + 'log' then there is no need to update 'c'. + + + Otherwise, we set log's parent field to c's parent and set + c's parent field to log. + + + + + + Define or redefine a Level using the values in the argument + + the level values + + + Define or redefine a Level using the values in the argument + + + Supports setting levels via the configuration file. + + + + + + Set a Property using the values in the argument + + the property value + + + Set a Property using the values in the argument. + + + Supports setting property values via the configuration file. + + + + + + The fully qualified type of the Hierarchy class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Event used to notify that a logger has been created. + + + + Event raised when a logger is created. + + + + + + Has no appender warning been emitted + + + + Flag to indicate if we have already issued a warning + about not having an appender warning. + + + + + + Get the root of this hierarchy + + + + Get the root of this hierarchy. + + + + + + Gets or sets the default instance. + + The default + + + The logger factory is used to create logger instances. + + + + + + A class to hold the value, name and display name for a level + + + + A class to hold the value, name and display name for a level + + + + + + Override Object.ToString to return sensible debug info + + string info about this object + + + + Value of the level + + + + If the value is not set (defaults to -1) the value will be looked + up for the current level with the same name. + + + + + + Name of the level + + + The name of the level + + + + The name of the level. + + + + + + Display name for the level + + + The display name of the level + + + + The display name of the level. + + + + + + Used internally to accelerate hash table searches. + + + + Internal class used to improve performance of + string keyed hashtables. + + + The hashcode of the string is cached for reuse. + The string is stored as an interned value. + When comparing two objects for equality + the reference equality of the interned strings is compared. + + + Nicko Cadell + Gert Driesen + + + + Construct key with string name + + + + Initializes a new instance of the class + with the specified name. + + + Stores the hashcode of the string and interns + the string key to optimize comparisons. + + + The Compact Framework 1.0 the + method does not work. On the Compact Framework + the string keys are not interned nor are they + compared by reference. + + + The name of the logger. + + + + Returns a hash code for the current instance. + + A hash code for the current instance. + + + Returns the cached hashcode. + + + + + + Determines whether two instances + are equal. + + The to compare with the current . + + true if the specified is equal to the current ; otherwise, false. + + + + Compares the references of the interned strings. + + + + + + Provision nodes are used where no logger instance has been specified + + + + instances are used in the + when there is no specified + for that node. + + + A provision node holds a list of child loggers on behalf of + a logger that does not exist. + + + Nicko Cadell + Gert Driesen + + + + Create a new provision node with child node + + A child logger to add to this node. + + + Initializes a new instance of the class + with the specified child logger. + + + + + + The sits at the root of the logger hierarchy tree. + + + + The is a regular except + that it provides several guarantees. + + + First, it cannot be assigned a null + level. Second, since the root logger cannot have a parent, the + property always returns the value of the + level field without walking the hierarchy. + + + Nicko Cadell + Gert Driesen + + + + Construct a + + The level to assign to the root logger. + + + Initializes a new instance of the class with + the specified logging level. + + + The root logger names itself as "root". However, the root + logger cannot be retrieved by name. + + + + + + The fully qualified type of the RootLogger class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets the assigned level value without walking the logger hierarchy. + + The assigned level value without walking the logger hierarchy. + + + Because the root logger cannot have a parent and its level + must not be null this property just returns the + value of . + + + + + + Gets or sets the assigned for the root logger. + + + The of the root logger. + + + + Setting the level of the root logger to a null reference + may have catastrophic results. We prevent this here. + + + + + + Initializes the log4net environment using an XML DOM. + + + + Configures a using an XML DOM. + + + Nicko Cadell + Gert Driesen + + + + Construct the configurator for a hierarchy + + The hierarchy to build. + + + Initializes a new instance of the class + with the specified . + + + + + + Configure the hierarchy by parsing a DOM tree of XML elements. + + The root element to parse. + + + Configure the hierarchy by parsing a DOM tree of XML elements. + + + + + + Parse appenders by IDREF. + + The appender ref element. + The instance of the appender that the ref refers to. + + + Parse an XML element that represents an appender and return + the appender. + + + + + + Parses an appender element. + + The appender element. + The appender instance or null when parsing failed. + + + Parse an XML element that represents an appender and return + the appender instance. + + + + + + Parses a logger element. + + The logger element. + + + Parse an XML element that represents a logger. + + + + + + Parses the root logger element. + + The root element. + + + Parse an XML element that represents the root logger. + + + + + + Parses the children of a logger element. + + The category element. + The logger instance. + Flag to indicate if the logger is the root logger. + + + Parse the child elements of a <logger> element. + + + + + + Parses an object renderer. + + The renderer element. + + + Parse an XML element that represents a renderer. + + + + + + Parses a level element. + + The level element. + The logger object to set the level on. + Flag to indicate if the logger is the root logger. + + + Parse an XML element that represents a level. + + + + + + Sets a parameter on an object. + + The parameter element. + The object to set the parameter on. + + The parameter name must correspond to a writable property + on the object. The value of the parameter is a string, + therefore this function will attempt to set a string + property first. If unable to set a string property it + will inspect the property and its argument type. It will + attempt to call a static method called Parse on the + type of the property. This method will take a single + string argument and return a value that can be used to + set the property. + + + + + Test if an element has no attributes or child elements + + the element to inspect + true if the element has any attributes or child elements, false otherwise + + + + Test if a is constructible with Activator.CreateInstance. + + the type to inspect + true if the type is creatable using a default constructor, false otherwise + + + + Look for a method on the that matches the supplied + + the type that has the method + the name of the method + the method info found + + + The method must be a public instance method on the . + The method must be named or "Add" followed by . + The method must take a single parameter. + + + + + + Converts a string value to a target type. + + The type of object to convert the string to. + The string value to use as the value of the object. + + + An object of type with value or + null when the conversion could not be performed. + + + + + + Creates an object as specified in XML. + + The XML element that contains the definition of the object. + The object type to use if not explicitly specified. + The type that the returned object must be or must inherit from. + The object or null + + + Parse an XML element and create an object instance based on the configuration + data. + + + The type of the instance may be specified in the XML. If not + specified then the is used + as the type. However the type is specified it must support the + type. + + + + + + key: appenderName, value: appender. + + + + + The Hierarchy being configured. + + + + + The fully qualified type of the XmlHierarchyConfigurator class. + + + Used by the internal logger to record the Type of the + log message. + + + + + + + + + + + + + + + + + + + + + Delegate used to handle logger repository shutdown event notifications + + The that is shutting down. + Empty event args + + + Delegate used to handle logger repository shutdown event notifications. + + + + + + Delegate used to handle logger repository configuration reset event notifications + + The that has had its configuration reset. + Empty event args + + + Delegate used to handle logger repository configuration reset event notifications. + + + + + + Delegate used to handle event notifications for logger repository configuration changes. + + The that has had its configuration changed. + Empty event arguments. + + + Delegate used to handle event notifications for logger repository configuration changes. + + + + + + Write the name of the current AppDomain to the output + + + + Write the name of the current AppDomain to the output writer + + + Nicko Cadell + + + + Write the name of the current AppDomain to the output + + the writer to write to + null, state is not set + + + Writes name of the current AppDomain to the output . + + + + + + Write the current date to the output + + + + Date pattern converter, uses a to format + the current date and time to the writer as a string. + + + The value of the determines + the formatting of the date. The following values are allowed: + + + Option value + Output + + + ISO8601 + + Uses the formatter. + Formats using the "yyyy-MM-dd HH:mm:ss,fff" pattern. + + + + DATE + + Uses the formatter. + Formats using the "dd MMM yyyy HH:mm:ss,fff" for example, "06 Nov 1994 15:49:37,459". + + + + ABSOLUTE + + Uses the formatter. + Formats using the "HH:mm:ss,fff" for example, "15:49:37,459". + + + + other + + Any other pattern string uses the formatter. + This formatter passes the pattern string to the + method. + For details on valid patterns see + DateTimeFormatInfo Class. + + + + + + The date and time is in the local time zone and is rendered in that zone. + To output the time in Universal time see . + + + Nicko Cadell + + + + The used to render the date to a string + + + + The used to render the date to a string + + + + + + Initialize the converter options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Write the current date to the output + + that will receive the formatted result. + null, state is not set + + + Pass the current date and time to the + for it to render it to the writer. + + + The date and time passed is in the local time zone. + + + + + + The fully qualified type of the DatePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write an folder path to the output + + + + Write an special path environment folder path to the output writer. + The value of the determines + the name of the variable to output. + should be a value in the enumeration. + + + Ron Grabowski + + + + Write an special path environment folder path to the output + + the writer to write to + null, state is not set + + + Writes the special path environment folder path to the output . + The name of the special path environment folder path to output must be set + using the + property. + + + + + + The fully qualified type of the EnvironmentFolderPathPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write an environment variable to the output + + + + Write an environment variable to the output writer. + The value of the determines + the name of the variable to output. + + + Nicko Cadell + + + + Write an environment variable to the output + + the writer to write to + null, state is not set + + + Writes the environment variable to the output . + The name of the environment variable to output must be set + using the + property. + + + + + + The fully qualified type of the EnvironmentPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write the current thread identity to the output + + + + Write the current thread identity to the output writer + + + Nicko Cadell + + + + Write the current thread identity to the output + + the writer to write to + null, state is not set + + + Writes the current thread identity to the output . + + + + + + The fully qualified type of the IdentityPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Pattern converter for literal string instances in the pattern + + + + Writes the literal string value specified in the + property to + the output. + + + Nicko Cadell + + + + Set the next converter in the chain + + The next pattern converter in the chain + The next pattern converter + + + Special case the building of the pattern converter chain + for instances. Two adjacent + literals in the pattern can be represented by a single combined + pattern converter. This implementation detects when a + is added to the chain + after this converter and combines its value with this converter's + literal value. + + + + + + Write the literal to the output + + the writer to write to + null, not set + + + Override the formatting behavior to ignore the FormattingInfo + because we have a literal instead. + + + Writes the value of + to the output . + + + + + + Convert this pattern into the rendered message + + that will receive the formatted result. + null, not set + + + This method is not used. + + + + + + Writes a newline to the output + + + + Writes the system dependent line terminator to the output. + This behavior can be overridden by setting the : + + + + Option Value + Output + + + DOS + DOS or Windows line terminator "\r\n" + + + UNIX + UNIX line terminator "\n" + + + + Nicko Cadell + + + + Initialize the converter + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Write the current process ID to the output + + + + Write the current process ID to the output writer + + + Nicko Cadell + + + + Write the current process ID to the output + + the writer to write to + null, state is not set + + + Write the current process ID to the output . + + + + + + The fully qualified type of the ProcessIdPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Property pattern converter + + + + This pattern converter reads the thread and global properties. + The thread properties take priority over global properties. + See for details of the + thread properties. See for + details of the global properties. + + + If the is specified then that will be used to + lookup a single property. If no is specified + then all properties will be dumped as a list of key value pairs. + + + Nicko Cadell + + + + Write the property value to the output + + that will receive the formatted result. + null, state is not set + + + Writes out the value of a named property. The property name + should be set in the + property. + + + If the is set to null + then all the properties are written as key value pairs. + + + + + + A Pattern converter that generates a string of random characters + + + + The converter generates a string of random characters. By default + the string is length 4. This can be changed by setting the + to the string value of the length required. + + + The random characters in the string are limited to uppercase letters + and numbers only. + + + The random number generator used by this class is not cryptographically secure. + + + Nicko Cadell + + + + Shared random number generator + + + + + Length of random string to generate. Default length 4. + + + + + Initialize the converter options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Write a randoim string to the output + + the writer to write to + null, state is not set + + + Write a randoim string to the output . + + + + + + The fully qualified type of the RandomStringPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write the current threads username to the output + + + + Write the current threads username to the output writer + + + Nicko Cadell + + + + Write the current threads username to the output + + the writer to write to + null, state is not set + + + Write the current threads username to the output . + + + + + + The fully qualified type of the UserNamePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write the UTC date time to the output + + + + Date pattern converter, uses a to format + the current date and time in Universal time. + + + See the for details on the date pattern syntax. + + + + Nicko Cadell + + + + Write the current date and time to the output + + that will receive the formatted result. + null, state is not set + + + Pass the current date and time to the + for it to render it to the writer. + + + The date is in Universal time when it is rendered. + + + + + + + The fully qualified type of the UtcDatePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Type converter for Boolean. + + + + Supports conversion from string to bool type. + + + + + + Nicko Cadell + Gert Driesen + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Convert the source object to the type supported by this object + + the object to convert + the converted object + + + Uses the method to convert the + argument to a . + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Exception base type for conversion errors. + + + + This type extends . It + does not add any new functionality but does differentiate the + type of exception being thrown. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Constructor + + A message to include with the exception. + + + Initializes a new instance of the class + with the specified message. + + + + + + Constructor + + A message to include with the exception. + A nested exception to include. + + + Initializes a new instance of the class + with the specified message and inner exception. + + + + + + Serialization constructor + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + + + Initializes a new instance of the class + with serialized data. + + + + + + Creates a new instance of the class. + + The conversion destination type. + The value to convert. + An instance of the . + + + Creates a new instance of the class. + + + + + + Creates a new instance of the class. + + The conversion destination type. + The value to convert. + A nested exception to include. + An instance of the . + + + Creates a new instance of the class. + + + + + + Register of type converters for specific types. + + + + Maintains a registry of type converters used to convert between + types. + + + Use the and + methods to register new converters. + The and methods + lookup appropriate converters to use. + + + + + Nicko Cadell + Gert Driesen + + + + Private constructor + + + Initializes a new instance of the class. + + + + + Static constructor. + + + + This constructor defines the intrinsic type converters. + + + + + + Adds a converter for a specific type. + + The type being converted to. + The type converter to use to convert to the destination type. + + + Adds a converter instance for a specific type. + + + + + + Adds a converter for a specific type. + + The type being converted to. + The type of the type converter to use to convert to the destination type. + + + Adds a converter for a specific type. + + + + + + Gets the type converter to use to convert values to the destination type. + + The type being converted from. + The type being converted to. + + The type converter instance to use for type conversions or null + if no type converter is found. + + + + Gets the type converter to use to convert values to the destination type. + + + + + + Gets the type converter to use to convert values to the destination type. + + The type being converted to. + + The type converter instance to use for type conversions or null + if no type converter is found. + + + + Gets the type converter to use to convert values to the destination type. + + + + + + Lookups the type converter to use as specified by the attributes on the + destination type. + + The type being converted to. + + The type converter instance to use for type conversions or null + if no type converter is found. + + + + + Creates the instance of the type converter. + + The type of the type converter. + + The type converter instance to use for type conversions or null + if no type converter is found. + + + + The type specified for the type converter must implement + the or interfaces + and must have a public default (no argument) constructor. + + + + + + The fully qualified type of the ConverterRegistry class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Mapping from to type converter. + + + + + Supports conversion from string to type. + + + + Supports conversion from string to type. + + + + + + Nicko Cadell + Gert Driesen + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Overrides the ConvertFrom method of IConvertFrom. + + the object to convert to an encoding + the encoding + + + Uses the method to + convert the argument to an . + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Interface supported by type converters + + + + This interface supports conversion from a single type to arbitrary types. + See . + + + Nicko Cadell + + + + Returns whether this converter can convert the object to the specified type + + A Type that represents the type you want to convert to + true if the conversion is possible + + + Test if the type supported by this converter can be converted to the + . + + + + + + Converts the given value object to the specified type, using the arguments + + the object to convert + The Type to convert the value parameter to + the converted object + + + Converts the (which must be of the type supported + by this converter) to the specified.. + + + + + + Supports conversion from string to type. + + + + Supports conversion from string to type. + + + + + Nicko Cadell + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Overrides the ConvertFrom method of IConvertFrom. + + the object to convert to an IPAddress + the IPAddress + + + Uses the method to convert the + argument to an . + If that fails then the string is resolved as a DNS hostname. + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Valid characters in an IPv4 or IPv6 address string. (Does not support subnets) + + + + + Supports conversion from string to type. + + + + Supports conversion from string to type. + + + The string is used as the + of the . + + + + + + Nicko Cadell + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Overrides the ConvertFrom method of IConvertFrom. + + the object to convert to a PatternLayout + the PatternLayout + + + Creates and returns a new using + the as the + . + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Convert between string and + + + + Supports conversion from string to type, + and from a type to a string. + + + The string is used as the + of the . + + + + + + Nicko Cadell + + + + Can the target type be converted to the type supported by this object + + A that represents the type you want to convert to + true if the conversion is possible + + + Returns true if the is + assignable from a type. + + + + + + Converts the given value object to the specified type, using the arguments + + the object to convert + The Type to convert the value parameter to + the converted object + + + Uses the method to convert the + argument to a . + + + + The object cannot be converted to the + . To check for this condition use the + method. + + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Overrides the ConvertFrom method of IConvertFrom. + + the object to convert to a PatternString + the PatternString + + + Creates and returns a new using + the as the + . + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Supports conversion from string to type. + + + + Supports conversion from string to type. + + + + + + Nicko Cadell + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Overrides the ConvertFrom method of IConvertFrom. + + the object to convert to a Type + the Type + + + Uses the method to convert the + argument to a . + Additional effort is made to locate partially specified types + by searching the loaded assemblies. + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Attribute used to associate a type converter + + + + Class and Interface level attribute that specifies a type converter + to use with the associated type. + + + To associate a type converter with a target type apply a + TypeConverterAttribute to the target type. Specify the + type of the type converter on the attribute. + + + Nicko Cadell + Gert Driesen + + + + The string type name of the type converter + + + + + Default constructor + + + + Default constructor + + + + + + Create a new type converter attribute for the specified type name + + The string type name of the type converter + + + The type specified must implement the + or the interfaces. + + + + + + Create a new type converter attribute for the specified type + + The type of the type converter + + + The type specified must implement the + or the interfaces. + + + + + + The string type name of the type converter + + + The string type name of the type converter + + + + The type specified must implement the + or the interfaces. + + + + + + A straightforward implementation of the interface. + + + + This is the default implementation of the + interface. Implementors of the interface + should aggregate an instance of this type. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Append on on all attached appenders. + + The event being logged. + The number of appenders called. + + + Calls the method on all + attached appenders. + + + + + + Append on on all attached appenders. + + The array of events being logged. + The number of appenders called. + + + Calls the method on all + attached appenders. + + + + + + Calls the DoAppende method on the with + the objects supplied. + + The appender + The events + + + If the supports the + interface then the will be passed + through using that interface. Otherwise the + objects in the array will be passed one at a time. + + + + + + Attaches an appender. + + The appender to add. + + + If the appender is already in the list it won't be added again. + + + + + + Gets an attached appender with the specified name. + + The name of the appender to get. + + The appender with the name specified, or null if no appender with the + specified name is found. + + + + Lookup an attached appender by name. + + + + + + Removes all attached appenders. + + + + Removes and closes all attached appenders + + + + + + Removes the specified appender from the list of attached appenders. + + The appender to remove. + The appender removed from the list + + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + Removes the appender with the specified name from the list of appenders. + + The name of the appender to remove. + The appender removed from the list + + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + List of appenders + + + + + Array of appenders, used to cache the m_appenderList + + + + + The fully qualified type of the AppenderAttachedImpl class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets all attached appenders. + + + A collection of attached appenders, or null if there + are no attached appenders. + + + + The read only collection of all currently attached appenders. + + + + + + This class aggregates several PropertiesDictionary collections together. + + + + Provides a dictionary style lookup over an ordered list of + collections. + + + Nicko Cadell + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Add a Properties Dictionary to this composite collection + + the properties to add + + + Properties dictionaries added first take precedence over dictionaries added + later. + + + + + + Flatten this composite collection into a single properties dictionary + + the flattened dictionary + + + Reduces the collection of ordered dictionaries to a single dictionary + containing the resultant values for the keys. + + + + + + Gets the value of a property + + + The value for the property with the specified key + + + + Looks up the value for the specified. + The collections are searched + in the order in which they were added to this collection. The value + returned is the value held by the first collection that contains + the specified key. + + + If none of the collections contain the specified key then + null is returned. + + + + + + Base class for Context Properties implementations + + + + This class defines a basic property get set accessor + + + Nicko Cadell + + + + Gets or sets the value of a property + + + The value for the property with the specified key + + + + Gets or sets the value of a property + + + + + + Wrapper class used to map converter names to converter types + + + + Pattern converter info class used during configuration by custom + PatternString and PatternLayer converters. + + + + + + default constructor + + + + + + + + + + + Gets or sets the name of the conversion pattern + + + + The name of the pattern in the format string + + + + + + Gets or sets the type of the converter + + + + The value specified must extend the + type. + + + + + + + + + + + Subclass of that maintains a count of + the number of bytes written. + + + + This writer counts the number of bytes written. + + + Nicko Cadell + Gert Driesen + + + + that does not leak exceptions + + + + does not throw exceptions when things go wrong. + Instead, it delegates error handling to its . + + + Nicko Cadell + Gert Driesen + + + + Adapter that extends and forwards all + messages to an instance of . + + + + Adapter that extends and forwards all + messages to an instance of . + + + Nicko Cadell + + + + The writer to forward messages to + + + + + Create an instance of that forwards all + messages to a . + + The to forward to + + + Create an instance of that forwards all + messages to a . + + + + + + Closes the writer and releases any system resources associated with the writer + + + + + + + + + Dispose this writer + + flag indicating if we are being disposed + + + Dispose this writer + + + + + + Flushes any buffered output + + + + Clears all buffers for the writer and causes any buffered data to be written + to the underlying device + + + + + + Writes a character to the wrapped TextWriter + + the value to write to the TextWriter + + + Writes a character to the wrapped TextWriter + + + + + + Writes a character buffer to the wrapped TextWriter + + the data buffer + the start index + the number of characters to write + + + Writes a character buffer to the wrapped TextWriter + + + + + + Writes a string to the wrapped TextWriter + + the value to write to the TextWriter + + + Writes a string to the wrapped TextWriter + + + + + + Gets or sets the underlying . + + + The underlying . + + + + Gets or sets the underlying . + + + + + + The Encoding in which the output is written + + + The + + + + The Encoding in which the output is written + + + + + + Gets an object that controls formatting + + + The format provider + + + + Gets an object that controls formatting + + + + + + Gets or sets the line terminator string used by the TextWriter + + + The line terminator to use + + + + Gets or sets the line terminator string used by the TextWriter + + + + + + Constructor + + the writer to actually write to + the error handler to report error to + + + Create a new QuietTextWriter using a writer and error handler + + + + + + Writes a character to the underlying writer + + the char to write + + + Writes a character to the underlying writer + + + + + + Writes a buffer to the underlying writer + + the buffer to write + the start index to write from + the number of characters to write + + + Writes a buffer to the underlying writer + + + + + + Writes a string to the output. + + The string data to write to the output. + + + Writes a string to the output. + + + + + + Closes the underlying output writer. + + + + Closes the underlying output writer. + + + + + + The error handler instance to pass all errors to + + + + + Flag to indicate if this writer is closed + + + + + Gets or sets the error handler that all errors are passed to. + + + The error handler that all errors are passed to. + + + + Gets or sets the error handler that all errors are passed to. + + + + + + Gets a value indicating whether this writer is closed. + + + true if this writer is closed, otherwise false. + + + + Gets a value indicating whether this writer is closed. + + + + + + Constructor + + The to actually write to. + The to report errors to. + + + Creates a new instance of the class + with the specified and . + + + + + + Writes a character to the underlying writer and counts the number of bytes written. + + the char to write + + + Overrides implementation of . Counts + the number of bytes written. + + + + + + Writes a buffer to the underlying writer and counts the number of bytes written. + + the buffer to write + the start index to write from + the number of characters to write + + + Overrides implementation of . Counts + the number of bytes written. + + + + + + Writes a string to the output and counts the number of bytes written. + + The string data to write to the output. + + + Overrides implementation of . Counts + the number of bytes written. + + + + + + Total number of bytes written. + + + + + Gets or sets the total number of bytes written. + + + The total number of bytes written. + + + + Gets or sets the total number of bytes written. + + + + + + A fixed size rolling buffer of logging events. + + + + An array backed fixed size leaky bucket. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + The maximum number of logging events in the buffer. + + + Initializes a new instance of the class with + the specified maximum number of buffered logging events. + + + The argument is not a positive integer. + + + + Appends a to the buffer. + + The event to append to the buffer. + The event discarded from the buffer, if the buffer is full, otherwise null. + + + Append an event to the buffer. If the buffer still contains free space then + null is returned. If the buffer is full then an event will be dropped + to make space for the new event, the event dropped is returned. + + + + + + Get and remove the oldest event in the buffer. + + The oldest logging event in the buffer + + + Gets the oldest (first) logging event in the buffer and removes it + from the buffer. + + + + + + Pops all the logging events from the buffer into an array. + + An array of all the logging events in the buffer. + + + Get all the events in the buffer and clear the buffer. + + + + + + Clear the buffer + + + + Clear the buffer of all events. The events in the buffer are lost. + + + + + + Gets the th oldest event currently in the buffer. + + The th oldest event currently in the buffer. + + + If is outside the range 0 to the number of events + currently in the buffer, then null is returned. + + + + + + Gets the maximum size of the buffer. + + The maximum size of the buffer. + + + Gets the maximum size of the buffer + + + + + + Gets the number of logging events in the buffer. + + The number of logging events in the buffer. + + + This number is guaranteed to be in the range 0 to + (inclusive). + + + + + + An always empty . + + + + A singleton implementation of the + interface that always represents an empty collection. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to enforce the singleton pattern. + + + + + + Copies the elements of the to an + , starting at a particular Array index. + + The one-dimensional + that is the destination of the elements copied from + . The Array must have zero-based + indexing. + The zero-based index in array at which + copying begins. + + + As the collection is empty no values are copied into the array. + + + + + + Returns an enumerator that can iterate through a collection. + + + An that can be used to + iterate through the collection. + + + + As the collection is empty a is returned. + + + + + + The singleton instance of the empty collection. + + + + + Gets the singleton instance of the empty collection. + + The singleton instance of the empty collection. + + + Gets the singleton instance of the empty collection. + + + + + + Gets a value indicating if access to the is synchronized (thread-safe). + + + true if access to the is synchronized (thread-safe); otherwise, false. + + + + For the this property is always true. + + + + + + Gets the number of elements contained in the . + + + The number of elements contained in the . + + + + As the collection is empty the is always 0. + + + + + + Gets an object that can be used to synchronize access to the . + + + An object that can be used to synchronize access to the . + + + + As the collection is empty and thread safe and synchronized this instance is also + the object. + + + + + + An always empty . + + + + A singleton implementation of the + interface that always represents an empty collection. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to enforce the singleton pattern. + + + + + + Copies the elements of the to an + , starting at a particular Array index. + + The one-dimensional + that is the destination of the elements copied from + . The Array must have zero-based + indexing. + The zero-based index in array at which + copying begins. + + + As the collection is empty no values are copied into the array. + + + + + + Returns an enumerator that can iterate through a collection. + + + An that can be used to + iterate through the collection. + + + + As the collection is empty a is returned. + + + + + + Adds an element with the provided key and value to the + . + + The to use as the key of the element to add. + The to use as the value of the element to add. + + + As the collection is empty no new values can be added. A + is thrown if this method is called. + + + This dictionary is always empty and cannot be modified. + + + + Removes all elements from the . + + + + As the collection is empty no values can be removed. A + is thrown if this method is called. + + + This dictionary is always empty and cannot be modified. + + + + Determines whether the contains an element + with the specified key. + + The key to locate in the . + false + + + As the collection is empty the method always returns false. + + + + + + Returns an enumerator that can iterate through a collection. + + + An that can be used to + iterate through the collection. + + + + As the collection is empty a is returned. + + + + + + Removes the element with the specified key from the . + + The key of the element to remove. + + + As the collection is empty no values can be removed. A + is thrown if this method is called. + + + This dictionary is always empty and cannot be modified. + + + + The singleton instance of the empty dictionary. + + + + + Gets the singleton instance of the . + + The singleton instance of the . + + + Gets the singleton instance of the . + + + + + + Gets a value indicating if access to the is synchronized (thread-safe). + + + true if access to the is synchronized (thread-safe); otherwise, false. + + + + For the this property is always true. + + + + + + Gets the number of elements contained in the + + + The number of elements contained in the . + + + + As the collection is empty the is always 0. + + + + + + Gets an object that can be used to synchronize access to the . + + + An object that can be used to synchronize access to the . + + + + As the collection is empty and thread safe and synchronized this instance is also + the object. + + + + + + Gets a value indicating whether the has a fixed size. + + true + + + As the collection is empty always returns true. + + + + + + Gets a value indicating whether the is read-only. + + true + + + As the collection is empty always returns true. + + + + + + Gets an containing the keys of the . + + An containing the keys of the . + + + As the collection is empty a is returned. + + + + + + Gets an containing the values of the . + + An containing the values of the . + + + As the collection is empty a is returned. + + + + + + Gets or sets the element with the specified key. + + The key of the element to get or set. + null + + + As the collection is empty no values can be looked up or stored. + If the index getter is called then null is returned. + A is thrown if the setter is called. + + + This dictionary is always empty and cannot be modified. + + + + Contain the information obtained when parsing formatting modifiers + in conversion modifiers. + + + + Holds the formatting information extracted from the format string by + the . This is used by the + objects when rendering the output. + + + Nicko Cadell + Gert Driesen + + + + Defaut Constructor + + + + Initializes a new instance of the class. + + + + + + Constructor + + + + Initializes a new instance of the class + with the specified parameters. + + + + + + Gets or sets the minimum value. + + + The minimum value. + + + + Gets or sets the minimum value. + + + + + + Gets or sets the maximum value. + + + The maximum value. + + + + Gets or sets the maximum value. + + + + + + Gets or sets a flag indicating whether left align is enabled + or not. + + + A flag indicating whether left align is enabled or not. + + + + Gets or sets a flag indicating whether left align is enabled or not. + + + + + + Implementation of Properties collection for the + + + + This class implements a properties collection that is thread safe and supports both + storing properties and capturing a read only copy of the current propertied. + + + This class is optimized to the scenario where the properties are read frequently + and are modified infrequently. + + + Nicko Cadell + + + + The read only copy of the properties. + + + + This variable is declared volatile to prevent the compiler and JIT from + reordering reads and writes of this thread performed on different threads. + + + + + + Lock object used to synchronize updates within this instance + + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Remove a property from the global context + + the key for the entry to remove + + + Removing an entry from the global context properties is relatively expensive compared + with reading a value. + + + + + + Clear the global context properties + + + + + Get a readonly immutable copy of the properties + + the current global context properties + + + This implementation is fast because the GlobalContextProperties class + stores a readonly copy of the properties. + + + + + + Gets or sets the value of a property + + + The value for the property with the specified key + + + + Reading the value for a key is faster than setting the value. + When the value is written a new read only copy of + the properties is created. + + + + + + The static class ILogExtensions contains a set of widely used + methods that ease the interaction with the ILog interface implementations. + + + + This class contains methods for logging at different levels and checks the + properties for determining if those logging levels are enabled in the current + configuration. + + + Simple example of logging messages + + using log4net.Util; + + ILog log = LogManager.GetLogger("application-log"); + + log.InfoExt("Application Start"); + log.DebugExt("This is a debug message"); + + + + + + The fully qualified type of the Logger class. + + + + + Log a message object with the level. + + The logger on which the message is logged. + The lambda expression that gets the object to log. + + + This method first checks if this logger is INFO + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is INFO enabled, then it converts + the message object (retrieved by invocation of the provided callback) to a + string by invoking the appropriate . + It then proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The logger on which the message is logged. + The lambda expression that gets the object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a message object with the level. //TODO + + Log a message object with the level. + + The logger on which the message is logged. + The message object to log. + + + This method first checks if this logger is INFO + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is INFO enabled, then it converts + the message object (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The logger on which the message is logged. + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Log a message object with the level. + + The logger on which the message is logged. + The lambda expression that gets the object to log. + + + This method first checks if this logger is INFO + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is INFO enabled, then it converts + the message object (retrieved by invocation of the provided callback) to a + string by invoking the appropriate . + It then proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The logger on which the message is logged. + The lambda expression that gets the object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a message object with the level. //TODO + + Log a message object with the level. + + The logger on which the message is logged. + The message object to log. + + + This method first checks if this logger is INFO + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is INFO enabled, then it converts + the message object (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The logger on which the message is logged. + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Log a message object with the level. + + The logger on which the message is logged. + The lambda expression that gets the object to log. + + + This method first checks if this logger is WARN + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is WARN enabled, then it converts + the message object (retrieved by invocation of the provided callback) to a + string by invoking the appropriate . + It then proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The logger on which the message is logged. + The lambda expression that gets the object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a message object with the level. //TODO + + Log a message object with the level. + + The logger on which the message is logged. + The message object to log. + + + This method first checks if this logger is WARN + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is WARN enabled, then it converts + the message object (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The logger on which the message is logged. + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Log a message object with the level. + + The logger on which the message is logged. + The lambda expression that gets the object to log. + + + This method first checks if this logger is ERROR + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is ERROR enabled, then it converts + the message object (retrieved by invocation of the provided callback) to a + string by invoking the appropriate . + It then proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The logger on which the message is logged. + The lambda expression that gets the object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a message object with the level. //TODO + + Log a message object with the level. + + The logger on which the message is logged. + The message object to log. + + + This method first checks if this logger is ERROR + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is ERROR enabled, then it converts + the message object (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The logger on which the message is logged. + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Log a message object with the level. + + The logger on which the message is logged. + The lambda expression that gets the object to log. + + + This method first checks if this logger is FATAL + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is FATAL enabled, then it converts + the message object (retrieved by invocation of the provided callback) to a + string by invoking the appropriate . + It then proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The logger on which the message is logged. + The lambda expression that gets the object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a message object with the level. //TODO + + Log a message object with the level. + + The logger on which the message is logged. + The message object to log. + + + This method first checks if this logger is FATAL + enabled by reading the value property. + This check happens always and does not depend on the + implementation. If this logger is FATAL enabled, then it converts + the message object (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The logger on which the message is logged. + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + The logger on which the message is logged. + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + The logger on which the message is logged. + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Manages a mapping from levels to + + + + Manages an ordered mapping from instances + to subclasses. + + + Nicko Cadell + + + + Default constructor + + + + Initialise a new instance of . + + + + + + Add a to this mapping + + the entry to add + + + If a has previously been added + for the same then that entry will be + overwritten. + + + + + + Lookup the mapping for the specified level + + the level to lookup + the for the level or null if no mapping found + + + Lookup the value for the specified level. Finds the nearest + mapping value for the level that is equal to or less than the + specified. + + + If no mapping could be found then null is returned. + + + + + + Initialize options + + + + Caches the sorted list of in an array + + + + + + Implementation of Properties collection for the + + + + Class implements a collection of properties that is specific to each thread. + The class is not synchronized as each thread has its own . + + + This class stores its properties in a slot on the named + log4net.Util.LogicalThreadContextProperties. + + + The requires a link time + for the + . + If the calling code does not have this permission then this context will be disabled. + It will not store any property values set on it. + + + Nicko Cadell + + + + Flag used to disable this context if we don't have permission to access the CallContext. + + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Remove a property + + the key for the entry to remove + + + Remove the value for the specified from the context. + + + + + + Clear all the context properties + + + + Clear all the context properties + + + + + + Get the PropertiesDictionary stored in the LocalDataStoreSlot for this thread. + + create the dictionary if it does not exist, otherwise return null if is does not exist + the properties for this thread + + + The collection returned is only to be used on the calling thread. If the + caller needs to share the collection between different threads then the + caller must clone the collection before doings so. + + + + + + Gets the call context get data. + + The peroperties dictionary stored in the call context + + The method has a + security link demand, therfore we must put the method call in a seperate method + that we can wrap in an exception handler. + + + + + Sets the call context data. + + The properties. + + The method has a + security link demand, therfore we must put the method call in a seperate method + that we can wrap in an exception handler. + + + + + The fully qualified type of the LogicalThreadContextProperties class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the value of a property + + + The value for the property with the specified key + + + + Get or set the property value for the specified. + + + + + + + + + + + + + Outputs log statements from within the log4net assembly. + + + + Log4net components cannot make log4net logging calls. However, it is + sometimes useful for the user to learn about what log4net is + doing. + + + All log4net internal debug calls go to the standard output stream + whereas internal error messages are sent to the standard error output + stream. + + + Nicko Cadell + Gert Driesen + + + + Formats Prefix, Source, and Message in the same format as the value + sent to Console.Out and Trace.Write. + + + + + + Initializes a new instance of the class. + + + + + + + + + Static constructor that initializes logging by reading + settings from the application configuration file. + + + + The log4net.Internal.Debug application setting + controls internal debugging. This setting should be set + to true to enable debugging. + + + The log4net.Internal.Quiet application setting + suppresses all internal logging including error messages. + This setting should be set to true to enable message + suppression. + + + + + + Raises the LogReceived event when an internal messages is received. + + + + + + + + + Writes log4net internal debug messages to the + standard output stream. + + + The message to log. + + + All internal debug messages are prepended with + the string "log4net: ". + + + + + + Writes log4net internal debug messages to the + standard output stream. + + The Type that generated this message. + The message to log. + An exception to log. + + + All internal debug messages are prepended with + the string "log4net: ". + + + + + + Writes log4net internal warning messages to the + standard error stream. + + The Type that generated this message. + The message to log. + + + All internal warning messages are prepended with + the string "log4net:WARN ". + + + + + + Writes log4net internal warning messages to the + standard error stream. + + The Type that generated this message. + The message to log. + An exception to log. + + + All internal warning messages are prepended with + the string "log4net:WARN ". + + + + + + Writes log4net internal error messages to the + standard error stream. + + The Type that generated this message. + The message to log. + + + All internal error messages are prepended with + the string "log4net:ERROR ". + + + + + + Writes log4net internal error messages to the + standard error stream. + + The Type that generated this message. + The message to log. + An exception to log. + + + All internal debug messages are prepended with + the string "log4net:ERROR ". + + + + + + Writes output to the standard output stream. + + The message to log. + + + Writes to both Console.Out and System.Diagnostics.Trace. + Note that the System.Diagnostics.Trace is not supported + on the Compact Framework. + + + If the AppDomain is not configured with a config file then + the call to System.Diagnostics.Trace may fail. This is only + an issue if you are programmatically creating your own AppDomains. + + + + + + Writes output to the standard error stream. + + The message to log. + + + Writes to both Console.Error and System.Diagnostics.Trace. + Note that the System.Diagnostics.Trace is not supported + on the Compact Framework. + + + If the AppDomain is not configured with a config file then + the call to System.Diagnostics.Trace may fail. This is only + an issue if you are programmatically creating your own AppDomains. + + + + + + Default debug level + + + + + In quietMode not even errors generate any output. + + + + + The event raised when an internal message has been received. + + + + + The Type that generated the internal message. + + + + + The DateTime stamp of when the internal message was received. + + + + + A string indicating the severity of the internal message. + + + "log4net: ", + "log4net:ERROR ", + "log4net:WARN " + + + + + The internal log message. + + + + + The Exception related to the message. + + + Optional. Will be null if no Exception was passed. + + + + + Gets or sets a value indicating whether log4net internal logging + is enabled or disabled. + + + true if log4net internal logging is enabled, otherwise + false. + + + + When set to true, internal debug level logging will be + displayed. + + + This value can be set by setting the application setting + log4net.Internal.Debug in the application configuration + file. + + + The default value is false, i.e. debugging is + disabled. + + + + + The following example enables internal debugging using the + application configuration file : + + + + + + + + + + + + + Gets or sets a value indicating whether log4net should generate no output + from internal logging, not even for errors. + + + true if log4net should generate no output at all from internal + logging, otherwise false. + + + + When set to true will cause internal logging at all levels to be + suppressed. This means that no warning or error reports will be logged. + This option overrides the setting and + disables all debug also. + + This value can be set by setting the application setting + log4net.Internal.Quiet in the application configuration file. + + + The default value is false, i.e. internal logging is not + disabled. + + + + The following example disables internal logging using the + application configuration file : + + + + + + + + + + + + + + + + + Test if LogLog.Debug is enabled for output. + + + true if Debug is enabled + + + + Test if LogLog.Debug is enabled for output. + + + + + + Test if LogLog.Warn is enabled for output. + + + true if Warn is enabled + + + + Test if LogLog.Warn is enabled for output. + + + + + + Test if LogLog.Error is enabled for output. + + + true if Error is enabled + + + + Test if LogLog.Error is enabled for output. + + + + + + Subscribes to the LogLog.LogReceived event and stores messages + to the supplied IList instance. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a native error code and message. + + + + Represents a Win32 platform native error. + + + Nicko Cadell + Gert Driesen + + + + Create an instance of the class with the specified + error number and message. + + The number of the native error. + The message of the native error. + + + Create an instance of the class with the specified + error number and message. + + + + + + Create a new instance of the class for the last Windows error. + + + An instance of the class for the last windows error. + + + + The message for the error number is lookup up using the + native Win32 FormatMessage function. + + + + + + Create a new instance of the class. + + the error number for the native error + + An instance of the class for the specified + error number. + + + + The message for the specified error number is lookup up using the + native Win32 FormatMessage function. + + + + + + Retrieves the message corresponding with a Win32 message identifier. + + Message identifier for the requested message. + + The message corresponding with the specified message identifier. + + + + The message will be searched for in system message-table resource(s) + using the native FormatMessage function. + + + + + + Return error information string + + error information string + + + Return error information string + + + + + + Formats a message string. + + Formatting options, and how to interpret the parameter. + Location of the message definition. + Message identifier for the requested message. + Language identifier for the requested message. + If includes FORMAT_MESSAGE_ALLOCATE_BUFFER, the function allocates a buffer using the LocalAlloc function, and places the pointer to the buffer at the address specified in . + If the FORMAT_MESSAGE_ALLOCATE_BUFFER flag is not set, this parameter specifies the maximum number of TCHARs that can be stored in the output buffer. If FORMAT_MESSAGE_ALLOCATE_BUFFER is set, this parameter specifies the minimum number of TCHARs to allocate for an output buffer. + Pointer to an array of values that are used as insert values in the formatted message. + + + The function requires a message definition as input. The message definition can come from a + buffer passed into the function. It can come from a message table resource in an + already-loaded module. Or the caller can ask the function to search the system's message + table resource(s) for the message definition. The function finds the message definition + in a message table resource based on a message identifier and a language identifier. + The function copies the formatted message text to an output buffer, processing any embedded + insert sequences if requested. + + + To prevent the usage of unsafe code, this stub does not support inserting values in the formatted message. + + + + + If the function succeeds, the return value is the number of TCHARs stored in the output + buffer, excluding the terminating null character. + + + If the function fails, the return value is zero. To get extended error information, + call . + + + + + + Gets the number of the native error. + + + The number of the native error. + + + + Gets the number of the native error. + + + + + + Gets the message of the native error. + + + The message of the native error. + + + + + Gets the message of the native error. + + + + + An always empty . + + + + A singleton implementation of the over a collection + that is empty and not modifiable. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to enforce the singleton pattern. + + + + + + Test if the enumerator can advance, if so advance. + + false as the cannot advance. + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will always return false. + + + + + + Resets the enumerator back to the start. + + + + As the enumerator is over an empty collection does nothing. + + + + + + The singleton instance of the . + + + + + Gets the singleton instance of the . + + The singleton instance of the . + + + Gets the singleton instance of the . + + + + + + Gets the current object from the enumerator. + + + Throws an because the + never has a current value. + + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + + + The collection is empty and + cannot be positioned over a valid location. + + + + Gets the current key from the enumerator. + + + Throws an exception because the + never has a current value. + + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + + + The collection is empty and + cannot be positioned over a valid location. + + + + Gets the current value from the enumerator. + + The current value from the enumerator. + + Throws an because the + never has a current value. + + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + + + The collection is empty and + cannot be positioned over a valid location. + + + + Gets the current entry from the enumerator. + + + Throws an because the + never has a current entry. + + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + + + The collection is empty and + cannot be positioned over a valid location. + + + + An always empty . + + + + A singleton implementation of the over a collection + that is empty and not modifiable. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to enforce the singleton pattern. + + + + + + Test if the enumerator can advance, if so advance + + false as the cannot advance. + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will always return false. + + + + + + Resets the enumerator back to the start. + + + + As the enumerator is over an empty collection does nothing. + + + + + + The singleton instance of the . + + + + + Get the singleton instance of the . + + The singleton instance of the . + + + Gets the singleton instance of the . + + + + + + Gets the current object from the enumerator. + + + Throws an because the + never has a current value. + + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + + + The collection is empty and + cannot be positioned over a valid location. + + + + A SecurityContext used when a SecurityContext is not required + + + + The is a no-op implementation of the + base class. It is used where a + is required but one has not been provided. + + + Nicko Cadell + + + + Singleton instance of + + + + Singleton instance of + + + + + + Private constructor + + + + Private constructor for singleton pattern. + + + + + + Impersonate this SecurityContext + + State supplied by the caller + null + + + No impersonation is done and null is always returned. + + + + + + Implements log4net's default error handling policy which consists + of emitting a message for the first error in an appender and + ignoring all subsequent errors. + + + + The error message is processed using the LogLog sub-system by default. + + + This policy aims at protecting an otherwise working application + from being flooded with error messages when logging fails. + + + Nicko Cadell + Gert Driesen + Ron Grabowski + + + + Default Constructor + + + + Initializes a new instance of the class. + + + + + + Constructor + + The prefix to use for each message. + + + Initializes a new instance of the class + with the specified prefix. + + + + + + Reset the error handler back to its initial disabled state. + + + + + Log an Error + + The error message. + The exception. + The internal error code. + + + Invokes if and only if this is the first error or the first error after has been called. + + + + + + Log the very first error + + The error message. + The exception. + The internal error code. + + + Sends the error information to 's Error method. + + + + + + Log an Error + + The error message. + The exception. + + + Invokes if and only if this is the first error or the first error after has been called. + + + + + + Log an error + + The error message. + + + Invokes if and only if this is the first error or the first error after has been called. + + + + + + The date the error was recorded. + + + + + Flag to indicate if it is the first error + + + + + The message recorded during the first error. + + + + + The exception recorded during the first error. + + + + + The error code recorded during the first error. + + + + + String to prefix each message with + + + + + The fully qualified type of the OnlyOnceErrorHandler class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Is error logging enabled + + + + Is error logging enabled. Logging is only enabled for the + first error delivered to the . + + + + + + The date the first error that trigged this error handler occured. + + + + + The message from the first error that trigged this error handler. + + + + + The exception from the first error that trigged this error handler. + + + May be . + + + + + The error code from the first error that trigged this error handler. + + + Defaults to + + + + + A convenience class to convert property values to specific types. + + + + Utility functions for converting types and parsing values. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to prevent instantiation of this class. + + + + + + Converts a string to a value. + + String to convert. + The default value. + The value of . + + + If is "true", then true is returned. + If is "false", then false is returned. + Otherwise, is returned. + + + + + + Parses a file size into a number. + + String to parse. + The default value. + The value of . + + + Parses a file size of the form: number[KB|MB|GB] into a + long value. It is scaled with the appropriate multiplier. + + + is returned when + cannot be converted to a value. + + + + + + Converts a string to an object. + + The target type to convert to. + The string to convert to an object. + + The object converted from a string or null when the + conversion failed. + + + + Converts a string to an object. Uses the converter registry to try + to convert the string value into the specified target type. + + + + + + Checks if there is an appropriate type conversion from the source type to the target type. + + The type to convert from. + The type to convert to. + true if there is a conversion from the source type to the target type. + + Checks if there is an appropriate type conversion from the source type to the target type. + + + + + + + Converts an object to the target type. + + The object to convert to the target type. + The type to convert to. + The converted object. + + + Converts an object to the target type. + + + + + + Instantiates an object given a class name. + + The fully qualified class name of the object to instantiate. + The class to which the new object should belong. + The object to return in case of non-fulfillment. + + An instance of the or + if the object could not be instantiated. + + + + Checks that the is a subclass of + . If that test fails or the object could + not be instantiated, then is returned. + + + + + + Performs variable substitution in string from the + values of keys found in . + + The string on which variable substitution is performed. + The dictionary to use to lookup variables. + The result of the substitutions. + + + The variable substitution delimiters are ${ and }. + + + For example, if props contains key=value, then the call + + + + string s = OptionConverter.SubstituteVariables("Value of key is ${key}."); + + + + will set the variable s to "Value of key is value.". + + + If no value could be found for the specified key, then substitution + defaults to an empty string. + + + For example, if system properties contains no value for the key + "nonExistentKey", then the call + + + + string s = OptionConverter.SubstituteVariables("Value of nonExistentKey is [${nonExistentKey}]"); + + + + will set s to "Value of nonExistentKey is []". + + + An Exception is thrown if contains a start + delimiter "${" which is not balanced by a stop delimiter "}". + + + + + + Converts the string representation of the name or numeric value of one or + more enumerated constants to an equivalent enumerated object. + + The type to convert to. + The enum string value. + If true, ignore case; otherwise, regard case. + An object of type whose value is represented by . + + + + The fully qualified type of the OptionConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Most of the work of the class + is delegated to the PatternParser class. + + + + The PatternParser processes a pattern string and + returns a chain of objects. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + The pattern to parse. + + + Initializes a new instance of the class + with the specified pattern string. + + + + + + Parses the pattern into a chain of pattern converters. + + The head of a chain of pattern converters. + + + Parses the pattern into a chain of pattern converters. + + + + + + Build the unified cache of converters from the static and instance maps + + the list of all the converter names + + + Build the unified cache of converters from the static and instance maps + + + + + + Internal method to parse the specified pattern to find specified matches + + the pattern to parse + the converter names to match in the pattern + + + The matches param must be sorted such that longer strings come before shorter ones. + + + + + + Process a parsed literal + + the literal text + + + + Process a parsed converter pattern + + the name of the converter + the optional option for the converter + the formatting info for the converter + + + + Resets the internal state of the parser and adds the specified pattern converter + to the chain. + + The pattern converter to add. + + + + The first pattern converter in the chain + + + + + the last pattern converter in the chain + + + + + The pattern + + + + + Internal map of converter identifiers to converter types + + + + This map overrides the static s_globalRulesRegistry map. + + + + + + The fully qualified type of the PatternParser class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Get the converter registry used by this parser + + + The converter registry used by this parser + + + + Get the converter registry used by this parser + + + + + + Sort strings by length + + + + that orders strings by string length. + The longest strings are placed first + + + + + + This class implements a patterned string. + + + + This string has embedded patterns that are resolved and expanded + when the string is formatted. + + + This class functions similarly to the + in that it accepts a pattern and renders it to a string. Unlike the + however the PatternString + does not render the properties of a specific but + of the process in general. + + + The recognized conversion pattern names are: + + + + Conversion Pattern Name + Effect + + + appdomain + + + Used to output the friendly name of the current AppDomain. + + + + + date + + + Used to output the current date and time in the local time zone. + To output the date in universal time use the %utcdate pattern. + The date conversion + specifier may be followed by a date format specifier enclosed + between braces. For example, %date{HH:mm:ss,fff} or + %date{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is + given then ISO8601 format is + assumed (). + + + The date format specifier admits the same syntax as the + time pattern string of the . + + + For better results it is recommended to use the log4net date + formatters. These can be specified using one of the strings + "ABSOLUTE", "DATE" and "ISO8601" for specifying + , + and respectively + . For example, + %date{ISO8601} or %date{ABSOLUTE}. + + + These dedicated date formatters perform significantly + better than . + + + + + env + + + Used to output the a specific environment variable. The key to + lookup must be specified within braces and directly following the + pattern specifier, e.g. %env{COMPUTERNAME} would include the value + of the COMPUTERNAME environment variable. + + + The env pattern is not supported on the .NET Compact Framework. + + + + + identity + + + Used to output the user name for the currently active user + (Principal.Identity.Name). + + + + + newline + + + Outputs the platform dependent line separator character or + characters. + + + This conversion pattern name offers the same performance as using + non-portable line separator strings such as "\n", or "\r\n". + Thus, it is the preferred way of specifying a line separator. + + + + + processid + + + Used to output the system process ID for the current process. + + + + + property + + + Used to output a specific context property. The key to + lookup must be specified within braces and directly following the + pattern specifier, e.g. %property{user} would include the value + from the property that is keyed by the string 'user'. Each property value + that is to be included in the log must be specified separately. + Properties are stored in logging contexts. By default + the log4net:HostName property is set to the name of machine on + which the event was originally logged. + + + If no key is specified, e.g. %property then all the keys and their + values are printed in a comma separated list. + + + The properties of an event are combined from a number of different + contexts. These are listed below in the order in which they are searched. + + + + the thread properties + + The that are set on the current + thread. These properties are shared by all events logged on this thread. + + + + the global properties + + The that are set globally. These + properties are shared by all the threads in the AppDomain. + + + + + + + random + + + Used to output a random string of characters. The string is made up of + uppercase letters and numbers. By default the string is 4 characters long. + The length of the string can be specified within braces directly following the + pattern specifier, e.g. %random{8} would output an 8 character string. + + + + + username + + + Used to output the WindowsIdentity for the currently + active user. + + + + + utcdate + + + Used to output the date of the logging event in universal time. + The date conversion + specifier may be followed by a date format specifier enclosed + between braces. For example, %utcdate{HH:mm:ss,fff} or + %utcdate{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is + given then ISO8601 format is + assumed (). + + + The date format specifier admits the same syntax as the + time pattern string of the . + + + For better results it is recommended to use the log4net date + formatters. These can be specified using one of the strings + "ABSOLUTE", "DATE" and "ISO8601" for specifying + , + and respectively + . For example, + %utcdate{ISO8601} or %utcdate{ABSOLUTE}. + + + These dedicated date formatters perform significantly + better than . + + + + + % + + + The sequence %% outputs a single percent sign. + + + + + + Additional pattern converters may be registered with a specific + instance using or + . + + + See the for details on the + format modifiers supported by the patterns. + + + Nicko Cadell + + + + Internal map of converter identifiers to converter types. + + + + + the pattern + + + + + the head of the pattern converter chain + + + + + patterns defined on this PatternString only + + + + + Initialize the global registry + + + + + Default constructor + + + + Initialize a new instance of + + + + + + Constructs a PatternString + + The pattern to use with this PatternString + + + Initialize a new instance of with the pattern specified. + + + + + + Initialize object options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Create the used to parse the pattern + + the pattern to parse + The + + + Returns PatternParser used to parse the conversion string. Subclasses + may override this to return a subclass of PatternParser which recognize + custom conversion pattern name. + + + + + + Produces a formatted string as specified by the conversion pattern. + + The TextWriter to write the formatted event to + + + Format the pattern to the . + + + + + + Format the pattern as a string + + the pattern formatted as a string + + + Format the pattern to a string. + + + + + + Add a converter to this PatternString + + the converter info + + + This version of the method is used by the configurator. + Programmatic users should use the alternative method. + + + + + + Add a converter to this PatternString + + the name of the conversion pattern for this converter + the type of the converter + + + Add a converter to this PatternString + + + + + + Gets or sets the pattern formatting string + + + The pattern formatting string + + + + The ConversionPattern option. This is the string which + controls formatting and consists of a mix of literal content and + conversion specifiers. + + + + + + String keyed object map. + + + + While this collection is serializable only member + objects that are serializable will + be serialized along with this collection. + + + Nicko Cadell + Gert Driesen + + + + String keyed object map that is read only. + + + + This collection is readonly and cannot be modified. + + + While this collection is serializable only member + objects that are serializable will + be serialized along with this collection. + + + Nicko Cadell + Gert Driesen + + + + The Hashtable used to store the properties data + + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Copy Constructor + + properties to copy + + + Initializes a new instance of the class. + + + + + + Deserialization constructor + + The that holds the serialized object data. + The that contains contextual information about the source or destination. + + + Initializes a new instance of the class + with serialized data. + + + + + + Gets the key names. + + An array of all the keys. + + + Gets the key names. + + + + + + Test if the dictionary contains a specified key + + the key to look for + true if the dictionary contains the specified key + + + Test if the dictionary contains a specified key + + + + + + Serializes this object into the provided. + + The to populate with data. + The destination for this serialization. + + + Serializes this object into the provided. + + + + + + See + + + + + See + + + + + + See + + + + + + + Remove all properties from the properties collection + + + + + See + + + + + + + See + + + + + + + See + + + + + Gets or sets the value of the property with the specified key. + + + The value of the property with the specified key. + + The key of the property to get or set. + + + The property value will only be serialized if it is serializable. + If it cannot be serialized it will be silently ignored if + a serialization operation is performed. + + + + + + The hashtable used to store the properties + + + The internal collection used to store the properties + + + + The hashtable used to store the properties + + + + + + See + + + + + See + + + + + See + + + + + See + + + + + See + + + + + See + + + + + The number of properties in this collection + + + + + See + + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Constructor + + properties to copy + + + Initializes a new instance of the class. + + + + + + Initializes a new instance of the class + with serialized data. + + The that holds the serialized object data. + The that contains contextual information about the source or destination. + + + Because this class is sealed the serialization constructor is private. + + + + + + Remove the entry with the specified key from this dictionary + + the key for the entry to remove + + + Remove the entry with the specified key from this dictionary + + + + + + See + + an enumerator + + + Returns a over the contest of this collection. + + + + + + See + + the key to remove + + + Remove the entry with the specified key from this dictionary + + + + + + See + + the key to lookup in the collection + true if the collection contains the specified key + + + Test if this collection contains a specified key. + + + + + + Remove all properties from the properties collection + + + + Remove all properties from the properties collection + + + + + + See + + the key + the value to store for the key + + + Store a value for the specified . + + + Thrown if the is not a string + + + + See + + + + + + + See + + + + + Gets or sets the value of the property with the specified key. + + + The value of the property with the specified key. + + The key of the property to get or set. + + + The property value will only be serialized if it is serializable. + If it cannot be serialized it will be silently ignored if + a serialization operation is performed. + + + + + + See + + + false + + + + This collection is modifiable. This property always + returns false. + + + + + + See + + + The value for the key specified. + + + + Get or set a value for the specified . + + + Thrown if the is not a string + + + + See + + + + + See + + + + + See + + + + + See + + + + + See + + + + + A class to hold the key and data for a property set in the config file + + + + A class to hold the key and data for a property set in the config file + + + + + + Override Object.ToString to return sensible debug info + + string info about this object + + + + Property Key + + + Property Key + + + + Property Key. + + + + + + Property Value + + + Property Value + + + + Property Value. + + + + + + A that ignores the message + + + + This writer is used in special cases where it is necessary + to protect a writer from being closed by a client. + + + Nicko Cadell + + + + Constructor + + the writer to actually write to + + + Create a new ProtectCloseTextWriter using a writer + + + + + + Attach this instance to a different underlying + + the writer to attach to + + + Attach this instance to a different underlying + + + + + + Does not close the underlying output writer. + + + + Does not close the underlying output writer. + This method does nothing. + + + + + + Defines a lock that supports single writers and multiple readers + + + + ReaderWriterLock is used to synchronize access to a resource. + At any given time, it allows either concurrent read access for + multiple threads, or write access for a single thread. In a + situation where a resource is changed infrequently, a + ReaderWriterLock provides better throughput than a simple + one-at-a-time lock, such as . + + + If a platform does not support a System.Threading.ReaderWriterLock + implementation then all readers and writers are serialized. Therefore + the caller must not rely on multiple simultaneous readers. + + + Nicko Cadell + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Acquires a reader lock + + + + blocks if a different thread has the writer + lock, or if at least one thread is waiting for the writer lock. + + + + + + Decrements the lock count + + + + decrements the lock count. When the count + reaches zero, the lock is released. + + + + + + Acquires the writer lock + + + + This method blocks if another thread has a reader lock or writer lock. + + + + + + Decrements the lock count on the writer lock + + + + ReleaseWriterLock decrements the writer lock count. + When the count reaches zero, the writer lock is released. + + + + + + A that can be and reused + + + + A that can be and reused. + This uses a single buffer for string operations. + + + Nicko Cadell + + + + Create an instance of + + the format provider to use + + + Create an instance of + + + + + + Override Dispose to prevent closing of writer + + flag + + + Override Dispose to prevent closing of writer + + + + + + Reset this string writer so that it can be reused. + + the maximum buffer capacity before it is trimmed + the default size to make the buffer + + + Reset this string writer so that it can be reused. + The internal buffers are cleared and reset. + + + + + + Utility class for system specific information. + + + + Utility class of static methods for system specific information. + + + Nicko Cadell + Gert Driesen + Alexey Solofnenko + + + + Private constructor to prevent instances. + + + + Only static methods are exposed from this type. + + + + + + Initialize default values for private static fields. + + + + Only static methods are exposed from this type. + + + + + + Gets the assembly location path for the specified assembly. + + The assembly to get the location for. + The location of the assembly. + + + This method does not guarantee to return the correct path + to the assembly. If only tries to give an indication as to + where the assembly was loaded from. + + + + + + Gets the fully qualified name of the , including + the name of the assembly from which the was + loaded. + + The to get the fully qualified name for. + The fully qualified name for the . + + + This is equivalent to the Type.AssemblyQualifiedName property, + but this method works on the .NET Compact Framework 1.0 as well as + the full .NET runtime. + + + + + + Gets the short name of the . + + The to get the name for. + The short name of the . + + + The short name of the assembly is the + without the version, culture, or public key. i.e. it is just the + assembly's file name without the extension. + + + Use this rather than Assembly.GetName().Name because that + is not available on the Compact Framework. + + + Because of a FileIOPermission security demand we cannot do + the obvious Assembly.GetName().Name. We are allowed to get + the of the assembly so we + start from there and strip out just the assembly name. + + + + + + Gets the file name portion of the , including the extension. + + The to get the file name for. + The file name of the assembly. + + + Gets the file name portion of the , including the extension. + + + + + + Loads the type specified in the type string. + + A sibling type to use to load the type. + The name of the type to load. + Flag set to true to throw an exception if the type cannot be loaded. + true to ignore the case of the type name; otherwise, false + The type loaded or null if it could not be loaded. + + + If the type name is fully qualified, i.e. if contains an assembly name in + the type name, the type will be loaded from the system using + . + + + If the type name is not fully qualified, it will be loaded from the assembly + containing the specified relative type. If the type is not found in the assembly + then all the loaded assemblies will be searched for the type. + + + + + + Loads the type specified in the type string. + + The name of the type to load. + Flag set to true to throw an exception if the type cannot be loaded. + true to ignore the case of the type name; otherwise, false + The type loaded or null if it could not be loaded. + + + If the type name is fully qualified, i.e. if contains an assembly name in + the type name, the type will be loaded from the system using + . + + + If the type name is not fully qualified it will be loaded from the + assembly that is directly calling this method. If the type is not found + in the assembly then all the loaded assemblies will be searched for the type. + + + + + + Loads the type specified in the type string. + + An assembly to load the type from. + The name of the type to load. + Flag set to true to throw an exception if the type cannot be loaded. + true to ignore the case of the type name; otherwise, false + The type loaded or null if it could not be loaded. + + + If the type name is fully qualified, i.e. if contains an assembly name in + the type name, the type will be loaded from the system using + . + + + If the type name is not fully qualified it will be loaded from the specified + assembly. If the type is not found in the assembly then all the loaded assemblies + will be searched for the type. + + + + + + Generate a new guid + + A new Guid + + + Generate a new guid + + + + + + Create an + + The name of the parameter that caused the exception + The value of the argument that causes this exception + The message that describes the error + the ArgumentOutOfRangeException object + + + Create a new instance of the class + with a specified error message, the parameter name, and the value + of the argument. + + + The Compact Framework does not support the 3 parameter constructor for the + type. This method provides an + implementation that works for all platforms. + + + + + + Parse a string into an value + + the string to parse + out param where the parsed value is placed + true if the string was able to be parsed into an integer + + + Attempts to parse the string into an integer. If the string cannot + be parsed then this method returns false. The method does not throw an exception. + + + + + + Parse a string into an value + + the string to parse + out param where the parsed value is placed + true if the string was able to be parsed into an integer + + + Attempts to parse the string into an integer. If the string cannot + be parsed then this method returns false. The method does not throw an exception. + + + + + + Parse a string into an value + + the string to parse + out param where the parsed value is placed + true if the string was able to be parsed into an integer + + + Attempts to parse the string into an integer. If the string cannot + be parsed then this method returns false. The method does not throw an exception. + + + + + + Lookup an application setting + + the application settings key to lookup + the value for the key, or null + + + Configuration APIs are not supported under the Compact Framework + + + + + + Convert a path into a fully qualified local file path. + + The path to convert. + The fully qualified path. + + + Converts the path specified to a fully + qualified path. If the path is relative it is + taken as relative from the application base + directory. + + + The path specified must be a local file path, a URI is not supported. + + + + + + Creates a new case-insensitive instance of the class with the default initial capacity. + + A new case-insensitive instance of the class with the default initial capacity + + + The new Hashtable instance uses the default load factor, the CaseInsensitiveHashCodeProvider, and the CaseInsensitiveComparer. + + + + + + Gets an empty array of types. + + + + The Type.EmptyTypes field is not available on + the .NET Compact Framework 1.0. + + + + + + The fully qualified type of the SystemInfo class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Cache the host name for the current machine + + + + + Cache the application friendly name + + + + + Text to output when a null is encountered. + + + + + Text to output when an unsupported feature is requested. + + + + + Start time for the current process. + + + + + Gets the system dependent line terminator. + + + The system dependent line terminator. + + + + Gets the system dependent line terminator. + + + + + + Gets the base directory for this . + + The base directory path for the current . + + + Gets the base directory for this . + + + The value returned may be either a local file path or a URI. + + + + + + Gets the path to the configuration file for the current . + + The path to the configuration file for the current . + + + The .NET Compact Framework 1.0 does not have a concept of a configuration + file. For this runtime, we use the entry assembly location as the root for + the configuration file name. + + + The value returned may be either a local file path or a URI. + + + + + + Gets the path to the file that first executed in the current . + + The path to the entry assembly. + + + Gets the path to the file that first executed in the current . + + + + + + Gets the ID of the current thread. + + The ID of the current thread. + + + On the .NET framework, the AppDomain.GetCurrentThreadId method + is used to obtain the thread ID for the current thread. This is the + operating system ID for the thread. + + + On the .NET Compact Framework 1.0 it is not possible to get the + operating system thread ID for the current thread. The native method + GetCurrentThreadId is implemented inline in a header file + and cannot be called. + + + On the .NET Framework 2.0 the Thread.ManagedThreadId is used as this + gives a stable id unrelated to the operating system thread ID which may + change if the runtime is using fibers. + + + + + + Get the host name or machine name for the current machine + + + The hostname or machine name + + + + Get the host name or machine name for the current machine + + + The host name () or + the machine name (Environment.MachineName) for + the current machine, or if neither of these are available + then NOT AVAILABLE is returned. + + + + + + Get this application's friendly name + + + The friendly name of this application as a string + + + + If available the name of the application is retrieved from + the AppDomain using AppDomain.CurrentDomain.FriendlyName. + + + Otherwise the file name of the entry assembly is used. + + + + + + Get the start time for the current process. + + + + This is the time at which the log4net library was loaded into the + AppDomain. Due to reports of a hang in the call to System.Diagnostics.Process.StartTime + this is not the start time for the current process. + + + The log4net library should be loaded by an application early during its + startup, therefore this start time should be a good approximation for + the actual start time. + + + Note that AppDomains may be loaded and unloaded within the + same process without the process terminating, however this start time + will be set per AppDomain. + + + + + + Text to output when a null is encountered. + + + + Use this value to indicate a null has been encountered while + outputting a string representation of an item. + + + The default value is (null). This value can be overridden by specifying + a value for the log4net.NullText appSetting in the application's + .config file. + + + + + + Text to output when an unsupported feature is requested. + + + + Use this value when an unsupported feature is requested. + + + The default value is NOT AVAILABLE. This value can be overridden by specifying + a value for the log4net.NotAvailableText appSetting in the application's + .config file. + + + + + + Utility class that represents a format string. + + + + Utility class that represents a format string. + + + Nicko Cadell + + + + Initialise the + + An that supplies culture-specific formatting information. + A containing zero or more format items. + An array containing zero or more objects to format. + + + + Format the string and arguments + + the formatted string + + + + Replaces the format item in a specified with the text equivalent + of the value of a corresponding instance in a specified array. + A specified parameter supplies culture-specific formatting information. + + An that supplies culture-specific formatting information. + A containing zero or more format items. + An array containing zero or more objects to format. + + A copy of format in which the format items have been replaced by the + equivalent of the corresponding instances of in args. + + + + This method does not throw exceptions. If an exception thrown while formatting the result the + exception and arguments are returned in the result string. + + + + + + Process an error during StringFormat + + + + + Dump the contents of an array into a string builder + + + + + Dump an object to a string + + + + + The fully qualified type of the SystemStringFormat class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Implementation of Properties collection for the + + + + Class implements a collection of properties that is specific to each thread. + The class is not synchronized as each thread has its own . + + + Nicko Cadell + + + + Each thread will automatically have its instance. + + + + + Internal constructor + + + + Initializes a new instance of the class. + + + + + + Remove a property + + the key for the entry to remove + + + Remove a property + + + + + + Get the keys stored in the properties. + + + Gets the keys stored in the properties. + + a set of the defined keys + + + + Clear all properties + + + + Clear all properties + + + + + + Get the PropertiesDictionary for this thread. + + create the dictionary if it does not exist, otherwise return null if does not exist + the properties for this thread + + + The collection returned is only to be used on the calling thread. If the + caller needs to share the collection between different threads then the + caller must clone the collection before doing so. + + + + + + Gets or sets the value of a property + + + The value for the property with the specified key + + + + Gets or sets the value of a property + + + + + + Implementation of Stack for the + + + + Implementation of Stack for the + + + Nicko Cadell + + + + The stack store. + + + + + Internal constructor + + + + Initializes a new instance of the class. + + + + + + Clears all the contextual information held in this stack. + + + + Clears all the contextual information held in this stack. + Only call this if you think that this tread is being reused after + a previous call execution which may not have completed correctly. + You do not need to use this method if you always guarantee to call + the method of the + returned from even in exceptional circumstances, + for example by using the using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message")) + syntax. + + + + + + Removes the top context from this stack. + + The message in the context that was removed from the top of this stack. + + + Remove the top context from this stack, and return + it to the caller. If this stack is empty then an + empty string (not ) is returned. + + + + + + Pushes a new context message into this stack. + + The new context message. + + An that can be used to clean up the context stack. + + + + Pushes a new context onto this stack. An + is returned that can be used to clean up this stack. This + can be easily combined with the using keyword to scope the + context. + + + Simple example of using the Push method with the using keyword. + + using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message")) + { + log.Warn("This should have an ThreadContext Stack message"); + } + + + + + + Gets the current context information for this stack. + + The current context information. + + + + Gets the current context information for this stack. + + Gets the current context information + + + Gets the current context information for this stack. + + + + + + Get a portable version of this object + + the portable instance of this object + + + Get a cross thread portable version of this object + + + + + + The number of messages in the stack + + + The current number of messages in the stack + + + + The current number of messages in the stack. That is + the number of times has been called + minus the number of times has been called. + + + + + + Gets and sets the internal stack used by this + + The internal storage stack + + + This property is provided only to support backward compatability + of the . Tytpically the internal stack should not + be modified. + + + + + + Inner class used to represent a single context frame in the stack. + + + + Inner class used to represent a single context frame in the stack. + + + + + + Constructor + + The message for this context. + The parent context in the chain. + + + Initializes a new instance of the class + with the specified message and parent context. + + + + + + Get the message. + + The message. + + + Get the message. + + + + + + Gets the full text of the context down to the root level. + + + The full text of the context down to the root level. + + + + Gets the full text of the context down to the root level. + + + + + + Struct returned from the method. + + + + This struct implements the and is designed to be used + with the pattern to remove the stack frame at the end of the scope. + + + + + + The ThreadContextStack internal stack + + + + + The depth to trim the stack to when this instance is disposed + + + + + Constructor + + The internal stack used by the ThreadContextStack. + The depth to return the stack to when this object is disposed. + + + Initializes a new instance of the class with + the specified stack and return depth. + + + + + + Returns the stack to the correct depth. + + + + Returns the stack to the correct depth. + + + + + + Implementation of Stacks collection for the + + + + Implementation of Stacks collection for the + + + Nicko Cadell + + + + Internal constructor + + + + Initializes a new instance of the class. + + + + + + The fully qualified type of the ThreadContextStacks class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets the named thread context stack + + + The named stack + + + + Gets the named thread context stack + + + + + + Utility class for transforming strings. + + + + Utility class for transforming strings. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to prevent instantiation of this class. + + + + + + Write a string to an + + the writer to write to + the string to write + The string to replace non XML compliant chars with + + + The test is escaped either using XML escape entities + or using CDATA sections. + + + + + + Replace invalid XML characters in text string + + the XML text input string + the string to use in place of invalid characters + A string that does not contain invalid XML characters. + + + Certain Unicode code points are not allowed in the XML InfoSet, for + details see: http://www.w3.org/TR/REC-xml/#charsets. + + + This method replaces any illegal characters in the input string + with the mask string specified. + + + + + + Count the number of times that the substring occurs in the text + + the text to search + the substring to find + the number of times the substring occurs in the text + + + The substring is assumed to be non repeating within itself. + + + + + + Characters illegal in XML 1.0 + + + + + Impersonate a Windows Account + + + + This impersonates a Windows account. + + + How the impersonation is done depends on the value of . + This allows the context to either impersonate a set of user credentials specified + using username, domain name and password or to revert to the process credentials. + + + + + + Default constructor + + + + Default constructor + + + + + + Initialize the SecurityContext based on the options set. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + The security context will try to Logon the specified user account and + capture a primary token for impersonation. + + + The required , + or properties were not specified. + + + + Impersonate the Windows account specified by the and properties. + + caller provided state + + An instance that will revoke the impersonation of this SecurityContext + + + + Depending on the property either + impersonate a user using credentials supplied or revert + to the process credentials. + + + + + + Create a given the userName, domainName and password. + + the user name + the domain name + the password + the for the account specified + + + Uses the Windows API call LogonUser to get a principal token for the account. This + token is used to initialize the WindowsIdentity. + + + + + + Gets or sets the impersonation mode for this security context + + + The impersonation mode for this security context + + + + Impersonate either a user with user credentials or + revert this thread to the credentials of the process. + The value is one of the + enum. + + + The default value is + + + When the mode is set to + the user's credentials are established using the + , and + values. + + + When the mode is set to + no other properties need to be set. If the calling thread is + impersonating then it will be reverted back to the process credentials. + + + + + + Gets or sets the Windows username for this security context + + + The Windows username for this security context + + + + This property must be set if + is set to (the default setting). + + + + + + Gets or sets the Windows domain name for this security context + + + The Windows domain name for this security context + + + + The default value for is the local machine name + taken from the property. + + + This property must be set if + is set to (the default setting). + + + + + + Sets the password for the Windows account specified by the and properties. + + + The password for the Windows account specified by the and properties. + + + + This property must be set if + is set to (the default setting). + + + + + + The impersonation modes for the + + + + See the property for + details. + + + + + + Impersonate a user using the credentials supplied + + + + + Revert this the thread to the credentials of the process + + + + + Adds to + + + + Helper class to expose the + through the interface. + + + + + + Constructor + + the impersonation context being wrapped + + + Constructor + + + + + + Revert the impersonation + + + + Revert the impersonation + + + + + + The log4net Global Context. + + + + The GlobalContext provides a location for global debugging + information to be stored. + + + The global context has a properties map and these properties can + be included in the output of log messages. The + supports selecting and outputing these properties. + + + By default the log4net:HostName property is set to the name of + the current machine. + + + + + GlobalContext.Properties["hostname"] = Environment.MachineName; + + + + Nicko Cadell + + + + Private Constructor. + + + Uses a private access modifier to prevent instantiation of this class. + + + + + The global context properties instance + + + + + The global properties map. + + + The global properties map. + + + + The global properties map. + + + + + + Provides information about the environment the assembly has + been built for. + + + + Version of the assembly + + + Version of the framework targeted + + + Type of framework targeted + + + Does it target a client profile? + + + + Identifies the version and target for this assembly. + + + + + The log4net Logical Thread Context. + + + + The LogicalThreadContext provides a location for specific debugging + information to be stored. + The LogicalThreadContext properties override any or + properties with the same name. + + + The Logical Thread Context has a properties map and a stack. + The properties and stack can + be included in the output of log messages. The + supports selecting and outputting these properties. + + + The Logical Thread Context provides a diagnostic context for the current call context. + This is an instrument for distinguishing interleaved log + output from different sources. Log output is typically interleaved + when a server handles multiple clients near-simultaneously. + + + The Logical Thread Context is managed on a per basis. + + + The requires a link time + for the + . + If the calling code does not have this permission then this context will be disabled. + It will not store any property values set on it. + + + Example of using the thread context properties to store a username. + + LogicalThreadContext.Properties["user"] = userName; + log.Info("This log message has a LogicalThreadContext Property called 'user'"); + + + Example of how to push a message into the context stack + + using(LogicalThreadContext.Stacks["LDC"].Push("my context message")) + { + log.Info("This log message has a LogicalThreadContext Stack message that includes 'my context message'"); + + } // at the end of the using block the message is automatically popped + + + + Nicko Cadell + + + + Private Constructor. + + + + Uses a private access modifier to prevent instantiation of this class. + + + + + + The thread context properties instance + + + + + The thread context stacks instance + + + + + The thread properties map + + + The thread properties map + + + + The LogicalThreadContext properties override any + or properties with the same name. + + + + + + The thread stacks + + + stack map + + + + The logical thread stacks. + + + + + + This class is used by client applications to request logger instances. + + + + This class has static methods that are used by a client to request + a logger instance. The method is + used to retrieve a logger. + + + See the interface for more details. + + + Simple example of logging messages + + ILog log = LogManager.GetLogger("application-log"); + + log.Info("Application Start"); + log.Debug("This is a debug message"); + + if (log.IsDebugEnabled) + { + log.Debug("This is another debug message"); + } + + + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + Uses a private access modifier to prevent instantiation of this class. + + + + Returns the named logger if it exists. + + Returns the named logger if it exists. + + + + If the named logger exists (in the default repository) then it + returns a reference to the logger, otherwise it returns null. + + + The fully qualified logger name to look for. + The logger found, or null if no logger could be found. + + + + Returns the named logger if it exists. + + + + If the named logger exists (in the specified repository) then it + returns a reference to the logger, otherwise it returns + null. + + + The repository to lookup in. + The fully qualified logger name to look for. + + The logger found, or null if the logger doesn't exist in the specified + repository. + + + + + Returns the named logger if it exists. + + + + If the named logger exists (in the repository for the specified assembly) then it + returns a reference to the logger, otherwise it returns + null. + + + The assembly to use to lookup the repository. + The fully qualified logger name to look for. + + The logger, or null if the logger doesn't exist in the specified + assembly's repository. + + + + Get the currently defined loggers. + + Returns all the currently defined loggers in the default repository. + + + The root logger is not included in the returned array. + + All the defined loggers. + + + + Returns all the currently defined loggers in the specified repository. + + The repository to lookup in. + + The root logger is not included in the returned array. + + All the defined loggers. + + + + Returns all the currently defined loggers in the specified assembly's repository. + + The assembly to use to lookup the repository. + + The root logger is not included in the returned array. + + All the defined loggers. + + + Get or create a logger. + + Retrieves or creates a named logger. + + + + Retrieves a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + The name of the logger to retrieve. + The logger with the name specified. + + + + Retrieves or creates a named logger. + + + + Retrieve a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + The repository to lookup in. + The name of the logger to retrieve. + The logger with the name specified. + + + + Retrieves or creates a named logger. + + + + Retrieve a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + The assembly to use to lookup the repository. + The name of the logger to retrieve. + The logger with the name specified. + + + + Shorthand for . + + + Get the logger for the fully qualified name of the type specified. + + The full name of will be used as the name of the logger to retrieve. + The logger with the name specified. + + + + Shorthand for . + + + Gets the logger for the fully qualified name of the type specified. + + The repository to lookup in. + The full name of will be used as the name of the logger to retrieve. + The logger with the name specified. + + + + Shorthand for . + + + Gets the logger for the fully qualified name of the type specified. + + The assembly to use to lookup the repository. + The full name of will be used as the name of the logger to retrieve. + The logger with the name specified. + + + + Shuts down the log4net system. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in all the + default repositories. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + Shutdown a logger repository. + + Shuts down the default repository. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + default repository. + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Shuts down the repository for the repository specified. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + specified. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + The repository to shutdown. + + + + Shuts down the repository specified. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + repository. The repository is looked up using + the specified. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + The assembly to use to lookup the repository. + + + Reset the configuration of a repository + + Resets all values contained in this repository instance to their defaults. + + + + Resets all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set to its default "off" value. + + + + + + Resets all values contained in this repository instance to their defaults. + + + + Reset all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set to its default "off" value. + + + The repository to reset. + + + + Resets all values contained in this repository instance to their defaults. + + + + Reset all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set to its default "off" value. + + + The assembly to use to lookup the repository to reset. + + + Get the logger repository. + + Returns the default instance. + + + + Gets the for the repository specified + by the callers assembly (). + + + The instance for the default repository. + + + + Returns the default instance. + + The default instance. + + + Gets the for the repository specified + by the argument. + + + The repository to lookup in. + + + + Returns the default instance. + + The default instance. + + + Gets the for the repository specified + by the argument. + + + The assembly to use to lookup the repository. + + + Get a logger repository. + + Returns the default instance. + + + + Gets the for the repository specified + by the callers assembly (). + + + The instance for the default repository. + + + + Returns the default instance. + + The default instance. + + + Gets the for the repository specified + by the argument. + + + The repository to lookup in. + + + + Returns the default instance. + + The default instance. + + + Gets the for the repository specified + by the argument. + + + The assembly to use to lookup the repository. + + + Create a domain + + Creates a repository with the specified repository type. + + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The created will be associated with the repository + specified such that a call to will return + the same repository instance. + + + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + Create a logger repository. + + Creates a repository with the specified repository type. + + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + The created will be associated with the repository + specified such that a call to will return + the same repository instance. + + + + + + Creates a repository with the specified name. + + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + Creates the default type of which is a + object. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The name of the repository, this must be unique amongst repositories. + The created for the repository. + The specified repository already exists. + + + + Creates a repository with the specified name. + + + + Creates the default type of which is a + object. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The name of the repository, this must be unique amongst repositories. + The created for the repository. + The specified repository already exists. + + + + Creates a repository with the specified name and repository type. + + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The name of the repository, this must be unique to the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + The specified repository already exists. + + + + Creates a repository with the specified name and repository type. + + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The name of the repository, this must be unique to the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + The specified repository already exists. + + + + Creates a repository for the specified assembly and repository type. + + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + The assembly to use to get the name of the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + + Creates a repository for the specified assembly and repository type. + + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + The assembly to use to get the name of the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + + Gets the list of currently defined repositories. + + + + Get an array of all the objects that have been created. + + + An array of all the known objects. + + + + Looks up the wrapper object for the logger specified. + + The logger to get the wrapper for. + The wrapper for the logger specified. + + + + Looks up the wrapper objects for the loggers specified. + + The loggers to get the wrappers for. + The wrapper objects for the loggers specified. + + + + Create the objects used by + this manager. + + The logger to wrap. + The wrapper for the logger specified. + + + + The wrapper map to use to hold the objects. + + + + + Implementation of Mapped Diagnostic Contexts. + + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + The MDC class is similar to the class except that it is + based on a map instead of a stack. It provides mapped + diagnostic contexts. A Mapped Diagnostic Context, or + MDC in short, is an instrument for distinguishing interleaved log + output from different sources. Log output is typically interleaved + when a server handles multiple clients near-simultaneously. + + + The MDC is managed on a per thread basis. + + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + Uses a private access modifier to prevent instantiation of this class. + + + + + Gets the context value identified by the parameter. + + The key to lookup in the MDC. + The string value held for the key, or a null reference if no corresponding value is found. + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + If the parameter does not look up to a + previously defined context then null will be returned. + + + + + + Add an entry to the MDC + + The key to store the value under. + The value to store. + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + Puts a context value (the parameter) as identified + with the parameter into the current thread's + context map. + + + If a value is already defined for the + specified then the value will be replaced. If the + is specified as null then the key value mapping will be removed. + + + + + + Removes the key value mapping for the key specified. + + The key to remove. + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + Remove the specified entry from this thread's MDC + + + + + + Clear all entries in the MDC + + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + Remove all the entries from this thread's MDC + + + + + + Implementation of Nested Diagnostic Contexts. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + A Nested Diagnostic Context, or NDC in short, is an instrument + to distinguish interleaved log output from different sources. Log + output is typically interleaved when a server handles multiple + clients near-simultaneously. + + + Interleaved log output can still be meaningful if each log entry + from different contexts had a distinctive stamp. This is where NDCs + come into play. + + + Note that NDCs are managed on a per thread basis. The NDC class + is made up of static methods that operate on the context of the + calling thread. + + + How to push a message into the context + + using(NDC.Push("my context message")) + { + ... all log calls will have 'my context message' included ... + + } // at the end of the using block the message is automatically removed + + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + Uses a private access modifier to prevent instantiation of this class. + + + + + Clears all the contextual information held on the current thread. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + Clears the stack of NDC data held on the current thread. + + + + + + Creates a clone of the stack of context information. + + A clone of the context info for this thread. + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + The results of this method can be passed to the + method to allow child threads to inherit the context of their + parent thread. + + + + + + Inherits the contextual information from another thread. + + The context stack to inherit. + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + This thread will use the context information from the stack + supplied. This can be used to initialize child threads with + the same contextual information as their parent threads. These + contexts will NOT be shared. Any further contexts that + are pushed onto the stack will not be visible to the other. + Call to obtain a stack to pass to + this method. + + + + + + Removes the top context from the stack. + + + The message in the context that was removed from the top + of the stack. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + Remove the top context from the stack, and return + it to the caller. If the stack is empty then an + empty string (not null) is returned. + + + + + + Pushes a new context message. + + The new context message. + + An that can be used to clean up + the context stack. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + Pushes a new context onto the context stack. An + is returned that can be used to clean up the context stack. This + can be easily combined with the using keyword to scope the + context. + + + Simple example of using the Push method with the using keyword. + + using(log4net.NDC.Push("NDC_Message")) + { + log.Warn("This should have an NDC message"); + } + + + + + + Removes the context information for this thread. It is + not required to call this method. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + This method is not implemented. + + + + + + Forces the stack depth to be at most . + + The maximum depth of the stack + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + Forces the stack depth to be at most . + This may truncate the head of the stack. This only affects the + stack in the current thread. Also it does not prevent it from + growing, it only sets the maximum depth at the time of the + call. This can be used to return to a known context depth. + + + + + + Gets the current context depth. + + The current context depth. + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + The number of context values pushed onto the context stack. + + + Used to record the current depth of the context. This can then + be restored using the method. + + + + + + + The log4net Thread Context. + + + + The ThreadContext provides a location for thread specific debugging + information to be stored. + The ThreadContext properties override any + properties with the same name. + + + The thread context has a properties map and a stack. + The properties and stack can + be included in the output of log messages. The + supports selecting and outputting these properties. + + + The Thread Context provides a diagnostic context for the current thread. + This is an instrument for distinguishing interleaved log + output from different sources. Log output is typically interleaved + when a server handles multiple clients near-simultaneously. + + + The Thread Context is managed on a per thread basis. + + + Example of using the thread context properties to store a username. + + ThreadContext.Properties["user"] = userName; + log.Info("This log message has a ThreadContext Property called 'user'"); + + + Example of how to push a message into the context stack + + using(ThreadContext.Stacks["NDC"].Push("my context message")) + { + log.Info("This log message has a ThreadContext Stack message that includes 'my context message'"); + + } // at the end of the using block the message is automatically popped + + + + Nicko Cadell + + + + Private Constructor. + + + + Uses a private access modifier to prevent instantiation of this class. + + + + + + The thread context properties instance + + + + + The thread context stacks instance + + + + + The thread properties map + + + The thread properties map + + + + The ThreadContext properties override any + properties with the same name. + + + + + + The thread stacks + + + stack map + + + + The thread local stacks. + + + + + diff --git a/lib/lucene.net/Lucene.Net.xml b/lib/lucene.net/Lucene.Net.xml index 31592cba0cf..a0f1d25f09c 100644 --- a/lib/lucene.net/Lucene.Net.xml +++ b/lib/lucene.net/Lucene.Net.xml @@ -1,27533 +1,27533 @@ - - - - Lucene.Net - - - - An "open" BitSet implementation that allows direct access to the array of words - storing the bits. -

      - Unlike java.util.bitset, the fact that bits are packed into an array of longs - is part of the interface. This allows efficient implementation of other algorithms - by someone other than the author. It also allows one to efficiently implement - alternate serialization or interchange formats. -

      - OpenBitSet is faster than java.util.BitSet in most operations - and *much* faster at calculating cardinality of sets and results of set operations. - It can also handle sets of larger cardinality (up to 64 * 2**32-1) -

      - The goals of OpenBitSet are the fastest implementation possible, and - maximum code reuse. Extra safety and encapsulation - may always be built on top, but if that's built in, the cost can never be removed (and - hence people re-implement their own version in order to get better performance). - If you want a "safe", totally encapsulated (and slower and limited) BitSet - class, use java.util.BitSet. -

      -

      Performance Results

      - - Test system: Pentium 4, Sun Java 1.5_06 -server -Xbatch -Xmx64M -
      BitSet size = 1,000,000 -
      Results are java.util.BitSet time divided by OpenBitSet time. - - - - - - - - - - -
      cardinality intersect_count union nextSetBit get iterator
      50% full 3.36 3.96 1.44 1.46 1.99 1.58
      1% full 3.31 3.90   1.04   0.99
      -
      - Test system: AMD Opteron, 64 bit linux, Sun Java 1.5_06 -server -Xbatch -Xmx64M -
      BitSet size = 1,000,000 -
      Results are java.util.BitSet time divided by OpenBitSet time. - - - - - - - - - - -
      cardinality intersect_count union nextSetBit get iterator
      50% full 2.50 3.50 1.00 1.03 1.12 1.25
      1% full 2.51 3.49   1.00   1.02
      -
      - $Id$ - -
      - - A DocIdSet contains a set of doc ids. Implementing classes must - only implement to provide access to the set. - - - - An empty instance for easy use, e.g. in Filters that hit no documents. - - - Provides a to access the set. - This implementation can return null or - EMPTY_DOCIDSET.Iterator() if there - are no docs that match. - - - - This method is a hint for , if this DocIdSet - should be cached without copying it into a BitSet. The default is to return - false. If you have an own DocIdSet implementation - that does its iteration very effective and fast without doing disk I/O, - override this method and return true. - - - - This abstract class defines methods to iterate over a set of non-decreasing - doc ids. Note that this class assumes it iterates on doc Ids, and therefore - is set to Int32.MaxValue in order to be used as - a sentinel object. Implementations of this class are expected to consider - as an invalid value. - - - - When returned by , and - it means there are no more docs in the iterator. - - - - Unsupported anymore. Call instead. This method throws - if called. - - - use instead. - - - - Returns the following: - - -1 or if or - were not called yet. - if the iterator has exhausted. - Otherwise it should return the doc ID it is currently on. - -

      - NOTE: in 3.0, this method will become abstract. - -

      - 2.9 - -
      - - Unsupported anymore. Call instead. This method throws - if called. - - - use instead. This will be removed in 3.0 - - - - Unsupported anymore. Call instead. This method throws - if called. - - - use instead. This will be removed in 3.0 - - - - Advances to the next document in the set and returns the doc it is - currently on, or if there are no more docs in the - set.
      - - NOTE: in 3.0 this method will become abstract, following the removal - of . For backward compatibility it is implemented as: - - - public int nextDoc() throws IOException { - return next() ? doc() : NO_MORE_DOCS; - } - - - NOTE: after the iterator has exhausted you should not call this - method, as it may result in unpredicted behavior. - -
      - 2.9 - -
      - - Advances to the first beyond the current whose document number is greater - than or equal to target. Returns the current document number or - if there are no more docs in the set. -

      - Behaves as if written: - - - int advance(int target) { - int doc; - while ((doc = nextDoc()) < target) { - } - return doc; - } - - - Some implementations are considerably more efficient than that. -

      - NOTE: certain implemenations may return a different value (each - time) if called several times in a row with the same target. -

      - NOTE: this method may be called with for - efficiency by some Scorers. If your implementation cannot efficiently - determine that it should exhaust, it is recommended that you check for that - value in each call to this method. -

      - NOTE: after the iterator has exhausted you should not call this - method, as it may result in unpredicted behavior. -

      - NOTE: in 3.0 this method will become abstract, following the removal - of . - -

      - 2.9 - -
      - - Constructs an OpenBitSet large enough to hold numBits. - - - - - - - Constructs an OpenBitSet from an existing long[]. -
      - The first 64 bits are in long[0], - with bit index 0 at the least significant bit, and bit index 63 at the most significant. - Given a bit index, - the word containing it is long[index/64], and it is at bit number index%64 within that word. -

      - numWords are the number of elements in the array that contain - set bits (non-zero longs). - numWords should be <= bits.length, and - any existing words in the array at position >= numWords should be zero. - -

      -
      - - This DocIdSet implementation is cacheable. - - - Returns the current capacity in bits (1 greater than the index of the last bit) - - - Returns the current capacity of this set. Included for - compatibility. This is *not* equal to - - - - Returns true if there are no set bits - - - Expert: returns the long[] storing the bits - - - Expert: sets a new long[] to use as the bit storage - - - Expert: gets the number of longs in the array that are in use - - - Expert: sets the number of longs in the array that are in use - - - Returns true or false for the specified bit index. - - - Returns true or false for the specified bit index. - The index should be less than the OpenBitSet size - - - - Returns true or false for the specified bit index - - - Returns true or false for the specified bit index. - The index should be less than the OpenBitSet size. - - - - returns 1 if the bit is set, 0 if not. - The index should be less than the OpenBitSet size - - - - sets a bit, expanding the set size if necessary - - - Sets the bit at the specified index. - The index should be less than the OpenBitSet size. - - - - Sets the bit at the specified index. - The index should be less than the OpenBitSet size. - - - - Sets a range of bits, expanding the set size if necessary - - - lower index - - one-past the last bit to set - - - - clears a bit. - The index should be less than the OpenBitSet size. - - - - clears a bit. - The index should be less than the OpenBitSet size. - - - - clears a bit, allowing access beyond the current set size without changing the size. - - - Clears a range of bits. Clearing past the end does not change the size of the set. - - - lower index - - one-past the last bit to clear - - - - Clears a range of bits. Clearing past the end does not change the size of the set. - - - lower index - - one-past the last bit to clear - - - - Sets a bit and returns the previous value. - The index should be less than the OpenBitSet size. - - - - Sets a bit and returns the previous value. - The index should be less than the OpenBitSet size. - - - - flips a bit. - The index should be less than the OpenBitSet size. - - - - flips a bit. - The index should be less than the OpenBitSet size. - - - - flips a bit, expanding the set size if necessary - - - flips a bit and returns the resulting bit value. - The index should be less than the OpenBitSet size. - - - - flips a bit and returns the resulting bit value. - The index should be less than the OpenBitSet size. - - - - Flips a range of bits, expanding the set size if necessary - - - lower index - - one-past the last bit to flip - - - - the number of set bits - - - - Returns the popcount or cardinality of the intersection of the two sets. - Neither set is modified. - - - - Returns the popcount or cardinality of the union of the two sets. - Neither set is modified. - - - - Returns the popcount or cardinality of "a and not b" - or "intersection(a, not(b))". - Neither set is modified. - - - - Returns the popcount or cardinality of the exclusive-or of the two sets. - Neither set is modified. - - - - Returns the index of the first set bit starting at the index specified. - -1 is returned if there are no more set bits. - - - - Returns the index of the first set bit starting at the index specified. - -1 is returned if there are no more set bits. - - - - this = this AND other - - - this = this OR other - - - Remove all elements set in other. this = this AND_NOT other - - - this = this XOR other - - - returns true if the sets have any elements in common - - - Expand the long[] with the size given as a number of words (64 bit longs). - getNumWords() is unchanged by this call. - - - - Ensure that the long[] is big enough to hold numBits, expanding it if necessary. - getNumWords() is unchanged by this call. - - - - Lowers numWords, the number of words in use, - by checking for trailing zero words. - - - - returns the number of 64 bit words it would take to hold numBits - - - returns true if both sets have the same bits set - - - Returns primitive memory sizes for estimating RAM usage. - - - - - size of array beyond contents - - - - Class size overhead - - - - a primitive Class - bool, byte, char, short, long, float, - short, double, int - - the size in bytes of given primitive Class - - - - size of reference - - - - Simple DocIdSet and DocIdSetIterator backed by a BitSet - - - This DocIdSet implementation is cacheable. - - - Returns the underlying BitSet. - - - use instead. - - - - use instead. - - - - use instead. - - - - Optimized implementation of a vector of bits. This is more-or-less like - java.util.BitSet, but also includes the following: - - a count() method, which efficiently computes the number of one bits; - optimized read from and write to disk; - inlinable get() method; - store and load, as bit set or d-gaps, depending on sparseness; - - - $Id: BitVector.java 765649 2009-04-16 14:29:26Z mikemccand $ - - - - Constructs a vector capable of holding n bits. - - - Sets the value of bit to one. - - - Sets the value of bit to true, and - returns true if bit was already set - - - - Sets the value of bit to zero. - - - Returns true if bit is one and - false if it is zero. - - - - Returns the number of bits in this vector. This is also one greater than - the number of the largest valid bit number. - - - - Returns the total number of one bits in this vector. This is efficiently - computed and cached, so that, if the vector is not changed, no - recomputation is done for repeated calls. - - - - - For testing - - - - Writes this vector to the file name in Directory - d, in a format that can be read by the constructor - . - - - - Write as a bit set - - - Write as a d-gaps list - - - Indicates if the bit vector is sparse and should be saved as a d-gaps list, or dense, and should be saved as a bit set. - - - Constructs a bit vector from the file name in Directory - d, as written by the method. - - - - Read as a bit set - - - read as a d-gaps list - - - Retrieve a subset of this BitVector. - - - starting index, inclusive - - ending index, exclusive - - subset - - - - - Not implemented. Waiting for volunteers. - - - - - Base class for Directory implementations that store index - files in the file system. There are currently three core - subclasses: - - - - is a straightforward - implementation using java.io.RandomAccessFile. - However, it has poor concurrent performance - (multiple threads will bottleneck) as it - synchronizes when multiple threads read from the - same file. - - uses java.nio's - FileChannel's positional io when reading to avoid - synchronization when reading from the same file. - Unfortunately, due to a Windows-only Sun - JRE bug this is a poor choice for Windows, but - on all other platforms this is the preferred - choice. Applications using or - Future#cancel(boolean) (on Java 1.5) should use - instead. See java doc - for details. - - - - uses memory-mapped IO when - reading. This is a good choice if you have plenty - of virtual memory relative to your index size, eg - if you are running on a 64 bit JRE, or you are - running on a 32 bit JRE but your index sizes are - small enough to fit into the virtual memory space. - Java has currently the limitation of not being able to - unmap files from user code. The files are unmapped, when GC - releases the byte buffers. Due to - - this bug in Sun's JRE, MMapDirectory's - is unable to close the underlying OS file handle. Only when - GC finally collects the underlying objects, which could be - quite some time later, will the file handle be closed. - This will consume additional transient disk usage: on Windows, - attempts to delete or overwrite the files will result in an - exception; on other platforms, which typically have a "delete on - last close" semantics, while such operations will succeed, the bytes - are still consuming space on disk. For many applications this - limitation is not a problem (e.g. if you have plenty of disk space, - and you don't rely on overwriting files on Windows) but it's still - an important limitation to be aware of. This class supplies a - (possibly dangerous) workaround mentioned in the bug report, - which may fail on non-Sun JVMs. - - Applications using or - Future#cancel(boolean) (on Java 1.5) should use - instead. See - java doc for details. - - - Unfortunately, because of system peculiarities, there is - no single overall best implementation. Therefore, we've - added the method, to allow Lucene to choose - the best FSDirectory implementation given your - environment, and the known limitations of each - implementation. For users who have no reason to prefer a - specific implementation, it's best to simply use - . For all others, you should instantiate the - desired implementation directly. - -

      The locking implementation is by default - , but can be changed by - passing in a custom instance. - The deprecated getDirectory methods default to use - for backwards compatibility. - The system properties - org.apache.lucene.store.FSDirectoryLockFactoryClass - and org.apache.lucene.FSDirectory.class - are deprecated and only used by the deprecated - getDirectory methods. The system property - org.apache.lucene.lockDir is ignored completely, - If you really want to store locks - elsewhere, you can create your own - (or , - etc.) passing in your preferred lock directory. - -

      In 3.0 this class will become abstract. - -

      - - -
      - - A Directory is a flat list of files. Files may be written once, when they - are created. Once a file is created it may only be opened for read, or - deleted. Random access is permitted both when reading and writing. - -

      Java's i/o APIs not used directly, but rather all i/o is - through this API. This permits things such as: - implementation of RAM-based indices; - implementation indices stored in a database, via JDBC; - implementation of an index as a single file; - - - Directory locking is implemented by an instance of - , and can be changed for each Directory - instance using . - -

      -
      - - Holds the LockFactory instance (implements locking for - this Directory instance). - - - - For some Directory implementations ( - , and its subclasses), this method - silently filters its results to include only index - files. Please use instead, which - does no filtering. - - - - Returns an array of strings, one for each file in the - directory. Unlike this method does no - filtering of the contents in a directory, and it will - never return null (throws IOException instead). - - Currently this method simply fallsback to - for Directory impls outside of Lucene's core & - contrib, but in 3.0 that method will be removed and - this method will become abstract. - - - - Returns true iff a file with the given name exists. - - - Returns the time the named file was last modified. - - - Set the modified time of an existing file to now. - - - Removes an existing file in the directory. - - - Renames an existing file in the directory. - If a file already exists with the new name, then it is replaced. - This replacement is not guaranteed to be atomic. - - - - - - Returns the length of a file in the directory. - - - Creates a new, empty file in the directory with the given name. - Returns a stream writing this file. - - - - Ensure that any writes to this file are moved to - stable storage. Lucene uses this to properly commit - changes to the index, to prevent a machine/OS crash - from corrupting the index. - - - - Returns a stream reading an existing file. - - - Returns a stream reading an existing file, with the - specified read buffer size. The particular Directory - implementation may ignore the buffer size. Currently - the only Directory implementations that respect this - parameter are and - . - - - - Construct a . - the name of the lock file - - - - Attempt to clear (forcefully unlock and remove) the - specified lock. Only call this at a time when you are - certain this lock is no longer in use. - - name of the lock to be cleared. - - - - Closes the store. - - - Set the LockFactory that this Directory instance should - use for its locking implementation. Each * instance of - LockFactory should only be used for one directory (ie, - do not share a single instance across multiple - Directories). - - - instance of . - - - - Get the LockFactory that this Directory instance is - using for its locking implementation. Note that this - may be null for Directory implementations that provide - their own locking implementation. - - - - Return a string identifier that uniquely differentiates - this Directory instance from other Directory instances. - This ID should be the same if two Directory instances - (even in different JVMs and/or on different machines) - are considered "the same index". This is how locking - "scopes" to the right index. - - - - Copy contents of a directory src to a directory dest. - If a file in src already exists in dest then the - one in dest will be blindly overwritten. - -

      NOTE: the source directory cannot change - while this method is running. Otherwise the results - are undefined and you could easily hit a - FileNotFoundException. - -

      NOTE: this method only copies files that look - like index files (ie, have extensions matching the - known extensions of index files). - -

      - source directory - - destination directory - - if true, call method on source directory - - IOException -
      - - AlreadyClosedException if this Directory is closed - - - This cache of directories ensures that there is a unique Directory - instance per path, so that synchronization on the Directory can be used to - synchronize access between readers and writers. We use - refcounts to ensure when the last use of an FSDirectory - instance for a given canonical path is closed, we remove the - instance from the cache. See LUCENE-776 - for some relevant discussion. - - Not used by any non-deprecated methods anymore - - - - Set whether Lucene's use of lock files is disabled. By default, - lock files are enabled. They should only be disabled if the index - is on a read-only medium like a CD-ROM. - - Use a or a constructor - that takes a and supply - . This setting does not work - with only the deprecated getDirectory - respect this setting. - - - - Returns whether Lucene's use of lock files is disabled. - true if locks are disabled, false if locks are enabled. - - - - Use a constructor that takes a and - supply . - - - - The default class which implements filesystem-based directories. - - - A buffer optionally used in renameTo method - - - Returns the directory instance for the named location. - - - Use - - - the path to the directory. - - the FSDirectory for the named file. - - - - Returns the directory instance for the named location. - - - Use - - - the path to the directory. - - instance of providing the - locking implementation. - - the FSDirectory for the named file. - - - - Returns the directory instance for the named location. - - - Use - - - the path to the directory. - - the FSDirectory for the named file. - - - - Returns the directory instance for the named location. - - - Use - - - the path to the directory. - - the FSDirectory for the named file. - - - - Returns the directory instance for the named location. - - - Use - - - the path to the directory. - - instance of providing the - locking implementation. - - the FSDirectory for the named file. - - - - Returns the directory instance for the named location. - - - Use - - - the path to the directory. - - instance of providing the - locking implementation. - - the FSDirectory for the named file. - - - - Returns the directory instance for the named location. - - - Use IndexWriter's create flag, instead, to - create a new index. - - - the path to the directory. - - if true, create, or erase any existing contents. - - the FSDirectory for the named file. - - - - Returns the directory instance for the named location. - - - Use IndexWriter's create flag, instead, to - create a new index. - - - the path to the directory. - - if true, create, or erase any existing contents. - - the FSDirectory for the named file. - - - - Returns the directory instance for the named location. - - - Use IndexWriter's create flag, instead, to - create a new index. - - - the path to the directory. - - if true, create, or erase any existing contents. - - the FSDirectory for the named file. - - - - - - - - Initializes the directory to create a new file with the given name. - This method should be used in . - - - - The underlying filesystem directory - - - - - - - - - - - Create a new FSDirectory for the named location (ctor for subclasses). - the path of the directory - - the lock factory to use, or null for the default - (); - - IOException - - - Creates an FSDirectory instance, trying to pick the - best implementation given the current environment. - The directory returned uses the . - -

      Currently this returns as - NIOFSDirectory is currently not supported. - -

      Currently this returns as - NIOFSDirectory is currently not supported. - -

      NOTE: this method may suddenly change which - implementation is returned from release to release, in - the event that higher performance defaults become - possible; if the precise implementation is important to - your application, please instantiate it directly, - instead. On 64 bit systems, it may also good to - return , but this is disabled - because of officially missing unmap support in Java. - For optimal performance you should consider using - this implementation on 64 bit JVMs. - -

      See above -

      -
      - - Creates an FSDirectory instance, trying to pick the - best implementation given the current environment. - The directory returned uses the . - -

      Currently this returns as - NIOFSDirectory is currently not supported. - -

      NOTE: this method may suddenly change which - implementation is returned from release to release, in - the event that higher performance defaults become - possible; if the precise implementation is important to - your application, please instantiate it directly, - instead. On 64 bit systems, it may also good to - return , but this is disabled - because of officially missing unmap support in Java. - For optimal performance you should consider using - this implementation on 64 bit JVMs. - -

      See above -

      -
      - - Just like , but allows you to - also specify a custom . - - - - Lists all files (not subdirectories) in the - directory. This method never returns null (throws - instead). - - - NoSuchDirectoryException if the directory - does not exist, or does exist but is not a - directory. - - IOException if list() returns null - - - Lists all files (not subdirectories) in the - directory. This method never returns null (throws - instead). - - - NoSuchDirectoryException if the directory - does not exist, or does exist but is not a - directory. - - IOException if list() returns null - - - Lists all files (not subdirectories) in the - directory. - - - - - - Returns true iff a file with the given name exists. - - - Returns the time the named file was last modified. - - - Returns the time the named file was last modified. - - - Set the modified time of an existing file to now. - - - Returns the length in bytes of a file in the directory. - - - Removes an existing file in the directory. - - - Renames an existing file in the directory. - Warning: This is not atomic. - - - - - - Creates an IndexOutput for the file with the given name. - In 3.0 this method will become abstract. - - - - Creates an IndexInput for the file with the given name. - In 3.0 this method will become abstract. - - - - So we can do some byte-to-hexchar conversion below - - - Closes the store to future operations. - - - - .NET - - - - For debug output. - - - Default read chunk size. This is a conditional - default: on 32bit JVMs, it defaults to 100 MB. On - 64bit JVMs, it's Integer.MAX_VALUE. - - - - - - Sets the maximum number of bytes read at once from the - underlying file during . - The default value is ; - -

      This was introduced due to Sun - JVM Bug 6478546, which throws an incorrect - OutOfMemoryError when attempting to read too many bytes - at once. It only happens on 32bit JVMs with a large - maximum heap size.

      - -

      Changes to this value will not impact any - already-opened s. You should call - this before attempting to open an index on the - directory.

      - -

      NOTE: This value should be as large as - possible to reduce any possible performance impact. If - you still encounter an incorrect OutOfMemoryError, - trying lowering the chunk size.

      -

      -
      - - The maximum number of bytes to read at once from the - underlying file during . - - - - - - Use SimpleFSDirectory.SimpleFSIndexInput instead - - - - Base implementation class for buffered . - - - Abstract base class for input from a file in a . A - random-access input stream. Used for all Lucene index input operations. - - - - - - Reads and returns a single byte. - - - - - Reads a specified number of bytes into an array at the specified offset. - the array to read bytes into - - the offset in the array to start storing bytes - - the number of bytes to read - - - - - - Reads a specified number of bytes into an array at the - specified offset with control over whether the read - should be buffered (callers who have their own buffer - should pass in "false" for useBuffer). Currently only - respects this parameter. - - the array to read bytes into - - the offset in the array to start storing bytes - - the number of bytes to read - - set to false if the caller will handle - buffering. - - - - - - Reads four bytes and returns an int. - - - - - Reads an int stored in variable-length format. Reads between one and - five bytes. Smaller values take fewer bytes. Negative numbers are not - supported. - - - - - - Reads eight bytes and returns a long. - - - - - Reads a long stored in variable-length format. Reads between one and - nine bytes. Smaller values take fewer bytes. Negative numbers are not - supported. - - - - Call this if readString should read characters stored - in the old modified UTF8 format (length in java chars - and java's modified UTF8 encoding). This is used for - indices written pre-2.4 See LUCENE-510 for details. - - - - Reads a string. - - - - - Reads Lucene's old "modified UTF-8" encoded - characters into an array. - - the array to read characters into - - the offset in the array to start storing characters - - the number of characters to read - - - - -- please use readString or readBytes - instead, and construct the string - from those utf8 bytes - - - - Expert - - Similar to but does not do any conversion operations on the bytes it is reading in. It still - has to invoke just as does, but it does not need a buffer to store anything - and it does not have to do any of the bitwise operations, since we don't actually care what is in the byte except to determine - how many more bytes to read - - The number of chars to read - - this method operates on old "modified utf8" encoded - strings - - - - Closes the stream to futher operations. - - - Returns the current position in this file, where the next read will - occur. - - - - - - Sets current position in this file, where the next read will occur. - - - - - The number of bytes in the file. - - - Returns a clone of this stream. - -

      Clones of a stream access the same data, and are positioned at the same - point as the stream they were cloned from. - -

      Expert: Subclasses must ensure that clones may be positioned at - different points in the input from each other and from the stream they - were cloned from. -

      -
      - - Default buffer size - - - Inits BufferedIndexInput with a specific bufferSize - - - Change the buffer size used by this IndexInput - - - - - - - Expert: implements buffer refill. Reads bytes from the current position - in the input. - - the array to read bytes into - - the offset in the array to start storing bytes - - the number of bytes to read - - - - Expert: implements seek. Sets current position in this file, where the - next will occur. - - - - - - A straightforward implementation of - using java.io.RandomAccessFile. However, this class has - poor concurrent performance (multiple threads will - bottleneck) as it synchronizes when multiple threads - read from the same file. It's usually better to use - or instead. - - - - Create a new SimpleFSDirectory for the named location. - - - the path of the directory - - the lock factory to use, or null for the default. - - IOException - - - Create a new SimpleFSDirectory for the named location. - - - the path of the directory - - the lock factory to use, or null for the default. - - IOException - - - Create a new SimpleFSDirectory for the named location and the default lock factory. - - - the path of the directory - - IOException - - - - - - - Create a new SimpleFSDirectory for the named location and the default lock factory. - - - the path of the directory - - IOException - - - Creates an IndexOutput for the file with the given name. - - - Creates an IndexInput for the file with the given name. - - - Please use ctor taking chunkSize - - - - Please use ctor taking chunkSize - - - - IndexInput methods - - - Method used for testing. Returns true if the underlying - file descriptor is valid. - - - - Base implementation class for buffered . - - - Abstract base class for output to a file in a Directory. A random-access - output stream. Used for all Lucene index output operations. - - - - - - - - Writes a single byte. - - - - - Writes an array of bytes. - the bytes to write - - the number of bytes to write - - - - - - Writes an array of bytes. - the bytes to write - - the offset in the byte array - - the number of bytes to write - - - - - - Writes an int as four bytes. - - - - - Writes an int in a variable-length format. Writes between one and - five bytes. Smaller values take fewer bytes. Negative numbers are not - supported. - - - - - - Writes a long as eight bytes. - - - - - Writes an long in a variable-length format. Writes between one and five - bytes. Smaller values take fewer bytes. Negative numbers are not - supported. - - - - - - Writes a string. - - - - - Writes a sub sequence of characters from s as the old - format (modified UTF-8 encoded bytes). - - the source of the characters - - the first character in the sequence - - the number of characters in the sequence - - -- please pre-convert to utf8 bytes - instead or use - - - - Writes a sub sequence of characters from char[] as - the old format (modified UTF-8 encoded bytes). - - the source of the characters - - the first character in the sequence - - the number of characters in the sequence - - -- please pre-convert to utf8 bytes instead or use - - - - Copy numBytes bytes from input to ourself. - - - Forces any buffered output to be written. - - - Closes this stream to further operations. - - - Returns the current position in this file, where the next write will - occur. - - - - - - Sets current position in this file, where the next write will occur. - - - - - The number of bytes in the file. - - - Set the file length. By default, this method does - nothing (it's optional for a Directory to implement - it). But, certain Directory implementations (for - - can use this to inform the - underlying IO system to pre-allocate the file to the - specified size. If the length is longer than the - current file length, the bytes added to the file are - undefined. Otherwise the file is truncated. - - file length - - - - Writes a single byte. - - - - - Writes an array of bytes. - the bytes to write - - the number of bytes to write - - - - - - Forces any buffered output to be written. - - - Expert: implements buffer write. Writes bytes at the current position in - the output. - - the bytes to write - - the number of bytes to write - - - - Expert: implements buffer write. Writes bytes at the current position in - the output. - - the bytes to write - - the offset in the byte array - - the number of bytes to write - - - - Closes this stream to further operations. - - - Returns the current position in this file, where the next write will - occur. - - - - - - Sets current position in this file, where the next write will occur. - - - - - The number of bytes in the file. - - - output methods: - - - Random-access methods - - - - - - - - - - - - - - - - - - - Use SimpleFSDirectory.SimpleFSIndexOutput instead - - - - - - - - - Not implemented. Waiting for volunteers. - - - - Simple standalone server that must be running when you - use . This server simply - verifies at most one process holds the lock at a time. - Run without any args to see usage. - - - - - - - - - Base class for file system based locking implementation. - - -

      Base class for Locking implementation. uses - instances of this class to implement locking.

      - -

      Note that there are some useful tools to verify that - your LockFactory is working correctly: - , , - .

      - -

      - - - - - - -
      - - Set the prefix in use for all locks created in this - LockFactory. This is normally called once, when a - Directory gets this LockFactory instance. However, you - can also call this (after this instance is assigned to - a Directory) to override the prefix in use. This - is helpful if you're running Lucene on machines that - have different mount points for the same shared - directory. - - - - Get the prefix in use for all locks created in this LockFactory. - - - Return a new Lock instance identified by lockName. - name of the lock to be created. - - - - Attempt to clear (forcefully unlock and remove) the - specified lock. Only call this at a time when you are - certain this lock is no longer in use. - - name of the lock to be cleared. - - - - Directory for the lock files. - - - Set the lock directory. This method can be only called - once to initialize the lock directory. It is used by - to set the lock directory to itsself. - Subclasses can also use this method to set the directory - in the constructor. - - - - Retrieve the lock directory. - - - Expert: Calculate query weights and build query scorers. -

      - The purpose of is to ensure searching does not - modify a , so that a instance can be reused.
      - dependent state of the query should reside in the - .
      - dependent state should reside in the . -

      - A Weight is used in the following way: - - A Weight is constructed by a top-level query, given a - Searcher (). - The method is called on the - Weight to compute the query normalization factor - of the query clauses contained in the - query. - The query normalization factor is passed to . At - this point the weighting is complete. - A Scorer is constructed by . - - -

      - 2.9 - -
      - - An explanation of the score computation for the named document. - - - sub-reader containing the give doc - - - - an Explanation for the score - - IOException - - - The query that this concerns. - - - The weight for this query. - - - Assigns the query normalization factor to this. - - - Returns a which scores documents in/out-of order according - to scoreDocsInOrder. -

      - NOTE: even if scoreDocsInOrder is false, it is - recommended to check whether the returned Scorer indeed scores - documents out of order (i.e., call ), as - some Scorer implementations will always return documents - in-order.
      - NOTE: null can be returned if no documents will be scored by this - query. - -

      - - the for which to return the . - - specifies whether in-order scoring of documents is required. Note - that if set to false (i.e., out-of-order scoring is required), - this method can return whatever scoring mode it supports, as every - in-order scorer is also an out-of-order one. However, an - out-of-order scorer may not support - and/or , therefore it is recommended to - request an in-order scorer if use of these methods is required. - - - if true, will be called; if false, - and/or will - be called. - - a which scores documents in/out-of order. - - IOException -
      - - The sum of squared weights of contained query clauses. - - - Returns true iff this implementation scores docs only out of order. This - method is used in conjunction with 's - AcceptsDocsOutOfOrder and - to - create a matching instance for a given , or - vice versa. -

      - NOTE: the default implementation returns false, i.e. - the Scorer scores documents in-order. -

      -
      - - A PriorityQueue maintains a partial ordering of its elements such that the - least element can always be found in constant time. Put()'s and pop()'s - require log(size) time. - -

      NOTE: This class pre-allocates a full array of - length maxSize+1, in . - -

      -
      - - Determines the ordering of objects in this priority queue. Subclasses - must define this one method. - - - - This method can be overridden by extending classes to return a sentinel - object which will be used by to fill the queue, so - that the code which uses that queue can always assume it's full and only - change the top without attempting to insert any new object.
      - - Those sentinel values should always compare worse than any non-sentinel - value (i.e., should always favor the - non-sentinel values).
      - - By default, this method returns false, which means the queue will not be - filled with sentinel values. Otherwise, the value returned will be used to - pre-populate the queue. Adds sentinel values to the queue.
      - - If this method is extended to return a non-null value, then the following - usage pattern is recommended: - - - // extends getSentinelObject() to return a non-null value. - PriorityQueue pq = new MyQueue(numHits); - // save the 'top' element, which is guaranteed to not be null. - MyObject pqTop = (MyObject) pq.top(); - <...> - // now in order to add a new element, which is 'better' than top (after - // you've verified it is better), it is as simple as: - pqTop.change(). - pqTop = pq.updateTop(); - - - NOTE: if this method returns a non-null value, it will be called by - times, relying on a new object to - be returned and will not check if it's null again. Therefore you should - ensure any call to this method creates a new instance and behaves - consistently, e.g., it cannot return null if it previously returned - non-null. - -
      - the sentinel object to use to pre-populate the queue, or null if - sentinel objects are not supported. - -
      - - Subclass constructors must call this. - - - Adds an Object to a PriorityQueue in log(size) time. If one tries to add - more objects than maxSize from initialize a RuntimeException - (ArrayIndexOutOfBound) is thrown. - - - use which returns the new top object, - saving an additional call to . - - - - Adds an Object to a PriorityQueue in log(size) time. If one tries to add - more objects than maxSize from initialize an - is thrown. - - - the new 'top' element in the queue. - - - - Adds element to the PriorityQueue in log(size) time if either the - PriorityQueue is not full, or not lessThan(element, top()). - - - - - true if element is added, false otherwise. - - use instead, which - encourages objects reuse. - - - - insertWithOverflow() is the same as insert() except its - return value: it returns the object (if any) that was - dropped off the heap because it was full. This can be - the given parameter (in case it is smaller than the - full heap's minimum, and couldn't be added), or another - object that was previously the smallest value in the - heap and now has been replaced by a larger one, or null - if the queue wasn't yet full with maxSize elements. - - - - Returns the least element of the PriorityQueue in constant time. - - - Removes and returns the least element of the PriorityQueue in log(size) - time. - - - - Should be called when the Object at top changes values. Still log(n) worst - case, but it's at least twice as fast to - - - pq.top().change(); - pq.adjustTop(); - - - instead of - - - o = pq.pop(); - o.change(); - pq.push(o); - - - - use which returns the new top element and - saves an additional call to . - - - - Should be called when the Object at top changes values. Still log(n) worst - case, but it's at least twice as fast to - - - pq.top().change(); - pq.updateTop(); - - - instead of - - - o = pq.pop(); - o.change(); - pq.push(o); - - - - the new 'top' element. - - - - Returns the number of elements currently stored in the PriorityQueue. - - - Removes all entries from the PriorityQueue. - - - Wrapper for () implementations, which simply re-bases the - incoming docID before calling . - - - Please migrate custom HitCollectors to the new - class. This class will be removed when is - removed. - - - -

      Expert: Collectors are primarily meant to be used to - gather raw results from a search, and implement sorting - or custom result filtering, collation, etc.

      - -

      As of 2.9, this class replaces the deprecated - HitCollector, and offers an API for efficient collection - of hits across sequential s. - advances the collector through each of the - sub readers, in an arbitrary order. This results in a - higher performance means of collection.

      - -

      Lucene's core collectors are derived from Collector. - Likely your application can use one of these classes, or - subclass , instead of - implementing Collector directly: - - - - is an abstract base class - that assumes you will retrieve the top N docs, - according to some criteria, after collection is - done. - - is a concrete subclass - and sorts according to score + - docID. This is used internally by the - search methods that do not take an - explicit . It is likely the most frequently - used collector. - - subclasses - and sorts according to a specified - object (sort by field). This is used - internally by the search methods - that take an explicit . - - , which wraps any other - Collector and aborts the search if it's taken too much - time, will subclass Collector in 3.0 (presently it - subclasses the deprecated HitCollector). - - wraps any other - Collector and prevents collection of hits whose score - is <= 0.0 - - - -

      Collector decouples the score from the collected doc: - the score computation is skipped entirely if it's not - needed. Collectors that do need the score should - implement the method, to hold onto the - passed instance, and call - within the collect method to compute the - current hit's score. If your collector may request the - score for a single hit multiple times, you should use - .

      - -

      NOTE: The doc that is passed to the collect - method is relative to the current reader. If your - collector needs to resolve this to the docID space of the - Multi*Reader, you must re-base it by recording the - docBase from the most recent setNextReader call. Here's - a simple example showing how to collect docIDs into a - BitSet:

      - - - Searcher searcher = new IndexSearcher(indexReader); - final BitSet bits = new BitSet(indexReader.maxDoc()); - searcher.search(query, new Collector() { - private int docBase; - - // ignore scorer - public void setScorer(Scorer scorer) { - } - - // accept docs out of order (for a BitSet it doesn't matter) - public boolean acceptsDocsOutOfOrder() { - return true; - } - - public void collect(int doc) { - bits.set(doc + docBase); - } - - public void setNextReader(IndexReader reader, int docBase) { - this.docBase = docBase; - } - }); - - -

      Not all collectors will need to rebase the docID. For - example, a collector that simply counts the total number - of hits would skip it.

      - -

      NOTE: Prior to 2.9, Lucene silently filtered - out hits with score <= 0. As of 2.9, the core Collectors - no longer do that. It's very unusual to have such hits - (a negative query boost, or function query returning - negative custom scores, could cause it to happen). If - you need that behavior, use - .

      - -

      NOTE: This API is experimental and might change - in incompatible ways in the next release.

      - -

      - 2.9 - -
      - - Called before successive calls to . Implementations - that need the score of the current document (passed-in to - ), should save the passed-in Scorer and call - scorer.score() when needed. - - - - Called once for every document matching a query, with the unbased document - number. - -

      - Note: This is called in an inner search loop. For good search performance, - implementations of this method should not call or - on every hit. - Doing so can slow searches by an order of magnitude or more. -

      -
      - - Called before collecting from each IndexReader. All doc ids in - will correspond to reader. - - Add docBase to the current IndexReaders internal document id to re-base ids - in . - - - next IndexReader - - - - - - - Return true if this collector does not - require the matching docIDs to be delivered in int sort - order (smallest to largest) to . -

      Most Lucene Query implementations will visit - matching docIDs in order. However, some queries - (currently limited to certain cases of ) - can achieve faster searching if the - Collector allows them to deliver the - docIDs out of order. -

      Many collectors don't mind getting docIDs out of - order, so it's important to return true - here. -

      - -
      - - Query that sets document score as a programmatic function of several (sub) scores: - - the score of its subQuery (any query) - (optional) the score of its ValueSourceQuery (or queries). - For most simple/convenient use cases this query is likely to be a - FieldScoreQuery - - Subclasses can modify the computation by overriding . - -

      - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. -

      -
      - - The abstract base class for queries. -

      Instantiable subclasses are: - - - - - - - - - - - - - -

      A parser for queries is contained in: - - QueryParser - -

      -
      - - Sets the boost for this query clause to b. Documents - matching this clause will (in addition to the normal weightings) have - their score multiplied by b. - - - - Gets the boost for this clause. Documents matching - this clause will (in addition to the normal weightings) have their score - multiplied by b. The boost is 1.0 by default. - - - - Prints a query to a string, with field assumed to be the - default field and omitted. -

      The representation used is one that is supposed to be readable - by QueryParser. However, - there are the following limitations: - - If the query was created by the parser, the printed - representation may not be exactly what was parsed. For example, - characters that need to be escaped will be represented without - the required backslash. - Some of the more complicated queries (e.g. span queries) - don't have a representation that can be parsed by QueryParser. - -

      -
      - - Prints a query to a string. - - - Expert: Constructs an appropriate Weight implementation for this query. - -

      - Only implemented by primitive queries, which re-write to themselves. -

      -
      - - Expert: Constructs and initializes a Weight for a top-level query. - - - Expert: called to re-write queries into primitive queries. For example, - a PrefixQuery will be rewritten into a BooleanQuery that consists - of TermQuerys. - - - - Expert: called when re-writing queries under MultiSearcher. - - Create a single query suitable for use by all subsearchers (in 1-1 - correspondence with queries). This is an optimization of the OR of - all queries. We handle the common optimization cases of equal - queries and overlapping clauses of boolean OR queries (as generated - by MultiTermQuery.rewrite()). - Be careful overriding this method as queries[0] determines which - method will be called and is not necessarily of the same type as - the other queries. - - - - Expert: adds all terms occuring in this query to the terms set. Only - works if this query is in its rewritten form. - - - UnsupportedOperationException if this query is not yet rewritten - - - Expert: merges the clauses of a set of BooleanQuery's into a single - BooleanQuery. - -

      A utility for use by implementations. -

      -
      - - Expert: Returns the Similarity implementation to be used for this query. - Subclasses may override this method to specify their own Similarity - implementation, perhaps one that delegates through that of the Searcher. - By default the Searcher's Similarity implementation is returned. - - - - Returns a clone of this query. - - - Create a CustomScoreQuery over input subQuery. - the sub query whose scored is being customed. Must not be null. - - - - Create a CustomScoreQuery over input subQuery and a . - the sub query whose score is being customed. Must not be null. - - a value source query whose scores are used in the custom score - computation. For most simple/convineient use case this would be a - FieldScoreQuery. - This parameter is optional - it can be null or even an empty array. - - - - Create a CustomScoreQuery over input subQuery and a . - the sub query whose score is being customized. Must not be null. - - value source queries whose scores are used in the custom score - computation. For most simple/convenient use case these would be - FieldScoreQueries. - This parameter is optional - it can be null or even an empty array. - - - - Returns true if o is equal to this. - - - Returns a hash code value for this object. - - - - Returns a that calculates the custom scores - for the given . The default implementation returns a default - implementation as specified in the docs of . - - - - - Compute a custom score by the subQuery score and a number of - ValueSourceQuery scores. - - The doc is relative to the current reader, which is - unknown to CustomScoreQuery when using per-segment search (since Lucene 2.9). - Please override and return a subclass - of for the given . - see CustomScoreProvider#customScore(int,float,float[]) - - - - Compute a custom score by the subQuery score and the ValueSourceQuery score. - - The doc is relative to the current reader, which is - unknown to CustomScoreQuery when using per-segment search (since Lucene 2.9). - Please override and return a subclass - of for the given . - - - - - Explain the custom score. - - The doc is relative to the current reader, which is - unknown to CustomScoreQuery when using per-segment search (since Lucene 2.9). - Please override and return a subclass - of for the given . - - - - Explain the custom score. - The doc is relative to the current reader, which is - unknown to CustomScoreQuery when using per-segment search (since Lucene 2.9). - Please override and return a subclass - of for the given . - - - - Checks if this is strict custom scoring. - In strict custom scoring, the ValueSource part does not participate in weight normalization. - This may be useful when one wants full control over how scores are modified, and does - not care about normalizing by the ValueSource part. - One particular case where this is useful if for testing this query. -

      - Note: only has effect when the ValueSource part is not null. -

      -
      - - Set the strict mode of this query. - The strict mode to set. - - - - - - A short name of this query, used in . - - - - An instance of this subclass should be returned by - , if you want - to modify the custom score calculation of a . - Since Lucene 2.9, queries operate on each segment of an Index separately, - so overriding the similar (now deprecated) methods in - is no longer suitable, as the supplied doc ID is per-segment - and without knowledge of the IndexReader you cannot access the - document or . - - @lucene.experimental - @since 2.9.2 - - - - - Creates a new instance of the provider class for the given IndexReader. - - - - - * Compute a custom score by the subQuery score and a number of - ValueSourceQuery scores. -

      - Subclasses can override this method to modify the custom score. -

      - If your custom scoring is different than the default herein you - should override at least one of the two customScore() methods. - If the number of ValueSourceQueries is always < 2 it is - sufficient to override the other - CustomScore() - method, which is simpler. -

      - The default computation herein is a multiplication of given scores: -

      -                ModifiedScore = valSrcScore * valSrcScores[0] * valSrcScores[1] * ...
      -            
      -
      - id of scored doc - score of that doc by the subQuery - scores of that doc by the ValueSourceQuery - custom score -
      - - - Compute a custom score by the subQuery score and the ValueSourceQuery score. -

      - Subclasses can override this method to modify the custom score. -

      - If your custom scoring is different than the default herein you - should override at least one of the two customScore() methods. - If the number of ValueSourceQueries is always < 2 it is - sufficient to override this customScore() method, which is simpler. -

      - The default computation herein is a multiplication of the two scores: -

      -                ModifiedScore = subQueryScore * valSrcScore
      -            
      -
      - id of scored doc - score of that doc by the subQuery - score of that doc by the ValueSourceQuery - custom score -
      - - - Explain the custom score. - Whenever overriding , - this method should also be overridden to provide the correct explanation - for the part of the custom scoring. - - doc being explained - explanation for the sub-query part - explanation for the value source part - an explanation for the custom score - - - - Explain the custom score. - Whenever overriding , - this method should also be overridden to provide the correct explanation - for the part of the custom scoring. - - - doc being explained - explanation for the sub-query part - explanation for the value source part - an explanation for the custom score - - - A scorer that applies a (callback) function on scores of the subQuery. - - - Expert: Common scoring functionality for different types of queries. - -

      - A Scorer iterates over documents matching a - query in increasing order of doc Id. -

      -

      - Document scores are computed using a given Similarity - implementation. -

      - -

      NOTE: The values Float.Nan, - Float.NEGATIVE_INFINITY and Float.POSITIVE_INFINITY are - not valid scores. Certain collectors (eg - ) will not properly collect hits - with these scores. - -

      - - -
      - - Constructs a Scorer. - The Similarity implementation used by this scorer. - - - - Returns the Similarity implementation used by this scorer. - - - Scores and collects all matching documents. - The collector to which all matching documents are passed through - . -
      When this method is used the method should not be used. - - use instead. - -
      - - Scores and collects all matching documents. - The collector to which all matching documents are passed. -
      When this method is used the method should not be used. - -
      - - Expert: Collects matching documents in a range. Hook for optimization. - Note that must be called once before this method is called - for the first time. - - The collector to which all matching documents are passed through - . - - Do not score documents past this. - - true if more matching documents may remain. - - use instead. - - - - Expert: Collects matching documents in a range. Hook for optimization. - Note, is added to ensure that - was called before this method. - - - The collector to which all matching documents are passed. - - Do not score documents past this. - - - The first document ID (ensures is called before - this method. - - true if more matching documents may remain. - - - - Returns the score of the current document matching the query. - Initially invalid, until or - is called the first time, or when called from within - . - - - - Returns an explanation of the score for a document. -
      When this method is used, the , and - methods should not be used. -
      - The document number for the explanation. - - - Please use - or instead. - -
      - - use instead. - - - - use instead. - - - - use instead. - - - - Expert: A hit queue for sorting by hits by terms in more than one field. - Uses FieldCache.DEFAULT for maintaining internal term lookup tables. - -

      Created: Dec 8, 2003 12:56:03 PM - -

      - lucene 1.4 - - $Id: FieldSortedHitQueue.java 803676 2009-08-12 19:31:38Z hossman $ - - - - - - see - -
      - - Creates a hit queue sorted by the given list of fields. - Index to use. - - Fieldable names, in priority order (highest priority first). Cannot be null or empty. - - The number of hits to retain. Must be greater than zero. - - IOException - - - Stores a comparator corresponding to each field being sorted by - - - Stores the sort criteria being used. - - - Stores the maximum score value encountered, needed for normalizing. - - - returns the maximum score encountered by elements inserted via insert() - - - Returns whether a is less relevant than b. - ScoreDoc - - ScoreDoc - - true if document a should be sorted after document b. - - - - Given a FieldDoc object, stores the values used - to sort the given document. These values are not the raw - values out of the index, but the internal representation - of them. This is so the given search hit can be collated - by a MultiSearcher with other search hits. - - The FieldDoc to store sort values into. - - The same FieldDoc passed in. - - - - - - Returns the SortFields being used by this hit queue. - - - Internal cache of comparators. Similar to FieldCache, only - caches comparators instead of term values. - - - - Returns a comparator for sorting hits according to a field containing bytes. - Index to use. - - Fieldable containing integer values. - - Comparator for sorting hits. - - IOException If an error occurs reading the index. - - - Returns a comparator for sorting hits according to a field containing shorts. - Index to use. - - Fieldable containing integer values. - - Comparator for sorting hits. - - IOException If an error occurs reading the index. - - - Returns a comparator for sorting hits according to a field containing integers. - Index to use. - - Fieldable containing integer values. - - Comparator for sorting hits. - - IOException If an error occurs reading the index. - - - Returns a comparator for sorting hits according to a field containing integers. - Index to use. - - Fieldable containing integer values. - - Comparator for sorting hits. - - IOException If an error occurs reading the index. - - - Returns a comparator for sorting hits according to a field containing floats. - Index to use. - - Fieldable containing float values. - - Comparator for sorting hits. - - IOException If an error occurs reading the index. - - - Returns a comparator for sorting hits according to a field containing doubles. - Index to use. - - Fieldable containing float values. - - Comparator for sorting hits. - - IOException If an error occurs reading the index. - - - Returns a comparator for sorting hits according to a field containing strings. - Index to use. - - Fieldable containing string values. - - Comparator for sorting hits. - - IOException If an error occurs reading the index. - - - Returns a comparator for sorting hits according to a field containing strings. - Index to use. - - Fieldable containing string values. - - - Comparator for sorting hits. - - IOException If an error occurs reading the index. - - - Returns a comparator for sorting hits according to values in the given field. - The terms in the field are looked at to determine whether they contain integers, - floats or strings. Once the type is determined, one of the other static methods - in this class is called to get the comparator. - - Index to use. - - Fieldable containing values. - - Comparator for sorting hits. - - IOException If an error occurs reading the index. - - - Expert: Internal cache. - - - Expert: The default cache implementation, storing all values in memory. - A WeakHashMap is used for storage. - -

      Created: May 19, 2004 4:40:36 PM - -

      - lucene 1.4 - - $Id: FieldCacheImpl.java 807572 2009-08-25 11:44:45Z mikemccand $ - -
      - - Checks the internal cache for an appropriate entry, and if none is - found, reads the terms in field as a single byte and returns an array - of size reader.maxDoc() of the value each document - has in the given field. - - Used to get field values. - - Which field contains the single byte values. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none is found, - reads the terms in field as bytes and returns an array of - size reader.maxDoc() of the value each document has in the - given field. - - Used to get field values. - - Which field contains the bytes. - - Computes byte for string values. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none is - found, reads the terms in field as shorts and returns an array - of size reader.maxDoc() of the value each document - has in the given field. - - Used to get field values. - - Which field contains the shorts. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none is found, - reads the terms in field as shorts and returns an array of - size reader.maxDoc() of the value each document has in the - given field. - - Used to get field values. - - Which field contains the shorts. - - Computes short for string values. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none is - found, reads the terms in field as integers and returns an array - of size reader.maxDoc() of the value each document - has in the given field. - - Used to get field values. - - Which field contains the integers. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none is found, - reads the terms in field as integers and returns an array of - size reader.maxDoc() of the value each document has in the - given field. - - Used to get field values. - - Which field contains the integers. - - Computes integer for string values. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if - none is found, reads the terms in field as floats and returns an array - of size reader.maxDoc() of the value each document - has in the given field. - - Used to get field values. - - Which field contains the floats. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if - none is found, reads the terms in field as floats and returns an array - of size reader.maxDoc() of the value each document - has in the given field. - - Used to get field values. - - Which field contains the floats. - - Computes float for string values. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none is - found, reads the terms in field as longs and returns an array - of size reader.maxDoc() of the value each document - has in the given field. - - - Used to get field values. - - Which field contains the longs. - - The values in the given field for each document. - - java.io.IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none is found, - reads the terms in field as longs and returns an array of - size reader.maxDoc() of the value each document has in the - given field. - - - Used to get field values. - - Which field contains the longs. - - Computes integer for string values. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none is - found, reads the terms in field as integers and returns an array - of size reader.maxDoc() of the value each document - has in the given field. - - - Used to get field values. - - Which field contains the doubles. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none is found, - reads the terms in field as doubles and returns an array of - size reader.maxDoc() of the value each document has in the - given field. - - - Used to get field values. - - Which field contains the doubles. - - Computes integer for string values. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none - is found, reads the term values in field and returns an array - of size reader.maxDoc() containing the value each document - has in the given field. - - Used to get field values. - - Which field contains the strings. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none - is found reads the term values in field and returns - an array of them in natural order, along with an array telling - which element in the term array each document uses. - - Used to get field values. - - Which field contains the strings. - - Array of terms and index into the array for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if - none is found reads field to see if it contains integers, longs, floats - or strings, and then calls one of the other methods in this class to get the - values. For string values, a StringIndex is returned. After - calling this method, there is an entry in the cache for both - type AUTO and the actual found type. - - Used to get field values. - - Which field contains the values. - - int[], long[], float[] or StringIndex. - - IOException If any error occurs. - Please specify the exact type, instead. - Especially, guessing does not work with the new - type. - - - - Checks the internal cache for an appropriate entry, and if none - is found reads the terms out of field and calls the given SortComparator - to get the sort values. A hit in the cache will happen if reader, - field, and comparator are the same (using equals()) - as a previous call to this method. - - Used to get field values. - - Which field contains the values. - - Used to convert terms into something to sort by. - - Array of sort objects, one for each document. - - IOException If any error occurs. - Please implement - directly, instead. - - - - EXPERT: Generates an array of CacheEntry objects representing all items - currently in the FieldCache. -

      - NOTE: These CacheEntry objects maintain a strong refrence to the - Cached Values. Maintaining refrences to a CacheEntry the IndexReader - associated with it has garbage collected will prevent the Value itself - from being garbage collected when the Cache drops the WeakRefrence. -

      -

      - EXPERIMENTAL API: This API is considered extremely advanced - and experimental. It may be removed or altered w/o warning in future - releases - of Lucene. -

      -

      -
      - -

      - EXPERT: Instructs the FieldCache to forcibly expunge all entries - from the underlying caches. This is intended only to be used for - test methods as a way to ensure a known base state of the Cache - (with out needing to rely on GC to free WeakReferences). - It should not be relied on for "Cache maintenance" in general - application code. -

      -

      - EXPERIMENTAL API: This API is considered extremely advanced - and experimental. It may be removed or altered w/o warning in future - releases - of Lucene. -

      -

      -
      - - - Expert: drops all cache entries associated with this - reader. NOTE: this reader must precisely match the - reader that the cache entry is keyed on. If you pass a - top-level reader, it usually will have no effect as - Lucene now caches at the segment reader level. - - - - If non-null, FieldCacheImpl will warn whenever - entries are created that are not sane according to - . - - - - counterpart of - - - Will be removed in 3.0, this is for binary compatibility only - - - - Will be removed in 3.0, this is for binary compatibility only - - - - Will be removed in 3.0, this is for binary compatibility only - - - - Will be removed in 3.0, this is for binary compatibility only - - - - - - - - EXPERT: A unique Identifier/Description for each item in the FieldCache. - Can be useful for logging/debugging. -

      - EXPERIMENTAL API: This API is considered extremely advanced - and experimental. It may be removed or altered w/o warning in future - releases - of Lucene. -

      -

      -
      - - - - - - Computes (and stores) the estimated size of the cache Value - - - - - The most recently estimated size of the value, null unless - estimateSize has been called. - - - - Only needed because of Entry (ab)use by - FieldSortedHitQueue, remove when FieldSortedHitQueue - is removed - - - - Only needed because of Entry (ab)use by - FieldSortedHitQueue, remove when FieldSortedHitQueue - is removed - - - - Adds warning to super.toString if Local or sortFieldType were specified - Only needed because of Entry (ab)use by - FieldSortedHitQueue, remove when FieldSortedHitQueue - is removed - - - - Hack: When thrown from a Parser (NUMERIC_UTILS_* ones), this stops - processing terms and returns the current FieldCache - array. - - - - Expert: Internal cache. - - - Remove this reader from the cache, if present. - - - Expert: Every composite-key in the internal cache is of this type. - - - Only (ab)used by FieldSortedHitQueue, - remove when FieldSortedHitQueue is removed - - - - Only (ab)used by FieldSortedHitQueue, - remove when FieldSortedHitQueue is removed - - - - Only (ab)used by FieldSortedHitQueue, - remove when FieldSortedHitQueue is removed - - - - Creates one of these objects for a custom comparator/parser. - - - Only (ab)used by FieldSortedHitQueue, - remove when FieldSortedHitQueue is removed - - - - Two of these are equal iff they reference the same field and type. - - - Composes a hashcode based on the field and type. - - - Please specify the exact type, instead. - Especially, guessing does not work with the new - type. - - - - - - - - Compares two ScoreDoc objects and returns a result indicating their - sort order. - - First ScoreDoc - - Second ScoreDoc - - a negative integer if i should come before j
      - a positive integer if i should come after j
      - 0 if they are equal -
      - - -
      - - Returns the value used to sort the given document. The - object returned must implement the java.io.Serializable - interface. This is used by multisearchers to determine how - to collate results from their searchers. - - - - Document - - Serializable object - - - - Returns the type of sort. Should return SortField.SCORE, - SortField.DOC, SortField.STRING, - SortField.INTEGER, SortField.FLOAT or - SortField.CUSTOM. It is not valid to return - SortField.AUTO. - This is used by multisearchers to determine how to collate results - from their searchers. - - One of the constants in SortField. - - - - - - Expert: Maintains caches of term values. - -

      Created: May 19, 2004 11:13:14 AM - -

      - lucene 1.4 - - $Id: FieldCache.java 807841 2009-08-25 22:27:31Z markrmiller $ - - - -
      - - Expert: Stores term text values and document ordering data. - - - All the term values, in natural order. - - - For each document, an index into the lookup array. - - - Creates one of these objects - - - Indicator for StringIndex values in the cache. - - - Expert: The cache used internally by sorting and range query classes. - - - The default parser for byte values, which are encoded by - - - The default parser for short values, which are encoded by - - - The default parser for int values, which are encoded by - - - The default parser for float values, which are encoded by - - - The default parser for long values, which are encoded by - - - The default parser for double values, which are encoded by - - - A parser instance for int values encoded by , e.g. when indexed - via /. - - - - A parser instance for float values encoded with , e.g. when indexed - via /. - - - - A parser instance for long values encoded by , e.g. when indexed - via /. - - - - A parser instance for double values encoded with , e.g. when indexed - via /. - - - - Interface to parse bytes from document fields. - - - - - Marker interface as super-interface to all parsers. It - is used to specify a custom parser to . - - - - Return a single Byte representation of this field's value. - - - Interface to parse shorts from document fields. - - - - - Return a short representation of this field's value. - - - Interface to parse ints from document fields. - - - - - Return an integer representation of this field's value. - - - Interface to parse floats from document fields. - - - - - Return an float representation of this field's value. - - - Interface to parse long from document fields. - - - Use , this will be removed in Lucene 3.0 - - - - Return an long representation of this field's value. - - - Interface to parse doubles from document fields. - - - Use , this will be removed in Lucene 3.0 - - - - Return an long representation of this field's value. - - - The Scorer for DisjunctionMaxQuery's. The union of all documents generated by the the subquery scorers - is generated in document number order. The score for each document is the maximum of the scores computed - by the subquery scorers that generate that document, plus tieBreakerMultiplier times the sum of the scores - for the other subqueries that generate the document. - - - - Creates a new instance of DisjunctionMaxScorer - - - Multiplier applied to non-maximum-scoring subqueries for a - document as they are summed into the result. - - -- not used since our definition involves neither coord nor terms - directly - - The sub scorers this Scorer should iterate on - - The actual number of scorers to iterate on. Note that the array's - length may be larger than the actual number of scorers. - - - - Generate the next document matching our associated DisjunctionMaxQuery. - - - true iff there is a next document - - use instead. - - - - use instead. - - - - Determine the current document score. Initially invalid, until is called the first time. - the score of the current generated document - - - - Advance to the first document beyond the current whose number is greater - than or equal to target. - - - the minimum number of the next desired document - - true iff there is a document to be generated whose number is at - least target - - use instead. - - - - Explain a score that we computed. UNSUPPORTED -- see explanation capability in DisjunctionMaxQuery. - the number of a document we scored - - the Explanation for our score - - - - This interface describes a character stream that maintains line and - column number positions of the characters. It also has the capability - to backup the stream to some extent. An implementation of this - interface is used in the TokenManager implementation generated by - JavaCCParser. - - All the methods except backup can be implemented in any fashion. backup - needs to be implemented correctly for the correct operation of the lexer. - Rest of the methods are all used to get information like line number, - column number and the String that constitutes a token and are not used - by the lexer. Hence their implementation won't affect the generated lexer's - operation. - - - - Returns the next character from the selected input. The method - of selecting the input is the responsibility of the class - implementing this interface. Can throw any java.io.IOException. - - - - Returns the column position of the character last read. - - - - - - - Returns the line number of the character last read. - - - - - - - Returns the column number of the last character for current token (being - matched after the last call to BeginTOken). - - - - Returns the line number of the last character for current token (being - matched after the last call to BeginTOken). - - - - Returns the column number of the first character for current token (being - matched after the last call to BeginTOken). - - - - Returns the line number of the first character for current token (being - matched after the last call to BeginTOken). - - - - Backs up the input stream by amount steps. Lexer calls this method if it - had already read some characters, but could not use them to match a - (longer) token. So, they will be used again as the prefix of the next - token and it is the implemetation's responsibility to do this right. - - - - Returns the next character that marks the beginning of the next token. - All characters must remain in the buffer between two successive calls - to this method to implement backup correctly. - - - - Returns a string made up of characters from the marked token beginning - to the current buffer position. Implementations have the choice of returning - anything that they want to. For example, for efficiency, one might decide - to just return null, which is a valid implementation. - - - - Returns an array of characters that make up the suffix of length 'len' for - the currently matched token. This is used to build up the matched string - for use in actions in the case of MORE. A simple and inefficient - implementation of this is as follows : - - { - String t = GetImage(); - return t.substring(t.length() - len, t.length()).toCharArray(); - } - - - - The lexer calls this function to indicate that it is done with the stream - and hence implementations can free any resources held by this class. - Again, the body of this function can be just empty and it will not - affect the lexer's operation. - - - - Fills in no-term-vectors for all docs we haven't seen - since the last doc that had term vectors. - - - - Consumer returns this on each doc. This holds any - state that must be flushed synchronized "in docID - order". We gather these and flush them in order. - - - - This class accepts multiple added documents and directly - writes a single segment file. It does this more - efficiently than creating a single segment per document - (with DocumentWriter) and doing standard merges on those - segments. - - Each added document is passed to the , - which in turn processes the document and interacts with - other consumers in the indexing chain. Certain - consumers, like and - , digest a document and - immediately write bytes to the "doc store" files (ie, - they do not consume RAM per document, except while they - are processing the document). - - Other consumers, eg and - , buffer bytes in RAM and flush only - when a new segment is produced. - Once we have used our allowed RAM buffer, or the number - of added docs is large enough (in the case we are - flushing by doc count instead of RAM usage), we create a - real segment and flush it to the Directory. - - Threads: - - Multiple threads are allowed into addDocument at once. - There is an initial synchronized call to getThreadState - which allocates a ThreadState for this thread. The same - thread will get the same ThreadState over time (thread - affinity) so that if there are consistent patterns (for - example each thread is indexing a different content - source) then we make better use of RAM. Then - processDocument is called on that ThreadState without - synchronization (most of the "heavy lifting" is in this - call). Finally the synchronized "finishDocument" is - called to flush changes to the directory. - - When flush is called by IndexWriter, or, we flush - internally when autoCommit=false, we forcefully idle all - threads and flush only once they are all idle. This - means you can call flush with a given thread even while - other threads are actively adding/deleting documents. - - - Exceptions: - - Because this class directly updates in-memory posting - lists, and flushes stored fields and term vectors - directly to files in the directory, there are certain - limited times when an exception can corrupt this state. - For example, a disk full while flushing stored fields - leaves this file in a corrupt state. Or, an OOM - exception while appending to the in-memory posting lists - can corrupt that posting list. We call such exceptions - "aborting exceptions". In these cases we must call - abort() to discard all docs added since the last flush. - - All other exceptions ("non-aborting exceptions") can - still partially update the index structures. These - updates are consistent, but, they represent only a part - of the document seen up until the exception was hit. - When this happens, we immediately mark the document as - deleted so that the document is always atomically ("all - or none") added to the index. - - - - Create and return a new DocWriterBuffer. - - - Returns true if any of the fields in the current - buffered docs have omitTermFreqAndPositions==false - - - - If non-null, various details of indexing are printed - here. - - - - Set how much RAM we can use before flushing. - - - Set max buffered docs, which means we will flush by - doc count instead of by RAM usage. - - - - Get current segment name we are writing. - - - Returns how many docs are currently buffered in RAM. - - - Returns the current doc store segment we are writing - to. This will be the same as segment when autoCommit - * is true. - - - - Returns the doc offset into the shared doc store for - the current buffered docs. - - - - Closes the current open doc stores an returns the doc - store segment name. This returns null if there are * - no buffered documents. - - - - Called if we hit an exception at a bad time (when - updating the index files) and must discard all - currently buffered docs. This resets our state, - discarding any docs added since last flush. - - - - Reset after a flush - - - Flush all pending docs to a new segment - - - Build compound file for the segment we just flushed - - - Set flushPending if it is not already set and returns - whether it was set. This is used by IndexWriter to - trigger a single flush even when multiple threads are - trying to do so. - - - - Returns a free (idle) ThreadState that may be used for - indexing this one document. This call also pauses if a - flush is pending. If delTerm is non-null then we - buffer this deleted term after the thread state has - been acquired. - - - - Returns true if the caller (IndexWriter) should now - flush. - - - - Called whenever a merge has completed and the merged segments had deletions - - - Does the synchronized work to finish/flush the - inverted document. - - - - The IndexingChain must define the method - which returns the DocConsumer that the DocumentsWriter calls to process the - documents. - - - - Consumer returns this on each doc. This holds any - state that must be flushed synchronized "in docID - order". We gather these and flush them in order. - - - - RAMFile buffer for DocWriters. - - - Expert: allocate a new buffer. - Subclasses can allocate differently. - - size of allocated buffer. - - allocated buffer. - - - - Allocate bytes used from shared pool. - - - Recycle the bytes used. - - - This is the base class for an in-memory posting list, - keyed by a Token. maintains a hash - table holding one instance of this per unique Token. - Consumers of TermsHash () must - subclass this class with its own concrete class. - FreqProxTermsWriter.PostingList is a private inner class used - for the freq/prox postings, and - TermVectorsTermsWriter.PostingList is a private inner class - used to hold TermVectors postings. - - - - Remaps docIDs after a merge has completed, where the - merged segments had at least one deletion. This is used - to renumber the buffered deletes in IndexWriter when a - merge of segments with deletions commits. - - - - Filename filter that accept filenames and extensions only created by Lucene. - - - $rcs = ' $Id: Exp $ ' ; - - - - Returns true if this is a file that would be contained - in a CFS file. This function should only be called on - files that pass the above "accept" (ie, are already - known to be a Lucene index file). - - - - Process the document. If there is - something for this document to be done in docID order, - you should encapsulate that as a - DocumentsWriter.DocWriter and return it. - DocumentsWriter then calls finish() on this object - when it's its turn. - - - - - Base class for enumerating all but deleted docs. - -

      NOTE: this class is meant only to be used internally - by Lucene; it's only public so it can be shared across - packages. This means the API is freely subject to - change, and, the class could be removed entirely, in any - Lucene release. Use directly at your own risk! */ -

      -
      - - TermDocs provides an interface for enumerating <document, frequency> - pairs for a term.

      The document portion names each document containing - the term. Documents are indicated by number. The frequency portion gives - the number of times the term occurred in each document.

      The pairs are - ordered by document number. -

      - - -
      - - Sets this to the data for a term. - The enumeration is reset to the start of the data for this term. - - - - Sets this to the data for the current term in a . - This may be optimized in some implementations. - - - - Returns the current document number.

      This is invalid until - is called for the first time. -

      -
      - - Returns the frequency of the term within the current document.

      This - is invalid until is called for the first time. -

      -
      - - Moves to the next pair in the enumeration.

      Returns true iff there is - such a next pair in the enumeration. -

      -
      - - Attempts to read multiple entries from the enumeration, up to length of - docs. Document numbers are stored in docs, and term - frequencies are stored in freqs. The freqs array must be as - long as the docs array. - -

      Returns the number of entries read. Zero is only returned when the - stream has been exhausted. -

      -
      - - Skips entries to the first beyond the current whose document number is - greater than or equal to target.

      Returns true iff there is such - an entry.

      Behaves as if written: - boolean skipTo(int target) { - do { - if (!next()) - return false; - } while (target > doc()); - return true; - } - - Some implementations are considerably more efficient than that. -

      -
      - - Frees associated resources. - - - Expert: This class provides a - for indexing numeric values that can be used by - or . - -

      Note that for simple usage, is - recommended. disables norms and - term freqs, as they are not usually needed during - searching. If you need to change these settings, you - should use this class. - -

      See for capabilities of fields - indexed numerically.

      - -

      Here's an example usage, for an int field: - - - Field field = new Field(name, new NumericTokenStream(precisionStep).setIntValue(value)); - field.setOmitNorms(true); - field.setOmitTermFreqAndPositions(true); - document.add(field); - - -

      For optimal performance, re-use the TokenStream and Field instance - for more than one document: - - - NumericTokenStream stream = new NumericTokenStream(precisionStep); - Field field = new Field(name, stream); - field.setOmitNorms(true); - field.setOmitTermFreqAndPositions(true); - Document document = new Document(); - document.add(field); - - for(all documents) { - stream.setIntValue(value) - writer.addDocument(document); - } - - -

      This stream is not intended to be used in analyzers; - it's more for iterating the different precisions during - indexing a specific numeric value.

      - -

      NOTE: as token streams are only consumed once - the document is added to the index, if you index more - than one numeric field, use a separate NumericTokenStream - instance for each.

      - -

      See for more details on the - precisionStep - parameter as well as how numeric fields work under the hood.

      - -

      NOTE: This API is experimental and - might change in incompatible ways in the next release. - Since 2.9 -

      -
      - - A TokenStream enumerates the sequence of tokens, either from - s of a or from query text. -

      - This is an abstract class. Concrete subclasses are: - - , a TokenStream whose input is a Reader; and - , a TokenStream whose input is another - TokenStream. - - A new TokenStream API has been introduced with Lucene 2.9. This API - has moved from being based to based. While - still exists in 2.9 as a convenience class, the preferred way - to store the information of a is to use s. -

      - TokenStream now extends , which provides - access to all of the token s for the TokenStream. - Note that only one instance per is created and reused - for every token. This approach reduces object creation and allows local - caching of references to the s. See - for further details. -

      - The workflow of the new TokenStream API is as follows: - - Instantiation of TokenStream/s which add/get - attributes to/from the . - The consumer calls . - The consumer retrieves attributes from the stream and stores local - references to all attributes it wants to access - The consumer calls until it returns false and - consumes the attributes after each call. - The consumer calls so that any end-of-stream operations - can be performed. - The consumer calls to release any resource when finished - using the TokenStream - - To make sure that filters and consumers know which attributes are available, - the attributes must be added during instantiation. Filters and consumers are - not required to check for availability of attributes in - . -

      - You can find some example code for the new API in the analysis package level - Javadoc. -

      - Sometimes it is desirable to capture a current state of a TokenStream - , e. g. for buffering purposes (see , - ). For this usecase - and - can be used. -

      -
      - - An AttributeSource contains a list of different s, - and methods to add and get them. There can only be a single instance - of an attribute in the same AttributeSource instance. This is ensured - by passing in the actual type of the Attribute (Class<Attribute>) to - the , which then checks if an instance of - that type is already present. If yes, it returns the instance, otherwise - it creates a new instance and returns it. - - - - An AttributeSource using the default attribute factory . - - - An AttributeSource that uses the same attributes as the supplied one. - - - An AttributeSource using the supplied for creating new instances. - - - returns the used AttributeFactory. - - - Returns a new iterator that iterates the attribute classes - in the same order they were added in. - Signature for Java 1.5: public Iterator<Class<? extends Attribute>> getAttributeClassesIterator() - - Note that this return value is different from Java in that it enumerates over the values - and not the keys - - - - Returns a new iterator that iterates all unique Attribute implementations. - This iterator may contain less entries that , - if one instance implements more than one Attribute interface. - Signature for Java 1.5: public Iterator<AttributeImpl> getAttributeImplsIterator() - - - - a cache that stores all interfaces for known implementation classes for performance (slow reflection) - - - Adds a custom AttributeImpl instance with one or more Attribute interfaces. - - - The caller must pass in a Class<? extends Attribute> value. - This method first checks if an instance of that class is - already in this AttributeSource and returns it. Otherwise a - new instance is created, added to this AttributeSource and returned. - Signature for Java 1.5: public <T extends Attribute> T addAttribute(Class<T>) - - - - Returns true, iff this AttributeSource has any attributes - - - The caller must pass in a Class<? extends Attribute> value. - Returns true, iff this AttributeSource contains the passed-in Attribute. - Signature for Java 1.5: public boolean hasAttribute(Class<? extends Attribute>) - - - - The caller must pass in a Class<? extends Attribute> value. - Returns the instance of the passed in Attribute contained in this AttributeSource - Signature for Java 1.5: public <T extends Attribute> T getAttribute(Class<T>) - - - IllegalArgumentException if this AttributeSource does not contain the - Attribute. It is recommended to always use even in consumers - of TokenStreams, because you cannot know if a specific TokenStream really uses - a specific Attribute. will automatically make the attribute - available. If you want to only use the attribute, if it is available (to optimize - consuming), use . - - - - Resets all Attributes in this AttributeSource by calling - on each Attribute implementation. - - - - Captures the state of all Attributes. The return value can be passed to - to restore the state of this or another AttributeSource. - - - - Restores this state by copying the values of all attribute implementations - that this state contains into the attributes implementations of the targetStream. - The targetStream must contain a corresponding instance for each argument - contained in this state (e.g. it is not possible to restore the state of - an AttributeSource containing a TermAttribute into a AttributeSource using - a Token instance as implementation). - - Note that this method does not affect attributes of the targetStream - that are not contained in this state. In other words, if for example - the targetStream contains an OffsetAttribute, but this state doesn't, then - the value of the OffsetAttribute remains unchanged. It might be desirable to - reset its value to the default, in which case the caller should first - call on the targetStream. - - - - Performs a clone of all instances returned in a new - AttributeSource instance. This method can be used to e.g. create another TokenStream - with exactly the same attributes (using ) - - - - An AttributeFactory creates instances of s. - - - returns an for the supplied interface class. -

      Signature for Java 1.5: public AttributeImpl createAttributeInstance(Class%lt;? extends Attribute> attClass) -

      -
      - - This is the default factory that creates s using the - class name of the supplied interface class by appending Impl to it. - - - - This class holds the state of an AttributeSource. - - - - - - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - A TokenStream using the default attribute factory. - - - A TokenStream that uses the same attributes as the supplied one. - - - A TokenStream using the supplied AttributeFactory for creating new instances. - - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - For extra performance you can globally enable the new - API using s. There will be a - small, but in most cases negligible performance increase by enabling this, - but it only works if all TokenStreams use the new API and - implement . This setting can only be enabled - globally. -

      - This setting only affects TokenStreams instantiated after this - call. All TokenStreams already created use the other setting. -

      - All core s are compatible with this setting, if you have - your own TokenStreams that are also compatible, you should enable - this. -

      - When enabled, tokenization may throw - s, if the whole tokenizer chain is not compatible eg one of the - TokenStreams does not implement the new TokenStream API. -

      - The default is false, so there is the fallback to the old API - available. - -

      - This setting will no longer be needed in Lucene 3.0 as the old - API will be removed. - -
      - - Returns if only the new API is used. - - - - - This setting will no longer be needed in Lucene 3.0 as - the old API will be removed. - - - - Consumers (i.e., ) use this method to advance the stream to - the next token. Implementing classes must implement this method and update - the appropriate s with the attributes of the next - token. - - The producer must make no assumptions about the attributes after the - method has been returned: the caller may arbitrarily change it. If the - producer needs to preserve the state for subsequent calls, it can use - to create a copy of the current attribute state. - - This method is called for every token of a document, so an efficient - implementation is crucial for good performance. To avoid calls to - and or downcasts, - references to all s that this stream uses should be - retrieved during instantiation. - - To ensure that filters and consumers know which attributes are available, - the attributes must be added during instantiation. Filters and consumers - are not required to check for availability of attributes in - . - - - false for end of stream; true otherwise - - Note that this method will be defined abstract in Lucene - 3.0. - - - - This method is called by the consumer after the last token has been - consumed, after returned false - (using the new TokenStream API). Streams implementing the old API - should upgrade to use this feature. -

      - This method can be used to perform any end-of-stream operations, such as - setting the final offset of a stream. The final offset of a stream might - differ from the offset of the last token eg in case one or more whitespaces - followed after the last token, but a was used. - -

      - IOException -
      - - Returns the next token in the stream, or null at EOS. When possible, the - input Token should be used as the returned Token (this gives fastest - tokenization performance), but this is not required and a new Token may be - returned. Callers may re-use a single Token instance for successive calls - to this method. - - This implicitly defines a "contract" between consumers (callers of this - method) and producers (implementations of this method that are the source - for tokens): - - A consumer must fully consume the previously returned - before calling this method again. - A producer must call before setting the fields in - it and returning it - - Also, the producer must make no assumptions about a after it - has been returned: the caller may arbitrarily change it. If the producer - needs to hold onto the for subsequent calls, it must clone() - it before storing it. Note that a is considered a - consumer. - - - a that may or may not be used to return; - this parameter should never be null (the callee is not required to - check for null before using it, but it is a good idea to assert that - it is not null.) - - next in the stream or null if end-of-stream was hit - - The new and - APIs should be used instead. - - - - Returns the next in the stream, or null at EOS. - - - The returned Token is a "full private copy" (not re-used across - calls to ) but will be slower than calling - or using the new - method with the new API. - - - - Resets this stream to the beginning. This is an optional operation, so - subclasses may or may not implement this method. is not needed for - the standard indexing process. However, if the tokens of a - TokenStream are intended to be consumed more than once, it is - necessary to implement . Note that if your TokenStream - caches tokens and feeds them back again after a reset, it is imperative - that you clone the tokens when you store them away (on the first pass) as - well as when you return them (on future passes after ). - - - - Releases resources associated with this stream. - - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - The full precision token gets this token type assigned. - - - The lower precision tokens gets this token type assigned. - - - Creates a token stream for numeric values using the default precisionStep - (4). The stream is not yet initialized, - before using set a value using the various set???Value() methods. - - - - Creates a token stream for numeric values with the specified - precisionStep. The stream is not yet initialized, - before using set a value using the various set???Value() methods. - - - - Expert: Creates a token stream for numeric values with the specified - precisionStep using the given . - The stream is not yet initialized, - before using set a value using the various set???Value() methods. - - - - Expert: Creates a token stream for numeric values with the specified - precisionStep using the given - . - The stream is not yet initialized, - before using set a value using the various set???Value() methods. - - - - Initializes the token stream with the supplied long value. - the value, for which this TokenStream should enumerate tokens. - - this instance, because of this you can use it the following way: - new Field(name, new NumericTokenStream(precisionStep).SetLongValue(value)) - - - - Initializes the token stream with the supplied int value. - the value, for which this TokenStream should enumerate tokens. - - this instance, because of this you can use it the following way: - new Field(name, new NumericTokenStream(precisionStep).SetIntValue(value)) - - - - Initializes the token stream with the supplied double value. - the value, for which this TokenStream should enumerate tokens. - - this instance, because of this you can use it the following way: - new Field(name, new NumericTokenStream(precisionStep).SetDoubleValue(value)) - - - - Initializes the token stream with the supplied float value. - the value, for which this TokenStream should enumerate tokens. - - this instance, because of this you can use it the following way: - new Field(name, new NumericTokenStream(precisionStep).SetFloatValue(value)) - - - - Holds a map of String input to String output, to be used - with . - - - - Records a replacement to be applied to the inputs - stream. Whenever singleMatch occurs in - the input, it will be replaced with - replacement. - - - input String to be replaced - - output String - - - - Replacement for Java 1.5 Character.valueOf() - Move to Character.valueOf() in 3.0 - - - - Returns a Character instance representing the given char value - - - a char value - - a Character representation of the given char value. - - - - Borrowed from Cglib. Allows custom swap so that two arrays can be sorted - at the same time. - - - - Some useful constants. - - - - $Id: Constants.java 828327 2009-10-22 06:47:40Z uschindler $ - - - - - The value of System.getProperty("java.version"). * - - - True iff this is Java version 1.1. - - - True iff this is Java version 1.2. - - - True iff this is Java version 1.3. - - - The value of System.getProperty("os.name"). * - - - True iff running on Linux. - - - True iff running on Windows. - - - True iff running on SunOS. - - - Implements the wildcard search query. Supported wildcards are *, which - matches any character sequence (including the empty one), and ?, - which matches any single character. Note this query can be slow, as it - needs to iterate over many terms. In order to prevent extremely slow WildcardQueries, - a Wildcard term should not start with one of the wildcards * or - ?. - -

      This query uses the - - rewrite method. - -

      - - -
      - - An abstract that matches documents - containing a subset of terms provided by a - enumeration. - -

      This query cannot be used directly; you must subclass - it and define to provide a - that iterates through the terms to be - matched. - -

      NOTE: if is either - or - , you may encounter a - exception during - searching, which happens when the number of terms to be - searched exceeds - . Setting - to - prevents this. - -

      The recommended rewrite method is - : it doesn't spend CPU - computing unhelpful scores, and it tries to pick the most - performant rewrite method given the query. - - Note that produces - MultiTermQueries using - by default. -

      -
      - - A rewrite method that first creates a private Filter, - by visiting each term in sequence and marking all docs - for that term. Matching documents are assigned a - constant score equal to the query's boost. - -

      This method is faster than the BooleanQuery - rewrite methods when the number of matched terms or - matched documents is non-trivial. Also, it will never - hit an errant - exception. - -

      - - -
      - - A rewrite method that first translates each term into - clause in a - BooleanQuery, and keeps the scores as computed by the - query. Note that typically such scores are - meaningless to the user, and require non-trivial CPU - to compute, so it's almost always better to use - instead. - -

      NOTE: This rewrite method will hit - if the number of terms - exceeds . - -

      - - -
      - - Like except - scores are not computed. Instead, each matching - document receives a constant score equal to the - query's boost. - -

      NOTE: This rewrite method will hit - if the number of terms - exceeds . - -

      - - -
      - - Read-only default instance of - , with - set to - - - and - set to - - . - Note that you cannot alter the configuration of this - instance; you'll need to create a private instance - instead. - - - - Constructs a query for terms matching term. - check sub class for possible term access - the Term does not - make sense for all MultiTermQuerys and will be removed. - - - - Constructs a query matching terms that cannot be represented with a single - Term. - - - - Returns the pattern term. - check sub class for possible term access - getTerm does not - make sense for all MultiTermQuerys and will be removed. - - - - Construct the enumeration to be used, expanding the pattern term. - - - Expert: Return the number of unique terms visited during execution of the query. - If there are many of them, you may consider using another query type - or optimize your total term count in index. -

      This method is not thread safe, be sure to only call it when no query is running! - If you re-use the same query instance for another - search, be sure to first reset the term counter - with . -

      On optimized indexes / no MultiReaders, you get the correct number of - unique terms for the whole index. Use this number to compare different queries. - For non-optimized indexes this number can also be achived in - non-constant-score mode. In constant-score mode you get the total number of - terms seeked for all segments / sub-readers. -

      - - -
      - - Expert: Resets the counting of unique terms. - Do this before executing the query/filter. - - - - - - - - - - Sets the rewrite method to be used when executing the - query. You can use one of the four core methods, or - implement your own subclass of . - - - - A rewrite method that tries to pick the best - constant-score rewrite method based on term and - document counts from the query. If both the number of - terms and documents is small enough, then - is used. - Otherwise, is - used. - - - - Abstract class that defines how the query is rewritten. - - - If the number of terms in this query is equal to or - larger than this setting then - is used. - - - - - - - - If the number of documents to be visited in the - postings exceeds this specified percentage of the - maxDoc() for the index, then - is used. - - 0.0 to 100.0 - - - - - - - - Returns the pattern term. - - - Prints a user-readable version of this query. - - - - Represents hits returned by . - - - - Represents hits returned by - and - - - - The total number of hits for the query. - - - - - The top hits for the query. - - - Stores the maximum score value encountered, needed for normalizing. - - - Returns the maximum score value encountered. Note that in case - scores are not tracked, this returns . - - - - Sets the maximum score value encountered. - - - Constructs a TopDocs with a default maxScore=Float.NaN. - - - - - - The fields which were used to sort results by. - - - Creates one of these objects. - Total number of hits for the query. - - The top hits for the query. - - The sort criteria used to find the top hits. - - The maximum score encountered. - - - - A which wraps another scorer and caches the score of the - current document. Successive calls to will return the same - result and will not invoke the wrapped Scorer's score() method, unless the - current document has changed.
      - This class might be useful due to the changes done to the - interface, in which the score is not computed for a document by default, only - if the collector requests it. Some collectors may need to use the score in - several places, however all they have in hand is a object, and - might end up computing the score of a document more than once. -
      -
      - - Creates a new instance by wrapping the given scorer. - - - use instead. - - - - use instead. - - - - use instead. - - - - This class is very similar to - except that it factors - in the value of the payloads located at each of the positions where the - occurs. -

      - In order to take advantage of this, you must override - - which returns 1 by default. -

      - Payload scores are aggregated using a pluggable . - -

      - - -
      - - Matches spans which are near one another. One can specify slop, the - maximum number of intervening unmatched positions, as well as whether - matches are required to be in-order. - - - - Base class for span-based queries. - - - Expert: Returns the matches for this query in an index. Used internally - to search for spans. - - - - Returns the name of the field matched by this query. - - - Returns a collection of all terms matched by this query. - use extractTerms instead - - - - - - Construct a SpanNearQuery. Matches spans matching a span from each - clause, with up to slop total unmatched positions between - them. * When inOrder is true, the spans from each clause - must be * ordered as in clauses. - - - - Return the clauses whose spans are matched. - - - Return the maximum number of intervening unmatched positions permitted. - - - Return true if matches are required to be in-order. - - - Returns a collection of all terms matched by this query. - use extractTerms instead - - - - - - Returns true iff o is equal to this. - - - Expert-only. Public for use by other weight implementations - - - Public for extension only. - - - not needed anymore - - - - use instead. - - - - use instead. - - - - use instead. - - - - By default, uses the to score the payloads, but - can be overridden to do other things. - - - The payloads - - The start position of the span being scored - - The end position of the span being scored - - - - - - - Expert: obtains short field values from the - FieldCache - using getShorts() and makes those values - available as other numeric types, casting as needed. - -

      - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. - -

      - for requirements - on the field. - -

      NOTE: with the switch in 2.9 to segment-based - searching, if is invoked with a - composite (multi-segment) reader, this can easily cause - double RAM usage for the values in the FieldCache. It's - best to switch your application to pass only atomic - (single segment) readers to this API. Alternatively, for - a short-term fix, you could wrap your ValueSource using - , which costs more CPU per lookup - but will not consume double the FieldCache RAM.

      - - - -

      Expert: A base class for ValueSource implementations that retrieve values for - a single field from the FieldCache. -

      - Fields used herein nust be indexed (doesn't matter if these fields are stored or not). -

      - It is assumed that each such indexed field is untokenized, or at least has a single token in a document. - For documents with multiple tokens of the same field, behavior is undefined (It is likely that current - code would use the value of one of these tokens, but this is not guaranteed). -

      - Document with no tokens in this field are assigned the Zero value. - -

      - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. - -

      NOTE: with the switch in 2.9 to segment-based - searching, if is invoked with a - composite (multi-segment) reader, this can easily cause - double RAM usage for the values in the FieldCache. It's - best to switch your application to pass only atomic - (single segment) readers to this API. Alternatively, for - a short-term fix, you could wrap your ValueSource using - , which costs more CPU per lookup - but will not consume double the FieldCache RAM.

      -

      -
      - - Expert: source of values for basic function queries. -

      At its default/simplest form, values - one per doc - are used as the score of that doc. -

      Values are instantiated as - DocValues for a particular reader. -

      ValueSource implementations differ in RAM requirements: it would always be a factor - of the number of documents, but for each document the number of bytes can be 1, 2, 4, or 8. - -

      - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. - - -

      -
      - - Return the DocValues used by the function query. - the IndexReader used to read these values. - If any caching is involved, that caching would also be IndexReader based. - - IOException for any error. - - - description of field, used in explain() - - - Needed for possible caching of query results - used by . - - - - - Needed for possible caching of query results - used by . - - - - - Create a cached field source for the input field. - - - Return cached DocValues for input field and reader. - FieldCache so that values of a field are loaded once per reader (RAM allowing) - - Field for which values are required. - - - - - - Check if equals to another , already knowing that cache and field are equal. - - - - - Return a hash code of a , without the hash-codes of the field - and the cache (those are taken care of elsewhere). - - - - - - Create a cached short field source with default string-to-short parser. - - - Create a cached short field source with a specific string-to-short parser. - - - Expert: represents field values as different types. - Normally created via a - ValueSuorce - for a particular field and reader. - -

      - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. - - -

      -
      - - Return doc value as a float. -

      Mandatory: every DocValues implementation must implement at least this method. -

      - document whose float value is requested. - -
      - - Return doc value as an int. -

      Optional: DocValues implementation can (but don't have to) override this method. -

      - document whose int value is requested. - -
      - - Return doc value as a long. -

      Optional: DocValues implementation can (but don't have to) override this method. -

      - document whose long value is requested. - -
      - - Return doc value as a double. -

      Optional: DocValues implementation can (but don't have to) override this method. -

      - document whose double value is requested. - -
      - - Return doc value as a string. -

      Optional: DocValues implementation can (but don't have to) override this method. -

      - document whose string value is requested. - -
      - - Return a string representation of a doc value, as reuired for Explanations. - - - Explain the scoring value for the input doc. - - - Expert: for test purposes only, return the inner array of values, or null if not applicable. -

      - Allows tests to verify that loaded values are: - - indeed cached/reused. - stored in the expected size/type (byte/short/int/float). - - Note: implementations of DocValues must override this method for - these test elements to be tested, Otherwise the test would not fail, just - print a warning. -

      -
      - - Returns the minimum of all values or Float.NaN if this - DocValues instance does not contain any value. -

      - This operation is optional -

      - -

      - the minimum of all values or Float.NaN if this - DocValues instance does not contain any value. - -
      - - Returns the maximum of all values or Float.NaN if this - DocValues instance does not contain any value. -

      - This operation is optional -

      - -

      - the maximum of all values or Float.NaN if this - DocValues instance does not contain any value. - -
      - - Returns the average of all values or Float.NaN if this - DocValues instance does not contain any value. * -

      - This operation is optional -

      - -

      - the average of all values or Float.NaN if this - DocValues instance does not contain any value - -
      - - This class wraps another ValueSource, but protects - against accidental double RAM usage in FieldCache when - a composite reader is passed to . - -

      NOTE: this class adds a CPU penalty to every - lookup, as it must resolve the incoming document to the - right sub-reader using a binary search.

      - -

      - This class is temporary, to ease the - migration to segment-based searching. Please change your - code to not pass composite readers to these APIs. - -
      - - Provides a for custom field sorting. - - NOTE: This API is experimental and might change in - incompatible ways in the next release. - - - - - Creates a comparator for the field in the given index. - - - Name of the field to create comparator for. - - FieldComparator. - - IOException - If an error occurs reading the index. - - - - A that only accepts documents whose single - term value in the specified field is contained in the - provided set of allowed terms. - -

      - - This is the same functionality as TermsFilter (from - contrib/queries), except this filter requires that the - field contains only a single term for all documents. - Because of drastically different implementations, they - also have different performance characteristics, as - described below. - -

      - - The first invocation of this filter on a given field will - be slower, since a must be - created. Subsequent invocations using the same field - will re-use this cache. However, as with all - functionality based on , persistent RAM - is consumed to hold the cache, and is not freed until the - is closed. In contrast, TermsFilter - has no persistent RAM consumption. - - -

      - - With each search, this filter translates the specified - set of Terms into a private keyed by - term number per unique (normally one - reader per segment). Then, during matching, the term - number for each docID is retrieved from the cache and - then checked for inclusion using the . - Since all testing is done using RAM resident data - structures, performance should be very fast, most likely - fast enough to not require further caching of the - DocIdSet for each possible combination of terms. - However, because docIDs are simply scanned linearly, an - index with a great many small documents may find this - linear scan too costly. - -

      - - In contrast, TermsFilter builds up an , - keyed by docID, every time it's created, by enumerating - through all matching docs using to seek - and scan through each term's docID list. While there is - no linear scan of all docIDs, besides the allocation of - the underlying array in the , this - approach requires a number of "disk seeks" in proportion - to the number of terms, which can be exceptionally costly - when there are cache misses in the OS's IO cache. - -

      - - Generally, this filter will be slower on the first - invocation for a given field, but subsequent invocations, - even if you change the allowed set of Terms, should be - faster than TermsFilter, especially as the number of - Terms being matched increases. If you are matching only - a very small number of terms, and those terms in turn - match a very small number of documents, TermsFilter may - perform faster. - -

      - - Which filter is best is very application dependent. -

      -
      - - Abstract base class for restricting which documents may be returned during searching. -

      - Note: In Lucene 3.0 will be removed - and will be defined as abstract. - All implementing classes must therefore implement - in order to work with Lucene 3.0. -

      -
      - - NOTE: See for - handling of multi-segment indexes (which applies to - this method as well. - - A BitSet with true for documents which should be permitted in - search results, and false for those that should not. - - Use instead. - - - - - Creates a enumerating the documents that should be - permitted in search results. NOTE: null can be - returned if no documents are accepted by this Filter. -

      - Note: This method will be called once per segment in - the index during searching. The returned - must refer to document IDs for that segment, not for - the top-level reader. -

      - a DocIdSet that provides the documents which should be permitted or - prohibited in search results. NOTE: null can be returned if - no documents will be accepted by this Filter. - - - A instance opened on the index currently - searched on. Note, it is likely that the provided reader does not - represent the whole underlying index i.e. if the index has more than - one segment the given reader only represents a single segment. - - - -
      - - This DocIdSet implementation is cacheable. - - - use instead. - - - - use instead. - - - - use instead. - - - - Wraps another SpanFilter's result and caches it. The purpose is to allow - filters to simply filter, and then wrap with this class to add caching. - - - - Abstract base class providing a mechanism to restrict searches to a subset - of an index and also maintains and returns position information. - This is useful if you want to compare the positions from a SpanQuery with the positions of items in - a filter. For instance, if you had a SpanFilter that marked all the occurrences of the word "foo" in documents, - and then you entered a new SpanQuery containing bar, you could not only filter by the word foo, but you could - then compare position information for post processing. - - - - Returns a SpanFilterResult with true for documents which should be permitted in - search results, and false for those that should not and Spans for where the true docs match. - - The to load position and DocIdSet information from - - A - - java.io.IOException if there was an issue accessing the necessary information - - - - - A transient Filter cache. - - - - New deletions always result in a cache miss, by default - (. - Filter to cache results of - - - - - New deletions always result in a cache miss, specify the - Filter to cache results of - See - - - Use instead. - - - - Wraps another filter's result and caches it. The purpose is to allow - filters to simply filter, and then wrap with this class to add caching. - - - - - New deletes are ignored by default, which gives higher - cache hit rate on reopened readers. Most of the time - this is safe, because the filter will be AND'd with a - Query that fully enforces deletions. If instead you - need this filter to always enforce deletions, pass - either or - . - - Filter to cache results of - - - - - Expert: by default, the cached filter will be shared - across reopened segments that only had changes to their - deletions. - - Filter to cache results of - See - - - - Use instead. - - - - Provide the DocIdSet to be cached, using the DocIdSet provided - by the wrapped Filter. - This implementation returns the given DocIdSet. - - - - - Expert: Specifies how new deletions against a reopened - reader should be handled. - - The default is IGNORE, which means the cache entry - will be re-used for a given segment, even when that - segment has been reopened due to changes in deletions. - This is a big performance gain, especially with - near-real-timer readers, since you don't hit a cache - miss on every reopened reader for prior segments. - - However, in some cases this can cause invalid query - results, allowing deleted documents to be returned. - This only happens if the main query does not rule out - deleted documents on its own, such as a toplevel - ConstantScoreQuery. To fix this, use RECACHE to - re-create the cached filter (at a higher per-reopen - cost, but at faster subsequent search performance), or - use DYNAMIC to dynamically intersect deleted docs (fast - reopen time but some hit to search performance). - - - - A serializable Enum class. - - - Resolves the deserialized instance to the local reference for accurate - equals() and == comparisons. - - - a reference to Parameter as resolved in the local VM - - ObjectStreamException - - - A transient Filter cache (package private because of test) - - - Abstract decorator class for a DocIdSet implementation - that provides on-demand filtering/validation - mechanism on a given DocIdSet. - -

      - - Technically, this same functionality could be achieved - with ChainedFilter (under contrib/misc), however the - benefit of this class is it never materializes the full - bitset for the filter. Instead, the - method is invoked on-demand, per docID visited during - searching. If you know few docIDs will be visited, and - the logic behind is relatively costly, - this may be a better way to filter than ChainedFilter. - -

      - - -
      - - Constructor. - Underlying DocIdSet - - - - This DocIdSet implementation is cacheable if the inner set is cacheable. - - - Validation method to determine whether a docid should be in the result set. - docid to be tested - - true if input docid should be in the result set, false otherwise. - - - - Implementation of the contract to build a DocIdSetIterator. - - - - - - - Abstract decorator class of a DocIdSetIterator - implementation that provides on-demand filter/validation - mechanism on an underlying DocIdSetIterator. See - . - - - - Constructor. - Underlying DocIdSetIterator. - - - - Validation method to determine whether a docid should be in the result set. - docid to be tested - - true if input docid should be in the result set, false otherwise. - - - - - - use instead. - - - - use instead. - - - - use instead. - - - - An IndexWriter creates and maintains an index. -

      The create argument to the - constructor determines - whether a new index is created, or whether an existing index is - opened. Note that you can open an index with create=true - even while readers are using the index. The old readers will - continue to search the "point in time" snapshot they had opened, - and won't see the newly created index until they re-open. There are - also constructors - with no create argument which will create a new index - if there is not already an index at the provided path and otherwise - open the existing index.

      -

      In either case, documents are added with - and removed with or - . A document can be updated with - (which just deletes - and then adds the entire document). When finished adding, deleting - and updating documents, should be called.

      - -

      These changes are buffered in memory and periodically - flushed to the (during the above method - calls). A flush is triggered when there are enough - buffered deletes (see ) - or enough added documents since the last flush, whichever - is sooner. For the added documents, flushing is triggered - either by RAM usage of the documents (see - ) or the number of added documents. - The default is to flush when RAM usage hits 16 MB. For - best indexing speed you should flush by RAM usage with a - large RAM buffer. Note that flushing just moves the - internal buffered state in IndexWriter into the index, but - these changes are not visible to IndexReader until either - or is called. A flush may - also trigger one or more segment merges which by default - run with a background thread so as not to block the - addDocument calls (see below - for changing the ).

      - -

      The optional autoCommit argument to the - constructors - controls visibility of the changes to - instances reading the same index. When this is - false, changes are not visible until - or is called. Note that changes will still be - flushed to the as new files, but are - not committed (no new segments_N file is written - referencing the new files, nor are the files sync'd to stable storage) - until or is called. If something - goes terribly wrong (for example the JVM crashes), then - the index will reflect none of the changes made since the - last commit, or the starting state if commit was not called. - You can also call , which closes the writer - without committing any changes, and removes any index - files that had been flushed but are now unreferenced. - This mode is useful for preventing readers from refreshing - at a bad time (for example after you've done all your - deletes but before you've done your adds). It can also be - used to implement simple single-writer transactional - semantics ("all or none"). You can do a two-phase commit - by calling - followed by . This is necessary when - Lucene is working with an external resource (for example, - a database) and both must either commit or rollback the - transaction.

      -

      When autoCommit is true then - the writer will periodically commit on its own. [Deprecated: Note that in 3.0, IndexWriter will - no longer accept autoCommit=true (it will be hardwired to - false). You can always call yourself - when needed]. There is - no guarantee when exactly an auto commit will occur (it - used to be after every flush, but it is now after every - completed merge, as of 2.4). If you want to force a - commit, call , or, close the writer. Once - a commit has finished, newly opened instances will - see the changes to the index as of that commit. When - running in this mode, be careful not to refresh your - readers while optimize or segment merges are taking place - as this can tie up substantial disk space.

      -

      -

      Regardless of autoCommit, an - or will only see the - index as of the "point in time" that it was opened. Any - changes committed to the index after the reader was opened - are not visible until the reader is re-opened.

      -

      If an index will not have more documents added for a while and optimal search - performance is desired, then either the full - method or partial method should be - called before the index is closed.

      -

      Opening an IndexWriter creates a lock file for the directory in use. Trying to open - another IndexWriter on the same directory will lead to a - . The - is also thrown if an IndexReader on the same directory is used to delete documents - from the index.

      -

      - -

      Expert: IndexWriter allows an optional - implementation to be - specified. You can use this to control when prior commits - are deleted from the index. The default policy is - which removes all prior - commits as soon as a new commit is done (this matches - behavior before 2.2). Creating your own policy can allow - you to explicitly keep previous "point in time" commits - alive in the index for some time, to allow readers to - refresh to the new commit without having the old commit - deleted out from under them. This is necessary on - filesystems like NFS that do not support "delete on last - close" semantics, which Lucene's "point in time" search - normally relies on.

      -

      Expert: - IndexWriter allows you to separately change - the and the . - The is invoked whenever there are - changes to the segments in the index. Its role is to - select which merges to do, if any, and return a - describing the merges. It - also selects merges to do for optimize(). (The default is - . Then, the - is invoked with the requested merges and - it decides when and how to run the merges. The default is - .

      -

      NOTE: if you hit an - OutOfMemoryError then IndexWriter will quietly record this - fact and block all future segment commits. This is a - defensive measure in case any internal state (buffered - documents and deletions) were corrupted. Any subsequent - calls to will throw an - IllegalStateException. The only course of action is to - call , which internally will call - , to undo any changes to the index since the - last commit. If you opened the writer with autoCommit - false you can also just call - directly.

      -

      NOTE: - instances are completely thread - safe, meaning multiple threads can call any of its - methods, concurrently. If your application requires - external synchronization, you should not - synchronize on the IndexWriter instance as - this may cause deadlock; use your own (non-Lucene) objects - instead.

      -

      -
      - - Name of the write lock in the index. - - - Value to denote a flush trigger is disabled - - - Default value is 16 MB (which means flush when buffered - docs consume 16 MB RAM). Change using . - - - - Default value is 10,000. Change using . - - - Default value is 128. Change using . - - - Default value for the write lock timeout (1,000). - - - - - - - - - - - Disabled by default (because IndexWriter flushes by RAM usage - by default). Change using . - - - - Disabled by default (because IndexWriter flushes by RAM usage - by default). Change using . - - - - - - - - - - Absolute hard maximum length for a term. If a term - arrives from the analyzer longer than this length, it - is skipped and a message is printed to infoStream, if - set (see ). - - - - Default for . On - Windows this defaults to 10.0 seconds; elsewhere it's - 0. - - - - Expert: returns a readonly reader, covering all committed as well as - un-committed changes to the index. This provides "near real-time" - searching, in that changes made during an IndexWriter session can be - quickly made available for searching without closing the writer nor - calling . - -

      - Note that this is functionally equivalent to calling {#commit} and then - using to open a new reader. But the turarnound - time of this method should be faster since it avoids the potentially - costly . -

      - - You must close the returned by this method once you are done using it. - -

      - It's near real-time because there is no hard - guarantee on how quickly you can get a new reader after - making changes with IndexWriter. You'll have to - experiment in your situation to determine if it's - faster enough. As this is a new and experimental - feature, please report back on your findings so we can - learn, improve and iterate.

      - -

      The resulting reader suppports - , but that call will simply forward - back to this method (though this may change in the - future).

      - -

      The very first time this method is called, this - writer instance will make every effort to pool the - readers that it opens for doing merges, applying - deletes, etc. This means additional resources (RAM, - file descriptors, CPU time) will be consumed.

      - -

      For lower latency on reopening a reader, you should call - to call to - pre-warm a newly merged segment before it's committed - to the index. This is important for minimizing index-to-search - delay after a large merge. - -

      If an addIndexes* call is running in another thread, - then this reader will only search those segments from - the foreign index that have been successfully copied - over, so far

      . - -

      NOTE: Once the writer is closed, any - outstanding readers may continue to be used. However, - if you attempt to reopen any of those readers, you'll - hit an .

      - -

      NOTE: This API is experimental and might - change in incompatible ways in the next release.

      - -

      - IndexReader that covers entire index plus all - changes made so far by this IndexWriter instance - - - IOException -
      - - Expert: like , except you can - specify which termInfosIndexDivisor should be used for - any newly opened readers. - - Subsambles which indexed - terms are loaded into RAM. This has the same effect as - except that setting - must be done at indexing time while this setting can be - set per reader. When set to N, then one in every - N*termIndexInterval terms in the index is loaded into - memory. By setting this to a value > 1 you can reduce - memory usage, at the expense of higher latency when - loading a TermInfo. The default value is 1. Set this - to -1 to skip loading the terms index entirely. - - - - Obtain the number of deleted docs for a pooled reader. - If the reader isn't being pooled, the segmentInfo's - delCount is returned. - - - - Used internally to throw an - if this IndexWriter has been - closed. - - AlreadyClosedException if this IndexWriter is - - - Prints a message to the infoStream (if non-null), - prefixed with the identifying information for this - writer and the thread that's calling it. - - - - Casts current mergePolicy to LogMergePolicy, and throws - an exception if the mergePolicy is not a LogMergePolicy. - - - -

      Get the current setting of whether newly flushed - segments will use the compound file format. Note that - this just returns the value previously set with - setUseCompoundFile(boolean), or the default value - (true). You cannot use this to query the status of - previously flushed segments.

      - -

      Note that this method is a convenience method: it - just calls mergePolicy.getUseCompoundFile as long as - mergePolicy is an instance of . - Otherwise an IllegalArgumentException is thrown.

      - -

      - - -
      - -

      Setting to turn on usage of a compound file. When on, - multiple files for each segment are merged into a - single file when a new segment is flushed.

      - -

      Note that this method is a convenience method: it - just calls mergePolicy.setUseCompoundFile as long as - mergePolicy is an instance of . - Otherwise an IllegalArgumentException is thrown.

      -

      -
      - - Expert: Set the Similarity implementation used by this IndexWriter. - - - - - - - Expert: Return the Similarity implementation used by this IndexWriter. - -

      This defaults to the current value of . -

      -
      - - Expert: Set the interval between indexed terms. Large values cause less - memory to be used by IndexReader, but slow random-access to terms. Small - values cause more memory to be used by an IndexReader, and speed - random-access to terms. - - This parameter determines the amount of computation required per query - term, regardless of the number of documents that contain that term. In - particular, it is the maximum number of other terms that must be - scanned before a term is located and its frequency and position information - may be processed. In a large index with user-entered query terms, query - processing time is likely to be dominated not by term lookup but rather - by the processing of frequency and positional data. In a small index - or when many uncommon query terms are generated (e.g., by wildcard - queries) term lookup may become a dominant cost. - - In particular, numUniqueTerms/interval terms are read into - memory by an IndexReader, and, on average, interval/2 terms - must be scanned for each random term access. - - - - - - - Expert: Return the interval between indexed terms. - - - - - - - Constructs an IndexWriter for the index in path. - Text will be analyzed with a. If create - is true, then a new, empty index will be created in - path, replacing the index already there, - if any. - -

      NOTE: autoCommit (see above) is set to false with this - constructor. - -

      - the path to the index directory - - the analyzer to use - - true to create the index or overwrite - the existing one; false to append to the existing - index - - Maximum field length in number of tokens/terms: LIMITED, UNLIMITED, or user-specified - via the MaxFieldLength constructor. - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - - Use - -
      - - Constructs an IndexWriter for the index in path. - Text will be analyzed with a. If create - is true, then a new, empty index will be created in - path, replacing the index already there, if any. - - - the path to the index directory - - the analyzer to use - - true to create the index or overwrite - the existing one; false to append to the existing - index - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - - This constructor will be removed in the 3.0 release. - Use - - instead, and call when needed. - - - - Constructs an IndexWriter for the index in path. - Text will be analyzed with a. If create - is true, then a new, empty index will be created in - path, replacing the index already there, if any. - -

      NOTE: autoCommit (see above) is set to false with this - constructor. - -

      - the path to the index directory - - the analyzer to use - - true to create the index or overwrite - the existing one; false to append to the existing - index - - Maximum field length in number of terms/tokens: LIMITED, UNLIMITED, or user-specified - via the MaxFieldLength constructor. - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - - Use - -
      - - Constructs an IndexWriter for the index in path. - Text will be analyzed with a. If create - is true, then a new, empty index will be created in - path, replacing the index already there, if any. - - - the path to the index directory - - the analyzer to use - - true to create the index or overwrite - the existing one; false to append to the existing - index - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - - This constructor will be removed in the 3.0 release. - Use - - instead, and call when needed. - - - - Constructs an IndexWriter for the index in d. - Text will be analyzed with a. If create - is true, then a new, empty index will be created in - d, replacing the index already there, if any. - -

      NOTE: autoCommit (see above) is set to false with this - constructor. - -

      - the index directory - - the analyzer to use - - true to create the index or overwrite - the existing one; false to append to the existing - index - - Maximum field length in number of terms/tokens: LIMITED, UNLIMITED, or user-specified - via the MaxFieldLength constructor. - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - -
      - - Constructs an IndexWriter for the index in d. - Text will be analyzed with a. If create - is true, then a new, empty index will be created in - d, replacing the index already there, if any. - - - the index directory - - the analyzer to use - - true to create the index or overwrite - the existing one; false to append to the existing - index - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - - This constructor will be removed in the 3.0 - release, and call when needed. - Use instead. - - - - Constructs an IndexWriter for the index in - path, first creating it if it does not - already exist. Text will be analyzed with - a. - -

      NOTE: autoCommit (see above) is set to false with this - constructor. - -

      - the path to the index directory - - the analyzer to use - - Maximum field length in number of terms/tokens: LIMITED, UNLIMITED, or user-specified - via the MaxFieldLength constructor. - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be - read/written to or if there is any other low-level - IO error - - Use - -
      - - Constructs an IndexWriter for the index in - path, first creating it if it does not - already exist. Text will be analyzed with - a. - - - the path to the index directory - - the analyzer to use - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be - read/written to or if there is any other low-level - IO error - - This constructor will be removed in the 3.0 - release, and call when needed. - Use instead. - - - - Constructs an IndexWriter for the index in - path, first creating it if it does not - already exist. Text will be analyzed with - a. - -

      NOTE: autoCommit (see above) is set to false with this - constructor. - -

      - the path to the index directory - - the analyzer to use - - Maximum field length in number of terms/tokens: LIMITED, UNLIMITED, or user-specified - via the MaxFieldLength constructor. - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be - read/written to or if there is any other low-level - IO error - - Use - -
      - - Constructs an IndexWriter for the index in - path, first creating it if it does not - already exist. Text will be analyzed with - a. - - - the path to the index directory - - the analyzer to use - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be - read/written to or if there is any other low-level - IO error - - This constructor will be removed in the 3.0 release. - Use - instead, and call when needed. - - - - Constructs an IndexWriter for the index in - d, first creating it if it does not - already exist. Text will be analyzed with - a. - -

      NOTE: autoCommit (see above) is set to false with this - constructor. - -

      - the index directory - - the analyzer to use - - Maximum field length in number of terms/tokens: LIMITED, UNLIMITED, or user-specified - via the MaxFieldLength constructor. - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be - read/written to or if there is any other low-level - IO error - -
      - - Constructs an IndexWriter for the index in - d, first creating it if it does not - already exist. Text will be analyzed with - a. - - - the index directory - - the analyzer to use - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be - read/written to or if there is any other low-level - IO error - - This constructor will be removed in the 3.0 release. - Use - - instead, and call when needed. - - - - Constructs an IndexWriter for the index in - d, first creating it if it does not - already exist. Text will be analyzed with - a. - - - the index directory - - see above - - the analyzer to use - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be - read/written to or if there is any other low-level - IO error - - This constructor will be removed in the 3.0 release. - Use - - instead, and call when needed. - - - - Constructs an IndexWriter for the index in d. - Text will be analyzed with a. If create - is true, then a new, empty index will be created in - d, replacing the index already there, if any. - - - the index directory - - see above - - the analyzer to use - - true to create the index or overwrite - the existing one; false to append to the existing - index - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - - This constructor will be removed in the 3.0 release. - Use - - instead, and call when needed. - - - - Expert: constructs an IndexWriter with a custom - , for the index in d, - first creating it if it does not already exist. Text - will be analyzed with a. - -

      NOTE: autoCommit (see above) is set to false with this - constructor. - -

      - the index directory - - the analyzer to use - - see above - - whether or not to limit field lengths - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be - read/written to or if there is any other low-level - IO error - -
      - - Expert: constructs an IndexWriter with a custom - , for the index in d, - first creating it if it does not already exist. Text - will be analyzed with a. - - - the index directory - - see above - - the analyzer to use - - see above - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be - read/written to or if there is any other low-level - IO error - - This constructor will be removed in the 3.0 release. - Use - - instead, and call when needed. - - - - Expert: constructs an IndexWriter with a custom - , for the index in d. - Text will be analyzed with a. If - create is true, then a new, empty index - will be created in d, replacing the index - already there, if any. - -

      NOTE: autoCommit (see above) is set to false with this - constructor. - -

      - the index directory - - the analyzer to use - - true to create the index or overwrite - the existing one; false to append to the existing - index - - see above - - , whether or not to limit field lengths. Value is in number of terms/tokens - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - -
      - - Expert: constructs an IndexWriter with a custom - and , - for the index in d. - Text will be analyzed with a. If - create is true, then a new, empty index - will be created in d, replacing the index - already there, if any. - -

      NOTE: autoCommit (see above) is set to false with this - constructor. - -

      - the index directory - - the analyzer to use - - true to create the index or overwrite - the existing one; false to append to the existing - index - - see above - - whether or not to limit field lengths, value is in number of terms/tokens. See . - - the chain to be used to - process documents - - which commit to open - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - -
      - - Expert: constructs an IndexWriter with a custom - , for the index in d. - Text will be analyzed with a. If - create is true, then a new, empty index - will be created in d, replacing the index - already there, if any. - - - the index directory - - see above - - the analyzer to use - - true to create the index or overwrite - the existing one; false to append to the existing - index - - see above - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - - This constructor will be removed in the 3.0 release. - Use - - instead, and call when needed. - - - - Expert: constructs an IndexWriter on specific commit - point, with a custom , for - the index in d. Text will be analyzed - with a. - -

      This is only meaningful if you've used a - in that past that keeps more than - just the last commit. - -

      This operation is similar to , - except that method can only rollback what's been done - with the current instance of IndexWriter since its last - commit, whereas this method can rollback to an - arbitrary commit point from the past, assuming the - has preserved past - commits. - -

      NOTE: autoCommit (see above) is set to false with this - constructor. - -

      - the index directory - - the analyzer to use - - see above - - whether or not to limit field lengths, value is in number of terms/tokens. See . - - which commit to open - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - -
      - - Expert: set the merge policy used by this writer. - - - Expert: returns the current MergePolicy in use by this writer. - - - - - Expert: set the merge scheduler used by this writer. - - - Expert: returns the current MergePolicy in use by this - writer. - - - - - -

      Determines the largest segment (measured by - document count) that may be merged with other segments. - Small values (e.g., less than 10,000) are best for - interactive indexing, as this limits the length of - pauses while indexing to a few seconds. Larger values - are best for batched indexing and speedier - searches.

      - -

      The default value is .

      - -

      Note that this method is a convenience method: it - just calls mergePolicy.setMaxMergeDocs as long as - mergePolicy is an instance of . - Otherwise an IllegalArgumentException is thrown.

      - -

      The default merge policy () - also allows you to set this - limit by net size (in MB) of the segment, using - .

      -

      -
      - -

      Returns the largest segment (measured by document - count) that may be merged with other segments.

      - -

      Note that this method is a convenience method: it - just calls mergePolicy.getMaxMergeDocs as long as - mergePolicy is an instance of . - Otherwise an IllegalArgumentException is thrown.

      - -

      - - -
      - - The maximum number of terms that will be indexed for a single field in a - document. This limits the amount of memory required for indexing, so that - collections with very large files will not crash the indexing process by - running out of memory. This setting refers to the number of running terms, - not to the number of different terms.

      - Note: this silently truncates large documents, excluding from the - index all terms that occur further in the document. If you know your source - documents are large, be sure to set this value high enough to accomodate - the expected size. If you set it to Integer.MAX_VALUE, then the only limit - is your memory, but you should anticipate an OutOfMemoryError.

      - By default, no more than terms - will be indexed for a field. -

      -
      - - Returns the maximum number of terms that will be - indexed for a single field in a document. - - - - - - Sets the termsIndexDivisor passed to any readers that - IndexWriter opens, for example when applying deletes - or creating a near-real-time reader in - . Default value is - . - - - - - - - - Determines the minimal number of documents required - before the buffered in-memory documents are flushed as - a new Segment. Large values generally gives faster - indexing. - -

      When this is set, the writer will flush every - maxBufferedDocs added documents. Pass in - to prevent triggering a flush due - to number of buffered documents. Note that if flushing - by RAM usage is also enabled, then the flush will be - triggered by whichever comes first.

      - -

      Disabled by default (writer flushes by RAM usage).

      - -

      - IllegalArgumentException if maxBufferedDocs is - enabled but smaller than 2, or it disables maxBufferedDocs - when ramBufferSize is already disabled - - - -
      - - If we are flushing by doc count (not by RAM usage), and - using LogDocMergePolicy then push maxBufferedDocs down - as its minMergeDocs, to keep backwards compatibility. - - - - Returns the number of buffered added documents that will - trigger a flush if enabled. - - - - - - Determines the amount of RAM that may be used for - buffering added documents and deletions before they are - flushed to the Directory. Generally for faster - indexing performance it's best to flush by RAM usage - instead of document count and use as large a RAM buffer - as you can. - -

      When this is set, the writer will flush whenever - buffered documents and deletions use this much RAM. - Pass in to prevent - triggering a flush due to RAM usage. Note that if - flushing by document count is also enabled, then the - flush will be triggered by whichever comes first.

      - -

      NOTE: the account of RAM usage for pending - deletions is only approximate. Specifically, if you - delete by Query, Lucene currently has no way to measure - the RAM usage if individual Queries so the accounting - will under-estimate and you should compensate by either - calling commit() periodically yourself, or by using - to flush by count - instead of RAM usage (each buffered delete Query counts - as one). - -

      - NOTE: because IndexWriter uses ints when managing its - internal storage, the absolute maximum value for this setting is somewhat - less than 2048 MB. The precise limit depends on various factors, such as - how large your documents are, how many fields have norms, etc., so it's - best to set this value comfortably under 2048. -

      - -

      The default value is .

      - -

      - IllegalArgumentException if ramBufferSize is - enabled but non-positive, or it disables ramBufferSize - when maxBufferedDocs is already disabled - -
      - - Returns the value set by if enabled. - - -

      Determines the minimal number of delete terms required before the buffered - in-memory delete terms are applied and flushed. If there are documents - buffered in memory at the time, they are merged and a new segment is - created.

      -

      Disabled by default (writer flushes by RAM usage).

      - -

      - IllegalArgumentException if maxBufferedDeleteTerms - is enabled but smaller than 1 - - - -
      - - Returns the number of buffered deleted terms that will - trigger a flush if enabled. - - - - - - Determines how often segment indices are merged by addDocument(). With - smaller values, less RAM is used while indexing, and searches on - unoptimized indices are faster, but indexing speed is slower. With larger - values, more RAM is used during indexing, and while searches on unoptimized - indices are slower, indexing is faster. Thus larger values (> 10) are best - for batch index creation, and smaller values (< 10) for indices that are - interactively maintained. - -

      Note that this method is a convenience method: it - just calls mergePolicy.setMergeFactor as long as - mergePolicy is an instance of . - Otherwise an IllegalArgumentException is thrown.

      - -

      This must never be less than 2. The default value is 10. -

      -
      - -

      Returns the number of segments that are merged at - once and also controls the total number of segments - allowed to accumulate in the index.

      - -

      Note that this method is a convenience method: it - just calls mergePolicy.getMergeFactor as long as - mergePolicy is an instance of . - Otherwise an IllegalArgumentException is thrown.

      - -

      - - -
      - - Expert: returns max delay inserted before syncing a - commit point. On Windows, at least, pausing before - syncing can increase net indexing throughput. The - delay is variable based on size of the segment's files, - and is only inserted when using - ConcurrentMergeScheduler for merges. - - This will be removed in 3.0, when - autoCommit=true is removed from IndexWriter. - - - - Expert: sets the max delay before syncing a commit - point. - - - - This will be removed in 3.0, when - autoCommit=true is removed from IndexWriter. - - - - If non-null, this will be the default infoStream used - by a newly instantiated IndexWriter. - - - - - - Returns the current default infoStream for newly - instantiated IndexWriters. - - - - - - If non-null, information about merges, deletes and a - message when maxFieldLength is reached will be printed - to this. - - - - Returns the current infoStream in use by this writer. - - - - - Returns true if verbosing is enabled (i.e., infoStream != null). - - - to change the default value for all instances of IndexWriter. - - - - Returns allowed timeout when acquiring the write lock. - - - - - Sets the default (for any instance of IndexWriter) maximum time to wait for a write lock (in - milliseconds). - - - - Returns default write lock timeout for newly - instantiated IndexWriters. - - - - - - Commits all changes to an index and closes all - associated files. Note that this may be a costly - operation, so, try to re-use a single writer instead of - closing and opening a new one. See for - caveats about write caching done by some IO devices. - -

      If an Exception is hit during close, eg due to disk - full or some other reason, then both the on-disk index - and the internal state of the IndexWriter instance will - be consistent. However, the close will not be complete - even though part of it (flushing buffered documents) - may have succeeded, so the write lock will still be - held.

      - -

      If you can correct the underlying cause (eg free up - some disk space) then you can call close() again. - Failing that, if you want to force the write lock to be - released (dangerous, because you may then lose buffered - docs in the IndexWriter instance) then you can do - something like this:

      - - - try { - writer.close(); - } finally { - if (IndexWriter.isLocked(directory)) { - IndexWriter.unlock(directory); - } - } - - - after which, you must be certain not to use the writer - instance anymore.

      - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer, again. See above for details.

      - -

      - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
      - - - .NET - - - - Closes the index with or without waiting for currently - running merges to finish. This is only meaningful when - using a MergeScheduler that runs merges in background - threads. - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer, again. See above for details.

      - -

      NOTE: it is dangerous to always call - close(false), especially when IndexWriter is not open - for very long, because this can result in "merge - starvation" whereby long merges will never have a - chance to finish. This will cause too many segments in - your index over time.

      - -

      - if true, this call will block - until all merges complete; else, it will ask all - running merges to abort, wait until those merges have - finished (which should be at most a few seconds), and - then return. - -
      - - Tells the docWriter to close its currently open shared - doc stores (stored fields & vectors files). - Return value specifices whether new doc store files are compound or not. - - - - Returns the Directory used by this index. - - - Returns the analyzer used by this index. - - - Returns the number of documents currently in this - index, not counting deletions. - - Please use (same as this - method) or (also takes deletions - into account), instead. - - - - Returns total number of docs in this index, including - docs not yet flushed (still in the RAM buffer), - not counting deletions. - - - - - - Returns total number of docs in this index, including - docs not yet flushed (still in the RAM buffer), and - including deletions. NOTE: buffered deletions - are not counted. If you really need these to be - counted you should call first. - - - - - - The maximum number of terms that will be indexed for a single field in a - document. This limits the amount of memory required for indexing, so that - collections with very large files will not crash the indexing process by - running out of memory.

      - Note that this effectively truncates large documents, excluding from the - index terms that occur further in the document. If you know your source - documents are large, be sure to set this value high enough to accomodate - the expected size. If you set it to Integer.MAX_VALUE, then the only limit - is your memory, but you should anticipate an OutOfMemoryError.

      - By default, no more than 10,000 terms will be indexed for a field. - -

      - - -
      - - Adds a document to this index. If the document contains more than - terms for a given field, the remainder are - discarded. - -

      Note that if an Exception is hit (for example disk full) - then the index will be consistent, but this document - may not have been added. Furthermore, it's possible - the index will have one segment in non-compound format - even when using compound files (when a merge has - partially succeeded).

      - -

      This method periodically flushes pending documents - to the Directory (see above), and - also periodically triggers segment merges in the index - according to the in use.

      - -

      Merges temporarily consume space in the - directory. The amount of space required is up to 1X the - size of all segments being merged, when no - readers/searchers are open against the index, and up to - 2X the size of all segments being merged when - readers/searchers are open against the index (see - for details). The sequence of - primitive merge operations performed is governed by the - merge policy. - -

      Note that each term in the document can be no longer - than 16383 characters, otherwise an - IllegalArgumentException will be thrown.

      - -

      Note that it's possible to create an invalid Unicode - string in java if a UTF16 surrogate pair is malformed. - In this case, the invalid characters are silently - replaced with the Unicode replacement character - U+FFFD.

      - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      - -

      - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
      - - Adds a document to this index, using the provided analyzer instead of the - value of . If the document contains more than - terms for a given field, the remainder are - discarded. - -

      See for details on - index and IndexWriter state after an Exception, and - flushing/merging temporary free space requirements.

      - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      - -

      - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
      - - Deletes the document(s) containing term. - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      - -

      - the term to identify the documents to be deleted - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
      - - Deletes the document(s) containing any of the - terms. All deletes are flushed at the same time. - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      - -

      - array of terms to identify the documents - to be deleted - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
      - - Deletes the document(s) matching the provided query. - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      - -

      - the query to identify the documents to be deleted - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
      - - Deletes the document(s) matching any of the provided queries. - All deletes are flushed at the same time. - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      - -

      - array of queries to identify the documents - to be deleted - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
      - - Updates a document by first deleting the document(s) - containing term and then adding the new - document. The delete and then add are atomic as seen - by a reader on the same index (flush may happen only after - the add). - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      - -

      - the term to identify the document(s) to be - deleted - - the document to be added - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
      - - Updates a document by first deleting the document(s) - containing term and then adding the new - document. The delete and then add are atomic as seen - by a reader on the same index (flush may happen only after - the add). - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      - -

      - the term to identify the document(s) to be - deleted - - the document to be added - - the analyzer to use when analyzing the document - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
      - - If non-null, information about merges will be printed to this. - - - Requests an "optimize" operation on an index, priming the index - for the fastest available search. Traditionally this has meant - merging all segments into a single segment as is done in the - default merge policy, but individaul merge policies may implement - optimize in different ways. - -

      It is recommended that this method be called upon completion of indexing. In - environments with frequent updates, optimize is best done during low volume times, if at all. - -

      -

      See http://www.gossamer-threads.com/lists/lucene/java-dev/47895 for more discussion.

      - -

      Note that optimize requires 2X the index size free - space in your Directory (3X if you're using compound - file format). For example, if your index - size is 10 MB then you need 20 MB free for optimize to - complete (30 MB if you're using compound fiel format).

      - -

      If some but not all readers re-open while an - optimize is underway, this will cause > 2X temporary - space to be consumed as those new readers will then - hold open the partially optimized segments at that - time. It is best not to re-open readers while optimize - is running.

      - -

      The actual temporary usage could be much less than - these figures (it depends on many factors).

      - -

      In general, once the optimize completes, the total size of the - index will be less than the size of the starting index. - It could be quite a bit smaller (if there were many - pending deletes) or just slightly smaller.

      - -

      If an Exception is hit during optimize(), for example - due to disk full, the index will not be corrupt and no - documents will have been lost. However, it may have - been partially optimized (some segments were merged but - not all), and it's possible that one of the segments in - the index will be in non-compound format even when - using compound file format. This will occur when the - Exception is hit during conversion of the segment into - compound format.

      - -

      This call will optimize those segments present in - the index when the call started. If other threads are - still adding documents and flushing segments, those - newly created segments will not be optimized unless you - call optimize again.

      - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      - -

      - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - -
      - - Optimize the index down to <= maxNumSegments. If - maxNumSegments==1 then this is the same as - . - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      - -

      - maximum number of segments left - in the index after optimization finishes - -
      - - Just like , except you can specify - whether the call should block until the optimize - completes. This is only meaningful with a - that is able to run merges in - background threads. - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      -

      -
      - - Just like , except you can - specify whether the call should block until the - optimize completes. This is only meaningful with a - that is able to run merges in - background threads. - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      -

      -
      - - Returns true if any merges in pendingMerges or - runningMerges are optimization merges. - - - - Just like , except you can - specify whether the call should block until the - operation completes. This is only meaningful with a - that is able to run merges in - background threads. - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      -

      -
      - - Expunges all deletes from the index. When an index - has many document deletions (or updates to existing - documents), it's best to either call optimize or - expungeDeletes to remove all unused data in the index - associated with the deleted documents. To see how - many deletions you have pending in your index, call - - This saves disk space and memory usage while - searching. expungeDeletes should be somewhat faster - than optimize since it does not insist on reducing the - index to a single segment (though, this depends on the - ; see .). Note that - this call does not first commit any buffered - documents, so you must do so yourself if necessary. - See also - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      -

      -
      - - Expert: asks the mergePolicy whether any merges are - necessary now and if so, runs the requested merges and - then iterate (test again if merges are needed) until no - more merges are returned by the mergePolicy. - - Explicit calls to maybeMerge() are usually not - necessary. The most common case is when merge policy - parameters have changed. - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      -

      -
      - - Expert: the calls this method - to retrieve the next merge requested by the - MergePolicy - - - - Like getNextMerge() except only returns a merge if it's - external. - - - - Please use instead. - - - - Close the IndexWriter without committing - any changes that have occurred since the last commit - (or since it was opened, if commit hasn't been called). - This removes any temporary files that had been created, - after which the state of the index will be the same as - it was when commit() was last called or when this - writer was first opened. This can only be called when - this IndexWriter was opened with - autoCommit=false. This also clears a - previous call to . - - IllegalStateException if this is called when - the writer was opened with autoCommit=true. - - IOException if there is a low-level IO error - - - Delete all documents in the index. - -

      This method will drop all buffered documents and will - remove all segments from the index. This change will not be - visible until a has been called. This method - can be rolled back using .

      - -

      NOTE: this method is much faster than using deleteDocuments( new MatchAllDocsQuery() ).

      - -

      NOTE: this method will forcefully abort all merges - in progress. If other threads are running - or any of the addIndexes methods, they - will receive s. -

      -
      - - Wait for any currently outstanding merges to finish. - -

      It is guaranteed that any merges started prior to calling this method - will have completed once this method completes.

      -

      -
      - - Merges all segments from an array of indexes into this index. - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      - -

      - Use instead, - then separately call afterwards if - you need to. - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
      - - Merges all segments from an array of indexes into this - index. - -

      This may be used to parallelize batch indexing. A large document - collection can be broken into sub-collections. Each sub-collection can be - indexed in parallel, on a different thread, process or machine. The - complete index can then be created by merging sub-collection indexes - with this method. - -

      NOTE: the index in each Directory must not be - changed (opened by a writer) while this method is - running. This method does not acquire a write lock in - each input Directory, so it is up to the caller to - enforce this. - -

      NOTE: while this is running, any attempts to - add or delete documents (with another thread) will be - paused until this method completes. - -

      This method is transactional in how Exceptions are - handled: it does not commit a new segments_N file until - all indexes are added. This means if an Exception - occurs (for example disk full), then either no indexes - will have been added or they all will have been.

      - -

      Note that this requires temporary free space in the - Directory up to 2X the sum of all input indexes - (including the starting index). If readers/searchers - are open against the starting index, then temporary - free space required will be higher by the size of the - starting index (see for details). -

      - -

      Once this completes, the final size of the index - will be less than the sum of all input index sizes - (including the starting index). It could be quite a - bit smaller (if there were many pending deletes) or - just slightly smaller.

      - -

      - This requires this index not be among those to be added. - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      - -

      - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
      - - Merges the provided indexes into this index. -

      After this completes, the index is optimized.

      -

      The provided IndexReaders are not closed.

      - -

      NOTE: while this is running, any attempts to - add or delete documents (with another thread) will be - paused until this method completes. - -

      See for - details on transactional semantics, temporary free - space required in the Directory, and non-CFS segments - on an Exception.

      - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      - -

      - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
      - - - A hook for extending classes to execute operations after pending added and - deleted documents have been flushed to the Directory but before the change - is committed (new segments_N file written). - - - - Flush all in-memory buffered updates (adds and deletes) - to the Directory. -

      Note: while this will force buffered docs to be - pushed into the index, it will not make these docs - visible to a reader. Use instead - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      - -

      - please call ) instead - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
      - - - A hook for extending classes to execute operations before pending added and - deleted documents are flushed to the Directory. - - - - Expert: prepare for commit. - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      - -

      - - -
      - -

      Expert: prepare for commit, specifying - commitUserData Map (String -> String). This does the - first phase of 2-phase commit. You can only call this - when autoCommit is false. This method does all steps - necessary to commit changes since this writer was - opened: flushes pending added and deleted docs, syncs - the index files, writes most of next segments_N file. - After calling this you must call either - to finish the commit, or - to revert the commit and undo all changes - done since the writer was opened.

      - - You can also just call directly - without prepareCommit first in which case that method - will internally call prepareCommit. - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      - -

      - Opaque Map (String->String) - that's recorded into the segments file in the index, - and retrievable by - . Note that when - IndexWriter commits itself, for example if open with - autoCommit=true, or, during , the - commitUserData is unchanged (just carried over from - the prior commit). If this is null then the previous - commitUserData is kept. Also, the commitUserData will - only "stick" if there are actually changes in the - index to commit. Therefore it's best to use this - feature only when autoCommit is false. - -
      - -

      Commits all pending changes (added & deleted - documents, optimizations, segment merges, added - indexes, etc.) to the index, and syncs all referenced - index files, such that a reader will see the changes - and the index updates will survive an OS or machine - crash or power loss. Note that this does not wait for - any running background merges to finish. This may be a - costly operation, so you should test the cost in your - application and do it only when really necessary.

      - -

      Note that this operation calls Directory.sync on - the index files. That call should not return until the - file contents & metadata are on stable storage. For - FSDirectory, this calls the OS's fsync. But, beware: - some hardware devices may in fact cache writes even - during fsync, and return before the bits are actually - on stable storage, to give the appearance of faster - performance. If you have such a device, and it does - not have a battery backup (for example) then on power - loss it may still lose data. Lucene cannot guarantee - consistency on such devices.

      - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      - -

      - - - - -
      - - Commits all changes to the index, specifying a - commitUserData Map (String -> String). This just - calls (if you didn't - already call it) and then . - -

      NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

      -

      -
      - - Flush all in-memory buffered udpates (adds and deletes) - to the Directory. - - if true, we may merge segments (if - deletes or docs were flushed) if necessary - - if false we are allowed to keep - doc stores open to share with the next segment - - whether pending deletes should also - be flushed - - - - Expert: Return the total size of all index files currently cached in memory. - Useful for size management with flushRamDocs() - - - - Expert: Return the number of documents currently - buffered in RAM. - - - - Carefully merges deletes for the segments we just - merged. This is tricky because, although merging will - clear all deletes (compacts the documents), new - deletes may have been flushed to the segments since - the merge was started. This method "carries over" - such new deletes onto the newly merged segment, and - saves the resulting deletes file (incrementing the - delete generation for merge.info). If no deletes were - flushed, no new deletes file is saved. - - - - Merges the indicated segments, replacing them in the stack with a - single segment. - - - - Hook that's called when the specified merge is complete. - - - Checks whether this merge involves any segments - already participating in a merge. If not, this merge - is "registered", meaning we record that its segments - are now participating in a merge, and true is - returned. Else (the merge conflicts) false is - returned. - - - - Does initial setup for a merge, which is fast but holds - the synchronized lock on IndexWriter instance. - - - - This is called after merging a segment and before - building its CFS. Return true if the files should be - sync'd. If you return false, then the source segment - files that were merged cannot be deleted until the CFS - file is built & sync'd. So, returning false consumes - more transient disk space, but saves performance of - not having to sync files which will shortly be deleted - anyway. - - -- this will be removed in 3.0 when - autoCommit is hardwired to false - - - - Does fininishing for a merge, which is fast but holds - the synchronized lock on IndexWriter instance. - - - - Does the actual (time-consuming) work of the merge, - but without holding synchronized lock on IndexWriter - instance - - - - Blocks until all files in syncing are sync'd - - - Pauses before syncing. On Windows, at least, it's - best (performance-wise) to pause in order to let OS - flush writes to disk on its own, before forcing a - sync. - - -- this will be removed in 3.0 when - autoCommit is hardwired to false - - - - Walk through all files referenced by the current - segmentInfos and ask the Directory to sync each file, - if it wasn't already. If that succeeds, then we - prepare a new segments_N file but do not fully commit - it. - - - - Returns true iff the index in the named directory is - currently locked. - - the directory to check for a lock - - IOException if there is a low-level IO error - - - Returns true iff the index in the named directory is - currently locked. - - the directory to check for a lock - - IOException if there is a low-level IO error - Use - - - - Forcibly unlocks the index in the named directory. -

      - Caution: this should only be used by failure recovery code, - when it is known that no other process nor thread is in fact - currently accessing this index. -

      -
      - - Set the merged segment warmer. See - . - - - - Returns the current merged segment warmer. See - . - - - - Deprecated: emulates IndexWriter's buggy behavior when - first token(s) have positionIncrement==0 (ie, prior to - fixing LUCENE-1542) - - - - Holds shared SegmentReader instances. IndexWriter uses - SegmentReaders for 1) applying deletes, 2) doing - merges, 3) handing out a real-time reader. This pool - reuses instances of the SegmentReaders in all these - places if it is in "near real-time mode" (getReader() - has been called on this instance). - - - - Forcefully clear changes for the specifed segments, - and remove from the pool. This is called on succesful merge. - - - - Release the segment reader (i.e. decRef it and close if there - are no more references. - - - - IOException - - - Release the segment reader (i.e. decRef it and close if there - are no more references. - - - - - IOException - - - Remove all our references to readers, and commits - any pending changes. - - - - Commit all segment reader in the pool. - IOException - - - Returns a ref to a clone. NOTE: this clone is not - enrolled in the pool, so you should simply close() - it when you're done (ie, do not call release()). - - - - Obtain a SegmentReader from the readerPool. The reader - must be returned by calling - - - - - - - - IOException - - - Obtain a SegmentReader from the readerPool. The reader - must be returned by calling - - - - - - - - - - - - - IOException - - - Specifies maximum field length (in number of tokens/terms) in constructors. - overrides the value set by - the constructor. - - - - Private type-safe-enum-pattern constructor. - - - instance name - - maximum field length - - - - Public constructor to allow users to specify the maximum field size limit. - - - The maximum field length - - - - Sets the maximum field length to . - - - Sets the maximum field length to - - - - - - If has been called (ie, this writer - is in near real-time mode), then after a merge - completes, this class can be invoked to warm the - reader on the newly merged segment, before the merge - commits. This is not required for near real-time - search, but will reduce search latency on opening a - new near real-time reader after a merge completes. - -

      NOTE: This API is experimental and might - change in incompatible ways in the next release.

      - -

      NOTE: warm is called before any deletes have - been carried over to the merged segment. -

      -
      - - IndexReader is an abstract class, providing an interface for accessing an - index. Search of an index is done entirely through this abstract interface, - so that any subclass which implements it is searchable. -

      Concrete subclasses of IndexReader are usually constructed with a call to - one of the static open() methods, e.g. - . -

      For efficiency, in this API documents are often referred to via - document numbers, non-negative integers which each name a unique - document in the index. These document numbers are ephemeral--they may change - as documents are added to and deleted from an index. Clients should thus not - rely on a given document having the same number between sessions. -

      An IndexReader can be opened on a directory for which an IndexWriter is - opened already, but it cannot be used to delete documents from the index then. -

      - NOTE: for backwards API compatibility, several methods are not listed - as abstract, but have no useful implementations in this base class and - instead always throw UnsupportedOperationException. Subclasses are - strongly encouraged to override these methods, but in many cases may not - need to. -

      -

      - NOTE: as of 2.4, it's possible to open a read-only - IndexReader using one of the static open methods that - accepts the boolean readOnly parameter. Such a reader has - better concurrency as it's not necessary to synchronize on - the isDeleted method. Currently the default for readOnly - is false, meaning if not specified you will get a - read/write IndexReader. But in 3.0 this default will - change to true, meaning you must explicitly specify false - if you want to make changes with the resulting IndexReader. -

      -

      NOTE: - instances are completely thread - safe, meaning multiple threads can call any of its methods, - concurrently. If your application requires external - synchronization, you should not synchronize on the - IndexReader instance; use your own - (non-Lucene) objects instead. -

      - $Id: IndexReader.java 826049 2009-10-16 19:28:55Z mikemccand $ - -
      - - Expert: returns the current refCount for this reader - - - Expert: increments the refCount of this IndexReader - instance. RefCounts are used to determine when a - reader can be closed safely, i.e. as soon as there are - no more references. Be sure to always call a - corresponding , in a finally clause; - otherwise the reader may never be closed. Note that - simply calls decRef(), which means that - the IndexReader will not really be closed until - has been called for all outstanding - references. - - - - - - - Expert: decreases the refCount of this IndexReader - instance. If the refCount drops to 0, then pending - changes (if any) are committed to the index and this - reader is closed. - - - IOException in case an IOException occurs in commit() or doClose() - - - - - - - will be deleted when IndexReader(Directory) is deleted - - - - - - Legacy Constructor for backwards compatibility. - -

      - This Constructor should not be used, it exists for backwards - compatibility only to support legacy subclasses that did not "own" - a specific directory, but needed to specify something to be returned - by the directory() method. Future subclasses should delegate to the - no arg constructor and implement the directory() method as appropriate. - -

      - Directory to be returned by the directory() method - - - - - use IndexReader() - -
      - - AlreadyClosedException if this IndexReader is closed - - - Returns a read/write IndexReader reading the index in an FSDirectory in the named - path. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - Use instead. - This method will be removed in the 3.0 release. - - - the path to the index directory - - - - Returns an IndexReader reading the index in an - FSDirectory in the named path. You should pass - readOnly=true, since it gives much better concurrent - performance, unless you intend to do write operations - (delete documents or change norms) with the reader. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - the path to the index directory - - true if this should be a readOnly - reader - - Use instead. - This method will be removed in the 3.0 release. - - - - - Returns a read/write IndexReader reading the index in an FSDirectory in the named - path. - - the path to the index directory - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - Use instead. - This method will be removed in the 3.0 release. - - - - - Returns an IndexReader reading the index in an - FSDirectory in the named path. You should pass - readOnly=true, since it gives much better concurrent - performance, unless you intend to do write operations - (delete documents or change norms) with the reader. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - the path to the index directory - - true if this should be a readOnly - reader - - Use instead. - This method will be removed in the 3.0 release. - - - - - Returns a read/write IndexReader reading the index in - the given Directory. - - the index directory - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - Use instead - This method will be removed in the 3.0 release. - - - - - Returns an IndexReader reading the index in the given - Directory. You should pass readOnly=true, since it - gives much better concurrent performance, unless you - intend to do write operations (delete documents or - change norms) with the reader. - - the index directory - - true if no changes (deletions, norms) will be made with this IndexReader - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Expert: returns a read/write IndexReader reading the index in the given - . - - the commit point to open - - CorruptIndexException if the index is corrupt - Use instead. - This method will be removed in the 3.0 release. - - - IOException if there is a low-level IO error - - - Expert: returns an IndexReader reading the index in the given - . You should pass readOnly=true, since it - gives much better concurrent performance, unless you - intend to do write operations (delete documents or - change norms) with the reader. - - the commit point to open - - true if no changes (deletions, norms) will be made with this IndexReader - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Expert: returns a read/write IndexReader reading the index in the given - Directory, with a custom . - - the index directory - - a custom deletion policy (only used - if you use this reader to perform deletes or to set - norms); see for details. - - Use instead. - This method will be removed in the 3.0 release. - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Expert: returns an IndexReader reading the index in - the given Directory, with a custom - . You should pass readOnly=true, - since it gives much better concurrent performance, - unless you intend to do write operations (delete - documents or change norms) with the reader. - - the index directory - - a custom deletion policy (only used - if you use this reader to perform deletes or to set - norms); see for details. - - true if no changes (deletions, norms) will be made with this IndexReader - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Expert: returns an IndexReader reading the index in - the given Directory, with a custom - . You should pass readOnly=true, - since it gives much better concurrent performance, - unless you intend to do write operations (delete - documents or change norms) with the reader. - - the index directory - - a custom deletion policy (only used - if you use this reader to perform deletes or to set - norms); see for details. - - true if no changes (deletions, norms) will be made with this IndexReader - - Subsamples which indexed - terms are loaded into RAM. This has the same effect as - except that setting - must be done at indexing time while this setting can be - set per reader. When set to N, then one in every - N*termIndexInterval terms in the index is loaded into - memory. By setting this to a value > 1 you can reduce - memory usage, at the expense of higher latency when - loading a TermInfo. The default value is 1. Set this - to -1 to skip loading the terms index entirely. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Expert: returns a read/write IndexReader reading the index in the given - Directory, using a specific commit and with a custom - . - - the specific to open; - see to list all commits - in a directory - - a custom deletion policy (only used - if you use this reader to perform deletes or to set - norms); see for details. - - Use instead. - This method will be removed in the 3.0 release. - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Expert: returns an IndexReader reading the index in - the given Directory, using a specific commit and with - a custom . You should pass - readOnly=true, since it gives much better concurrent - performance, unless you intend to do write operations - (delete documents or change norms) with the reader. - - the specific to open; - see to list all commits - in a directory - - a custom deletion policy (only used - if you use this reader to perform deletes or to set - norms); see for details. - - true if no changes (deletions, norms) will be made with this IndexReader - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Expert: returns an IndexReader reading the index in - the given Directory, using a specific commit and with - a custom . You should pass - readOnly=true, since it gives much better concurrent - performance, unless you intend to do write operations - (delete documents or change norms) with the reader. - - the specific to open; - see to list all commits - in a directory - - a custom deletion policy (only used - if you use this reader to perform deletes or to set - norms); see for details. - - true if no changes (deletions, norms) will be made with this IndexReader - - Subsambles which indexed - terms are loaded into RAM. This has the same effect as - except that setting - must be done at indexing time while this setting can be - set per reader. When set to N, then one in every - N*termIndexInterval terms in the index is loaded into - memory. By setting this to a value > 1 you can reduce - memory usage, at the expense of higher latency when - loading a TermInfo. The default value is 1. Set this - to -1 to skip loading the terms index entirely. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Refreshes an IndexReader if the index has changed since this instance - was (re)opened. -

      - Opening an IndexReader is an expensive operation. This method can be used - to refresh an existing IndexReader to reduce these costs. This method - tries to only load segments that have changed or were created after the - IndexReader was (re)opened. -

      - If the index has not changed since this instance was (re)opened, then this - call is a NOOP and returns this instance. Otherwise, a new instance is - returned. The old instance is not closed and remains usable.
      -

      - If the reader is reopened, even though they share - resources internally, it's safe to make changes - (deletions, norms) with the new reader. All shared - mutable state obeys "copy on write" semantics to ensure - the changes are not seen by other readers. -

      - You can determine whether a reader was actually reopened by comparing the - old instance with the instance returned by this method: - - IndexReader reader = ... - ... - IndexReader newReader = r.reopen(); - if (newReader != reader) { - ... // reader was reopened - reader.close(); - } - reader = newReader; - ... - - - Be sure to synchronize that code so that other threads, - if present, can never use reader after it has been - closed and before it's switched to newReader. - -

      NOTE: If this reader is a near real-time - reader (obtained from , - reopen() will simply call writer.getReader() again for - you, though this may change in the future. - -

      - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
      - - Just like , except you can change the - readOnly of the original reader. If the index is - unchanged but readOnly is different then a new reader - will be returned. - - - - Expert: reopen this reader on a specific commit point. - This always returns a readOnly reader. If the - specified commit point matches what this reader is - already on, and this reader is already readOnly, then - this same instance is returned; if it is not already - readOnly, a readOnly clone is returned. - - - - Efficiently clones the IndexReader (sharing most - internal state). -

      - On cloning a reader with pending changes (deletions, - norms), the original reader transfers its write lock to - the cloned reader. This means only the cloned reader - may make further changes to the index, and commit the - changes to the index on close, but the old reader still - reflects all changes made up until it was cloned. -

      - Like , it's safe to make changes to - either the original or the cloned reader: all shared - mutable state obeys "copy on write" semantics to ensure - the changes are not seen by other readers. -

      -

      - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
      - - Clones the IndexReader and optionally changes readOnly. A readOnly - reader cannot open a writeable reader. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Returns the directory associated with this index. The Default - implementation returns the directory specified by subclasses when - delegating to the IndexReader(Directory) constructor, or throws an - UnsupportedOperationException if one was not specified. - - UnsupportedOperationException if no directory - - - Returns the time the index in the named directory was last modified. - Do not use this to check whether the reader is still up-to-date, use - instead. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - Use instead. - This method will be removed in the 3.0 release. - - - - Returns the time the index in the named directory was last modified. - Do not use this to check whether the reader is still up-to-date, use - instead. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - Use instead. - This method will be removed in the 3.0 release. - - - - - Returns the time the index in the named directory was last modified. - Do not use this to check whether the reader is still up-to-date, use - instead. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Reads version number from segments files. The version number is - initialized with a timestamp and then increased by one for each change of - the index. - - - where the index resides. - - version number. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - Use instead. - This method will be removed in the 3.0 release. - - - - Reads version number from segments files. The version number is - initialized with a timestamp and then increased by one for each change of - the index. - - - where the index resides. - - version number. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - Use instead. - This method will be removed in the 3.0 release. - - - - Reads version number from segments files. The version number is - initialized with a timestamp and then increased by one for each change of - the index. - - - where the index resides. - - version number. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Reads commitUserData, previously passed to - , - from current index segments file. This will return null if - - has never been called for this index. - - where the index resides. - - commit userData. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - - - - - Version number when this IndexReader was opened. Not implemented in the - IndexReader base class. - -

      - If this reader is based on a Directory (ie, was created by calling - , or - on a reader based on a Directory), then - this method returns the version recorded in the commit that the reader - opened. This version is advanced every time is - called. -

      - -

      - If instead this reader is a near real-time reader (ie, obtained by a call - to , or by calling on a near - real-time reader), then this method returns the version of the last - commit done by the writer. Note that even as further changes are made - with the writer, the version will not changed until a commit is - completed. Thus, you should not rely on this method to determine when a - near real-time reader should be opened. Use instead. -

      - -

      - UnsupportedOperationException - unless overridden in subclass - -
      - - Retrieve the String userData optionally passed to - . - This will return null if - - has never been called for this index. - - - - - -

      For IndexReader implementations that use - TermInfosReader to read terms, this sets the - indexDivisor to subsample the number of indexed terms - loaded into memory. This has the same effect as - except that setting - must be done at indexing time while this setting can be - set per reader. When set to N, then one in every - N*termIndexInterval terms in the index is loaded into - memory. By setting this to a value > 1 you can reduce - memory usage, at the expense of higher latency when - loading a TermInfo. The default value is 1.

      - - NOTE: you must call this before the term - index is loaded. If the index is already loaded, - an IllegalStateException is thrown. -

      - IllegalStateException if the term index has already been loaded into memory - Please use to specify the required TermInfos index divisor instead. - -
      - -

      For IndexReader implementations that use - TermInfosReader to read terms, this returns the - current indexDivisor as specified when the reader was - opened. -

      -
      - - Check whether any new changes have occurred to the index since this - reader was opened. - -

      - If this reader is based on a Directory (ie, was created by calling - , or on a reader based on a Directory), then - this method checks if any further commits (see - have occurred in that directory). -

      - -

      - If instead this reader is a near real-time reader (ie, obtained by a call - to , or by calling on a near - real-time reader), then this method checks if either a new commmit has - occurred, or any new uncommitted changes have taken place via the writer. - Note that even if the writer has only performed merging, this method will - still return false. -

      - -

      - In any event, if this returns false, you should call to - get a new reader that sees the changes. -

      - -

      - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - UnsupportedOperationException unless overridden in subclass -
      - - Checks is the index is optimized (if it has a single segment and - no deletions). Not implemented in the IndexReader base class. - - true if the index is optimized; false otherwise - - UnsupportedOperationException unless overridden in subclass - - - Return an array of term frequency vectors for the specified document. - The array contains a vector for each vectorized field in the document. - Each vector contains terms and frequencies for all terms in a given vectorized field. - If no such fields existed, the method returns null. The term vectors that are - returned may either be of type - or of type if - positions or offsets have been stored. - - - document for which term frequency vectors are returned - - array of term frequency vectors. May be null if no term vectors have been - stored for the specified document. - - IOException if index cannot be accessed - - - - - Return a term frequency vector for the specified document and field. The - returned vector contains terms and frequencies for the terms in - the specified field of this document, if the field had the storeTermVector - flag set. If termvectors had been stored with positions or offsets, a - is returned. - - - document for which the term frequency vector is returned - - field for which the term frequency vector is returned. - - term frequency vector May be null if field does not exist in the specified - document or term vector was not stored. - - IOException if index cannot be accessed - - - - - Load the Term Vector into a user-defined data structure instead of relying on the parallel arrays of - the . - - The number of the document to load the vector for - - The name of the field to load - - The to process the vector. Must not be null - - IOException if term vectors cannot be accessed or if they do not exist on the field and doc. specified. - - - - - Map all the term vectors for all fields in a Document - The number of the document to load the vector for - - The to process the vector. Must not be null - - IOException if term vectors cannot be accessed or if they do not exist on the field and doc. specified. - - - Returns true if an index exists at the specified directory. - If the directory does not exist or if there is no index in it. - false is returned. - - the directory to check for an index - - true if an index exists; false otherwise - - Use instead - This method will be removed in the 3.0 release. - - - - - Returns true if an index exists at the specified directory. - If the directory does not exist or if there is no index in it. - - the directory to check for an index - - true if an index exists; false otherwise - - Use instead. - This method will be removed in the 3.0 release. - - - - - Returns true if an index exists at the specified directory. - If the directory does not exist or if there is no index in it. - - the directory to check for an index - - true if an index exists; false otherwise - - IOException if there is a problem with accessing the index - - - Returns the number of documents in this index. - - - Returns one greater than the largest possible document number. - This may be used to, e.g., determine how big to allocate an array which - will have an element for every document number in an index. - - - - Returns the number of deleted documents. - - - Returns the stored fields of the nth - Document in this index. -

      - NOTE: for performance reasons, this method does not check if the - requested document is deleted, and therefore asking for a deleted document - may yield unspecified results. Usually this is not required, however you - can call with the requested document ID to verify - the document is not deleted. - -

      - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
      - - Get the at the n - th position. The may be used to determine - what s to load and how they should - be loaded. NOTE: If this Reader (more specifically, the underlying - FieldsReader) is closed before the lazy - is loaded an exception may be - thrown. If you want the value of a lazy - to be available after closing you - must explicitly load it or fetch the Document again with a new loader. -

      - NOTE: for performance reasons, this method does not check if the - requested document is deleted, and therefore asking for a deleted document - may yield unspecified results. Usually this is not required, however you - can call with the requested document ID to verify - the document is not deleted. - -

      - Get the document at the nth position - - The to use to determine what - Fields should be loaded on the Document. May be null, in which case - all Fields will be loaded. - - The stored fields of the - at the nth position - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - - - - - - -
      - - Returns true if document n has been deleted - - - Returns true if any documents have been deleted - - - Returns true if there are norms stored for this field. - - - Returns the byte-encoded normalization factor for the named field of - every document. This is used by the search code to score documents. - - - - - - - Reads the byte-encoded normalization factor for the named field of every - document. This is used by the search code to score documents. - - - - - - - Expert: Resets the normalization factor for the named field of the named - document. The norm represents the product of the field's boost - and its length normalization. Thus, to preserve the length normalization - values when resetting this, one should base the new value upon the old. - - NOTE: If this field does not store norms, then - this method call will silently do nothing. - - - - - - - StaleReaderException if the index has changed - since this reader was opened - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Implements setNorm in subclass. - - - Expert: Resets the normalization factor for the named field of the named - document. - - - - - - - - StaleReaderException if the index has changed - since this reader was opened - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Returns an enumeration of all the terms in the index. The - enumeration is ordered by Term.compareTo(). Each term is greater - than all that precede it in the enumeration. Note that after - calling terms(), must be called - on the resulting enumeration before calling other methods such as - . - - IOException if there is a low-level IO error - - - Returns an enumeration of all terms starting at a given term. If - the given term does not exist, the enumeration is positioned at the - first term greater than the supplied term. The enumeration is - ordered by Term.compareTo(). Each term is greater than all that - precede it in the enumeration. - - IOException if there is a low-level IO error - - - Returns the number of documents containing the term t. - IOException if there is a low-level IO error - - - Returns an enumeration of all the documents which contain - term. For each document, the document number, the frequency of - the term in that document is also provided, for use in - search scoring. If term is null, then all non-deleted - docs are returned with freq=1. - Thus, this method implements the mapping: -

      - Term    =>    <docNum, freq>* - -

      The enumeration is ordered by document number. Each document number - is greater than all that precede it in the enumeration. -

      - IOException if there is a low-level IO error -
      - - Returns an unpositioned enumerator. - IOException if there is a low-level IO error - - - Returns an enumeration of all the documents which contain - term. For each document, in addition to the document number - and frequency of the term in that document, a list of all of the ordinal - positions of the term in the document is available. Thus, this method - implements the mapping: - -

      - Term    =>    <docNum, freq, - <pos1, pos2, ... - posfreq-1> - >* - -

      This positional information facilitates phrase and proximity searching. -

      The enumeration is ordered by document number. Each document number is - greater than all that precede it in the enumeration. -

      - IOException if there is a low-level IO error -
      - - Returns an unpositioned enumerator. - IOException if there is a low-level IO error - - - Deletes the document numbered docNum. Once a document is - deleted it will not appear in TermDocs or TermPostitions enumerations. - Attempts to read its field with the - method will result in an error. The presence of this document may still be - reflected in the statistic, though - this will be corrected eventually as the index is further modified. - - - StaleReaderException if the index has changed - since this reader was opened - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Implements deletion of the document numbered docNum. - Applications should call or . - - - - Deletes all documents that have a given term indexed. - This is useful if one uses a document field to hold a unique ID string for - the document. Then to delete such a document, one merely constructs a - term with the appropriate field and the unique ID string as its text and - passes it to this method. - See for information about when this deletion will - become effective. - - - the number of documents deleted - - StaleReaderException if the index has changed - since this reader was opened - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Undeletes all documents currently marked as deleted in this index. - - - StaleReaderException if the index has changed - since this reader was opened - - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Implements actual undeleteAll() in subclass. - - - Does nothing by default. Subclasses that require a write lock for - index modifications must implement this method. - - - - - IOException - - - Opaque Map (String -> String) - that's recorded into the segments file in the index, - and retrievable by - . - - IOException - - - Commit changes resulting from delete, undeleteAll, or - setNorm operations - - If an exception is hit, then either no changes or all - changes will have been committed to the index - (transactional semantics). - - IOException if there is a low-level IO error - - - Commit changes resulting from delete, undeleteAll, or - setNorm operations - - If an exception is hit, then either no changes or all - changes will have been committed to the index - (transactional semantics). - - IOException if there is a low-level IO error - - - Implements commit. - Please implement - - instead. - - - - Implements commit. NOTE: subclasses should override - this. In 3.0 this will become an abstract method. - - - - Closes files associated with this index. - Also saves any new deletions to disk. - No other methods should be called after this has been called. - - IOException if there is a low-level IO error - - - - .NET - - - - Implements close. - - - Get a list of unique field names that exist in this index and have the specified - field option information. - - specifies which field option should be available for the returned fields - - Collection of Strings indicating the names of the fields. - - - - - - Returns true iff the index in the named directory is - currently locked. - - the directory to check for a lock - - IOException if there is a low-level IO error - Please use instead. - This method will be removed in the 3.0 release. - - - - - Returns true iff the index in the named directory is - currently locked. - - the directory to check for a lock - - IOException if there is a low-level IO error - Use instead. - This method will be removed in the 3.0 release. - - - - - Forcibly unlocks the index in the named directory. -

      - Caution: this should only be used by failure recovery code, - when it is known that no other process nor thread is in fact - currently accessing this index. -

      - Please use instead. - This method will be removed in the 3.0 release. - - -
      - - Expert: return the IndexCommit that this reader has - opened. This method is only implemented by those - readers that correspond to a Directory with its own - segments_N file. - -

      WARNING: this API is new and experimental and - may suddenly change.

      -

      -
      - - Prints the filename and size of each file within a given compound file. - Add the -extract flag to extract files to the current working directory. - In order to make the extracted version of the index work, you have to copy - the segments file from the compound index into the directory where the extracted files are stored. - - Usage: Lucene.Net.Index.IndexReader [-extract] <cfsfile> - - - - Returns all commit points that exist in the Directory. - Normally, because the default is - , there would be only - one commit point. But if you're using a custom - then there could be many commits. - Once you have a given commit, you can open a reader on - it by calling - There must be at least one commit in - the Directory, else this method throws . - Note that if a commit is in - progress while this method is running, that commit - may or may not be returned array. - - - - Expert: returns the sequential sub readers that this - reader is logically composed of. For example, - IndexSearcher uses this API to drive searching by one - sub reader at a time. If this reader is not composed - of sequential child readers, it should return null. - If this method returns an empty array, that means this - reader is a null reader (for example a MultiReader - that has no sub readers). -

      - NOTE: You should not try using sub-readers returned by - this method to make any changes (setNorm, deleteDocument, - etc.). While this might succeed for one composite reader - (like MultiReader), it will most likely lead to index - corruption for other readers (like DirectoryReader obtained - through . Use the parent reader directly. -

      -
      - - Expert - - - - - Expert. Warning: this returns null if the reader has - no deletions - - - Returns the number of unique terms (across all fields) - in this reader. - - This method returns long, even though internally - Lucene cannot handle more than 2^31 unique terms, for - a possible future when this limitation is removed. - - - UnsupportedOperationException if this count - cannot be easily determined (eg Multi*Readers). - Instead, you should call - and ask each sub reader for - its unique term count. - - - - Expert: Return the state of the flag that disables fakes norms in favor of representing the absence of field norms with null. - true if fake norms are disabled - - This currently defaults to false (to remain - back-compatible), but in 3.0 it will be hardwired to - true, meaning the norms() methods will return null for - fields that had disabled norms. - - - - Expert: Set the state of the flag that disables fakes norms in favor of representing the absence of field norms with null. - true to disable fake norms, false to preserve the legacy behavior - - This currently defaults to false (to remain - back-compatible), but in 3.0 it will be hardwired to - true, meaning the norms() methods will return null for - fields that had disabled norms. - - - - Utility class for executing code that needs to do - something with the current segments file. This is - necessary with lock-less commits because from the time - you locate the current segments file name, until you - actually open it, read its contents, or check modified - time, etc., it could have been deleted due to a writer - commit finishing. - - - - A collection of segmentInfo objects with methods for operating on - those segments in relation to the file system. - -

      NOTE: This API is new and still experimental - (subject to change suddenly in the next release)

      -

      -
      - - The file format version, a negative number. - - - This format adds details used for lockless commits. It differs - slightly from the previous format in that file names - are never re-used (write once). Instead, each file is - written to the next generation. For example, - segments_1, segments_2, etc. This allows us to not use - a commit lock. See file - formats for details. - - - - This format adds a "hasSingleNormFile" flag into each segment info. - See LUCENE-756 - for details. - - - - This format allows multiple segments to share a single - vectors and stored fields file. - - - - This format adds a checksum at the end of the file to - ensure all bytes were successfully written. - - - - This format adds the deletion count for each segment. - This way IndexWriter can efficiently report numDocs(). - - - - This format adds the boolean hasProx to record if any - fields in the segment store prox information (ie, have - omitTermFreqAndPositions==false) - - - - This format adds optional commit userData (String) storage. - - - This format adds optional per-segment String - dianostics storage, and switches userData to Map - - - - counts how often the index has been changed by adding or deleting docs. - starting with the current time in milliseconds forces to create unique version numbers. - - - - If non-null, information about loading segments_N files - - - - - Get the generation (N) of the current segments_N file - from a list of files. - - - -- array of file names to check - - - - Get the generation (N) of the current segments_N file - in the directory. - - - -- directory to search for the latest segments_N file - - - - Get the filename of the current segments_N file - from a list of files. - - - -- array of file names to check - - - - Get the filename of the current segments_N file - in the directory. - - - -- directory to search for the latest segments_N file - - - - Get the segments_N filename in use by this segment infos. - - - Parse the generation off the segments file name and - return it. - - - - Get the next segments_N filename that will be written. - - - Read a particular segmentFileName. Note that this may - throw an IOException if a commit is in process. - - - -- directory containing the segments file - - -- segment file to load - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - This version of read uses the retry logic (for lock-less - commits) to find the right segments file to load. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Returns a copy of this instance, also copying each - SegmentInfo. - - - - version number when this SegmentInfos was generated. - - - Current version number from segments file. - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Returns userData from latest segments file - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - If non-null, information about retries when loading - the segments file will be printed to this. - - - - Advanced: set how many times to try loading the - segments.gen file contents to determine current segment - generation. This file is only referenced when the - primary method (listing the directory) fails. - - - - - - - - Advanced: set how many milliseconds to pause in between - attempts to load the segments.gen file. - - - - - - - - Advanced: set how many times to try incrementing the - gen when loading the segments file. This only runs if - the primary (listing directory) and secondary (opening - segments.gen file) methods fail to find the segments - file. - - - - - - - - - - - - Returns a new SegmentInfos containg the SegmentInfo - instances in the specified range first (inclusive) to - last (exclusive), so total number of segments returned - is last-first. - - - - Call this to start a commit. This writes the new - segments file, but writes an invalid checksum at the - end, so that it is not visible to readers. Once this - is called you must call to complete - the commit or to abort it. - - - - Returns all file names referenced by SegmentInfo - instances matching the provided Directory (ie files - associated with any "external" segments are skipped). - The returned collection is recomputed on each - invocation. - - - - Writes & syncs to the Directory dir, taking care to - remove the segments file on exception - - - - Replaces all segments in this instance, but keeps - generation, version, counter so that future commits - remain write once. - - - - - Simple brute force implementation. - If size is equal, compare items one by one. - - SegmentInfos object to check equality for - true if lists are equal, false otherwise - - - - Calculate hash code of SegmentInfos - - hash code as in java version of ArrayList - - - Utility class for executing code that needs to do - something with the current segments file. This is - necessary with lock-less commits because from the time - you locate the current segments file name, until you - actually open it, read its contents, or check modified - time, etc., it could have been deleted due to a writer - commit finishing. - - - - Subclass must implement this. The assumption is an - IOException will be thrown if something goes wrong - during the processing that could have been caused by - a writer committing. - - - - Constants describing field properties, for example used for - . - - - - All fields - - - All indexed fields - - - All fields that store payloads - - - All fields that omit tf - - - Renamed to - - - - All fields which are not indexed - - - All fields which are indexed with termvectors enabled - - - All fields which are indexed but don't have termvectors enabled - - - All fields with termvectors enabled. Please note that only standard termvector fields are returned - - - All fields with termvectors with position values enabled - - - All fields with termvectors with offset values enabled - - - All fields with termvectors with offset values and position values enabled - - - This is a DocConsumer that gathers all fields under the - same name, and calls per-field consumers to process field - by field. This class doesn't doesn't do any "real" work - of its own: it just forwards the fields to a - DocFieldConsumer. - - - - Implements the skip list reader for the default posting list format - that stores positions and payloads. - - - - - This abstract class reads skip lists with multiple levels. - - See for the information about the encoding - of the multi level skip lists. - - Subclasses must implement the abstract method - which defines the actual format of the skip data. - - - - Returns the id of the doc to which the last call of - has skipped. - - - - Skips entries to the first beyond the current whose document number is - greater than or equal to target. Returns the current doc count. - - - - Seeks the skip entry on the given level - - - initializes the reader - - - Loads the skip levels - - - Subclasses must implement the actual skip data encoding in this method. - - - the level skip data shall be read from - - the skip stream to read from - - - - Copies the values of the last read skip entry on this level - - - used to buffer the top skip levels - - - Returns the freq pointer of the doc to which the last call of - has skipped. - - - - Returns the prox pointer of the doc to which the last call of - has skipped. - - - - Returns the payload length of the payload stored just before - the doc to which the last call of - has skipped. - - - - Combines multiple files into a single compound file. - The file format:
      - - VInt fileCount - {Directory} - fileCount entries with the following structure: - - long dataOffset - String fileName - - {File Data} - fileCount entries with the raw data of the corresponding file - - - The fileCount integer indicates how many files are contained in this compound - file. The {directory} that follows has that many entries. Each directory entry - contains a long pointer to the start of this file's data section, and a String - with that file's name. - - -
      - $Id: CompoundFileWriter.java 690539 2008-08-30 17:33:06Z mikemccand $ - -
      - - Create the compound stream in the specified file. The file name is the - entire name (no extensions are added). - - NullPointerException if dir or name is null - - - Returns the directory of the compound file. - - - Returns the name of the compound file. - - - Add a source stream. file is the string by which the - sub-stream will be known in the compound stream. - - - IllegalStateException if this writer is closed - NullPointerException if file is null - IllegalArgumentException if a file with the same name - has been added already - - - - Merge files with the extensions added up to now. - All files with these extensions are combined sequentially into the - compound stream. After successful merge, the source files - are deleted. - - IllegalStateException if close() had been called before or - if no file has been added to this object - - - - Copy the contents of the file with specified extension into the - provided output stream. Use the provided buffer for moving data - to reduce memory allocation. - - - - source file - - - temporary holder for the start of directory entry for this file - - - temporary holder for the start of this file's data section - - - Class for accessing a compound stream. - This class implements a directory, but is limited to only read operations. - Directory methods that would normally modify data throw an exception. - - - - $Id: CompoundFileReader.java 673371 2008-07-02 11:57:27Z mikemccand $ - - - - - .NET - - - - Returns an array of strings, one for each file in the directory. - - - Returns true iff a file with the given name exists. - - - Returns the time the compound file was last modified. - - - Set the modified time of the compound file to now. - - - Not implemented - UnsupportedOperationException - - - Not implemented - UnsupportedOperationException - - - Returns the length of a file in the directory. - IOException if the file does not exist - - - Not implemented - UnsupportedOperationException - - - Not implemented - UnsupportedOperationException - - - Implementation of an IndexInput that reads from a portion of the - compound file. The visibility is left as "package" *only* because - this helps with testing since JUnit test cases in a different class - can then access package fields of this class. - - - - Expert: implements buffer refill. Reads bytes from the current - position in the input. - - the array to read bytes into - - the offset in the array to start storing bytes - - the number of bytes to read - - - - Expert: implements seek. Sets current position in this file, where - the next will occur. - - - - - - Closes the stream to further operations. - - - Provides information about what should be done with this Field - - - - - - Load this every time the is loaded, reading in the data as it is encountered. - and should not return null. -

      - should be called by the Reader. -

      -
      - - Lazily load this . This means the is valid, but it may not actually contain its data until - invoked. SHOULD NOT BE USED. is safe to use and should - return a valid instance of a . -

      - should be called by the Reader. -

      -
      - - Do not load the . and should return null. - is not called. -

      - should not be called by the Reader. -

      -
      - - Load this field as in the case, but immediately return from loading for the . Thus, the - Document may not have its complete set of Fields. and should - both be valid for this -

      - should be called by the Reader. -

      -
      - - Behaves much like but does not uncompress any compressed data. This is used for internal purposes. - and should not return null. -

      - should be called by - the Reader. -

      - This is an internal option only, and is - no longer needed now that - is used for field compression. - -
      - - Expert: Load the size of this rather than its value. - Size is measured as number of bytes required to store the field == bytes for a binary or any compressed value, and 2*chars for a String value. - The size is stored as a binary value, represented as an int in a byte[], with the higher order byte first in [0] - - - - Expert: Like but immediately break from the field loading loop, i.e., stop loading further fields, after the size is loaded - - - Provides support for converting dates to strings and vice-versa. - The strings are structured so that lexicographic sorting orders - them by date, which makes them suitable for use as field values - and search terms. - -

      This class also helps you to limit the resolution of your dates. Do not - save dates with a finer resolution than you really need, as then - RangeQuery and PrefixQuery will require more memory and become slower. - -

      Compared to the strings generated by the methods - in this class take slightly more space, unless your selected resolution - is set to Resolution.DAY or lower. - -

      - Another approach is , which provides - a sortable binary representation (prefix encoded) of numeric values, which - date/time are. - For indexing a , convert it to unix timestamp as - long and - index this as a numeric value with - and use to query it. -

      -
      - - Converts a Date to a string suitable for indexing. - - - the date to be converted - - the desired resolution, see - - - a string in format yyyyMMddHHmmssSSS or shorter, - depending on resolution; using GMT as timezone - - - - Converts a millisecond time to a string suitable for indexing. - - - the date expressed as milliseconds since January 1, 1970, 00:00:00 GMT - - the desired resolution, see - - - a string in format yyyyMMddHHmmssSSS or shorter, - depending on resolution; using GMT as timezone - - - - Converts a string produced by timeToString or - DateToString back to a time, represented as the - number of milliseconds since January 1, 1970, 00:00:00 GMT. - - - the date string to be converted - - the number of milliseconds since January 1, 1970, 00:00:00 GMT - - ParseException if dateString is not in the - expected format - - - - Converts a string produced by timeToString or - DateToString back to a time, represented as a - Date object. - - - the date string to be converted - - the parsed time as a Date object - - ParseException if dateString is not in the - expected format - - - - Limit a date's resolution. For example, the date 2004-09-21 13:50:11 - will be changed to 2004-09-01 00:00:00 when using - Resolution.MONTH. - - - - The desired resolution of the date to be returned - - the date with all values more precise than resolution - set to 0 or 1 - - - - Limit a date's resolution. For example, the date 1095767411000 - (which represents 2004-09-21 13:50:11) will be changed to - 1093989600000 (2004-09-01 00:00:00) when using - Resolution.MONTH. - - - The time in milliseconds (not ticks). - The desired resolution of the date to be returned - - the date with all values more precise than resolution - set to 0 or 1, expressed as milliseconds since January 1, 1970, 00:00:00 GMT - - - - Specifies the time granularity. - - - The positionIncrement determines the position of this token - relative to the previous Token in a TokenStream, used in phrase - searching. - -

      The default value is one. - -

      Some common uses for this are: - - Set it to zero to put multiple terms in the same position. This is - useful if, e.g., a word has multiple stems. Searches for phrases - including either stem will match. In this case, all but the first stem's - increment should be set to zero: the increment of the first instance - should be one. Repeating a token with an increment of zero can also be - used to boost the scores of matches on that token. - - Set it to values greater than one to inhibit exact phrase matches. - If, for example, one does not want phrases to match across removed stop - words, then one could build a stop word filter that removes stop words and - also sets the increment to the number of stop words removed before each - non-stop word. Then exact phrase queries will only match when the terms - occur with no intervening stop words. - - - -

      - - -
      - - Base interface for attributes. - - - Set the position increment. The default value is one. - - - the distance from the prior term - - - - Returns the position increment of this Token. - - - - - Filters with , - and , using a list of English stop - words. - - -

      - You must specify the required compatibility when creating - StandardAnalyzer: - - As of 2.9, StopFilter preserves position increments - As of 2.4, Tokens incorrectly identified as acronyms are corrected (see - LUCENE-1608) - - -

      - $Id: StandardAnalyzer.java 829134 2009-10-23 17:18:53Z mikemccand $ - -
      - - An Analyzer builds TokenStreams, which analyze text. It thus represents a - policy for extracting index terms from text. -

      - Typical implementations first build a Tokenizer, which breaks the stream of - characters from the Reader into raw Tokens. One or more TokenFilters may - then be applied to the output of the Tokenizer. -

      -
      - - Creates a TokenStream which tokenizes all the text in the provided - Reader. Must be able to handle null field name for - backward compatibility. - - - - Creates a TokenStream that is allowed to be re-used - from the previous time that the same thread called - this method. Callers that do not need to use more - than one TokenStream at the same time from this - analyzer should use this method for better - performance. - - - - Used by Analyzers that implement reusableTokenStream - to retrieve previously saved TokenStreams for re-use - by the same thread. - - - - Used by Analyzers that implement reusableTokenStream - to save a TokenStream for later re-use by the same - thread. - - - - This is only present to preserve - back-compat of classes that subclass a core analyzer - and override tokenStream but not reusableTokenStream - - - - Invoked before indexing a Fieldable instance if - terms have already been added to that field. This allows custom - analyzers to place an automatic position increment gap between - Fieldable instances using the same field name. The default value - position increment gap is 0. With a 0 position increment gap and - the typical default token position increment of 1, all terms in a field, - including across Fieldable instances, are in successive positions, allowing - exact PhraseQuery matches, for instance, across Fieldable instance boundaries. - - - Fieldable name being indexed. - - position increment gap, added to the next token emitted from - - - - Just like , except for - Token offsets instead. By default this returns 1 for - tokenized fields and, as if the fields were joined - with an extra space character, and 0 for un-tokenized - fields. This method is only called if the field - produced at least one token for indexing. - - - the field just indexed - - offset gap, added to the next token emitted from - - - - Frees persistent resources used by this Analyzer - - - Default maximum allowed token length - - - Specifies whether deprecated acronyms should be replaced with HOST type. - This is false by default to support backward compatibility. - - - this should be removed in the next release (3.0). - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - - - - true if new instances of StandardTokenizer will - replace mischaracterized acronyms - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - This will be removed (hardwired to true) in 3.0 - - - - - Set to true to have new - instances of StandardTokenizer replace mischaracterized - acronyms by default. Set to false to preserve the - previous (before 2.4) buggy behavior. Alternatively, - set the system property - Lucene.Net.Analysis.Standard.StandardAnalyzer.replaceInvalidAcronym - to false. - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - This will be removed (hardwired to true) in 3.0 - - - - An array containing some common English words that are usually not - useful for searching. - - Use instead - - - - An unmodifiable set containing some common English words that are usually not - useful for searching. - - - - Builds an analyzer with the default stop words - (). - - Use instead. - - - - Builds an analyzer with the default stop words (). - - Lucene version to match See above /> - - - - - Builds an analyzer with the given stop words. - Use - instead - - - - Builds an analyzer with the given stop words. - Lucene version to match See above /> - - - stop words - - - - Builds an analyzer with the given stop words. - Use instead - - - - Builds an analyzer with the stop words from the given file. - - - Use - instead - - - - Builds an analyzer with the stop words from the given file. - - - Lucene version to match See above /> - - - File to read stop words from - - - - Builds an analyzer with the stop words from the given reader. - - - Use - instead - - - - Builds an analyzer with the stop words from the given reader. - - - Lucene version to match See above /> - - - Reader to read stop words from - - - - - Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - - Remove in 3.X and make true the only valid value - - - - The stopwords to use - - Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - - Remove in 3.X and make true the only valid value - - - - The stopwords to use - - Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - - Remove in 3.X and make true the only valid value - - - - - The stopwords to use - - Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - - Remove in 3.X and make true the only valid value - - - - The stopwords to use - - Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - - Remove in 3.X and make true the only valid value - - - - Constructs a filtered by a - , a and a . - - - - Set maximum allowed token length. If a token is seen - that exceeds this length then it is discarded. This - setting only takes effect the next time tokenStream or - reusableTokenStream is called. - - - - - - - - Use instead - - - - - true if this Analyzer is replacing mischaracterized acronyms in the StandardTokenizer - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - This will be removed (hardwired to true) in 3.0 - - - - - Set to true if this Analyzer is replacing mischaracterized acronyms in the StandardTokenizer - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - This will be removed (hardwired to true) in 3.0 - - - - Transforms the token stream as per the Porter stemming algorithm. - Note: the input to the stemming filter must already be in lower case, - so you will need to use LowerCaseFilter or LowerCaseTokenizer farther - down the Tokenizer chain in order for this to work properly! -

      - To use this filter with other analyzers, you'll want to write an - Analyzer class that sets up the TokenStream chain as you want it. - To use this with LowerCaseTokenizer, for example, you'd write an - analyzer like this: -

      - - class MyAnalyzer extends Analyzer { - public final TokenStream tokenStream(String fieldName, Reader reader) { - return new PorterStemFilter(new LowerCaseTokenizer(reader)); - } - } - -

      -
      - - A TokenFilter is a TokenStream whose input is another TokenStream. -

      - This is an abstract class; subclasses must override . - -

      - - -
      - - The source of tokens for this filter. - - - Construct a token stream filtering the given input. - - - Performs end-of-stream operations, if any, and calls then end() on the - input TokenStream.

      - NOTE: Be sure to call super.end() first when overriding this method. -

      -
      - - Close the input TokenStream. - - - Reset the filter as well as the input TokenStream. - - - A filter that replaces accented characters in the ISO Latin 1 character set - (ISO-8859-1) by their unaccented equivalent. The case will not be altered. -

      - For instance, 'À' will be replaced by 'a'. -

      - -

      - in favor of which covers a superset - of Latin 1. This class will be removed in Lucene 3.0. - -
      - - Will be removed in Lucene 3.0. This method is final, as it should - not be overridden. Delegates to the backwards compatibility layer. - - - - Will be removed in Lucene 3.0. This method is final, as it should - not be overridden. Delegates to the backwards compatibility layer. - - - - To replace accented characters in a String by unaccented equivalents. - - - Helper class for keeping Listss of Objects associated with keys. WARNING: THIS CLASS IS NOT THREAD SAFE - - - the backing store for this object - - - - direct access to the map backing this object. - - - - Adds val to the Set associated with key in the Map. If key is not - already in the map, a new Set will first be created. - - the size of the Set associated with key once val is added to it. - - - - Adds multiple vals to the Set associated with key in the Map. - If key is not - already in the map, a new Set will first be created. - - the size of the Set associated with key once val is added to it. - - - - A variety of high efficiencly bit twiddling routines. - - - $Id$ - - - - Returns the number of bits set in the long - - - Returns the number of set bits in an array of longs. - - - Returns the popcount or cardinality of the two sets after an intersection. - Neither array is modified. - - - - Returns the popcount or cardinality of the union of two sets. - Neither array is modified. - - - - Returns the popcount or cardinality of A & ~B - Neither array is modified. - - - - table of number of trailing zeros in a byte - - - Returns number of trailing zeros in a 64 bit long value. - - - Returns number of trailing zeros in a 32 bit int value. - - - returns 0 based index of first set bit - (only works for x!=0) -
      This is an alternate implementation of ntz() -
      -
      - - returns 0 based index of first set bit -
      This is an alternate implementation of ntz() -
      -
      - - returns true if v is a power of two or zero - - - returns true if v is a power of two or zero - - - returns the next highest power of two, or the current value if it's already a power of two or zero - - - returns the next highest power of two, or the current value if it's already a power of two or zero - - - Writes bytes through to a primary IndexOutput, computing - checksum. Note that you cannot use seek(). - - - - Starts but does not complete the commit of this file (= - writing of the final checksum at the end). After this - is called must call and the - to complete the commit. - - - - See - - - Matches spans containing a term. - - - Construct a SpanTermQuery matching the named term's spans. - - - Return the term whose spans are matched. - - - Returns a collection of all terms matched by this query. - use extractTerms instead - - - - - - Expert: an enumeration of span matches. Used to implement span searching. - Each span represents a range of term positions within a document. Matches - are enumerated in order, by increasing document number, within that by - increasing start position and finally by increasing end position. - - - - Move to the next match, returning true iff any such exists. - - - Skips to the first match beyond the current, whose document number is - greater than or equal to target.

      Returns true iff there is such - a match.

      Behaves as if written: - boolean skipTo(int target) { - do { - if (!next()) - return false; - } while (target > doc()); - return true; - } - - Most implementations are considerably more efficient than that. -

      -
      - - Returns the document number of the current match. Initially invalid. - - - Returns the start position of the current match. Initially invalid. - - - Returns the end position of the current match. Initially invalid. - - - Returns the payload data for the current span. - This is invalid until is called for - the first time. - This method must not be called more than once after each call - of . However, most payloads are loaded lazily, - so if the payload data for the current position is not needed, - this method may not be called at all for performance reasons. An ordered - SpanQuery does not lazy load, so if you have payloads in your index and - you do not want ordered SpanNearQuerys to collect payloads, you can - disable collection with a constructor option.
      - - Note that the return type is a collection, thus the ordering should not be relied upon. -
      -

      - WARNING: The status of the Payloads feature is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case.

      - -

      - a List of byte arrays containing the data of this payload, otherwise null if isPayloadAvailable is false - - java.io.IOException -
      - - Checks if a payload can be loaded at this position. -

      - Payloads can only be loaded once per call to - . - -

      - true if there is a payload available at this position that can be loaded - -
      - - A wrapper for , that exposes its - functionality as a . -

      - MultiTermQueryWrapperFilter is not designed to - be used by itself. Normally you subclass it to provide a Filter - counterpart for a subclass. -

      - For example, and extend - MultiTermQueryWrapperFilter. - This class also provides the functionality behind - ; - this is why it is not abstract. -

      -
      - - Wrap a as a Filter. - - - Expert: Return the number of unique terms visited during execution of the filter. - If there are many of them, you may consider using another filter type - or optimize your total term count in index. -

      This method is not thread safe, be sure to only call it when no filter is running! - If you re-use the same filter instance for another - search, be sure to first reset the term counter - with . -

      - - -
      - - Expert: Resets the counting of unique terms. - Do this before executing the filter. - - - - - - Returns a BitSet with true for documents which should be - permitted in search results, and false for those that should - not. - - Use instead. - - - - Returns a DocIdSet with documents that should be - permitted in search results. - - - - Expert: a FieldComparator compares hits so as to determine their - sort order when collecting the top results with - . The concrete public FieldComparator - classes here correspond to the SortField types. - -

      This API is designed to achieve high performance - sorting, by exposing a tight interaction with - as it visits hits. Whenever a hit is - competitive, it's enrolled into a virtual slot, which is - an int ranging from 0 to numHits-1. The - is made aware of segment transitions - during searching in case any internal state it's tracking - needs to be recomputed during these transitions.

      - -

      A comparator must define these functions:

      - - - - Compare a hit at 'slot a' - with hit 'slot b'. - - This method is called by - to notify the - FieldComparator of the current weakest ("bottom") - slot. Note that this slot may not hold the weakest - value according to your comparator, in cases where - your comparator is not the primary one (ie, is only - used to break ties from the comparators before it). - - Compare a new hit (docID) - against the "weakest" (bottom) entry in the queue. - - Installs a new hit into the - priority queue. The - calls this method when a new hit is competitive. - - Invoked - when the search is switching to the next segment. - You may need to update internal state of the - comparator, for example retrieving new values from - the . - - Return the sort value stored in - the specified slot. This is only called at the end - of the search, in order to populate - when returning the top results. - - - NOTE: This API is experimental and might change in - incompatible ways in the next release. -

      -
      - - Compare hit at slot1 with hit at slot2. - - - first slot to compare - - second slot to compare - - any N < 0 if slot2's value is sorted after - slot1, any N > 0 if the slot2's value is sorted before - slot1 and 0 if they are equal - - - - Set the bottom slot, ie the "weakest" (sorted last) - entry in the queue. When is - called, you should compare against this slot. This - will always be called before . - - - the currently weakest (sorted last) slot in the queue - - - - Compare the bottom of the queue with doc. This will - only invoked after setBottom has been called. This - should return the same result as - } as if bottom were slot1 and the new - document were slot 2. - -

      For a search that hits many results, this method - will be the hotspot (invoked by far the most - frequently).

      - -

      - that was hit - - any N < 0 if the doc's value is sorted after - the bottom entry (not competitive), any N > 0 if the - doc's value is sorted before the bottom entry and 0 if - they are equal. - -
      - - This method is called when a new hit is competitive. - You should copy any state associated with this document - that will be required for future comparisons, into the - specified slot. - - - which slot to copy the hit to - - docID relative to current reader - - - - Set a new Reader. All doc correspond to the current Reader. - - - current reader - - docBase of this reader - - IOException - IOException - - - Sets the Scorer to use in case a document's score is - needed. - - - Scorer instance that you should use to - obtain the current hit's score, if necessary. - - - - Return the actual value in the slot. - - - the value - - value in this slot upgraded to Comparable - - - - Parses field's values as byte (using - and sorts by ascending value - - - - Sorts by ascending docID - - - Parses field's values as double (using - and sorts by ascending value - - - - Parses field's values as float (using - and sorts by ascending value - - - - Parses field's values as int (using - and sorts by ascending value - - - - Parses field's values as long (using - and sorts by ascending value - - - - Sorts by descending relevance. NOTE: if you are - sorting only by descending relevance and then - secondarily by ascending docID, peformance is faster - using directly (which - uses when no is - specified). - - - - Parses field's values as short (using ) - and sorts by ascending value - - - - Sorts by a field's value using the Collator for a - given Locale. - - - - Sorts by field's natural String sort order, using - ordinals. This is functionally equivalent to - , but it first resolves the string - to their relative ordinal positions (using the index - returned by ), and - does most comparisons using the ordinals. For medium - to large results, this comparator will be much faster - than . For very small - result sets it may be slower. - - - - Sorts by field's natural String sort order. All - comparisons are done using String.compareTo, which is - slow for medium to large result sets but possibly - very fast for very small results sets. - - - - Token Manager. - - - Token literal values and constants. - Generated by org.javacc.parser.OtherFilesGen#start() - - - - End of File. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - Lexical state. - - - Lexical state. - - - Lexical state. - - - Lexical state. - - - Literal token values. - - - Debug output. - - - Set debug output. - - - Token literal values. - - - Lexer state names. - - - Lex State array. - - - Constructor. - - - Constructor. - - - Reinitialise parser. - - - Reinitialise parser. - - - Switch to specified lex state. - - - Get the next Token. - - - Implement this class to plug into the TermsHash - processor, which inverts and stores Tokens into a hash - table and provides an API for writing bytes into - multiple streams for each unique Token. - - - - Called once per field per document if term vectors - are enabled, to write the vectors to - RAMOutputStream, which is then quickly flushed to - the real term vectors files in the Directory. - - - - Used by DocumentsWriter to implemented a StringReader - that can be reset to a new string; we use this when - tokenizing the string value from a Field. - - - - Add a new thread - - - Abort (called after hitting AbortException) - - - Flush a new segment - - - Close doc stores - - - Attempt to free RAM, returning true if any RAM was - freed - - - - Implements the skip list writer for the default posting list format - that stores positions and payloads. - - - - - This abstract class writes skip lists with multiple levels. - - Example for skipInterval = 3: - c (skip level 2) - c c c (skip level 1) - x x x x x x x x x x (skip level 0) - d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d (posting list) - 3 6 9 12 15 18 21 24 27 30 (df) - - d - document - x - skip data - c - skip data with child pointer - - Skip level i contains every skipInterval-th entry from skip level i-1. - Therefore the number of entries on level i is: floor(df / ((skipInterval ^ (i + 1))). - - Each skip entry on a level i>0 contains a pointer to the corresponding skip entry in list i-1. - This guarantess a logarithmic amount of skips to find the target document. - - While this class takes care of writing the different skip levels, - subclasses must define the actual format of the skip data. - - - - - Subclasses must implement the actual skip data encoding in this method. - - - the level skip data shall be writting for - - the skip buffer to write to - - - - Writes the current skip data to the buffers. The current document frequency determines - the max level is skip data is to be written to. - - - the current document frequency - - IOException - - - Writes the buffered skip lists to the given output. - - - the IndexOutput the skip lists shall be written to - - the pointer the skip list starts - - - - Sets the values for the current skip data. - - - This exception is thrown when Lucene detects - an inconsistency in the index. - - - - - * Base utility class for implementing a . - * You subclass this, and then record mappings by calling - * , and then invoke the correct - * method to correct an offset. - - - - Subclasses of CharFilter can be chained to filter CharStream. - They can be used as with additional offset - correction. s will automatically use - if a CharFilter/CharStream subclass is used. - - - $Id$ - - - - - CharStream adds - functionality over . All Tokenizers accept a - CharStream instead of as input, which enables - arbitrary character based filtering before tokenization. - The method fixed offsets to account for - removal or insertion of characters, so that the offsets - reported in the tokens match the character offsets of the - original Reader. - - - - Called by CharFilter(s) and Tokenizer to correct token offset. - - - offset as seen in the output - - corrected offset based on the input - - - - Subclass may want to override to correct the current offset. - - - current offset - - corrected offset - - - - Chains the corrected offset through the input - CharFilter. - - - - Retrieve the corrected offset. - - - Class to encode java's UTF16 char[] into UTF8 byte[] - without always allocating a new byte[] as - String.getBytes("UTF-8") does. - -

      WARNING: This API is a new and experimental and - may suddenly change.

      -

      -
      - - Encode characters from a char[] source, starting at - offset and stopping when the character 0xffff is seen. - Returns the number of bytes written to bytesOut. - - - - Encode characters from a char[] source, starting at - offset for length chars. Returns the number of bytes - written to bytesOut. - - - - Encode characters from this String, starting at offset - for length characters. Returns the number of bytes - written to bytesOut. - - - - Convert UTF8 bytes into UTF16 characters. If offset - is non-zero, conversion starts at that starting point - in utf8, re-using the results from the previous call - up until offset. - - - - Simple lockless and memory barrier free String intern cache that is guaranteed - to return the same String instance as String.intern() does. - - - - Subclasses of StringInterner are required to - return the same single String object for all equal strings. - Depending on the implementation, this may not be - the same object returned as String.intern(). - - This StringInterner base class simply delegates to String.intern(). - - - - Returns a single object instance for each equal string. - - - Returns a single object instance for each equal string. - - - Size of the hash table, should be a power of two. - - Maximum length of each bucket, after which the oldest item inserted is dropped. - - - - This is a helper class to generate prefix-encoded representations for numerical values - and supplies converters to represent float/double values as sortable integers/longs. - -

      To quickly execute range queries in Apache Lucene, a range is divided recursively - into multiple intervals for searching: The center of the range is searched only with - the lowest possible precision in the trie, while the boundaries are matched - more exactly. This reduces the number of terms dramatically. - -

      This class generates terms to achive this: First the numerical integer values need to - be converted to strings. For that integer values (32 bit or 64 bit) are made unsigned - and the bits are converted to ASCII chars with each 7 bit. The resulting string is - sortable like the original integer value. Each value is also prefixed - (in the first char) by the shift value (number of bits removed) used - during encoding. - -

      To also index floating point numbers, this class supplies two methods to convert them - to integer values by changing their bit layout: , - . You will have no precision loss by - converting floating point numbers to integers and back (only that the integer form - is not usable). Other data types like dates can easily converted to longs or ints (e.g. - date to long: ). - -

      For easy usage, the trie algorithm is implemented for indexing inside - that can index int, long, - float, and double. For querying, - and implement the query part - for the same data types. - -

      This class can also be used, to generate lexicographically sortable (according - ) representations of numeric data types for other - usages (e.g. sorting). - -

      NOTE: This API is experimental and - might change in incompatible ways in the next release. - -

      - 2.9 - -
      - - The default precision step used by , , - , and as default - - - - Expert: The maximum term length (used for char[] buffer size) - for encoding long values. - - - - - - Expert: The maximum term length (used for char[] buffer size) - for encoding int values. - - - - - - Expert: Longs are stored at lower precision by shifting off lower bits. The shift count is - stored as SHIFT_START_LONG+shift in the first character - - - - Expert: Integers are stored at lower precision by shifting off lower bits. The shift count is - stored as SHIFT_START_INT+shift in the first character - - - - Expert: Returns prefix coded bits after reducing the precision by shift bits. - This is method is used by . - - the numeric value - - how many bits to strip from the right - - that will contain the encoded chars, must be at least of - length - - number of chars written to buffer - - - - Expert: Returns prefix coded bits after reducing the precision by shift bits. - This is method is used by . - - the numeric value - - how many bits to strip from the right - - - - This is a convenience method, that returns prefix coded bits of a long without - reducing the precision. It can be used to store the full precision value as a - stored field in index. -

      To decode, use . -

      -
      - - Expert: Returns prefix coded bits after reducing the precision by shift bits. - This is method is used by . - - the numeric value - - how many bits to strip from the right - - that will contain the encoded chars, must be at least of - length - - number of chars written to buffer - - - - Expert: Returns prefix coded bits after reducing the precision by shift bits. - This is method is used by . - - the numeric value - - how many bits to strip from the right - - - - This is a convenience method, that returns prefix coded bits of an int without - reducing the precision. It can be used to store the full precision value as a - stored field in index. -

      To decode, use . -

      -
      - - Returns a long from prefixCoded characters. - Rightmost bits will be zero for lower precision codes. - This method can be used to decode e.g. a stored field. - - NumberFormatException if the supplied string is - not correctly prefix encoded. - - - - - - Returns an int from prefixCoded characters. - Rightmost bits will be zero for lower precision codes. - This method can be used to decode e.g. a stored field. - - NumberFormatException if the supplied string is - not correctly prefix encoded. - - - - - - Converts a double value to a sortable signed long. - The value is converted by getting their IEEE 754 floating-point "double format" - bit layout and then some bits are swapped, to be able to compare the result as long. - By this the precision is not reduced, but the value can easily used as a long. - - - - - - Convenience method: this just returns: - longToPrefixCoded(doubleToSortableLong(val)) - - - - Converts a sortable long back to a double. - - - - - Convenience method: this just returns: - sortableLongToDouble(prefixCodedToLong(val)) - - - - Converts a float value to a sortable signed int. - The value is converted by getting their IEEE 754 floating-point "float format" - bit layout and then some bits are swapped, to be able to compare the result as int. - By this the precision is not reduced, but the value can easily used as an int. - - - - - - Convenience method: this just returns: - intToPrefixCoded(floatToSortableInt(val)) - - - - Converts a sortable int back to a float. - - - - - Convenience method: this just returns: - sortableIntToFloat(prefixCodedToInt(val)) - - - - Expert: Splits a long range recursively. - You may implement a builder that adds clauses to a - for each call to its - - method. -

      This method is used by . -

      -
      - - Expert: Splits an int range recursively. - You may implement a builder that adds clauses to a - for each call to its - - method. -

      This method is used by . -

      -
      - - This helper does the splitting for both 32 and 64 bit. - - - Helper that delegates to correct range builder - - - Expert: Callback for . - You need to overwrite only one of the methods. -

      NOTE: This is a very low-level interface, - the method signatures may change in later versions. -

      -
      - - Overwrite this method, if you like to receive the already prefix encoded range bounds. - You can directly build classical (inclusive) range queries from them. - - - - Overwrite this method, if you like to receive the raw long range bounds. - You can use this for e.g. debugging purposes (print out range bounds). - - - - Expert: Callback for . - You need to overwrite only one of the methods. -

      NOTE: This is a very low-level interface, - the method signatures may change in later versions. -

      -
      - - Overwrite this method, if you like to receive the already prefix encoded range bounds. - You can directly build classical range (inclusive) queries from them. - - - - Overwrite this method, if you like to receive the raw int range bounds. - You can use this for e.g. debugging purposes (print out range bounds). - - - - Provides support for converting byte sequences to Strings and back again. - The resulting Strings preserve the original byte sequences' sort order. - - The Strings are constructed using a Base 8000h encoding of the original - binary data - each char of an encoded String represents a 15-bit chunk - from the byte sequence. Base 8000h was chosen because it allows for all - lower 15 bits of char to be used without restriction; the surrogate range - [U+D8000-U+DFFF] does not represent valid chars, and would require - complicated handling to avoid them and allow use of char's high bit. - - Although unset bits are used as padding in the final char, the original - byte sequence could contain trailing bytes with no set bits (null bytes): - padding is indistinguishable from valid information. To overcome this - problem, a char is appended, indicating the number of encoded bytes in the - final content char. - - This class's operations are defined over CharBuffers and ByteBuffers, to - allow for wrapped arrays to be reused, reducing memory allocation costs for - repeated operations. Note that this class calls array() and arrayOffset() - on the CharBuffers and ByteBuffers it uses, so only wrapped arrays may be - used. This class interprets the arrayOffset() and limit() values returned by - its input buffers as beginning and end+1 positions on the wrapped array, - resprectively; similarly, on the output buffer, arrayOffset() is the first - position written to, and limit() is set to one past the final output array - position. - - - - Returns the number of chars required to encode the given byte sequence. - - - The byte sequence to be encoded. Must be backed by an array. - - The number of chars required to encode the given byte sequence - - IllegalArgumentException If the given ByteBuffer is not backed by an array - - - Returns the number of bytes required to decode the given char sequence. - - - The char sequence to be encoded. Must be backed by an array. - - The number of bytes required to decode the given char sequence - - IllegalArgumentException If the given CharBuffer is not backed by an array - - - Encodes the input byte sequence into the output char sequence. Before - calling this method, ensure that the output CharBuffer has sufficient - capacity by calling . - - - The byte sequence to encode - - Where the char sequence encoding result will go. The limit - is set to one past the position of the final char. - - IllegalArgumentException If either the input or the output buffer - is not backed by an array - - - - Decodes the input char sequence into the output byte sequence. Before - calling this method, ensure that the output ByteBuffer has sufficient - capacity by calling . - - - The char sequence to decode - - Where the byte sequence decoding result will go. The limit - is set to one past the position of the final char. - - IllegalArgumentException If either the input or the output buffer - is not backed by an array - - - - Decodes the given char sequence, which must have been encoded by - or - . - - - The char sequence to decode - - A byte sequence containing the decoding result. The limit - is set to one past the position of the final char. - - IllegalArgumentException If the input buffer is not backed by an - array - - - - Encodes the input byte sequence. - - - The byte sequence to encode - - A char sequence containing the encoding result. The limit is set - to one past the position of the final char. - - IllegalArgumentException If the input buffer is not backed by an - array - - - - Java's builtin ThreadLocal has a serious flaw: - it can take an arbitrarily long amount of time to - dereference the things you had stored in it, even once the - ThreadLocal instance itself is no longer referenced. - This is because there is single, master map stored for - each thread, which all ThreadLocals share, and that - master map only periodically purges "stale" entries. - - While not technically a memory leak, because eventually - the memory will be reclaimed, it can take a long time - and you can easily hit OutOfMemoryError because from the - GC's standpoint the stale entries are not reclaimaible. - - This class works around that, by only enrolling - WeakReference values into the ThreadLocal, and - separately holding a hard reference to each stored - value. When you call , these hard - references are cleared and then GC is freely able to - reclaim space by objects stored in it. - - - - - File-based implementation that uses - mmap for reading, and - for writing. - -

      NOTE: memory mapping uses up a portion of the - virtual memory address space in your process equal to the - size of the file being mapped. Before using this class, - be sure your have plenty of virtual address space, e.g. by - using a 64 bit JRE, or a 32 bit JRE with indexes that are - guaranteed to fit within the address space. - On 32 bit platforms also consult - if you have problems with mmap failing because of fragmented - address space. If you get an OutOfMemoryException, it is recommened - to reduce the chunk size, until it works. - -

      Due to - this bug in Sun's JRE, MMapDirectory's - is unable to close the underlying OS file handle. Only when GC - finally collects the underlying objects, which could be quite - some time later, will the file handle be closed. - -

      This will consume additional transient disk usage: on Windows, - attempts to delete or overwrite the files will result in an - exception; on other platforms, which typically have a "delete on - last close" semantics, while such operations will succeed, the bytes - are still consuming space on disk. For many applications this - limitation is not a problem (e.g. if you have plenty of disk space, - and you don't rely on overwriting files on Windows) but it's still - an important limitation to be aware of. - -

      This class supplies the workaround mentioned in the bug report - (disabled by default, see ), which may fail on - non-Sun JVMs. It forcefully unmaps the buffer on close by using - an undocumented internal cleanup functionality. - is true, if the workaround - can be enabled (with no guarantees). -

      -
      - - Create a new MMapDirectory for the named location. - - - the path of the directory - - the lock factory to use, or null for the default. - - IOException - - - Create a new MMapDirectory for the named location. - - - the path of the directory - - the lock factory to use, or null for the default. - - IOException - - - Create a new MMapDirectory for the named location and the default lock factory. - - - the path of the directory - - IOException - - - Create a new MMapDirectory for the named location and the default lock factory. - - - the path of the directory - - IOException - - - - - - - true, if this platform supports unmapping mmaped files. - - - This method enables the workaround for unmapping the buffers - from address space after closing , that is - mentioned in the bug report. This hack may fail on non-Sun JVMs. - It forcefully unmaps the buffer on close by using - an undocumented internal cleanup functionality. -

      NOTE: Enabling this is completely unsupported - by Java and may lead to JVM crashs if IndexInput - is closed while another thread is still accessing it (SIGSEGV). -

      - IllegalArgumentException if - is false and the workaround cannot be enabled. - -
      - - Returns true, if the unmap workaround is enabled. - - - - - Try to unmap the buffer, this method silently fails if no support - for that in the JVM. On Windows, this leads to the fact, - that mmapped files cannot be modified or deleted. - - - - Sets the maximum chunk size (default is for - 64 bit JVMs and 256 MiBytes for 32 bit JVMs) used for memory mapping. - Especially on 32 bit platform, the address space can be very fragmented, - so large index files cannot be mapped. - Using a lower chunk size makes the directory implementation a little - bit slower (as the correct chunk must be resolved on each seek) - but the chance is higher that mmap does not fail. On 64 bit - Java platforms, this parameter should always be , - as the adress space is big enough. - - - - Returns the current mmap chunk size. - - - - - Creates an IndexInput for the file with the given name. - - - Creates an IndexOutput for the file with the given name. - - - This exception is thrown when the write.lock - could not be acquired. This - happens when a writer tries to open an index - that another writer already has open. - - - - - - This exception is thrown when there is an attempt to - access something that has already been closed. - - - - The is used to timeout search requests that - take longer than the maximum allowed search time limit. After this time is - exceeded, the search thread is stopped by throwing a - . - - - - Default timer resolution. - - - - - Default for . - - - - - Create a TimeLimitedCollector wrapper over another with a specified timeout. - the wrapped - - max time allowed for collecting hits after which is thrown - - - - Return the timer resolution. - - - - - Set the timer resolution. - The default timer resolution is 20 milliseconds. - This means that a search required to take no longer than - 800 milliseconds may be stopped after 780 to 820 milliseconds. -
      Note that: - - Finer (smaller) resolution is more accurate but less efficient. - Setting resolution to less than 5 milliseconds will be silently modified to 5 milliseconds. - Setting resolution smaller than current resolution might take effect only after current - resolution. (Assume current resolution of 20 milliseconds is modified to 5 milliseconds, - then it can take up to 20 milliseconds for the change to have effect. - -
      -
      - - Checks if this time limited collector is greedy in collecting the last hit. - A non greedy collector, upon a timeout, would throw a - without allowing the wrapped collector to collect current doc. A greedy one would - first allow the wrapped hit collector to collect current doc and only then - throw a . - - - - - - Sets whether this time limited collector is greedy. - true to make this time limited greedy - - - - - - Calls on the decorated - unless the allowed time has passed, in which case it throws an exception. - - - TimeExceededException - if the time allowed has exceeded. - - - - - Support class used to handle threads - - - - - This interface should be implemented by any class whose instances are intended - to be executed by a thread. - - - - - This method has to be implemented in order that starting of the thread causes the object's - run method to be called in that separately executing thread. - - - - - Contains conversion support elements such as classes, interfaces and static methods. - - - - - Copies an array of chars obtained from a String into a specified array of chars - - The String to get the chars from - Position of the String to start getting the chars - Position of the String to end getting the chars - Array to return the chars - Position of the destination array of chars to start storing the chars - An array of chars - - - - Support class used to handle threads - - - - - The instance of System.Threading.Thread - - - - - Initializes a new instance of the ThreadClass class - - - - - Initializes a new instance of the Thread class. - - The name of the thread - - - - Initializes a new instance of the Thread class. - - A ThreadStart delegate that references the methods to be invoked when this thread begins executing - - - - Initializes a new instance of the Thread class. - - A ThreadStart delegate that references the methods to be invoked when this thread begins executing - The name of the thread - - - - This method has no functionality unless the method is overridden - - - - - Causes the operating system to change the state of the current thread instance to ThreadState.Running - - - - - Interrupts a thread that is in the WaitSleepJoin thread state - - - - - Blocks the calling thread until a thread terminates - - - - - Blocks the calling thread until a thread terminates or the specified time elapses - - Time of wait in milliseconds - - - - Blocks the calling thread until a thread terminates or the specified time elapses - - Time of wait in milliseconds - Time of wait in nanoseconds - - - - Resumes a thread that has been suspended - - - - - Raises a ThreadAbortException in the thread on which it is invoked, - to begin the process of terminating the thread. Calling this method - usually terminates the thread - - - - - Raises a ThreadAbortException in the thread on which it is invoked, - to begin the process of terminating the thread while also providing - exception information about the thread termination. - Calling this method usually terminates the thread. - - An object that contains application-specific information, such as state, which can be used by the thread being aborted - - - - Suspends the thread, if the thread is already suspended it has no effect - - - - - Obtain a String that represents the current object - - A String that represents the current object - - - - Gets the currently running thread - - The currently running thread - - - - Gets the current thread instance - - - - - Gets or sets the name of the thread - - - - - Gets or sets a value indicating the scheduling priority of a thread - - - - - Gets a value indicating the execution status of the current thread - - - - - Gets or sets a value indicating whether or not a thread is a background thread. - - - - - Represents the methods to support some operations over files. - - - - - Returns an array of abstract pathnames representing the files and directories of the specified path. - - The abstract pathname to list it childs. - An array of abstract pathnames childs of the path specified or null if the path is not a directory - - - - Returns a list of files in a give directory. - - The full path name to the directory. - - An array containing the files. - - - - Flushes the specified file stream. Ensures that all buffered - data is actually written to the file system. - - The file stream. - - - - A simple class for number conversions. - - - - - Min radix value. - - - - - Max radix value. - - - - - Converts a number to System.String. - - - - - - - Converts a number to System.String. - - - - - - - Converts a number to System.String in the specified radix. - - A number to be converted. - A radix. - A System.String representation of the number in the specified redix. - - - - Parses a number in the specified radix. - - An input System.String. - A radix. - The parsed number in the specified radix. - - - - Performs an unsigned bitwise right shift with the specified number - - Number to operate on - Ammount of bits to shift - The resulting number from the shift operation - - - - Performs an unsigned bitwise right shift with the specified number - - Number to operate on - Ammount of bits to shift - The resulting number from the shift operation - - - - Returns the index of the first bit that is set to true that occurs - on or after the specified starting index. If no such bit exists - then -1 is returned. - - The BitArray object. - The index to start checking from (inclusive). - The index of the next set bit. - - - - Converts a System.String number to long. - - - - - - - Mimics Java's Character class. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This class provides supporting methods of java.util.BitSet - that are not present in System.Collections.BitArray. - - - - - Returns the next set bit at or after index, or -1 if no such bit exists. - - - the index of bit array at which to start checking - the next set bit or -1 - - - - Returns the next un-set bit at or after index, or -1 if no such bit exists. - - - the index of bit array at which to start checking - the next set bit or -1 - - - - Returns the number of bits set to true in this BitSet. - - The BitArray object. - The number of bits set to true in this BitSet. - - - - Summary description for TestSupportClass. - - - - - Compares two Term arrays for equality. - - First Term array to compare - Second Term array to compare - true if the Terms are equal in both arrays, false otherwise - - - - A Hashtable which holds weak references to its keys so they - can be collected during GC. - - - - - Serves as a simple "GC Monitor" that indicates whether cleanup is needed. - If collectableObject.IsAlive is false, GC has occurred and we should perform cleanup - - - - - Customize the hashtable lookup process by overriding KeyEquals. KeyEquals - will compare both WeakKey to WeakKey and WeakKey to real keys - - - - - Perform cleanup if GC occurred - - - - - Iterate over all keys and remove keys that were collected - - - - - Wrap each key with a WeakKey and add it to the hashtable - - - - - Create a temporary copy of the real keys and return that - - - - - A weak referene wrapper for the hashtable keys. Whenever a key\value pair - is added to the hashtable, the key is wrapped using a WeakKey. WeakKey saves the - value of the original object hashcode for fast comparison. - - - - - A Dictionary enumerator which wraps the original hashtable enumerator - and performs 2 tasks: Extract the real key from a WeakKey and skip keys - that were already collected. - - - - - Support class used to handle Hashtable addition, which does a check - first to make sure the added item is unique in the hash. - - - - - Converts the specified collection to its string representation. - - The collection to convert to string. - A string representation of the specified collection. - - - - Compares two string arrays for equality. - - First string array list to compare - Second string array list to compare - true if the strings are equal in both arrays, false otherwise - - - - Sorts an IList collections - - The System.Collections.IList instance that will be sorted - The Comparator criteria, null to use natural comparator. - - - - Fills the array with an specific value from an specific index to an specific index. - - The array to be filled. - The first index to be filled. - The last index to be filled. - The value to fill the array with. - - - - Fills the array with an specific value. - - The array to be filled. - The value to fill the array with. - - - - Compares the entire members of one array whith the other one. - - The array to be compared. - The array to be compared with. - Returns true if the two specified arrays of Objects are equal - to one another. The two arrays are considered equal if both arrays - contain the same number of elements, and all corresponding pairs of - elements in the two arrays are equal. Two objects e1 and e2 are - considered equal if (e1==null ? e2==null : e1.equals(e2)). In other - words, the two arrays are equal if they contain the same elements in - the same order. Also, two array references are considered equal if - both are null. - - - A collection of which can be - looked up by instances of . - The type of the items contains in this - collection. - The type of the keys that can be used to look - up the items. - - - Creates a new instance of the - class. - The which will convert - instances of to - when the override of is called. - - - The which will convert - instances of to - when the override of is called. - - - Converts an item that is added to the collection to - a key. - The instance of - to convert into an instance of . - The instance of which is the - key for this item. - - - Determines if a key for an item exists in this - collection. - The instance of - to see if it exists in this collection. - True if the key exists in the collection, false otherwise. - - - Represents a strongly typed list of objects that can be accessed by index. - Provides methods to search, sort, and manipulate lists. Also provides functionality - to compare lists against each other through an implementations of - . - The type of elements in the list. - - - Initializes a new instance of the - class that is empty and has the - default initial capacity. - - - Initializes a new instance of the - class that contains elements copied from the specified collection and has - sufficient capacity to accommodate the number of elements copied. - The collection whose elements are copied to the new list. - - - Initializes a new instance of the - class that is empty and has the specified initial capacity. - The number of elements that the new list can initially store. - - - Adds a range of objects represented by the - implementation. - The - implementation to add to this list. - - - Compares the counts of two - implementations. - This uses a trick in LINQ, sniffing types for implementations - of interfaces that might supply shortcuts when trying to make comparisons. - In this case, that is the and - interfaces, either of which can provide a count - which can be used in determining the equality of sequences (if they don't have - the same count, then they can't be equal). - The from the left hand side of the - comparison to check the count of. - The from the right hand side of the - comparison to check the count of. - Null if the result is indeterminate. This occurs when either - or doesn't implement or . - Otherwise, it will get the count from each and return true if they are equal, false otherwise. - - - Compares the contents of a - implementation to another one to determine equality. - Thinking of the implementation as - a string with any number of characters, the algorithm checks - each item in each list. If any item of the list is not equal (or - one list contains all the elements of another list), then that list - element is compared to the other list element to see which - list is greater. - The implementation - that is considered the left hand side. - The implementation - that is considered the right hand side. - True if the items are equal, false otherwise. - - - Compares this sequence to another - implementation, returning true if they are equal, false otherwise. - The other implementation - to compare against. - True if the sequence in - is the same as this one. - - - Compares this object for equality against other. - The other object to compare this object against. - True if this object and are equal, false - otherwise. - - - Gets the hash code for the list. - The hash code value. - - - Gets the hash code for the list. - The - implementation which will have all the contents hashed. - The hash code value. - - - Clones the . - This is a shallow clone. - A new shallow clone of this - . - - - - A simple wrapper to allow for the use of the GeneralKeyedCollection. The - wrapper is required as there can be several keys for an object depending - on how many interfaces it implements. - - - - - Provides platform infos. - - - - - Whether we run under a Unix platform. - - - - - Whether we run under a supported Windows platform. - - - - - For Debuging purposes. - - - - TimerThread provides a pseudo-clock service to all searching - threads, so that they can count elapsed time with less overhead - than repeatedly calling System.currentTimeMillis. A single - thread should be created to be used for all searches. - - - - Get the timer value in milliseconds. - - - Thrown when elapsed search time exceeds allowed search time. - - - Returns allowed time (milliseconds). - - - Returns elapsed time (milliseconds). - - - Returns last doc(absolute doc id) that was collected when the search time exceeded. - - - Expert: returns a comparator for sorting ScoreDocs. - -

      - Created: Apr 21, 2004 3:49:28 PM - - This class will be used as part of a key to a FieldCache value. You must - implement hashCode and equals to avoid an explosion in RAM usage if you use - instances that are not the same instance. If you are searching using the - Remote contrib, the same instance of this class on the client will be a new - instance on every call to the server, so hashCode/equals is very important in - that situation. - -

      - $Id: SortComparatorSource.java 747019 2009-02-23 13:59:50Z - mikemccand $ - - 1.4 - - Please use instead. - -
      - - Creates a comparator for the field in the given index. - Index to create comparator for. - - Name of the field to create comparator for. - - Comparator of ScoreDoc objects. - - IOException If an error occurs reading the index. - - - Abstract base class for sorting hits returned by a Query. - -

      - This class should only be used if the other SortField types (SCORE, DOC, - STRING, INT, FLOAT) do not provide an adequate sorting. It maintains an - internal cache of values which could be quite large. The cache is an array of - Comparable, one for each document in the index. There is a distinct - Comparable for each unique term in the field - if some documents have the - same term in the field, the cache array will have entries which reference the - same Comparable. - - This class will be used as part of a key to a FieldCache value. You must - implement hashCode and equals to avoid an explosion in RAM usage if you use - instances that are not the same instance. If you are searching using the - Remote contrib, the same instance of this class on the client will be a new - instance on every call to the server, so hashCode/equals is very important in - that situation. - -

      - Created: Apr 21, 2004 5:08:38 PM - - -

      - $Id: SortComparator.java 800119 2009-08-02 17:59:21Z markrmiller $ - - 1.4 - - Please use instead. - -
      - - Returns an object which, when sorted according to natural order, - will order the Term values in the correct order. -

      For example, if the Terms contained integer values, this method - would return new Integer(termtext). Note that this - might not always be the most efficient implementation - for this - particular example, a better implementation might be to make a - ScoreDocLookupComparator that uses an internal lookup table of int. -

      - The textual value of the term. - - An object representing termtext that sorts according to the natural order of termtext. - - - - - -
      - - Returns the maximum payload score seen, else 1 if there are no payloads on the doc. -

      - Is thread safe and completely reusable. - - -

      -
      - - An abstract class that defines a way for Payload*Query instances - to transform the cumulative effects of payload scores for a document. - - - for more information - -

      - This class and its derivations are experimental and subject to change - - - - - -

      Calculate the score up to this point for this doc and field - The current doc - - The field - - The start position of the matching Span - - The end position of the matching Span - - The number of payloads seen so far - - The current score so far - - The score for the current payload - - The new current Score - - - - -
      - - Calculate the final score for all the payloads seen so far for this doc/field - The current doc - - The current field - - The total number of payloads seen on this document - - The raw score for those payloads - - The final score for the payloads - - - - MessageBundles classes extend this class, to implement a bundle. - - For Native Language Support (NLS), system of software internationalization. - - This interface is similar to the NLS class in eclipse.osgi.util.NLS class - - initializeMessages() method resets the values of all static strings, should - only be called by classes that extend from NLS (see TestMessages.java for - reference) - performs validation of all message in a bundle, at class load - time - performs per message validation at runtime - see NLSTest.java for - usage reference - - MessageBundle classes may subclass this type. - - - - Initialize a given class with the message bundle Keys Should be called from - a class that extends NLS in a static block at class load time. - - - Property file with that contains the message bundle - - where constants will reside - - - - - - - - - - - - - - - - Message Key - - - - - Performs the priviliged action. - - A value that may represent the result of the action. - - - The TermVectorOffsetInfo class holds information pertaining to a Term in a 's - offset information. This offset information is the character offset as set during the Analysis phase (and thus may not be the actual offset in the - original content). - - - - Convenience declaration when creating a that stores only position information. - - - The accessor for the ending offset for the term - The offset - - - - The accessor for the starting offset of the term. - - - The offset - - - - Two TermVectorOffsetInfos are equals if both the start and end offsets are the same - The comparison Object - - true if both and are the same for both objects. - - - - A that simply does each merge - sequentially, using the current thread. - - - -

      Expert: uses an instance - implementing this interface to execute the merges - selected by a . The default - MergeScheduler is .

      - -

      NOTE: This API is new and still experimental - (subject to change suddenly in the next release)

      - -

      NOTE: This class typically requires access to - package-private APIs (eg, SegmentInfos) to do its job; - if you implement your own MergePolicy, you'll need to put - it in package Lucene.Net.Index in order to use - these APIs. -

      -
      - - Run the merges provided by . - - - Close this MergeScheduler. - - - Just do the merges in sequence. We do this - "synchronized" so that even if the application is using - multiple threads, only one merge may run at a time. - - - - This class tracks the number and position / offset parameters of terms - being added to the index. The information collected in this class is - also used to calculate the normalization factor for a field. - -

      WARNING: This API is new and experimental, and may suddenly - change.

      -

      -
      - - Re-initialize the state, using this boost value. - boost value to use. - - - - Get the last processed term position. - the position - - - - Get total number of terms in this field. - the length - - - - Get the number of terms with positionIncrement == 0. - the numOverlap - - - - Get end offset of the last processed term. - the offset - - - - Get boost value. This is the cumulative product of - document boost and field boost for all field instances - sharing the same field name. - - the boost - - - - The term text of a Token. - - - Base class for Attributes that can be added to a - . -

      - Attributes are used to add data in a dynamic, yet type-safe way to a source - of usually streamed objects, e. g. a . -

      -
      - - Clears the values in this AttributeImpl and resets it to its - default value. If this implementation implements more than one Attribute interface - it clears all. - - - - The default implementation of this method accesses all declared - fields of this object and prints the values in the following syntax: - - - public String toString() { - return "start=" + startOffset + ",end=" + endOffset; - } - - - This method may be overridden by subclasses. - - - - Subclasses must implement this method and should compute - a hashCode similar to this: - - public int hashCode() { - int code = startOffset; - code = code * 31 + endOffset; - return code; - } - - - see also - - - - All values used for computation of - should be checked here for equality. - - see also - - - - Copies the values from this Attribute into the passed-in - target attribute. The target implementation must support all the - Attributes this implementation supports. - - - - Shallow clone. Subclasses must override this if they - need to clone any members deeply, - - - - The term text of a Token. - - - Returns the Token's term text. - - This method has a performance penalty - because the text is stored internally in a char[]. If - possible, use and - directly instead. If you really need a - String, use this method, which is nothing more than - a convenience call to new String(token.termBuffer(), 0, token.termLength()) - - - - Copies the contents of buffer, starting at offset for - length characters, into the termBuffer array. - - the buffer to copy - - the index in the buffer of the first character to copy - - the number of characters to copy - - - - Copies the contents of buffer into the termBuffer array. - the buffer to copy - - - - Copies the contents of buffer, starting at offset and continuing - for length characters, into the termBuffer array. - - the buffer to copy - - the index in the buffer of the first character to copy - - the number of characters to copy - - - - Returns the internal termBuffer character array which - you can then directly alter. If the array is too - small for your token, use - to increase it. After - altering the buffer be sure to call - to record the number of valid - characters that were placed into the termBuffer. - - - - Grows the termBuffer to at least size newSize, preserving the - existing content. Note: If the next operation is to change - the contents of the term buffer use - , - , or - - to optimally combine the resize with the setting of the termBuffer. - - minimum size of the new termBuffer - - newly created termBuffer with length >= newSize - - - - Return number of valid characters (length of the term) - in the termBuffer array. - - - - Set number of valid characters (length of the term) in - the termBuffer array. Use this to truncate the termBuffer - or to synchronize with external manipulation of the termBuffer. - Note: to grow the size of the array, - use first. - - the truncated length - - - - Returns the Token's term text. - - This method has a performance penalty - because the text is stored internally in a char[]. If - possible, use and - directly instead. If you - really need a String, use this method, which is nothing more than - a convenience call to new String(token.termBuffer(), 0, token.termLength()) - - - - Copies the contents of buffer, starting at offset for - length characters, into the termBuffer array. - - the buffer to copy - - the index in the buffer of the first character to copy - - the number of characters to copy - - - - Copies the contents of buffer into the termBuffer array. - the buffer to copy - - - - Copies the contents of buffer, starting at offset and continuing - for length characters, into the termBuffer array. - - the buffer to copy - - the index in the buffer of the first character to copy - - the number of characters to copy - - - - Returns the internal termBuffer character array which - you can then directly alter. If the array is too - small for your token, use - to increase it. After - altering the buffer be sure to call - to record the number of valid - characters that were placed into the termBuffer. - - - - Grows the termBuffer to at least size newSize, preserving the - existing content. Note: If the next operation is to change - the contents of the term buffer use - , - , or - - to optimally combine the resize with the setting of the termBuffer. - - minimum size of the new termBuffer - - newly created termBuffer with length >= newSize - - - - Allocates a buffer char[] of at least newSize, without preserving the existing content. - its always used in places that set the content - - minimum size of the buffer - - - - Return number of valid characters (length of the term) - in the termBuffer array. - - - - Set number of valid characters (length of the term) in - the termBuffer array. Use this to truncate the termBuffer - or to synchronize with external manipulation of the termBuffer. - Note: to grow the size of the array, - use first. - - the truncated length - - - - This class can be used if the token attributes of a TokenStream - are intended to be consumed more than once. It caches - all token attribute states locally in a List. - -

      CachingTokenFilter implements the optional method - , which repositions the - stream to the first Token. -

      -
      - - Will be removed in Lucene 3.0. This method is final, as it should - not be overridden. Delegates to the backwards compatibility layer. - - - - Will be removed in Lucene 3.0. This method is final, as it should - not be overridden. Delegates to the backwards compatibility layer. - - - - Methods for manipulating strings. - - $Id: StringHelper.java 801344 2009-08-05 18:05:06Z yonik $ - - - - Expert: - The StringInterner implementation used by Lucene. - This shouldn't be changed to an incompatible implementation after other Lucene APIs have been used. - - - - Return the same string object for all equal strings - - - Compares two byte[] arrays, element by element, and returns the - number of elements common to both arrays. - - - The first byte[] to compare - - - The second byte[] to compare - - - The number of common elements. - - - - Compares two strings, character by character, and returns the - first position where the two strings differ from one another. - - - The first string to compare - - The second string to compare - - The first position where the two strings differ. - - - - Base class for cache implementations. - - - Returns a thread-safe cache backed by the specified cache. - In order to guarantee thread-safety, all access to the backed cache must - be accomplished through the returned cache. - - - - Called by . This method - returns a instance that wraps - this instance by default and can be overridden to return - e. g. subclasses of or this - in case this cache is already synchronized. - - - - Puts a (key, value)-pair into the cache. - - - Returns the value for the given key. - - - Returns whether the given key is in this cache. - - - Closes the cache. - - - Simple Cache wrapper that synchronizes all - calls that access the cache. - - - - Implements for a single in-process instance, - meaning all locking will take place through this one instance. - Only use this when you are certain all - IndexReaders and IndexWriters for a given index are running - against a single shared in-process Directory instance. This is - currently the default locking for RAMDirectory. - - - - - - - An interprocess mutex lock. -

      Typical use might look like: - new Lock.With(directory.makeLock("my.lock")) { - public Object doBody() { - ... code to execute while locked ... - } - }.run(); - - - -

      - $Id: Lock.java 769409 2009-04-28 14:05:43Z mikemccand $ - - - -
      - - Pass this value to to try - forever to obtain the lock. - - - - How long waits, in milliseconds, - in between attempts to acquire the lock. - - - - Attempts to obtain exclusive access and immediately return - upon success or failure. - - true iff exclusive access is obtained - - - - If a lock obtain called, this failureReason may be set - with the "root cause" Exception as to why the lock was - not obtained. - - - - Attempts to obtain an exclusive lock within amount of - time given. Polls once per - (currently 1000) milliseconds until lockWaitTimeout is - passed. - - length of time to wait in - milliseconds or - to retry forever - - true if lock was obtained - - LockObtainFailedException if lock wait times out - IllegalArgumentException if lockWaitTimeout is - out of bounds - - IOException if obtain() throws IOException - - - Releases exclusive access. - - - Returns true if the resource is currently locked. Note that one must - still call before using the resource. - - - - Utility class for executing code with exclusive access. - - - Constructs an executor that will grab the named lock. - - - Code to execute with exclusive access. - - - Calls while lock is obtained. Blocks if lock - cannot be obtained immediately. Retries to obtain lock once per second - until it is obtained, or until it has tried ten times. Lock is released when - exits. - - LockObtainFailedException if lock could not - be obtained - - IOException if throws IOException - - - A that sorts by using - s. -

      - See the method - for instantiating a TopFieldCollector. - -

      NOTE: This API is experimental and might change in - incompatible ways in the next release.

      -

      -
      - - A base class for all collectors that return a output. This - collector allows easy extension by providing a single constructor which - accepts a as well as protected members for that - priority queue and a counter of the number of total hits.
      - Extending classes can override and - in order to provide their own implementation. -
      -
      - - The priority queue which holds the top documents. Note that different - implementations of PriorityQueue give different meaning to 'top documents'. - HitQueue for example aggregates the top scoring documents, while other PQ - implementations may hold documents sorted by other criteria. - - - - The total number of documents that the collector encountered. - - - Populates the results array with the ScoreDoc instaces. This can be - overridden in case a different ScoreDoc type should be returned. - - - - Returns a instance containing the given results. If - results is null it means there are no results to return, - either because there were 0 calls to collect() or because the arguments to - topDocs were invalid. - - - - The total number of documents that matched this query. - - - Returns the top docs that were collected by this collector. - - - Returns the documents in the rage [start .. pq.size()) that were collected - by this collector. Note that if start >= pq.size(), an empty TopDocs is - returned.
      - This method is convenient to call if the application allways asks for the - last results, starting from the last 'page'.
      - NOTE: you cannot call this method more than once for each search - execution. If you need to call it more than once, passing each time a - different start, you should call and work - with the returned object, which will contain all the - results this search execution collected. -
      -
      - - Returns the documents in the rage [start .. start+howMany) that were - collected by this collector. Note that if start >= pq.size(), an empty - TopDocs is returned, and if pq.size() - start < howMany, then only the - available documents in [start .. pq.size()) are returned.
      - This method is useful to call in case pagination of search results is - allowed by the search application, as well as it attempts to optimize the - memory used by allocating only as much as requested by howMany.
      - NOTE: you cannot call this method more than once for each search - execution. If you need to call it more than once, passing each time a - different range, you should call and work with the - returned object, which will contain all the results this - search execution collected. -
      -
      - - Creates a new from the given - arguments. - -

      NOTE: The instances returned by this method - pre-allocate a full array of length - numHits. - -

      - the sort criteria (SortFields). - - the number of results to collect. - - specifies whether the actual field values should be returned on - the results (FieldDoc). - - specifies whether document scores should be tracked and set on the - results. Note that if set to false, then the results' scores will - be set to Float.NaN. Setting this to true affects performance, as - it incurs the score computation on each competitive result. - Therefore if document scores are not required by the application, - it is recommended to set it to false. - - specifies whether the query's maxScore should be tracked and set - on the resulting . Note that if set to false, - returns Float.NaN. Setting this to - true affects performance as it incurs the score computation on - each result. Also, setting this true automatically sets - trackDocScores to true as well. - - specifies whether documents are scored in doc Id order or not by - the given in . - - a instance which will sort the results by - the sort criteria. - - IOException -
      - - Calculate the final score as the average score of all payloads seen. -

      - Is thread safe and completely reusable. - - -

      -
      - - Implements search over a single IndexReader. - -

      Applications usually need only call the inherited - or methods. For performance reasons it is - recommended to open only one IndexSearcher and use it for all of your searches. - -

      Note that you can only access Hits from an IndexSearcher as long as it is - not yet closed, otherwise an IOException will be thrown. - -

      NOTE: - instances are completely - thread safe, meaning multiple threads can call any of its - methods, concurrently. If your application requires - external synchronization, you should not - synchronize on the IndexSearcher instance; - use your own (non-Lucene) objects instead.

      -

      -
      - - An abstract base class for search implementations. Implements the main search - methods. - -

      - Note that you can only access hits from a Searcher as long as it is not yet - closed, otherwise an IOException will be thrown. -

      -
      - - The interface for search implementations. - -

      - Searchable is the abstract network protocol for searching. Implementations - provide search over a single index, over multiple indices, and over indices - on remote servers. - -

      - Queries, filters and sort criteria are designed to be compact so that they - may be efficiently passed to a remote index, with only the top-scoring hits - being returned, rather than every matching hit. - - NOTE: this interface is kept public for convenience. Since it is not - expected to be implemented directly, it may be changed unexpectedly between - releases. -

      -
      - - Lower-level search API. - -

      is called for every non-zero - scoring document. -
      HitCollector-based access to remote indexes is discouraged. - -

      Applications should only use this if they need all of the - matching documents. The high-level search API () - is usually more efficient, as it skips - non-high-scoring hits. - -

      - to match documents - - if non-null, used to permit documents to be collected. - - to receive hits - - BooleanQuery.TooManyClauses - use instead. - -
      - - Lower-level search API. - -

      - is called for every document.
      - Collector-based access to remote indexes is discouraged. - -

      - Applications should only use this if they need all of the matching - documents. The high-level search API () is - usually more efficient, as it skips non-high-scoring hits. - -

      - to match documents - - if non-null, used to permit documents to be collected. - - to receive hits - - BooleanQuery.TooManyClauses -
      - - Frees resources associated with this Searcher. - Be careful not to call this method while you are still using objects - like . - - - - Expert: Returns the number of documents containing term. - Called by search code to compute term weights. - - - - - - Expert: For each term in the terms array, calculates the number of - documents containing term. Returns an array with these - document frequencies. Used to minimize number of remote calls. - - - - Expert: Returns one greater than the largest possible document number. - Called by search code to compute term weights. - - - - - - Expert: Low-level search implementation. Finds the top n - hits for query, applying filter if non-null. - -

      Called by . - -

      Applications should usually call or - instead. -

      - BooleanQuery.TooManyClauses -
      - - Expert: Returns the stored fields of document i. - Called by implementations. - - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Get the at the nth position. The - may be used to determine what s to load and how they should be loaded. - - NOTE: If the underlying Reader (more specifically, the underlying FieldsReader) is closed before the lazy is - loaded an exception may be thrown. If you want the value of a lazy to be available after closing you must - explicitly load it or fetch the Document again with a new loader. - - - - Get the document at the nth position - - The to use to determine what Fields should be loaded on the Document. May be null, in which case all Fields will be loaded. - - The stored fields of the at the nth position - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - - - - - - - - - - - - - Expert: called to re-write queries into primitive queries. - BooleanQuery.TooManyClauses - - - Expert: low-level implementation method - Returns an Explanation that describes how doc scored against - weight. - -

      This is intended to be used in developing Similarity implementations, - and, for good performance, should not be displayed with every hit. - Computing an explanation is as expensive as executing the query over the - entire index. -

      Applications should call . -

      - BooleanQuery.TooManyClauses -
      - - Expert: Low-level search implementation with arbitrary sorting. Finds - the top n hits for query, applying - filter if non-null, and sorting the hits by the criteria in - sort. - -

      Applications should usually call - instead. - -

      - BooleanQuery.TooManyClauses -
      - - Returns the documents matching query. - BooleanQuery.TooManyClauses - Hits will be removed in Lucene 3.0. Use - instead. - - - - Returns the documents matching query and - filter. - - BooleanQuery.TooManyClauses - Hits will be removed in Lucene 3.0. Use - instead. - - - - Returns documents matching query sorted by - sort. - - BooleanQuery.TooManyClauses - Hits will be removed in Lucene 3.0. Use - instead. - - - - Returns documents matching query and filter, - sorted by sort. - - BooleanQuery.TooManyClauses - Hits will be removed in Lucene 3.0. Use - instead. - - - - Search implementation with arbitrary sorting. Finds - the top n hits for query, applying - filter if non-null, and sorting the hits by the criteria in - sort. - -

      NOTE: this does not compute scores by default; use - to enable scoring. - -

      - BooleanQuery.TooManyClauses -
      - - Lower-level search API. - -

      is called for every matching - document. - -

      Applications should only use this if they need all of the - matching documents. The high-level search API () - is usually more efficient, as it skips - non-high-scoring hits. -

      Note: The score passed to this method is a raw score. - In other words, the score will not necessarily be a float whose value is - between 0 and 1. -

      - BooleanQuery.TooManyClauses - use instead. - -
      - - Lower-level search API. - -

      is called for every matching document. - -

      Applications should only use this if they need all of the matching - documents. The high-level search API ( - ) is usually more efficient, as it skips non-high-scoring hits. -

      Note: The score passed to this method is a raw score. - In other words, the score will not necessarily be a float whose value is - between 0 and 1. -

      - BooleanQuery.TooManyClauses -
      - - Lower-level search API. - -

      is called for every matching - document. -
      HitCollector-based access to remote indexes is discouraged. - -

      Applications should only use this if they need all of the - matching documents. The high-level search API () - is usually more efficient, as it skips - non-high-scoring hits. - -

      - to match documents - - if non-null, used to permit documents to be collected. - - to receive hits - - BooleanQuery.TooManyClauses - use instead. - -
      - - Lower-level search API. - -

      is called for every matching - document. -
      Collector-based access to remote indexes is discouraged. - -

      Applications should only use this if they need all of the - matching documents. The high-level search API () - is usually more efficient, as it skips - non-high-scoring hits. - -

      - to match documents - - if non-null, used to permit documents to be collected. - - to receive hits - - BooleanQuery.TooManyClauses -
      - - Finds the top n - hits for query, applying filter if non-null. - - - BooleanQuery.TooManyClauses - - - Finds the top n - hits for query. - - - BooleanQuery.TooManyClauses - - - Returns an Explanation that describes how doc scored against - query. - -

      This is intended to be used in developing Similarity implementations, - and, for good performance, should not be displayed with every hit. - Computing an explanation is as expensive as executing the query over the - entire index. -

      -
      - - The Similarity implementation used by this searcher. - - - Expert: Set the Similarity implementation used by this Searcher. - - - - - - - Expert: Return the Similarity implementation used by this Searcher. - -

      This defaults to the current value of . -

      -
      - - creates a weight for query - new weight - - - - use instead. - - - - Creates a searcher searching the index in the named directory. - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - Use instead - - - - Creates a searcher searching the index in the named - directory. You should pass readOnly=true, since it - gives much better concurrent performance, unless you - intend to do write operations (delete documents or - change norms) with the underlying IndexReader. - - directory where IndexReader will be opened - - if true, the underlying IndexReader - will be opened readOnly - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - Use instead - - - - Creates a searcher searching the index in the provided directory. - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - Use instead - - - - Creates a searcher searching the index in the named - directory. You should pass readOnly=true, since it - gives much better concurrent performance, unless you - intend to do write operations (delete documents or - change norms) with the underlying IndexReader. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - directory where IndexReader will be opened - - if true, the underlying IndexReader - will be opened readOnly - - - - Creates a searcher searching the provided index. - - - Return the this searches. - - - Note that the underlying IndexReader is not closed, if - IndexSearcher was constructed with IndexSearcher(IndexReader r). - If the IndexReader was supplied implicitly by specifying a directory, then - the IndexReader gets closed. - - - - - .NET - - - - Just like , but you choose - whether or not the fields in the returned instances - should be set by specifying fillFields.
      - -

      - NOTE: this does not compute scores by default. If you need scores, create - a instance by calling - and then pass that to - . -

      -

      -
      - - By default, no scores are computed when sorting by field (using - ). You can change that, per - IndexSearcher instance, by calling this method. Note that this will incur - a CPU cost. - - - If true, then scores are returned for every matching document - in . - - - If true, then the max score for all matching docs is computed. - - - - A query that scores each document as the value of the numeric input field. -

      - The query matches all documents, and scores each document according to the numeric - value of that field. -

      - It is assumed, and expected, that: - - The field used here is indexed, and has exactly - one token in every scored document. - Best if this field is un_tokenized. - That token is parsable to the selected type. - -

      - Combining this query in a FunctionQuery allows much freedom in affecting document scores. - Note, that with this freedom comes responsibility: it is more than likely that the - default Lucene scoring is superior in quality to scoring modified as explained here. - However, in some cases, and certainly for research experiments, this capability may turn useful. -

      - When contructing this query, select the appropriate type. That type should match the data stored in the - field. So in fact the "right" type should be selected before indexing. Type selection - has effect on the RAM usage: - - consumes 1 * maxDocs bytes. - consumes 2 * maxDocs bytes. - consumes 4 * maxDocs bytes. - consumes 8 * maxDocs bytes. - -

      - Caching: - Values for the numeric field are loaded once and cached in memory for further use with the same IndexReader. - To take advantage of this, it is extremely important to reuse index-readers or index-searchers, - otherwise, for instance if for each query a new index reader is opened, large penalties would be - paid for loading the field values into memory over and over again! - -

      - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. -

      -
      - - Expert: A Query that sets the scores of document to the - values obtained from a ValueSource. -

      - This query provides a score for each and every undeleted document in the index. -

      - The value source can be based on a (cached) value of an indexed field, but it - can also be based on an external source, e.g. values read from an external database. -

      - Score is set as: Score(doc,query) = query.getBoost()2 * valueSource(doc). - -

      - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. -

      -
      - - Create a value source query - provides the values defines the function to be used for scoring - - - - Returns true if o is equal to this. - - - Returns a hash code value for this object. - - - A scorer that (simply) matches all documents, and scores each document with - the value of the value soure in effect. As an example, if the value source - is a (cached) field source, then value of that field in that document will - be used. (assuming field is indexed for this doc, with a single token.) - - - - use instead. - - - - use instead. - - - - use instead. - - - - Create a FieldScoreQuery - a query that scores each document as the value of the numeric input field. -

      - The type param tells how to parse the field string values into a numeric score value. -

      - the numeric field to be used. - - the type of the field: either - , , , or . - -
      - - Type of score field, indicating how field values are interpreted/parsed. -

      - The type selected at search search time should match the data stored in the field. - Different types have different RAM requirements: - - consumes 1 * maxDocs bytes. - consumes 2 * maxDocs bytes. - consumes 4 * maxDocs bytes. - consumes 8 * maxDocs bytes. - -

      -
      - - field values are interpreted as numeric byte values. - - - field values are interpreted as numeric short values. - - - field values are interpreted as numeric int values. - - - field values are interpreted as numeric float values. - - - An alternative to BooleanScorer that also allows a minimum number - of optional scorers that should match. -
      Implements skipTo(), and has no limitations on the numbers of added scorers. -
      Uses ConjunctionScorer, DisjunctionScorer, ReqOptScorer and ReqExclScorer. -
      -
      - - The scorer to which all scoring will be delegated, - except for computing and using the coordination factor. - - - - The number of optionalScorers that need to match (if there are any) - - - Creates a with the given similarity and lists of required, - prohibited and optional scorers. In no required scorers are added, at least - one of the optional scorers will have to match during the search. - - - The similarity to be used. - - The minimum number of optional added scorers that should match - during the search. In case no required scorers are added, at least - one of the optional scorers will have to match during the search. - - the list of required scorers. - - the list of prohibited scorers. - - the list of optional scorers. - - - - Returns the scorer to be used for match counting and score summing. - Uses requiredScorers, optionalScorers and prohibitedScorers. - - - - Returns the scorer to be used for match counting and score summing. - Uses the given required scorer and the prohibitedScorers. - - A required scorer already built. - - - - Scores and collects all matching documents. - The collector to which all matching documents are passed through - . -
      When this method is used the method should not be used. - - use instead. - -
      - - Scores and collects all matching documents. - The collector to which all matching documents are passed through. -
      When this method is used the method should not be used. - -
      - - Expert: Collects matching documents in a range. -
      Note that must be called once before this method is - called for the first time. -
      - The collector to which all matching documents are passed through - . - - Do not score documents past this. - - true if more matching documents may remain. - - use instead. - -
      - - use instead. - - - - use instead. - - - - use instead. - - - - Throws an UnsupportedOperationException. - TODO: Implement an explanation of the coordination factor. - - The document number for the explanation. - - UnsupportedOperationException - - - A Scorer for OR like queries, counterpart of ConjunctionScorer. - This Scorer implements and uses skipTo() on the given Scorers. - TODO: Implement score(HitCollector, int). - - - - The number of subscorers. - - - The subscorers. - - - The minimum number of scorers that should match. - - - The scorerDocQueue contains all subscorers ordered by their current doc(), - with the minimum at the top. -
      The scorerDocQueue is initialized the first time next() or skipTo() is called. -
      An exhausted scorer is immediately removed from the scorerDocQueue. -
      If less than the minimumNrMatchers scorers - remain in the scorerDocQueue next() and skipTo() return false. -

      - After each to call to next() or skipTo() - currentSumScore is the total score of the current matching doc, - nrMatchers is the number of matching scorers, - and all scorers are after the matching doc, or are exhausted. -

      -
      - - The document number of the current match. - - - The number of subscorers that provide the current match. - - - Construct a DisjunctionScorer. - A collection of at least two subscorers. - - The positive minimum number of subscorers that should - match to match this query. -
      When minimumNrMatchers is bigger than - the number of subScorers, - no matches will be produced. -
      When minimumNrMatchers equals the number of subScorers, - it more efficient to use ConjunctionScorer. - -
      - - Construct a DisjunctionScorer, using one as the minimum number - of matching subscorers. - - - - Called the first time next() or skipTo() is called to - initialize scorerDocQueue. - - - - Scores and collects all matching documents. - The collector to which all matching documents are passed through - . -
      When this method is used the method should not be used. - - use instead. - -
      - - Scores and collects all matching documents. - The collector to which all matching documents are passed through. -
      When this method is used the method should not be used. - -
      - - Expert: Collects matching documents in a range. Hook for optimization. - Note that must be called once before this method is called - for the first time. - - The collector to which all matching documents are passed through - . - - Do not score documents past this. - - true if more matching documents may remain. - - use instead. - - - - Expert: Collects matching documents in a range. Hook for optimization. - Note that must be called once before this method is called - for the first time. - - The collector to which all matching documents are passed through. - - Do not score documents past this. - - - true if more matching documents may remain. - - - - use instead. - - - - Advance all subscorers after the current document determined by the - top of the scorerDocQueue. - Repeat until at least the minimum number of subscorers match on the same - document and all subscorers are after that document or are exhausted. -
      On entry the scorerDocQueue has at least minimumNrMatchers - available. At least the scorer with the minimum document number will be advanced. -
      - true iff there is a match. -
      In case there is a match, currentDoc, currentSumScore, - and nrMatchers describe the match. - - TODO: Investigate whether it is possible to use skipTo() when - the minimum number of matchers is bigger than one, ie. try and use the - character of ConjunctionScorer for the minimum number of matchers. - Also delay calling score() on the sub scorers until the minimum number of - matchers is reached. -
      For this, a Scorer array with minimumNrMatchers elements might - hold Scorers at currentDoc that are temporarily popped from scorerQueue. -
      -
      - - Returns the score of the current document matching the query. - Initially invalid, until is called the first time. - - - - use instead. - - - - Returns the number of subscorers matching the current document. - Initially invalid, until is called the first time. - - - - Skips to the first match beyond the current whose document number is - greater than or equal to a given target.
      - When this method is used the method should not be - used.
      - The implementation uses the skipTo() method on the subscorers. - -
      - The target document number. - - true iff there is such a match. - - use instead. - -
      - - Advances to the first match beyond the current whose document number is - greater than or equal to a given target.
      - When this method is used the method should not be - used.
      - The implementation uses the skipTo() method on the subscorers. - -
      - The target document number. - - the document whose number is greater than or equal to the given - target, or -1 if none exist. - -
      - - An explanation for the score of a given document. - - - - Scorer for conjunctions, sets of queries, all of which are required. - - - use instead. - - - - use instead. - - - - use instead. - - - - Count a scorer as a single match. - - - use instead. - - - - use instead. - - - - use instead. - - - - A clause in a BooleanQuery. - - - The query whose matching documents are combined by the boolean query. - - - Constructs a BooleanClause. - - - Returns true if o is equal to this. - - - Returns a hash code value for this object. - - - Specifies how clauses are to occur in matching documents. - - - Use this operator for clauses that must appear in the matching documents. - - - Use this operator for clauses that should appear in the - matching documents. For a BooleanQuery with no MUST - clauses one or more SHOULD clauses must match a document - for the BooleanQuery to match. - - - - - - Use this operator for clauses that must not appear in the matching documents. - Note that it is not possible to search for queries that only consist - of a MUST_NOT clause. - - - - Interface that exceptions should implement to support lazy loading of messages. - - For Native Language Support (NLS), system of software internationalization. - - This Interface should be implemented by all exceptions that require - translation - - - - - a instance of a class that implements the Message interface - - - - Abstract class for enumerating terms. -

      Term enumerations are always ordered by Term.compareTo(). Each term in - the enumeration is greater than all that precede it. -

      -
      - - Increments the enumeration to the next element. True if one exists. - - - Returns the current Term in the enumeration. - - - Returns the docFreq of the current Term in the enumeration. - - - Closes the enumeration to further activity, freeing resources. - - - Skips terms to the first beyond the current whose value is - greater or equal to target.

      Returns true iff there is such - an entry.

      Behaves as if written: - public boolean skipTo(Term target) { - do { - if (!next()) - return false; - } while (target > term()); - return true; - } - - Some implementations *could* be considerably more efficient than a linear scan. - Check the implementation to be sure. -

      - This method is not performant and will be removed in Lucene 3.0. - Use to create a new TermEnum positioned at a - given term. - -
      - - Optimized implementation. - - - Overridden by SegmentTermPositions to skip in prox stream. - - - Optimized implementation. - - - Allows you to iterate over the for multiple s as - a single . - - - - - TermPositions provides an interface for enumerating the <document, - frequency, <position>* > tuples for a term.

      The document and - frequency are the same as for a TermDocs. The positions portion lists the ordinal - positions of each occurrence of a term in a document. - -

      - - -
      - - Returns next position in the current document. It is an error to call - this more than times - without calling

      This is - invalid until is called for - the first time. -

      -
      - - Returns the length of the payload at the current term position. - This is invalid until is called for - the first time.
      -
      - length of the current payload in number of bytes - -
      - - Returns the payload data at the current term position. - This is invalid until is called for - the first time. - This method must not be called more than once after each call - of . However, payloads are loaded lazily, - so if the payload data for the current position is not needed, - this method may not be called at all for performance reasons.
      - -
      - the array into which the data of this payload is to be - stored, if it is big enough; otherwise, a new byte[] array - is allocated for this purpose. - - the offset in the array into which the data of this payload - is to be stored. - - a byte[] array containing the data of this payload - - IOException -
      - - Checks if a payload can be loaded at this position. -

      - Payloads can only be loaded once per call to - . - -

      - true if there is a payload available at this position that can be loaded - -
      - - Creates a new MultipleTermPositions instance. - - - - - - - Not implemented. - UnsupportedOperationException - - - Not implemented. - UnsupportedOperationException - - - Not implemented. - UnsupportedOperationException - - - Not implemented. - UnsupportedOperationException - - - Not implemented. - UnsupportedOperationException - - - - false - - - -

      Expert: policy for deletion of stale index commits. - -

      Implement this interface, and pass it to one - of the or - constructors, to customize when older - point-in-time commits - are deleted from the index directory. The default deletion policy - is , which always - removes old commits as soon as a new commit is done (this - matches the behavior before 2.2).

      - -

      One expected use case for this (and the reason why it - was first created) is to work around problems with an - index directory accessed via filesystems like NFS because - NFS does not provide the "delete on last close" semantics - that Lucene's "point in time" search normally relies on. - By implementing a custom deletion policy, such as "a - commit is only removed once it has been stale for more - than X minutes", you can give your readers time to - refresh to the new commit before - removes the old commits. Note that doing so will - increase the storage requirements of the index. See LUCENE-710 - for details.

      -

      -
      - -

      This is called once when a writer is first - instantiated to give the policy a chance to remove old - commit points.

      - -

      The writer locates all index commits present in the - index directory and calls this method. The policy may - choose to delete some of the commit points, doing so by - calling method - of .

      - -

      Note: the last CommitPoint is the most recent one, - i.e. the "front index state". Be careful not to delete it, - unless you know for sure what you are doing, and unless - you can afford to lose the index content while doing that. - -

      - List of current - point-in-time commits, - sorted by age (the 0th one is the oldest commit). - -
      - -

      This is called each time the writer completed a commit. - This gives the policy a chance to remove old commit points - with each commit.

      - -

      The policy may now choose to delete old commit points - by calling method - of .

      - -

      If writer has autoCommit = true then - this method will in general be called many times during - one instance of . If - autoCommit = false then this method is - only called once when is - called, or not at all if the - is called. - -

      Note: the last CommitPoint is the most recent one, - i.e. the "front index state". Be careful not to delete it, - unless you know for sure what you are doing, and unless - you can afford to lose the index content while doing that. - -

      - List of , - sorted by age (the 0th one is the oldest commit). - -
      - - NOTE: this API is experimental and will likely change - - - Adds a new term in this field; term ends with U+FFFF - char - - - - Called when we are done adding terms to this field - - - Add a new position & payload. If payloadLength > 0 - you must read those bytes from the IndexInput. - - - - Called when we are done adding positions & payloads - - - Add a new position & payload - - - Called when we are done adding positions & payloads - - - This is just a "splitter" class: it lets you wrap two - DocFieldConsumer instances as a single consumer. - - - - Called when DocumentsWriter decides to create a new - segment - - - - Called when DocumentsWriter decides to close the doc - stores - - - - Called when an aborting exception is hit - - - Add a new thread - - - Called when DocumentsWriter is using too much RAM. - The consumer should free RAM, if possible, returning - true if any RAM was in fact freed. - - - - A that runs each merge using a - separate thread, up until a maximum number of threads - () at which when a merge is - needed, the thread(s) that are updating the index will - pause until one or more merges completes. This is a - simple way to use concurrency in the indexing process - without having to create and manage application level - threads. - - - - Sets the max # simultaneous threads that may be - running. If a merge is necessary yet we already have - this many threads running, the incoming thread (that - is calling add/updateDocument) will block until - a merge thread has completed. - - - - Get the max # simultaneous threads that may be - - - - - Return the priority that merge threads run at. By - default the priority is 1 plus the priority of (ie, - slightly higher priority than) the first thread that - calls merge. - - - - Return the priority that merge threads run at. - - - Does the actual merge, by calling - - - Create and return a new MergeThread - - - Called when an exception is hit in a background merge - thread - - - - Used for testing - - - Used for testing - - - Used for testing - - - Used for testing - - - Used for testing - - - Declare what fields to load normally and what fields to load lazily - - - - - - Similar to a - java.io.FileFilter, the FieldSelector allows one to make decisions about - what Fields get loaded on a by - - - - - the field to accept or reject - - an instance of - if the named fieldName should be loaded. - - - - Pass in the Set of names to load and the Set of names to load lazily. If both are null, the - Document will not have any on it. - - A Set of field names to load. May be empty, but not null - - A Set of field names to load lazily. May be empty, but not null - - - - Indicate whether to load the field with the given name or not. If the is not in either of the - initializing Sets, then is returned. If a Field name - is in both fieldsToLoad and lazyFieldsToLoad, lazy has precedence. - - - The name to check - - The - - - - A field is a section of a Document. Each field has two parts, a name and a - value. Values may be free text, provided as a String or as a Reader, or they - may be atomic keywords, which are not further processed. Such keywords may - be used to represent dates, urls, etc. Fields are optionally stored in the - index, so that they may be returned with hits on the document. - - - - - - - - - - Synonymous with . - -

      WARNING: This interface may change within minor versions, despite Lucene's backward compatibility requirements. - This means new methods may be added from version to version. This change only affects the Fieldable API; other backwards - compatibility promises remain intact. For example, Lucene can still - read and write indices created within the same major version. -

      - - -

      -
      - - Sets the boost factor hits on this field. This value will be - multiplied into the score of all hits on this this field of this - document. - -

      The boost is multiplied by of the document - containing this field. If a document has multiple fields with the same - name, all such values are multiplied together. This product is then - used to compute the norm factor for the field. By - default, in the - method, the boost value is multiplied - by the - and then rounded by before it is stored in the - index. One should attempt to ensure that this product does not overflow - the range of that encoding. - -

      - - - - - - -
      - - Returns the boost factor for hits for this field. - -

      The default value is 1.0. - -

      Note: this value is not stored directly with the document in the index. - Documents returned from and - may thus not have the same value present as when - this field was indexed. - -

      - - -
      - - Returns the name of the field as an interned string. - For example "date", "title", "body", ... - - - - The value of the field as a String, or null. -

      - For indexing, if isStored()==true, the stringValue() will be used as the stored field value - unless isBinary()==true, in which case binaryValue() will be used. - - If isIndexed()==true and isTokenized()==false, this String value will be indexed as a single token. - If isIndexed()==true and isTokenized()==true, then tokenStreamValue() will be used to generate indexed tokens if not null, - else readerValue() will be used to generate indexed tokens if not null, else stringValue() will be used to generate tokens. -

      -
      - - The value of the field as a Reader, which can be used at index time to generate indexed tokens. - - - - - The value of the field in Binary, or null. - - - - - The TokenStream for this field to be used when indexing, or null. - - - - - True if the value of the field is to be stored in the index for return - with search hits. - - - - True if the value of the field is to be indexed, so that it may be - searched on. - - - - True if the value of the field should be tokenized as text prior to - indexing. Un-tokenized fields are indexed as a single word and may not be - Reader-valued. - - - - True if the value of the field is stored and compressed within the index - - - True if the term or terms used to index this field are stored as a term - vector, available from . - These methods do not provide access to the original content of the field, - only to terms used to index it. If the original content must be - preserved, use the stored attribute instead. - - - - - - - True if terms are stored as term vector together with their offsets - (start and end positon in source text). - - - - True if terms are stored as term vector together with their token positions. - - - True if the value of the field is stored as binary - - - True if norms are omitted for this indexed field - - - Expert: - - If set, omit normalization factors associated with this indexed field. - This effectively disables indexing boosts and length normalization for this field. - - - - Renamed to - - - - Renamed to - - - - Indicates whether a Field is Lazy or not. The semantics of Lazy loading are such that if a Field is lazily loaded, retrieving - it's values via or is only valid as long as the that - retrieved the is still open. - - - true if this field can be loaded lazily - - - - Returns offset into byte[] segment that is used as value, if Field is not binary - returned value is undefined - - index of the first character in byte[] segment that represents this Field value - - - - Returns length of byte[] segment that is used as value, if Field is not binary - returned value is undefined - - length of byte[] segment that represents this Field value - - - - Return the raw byte[] for the binary field. Note that - you must also call and - to know which range of bytes in this - returned array belong to the field. - - reference to the Field value as byte[]. - - - - Return the raw byte[] for the binary field. Note that - you must also call and - to know which range of bytes in this - returned array belong to the field.

      - About reuse: if you pass in the result byte[] and it is - used, likely the underlying implementation will hold - onto this byte[] and return it in future calls to - or . - So if you subsequently re-use the same byte[] elsewhere - it will alter this Fieldable's value. -

      - User defined buffer that will be used if - possible. If this is null or not large enough, a new - buffer is allocated - - reference to the Field value as byte[]. - -
      - - Sets the boost factor hits on this field. This value will be - multiplied into the score of all hits on this this field of this - document. - -

      The boost is multiplied by of the document - containing this field. If a document has multiple fields with the same - name, all such values are multiplied together. This product is then - used to compute the norm factor for the field. By - default, in the - method, the boost value is multipled - by the and then - rounded by before it is stored in the - index. One should attempt to ensure that this product does not overflow - the range of that encoding. - -

      - - - - - - -
      - - Returns the boost factor for hits for this field. - -

      The default value is 1.0. - -

      Note: this value is not stored directly with the document in the index. - Documents returned from and - may thus not have the same value present as when - this field was indexed. - -

      - - -
      - - Returns the name of the field as an interned string. - For example "date", "title", "body", ... - - - - True iff the value of the field is to be stored in the index for return - with search hits. It is an error for this to be true if a field is - Reader-valued. - - - - True iff the value of the field is to be indexed, so that it may be - searched on. - - - - True iff the value of the field should be tokenized as text prior to - indexing. Un-tokenized fields are indexed as a single word and may not be - Reader-valued. - - - - True if the value of the field is stored and compressed within the index - - - True iff the term or terms used to index this field are stored as a term - vector, available from . - These methods do not provide access to the original content of the field, - only to terms used to index it. If the original content must be - preserved, use the stored attribute instead. - - - - - - - True iff terms are stored as term vector together with their offsets - (start and end position in source text). - - - - True iff terms are stored as term vector together with their token positions. - - - True iff the value of the filed is stored as binary - - - Return the raw byte[] for the binary field. Note that - you must also call and - to know which range of bytes in this - returned array belong to the field. - - reference to the Field value as byte[]. - - - - Returns length of byte[] segment that is used as value, if Field is not binary - returned value is undefined - - length of byte[] segment that represents this Field value - - - - Returns offset into byte[] segment that is used as value, if Field is not binary - returned value is undefined - - index of the first character in byte[] segment that represents this Field value - - - - True if norms are omitted for this indexed field - - - Renamed to - - - - - - - - Expert: - - If set, omit normalization factors associated with this indexed field. - This effectively disables indexing boosts and length normalization for this field. - - - - Renamed to - - - - Expert: - - If set, omit term freq, positions and payloads from - postings for this field. - -

      NOTE: While this option reduces storage space - required in the index, it also means any query - requiring positional information, such as - or subclasses will - silently fail to find results. -

      -
      - - Prints a Field for human consumption. - - - The value of the field as a String, or null. If null, the Reader value or - binary value is used. Exactly one of stringValue(), - readerValue(), and getBinaryValue() must be set. - - - - The value of the field as a Reader, or null. If null, the String value or - binary value is used. Exactly one of stringValue(), - readerValue(), and getBinaryValue() must be set. - - - - The value of the field in Binary, or null. If null, the Reader value, - or String value is used. Exactly one of stringValue(), - readerValue(), and getBinaryValue() must be set. - - This method must allocate a new byte[] if - the is non-zero - or is not the - full length of the byte[]. Please use - instead, which simply - returns the byte[]. - - - - The TokesStream for this field to be used when indexing, or null. If null, the Reader value - or String value is analyzed to produce the indexed tokens. - - - -

      Expert: change the value of this field. This can - be used during indexing to re-use a single Field - instance to improve indexing speed by avoiding GC cost - of new'ing and reclaiming Field instances. Typically - a single instance is re-used as - well. This helps most on small documents.

      - -

      Each Field instance should only be used once - within a single instance. See ImproveIndexingSpeed - for details.

      -

      -
      - - Expert: change the value of this field. See setValue(String). - - - Expert: change the value of this field. See setValue(String). - - - Expert: change the value of this field. See setValue(String). - - - Expert: change the value of this field. See setValue(String). - use - - - - Expert: sets the token stream to be used for indexing and causes isIndexed() and isTokenized() to return true. - May be combined with stored values from stringValue() or binaryValue() - - - - Create a field by specifying its name, value and how it will - be saved in the index. Term vectors will not be stored in the index. - - - The name of the field - - The string to process - - Whether value should be stored in the index - - Whether the field should be indexed, and if so, if it should - be tokenized before indexing - - NullPointerException if name or value is null - IllegalArgumentException if the field is neither stored nor indexed - - - Create a field by specifying its name, value and how it will - be saved in the index. - - - The name of the field - - The string to process - - Whether value should be stored in the index - - Whether the field should be indexed, and if so, if it should - be tokenized before indexing - - Whether term vector should be stored - - NullPointerException if name or value is null - IllegalArgumentException in any of the following situations: - - the field is neither stored nor indexed - the field is not indexed but termVector is TermVector.YES - - - - - Create a field by specifying its name, value and how it will - be saved in the index. - - - The name of the field - - Whether to .intern() name or not - - The string to process - - Whether value should be stored in the index - - Whether the field should be indexed, and if so, if it should - be tokenized before indexing - - Whether term vector should be stored - - NullPointerException if name or value is null - IllegalArgumentException in any of the following situations: - - the field is neither stored nor indexed - the field is not indexed but termVector is TermVector.YES - - - - - Create a tokenized and indexed field that is not stored. Term vectors will - not be stored. The Reader is read only when the Document is added to the index, - i.e. you may not close the Reader until - has been called. - - - The name of the field - - The reader with the content - - NullPointerException if name or reader is null - - - Create a tokenized and indexed field that is not stored, optionally with - storing term vectors. The Reader is read only when the Document is added to the index, - i.e. you may not close the Reader until - has been called. - - - The name of the field - - The reader with the content - - Whether term vector should be stored - - NullPointerException if name or reader is null - - - Create a tokenized and indexed field that is not stored. Term vectors will - not be stored. This is useful for pre-analyzed fields. - The TokenStream is read only when the Document is added to the index, - i.e. you may not close the TokenStream until - has been called. - - - The name of the field - - The TokenStream with the content - - NullPointerException if name or tokenStream is null - - - Create a tokenized and indexed field that is not stored, optionally with - storing term vectors. This is useful for pre-analyzed fields. - The TokenStream is read only when the Document is added to the index, - i.e. you may not close the TokenStream until - has been called. - - - The name of the field - - The TokenStream with the content - - Whether term vector should be stored - - NullPointerException if name or tokenStream is null - - - Create a stored field with binary value. Optionally the value may be compressed. - - - The name of the field - - The binary value - - How value should be stored (compressed or not) - - IllegalArgumentException if store is Store.NO - - - Create a stored field with binary value. Optionally the value may be compressed. - - - The name of the field - - The binary value - - Starting offset in value where this Field's bytes are - - Number of bytes to use for this Field, starting at offset - - How value should be stored (compressed or not) - - IllegalArgumentException if store is Store.NO - - - Specifies whether and how a field should be stored. - - - Store the original field value in the index in a compressed form. This is - useful for long documents and for binary valued fields. - - Please use instead. - For string fields that were previously indexed and stored using compression, - the new way to achieve this is: First add the field indexed-only (no store) - and additionally using the same field name as a binary, stored field - with . - - - - Store the original field value in the index. This is useful for short texts - like a document's title which should be displayed with the results. The - value is stored in its original form, i.e. no analyzer is used before it is - stored. - - - - Do not store the field value in the index. - - - Specifies whether and how a field should be indexed. - - - Do not index the field value. This field can thus not be searched, - but one can still access its contents provided it is - stored. - - - - Index the tokens produced by running the field's - value through an Analyzer. This is useful for - common text. - - - - this has been renamed to - - - - Index the field's value without using an Analyzer, so it can be searched. - As no analyzer is used the value will be stored as a single term. This is - useful for unique Ids like product numbers. - - - - This has been renamed to - - - - Expert: Index the field's value without an Analyzer, - and also disable the storing of norms. Note that you - can also separately enable/disable norms by calling - . No norms means that - index-time field and document boosting and field - length normalization are disabled. The benefit is - less memory usage as norms take up one byte of RAM - per indexed field for every document in the index, - during searching. Note that once you index a given - field with norms enabled, disabling norms will - have no effect. In other words, for this to have the - above described effect on a field, all instances of - that field must be indexed with NOT_ANALYZED_NO_NORMS - from the beginning. - - - - This has been renamed to - - - - - Expert: Index the tokens produced by running the - field's value through an Analyzer, and also - separately disable the storing of norms. See - for what norms are - and why you may want to disable them. - - - - Specifies whether and how a field should have term vectors. - - - Do not store term vectors. - - - Store the term vectors of each document. A term vector is a list - of the document's terms and their number of occurrences in that document. - - - - Store the term vector + token position information - - - - - - - Store the term vector + Token offset information - - - - - - - Store the term vector + Token position and offset information - - - - - - - - - - - A grammar-based tokenizer constructed with JFlex - -

      This should be a good tokenizer for most European-language documents: - - - Splits words at punctuation characters, removing punctuation. However, a - dot that's not followed by whitespace is considered part of a token. - Splits words at hyphens, unless there's a number in the token, in which case - the whole token is interpreted as a product number and is not split. - Recognizes email addresses and internet hostnames as one token. - - -

      Many applications have specific tokenizer needs. If this tokenizer does - not suit your application, please consider copying this source code - directory to your project and maintaining your own grammar-based tokenizer. - - -

      - You must specify the required compatibility when creating - StandardAnalyzer: - - As of 2.4, Tokens incorrectly identified as acronyms are corrected (see - LUCENE-1608 - -

      -
      - - A Tokenizer is a TokenStream whose input is a Reader. -

      - This is an abstract class; subclasses must override -

      - NOTE: Subclasses overriding must call - before setting attributes. - Subclasses overriding must call - before setting Token attributes. -

      -
      - - The text source for this Tokenizer. - - - Construct a tokenizer with null input. - - - Construct a token stream processing the given input. - - - Construct a tokenizer with null input using the given AttributeFactory. - - - Construct a token stream processing the given input using the given AttributeFactory. - - - Construct a token stream processing the given input using the given AttributeSource. - - - Construct a token stream processing the given input using the given AttributeSource. - - - By default, closes the input Reader. - - - Return the corrected offset. If is a subclass - this method calls , else returns currentOff. - - offset as seen in the output - - corrected offset based on the input - - - - - - Expert: Reset the tokenizer to a new reader. Typically, an - analyzer (in its reusableTokenStream method) will use - this to re-use a previously created tokenizer. - - - - this solves a bug where HOSTs that end with '.' are identified - as ACRONYMs. It is deprecated and will be removed in the next - release. - - - - A private instance of the JFlex-constructed scanner - - - String token types that correspond to token type int constants - - - Please use instead - - - - Specifies whether deprecated acronyms should be replaced with HOST type. - This is false by default to support backward compatibility. -

      - See http://issues.apache.org/jira/browse/LUCENE-1068 - -

      - this should be removed in the next release (3.0). - -
      - - Set the max allowed token length. Any token longer - than this is skipped. - - - - - - - - Creates a new instance of the . Attaches the - input to a newly created JFlex scanner. - - Use instead - - - - Creates a new instance of the . Attaches - the input to the newly created JFlex scanner. - - - The input reader - - Set to true to replace mischaracterized acronyms with HOST. - - See http://issues.apache.org/jira/browse/LUCENE-1068 - - Use instead - - - - Creates a new instance of the - . Attaches - the input to the newly created JFlex scanner. - - - - The input reader - - See http://issues.apache.org/jira/browse/LUCENE-1068 - - - - Creates a new StandardTokenizer with a given . - Use - - instead - - - - Creates a new StandardTokenizer with a given . - - - Creates a new StandardTokenizer with a given - Use - - instead - - - - Creates a new StandardTokenizer with a given - - - - - - (non-Javadoc) - - - - - - Will be removed in Lucene 3.0. This method is final, as it should - not be overridden. Delegates to the backwards compatibility layer. - - - - Will be removed in Lucene 3.0. This method is final, as it should - not be overridden. Delegates to the backwards compatibility layer. - - - - Prior to https://issues.apache.org/jira/browse/LUCENE-1068, StandardTokenizer mischaracterized as acronyms tokens like www.abc.com - when they should have been labeled as hosts instead. - - true if StandardTokenizer now returns these tokens as Hosts, otherwise false - - - Remove in 3.X and make true the only valid value - - - - - Set to true to replace mischaracterized acronyms as HOST. - - Remove in 3.X and make true the only valid value - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - - - An that filters - with - - - - This class converts alphabetic, numeric, and symbolic Unicode characters - which are not in the first 127 ASCII characters (the "Basic Latin" Unicode - block) into their ASCII equivalents, if one exists. - - Characters from the following Unicode blocks are converted; however, only - those characters with reasonable ASCII alternatives are converted: - - - C1 Controls and Latin-1 Supplement: http://www.unicode.org/charts/PDF/U0080.pdf - Latin Extended-A: http://www.unicode.org/charts/PDF/U0100.pdf - Latin Extended-B: http://www.unicode.org/charts/PDF/U0180.pdf - Latin Extended Additional: http://www.unicode.org/charts/PDF/U1E00.pdf - Latin Extended-C: http://www.unicode.org/charts/PDF/U2C60.pdf - Latin Extended-D: http://www.unicode.org/charts/PDF/UA720.pdf - IPA Extensions: http://www.unicode.org/charts/PDF/U0250.pdf - Phonetic Extensions: http://www.unicode.org/charts/PDF/U1D00.pdf - Phonetic Extensions Supplement: http://www.unicode.org/charts/PDF/U1D80.pdf - General Punctuation: http://www.unicode.org/charts/PDF/U2000.pdf - Superscripts and Subscripts: http://www.unicode.org/charts/PDF/U2070.pdf - Enclosed Alphanumerics: http://www.unicode.org/charts/PDF/U2460.pdf - Dingbats: http://www.unicode.org/charts/PDF/U2700.pdf - Supplemental Punctuation: http://www.unicode.org/charts/PDF/U2E00.pdf - Alphabetic Presentation Forms: http://www.unicode.org/charts/PDF/UFB00.pdf - Halfwidth and Fullwidth Forms: http://www.unicode.org/charts/PDF/UFF00.pdf - - - See: http://en.wikipedia.org/wiki/Latin_characters_in_Unicode - - The set of character conversions supported by this class is a superset of - those supported by Lucene's which strips - accents from Latin1 characters. For example, 'À' will be replaced by - 'a'. - - - - Converts characters above ASCII to their ASCII equivalents. For example, - accents are removed from accented characters. - - The string to fold - - The number of characters in the input string - - - - Expert: A Scorer for documents matching a Term. - - - Construct a TermScorer. - - - The weight of the Term in the query. - - An iterator over the documents matching the Term. - - The Similarity implementation to be used for score - computations. - - The field norms of the document fields for the Term. - - - - use instead. - - - - use instead. - - - - use instead. - - - - Advances to the next document matching the query.
      - The iterator over the matching documents is buffered using - . - -
      - true iff there is another document matching the query. - - use instead. - -
      - - Advances to the next document matching the query.
      - The iterator over the matching documents is buffered using - . - -
      - the document matching the query or -1 if there are no more documents. - -
      - - Skips to the first match beyond the current whose document number is - greater than or equal to a given target.
      - The implementation uses . - -
      - The target document number. - - true iff there is such a match. - - use instead. - -
      - - Advances to the first match beyond the current whose document number is - greater than or equal to a given target.
      - The implementation uses . - -
      - The target document number. - - the matching document or -1 if none exist. - -
      - - Returns an explanation of the score for a document. -
      When this method is used, the method - and the method should not be used. -
      - The document number for the explanation. - -
      - - Returns a string representation of this TermScorer. - - - The results of a SpanQueryFilter. Wraps the BitSet and the position information from the SpanQuery - -

      - NOTE: This API is still experimental and subject to change. - - -

      -
      - - - - - - - The bits for the Filter - - A List of objects - - Use instead - - - - - The DocIdSet for the Filter - - A List of objects - - - - The first entry in the array corresponds to the first "on" bit. - Entries are increasing by document order - - A List of PositionInfo objects - - - - Use - - - - Returns the docIdSet - - - - A List of objects - - - - - The end position of this match - - - - The Start position - The start position of this match - - - - Expert: Delegating scoring implementation. Useful in - implementations, to override only certain - methods of a Searcher's Similiarty implementation.. - - - - Expert: Scoring API. -

      Subclasses implement search scoring. - -

      The score of query q for document d correlates to the - cosine-distance or dot-product between document and query vectors in a - - Vector Space Model (VSM) of Information Retrieval. - A document whose vector is closer to the query vector in that model is scored higher. - - The score is computed as follows: - -

      - - -
      - - - - - - - - - - - -
      - score(q,d)   =   - coord(q,d)  ·  - queryNorm(q)  ·  - - - - ( - tf(t in d)  ·  - idf(t)2  ·  - t.getBoost() ·  - norm(t,d) - ) -
      t in q
      -
      - -

      where - - - - tf(t in d) - correlates to the term's frequency, - defined as the number of times term t appears in the currently scored document d. - Documents that have more occurrences of a given term receive a higher score. - The default computation for tf(t in d) in - DefaultSimilarity is: - -
       
      - - - - - -
      - tf(t in d)   =   - - frequency½ -
      -
       
      -
      - - - - idf(t) stands for Inverse Document Frequency. This value - correlates to the inverse of docFreq - (the number of documents in which the term t appears). - This means rarer terms give higher contribution to the total score. - The default computation for idf(t) in - DefaultSimilarity is: - -
       
      - - - - - - - -
      - idf(t)  =   - - 1 + log ( - - - - - -
      numDocs
      –––––––––
      docFreq+1
      -
      - ) -
      -
       
      -
      - - - - coord(q,d) - is a score factor based on how many of the query terms are found in the specified document. - Typically, a document that contains more of the query's terms will receive a higher score - than another document with fewer query terms. - This is a search time factor computed in - coord(q,d) - by the Similarity in effect at search time. -
       
      -
      - - - - queryNorm(q) - - is a normalizing factor used to make scores between queries comparable. - This factor does not affect document ranking (since all ranked documents are multiplied by the same factor), - but rather just attempts to make scores from different queries (or even different indexes) comparable. - This is a search time factor computed by the Similarity in effect at search time. - - The default computation in - DefaultSimilarity - is: -
       
      - - - - - -
      - queryNorm(q)   =   - queryNorm(sumOfSquaredWeights) -   =   - - - - - -
      1
      - –––––––––––––– -
      sumOfSquaredWeights½
      -
      -
       
      - - The sum of squared weights (of the query terms) is - computed by the query object. - For example, a boolean query - computes this value as: - -
       
      - - - - - - - - - - - -
      - sumOfSquaredWeights   =   - q.getBoost() 2 -  ·  - - - - ( - idf(t)  ·  - t.getBoost() - ) 2 -
      t in q
      -
       
      - -
      - - - - t.getBoost() - is a search time boost of term t in the query q as - specified in the query text - (see query syntax), - or as set by application calls to - . - Notice that there is really no direct API for accessing a boost of one term in a multi term query, - but rather multi terms are represented in a query as multi - TermQuery objects, - and so the boost of a term in the query is accessible by calling the sub-query - . -
       
      -
      - - - - norm(t,d) encapsulates a few (indexing time) boost and length factors: - - - Document boost - set by calling - doc.setBoost() - before adding the document to the index. - - Field boost - set by calling - field.SetBoost() - before adding the field to a document. - - LengthNorm(field) - computed - when the document is added to the index in accordance with the number of tokens - of this field in the document, so that shorter fields contribute more to the score. - LengthNorm is computed by the Similarity class in effect at indexing. - - - -

      - When a document is added to the index, all the above factors are multiplied. - If the document has multiple fields with the same name, all their boosts are multiplied together: - -
       
      - - - - - - - - - - - -
      - norm(t,d)   =   - doc.GetBoost() -  ·  - LengthNorm(field) -  ·  - - - - field.GetBoost() -
      field f in d named as t
      -
       
      - However the resulted norm value is encoded as a single byte - before being stored. - At search time, the norm byte value is read from the index - directory and - decoded back to a float norm value. - This encoding/decoding, while reducing index size, comes with the price of - precision loss - it is not guaranteed that decode(encode(x)) = x. - For instance, decode(encode(0.89)) = 0.75. - Also notice that search time is too late to modify this norm part of scoring, e.g. by - using a different for search. -
       
      - - - -

      - - - - - - -
      - - Set the default Similarity implementation used by indexing and search - code. - - - - - - - - - Return the default Similarity implementation used by indexing and search - code. - -

      This is initially an instance of . - -

      - - - - -
      - - Cache of decoded bytes. - - - Decodes a normalization factor stored in an index. - - - - - Returns a table for decoding normalization bytes. - - - - - Compute the normalization value for a field, given the accumulated - state of term processing for this field (see ). - -

      Implementations should calculate a float value based on the field - state and then return that value. - -

      For backward compatibility this method by default calls - passing - as the second argument, and - then multiplies this value by .

      - -

      WARNING: This API is new and experimental and may - suddenly change.

      - -

      - field name - - current processing state for this field - - the calculated float norm - -
      - - Computes the normalization value for a field given the total number of - terms contained in a field. These values, together with field boosts, are - stored in an index and multipled into scores for hits on each field by the - search code. - -

      Matches in longer fields are less precise, so implementations of this - method usually return smaller values when numTokens is large, - and larger values when numTokens is small. - -

      Note that the return values are computed under - - and then stored using - . - Thus they have limited precision, and documents - must be re-indexed if this method is altered. - -

      - the name of the field - - the total number of tokens contained in fields named - fieldName of doc. - - a normalization factor for hits on this field of this document - - - - -
      - - Computes the normalization value for a query given the sum of the squared - weights of each of the query terms. This value is then multipled into the - weight of each query term. - -

      This does not affect ranking, but rather just attempts to make scores - from different queries comparable. - -

      - the sum of the squares of query term weights - - a normalization factor for query weights - -
      - - Encodes a normalization factor for storage in an index. - -

      The encoding uses a three-bit mantissa, a five-bit exponent, and - the zero-exponent point at 15, thus - representing values from around 7x10^9 to 2x10^-9 with about one - significant decimal digit of accuracy. Zero is also represented. - Negative numbers are rounded up to zero. Values too large to represent - are rounded down to the largest representable value. Positive values too - small to represent are rounded up to the smallest positive representable - value. - -

      - - - - -
      - - Computes a score factor based on a term or phrase's frequency in a - document. This value is multiplied by the - factor for each term in the query and these products are then summed to - form the initial score for a document. - -

      Terms and phrases repeated in a document indicate the topic of the - document, so implementations of this method usually return larger values - when freq is large, and smaller values when freq - is small. - -

      The default implementation calls . - -

      - the frequency of a term within a document - - a score factor based on a term's within-document frequency - -
      - - Computes the amount of a sloppy phrase match, based on an edit distance. - This value is summed for each sloppy phrase match in a document to form - the frequency that is passed to . - -

      A phrase match with a small edit distance to a document passage more - closely matches the document, so implementations of this method usually - return larger values when the edit distance is small and smaller values - when it is large. - -

      - - - the edit distance of this sloppy phrase match - - the frequency increment for this match - -
      - - Computes a score factor based on a term or phrase's frequency in a - document. This value is multiplied by the - factor for each term in the query and these products are then summed to - form the initial score for a document. - -

      Terms and phrases repeated in a document indicate the topic of the - document, so implementations of this method usually return larger values - when freq is large, and smaller values when freq - is small. - -

      - the frequency of a term within a document - - a score factor based on a term's within-document frequency - -
      - - Computes a score factor for a simple term. - -

      The default implementation is: - return idf(searcher.docFreq(term), searcher.maxDoc()); - - - Note that is used instead of - because it is proportional to - , i.e., when one is inaccurate, - so is the other, and in the same direction. - -

      - the term in question - - the document collection being searched - - a score factor for the term - - see - -
      - - Computes a score factor for a simple term and returns an explanation - for that score factor. - -

      - The default implementation uses: - - - idf(searcher.docFreq(term), searcher.maxDoc()); - - - Note that is used instead of - because it is - proportional to , i.e., when one is - inaccurate, so is the other, and in the same direction. - -

      - the term in question - - the document collection being searched - - an IDFExplain object that includes both an idf score factor - and an explanation for the term. - - IOException -
      - - Computes a score factor for a phrase. - -

      The default implementation sums the factor - for each term in the phrase. - -

      - the terms in the phrase - - the document collection being searched - - idf score factor - - see - -
      - - Computes a score factor for a phrase. - -

      - The default implementation sums the idf factor for - each term in the phrase. - -

      - the terms in the phrase - - the document collection being searched - - an IDFExplain object that includes both an idf - score factor for the phrase and an explanation - for each term. - - IOException -
      - - Computes a score factor based on a term's document frequency (the number - of documents which contain the term). This value is multiplied by the - factor for each term in the query and these products are - then summed to form the initial score for a document. - -

      Terms that occur in fewer documents are better indicators of topic, so - implementations of this method usually return larger values for rare terms, - and smaller values for common terms. - -

      - the number of documents which contain the term - - the total number of documents in the collection - - a score factor based on the term's document frequency - -
      - - Computes a score factor based on the fraction of all query terms that a - document contains. This value is multiplied into scores. - -

      The presence of a large portion of the query terms indicates a better - match with the query, so implementations of this method usually return - larger values when the ratio between these parameters is large and smaller - values when the ratio between them is small. - -

      - the number of query terms matched in the document - - the total number of terms in the query - - a score factor based on term overlap with the query - -
      - - Calculate a scoring factor based on the data in the payload. Overriding implementations - are responsible for interpreting what is in the payload. Lucene makes no assumptions about - what is in the byte array. -

      - The default implementation returns 1. - -

      - The fieldName of the term this payload belongs to - - The payload byte array to be scored - - The offset into the payload array - - The length in the array - - An implementation dependent float to be used as a scoring factor - - - See - -
      - - Calculate a scoring factor based on the data in the payload. Overriding implementations - are responsible for interpreting what is in the payload. Lucene makes no assumptions about - what is in the byte array. -

      - The default implementation returns 1. - -

      - The docId currently being scored. If this value is , then it should be assumed that the PayloadQuery implementation does not provide document information - - The fieldName of the term this payload belongs to - - The start position of the payload - - The end position of the payload - - The payload byte array to be scored - - The offset into the payload array - - The length in the array - - An implementation dependent float to be used as a scoring factor - - -
      - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - The Similarity implementation used by default. - TODO: move back to top when old API is removed! - - - - - Small Util class used to pass both an idf factor as well as an - explanation for that factor. - - This class will likely be held on a , so be aware - before storing any large or un-serializable fields. - - - - - Expert: Describes the score computation for document and query. - - - Indicates whether or not this Explanation models a good match. - -

      - By default, an Explanation represents a "match" if the value is positive. -

      -

      - - -
      - - The value assigned to this explanation node. - - - Sets the value assigned to this explanation node. - - - A description of this explanation node. - - - Sets the description of this explanation node. - - - A short one line summary which should contain all high level - information about this Explanation, without the "Details" - - - - The sub-nodes of this explanation node. - - - Adds a sub-node to this explanation node. - - - Render an explanation as text. - - - Render an explanation as HTML. - - - Small Util class used to pass both an idf factor as well as an - explanation for that factor. - - This class will likely be held on a , so be aware - before storing any large or un-serializable fields. - - - - - the idf factor - - - - This should be calculated lazily if possible. - - - the explanation for the idf factor. - - - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - Construct a that delegates all methods to another. - - - the Similarity implementation to delegate to - - - - A Query that matches documents within an exclusive range of terms. - -

      This query matches the documents looking for terms that fall into the - supplied range according to . It is not intended - for numerical ranges, use instead. - -

      This query uses - . If you - want to change this, use the new - instead. - -

      - Use for term ranges or - for numeric ranges instead. - This class will be removed in Lucene 3.0. - -
      - - Constructs a query selecting all terms greater than - lowerTerm but less than upperTerm. - There must be at least one term and either term may be null, - in which case there is no bound on that side, but if there are - two terms, both terms must be for the same field. - - - The Term at the lower end of the range - - The Term at the upper end of the range - - If true, both lowerTerm and - upperTerm will themselves be included in the range. - - - - Constructs a query selecting all terms greater than - lowerTerm but less than upperTerm. - There must be at least one term and either term may be null, - in which case there is no bound on that side, but if there are - two terms, both terms must be for the same field. -

      - If collator is not null, it will be used to decide whether - index terms are within the given range, rather than using the Unicode code - point order in which index terms are stored. -

      - WARNING: Using this constructor and supplying a non-null - value in the collator parameter will cause every single - index Term in the Field referenced by lowerTerm and/or upperTerm to be - examined. Depending on the number of index Terms in this Field, the - operation could be very slow. - -

      - The Term at the lower end of the range - - The Term at the upper end of the range - - If true, both lowerTerm and - upperTerm will themselves be included in the range. - - The collator to use to collate index Terms, to determine - their membership in the range bounded by lowerTerm and - upperTerm. - -
      - - Returns the field name for this query - - - Returns the lower term of this range query. - - - Returns the upper term of this range query. - - - Returns true if the range query is inclusive - - - Returns the collator used to determine range inclusion, if any. - - - Prints a user-readable version of this query. - - - Returns true iff o is equal to this. - - - Returns a hash code value for this object. - - - Position of a term in a document that takes into account the term offset within the phrase. - - - Go to next location of this term current document, and set - position as location - offset, so that a - matching exact phrase is easily identified when all PhrasePositions - have exactly the same position. - - - - A query that matches all documents. - - - - - Field used for normalization factor (document boost). Null if nothing. - - - - use instead. - - - - use instead. - - - - use instead. - - - - Lower-level search API.
      - HitCollectors are primarily meant to be used to implement queries, sorting - and filtering. See for a lower level and higher performance - (on a multi-segment index) API. - -
      - - - $Id: HitCollector.java 764551 2009-04-13 18:33:56Z mikemccand $ - - Please use instead. - -
      - - Called once for every document matching a query, with the document - number and its raw score. - -

      If, for example, an application wished to collect all of the hits for a - query in a BitSet, then it might: - - Searcher searcher = new IndexSearcher(indexReader); - final BitSet bits = new BitSet(indexReader.maxDoc()); - searcher.search(query, new HitCollector() { - public void collect(int doc, float score) { - bits.set(doc); - } - }); - - -

      Note: This is called in an inner search loop. For good search - performance, implementations of this method should not call - or - on every - document number encountered. Doing so can slow searches by an order - of magnitude or more. -

      Note: The score passed to this method is a raw score. - In other words, the score will not necessarily be a float whose value is - between 0 and 1. -

      -
      - - Filter caching singleton. It can be used - to save filters locally for reuse. - This class makes it possble to cache Filters even when using RMI, as it - keeps the cache on the seaercher side of the RMI connection. - - Also could be used as a persistent storage for any filter as long as the - filter provides a proper hashCode(), as that is used as the key in the cache. - - The cache is periodically cleaned up from a separate thread to ensure the - cache doesn't exceed the maximum size. - - - - The default maximum number of Filters in the cache - - - The default frequency of cache clenup - - - The cache itself - - - Maximum allowed cache size - - - Cache cleaning frequency - - - Cache cleaner that runs in a separate thread - - - Sets up the FilterManager singleton. - - - Sets the max size that cache should reach before it is cleaned up - maximum allowed cache size - - - - Sets the cache cleaning frequency in milliseconds. - cleaning frequency in millioseconds - - - - Returns the cached version of the filter. Allows the caller to pass up - a small filter but this will keep a persistent version around and allow - the caching filter to do its job. - - - The input filter - - The cached version of the filter - - - - Holds the filter and the last time the filter was used, to make LRU-based - cache cleaning possible. - TODO: Clean this up when we switch to Java 1.5 - - - - Keeps the cache from getting too big. - If we were using Java 1.5, we could use LinkedHashMap and we would not need this thread - to clean out the cache. - - The SortedSet sortedFilterItems is used only to sort the items from the cache, - so when it's time to clean up we have the TreeSet sort the FilterItems by - timestamp. - - Removes 1.5 * the numbers of items to make the cache smaller. - For example: - If cache clean size is 10, and the cache is at 15, we would remove (15 - 10) * 1.5 = 7.5 round up to 8. - This way we clean the cache a bit more, and avoid having the cache cleaner having to do it frequently. - - - - The SegmentMerger class combines two or more Segments, represented by an IndexReader (, - into a single Segment. After adding the appropriate readers, call the merge method to combine the - segments. -

      - If the compoundFile flag is set, then the segments will be merged into a compound file. - - -

      - - - - -
      - - Maximum number of contiguous documents to bulk-copy - when merging stored fields - - - - norms header placeholder - - - This ctor used only by test code. - - - The Directory to merge the other segments into - - The name of the new segment - - - - Add an IndexReader to the collection of readers that are to be merged - - - - - - The index of the reader to return - - The ith reader to be merged - - - - Merges the readers specified by the method into the directory passed to the constructor - The number of documents that were merged - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Merges the readers specified by the method - into the directory passed to the constructor. - - if false, we will not merge the - stored fields nor vectors files - - The number of documents that were merged - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - close all IndexReaders that have been added. - Should not be called before merge(). - - IOException - - - - The number of documents in all of the readers - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Merge the TermVectors from each of the segments into the new one. - IOException - - - Process postings from multiple segments all positioned on the - same term. Writes out merged entries into freqOutput and - the proxOutput streams. - - - array of segments - - number of cells in the array actually occupied - - number of documents across all segments where this term was found - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Records the fact that roughly units amount of work - have been done since this method was last called. - When adding time-consuming code into SegmentMerger, - you should test different values for units to ensure - that the time in between calls to merge.checkAborted - is up to ~ 1 second. - - - - Information about a segment such as it's name, directory, and files related - to the segment. - - *

      NOTE: This API is new and still experimental - (subject to change suddenly in the next release)

      -

      -
      - - Copy everything from src SegmentInfo into our instance. - - - Construct a new SegmentInfo instance by reading a - previously saved SegmentInfo from input. - - - directory to load from - - format of the segments info file - - input handle to read segment info from - - - - Returns total size in bytes of all of files used by - this segment. - - - - Returns true if this field for this segment has saved a separate norms file (_<segment>_N.sX). - - - the field index to check - - - - Returns true if any fields in this segment have separate norms. - - - Increment the generation count for the norms file for - this field. - - - field whose norm file will be rewritten - - - - Get the file name for the norms file for this field. - - - field index - - - - Mark whether this segment is stored as a compound file. - - - true if this is a compound file; - else, false - - - - Returns true if this segment is stored as a compound - file; else, false. - - - - Save this segment's info. - - - Used for debugging - - - We consider another SegmentInfo instance equal if it - has the same dir and same name. - - - - A FilterIndexReader contains another IndexReader, which it - uses as its basic source of data, possibly transforming the data along the - way or providing additional functionality. The class - FilterIndexReader itself simply implements all abstract methods - of IndexReader with versions that pass all requests to the - contained index reader. Subclasses of FilterIndexReader may - further override some of these methods and may also provide additional - methods and fields. - - - -

      Construct a FilterIndexReader based on the specified base reader. - Directory locking for delete, undeleteAll, and setNorm operations is - left to the base reader.

      -

      Note that base reader is closed if this FilterIndexReader is closed.

      -

      - specified base reader. - -
      - - - - - - - If the subclass of FilteredIndexReader modifies the - contents of the FieldCache, you must override this - method to provide a different key */ - - - - - If the subclass of FilteredIndexReader modifies the - deleted docs, you must override this method to provide - a different key */ - - - - Base class for filtering implementations. - - - Base class for filtering implementations. - - - Base class for filtering implementations. - - - Provides support for converting dates to strings and vice-versa. - The strings are structured so that lexicographic sorting orders by date, - which makes them suitable for use as field values and search terms. - -

      Note that this class saves dates with millisecond granularity, - which is bad for and , as those - queries are expanded to a BooleanQuery with a potentially large number - of terms when searching. Thus you might want to use - instead. - -

      - Note: dates before 1970 cannot be used, and therefore cannot be - indexed when using this class. See for an - alternative without such a limitation. - -

      - Another approach is , which provides - a sortable binary representation (prefix encoded) of numeric values, which - date/time are. - For indexing a , convert it to unix timestamp as - long and - index this as a numeric value with - and use to query it. - -

      - If you build a new index, use or - instead. - This class is included for use with existing - indices and will be removed in a future release. - -
      - - Converts a Date to a string suitable for indexing. - RuntimeException if the date specified in the - method argument is before 1970 - - - - Converts a millisecond time to a string suitable for indexing. - RuntimeException if the time specified in the - method argument is negative, that is, before 1970 - - - - Converts a string-encoded date into a millisecond time. - - - Converts a string-encoded date into a Date object. - - - Normalizes tokens extracted with . - - - Construct filtering in. - - - Returns the next token in the stream, or null at EOS. -

      Removes 's from the end of words. -

      Removes dots from acronyms. -

      -
      - - A SinkTokenizer can be used to cache Tokens for use in an Analyzer -

      - WARNING: and only work with the old TokenStream API. - If you switch to the new API, you need to use instead, which offers - the same functionality. -

      - - - Use instead - - - -
      - - Get the tokens in the internal List. -

      - WARNING: Adding tokens to this list requires the method to be called in order for them - to be made available. Also, this Tokenizer does nothing to protect against s - in the case of adds happening while is being called. -

      - WARNING: Since this SinkTokenizer can be reset and the cached tokens made available again, do not modify them. Modify clones instead. - -

      - A List of s - -
      - - Returns the next token out of the list of cached tokens - The next in the Sink. - - IOException - - - Override this method to cache only certain tokens, or new tokens based - on the old tokens. - - - The to add to the sink - - - - Reset the internal data structures to the start at the front of the list of tokens. Should be called - if tokens were added to the list after an invocation of - - IOException - - - Simple cache implementation that uses a HashMap to store (key, value) pairs. - This cache is not synchronized, use - if needed. - - - - Returns a Set containing all keys in this cache. - - -

      Implements using native OS file - locks. Note that because this LockFactory relies on - java.nio.* APIs for locking, any problems with those APIs - will cause locking to fail. Specifically, on certain NFS - environments the java.nio.* locks will fail (the lock can - incorrectly be double acquired) whereas - worked perfectly in those same - environments. For NFS based access to an index, it's - recommended that you try - first and work around the one limitation that a lock file - could be left when the JVM exits abnormally.

      - -

      The primary benefit of is - that lock files will be properly removed (by the OS) if - the JVM has an abnormal exit.

      - -

      Note that, unlike , the existence of - leftover lock files in the filesystem on exiting the JVM - is fine because the OS will free the locks held against - these files even though the files still remain.

      - -

      If you suspect that this or any other LockFactory is - not working properly in your environment, you can easily - test it by using , - and .

      - -

      - - -
      - - Create a NativeFSLockFactory instance, with null (unset) - lock directory. When you pass this factory to a - subclass, the lock directory is automatically set to the - directory itsself. Be sure to create one instance for each directory - your create! - - - - Create a NativeFSLockFactory instance, storing lock - files into the specified lockDirName: - - - where lock files are created. - - - - Create a NativeFSLockFactory instance, storing lock - files into the specified lockDir: - - - where lock files are created. - - - - Create a NativeFSLockFactory instance, storing lock - files into the specified lockDir: - - - where lock files are created. - - - - Writes bytes through to a primary IndexOutput, computing - checksum as it goes. Note that you cannot use seek(). - - - - Stores information about how to sort documents by terms in an individual - field. Fields must be indexed in order to sort by them. - -

      Created: Feb 11, 2004 1:25:29 PM - -

      - lucene 1.4 - - $Id: SortField.java 801344 2009-08-05 18:05:06Z yonik $ - - - -
      - - Sort by document score (relevancy). Sort values are Float and higher - values are at the front. - - - - Sort by document number (index order). Sort values are Integer and lower - values are at the front. - - - - Guess type of sort based on field contents. A regular expression is used - to look at the first term indexed for the field and determine if it - represents an integer number, a floating point number, or just arbitrary - string characters. - - Please specify the exact type, instead. - Especially, guessing does not work with the new - type. - - - - Sort using term values as Strings. Sort values are String and lower - values are at the front. - - - - Sort using term values as encoded Integers. Sort values are Integer and - lower values are at the front. - - - - Sort using term values as encoded Floats. Sort values are Float and - lower values are at the front. - - - - Sort using term values as encoded Longs. Sort values are Long and - lower values are at the front. - - - - Sort using term values as encoded Doubles. Sort values are Double and - lower values are at the front. - - - - Sort using term values as encoded Shorts. Sort values are Short and - lower values are at the front. - - - - Sort using a custom Comparator. Sort values are any Comparable and - sorting is done according to natural order. - - - - Sort using term values as encoded Bytes. Sort values are Byte and - lower values are at the front. - - - - Sort using term values as Strings, but comparing by - value (using String.compareTo) for all comparisons. - This is typically slower than , which - uses ordinals to do the sorting. - - - - Represents sorting by document score (relevancy). - - - Represents sorting by document number (index order). - - - Creates a sort by terms in the given field where the type of term value - is determined dynamically (). - - Name of field to sort by, cannot be - null. - - Please specify the exact type instead. - - - - Creates a sort, possibly in reverse, by terms in the given field where - the type of term value is determined dynamically (). - - Name of field to sort by, cannot be null. - - True if natural order should be reversed. - - Please specify the exact type instead. - - - - Creates a sort by terms in the given field with the type of term - values explicitly given. - - Name of field to sort by. Can be null if - type is SCORE or DOC. - - Type of values in the terms. - - - - Creates a sort, possibly in reverse, by terms in the given field with the - type of term values explicitly given. - - Name of field to sort by. Can be null if - type is SCORE or DOC. - - Type of values in the terms. - - True if natural order should be reversed. - - - - Creates a sort by terms in the given field, parsed - to numeric values using a custom . - - Name of field to sort by. Must not be null. - - Instance of a , - which must subclass one of the existing numeric - parsers from . Sort type is inferred - by testing which numeric parser the parser subclasses. - - IllegalArgumentException if the parser fails to - subclass an existing numeric parser, or field is null - - - - Creates a sort, possibly in reverse, by terms in the given field, parsed - to numeric values using a custom . - - Name of field to sort by. Must not be null. - - Instance of a , - which must subclass one of the existing numeric - parsers from . Sort type is inferred - by testing which numeric parser the parser subclasses. - - True if natural order should be reversed. - - IllegalArgumentException if the parser fails to - subclass an existing numeric parser, or field is null - - - - Creates a sort by terms in the given field sorted - according to the given locale. - - Name of field to sort by, cannot be null. - - Locale of values in the field. - - - - Creates a sort, possibly in reverse, by terms in the given field sorted - according to the given locale. - - Name of field to sort by, cannot be null. - - Locale of values in the field. - - - - Creates a sort with a custom comparison function. - Name of field to sort by; cannot be null. - - Returns a comparator for sorting hits. - - use SortField (String field, FieldComparatorSource comparator) - - - - Creates a sort with a custom comparison function. - Name of field to sort by; cannot be null. - - Returns a comparator for sorting hits. - - - - Creates a sort, possibly in reverse, with a custom comparison function. - Name of field to sort by; cannot be null. - - Returns a comparator for sorting hits. - - True if natural order should be reversed. - - use SortField (String field, FieldComparatorSource comparator, boolean reverse) - - - - Creates a sort, possibly in reverse, with a custom comparison function. - Name of field to sort by; cannot be null. - - Returns a comparator for sorting hits. - - True if natural order should be reversed. - - - - Returns the name of the field. Could return null - if the sort is by SCORE or DOC. - - Name of field, possibly null. - - - - Returns the type of contents in the field. - One of the constants SCORE, DOC, AUTO, STRING, INT or FLOAT. - - - - Returns the Locale by which term values are interpreted. - May return null if no Locale was specified. - - Locale, or null. - - - - Returns the instance of a parser that fits to the given sort type. - May return null if no parser was specified. Sorting is using the default parser then. - - An instance of a parser, or null. - - - - Returns whether the sort should be reversed. - True if natural order should be reversed. - - - - use - - - - Use legacy IndexSearch implementation: search with a DirectoryReader rather - than passing a single hit collector to multiple SegmentReaders. - - - true for legacy behavior - - will be removed in Lucene 3.0. - - - - if true, IndexSearch will use legacy sorting search implementation. - eg. multiple Priority Queues. - - will be removed in Lucene 3.0. - - - - Returns true if o is equal to this. If a - (deprecated) or - was provided, it must properly - implement equals (unless a singleton is always used). - - - - Returns true if o is equal to this. If a - (deprecated) or - was provided, it must properly - implement hashCode (unless a singleton is always - used). - - - - Returns the to use for - sorting. - - NOTE: This API is experimental and might change in - incompatible ways in the next release. - - - number of top hits the queue will store - - position of this SortField within - . The comparator is primary if sortPos==0, - secondary if sortPos==1, etc. Some comparators can - optimize themselves when they are the primary sort. - - to use when sorting - - - - Attempts to detect the given field type for an IndexReader. - - - - - A Filter that restricts search results to values that have a matching prefix in a given - field. - - - - Prints a user-readable version of this query. - - - The BoostingTermQuery is very similar to the except - that it factors in the value of the payload located at each of the positions where the - occurs. -

      - In order to take advantage of this, you must override - which returns 1 by default. -

      - Payload scores are averaged across term occurrences in the document. - -

      - - - - See - -
      - - This class is very similar to - except that it factors - in the value of the payload located at each of the positions where the - occurs. -

      - In order to take advantage of this, you must override - - which returns 1 by default. -

      - Payload scores are aggregated using a pluggable . - -

      -
      - - - * - - IOException - - - Returns the SpanScorer score only. -

      - Should not be overriden without good cause! - -

      - the score for just the Span part w/o the payload - - IOException - - - - -
      - - The score for the payload - - - The score, as calculated by - - - - - A that only accepts numeric values within - a specified range. To use this, you must first index the - numeric values using (expert: - ). - -

      You create a new NumericRangeFilter with the static - factory methods, eg: - - - Filter f = NumericRangeFilter.newFloatRange("weight", - new Float(0.3f), new Float(0.10f), - true, true); - - - accepts all documents whose float valued "weight" field - ranges from 0.3 to 0.10, inclusive. - See for details on how Lucene - indexes and searches numeric valued fields. - -

      NOTE: This API is experimental and - might change in incompatible ways in the next - release. - -

      - 2.9 - - -
      - - Factory that creates a NumericRangeFilter, that filters a long - range using the given precisionStep. - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeFilter, that queries a long - range using the default precisionStep (4). - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeFilter, that filters a int - range using the given precisionStep. - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeFilter, that queries a int - range using the default precisionStep (4). - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeFilter, that filters a double - range using the given precisionStep. - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeFilter, that queries a double - range using the default precisionStep (4). - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeFilter, that filters a float - range using the given precisionStep. - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeFilter, that queries a float - range using the default precisionStep (4). - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Returns the field name for this filter - - - Returns true if the lower endpoint is inclusive - - - Returns true if the upper endpoint is inclusive - - - Returns the lower value of this range filter - - - Returns the upper value of this range filter - - - Expert: obtains the ordinal of the field value from the default Lucene - FieldCache using getStringIndex() - and reverses the order. -

      - The native lucene index order is used to assign an ordinal value for each field value. -

      - Field values (terms) are lexicographically ordered by unicode value, and numbered starting at 1. -
      - Example of reverse ordinal (rord): -
      If there were only three field values: "apple","banana","pear" -
      then rord("apple")=3, rord("banana")=2, ord("pear")=1 -

      - WARNING: - rord() depends on the position in an index and can thus change - when other documents are inserted or deleted, - or if a MultiSearcher is used. - -

      - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. - -

      NOTE: with the switch in 2.9 to segment-based - searching, if is invoked with a - composite (multi-segment) reader, this can easily cause - double RAM usage for the values in the FieldCache. It's - best to switch your application to pass only atomic - (single segment) readers to this API. Alternatively, for - a short-term fix, you could wrap your ValueSource using - , which costs more CPU per lookup - but will not consume double the FieldCache RAM.

      -

      -
      - - Contructor for a certain field. - field whose values reverse order is used. - - - - Expert: obtains float field values from the - FieldCache - using getFloats() and makes those values - available as other numeric types, casting as needed. - -

      - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. - -

      - for requirements" - on the field. - -

      NOTE: with the switch in 2.9 to segment-based - searching, if is invoked with a - composite (multi-segment) reader, this can easily cause - double RAM usage for the values in the FieldCache. It's - best to switch your application to pass only atomic - (single segment) readers to this API. Alternatively, for - a short-term fix, you could wrap your ValueSource using - , which costs more CPU per lookup - but will not consume double the FieldCache RAM.

      - - - -

      Create a cached float field source with default string-to-float parser. -
      - - Create a cached float field source with a specific string-to-float parser. - - - Abstract class for enumerating a subset of all terms. -

      Term enumerations are always ordered by Term.compareTo(). Each term in - the enumeration is greater than all that precede it. -

      -
      - - the current term - - - the delegate enum - to set this member use - - - Equality compare on the term - - - Equality measure on the term - - - Indicates the end of the enumeration has been reached - - - use this method to set the actual TermEnum (e.g. in ctor), - it will be automatically positioned on the first matching term. - - - - Returns the docFreq of the current Term in the enumeration. - Returns -1 if no Term matches or all terms have been enumerated. - - - - Increments the enumeration to the next element. True if one exists. - - - Returns the current Term in the enumeration. - Returns null if no Term matches or all terms have been enumerated. - - - - Closes the enumeration to further activity, freeing resources. - - - A range filter built on top of a cached single term field (in ). - -

      FieldCacheRangeFilter builds a single cache for the field the first time it is used. - Each subsequent FieldCacheRangeFilter on the same field then reuses this cache, - even if the range itself changes. - -

      This means that FieldCacheRangeFilter is much faster (sometimes more than 100x as fast) - as building a (or on a ) - for each query, if using a . However, if the range never changes it - is slower (around 2x as slow) than building a CachingWrapperFilter on top of a single TermRangeFilter. - - For numeric data types, this filter may be significantly faster than . - Furthermore, it does not need the numeric values encoded by . But - it has the problem that it only works with exact one value/document (see below). - -

      As with all based functionality, FieldCacheRangeFilter is only valid for - fields which exact one term for each document (except for - where 0 terms are also allowed). Due to a restriction of , for numeric ranges - all terms that do not have a numeric value, 0 is assumed. - -

      Thus it works on dates, prices and other single value fields but will not work on - regular text fields. It is preferable to use a NOT_ANALYZED field to ensure that - there is only a single term. - -

      This class does not have an constructor, use one of the static factory methods available, - that create a correct instance for different data types supported by . -

      -
      - - This method is implemented for each data type - - - Creates a string range query using . This works with all - fields containing zero or one term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using . This works with all - byte fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using . This works with all - byte fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using . This works with all - short fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using . This works with all - short fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using . This works with all - int fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using . This works with all - int fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using . This works with all - long fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using . This works with all - long fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using . This works with all - float fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using . This works with all - float fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using . This works with all - double fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using . This works with all - double fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - this method checks, if a doc is a hit, should throw AIOBE, when position invalid - - - this DocIdSet is cacheable, if it works solely with FieldCache and no TermDocs - - - use instead. - - - - use instead. - - - - use instead. - - - - use instead. - - - - use instead. - - - - The TermVectorMapper can be used to map Term Vectors into your own - structure instead of the parallel array structure used by - . -

      - It is up to the implementation to make sure it is thread-safe. - - - -

      -
      - - - true if this mapper should tell Lucene to ignore positions even if they are stored - - similar to ignoringPositions - - - - Tell the mapper what to expect in regards to field, number of terms, offset and position storage. - This method will be called once before retrieving the vector for a field. - - This method will be called before . - - The field the vector is for - - The number of terms that need to be mapped - - true if the mapper should expect offset information - - true if the mapper should expect positions info - - - - Map the Term Vector information into your own structure - The term to add to the vector - - The frequency of the term in the document - - null if the offset is not specified, otherwise the offset into the field of the term - - null if the position is not specified, otherwise the position in the field of the term - - - - Indicate to Lucene that even if there are positions stored, this mapper is not interested in them and they - can be skipped over. Derived classes should set this to true if they want to ignore positions. The default - is false, meaning positions will be loaded if they are stored. - - false - - - - - Same principal as , but applied to offsets. false by default. - - false - - - - Passes down the index of the document whose term vector is currently being mapped, - once for each top level call to a term vector reader. -

      - Default implementation IGNORES the document number. Override if your implementation needs the document number. -

      - NOTE: Document numbers are internal to Lucene and subject to change depending on indexing operations. - -

      - index of document currently being mapped - -
      - - A Payload is metadata that can be stored together with each occurrence - of a term. This metadata is stored inline in the posting list of the - specific term. -

      - To store payloads in the index a has to be used that - produces payload data. -

      - Use and - to retrieve the payloads from the index.
      - -

      -
      - - the byte array containing the payload data - - - the offset within the byte array - - - the length of the payload data - - - Creates an empty payload and does not allocate a byte array. - - - Creates a new payload with the the given array as data. - A reference to the passed-in array is held, i. e. no - copy is made. - - - the data of this payload - - - - Creates a new payload with the the given array as data. - A reference to the passed-in array is held, i. e. no - copy is made. - - - the data of this payload - - the offset in the data byte array - - the length of the data - - - - Sets this payloads data. - A reference to the passed-in array is held, i. e. no - copy is made. - - - - Sets this payloads data. - A reference to the passed-in array is held, i. e. no - copy is made. - - - - Returns a reference to the underlying byte array - that holds this payloads data. - - - - Returns the offset in the underlying byte array - - - Returns the length of the payload data. - - - Returns the byte at the given index. - - - Allocates a new byte array, copies the payload data into it and returns it. - - - Copies the payload data to a byte array. - - - the target byte array - - the offset in the target byte array - - - - Clones this payload by creating a copy of the underlying - byte array. - - - - Processes all occurrences of a single field - - - Works in conjunction with the SinkTokenizer to provide the ability to set aside tokens - that have already been analyzed. This is useful in situations where multiple fields share - many common analysis steps and then go their separate ways. -

      - It is also useful for doing things like entity extraction or proper noun analysis as - part of the analysis workflow and saving off those tokens for use in another field. - - - SinkTokenizer sink1 = new SinkTokenizer(); - SinkTokenizer sink2 = new SinkTokenizer(); - TokenStream source1 = new TeeTokenFilter(new TeeTokenFilter(new WhitespaceTokenizer(reader1), sink1), sink2); - TokenStream source2 = new TeeTokenFilter(new TeeTokenFilter(new WhitespaceTokenizer(reader2), sink1), sink2); - TokenStream final1 = new LowerCaseFilter(source1); - TokenStream final2 = source2; - TokenStream final3 = new EntityDetect(sink1); - TokenStream final4 = new URLDetect(sink2); - d.add(new Field("f1", final1)); - d.add(new Field("f2", final2)); - d.add(new Field("f3", final3)); - d.add(new Field("f4", final4)); - - In this example, sink1 and sink2 will both get tokens from both - reader1 and reader2 after whitespace tokenizer - and now we can further wrap any of these in extra analysis, and more "sources" can be inserted if desired. - It is important, that tees are consumed before sinks (in the above example, the field names must be - less the sink's field names). - Note, the EntityDetect and URLDetect TokenStreams are for the example and do not currently exist in Lucene -

      - - See LUCENE-1058. -

      - WARNING: and only work with the old TokenStream API. - If you switch to the new API, you need to use instead, which offers - the same functionality. -

      - - - Use instead - - -
      - - This TokenFilter provides the ability to set aside attribute states - that have already been analyzed. This is useful in situations where multiple fields share - many common analysis steps and then go their separate ways. -

      - It is also useful for doing things like entity extraction or proper noun analysis as - part of the analysis workflow and saving off those tokens for use in another field. - - - TeeSinkTokenFilter source1 = new TeeSinkTokenFilter(new WhitespaceTokenizer(reader1)); - TeeSinkTokenFilter.SinkTokenStream sink1 = source1.newSinkTokenStream(); - TeeSinkTokenFilter.SinkTokenStream sink2 = source1.newSinkTokenStream(); - TeeSinkTokenFilter source2 = new TeeSinkTokenFilter(new WhitespaceTokenizer(reader2)); - source2.addSinkTokenStream(sink1); - source2.addSinkTokenStream(sink2); - TokenStream final1 = new LowerCaseFilter(source1); - TokenStream final2 = source2; - TokenStream final3 = new EntityDetect(sink1); - TokenStream final4 = new URLDetect(sink2); - d.add(new Field("f1", final1)); - d.add(new Field("f2", final2)); - d.add(new Field("f3", final3)); - d.add(new Field("f4", final4)); - - In this example, sink1 and sink2 will both get tokens from both - reader1 and reader2 after whitespace tokenizer - and now we can further wrap any of these in extra analysis, and more "sources" can be inserted if desired. - It is important, that tees are consumed before sinks (in the above example, the field names must be - less the sink's field names). If you are not sure, which stream is consumed first, you can simply - add another sink and then pass all tokens to the sinks at once using . - This TokenFilter is exhausted after this. In the above example, change - the example above to: - - ... - TokenStream final1 = new LowerCaseFilter(source1.newSinkTokenStream()); - TokenStream final2 = source2.newSinkTokenStream(); - sink1.consumeAllTokens(); - sink2.consumeAllTokens(); - ... - - In this case, the fields can be added in any order, because the sources are not used anymore and all sinks are ready. -

      Note, the EntityDetect and URLDetect TokenStreams are for the example and do not currently exist in Lucene. -

      -
      - - Instantiates a new TeeSinkTokenFilter. - - - Returns a new that receives all tokens consumed by this stream. - - - Returns a new that receives all tokens consumed by this stream - that pass the supplied filter. - - - - - - Adds a created by another TeeSinkTokenFilter - to this one. The supplied stream will also receive all consumed tokens. - This method can be used to pass tokens from two different tees to one sink. - - - - TeeSinkTokenFilter passes all tokens to the added sinks - when itself is consumed. To be sure, that all tokens from the input - stream are passed to the sinks, you can call this methods. - This instance is exhausted after this, but all sinks are instant available. - - - - A filter that decides which states to store in the sink. - - - Returns true, iff the current state of the passed-in shall be stored - in the sink. - - - - Called by . This method does nothing by default - and can optionally be overridden. - - - - Removes stop words from a token stream. - - - Construct a token stream filtering the given input. - Use instead - - - - Construct a token stream filtering the given input. - true if token positions should record the removed stop words - - input TokenStream - - array of stop words - - Use instead. - - - - Constructs a filter which removes words from the input - TokenStream that are named in the array of words. - - Use instead - - - - Constructs a filter which removes words from the input - TokenStream that are named in the array of words. - - true if token positions should record the removed stop words - - input TokenStream - - array of stop words - - true if case is ignored - - Use instead. - - - - Construct a token stream filtering the given input. - If stopWords is an instance of (true if - makeStopSet() was used to construct the set) it will be directly used - and ignoreCase will be ignored since CharArraySet - directly controls case sensitivity. -

      - If stopWords is not an instance of , - a new CharArraySet will be constructed and ignoreCase will be - used to specify the case sensitivity of that set. - -

      - - - The set of Stop Words. - - -Ignore case when stopping. - - Use instead - -
      - - Construct a token stream filtering the given input. - If stopWords is an instance of (true if - makeStopSet() was used to construct the set) it will be directly used - and ignoreCase will be ignored since CharArraySet - directly controls case sensitivity. -

      - If stopWords is not an instance of , - a new CharArraySet will be constructed and ignoreCase will be - used to specify the case sensitivity of that set. - -

      - true if token positions should record the removed stop words - - Input TokenStream - - The set of Stop Words. - - -Ignore case when stopping. - -
      - - Constructs a filter which removes words from the input - TokenStream that are named in the Set. - - - - - Use instead - - - - Constructs a filter which removes words from the input - TokenStream that are named in the Set. - - - true if token positions should record the removed stop words - - Input stream - - The set of Stop Words. - - - - - - Builds a Set from an array of stop words, - appropriate for passing into the StopFilter constructor. - This permits this stopWords construction to be cached once when - an Analyzer is constructed. - - - passing false to ignoreCase - - - - Builds a Set from an array of stop words, - appropriate for passing into the StopFilter constructor. - This permits this stopWords construction to be cached once when - an Analyzer is constructed. - - - passing false to ignoreCase - - - - - An array of stopwords - - If true, all words are lower cased first. - - a Set containing the words - - - - - A List of Strings representing the stopwords - - if true, all words are lower cased first - - A Set containing the words - - - - Returns the next input Token whose term() is not a stop word. - - - - - Please specify this when you create the StopFilter - - - - Returns version-dependent default for enablePositionIncrements. Analyzers - that embed StopFilter use this method when creating the StopFilter. Prior - to 2.9, this returns . On 2.9 - or later, it returns true. - - - - Set the default position increments behavior of every StopFilter created - from now on. -

      - Note: behavior of a single StopFilter instance can be modified with - . This static method allows - control over behavior of classes using StopFilters internally, for - example - if used with the no-arg ctor. -

      - Default : false. - -

      - - - Please specify this when you create the StopFilter - -
      - - - - - - If true, this StopFilter will preserve - positions of the incoming tokens (ie, accumulate and - set position increments of the removed stop tokens). - Generally, true is best as it does not - lose information (positions of the original tokens) - during indexing. - -

      When set, when a token is stopped - (omitted), the position increment of the following - token is incremented. - -

      NOTE: be sure to also - set if - you use QueryParser to create queries. -

      -
      - - CharReader is a Reader wrapper. It reads chars from - Reader and outputs , defining an - identify function method that - simply returns the provided offset. - - - - Stores and iterate on sorted integers in compressed form in RAM.
      - The code for compressing the differences between ascending integers was - borrowed from and - .

      - NOTE: this class assumes the stored integers are doc Ids (hence why it - extends ). Therefore its assumes - can be used as sentinel. If you intent to use - this value, then make sure it's not used during search flow. -

      -
      - - When a BitSet has fewer than 1 in BITS2VINTLIST_SIZE bits set, - a SortedVIntList representing the index numbers of the set bits - will be smaller than that BitSet. - - - - Create a SortedVIntList from all elements of an array of integers. - - - A sorted array of non negative integers. - - - - Create a SortedVIntList from an array of integers. - An array of sorted non negative integers. - - The number of integers to be used from the array. - - - - Create a SortedVIntList from a BitSet. - A bit set representing a set of integers. - - - - Create a SortedVIntList from an OpenBitSet. - A bit set representing a set of integers. - - - - Create a SortedVIntList. - An iterator providing document numbers as a set of integers. - This DocIdSetIterator is iterated completely when this constructor - is called and it must provide the integers in non - decreasing order. - - - - The total number of sorted integers. - - - - The size of the byte array storing the compressed sorted integers. - - - - This DocIdSet implementation is cacheable. - - - An iterator over the sorted integers. - - - - use instead. - - - - use instead. - - - - use instead. - - - - A ScorerDocQueue maintains a partial ordering of its Scorers such that the - least Scorer can always be found in constant time. Put()'s and pop()'s - require log(size) time. The ordering is by Scorer.doc(). - - - - Create a ScorerDocQueue with a maximum size. - - - Adds a Scorer to a ScorerDocQueue in log(size) time. - If one tries to add more Scorers than maxSize - a RuntimeException (ArrayIndexOutOfBound) is thrown. - - - - Adds a Scorer to the ScorerDocQueue in log(size) time if either - the ScorerDocQueue is not full, or not lessThan(scorer, top()). - - - - true if scorer is added, false otherwise. - - - - Returns the least Scorer of the ScorerDocQueue in constant time. - Should not be used when the queue is empty. - - - - Returns document number of the least Scorer of the ScorerDocQueue - in constant time. - Should not be used when the queue is empty. - - - - Removes and returns the least scorer of the ScorerDocQueue in log(size) - time. - Should not be used when the queue is empty. - - - - Removes the least scorer of the ScorerDocQueue in log(size) time. - Should not be used when the queue is empty. - - - - Should be called when the scorer at top changes doc() value. - Still log(n) worst case, but it's at least twice as fast to - { pq.top().change(); pq.adjustTop(); } - instead of - { o = pq.pop(); o.change(); pq.push(o); } - - - - - Returns the number of scorers currently stored in the ScorerDocQueue. - - - Removes all entries from the ScorerDocQueue. - - - Construct an OpenBitSetDISI with its bits set - from the doc ids of the given DocIdSetIterator. - Also give a maximum size one larger than the largest doc id for which a - bit may ever be set on this OpenBitSetDISI. - - - - Construct an OpenBitSetDISI with no bits set, and a given maximum size - one larger than the largest doc id for which a bit may ever be set - on this OpenBitSetDISI. - - - - Perform an inplace OR with the doc ids from a given DocIdSetIterator, - setting the bit for each such doc id. - These doc ids should be smaller than the maximum size passed to the - constructor. - - - - Perform an inplace AND with the doc ids from a given DocIdSetIterator, - leaving only the bits set for which the doc ids are in common. - These doc ids should be smaller than the maximum size passed to the - constructor. - - - - Perform an inplace NOT with the doc ids from a given DocIdSetIterator, - clearing all the bits for each such doc id. - These doc ids should be smaller than the maximum size passed to the - constructor. - - - - Perform an inplace XOR with the doc ids from a given DocIdSetIterator, - flipping all the bits for each such doc id. - These doc ids should be smaller than the maximum size passed to the - constructor. - - - - Methods for manipulating arrays. - - - Parses the string argument as if it was an int value and returns the - result. Throws NumberFormatException if the string does not represent an - int quantity. - - - a string representation of an int quantity. - - int the value represented by the argument - - NumberFormatException if the argument could not be parsed as an int quantity. - - - Parses a char array into an int. - the character array - - The offset into the array - - The length - - the int - - NumberFormatException if it can't parse - - - Parses the string argument as if it was an int value and returns the - result. Throws NumberFormatException if the string does not represent an - int quantity. The second argument specifies the radix to use when parsing - the value. - - - a string representation of an int quantity. - - - - the base to use for conversion. - - int the value represented by the argument - - NumberFormatException if the argument could not be parsed as an int quantity. - - - Returns hash of chars in range start (inclusive) to - end (inclusive) - - - - Returns hash of chars in range start (inclusive) to - end (inclusive) - - - - A that wraps another - and verifies that each lock obtain/release - is "correct" (never results in two processes holding the - lock at the same time). It does this by contacting an - external server () to assert that - at most one process holds the lock at a time. To use - this, you should also run on the - host & port matching what you pass to the constructor. - - - - - - - - - should be a unique id across all clients - - the LockFactory that we are testing - - host or IP where - is running - - the port is - listening on - - - -

      - The TimeLimitedCollector is used to timeout search requests that take longer - than the maximum allowed search time limit. After this time is exceeded, the - search thread is stopped by throwing a TimeExceeded Exception. -

      - -

      - Use instead, which extends the new - . This class will be removed in 3.0. - -
      - - Default timer resolution. - - - - - Default for . - - - - - Create a TimeLimitedCollector wrapper over another HitCollector with a specified timeout. - the wrapped HitCollector - - max time allowed for collecting hits after which is thrown - - - - Calls collect() on the decorated HitCollector. - - - TimeExceededException if the time allowed has been exceeded. - - - Return the timer resolution. - - - - - Set the timer resolution. - The default timer resolution is 20 milliseconds. - This means that a search required to take no longer than - 800 milliseconds may be stopped after 780 to 820 milliseconds. -
      Note that: - - Finer (smaller) resolution is more accurate but less efficient. - Setting resolution to less than 5 milliseconds will be silently modified to 5 milliseconds. - Setting resolution smaller than current resolution might take effect only after current - resolution. (Assume current resolution of 20 milliseconds is modified to 5 milliseconds, - then it can take up to 20 milliseconds for the change to have effect. - -
      -
      - - Checks if this time limited collector is greedy in collecting the last hit. - A non greedy collector, upon a timeout, would throw a - without allowing the wrapped collector to collect current doc. A greedy one would - first allow the wrapped hit collector to collect current doc and only then - throw a . - - - - - - Sets whether this time limited collector is greedy. - true to make this time limited greedy - - - - - - TimerThread provides a pseudo-clock service to all searching - threads, so that they can count elapsed time with less overhead - than repeatedly calling System.currentTimeMillis. A single - thread should be created to be used for all searches. - - - - Get the timer value in milliseconds. - - - Thrown when elapsed search time exceeds allowed search time. - - - Returns allowed time (milliseconds). - - - Returns elapsed time (milliseconds). - - - Returns last doc that was collected when the search time exceeded. - - - Expert: Compares two ScoreDoc objects for sorting. - -

      Created: Feb 3, 2004 9:00:16 AM - -

      - lucene 1.4 - - $Id: ScoreDocComparator.java 738219 2009-01-27 20:15:21Z mikemccand $ - - use - -
      - - Special comparator for sorting hits according to computed relevance (document score). - - - Special comparator for sorting hits according to index order (document number). - - - Creates a new instance with size elements. If - prePopulate is set to true, the queue will pre-populate itself - with sentinel objects and set its to size. In - that case, you should not rely on to get the number of - actual elements that were added to the queue, but keep track yourself.
      - NOTE: in case prePopulate is true, you should pop - elements from the queue using the following code example: - - - PriorityQueue pq = new HitQueue(10, true); // pre-populate. - ScoreDoc top = pq.top(); - - // Add/Update one element. - top.score = 1.0f; - top.doc = 0; - top = (ScoreDoc) pq.updateTop(); - int totalHits = 1; - - // Now pop only the elements that were *truly* inserted. - // First, pop all the sentinel elements (there are pq.size() - totalHits). - for (int i = pq.size() - totalHits; i > 0; i--) pq.pop(); - - // Now pop the truly added elements. - ScoreDoc[] results = new ScoreDoc[totalHits]; - for (int i = totalHits - 1; i >= 0; i--) { - results[i] = (ScoreDoc) pq.pop(); - } - - -

      NOTE: This class pre-allocate a full array of - length size. - -

      - the requested size of this queue. - - specifies whether to pre-populate the queue with sentinel values. - - - -
      - - Expert: obtains single byte field values from the - FieldCache - using getBytes() and makes those values - available as other numeric types, casting as needed. - -

      - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. - -

      - for requirements" - on the field. - -

      NOTE: with the switch in 2.9 to segment-based - searching, if is invoked with a - composite (multi-segment) reader, this can easily cause - double RAM usage for the values in the FieldCache. It's - best to switch your application to pass only atomic - (single segment) readers to this API. Alternatively, for - a short-term fix, you could wrap your ValueSource using - , which costs more CPU per lookup - but will not consume double the FieldCache RAM.

      - - - -

      Create a cached byte field source with default string-to-byte parser. -
      - - Create a cached byte field source with a specific string-to-byte parser. - - - Expert: A hit queue for sorting by hits by terms in more than one field. - Uses FieldCache.DEFAULT for maintaining - internal term lookup tables. - - This class will not resolve SortField.AUTO types, and expects the type - of all SortFields used for construction to already have been resolved. - is a utility method which - may be used for field type detection. - - NOTE: This API is experimental and might change in - incompatible ways in the next release. - - - 2.9 - - $Id: - - - - - - - - Creates a hit queue sorted by the given list of fields. - -

      NOTE: The instances returned by this method - pre-allocate a full array of length numHits. - -

      - SortField array we are sorting by in priority order (highest - priority first); cannot be null or empty - - The number of hits to retain. Must be greater than zero. - - IOException -
      - - Stores the sort criteria being used. - - - Given a queue Entry, creates a corresponding FieldDoc - that contains the values used to sort the given document. - These values are not the raw values out of the index, but the internal - representation of them. This is so the given search hit can be collated by - a MultiSearcher with other search hits. - - - The Entry used to create a FieldDoc - - The newly created FieldDoc - - - - - - Returns the SortFields being used by this hit queue. - - - An implementation of which is optimized in case - there is just one comparator. - - - - Returns whether a is less relevant than b. - ScoreDoc - - ScoreDoc - - true if document a should be sorted after document b. - - - - An implementation of which is optimized in case - there is more than one comparator. - - - - A TermInfo is the record of information stored for a term. - - - The number of documents which contain the term. - - - Call this if the IndexInput passed to - stores terms in the "modified UTF8" (pre LUCENE-510) - format. - - - - This is a DocFieldConsumer that writes stored fields. - - - Fills in any hole in the docIDs - - - A that wraps around any other - and adds the ability to hold and - later release a single "snapshot" of an index. While - the snapshot is held, the will not - remove any files associated with it even if the index is - otherwise being actively, arbitrarily changed. Because - we wrap another arbitrary , this - gives you the freedom to continue using whatever - you would normally want to use with your - index. Note that you can re-use a single instance of - SnapshotDeletionPolicy across multiple writers as long - as they are against the same index Directory. Any - snapshot held when a writer is closed will "survive" - when the next writer is opened. - -

      WARNING: This API is a new and experimental and - may suddenly change.

      -

      -
      - - Take a snapshot of the most recent commit to the - index. You must call release() to free this snapshot. - Note that while the snapshot is held, the files it - references will not be deleted, which will consume - additional disk space in your index. If you take a - snapshot at a particularly bad time (say just before - you call optimize()) then in the worst case this could - consume an extra 1X of your total index size, until - you release the snapshot. - - - - Release the currently held snapshot. - - -

      Expert: represents a single commit into an index as seen by the - or .

      - -

      Changes to the content of an index are made visible - only after the writer who made that change commits by - writing a new segments file - (segments_N). This point in time, when the - action of writing of a new segments file to the directory - is completed, is an index commit.

      - -

      Each index commit point has a unique segments file - associated with it. The segments file associated with a - later index commit point would have a larger N.

      - -

      WARNING: This API is a new and experimental and - may suddenly change.

      -

      -
      - - Please subclass IndexCommit class instead - - - - Get the segments file (segments_N) associated - with this commit point. - - - - Returns all index files referenced by this commit point. - - - Delete this commit point. -

      - Upon calling this, the writer is notified that this commit - point should be deleted. -

      - Decision that a commit-point should be deleted is taken by the in effect - and therefore this should only be called by its or - methods. -

      -
      - - Get the segments file (segments_N) associated - with this commit point. - - - - Returns all index files referenced by this commit point. - - - Returns the for the index. - - - Delete this commit point. This only applies when using - the commit point in the context of IndexWriter's - IndexDeletionPolicy. -

      - Upon calling this, the writer is notified that this commit - point should be deleted. -

      - Decision that a commit-point should be deleted is taken by the in effect - and therefore this should only be called by its or - methods. -

      -
      - - Returns true if this commit is an optimized index. - - - Two IndexCommits are equal if both their Directory and versions are equal. - - - Returns the version for this IndexCommit. This is the - same value that would - return if it were opened on this commit. - - - - Returns the generation (the _N in segments_N) for this - IndexCommit - - - - Convenience method that returns the last modified time - of the segments_N file corresponding to this index - commit, equivalent to - getDirectory().fileModified(getSegmentsFileName()). - - - - Returns userData, previously passed to - - for this commit. IDictionary is String -> String. - - - - $Id - -

      NOTE: This API is new and still experimental - (subject to change suddenly in the next release)

      -

      -
      - - The class which implements SegmentReader. - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Clones the norm bytes. May be overridden by subclasses. New and experimental. - Byte array to clone - - New BitVector - - - - Clones the deleteDocs BitVector. May be overridden by subclasses. New and experimental. - BitVector to clone - - New BitVector - - - - - - - - - - - - Read norms into a pre-allocated array. - - - Create a clone from the initial TermVectorsReader and store it in the ThreadLocal. - TermVectorsReader - - - - Return a term frequency vector for the specified document and field. The - vector returned contains term numbers and frequencies for all terms in - the specified field of this document, if the field had storeTermVector - flag set. If the flag was not set, the method returns null. - - IOException - - - Return an array of term frequency vectors for the specified document. - The array contains a vector for each vectorized field in the document. - Each vector vector contains term numbers and frequencies for all terms - in a given vectorized field. - If no such fields existed, the method returns null. - - IOException - - - Return the name of the segment this reader is reading. - - - Return the SegmentInfo of the segment this reader is reading. - - - Returns the directory this index resides in. - - - Lotsa tests did hacks like:
      - SegmentReader reader = (SegmentReader) IndexReader.open(dir);
      - They broke. This method serves as a hack to keep hacks working -
      -
      - - Sets the initial value - - - Byte[] referencing is used because a new norm object needs - to be created for each clone, and the byte array is all - that is needed for sharing between cloned readers. The - current norm referencing is for sharing between readers - whereas the byte[] referencing is for copy on write which - is independent of reader references (i.e. incRef, decRef). - - - - Holds buffered deletes, by docID, term or query. We - hold two instances of this class: one for the deletes - prior to the last flush, the other for deletes after - the last flush. This is so if we need to abort - (discard all buffered docs) we can also discard the - buffered deletes yet keep the deletes done during - previously flushed segments. - - - - Provides support for converting longs to Strings, and back again. The strings - are structured so that lexicographic sorting order is preserved. - -

      - That is, if l1 is less than l2 for any two longs l1 and l2, then - NumberTools.longToString(l1) is lexicographically less than - NumberTools.longToString(l2). (Similarly for "greater than" and "equals".) - -

      - This class handles all long values (unlike - ). - -

      - For new indexes use instead, which - provides a sortable binary representation (prefix encoded) of numeric - values. - To index and efficiently query numeric values use - and . - This class is included for use with existing - indices and will be removed in a future release. - -
      - - Equivalent to longToString(Long.MIN_VALUE) - - - Equivalent to longToString(Long.MAX_VALUE) - - - The length of (all) strings returned by - - - Converts a long to a String suitable for indexing. - - - Converts a String that was returned by back to a - long. - - - IllegalArgumentException - if the input is null - - NumberFormatException - if the input does not parse (it was not a String returned by - longToString()). - - - - Documents are the unit of indexing and search. - - A Document is a set of fields. Each field has a name and a textual value. - A field may be stored with the document, in which - case it is returned with search hits on the document. Thus each document - should typically contain one or more stored fields which uniquely identify - it. - -

      Note that fields which are not stored are - not available in documents retrieved from the index, e.g. with , - or . -

      -
      - - Constructs a new document with no fields. - - - Sets a boost factor for hits on any field of this document. This value - will be multiplied into the score of all hits on this document. - -

      The default value is 1.0. - -

      Values are multiplied into the value of of - each field in this document. Thus, this method in effect sets a default - boost for the fields of this document. - -

      - - -
      - - Returns, at indexing time, the boost factor as set by . - -

      Note that once a document is indexed this value is no longer available - from the index. At search time, for retrieved documents, this method always - returns 1. This however does not mean that the boost value set at indexing - time was ignored - it was just combined with other indexing time factors and - stored elsewhere, for better indexing and search performance. (For more - information see the "norm(t,d)" part of the scoring formula in - Similarity.) - -

      - - -
      - -

      Adds a field to a document. Several fields may be added with - the same name. In this case, if the fields are indexed, their text is - treated as though appended for the purposes of search.

      -

      Note that add like the removeField(s) methods only makes sense - prior to adding a document to an index. These methods cannot - be used to change the content of an existing index! In order to achieve this, - a document has to be deleted from an index and a new changed version of that - document has to be added.

      -

      -
      - -

      Removes field with the specified name from the document. - If multiple fields exist with this name, this method removes the first field that has been added. - If there is no field with the specified name, the document remains unchanged.

      -

      Note that the removeField(s) methods like the add method only make sense - prior to adding a document to an index. These methods cannot - be used to change the content of an existing index! In order to achieve this, - a document has to be deleted from an index and a new changed version of that - document has to be added.

      -

      -
      - -

      Removes all fields with the given name from the document. - If there is no field with the specified name, the document remains unchanged.

      -

      Note that the removeField(s) methods like the add method only make sense - prior to adding a document to an index. These methods cannot - be used to change the content of an existing index! In order to achieve this, - a document has to be deleted from an index and a new changed version of that - document has to be added.

      -

      -
      - - Returns a field with the given name if any exist in this document, or - null. If multiple fields exists with this name, this method returns the - first value added. - Do not use this method with lazy loaded fields. - - - - Returns a field with the given name if any exist in this document, or - null. If multiple fields exists with this name, this method returns the - first value added. - - - - Returns the string value of the field with the given name if any exist in - this document, or null. If multiple fields exist with this name, this - method returns the first value added. If only binary fields with this name - exist, returns null. - - - - Returns an Enumeration of all the fields in a document. - use instead - - - - Returns a List of all the fields in a document. -

      Note that fields which are not stored are - not available in documents retrieved from the - index, e.g. or . -

      -
      - - Returns an array of s with the given name. - Do not use with lazy loaded fields. - This method returns an empty array when there are no - matching fields. It never returns null. - - - the name of the field - - a Field[] array - - - - Returns an array of s with the given name. - This method returns an empty array when there are no - matching fields. It never returns null. - - - the name of the field - - a Fieldable[] array - - - - Returns an array of values of the field specified as the method parameter. - This method returns an empty array when there are no - matching fields. It never returns null. - - the name of the field - - a String[] of field values - - - - Returns an array of byte arrays for of the fields that have the name specified - as the method parameter. This method returns an empty - array when there are no matching fields. It never - returns null. - - - the name of the field - - a byte[][] of binary field values - - - - Returns an array of bytes for the first (or only) field that has the name - specified as the method parameter. This method will return null - if no binary fields with the specified name are available. - There may be non-binary fields with the same name. - - - the name of the field. - - a byte[] containing the binary field value or null - - - - Prints the fields of a document for human consumption. - - - Loader for text files that represent a list of stopwords. - - - - $Id: WordlistLoader.java 706342 2008-10-20 17:19:29Z gsingers $ - - - - Loads a text file and adds every line as an entry to a HashSet (omitting - leading and trailing whitespace). Every line of the file should contain only - one word. The words need to be in lowercase if you make use of an - Analyzer which uses LowerCaseFilter (like StandardAnalyzer). - - - File containing the wordlist - - A HashSet with the file's words - - - - Loads a text file and adds every non-comment line as an entry to a HashSet (omitting - leading and trailing whitespace). Every line of the file should contain only - one word. The words need to be in lowercase if you make use of an - Analyzer which uses LowerCaseFilter (like StandardAnalyzer). - - - File containing the wordlist - - The comment string to ignore - - A HashSet with the file's words - - - - Reads lines from a Reader and adds every line as an entry to a HashSet (omitting - leading and trailing whitespace). Every line of the Reader should contain only - one word. The words need to be in lowercase if you make use of an - Analyzer which uses LowerCaseFilter (like StandardAnalyzer). - - - Reader containing the wordlist - - A HashSet with the reader's words - - - - Reads lines from a Reader and adds every non-comment line as an entry to a HashSet (omitting - leading and trailing whitespace). Every line of the Reader should contain only - one word. The words need to be in lowercase if you make use of an - Analyzer which uses LowerCaseFilter (like StandardAnalyzer). - - - Reader containing the wordlist - - The string representing a comment. - - A HashSet with the reader's words - - - - Reads a stem dictionary. Each line contains: - word\tstem - (i.e. two tab seperated words) - - - stem dictionary that overrules the stemming algorithm - - IOException - - - Emits the entire input as a single token. - - - Will be removed in Lucene 3.0. This method is final, as it should - not be overridden. Delegates to the backwards compatibility layer. - - - - Will be removed in Lucene 3.0. This method is final, as it should - not be overridden. Delegates to the backwards compatibility layer. - - - - "Tokenizes" the entire stream as a single token. This is useful - for data like zip codes, ids, and some product names. - - - - A simple class that stores Strings as char[]'s in a - hash table. Note that this is not a general purpose - class. For example, it cannot remove items from the - set, nor does it resize its hash table to be smaller, - etc. It is designed to be quick to test if a char[] - is in the set without the necessity of converting it - to a String first. - - - - Create set with enough capacity to hold startSize - terms - - - - Create set from a Collection of char[] or String - - - Create set from entries - - - true if the len chars of text starting at off - are in the set - - - - true if the System.String is in the set - - - Returns true if the String is in the set - - - Add this String into the set - - - Add this char[] directly to the set. - If ignoreCase is true for this Set, the text array will be directly modified. - The user should never modify this text array after calling this method. - - - - Returns an unmodifiable . This allows to provide - unmodifiable views of internal sets for "read-only" use. - - a set for which the unmodifiable set is returned. - - an new unmodifiable . - - NullReferenceException thrown - if the given set is null. - - - Adds all of the elements in the specified collection to this collection - - - Removes all elements from the set - - - Removes from this set all of its elements that are contained in the specified collection - - - Retains only the elements in this set that are contained in the specified collection - - - The Iterator<String> for this set. Strings are constructed on the fly, so - use nextCharArray for more efficient access. - - - - do not modify the returned char[] - - - Returns the next String, as a Set<String> would... - use nextCharArray() for better efficiency. - - - - Efficient unmodifiable . This implementation does not - delegate calls to a given like - Collections.UnmodifiableSet(java.util.Set) does. Instead is passes - the internal representation of a to a super - constructor and overrides all mutators. - - - - Encapsulates sort criteria for returned hits. - -

      The fields used to determine sort order must be carefully chosen. - Documents must contain a single term in such a field, - and the value of the term should indicate the document's relative position in - a given sort order. The field must be indexed, but should not be tokenized, - and does not need to be stored (unless you happen to want it back with the - rest of your document data). In other words: - -

      document.add (new Field ("byNumber", Integer.toString(x), Field.Store.NO, Field.Index.NOT_ANALYZED));

      - - -

      Valid Types of Values

      - -

      There are four possible kinds of term values which may be put into - sorting fields: Integers, Longs, Floats, or Strings. Unless - SortField objects are specified, the type of value - in the field is determined by parsing the first term in the field. - -

      Integer term values should contain only digits and an optional - preceding negative sign. Values must be base 10 and in the range - Integer.MIN_VALUE and Integer.MAX_VALUE inclusive. - Documents which should appear first in the sort - should have low value integers, later documents high values - (i.e. the documents should be numbered 1..n where - 1 is the first and n the last). - -

      Long term values should contain only digits and an optional - preceding negative sign. Values must be base 10 and in the range - Long.MIN_VALUE and Long.MAX_VALUE inclusive. - Documents which should appear first in the sort - should have low value integers, later documents high values. - -

      Float term values should conform to values accepted by - (except that NaN - and Infinity are not supported). - Documents which should appear first in the sort - should have low values, later documents high values. - -

      String term values can contain any valid String, but should - not be tokenized. The values are sorted according to their - natural order. Note that using this type - of term value has higher memory requirements than the other - two types. - -

      Object Reuse

      - -

      One of these objects can be - used multiple times and the sort order changed between usages. - -

      This class is thread safe. - -

      Memory Usage

      - -

      Sorting uses of caches of term values maintained by the - internal HitQueue(s). The cache is static and contains an integer - or float array of length IndexReader.maxDoc() for each field - name for which a sort is performed. In other words, the size of the - cache in bytes is: - -

      4 * IndexReader.maxDoc() * (# of different fields actually used to sort) - -

      For String fields, the cache is larger: in addition to the - above array, the value of every term in the field is kept in memory. - If there are many unique terms in the field, this could - be quite large. - -

      Note that the size of the cache is not affected by how many - fields are in the index and might be used to sort - only by - the ones actually used to sort a result set. - -

      Created: Feb 12, 2004 10:53:57 AM - -

      - lucene 1.4 - - $Id: Sort.java 795179 2009-07-17 18:23:30Z mikemccand $ - -
      - - Represents sorting by computed relevance. Using this sort criteria returns - the same results as calling - Searcher#search()without a sort criteria, - only with slightly more overhead. - - - - Represents sorting by index order. - - - Sorts by computed relevance. This is the same sort criteria as calling - without a sort criteria, - only with slightly more overhead. - - - - Sorts by the terms in field then by index order (document - number). The type of value in field is determined - automatically. - - - - - Please specify the type explicitly by - first creating a and then use - - - - - Sorts possibly in reverse by the terms in field then by - index order (document number). The type of value in field is - determined automatically. - - - - - Please specify the type explicitly by - first creating a and then use - - - - - Sorts in succession by the terms in each field. The type of value in - field is determined automatically. - - - - - Please specify the type explicitly by - first creating s and then use - - - - - Sorts by the criteria in the given SortField. - - - Sorts in succession by the criteria in each SortField. - - - Sets the sort to the terms in field then by index order - (document number). - - Please specify the type explicitly by - first creating a and then use - - - - - Sets the sort to the terms in field possibly in reverse, - then by index order (document number). - - Please specify the type explicitly by - first creating a and then use - - - - - Sets the sort to the terms in each field in succession. - Please specify the type explicitly by - first creating s and then use - - - - - Sets the sort to the given criteria. - - - Sets the sort to the given criteria in succession. - - - Representation of the sort criteria. - Array of SortField objects used in this sort criteria - - - - Returns true if o is equal to this. - - - Returns a hash code value for this object. - - - A implementation which wraps another - and makes sure only documents with - scores > 0 are collected. - - - - Expert: Scoring functionality for phrase queries. -
      A document is considered matching if it contains the phrase-query terms - at "valid" positons. What "valid positions" are - depends on the type of the phrase query: for an exact phrase query terms are required - to appear in adjacent locations, while for a sloppy phrase query some distance between - the terms is allowed. The abstract method of extending classes - is invoked for each document containing all the phrase query terms, in order to - compute the frequency of the phrase query in that document. A non zero frequency - means a match. -
      -
      - - use instead. - - - - use instead. - - - - use instead. - - - - For a document containing all the phrase query terms, compute the - frequency of the phrase in that document. - A non zero frequency means a match. -
      Note, that containing all phrase terms does not guarantee a match - they have to be found in matching locations. -
      - frequency of the phrase in current doc, 0 if not found. - -
      - - Expert: A ScoreDoc which also contains information about - how to sort the referenced document. In addition to the - document number and score, this object contains an array - of values for the document from the field(s) used to sort. - For example, if the sort criteria was to sort by fields - "a", "b" then "c", the fields object array - will have three elements, corresponding respectively to - the term values for the document in fields "a", "b" and "c". - The class of each element in the array will be either - Integer, Float or String depending on the type of values - in the terms of each field. - -

      Created: Feb 11, 2004 1:23:38 PM - -

      - lucene 1.4 - - $Id: FieldDoc.java 773194 2009-05-09 10:36:41Z mikemccand $ - - - - - -
      - - Expert: Returned by low-level search implementations. - - - - - Expert: The score of this document for the query. - - - Expert: A hit document's number. - - - - - Expert: Constructs a ScoreDoc. - - - Expert: The values which are used to sort the referenced document. - The order of these will match the original sort criteria given by a - Sort object. Each Object will be either an Integer, Float or String, - depending on the type of values in the terms of the original field. - - - - - - - - Expert: Creates one of these objects with empty sort information. - - - Expert: Creates one of these objects with the given sort information. - - - A query that wraps a filter and simply returns a constant score equal to the - query boost for every document in the filter. - - - - $Id: ConstantScoreQuery.java 807180 2009-08-24 12:26:43Z markrmiller $ - - - - Returns the encapsulated filter - - - Prints a user-readable version of this query. - - - Returns true if o is equal to this. - - - Returns a hash code value for this object. - - - use instead. - - - - use instead. - - - - use instead. - - - - This class is generated by JavaCC. The most important method is - . - - The syntax for query strings is as follows: - A Query is a series of clauses. - A clause may be prefixed by: - - a plus (+) or a minus (-) sign, indicating - that the clause is required or prohibited respectively; or - a term followed by a colon, indicating the field to be searched. - This enables one to construct queries which search multiple fields. - - - A clause may be either: - - a term, indicating all the documents that contain this term; or - a nested query, enclosed in parentheses. Note that this may be used - with a +/- prefix to require any of a set of - terms. - - - Thus, in BNF, the query grammar is: - - Query ::= ( Clause )* - Clause ::= ["+", "-"] [<TERM> ":"] ( <TERM> | "(" Query ")" ) - - -

      - Examples of appropriately formatted queries can be found in the query syntax - documentation. -

      - -

      - In s, QueryParser tries to detect date values, e.g. - date:[6/1/2005 TO 6/4/2005] produces a range query that searches - for "date" fields between 2005-06-01 and 2005-06-04. Note that the format - of the accepted input depends on the locale. - By default a date is converted into a search term using the deprecated - for compatibility reasons. - To use the new to convert dates, a - has to be set. -

      -

      - The date resolution that shall be used for RangeQueries can be set - using - or . The former - sets the default date resolution for all fields, whereas the latter can - be used to set field specific date resolutions. Field specific date - resolutions take, if set, precedence over the default date resolution. -

      -

      - If you use neither nor in your - index, you can create your own - query parser that inherits QueryParser and overwrites - to - use a different method for date conversion. -

      - -

      Note that QueryParser is not thread-safe.

      - -

      NOTE: there is a new QueryParser in contrib, which matches - the same syntax as this class, but is more modular, - enabling substantial customization to how a query is created. - -

      NOTE: there is a new QueryParser in contrib, which matches - the same syntax as this class, but is more modular, - enabling substantial customization to how a query is created. - NOTE: You must specify the required compatibility when - creating QueryParser: - - As of 2.9, is true by default. - -

      -
      - - Alternative form of QueryParser.Operator.AND - - - Alternative form of QueryParser.Operator.OR - - - The actual operator that parser uses to combine query terms - - - Constructs a query parser. - the default field for query terms. - - used to find terms in the query text. - - Use instead - - - - Constructs a query parser. - - - Lucene version to match. See above) - - the default field for query terms. - - used to find terms in the query text. - - - - Parses a query string, returning a . - the query string to be parsed. - - ParseException if the parsing fails - - - Returns the analyzer. - - - - Returns the field. - - - - Get the minimal similarity for fuzzy queries. - - - Set the minimum similarity for fuzzy queries. - Default is 0.5f. - - - - Get the prefix length for fuzzy queries. - Returns the fuzzyPrefixLength. - - - - Set the prefix length for fuzzy queries. Default is 0. - The fuzzyPrefixLength to set. - - - - Sets the default slop for phrases. If zero, then exact phrase matches - are required. Default value is zero. - - - - Gets the default slop for phrases. - - - Set to true to allow leading wildcard characters. -

      - When set, * or ? are allowed as - the first character of a PrefixQuery and WildcardQuery. - Note that this can produce very slow - queries on big indexes. -

      - Default: false. -

      -
      - - - - - - Set to true to enable position increments in result query. -

      - When set, result phrase and multi-phrase queries will - be aware of position increments. - Useful when e.g. a StopFilter increases the position increment of - the token that follows an omitted token. -

      - Default: false. -

      -
      - - - - - - Sets the boolean operator of the QueryParser. - In default mode (OR_OPERATOR) terms without any modifiers - are considered optional: for example capital of Hungary is equal to - capital OR of OR Hungary.
      - In AND_OPERATOR mode terms are considered to be in conjunction: the - above mentioned query is parsed as capital AND of AND Hungary -
      -
      - - Gets implicit operator setting, which will be either AND_OPERATOR - or OR_OPERATOR. - - - - Whether terms of wildcard, prefix, fuzzy and range queries are to be automatically - lower-cased or not. Default is true. - - - - - - - - Please use instead. - - - - Please use instead. - - - - By default QueryParser uses - when creating a PrefixQuery, WildcardQuery or RangeQuery. This implementation is generally preferable because it - a) Runs faster b) Does not have the scarcity of terms unduly influence score - c) avoids any "TooManyBooleanClauses" exception. - However, if your application really needs to use the - old-fashioned BooleanQuery expansion rewriting and the above - points are not relevant then use this to change - the rewrite method. - - - - - - - - Set locale used by date range parsing. - - - Returns current locale, allowing access by subclasses. - - - Sets the default date resolution used by RangeQueries for fields for which no - specific date resolutions has been set. Field specific resolutions can be set - with . - - - the default date resolution to set - - - - Sets the date resolution used by RangeQueries for a specific field. - - - field for which the date resolution is to be set - - date resolution to set - - - - Returns the date resolution that is used by RangeQueries for the given field. - Returns null, if no default or field specific date resolution has been set - for the given field. - - - - - Sets the collator used to determine index term inclusion in ranges - for RangeQuerys. -

      - WARNING: Setting the rangeCollator to a non-null - collator using this method will cause every single index Term in the - Field referenced by lowerTerm and/or upperTerm to be examined. - Depending on the number of index Terms in this Field, the operation could - be very slow. - -

      - the collator to use when constructing RangeQuerys - -
      - - the collator used to determine index term inclusion in ranges - for RangeQuerys. - - - - use instead. - - - - throw in overridden method to disallow - - - - Base implementation delegates to . - This method may be overridden, for example, to return - a SpanNearQuery instead of a PhraseQuery. - - - throw in overridden method to disallow - - - - throw in overridden method to disallow - - - - Builds a new BooleanQuery instance - disable coord - - new BooleanQuery instance - - - - Builds a new BooleanClause instance - sub query - - how this clause should occur when matching documents - - new BooleanClause instance - - - - Builds a new TermQuery instance - term - - new TermQuery instance - - - - Builds a new PhraseQuery instance - new PhraseQuery instance - - - - Builds a new MultiPhraseQuery instance - new MultiPhraseQuery instance - - - - Builds a new PrefixQuery instance - Prefix term - - new PrefixQuery instance - - - - Builds a new FuzzyQuery instance - Term - - minimum similarity - - prefix length - - new FuzzyQuery Instance - - - - Builds a new TermRangeQuery instance - Field - - min - - max - - true if range is inclusive - - new TermRangeQuery instance - - - - Builds a new MatchAllDocsQuery instance - new MatchAllDocsQuery instance - - - - Builds a new WildcardQuery instance - wildcard term - - new WildcardQuery instance - - - - Factory method for generating query, given a set of clauses. - By default creates a boolean query composed of clauses passed in. - - Can be overridden by extending classes, to modify query being - returned. - - - List that contains instances - to join. - - - Resulting object. - - throw in overridden method to disallow - - use instead - - - - Factory method for generating query, given a set of clauses. - By default creates a boolean query composed of clauses passed in. - - Can be overridden by extending classes, to modify query being - returned. - - - List that contains instances - to join. - - - Resulting object. - - throw in overridden method to disallow - - - - Factory method for generating query, given a set of clauses. - By default creates a boolean query composed of clauses passed in. - - Can be overridden by extending classes, to modify query being - returned. - - - List that contains instances - to join. - - true if coord scoring should be disabled. - - - Resulting object. - - throw in overridden method to disallow - - use instead - - - - Factory method for generating query, given a set of clauses. - By default creates a boolean query composed of clauses passed in. - - Can be overridden by extending classes, to modify query being - returned. - - - List that contains instances - to join. - - true if coord scoring should be disabled. - - - Resulting object. - - throw in overridden method to disallow - - - - Factory method for generating a query. Called when parser - parses an input term token that contains one or more wildcard - characters (? and *), but is not a prefix term token (one - that has just a single * character at the end) -

      - Depending on settings, prefix term may be lower-cased - automatically. It will not go through the default Analyzer, - however, since normal Analyzers are unlikely to work properly - with wildcard templates. -

      - Can be overridden by extending classes, to provide custom handling for - wildcard queries, which may be necessary due to missing analyzer calls. - -

      - Name of the field query will use. - - Term token that contains one or more wild card - characters (? or *), but is not simple prefix term - - - Resulting built for the term - - throw in overridden method to disallow - -
      - - Factory method for generating a query (similar to - ). Called when parser parses an input term - token that uses prefix notation; that is, contains a single '*' wildcard - character as its last character. Since this is a special case - of generic wildcard term, and such a query can be optimized easily, - this usually results in a different query object. -

      - Depending on settings, a prefix term may be lower-cased - automatically. It will not go through the default Analyzer, - however, since normal Analyzers are unlikely to work properly - with wildcard templates. -

      - Can be overridden by extending classes, to provide custom handling for - wild card queries, which may be necessary due to missing analyzer calls. - -

      - Name of the field query will use. - - Term token to use for building term for the query - (without trailing '*' character!) - - - Resulting built for the term - - throw in overridden method to disallow - -
      - - Factory method for generating a query (similar to - ). Called when parser parses - an input term token that has the fuzzy suffix (~) appended. - - - Name of the field query will use. - - Term token to use for building term for the query - - - Resulting built for the term - - throw in overridden method to disallow - - - - Returns a String where the escape char has been - removed, or kept only once if there was a double escape. - - Supports escaped unicode characters, e. g. translates - \\u0041 to A. - - - - - Returns the numeric value of the hexadecimal character - - - Returns a String where those characters that QueryParser - expects to be escaped are escaped by a preceding \. - - - - Command line tool to test QueryParser, using . - Usage:
      - java Lucene.Net.QueryParsers.QueryParser <input> -
      -
      - - Generated Token Manager. - - - Current token. - - - Next token. - - - Constructor with user supplied CharStream. - - - Reinitialise. - - - Constructor with generated Token Manager. - - - Reinitialise. - - - Get the next Token. - - - Get the specific Token. - - - Generate ParseException. - - - Enable tracing. - - - Disable tracing. - - - The default operator for parsing queries. - Use to change it. - - - -

      [Note that as of 2.1, all but one of the - methods in this class are available via - . The one method that is not available is - .]

      - - A class to modify an index, i.e. to delete and add documents. This - class hides and so that you - do not need to care about implementation details such as that adding - documents is done via IndexWriter and deletion is done via IndexReader. - -

      Note that you cannot create more than one IndexModifier object - on the same directory at the same time. - -

      Example usage: - - - - - -

      - - - - - - -
      - -     Analyzer analyzer = new StandardAnalyzer();
      -     // create an index in /tmp/index, overwriting an existing one:
      -     IndexModifier indexModifier = new IndexModifier("/tmp/index", analyzer, true);
      -     Document doc = new Document();
      -     doc.add(new Field("id""1", Field.Store.YES, Field.Index.NOT_ANALYZED));
      -     doc.add(new Field("body""a simple test", Field.Store.YES, Field.Index.ANALYZED));
      -     indexModifier.addDocument(doc);
      -     int deleted = indexModifier.delete(new Term("id""1"));
      -     System.out.println("Deleted " + deleted + " document");
      -     indexModifier.flush();
      -     System.out.println(indexModifier.docCount() " docs in index");
      -     indexModifier.close();
      -
      -
      - - - -

      Not all methods of IndexReader and IndexWriter are offered by this - class. If you need access to additional methods, either use those classes - directly or implement your own class that extends IndexModifier. - -

      Although an instance of this class can be used from more than one - thread, you will not get the best performance. You might want to use - IndexReader and IndexWriter directly for that (but you will need to - care about synchronization yourself then). - -

      While you can freely mix calls to add() and delete() using this class, - you should batch you calls for best performance. For example, if you - want to update 20 documents, you should first delete all those documents, - then add all the new documents. - -

      - Please use instead. - -
      - - Open an index with write access. - - - the index directory - - the analyzer to use for adding new documents - - true to create the index or overwrite the existing one; - false to append to the existing index - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Open an index with write access. - - - the index directory - - the analyzer to use for adding new documents - - true to create the index or overwrite the existing one; - false to append to the existing index - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Open an index with write access. - - - the index directory - - the analyzer to use for adding new documents - - true to create the index or overwrite the existing one; - false to append to the existing index - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Initialize an IndexWriter. - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Throw an IllegalStateException if the index is closed. - IllegalStateException - - - Close the IndexReader and open an IndexWriter. - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Close the IndexWriter and open an IndexReader. - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Make sure all changes are written to disk. - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Adds a document to this index, using the provided analyzer instead of the - one specific in the constructor. If the document contains more than - terms for a given field, the remainder are - discarded. - - - - IllegalStateException if the index is closed - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Adds a document to this index. If the document contains more than - terms for a given field, the remainder are - discarded. - - - - IllegalStateException if the index is closed - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Deletes all documents containing term. - This is useful if one uses a document field to hold a unique ID string for - the document. Then to delete such a document, one merely constructs a - term with the appropriate field and the unique ID string as its text and - passes it to this method. Returns the number of documents deleted. - - the number of documents deleted - - - - IllegalStateException if the index is closed - StaleReaderException if the index has changed - since this reader was opened - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Deletes the document numbered docNum. - - - StaleReaderException if the index has changed - since this reader was opened - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IllegalStateException if the index is closed - - - Returns the number of documents currently in this - index. If the writer is currently open, this returns - , else - . But, note that - does not take deletions into - account, unlike . - - IllegalStateException if the index is closed - - - Merges all segments together into a single segment, optimizing an index - for search. - - - - IllegalStateException if the index is closed - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - If non-null, information about merges and a message when - is reached will be printed to this. -

      Example: index.setInfoStream(System.err); -

      - - - IllegalStateException if the index is closed -
      - - - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Setting to turn on usage of a compound file. When on, multiple files - for each segment are merged into a single file once the segment creation - is finished. This is done regardless of what directory is in use. - - - - IllegalStateException if the index is closed - - - - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - The maximum number of terms that will be indexed for a single field in a - document. This limits the amount of memory required for indexing, so that - collections with very large files will not crash the indexing process by - running out of memory.

      - Note that this effectively truncates large documents, excluding from the - index terms that occur further in the document. If you know your source - documents are large, be sure to set this value high enough to accommodate - the expected size. If you set it to Integer.MAX_VALUE, then the only limit - is your memory, but you should anticipate an OutOfMemoryError.

      - By default, no more than 10,000 terms will be indexed for a field. -

      - - - IllegalStateException if the index is closed -
      - - - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Determines the minimal number of documents required before the buffered - in-memory documents are merging and a new Segment is created. - Since Documents are merged in a , - large value gives faster indexing. At the same time, mergeFactor limits - the number of files open in a FSDirectory. - -

      The default value is 10. - -

      - - - IllegalStateException if the index is closed - IllegalArgumentException if maxBufferedDocs is smaller than 2 -
      - - - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Determines how often segment indices are merged by addDocument(). With - smaller values, less RAM is used while indexing, and searches on - unoptimized indices are faster, but indexing speed is slower. With larger - values, more RAM is used during indexing, and while searches on unoptimized - indices are slower, indexing is faster. Thus larger values (> 10) are best - for batch index creation, and smaller values (< 10) for indices that are - interactively maintained. -

      This must never be less than 2. The default value is 10. - -

      - - - IllegalStateException if the index is closed -
      - - - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Close this index, writing all pending changes to disk. - - - IllegalStateException if the index has been closed before already - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Used by DocumentsWriter to maintain per-thread state. - We keep a separate Posting hash and other state for each - thread and then merge postings hashes from all threads - when writing the segment. - - - - Load the First field and break. -

      - See -

      -
      - - Common util methods for dealing with s. - - - - - Gathers sub-readers from reader into a List. - - - - - - - - - Returns sub IndexReader that contains the given document id. - - - id of document - - parent reader - - sub reader of parent which contains the specified doc id - - - - Returns sub-reader subIndex from reader. - - - parent reader - - index of desired sub reader - - the subreader at subINdex - - - - Returns index of the searcher/reader for document n in the - array used to construct this searcher/reader. - - - - Estimates the size of a given Object using a given MemoryModel for primitive - size information. - - Resource Usage: - - Internally uses a Map to temporally hold a reference to every - object seen. - - If checkIntered, all Strings checked will be interned, but those - that were not already interned will be released for GC when the - estimate is complete. - - - - Constructs this object with an AverageGuessMemoryModel and - checkInterned = true. - - - - check if Strings are interned and don't add to size - if they are. Defaults to true but if you know the objects you are checking - won't likely contain many interned Strings, it will be faster to turn off - intern checking. - - - - MemoryModel to use for primitive object sizes. - - - - MemoryModel to use for primitive object sizes. - - check if Strings are interned and don't add to size - if they are. Defaults to true but if you know the objects you are checking - won't likely contain many interned Strings, it will be faster to turn off - intern checking. - - - - Return good default units based on byte size. - - - Subclass of FilteredTermEnum for enumerating all terms that match the - specified wildcard filter term. -

      - Term enumerations are always ordered by Term.compareTo(). Each term in - the enumeration is greater than all that precede it. - -

      - $Id: WildcardTermEnum.java 783371 2009-06-10 14:39:56Z mikemccand $ - -
      - - ***************************************** - String equality with support for wildcards - ****************************************** - - - - Creates a new WildcardTermEnum. -

      - After calling the constructor the enumeration is already pointing to the first - valid term if such a term exists. -

      -
      - - Determines if a word matches a wildcard pattern. - Work released by Granta Design Ltd after originally being done on - company time. - - - - Subclass of FilteredTermEnum for enumerating all terms that match the - specified range parameters. -

      - Term enumerations are always ordered by Term.compareTo(). Each term in - the enumeration is greater than all that precede it. -

      - 2.9 - -
      - - Enumerates all terms greater/equal than lowerTerm - but less/equal than upperTerm. - - If an endpoint is null, it is said to be "open". Either or both - endpoints may be open. Open endpoints may not be exclusive - (you can't select all but the first or last term without - explicitly specifying the term to exclude.) - - - - - An interned field that holds both lower and upper terms. - - The term text at the lower end of the range - - The term text at the upper end of the range - - If true, the lowerTerm is included in the range. - - If true, the upperTerm is included in the range. - - The collator to use to collate index Terms, to determine their - membership in the range bounded by lowerTerm and - upperTerm. - - - IOException - - - A Filter that restricts search results to a range of values in a given - field. - -

      This filter matches the documents looking for terms that fall into the - supplied range according to . It is not intended - for numerical ranges, use instead. - -

      If you construct a large number of range filters with different ranges but on the - same field, may have significantly better performance. -

      - 2.9 - -
      - - The field this range applies to - - The lower bound on this range - - The upper bound on this range - - Does this range include the lower bound? - - Does this range include the upper bound? - - IllegalArgumentException if both terms are null or if - lowerTerm is null and includeLower is true (similar for upperTerm - and includeUpper) - - - - WARNING: Using this constructor and supplying a non-null - value in the collator parameter will cause every single - index Term in the Field referenced by lowerTerm and/or upperTerm to be - examined. Depending on the number of index Terms in this Field, the - operation could be very slow. - - - - The lower bound on this range - - The upper bound on this range - - Does this range include the lower bound? - - Does this range include the upper bound? - - The collator to use when determining range inclusion; set - to null to use Unicode code point ordering instead of collation. - - IllegalArgumentException if both terms are null or if - lowerTerm is null and includeLower is true (similar for upperTerm - and includeUpper) - - - - Constructs a filter for field fieldName matching - less than or equal to upperTerm. - - - - Constructs a filter for field fieldName matching - greater than or equal to lowerTerm. - - - - Returns the field name for this filter - - - Returns the lower value of this range filter - - - Returns the upper value of this range filter - - - Returns true if the lower endpoint is inclusive - - - Returns true if the upper endpoint is inclusive - - - Returns the collator used to determine range inclusion, if any. - - - Matches the union of its clauses. - - - Construct a SpanOrQuery merging the provided clauses. - - - Return the clauses whose spans are matched. - - - Returns a collection of all terms matched by this query. - use extractTerms instead - - - - - -

      Wrapper to allow objects participate in composite - single-field SpanQueries by 'lying' about their search field. That is, - the masked SpanQuery will function as normal, - but simply hands back the value supplied - in this class's constructor.

      - -

      This can be used to support Queries like or - across different fields, which is not ordinarily - permitted.

      - -

      This can be useful for denormalized relational data: for example, when - indexing a document with conceptually many 'children':

      - -

      -            teacherid: 1
      -            studentfirstname: james
      -            studentsurname: jones
      -            
      -            teacherid: 2
      -            studenfirstname: james
      -            studentsurname: smith
      -            studentfirstname: sally
      -            studentsurname: jones
      -            
      - -

      a SpanNearQuery with a slop of 0 can be applied across two - objects as follows: - - SpanQuery q1 = new SpanTermQuery(new Term("studentfirstname", "james")); - SpanQuery q2 = new SpanTermQuery(new Term("studentsurname", "jones")); - SpanQuery q2m new FieldMaskingSpanQuery(q2, "studentfirstname"); - Query q = new SpanNearQuery(new SpanQuery[]{q1, q2m}, -1, false); - - to search for 'studentfirstname:james studentsurname:jones' and find - teacherid 1 without matching teacherid 2 (which has a 'james' in position 0 - and 'jones' in position 1).

      - -

      Note: as returns the masked field, scoring will be - done using the norms of the field name supplied. This may lead to unexpected - scoring behaviour.

      -

      -
      - - use instead. - - - - A Filter that restricts search results to a range of values in a given - field. - -

      This filter matches the documents looking for terms that fall into the - supplied range according to . It is not intended - for numerical ranges, use instead. - -

      If you construct a large number of range filters with different ranges but on the - same field, may have significantly better performance. - -

      - Use for term ranges or - for numeric ranges instead. - This class will be removed in Lucene 3.0. - -
      - - The field this range applies to - - The lower bound on this range - - The upper bound on this range - - Does this range include the lower bound? - - Does this range include the upper bound? - - IllegalArgumentException if both terms are null or if - lowerTerm is null and includeLower is true (similar for upperTerm - and includeUpper) - - - - WARNING: Using this constructor and supplying a non-null - value in the collator parameter will cause every single - index Term in the Field referenced by lowerTerm and/or upperTerm to be - examined. Depending on the number of index Terms in this Field, the - operation could be very slow. - - - - The lower bound on this range - - The upper bound on this range - - Does this range include the lower bound? - - Does this range include the upper bound? - - The collator to use when determining range inclusion; set - to null to use Unicode code point ordering instead of collation. - - IllegalArgumentException if both terms are null or if - lowerTerm is null and includeLower is true (similar for upperTerm - and includeUpper) - - - - Constructs a filter for field fieldName matching - less than or equal to upperTerm. - - - - Constructs a filter for field fieldName matching - greater than or equal to lowerTerm. - - - - A ranked list of documents, used to hold search results. -

      - Caution: Iterate only over the hits needed. Iterating over all hits is - generally not desirable and may be the source of performance issues. If you - need to iterate over many or all hits, consider using the search method that - takes a . -

      -

      - Note: Deleting matching documents concurrently with traversing the - hits, might, when deleting hits that were not yet retrieved, decrease - . In such case, an exceptionw is thrown when accessing hit n - > current_ (but n < - _at_start). - -

      - see , - and - :
      - - - TopDocs topDocs = searcher.Search(query, numHits); - ScoreDoc[] hits = topDocs.scoreDocs; - for (int i = 0; i < hits.Length; i++) { - int docId = hits[i].doc; - Document d = searcher.Doc(docId); - // do something with current hit - ... - -
      -
      - - Tries to add new documents to hitDocs. - Ensures that the hit numbered min has been retrieved. - - - - Returns the total number of hits available in this set. - - - Returns the stored fields of the nth document in this set. -

      Documents are cached, so that repeated requests for the same element may - return the same Document object. -

      - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
      - - Returns the score for the nth document in this set. - - - Returns the id for the nth document in this set. - Note that ids may change when the index changes, so you cannot - rely on the id to be stable. - - - - Returns a to navigate the Hits. Each item returned - from is a . -

      - Caution: Iterate only over the hits needed. Iterating over all - hits is generally not desirable and may be the source of - performance issues. If you need to iterate over many or all hits, consider - using a search method that takes a . -

      -

      -
      - - Implements the fuzzy search query. The similarity measurement - is based on the Levenshtein (edit distance) algorithm. - - Warning: this query is not very scalable with its default prefix - length of 0 - in this case, *every* term will be enumerated and - cause an edit score calculation. - - - - - Create a new FuzzyQuery that will match terms with a similarity - of at least minimumSimilarity to term. - If a prefixLength > 0 is specified, a common prefix - of that length is also required. - - - the term to search for - - a value between 0 and 1 to set the required similarity - between the query term and the matching terms. For example, for a - minimumSimilarity of 0.5 a term of the same length - as the query term is considered similar to the query term if the edit distance - between both terms is less than length(term)*0.5 - - length of common (non-fuzzy) prefix - - IllegalArgumentException if minimumSimilarity is >= 1 or < 0 - or if prefixLength < 0 - - - - Calls FuzzyQuery(term, minimumSimilarity, 0). - - - Calls FuzzyQuery(term, 0.5f, 0). - - - Returns the minimum similarity that is required for this query to match. - float value between 0.0 and 1.0 - - - - Returns the non-fuzzy prefix length. This is the number of characters at the start - of a term that must be identical (not fuzzy) to the query term if the query - is to match that term. - - - - Returns the pattern term. - - - A query that generates the union of documents produced by its subqueries, and that scores each document with the maximum - score for that document as produced by any subquery, plus a tie breaking increment for any additional matching subqueries. - This is useful when searching for a word in multiple fields with different boost factors (so that the fields cannot be - combined equivalently into a single search field). We want the primary score to be the one associated with the highest boost, - not the sum of the field scores (as BooleanQuery would give). - If the query is "albino elephant" this ensures that "albino" matching one field and "elephant" matching - another gets a higher score than "albino" matching both fields. - To get this result, use both BooleanQuery and DisjunctionMaxQuery: for each term a DisjunctionMaxQuery searches for it in - each field, while the set of these DisjunctionMaxQuery's is combined into a BooleanQuery. - The tie breaker capability allows results that include the same term in multiple fields to be judged better than results that - include this term in only the best of those multiple fields, without confusing this with the better case of two different terms - in the multiple fields. - - - - Creates a new empty DisjunctionMaxQuery. Use add() to add the subqueries. - the score of each non-maximum disjunct for a document is multiplied by this weight - and added into the final score. If non-zero, the value should be small, on the order of 0.1, which says that - 10 occurrences of word in a lower-scored field that is also in a higher scored field is just as good as a unique - word in the lower scored field (i.e., one that is not in any higher scored field. - - - - Creates a new DisjunctionMaxQuery - a Collection<Query> of all the disjuncts to add - - the weight to give to each matching non-maximum disjunct - - - - Add a subquery to this disjunction - the disjunct added - - - - Add a collection of disjuncts to this disjunction - via Iterable - - - - An Iterator<Query> over the disjuncts - - - Optimize our representation and our subqueries representations - the IndexReader we query - - an optimized copy of us (which may not be a copy if there is nothing to optimize) - - - - Create a shallow copy of us -- used in rewriting if necessary - a copy of us (but reuse, don't copy, our subqueries) - - - - Prettyprint us. - the field to which we are applied - - a string that shows what we do, of the form "(disjunct1 | disjunct2 | ... | disjunctn)^boost" - - - - Return true iff we represent the same query as o - another object - - true iff o is a DisjunctionMaxQuery with the same boost and the same subqueries, in the same order, as us - - - - Compute a hash code for hashing us - the hash code - - - - Expert: the Weight for DisjunctionMaxQuery, used to - normalize, score and explain these queries. - -

      NOTE: this API and implementation is subject to - change suddenly in the next release.

      -

      -
      - - The Similarity implementation. - - - The Weights for our subqueries, in 1-1 correspondence with disjuncts - - - A QueryParser which constructs queries to search multiple fields. - - - $Revision: 829134 $ - - - - Creates a MultiFieldQueryParser. Allows passing of a map with term to - Boost, and the boost to apply to each term. - -

      - It will, when parse(String query) is called, construct a query like this - (assuming the query consists of two terms and you specify the two fields - title and body): -

      - - - (title:term1 body:term1) (title:term2 body:term2) - - -

      - When setDefaultOperator(AND_OPERATOR) is set, the result will be: -

      - - - +(title:term1 body:term1) +(title:term2 body:term2) - - -

      - When you pass a boost (title=>5 body=>10) you can get -

      - - - +(title:term1^5.0 body:term1^10.0) +(title:term2^5.0 body:term2^10.0) - - -

      - In other words, all the query's terms must appear, but it doesn't matter - in what fields they appear. -

      - -

      - Please use - - instead - -
      - - Creates a MultiFieldQueryParser. Allows passing of a map with term to - Boost, and the boost to apply to each term. - -

      - It will, when parse(String query) is called, construct a query like this - (assuming the query consists of two terms and you specify the two fields - title and body): -

      - - - (title:term1 body:term1) (title:term2 body:term2) - - -

      - When setDefaultOperator(AND_OPERATOR) is set, the result will be: -

      - - - +(title:term1 body:term1) +(title:term2 body:term2) - - -

      - When you pass a boost (title=>5 body=>10) you can get -

      - - - +(title:term1^5.0 body:term1^10.0) +(title:term2^5.0 body:term2^10.0) - - -

      - In other words, all the query's terms must appear, but it doesn't matter - in what fields they appear. -

      -

      -
      - - Creates a MultiFieldQueryParser. - -

      - It will, when parse(String query) is called, construct a query like this - (assuming the query consists of two terms and you specify the two fields - title and body): -

      - - - (title:term1 body:term1) (title:term2 body:term2) - - -

      - When setDefaultOperator(AND_OPERATOR) is set, the result will be: -

      - - - +(title:term1 body:term1) +(title:term2 body:term2) - - -

      - In other words, all the query's terms must appear, but it doesn't matter - in what fields they appear. -

      - -

      - Please use - - instead - -
      - - Creates a MultiFieldQueryParser. - -

      - It will, when parse(String query) is called, construct a query like this - (assuming the query consists of two terms and you specify the two fields - title and body): -

      - - - (title:term1 body:term1) (title:term2 body:term2) - - -

      - When setDefaultOperator(AND_OPERATOR) is set, the result will be: -

      - - - +(title:term1 body:term1) +(title:term2 body:term2) - - -

      - In other words, all the query's terms must appear, but it doesn't matter - in what fields they appear. -

      -

      -
      - - Parses a query which searches on the fields specified. -

      - If x fields are specified, this effectively constructs: - - - (field1:query1) (field2:query2) (field3:query3)...(fieldx:queryx) - - -

      - Queries strings to parse - - Fields to search on - - Analyzer to use - - ParseException - if query parsing fails - - IllegalArgumentException - if the length of the queries array differs from the length of - the fields array - - Use - instead - -
      - - Parses a query which searches on the fields specified. -

      - If x fields are specified, this effectively constructs: - - - (field1:query1) (field2:query2) (field3:query3)...(fieldx:queryx) - - -

      - Lucene version to match; this is passed through to - QueryParser. - - Queries strings to parse - - Fields to search on - - Analyzer to use - - ParseException - if query parsing fails - - IllegalArgumentException - if the length of the queries array differs from the length of - the fields array - -
      - - Parses a query, searching on the fields specified. - Use this if you need to specify certain fields as required, - and others as prohibited. -

      - Usage: - - String[] fields = {"filename", "contents", "description"}; - BooleanClause.Occur[] flags = {BooleanClause.Occur.SHOULD, - BooleanClause.Occur.MUST, - BooleanClause.Occur.MUST_NOT}; - MultiFieldQueryParser.parse("query", fields, flags, analyzer); - -

      - The code above would construct a query: - - (filename:query) +(contents:query) -(description:query) - - -

      - Query string to parse - - Fields to search on - - Flags describing the fields - - Analyzer to use - - ParseException if query parsing fails - IllegalArgumentException if the length of the fields array differs - from the length of the flags array - - Use - - instead - -
      - - Parses a query, searching on the fields specified. Use this if you need - to specify certain fields as required, and others as prohibited. -

      - Uasge: - - String[] fields = {"filename", "contents", "description"}; - BooleanClause.Occur[] flags = {BooleanClause.Occur.SHOULD, - BooleanClause.Occur.MUST, - BooleanClause.Occur.MUST_NOT}; - MultiFieldQueryParser.parse("query", fields, flags, analyzer); - -

      - The code above would construct a query: - - - (filename:query) +(contents:query) -(description:query) - - -

      - Lucene version to match; this is passed through to - QueryParser. - - Query string to parse - - Fields to search on - - Flags describing the fields - - Analyzer to use - - ParseException - if query parsing fails - - IllegalArgumentException - if the length of the fields array differs from the length of - the flags array - -
      - - Parses a query, searching on the fields specified. - Use this if you need to specify certain fields as required, - and others as prohibited. -

      - Usage: - - String[] query = {"query1", "query2", "query3"}; - String[] fields = {"filename", "contents", "description"}; - BooleanClause.Occur[] flags = {BooleanClause.Occur.SHOULD, - BooleanClause.Occur.MUST, - BooleanClause.Occur.MUST_NOT}; - MultiFieldQueryParser.parse(query, fields, flags, analyzer); - -

      - The code above would construct a query: - - (filename:query1) +(contents:query2) -(description:query3) - - -

      - Queries string to parse - - Fields to search on - - Flags describing the fields - - Analyzer to use - - ParseException if query parsing fails - IllegalArgumentException if the length of the queries, fields, - and flags array differ - - Used - - instead - -
      - - Parses a query, searching on the fields specified. Use this if you need - to specify certain fields as required, and others as prohibited. -

      - Usage: - - String[] query = {"query1", "query2", "query3"}; - String[] fields = {"filename", "contents", "description"}; - BooleanClause.Occur[] flags = {BooleanClause.Occur.SHOULD, - BooleanClause.Occur.MUST, - BooleanClause.Occur.MUST_NOT}; - MultiFieldQueryParser.parse(query, fields, flags, analyzer); - -

      - The code above would construct a query: - - - (filename:query1) +(contents:query2) -(description:query3) - - -

      - Lucene version to match; this is passed through to - QueryParser. - - Queries string to parse - - Fields to search on - - Flags describing the fields - - Analyzer to use - - ParseException - if query parsing fails - - IllegalArgumentException - if the length of the queries, fields, and flags array differ - -
      - - Writes norms. Each thread X field accumulates the norms - for the doc/fields it saw, then the flush method below - merges all of these together into a single _X.nrm file. - - - - Produce _X.nrm if any document had a field with norms - not disabled - - - - Useful constants representing filenames and extensions used by lucene - - - $rcs = ' $Id: Exp $ ' ; - - - - Name of the index segment file - - - Name of the generation reference file name - - - Name of the index deletable file (only used in - pre-lockless indices) - - - - Extension of norms file - - - Extension of freq postings file - - - Extension of prox postings file - - - Extension of terms file - - - Extension of terms index file - - - Extension of stored fields index file - - - Extension of stored fields file - - - Extension of vectors fields file - - - Extension of vectors documents file - - - Extension of vectors index file - - - Extension of compound file - - - Extension of compound file for doc store files - - - Extension of deletes - - - Extension of field infos - - - Extension of plain norms - - - Extension of separate norms - - - Extension of gen file - - - This array contains all filename extensions used by - Lucene's index files, with two exceptions, namely the - extension made up from .f + a number and - from .s + a number. Also note that - Lucene's segments_N files do not have any - filename extension. - - - - File extensions that are added to a compound file - (same as above, minus "del", "gen", "cfs"). - - - - File extensions of old-style index files - - - File extensions for term vector support - - - Computes the full file name from base, extension and - generation. If the generation is -1, the file name is - null. If it's 0, the file name is - If it's > 0, the file name is - - - -- main part of the file name - - -- extension of the filename (including .) - - -- generation - - - - Returns true if the provided filename is one of the doc - store files (ends with an extension in - STORE_INDEX_EXTENSIONS). - - - - NOTE: this API is experimental and will likely change - - - Adds a new doc in this term. If this returns null - then we just skip consuming positions/payloads. - - - - Called when we are done adding docs to this term - - -

      This class provides a that enables indexing - of numeric values for efficient range filtering and - sorting. Here's an example usage, adding an int value: - - document.add(new NumericField(name).setIntValue(value)); - - - For optimal performance, re-use the - NumericField and instance for more than - one document: - - - NumericField field = new NumericField(name); - Document document = new Document(); - document.add(field); - - for(all documents) { - ... - field.setIntValue(value) - writer.addDocument(document); - ... - } - - -

      The .Net native types int, long, - float and double are - directly supported. However, any value that can be - converted into these native types can also be indexed. - For example, date/time values represented by a - can be translated into a long - value using the java.util.Date.getTime method. If you - don't need millisecond precision, you can quantize the - value, either by dividing the result of - java.util.Date.getTime or using the separate getters - (for year, month, etc.) to construct an int or - long value.

      - -

      To perform range querying or filtering against a - NumericField, use or - . To sort according to a - NumericField, use the normal numeric sort types, eg - (note that - will not work with these fields). NumericField values - can also be loaded directly from .

      - -

      By default, a NumericField's value is not stored but - is indexed for range filtering and sorting. You can use - the - constructor if you need to change these defaults.

      - -

      You may add the same field name as a NumericField to - the same document more than once. Range querying and - filtering will be the logical OR of all values; so a range query - will hit all documents that have at least one value in - the range. However sort behavior is not defined. If you need to sort, - you should separately index a single-valued NumericField.

      - -

      A NumericField will consume somewhat more disk space - in the index than an ordinary single-valued field. - However, for a typical index that includes substantial - textual content per document, this increase will likely - be in the noise.

      - -

      Within Lucene, each numeric value is indexed as a - trie structure, where each term is logically - assigned to larger and larger pre-defined brackets (which - are simply lower-precision representations of the value). - The step size between each successive bracket is called the - precisionStep, measured in bits. Smaller - precisionStep values result in larger number - of brackets, which consumes more disk space in the index - but may result in faster range search performance. The - default value, 4, was selected for a reasonable tradeoff - of disk space consumption versus performance. You can - use the expert constructor - if you'd - like to change the value. Note that you must also - specify a congruent value when creating - or . - For low cardinality fields larger precision steps are good. - If the cardinality is < 100, it is fair - to use , which produces one - term per value. - -

      For more information on the internals of numeric trie - indexing, including the precisionStep - configuration, see . The format of - indexed values is described in . - -

      If you only need to sort by numeric value, and never - run range querying/filtering, you can index using a - precisionStep of . - This will minimize disk space consumed.

      - -

      More advanced users can instead use - directly, when indexing numbers. This - class is a wrapper around this token stream type for - easier, more intuitive usage.

      - -

      NOTE: This class is only used during - indexing. When retrieving the stored field value from a - instance after search, you will get a - conventional instance where the numeric - values are returned as s (according to - toString(value) of the used data type). - -

      NOTE: This API is - experimental and might change in incompatible ways in the - next release. - -

      - 2.9 - -
      - - Creates a field for numeric values using the default precisionStep - (4). The instance is not yet initialized with - a numeric value, before indexing a document containing this field, - set a value using the various set???Value() methods. - This constructor creates an indexed, but not stored field. - - the field name - - - - Creates a field for numeric values using the default precisionStep - (4). The instance is not yet initialized with - a numeric value, before indexing a document containing this field, - set a value using the various set???Value() methods. - - the field name - - if the field should be stored in plain text form - (according to toString(value) of the used data type) - - if the field should be indexed using - - - - Creates a field for numeric values with the specified - precisionStep. The instance is not yet initialized with - a numeric value, before indexing a document containing this field, - set a value using the various set???Value() methods. - This constructor creates an indexed, but not stored field. - - the field name - - the used precision step - - - - Creates a field for numeric values with the specified - precisionStep. The instance is not yet initialized with - a numeric value, before indexing a document containing this field, - set a value using the various set???Value() methods. - - the field name - - the used precision step - - if the field should be stored in plain text form - (according to toString(value) of the used data type) - - if the field should be indexed using - - - - Returns a for indexing the numeric value. - - - Returns always null for numeric fields - - - Returns always null for numeric fields - - - Returns always null for numeric fields - - - Returns the numeric value as a string (how it is stored, when is chosen). - - - Returns the current numeric value as a subclass of , null if not yet initialized. - - - Initializes the field with the supplied long value. - the numeric value - - this instance, because of this you can use it the following way: - document.add(new NumericField(name, precisionStep).SetLongValue(value)) - - - - Initializes the field with the supplied int value. - the numeric value - - this instance, because of this you can use it the following way: - document.add(new NumericField(name, precisionStep).setIntValue(value)) - - - - Initializes the field with the supplied double value. - the numeric value - - this instance, because of this you can use it the following way: - document.add(new NumericField(name, precisionStep).setDoubleValue(value)) - - - - Initializes the field with the supplied float value. - the numeric value - - this instance, because of this you can use it the following way: - document.add(new NumericField(name, precisionStep).setFloatValue(value)) - - - - An Analyzer that uses . - - - A Token's lexical type. The Default value is "word". - - - Returns this Token's lexical type. Defaults to "word". - - - Set the lexical type. - - - - - - Stemmer, implementing the Porter Stemming Algorithm - - The Stemmer class transforms a word into its root form. The input - word can be provided a character at time (by calling add()), or at once - by calling one of the various stem(something) methods. - - - - reset() resets the stemmer so it can stem another word. If you invoke - the stemmer by calling add(char) and then stem(), you must call reset() - before starting another word. - - - - Add a character to the word being stemmed. When you are finished - adding characters, you can call stem(void) to process the word. - - - - After a word has been stemmed, it can be retrieved by toString(), - or a reference to the internal buffer can be retrieved by getResultBuffer - and getResultLength (which is generally more efficient.) - - - - Returns the length of the word resulting from the stemming process. - - - Returns a reference to a character buffer containing the results of - the stemming process. You also need to consult getResultLength() - to determine the length of the result. - - - - Stem a word provided as a String. Returns the result as a String. - - - Stem a word contained in a char[]. Returns true if the stemming process - resulted in a word different from the input. You can retrieve the - result with getResultLength()/getResultBuffer() or toString(). - - - - Stem a word contained in a portion of a char[] array. Returns - true if the stemming process resulted in a word different from - the input. You can retrieve the result with - getResultLength()/getResultBuffer() or toString(). - - - - Stem a word contained in a leading portion of a char[] array. - Returns true if the stemming process resulted in a word different - from the input. You can retrieve the result with - getResultLength()/getResultBuffer() or toString(). - - - - Stem the word placed into the Stemmer buffer through calls to add(). - Returns true if the stemming process resulted in a word different - from the input. You can retrieve the result with - getResultLength()/getResultBuffer() or toString(). - - - - Test program for demonstrating the Stemmer. It reads a file and - stems each word, writing the result to standard out. - Usage: Stemmer file-name - - - - Normalizes token text to lower case. - - - $Id: LowerCaseFilter.java 797665 2009-07-24 21:45:48Z buschmi $ - - - - A memory-resident implementation. - - - $Id: RAMOutputStream.java 691694 2008-09-03 17:34:29Z mikemccand $ - - - - Construct an empty output buffer. - - - Copy the current contents of this buffer to the named output. - - - Resets this to an empty buffer. - - - Returns byte usage of all buffers. - - - This exception is thrown when you try to list a - non-existent directory. - - - - A Query that matches documents within an exclusive range of terms. - -

      This query matches the documents looking for terms that fall into the - supplied range according to . It is not intended - for numerical ranges, use instead. - -

      This query uses the - - rewrite method. -

      - 2.9 - -
      - - Constructs a query selecting all terms greater/equal than lowerTerm - but less/equal than upperTerm. - -

      - If an endpoint is null, it is said - to be "open". Either or both endpoints may be open. Open endpoints may not - be exclusive (you can't select all but the first or last term without - explicitly specifying the term to exclude.) - -

      - The field that holds both lower and upper terms. - - The term text at the lower end of the range - - The term text at the upper end of the range - - If true, the lowerTerm is - included in the range. - - If true, the upperTerm is - included in the range. - -
      - - Constructs a query selecting all terms greater/equal than - lowerTerm but less/equal than upperTerm. -

      - If an endpoint is null, it is said - to be "open". Either or both endpoints may be open. Open endpoints may not - be exclusive (you can't select all but the first or last term without - explicitly specifying the term to exclude.) -

      - If collator is not null, it will be used to decide whether - index terms are within the given range, rather than using the Unicode code - point order in which index terms are stored. -

      - WARNING: Using this constructor and supplying a non-null - value in the collator parameter will cause every single - index Term in the Field referenced by lowerTerm and/or upperTerm to be - examined. Depending on the number of index Terms in this Field, the - operation could be very slow. - -

      - - The Term text at the lower end of the range - - The Term text at the upper end of the range - - If true, the lowerTerm is - included in the range. - - If true, the upperTerm is - included in the range. - - The collator to use to collate index Terms, to determine - their membership in the range bounded by lowerTerm and - upperTerm. - -
      - - Returns the field name for this query - - - Returns the lower value of this range query - - - Returns the upper value of this range query - - - Returns true if the lower endpoint is inclusive - - - Returns true if the upper endpoint is inclusive - - - Returns the collator used to determine range inclusion, if any. - - - Prints a user-readable version of this query. - - - Similar to , but for the unordered case. - - Expert: - Only public for subclassing. Most implementations should not need this class - - - - WARNING: The List is not necessarily in order of the the positions - Collection of byte[] payloads - - IOException - - - Wraps a Spans, and can be used to form a linked list. - - - - - - - - - Provides access to stored term vector of - a document field. The vector consists of the name of the field, an array of the terms tha occur in the field of the - and a parallel array of frequencies. Thus, getTermFrequencies()[5] corresponds with the - frequency of getTerms()[5], assuming there are at least 5 terms in the Document. - - - - The name. - The name of the field this vector is associated with. - - - - - The number of terms in the term vector. - - - - An Array of term texts in ascending order. - - - - Array of term frequencies. Locations of the array correspond one to one - to the terms in the array obtained from getTerms - method. Each location in the array contains the number of times this - term occurs in the document or the document field. - - - - Return an index in the term numbers array returned from - getTerms at which the term with the specified - term appears. If this term does not appear in the array, - return -1. - - - - Just like indexOf(int) but searches for a number of terms - at the same time. Returns an array that has the same size as the number - of terms searched for, each slot containing the result of searching for - that term number. - - - array containing terms to look for - - index in the array where the list of terms starts - - the number of terms in the list - - - - - The original list of terms from the query, can contain duplicates - - - -

      A that matches numeric values within a - specified range. To use this, you must first index the - numeric values using (expert: - ). If your terms are instead textual, - you should use . - is the filter equivalent of this - query.

      - -

      You create a new NumericRangeQuery with the static - factory methods, eg: - - - Query q = NumericRangeQuery.newFloatRange("weight", - new Float(0.3f), new Float(0.10f), - true, true); - - - matches all documents whose float valued "weight" field - ranges from 0.3 to 0.10, inclusive. - -

      The performance of NumericRangeQuery is much better - than the corresponding because the - number of terms that must be searched is usually far - fewer, thanks to trie indexing, described below.

      - -

      You can optionally specify a precisionStep - when creating this query. This is necessary if you've - changed this configuration from its default (4) during - indexing. Lower values consume more disk space but speed - up searching. Suitable values are between 1 and - 8. A good starting point to test is 4, - which is the default value for all Numeric* - classes. See below for - details. - -

      This query defaults to - for - 32 bit (int/float) ranges with precisionStep <8 and 64 - bit (long/double) ranges with precisionStep <6. - Otherwise it uses - as the - number of terms is likely to be high. With precision - steps of <4, this query can be run with one of the - BooleanQuery rewrite methods without changing - BooleanQuery's default max clause count. - -

      NOTE: This API is experimental and - might change in incompatible ways in the next release. - -

      How it works

      - -

      See the publication about panFMP, - where this algorithm was described (referred to as TrieRangeQuery): - -

      Schindler, U, Diepenbroek, M, 2008. - Generic XML-based Framework for Metadata Portals. - Computers & Geosciences 34 (12), 1947-1955. - doi:10.1016/j.cageo.2008.02.023
      - -

      A quote from this paper: Because Apache Lucene is a full-text - search engine and not a conventional database, it cannot handle numerical ranges - (e.g., field value is inside user defined bounds, even dates are numerical values). - We have developed an extension to Apache Lucene that stores - the numerical values in a special string-encoded format with variable precision - (all numerical values like doubles, longs, floats, and ints are converted to - lexicographic sortable string representations and stored with different precisions - (for a more detailed description of how the values are stored, - see ). A range is then divided recursively into multiple intervals for searching: - The center of the range is searched only with the lowest possible precision in the trie, - while the boundaries are matched more exactly. This reduces the number of terms dramatically.

      - -

      For the variant that stores long values in 8 different precisions (each reduced by 8 bits) that - uses a lowest precision of 1 byte, the index contains only a maximum of 256 distinct values in the - lowest precision. Overall, a range could consist of a theoretical maximum of - 7*255*2 + 255 = 3825 distinct terms (when there is a term for every distinct value of an - 8-byte-number in the index and the range covers almost all of them; a maximum of 255 distinct values is used - because it would always be possible to reduce the full 256 values to one term with degraded precision). - In practice, we have seen up to 300 terms in most cases (index with 500,000 metadata records - and a uniform value distribution).

      - -

      Precision Step

      -

      You can choose any precisionStep when encoding values. - Lower step values mean more precisions and so more terms in index (and index gets larger). - On the other hand, the maximum number of terms to match reduces, which optimized query speed. - The formula to calculate the maximum term count is: - - n = [ (bitsPerValue/precisionStep - 1) * (2^precisionStep - 1 ) * 2 ] + (2^precisionStep - 1 ) - -

      (this formula is only correct, when bitsPerValue/precisionStep is an integer; - in other cases, the value must be rounded up and the last summand must contain the modulo of the division as - precision step). - For longs stored using a precision step of 4, n = 15*15*2 + 15 = 465, and for a precision - step of 2, n = 31*3*2 + 3 = 189. But the faster search speed is reduced by more seeking - in the term enum of the index. Because of this, the ideal precisionStep value can only - be found out by testing. Important: You can index with a lower precision step value and test search speed - using a multiple of the original step value.

      - -

      Good values for precisionStep are depending on usage and data type: - - The default for all data types is 4, which is used, when no precisionStep is given. - Ideal value in most cases for 64 bit data types (long, double) is 6 or 8. - Ideal value in most cases for 32 bit data types (int, float) is 4. - Steps >64 for long/double and >32 for int/float produces one token - per value in the index and querying is as slow as a conventional . But it can be used - to produce fields, that are solely used for sorting (in this case simply use as - precisionStep). Using NumericFields for sorting - is ideal, because building the field cache is much faster than with text-only numbers. - Sorting is also possible with range query optimized fields using one of the above precisionSteps. - - -

      Comparisons of the different types of RangeQueries on an index with about 500,000 docs showed - that in boolean rewrite mode (with raised clause count) - took about 30-40 secs to complete, in constant score filter rewrite mode took 5 secs - and executing this class took <100ms to complete (on an Opteron64 machine, Java 1.5, 8 bit - precision step). This query type was developed for a geographic portal, where the performance for - e.g. bounding boxes or exact date/time stamps is important.

      - -

      - 2.9 - - -
      - - Factory that creates a NumericRangeQuery, that queries a long - range using the given precisionStep. - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeQuery, that queries a long - range using the default precisionStep (4). - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeQuery, that queries a int - range using the given precisionStep. - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeQuery, that queries a int - range using the default precisionStep (4). - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeQuery, that queries a double - range using the given precisionStep. - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeQuery, that queries a double - range using the default precisionStep (4). - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeQuery, that queries a float - range using the given precisionStep. - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeQuery, that queries a float - range using the default precisionStep (4). - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Returns the field name for this query - - - Returns true if the lower endpoint is inclusive - - - Returns true if the upper endpoint is inclusive - - - Returns the lower value of this range query - - - Returns the upper value of this range query - - - Subclass of FilteredTermEnum for enumerating all terms that match the - sub-ranges for trie range queries. -

      - WARNING: This term enumeration is not guaranteed to be always ordered by - . - The ordering depends on how and - generates the sub-ranges. For - ordering is not relevant. -

      -
      - - this is a dummy, it is not used by this class. - - - Compares if current upper bound is reached, - this also updates the term count for statistics. - In contrast to , a return value - of false ends iterating the current enum - and forwards to the next sub-range. - - - - Increments the enumeration to the next element. True if one exists. - - - Closes the enumeration to further activity, freeing resources. - - - This interface is obsolete, use instead. - - - Use , this will be removed in Lucene 3.0 - - - - - Use ; this will be removed in Lucene 3.0 - - - - Use , this will be removed in Lucene 3.0 - - - - Use , this will be removed in Lucene 3.0 - - - - Token Manager Error. - - - Lexical error occurred. - - - An attempt was made to create a second instance of a static token manager. - - - Tried to change to an invalid lexical state. - - - Detected (and bailed out of) an infinite loop in the token manager. - - - Indicates the reason why the exception is thrown. It will have - one of the above 4 values. - - - - Replaces unprintable characters by their escaped (or unicode escaped) - equivalents in the given string - - - - Returns a detailed message for the Error when it is thrown by the - token manager to indicate a lexical error. - Parameters : - EOFSeen : indicates if EOF caused the lexical error - curLexState : lexical state in which this error occurred - errorLine : line number when the error occurred - errorColumn : column number when the error occurred - errorAfter : prefix that was seen before this error occurred - curchar : the offending character - Note: You can customize the lexical error message by modifying this method. - - - - No arg constructor. - - - Constructor with message and reason. - - - Full Constructor. - - - You can also modify the body of this method to customize your error messages. - For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not - of end-users concern, so you can return something like : - - "Internal Error : Please file a bug report .... " - - from this method for such cases in the release version of your parser. - - - - Message Interface for a lazy loading. - For Native Language Support (NLS), system of software internationalization. - - - - Collapse the hash table & sort in-place. - - - Compares term text for two Posting instance and - returns -1 if p1 < p2; 1 if p1 > p2; else 0. - - - - Test whether the text for current RawPostingList p equals - current tokenText. - - - - Called when postings hash is too small (> 50% - occupied) or too large (< 20% occupied). - - - - An IndexReader which reads indexes with multiple segments. - - - Construct reading the named set of readers. - - - This constructor is only used for - - - Version number when this IndexReader was opened. - - - Checks is the index is optimized (if it has a single segment and no deletions) - true if the index is optimized; false otherwise - - - - Tries to acquire the WriteLock on this directory. this method is only valid if this IndexReader is directory - owner. - - - StaleReaderException if the index has changed since this reader was opened - CorruptIndexException if the index is corrupt - Lucene.Net.Store.LockObtainFailedException - if another writer has this index open (write.lock could not be - obtained) - - IOException if there is a low-level IO error - - - - - - - Commit changes resulting from delete, undeleteAll, or setNorm operations -

      - If an exception is hit, then either no changes or all changes will have been committed to the index (transactional - semantics). - -

      - IOException if there is a low-level IO error -
      - - Returns the directory this index resides in. - - - Expert: return the IndexCommit that this reader has opened. -

      -

      WARNING: this API is new and experimental and may suddenly change.

      -

      -
      - - - - - - Optimized implementation. - - - An IndexReader which reads multiple indexes, appending their content. - - - $Id: MultiReader.java 782406 2009-06-07 16:31:18Z mikemccand $ - - - -

      Construct a MultiReader aggregating the named set of (sub)readers. - Directory locking for delete, undeleteAll, and setNorm operations is - left to the subreaders.

      -

      Note that all subreaders are closed if this Multireader is closed.

      -

      - set of (sub)readers - - IOException -
      - -

      Construct a MultiReader aggregating the named set of (sub)readers. - Directory locking for delete, undeleteAll, and setNorm operations is - left to the subreaders.

      -

      - indicates whether the subreaders should be closed - when this MultiReader is closed - - set of (sub)readers - - IOException -
      - - Tries to reopen the subreaders. -
      - If one or more subreaders could be re-opened (i. e. subReader.reopen() - returned a new instance != subReader), then a new MultiReader instance - is returned, otherwise this instance is returned. -

      - A re-opened instance might share one or more subreaders with the old - instance. Index modification operations result in undefined behavior - when performed before the old instance is closed. - (see ). -

      - If subreaders are shared, then the reference count of those - readers is increased to ensure that the subreaders remain open - until the last referring reader is closed. - -

      - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
      - - Clones the subreaders. - (see ). -
      -

      - If subreaders are shared, then the reference count of those - readers is increased to ensure that the subreaders remain open - until the last referring reader is closed. -

      -
      - - If clone is true then we clone each of the subreaders - - - New IndexReader, or same one (this) if - reopen/clone is not necessary - - CorruptIndexException - IOException - - - - - - - Checks recursively if all subreaders are up to date. - - - Not implemented. - UnsupportedOperationException - - -

      Expert: a MergePolicy determines the sequence of - primitive merge operations to be used for overall merge - and optimize operations.

      - -

      Whenever the segments in an index have been altered by - , either the addition of a newly - flushed segment, addition of many segments from - addIndexes* calls, or a previous merge that may now need - to cascade, invokes - to give the MergePolicy a chance to pick - merges that are now required. This method returns a - instance describing the set of - merges that should be done, or null if no merges are - necessary. When IndexWriter.optimize is called, it calls - and the MergePolicy should - then return the necessary merges.

      - -

      Note that the policy can return more than one merge at - a time. In this case, if the writer is using - , the merges will be run - sequentially but if it is using - they will be run concurrently.

      - -

      The default MergePolicy is - .

      - -

      NOTE: This API is new and still experimental - (subject to change suddenly in the next release)

      - -

      NOTE: This class typically requires access to - package-private APIs (e.g. SegmentInfos) to do its job; - if you implement your own MergePolicy, you'll need to put - it in package Lucene.Net.Index in order to use - these APIs. -

      -
      - - Determine what set of merge operations are now necessary on the index. - calls this whenever there is a change to the segments. - This call is always synchronized on the instance so - only one thread at a time will call this method. - - - the total set of segments in the index - - - - Determine what set of merge operations is necessary in order to optimize - the index. calls this when its - method is called. This call is always - synchronized on the instance so only one thread at a - time will call this method. - - - the total set of segments in the index - - requested maximum number of segments in the index (currently this - is always 1) - - contains the specific SegmentInfo instances that must be merged - away. This may be a subset of all SegmentInfos. - - - - Determine what set of merge operations is necessary in order to expunge all - deletes from the index. - - - the total set of segments in the index - - - - Release all resources for the policy. - - - Returns true if a newly flushed (not from merge) - segment should use the compound file format. - - - - Returns true if the doc store files should use the - compound file format. - - - - OneMerge provides the information necessary to perform - an individual primitive merge operation, resulting in - a single new segment. The merge spec includes the - subset of segments to be merged as well as whether the - new segment should use the compound file format. - - - - Record that an exception occurred while executing - this merge - - - - Retrieve previous exception set by - . - - - - Mark this merge as aborted. If this is called - before the merge is committed then the merge will - not be committed. - - - - Returns true if this merge was aborted. - - - A MergeSpecification instance provides the information - necessary to perform multiple merges. It simply - contains a list of instances. - - - - The subset of segments to be included in the primitive merge. - - - Exception thrown if there are any problems while - executing a merge. - - - - - Use instead - - - - - Use instead - - - - Returns the of the index that hit - the exception. - - - -

      This class implements a that tries - to merge segments into levels of exponentially - increasing size, where each level has fewer segments than - the value of the merge factor. Whenever extra segments - (beyond the merge factor upper bound) are encountered, - all segments within the level are merged. You can get or - set the merge factor using and - respectively.

      - -

      This class is abstract and requires a subclass to - define the method which specifies how a - segment's size is determined. - is one subclass that measures size by document count in - the segment. is another - subclass that measures size as the total byte size of the - file(s) for the segment.

      -

      -
      - - Defines the allowed range of log(size) for each - level. A level is computed by taking the max segment - log size, minus LEVEL_LOG_SPAN, and finding all - segments falling within that range. - - - - Default merge factor, which is how many segments are - merged at a time - - - - Default maximum segment size. A segment of this size - - - - - Default noCFSRatio. If a merge's size is >= 10% of - the index, then we disable compound file for it. - See - - - - - - - - - If a merged segment will be more than this percentage - of the total size of the index, leave the segment as - non-compound file even if compound file is enabled. - Set to 1.0 to always use CFS regardless of merge - size. - - -

      Returns the number of segments that are merged at - once and also controls the total number of segments - allowed to accumulate in the index.

      -

      -
      - - Determines how often segment indices are merged by - addDocument(). With smaller values, less RAM is used - while indexing, and searches on unoptimized indices are - faster, but indexing speed is slower. With larger - values, more RAM is used during indexing, and while - searches on unoptimized indices are slower, indexing is - faster. Thus larger values (> 10) are best for batch - index creation, and smaller values (< 10) for indices - that are interactively maintained. - - - - Sets whether compound file format should be used for - newly flushed and newly merged segments. - - - - Returns true if newly flushed and newly merge segments - - - - - Sets whether compound file format should be used for - newly flushed and newly merged doc store - segment files (term vectors and stored fields). - - - - Returns true if newly flushed and newly merge doc - store segment files (term vectors and stored fields) - - - - - - Sets whether the segment size should be calibrated by - the number of deletes when choosing segments for merge. - - - - Returns true if the segment size should be calibrated - by the number of deletes when choosing segments for merge. - - - - Returns true if this single info is optimized (has no - pending norms or deletes, is in the same dir as the - writer, and matches the current compound file setting - - - - Returns the merges necessary to optimize the index. - This merge policy defines "optimized" to mean only one - segment in the index, where that segment has no - deletions pending nor separate norms, and it is in - compound file format if the current useCompoundFile - setting is true. This method returns multiple merges - (mergeFactor at a time) so the - in use may make use of concurrency. - - - - Finds merges necessary to expunge all deletes from the - index. We simply merge adjacent segments that have - deletes, up to mergeFactor at a time. - - - - Checks if any merges are now necessary and returns a - if so. A merge - is necessary when there are more than - segments at a given level. When - multiple levels have too many segments, this method - will return multiple merges, allowing the - to use concurrency. - - - -

      Determines the largest segment (measured by - document count) that may be merged with other segments. - Small values (e.g., less than 10,000) are best for - interactive indexing, as this limits the length of - pauses while indexing to a few seconds. Larger values - are best for batched indexing and speedier - searches.

      - -

      The default value is .

      - -

      The default merge policy () - also allows you to set this - limit by net size (in MB) of the segment, using - .

      -

      -
      - - Returns the largest segment (measured by document - count) that may be merged with other segments. - - - - - - This is a DocFieldConsumer that inverts each field, - separately, from a Document, and accepts a - InvertedTermsConsumer to process those terms. - - - - The positionIncrement determines the position of this token - relative to the previous Token in a , used in phrase - searching. - -

      The default value is one. - -

      Some common uses for this are: - - Set it to zero to put multiple terms in the same position. This is - useful if, e.g., a word has multiple stems. Searches for phrases - including either stem will match. In this case, all but the first stem's - increment should be set to zero: the increment of the first instance - should be one. Repeating a token with an increment of zero can also be - used to boost the scores of matches on that token. - - Set it to values greater than one to inhibit exact phrase matches. - If, for example, one does not want phrases to match across removed stop - words, then one could build a stop word filter that removes stop words and - also sets the increment to the number of stop words removed before each - non-stop word. Then exact phrase queries will only match when the terms - occur with no intervening stop words. - - -

      -
      - - Set the position increment. The default value is one. - - - the distance from the prior term - - - - Returns the position increment of this Token. - - - - - The start and end character offset of a Token. - - - The start and end character offset of a Token. - - - Returns this Token's starting offset, the position of the first character - corresponding to this token in the source text. - Note that the difference between endOffset() and startOffset() may not be - equal to termText.length(), as the term text may have been altered by a - stemmer or some other filter. - - - - Set the starting and ending offset. - See StartOffset() and EndOffset() - - - - Returns this Token's ending offset, one greater than the position of the - last character corresponding to this token in the source text. The length - of the token in the source text is (endOffset - startOffset). - - - - Returns this Token's starting offset, the position of the first character - corresponding to this token in the source text. - Note that the difference between endOffset() and startOffset() may not be - equal to termText.length(), as the term text may have been altered by a - stemmer or some other filter. - - - - Set the starting and ending offset. - See StartOffset() and EndOffset() - - - - Returns this Token's ending offset, one greater than the position of the - last character corresponding to this token in the source text. The length - of the token in the source text is (endOffset - startOffset). - - - - - The maximum number of items to cache. - - - - - The list to efficiently maintain the LRU state. - - - - - The dictionary to hash into any location in the list. - - - - - The node instance to use/re-use when adding an item to the cache. - - - - - Container to hold the key and value to aid in removal from - the dictionary when an item is removed from cache. - - - - Provides methods for sanity checking that entries in the FieldCache - are not wasteful or inconsistent. -

      -

      - Lucene 2.9 Introduced numerous enhancements into how the FieldCache - is used by the low levels of Lucene searching (for Sorting and - ValueSourceQueries) to improve both the speed for Sorting, as well - as reopening of IndexReaders. But these changes have shifted the - usage of FieldCache from "top level" IndexReaders (frequently a - MultiReader or DirectoryReader) down to the leaf level SegmentReaders. - As a result, existing applications that directly access the FieldCache - may find RAM usage increase significantly when upgrading to 2.9 or - Later. This class provides an API for these applications (or their - Unit tests) to check at run time if the FieldCache contains "insane" - usages of the FieldCache. -

      -

      - EXPERIMENTAL API: This API is considered extremely advanced and - experimental. It may be removed or altered w/o warning in future releases - of Lucene. -

      -

      - - - - - - -
      - - If set, will be used to estimate size for all CacheEntry objects - dealt with. - - - - Quick and dirty convenience method - - - - - Quick and dirty convenience method that instantiates an instance with - "good defaults" and uses it to test the CacheEntry[] - - - - - - Tests a CacheEntry[] for indication of "insane" cache usage. -

      - NOTE:FieldCache CreationPlaceholder objects are ignored. - (:TODO: is this a bad idea? are we masking a real problem?) -

      -

      -
      - - Internal helper method used by check that iterates over - valMismatchKeys and generates a Collection of Insanity - instances accordingly. The MapOfSets are used to populate - the Insantiy objects. - - - - - - Internal helper method used by check that iterates over - the keys of readerFieldToValIds and generates a Collection - of Insanity instances whenever two (or more) ReaderField instances are - found that have an ancestery relationships. - - - - - - - Checks if the seed is an IndexReader, and if so will walk - the hierarchy of subReaders building up a list of the objects - returned by obj.getFieldCacheKey() - - - - Simple pair object for using "readerKey + fieldName" a Map key - - - Simple container for a collection of related CacheEntry objects that - in conjunction with eachother represent some "insane" usage of the - FieldCache. - - - - Type of insane behavior this object represents - - - Description of hte insane behavior - - - CacheEntry objects which suggest a problem - - - Multi-Line representation of this Insanity object, starting with - the Type and Msg, followed by each CacheEntry.toString() on it's - own line prefaced by a tab character - - - - An Enumaration of the differnet types of "insane" behavior that - may be detected in a FieldCache. - - - - - - - - - - - Indicates an overlap in cache usage on a given field - in sub/super readers. - - - -

      - Indicates entries have the same reader+fieldname but - different cached values. This can happen if different datatypes, - or parsers are used -- and while it's not necessarily a bug - it's typically an indication of a possible problem. -

      -

      - PNOTE: Only the reader, fieldname, and cached value are actually - tested -- if two cache entries have different parsers or datatypes but - the cached values are the same Object (== not just equal()) this method - does not consider that a red flag. This allows for subtle variations - in the way a Parser is specified (null vs DEFAULT_LONG_PARSER, etc...) -

      -

      -
      - - Indicates an expected bit of "insanity". This may be useful for - clients that wish to preserve/log information about insane usage - but indicate that it was expected. - - - - Removes matches which overlap with another SpanQuery. - - - Construct a SpanNotQuery matching spans from include which - have no overlap with spans from exclude. - - - - Return the SpanQuery whose matches are filtered. - - - Return the SpanQuery whose matches must not overlap those returned. - - - Returns a collection of all terms matched by this query. - use extractTerms instead - - - - - - Returns true iff o is equal to this. - - - Constrains search results to only match those which also match a provided - query. Also provides position information about where each document matches - at the cost of extra space compared with the QueryWrapperFilter. - There is an added cost to this above what is stored in a . Namely, - the position information for each matching document is stored. -

      - This filter does not cache. See the for a wrapper that - caches. - - -

      - $Id:$ - -
      - - Constructs a filter which only matches documents matching - query. - - The to use as the basis for the Filter. - - - - A Scorer for queries with a required subscorer - and an excluding (prohibited) sub DocIdSetIterator. -
      - This Scorer implements , - and it uses the skipTo() on the given scorers. -
      -
      - - Construct a ReqExclScorer. - The scorer that must match, except where - - indicates exclusion. - - - - use instead. - - - - Advance to non excluded doc. -
      On entry: - - reqScorer != null, - exclScorer != null, - reqScorer was advanced once via next() or skipTo() - and reqScorer.doc() may still be excluded. - - Advances reqScorer a non excluded required doc, if any. -
      - true iff there is a non excluded required doc. - -
      - - use instead. - - - - Returns the score of the current document matching the query. - Initially invalid, until is called the first time. - - The score of the required scorer. - - - - use instead. - - - - A Query that matches documents containing a particular sequence of terms. - A PhraseQuery is built by QueryParser for input like "new york". - -

      This query may be combined with other terms or queries with a . -

      -
      - - Constructs an empty phrase query. - - - Sets the number of other words permitted between words in query phrase. - If zero, then this is an exact phrase search. For larger values this works - like a WITHIN or NEAR operator. -

      The slop is in fact an edit-distance, where the units correspond to - moves of terms in the query phrase out of position. For example, to switch - the order of two words requires two moves (the first move places the words - atop one another), so to permit re-orderings of phrases, the slop must be - at least two. -

      More exact matches are scored higher than sloppier matches, thus search - results are sorted by exactness. -

      The slop is zero by default, requiring exact matches. -

      -
      - - Returns the slop. See setSlop(). - - - Adds a term to the end of the query phrase. - The relative position of the term is the one immediately after the last term added. - - - - Adds a term to the end of the query phrase. - The relative position of the term within the phrase is specified explicitly. - This allows e.g. phrases with more than one term at the same position - or phrases with gaps (e.g. in connection with stopwords). - - - - - - - - - Returns the set of terms in this phrase. - - - Returns the relative positions of terms in this phrase. - - - - - - - Prints a user-readable version of this query. - - - Returns true iff o is equal to this. - - - Returns a hash code value for this object. - - - Convenience class for holding TermVector information. - - - Extends TermFreqVector to provide additional information about - positions in which each of the terms is found. A TermPositionVector not necessarily - contains both positions and offsets, but at least one of these arrays exists. - - - - Returns an array of positions in which the term is found. - Terms are identified by the index at which its number appears in the - term String array obtained from the indexOf method. - May return null if positions have not been stored. - - - - Returns an array of TermVectorOffsetInfo in which the term is found. - May return null if offsets have not been stored. - - - - - - The position in the array to get the offsets from - - An array of TermVectorOffsetInfo objects or the empty list - - - - An IndexReader which reads multiple, parallel indexes. Each index added - must have the same number of documents, but typically each contains - different fields. Each document contains the union of the fields of all - documents with the same document number. When searching, matches for a - query term are from the first index added that has the field. - -

      This is useful, e.g., with collections that have large fields which - change rarely and small fields that change more frequently. The smaller - fields may be re-indexed in a new index and both indexes may be searched - together. - -

      Warning: It is up to you to make sure all indexes - are created and modified the same way. For example, if you add - documents to one index, you need to add the same documents in the - same order to the other indexes. Failure to do so will result in - undefined behavior. -

      -
      - - Construct a ParallelReader. -

      Note that all subreaders are closed if this ParallelReader is closed.

      -

      -
      - - Construct a ParallelReader. - indicates whether the subreaders should be closed - when this ParallelReader is closed - - - - Add an IndexReader. - IOException if there is a low-level IO error - - - Add an IndexReader whose stored fields will not be returned. This can - accellerate search when stored fields are only needed from a subset of - the IndexReaders. - - - IllegalArgumentException if not all indexes contain the same number - of documents - - IllegalArgumentException if not all indexes have the same value - of - - IOException if there is a low-level IO error - - - Tries to reopen the subreaders. -
      - If one or more subreaders could be re-opened (i. e. subReader.reopen() - returned a new instance != subReader), then a new ParallelReader instance - is returned, otherwise this instance is returned. -

      - A re-opened instance might share one or more subreaders with the old - instance. Index modification operations result in undefined behavior - when performed before the old instance is closed. - (see ). -

      - If subreaders are shared, then the reference count of those - readers is increased to ensure that the subreaders remain open - until the last referring reader is closed. - -

      - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
      - - Checks recursively if all subreaders are up to date. - - - Checks recursively if all subindexes are optimized - - - Not implemented. - UnsupportedOperationException - - - - - - - - - - - - - Constructs a new runtime exception with null as its - detail message. The cause is not initialized, and may subsequently be - initialized by a call to . - - - - Constructs a new runtime exception with the specified cause and a - detail message of (cause==null ? null : cause.toString()) - (which typically contains the class and detail message of - cause). -

      - This constructor is useful for runtime exceptions - that are little more than wrappers for other throwables. - -

      - the cause (which is saved for later retrieval by the - ). (A null value is - permitted, and indicates that the cause is nonexistent or - unknown.) - - 1.4 - -
      - - Constructs a new runtime exception with the specified detail message. - The cause is not initialized, and may subsequently be initialized by a - call to . - - - the detail message. The detail message is saved for - later retrieval by the method. - - - - Constructs a new runtime exception with the specified detail message and - cause.

      Note that the detail message associated with - cause is not automatically incorporated in - this runtime exception's detail message. - -

      - the detail message (which is saved for later retrieval - by the method). - - the cause (which is saved for later retrieval by the - method). (A null value is - permitted, and indicates that the cause is nonexistent or - unknown.) - - 1.4 - -
      - - Gathers all Fieldables for a document under the same - name, updates FieldInfos, and calls per-field consumers - to process field by field. - - Currently, only a single thread visits the fields, - sequentially, for processing. - - - - If there are fields we've seen but did not see again - in the last run, then free them up. - - - - A Token's lexical type. The Default value is "word". - - - Returns this Token's lexical type. Defaults to "word". - - - Set the lexical type. - - - - - The payload of a Token. See also . - - - The payload of a Token. See also . - - - Returns this Token's payload. - - - Sets this Token's payload. - - - Initialize this attribute with no payload. - - - Initialize this attribute with the given payload. - - - Returns this Token's payload. - - - Sets this Token's payload. - - -

      Implements using - .

      - -

      NOTE: the javadocs - for File.createNewFile contain a vague - yet spooky warning about not using the API for file - locking. This warning was added due to this - bug, and in fact the only known problem with using - this API for locking is that the Lucene write lock may - not be released when the JVM exits abnormally.

      -

      When this happens, a - is hit when trying to create a writer, in which case you - need to explicitly clear the lock file first. You can - either manually remove the file, or use the - - API. But, first be certain that no writer is in fact - writing to the index otherwise you can easily corrupt - your index.

      - -

      If you suspect that this or any other LockFactory is - not working properly in your environment, you can easily - test it by using , - and .

      - -

      - - -
      - - Create a SimpleFSLockFactory instance, with null (unset) - lock directory. When you pass this factory to a - subclass, the lock directory is automatically set to the - directory itsself. Be sure to create one instance for each directory - your create! - - - - Instantiate using the provided directory (as a File instance). - where lock files should be created. - - - - Instantiate using the provided directory (as a File instance). - where lock files should be created. - - - - Instantiate using the provided directory name (String). - where lock files should be created. - - - - A implementation that collects the top-scoring hits, - returning them as a . This is used by to - implement -based search. Hits are sorted by score descending - and then (when the scores are tied) docID ascending. When you create an - instance of this collector you should know in advance whether documents are - going to be collected in doc Id order or not. - -

      NOTE: The values and - are not valid scores. This - collector will not properly collect hits with such - scores. -

      -
      - - Creates a new given the number of hits to - collect and whether documents are scored in order by the input - to . - -

      NOTE: The instances returned by this method - pre-allocate a full array of length - numHits, and fill the array with sentinel - objects. -

      -
      - - Expert: - Public for extension only - - - - MultiPhraseQuery is a generalized version of PhraseQuery, with an added - method . - To use this class, to search for the phrase "Microsoft app*" first use - add(Term) on the term "Microsoft", then find all terms that have "app" as - prefix using IndexReader.terms(Term), and use MultiPhraseQuery.add(Term[] - terms) to add them to the query. - - - 1.0 - - - - Sets the phrase slop for this query. - - - - - Sets the phrase slop for this query. - - - - - Add a single term at the next position in the phrase. - - - - - Add multiple terms at the next position in the phrase. Any of the terms - may match. - - - - - - - Allows to specify the relative position of terms within the phrase. - - - - - - - - - - - Returns a List<Term[]> of the terms in the multiphrase. - Do not modify the List or its contents. - - - - Returns the relative positions of terms in this phrase. - - - Prints a user-readable version of this query. - - - Returns true if o is equal to this. - - - Returns a hash code value for this object. - - - An iterator over that provides lazy fetching of each document. - returns an instance of this class. Calls to - return a instance. - - - Use and instead. Hits will be removed in Lucene 3.0. - - - - Constructed from . - - - true if current hit is less than the total number of . - - - - Unsupported operation. - - - UnsupportedOperationException - - - Returns the total number of hits. - - - Returns a instance representing the next hit in . - - - Next . - - - - Subclass of FilteredTermEnum for enumerating all terms that are similiar - to the specified filter term. - -

      Term enumerations are always ordered by Term.compareTo(). Each term in - the enumeration is greater than all that precede it. -

      -
      - - Creates a FuzzyTermEnum with an empty prefix and a minSimilarity of 0.5f. -

      - After calling the constructor the enumeration is already pointing to the first - valid term if such a term exists. - -

      - - - - - IOException - - -
      - - Creates a FuzzyTermEnum with an empty prefix. -

      - After calling the constructor the enumeration is already pointing to the first - valid term if such a term exists. - -

      - - - - - - - IOException - - -
      - - Constructor for enumeration of all terms from specified reader which share a prefix of - length prefixLength with term and which have a fuzzy similarity > - minSimilarity. -

      - After calling the constructor the enumeration is already pointing to the first - valid term if such a term exists. - -

      - Delivers terms. - - Pattern term. - - Minimum required similarity for terms from the reader. Default value is 0.5f. - - Length of required common prefix. Default value is 0. - - IOException -
      - - The termCompare method in FuzzyTermEnum uses Levenshtein distance to - calculate the distance between the given term and the comparing term. - - - - Finds and returns the smallest of three integers - - -

      Similarity returns a number that is 1.0f or less (including negative numbers) - based on how similar the Term is compared to a target term. It returns - exactly 0.0f when - - editDistance < maximumEditDistance - Otherwise it returns: - - 1 - (editDistance / length) - where length is the length of the shortest term (text or target) including a - prefix that are identical and editDistance is the Levenshtein distance for - the two words.

      - -

      Embedded within this algorithm is a fail-fast Levenshtein distance - algorithm. The fail-fast algorithm differs from the standard Levenshtein - distance algorithm in that it is aborted if it is discovered that the - mimimum distance between the words is greater than some threshold. - -

      To calculate the maximum distance threshold we use the following formula: - - (1 - minimumSimilarity) * length - where length is the shortest term including any prefix that is not part of the - similarity comparision. This formula was derived by solving for what maximum value - of distance returns false for the following statements: - - similarity = 1 - ((float)distance / (float) (prefixLength + Math.min(textlen, targetlen))); - return (similarity > minimumSimilarity); - where distance is the Levenshtein distance for the two words. -

      -

      Levenshtein distance (also known as edit distance) is a measure of similiarity - between two strings where the distance is measured as the number of character - deletions, insertions or substitutions required to transform one string to - the other string. -

      - the target word or phrase - - the similarity, 0.0 or less indicates that it matches less than the required - threshold and 1.0 indicates that the text and target are identical - -
      - - Grow the second dimension of the array, so that we can calculate the - Levenshtein difference. - - - - The max Distance is the maximum Levenshtein distance for the text - compared to some other value that results in score that is - better than the minimum similarity. - - the length of the "other value" - - the maximum levenshtein distance that we care about - - - - A query that applies a filter to the results of another query. - -

      Note: the bits are retrieved from the filter each time this - query is used in a search - use a CachingWrapperFilter to avoid - regenerating the bits every time. - -

      Created: Apr 20, 2004 8:58:29 AM - -

      - 1.4 - - $Id: FilteredQuery.java 807821 2009-08-25 21:55:49Z mikemccand $ - - - -
      - - Constructs a new query which applies a filter to the results of the original query. - Filter.getDocIdSet() will be called every time this query is used in a search. - - Query to be filtered, cannot be null. - - Filter to apply to query results, cannot be null. - - - - Returns a Weight that applies the filter to the enclosed query's Weight. - This is accomplished by overriding the Scorer returned by the Weight. - - - - Rewrites the wrapped query. - - - Prints a user-readable version of this query. - - - Returns true iff o is equal to this. - - - Returns a hash code value for this object. - - - use instead. - - - - use instead. - - - - use instead. - - - - Describes the input token stream. - - - An integer that describes the kind of this token. This numbering - system is determined by JavaCCParser, and a table of these numbers is - stored in the file ...Constants.java. - - - - The line number of the first character of this Token. - - - The column number of the first character of this Token. - - - The line number of the last character of this Token. - - - The column number of the last character of this Token. - - - The string image of the token. - - - A reference to the next regular (non-special) token from the input - stream. If this is the last token from the input stream, or if the - token manager has not read tokens beyond this one, this field is - set to null. This is true only if this token is also a regular - token. Otherwise, see below for a description of the contents of - this field. - - - - This field is used to access special tokens that occur prior to this - token, but after the immediately preceding regular (non-special) token. - If there are no such special tokens, this field is set to null. - When there are more than one such special token, this field refers - to the last of these special tokens, which in turn refers to the next - previous special token through its specialToken field, and so on - until the first special token (whose specialToken field is null). - The next fields of special tokens refer to other special tokens that - immediately follow it (without an intervening regular token). If there - is no such token, this field is null. - - - - An optional attribute value of the Token. - Tokens which are not used as syntactic sugar will often contain - meaningful values that will be used later on by the compiler or - interpreter. This attribute value is often different from the image. - Any subclass of Token that actually wants to return a non-null value can - override this method as appropriate. - - - - No-argument constructor - - - Constructs a new token for the specified Image. - - - Constructs a new token for the specified Image and Kind. - - - Returns the image. - - - Returns a new Token object, by default. However, if you want, you - can create and return subclass objects based on the value of ofKind. - Simply add the cases to the switch for all those special cases. - For example, if you have a subclass of Token called IDToken that - you want to create if ofKind is ID, simply add something like : - - case MyParserConstants.ID : return new IDToken(ofKind, image); - - to the following switch statement. Then you can cast matchedToken - variable to the appropriate type and use sit in your lexical actions. - - - - An efficient implementation of JavaCC's CharStream interface.

      Note that - this does not do line-number counting, but instead keeps track of the - character position of the token in the input, as required by Lucene's - API. - -

      -
      - - Constructs from a Reader. - - - - The number of the field this vector is associated with - - - - For each Field, store position by position information. It ignores frequency information -

      - This is not thread-safe. -

      -
      - - A Map of Integer and TVPositionInfo - - - - - - - - Never ignores positions. This mapper doesn't make much sense unless there are positions - false - - - - Callback for the TermVectorReader. - - - - - - - - - - - Callback mechanism used by the TermVectorReader - The field being read - - The number of terms in the vector - - Whether offsets are available - - Whether positions are available - - - - Get the mapping between fields and terms, sorted by the comparator - - - A map between field names and a Map. The sub-Map key is the position as the integer, the value is . - - - - Container for a term at a position - - - - The position of the term - - - - Note, there may be multiple terms at the same position - A List of Strings - - - - Parallel list (to ) of TermVectorOffsetInfo objects. - There may be multiple entries since there may be multiple terms at a position - A List of TermVectorOffsetInfo objects, if offsets are store. - - - - Abstract API that consumes terms, doc, freq, prox and - payloads postings. Concrete implementations of this - actually do "something" with the postings (write it into - the index in a specific format). - - NOTE: this API is experimental and will likely change - - - - Add a new field - - - Called when we are done adding everything. - - - Add a new field - - - Called when we are done adding everything. - - - This class keeps track of closing the underlying directory. It is used to wrap - DirectoryReaders, that are created using a String/File parameter - in IndexReader.open() with FSDirectory.getDirectory(). - - This helper class is removed with all String/File - IndexReader.open() methods in Lucene 3.0 - - - - This member contains the ref counter, that is passed to each instance after cloning/reopening, - and is global to all DirectoryOwningReader derived from the original one. - This reuses the class - - - - Removes words that are too long or too short from the stream. - - - - $Id: LengthFilter.java 807201 2009-08-24 13:22:34Z markrmiller $ - - - - Build a filter that removes words that are too long or too - short from the text. - - - - Returns the next input Token whose term() is the right len - - - Floating point numbers smaller than 32 bits. - - - $Id$ - - - - Converts a 32 bit float to an 8 bit float. -
      Values less than zero are all mapped to zero. -
      Values are truncated (rounded down) to the nearest 8 bit value. -
      Values between zero and the smallest representable value - are rounded up. - -
      - the 32 bit float to be converted to an 8 bit float (byte) - - the number of mantissa bits to use in the byte, with the remainder to be used in the exponent - - the zero-point in the range of exponent values - - the 8 bit float representation - -
      - - Converts an 8 bit float to a 32 bit float. - - - floatToByte(b, mantissaBits=3, zeroExponent=15) -
      smallest non-zero value = 5.820766E-10 -
      largest value = 7.5161928E9 -
      epsilon = 0.125 -
      -
      - - byteToFloat(b, mantissaBits=3, zeroExponent=15) - - - floatToByte(b, mantissaBits=5, zeroExponent=2) -
      smallest nonzero value = 0.033203125 -
      largest value = 1984.0 -
      epsilon = 0.03125 -
      -
      - - byteToFloat(b, mantissaBits=5, zeroExponent=2) - - - An average, best guess, MemoryModel that should work okay on most systems. - - - - - A implementation that collects the top-scoring - documents, returning them as a . This is used by - to implement -based search. - -

      This may be extended, overriding the collect method to, e.g., - conditionally invoke super() in order to filter which - documents are collected. - -

      - Please use - instead, which has better performance. - - -
      - - The total number of hits the collector encountered. - - - The priority queue which holds the top-scoring documents. - - - Construct to collect a given number of hits. - the maximum number of hits to collect - - - - use TopDocCollector(hq) instead. numHits is not used by this - constructor. It will be removed in a future release. - - - - Constructor to collect the top-scoring documents by using the given PQ. - the PQ to use by this instance. - - - - The total number of documents that matched this query. - - - The top-scoring hits. - - - Implements search over a set of Searchables. - -

      Applications usually need only call the inherited - or methods. -

      -
      - - Creates a searcher which searches searchers. - - - Return the array of s this searches. - - - - .NET - - - - Returns index of the searcher for document n in the array - used to construct this searcher. - - - - Returns the document number of document n within its - sub-index. - - - - Create weight in multiple index scenario. - - Distributed query processing is done in the following steps: - 1. rewrite query - 2. extract necessary terms - 3. collect dfs for these terms from the Searchables - 4. create query weight using aggregate dfs. - 5. distribute that weight to Searchables - 6. merge results - - Steps 1-4 are done here, 5+6 in the search() methods - - - rewritten queries - - - - Document Frequency cache acting as a Dummy-Searcher. This class is no - full-fledged Searcher, but only supports the methods necessary to - initialize Weights. - - - - - .NET - - - - Expert: Default scoring implementation. - - - Implemented as - state.getBoost()*lengthNorm(numTerms), where - numTerms is if - is false, else it's - - - . - -

      WARNING: This API is new and experimental, and may suddenly - change.

      -

      -
      - - Implemented as 1/sqrt(numTerms). - - - Implemented as 1/sqrt(sumOfSquaredWeights). - - - Implemented as sqrt(freq). - - - Implemented as 1 / (distance + 1). - - - Implemented as log(numDocs/(docFreq+1)) + 1. - - - Implemented as overlap / maxOverlap. - - - Determines whether overlap tokens (Tokens with - 0 position increment) are ignored when computing - norm. By default this is false, meaning overlap - tokens are counted just like non-overlap tokens. - -

      WARNING: This API is new and experimental, and may suddenly - change.

      - -

      - - -
      - - - - - - Expert: Describes the score computation for document and query, and - can distinguish a match independent of a positive value. - - - - The match status of this explanation node. - May be null if match status is unknown - - - - Sets the match status assigned to this explanation node. - May be null if match status is unknown - - - - Indicates whether or not this Explanation models a good match. - -

      - If the match status is explicitly set (i.e.: not null) this method - uses it; otherwise it defers to the superclass. -

      -

      - - -
      - - A Query that matches documents matching boolean combinations of other - queries, e.g. s, s or other - BooleanQuerys. - - - - Return the maximum number of clauses permitted, 1024 by default. - Attempts to add more than the permitted number of clauses cause - to be thrown. - - - - - - Set the maximum number of clauses permitted per BooleanQuery. - Default value is 1024. - - - - Constructs an empty boolean query. - - - Constructs an empty boolean query. - - may be disabled in scoring, as - appropriate. For example, this score factor does not make sense for most - automatically generated queries, like and - . - - - disables in scoring. - - - - Returns true iff is disabled in - scoring for this query instance. - - - - - - Specifies a minimum number of the optional BooleanClauses - which must be satisfied. - -

      - By default no optional clauses are necessary for a match - (unless there are no required clauses). If this method is used, - then the specified number of clauses is required. -

      -

      - Use of this method is totally independent of specifying that - any specific clauses are required (or prohibited). This number will - only be compared against the number of matching optional clauses. -

      -

      - EXPERT NOTE: Using this method may force collecting docs in order, - regardless of whether setAllowDocsOutOfOrder(true) has been called. -

      - -

      - the number of optional clauses that must match - - - -
      - - Gets the minimum number of the optional BooleanClauses - which must be satisifed. - - - - Adds a clause to a boolean query. - - - TooManyClauses if the new number of clauses exceeds the maximum clause number - - - - - Adds a clause to a boolean query. - TooManyClauses if the new number of clauses exceeds the maximum clause number - - - - - Returns the set of clauses in this query. - - - Returns the list of clauses in this query. - - - Whether hit docs may be collected out of docid order. - - - this will not be needed anymore, as - is used. - - - - Expert: Indicates whether hit docs may be collected out of docid order. - -

      - Background: although the contract of the Scorer class requires that - documents be iterated in order of doc id, this was not true in early - versions of Lucene. Many pieces of functionality in the current Lucene code - base have undefined behavior if this contract is not upheld, but in some - specific simple cases may be faster. (For example: disjunction queries with - less than 32 prohibited clauses; This setting has no effect for other - queries.) -

      - -

      - Specifics: By setting this option to true, docid N might be scored for a - single segment before docid N-1. Across multiple segments, docs may be - scored out of order regardless of this setting - it only applies to scoring - a single segment. - - Being static, this setting is system wide. -

      - -

      - this is not needed anymore, as - is used. - -
      - - Whether hit docs may be collected out of docid order. - - - - - this is not needed anymore, as - is used. - - - - Use instead. - - - - Use instead. - - - - Prints a user-readable version of this query. - - - Returns true iff o is equal to this. - - - Returns a hash code value for this object. - - - Thrown when an attempt is made to add more than - clauses. This typically happens if - a PrefixQuery, FuzzyQuery, WildcardQuery, or TermRangeQuery - is expanded to many terms during search. - - - - Expert: the Weight for BooleanQuery, used to - normalize, score and explain these queries. - -

      NOTE: this API and implementation is subject to - change suddenly in the next release.

      -

      -
      - - The Similarity implementation. - - - Default implementation of Message interface. - For Native Language Support (NLS), system of software internationalization. - - - - $Id: TermVectorsReader.java 687046 2008-08-19 13:01:11Z mikemccand $ - - - - Retrieve the length (in bytes) of the tvd and tvf - entries for the next numDocs starting with - startDocID. This is used for bulk copying when - merging segments, if the field numbers are - congruent. Once this returns, the tvf & tvd streams - are seeked to the startDocID. - - - - - The number of documents in the reader - - - - Retrieve the term vector for the given document and field - The document number to retrieve the vector for - - The field within the document to retrieve - - The TermFreqVector for the document and field or null if there is no termVector for this field. - - IOException if there is an error reading the term vector files - - - Return all term vectors stored for this document or null if the could not be read in. - - - The document number to retrieve the vector for - - All term frequency vectors - - IOException if there is an error reading the term vector files - - - - The field to read in - - The pointer within the tvf file where we should start reading - - The mapper used to map the TermVector - - IOException - - - Models the existing parallel array structure - - - Construct the vector - The based on the mappings. - - - - Compares s first by frequency and then by - the term (case-sensitive) - - - - - - This stores a monotonically increasing set of <Term, TermInfo> pairs in a - Directory. A TermInfos can be written once, in order. - - - - The file format version, a negative number. - - - Expert: The fraction of terms in the "dictionary" which should be stored - in RAM. Smaller values use more memory, but make searching slightly - faster, while larger values use less memory and make searching slightly - slower. Searching is typically not dominated by dictionary lookup, so - tweaking this is rarely useful. - - - - Expert: The fraction of entries stored in skip tables, - used to accellerate . Larger values result in - smaller indexes, greater acceleration, but fewer accelerable cases, while - smaller values result in bigger indexes, less acceleration and more - accelerable cases. More detailed experiments would be useful here. - - - - Expert: The maximum number of skip levels. Smaller values result in - slightly smaller indexes, but slower skipping in big posting lists. - - - - Adds a new <fieldNumber, termBytes>, TermInfo> pair to the set. - Term must be lexicographically greater than all previous Terms added. - TermInfo pointers must be positive and greater than all previous. - - - - Called to complete TermInfos creation. - - - This stores a monotonically increasing set of <Term, TermInfo> pairs in a - Directory. Pairs are accessed either by Term or by ordinal position the - set. - - - - Returns the number of term/value pairs in the set. - - - Returns the offset of the greatest index entry which is less than or equal to term. - - - Returns the TermInfo for a Term in the set, or null. - - - Returns the TermInfo for a Term in the set, or null. - - - Returns the position of a Term in the set or -1. - - - Returns an enumeration of all the Terms and TermInfos in the set. - - - Returns an enumeration of terms starting at or after the named term. - - - Per-thread resources managed by ThreadLocal - - - This exception is thrown when an - tries to make changes to the index (via - , - or ) - but changes have already been committed to the index - since this reader was instantiated. When this happens - you must open a new reader on the current index to make - the changes. - - - - Store a sorted collection of s. Collects all term information - into a single, SortedSet. -
      - NOTE: This Mapper ignores all Field information for the Document. This means that if you are using offset/positions you will not - know what Fields they correlate with. -
      - This is not thread-safe -
      -
      - - Stand-in name for the field in . - - - - A Comparator for sorting s - - - - - The term to map - - The frequency of the term - - Offset information, may be null - - Position information, may be null - - - - The TermVectorEntrySet. A SortedSet of objects. Sort is by the comparator passed into the constructor. -
      - This set will be empty until after the mapping process takes place. - -
      - The SortedSet of . - -
      - - Increments the enumeration to the next element. True if one exists. - - - Optimized scan, without allocating new terms. - Return number of invocations to next(). - - - - Returns the current Term in the enumeration. - Initially invalid, valid after next() called for the first time. - - - - Returns the previous Term enumerated. Initially null. - - - Returns the current TermInfo in the enumeration. - Initially invalid, valid after next() called for the first time. - - - - Sets the argument to the current TermInfo in the enumeration. - Initially invalid, valid after next() called for the first time. - - - - Returns the docFreq from the current TermInfo in the enumeration. - Initially invalid, valid after next() called for the first time. - - - - Closes the enumeration to further activity, freeing resources. - - - This is a DocFieldConsumer that inverts each field, - separately, from a Document, and accepts a - InvertedTermsConsumer to process those terms. - - - - Holds all per thread, per field state. - - - Helper methods to ease implementing . - - - for printing boost only if not 1.0 - - - A memory-resident implementation. - - - $Id: RAMInputStream.java 632120 2008-02-28 21:13:59Z mikemccand $ - - - - A memory-resident implementation. Locking - implementation is by default the - but can be changed with . - - - $Id: RAMDirectory.java 781333 2009-06-03 10:38:57Z mikemccand $ - - - - Constructs an empty . - - - Creates a new RAMDirectory instance from a different - Directory implementation. This can be used to load - a disk-based index into memory. -

      - This should be used only with indices that can fit into memory. -

      - Note that the resulting RAMDirectory instance is fully - independent from the original Directory (it is a - complete copy). Any subsequent changes to the - original Directory will not be visible in the - RAMDirectory instance. - -

      - a Directory value - - if an error occurs - -
      - - Creates a new RAMDirectory instance from the . - - - a File specifying the index directory - - - - - Use instead - - - - Creates a new RAMDirectory instance from the . - - - a String specifying the full index directory path - - - - - Use instead - - - - Returns true iff the named file exists in this directory. - - - Returns the time the named file was last modified. - IOException if the file does not exist - - - Set the modified time of an existing file to now. - IOException if the file does not exist - - - Returns the length in bytes of a file in the directory. - IOException if the file does not exist - - - Return total size in bytes of all files in this - directory. This is currently quantized to - RAMOutputStream.BUFFER_SIZE. - - - - Removes an existing file in the directory. - IOException if the file does not exist - - - Renames an existing file in the directory. - FileNotFoundException if from does not exist - - - - - Creates a new, empty file in the directory with the given name. Returns a stream writing this file. - - - Returns a stream reading an existing file. - - - Closes the store to future operations, releasing associated memory. - - - - .NET - - - - A implementation that collects the top-sorting - documents, returning them as a . This is used by - to implement -based search. - -

      This may be extended, overriding the collect method to, e.g., - conditionally invoke super() in order to filter which - documents are collected. - -

      - Please use instead. - -
      - - Construct to collect a given number of hits. - the index to be searched - - the sort criteria - - the maximum number of hits to collect - - - - Matches spans near the beginning of a field. - - - Construct a SpanFirstQuery matching spans in match whose end - position is less than or equal to end. - - - - Return the SpanQuery whose matches are filtered. - - - Return the maximum end position permitted in a match. - - - Returns a collection of all terms matched by this query. - use extractTerms instead - - - - - - A Spans that is formed from the ordered subspans of a SpanNearQuery - where the subspans do not overlap and have a maximum slop between them. -

      - The formed spans only contains minimum slop matches.
      - The matching slop is computed from the distance(s) between - the non overlapping matching Spans.
      - Successive matches are always formed from the successive Spans - of the SpanNearQuery. -

      - The formed spans may contain overlaps when the slop is at least 1. - For example, when querying using - t1 t2 t3 - with slop at least 1, the fragment: - t1 t2 t1 t3 t2 t3 - matches twice: - t1 t2 .. t3 - t1 .. t2 t3 - - - Expert: - Only public for subclassing. Most implementations should not need this class -

      -
      - - The spans in the same order as the SpanNearQuery - - - Indicates that all subSpans have same doc() - - - Advances the subSpans to just after an ordered match with a minimum slop - that is smaller than the slop allowed by the SpanNearQuery. - - true iff there is such a match. - - - - Advance the subSpans to the same document - - - Check whether two Spans in the same document are ordered. - - - - - true iff spans1 starts before spans2 - or the spans start at the same position, - and spans1 ends before spans2. - - - - Like , but use the spans - starts and ends as parameters. - - - - Order the subSpans within the same document by advancing all later spans - after the previous one. - - - - The subSpans are ordered in the same doc, so there is a possible match. - Compute the slop while making the match as short as possible by advancing - all subSpans except the last one in reverse order. - - - - A Scorer for queries with a required part and an optional part. - Delays skipTo() on the optional part until a score() is needed. -
      - This Scorer implements . -
      -
      - - The scorers passed from the constructor. - These are set to null as soon as their next() or skipTo() returns false. - - - - Construct a ReqOptScorer. - The required scorer. This must match. - - The optional scorer. This is used for scoring only. - - - - use instead. - - - - use instead. - - - - use instead. - - - - Returns the score of the current document matching the query. - Initially invalid, until is called the first time. - - The score of the required scorer, eventually increased by the score - of the optional scorer when it also matches the current document. - - - - Explain the score of a document. - TODO: Also show the total score. - See BooleanScorer.explain() on how to do this. - - - - Subclass of FilteredTermEnum for enumerating all terms that match the - specified prefix filter term. -

      - Term enumerations are always ordered by Term.compareTo(). Each term in - the enumeration is greater than all that precede it. - -

      -
      - - Calculates the minimum payload seen - - - - - - Expert: obtains int field values from the - FieldCache - using getInts() and makes those values - available as other numeric types, casting as needed. - -

      - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. - -

      - for requirements - on the field. - -

      NOTE: with the switch in 2.9 to segment-based - searching, if is invoked with a - composite (multi-segment) reader, this can easily cause - double RAM usage for the values in the FieldCache. It's - best to switch your application to pass only atomic - (single segment) readers to this API. Alternatively, for - a short-term fix, you could wrap your ValueSource using - , which costs more CPU per lookup - but will not consume double the FieldCache RAM.

      - - - -

      Create a cached int field source with default string-to-int parser. -
      - - Create a cached int field source with a specific string-to-int parser. - - - Add a complete document specified by all its term vectors. If document has no - term vectors, add value for tvx. - - - - - IOException - - - Do a bulk copy of numDocs documents from reader to our - streams. This is used to expedite merging, if the - field numbers are congruent. - - - - Close all streams. - - - This class implements , which - is passed each token produced by the analyzer on each - field. It stores these tokens in a hash table, and - allocates separate byte streams per token. Consumers of - this class, eg and - , write their own byte streams - under each term. - - - - Returns an array of TermVectorOffsetInfo in which the term is found. - - - The position in the array to get the offsets from - - An array of TermVectorOffsetInfo objects or the empty list - - - - - - Returns an array of positions in which the term is found. - Terms are identified by the index at which its number appears in the - term String array obtained from the indexOf method. - - - - This is a that measures size of a - segment as the number of documents (not taking deletions - into account). - - - - - - - - Sets the minimum size for the lowest level segments. - Any segments below this size are considered to be on - the same level (even if they vary drastically in size) - and will be merged whenever there are mergeFactor of - them. This effectively truncates the "long tail" of - small segments that would otherwise be created into a - single level. If you set this too large, it could - greatly increase the merging cost during indexing (if - you flush many small segments). - - - - Get the minimum size for a segment to remain - un-merged. - - - - - - This is a that measures size of a - segment as the total byte size of the segment's files. - - - - - - - - Default maximum segment size. A segment of this size - - - - -

      Determines the largest segment (measured by total - byte size of the segment's files, in MB) that may be - merged with other segments. Small values (e.g., less - than 50 MB) are best for interactive indexing, as this - limits the length of pauses while indexing to a few - seconds. Larger values are best for batched indexing - and speedier searches.

      - -

      Note that is also - used to check whether a segment is too large for - merging (it's either or).

      -

      -
      - - Returns the largest segment (meaured by total byte - size of the segment's files, in MB) that may be merged - with other segments. - - - - - - Sets the minimum size for the lowest level segments. - Any segments below this size are considered to be on - the same level (even if they vary drastically in size) - and will be merged whenever there are mergeFactor of - them. This effectively truncates the "long tail" of - small segments that would otherwise be created into a - single level. If you set this too large, it could - greatly increase the merging cost during indexing (if - you flush many small segments). - - - - Get the minimum size for a segment to remain - un-merged. - - - - - - Consumes doc and freq, writing them using the current - index file format - - - - Adds a new doc in this term. If this returns null - then we just skip consuming positions/payloads. - - - - Called when we are done adding docs to this term - - - Bulk write a contiguous series of documents. The - lengths array is the length (in bytes) of each raw - document. The stream IndexInput is the - fieldsStream from which we should bulk-copy all - bytes. - - - - Class responsible for access to stored document fields. -

      - It uses <segment>.fdt and <segment>.fdx; files. - -

      - $Id: FieldsReader.java 801344 2009-08-05 18:05:06Z yonik $ - -
      - - Returns a cloned FieldsReader that shares open - IndexInputs with the original one. It is the caller's - job not to close the original FieldsReader until all - clones are called (eg, currently SegmentReader manages - this logic). - - - - AlreadyClosedException if this FieldsReader is closed - - - Closes the underlying streams, including any ones associated with a - lazy implementation of a Field. This means that the Fields values will not be accessible. - - - IOException - - - Returns the length in bytes of each raw document in a - contiguous range of length numDocs starting with - startDocID. Returns the IndexInput (the fieldStream), - already seeked to the starting point for startDocID. - - - - Skip the field. We still have to read some of the information about the field, but can skip past the actual content. - This will have the most payoff on large fields. - - - - A Lazy implementation of Fieldable that differs loading of fields until asked for, instead of when the Document is - loaded. - - - - The value of the field in Binary, or null. If null, the Reader value, - String value, or TokenStream value is used. Exactly one of stringValue(), - readerValue(), binaryValue(), and tokenStreamValue() must be set. - - - - The value of the field as a Reader, or null. If null, the String value, - binary value, or TokenStream value is used. Exactly one of stringValue(), - readerValue(), binaryValue(), and tokenStreamValue() must be set. - - - - The value of the field as a TokenStream, or null. If null, the Reader value, - String value, or binary value is used. Exactly one of stringValue(), - readerValue(), binaryValue(), and tokenStreamValue() must be set. - - - - The value of the field as a String, or null. If null, the Reader value, - binary value, or TokenStream value is used. Exactly one of stringValue(), - readerValue(), binaryValue(), and tokenStreamValue() must be set. - - - - Holds state for inverting all occurrences of a single - field in the document. This class doesn't do anything - itself; instead, it forwards the tokens produced by - analysis to its own consumer - (InvertedDocConsumerPerField). It also interacts with an - endConsumer (InvertedDocEndConsumerPerField). - - - - Basic tool and API to check the health of an index and - write a new segments file that removes reference to - problematic segments. - -

      As this tool checks every byte in the index, on a large - index it can take quite a long time to run. - -

      WARNING: this tool and API is new and - experimental and is subject to suddenly change in the - next release. Please make a complete backup of your - index before using this to fix your index! -

      -
      - - Default PrintStream for all CheckIndex instances. - Use per instance, - instead. - - - - Create a new CheckIndex on the directory. - - - Set infoStream where messages should go. If null, no - messages are printed - - - - Returns true if index is clean, else false. - Please instantiate a CheckIndex and then use instead - - - - Returns true if index is clean, else false. - Please instantiate a CheckIndex and then use instead - - - - Returns a instance detailing - the state of the index. - -

      As this method checks every byte in the index, on a large - index it can take quite a long time to run. - -

      WARNING: make sure - you only call this when the index is not opened by any - writer. -

      -
      - - Returns a instance detailing - the state of the index. - - - list of specific segment names to check - -

      As this method checks every byte in the specified - segments, on a large index it can take quite a long - time to run. - -

      WARNING: make sure - you only call this when the index is not opened by any - writer. - - - -

      Test field norms. -
      - - Test the term index. - - - Test stored fields for a segment. - - - Test term vectors for a segment. - - - Repairs the index using previously returned result - from . Note that this does not - remove any of the unreferenced files after it's done; - you must separately open an , which - deletes unreferenced files when it's created. - -

      WARNING: this writes a - new segments file into the index, effectively removing - all documents in broken segments from the index. - BE CAREFUL. - -

      WARNING: Make sure you only call this when the - index is not opened by any writer. -

      -
      - - Command-line interface to check and fix an index. -

      - Run it like this: - - java -ea:Lucene.Net... Lucene.Net.Index.CheckIndex pathToIndex [-fix] [-segment X] [-segment Y] - - - -fix: actually write a new segments_N file, removing any problematic segments - -segment X: only check the specified - segment(s). This can be specified multiple times, - to check more than one segment, eg -segment _2 - -segment _a. You can't use this with the -fix - option. - -

      WARNING: -fix should only be used on an emergency basis as it will cause - documents (perhaps many) to be permanently removed from the index. Always make - a backup copy of your index before running this! Do not run this tool on an index - that is actively being written to. You have been warned! -

      Run without -fix, this tool will open the index, report version information - and report any exceptions it hits and what action it would take if -fix were - specified. With -fix, this tool will remove any segments that have issues and - write a new segments_N file. This means all documents contained in the affected - segments will be removed. -

      - This tool exits with exit code 1 if the index cannot be opened or has any - corruption, else 0. -

      -
      - - Returned from detailing the health and status of the index. - -

      WARNING: this API is new and experimental and is - subject to suddenly change in the next release. - -

      -
      - - True if no problems were found with the index. - - - True if we were unable to locate and load the segments_N file. - - - True if we were unable to open the segments_N file. - - - True if we were unable to read the version number from segments_N file. - - - Name of latest segments_N file in the index. - - - Number of segments in the index. - - - String description of the version of the index. - - - Empty unless you passed specific segments list to check as optional 3rd argument. - - - - - True if the index was created with a newer version of Lucene than the CheckIndex tool. - - - List of instances, detailing status of each segment. - - - Directory index is in. - - - SegmentInfos instance containing only segments that - had no problems (this is used with the - method to repair the index. - - - - How many documents will be lost to bad segments. - - - How many bad segments were found. - - - True if we checked only specific segments () - was called with non-null - argument). - - - - Holds the userData of the last commit in the index - - - Holds the status of each segment in the index. - See . - -

      WARNING: this API is new and experimental and is - subject to suddenly change in the next release. -

      -
      - - Name of the segment. - - - Document count (does not take deletions into account). - - - True if segment is compound file format. - - - Number of files referenced by this segment. - - - Net size (MB) of the files referenced by this - segment. - - - - Doc store offset, if this segment shares the doc - store files (stored fields and term vectors) with - other segments. This is -1 if it does not share. - - - - String of the shared doc store segment, or null if - this segment does not share the doc store files. - - - - True if the shared doc store files are compound file - format. - - - - True if this segment has pending deletions. - - - Name of the current deletions file name. - - - Number of deleted documents. - - - True if we were able to open a SegmentReader on this - segment. - - - - Number of fields in this segment. - - - True if at least one of the fields in this segment - does not omitTermFreqAndPositions. - - - - - - Map<String, String> that includes certain - debugging details that IndexWriter records into - each segment it creates - - - - Status for testing of field norms (null if field norms could not be tested). - - - Status for testing of indexed terms (null if indexed terms could not be tested). - - - Status for testing of stored fields (null if stored fields could not be tested). - - - Status for testing of term vectors (null if term vectors could not be tested). - - - Status from testing field norms. - - - Number of fields successfully tested - - - Exception thrown during term index test (null on success) - - - Status from testing term index. - - - Total term count - - - Total frequency across all terms. - - - Total number of positions. - - - Exception thrown during term index test (null on success) - - - Status from testing stored fields. - - - Number of documents tested. - - - Total number of stored fields tested. - - - Exception thrown during stored fields test (null on success) - - - Status from testing stored fields. - - - Number of documents tested. - - - Total number of term vectors tested. - - - Exception thrown during term vector test (null on success) - - - This attribute can be used to pass different flags down the tokenizer chain, - eg from one TokenFilter to another one. - - - - This attribute can be used to pass different flags down the chain, - eg from one TokenFilter to another one. - - - - EXPERIMENTAL: While we think this is here to stay, we may want to change it to be a long. -

      - - Get the bitset for any bits that have been set. This is completely distinct from , although they do share similar purposes. - The flags can be used to encode information about the token for use by other s. - - -

      - The bits - -
      - - - - - - EXPERIMENTAL: While we think this is here to stay, we may want to change it to be a long. -

      - - Get the bitset for any bits that have been set. This is completely distinct from , although they do share similar purposes. - The flags can be used to encode information about the token for use by other s. - - -

      - The bits - -
      - - - - - - A Token is an occurrence of a term from the text of a field. It consists of - a term's text, the start and end offset of the term in the text of the field, - and a type string. -

      - The start and end offsets permit applications to re-associate a token with - its source text, e.g., to display highlighted query terms in a document - browser, or to show matching text fragments in a KWIC display, etc. -

      - The type is a string, assigned by a lexical analyzer - (a.k.a. tokenizer), naming the lexical or syntactic class that the token - belongs to. For example an end of sentence marker token might be implemented - with type "eos". The default token type is "word". -

      - A Token can optionally have metadata (a.k.a. Payload) in the form of a variable - length byte array. Use and - to retrieve the payloads from the index. -

      -

      -
      -

      NOTE: As of 2.9, Token implements all interfaces - that are part of core Lucene and can be found in the namespace. - Even though it is not necessary to use Token anymore, with the new TokenStream API it can - be used as convenience class that implements all s, which is especially useful - to easily switch from the old to the new TokenStream API. -

      -

      -

      NOTE: As of 2.3, Token stores the term text - internally as a malleable char[] termBuffer instead of - String termText. The indexing code and core tokenizers - have been changed to re-use a single Token instance, changing - its buffer and other fields in-place as the Token is - processed. This provides substantially better indexing - performance as it saves the GC cost of new'ing a Token and - String for every term. The APIs that accept String - termText are still available but a warning about the - associated performance cost has been added (below). The - method has been deprecated.

      -

      -

      Tokenizers and TokenFilters should try to re-use a Token instance when - possible for best performance, by implementing the - API. - Failing that, to create a new Token you should first use - one of the constructors that starts with null text. To load - the token from a char[] use . - To load from a String use or . - Alternatively you can get the Token's termBuffer by calling either , - if you know that your text is shorter than the capacity of the termBuffer - or , if there is any possibility - that you may need to grow the buffer. Fill in the characters of your term into this - buffer, with if loading from a string, - or with , and finally call to - set the length of the term text. See LUCENE-969 - for details.

      -

      Typical Token reuse patterns: - - Copying text from a string (type is reset to if not - specified):
      - - return reusableToken.reinit(string, startOffset, endOffset[, type]); - -
      - Copying some text from a string (type is reset to - if not specified):
      - - return reusableToken.reinit(string, 0, string.length(), startOffset, endOffset[, type]); - -
      - Copying text from char[] buffer (type is reset to - if not specified):
      - - return reusableToken.reinit(buffer, 0, buffer.length, startOffset, endOffset[, type]); - -
      - Copying some text from a char[] buffer (type is reset to - if not specified):
      - - return reusableToken.reinit(buffer, start, end - start, startOffset, endOffset[, type]); - -
      - Copying from one one Token to another (type is reset to - if not specified):
      - - return reusableToken.reinit(source.termBuffer(), 0, source.termLength(), source.startOffset(), source.endOffset()[, source.type()]); - -
      -
      - A few things to note: - - clear() initializes all of the fields to default values. This was changed in contrast to Lucene 2.4, but should affect no one. - Because TokenStreams can be chained, one cannot assume that the Token's current type is correct. - The startOffset and endOffset represent the start and offset in the - source text, so be careful in adjusting them. - When caching a reusable token, clone it. When injecting a cached token into a stream that can be reset, clone it again. - -

      -

      - - -
      - - We will remove this when we remove the - deprecated APIs - - - - Characters for the term text. - This will be made private. Instead, use: - , - , - , or - - - - - Length of term text in the buffer. - This will be made private. Instead, use: - , or . - - - - Start in source text. - This will be made private. Instead, use: - , or . - - - - End in source text. - This will be made private. Instead, use: - , or . - - - - The lexical type of the token. - This will be made private. Instead, use: - , or . - - - - This will be made private. Instead, use: - , or . - - - - This will be made private. Instead, use: - , or . - - - - Constructs a Token will null text. - - - Constructs a Token with null text and start & end - offsets. - - start offset in the source text - - end offset in the source text - - - - Constructs a Token with null text and start & end - offsets plus the Token type. - - start offset in the source text - - end offset in the source text - - the lexical type of this Token - - - - Constructs a Token with null text and start & end - offsets plus flags. NOTE: flags is EXPERIMENTAL. - - start offset in the source text - - end offset in the source text - - The bits to set for this token - - - - Constructs a Token with the given term text, and start - & end offsets. The type defaults to "word." - NOTE: for better indexing speed you should - instead use the char[] termBuffer methods to set the - term text. - - term text - - start offset - - end offset - - - - Constructs a Token with the given text, start and end - offsets, & type. NOTE: for better indexing - speed you should instead use the char[] termBuffer - methods to set the term text. - - term text - - start offset - - end offset - - token type - - - - Constructs a Token with the given text, start and end - offsets, & type. NOTE: for better indexing - speed you should instead use the char[] termBuffer - methods to set the term text. - - - - - - - - token type bits - - - - Constructs a Token with the given term buffer (offset - & length), start and end - offsets - - - - - - - - - - - - - - Set the position increment. This determines the position of this token - relative to the previous Token in a , used in phrase - searching. - -

      The default value is one. - -

      Some common uses for this are: - - Set it to zero to put multiple terms in the same position. This is - useful if, e.g., a word has multiple stems. Searches for phrases - including either stem will match. In this case, all but the first stem's - increment should be set to zero: the increment of the first instance - should be one. Repeating a token with an increment of zero can also be - used to boost the scores of matches on that token. - - Set it to values greater than one to inhibit exact phrase matches. - If, for example, one does not want phrases to match across removed stop - words, then one could build a stop word filter that removes stop words and - also sets the increment to the number of stop words removed before each - non-stop word. Then exact phrase queries will only match when the terms - occur with no intervening stop words. - - -

      - the distance from the prior term - - - -
      - - Returns the position increment of this Token. - - - - - Sets the Token's term text. NOTE: for better - indexing speed you should instead use the char[] - termBuffer methods to set the term text. - - use or - or - . - - - - Returns the Token's term text. - - - This method now has a performance penalty - because the text is stored internally in a char[]. If - possible, use and - directly instead. If you really need a - String, use - - - - Returns the Token's term text. - - This method has a performance penalty - because the text is stored internally in a char[]. If - possible, use and - directly instead. If you really need a - String, use this method, which is nothing more than - a convenience call to new String(token.termBuffer(), 0, token.termLength()) - - - - Copies the contents of buffer, starting at offset for - length characters, into the termBuffer array. - - the buffer to copy - - the index in the buffer of the first character to copy - - the number of characters to copy - - - - Copies the contents of buffer into the termBuffer array. - the buffer to copy - - - - Copies the contents of buffer, starting at offset and continuing - for length characters, into the termBuffer array. - - the buffer to copy - - the index in the buffer of the first character to copy - - the number of characters to copy - - - - Returns the internal termBuffer character array which - you can then directly alter. If the array is too - small for your token, use - to increase it. After - altering the buffer be sure to call - to record the number of valid - characters that were placed into the termBuffer. - - - - Grows the termBuffer to at least size newSize, preserving the - existing content. Note: If the next operation is to change - the contents of the term buffer use - , - , or - - to optimally combine the resize with the setting of the termBuffer. - - minimum size of the new termBuffer - - newly created termBuffer with length >= newSize - - - - Allocates a buffer char[] of at least newSize, without preserving the existing content. - its always used in places that set the content - - minimum size of the buffer - - - - Return number of valid characters (length of the term) - in the termBuffer array. - - - - Set number of valid characters (length of the term) in - the termBuffer array. Use this to truncate the termBuffer - or to synchronize with external manipulation of the termBuffer. - Note: to grow the size of the array, - use first. - - the truncated length - - - - Returns this Token's starting offset, the position of the first character - corresponding to this token in the source text. - Note that the difference between endOffset() and startOffset() may not be - equal to termText.length(), as the term text may have been altered by a - stemmer or some other filter. - - - - Set the starting offset. - - - - - Returns this Token's ending offset, one greater than the position of the - last character corresponding to this token in the source text. The length - of the token in the source text is (endOffset - startOffset). - - - - Set the ending offset. - - - - - Set the starting and ending offset. - See StartOffset() and EndOffset() - - - - Returns this Token's lexical type. Defaults to "word". - - - Set the lexical type. - - - - - EXPERIMENTAL: While we think this is here to stay, we may want to change it to be a long. -

      - - Get the bitset for any bits that have been set. This is completely distinct from , although they do share similar purposes. - The flags can be used to encode information about the token for use by other s. - - -

      - The bits - -
      - - - - - - Returns this Token's payload. - - - Sets this Token's payload. - - - Resets the term text, payload, flags, and positionIncrement, - startOffset, endOffset and token type to default. - - - - Makes a clone, but replaces the term buffer & - start/end offset in the process. This is more - efficient than doing a full clone (and then calling - setTermBuffer) because it saves a wasted copy of the old - termBuffer. - - - - Shorthand for calling , - , - , - , - - - this Token instance - - - - Shorthand for calling , - , - , - - on Token.DEFAULT_TYPE - - this Token instance - - - - Shorthand for calling , - , - , - - - - this Token instance - - - - Shorthand for calling , - , - , - - - - this Token instance - - - - Shorthand for calling , - , - , - - on Token.DEFAULT_TYPE - - this Token instance - - - - Shorthand for calling , - , - , - - on Token.DEFAULT_TYPE - - this Token instance - - - - Copy the prototype token's fields into this one. Note: Payloads are shared. - - - - - Copy the prototype token's fields into this one, with a different term. Note: Payloads are shared. - - - - - - - Copy the prototype token's fields into this one, with a different term. Note: Payloads are shared. - - - - - - - - - - - This analyzer is used to facilitate scenarios where different - fields require different analysis techniques. Use - to add a non-default analyzer on a field name basis. - -

      Example usage: - - - PerFieldAnalyzerWrapper aWrapper = - new PerFieldAnalyzerWrapper(new StandardAnalyzer()); - aWrapper.addAnalyzer("firstname", new KeywordAnalyzer()); - aWrapper.addAnalyzer("lastname", new KeywordAnalyzer()); - - -

      In this example, StandardAnalyzer will be used for all fields except "firstname" - and "lastname", for which KeywordAnalyzer will be used. - -

      A PerFieldAnalyzerWrapper can be used like any other analyzer, for both indexing - and query parsing. -

      -
      - - Constructs with default analyzer. - - - Any fields not specifically - defined to use a different analyzer will use the one provided here. - - - - Constructs with default analyzer and a map of analyzers to use for - specific fields. - - - Any fields not specifically - defined to use a different analyzer will use the one provided here. - - a Map (String field name to the Analyzer) to be - used for those fields - - - - Defines an analyzer to use for the specified field. - - - field name requiring a non-default analyzer - - non-default analyzer to use for field - - - - Return the positionIncrementGap from the analyzer assigned to fieldName - - - Return the offsetGap from the analyzer assigned to field - - - Simplistic that applies the mappings - contained in a to the character - stream, and correcting the resulting changes to the - offsets. - - - - Default constructor that takes a . - - - Easy-use constructor that takes a . - - - LowerCaseTokenizer performs the function of LetterTokenizer - and LowerCaseFilter together. It divides text at non-letters and converts - them to lower case. While it is functionally equivalent to the combination - of LetterTokenizer and LowerCaseFilter, there is a performance advantage - to doing the two tasks at once, hence this (redundant) implementation. -

      - Note: this does a decent job for most European languages, but does a terrible - job for some Asian languages, where words are not separated by spaces. -

      -
      - - A LetterTokenizer is a tokenizer that divides text at non-letters. That's - to say, it defines tokens as maximal strings of adjacent letters, as defined - by java.lang.Character.isLetter() predicate. - Note: this does a decent job for most European languages, but does a terrible - job for some Asian languages, where words are not separated by spaces. - - - - An abstract base class for simple, character-oriented tokenizers. - - - Returns true iff a character should be included in a token. This - tokenizer generates as tokens adjacent sequences of characters which - satisfy this predicate. Characters for which this is false are used to - define token boundaries and are not included in tokens. - - - - Called on each token character to normalize it before it is added to the - token. The default implementation does nothing. Subclasses may use this - to, e.g., lowercase tokens. - - - - Will be removed in Lucene 3.0. This method is final, as it should - not be overridden. Delegates to the backwards compatibility layer. - - - - Will be removed in Lucene 3.0. This method is final, as it should - not be overridden. Delegates to the backwards compatibility layer. - - - - Construct a new LetterTokenizer. - - - Construct a new LetterTokenizer using a given . - - - Construct a new LetterTokenizer using a given . - - - Collects only characters which satisfy - . - - - - Construct a new LowerCaseTokenizer. - - - Construct a new LowerCaseTokenizer using a given . - - - Construct a new LowerCaseTokenizer using a given . - - - Converts char to lower case - . - - - - Use by certain classes to match version compatibility - across releases of Lucene. -

      - WARNING: When changing the version parameter - that you supply to components in Lucene, do not simply - change the version at search-time, but instead also adjust - your indexing code to match, and re-index. -

      -
      - - -

      WARNING: if you use this setting, and then - upgrade to a newer release of Lucene, sizable changes - may happen. If precise back compatibility is important - then you should instead explicitly specify an actual - version. - If you use this constant then you may need to - re-index all of your documents when upgrading - Lucene, as the way text is indexed may have changed. - Additionally, you may need to re-test your entire - application to ensure it behaves as expected, as - some defaults may have changed and may break functionality - in your application. -

      -
      - - Match settings and bugs in Lucene's 2.0 release. - - - Match settings and bugs in Lucene's 2.1 release. - - - Match settings and bugs in Lucene's 2.2 release. - - - Match settings and bugs in Lucene's 2.3 release. - - - Match settings and bugs in Lucene's 2.3 release. - - - Match settings and bugs in Lucene's 2.3 release. - Use this to get the latest and greatest settings, bug - fixes, etc, for Lucene. - - - - An iterator to iterate over set bits in an OpenBitSet. - This is faster than nextSetBit() for iterating over the complete set of bits, - especially when the density of the bits set is high. - - - $Id$ - - - - ** the python code that generated bitlist - def bits2int(val): - arr=0 - for shift in range(8,0,-1): - if val & 0x80: - arr = (arr << 4) | shift - val = val << 1 - return arr - def int_table(): - tbl = [ hex(bits2int(val)).strip('L') for val in range(256) ] - return ','.join(tbl) - **** - - - - use instead. - - - - use instead. - - - - use instead. - - - - Expert: A Directory instance that switches files between - two other Directory instances. -

      Files with the specified extensions are placed in the - primary directory; others are placed in the secondary - directory. The provided Set must not change once passed - to this class, and must allow multiple threads to call - contains at once.

      - -

      NOTE: this API is new and experimental and is - subject to suddenly change in the next release. -

      -
      - - Return the primary directory - - - Return the secondary directory - - - - .NET - - - - Utility method to return a file's extension. - - - A Query that matches documents containing a term. - This may be combined with other terms with a . - - - - Constructs a query for the term t. - - - Returns the term of this query. - - - Prints a user-readable version of this query. - - - Returns true iff o is equal to this. - - - Returns a hash code value for this object. - - - Constrains search results to only match those which also match a provided - query. - -

      This could be used, for example, with a on a suitably - formatted date field to implement date filtering. One could re-use a single - QueryFilter that matches, e.g., only documents modified within the last - week. The QueryFilter and TermRangeQuery would only need to be reconstructed - once per day. - -

      - $Id:$ - -
      - - Constructs a filter which only matches documents matching - query. - - - - Use instead. - - - - Constrains search results to only match those which also match a provided - query. Results are cached, so that searches after the first on the same - index using this filter are much faster. - - - $Id: QueryFilter.java 528298 2007-04-13 00:59:28Z hossman $ - - use a CachingWrapperFilter with QueryWrapperFilter - - - - Constructs a filter which only matches documents matching - query. - - - - A Query that matches documents containing terms with a specified prefix. A PrefixQuery - is built by QueryParser for input like app*. - -

      This query uses the - - rewrite method. -

      -
      - - Constructs a query for terms starting with prefix. - - - Returns the prefix of this query. - - - Prints a user-readable version of this query. - - - Experimental class to get set of payloads for most standard Lucene queries. - Operates like Highlighter - IndexReader should only contain doc of interest, - best to use MemoryIndex. - -

      - - WARNING: The status of the Payloads feature is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. - -

      -
      - - that contains doc with payloads to extract - - - - Query should be rewritten for wild/fuzzy support. - - - - - payloads Collection - - IOException - - - Expert: obtains the ordinal of the field value from the default Lucene - Fieldcache using getStringIndex(). -

      - The native lucene index order is used to assign an ordinal value for each field value. -

      - Field values (terms) are lexicographically ordered by unicode value, and numbered starting at 1. -

      - Example: -
      If there were only three field values: "apple","banana","pear" -
      then ord("apple")=1, ord("banana")=2, ord("pear")=3 -

      - WARNING: - ord() depends on the position in an index and can thus change - when other documents are inserted or deleted, - or if a MultiSearcher is used. - -

      - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. - -

      NOTE: with the switch in 2.9 to segment-based - searching, if is invoked with a - composite (multi-segment) reader, this can easily cause - double RAM usage for the values in the FieldCache. It's - best to switch your application to pass only atomic - (single segment) readers to this API. Alternatively, for - a short-term fix, you could wrap your ValueSource using - , which costs more CPU per lookup - but will not consume double the FieldCache RAM.

      -

      -
      - - Constructor for a certain field. - field whose values order is used. - - - - Expert: Collects sorted results from Searchable's and collates them. - The elements put into this queue must be of type FieldDoc. - -

      Created: Feb 11, 2004 2:04:21 PM - -

      - lucene 1.4 - - $Id: FieldDocSortedHitQueue.java 695514 2008-09-15 15:42:11Z otis $ - -
      - - Creates a hit queue sorted by the given list of fields. - Fieldable names, in priority order (highest priority first). - - The number of hits to retain. Must be greater than zero. - - - - Allows redefinition of sort fields if they are null. - This is to handle the case using ParallelMultiSearcher where the - original list contains AUTO and we don't know the actual sort - type until the values come back. The fields can only be set once. - This method is thread safe. - - - - - - Returns the fields being used to sort. - - - Returns an array of collators, possibly null. The collators - correspond to any SortFields which were given a specific locale. - - Array of sort fields. - - Array, possibly null. - - - - Returns whether a is less relevant than b. - ScoreDoc - - ScoreDoc - - true if document a should be sorted after document b. - - - - A range query that returns a constant score equal to its boost for - all documents in the exclusive range of terms. - -

      It does not have an upper bound on the number of clauses covered in the range. - -

      This query matches the documents looking for terms that fall into the - supplied range according to . It is not intended - for numerical ranges, use instead. - -

      This query is hardwired to . - If you want to change this, use instead. - -

      - Use for term ranges or - for numeric ranges instead. - This class will be removed in Lucene 3.0. - - $Id: ConstantScoreRangeQuery.java 797694 2009-07-25 00:03:33Z mikemccand $ - -
      - - Changes of mode are not supported by this class (fixed to constant score rewrite mode) - - - This exception is thrown when parse errors are encountered. - You can explicitly create objects of this exception type by - calling the method generateParseException in the generated - parser. - - You can modify this class to customize your error reporting - mechanisms so long as you retain the public fields. - - - - This constructor is used by the method "generateParseException" - in the generated parser. Calling this constructor generates - a new object of this type with the fields "currentToken", - "expectedTokenSequences", and "tokenImage" set. The boolean - flag "specialConstructor" is also set to true to indicate that - this constructor was used to create this object. - This constructor calls its super class with the empty string - to force the "toString" method of parent class "Throwable" to - print the error message in the form: - ParseException: <result of getMessage> - - - - The following constructors are for use by you for whatever - purpose you can think of. Constructing the exception in this - manner makes the exception behave in the normal way - i.e., as - documented in the class "Throwable". The fields "errorToken", - "expectedTokenSequences", and "tokenImage" do not contain - relevant information. The JavaCC generated code does not use - these constructors. - - - - Constructor with message. - - - Constructor with message. - - - This variable determines which constructor was used to create - this object and thereby affects the semantics of the - "getMessage" method (see below). - - - - This is the last token that has been consumed successfully. If - this object has been created due to a parse error, the token - followng this token will (therefore) be the first error token. - - - - Each entry in this array is an array of integers. Each array - of integers represents a sequence of tokens (by their ordinal - values) that is expected at this point of the parse. - - - - This is a reference to the "tokenImage" array of the generated - parser within which the parse error occurred. This array is - defined in the generated ...Constants interface. - - - - The end of line string for this machine. - - - Used to convert raw characters to their escaped version - when these raw version cannot be used as part of an ASCII - string literal. - - - - This method has the standard behavior when this object has been - created using the standard constructors. Otherwise, it uses - "currentToken" and "expectedTokenSequences" to generate a parse - error message and returns it. If this object has been created - due to a parse error, and you do not catch it (it gets thrown - from the parser), then this method is called during the printing - of the final stack trace, and hence the correct error message - gets displayed. - - - - Taps into DocInverter, as an InvertedDocEndConsumer, - which is called at the end of inverting each field. We - just look at the length for the field (docState.length) - and record the norm. - - - - Used by DocumentsWriter to merge the postings from - multiple ThreadStates when creating a segment - - - - Simple utility class providing static methods to - compress and decompress binary data for stored fields. - This class uses java.util.zip.Deflater and Inflater - classes to compress and decompress, which is the same - format previously used by the now deprecated - Field.Store.COMPRESS. - - - - Compresses the specified byte range using the - specified compressionLevel (constants are defined in - java.util.zip.Deflater). - - - - Compresses the specified byte range, with default BEST_COMPRESSION level - - - Compresses all bytes in the array, with default BEST_COMPRESSION level - - - Compresses the String value, with default BEST_COMPRESSION level - - - Compresses the String value using the specified - compressionLevel (constants are defined in - java.util.zip.Deflater). - - - - Decompress the byte array previously returned by - compress - - - - Decompress the byte array previously returned by - compressString back into a String - - - - Filters with and - . - - -

      - You must specify the required compatibility when creating - StopAnalyzer: - - As of 2.9, position increments are preserved - -

      -
      - - An array containing some common English words that are not usually useful - for searching. - - Use instead - - - - An unmodifiable set containing some common English words that are not usually useful - for searching. - - - - Builds an analyzer which removes words in - ENGLISH_STOP_WORDS. - - Use instead - - - - Builds an analyzer which removes words in ENGLISH_STOP_WORDS. - - - Builds an analyzer which removes words in - ENGLISH_STOP_WORDS. - - - See - - Use instead - - - - Builds an analyzer with the stop words from the given set. - Use instead - - - - Builds an analyzer with the stop words from the given set. - - - Builds an analyzer with the stop words from the given set. - Set of stop words - - - See - - Use instead - - - - Builds an analyzer which removes words in the provided array. - Use instead - - Use instead - - - - Builds an analyzer which removes words in the provided array. - Array of stop words - - - See - - Use instead - - - - Builds an analyzer with the stop words from the given file. - - - Use instead - - - - Builds an analyzer with the stop words from the given file. - - - File to load stop words from - - - See - - Use instead - - - - Builds an analyzer with the stop words from the given file. - - - - - See above - - File to load stop words from - - - - Builds an analyzer with the stop words from the given reader. - - - Use instead - - - - Builds an analyzer with the stop words from the given reader. - - - Reader to load stop words from - - - See - - Use instead - - - - Builds an analyzer with the stop words from the given reader. - - - See above - - Reader to load stop words from - - - - Filters LowerCaseTokenizer with StopFilter. - - - Filters LowerCaseTokenizer with StopFilter. - - - Use this to disable locking entirely. - This LockFactory is used when you call . - Only one instance of this lock is created. You should call - to get the instance. - - - - - - - Simple standalone tool that forever acquires & releases a - lock using a specific LockFactory. Run without any args - to see usage. - - - - - - - - - This exception is thrown when the write.lock - could not be released. - - - - - - Score a candidate doc for all slop-valid position-combinations (matches) - encountered while traversing/hopping the PhrasePositions. -
      The score contribution of a match depends on the distance: -
      - highest score for distance=0 (exact match). -
      - score gets lower as distance gets higher. -
      Example: for query "a b"~2, a document "x a b a y" can be scored twice: - once for "a b" (distance=0), and once for "b a" (distance=2). -
      Possibly not all valid combinations are encountered, because for efficiency - we always propagate the least PhrasePosition. This allows to base on - PriorityQueue and move forward faster. - As result, for example, document "a b c b a" - would score differently for queries "a b c"~4 and "c b a"~4, although - they really are equivalent. - Similarly, for doc "a b c b a f g", query "c b"~2 - would get same score as "g f"~2, although "c b"~2 could be matched twice. - We may want to fix this in the future (currently not, for performance reasons). -
      -
      - - Init PhrasePositions in place. - There is a one time initialization for this scorer: -
      - Put in repeats[] each pp that has another pp with same position in the doc. -
      - Also mark each such pp by pp.repeats = true. -
      Later can consult with repeats[] in termPositionsDiffer(pp), making that check efficient. - In particular, this allows to score queries with no repetitions with no overhead due to this computation. -
      - Example 1 - query with no repetitions: "ho my"~2 -
      - Example 2 - query with repetitions: "ho my my"~2 -
      - Example 3 - query with repetitions: "my ho my"~2 -
      Init per doc w/repeats in query, includes propagating some repeating pp's to avoid false phrase detection. -
      - end (max position), or -1 if any term ran out (i.e. done) - - IOException -
      - - We disallow two pp's to have the same TermPosition, thereby verifying multiple occurrences - in the query of the same word would go elsewhere in the matched doc. - - null if differ (i.e. valid) otherwise return the higher offset PhrasePositions - out of the first two PPs found to not differ. - - - - Implements parallel search over a set of Searchables. - -

      Applications usually need only call the inherited - or methods. -

      -
      - - Creates a searchable which searches searchables. - - - TODO: parallelize this one too - - - A search implementation which spans a new thread for each - Searchable, waits for each search to complete and merge - the results back together. - - - - A search implementation allowing sorting which spans a new thread for each - Searchable, waits for each search to complete and merges - the results back together. - - - - Lower-level search API. - -

      is called for every matching document. - -

      Applications should only use this if they need all of the - matching documents. The high-level search API () - is usually more efficient, as it skips - non-high-scoring hits. - -

      - to match documents - - if non-null, a bitset used to eliminate some documents - - to receive hits - - TODO: parallelize this one too - -
      - - - TODO: this one could be parallelized too - - - - - A thread subclass for searching a single searchable - - - Wrapper used by to provide a lazily loaded hit - from . - - - Use and instead. Hits will be removed in Lucene 3.0. - - - - Constructed from - Hits returned from a search - - Hit index in Hits - - - - Returns document for this hit. - - - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Returns score for this hit. - - - - - - - Returns id for this hit. - - - - - - - Returns the boost factor for this hit on any field of the underlying document. - - - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Returns the string value of the field with the given name if any exist in - this document, or null. If multiple fields exist with this name, this - method returns the first value added. If only binary fields with this name - exist, returns null. - - - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Prints the parameters to be used to discover the promised result. - - - use instead. - - - - use instead. - - - - use instead. - - - - use instead. - - - - use instead. - - - - use instead. - - - - use instead. - - - - use instead. - - - - A simple hash table of document scores within a range. - - - Lucene's package information, including version. * - - - A Term represents a word from text. This is the unit of search. It is - composed of two elements, the text of the word, as a string, and the name of - the field that the text occured in, an interned string. - Note that terms may represent more than words from text fields, but also - things like dates, email addresses, urls, etc. - - - - Constructs a Term with the given field and text. -

      Note that a null field or null text value results in undefined - behavior for most Lucene APIs that accept a Term parameter. -

      -
      - - Constructs a Term with the given field and empty text. - This serves two purposes: 1) reuse of a Term with the same field. - 2) pattern for a query. - - - - - - - Returns the field of this term, an interned string. The field indicates - the part of a document which this term came from. - - - - Returns the text of this term. In the case of words, this is simply the - text of the word. In the case of dates and other types, this is an - encoding of the object as a string. - - - - Optimized construction of new Terms by reusing same field as this Term - - avoids field.intern() overhead - - The text of the new term (field is implicitly same as this Term instance) - - A new Term - - - - Compares two terms, returning a negative integer if this - term belongs before the argument, zero if this term is equal to the - argument, and a positive integer if this term belongs after the argument. - The ordering of terms is first by field, then by text. - - - - Resets the field and text of a Term. - - - Called by super.skipTo(). - - - This implementation that - keeps only the most recent commit and immediately removes - all prior commits after a new commit is done. This is - the default deletion policy. - - - - Deletes all commits except the most recent one. - - - Deletes all commits except the most recent one. - - - - This class keeps track of each SegmentInfos instance that - is still "live", either because it corresponds to a - segments_N file in the Directory (a "commit", i.e. a - committed SegmentInfos) or because it's an in-memory - SegmentInfos that a writer is actively updating but has - not yet committed. This class uses simple reference - counting to map the live SegmentInfos instances to - individual files in the Directory. - - When autoCommit=true, IndexWriter currently commits only - on completion of a merge (though this may change with - time: it is not a guarantee). When autoCommit=false, - IndexWriter only commits when it is closed. Regardless - of autoCommit, the user may call IndexWriter.commit() to - force a blocking commit. - - The same directory file may be referenced by more than - one IndexCommit, i.e. more than one SegmentInfos. - Therefore we count how many commits reference each file. - When all the commits referencing a certain file have been - deleted, the refcount for that file becomes zero, and the - file is deleted. - - A separate deletion policy interface - (IndexDeletionPolicy) is consulted on creation (onInit) - and once per commit (onCommit), to decide when a commit - should be removed. - - It is the business of the IndexDeletionPolicy to choose - when to delete commit points. The actual mechanics of - file deletion, retrying, etc, derived from the deletion - of commit points is the business of the IndexFileDeleter. - - The current default deletion policy is - , which removes all - prior commits when a new commit has completed. This - matches the behavior before 2.2. - - Note that you must hold the write.lock before - instantiating this class. It opens segments_N file(s) - directly with no retry logic. - - - - because they are open and we are running on Windows), - so we will retry them again later: //// - - - Counts how many existing commits reference a file. - Maps String to RefCount (class below) instances: //// - - - This will have just 1 commit if you are using the - default delete policy (KeepOnlyLastCommitDeletionPolicy). - Other policies may leave commit points live for longer - in which case this list would be longer than 1: //// - - - non-commit checkpoint: //// - - - Change to true to see details of reference counts when - infoStream != null - - - - Initialize the deleter: find all previous commits in - the Directory, incref the files they reference, call - the policy to let it delete commits. This will remove - any files not referenced by any of the commits. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Remove the CommitPoints in the commitsToDelete List by - DecRef'ing all files from each SegmentInfos. - - - - Writer calls this when it has hit an error and had to - roll back, to tell us that there may now be - unreferenced files in the filesystem. So we re-list - the filesystem and delete such files. If segmentName - is non-null, we will only delete files corresponding to - that segment. - - - - For definition of "check point" see IndexWriter comments: - "Clarification: Check Points (and commits)". - - Writer calls this when it has made a "consistent - change" to the index, meaning new files are written to - the index and the in-memory SegmentInfos have been - modified to point to those files. - - This may or may not be a commit (segments_N may or may - not have been written). - - We simply incref the files referenced by the new - SegmentInfos and decref the files we had previously - seen (if any). - - If this is a commit, we also call the policy to give it - a chance to remove other commits. If any commits are - removed, we decref their files as well. - - - - Deletes the specified files, but only if they are new - (have not yet been incref'd). - - - - Tracks the reference count for a single index file: - - - Holds details for each commit point. This class is - also passed to the deletion policy. Note: this class - has a natural ordering that is inconsistent with - equals. - - - - Called only be the deletion policy, to remove this - commit point from the index. - - - - Adds a new term in this field - - - Called when we are done adding terms to this field - - - For each Field, store a sorted collection of s -

      - This is not thread-safe. -

      -
      - - - A Comparator for sorting s - - - - Get the mapping between fields and terms, sorted by the comparator - - - A map between field names and s per field. SortedSet entries are - - - - Access to the Fieldable Info file that describes document fields and whether or - not they are indexed. Each segment has a separate Fieldable Info file. Objects - of this class are thread-safe for multiple readers, but only one thread can - be adding documents at a time, with no other reader or writer threads - accessing this object. - - - - Construct a FieldInfos object using the directory and the name of the file - IndexInput - - The directory to open the IndexInput from - - The name of the file to open the IndexInput from in the Directory - - IOException - - - Returns a deep clone of this FieldInfos instance. - - - Adds field info for a Document. - - - Returns true if any fields do not omitTermFreqAndPositions - - - Add fields that are indexed. Whether they have termvectors has to be specified. - - - The names of the fields - - Whether the fields store term vectors or not - - true if positions should be stored. - - true if offsets should be stored - - - - Assumes the fields are not storing term vectors. - - - The names of the fields - - Whether the fields are indexed or not - - - - - - - Calls 5 parameter add with false for all TermVector parameters. - - - The name of the Fieldable - - true if the field is indexed - - - - - - Calls 5 parameter add with false for term vector positions and offsets. - - - The name of the field - - true if the field is indexed - - true if the term vector should be stored - - - - If the field is not yet known, adds it. If it is known, checks to make - sure that the isIndexed flag is the same as was given previously for this - field. If not - marks it as being indexed. Same goes for the TermVector - parameters. - - - The name of the field - - true if the field is indexed - - true if the term vector should be stored - - true if the term vector with positions should be stored - - true if the term vector with offsets should be stored - - - - If the field is not yet known, adds it. If it is known, checks to make - sure that the isIndexed flag is the same as was given previously for this - field. If not - marks it as being indexed. Same goes for the TermVector - parameters. - - - The name of the field - - true if the field is indexed - - true if the term vector should be stored - - true if the term vector with positions should be stored - - true if the term vector with offsets should be stored - - true if the norms for the indexed field should be omitted - - - - If the field is not yet known, adds it. If it is known, checks to make - sure that the isIndexed flag is the same as was given previously for this - field. If not - marks it as being indexed. Same goes for the TermVector - parameters. - - - The name of the field - - true if the field is indexed - - true if the term vector should be stored - - true if the term vector with positions should be stored - - true if the term vector with offsets should be stored - - true if the norms for the indexed field should be omitted - - true if payloads should be stored for this field - - true if term freqs should be omitted for this field - - - - Return the fieldName identified by its number. - - - - - the fieldName or an empty string when the field - with the given number doesn't exist. - - - - Return the fieldinfo object referenced by the fieldNumber. - - - the FieldInfo object or null when the given fieldNumber - doesn't exist. - - - - Class to write byte streams into slices of shared - byte[]. This is used by DocumentsWriter to hold the - posting list for many terms in RAM. - - - - Set up the writer to write at address. - - - Write byte into byte slice stream - - - A based on a Map of field names to s - - - - - Create a a MapFieldSelector - maps from field names (String) to s - - - - Create a a MapFieldSelector - fields to LOAD. List of Strings. All other fields are NO_LOAD. - - - - Create a a MapFieldSelector - fields to LOAD. All other fields are NO_LOAD. - - - - Load field according to its associated value in fieldSelections - a field name - - the fieldSelections value that field maps to or NO_LOAD if none. - - - - A WhitespaceTokenizer is a tokenizer that divides text at whitespace. - Adjacent sequences of non-Whitespace characters form tokens. - - - - Construct a new WhitespaceTokenizer. - - - Construct a new WhitespaceTokenizer using a given . - - - Construct a new WhitespaceTokenizer using a given . - - - Collects only characters which do not satisfy - . - - - - This class wraps a Token and supplies a single attribute instance - where the delegate token can be replaced. - - Will be removed, when old TokenStream API is removed. - - - - This class is a scanner generated by - JFlex 1.4.1 - on 9/4/08 6:49 PM from the specification file - /tango/mike/src/lucene.standarddigit/src/java/org/apache/lucene/analysis/standard/StandardTokenizerImpl.jflex - - - - This character denotes the end of file - - - initial size of the lookahead buffer - - - lexical states - - - Translates characters to character classes - - - Translates characters to character classes - - - Translates DFA states to action switch labels. - - - Translates a state to a row index in the transition table - - - The transition table of the DFA - - - ZZ_ATTRIBUTE[aState] contains the attributes of state aState - - - the input device - - - the current state of the DFA - - - the current lexical state - - - this buffer contains the current text to be matched and is - the source of the yytext() string - - - - the textposition at the last accepting state - - - the textposition at the last state to be included in yytext - - - the current text position in the buffer - - - startRead marks the beginning of the yytext() string in the buffer - - - endRead marks the last character in the buffer, that has been read - from input - - - - number of newlines encountered up to the start of the matched text - - - the number of characters up to the start of the matched text - - - the number of characters from the last newline up to the start of the - matched text - - - - zzAtBOL == true <=> the scanner is currently at the beginning of a line - - - zzAtEOF == true <=> the scanner is at the EOF - - - this solves a bug where HOSTs that end with '.' are identified - as ACRONYMs. It is deprecated and will be removed in the next - release. - - - - Resets the Tokenizer to a new Reader. - - - Fills Lucene token with the current token text. - - - Fills TermAttribute with the current token text. - - - Creates a new scanner - There is also a java.io.InputStream version of this constructor. - - - the java.io.Reader to read input from. - - - - Creates a new scanner. - There is also java.io.Reader version of this constructor. - - - the java.io.Inputstream to read input from. - - - - Unpacks the compressed character translation table. - - - the packed character translation table - - the unpacked character translation table - - - - Refills the input buffer. - - false, iff there was new input. - - - if any I/O-Error occurs - - - - Closes the input stream. - - - Resets the scanner to read from a new input stream. - Does not close the old reader. - - All internal variables are reset, the old input stream - cannot be reused (internal buffer is discarded and lost). - Lexical state is set to ZZ_INITIAL. - - - the new input stream - - - - Returns the current lexical state. - - - Enters a new lexical state - - - the new lexical state - - - - Returns the text matched by the current regular expression. - - - Returns the character at position pos from the - matched text. - - It is equivalent to yytext().charAt(pos), but faster - - - the position of the character to fetch. - A value from 0 to yylength()-1. - - - the character at position pos - - - - Returns the length of the matched text region. - - - Reports an error that occured while scanning. - - In a wellformed scanner (no or only correct usage of - yypushback(int) and a match-all fallback rule) this method - will only be called with things that "Can't Possibly Happen". - If this method is called, something is seriously wrong - (e.g. a JFlex bug producing a faulty scanner etc.). - - Usual syntax/scanner level error handling should be done - in error fallback rules. - - - the code of the errormessage to display - - - - Pushes the specified amount of characters back into the input stream. - - They will be read again by then next call of the scanning method - - - the number of characters to be read again. - This number must not be greater than yylength()! - - - - Resumes scanning until the next regular expression is matched, - the end of input is encountered or an I/O-Error occurs. - - - the next token - - if any I/O-Error occurs - - -
      -
      + + + + Lucene.Net + + + + An "open" BitSet implementation that allows direct access to the array of words + storing the bits. +

      + Unlike java.util.bitset, the fact that bits are packed into an array of longs + is part of the interface. This allows efficient implementation of other algorithms + by someone other than the author. It also allows one to efficiently implement + alternate serialization or interchange formats. +

      + OpenBitSet is faster than java.util.BitSet in most operations + and *much* faster at calculating cardinality of sets and results of set operations. + It can also handle sets of larger cardinality (up to 64 * 2**32-1) +

      + The goals of OpenBitSet are the fastest implementation possible, and + maximum code reuse. Extra safety and encapsulation + may always be built on top, but if that's built in, the cost can never be removed (and + hence people re-implement their own version in order to get better performance). + If you want a "safe", totally encapsulated (and slower and limited) BitSet + class, use java.util.BitSet. +

      +

      Performance Results

      + + Test system: Pentium 4, Sun Java 1.5_06 -server -Xbatch -Xmx64M +
      BitSet size = 1,000,000 +
      Results are java.util.BitSet time divided by OpenBitSet time. + + + + + + + + + + +
      cardinality intersect_count union nextSetBit get iterator
      50% full 3.36 3.96 1.44 1.46 1.99 1.58
      1% full 3.31 3.90   1.04   0.99
      +
      + Test system: AMD Opteron, 64 bit linux, Sun Java 1.5_06 -server -Xbatch -Xmx64M +
      BitSet size = 1,000,000 +
      Results are java.util.BitSet time divided by OpenBitSet time. + + + + + + + + + + +
      cardinality intersect_count union nextSetBit get iterator
      50% full 2.50 3.50 1.00 1.03 1.12 1.25
      1% full 2.51 3.49   1.00   1.02
      +
      + $Id$ + +
      + + A DocIdSet contains a set of doc ids. Implementing classes must + only implement to provide access to the set. + + + + An empty instance for easy use, e.g. in Filters that hit no documents. + + + Provides a to access the set. + This implementation can return null or + EMPTY_DOCIDSET.Iterator() if there + are no docs that match. + + + + This method is a hint for , if this DocIdSet + should be cached without copying it into a BitSet. The default is to return + false. If you have an own DocIdSet implementation + that does its iteration very effective and fast without doing disk I/O, + override this method and return true. + + + + This abstract class defines methods to iterate over a set of non-decreasing + doc ids. Note that this class assumes it iterates on doc Ids, and therefore + is set to Int32.MaxValue in order to be used as + a sentinel object. Implementations of this class are expected to consider + as an invalid value. + + + + When returned by , and + it means there are no more docs in the iterator. + + + + Unsupported anymore. Call instead. This method throws + if called. + + + use instead. + + + + Returns the following: + + -1 or if or + were not called yet. + if the iterator has exhausted. + Otherwise it should return the doc ID it is currently on. + +

      + NOTE: in 3.0, this method will become abstract. + +

      + 2.9 + +
      + + Unsupported anymore. Call instead. This method throws + if called. + + + use instead. This will be removed in 3.0 + + + + Unsupported anymore. Call instead. This method throws + if called. + + + use instead. This will be removed in 3.0 + + + + Advances to the next document in the set and returns the doc it is + currently on, or if there are no more docs in the + set.
      + + NOTE: in 3.0 this method will become abstract, following the removal + of . For backward compatibility it is implemented as: + + + public int nextDoc() throws IOException { + return next() ? doc() : NO_MORE_DOCS; + } + + + NOTE: after the iterator has exhausted you should not call this + method, as it may result in unpredicted behavior. + +
      + 2.9 + +
      + + Advances to the first beyond the current whose document number is greater + than or equal to target. Returns the current document number or + if there are no more docs in the set. +

      + Behaves as if written: + + + int advance(int target) { + int doc; + while ((doc = nextDoc()) < target) { + } + return doc; + } + + + Some implementations are considerably more efficient than that. +

      + NOTE: certain implemenations may return a different value (each + time) if called several times in a row with the same target. +

      + NOTE: this method may be called with for + efficiency by some Scorers. If your implementation cannot efficiently + determine that it should exhaust, it is recommended that you check for that + value in each call to this method. +

      + NOTE: after the iterator has exhausted you should not call this + method, as it may result in unpredicted behavior. +

      + NOTE: in 3.0 this method will become abstract, following the removal + of . + +

      + 2.9 + +
      + + Constructs an OpenBitSet large enough to hold numBits. + + + + + + + Constructs an OpenBitSet from an existing long[]. +
      + The first 64 bits are in long[0], + with bit index 0 at the least significant bit, and bit index 63 at the most significant. + Given a bit index, + the word containing it is long[index/64], and it is at bit number index%64 within that word. +

      + numWords are the number of elements in the array that contain + set bits (non-zero longs). + numWords should be <= bits.length, and + any existing words in the array at position >= numWords should be zero. + +

      +
      + + This DocIdSet implementation is cacheable. + + + Returns the current capacity in bits (1 greater than the index of the last bit) + + + Returns the current capacity of this set. Included for + compatibility. This is *not* equal to + + + + Returns true if there are no set bits + + + Expert: returns the long[] storing the bits + + + Expert: sets a new long[] to use as the bit storage + + + Expert: gets the number of longs in the array that are in use + + + Expert: sets the number of longs in the array that are in use + + + Returns true or false for the specified bit index. + + + Returns true or false for the specified bit index. + The index should be less than the OpenBitSet size + + + + Returns true or false for the specified bit index + + + Returns true or false for the specified bit index. + The index should be less than the OpenBitSet size. + + + + returns 1 if the bit is set, 0 if not. + The index should be less than the OpenBitSet size + + + + sets a bit, expanding the set size if necessary + + + Sets the bit at the specified index. + The index should be less than the OpenBitSet size. + + + + Sets the bit at the specified index. + The index should be less than the OpenBitSet size. + + + + Sets a range of bits, expanding the set size if necessary + + + lower index + + one-past the last bit to set + + + + clears a bit. + The index should be less than the OpenBitSet size. + + + + clears a bit. + The index should be less than the OpenBitSet size. + + + + clears a bit, allowing access beyond the current set size without changing the size. + + + Clears a range of bits. Clearing past the end does not change the size of the set. + + + lower index + + one-past the last bit to clear + + + + Clears a range of bits. Clearing past the end does not change the size of the set. + + + lower index + + one-past the last bit to clear + + + + Sets a bit and returns the previous value. + The index should be less than the OpenBitSet size. + + + + Sets a bit and returns the previous value. + The index should be less than the OpenBitSet size. + + + + flips a bit. + The index should be less than the OpenBitSet size. + + + + flips a bit. + The index should be less than the OpenBitSet size. + + + + flips a bit, expanding the set size if necessary + + + flips a bit and returns the resulting bit value. + The index should be less than the OpenBitSet size. + + + + flips a bit and returns the resulting bit value. + The index should be less than the OpenBitSet size. + + + + Flips a range of bits, expanding the set size if necessary + + + lower index + + one-past the last bit to flip + + + + the number of set bits + + + + Returns the popcount or cardinality of the intersection of the two sets. + Neither set is modified. + + + + Returns the popcount or cardinality of the union of the two sets. + Neither set is modified. + + + + Returns the popcount or cardinality of "a and not b" + or "intersection(a, not(b))". + Neither set is modified. + + + + Returns the popcount or cardinality of the exclusive-or of the two sets. + Neither set is modified. + + + + Returns the index of the first set bit starting at the index specified. + -1 is returned if there are no more set bits. + + + + Returns the index of the first set bit starting at the index specified. + -1 is returned if there are no more set bits. + + + + this = this AND other + + + this = this OR other + + + Remove all elements set in other. this = this AND_NOT other + + + this = this XOR other + + + returns true if the sets have any elements in common + + + Expand the long[] with the size given as a number of words (64 bit longs). + getNumWords() is unchanged by this call. + + + + Ensure that the long[] is big enough to hold numBits, expanding it if necessary. + getNumWords() is unchanged by this call. + + + + Lowers numWords, the number of words in use, + by checking for trailing zero words. + + + + returns the number of 64 bit words it would take to hold numBits + + + returns true if both sets have the same bits set + + + Returns primitive memory sizes for estimating RAM usage. + + + + + size of array beyond contents + + + + Class size overhead + + + + a primitive Class - bool, byte, char, short, long, float, + short, double, int + + the size in bytes of given primitive Class + + + + size of reference + + + + Simple DocIdSet and DocIdSetIterator backed by a BitSet + + + This DocIdSet implementation is cacheable. + + + Returns the underlying BitSet. + + + use instead. + + + + use instead. + + + + use instead. + + + + Optimized implementation of a vector of bits. This is more-or-less like + java.util.BitSet, but also includes the following: + + a count() method, which efficiently computes the number of one bits; + optimized read from and write to disk; + inlinable get() method; + store and load, as bit set or d-gaps, depending on sparseness; + + + $Id: BitVector.java 765649 2009-04-16 14:29:26Z mikemccand $ + + + + Constructs a vector capable of holding n bits. + + + Sets the value of bit to one. + + + Sets the value of bit to true, and + returns true if bit was already set + + + + Sets the value of bit to zero. + + + Returns true if bit is one and + false if it is zero. + + + + Returns the number of bits in this vector. This is also one greater than + the number of the largest valid bit number. + + + + Returns the total number of one bits in this vector. This is efficiently + computed and cached, so that, if the vector is not changed, no + recomputation is done for repeated calls. + + + + + For testing + + + + Writes this vector to the file name in Directory + d, in a format that can be read by the constructor + . + + + + Write as a bit set + + + Write as a d-gaps list + + + Indicates if the bit vector is sparse and should be saved as a d-gaps list, or dense, and should be saved as a bit set. + + + Constructs a bit vector from the file name in Directory + d, as written by the method. + + + + Read as a bit set + + + read as a d-gaps list + + + Retrieve a subset of this BitVector. + + + starting index, inclusive + + ending index, exclusive + + subset + + + + + Not implemented. Waiting for volunteers. + + + + + Base class for Directory implementations that store index + files in the file system. There are currently three core + subclasses: + + + + is a straightforward + implementation using java.io.RandomAccessFile. + However, it has poor concurrent performance + (multiple threads will bottleneck) as it + synchronizes when multiple threads read from the + same file. + + uses java.nio's + FileChannel's positional io when reading to avoid + synchronization when reading from the same file. + Unfortunately, due to a Windows-only Sun + JRE bug this is a poor choice for Windows, but + on all other platforms this is the preferred + choice. Applications using or + Future#cancel(boolean) (on Java 1.5) should use + instead. See java doc + for details. + + + + uses memory-mapped IO when + reading. This is a good choice if you have plenty + of virtual memory relative to your index size, eg + if you are running on a 64 bit JRE, or you are + running on a 32 bit JRE but your index sizes are + small enough to fit into the virtual memory space. + Java has currently the limitation of not being able to + unmap files from user code. The files are unmapped, when GC + releases the byte buffers. Due to + + this bug in Sun's JRE, MMapDirectory's + is unable to close the underlying OS file handle. Only when + GC finally collects the underlying objects, which could be + quite some time later, will the file handle be closed. + This will consume additional transient disk usage: on Windows, + attempts to delete or overwrite the files will result in an + exception; on other platforms, which typically have a "delete on + last close" semantics, while such operations will succeed, the bytes + are still consuming space on disk. For many applications this + limitation is not a problem (e.g. if you have plenty of disk space, + and you don't rely on overwriting files on Windows) but it's still + an important limitation to be aware of. This class supplies a + (possibly dangerous) workaround mentioned in the bug report, + which may fail on non-Sun JVMs. + + Applications using or + Future#cancel(boolean) (on Java 1.5) should use + instead. See + java doc for details. + + + Unfortunately, because of system peculiarities, there is + no single overall best implementation. Therefore, we've + added the method, to allow Lucene to choose + the best FSDirectory implementation given your + environment, and the known limitations of each + implementation. For users who have no reason to prefer a + specific implementation, it's best to simply use + . For all others, you should instantiate the + desired implementation directly. + +

      The locking implementation is by default + , but can be changed by + passing in a custom instance. + The deprecated getDirectory methods default to use + for backwards compatibility. + The system properties + org.apache.lucene.store.FSDirectoryLockFactoryClass + and org.apache.lucene.FSDirectory.class + are deprecated and only used by the deprecated + getDirectory methods. The system property + org.apache.lucene.lockDir is ignored completely, + If you really want to store locks + elsewhere, you can create your own + (or , + etc.) passing in your preferred lock directory. + +

      In 3.0 this class will become abstract. + +

      + + +
      + + A Directory is a flat list of files. Files may be written once, when they + are created. Once a file is created it may only be opened for read, or + deleted. Random access is permitted both when reading and writing. + +

      Java's i/o APIs not used directly, but rather all i/o is + through this API. This permits things such as: + implementation of RAM-based indices; + implementation indices stored in a database, via JDBC; + implementation of an index as a single file; + + + Directory locking is implemented by an instance of + , and can be changed for each Directory + instance using . + +

      +
      + + Holds the LockFactory instance (implements locking for + this Directory instance). + + + + For some Directory implementations ( + , and its subclasses), this method + silently filters its results to include only index + files. Please use instead, which + does no filtering. + + + + Returns an array of strings, one for each file in the + directory. Unlike this method does no + filtering of the contents in a directory, and it will + never return null (throws IOException instead). + + Currently this method simply fallsback to + for Directory impls outside of Lucene's core & + contrib, but in 3.0 that method will be removed and + this method will become abstract. + + + + Returns true iff a file with the given name exists. + + + Returns the time the named file was last modified. + + + Set the modified time of an existing file to now. + + + Removes an existing file in the directory. + + + Renames an existing file in the directory. + If a file already exists with the new name, then it is replaced. + This replacement is not guaranteed to be atomic. + + + + + + Returns the length of a file in the directory. + + + Creates a new, empty file in the directory with the given name. + Returns a stream writing this file. + + + + Ensure that any writes to this file are moved to + stable storage. Lucene uses this to properly commit + changes to the index, to prevent a machine/OS crash + from corrupting the index. + + + + Returns a stream reading an existing file. + + + Returns a stream reading an existing file, with the + specified read buffer size. The particular Directory + implementation may ignore the buffer size. Currently + the only Directory implementations that respect this + parameter are and + . + + + + Construct a . + the name of the lock file + + + + Attempt to clear (forcefully unlock and remove) the + specified lock. Only call this at a time when you are + certain this lock is no longer in use. + + name of the lock to be cleared. + + + + Closes the store. + + + Set the LockFactory that this Directory instance should + use for its locking implementation. Each * instance of + LockFactory should only be used for one directory (ie, + do not share a single instance across multiple + Directories). + + + instance of . + + + + Get the LockFactory that this Directory instance is + using for its locking implementation. Note that this + may be null for Directory implementations that provide + their own locking implementation. + + + + Return a string identifier that uniquely differentiates + this Directory instance from other Directory instances. + This ID should be the same if two Directory instances + (even in different JVMs and/or on different machines) + are considered "the same index". This is how locking + "scopes" to the right index. + + + + Copy contents of a directory src to a directory dest. + If a file in src already exists in dest then the + one in dest will be blindly overwritten. + +

      NOTE: the source directory cannot change + while this method is running. Otherwise the results + are undefined and you could easily hit a + FileNotFoundException. + +

      NOTE: this method only copies files that look + like index files (ie, have extensions matching the + known extensions of index files). + +

      + source directory + + destination directory + + if true, call method on source directory + + IOException +
      + + AlreadyClosedException if this Directory is closed + + + This cache of directories ensures that there is a unique Directory + instance per path, so that synchronization on the Directory can be used to + synchronize access between readers and writers. We use + refcounts to ensure when the last use of an FSDirectory + instance for a given canonical path is closed, we remove the + instance from the cache. See LUCENE-776 + for some relevant discussion. + + Not used by any non-deprecated methods anymore + + + + Set whether Lucene's use of lock files is disabled. By default, + lock files are enabled. They should only be disabled if the index + is on a read-only medium like a CD-ROM. + + Use a or a constructor + that takes a and supply + . This setting does not work + with only the deprecated getDirectory + respect this setting. + + + + Returns whether Lucene's use of lock files is disabled. + true if locks are disabled, false if locks are enabled. + + + + Use a constructor that takes a and + supply . + + + + The default class which implements filesystem-based directories. + + + A buffer optionally used in renameTo method + + + Returns the directory instance for the named location. + + + Use + + + the path to the directory. + + the FSDirectory for the named file. + + + + Returns the directory instance for the named location. + + + Use + + + the path to the directory. + + instance of providing the + locking implementation. + + the FSDirectory for the named file. + + + + Returns the directory instance for the named location. + + + Use + + + the path to the directory. + + the FSDirectory for the named file. + + + + Returns the directory instance for the named location. + + + Use + + + the path to the directory. + + the FSDirectory for the named file. + + + + Returns the directory instance for the named location. + + + Use + + + the path to the directory. + + instance of providing the + locking implementation. + + the FSDirectory for the named file. + + + + Returns the directory instance for the named location. + + + Use + + + the path to the directory. + + instance of providing the + locking implementation. + + the FSDirectory for the named file. + + + + Returns the directory instance for the named location. + + + Use IndexWriter's create flag, instead, to + create a new index. + + + the path to the directory. + + if true, create, or erase any existing contents. + + the FSDirectory for the named file. + + + + Returns the directory instance for the named location. + + + Use IndexWriter's create flag, instead, to + create a new index. + + + the path to the directory. + + if true, create, or erase any existing contents. + + the FSDirectory for the named file. + + + + Returns the directory instance for the named location. + + + Use IndexWriter's create flag, instead, to + create a new index. + + + the path to the directory. + + if true, create, or erase any existing contents. + + the FSDirectory for the named file. + + + + + + + + Initializes the directory to create a new file with the given name. + This method should be used in . + + + + The underlying filesystem directory + + + + + + + + + + + Create a new FSDirectory for the named location (ctor for subclasses). + the path of the directory + + the lock factory to use, or null for the default + (); + + IOException + + + Creates an FSDirectory instance, trying to pick the + best implementation given the current environment. + The directory returned uses the . + +

      Currently this returns as + NIOFSDirectory is currently not supported. + +

      Currently this returns as + NIOFSDirectory is currently not supported. + +

      NOTE: this method may suddenly change which + implementation is returned from release to release, in + the event that higher performance defaults become + possible; if the precise implementation is important to + your application, please instantiate it directly, + instead. On 64 bit systems, it may also good to + return , but this is disabled + because of officially missing unmap support in Java. + For optimal performance you should consider using + this implementation on 64 bit JVMs. + +

      See above +

      +
      + + Creates an FSDirectory instance, trying to pick the + best implementation given the current environment. + The directory returned uses the . + +

      Currently this returns as + NIOFSDirectory is currently not supported. + +

      NOTE: this method may suddenly change which + implementation is returned from release to release, in + the event that higher performance defaults become + possible; if the precise implementation is important to + your application, please instantiate it directly, + instead. On 64 bit systems, it may also good to + return , but this is disabled + because of officially missing unmap support in Java. + For optimal performance you should consider using + this implementation on 64 bit JVMs. + +

      See above +

      +
      + + Just like , but allows you to + also specify a custom . + + + + Lists all files (not subdirectories) in the + directory. This method never returns null (throws + instead). + + + NoSuchDirectoryException if the directory + does not exist, or does exist but is not a + directory. + + IOException if list() returns null + + + Lists all files (not subdirectories) in the + directory. This method never returns null (throws + instead). + + + NoSuchDirectoryException if the directory + does not exist, or does exist but is not a + directory. + + IOException if list() returns null + + + Lists all files (not subdirectories) in the + directory. + + + + + + Returns true iff a file with the given name exists. + + + Returns the time the named file was last modified. + + + Returns the time the named file was last modified. + + + Set the modified time of an existing file to now. + + + Returns the length in bytes of a file in the directory. + + + Removes an existing file in the directory. + + + Renames an existing file in the directory. + Warning: This is not atomic. + + + + + + Creates an IndexOutput for the file with the given name. + In 3.0 this method will become abstract. + + + + Creates an IndexInput for the file with the given name. + In 3.0 this method will become abstract. + + + + So we can do some byte-to-hexchar conversion below + + + Closes the store to future operations. + + + + .NET + + + + For debug output. + + + Default read chunk size. This is a conditional + default: on 32bit JVMs, it defaults to 100 MB. On + 64bit JVMs, it's Integer.MAX_VALUE. + + + + + + Sets the maximum number of bytes read at once from the + underlying file during . + The default value is ; + +

      This was introduced due to Sun + JVM Bug 6478546, which throws an incorrect + OutOfMemoryError when attempting to read too many bytes + at once. It only happens on 32bit JVMs with a large + maximum heap size.

      + +

      Changes to this value will not impact any + already-opened s. You should call + this before attempting to open an index on the + directory.

      + +

      NOTE: This value should be as large as + possible to reduce any possible performance impact. If + you still encounter an incorrect OutOfMemoryError, + trying lowering the chunk size.

      +

      +
      + + The maximum number of bytes to read at once from the + underlying file during . + + + + + + Use SimpleFSDirectory.SimpleFSIndexInput instead + + + + Base implementation class for buffered . + + + Abstract base class for input from a file in a . A + random-access input stream. Used for all Lucene index input operations. + + + + + + Reads and returns a single byte. + + + + + Reads a specified number of bytes into an array at the specified offset. + the array to read bytes into + + the offset in the array to start storing bytes + + the number of bytes to read + + + + + + Reads a specified number of bytes into an array at the + specified offset with control over whether the read + should be buffered (callers who have their own buffer + should pass in "false" for useBuffer). Currently only + respects this parameter. + + the array to read bytes into + + the offset in the array to start storing bytes + + the number of bytes to read + + set to false if the caller will handle + buffering. + + + + + + Reads four bytes and returns an int. + + + + + Reads an int stored in variable-length format. Reads between one and + five bytes. Smaller values take fewer bytes. Negative numbers are not + supported. + + + + + + Reads eight bytes and returns a long. + + + + + Reads a long stored in variable-length format. Reads between one and + nine bytes. Smaller values take fewer bytes. Negative numbers are not + supported. + + + + Call this if readString should read characters stored + in the old modified UTF8 format (length in java chars + and java's modified UTF8 encoding). This is used for + indices written pre-2.4 See LUCENE-510 for details. + + + + Reads a string. + + + + + Reads Lucene's old "modified UTF-8" encoded + characters into an array. + + the array to read characters into + + the offset in the array to start storing characters + + the number of characters to read + + + + -- please use readString or readBytes + instead, and construct the string + from those utf8 bytes + + + + Expert + + Similar to but does not do any conversion operations on the bytes it is reading in. It still + has to invoke just as does, but it does not need a buffer to store anything + and it does not have to do any of the bitwise operations, since we don't actually care what is in the byte except to determine + how many more bytes to read + + The number of chars to read + + this method operates on old "modified utf8" encoded + strings + + + + Closes the stream to futher operations. + + + Returns the current position in this file, where the next read will + occur. + + + + + + Sets current position in this file, where the next read will occur. + + + + + The number of bytes in the file. + + + Returns a clone of this stream. + +

      Clones of a stream access the same data, and are positioned at the same + point as the stream they were cloned from. + +

      Expert: Subclasses must ensure that clones may be positioned at + different points in the input from each other and from the stream they + were cloned from. +

      +
      + + Default buffer size + + + Inits BufferedIndexInput with a specific bufferSize + + + Change the buffer size used by this IndexInput + + + + + + + Expert: implements buffer refill. Reads bytes from the current position + in the input. + + the array to read bytes into + + the offset in the array to start storing bytes + + the number of bytes to read + + + + Expert: implements seek. Sets current position in this file, where the + next will occur. + + + + + + A straightforward implementation of + using java.io.RandomAccessFile. However, this class has + poor concurrent performance (multiple threads will + bottleneck) as it synchronizes when multiple threads + read from the same file. It's usually better to use + or instead. + + + + Create a new SimpleFSDirectory for the named location. + + + the path of the directory + + the lock factory to use, or null for the default. + + IOException + + + Create a new SimpleFSDirectory for the named location. + + + the path of the directory + + the lock factory to use, or null for the default. + + IOException + + + Create a new SimpleFSDirectory for the named location and the default lock factory. + + + the path of the directory + + IOException + + + + + + + Create a new SimpleFSDirectory for the named location and the default lock factory. + + + the path of the directory + + IOException + + + Creates an IndexOutput for the file with the given name. + + + Creates an IndexInput for the file with the given name. + + + Please use ctor taking chunkSize + + + + Please use ctor taking chunkSize + + + + IndexInput methods + + + Method used for testing. Returns true if the underlying + file descriptor is valid. + + + + Base implementation class for buffered . + + + Abstract base class for output to a file in a Directory. A random-access + output stream. Used for all Lucene index output operations. + + + + + + + + Writes a single byte. + + + + + Writes an array of bytes. + the bytes to write + + the number of bytes to write + + + + + + Writes an array of bytes. + the bytes to write + + the offset in the byte array + + the number of bytes to write + + + + + + Writes an int as four bytes. + + + + + Writes an int in a variable-length format. Writes between one and + five bytes. Smaller values take fewer bytes. Negative numbers are not + supported. + + + + + + Writes a long as eight bytes. + + + + + Writes an long in a variable-length format. Writes between one and five + bytes. Smaller values take fewer bytes. Negative numbers are not + supported. + + + + + + Writes a string. + + + + + Writes a sub sequence of characters from s as the old + format (modified UTF-8 encoded bytes). + + the source of the characters + + the first character in the sequence + + the number of characters in the sequence + + -- please pre-convert to utf8 bytes + instead or use + + + + Writes a sub sequence of characters from char[] as + the old format (modified UTF-8 encoded bytes). + + the source of the characters + + the first character in the sequence + + the number of characters in the sequence + + -- please pre-convert to utf8 bytes instead or use + + + + Copy numBytes bytes from input to ourself. + + + Forces any buffered output to be written. + + + Closes this stream to further operations. + + + Returns the current position in this file, where the next write will + occur. + + + + + + Sets current position in this file, where the next write will occur. + + + + + The number of bytes in the file. + + + Set the file length. By default, this method does + nothing (it's optional for a Directory to implement + it). But, certain Directory implementations (for + + can use this to inform the + underlying IO system to pre-allocate the file to the + specified size. If the length is longer than the + current file length, the bytes added to the file are + undefined. Otherwise the file is truncated. + + file length + + + + Writes a single byte. + + + + + Writes an array of bytes. + the bytes to write + + the number of bytes to write + + + + + + Forces any buffered output to be written. + + + Expert: implements buffer write. Writes bytes at the current position in + the output. + + the bytes to write + + the number of bytes to write + + + + Expert: implements buffer write. Writes bytes at the current position in + the output. + + the bytes to write + + the offset in the byte array + + the number of bytes to write + + + + Closes this stream to further operations. + + + Returns the current position in this file, where the next write will + occur. + + + + + + Sets current position in this file, where the next write will occur. + + + + + The number of bytes in the file. + + + output methods: + + + Random-access methods + + + + + + + + + + + + + + + + + + + Use SimpleFSDirectory.SimpleFSIndexOutput instead + + + + + + + + + Not implemented. Waiting for volunteers. + + + + Simple standalone server that must be running when you + use . This server simply + verifies at most one process holds the lock at a time. + Run without any args to see usage. + + + + + + + + + Base class for file system based locking implementation. + + +

      Base class for Locking implementation. uses + instances of this class to implement locking.

      + +

      Note that there are some useful tools to verify that + your LockFactory is working correctly: + , , + .

      + +

      + + + + + + +
      + + Set the prefix in use for all locks created in this + LockFactory. This is normally called once, when a + Directory gets this LockFactory instance. However, you + can also call this (after this instance is assigned to + a Directory) to override the prefix in use. This + is helpful if you're running Lucene on machines that + have different mount points for the same shared + directory. + + + + Get the prefix in use for all locks created in this LockFactory. + + + Return a new Lock instance identified by lockName. + name of the lock to be created. + + + + Attempt to clear (forcefully unlock and remove) the + specified lock. Only call this at a time when you are + certain this lock is no longer in use. + + name of the lock to be cleared. + + + + Directory for the lock files. + + + Set the lock directory. This method can be only called + once to initialize the lock directory. It is used by + to set the lock directory to itsself. + Subclasses can also use this method to set the directory + in the constructor. + + + + Retrieve the lock directory. + + + Expert: Calculate query weights and build query scorers. +

      + The purpose of is to ensure searching does not + modify a , so that a instance can be reused.
      + dependent state of the query should reside in the + .
      + dependent state should reside in the . +

      + A Weight is used in the following way: + + A Weight is constructed by a top-level query, given a + Searcher (). + The method is called on the + Weight to compute the query normalization factor + of the query clauses contained in the + query. + The query normalization factor is passed to . At + this point the weighting is complete. + A Scorer is constructed by . + + +

      + 2.9 + +
      + + An explanation of the score computation for the named document. + + + sub-reader containing the give doc + + + + an Explanation for the score + + IOException + + + The query that this concerns. + + + The weight for this query. + + + Assigns the query normalization factor to this. + + + Returns a which scores documents in/out-of order according + to scoreDocsInOrder. +

      + NOTE: even if scoreDocsInOrder is false, it is + recommended to check whether the returned Scorer indeed scores + documents out of order (i.e., call ), as + some Scorer implementations will always return documents + in-order.
      + NOTE: null can be returned if no documents will be scored by this + query. + +

      + + the for which to return the . + + specifies whether in-order scoring of documents is required. Note + that if set to false (i.e., out-of-order scoring is required), + this method can return whatever scoring mode it supports, as every + in-order scorer is also an out-of-order one. However, an + out-of-order scorer may not support + and/or , therefore it is recommended to + request an in-order scorer if use of these methods is required. + + + if true, will be called; if false, + and/or will + be called. + + a which scores documents in/out-of order. + + IOException +
      + + The sum of squared weights of contained query clauses. + + + Returns true iff this implementation scores docs only out of order. This + method is used in conjunction with 's + AcceptsDocsOutOfOrder and + to + create a matching instance for a given , or + vice versa. +

      + NOTE: the default implementation returns false, i.e. + the Scorer scores documents in-order. +

      +
      + + A PriorityQueue maintains a partial ordering of its elements such that the + least element can always be found in constant time. Put()'s and pop()'s + require log(size) time. + +

      NOTE: This class pre-allocates a full array of + length maxSize+1, in . + +

      +
      + + Determines the ordering of objects in this priority queue. Subclasses + must define this one method. + + + + This method can be overridden by extending classes to return a sentinel + object which will be used by to fill the queue, so + that the code which uses that queue can always assume it's full and only + change the top without attempting to insert any new object.
      + + Those sentinel values should always compare worse than any non-sentinel + value (i.e., should always favor the + non-sentinel values).
      + + By default, this method returns false, which means the queue will not be + filled with sentinel values. Otherwise, the value returned will be used to + pre-populate the queue. Adds sentinel values to the queue.
      + + If this method is extended to return a non-null value, then the following + usage pattern is recommended: + + + // extends getSentinelObject() to return a non-null value. + PriorityQueue pq = new MyQueue(numHits); + // save the 'top' element, which is guaranteed to not be null. + MyObject pqTop = (MyObject) pq.top(); + <...> + // now in order to add a new element, which is 'better' than top (after + // you've verified it is better), it is as simple as: + pqTop.change(). + pqTop = pq.updateTop(); + + + NOTE: if this method returns a non-null value, it will be called by + times, relying on a new object to + be returned and will not check if it's null again. Therefore you should + ensure any call to this method creates a new instance and behaves + consistently, e.g., it cannot return null if it previously returned + non-null. + +
      + the sentinel object to use to pre-populate the queue, or null if + sentinel objects are not supported. + +
      + + Subclass constructors must call this. + + + Adds an Object to a PriorityQueue in log(size) time. If one tries to add + more objects than maxSize from initialize a RuntimeException + (ArrayIndexOutOfBound) is thrown. + + + use which returns the new top object, + saving an additional call to . + + + + Adds an Object to a PriorityQueue in log(size) time. If one tries to add + more objects than maxSize from initialize an + is thrown. + + + the new 'top' element in the queue. + + + + Adds element to the PriorityQueue in log(size) time if either the + PriorityQueue is not full, or not lessThan(element, top()). + + + + + true if element is added, false otherwise. + + use instead, which + encourages objects reuse. + + + + insertWithOverflow() is the same as insert() except its + return value: it returns the object (if any) that was + dropped off the heap because it was full. This can be + the given parameter (in case it is smaller than the + full heap's minimum, and couldn't be added), or another + object that was previously the smallest value in the + heap and now has been replaced by a larger one, or null + if the queue wasn't yet full with maxSize elements. + + + + Returns the least element of the PriorityQueue in constant time. + + + Removes and returns the least element of the PriorityQueue in log(size) + time. + + + + Should be called when the Object at top changes values. Still log(n) worst + case, but it's at least twice as fast to + + + pq.top().change(); + pq.adjustTop(); + + + instead of + + + o = pq.pop(); + o.change(); + pq.push(o); + + + + use which returns the new top element and + saves an additional call to . + + + + Should be called when the Object at top changes values. Still log(n) worst + case, but it's at least twice as fast to + + + pq.top().change(); + pq.updateTop(); + + + instead of + + + o = pq.pop(); + o.change(); + pq.push(o); + + + + the new 'top' element. + + + + Returns the number of elements currently stored in the PriorityQueue. + + + Removes all entries from the PriorityQueue. + + + Wrapper for () implementations, which simply re-bases the + incoming docID before calling . + + + Please migrate custom HitCollectors to the new + class. This class will be removed when is + removed. + + + +

      Expert: Collectors are primarily meant to be used to + gather raw results from a search, and implement sorting + or custom result filtering, collation, etc.

      + +

      As of 2.9, this class replaces the deprecated + HitCollector, and offers an API for efficient collection + of hits across sequential s. + advances the collector through each of the + sub readers, in an arbitrary order. This results in a + higher performance means of collection.

      + +

      Lucene's core collectors are derived from Collector. + Likely your application can use one of these classes, or + subclass , instead of + implementing Collector directly: + + + + is an abstract base class + that assumes you will retrieve the top N docs, + according to some criteria, after collection is + done. + + is a concrete subclass + and sorts according to score + + docID. This is used internally by the + search methods that do not take an + explicit . It is likely the most frequently + used collector. + + subclasses + and sorts according to a specified + object (sort by field). This is used + internally by the search methods + that take an explicit . + + , which wraps any other + Collector and aborts the search if it's taken too much + time, will subclass Collector in 3.0 (presently it + subclasses the deprecated HitCollector). + + wraps any other + Collector and prevents collection of hits whose score + is <= 0.0 + + + +

      Collector decouples the score from the collected doc: + the score computation is skipped entirely if it's not + needed. Collectors that do need the score should + implement the method, to hold onto the + passed instance, and call + within the collect method to compute the + current hit's score. If your collector may request the + score for a single hit multiple times, you should use + .

      + +

      NOTE: The doc that is passed to the collect + method is relative to the current reader. If your + collector needs to resolve this to the docID space of the + Multi*Reader, you must re-base it by recording the + docBase from the most recent setNextReader call. Here's + a simple example showing how to collect docIDs into a + BitSet:

      + + + Searcher searcher = new IndexSearcher(indexReader); + final BitSet bits = new BitSet(indexReader.maxDoc()); + searcher.search(query, new Collector() { + private int docBase; + + // ignore scorer + public void setScorer(Scorer scorer) { + } + + // accept docs out of order (for a BitSet it doesn't matter) + public boolean acceptsDocsOutOfOrder() { + return true; + } + + public void collect(int doc) { + bits.set(doc + docBase); + } + + public void setNextReader(IndexReader reader, int docBase) { + this.docBase = docBase; + } + }); + + +

      Not all collectors will need to rebase the docID. For + example, a collector that simply counts the total number + of hits would skip it.

      + +

      NOTE: Prior to 2.9, Lucene silently filtered + out hits with score <= 0. As of 2.9, the core Collectors + no longer do that. It's very unusual to have such hits + (a negative query boost, or function query returning + negative custom scores, could cause it to happen). If + you need that behavior, use + .

      + +

      NOTE: This API is experimental and might change + in incompatible ways in the next release.

      + +

      + 2.9 + +
      + + Called before successive calls to . Implementations + that need the score of the current document (passed-in to + ), should save the passed-in Scorer and call + scorer.score() when needed. + + + + Called once for every document matching a query, with the unbased document + number. + +

      + Note: This is called in an inner search loop. For good search performance, + implementations of this method should not call or + on every hit. + Doing so can slow searches by an order of magnitude or more. +

      +
      + + Called before collecting from each IndexReader. All doc ids in + will correspond to reader. + + Add docBase to the current IndexReaders internal document id to re-base ids + in . + + + next IndexReader + + + + + + + Return true if this collector does not + require the matching docIDs to be delivered in int sort + order (smallest to largest) to . +

      Most Lucene Query implementations will visit + matching docIDs in order. However, some queries + (currently limited to certain cases of ) + can achieve faster searching if the + Collector allows them to deliver the + docIDs out of order. +

      Many collectors don't mind getting docIDs out of + order, so it's important to return true + here. +

      + +
      + + Query that sets document score as a programmatic function of several (sub) scores: + + the score of its subQuery (any query) + (optional) the score of its ValueSourceQuery (or queries). + For most simple/convenient use cases this query is likely to be a + FieldScoreQuery + + Subclasses can modify the computation by overriding . + +

      + WARNING: The status of the Search.Function package is experimental. + The APIs introduced here might change in the future and will not be + supported anymore in such a case. +

      +
      + + The abstract base class for queries. +

      Instantiable subclasses are: + + + + + + + + + + + + + +

      A parser for queries is contained in: + + QueryParser + +

      +
      + + Sets the boost for this query clause to b. Documents + matching this clause will (in addition to the normal weightings) have + their score multiplied by b. + + + + Gets the boost for this clause. Documents matching + this clause will (in addition to the normal weightings) have their score + multiplied by b. The boost is 1.0 by default. + + + + Prints a query to a string, with field assumed to be the + default field and omitted. +

      The representation used is one that is supposed to be readable + by QueryParser. However, + there are the following limitations: + + If the query was created by the parser, the printed + representation may not be exactly what was parsed. For example, + characters that need to be escaped will be represented without + the required backslash. + Some of the more complicated queries (e.g. span queries) + don't have a representation that can be parsed by QueryParser. + +

      +
      + + Prints a query to a string. + + + Expert: Constructs an appropriate Weight implementation for this query. + +

      + Only implemented by primitive queries, which re-write to themselves. +

      +
      + + Expert: Constructs and initializes a Weight for a top-level query. + + + Expert: called to re-write queries into primitive queries. For example, + a PrefixQuery will be rewritten into a BooleanQuery that consists + of TermQuerys. + + + + Expert: called when re-writing queries under MultiSearcher. + + Create a single query suitable for use by all subsearchers (in 1-1 + correspondence with queries). This is an optimization of the OR of + all queries. We handle the common optimization cases of equal + queries and overlapping clauses of boolean OR queries (as generated + by MultiTermQuery.rewrite()). + Be careful overriding this method as queries[0] determines which + method will be called and is not necessarily of the same type as + the other queries. + + + + Expert: adds all terms occuring in this query to the terms set. Only + works if this query is in its rewritten form. + + + UnsupportedOperationException if this query is not yet rewritten + + + Expert: merges the clauses of a set of BooleanQuery's into a single + BooleanQuery. + +

      A utility for use by implementations. +

      +
      + + Expert: Returns the Similarity implementation to be used for this query. + Subclasses may override this method to specify their own Similarity + implementation, perhaps one that delegates through that of the Searcher. + By default the Searcher's Similarity implementation is returned. + + + + Returns a clone of this query. + + + Create a CustomScoreQuery over input subQuery. + the sub query whose scored is being customed. Must not be null. + + + + Create a CustomScoreQuery over input subQuery and a . + the sub query whose score is being customed. Must not be null. + + a value source query whose scores are used in the custom score + computation. For most simple/convineient use case this would be a + FieldScoreQuery. + This parameter is optional - it can be null or even an empty array. + + + + Create a CustomScoreQuery over input subQuery and a . + the sub query whose score is being customized. Must not be null. + + value source queries whose scores are used in the custom score + computation. For most simple/convenient use case these would be + FieldScoreQueries. + This parameter is optional - it can be null or even an empty array. + + + + Returns true if o is equal to this. + + + Returns a hash code value for this object. + + + + Returns a that calculates the custom scores + for the given . The default implementation returns a default + implementation as specified in the docs of . + + + + + Compute a custom score by the subQuery score and a number of + ValueSourceQuery scores. + + The doc is relative to the current reader, which is + unknown to CustomScoreQuery when using per-segment search (since Lucene 2.9). + Please override and return a subclass + of for the given . + see CustomScoreProvider#customScore(int,float,float[]) + + + + Compute a custom score by the subQuery score and the ValueSourceQuery score. + + The doc is relative to the current reader, which is + unknown to CustomScoreQuery when using per-segment search (since Lucene 2.9). + Please override and return a subclass + of for the given . + + + + + Explain the custom score. + + The doc is relative to the current reader, which is + unknown to CustomScoreQuery when using per-segment search (since Lucene 2.9). + Please override and return a subclass + of for the given . + + + + Explain the custom score. + The doc is relative to the current reader, which is + unknown to CustomScoreQuery when using per-segment search (since Lucene 2.9). + Please override and return a subclass + of for the given . + + + + Checks if this is strict custom scoring. + In strict custom scoring, the ValueSource part does not participate in weight normalization. + This may be useful when one wants full control over how scores are modified, and does + not care about normalizing by the ValueSource part. + One particular case where this is useful if for testing this query. +

      + Note: only has effect when the ValueSource part is not null. +

      +
      + + Set the strict mode of this query. + The strict mode to set. + + + + + + A short name of this query, used in . + + + + An instance of this subclass should be returned by + , if you want + to modify the custom score calculation of a . + Since Lucene 2.9, queries operate on each segment of an Index separately, + so overriding the similar (now deprecated) methods in + is no longer suitable, as the supplied doc ID is per-segment + and without knowledge of the IndexReader you cannot access the + document or . + + @lucene.experimental + @since 2.9.2 + + + + + Creates a new instance of the provider class for the given IndexReader. + + + + + * Compute a custom score by the subQuery score and a number of + ValueSourceQuery scores. +

      + Subclasses can override this method to modify the custom score. +

      + If your custom scoring is different than the default herein you + should override at least one of the two customScore() methods. + If the number of ValueSourceQueries is always < 2 it is + sufficient to override the other + CustomScore() + method, which is simpler. +

      + The default computation herein is a multiplication of given scores: +

      +                ModifiedScore = valSrcScore * valSrcScores[0] * valSrcScores[1] * ...
      +            
      +
      + id of scored doc + score of that doc by the subQuery + scores of that doc by the ValueSourceQuery + custom score +
      + + + Compute a custom score by the subQuery score and the ValueSourceQuery score. +

      + Subclasses can override this method to modify the custom score. +

      + If your custom scoring is different than the default herein you + should override at least one of the two customScore() methods. + If the number of ValueSourceQueries is always < 2 it is + sufficient to override this customScore() method, which is simpler. +

      + The default computation herein is a multiplication of the two scores: +

      +                ModifiedScore = subQueryScore * valSrcScore
      +            
      +
      + id of scored doc + score of that doc by the subQuery + score of that doc by the ValueSourceQuery + custom score +
      + + + Explain the custom score. + Whenever overriding , + this method should also be overridden to provide the correct explanation + for the part of the custom scoring. + + doc being explained + explanation for the sub-query part + explanation for the value source part + an explanation for the custom score + + + + Explain the custom score. + Whenever overriding , + this method should also be overridden to provide the correct explanation + for the part of the custom scoring. + + + doc being explained + explanation for the sub-query part + explanation for the value source part + an explanation for the custom score + + + A scorer that applies a (callback) function on scores of the subQuery. + + + Expert: Common scoring functionality for different types of queries. + +

      + A Scorer iterates over documents matching a + query in increasing order of doc Id. +

      +

      + Document scores are computed using a given Similarity + implementation. +

      + +

      NOTE: The values Float.Nan, + Float.NEGATIVE_INFINITY and Float.POSITIVE_INFINITY are + not valid scores. Certain collectors (eg + ) will not properly collect hits + with these scores. + +

      + + +
      + + Constructs a Scorer. + The Similarity implementation used by this scorer. + + + + Returns the Similarity implementation used by this scorer. + + + Scores and collects all matching documents. + The collector to which all matching documents are passed through + . +
      When this method is used the method should not be used. + + use instead. + +
      + + Scores and collects all matching documents. + The collector to which all matching documents are passed. +
      When this method is used the method should not be used. + +
      + + Expert: Collects matching documents in a range. Hook for optimization. + Note that must be called once before this method is called + for the first time. + + The collector to which all matching documents are passed through + . + + Do not score documents past this. + + true if more matching documents may remain. + + use instead. + + + + Expert: Collects matching documents in a range. Hook for optimization. + Note, is added to ensure that + was called before this method. + + + The collector to which all matching documents are passed. + + Do not score documents past this. + + + The first document ID (ensures is called before + this method. + + true if more matching documents may remain. + + + + Returns the score of the current document matching the query. + Initially invalid, until or + is called the first time, or when called from within + . + + + + Returns an explanation of the score for a document. +
      When this method is used, the , and + methods should not be used. +
      + The document number for the explanation. + + + Please use + or instead. + +
      + + use instead. + + + + use instead. + + + + use instead. + + + + Expert: A hit queue for sorting by hits by terms in more than one field. + Uses FieldCache.DEFAULT for maintaining internal term lookup tables. + +

      Created: Dec 8, 2003 12:56:03 PM + +

      + lucene 1.4 + + $Id: FieldSortedHitQueue.java 803676 2009-08-12 19:31:38Z hossman $ + + + + + + see + +
      + + Creates a hit queue sorted by the given list of fields. + Index to use. + + Fieldable names, in priority order (highest priority first). Cannot be null or empty. + + The number of hits to retain. Must be greater than zero. + + IOException + + + Stores a comparator corresponding to each field being sorted by + + + Stores the sort criteria being used. + + + Stores the maximum score value encountered, needed for normalizing. + + + returns the maximum score encountered by elements inserted via insert() + + + Returns whether a is less relevant than b. + ScoreDoc + + ScoreDoc + + true if document a should be sorted after document b. + + + + Given a FieldDoc object, stores the values used + to sort the given document. These values are not the raw + values out of the index, but the internal representation + of them. This is so the given search hit can be collated + by a MultiSearcher with other search hits. + + The FieldDoc to store sort values into. + + The same FieldDoc passed in. + + + + + + Returns the SortFields being used by this hit queue. + + + Internal cache of comparators. Similar to FieldCache, only + caches comparators instead of term values. + + + + Returns a comparator for sorting hits according to a field containing bytes. + Index to use. + + Fieldable containing integer values. + + Comparator for sorting hits. + + IOException If an error occurs reading the index. + + + Returns a comparator for sorting hits according to a field containing shorts. + Index to use. + + Fieldable containing integer values. + + Comparator for sorting hits. + + IOException If an error occurs reading the index. + + + Returns a comparator for sorting hits according to a field containing integers. + Index to use. + + Fieldable containing integer values. + + Comparator for sorting hits. + + IOException If an error occurs reading the index. + + + Returns a comparator for sorting hits according to a field containing integers. + Index to use. + + Fieldable containing integer values. + + Comparator for sorting hits. + + IOException If an error occurs reading the index. + + + Returns a comparator for sorting hits according to a field containing floats. + Index to use. + + Fieldable containing float values. + + Comparator for sorting hits. + + IOException If an error occurs reading the index. + + + Returns a comparator for sorting hits according to a field containing doubles. + Index to use. + + Fieldable containing float values. + + Comparator for sorting hits. + + IOException If an error occurs reading the index. + + + Returns a comparator for sorting hits according to a field containing strings. + Index to use. + + Fieldable containing string values. + + Comparator for sorting hits. + + IOException If an error occurs reading the index. + + + Returns a comparator for sorting hits according to a field containing strings. + Index to use. + + Fieldable containing string values. + + + Comparator for sorting hits. + + IOException If an error occurs reading the index. + + + Returns a comparator for sorting hits according to values in the given field. + The terms in the field are looked at to determine whether they contain integers, + floats or strings. Once the type is determined, one of the other static methods + in this class is called to get the comparator. + + Index to use. + + Fieldable containing values. + + Comparator for sorting hits. + + IOException If an error occurs reading the index. + + + Expert: Internal cache. + + + Expert: The default cache implementation, storing all values in memory. + A WeakHashMap is used for storage. + +

      Created: May 19, 2004 4:40:36 PM + +

      + lucene 1.4 + + $Id: FieldCacheImpl.java 807572 2009-08-25 11:44:45Z mikemccand $ + +
      + + Checks the internal cache for an appropriate entry, and if none is + found, reads the terms in field as a single byte and returns an array + of size reader.maxDoc() of the value each document + has in the given field. + + Used to get field values. + + Which field contains the single byte values. + + The values in the given field for each document. + + IOException If any error occurs. + + + Checks the internal cache for an appropriate entry, and if none is found, + reads the terms in field as bytes and returns an array of + size reader.maxDoc() of the value each document has in the + given field. + + Used to get field values. + + Which field contains the bytes. + + Computes byte for string values. + + The values in the given field for each document. + + IOException If any error occurs. + + + Checks the internal cache for an appropriate entry, and if none is + found, reads the terms in field as shorts and returns an array + of size reader.maxDoc() of the value each document + has in the given field. + + Used to get field values. + + Which field contains the shorts. + + The values in the given field for each document. + + IOException If any error occurs. + + + Checks the internal cache for an appropriate entry, and if none is found, + reads the terms in field as shorts and returns an array of + size reader.maxDoc() of the value each document has in the + given field. + + Used to get field values. + + Which field contains the shorts. + + Computes short for string values. + + The values in the given field for each document. + + IOException If any error occurs. + + + Checks the internal cache for an appropriate entry, and if none is + found, reads the terms in field as integers and returns an array + of size reader.maxDoc() of the value each document + has in the given field. + + Used to get field values. + + Which field contains the integers. + + The values in the given field for each document. + + IOException If any error occurs. + + + Checks the internal cache for an appropriate entry, and if none is found, + reads the terms in field as integers and returns an array of + size reader.maxDoc() of the value each document has in the + given field. + + Used to get field values. + + Which field contains the integers. + + Computes integer for string values. + + The values in the given field for each document. + + IOException If any error occurs. + + + Checks the internal cache for an appropriate entry, and if + none is found, reads the terms in field as floats and returns an array + of size reader.maxDoc() of the value each document + has in the given field. + + Used to get field values. + + Which field contains the floats. + + The values in the given field for each document. + + IOException If any error occurs. + + + Checks the internal cache for an appropriate entry, and if + none is found, reads the terms in field as floats and returns an array + of size reader.maxDoc() of the value each document + has in the given field. + + Used to get field values. + + Which field contains the floats. + + Computes float for string values. + + The values in the given field for each document. + + IOException If any error occurs. + + + Checks the internal cache for an appropriate entry, and if none is + found, reads the terms in field as longs and returns an array + of size reader.maxDoc() of the value each document + has in the given field. + + + Used to get field values. + + Which field contains the longs. + + The values in the given field for each document. + + java.io.IOException If any error occurs. + + + Checks the internal cache for an appropriate entry, and if none is found, + reads the terms in field as longs and returns an array of + size reader.maxDoc() of the value each document has in the + given field. + + + Used to get field values. + + Which field contains the longs. + + Computes integer for string values. + + The values in the given field for each document. + + IOException If any error occurs. + + + Checks the internal cache for an appropriate entry, and if none is + found, reads the terms in field as integers and returns an array + of size reader.maxDoc() of the value each document + has in the given field. + + + Used to get field values. + + Which field contains the doubles. + + The values in the given field for each document. + + IOException If any error occurs. + + + Checks the internal cache for an appropriate entry, and if none is found, + reads the terms in field as doubles and returns an array of + size reader.maxDoc() of the value each document has in the + given field. + + + Used to get field values. + + Which field contains the doubles. + + Computes integer for string values. + + The values in the given field for each document. + + IOException If any error occurs. + + + Checks the internal cache for an appropriate entry, and if none + is found, reads the term values in field and returns an array + of size reader.maxDoc() containing the value each document + has in the given field. + + Used to get field values. + + Which field contains the strings. + + The values in the given field for each document. + + IOException If any error occurs. + + + Checks the internal cache for an appropriate entry, and if none + is found reads the term values in field and returns + an array of them in natural order, along with an array telling + which element in the term array each document uses. + + Used to get field values. + + Which field contains the strings. + + Array of terms and index into the array for each document. + + IOException If any error occurs. + + + Checks the internal cache for an appropriate entry, and if + none is found reads field to see if it contains integers, longs, floats + or strings, and then calls one of the other methods in this class to get the + values. For string values, a StringIndex is returned. After + calling this method, there is an entry in the cache for both + type AUTO and the actual found type. + + Used to get field values. + + Which field contains the values. + + int[], long[], float[] or StringIndex. + + IOException If any error occurs. + Please specify the exact type, instead. + Especially, guessing does not work with the new + type. + + + + Checks the internal cache for an appropriate entry, and if none + is found reads the terms out of field and calls the given SortComparator + to get the sort values. A hit in the cache will happen if reader, + field, and comparator are the same (using equals()) + as a previous call to this method. + + Used to get field values. + + Which field contains the values. + + Used to convert terms into something to sort by. + + Array of sort objects, one for each document. + + IOException If any error occurs. + Please implement + directly, instead. + + + + EXPERT: Generates an array of CacheEntry objects representing all items + currently in the FieldCache. +

      + NOTE: These CacheEntry objects maintain a strong refrence to the + Cached Values. Maintaining refrences to a CacheEntry the IndexReader + associated with it has garbage collected will prevent the Value itself + from being garbage collected when the Cache drops the WeakRefrence. +

      +

      + EXPERIMENTAL API: This API is considered extremely advanced + and experimental. It may be removed or altered w/o warning in future + releases + of Lucene. +

      +

      +
      + +

      + EXPERT: Instructs the FieldCache to forcibly expunge all entries + from the underlying caches. This is intended only to be used for + test methods as a way to ensure a known base state of the Cache + (with out needing to rely on GC to free WeakReferences). + It should not be relied on for "Cache maintenance" in general + application code. +

      +

      + EXPERIMENTAL API: This API is considered extremely advanced + and experimental. It may be removed or altered w/o warning in future + releases + of Lucene. +

      +

      +
      + + + Expert: drops all cache entries associated with this + reader. NOTE: this reader must precisely match the + reader that the cache entry is keyed on. If you pass a + top-level reader, it usually will have no effect as + Lucene now caches at the segment reader level. + + + + If non-null, FieldCacheImpl will warn whenever + entries are created that are not sane according to + . + + + + counterpart of + + + Will be removed in 3.0, this is for binary compatibility only + + + + Will be removed in 3.0, this is for binary compatibility only + + + + Will be removed in 3.0, this is for binary compatibility only + + + + Will be removed in 3.0, this is for binary compatibility only + + + + + + + + EXPERT: A unique Identifier/Description for each item in the FieldCache. + Can be useful for logging/debugging. +

      + EXPERIMENTAL API: This API is considered extremely advanced + and experimental. It may be removed or altered w/o warning in future + releases + of Lucene. +

      +

      +
      + + + + + + Computes (and stores) the estimated size of the cache Value + + + + + The most recently estimated size of the value, null unless + estimateSize has been called. + + + + Only needed because of Entry (ab)use by + FieldSortedHitQueue, remove when FieldSortedHitQueue + is removed + + + + Only needed because of Entry (ab)use by + FieldSortedHitQueue, remove when FieldSortedHitQueue + is removed + + + + Adds warning to super.toString if Local or sortFieldType were specified + Only needed because of Entry (ab)use by + FieldSortedHitQueue, remove when FieldSortedHitQueue + is removed + + + + Hack: When thrown from a Parser (NUMERIC_UTILS_* ones), this stops + processing terms and returns the current FieldCache + array. + + + + Expert: Internal cache. + + + Remove this reader from the cache, if present. + + + Expert: Every composite-key in the internal cache is of this type. + + + Only (ab)used by FieldSortedHitQueue, + remove when FieldSortedHitQueue is removed + + + + Only (ab)used by FieldSortedHitQueue, + remove when FieldSortedHitQueue is removed + + + + Only (ab)used by FieldSortedHitQueue, + remove when FieldSortedHitQueue is removed + + + + Creates one of these objects for a custom comparator/parser. + + + Only (ab)used by FieldSortedHitQueue, + remove when FieldSortedHitQueue is removed + + + + Two of these are equal iff they reference the same field and type. + + + Composes a hashcode based on the field and type. + + + Please specify the exact type, instead. + Especially, guessing does not work with the new + type. + + + + + + + + Compares two ScoreDoc objects and returns a result indicating their + sort order. + + First ScoreDoc + + Second ScoreDoc + + a negative integer if i should come before j
      + a positive integer if i should come after j
      + 0 if they are equal +
      + + +
      + + Returns the value used to sort the given document. The + object returned must implement the java.io.Serializable + interface. This is used by multisearchers to determine how + to collate results from their searchers. + + + + Document + + Serializable object + + + + Returns the type of sort. Should return SortField.SCORE, + SortField.DOC, SortField.STRING, + SortField.INTEGER, SortField.FLOAT or + SortField.CUSTOM. It is not valid to return + SortField.AUTO. + This is used by multisearchers to determine how to collate results + from their searchers. + + One of the constants in SortField. + + + + + + Expert: Maintains caches of term values. + +

      Created: May 19, 2004 11:13:14 AM + +

      + lucene 1.4 + + $Id: FieldCache.java 807841 2009-08-25 22:27:31Z markrmiller $ + + + +
      + + Expert: Stores term text values and document ordering data. + + + All the term values, in natural order. + + + For each document, an index into the lookup array. + + + Creates one of these objects + + + Indicator for StringIndex values in the cache. + + + Expert: The cache used internally by sorting and range query classes. + + + The default parser for byte values, which are encoded by + + + The default parser for short values, which are encoded by + + + The default parser for int values, which are encoded by + + + The default parser for float values, which are encoded by + + + The default parser for long values, which are encoded by + + + The default parser for double values, which are encoded by + + + A parser instance for int values encoded by , e.g. when indexed + via /. + + + + A parser instance for float values encoded with , e.g. when indexed + via /. + + + + A parser instance for long values encoded by , e.g. when indexed + via /. + + + + A parser instance for double values encoded with , e.g. when indexed + via /. + + + + Interface to parse bytes from document fields. + + + + + Marker interface as super-interface to all parsers. It + is used to specify a custom parser to . + + + + Return a single Byte representation of this field's value. + + + Interface to parse shorts from document fields. + + + + + Return a short representation of this field's value. + + + Interface to parse ints from document fields. + + + + + Return an integer representation of this field's value. + + + Interface to parse floats from document fields. + + + + + Return an float representation of this field's value. + + + Interface to parse long from document fields. + + + Use , this will be removed in Lucene 3.0 + + + + Return an long representation of this field's value. + + + Interface to parse doubles from document fields. + + + Use , this will be removed in Lucene 3.0 + + + + Return an long representation of this field's value. + + + The Scorer for DisjunctionMaxQuery's. The union of all documents generated by the the subquery scorers + is generated in document number order. The score for each document is the maximum of the scores computed + by the subquery scorers that generate that document, plus tieBreakerMultiplier times the sum of the scores + for the other subqueries that generate the document. + + + + Creates a new instance of DisjunctionMaxScorer + + + Multiplier applied to non-maximum-scoring subqueries for a + document as they are summed into the result. + + -- not used since our definition involves neither coord nor terms + directly + + The sub scorers this Scorer should iterate on + + The actual number of scorers to iterate on. Note that the array's + length may be larger than the actual number of scorers. + + + + Generate the next document matching our associated DisjunctionMaxQuery. + + + true iff there is a next document + + use instead. + + + + use instead. + + + + Determine the current document score. Initially invalid, until is called the first time. + the score of the current generated document + + + + Advance to the first document beyond the current whose number is greater + than or equal to target. + + + the minimum number of the next desired document + + true iff there is a document to be generated whose number is at + least target + + use instead. + + + + Explain a score that we computed. UNSUPPORTED -- see explanation capability in DisjunctionMaxQuery. + the number of a document we scored + + the Explanation for our score + + + + This interface describes a character stream that maintains line and + column number positions of the characters. It also has the capability + to backup the stream to some extent. An implementation of this + interface is used in the TokenManager implementation generated by + JavaCCParser. + + All the methods except backup can be implemented in any fashion. backup + needs to be implemented correctly for the correct operation of the lexer. + Rest of the methods are all used to get information like line number, + column number and the String that constitutes a token and are not used + by the lexer. Hence their implementation won't affect the generated lexer's + operation. + + + + Returns the next character from the selected input. The method + of selecting the input is the responsibility of the class + implementing this interface. Can throw any java.io.IOException. + + + + Returns the column position of the character last read. + + + + + + + Returns the line number of the character last read. + + + + + + + Returns the column number of the last character for current token (being + matched after the last call to BeginTOken). + + + + Returns the line number of the last character for current token (being + matched after the last call to BeginTOken). + + + + Returns the column number of the first character for current token (being + matched after the last call to BeginTOken). + + + + Returns the line number of the first character for current token (being + matched after the last call to BeginTOken). + + + + Backs up the input stream by amount steps. Lexer calls this method if it + had already read some characters, but could not use them to match a + (longer) token. So, they will be used again as the prefix of the next + token and it is the implemetation's responsibility to do this right. + + + + Returns the next character that marks the beginning of the next token. + All characters must remain in the buffer between two successive calls + to this method to implement backup correctly. + + + + Returns a string made up of characters from the marked token beginning + to the current buffer position. Implementations have the choice of returning + anything that they want to. For example, for efficiency, one might decide + to just return null, which is a valid implementation. + + + + Returns an array of characters that make up the suffix of length 'len' for + the currently matched token. This is used to build up the matched string + for use in actions in the case of MORE. A simple and inefficient + implementation of this is as follows : + + { + String t = GetImage(); + return t.substring(t.length() - len, t.length()).toCharArray(); + } + + + + The lexer calls this function to indicate that it is done with the stream + and hence implementations can free any resources held by this class. + Again, the body of this function can be just empty and it will not + affect the lexer's operation. + + + + Fills in no-term-vectors for all docs we haven't seen + since the last doc that had term vectors. + + + + Consumer returns this on each doc. This holds any + state that must be flushed synchronized "in docID + order". We gather these and flush them in order. + + + + This class accepts multiple added documents and directly + writes a single segment file. It does this more + efficiently than creating a single segment per document + (with DocumentWriter) and doing standard merges on those + segments. + + Each added document is passed to the , + which in turn processes the document and interacts with + other consumers in the indexing chain. Certain + consumers, like and + , digest a document and + immediately write bytes to the "doc store" files (ie, + they do not consume RAM per document, except while they + are processing the document). + + Other consumers, eg and + , buffer bytes in RAM and flush only + when a new segment is produced. + Once we have used our allowed RAM buffer, or the number + of added docs is large enough (in the case we are + flushing by doc count instead of RAM usage), we create a + real segment and flush it to the Directory. + + Threads: + + Multiple threads are allowed into addDocument at once. + There is an initial synchronized call to getThreadState + which allocates a ThreadState for this thread. The same + thread will get the same ThreadState over time (thread + affinity) so that if there are consistent patterns (for + example each thread is indexing a different content + source) then we make better use of RAM. Then + processDocument is called on that ThreadState without + synchronization (most of the "heavy lifting" is in this + call). Finally the synchronized "finishDocument" is + called to flush changes to the directory. + + When flush is called by IndexWriter, or, we flush + internally when autoCommit=false, we forcefully idle all + threads and flush only once they are all idle. This + means you can call flush with a given thread even while + other threads are actively adding/deleting documents. + + + Exceptions: + + Because this class directly updates in-memory posting + lists, and flushes stored fields and term vectors + directly to files in the directory, there are certain + limited times when an exception can corrupt this state. + For example, a disk full while flushing stored fields + leaves this file in a corrupt state. Or, an OOM + exception while appending to the in-memory posting lists + can corrupt that posting list. We call such exceptions + "aborting exceptions". In these cases we must call + abort() to discard all docs added since the last flush. + + All other exceptions ("non-aborting exceptions") can + still partially update the index structures. These + updates are consistent, but, they represent only a part + of the document seen up until the exception was hit. + When this happens, we immediately mark the document as + deleted so that the document is always atomically ("all + or none") added to the index. + + + + Create and return a new DocWriterBuffer. + + + Returns true if any of the fields in the current + buffered docs have omitTermFreqAndPositions==false + + + + If non-null, various details of indexing are printed + here. + + + + Set how much RAM we can use before flushing. + + + Set max buffered docs, which means we will flush by + doc count instead of by RAM usage. + + + + Get current segment name we are writing. + + + Returns how many docs are currently buffered in RAM. + + + Returns the current doc store segment we are writing + to. This will be the same as segment when autoCommit + * is true. + + + + Returns the doc offset into the shared doc store for + the current buffered docs. + + + + Closes the current open doc stores an returns the doc + store segment name. This returns null if there are * + no buffered documents. + + + + Called if we hit an exception at a bad time (when + updating the index files) and must discard all + currently buffered docs. This resets our state, + discarding any docs added since last flush. + + + + Reset after a flush + + + Flush all pending docs to a new segment + + + Build compound file for the segment we just flushed + + + Set flushPending if it is not already set and returns + whether it was set. This is used by IndexWriter to + trigger a single flush even when multiple threads are + trying to do so. + + + + Returns a free (idle) ThreadState that may be used for + indexing this one document. This call also pauses if a + flush is pending. If delTerm is non-null then we + buffer this deleted term after the thread state has + been acquired. + + + + Returns true if the caller (IndexWriter) should now + flush. + + + + Called whenever a merge has completed and the merged segments had deletions + + + Does the synchronized work to finish/flush the + inverted document. + + + + The IndexingChain must define the method + which returns the DocConsumer that the DocumentsWriter calls to process the + documents. + + + + Consumer returns this on each doc. This holds any + state that must be flushed synchronized "in docID + order". We gather these and flush them in order. + + + + RAMFile buffer for DocWriters. + + + Expert: allocate a new buffer. + Subclasses can allocate differently. + + size of allocated buffer. + + allocated buffer. + + + + Allocate bytes used from shared pool. + + + Recycle the bytes used. + + + This is the base class for an in-memory posting list, + keyed by a Token. maintains a hash + table holding one instance of this per unique Token. + Consumers of TermsHash () must + subclass this class with its own concrete class. + FreqProxTermsWriter.PostingList is a private inner class used + for the freq/prox postings, and + TermVectorsTermsWriter.PostingList is a private inner class + used to hold TermVectors postings. + + + + Remaps docIDs after a merge has completed, where the + merged segments had at least one deletion. This is used + to renumber the buffered deletes in IndexWriter when a + merge of segments with deletions commits. + + + + Filename filter that accept filenames and extensions only created by Lucene. + + + $rcs = ' $Id: Exp $ ' ; + + + + Returns true if this is a file that would be contained + in a CFS file. This function should only be called on + files that pass the above "accept" (ie, are already + known to be a Lucene index file). + + + + Process the document. If there is + something for this document to be done in docID order, + you should encapsulate that as a + DocumentsWriter.DocWriter and return it. + DocumentsWriter then calls finish() on this object + when it's its turn. + + + + + Base class for enumerating all but deleted docs. + +

      NOTE: this class is meant only to be used internally + by Lucene; it's only public so it can be shared across + packages. This means the API is freely subject to + change, and, the class could be removed entirely, in any + Lucene release. Use directly at your own risk! */ +

      +
      + + TermDocs provides an interface for enumerating <document, frequency> + pairs for a term.

      The document portion names each document containing + the term. Documents are indicated by number. The frequency portion gives + the number of times the term occurred in each document.

      The pairs are + ordered by document number. +

      + + +
      + + Sets this to the data for a term. + The enumeration is reset to the start of the data for this term. + + + + Sets this to the data for the current term in a . + This may be optimized in some implementations. + + + + Returns the current document number.

      This is invalid until + is called for the first time. +

      +
      + + Returns the frequency of the term within the current document.

      This + is invalid until is called for the first time. +

      +
      + + Moves to the next pair in the enumeration.

      Returns true iff there is + such a next pair in the enumeration. +

      +
      + + Attempts to read multiple entries from the enumeration, up to length of + docs. Document numbers are stored in docs, and term + frequencies are stored in freqs. The freqs array must be as + long as the docs array. + +

      Returns the number of entries read. Zero is only returned when the + stream has been exhausted. +

      +
      + + Skips entries to the first beyond the current whose document number is + greater than or equal to target.

      Returns true iff there is such + an entry.

      Behaves as if written: + boolean skipTo(int target) { + do { + if (!next()) + return false; + } while (target > doc()); + return true; + } + + Some implementations are considerably more efficient than that. +

      +
      + + Frees associated resources. + + + Expert: This class provides a + for indexing numeric values that can be used by + or . + +

      Note that for simple usage, is + recommended. disables norms and + term freqs, as they are not usually needed during + searching. If you need to change these settings, you + should use this class. + +

      See for capabilities of fields + indexed numerically.

      + +

      Here's an example usage, for an int field: + + + Field field = new Field(name, new NumericTokenStream(precisionStep).setIntValue(value)); + field.setOmitNorms(true); + field.setOmitTermFreqAndPositions(true); + document.add(field); + + +

      For optimal performance, re-use the TokenStream and Field instance + for more than one document: + + + NumericTokenStream stream = new NumericTokenStream(precisionStep); + Field field = new Field(name, stream); + field.setOmitNorms(true); + field.setOmitTermFreqAndPositions(true); + Document document = new Document(); + document.add(field); + + for(all documents) { + stream.setIntValue(value) + writer.addDocument(document); + } + + +

      This stream is not intended to be used in analyzers; + it's more for iterating the different precisions during + indexing a specific numeric value.

      + +

      NOTE: as token streams are only consumed once + the document is added to the index, if you index more + than one numeric field, use a separate NumericTokenStream + instance for each.

      + +

      See for more details on the + precisionStep + parameter as well as how numeric fields work under the hood.

      + +

      NOTE: This API is experimental and + might change in incompatible ways in the next release. + Since 2.9 +

      +
      + + A TokenStream enumerates the sequence of tokens, either from + s of a or from query text. +

      + This is an abstract class. Concrete subclasses are: + + , a TokenStream whose input is a Reader; and + , a TokenStream whose input is another + TokenStream. + + A new TokenStream API has been introduced with Lucene 2.9. This API + has moved from being based to based. While + still exists in 2.9 as a convenience class, the preferred way + to store the information of a is to use s. +

      + TokenStream now extends , which provides + access to all of the token s for the TokenStream. + Note that only one instance per is created and reused + for every token. This approach reduces object creation and allows local + caching of references to the s. See + for further details. +

      + The workflow of the new TokenStream API is as follows: + + Instantiation of TokenStream/s which add/get + attributes to/from the . + The consumer calls . + The consumer retrieves attributes from the stream and stores local + references to all attributes it wants to access + The consumer calls until it returns false and + consumes the attributes after each call. + The consumer calls so that any end-of-stream operations + can be performed. + The consumer calls to release any resource when finished + using the TokenStream + + To make sure that filters and consumers know which attributes are available, + the attributes must be added during instantiation. Filters and consumers are + not required to check for availability of attributes in + . +

      + You can find some example code for the new API in the analysis package level + Javadoc. +

      + Sometimes it is desirable to capture a current state of a TokenStream + , e. g. for buffering purposes (see , + ). For this usecase + and + can be used. +

      +
      + + An AttributeSource contains a list of different s, + and methods to add and get them. There can only be a single instance + of an attribute in the same AttributeSource instance. This is ensured + by passing in the actual type of the Attribute (Class<Attribute>) to + the , which then checks if an instance of + that type is already present. If yes, it returns the instance, otherwise + it creates a new instance and returns it. + + + + An AttributeSource using the default attribute factory . + + + An AttributeSource that uses the same attributes as the supplied one. + + + An AttributeSource using the supplied for creating new instances. + + + returns the used AttributeFactory. + + + Returns a new iterator that iterates the attribute classes + in the same order they were added in. + Signature for Java 1.5: public Iterator<Class<? extends Attribute>> getAttributeClassesIterator() + + Note that this return value is different from Java in that it enumerates over the values + and not the keys + + + + Returns a new iterator that iterates all unique Attribute implementations. + This iterator may contain less entries that , + if one instance implements more than one Attribute interface. + Signature for Java 1.5: public Iterator<AttributeImpl> getAttributeImplsIterator() + + + + a cache that stores all interfaces for known implementation classes for performance (slow reflection) + + + Adds a custom AttributeImpl instance with one or more Attribute interfaces. + + + The caller must pass in a Class<? extends Attribute> value. + This method first checks if an instance of that class is + already in this AttributeSource and returns it. Otherwise a + new instance is created, added to this AttributeSource and returned. + Signature for Java 1.5: public <T extends Attribute> T addAttribute(Class<T>) + + + + Returns true, iff this AttributeSource has any attributes + + + The caller must pass in a Class<? extends Attribute> value. + Returns true, iff this AttributeSource contains the passed-in Attribute. + Signature for Java 1.5: public boolean hasAttribute(Class<? extends Attribute>) + + + + The caller must pass in a Class<? extends Attribute> value. + Returns the instance of the passed in Attribute contained in this AttributeSource + Signature for Java 1.5: public <T extends Attribute> T getAttribute(Class<T>) + + + IllegalArgumentException if this AttributeSource does not contain the + Attribute. It is recommended to always use even in consumers + of TokenStreams, because you cannot know if a specific TokenStream really uses + a specific Attribute. will automatically make the attribute + available. If you want to only use the attribute, if it is available (to optimize + consuming), use . + + + + Resets all Attributes in this AttributeSource by calling + on each Attribute implementation. + + + + Captures the state of all Attributes. The return value can be passed to + to restore the state of this or another AttributeSource. + + + + Restores this state by copying the values of all attribute implementations + that this state contains into the attributes implementations of the targetStream. + The targetStream must contain a corresponding instance for each argument + contained in this state (e.g. it is not possible to restore the state of + an AttributeSource containing a TermAttribute into a AttributeSource using + a Token instance as implementation). + + Note that this method does not affect attributes of the targetStream + that are not contained in this state. In other words, if for example + the targetStream contains an OffsetAttribute, but this state doesn't, then + the value of the OffsetAttribute remains unchanged. It might be desirable to + reset its value to the default, in which case the caller should first + call on the targetStream. + + + + Performs a clone of all instances returned in a new + AttributeSource instance. This method can be used to e.g. create another TokenStream + with exactly the same attributes (using ) + + + + An AttributeFactory creates instances of s. + + + returns an for the supplied interface class. +

      Signature for Java 1.5: public AttributeImpl createAttributeInstance(Class%lt;? extends Attribute> attClass) +

      +
      + + This is the default factory that creates s using the + class name of the supplied interface class by appending Impl to it. + + + + This class holds the state of an AttributeSource. + + + + + + + Remove this when old API is removed! + + + + Remove this when old API is removed! + + + + Remove this when old API is removed! + + + + Remove this when old API is removed! + + + + Remove this when old API is removed! + + + + Remove this when old API is removed! + + + + A TokenStream using the default attribute factory. + + + A TokenStream that uses the same attributes as the supplied one. + + + A TokenStream using the supplied AttributeFactory for creating new instances. + + + Remove this when old API is removed! + + + + Remove this when old API is removed! + + + + For extra performance you can globally enable the new + API using s. There will be a + small, but in most cases negligible performance increase by enabling this, + but it only works if all TokenStreams use the new API and + implement . This setting can only be enabled + globally. +

      + This setting only affects TokenStreams instantiated after this + call. All TokenStreams already created use the other setting. +

      + All core s are compatible with this setting, if you have + your own TokenStreams that are also compatible, you should enable + this. +

      + When enabled, tokenization may throw + s, if the whole tokenizer chain is not compatible eg one of the + TokenStreams does not implement the new TokenStream API. +

      + The default is false, so there is the fallback to the old API + available. + +

      + This setting will no longer be needed in Lucene 3.0 as the old + API will be removed. + +
      + + Returns if only the new API is used. + + + + + This setting will no longer be needed in Lucene 3.0 as + the old API will be removed. + + + + Consumers (i.e., ) use this method to advance the stream to + the next token. Implementing classes must implement this method and update + the appropriate s with the attributes of the next + token. + + The producer must make no assumptions about the attributes after the + method has been returned: the caller may arbitrarily change it. If the + producer needs to preserve the state for subsequent calls, it can use + to create a copy of the current attribute state. + + This method is called for every token of a document, so an efficient + implementation is crucial for good performance. To avoid calls to + and or downcasts, + references to all s that this stream uses should be + retrieved during instantiation. + + To ensure that filters and consumers know which attributes are available, + the attributes must be added during instantiation. Filters and consumers + are not required to check for availability of attributes in + . + + + false for end of stream; true otherwise + + Note that this method will be defined abstract in Lucene + 3.0. + + + + This method is called by the consumer after the last token has been + consumed, after returned false + (using the new TokenStream API). Streams implementing the old API + should upgrade to use this feature. +

      + This method can be used to perform any end-of-stream operations, such as + setting the final offset of a stream. The final offset of a stream might + differ from the offset of the last token eg in case one or more whitespaces + followed after the last token, but a was used. + +

      + IOException +
      + + Returns the next token in the stream, or null at EOS. When possible, the + input Token should be used as the returned Token (this gives fastest + tokenization performance), but this is not required and a new Token may be + returned. Callers may re-use a single Token instance for successive calls + to this method. + + This implicitly defines a "contract" between consumers (callers of this + method) and producers (implementations of this method that are the source + for tokens): + + A consumer must fully consume the previously returned + before calling this method again. + A producer must call before setting the fields in + it and returning it + + Also, the producer must make no assumptions about a after it + has been returned: the caller may arbitrarily change it. If the producer + needs to hold onto the for subsequent calls, it must clone() + it before storing it. Note that a is considered a + consumer. + + + a that may or may not be used to return; + this parameter should never be null (the callee is not required to + check for null before using it, but it is a good idea to assert that + it is not null.) + + next in the stream or null if end-of-stream was hit + + The new and + APIs should be used instead. + + + + Returns the next in the stream, or null at EOS. + + + The returned Token is a "full private copy" (not re-used across + calls to ) but will be slower than calling + or using the new + method with the new API. + + + + Resets this stream to the beginning. This is an optional operation, so + subclasses may or may not implement this method. is not needed for + the standard indexing process. However, if the tokens of a + TokenStream are intended to be consumed more than once, it is + necessary to implement . Note that if your TokenStream + caches tokens and feeds them back again after a reset, it is imperative + that you clone the tokens when you store them away (on the first pass) as + well as when you return them (on future passes after ). + + + + Releases resources associated with this stream. + + + Remove this when old API is removed! + + + + Remove this when old API is removed! + + + + The full precision token gets this token type assigned. + + + The lower precision tokens gets this token type assigned. + + + Creates a token stream for numeric values using the default precisionStep + (4). The stream is not yet initialized, + before using set a value using the various set???Value() methods. + + + + Creates a token stream for numeric values with the specified + precisionStep. The stream is not yet initialized, + before using set a value using the various set???Value() methods. + + + + Expert: Creates a token stream for numeric values with the specified + precisionStep using the given . + The stream is not yet initialized, + before using set a value using the various set???Value() methods. + + + + Expert: Creates a token stream for numeric values with the specified + precisionStep using the given + . + The stream is not yet initialized, + before using set a value using the various set???Value() methods. + + + + Initializes the token stream with the supplied long value. + the value, for which this TokenStream should enumerate tokens. + + this instance, because of this you can use it the following way: + new Field(name, new NumericTokenStream(precisionStep).SetLongValue(value)) + + + + Initializes the token stream with the supplied int value. + the value, for which this TokenStream should enumerate tokens. + + this instance, because of this you can use it the following way: + new Field(name, new NumericTokenStream(precisionStep).SetIntValue(value)) + + + + Initializes the token stream with the supplied double value. + the value, for which this TokenStream should enumerate tokens. + + this instance, because of this you can use it the following way: + new Field(name, new NumericTokenStream(precisionStep).SetDoubleValue(value)) + + + + Initializes the token stream with the supplied float value. + the value, for which this TokenStream should enumerate tokens. + + this instance, because of this you can use it the following way: + new Field(name, new NumericTokenStream(precisionStep).SetFloatValue(value)) + + + + Holds a map of String input to String output, to be used + with . + + + + Records a replacement to be applied to the inputs + stream. Whenever singleMatch occurs in + the input, it will be replaced with + replacement. + + + input String to be replaced + + output String + + + + Replacement for Java 1.5 Character.valueOf() + Move to Character.valueOf() in 3.0 + + + + Returns a Character instance representing the given char value + + + a char value + + a Character representation of the given char value. + + + + Borrowed from Cglib. Allows custom swap so that two arrays can be sorted + at the same time. + + + + Some useful constants. + + + + $Id: Constants.java 828327 2009-10-22 06:47:40Z uschindler $ + + + + + The value of System.getProperty("java.version"). * + + + True iff this is Java version 1.1. + + + True iff this is Java version 1.2. + + + True iff this is Java version 1.3. + + + The value of System.getProperty("os.name"). * + + + True iff running on Linux. + + + True iff running on Windows. + + + True iff running on SunOS. + + + Implements the wildcard search query. Supported wildcards are *, which + matches any character sequence (including the empty one), and ?, + which matches any single character. Note this query can be slow, as it + needs to iterate over many terms. In order to prevent extremely slow WildcardQueries, + a Wildcard term should not start with one of the wildcards * or + ?. + +

      This query uses the + + rewrite method. + +

      + + +
      + + An abstract that matches documents + containing a subset of terms provided by a + enumeration. + +

      This query cannot be used directly; you must subclass + it and define to provide a + that iterates through the terms to be + matched. + +

      NOTE: if is either + or + , you may encounter a + exception during + searching, which happens when the number of terms to be + searched exceeds + . Setting + to + prevents this. + +

      The recommended rewrite method is + : it doesn't spend CPU + computing unhelpful scores, and it tries to pick the most + performant rewrite method given the query. + + Note that produces + MultiTermQueries using + by default. +

      +
      + + A rewrite method that first creates a private Filter, + by visiting each term in sequence and marking all docs + for that term. Matching documents are assigned a + constant score equal to the query's boost. + +

      This method is faster than the BooleanQuery + rewrite methods when the number of matched terms or + matched documents is non-trivial. Also, it will never + hit an errant + exception. + +

      + + +
      + + A rewrite method that first translates each term into + clause in a + BooleanQuery, and keeps the scores as computed by the + query. Note that typically such scores are + meaningless to the user, and require non-trivial CPU + to compute, so it's almost always better to use + instead. + +

      NOTE: This rewrite method will hit + if the number of terms + exceeds . + +

      + + +
      + + Like except + scores are not computed. Instead, each matching + document receives a constant score equal to the + query's boost. + +

      NOTE: This rewrite method will hit + if the number of terms + exceeds . + +

      + + +
      + + Read-only default instance of + , with + set to + + + and + set to + + . + Note that you cannot alter the configuration of this + instance; you'll need to create a private instance + instead. + + + + Constructs a query for terms matching term. + check sub class for possible term access - the Term does not + make sense for all MultiTermQuerys and will be removed. + + + + Constructs a query matching terms that cannot be represented with a single + Term. + + + + Returns the pattern term. + check sub class for possible term access - getTerm does not + make sense for all MultiTermQuerys and will be removed. + + + + Construct the enumeration to be used, expanding the pattern term. + + + Expert: Return the number of unique terms visited during execution of the query. + If there are many of them, you may consider using another query type + or optimize your total term count in index. +

      This method is not thread safe, be sure to only call it when no query is running! + If you re-use the same query instance for another + search, be sure to first reset the term counter + with . +

      On optimized indexes / no MultiReaders, you get the correct number of + unique terms for the whole index. Use this number to compare different queries. + For non-optimized indexes this number can also be achived in + non-constant-score mode. In constant-score mode you get the total number of + terms seeked for all segments / sub-readers. +

      + + +
      + + Expert: Resets the counting of unique terms. + Do this before executing the query/filter. + + + + + + + + + + Sets the rewrite method to be used when executing the + query. You can use one of the four core methods, or + implement your own subclass of . + + + + A rewrite method that tries to pick the best + constant-score rewrite method based on term and + document counts from the query. If both the number of + terms and documents is small enough, then + is used. + Otherwise, is + used. + + + + Abstract class that defines how the query is rewritten. + + + If the number of terms in this query is equal to or + larger than this setting then + is used. + + + + + + + + If the number of documents to be visited in the + postings exceeds this specified percentage of the + maxDoc() for the index, then + is used. + + 0.0 to 100.0 + + + + + + + + Returns the pattern term. + + + Prints a user-readable version of this query. + + + + Represents hits returned by . + + + + Represents hits returned by + and + + + + The total number of hits for the query. + + + + + The top hits for the query. + + + Stores the maximum score value encountered, needed for normalizing. + + + Returns the maximum score value encountered. Note that in case + scores are not tracked, this returns . + + + + Sets the maximum score value encountered. + + + Constructs a TopDocs with a default maxScore=Float.NaN. + + + + + + The fields which were used to sort results by. + + + Creates one of these objects. + Total number of hits for the query. + + The top hits for the query. + + The sort criteria used to find the top hits. + + The maximum score encountered. + + + + A which wraps another scorer and caches the score of the + current document. Successive calls to will return the same + result and will not invoke the wrapped Scorer's score() method, unless the + current document has changed.
      + This class might be useful due to the changes done to the + interface, in which the score is not computed for a document by default, only + if the collector requests it. Some collectors may need to use the score in + several places, however all they have in hand is a object, and + might end up computing the score of a document more than once. +
      +
      + + Creates a new instance by wrapping the given scorer. + + + use instead. + + + + use instead. + + + + use instead. + + + + This class is very similar to + except that it factors + in the value of the payloads located at each of the positions where the + occurs. +

      + In order to take advantage of this, you must override + + which returns 1 by default. +

      + Payload scores are aggregated using a pluggable . + +

      + + +
      + + Matches spans which are near one another. One can specify slop, the + maximum number of intervening unmatched positions, as well as whether + matches are required to be in-order. + + + + Base class for span-based queries. + + + Expert: Returns the matches for this query in an index. Used internally + to search for spans. + + + + Returns the name of the field matched by this query. + + + Returns a collection of all terms matched by this query. + use extractTerms instead + + + + + + Construct a SpanNearQuery. Matches spans matching a span from each + clause, with up to slop total unmatched positions between + them. * When inOrder is true, the spans from each clause + must be * ordered as in clauses. + + + + Return the clauses whose spans are matched. + + + Return the maximum number of intervening unmatched positions permitted. + + + Return true if matches are required to be in-order. + + + Returns a collection of all terms matched by this query. + use extractTerms instead + + + + + + Returns true iff o is equal to this. + + + Expert-only. Public for use by other weight implementations + + + Public for extension only. + + + not needed anymore + + + + use instead. + + + + use instead. + + + + use instead. + + + + By default, uses the to score the payloads, but + can be overridden to do other things. + + + The payloads + + The start position of the span being scored + + The end position of the span being scored + + + + + + + Expert: obtains short field values from the + FieldCache + using getShorts() and makes those values + available as other numeric types, casting as needed. + +

      + WARNING: The status of the Search.Function package is experimental. + The APIs introduced here might change in the future and will not be + supported anymore in such a case. + +

      + for requirements + on the field. + +

      NOTE: with the switch in 2.9 to segment-based + searching, if is invoked with a + composite (multi-segment) reader, this can easily cause + double RAM usage for the values in the FieldCache. It's + best to switch your application to pass only atomic + (single segment) readers to this API. Alternatively, for + a short-term fix, you could wrap your ValueSource using + , which costs more CPU per lookup + but will not consume double the FieldCache RAM.

      + + + +

      Expert: A base class for ValueSource implementations that retrieve values for + a single field from the FieldCache. +

      + Fields used herein nust be indexed (doesn't matter if these fields are stored or not). +

      + It is assumed that each such indexed field is untokenized, or at least has a single token in a document. + For documents with multiple tokens of the same field, behavior is undefined (It is likely that current + code would use the value of one of these tokens, but this is not guaranteed). +

      + Document with no tokens in this field are assigned the Zero value. + +

      + WARNING: The status of the Search.Function package is experimental. + The APIs introduced here might change in the future and will not be + supported anymore in such a case. + +

      NOTE: with the switch in 2.9 to segment-based + searching, if is invoked with a + composite (multi-segment) reader, this can easily cause + double RAM usage for the values in the FieldCache. It's + best to switch your application to pass only atomic + (single segment) readers to this API. Alternatively, for + a short-term fix, you could wrap your ValueSource using + , which costs more CPU per lookup + but will not consume double the FieldCache RAM.

      +

      +
      + + Expert: source of values for basic function queries. +

      At its default/simplest form, values - one per doc - are used as the score of that doc. +

      Values are instantiated as + DocValues for a particular reader. +

      ValueSource implementations differ in RAM requirements: it would always be a factor + of the number of documents, but for each document the number of bytes can be 1, 2, 4, or 8. + +

      + WARNING: The status of the Search.Function package is experimental. + The APIs introduced here might change in the future and will not be + supported anymore in such a case. + + +

      +
      + + Return the DocValues used by the function query. + the IndexReader used to read these values. + If any caching is involved, that caching would also be IndexReader based. + + IOException for any error. + + + description of field, used in explain() + + + Needed for possible caching of query results - used by . + + + + + Needed for possible caching of query results - used by . + + + + + Create a cached field source for the input field. + + + Return cached DocValues for input field and reader. + FieldCache so that values of a field are loaded once per reader (RAM allowing) + + Field for which values are required. + + + + + + Check if equals to another , already knowing that cache and field are equal. + + + + + Return a hash code of a , without the hash-codes of the field + and the cache (those are taken care of elsewhere). + + + + + + Create a cached short field source with default string-to-short parser. + + + Create a cached short field source with a specific string-to-short parser. + + + Expert: represents field values as different types. + Normally created via a + ValueSuorce + for a particular field and reader. + +

      + WARNING: The status of the Search.Function package is experimental. + The APIs introduced here might change in the future and will not be + supported anymore in such a case. + + +

      +
      + + Return doc value as a float. +

      Mandatory: every DocValues implementation must implement at least this method. +

      + document whose float value is requested. + +
      + + Return doc value as an int. +

      Optional: DocValues implementation can (but don't have to) override this method. +

      + document whose int value is requested. + +
      + + Return doc value as a long. +

      Optional: DocValues implementation can (but don't have to) override this method. +

      + document whose long value is requested. + +
      + + Return doc value as a double. +

      Optional: DocValues implementation can (but don't have to) override this method. +

      + document whose double value is requested. + +
      + + Return doc value as a string. +

      Optional: DocValues implementation can (but don't have to) override this method. +

      + document whose string value is requested. + +
      + + Return a string representation of a doc value, as reuired for Explanations. + + + Explain the scoring value for the input doc. + + + Expert: for test purposes only, return the inner array of values, or null if not applicable. +

      + Allows tests to verify that loaded values are: + + indeed cached/reused. + stored in the expected size/type (byte/short/int/float). + + Note: implementations of DocValues must override this method for + these test elements to be tested, Otherwise the test would not fail, just + print a warning. +

      +
      + + Returns the minimum of all values or Float.NaN if this + DocValues instance does not contain any value. +

      + This operation is optional +

      + +

      + the minimum of all values or Float.NaN if this + DocValues instance does not contain any value. + +
      + + Returns the maximum of all values or Float.NaN if this + DocValues instance does not contain any value. +

      + This operation is optional +

      + +

      + the maximum of all values or Float.NaN if this + DocValues instance does not contain any value. + +
      + + Returns the average of all values or Float.NaN if this + DocValues instance does not contain any value. * +

      + This operation is optional +

      + +

      + the average of all values or Float.NaN if this + DocValues instance does not contain any value + +
      + + This class wraps another ValueSource, but protects + against accidental double RAM usage in FieldCache when + a composite reader is passed to . + +

      NOTE: this class adds a CPU penalty to every + lookup, as it must resolve the incoming document to the + right sub-reader using a binary search.

      + +

      + This class is temporary, to ease the + migration to segment-based searching. Please change your + code to not pass composite readers to these APIs. + +
      + + Provides a for custom field sorting. + + NOTE: This API is experimental and might change in + incompatible ways in the next release. + + + + + Creates a comparator for the field in the given index. + + + Name of the field to create comparator for. + + FieldComparator. + + IOException + If an error occurs reading the index. + + + + A that only accepts documents whose single + term value in the specified field is contained in the + provided set of allowed terms. + +

      + + This is the same functionality as TermsFilter (from + contrib/queries), except this filter requires that the + field contains only a single term for all documents. + Because of drastically different implementations, they + also have different performance characteristics, as + described below. + +

      + + The first invocation of this filter on a given field will + be slower, since a must be + created. Subsequent invocations using the same field + will re-use this cache. However, as with all + functionality based on , persistent RAM + is consumed to hold the cache, and is not freed until the + is closed. In contrast, TermsFilter + has no persistent RAM consumption. + + +

      + + With each search, this filter translates the specified + set of Terms into a private keyed by + term number per unique (normally one + reader per segment). Then, during matching, the term + number for each docID is retrieved from the cache and + then checked for inclusion using the . + Since all testing is done using RAM resident data + structures, performance should be very fast, most likely + fast enough to not require further caching of the + DocIdSet for each possible combination of terms. + However, because docIDs are simply scanned linearly, an + index with a great many small documents may find this + linear scan too costly. + +

      + + In contrast, TermsFilter builds up an , + keyed by docID, every time it's created, by enumerating + through all matching docs using to seek + and scan through each term's docID list. While there is + no linear scan of all docIDs, besides the allocation of + the underlying array in the , this + approach requires a number of "disk seeks" in proportion + to the number of terms, which can be exceptionally costly + when there are cache misses in the OS's IO cache. + +

      + + Generally, this filter will be slower on the first + invocation for a given field, but subsequent invocations, + even if you change the allowed set of Terms, should be + faster than TermsFilter, especially as the number of + Terms being matched increases. If you are matching only + a very small number of terms, and those terms in turn + match a very small number of documents, TermsFilter may + perform faster. + +

      + + Which filter is best is very application dependent. +

      +
      + + Abstract base class for restricting which documents may be returned during searching. +

      + Note: In Lucene 3.0 will be removed + and will be defined as abstract. + All implementing classes must therefore implement + in order to work with Lucene 3.0. +

      +
      + + NOTE: See for + handling of multi-segment indexes (which applies to + this method as well. + + A BitSet with true for documents which should be permitted in + search results, and false for those that should not. + + Use instead. + + + + + Creates a enumerating the documents that should be + permitted in search results. NOTE: null can be + returned if no documents are accepted by this Filter. +

      + Note: This method will be called once per segment in + the index during searching. The returned + must refer to document IDs for that segment, not for + the top-level reader. +

      + a DocIdSet that provides the documents which should be permitted or + prohibited in search results. NOTE: null can be returned if + no documents will be accepted by this Filter. + + + A instance opened on the index currently + searched on. Note, it is likely that the provided reader does not + represent the whole underlying index i.e. if the index has more than + one segment the given reader only represents a single segment. + + + +
      + + This DocIdSet implementation is cacheable. + + + use instead. + + + + use instead. + + + + use instead. + + + + Wraps another SpanFilter's result and caches it. The purpose is to allow + filters to simply filter, and then wrap with this class to add caching. + + + + Abstract base class providing a mechanism to restrict searches to a subset + of an index and also maintains and returns position information. + This is useful if you want to compare the positions from a SpanQuery with the positions of items in + a filter. For instance, if you had a SpanFilter that marked all the occurrences of the word "foo" in documents, + and then you entered a new SpanQuery containing bar, you could not only filter by the word foo, but you could + then compare position information for post processing. + + + + Returns a SpanFilterResult with true for documents which should be permitted in + search results, and false for those that should not and Spans for where the true docs match. + + The to load position and DocIdSet information from + + A + + java.io.IOException if there was an issue accessing the necessary information + + + + + A transient Filter cache. + + + + New deletions always result in a cache miss, by default + (. + Filter to cache results of + + + + + New deletions always result in a cache miss, specify the + Filter to cache results of + See + + + Use instead. + + + + Wraps another filter's result and caches it. The purpose is to allow + filters to simply filter, and then wrap with this class to add caching. + + + + + New deletes are ignored by default, which gives higher + cache hit rate on reopened readers. Most of the time + this is safe, because the filter will be AND'd with a + Query that fully enforces deletions. If instead you + need this filter to always enforce deletions, pass + either or + . + + Filter to cache results of + + + + + Expert: by default, the cached filter will be shared + across reopened segments that only had changes to their + deletions. + + Filter to cache results of + See + + + + Use instead. + + + + Provide the DocIdSet to be cached, using the DocIdSet provided + by the wrapped Filter. + This implementation returns the given DocIdSet. + + + + + Expert: Specifies how new deletions against a reopened + reader should be handled. + + The default is IGNORE, which means the cache entry + will be re-used for a given segment, even when that + segment has been reopened due to changes in deletions. + This is a big performance gain, especially with + near-real-timer readers, since you don't hit a cache + miss on every reopened reader for prior segments. + + However, in some cases this can cause invalid query + results, allowing deleted documents to be returned. + This only happens if the main query does not rule out + deleted documents on its own, such as a toplevel + ConstantScoreQuery. To fix this, use RECACHE to + re-create the cached filter (at a higher per-reopen + cost, but at faster subsequent search performance), or + use DYNAMIC to dynamically intersect deleted docs (fast + reopen time but some hit to search performance). + + + + A serializable Enum class. + + + Resolves the deserialized instance to the local reference for accurate + equals() and == comparisons. + + + a reference to Parameter as resolved in the local VM + + ObjectStreamException + + + A transient Filter cache (package private because of test) + + + Abstract decorator class for a DocIdSet implementation + that provides on-demand filtering/validation + mechanism on a given DocIdSet. + +

      + + Technically, this same functionality could be achieved + with ChainedFilter (under contrib/misc), however the + benefit of this class is it never materializes the full + bitset for the filter. Instead, the + method is invoked on-demand, per docID visited during + searching. If you know few docIDs will be visited, and + the logic behind is relatively costly, + this may be a better way to filter than ChainedFilter. + +

      + + +
      + + Constructor. + Underlying DocIdSet + + + + This DocIdSet implementation is cacheable if the inner set is cacheable. + + + Validation method to determine whether a docid should be in the result set. + docid to be tested + + true if input docid should be in the result set, false otherwise. + + + + Implementation of the contract to build a DocIdSetIterator. + + + + + + + Abstract decorator class of a DocIdSetIterator + implementation that provides on-demand filter/validation + mechanism on an underlying DocIdSetIterator. See + . + + + + Constructor. + Underlying DocIdSetIterator. + + + + Validation method to determine whether a docid should be in the result set. + docid to be tested + + true if input docid should be in the result set, false otherwise. + + + + + + use instead. + + + + use instead. + + + + use instead. + + + + An IndexWriter creates and maintains an index. +

      The create argument to the + constructor determines + whether a new index is created, or whether an existing index is + opened. Note that you can open an index with create=true + even while readers are using the index. The old readers will + continue to search the "point in time" snapshot they had opened, + and won't see the newly created index until they re-open. There are + also constructors + with no create argument which will create a new index + if there is not already an index at the provided path and otherwise + open the existing index.

      +

      In either case, documents are added with + and removed with or + . A document can be updated with + (which just deletes + and then adds the entire document). When finished adding, deleting + and updating documents, should be called.

      + +

      These changes are buffered in memory and periodically + flushed to the (during the above method + calls). A flush is triggered when there are enough + buffered deletes (see ) + or enough added documents since the last flush, whichever + is sooner. For the added documents, flushing is triggered + either by RAM usage of the documents (see + ) or the number of added documents. + The default is to flush when RAM usage hits 16 MB. For + best indexing speed you should flush by RAM usage with a + large RAM buffer. Note that flushing just moves the + internal buffered state in IndexWriter into the index, but + these changes are not visible to IndexReader until either + or is called. A flush may + also trigger one or more segment merges which by default + run with a background thread so as not to block the + addDocument calls (see below + for changing the ).

      + +

      The optional autoCommit argument to the + constructors + controls visibility of the changes to + instances reading the same index. When this is + false, changes are not visible until + or is called. Note that changes will still be + flushed to the as new files, but are + not committed (no new segments_N file is written + referencing the new files, nor are the files sync'd to stable storage) + until or is called. If something + goes terribly wrong (for example the JVM crashes), then + the index will reflect none of the changes made since the + last commit, or the starting state if commit was not called. + You can also call , which closes the writer + without committing any changes, and removes any index + files that had been flushed but are now unreferenced. + This mode is useful for preventing readers from refreshing + at a bad time (for example after you've done all your + deletes but before you've done your adds). It can also be + used to implement simple single-writer transactional + semantics ("all or none"). You can do a two-phase commit + by calling + followed by . This is necessary when + Lucene is working with an external resource (for example, + a database) and both must either commit or rollback the + transaction.

      +

      When autoCommit is true then + the writer will periodically commit on its own. [Deprecated: Note that in 3.0, IndexWriter will + no longer accept autoCommit=true (it will be hardwired to + false). You can always call yourself + when needed]. There is + no guarantee when exactly an auto commit will occur (it + used to be after every flush, but it is now after every + completed merge, as of 2.4). If you want to force a + commit, call , or, close the writer. Once + a commit has finished, newly opened instances will + see the changes to the index as of that commit. When + running in this mode, be careful not to refresh your + readers while optimize or segment merges are taking place + as this can tie up substantial disk space.

      +

      +

      Regardless of autoCommit, an + or will only see the + index as of the "point in time" that it was opened. Any + changes committed to the index after the reader was opened + are not visible until the reader is re-opened.

      +

      If an index will not have more documents added for a while and optimal search + performance is desired, then either the full + method or partial method should be + called before the index is closed.

      +

      Opening an IndexWriter creates a lock file for the directory in use. Trying to open + another IndexWriter on the same directory will lead to a + . The + is also thrown if an IndexReader on the same directory is used to delete documents + from the index.

      +

      + +

      Expert: IndexWriter allows an optional + implementation to be + specified. You can use this to control when prior commits + are deleted from the index. The default policy is + which removes all prior + commits as soon as a new commit is done (this matches + behavior before 2.2). Creating your own policy can allow + you to explicitly keep previous "point in time" commits + alive in the index for some time, to allow readers to + refresh to the new commit without having the old commit + deleted out from under them. This is necessary on + filesystems like NFS that do not support "delete on last + close" semantics, which Lucene's "point in time" search + normally relies on.

      +

      Expert: + IndexWriter allows you to separately change + the and the . + The is invoked whenever there are + changes to the segments in the index. Its role is to + select which merges to do, if any, and return a + describing the merges. It + also selects merges to do for optimize(). (The default is + . Then, the + is invoked with the requested merges and + it decides when and how to run the merges. The default is + .

      +

      NOTE: if you hit an + OutOfMemoryError then IndexWriter will quietly record this + fact and block all future segment commits. This is a + defensive measure in case any internal state (buffered + documents and deletions) were corrupted. Any subsequent + calls to will throw an + IllegalStateException. The only course of action is to + call , which internally will call + , to undo any changes to the index since the + last commit. If you opened the writer with autoCommit + false you can also just call + directly.

      +

      NOTE: + instances are completely thread + safe, meaning multiple threads can call any of its + methods, concurrently. If your application requires + external synchronization, you should not + synchronize on the IndexWriter instance as + this may cause deadlock; use your own (non-Lucene) objects + instead.

      +

      +
      + + Name of the write lock in the index. + + + Value to denote a flush trigger is disabled + + + Default value is 16 MB (which means flush when buffered + docs consume 16 MB RAM). Change using . + + + + Default value is 10,000. Change using . + + + Default value is 128. Change using . + + + Default value for the write lock timeout (1,000). + + + + + + + + + + + Disabled by default (because IndexWriter flushes by RAM usage + by default). Change using . + + + + Disabled by default (because IndexWriter flushes by RAM usage + by default). Change using . + + + + + + + + + + Absolute hard maximum length for a term. If a term + arrives from the analyzer longer than this length, it + is skipped and a message is printed to infoStream, if + set (see ). + + + + Default for . On + Windows this defaults to 10.0 seconds; elsewhere it's + 0. + + + + Expert: returns a readonly reader, covering all committed as well as + un-committed changes to the index. This provides "near real-time" + searching, in that changes made during an IndexWriter session can be + quickly made available for searching without closing the writer nor + calling . + +

      + Note that this is functionally equivalent to calling {#commit} and then + using to open a new reader. But the turarnound + time of this method should be faster since it avoids the potentially + costly . +

      + + You must close the returned by this method once you are done using it. + +

      + It's near real-time because there is no hard + guarantee on how quickly you can get a new reader after + making changes with IndexWriter. You'll have to + experiment in your situation to determine if it's + faster enough. As this is a new and experimental + feature, please report back on your findings so we can + learn, improve and iterate.

      + +

      The resulting reader suppports + , but that call will simply forward + back to this method (though this may change in the + future).

      + +

      The very first time this method is called, this + writer instance will make every effort to pool the + readers that it opens for doing merges, applying + deletes, etc. This means additional resources (RAM, + file descriptors, CPU time) will be consumed.

      + +

      For lower latency on reopening a reader, you should call + to call to + pre-warm a newly merged segment before it's committed + to the index. This is important for minimizing index-to-search + delay after a large merge. + +

      If an addIndexes* call is running in another thread, + then this reader will only search those segments from + the foreign index that have been successfully copied + over, so far

      . + +

      NOTE: Once the writer is closed, any + outstanding readers may continue to be used. However, + if you attempt to reopen any of those readers, you'll + hit an .

      + +

      NOTE: This API is experimental and might + change in incompatible ways in the next release.

      + +

      + IndexReader that covers entire index plus all + changes made so far by this IndexWriter instance + + + IOException +
      + + Expert: like , except you can + specify which termInfosIndexDivisor should be used for + any newly opened readers. + + Subsambles which indexed + terms are loaded into RAM. This has the same effect as + except that setting + must be done at indexing time while this setting can be + set per reader. When set to N, then one in every + N*termIndexInterval terms in the index is loaded into + memory. By setting this to a value > 1 you can reduce + memory usage, at the expense of higher latency when + loading a TermInfo. The default value is 1. Set this + to -1 to skip loading the terms index entirely. + + + + Obtain the number of deleted docs for a pooled reader. + If the reader isn't being pooled, the segmentInfo's + delCount is returned. + + + + Used internally to throw an + if this IndexWriter has been + closed. + + AlreadyClosedException if this IndexWriter is + + + Prints a message to the infoStream (if non-null), + prefixed with the identifying information for this + writer and the thread that's calling it. + + + + Casts current mergePolicy to LogMergePolicy, and throws + an exception if the mergePolicy is not a LogMergePolicy. + + + +

      Get the current setting of whether newly flushed + segments will use the compound file format. Note that + this just returns the value previously set with + setUseCompoundFile(boolean), or the default value + (true). You cannot use this to query the status of + previously flushed segments.

      + +

      Note that this method is a convenience method: it + just calls mergePolicy.getUseCompoundFile as long as + mergePolicy is an instance of . + Otherwise an IllegalArgumentException is thrown.

      + +

      + + +
      + +

      Setting to turn on usage of a compound file. When on, + multiple files for each segment are merged into a + single file when a new segment is flushed.

      + +

      Note that this method is a convenience method: it + just calls mergePolicy.setUseCompoundFile as long as + mergePolicy is an instance of . + Otherwise an IllegalArgumentException is thrown.

      +

      +
      + + Expert: Set the Similarity implementation used by this IndexWriter. + + + + + + + Expert: Return the Similarity implementation used by this IndexWriter. + +

      This defaults to the current value of . +

      +
      + + Expert: Set the interval between indexed terms. Large values cause less + memory to be used by IndexReader, but slow random-access to terms. Small + values cause more memory to be used by an IndexReader, and speed + random-access to terms. + + This parameter determines the amount of computation required per query + term, regardless of the number of documents that contain that term. In + particular, it is the maximum number of other terms that must be + scanned before a term is located and its frequency and position information + may be processed. In a large index with user-entered query terms, query + processing time is likely to be dominated not by term lookup but rather + by the processing of frequency and positional data. In a small index + or when many uncommon query terms are generated (e.g., by wildcard + queries) term lookup may become a dominant cost. + + In particular, numUniqueTerms/interval terms are read into + memory by an IndexReader, and, on average, interval/2 terms + must be scanned for each random term access. + + + + + + + Expert: Return the interval between indexed terms. + + + + + + + Constructs an IndexWriter for the index in path. + Text will be analyzed with a. If create + is true, then a new, empty index will be created in + path, replacing the index already there, + if any. + +

      NOTE: autoCommit (see above) is set to false with this + constructor. + +

      + the path to the index directory + + the analyzer to use + + true to create the index or overwrite + the existing one; false to append to the existing + index + + Maximum field length in number of tokens/terms: LIMITED, UNLIMITED, or user-specified + via the MaxFieldLength constructor. + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if the directory cannot be read/written to, or + if it does not exist and create is + false or if there is any other low-level + IO error + + Use + +
      + + Constructs an IndexWriter for the index in path. + Text will be analyzed with a. If create + is true, then a new, empty index will be created in + path, replacing the index already there, if any. + + + the path to the index directory + + the analyzer to use + + true to create the index or overwrite + the existing one; false to append to the existing + index + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if the directory cannot be read/written to, or + if it does not exist and create is + false or if there is any other low-level + IO error + + This constructor will be removed in the 3.0 release. + Use + + instead, and call when needed. + + + + Constructs an IndexWriter for the index in path. + Text will be analyzed with a. If create + is true, then a new, empty index will be created in + path, replacing the index already there, if any. + +

      NOTE: autoCommit (see above) is set to false with this + constructor. + +

      + the path to the index directory + + the analyzer to use + + true to create the index or overwrite + the existing one; false to append to the existing + index + + Maximum field length in number of terms/tokens: LIMITED, UNLIMITED, or user-specified + via the MaxFieldLength constructor. + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if the directory cannot be read/written to, or + if it does not exist and create is + false or if there is any other low-level + IO error + + Use + +
      + + Constructs an IndexWriter for the index in path. + Text will be analyzed with a. If create + is true, then a new, empty index will be created in + path, replacing the index already there, if any. + + + the path to the index directory + + the analyzer to use + + true to create the index or overwrite + the existing one; false to append to the existing + index + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if the directory cannot be read/written to, or + if it does not exist and create is + false or if there is any other low-level + IO error + + This constructor will be removed in the 3.0 release. + Use + + instead, and call when needed. + + + + Constructs an IndexWriter for the index in d. + Text will be analyzed with a. If create + is true, then a new, empty index will be created in + d, replacing the index already there, if any. + +

      NOTE: autoCommit (see above) is set to false with this + constructor. + +

      + the index directory + + the analyzer to use + + true to create the index or overwrite + the existing one; false to append to the existing + index + + Maximum field length in number of terms/tokens: LIMITED, UNLIMITED, or user-specified + via the MaxFieldLength constructor. + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if the directory cannot be read/written to, or + if it does not exist and create is + false or if there is any other low-level + IO error + +
      + + Constructs an IndexWriter for the index in d. + Text will be analyzed with a. If create + is true, then a new, empty index will be created in + d, replacing the index already there, if any. + + + the index directory + + the analyzer to use + + true to create the index or overwrite + the existing one; false to append to the existing + index + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if the directory cannot be read/written to, or + if it does not exist and create is + false or if there is any other low-level + IO error + + This constructor will be removed in the 3.0 + release, and call when needed. + Use instead. + + + + Constructs an IndexWriter for the index in + path, first creating it if it does not + already exist. Text will be analyzed with + a. + +

      NOTE: autoCommit (see above) is set to false with this + constructor. + +

      + the path to the index directory + + the analyzer to use + + Maximum field length in number of terms/tokens: LIMITED, UNLIMITED, or user-specified + via the MaxFieldLength constructor. + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if the directory cannot be + read/written to or if there is any other low-level + IO error + + Use + +
      + + Constructs an IndexWriter for the index in + path, first creating it if it does not + already exist. Text will be analyzed with + a. + + + the path to the index directory + + the analyzer to use + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if the directory cannot be + read/written to or if there is any other low-level + IO error + + This constructor will be removed in the 3.0 + release, and call when needed. + Use instead. + + + + Constructs an IndexWriter for the index in + path, first creating it if it does not + already exist. Text will be analyzed with + a. + +

      NOTE: autoCommit (see above) is set to false with this + constructor. + +

      + the path to the index directory + + the analyzer to use + + Maximum field length in number of terms/tokens: LIMITED, UNLIMITED, or user-specified + via the MaxFieldLength constructor. + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if the directory cannot be + read/written to or if there is any other low-level + IO error + + Use + +
      + + Constructs an IndexWriter for the index in + path, first creating it if it does not + already exist. Text will be analyzed with + a. + + + the path to the index directory + + the analyzer to use + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if the directory cannot be + read/written to or if there is any other low-level + IO error + + This constructor will be removed in the 3.0 release. + Use + instead, and call when needed. + + + + Constructs an IndexWriter for the index in + d, first creating it if it does not + already exist. Text will be analyzed with + a. + +

      NOTE: autoCommit (see above) is set to false with this + constructor. + +

      + the index directory + + the analyzer to use + + Maximum field length in number of terms/tokens: LIMITED, UNLIMITED, or user-specified + via the MaxFieldLength constructor. + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if the directory cannot be + read/written to or if there is any other low-level + IO error + +
      + + Constructs an IndexWriter for the index in + d, first creating it if it does not + already exist. Text will be analyzed with + a. + + + the index directory + + the analyzer to use + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if the directory cannot be + read/written to or if there is any other low-level + IO error + + This constructor will be removed in the 3.0 release. + Use + + instead, and call when needed. + + + + Constructs an IndexWriter for the index in + d, first creating it if it does not + already exist. Text will be analyzed with + a. + + + the index directory + + see above + + the analyzer to use + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if the directory cannot be + read/written to or if there is any other low-level + IO error + + This constructor will be removed in the 3.0 release. + Use + + instead, and call when needed. + + + + Constructs an IndexWriter for the index in d. + Text will be analyzed with a. If create + is true, then a new, empty index will be created in + d, replacing the index already there, if any. + + + the index directory + + see above + + the analyzer to use + + true to create the index or overwrite + the existing one; false to append to the existing + index + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if the directory cannot be read/written to, or + if it does not exist and create is + false or if there is any other low-level + IO error + + This constructor will be removed in the 3.0 release. + Use + + instead, and call when needed. + + + + Expert: constructs an IndexWriter with a custom + , for the index in d, + first creating it if it does not already exist. Text + will be analyzed with a. + +

      NOTE: autoCommit (see above) is set to false with this + constructor. + +

      + the index directory + + the analyzer to use + + see above + + whether or not to limit field lengths + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if the directory cannot be + read/written to or if there is any other low-level + IO error + +
      + + Expert: constructs an IndexWriter with a custom + , for the index in d, + first creating it if it does not already exist. Text + will be analyzed with a. + + + the index directory + + see above + + the analyzer to use + + see above + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if the directory cannot be + read/written to or if there is any other low-level + IO error + + This constructor will be removed in the 3.0 release. + Use + + instead, and call when needed. + + + + Expert: constructs an IndexWriter with a custom + , for the index in d. + Text will be analyzed with a. If + create is true, then a new, empty index + will be created in d, replacing the index + already there, if any. + +

      NOTE: autoCommit (see above) is set to false with this + constructor. + +

      + the index directory + + the analyzer to use + + true to create the index or overwrite + the existing one; false to append to the existing + index + + see above + + , whether or not to limit field lengths. Value is in number of terms/tokens + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if the directory cannot be read/written to, or + if it does not exist and create is + false or if there is any other low-level + IO error + +
      + + Expert: constructs an IndexWriter with a custom + and , + for the index in d. + Text will be analyzed with a. If + create is true, then a new, empty index + will be created in d, replacing the index + already there, if any. + +

      NOTE: autoCommit (see above) is set to false with this + constructor. + +

      + the index directory + + the analyzer to use + + true to create the index or overwrite + the existing one; false to append to the existing + index + + see above + + whether or not to limit field lengths, value is in number of terms/tokens. See . + + the chain to be used to + process documents + + which commit to open + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if the directory cannot be read/written to, or + if it does not exist and create is + false or if there is any other low-level + IO error + +
      + + Expert: constructs an IndexWriter with a custom + , for the index in d. + Text will be analyzed with a. If + create is true, then a new, empty index + will be created in d, replacing the index + already there, if any. + + + the index directory + + see above + + the analyzer to use + + true to create the index or overwrite + the existing one; false to append to the existing + index + + see above + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if the directory cannot be read/written to, or + if it does not exist and create is + false or if there is any other low-level + IO error + + This constructor will be removed in the 3.0 release. + Use + + instead, and call when needed. + + + + Expert: constructs an IndexWriter on specific commit + point, with a custom , for + the index in d. Text will be analyzed + with a. + +

      This is only meaningful if you've used a + in that past that keeps more than + just the last commit. + +

      This operation is similar to , + except that method can only rollback what's been done + with the current instance of IndexWriter since its last + commit, whereas this method can rollback to an + arbitrary commit point from the past, assuming the + has preserved past + commits. + +

      NOTE: autoCommit (see above) is set to false with this + constructor. + +

      + the index directory + + the analyzer to use + + see above + + whether or not to limit field lengths, value is in number of terms/tokens. See . + + which commit to open + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if the directory cannot be read/written to, or + if it does not exist and create is + false or if there is any other low-level + IO error + +
      + + Expert: set the merge policy used by this writer. + + + Expert: returns the current MergePolicy in use by this writer. + + + + + Expert: set the merge scheduler used by this writer. + + + Expert: returns the current MergePolicy in use by this + writer. + + + + + +

      Determines the largest segment (measured by + document count) that may be merged with other segments. + Small values (e.g., less than 10,000) are best for + interactive indexing, as this limits the length of + pauses while indexing to a few seconds. Larger values + are best for batched indexing and speedier + searches.

      + +

      The default value is .

      + +

      Note that this method is a convenience method: it + just calls mergePolicy.setMaxMergeDocs as long as + mergePolicy is an instance of . + Otherwise an IllegalArgumentException is thrown.

      + +

      The default merge policy () + also allows you to set this + limit by net size (in MB) of the segment, using + .

      +

      +
      + +

      Returns the largest segment (measured by document + count) that may be merged with other segments.

      + +

      Note that this method is a convenience method: it + just calls mergePolicy.getMaxMergeDocs as long as + mergePolicy is an instance of . + Otherwise an IllegalArgumentException is thrown.

      + +

      + + +
      + + The maximum number of terms that will be indexed for a single field in a + document. This limits the amount of memory required for indexing, so that + collections with very large files will not crash the indexing process by + running out of memory. This setting refers to the number of running terms, + not to the number of different terms.

      + Note: this silently truncates large documents, excluding from the + index all terms that occur further in the document. If you know your source + documents are large, be sure to set this value high enough to accomodate + the expected size. If you set it to Integer.MAX_VALUE, then the only limit + is your memory, but you should anticipate an OutOfMemoryError.

      + By default, no more than terms + will be indexed for a field. +

      +
      + + Returns the maximum number of terms that will be + indexed for a single field in a document. + + + + + + Sets the termsIndexDivisor passed to any readers that + IndexWriter opens, for example when applying deletes + or creating a near-real-time reader in + . Default value is + . + + + + + + + + Determines the minimal number of documents required + before the buffered in-memory documents are flushed as + a new Segment. Large values generally gives faster + indexing. + +

      When this is set, the writer will flush every + maxBufferedDocs added documents. Pass in + to prevent triggering a flush due + to number of buffered documents. Note that if flushing + by RAM usage is also enabled, then the flush will be + triggered by whichever comes first.

      + +

      Disabled by default (writer flushes by RAM usage).

      + +

      + IllegalArgumentException if maxBufferedDocs is + enabled but smaller than 2, or it disables maxBufferedDocs + when ramBufferSize is already disabled + + + +
      + + If we are flushing by doc count (not by RAM usage), and + using LogDocMergePolicy then push maxBufferedDocs down + as its minMergeDocs, to keep backwards compatibility. + + + + Returns the number of buffered added documents that will + trigger a flush if enabled. + + + + + + Determines the amount of RAM that may be used for + buffering added documents and deletions before they are + flushed to the Directory. Generally for faster + indexing performance it's best to flush by RAM usage + instead of document count and use as large a RAM buffer + as you can. + +

      When this is set, the writer will flush whenever + buffered documents and deletions use this much RAM. + Pass in to prevent + triggering a flush due to RAM usage. Note that if + flushing by document count is also enabled, then the + flush will be triggered by whichever comes first.

      + +

      NOTE: the account of RAM usage for pending + deletions is only approximate. Specifically, if you + delete by Query, Lucene currently has no way to measure + the RAM usage if individual Queries so the accounting + will under-estimate and you should compensate by either + calling commit() periodically yourself, or by using + to flush by count + instead of RAM usage (each buffered delete Query counts + as one). + +

      + NOTE: because IndexWriter uses ints when managing its + internal storage, the absolute maximum value for this setting is somewhat + less than 2048 MB. The precise limit depends on various factors, such as + how large your documents are, how many fields have norms, etc., so it's + best to set this value comfortably under 2048. +

      + +

      The default value is .

      + +

      + IllegalArgumentException if ramBufferSize is + enabled but non-positive, or it disables ramBufferSize + when maxBufferedDocs is already disabled + +
      + + Returns the value set by if enabled. + + +

      Determines the minimal number of delete terms required before the buffered + in-memory delete terms are applied and flushed. If there are documents + buffered in memory at the time, they are merged and a new segment is + created.

      +

      Disabled by default (writer flushes by RAM usage).

      + +

      + IllegalArgumentException if maxBufferedDeleteTerms + is enabled but smaller than 1 + + + +
      + + Returns the number of buffered deleted terms that will + trigger a flush if enabled. + + + + + + Determines how often segment indices are merged by addDocument(). With + smaller values, less RAM is used while indexing, and searches on + unoptimized indices are faster, but indexing speed is slower. With larger + values, more RAM is used during indexing, and while searches on unoptimized + indices are slower, indexing is faster. Thus larger values (> 10) are best + for batch index creation, and smaller values (< 10) for indices that are + interactively maintained. + +

      Note that this method is a convenience method: it + just calls mergePolicy.setMergeFactor as long as + mergePolicy is an instance of . + Otherwise an IllegalArgumentException is thrown.

      + +

      This must never be less than 2. The default value is 10. +

      +
      + +

      Returns the number of segments that are merged at + once and also controls the total number of segments + allowed to accumulate in the index.

      + +

      Note that this method is a convenience method: it + just calls mergePolicy.getMergeFactor as long as + mergePolicy is an instance of . + Otherwise an IllegalArgumentException is thrown.

      + +

      + + +
      + + Expert: returns max delay inserted before syncing a + commit point. On Windows, at least, pausing before + syncing can increase net indexing throughput. The + delay is variable based on size of the segment's files, + and is only inserted when using + ConcurrentMergeScheduler for merges. + + This will be removed in 3.0, when + autoCommit=true is removed from IndexWriter. + + + + Expert: sets the max delay before syncing a commit + point. + + + + This will be removed in 3.0, when + autoCommit=true is removed from IndexWriter. + + + + If non-null, this will be the default infoStream used + by a newly instantiated IndexWriter. + + + + + + Returns the current default infoStream for newly + instantiated IndexWriters. + + + + + + If non-null, information about merges, deletes and a + message when maxFieldLength is reached will be printed + to this. + + + + Returns the current infoStream in use by this writer. + + + + + Returns true if verbosing is enabled (i.e., infoStream != null). + + + to change the default value for all instances of IndexWriter. + + + + Returns allowed timeout when acquiring the write lock. + + + + + Sets the default (for any instance of IndexWriter) maximum time to wait for a write lock (in + milliseconds). + + + + Returns default write lock timeout for newly + instantiated IndexWriters. + + + + + + Commits all changes to an index and closes all + associated files. Note that this may be a costly + operation, so, try to re-use a single writer instead of + closing and opening a new one. See for + caveats about write caching done by some IO devices. + +

      If an Exception is hit during close, eg due to disk + full or some other reason, then both the on-disk index + and the internal state of the IndexWriter instance will + be consistent. However, the close will not be complete + even though part of it (flushing buffered documents) + may have succeeded, so the write lock will still be + held.

      + +

      If you can correct the underlying cause (eg free up + some disk space) then you can call close() again. + Failing that, if you want to force the write lock to be + released (dangerous, because you may then lose buffered + docs in the IndexWriter instance) then you can do + something like this:

      + + + try { + writer.close(); + } finally { + if (IndexWriter.isLocked(directory)) { + IndexWriter.unlock(directory); + } + } + + + after which, you must be certain not to use the writer + instance anymore.

      + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer, again. See above for details.

      + +

      + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error +
      + + + .NET + + + + Closes the index with or without waiting for currently + running merges to finish. This is only meaningful when + using a MergeScheduler that runs merges in background + threads. + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer, again. See above for details.

      + +

      NOTE: it is dangerous to always call + close(false), especially when IndexWriter is not open + for very long, because this can result in "merge + starvation" whereby long merges will never have a + chance to finish. This will cause too many segments in + your index over time.

      + +

      + if true, this call will block + until all merges complete; else, it will ask all + running merges to abort, wait until those merges have + finished (which should be at most a few seconds), and + then return. + +
      + + Tells the docWriter to close its currently open shared + doc stores (stored fields & vectors files). + Return value specifices whether new doc store files are compound or not. + + + + Returns the Directory used by this index. + + + Returns the analyzer used by this index. + + + Returns the number of documents currently in this + index, not counting deletions. + + Please use (same as this + method) or (also takes deletions + into account), instead. + + + + Returns total number of docs in this index, including + docs not yet flushed (still in the RAM buffer), + not counting deletions. + + + + + + Returns total number of docs in this index, including + docs not yet flushed (still in the RAM buffer), and + including deletions. NOTE: buffered deletions + are not counted. If you really need these to be + counted you should call first. + + + + + + The maximum number of terms that will be indexed for a single field in a + document. This limits the amount of memory required for indexing, so that + collections with very large files will not crash the indexing process by + running out of memory.

      + Note that this effectively truncates large documents, excluding from the + index terms that occur further in the document. If you know your source + documents are large, be sure to set this value high enough to accomodate + the expected size. If you set it to Integer.MAX_VALUE, then the only limit + is your memory, but you should anticipate an OutOfMemoryError.

      + By default, no more than 10,000 terms will be indexed for a field. + +

      + + +
      + + Adds a document to this index. If the document contains more than + terms for a given field, the remainder are + discarded. + +

      Note that if an Exception is hit (for example disk full) + then the index will be consistent, but this document + may not have been added. Furthermore, it's possible + the index will have one segment in non-compound format + even when using compound files (when a merge has + partially succeeded).

      + +

      This method periodically flushes pending documents + to the Directory (see above), and + also periodically triggers segment merges in the index + according to the in use.

      + +

      Merges temporarily consume space in the + directory. The amount of space required is up to 1X the + size of all segments being merged, when no + readers/searchers are open against the index, and up to + 2X the size of all segments being merged when + readers/searchers are open against the index (see + for details). The sequence of + primitive merge operations performed is governed by the + merge policy. + +

      Note that each term in the document can be no longer + than 16383 characters, otherwise an + IllegalArgumentException will be thrown.

      + +

      Note that it's possible to create an invalid Unicode + string in java if a UTF16 surrogate pair is malformed. + In this case, the invalid characters are silently + replaced with the Unicode replacement character + U+FFFD.

      + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      + +

      + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error +
      + + Adds a document to this index, using the provided analyzer instead of the + value of . If the document contains more than + terms for a given field, the remainder are + discarded. + +

      See for details on + index and IndexWriter state after an Exception, and + flushing/merging temporary free space requirements.

      + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      + +

      + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error +
      + + Deletes the document(s) containing term. + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      + +

      + the term to identify the documents to be deleted + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error +
      + + Deletes the document(s) containing any of the + terms. All deletes are flushed at the same time. + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      + +

      + array of terms to identify the documents + to be deleted + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error +
      + + Deletes the document(s) matching the provided query. + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      + +

      + the query to identify the documents to be deleted + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error +
      + + Deletes the document(s) matching any of the provided queries. + All deletes are flushed at the same time. + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      + +

      + array of queries to identify the documents + to be deleted + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error +
      + + Updates a document by first deleting the document(s) + containing term and then adding the new + document. The delete and then add are atomic as seen + by a reader on the same index (flush may happen only after + the add). + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      + +

      + the term to identify the document(s) to be + deleted + + the document to be added + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error +
      + + Updates a document by first deleting the document(s) + containing term and then adding the new + document. The delete and then add are atomic as seen + by a reader on the same index (flush may happen only after + the add). + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      + +

      + the term to identify the document(s) to be + deleted + + the document to be added + + the analyzer to use when analyzing the document + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error +
      + + If non-null, information about merges will be printed to this. + + + Requests an "optimize" operation on an index, priming the index + for the fastest available search. Traditionally this has meant + merging all segments into a single segment as is done in the + default merge policy, but individaul merge policies may implement + optimize in different ways. + +

      It is recommended that this method be called upon completion of indexing. In + environments with frequent updates, optimize is best done during low volume times, if at all. + +

      +

      See http://www.gossamer-threads.com/lists/lucene/java-dev/47895 for more discussion.

      + +

      Note that optimize requires 2X the index size free + space in your Directory (3X if you're using compound + file format). For example, if your index + size is 10 MB then you need 20 MB free for optimize to + complete (30 MB if you're using compound fiel format).

      + +

      If some but not all readers re-open while an + optimize is underway, this will cause > 2X temporary + space to be consumed as those new readers will then + hold open the partially optimized segments at that + time. It is best not to re-open readers while optimize + is running.

      + +

      The actual temporary usage could be much less than + these figures (it depends on many factors).

      + +

      In general, once the optimize completes, the total size of the + index will be less than the size of the starting index. + It could be quite a bit smaller (if there were many + pending deletes) or just slightly smaller.

      + +

      If an Exception is hit during optimize(), for example + due to disk full, the index will not be corrupt and no + documents will have been lost. However, it may have + been partially optimized (some segments were merged but + not all), and it's possible that one of the segments in + the index will be in non-compound format even when + using compound file format. This will occur when the + Exception is hit during conversion of the segment into + compound format.

      + +

      This call will optimize those segments present in + the index when the call started. If other threads are + still adding documents and flushing segments, those + newly created segments will not be optimized unless you + call optimize again.

      + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      + +

      + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + +
      + + Optimize the index down to <= maxNumSegments. If + maxNumSegments==1 then this is the same as + . + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      + +

      + maximum number of segments left + in the index after optimization finishes + +
      + + Just like , except you can specify + whether the call should block until the optimize + completes. This is only meaningful with a + that is able to run merges in + background threads. + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      +

      +
      + + Just like , except you can + specify whether the call should block until the + optimize completes. This is only meaningful with a + that is able to run merges in + background threads. + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      +

      +
      + + Returns true if any merges in pendingMerges or + runningMerges are optimization merges. + + + + Just like , except you can + specify whether the call should block until the + operation completes. This is only meaningful with a + that is able to run merges in + background threads. + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      +

      +
      + + Expunges all deletes from the index. When an index + has many document deletions (or updates to existing + documents), it's best to either call optimize or + expungeDeletes to remove all unused data in the index + associated with the deleted documents. To see how + many deletions you have pending in your index, call + + This saves disk space and memory usage while + searching. expungeDeletes should be somewhat faster + than optimize since it does not insist on reducing the + index to a single segment (though, this depends on the + ; see .). Note that + this call does not first commit any buffered + documents, so you must do so yourself if necessary. + See also + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      +

      +
      + + Expert: asks the mergePolicy whether any merges are + necessary now and if so, runs the requested merges and + then iterate (test again if merges are needed) until no + more merges are returned by the mergePolicy. + + Explicit calls to maybeMerge() are usually not + necessary. The most common case is when merge policy + parameters have changed. + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      +

      +
      + + Expert: the calls this method + to retrieve the next merge requested by the + MergePolicy + + + + Like getNextMerge() except only returns a merge if it's + external. + + + + Please use instead. + + + + Close the IndexWriter without committing + any changes that have occurred since the last commit + (or since it was opened, if commit hasn't been called). + This removes any temporary files that had been created, + after which the state of the index will be the same as + it was when commit() was last called or when this + writer was first opened. This can only be called when + this IndexWriter was opened with + autoCommit=false. This also clears a + previous call to . + + IllegalStateException if this is called when + the writer was opened with autoCommit=true. + + IOException if there is a low-level IO error + + + Delete all documents in the index. + +

      This method will drop all buffered documents and will + remove all segments from the index. This change will not be + visible until a has been called. This method + can be rolled back using .

      + +

      NOTE: this method is much faster than using deleteDocuments( new MatchAllDocsQuery() ).

      + +

      NOTE: this method will forcefully abort all merges + in progress. If other threads are running + or any of the addIndexes methods, they + will receive s. +

      +
      + + Wait for any currently outstanding merges to finish. + +

      It is guaranteed that any merges started prior to calling this method + will have completed once this method completes.

      +

      +
      + + Merges all segments from an array of indexes into this index. + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      + +

      + Use instead, + then separately call afterwards if + you need to. + + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error +
      + + Merges all segments from an array of indexes into this + index. + +

      This may be used to parallelize batch indexing. A large document + collection can be broken into sub-collections. Each sub-collection can be + indexed in parallel, on a different thread, process or machine. The + complete index can then be created by merging sub-collection indexes + with this method. + +

      NOTE: the index in each Directory must not be + changed (opened by a writer) while this method is + running. This method does not acquire a write lock in + each input Directory, so it is up to the caller to + enforce this. + +

      NOTE: while this is running, any attempts to + add or delete documents (with another thread) will be + paused until this method completes. + +

      This method is transactional in how Exceptions are + handled: it does not commit a new segments_N file until + all indexes are added. This means if an Exception + occurs (for example disk full), then either no indexes + will have been added or they all will have been.

      + +

      Note that this requires temporary free space in the + Directory up to 2X the sum of all input indexes + (including the starting index). If readers/searchers + are open against the starting index, then temporary + free space required will be higher by the size of the + starting index (see for details). +

      + +

      Once this completes, the final size of the index + will be less than the sum of all input index sizes + (including the starting index). It could be quite a + bit smaller (if there were many pending deletes) or + just slightly smaller.

      + +

      + This requires this index not be among those to be added. + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      + +

      + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error +
      + + Merges the provided indexes into this index. +

      After this completes, the index is optimized.

      +

      The provided IndexReaders are not closed.

      + +

      NOTE: while this is running, any attempts to + add or delete documents (with another thread) will be + paused until this method completes. + +

      See for + details on transactional semantics, temporary free + space required in the Directory, and non-CFS segments + on an Exception.

      + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      + +

      + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error +
      + + + A hook for extending classes to execute operations after pending added and + deleted documents have been flushed to the Directory but before the change + is committed (new segments_N file written). + + + + Flush all in-memory buffered updates (adds and deletes) + to the Directory. +

      Note: while this will force buffered docs to be + pushed into the index, it will not make these docs + visible to a reader. Use instead + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      + +

      + please call ) instead + + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error +
      + + + A hook for extending classes to execute operations before pending added and + deleted documents are flushed to the Directory. + + + + Expert: prepare for commit. + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      + +

      + + +
      + +

      Expert: prepare for commit, specifying + commitUserData Map (String -> String). This does the + first phase of 2-phase commit. You can only call this + when autoCommit is false. This method does all steps + necessary to commit changes since this writer was + opened: flushes pending added and deleted docs, syncs + the index files, writes most of next segments_N file. + After calling this you must call either + to finish the commit, or + to revert the commit and undo all changes + done since the writer was opened.

      + + You can also just call directly + without prepareCommit first in which case that method + will internally call prepareCommit. + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      + +

      + Opaque Map (String->String) + that's recorded into the segments file in the index, + and retrievable by + . Note that when + IndexWriter commits itself, for example if open with + autoCommit=true, or, during , the + commitUserData is unchanged (just carried over from + the prior commit). If this is null then the previous + commitUserData is kept. Also, the commitUserData will + only "stick" if there are actually changes in the + index to commit. Therefore it's best to use this + feature only when autoCommit is false. + +
      + +

      Commits all pending changes (added & deleted + documents, optimizations, segment merges, added + indexes, etc.) to the index, and syncs all referenced + index files, such that a reader will see the changes + and the index updates will survive an OS or machine + crash or power loss. Note that this does not wait for + any running background merges to finish. This may be a + costly operation, so you should test the cost in your + application and do it only when really necessary.

      + +

      Note that this operation calls Directory.sync on + the index files. That call should not return until the + file contents & metadata are on stable storage. For + FSDirectory, this calls the OS's fsync. But, beware: + some hardware devices may in fact cache writes even + during fsync, and return before the bits are actually + on stable storage, to give the appearance of faster + performance. If you have such a device, and it does + not have a battery backup (for example) then on power + loss it may still lose data. Lucene cannot guarantee + consistency on such devices.

      + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      + +

      + + + + +
      + + Commits all changes to the index, specifying a + commitUserData Map (String -> String). This just + calls (if you didn't + already call it) and then . + +

      NOTE: if this method hits an OutOfMemoryError + you should immediately close the writer. See above for details.

      +

      +
      + + Flush all in-memory buffered udpates (adds and deletes) + to the Directory. + + if true, we may merge segments (if + deletes or docs were flushed) if necessary + + if false we are allowed to keep + doc stores open to share with the next segment + + whether pending deletes should also + be flushed + + + + Expert: Return the total size of all index files currently cached in memory. + Useful for size management with flushRamDocs() + + + + Expert: Return the number of documents currently + buffered in RAM. + + + + Carefully merges deletes for the segments we just + merged. This is tricky because, although merging will + clear all deletes (compacts the documents), new + deletes may have been flushed to the segments since + the merge was started. This method "carries over" + such new deletes onto the newly merged segment, and + saves the resulting deletes file (incrementing the + delete generation for merge.info). If no deletes were + flushed, no new deletes file is saved. + + + + Merges the indicated segments, replacing them in the stack with a + single segment. + + + + Hook that's called when the specified merge is complete. + + + Checks whether this merge involves any segments + already participating in a merge. If not, this merge + is "registered", meaning we record that its segments + are now participating in a merge, and true is + returned. Else (the merge conflicts) false is + returned. + + + + Does initial setup for a merge, which is fast but holds + the synchronized lock on IndexWriter instance. + + + + This is called after merging a segment and before + building its CFS. Return true if the files should be + sync'd. If you return false, then the source segment + files that were merged cannot be deleted until the CFS + file is built & sync'd. So, returning false consumes + more transient disk space, but saves performance of + not having to sync files which will shortly be deleted + anyway. + + -- this will be removed in 3.0 when + autoCommit is hardwired to false + + + + Does fininishing for a merge, which is fast but holds + the synchronized lock on IndexWriter instance. + + + + Does the actual (time-consuming) work of the merge, + but without holding synchronized lock on IndexWriter + instance + + + + Blocks until all files in syncing are sync'd + + + Pauses before syncing. On Windows, at least, it's + best (performance-wise) to pause in order to let OS + flush writes to disk on its own, before forcing a + sync. + + -- this will be removed in 3.0 when + autoCommit is hardwired to false + + + + Walk through all files referenced by the current + segmentInfos and ask the Directory to sync each file, + if it wasn't already. If that succeeds, then we + prepare a new segments_N file but do not fully commit + it. + + + + Returns true iff the index in the named directory is + currently locked. + + the directory to check for a lock + + IOException if there is a low-level IO error + + + Returns true iff the index in the named directory is + currently locked. + + the directory to check for a lock + + IOException if there is a low-level IO error + Use + + + + Forcibly unlocks the index in the named directory. +

      + Caution: this should only be used by failure recovery code, + when it is known that no other process nor thread is in fact + currently accessing this index. +

      +
      + + Set the merged segment warmer. See + . + + + + Returns the current merged segment warmer. See + . + + + + Deprecated: emulates IndexWriter's buggy behavior when + first token(s) have positionIncrement==0 (ie, prior to + fixing LUCENE-1542) + + + + Holds shared SegmentReader instances. IndexWriter uses + SegmentReaders for 1) applying deletes, 2) doing + merges, 3) handing out a real-time reader. This pool + reuses instances of the SegmentReaders in all these + places if it is in "near real-time mode" (getReader() + has been called on this instance). + + + + Forcefully clear changes for the specifed segments, + and remove from the pool. This is called on succesful merge. + + + + Release the segment reader (i.e. decRef it and close if there + are no more references. + + + + IOException + + + Release the segment reader (i.e. decRef it and close if there + are no more references. + + + + + IOException + + + Remove all our references to readers, and commits + any pending changes. + + + + Commit all segment reader in the pool. + IOException + + + Returns a ref to a clone. NOTE: this clone is not + enrolled in the pool, so you should simply close() + it when you're done (ie, do not call release()). + + + + Obtain a SegmentReader from the readerPool. The reader + must be returned by calling + + + + + + + + IOException + + + Obtain a SegmentReader from the readerPool. The reader + must be returned by calling + + + + + + + + + + + + + IOException + + + Specifies maximum field length (in number of tokens/terms) in constructors. + overrides the value set by + the constructor. + + + + Private type-safe-enum-pattern constructor. + + + instance name + + maximum field length + + + + Public constructor to allow users to specify the maximum field size limit. + + + The maximum field length + + + + Sets the maximum field length to . + + + Sets the maximum field length to + + + + + + If has been called (ie, this writer + is in near real-time mode), then after a merge + completes, this class can be invoked to warm the + reader on the newly merged segment, before the merge + commits. This is not required for near real-time + search, but will reduce search latency on opening a + new near real-time reader after a merge completes. + +

      NOTE: This API is experimental and might + change in incompatible ways in the next release.

      + +

      NOTE: warm is called before any deletes have + been carried over to the merged segment. +

      +
      + + IndexReader is an abstract class, providing an interface for accessing an + index. Search of an index is done entirely through this abstract interface, + so that any subclass which implements it is searchable. +

      Concrete subclasses of IndexReader are usually constructed with a call to + one of the static open() methods, e.g. + . +

      For efficiency, in this API documents are often referred to via + document numbers, non-negative integers which each name a unique + document in the index. These document numbers are ephemeral--they may change + as documents are added to and deleted from an index. Clients should thus not + rely on a given document having the same number between sessions. +

      An IndexReader can be opened on a directory for which an IndexWriter is + opened already, but it cannot be used to delete documents from the index then. +

      + NOTE: for backwards API compatibility, several methods are not listed + as abstract, but have no useful implementations in this base class and + instead always throw UnsupportedOperationException. Subclasses are + strongly encouraged to override these methods, but in many cases may not + need to. +

      +

      + NOTE: as of 2.4, it's possible to open a read-only + IndexReader using one of the static open methods that + accepts the boolean readOnly parameter. Such a reader has + better concurrency as it's not necessary to synchronize on + the isDeleted method. Currently the default for readOnly + is false, meaning if not specified you will get a + read/write IndexReader. But in 3.0 this default will + change to true, meaning you must explicitly specify false + if you want to make changes with the resulting IndexReader. +

      +

      NOTE: + instances are completely thread + safe, meaning multiple threads can call any of its methods, + concurrently. If your application requires external + synchronization, you should not synchronize on the + IndexReader instance; use your own + (non-Lucene) objects instead. +

      + $Id: IndexReader.java 826049 2009-10-16 19:28:55Z mikemccand $ + +
      + + Expert: returns the current refCount for this reader + + + Expert: increments the refCount of this IndexReader + instance. RefCounts are used to determine when a + reader can be closed safely, i.e. as soon as there are + no more references. Be sure to always call a + corresponding , in a finally clause; + otherwise the reader may never be closed. Note that + simply calls decRef(), which means that + the IndexReader will not really be closed until + has been called for all outstanding + references. + + + + + + + Expert: decreases the refCount of this IndexReader + instance. If the refCount drops to 0, then pending + changes (if any) are committed to the index and this + reader is closed. + + + IOException in case an IOException occurs in commit() or doClose() + + + + + + + will be deleted when IndexReader(Directory) is deleted + + + + + + Legacy Constructor for backwards compatibility. + +

      + This Constructor should not be used, it exists for backwards + compatibility only to support legacy subclasses that did not "own" + a specific directory, but needed to specify something to be returned + by the directory() method. Future subclasses should delegate to the + no arg constructor and implement the directory() method as appropriate. + +

      + Directory to be returned by the directory() method + + + + - use IndexReader() + +
      + + AlreadyClosedException if this IndexReader is closed + + + Returns a read/write IndexReader reading the index in an FSDirectory in the named + path. + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + Use instead. + This method will be removed in the 3.0 release. + + + the path to the index directory + + + + Returns an IndexReader reading the index in an + FSDirectory in the named path. You should pass + readOnly=true, since it gives much better concurrent + performance, unless you intend to do write operations + (delete documents or change norms) with the reader. + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + the path to the index directory + + true if this should be a readOnly + reader + + Use instead. + This method will be removed in the 3.0 release. + + + + + Returns a read/write IndexReader reading the index in an FSDirectory in the named + path. + + the path to the index directory + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + Use instead. + This method will be removed in the 3.0 release. + + + + + Returns an IndexReader reading the index in an + FSDirectory in the named path. You should pass + readOnly=true, since it gives much better concurrent + performance, unless you intend to do write operations + (delete documents or change norms) with the reader. + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + the path to the index directory + + true if this should be a readOnly + reader + + Use instead. + This method will be removed in the 3.0 release. + + + + + Returns a read/write IndexReader reading the index in + the given Directory. + + the index directory + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + Use instead + This method will be removed in the 3.0 release. + + + + + Returns an IndexReader reading the index in the given + Directory. You should pass readOnly=true, since it + gives much better concurrent performance, unless you + intend to do write operations (delete documents or + change norms) with the reader. + + the index directory + + true if no changes (deletions, norms) will be made with this IndexReader + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Expert: returns a read/write IndexReader reading the index in the given + . + + the commit point to open + + CorruptIndexException if the index is corrupt + Use instead. + This method will be removed in the 3.0 release. + + + IOException if there is a low-level IO error + + + Expert: returns an IndexReader reading the index in the given + . You should pass readOnly=true, since it + gives much better concurrent performance, unless you + intend to do write operations (delete documents or + change norms) with the reader. + + the commit point to open + + true if no changes (deletions, norms) will be made with this IndexReader + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Expert: returns a read/write IndexReader reading the index in the given + Directory, with a custom . + + the index directory + + a custom deletion policy (only used + if you use this reader to perform deletes or to set + norms); see for details. + + Use instead. + This method will be removed in the 3.0 release. + + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Expert: returns an IndexReader reading the index in + the given Directory, with a custom + . You should pass readOnly=true, + since it gives much better concurrent performance, + unless you intend to do write operations (delete + documents or change norms) with the reader. + + the index directory + + a custom deletion policy (only used + if you use this reader to perform deletes or to set + norms); see for details. + + true if no changes (deletions, norms) will be made with this IndexReader + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Expert: returns an IndexReader reading the index in + the given Directory, with a custom + . You should pass readOnly=true, + since it gives much better concurrent performance, + unless you intend to do write operations (delete + documents or change norms) with the reader. + + the index directory + + a custom deletion policy (only used + if you use this reader to perform deletes or to set + norms); see for details. + + true if no changes (deletions, norms) will be made with this IndexReader + + Subsamples which indexed + terms are loaded into RAM. This has the same effect as + except that setting + must be done at indexing time while this setting can be + set per reader. When set to N, then one in every + N*termIndexInterval terms in the index is loaded into + memory. By setting this to a value > 1 you can reduce + memory usage, at the expense of higher latency when + loading a TermInfo. The default value is 1. Set this + to -1 to skip loading the terms index entirely. + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Expert: returns a read/write IndexReader reading the index in the given + Directory, using a specific commit and with a custom + . + + the specific to open; + see to list all commits + in a directory + + a custom deletion policy (only used + if you use this reader to perform deletes or to set + norms); see for details. + + Use instead. + This method will be removed in the 3.0 release. + + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Expert: returns an IndexReader reading the index in + the given Directory, using a specific commit and with + a custom . You should pass + readOnly=true, since it gives much better concurrent + performance, unless you intend to do write operations + (delete documents or change norms) with the reader. + + the specific to open; + see to list all commits + in a directory + + a custom deletion policy (only used + if you use this reader to perform deletes or to set + norms); see for details. + + true if no changes (deletions, norms) will be made with this IndexReader + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Expert: returns an IndexReader reading the index in + the given Directory, using a specific commit and with + a custom . You should pass + readOnly=true, since it gives much better concurrent + performance, unless you intend to do write operations + (delete documents or change norms) with the reader. + + the specific to open; + see to list all commits + in a directory + + a custom deletion policy (only used + if you use this reader to perform deletes or to set + norms); see for details. + + true if no changes (deletions, norms) will be made with this IndexReader + + Subsambles which indexed + terms are loaded into RAM. This has the same effect as + except that setting + must be done at indexing time while this setting can be + set per reader. When set to N, then one in every + N*termIndexInterval terms in the index is loaded into + memory. By setting this to a value > 1 you can reduce + memory usage, at the expense of higher latency when + loading a TermInfo. The default value is 1. Set this + to -1 to skip loading the terms index entirely. + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Refreshes an IndexReader if the index has changed since this instance + was (re)opened. +

      + Opening an IndexReader is an expensive operation. This method can be used + to refresh an existing IndexReader to reduce these costs. This method + tries to only load segments that have changed or were created after the + IndexReader was (re)opened. +

      + If the index has not changed since this instance was (re)opened, then this + call is a NOOP and returns this instance. Otherwise, a new instance is + returned. The old instance is not closed and remains usable.
      +

      + If the reader is reopened, even though they share + resources internally, it's safe to make changes + (deletions, norms) with the new reader. All shared + mutable state obeys "copy on write" semantics to ensure + the changes are not seen by other readers. +

      + You can determine whether a reader was actually reopened by comparing the + old instance with the instance returned by this method: + + IndexReader reader = ... + ... + IndexReader newReader = r.reopen(); + if (newReader != reader) { + ... // reader was reopened + reader.close(); + } + reader = newReader; + ... + + + Be sure to synchronize that code so that other threads, + if present, can never use reader after it has been + closed and before it's switched to newReader. + +

      NOTE: If this reader is a near real-time + reader (obtained from , + reopen() will simply call writer.getReader() again for + you, though this may change in the future. + +

      + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error +
      + + Just like , except you can change the + readOnly of the original reader. If the index is + unchanged but readOnly is different then a new reader + will be returned. + + + + Expert: reopen this reader on a specific commit point. + This always returns a readOnly reader. If the + specified commit point matches what this reader is + already on, and this reader is already readOnly, then + this same instance is returned; if it is not already + readOnly, a readOnly clone is returned. + + + + Efficiently clones the IndexReader (sharing most + internal state). +

      + On cloning a reader with pending changes (deletions, + norms), the original reader transfers its write lock to + the cloned reader. This means only the cloned reader + may make further changes to the index, and commit the + changes to the index on close, but the old reader still + reflects all changes made up until it was cloned. +

      + Like , it's safe to make changes to + either the original or the cloned reader: all shared + mutable state obeys "copy on write" semantics to ensure + the changes are not seen by other readers. +

      +

      + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error +
      + + Clones the IndexReader and optionally changes readOnly. A readOnly + reader cannot open a writeable reader. + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Returns the directory associated with this index. The Default + implementation returns the directory specified by subclasses when + delegating to the IndexReader(Directory) constructor, or throws an + UnsupportedOperationException if one was not specified. + + UnsupportedOperationException if no directory + + + Returns the time the index in the named directory was last modified. + Do not use this to check whether the reader is still up-to-date, use + instead. + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + Use instead. + This method will be removed in the 3.0 release. + + + + Returns the time the index in the named directory was last modified. + Do not use this to check whether the reader is still up-to-date, use + instead. + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + Use instead. + This method will be removed in the 3.0 release. + + + + + Returns the time the index in the named directory was last modified. + Do not use this to check whether the reader is still up-to-date, use + instead. + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Reads version number from segments files. The version number is + initialized with a timestamp and then increased by one for each change of + the index. + + + where the index resides. + + version number. + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + Use instead. + This method will be removed in the 3.0 release. + + + + Reads version number from segments files. The version number is + initialized with a timestamp and then increased by one for each change of + the index. + + + where the index resides. + + version number. + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + Use instead. + This method will be removed in the 3.0 release. + + + + Reads version number from segments files. The version number is + initialized with a timestamp and then increased by one for each change of + the index. + + + where the index resides. + + version number. + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Reads commitUserData, previously passed to + , + from current index segments file. This will return null if + + has never been called for this index. + + where the index resides. + + commit userData. + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + + + + + Version number when this IndexReader was opened. Not implemented in the + IndexReader base class. + +

      + If this reader is based on a Directory (ie, was created by calling + , or + on a reader based on a Directory), then + this method returns the version recorded in the commit that the reader + opened. This version is advanced every time is + called. +

      + +

      + If instead this reader is a near real-time reader (ie, obtained by a call + to , or by calling on a near + real-time reader), then this method returns the version of the last + commit done by the writer. Note that even as further changes are made + with the writer, the version will not changed until a commit is + completed. Thus, you should not rely on this method to determine when a + near real-time reader should be opened. Use instead. +

      + +

      + UnsupportedOperationException + unless overridden in subclass + +
      + + Retrieve the String userData optionally passed to + . + This will return null if + + has never been called for this index. + + + + + +

      For IndexReader implementations that use + TermInfosReader to read terms, this sets the + indexDivisor to subsample the number of indexed terms + loaded into memory. This has the same effect as + except that setting + must be done at indexing time while this setting can be + set per reader. When set to N, then one in every + N*termIndexInterval terms in the index is loaded into + memory. By setting this to a value > 1 you can reduce + memory usage, at the expense of higher latency when + loading a TermInfo. The default value is 1.

      + + NOTE: you must call this before the term + index is loaded. If the index is already loaded, + an IllegalStateException is thrown. +

      + IllegalStateException if the term index has already been loaded into memory + Please use to specify the required TermInfos index divisor instead. + +
      + +

      For IndexReader implementations that use + TermInfosReader to read terms, this returns the + current indexDivisor as specified when the reader was + opened. +

      +
      + + Check whether any new changes have occurred to the index since this + reader was opened. + +

      + If this reader is based on a Directory (ie, was created by calling + , or on a reader based on a Directory), then + this method checks if any further commits (see + have occurred in that directory). +

      + +

      + If instead this reader is a near real-time reader (ie, obtained by a call + to , or by calling on a near + real-time reader), then this method checks if either a new commmit has + occurred, or any new uncommitted changes have taken place via the writer. + Note that even if the writer has only performed merging, this method will + still return false. +

      + +

      + In any event, if this returns false, you should call to + get a new reader that sees the changes. +

      + +

      + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + UnsupportedOperationException unless overridden in subclass +
      + + Checks is the index is optimized (if it has a single segment and + no deletions). Not implemented in the IndexReader base class. + + true if the index is optimized; false otherwise + + UnsupportedOperationException unless overridden in subclass + + + Return an array of term frequency vectors for the specified document. + The array contains a vector for each vectorized field in the document. + Each vector contains terms and frequencies for all terms in a given vectorized field. + If no such fields existed, the method returns null. The term vectors that are + returned may either be of type + or of type if + positions or offsets have been stored. + + + document for which term frequency vectors are returned + + array of term frequency vectors. May be null if no term vectors have been + stored for the specified document. + + IOException if index cannot be accessed + + + + + Return a term frequency vector for the specified document and field. The + returned vector contains terms and frequencies for the terms in + the specified field of this document, if the field had the storeTermVector + flag set. If termvectors had been stored with positions or offsets, a + is returned. + + + document for which the term frequency vector is returned + + field for which the term frequency vector is returned. + + term frequency vector May be null if field does not exist in the specified + document or term vector was not stored. + + IOException if index cannot be accessed + + + + + Load the Term Vector into a user-defined data structure instead of relying on the parallel arrays of + the . + + The number of the document to load the vector for + + The name of the field to load + + The to process the vector. Must not be null + + IOException if term vectors cannot be accessed or if they do not exist on the field and doc. specified. + + + + + Map all the term vectors for all fields in a Document + The number of the document to load the vector for + + The to process the vector. Must not be null + + IOException if term vectors cannot be accessed or if they do not exist on the field and doc. specified. + + + Returns true if an index exists at the specified directory. + If the directory does not exist or if there is no index in it. + false is returned. + + the directory to check for an index + + true if an index exists; false otherwise + + Use instead + This method will be removed in the 3.0 release. + + + + + Returns true if an index exists at the specified directory. + If the directory does not exist or if there is no index in it. + + the directory to check for an index + + true if an index exists; false otherwise + + Use instead. + This method will be removed in the 3.0 release. + + + + + Returns true if an index exists at the specified directory. + If the directory does not exist or if there is no index in it. + + the directory to check for an index + + true if an index exists; false otherwise + + IOException if there is a problem with accessing the index + + + Returns the number of documents in this index. + + + Returns one greater than the largest possible document number. + This may be used to, e.g., determine how big to allocate an array which + will have an element for every document number in an index. + + + + Returns the number of deleted documents. + + + Returns the stored fields of the nth + Document in this index. +

      + NOTE: for performance reasons, this method does not check if the + requested document is deleted, and therefore asking for a deleted document + may yield unspecified results. Usually this is not required, however you + can call with the requested document ID to verify + the document is not deleted. + +

      + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error +
      + + Get the at the n + th position. The may be used to determine + what s to load and how they should + be loaded. NOTE: If this Reader (more specifically, the underlying + FieldsReader) is closed before the lazy + is loaded an exception may be + thrown. If you want the value of a lazy + to be available after closing you + must explicitly load it or fetch the Document again with a new loader. +

      + NOTE: for performance reasons, this method does not check if the + requested document is deleted, and therefore asking for a deleted document + may yield unspecified results. Usually this is not required, however you + can call with the requested document ID to verify + the document is not deleted. + +

      + Get the document at the nth position + + The to use to determine what + Fields should be loaded on the Document. May be null, in which case + all Fields will be loaded. + + The stored fields of the + at the nth position + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + + + + + + +
      + + Returns true if document n has been deleted + + + Returns true if any documents have been deleted + + + Returns true if there are norms stored for this field. + + + Returns the byte-encoded normalization factor for the named field of + every document. This is used by the search code to score documents. + + + + + + + Reads the byte-encoded normalization factor for the named field of every + document. This is used by the search code to score documents. + + + + + + + Expert: Resets the normalization factor for the named field of the named + document. The norm represents the product of the field's boost + and its length normalization. Thus, to preserve the length normalization + values when resetting this, one should base the new value upon the old. + + NOTE: If this field does not store norms, then + this method call will silently do nothing. + + + + + + + StaleReaderException if the index has changed + since this reader was opened + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if there is a low-level IO error + + + Implements setNorm in subclass. + + + Expert: Resets the normalization factor for the named field of the named + document. + + + + + + + + StaleReaderException if the index has changed + since this reader was opened + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if there is a low-level IO error + + + Returns an enumeration of all the terms in the index. The + enumeration is ordered by Term.compareTo(). Each term is greater + than all that precede it in the enumeration. Note that after + calling terms(), must be called + on the resulting enumeration before calling other methods such as + . + + IOException if there is a low-level IO error + + + Returns an enumeration of all terms starting at a given term. If + the given term does not exist, the enumeration is positioned at the + first term greater than the supplied term. The enumeration is + ordered by Term.compareTo(). Each term is greater than all that + precede it in the enumeration. + + IOException if there is a low-level IO error + + + Returns the number of documents containing the term t. + IOException if there is a low-level IO error + + + Returns an enumeration of all the documents which contain + term. For each document, the document number, the frequency of + the term in that document is also provided, for use in + search scoring. If term is null, then all non-deleted + docs are returned with freq=1. + Thus, this method implements the mapping: +

      + Term    =>    <docNum, freq>* + +

      The enumeration is ordered by document number. Each document number + is greater than all that precede it in the enumeration. +

      + IOException if there is a low-level IO error +
      + + Returns an unpositioned enumerator. + IOException if there is a low-level IO error + + + Returns an enumeration of all the documents which contain + term. For each document, in addition to the document number + and frequency of the term in that document, a list of all of the ordinal + positions of the term in the document is available. Thus, this method + implements the mapping: + +

      + Term    =>    <docNum, freq, + <pos1, pos2, ... + posfreq-1> + >* + +

      This positional information facilitates phrase and proximity searching. +

      The enumeration is ordered by document number. Each document number is + greater than all that precede it in the enumeration. +

      + IOException if there is a low-level IO error +
      + + Returns an unpositioned enumerator. + IOException if there is a low-level IO error + + + Deletes the document numbered docNum. Once a document is + deleted it will not appear in TermDocs or TermPostitions enumerations. + Attempts to read its field with the + method will result in an error. The presence of this document may still be + reflected in the statistic, though + this will be corrected eventually as the index is further modified. + + + StaleReaderException if the index has changed + since this reader was opened + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if there is a low-level IO error + + + Implements deletion of the document numbered docNum. + Applications should call or . + + + + Deletes all documents that have a given term indexed. + This is useful if one uses a document field to hold a unique ID string for + the document. Then to delete such a document, one merely constructs a + term with the appropriate field and the unique ID string as its text and + passes it to this method. + See for information about when this deletion will + become effective. + + + the number of documents deleted + + StaleReaderException if the index has changed + since this reader was opened + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if there is a low-level IO error + + + Undeletes all documents currently marked as deleted in this index. + + + StaleReaderException if the index has changed + since this reader was opened + + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Implements actual undeleteAll() in subclass. + + + Does nothing by default. Subclasses that require a write lock for + index modifications must implement this method. + + + + + IOException + + + Opaque Map (String -> String) + that's recorded into the segments file in the index, + and retrievable by + . + + IOException + + + Commit changes resulting from delete, undeleteAll, or + setNorm operations + + If an exception is hit, then either no changes or all + changes will have been committed to the index + (transactional semantics). + + IOException if there is a low-level IO error + + + Commit changes resulting from delete, undeleteAll, or + setNorm operations + + If an exception is hit, then either no changes or all + changes will have been committed to the index + (transactional semantics). + + IOException if there is a low-level IO error + + + Implements commit. + Please implement + + instead. + + + + Implements commit. NOTE: subclasses should override + this. In 3.0 this will become an abstract method. + + + + Closes files associated with this index. + Also saves any new deletions to disk. + No other methods should be called after this has been called. + + IOException if there is a low-level IO error + + + + .NET + + + + Implements close. + + + Get a list of unique field names that exist in this index and have the specified + field option information. + + specifies which field option should be available for the returned fields + + Collection of Strings indicating the names of the fields. + + + + + + Returns true iff the index in the named directory is + currently locked. + + the directory to check for a lock + + IOException if there is a low-level IO error + Please use instead. + This method will be removed in the 3.0 release. + + + + + Returns true iff the index in the named directory is + currently locked. + + the directory to check for a lock + + IOException if there is a low-level IO error + Use instead. + This method will be removed in the 3.0 release. + + + + + Forcibly unlocks the index in the named directory. +

      + Caution: this should only be used by failure recovery code, + when it is known that no other process nor thread is in fact + currently accessing this index. +

      + Please use instead. + This method will be removed in the 3.0 release. + + +
      + + Expert: return the IndexCommit that this reader has + opened. This method is only implemented by those + readers that correspond to a Directory with its own + segments_N file. + +

      WARNING: this API is new and experimental and + may suddenly change.

      +

      +
      + + Prints the filename and size of each file within a given compound file. + Add the -extract flag to extract files to the current working directory. + In order to make the extracted version of the index work, you have to copy + the segments file from the compound index into the directory where the extracted files are stored. + + Usage: Lucene.Net.Index.IndexReader [-extract] <cfsfile> + + + + Returns all commit points that exist in the Directory. + Normally, because the default is + , there would be only + one commit point. But if you're using a custom + then there could be many commits. + Once you have a given commit, you can open a reader on + it by calling + There must be at least one commit in + the Directory, else this method throws . + Note that if a commit is in + progress while this method is running, that commit + may or may not be returned array. + + + + Expert: returns the sequential sub readers that this + reader is logically composed of. For example, + IndexSearcher uses this API to drive searching by one + sub reader at a time. If this reader is not composed + of sequential child readers, it should return null. + If this method returns an empty array, that means this + reader is a null reader (for example a MultiReader + that has no sub readers). +

      + NOTE: You should not try using sub-readers returned by + this method to make any changes (setNorm, deleteDocument, + etc.). While this might succeed for one composite reader + (like MultiReader), it will most likely lead to index + corruption for other readers (like DirectoryReader obtained + through . Use the parent reader directly. +

      +
      + + Expert + + + + + Expert. Warning: this returns null if the reader has + no deletions + + + Returns the number of unique terms (across all fields) + in this reader. + + This method returns long, even though internally + Lucene cannot handle more than 2^31 unique terms, for + a possible future when this limitation is removed. + + + UnsupportedOperationException if this count + cannot be easily determined (eg Multi*Readers). + Instead, you should call + and ask each sub reader for + its unique term count. + + + + Expert: Return the state of the flag that disables fakes norms in favor of representing the absence of field norms with null. + true if fake norms are disabled + + This currently defaults to false (to remain + back-compatible), but in 3.0 it will be hardwired to + true, meaning the norms() methods will return null for + fields that had disabled norms. + + + + Expert: Set the state of the flag that disables fakes norms in favor of representing the absence of field norms with null. + true to disable fake norms, false to preserve the legacy behavior + + This currently defaults to false (to remain + back-compatible), but in 3.0 it will be hardwired to + true, meaning the norms() methods will return null for + fields that had disabled norms. + + + + Utility class for executing code that needs to do + something with the current segments file. This is + necessary with lock-less commits because from the time + you locate the current segments file name, until you + actually open it, read its contents, or check modified + time, etc., it could have been deleted due to a writer + commit finishing. + + + + A collection of segmentInfo objects with methods for operating on + those segments in relation to the file system. + +

      NOTE: This API is new and still experimental + (subject to change suddenly in the next release)

      +

      +
      + + The file format version, a negative number. + + + This format adds details used for lockless commits. It differs + slightly from the previous format in that file names + are never re-used (write once). Instead, each file is + written to the next generation. For example, + segments_1, segments_2, etc. This allows us to not use + a commit lock. See file + formats for details. + + + + This format adds a "hasSingleNormFile" flag into each segment info. + See LUCENE-756 + for details. + + + + This format allows multiple segments to share a single + vectors and stored fields file. + + + + This format adds a checksum at the end of the file to + ensure all bytes were successfully written. + + + + This format adds the deletion count for each segment. + This way IndexWriter can efficiently report numDocs(). + + + + This format adds the boolean hasProx to record if any + fields in the segment store prox information (ie, have + omitTermFreqAndPositions==false) + + + + This format adds optional commit userData (String) storage. + + + This format adds optional per-segment String + dianostics storage, and switches userData to Map + + + + counts how often the index has been changed by adding or deleting docs. + starting with the current time in milliseconds forces to create unique version numbers. + + + + If non-null, information about loading segments_N files + + + + + Get the generation (N) of the current segments_N file + from a list of files. + + + -- array of file names to check + + + + Get the generation (N) of the current segments_N file + in the directory. + + + -- directory to search for the latest segments_N file + + + + Get the filename of the current segments_N file + from a list of files. + + + -- array of file names to check + + + + Get the filename of the current segments_N file + in the directory. + + + -- directory to search for the latest segments_N file + + + + Get the segments_N filename in use by this segment infos. + + + Parse the generation off the segments file name and + return it. + + + + Get the next segments_N filename that will be written. + + + Read a particular segmentFileName. Note that this may + throw an IOException if a commit is in process. + + + -- directory containing the segments file + + -- segment file to load + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + This version of read uses the retry logic (for lock-less + commits) to find the right segments file to load. + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Returns a copy of this instance, also copying each + SegmentInfo. + + + + version number when this SegmentInfos was generated. + + + Current version number from segments file. + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Returns userData from latest segments file + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + If non-null, information about retries when loading + the segments file will be printed to this. + + + + Advanced: set how many times to try loading the + segments.gen file contents to determine current segment + generation. This file is only referenced when the + primary method (listing the directory) fails. + + + + + + + + Advanced: set how many milliseconds to pause in between + attempts to load the segments.gen file. + + + + + + + + Advanced: set how many times to try incrementing the + gen when loading the segments file. This only runs if + the primary (listing directory) and secondary (opening + segments.gen file) methods fail to find the segments + file. + + + + + + + + + + + + Returns a new SegmentInfos containg the SegmentInfo + instances in the specified range first (inclusive) to + last (exclusive), so total number of segments returned + is last-first. + + + + Call this to start a commit. This writes the new + segments file, but writes an invalid checksum at the + end, so that it is not visible to readers. Once this + is called you must call to complete + the commit or to abort it. + + + + Returns all file names referenced by SegmentInfo + instances matching the provided Directory (ie files + associated with any "external" segments are skipped). + The returned collection is recomputed on each + invocation. + + + + Writes & syncs to the Directory dir, taking care to + remove the segments file on exception + + + + Replaces all segments in this instance, but keeps + generation, version, counter so that future commits + remain write once. + + + + + Simple brute force implementation. + If size is equal, compare items one by one. + + SegmentInfos object to check equality for + true if lists are equal, false otherwise + + + + Calculate hash code of SegmentInfos + + hash code as in java version of ArrayList + + + Utility class for executing code that needs to do + something with the current segments file. This is + necessary with lock-less commits because from the time + you locate the current segments file name, until you + actually open it, read its contents, or check modified + time, etc., it could have been deleted due to a writer + commit finishing. + + + + Subclass must implement this. The assumption is an + IOException will be thrown if something goes wrong + during the processing that could have been caused by + a writer committing. + + + + Constants describing field properties, for example used for + . + + + + All fields + + + All indexed fields + + + All fields that store payloads + + + All fields that omit tf + + + Renamed to + + + + All fields which are not indexed + + + All fields which are indexed with termvectors enabled + + + All fields which are indexed but don't have termvectors enabled + + + All fields with termvectors enabled. Please note that only standard termvector fields are returned + + + All fields with termvectors with position values enabled + + + All fields with termvectors with offset values enabled + + + All fields with termvectors with offset values and position values enabled + + + This is a DocConsumer that gathers all fields under the + same name, and calls per-field consumers to process field + by field. This class doesn't doesn't do any "real" work + of its own: it just forwards the fields to a + DocFieldConsumer. + + + + Implements the skip list reader for the default posting list format + that stores positions and payloads. + + + + + This abstract class reads skip lists with multiple levels. + + See for the information about the encoding + of the multi level skip lists. + + Subclasses must implement the abstract method + which defines the actual format of the skip data. + + + + Returns the id of the doc to which the last call of + has skipped. + + + + Skips entries to the first beyond the current whose document number is + greater than or equal to target. Returns the current doc count. + + + + Seeks the skip entry on the given level + + + initializes the reader + + + Loads the skip levels + + + Subclasses must implement the actual skip data encoding in this method. + + + the level skip data shall be read from + + the skip stream to read from + + + + Copies the values of the last read skip entry on this level + + + used to buffer the top skip levels + + + Returns the freq pointer of the doc to which the last call of + has skipped. + + + + Returns the prox pointer of the doc to which the last call of + has skipped. + + + + Returns the payload length of the payload stored just before + the doc to which the last call of + has skipped. + + + + Combines multiple files into a single compound file. + The file format:
      + + VInt fileCount + {Directory} + fileCount entries with the following structure: + + long dataOffset + String fileName + + {File Data} + fileCount entries with the raw data of the corresponding file + + + The fileCount integer indicates how many files are contained in this compound + file. The {directory} that follows has that many entries. Each directory entry + contains a long pointer to the start of this file's data section, and a String + with that file's name. + + +
      + $Id: CompoundFileWriter.java 690539 2008-08-30 17:33:06Z mikemccand $ + +
      + + Create the compound stream in the specified file. The file name is the + entire name (no extensions are added). + + NullPointerException if dir or name is null + + + Returns the directory of the compound file. + + + Returns the name of the compound file. + + + Add a source stream. file is the string by which the + sub-stream will be known in the compound stream. + + + IllegalStateException if this writer is closed + NullPointerException if file is null + IllegalArgumentException if a file with the same name + has been added already + + + + Merge files with the extensions added up to now. + All files with these extensions are combined sequentially into the + compound stream. After successful merge, the source files + are deleted. + + IllegalStateException if close() had been called before or + if no file has been added to this object + + + + Copy the contents of the file with specified extension into the + provided output stream. Use the provided buffer for moving data + to reduce memory allocation. + + + + source file + + + temporary holder for the start of directory entry for this file + + + temporary holder for the start of this file's data section + + + Class for accessing a compound stream. + This class implements a directory, but is limited to only read operations. + Directory methods that would normally modify data throw an exception. + + + + $Id: CompoundFileReader.java 673371 2008-07-02 11:57:27Z mikemccand $ + + + + + .NET + + + + Returns an array of strings, one for each file in the directory. + + + Returns true iff a file with the given name exists. + + + Returns the time the compound file was last modified. + + + Set the modified time of the compound file to now. + + + Not implemented + UnsupportedOperationException + + + Not implemented + UnsupportedOperationException + + + Returns the length of a file in the directory. + IOException if the file does not exist + + + Not implemented + UnsupportedOperationException + + + Not implemented + UnsupportedOperationException + + + Implementation of an IndexInput that reads from a portion of the + compound file. The visibility is left as "package" *only* because + this helps with testing since JUnit test cases in a different class + can then access package fields of this class. + + + + Expert: implements buffer refill. Reads bytes from the current + position in the input. + + the array to read bytes into + + the offset in the array to start storing bytes + + the number of bytes to read + + + + Expert: implements seek. Sets current position in this file, where + the next will occur. + + + + + + Closes the stream to further operations. + + + Provides information about what should be done with this Field + + + + + + Load this every time the is loaded, reading in the data as it is encountered. + and should not return null. +

      + should be called by the Reader. +

      +
      + + Lazily load this . This means the is valid, but it may not actually contain its data until + invoked. SHOULD NOT BE USED. is safe to use and should + return a valid instance of a . +

      + should be called by the Reader. +

      +
      + + Do not load the . and should return null. + is not called. +

      + should not be called by the Reader. +

      +
      + + Load this field as in the case, but immediately return from loading for the . Thus, the + Document may not have its complete set of Fields. and should + both be valid for this +

      + should be called by the Reader. +

      +
      + + Behaves much like but does not uncompress any compressed data. This is used for internal purposes. + and should not return null. +

      + should be called by + the Reader. +

      + This is an internal option only, and is + no longer needed now that + is used for field compression. + +
      + + Expert: Load the size of this rather than its value. + Size is measured as number of bytes required to store the field == bytes for a binary or any compressed value, and 2*chars for a String value. + The size is stored as a binary value, represented as an int in a byte[], with the higher order byte first in [0] + + + + Expert: Like but immediately break from the field loading loop, i.e., stop loading further fields, after the size is loaded + + + Provides support for converting dates to strings and vice-versa. + The strings are structured so that lexicographic sorting orders + them by date, which makes them suitable for use as field values + and search terms. + +

      This class also helps you to limit the resolution of your dates. Do not + save dates with a finer resolution than you really need, as then + RangeQuery and PrefixQuery will require more memory and become slower. + +

      Compared to the strings generated by the methods + in this class take slightly more space, unless your selected resolution + is set to Resolution.DAY or lower. + +

      + Another approach is , which provides + a sortable binary representation (prefix encoded) of numeric values, which + date/time are. + For indexing a , convert it to unix timestamp as + long and + index this as a numeric value with + and use to query it. +

      +
      + + Converts a Date to a string suitable for indexing. + + + the date to be converted + + the desired resolution, see + + + a string in format yyyyMMddHHmmssSSS or shorter, + depending on resolution; using GMT as timezone + + + + Converts a millisecond time to a string suitable for indexing. + + + the date expressed as milliseconds since January 1, 1970, 00:00:00 GMT + + the desired resolution, see + + + a string in format yyyyMMddHHmmssSSS or shorter, + depending on resolution; using GMT as timezone + + + + Converts a string produced by timeToString or + DateToString back to a time, represented as the + number of milliseconds since January 1, 1970, 00:00:00 GMT. + + + the date string to be converted + + the number of milliseconds since January 1, 1970, 00:00:00 GMT + + ParseException if dateString is not in the + expected format + + + + Converts a string produced by timeToString or + DateToString back to a time, represented as a + Date object. + + + the date string to be converted + + the parsed time as a Date object + + ParseException if dateString is not in the + expected format + + + + Limit a date's resolution. For example, the date 2004-09-21 13:50:11 + will be changed to 2004-09-01 00:00:00 when using + Resolution.MONTH. + + + + The desired resolution of the date to be returned + + the date with all values more precise than resolution + set to 0 or 1 + + + + Limit a date's resolution. For example, the date 1095767411000 + (which represents 2004-09-21 13:50:11) will be changed to + 1093989600000 (2004-09-01 00:00:00) when using + Resolution.MONTH. + + + The time in milliseconds (not ticks). + The desired resolution of the date to be returned + + the date with all values more precise than resolution + set to 0 or 1, expressed as milliseconds since January 1, 1970, 00:00:00 GMT + + + + Specifies the time granularity. + + + The positionIncrement determines the position of this token + relative to the previous Token in a TokenStream, used in phrase + searching. + +

      The default value is one. + +

      Some common uses for this are: + + Set it to zero to put multiple terms in the same position. This is + useful if, e.g., a word has multiple stems. Searches for phrases + including either stem will match. In this case, all but the first stem's + increment should be set to zero: the increment of the first instance + should be one. Repeating a token with an increment of zero can also be + used to boost the scores of matches on that token. + + Set it to values greater than one to inhibit exact phrase matches. + If, for example, one does not want phrases to match across removed stop + words, then one could build a stop word filter that removes stop words and + also sets the increment to the number of stop words removed before each + non-stop word. Then exact phrase queries will only match when the terms + occur with no intervening stop words. + + + +

      + + +
      + + Base interface for attributes. + + + Set the position increment. The default value is one. + + + the distance from the prior term + + + + Returns the position increment of this Token. + + + + + Filters with , + and , using a list of English stop + words. + + +

      + You must specify the required compatibility when creating + StandardAnalyzer: + + As of 2.9, StopFilter preserves position increments + As of 2.4, Tokens incorrectly identified as acronyms are corrected (see + LUCENE-1608) + + +

      + $Id: StandardAnalyzer.java 829134 2009-10-23 17:18:53Z mikemccand $ + +
      + + An Analyzer builds TokenStreams, which analyze text. It thus represents a + policy for extracting index terms from text. +

      + Typical implementations first build a Tokenizer, which breaks the stream of + characters from the Reader into raw Tokens. One or more TokenFilters may + then be applied to the output of the Tokenizer. +

      +
      + + Creates a TokenStream which tokenizes all the text in the provided + Reader. Must be able to handle null field name for + backward compatibility. + + + + Creates a TokenStream that is allowed to be re-used + from the previous time that the same thread called + this method. Callers that do not need to use more + than one TokenStream at the same time from this + analyzer should use this method for better + performance. + + + + Used by Analyzers that implement reusableTokenStream + to retrieve previously saved TokenStreams for re-use + by the same thread. + + + + Used by Analyzers that implement reusableTokenStream + to save a TokenStream for later re-use by the same + thread. + + + + This is only present to preserve + back-compat of classes that subclass a core analyzer + and override tokenStream but not reusableTokenStream + + + + Invoked before indexing a Fieldable instance if + terms have already been added to that field. This allows custom + analyzers to place an automatic position increment gap between + Fieldable instances using the same field name. The default value + position increment gap is 0. With a 0 position increment gap and + the typical default token position increment of 1, all terms in a field, + including across Fieldable instances, are in successive positions, allowing + exact PhraseQuery matches, for instance, across Fieldable instance boundaries. + + + Fieldable name being indexed. + + position increment gap, added to the next token emitted from + + + + Just like , except for + Token offsets instead. By default this returns 1 for + tokenized fields and, as if the fields were joined + with an extra space character, and 0 for un-tokenized + fields. This method is only called if the field + produced at least one token for indexing. + + + the field just indexed + + offset gap, added to the next token emitted from + + + + Frees persistent resources used by this Analyzer + + + Default maximum allowed token length + + + Specifies whether deprecated acronyms should be replaced with HOST type. + This is false by default to support backward compatibility. + + + this should be removed in the next release (3.0). + + See https://issues.apache.org/jira/browse/LUCENE-1068 + + + + + true if new instances of StandardTokenizer will + replace mischaracterized acronyms + + See https://issues.apache.org/jira/browse/LUCENE-1068 + + This will be removed (hardwired to true) in 3.0 + + + + + Set to true to have new + instances of StandardTokenizer replace mischaracterized + acronyms by default. Set to false to preserve the + previous (before 2.4) buggy behavior. Alternatively, + set the system property + Lucene.Net.Analysis.Standard.StandardAnalyzer.replaceInvalidAcronym + to false. + + See https://issues.apache.org/jira/browse/LUCENE-1068 + + This will be removed (hardwired to true) in 3.0 + + + + An array containing some common English words that are usually not + useful for searching. + + Use instead + + + + An unmodifiable set containing some common English words that are usually not + useful for searching. + + + + Builds an analyzer with the default stop words + (). + + Use instead. + + + + Builds an analyzer with the default stop words (). + + Lucene version to match See above /> + + + + + Builds an analyzer with the given stop words. + Use + instead + + + + Builds an analyzer with the given stop words. + Lucene version to match See above /> + + + stop words + + + + Builds an analyzer with the given stop words. + Use instead + + + + Builds an analyzer with the stop words from the given file. + + + Use + instead + + + + Builds an analyzer with the stop words from the given file. + + + Lucene version to match See above /> + + + File to read stop words from + + + + Builds an analyzer with the stop words from the given reader. + + + Use + instead + + + + Builds an analyzer with the stop words from the given reader. + + + Lucene version to match See above /> + + + Reader to read stop words from + + + + + Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer + + See https://issues.apache.org/jira/browse/LUCENE-1068 + + + Remove in 3.X and make true the only valid value + + + + The stopwords to use + + Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer + + See https://issues.apache.org/jira/browse/LUCENE-1068 + + + Remove in 3.X and make true the only valid value + + + + The stopwords to use + + Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer + + See https://issues.apache.org/jira/browse/LUCENE-1068 + + + Remove in 3.X and make true the only valid value + + + + + The stopwords to use + + Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer + + See https://issues.apache.org/jira/browse/LUCENE-1068 + + + Remove in 3.X and make true the only valid value + + + + The stopwords to use + + Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer + + See https://issues.apache.org/jira/browse/LUCENE-1068 + + + Remove in 3.X and make true the only valid value + + + + Constructs a filtered by a + , a and a . + + + + Set maximum allowed token length. If a token is seen + that exceeds this length then it is discarded. This + setting only takes effect the next time tokenStream or + reusableTokenStream is called. + + + + + + + + Use instead + + + + + true if this Analyzer is replacing mischaracterized acronyms in the StandardTokenizer + + See https://issues.apache.org/jira/browse/LUCENE-1068 + + This will be removed (hardwired to true) in 3.0 + + + + + Set to true if this Analyzer is replacing mischaracterized acronyms in the StandardTokenizer + + See https://issues.apache.org/jira/browse/LUCENE-1068 + + This will be removed (hardwired to true) in 3.0 + + + + Transforms the token stream as per the Porter stemming algorithm. + Note: the input to the stemming filter must already be in lower case, + so you will need to use LowerCaseFilter or LowerCaseTokenizer farther + down the Tokenizer chain in order for this to work properly! +

      + To use this filter with other analyzers, you'll want to write an + Analyzer class that sets up the TokenStream chain as you want it. + To use this with LowerCaseTokenizer, for example, you'd write an + analyzer like this: +

      + + class MyAnalyzer extends Analyzer { + public final TokenStream tokenStream(String fieldName, Reader reader) { + return new PorterStemFilter(new LowerCaseTokenizer(reader)); + } + } + +

      +
      + + A TokenFilter is a TokenStream whose input is another TokenStream. +

      + This is an abstract class; subclasses must override . + +

      + + +
      + + The source of tokens for this filter. + + + Construct a token stream filtering the given input. + + + Performs end-of-stream operations, if any, and calls then end() on the + input TokenStream.

      + NOTE: Be sure to call super.end() first when overriding this method. +

      +
      + + Close the input TokenStream. + + + Reset the filter as well as the input TokenStream. + + + A filter that replaces accented characters in the ISO Latin 1 character set + (ISO-8859-1) by their unaccented equivalent. The case will not be altered. +

      + For instance, 'À' will be replaced by 'a'. +

      + +

      + in favor of which covers a superset + of Latin 1. This class will be removed in Lucene 3.0. + +
      + + Will be removed in Lucene 3.0. This method is final, as it should + not be overridden. Delegates to the backwards compatibility layer. + + + + Will be removed in Lucene 3.0. This method is final, as it should + not be overridden. Delegates to the backwards compatibility layer. + + + + To replace accented characters in a String by unaccented equivalents. + + + Helper class for keeping Listss of Objects associated with keys. WARNING: THIS CLASS IS NOT THREAD SAFE + + + the backing store for this object + + + + direct access to the map backing this object. + + + + Adds val to the Set associated with key in the Map. If key is not + already in the map, a new Set will first be created. + + the size of the Set associated with key once val is added to it. + + + + Adds multiple vals to the Set associated with key in the Map. + If key is not + already in the map, a new Set will first be created. + + the size of the Set associated with key once val is added to it. + + + + A variety of high efficiencly bit twiddling routines. + + + $Id$ + + + + Returns the number of bits set in the long + + + Returns the number of set bits in an array of longs. + + + Returns the popcount or cardinality of the two sets after an intersection. + Neither array is modified. + + + + Returns the popcount or cardinality of the union of two sets. + Neither array is modified. + + + + Returns the popcount or cardinality of A & ~B + Neither array is modified. + + + + table of number of trailing zeros in a byte + + + Returns number of trailing zeros in a 64 bit long value. + + + Returns number of trailing zeros in a 32 bit int value. + + + returns 0 based index of first set bit + (only works for x!=0) +
      This is an alternate implementation of ntz() +
      +
      + + returns 0 based index of first set bit +
      This is an alternate implementation of ntz() +
      +
      + + returns true if v is a power of two or zero + + + returns true if v is a power of two or zero + + + returns the next highest power of two, or the current value if it's already a power of two or zero + + + returns the next highest power of two, or the current value if it's already a power of two or zero + + + Writes bytes through to a primary IndexOutput, computing + checksum. Note that you cannot use seek(). + + + + Starts but does not complete the commit of this file (= + writing of the final checksum at the end). After this + is called must call and the + to complete the commit. + + + + See + + + Matches spans containing a term. + + + Construct a SpanTermQuery matching the named term's spans. + + + Return the term whose spans are matched. + + + Returns a collection of all terms matched by this query. + use extractTerms instead + + + + + + Expert: an enumeration of span matches. Used to implement span searching. + Each span represents a range of term positions within a document. Matches + are enumerated in order, by increasing document number, within that by + increasing start position and finally by increasing end position. + + + + Move to the next match, returning true iff any such exists. + + + Skips to the first match beyond the current, whose document number is + greater than or equal to target.

      Returns true iff there is such + a match.

      Behaves as if written: + boolean skipTo(int target) { + do { + if (!next()) + return false; + } while (target > doc()); + return true; + } + + Most implementations are considerably more efficient than that. +

      +
      + + Returns the document number of the current match. Initially invalid. + + + Returns the start position of the current match. Initially invalid. + + + Returns the end position of the current match. Initially invalid. + + + Returns the payload data for the current span. + This is invalid until is called for + the first time. + This method must not be called more than once after each call + of . However, most payloads are loaded lazily, + so if the payload data for the current position is not needed, + this method may not be called at all for performance reasons. An ordered + SpanQuery does not lazy load, so if you have payloads in your index and + you do not want ordered SpanNearQuerys to collect payloads, you can + disable collection with a constructor option.
      + + Note that the return type is a collection, thus the ordering should not be relied upon. +
      +

      + WARNING: The status of the Payloads feature is experimental. + The APIs introduced here might change in the future and will not be + supported anymore in such a case.

      + +

      + a List of byte arrays containing the data of this payload, otherwise null if isPayloadAvailable is false + + java.io.IOException +
      + + Checks if a payload can be loaded at this position. +

      + Payloads can only be loaded once per call to + . + +

      + true if there is a payload available at this position that can be loaded + +
      + + A wrapper for , that exposes its + functionality as a . +

      + MultiTermQueryWrapperFilter is not designed to + be used by itself. Normally you subclass it to provide a Filter + counterpart for a subclass. +

      + For example, and extend + MultiTermQueryWrapperFilter. + This class also provides the functionality behind + ; + this is why it is not abstract. +

      +
      + + Wrap a as a Filter. + + + Expert: Return the number of unique terms visited during execution of the filter. + If there are many of them, you may consider using another filter type + or optimize your total term count in index. +

      This method is not thread safe, be sure to only call it when no filter is running! + If you re-use the same filter instance for another + search, be sure to first reset the term counter + with . +

      + + +
      + + Expert: Resets the counting of unique terms. + Do this before executing the filter. + + + + + + Returns a BitSet with true for documents which should be + permitted in search results, and false for those that should + not. + + Use instead. + + + + Returns a DocIdSet with documents that should be + permitted in search results. + + + + Expert: a FieldComparator compares hits so as to determine their + sort order when collecting the top results with + . The concrete public FieldComparator + classes here correspond to the SortField types. + +

      This API is designed to achieve high performance + sorting, by exposing a tight interaction with + as it visits hits. Whenever a hit is + competitive, it's enrolled into a virtual slot, which is + an int ranging from 0 to numHits-1. The + is made aware of segment transitions + during searching in case any internal state it's tracking + needs to be recomputed during these transitions.

      + +

      A comparator must define these functions:

      + + + + Compare a hit at 'slot a' + with hit 'slot b'. + + This method is called by + to notify the + FieldComparator of the current weakest ("bottom") + slot. Note that this slot may not hold the weakest + value according to your comparator, in cases where + your comparator is not the primary one (ie, is only + used to break ties from the comparators before it). + + Compare a new hit (docID) + against the "weakest" (bottom) entry in the queue. + + Installs a new hit into the + priority queue. The + calls this method when a new hit is competitive. + + Invoked + when the search is switching to the next segment. + You may need to update internal state of the + comparator, for example retrieving new values from + the . + + Return the sort value stored in + the specified slot. This is only called at the end + of the search, in order to populate + when returning the top results. + + + NOTE: This API is experimental and might change in + incompatible ways in the next release. +

      +
      + + Compare hit at slot1 with hit at slot2. + + + first slot to compare + + second slot to compare + + any N < 0 if slot2's value is sorted after + slot1, any N > 0 if the slot2's value is sorted before + slot1 and 0 if they are equal + + + + Set the bottom slot, ie the "weakest" (sorted last) + entry in the queue. When is + called, you should compare against this slot. This + will always be called before . + + + the currently weakest (sorted last) slot in the queue + + + + Compare the bottom of the queue with doc. This will + only invoked after setBottom has been called. This + should return the same result as + } as if bottom were slot1 and the new + document were slot 2. + +

      For a search that hits many results, this method + will be the hotspot (invoked by far the most + frequently).

      + +

      + that was hit + + any N < 0 if the doc's value is sorted after + the bottom entry (not competitive), any N > 0 if the + doc's value is sorted before the bottom entry and 0 if + they are equal. + +
      + + This method is called when a new hit is competitive. + You should copy any state associated with this document + that will be required for future comparisons, into the + specified slot. + + + which slot to copy the hit to + + docID relative to current reader + + + + Set a new Reader. All doc correspond to the current Reader. + + + current reader + + docBase of this reader + + IOException + IOException + + + Sets the Scorer to use in case a document's score is + needed. + + + Scorer instance that you should use to + obtain the current hit's score, if necessary. + + + + Return the actual value in the slot. + + + the value + + value in this slot upgraded to Comparable + + + + Parses field's values as byte (using + and sorts by ascending value + + + + Sorts by ascending docID + + + Parses field's values as double (using + and sorts by ascending value + + + + Parses field's values as float (using + and sorts by ascending value + + + + Parses field's values as int (using + and sorts by ascending value + + + + Parses field's values as long (using + and sorts by ascending value + + + + Sorts by descending relevance. NOTE: if you are + sorting only by descending relevance and then + secondarily by ascending docID, peformance is faster + using directly (which + uses when no is + specified). + + + + Parses field's values as short (using ) + and sorts by ascending value + + + + Sorts by a field's value using the Collator for a + given Locale. + + + + Sorts by field's natural String sort order, using + ordinals. This is functionally equivalent to + , but it first resolves the string + to their relative ordinal positions (using the index + returned by ), and + does most comparisons using the ordinals. For medium + to large results, this comparator will be much faster + than . For very small + result sets it may be slower. + + + + Sorts by field's natural String sort order. All + comparisons are done using String.compareTo, which is + slow for medium to large result sets but possibly + very fast for very small results sets. + + + + Token Manager. + + + Token literal values and constants. + Generated by org.javacc.parser.OtherFilesGen#start() + + + + End of File. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + RegularExpression Id. + + + Lexical state. + + + Lexical state. + + + Lexical state. + + + Lexical state. + + + Literal token values. + + + Debug output. + + + Set debug output. + + + Token literal values. + + + Lexer state names. + + + Lex State array. + + + Constructor. + + + Constructor. + + + Reinitialise parser. + + + Reinitialise parser. + + + Switch to specified lex state. + + + Get the next Token. + + + Implement this class to plug into the TermsHash + processor, which inverts and stores Tokens into a hash + table and provides an API for writing bytes into + multiple streams for each unique Token. + + + + Called once per field per document if term vectors + are enabled, to write the vectors to + RAMOutputStream, which is then quickly flushed to + the real term vectors files in the Directory. + + + + Used by DocumentsWriter to implemented a StringReader + that can be reset to a new string; we use this when + tokenizing the string value from a Field. + + + + Add a new thread + + + Abort (called after hitting AbortException) + + + Flush a new segment + + + Close doc stores + + + Attempt to free RAM, returning true if any RAM was + freed + + + + Implements the skip list writer for the default posting list format + that stores positions and payloads. + + + + + This abstract class writes skip lists with multiple levels. + + Example for skipInterval = 3: + c (skip level 2) + c c c (skip level 1) + x x x x x x x x x x (skip level 0) + d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d (posting list) + 3 6 9 12 15 18 21 24 27 30 (df) + + d - document + x - skip data + c - skip data with child pointer + + Skip level i contains every skipInterval-th entry from skip level i-1. + Therefore the number of entries on level i is: floor(df / ((skipInterval ^ (i + 1))). + + Each skip entry on a level i>0 contains a pointer to the corresponding skip entry in list i-1. + This guarantess a logarithmic amount of skips to find the target document. + + While this class takes care of writing the different skip levels, + subclasses must define the actual format of the skip data. + + + + + Subclasses must implement the actual skip data encoding in this method. + + + the level skip data shall be writting for + + the skip buffer to write to + + + + Writes the current skip data to the buffers. The current document frequency determines + the max level is skip data is to be written to. + + + the current document frequency + + IOException + + + Writes the buffered skip lists to the given output. + + + the IndexOutput the skip lists shall be written to + + the pointer the skip list starts + + + + Sets the values for the current skip data. + + + This exception is thrown when Lucene detects + an inconsistency in the index. + + + + + * Base utility class for implementing a . + * You subclass this, and then record mappings by calling + * , and then invoke the correct + * method to correct an offset. + + + + Subclasses of CharFilter can be chained to filter CharStream. + They can be used as with additional offset + correction. s will automatically use + if a CharFilter/CharStream subclass is used. + + + $Id$ + + + + + CharStream adds + functionality over . All Tokenizers accept a + CharStream instead of as input, which enables + arbitrary character based filtering before tokenization. + The method fixed offsets to account for + removal or insertion of characters, so that the offsets + reported in the tokens match the character offsets of the + original Reader. + + + + Called by CharFilter(s) and Tokenizer to correct token offset. + + + offset as seen in the output + + corrected offset based on the input + + + + Subclass may want to override to correct the current offset. + + + current offset + + corrected offset + + + + Chains the corrected offset through the input + CharFilter. + + + + Retrieve the corrected offset. + + + Class to encode java's UTF16 char[] into UTF8 byte[] + without always allocating a new byte[] as + String.getBytes("UTF-8") does. + +

      WARNING: This API is a new and experimental and + may suddenly change.

      +

      +
      + + Encode characters from a char[] source, starting at + offset and stopping when the character 0xffff is seen. + Returns the number of bytes written to bytesOut. + + + + Encode characters from a char[] source, starting at + offset for length chars. Returns the number of bytes + written to bytesOut. + + + + Encode characters from this String, starting at offset + for length characters. Returns the number of bytes + written to bytesOut. + + + + Convert UTF8 bytes into UTF16 characters. If offset + is non-zero, conversion starts at that starting point + in utf8, re-using the results from the previous call + up until offset. + + + + Simple lockless and memory barrier free String intern cache that is guaranteed + to return the same String instance as String.intern() does. + + + + Subclasses of StringInterner are required to + return the same single String object for all equal strings. + Depending on the implementation, this may not be + the same object returned as String.intern(). + + This StringInterner base class simply delegates to String.intern(). + + + + Returns a single object instance for each equal string. + + + Returns a single object instance for each equal string. + + + Size of the hash table, should be a power of two. + + Maximum length of each bucket, after which the oldest item inserted is dropped. + + + + This is a helper class to generate prefix-encoded representations for numerical values + and supplies converters to represent float/double values as sortable integers/longs. + +

      To quickly execute range queries in Apache Lucene, a range is divided recursively + into multiple intervals for searching: The center of the range is searched only with + the lowest possible precision in the trie, while the boundaries are matched + more exactly. This reduces the number of terms dramatically. + +

      This class generates terms to achive this: First the numerical integer values need to + be converted to strings. For that integer values (32 bit or 64 bit) are made unsigned + and the bits are converted to ASCII chars with each 7 bit. The resulting string is + sortable like the original integer value. Each value is also prefixed + (in the first char) by the shift value (number of bits removed) used + during encoding. + +

      To also index floating point numbers, this class supplies two methods to convert them + to integer values by changing their bit layout: , + . You will have no precision loss by + converting floating point numbers to integers and back (only that the integer form + is not usable). Other data types like dates can easily converted to longs or ints (e.g. + date to long: ). + +

      For easy usage, the trie algorithm is implemented for indexing inside + that can index int, long, + float, and double. For querying, + and implement the query part + for the same data types. + +

      This class can also be used, to generate lexicographically sortable (according + ) representations of numeric data types for other + usages (e.g. sorting). + +

      NOTE: This API is experimental and + might change in incompatible ways in the next release. + +

      + 2.9 + +
      + + The default precision step used by , , + , and as default + + + + Expert: The maximum term length (used for char[] buffer size) + for encoding long values. + + + + + + Expert: The maximum term length (used for char[] buffer size) + for encoding int values. + + + + + + Expert: Longs are stored at lower precision by shifting off lower bits. The shift count is + stored as SHIFT_START_LONG+shift in the first character + + + + Expert: Integers are stored at lower precision by shifting off lower bits. The shift count is + stored as SHIFT_START_INT+shift in the first character + + + + Expert: Returns prefix coded bits after reducing the precision by shift bits. + This is method is used by . + + the numeric value + + how many bits to strip from the right + + that will contain the encoded chars, must be at least of + length + + number of chars written to buffer + + + + Expert: Returns prefix coded bits after reducing the precision by shift bits. + This is method is used by . + + the numeric value + + how many bits to strip from the right + + + + This is a convenience method, that returns prefix coded bits of a long without + reducing the precision. It can be used to store the full precision value as a + stored field in index. +

      To decode, use . +

      +
      + + Expert: Returns prefix coded bits after reducing the precision by shift bits. + This is method is used by . + + the numeric value + + how many bits to strip from the right + + that will contain the encoded chars, must be at least of + length + + number of chars written to buffer + + + + Expert: Returns prefix coded bits after reducing the precision by shift bits. + This is method is used by . + + the numeric value + + how many bits to strip from the right + + + + This is a convenience method, that returns prefix coded bits of an int without + reducing the precision. It can be used to store the full precision value as a + stored field in index. +

      To decode, use . +

      +
      + + Returns a long from prefixCoded characters. + Rightmost bits will be zero for lower precision codes. + This method can be used to decode e.g. a stored field. + + NumberFormatException if the supplied string is + not correctly prefix encoded. + + + + + + Returns an int from prefixCoded characters. + Rightmost bits will be zero for lower precision codes. + This method can be used to decode e.g. a stored field. + + NumberFormatException if the supplied string is + not correctly prefix encoded. + + + + + + Converts a double value to a sortable signed long. + The value is converted by getting their IEEE 754 floating-point "double format" + bit layout and then some bits are swapped, to be able to compare the result as long. + By this the precision is not reduced, but the value can easily used as a long. + + + + + + Convenience method: this just returns: + longToPrefixCoded(doubleToSortableLong(val)) + + + + Converts a sortable long back to a double. + + + + + Convenience method: this just returns: + sortableLongToDouble(prefixCodedToLong(val)) + + + + Converts a float value to a sortable signed int. + The value is converted by getting their IEEE 754 floating-point "float format" + bit layout and then some bits are swapped, to be able to compare the result as int. + By this the precision is not reduced, but the value can easily used as an int. + + + + + + Convenience method: this just returns: + intToPrefixCoded(floatToSortableInt(val)) + + + + Converts a sortable int back to a float. + + + + + Convenience method: this just returns: + sortableIntToFloat(prefixCodedToInt(val)) + + + + Expert: Splits a long range recursively. + You may implement a builder that adds clauses to a + for each call to its + + method. +

      This method is used by . +

      +
      + + Expert: Splits an int range recursively. + You may implement a builder that adds clauses to a + for each call to its + + method. +

      This method is used by . +

      +
      + + This helper does the splitting for both 32 and 64 bit. + + + Helper that delegates to correct range builder + + + Expert: Callback for . + You need to overwrite only one of the methods. +

      NOTE: This is a very low-level interface, + the method signatures may change in later versions. +

      +
      + + Overwrite this method, if you like to receive the already prefix encoded range bounds. + You can directly build classical (inclusive) range queries from them. + + + + Overwrite this method, if you like to receive the raw long range bounds. + You can use this for e.g. debugging purposes (print out range bounds). + + + + Expert: Callback for . + You need to overwrite only one of the methods. +

      NOTE: This is a very low-level interface, + the method signatures may change in later versions. +

      +
      + + Overwrite this method, if you like to receive the already prefix encoded range bounds. + You can directly build classical range (inclusive) queries from them. + + + + Overwrite this method, if you like to receive the raw int range bounds. + You can use this for e.g. debugging purposes (print out range bounds). + + + + Provides support for converting byte sequences to Strings and back again. + The resulting Strings preserve the original byte sequences' sort order. + + The Strings are constructed using a Base 8000h encoding of the original + binary data - each char of an encoded String represents a 15-bit chunk + from the byte sequence. Base 8000h was chosen because it allows for all + lower 15 bits of char to be used without restriction; the surrogate range + [U+D8000-U+DFFF] does not represent valid chars, and would require + complicated handling to avoid them and allow use of char's high bit. + + Although unset bits are used as padding in the final char, the original + byte sequence could contain trailing bytes with no set bits (null bytes): + padding is indistinguishable from valid information. To overcome this + problem, a char is appended, indicating the number of encoded bytes in the + final content char. + + This class's operations are defined over CharBuffers and ByteBuffers, to + allow for wrapped arrays to be reused, reducing memory allocation costs for + repeated operations. Note that this class calls array() and arrayOffset() + on the CharBuffers and ByteBuffers it uses, so only wrapped arrays may be + used. This class interprets the arrayOffset() and limit() values returned by + its input buffers as beginning and end+1 positions on the wrapped array, + resprectively; similarly, on the output buffer, arrayOffset() is the first + position written to, and limit() is set to one past the final output array + position. + + + + Returns the number of chars required to encode the given byte sequence. + + + The byte sequence to be encoded. Must be backed by an array. + + The number of chars required to encode the given byte sequence + + IllegalArgumentException If the given ByteBuffer is not backed by an array + + + Returns the number of bytes required to decode the given char sequence. + + + The char sequence to be encoded. Must be backed by an array. + + The number of bytes required to decode the given char sequence + + IllegalArgumentException If the given CharBuffer is not backed by an array + + + Encodes the input byte sequence into the output char sequence. Before + calling this method, ensure that the output CharBuffer has sufficient + capacity by calling . + + + The byte sequence to encode + + Where the char sequence encoding result will go. The limit + is set to one past the position of the final char. + + IllegalArgumentException If either the input or the output buffer + is not backed by an array + + + + Decodes the input char sequence into the output byte sequence. Before + calling this method, ensure that the output ByteBuffer has sufficient + capacity by calling . + + + The char sequence to decode + + Where the byte sequence decoding result will go. The limit + is set to one past the position of the final char. + + IllegalArgumentException If either the input or the output buffer + is not backed by an array + + + + Decodes the given char sequence, which must have been encoded by + or + . + + + The char sequence to decode + + A byte sequence containing the decoding result. The limit + is set to one past the position of the final char. + + IllegalArgumentException If the input buffer is not backed by an + array + + + + Encodes the input byte sequence. + + + The byte sequence to encode + + A char sequence containing the encoding result. The limit is set + to one past the position of the final char. + + IllegalArgumentException If the input buffer is not backed by an + array + + + + Java's builtin ThreadLocal has a serious flaw: + it can take an arbitrarily long amount of time to + dereference the things you had stored in it, even once the + ThreadLocal instance itself is no longer referenced. + This is because there is single, master map stored for + each thread, which all ThreadLocals share, and that + master map only periodically purges "stale" entries. + + While not technically a memory leak, because eventually + the memory will be reclaimed, it can take a long time + and you can easily hit OutOfMemoryError because from the + GC's standpoint the stale entries are not reclaimaible. + + This class works around that, by only enrolling + WeakReference values into the ThreadLocal, and + separately holding a hard reference to each stored + value. When you call , these hard + references are cleared and then GC is freely able to + reclaim space by objects stored in it. + + + + + File-based implementation that uses + mmap for reading, and + for writing. + +

      NOTE: memory mapping uses up a portion of the + virtual memory address space in your process equal to the + size of the file being mapped. Before using this class, + be sure your have plenty of virtual address space, e.g. by + using a 64 bit JRE, or a 32 bit JRE with indexes that are + guaranteed to fit within the address space. + On 32 bit platforms also consult + if you have problems with mmap failing because of fragmented + address space. If you get an OutOfMemoryException, it is recommened + to reduce the chunk size, until it works. + +

      Due to + this bug in Sun's JRE, MMapDirectory's + is unable to close the underlying OS file handle. Only when GC + finally collects the underlying objects, which could be quite + some time later, will the file handle be closed. + +

      This will consume additional transient disk usage: on Windows, + attempts to delete or overwrite the files will result in an + exception; on other platforms, which typically have a "delete on + last close" semantics, while such operations will succeed, the bytes + are still consuming space on disk. For many applications this + limitation is not a problem (e.g. if you have plenty of disk space, + and you don't rely on overwriting files on Windows) but it's still + an important limitation to be aware of. + +

      This class supplies the workaround mentioned in the bug report + (disabled by default, see ), which may fail on + non-Sun JVMs. It forcefully unmaps the buffer on close by using + an undocumented internal cleanup functionality. + is true, if the workaround + can be enabled (with no guarantees). +

      +
      + + Create a new MMapDirectory for the named location. + + + the path of the directory + + the lock factory to use, or null for the default. + + IOException + + + Create a new MMapDirectory for the named location. + + + the path of the directory + + the lock factory to use, or null for the default. + + IOException + + + Create a new MMapDirectory for the named location and the default lock factory. + + + the path of the directory + + IOException + + + Create a new MMapDirectory for the named location and the default lock factory. + + + the path of the directory + + IOException + + + + + + + true, if this platform supports unmapping mmaped files. + + + This method enables the workaround for unmapping the buffers + from address space after closing , that is + mentioned in the bug report. This hack may fail on non-Sun JVMs. + It forcefully unmaps the buffer on close by using + an undocumented internal cleanup functionality. +

      NOTE: Enabling this is completely unsupported + by Java and may lead to JVM crashs if IndexInput + is closed while another thread is still accessing it (SIGSEGV). +

      + IllegalArgumentException if + is false and the workaround cannot be enabled. + +
      + + Returns true, if the unmap workaround is enabled. + + + + + Try to unmap the buffer, this method silently fails if no support + for that in the JVM. On Windows, this leads to the fact, + that mmapped files cannot be modified or deleted. + + + + Sets the maximum chunk size (default is for + 64 bit JVMs and 256 MiBytes for 32 bit JVMs) used for memory mapping. + Especially on 32 bit platform, the address space can be very fragmented, + so large index files cannot be mapped. + Using a lower chunk size makes the directory implementation a little + bit slower (as the correct chunk must be resolved on each seek) + but the chance is higher that mmap does not fail. On 64 bit + Java platforms, this parameter should always be , + as the adress space is big enough. + + + + Returns the current mmap chunk size. + + + + + Creates an IndexInput for the file with the given name. + + + Creates an IndexOutput for the file with the given name. + + + This exception is thrown when the write.lock + could not be acquired. This + happens when a writer tries to open an index + that another writer already has open. + + + + + + This exception is thrown when there is an attempt to + access something that has already been closed. + + + + The is used to timeout search requests that + take longer than the maximum allowed search time limit. After this time is + exceeded, the search thread is stopped by throwing a + . + + + + Default timer resolution. + + + + + Default for . + + + + + Create a TimeLimitedCollector wrapper over another with a specified timeout. + the wrapped + + max time allowed for collecting hits after which is thrown + + + + Return the timer resolution. + + + + + Set the timer resolution. + The default timer resolution is 20 milliseconds. + This means that a search required to take no longer than + 800 milliseconds may be stopped after 780 to 820 milliseconds. +
      Note that: + + Finer (smaller) resolution is more accurate but less efficient. + Setting resolution to less than 5 milliseconds will be silently modified to 5 milliseconds. + Setting resolution smaller than current resolution might take effect only after current + resolution. (Assume current resolution of 20 milliseconds is modified to 5 milliseconds, + then it can take up to 20 milliseconds for the change to have effect. + +
      +
      + + Checks if this time limited collector is greedy in collecting the last hit. + A non greedy collector, upon a timeout, would throw a + without allowing the wrapped collector to collect current doc. A greedy one would + first allow the wrapped hit collector to collect current doc and only then + throw a . + + + + + + Sets whether this time limited collector is greedy. + true to make this time limited greedy + + + + + + Calls on the decorated + unless the allowed time has passed, in which case it throws an exception. + + + TimeExceededException + if the time allowed has exceeded. + + + + + Support class used to handle threads + + + + + This interface should be implemented by any class whose instances are intended + to be executed by a thread. + + + + + This method has to be implemented in order that starting of the thread causes the object's + run method to be called in that separately executing thread. + + + + + Contains conversion support elements such as classes, interfaces and static methods. + + + + + Copies an array of chars obtained from a String into a specified array of chars + + The String to get the chars from + Position of the String to start getting the chars + Position of the String to end getting the chars + Array to return the chars + Position of the destination array of chars to start storing the chars + An array of chars + + + + Support class used to handle threads + + + + + The instance of System.Threading.Thread + + + + + Initializes a new instance of the ThreadClass class + + + + + Initializes a new instance of the Thread class. + + The name of the thread + + + + Initializes a new instance of the Thread class. + + A ThreadStart delegate that references the methods to be invoked when this thread begins executing + + + + Initializes a new instance of the Thread class. + + A ThreadStart delegate that references the methods to be invoked when this thread begins executing + The name of the thread + + + + This method has no functionality unless the method is overridden + + + + + Causes the operating system to change the state of the current thread instance to ThreadState.Running + + + + + Interrupts a thread that is in the WaitSleepJoin thread state + + + + + Blocks the calling thread until a thread terminates + + + + + Blocks the calling thread until a thread terminates or the specified time elapses + + Time of wait in milliseconds + + + + Blocks the calling thread until a thread terminates or the specified time elapses + + Time of wait in milliseconds + Time of wait in nanoseconds + + + + Resumes a thread that has been suspended + + + + + Raises a ThreadAbortException in the thread on which it is invoked, + to begin the process of terminating the thread. Calling this method + usually terminates the thread + + + + + Raises a ThreadAbortException in the thread on which it is invoked, + to begin the process of terminating the thread while also providing + exception information about the thread termination. + Calling this method usually terminates the thread. + + An object that contains application-specific information, such as state, which can be used by the thread being aborted + + + + Suspends the thread, if the thread is already suspended it has no effect + + + + + Obtain a String that represents the current object + + A String that represents the current object + + + + Gets the currently running thread + + The currently running thread + + + + Gets the current thread instance + + + + + Gets or sets the name of the thread + + + + + Gets or sets a value indicating the scheduling priority of a thread + + + + + Gets a value indicating the execution status of the current thread + + + + + Gets or sets a value indicating whether or not a thread is a background thread. + + + + + Represents the methods to support some operations over files. + + + + + Returns an array of abstract pathnames representing the files and directories of the specified path. + + The abstract pathname to list it childs. + An array of abstract pathnames childs of the path specified or null if the path is not a directory + + + + Returns a list of files in a give directory. + + The full path name to the directory. + + An array containing the files. + + + + Flushes the specified file stream. Ensures that all buffered + data is actually written to the file system. + + The file stream. + + + + A simple class for number conversions. + + + + + Min radix value. + + + + + Max radix value. + + + + + Converts a number to System.String. + + + + + + + Converts a number to System.String. + + + + + + + Converts a number to System.String in the specified radix. + + A number to be converted. + A radix. + A System.String representation of the number in the specified redix. + + + + Parses a number in the specified radix. + + An input System.String. + A radix. + The parsed number in the specified radix. + + + + Performs an unsigned bitwise right shift with the specified number + + Number to operate on + Ammount of bits to shift + The resulting number from the shift operation + + + + Performs an unsigned bitwise right shift with the specified number + + Number to operate on + Ammount of bits to shift + The resulting number from the shift operation + + + + Returns the index of the first bit that is set to true that occurs + on or after the specified starting index. If no such bit exists + then -1 is returned. + + The BitArray object. + The index to start checking from (inclusive). + The index of the next set bit. + + + + Converts a System.String number to long. + + + + + + + Mimics Java's Character class. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This class provides supporting methods of java.util.BitSet + that are not present in System.Collections.BitArray. + + + + + Returns the next set bit at or after index, or -1 if no such bit exists. + + + the index of bit array at which to start checking + the next set bit or -1 + + + + Returns the next un-set bit at or after index, or -1 if no such bit exists. + + + the index of bit array at which to start checking + the next set bit or -1 + + + + Returns the number of bits set to true in this BitSet. + + The BitArray object. + The number of bits set to true in this BitSet. + + + + Summary description for TestSupportClass. + + + + + Compares two Term arrays for equality. + + First Term array to compare + Second Term array to compare + true if the Terms are equal in both arrays, false otherwise + + + + A Hashtable which holds weak references to its keys so they + can be collected during GC. + + + + + Serves as a simple "GC Monitor" that indicates whether cleanup is needed. + If collectableObject.IsAlive is false, GC has occurred and we should perform cleanup + + + + + Customize the hashtable lookup process by overriding KeyEquals. KeyEquals + will compare both WeakKey to WeakKey and WeakKey to real keys + + + + + Perform cleanup if GC occurred + + + + + Iterate over all keys and remove keys that were collected + + + + + Wrap each key with a WeakKey and add it to the hashtable + + + + + Create a temporary copy of the real keys and return that + + + + + A weak referene wrapper for the hashtable keys. Whenever a key\value pair + is added to the hashtable, the key is wrapped using a WeakKey. WeakKey saves the + value of the original object hashcode for fast comparison. + + + + + A Dictionary enumerator which wraps the original hashtable enumerator + and performs 2 tasks: Extract the real key from a WeakKey and skip keys + that were already collected. + + + + + Support class used to handle Hashtable addition, which does a check + first to make sure the added item is unique in the hash. + + + + + Converts the specified collection to its string representation. + + The collection to convert to string. + A string representation of the specified collection. + + + + Compares two string arrays for equality. + + First string array list to compare + Second string array list to compare + true if the strings are equal in both arrays, false otherwise + + + + Sorts an IList collections + + The System.Collections.IList instance that will be sorted + The Comparator criteria, null to use natural comparator. + + + + Fills the array with an specific value from an specific index to an specific index. + + The array to be filled. + The first index to be filled. + The last index to be filled. + The value to fill the array with. + + + + Fills the array with an specific value. + + The array to be filled. + The value to fill the array with. + + + + Compares the entire members of one array whith the other one. + + The array to be compared. + The array to be compared with. + Returns true if the two specified arrays of Objects are equal + to one another. The two arrays are considered equal if both arrays + contain the same number of elements, and all corresponding pairs of + elements in the two arrays are equal. Two objects e1 and e2 are + considered equal if (e1==null ? e2==null : e1.equals(e2)). In other + words, the two arrays are equal if they contain the same elements in + the same order. Also, two array references are considered equal if + both are null. + + + A collection of which can be + looked up by instances of . + The type of the items contains in this + collection. + The type of the keys that can be used to look + up the items. + + + Creates a new instance of the + class. + The which will convert + instances of to + when the override of is called. + + + The which will convert + instances of to + when the override of is called. + + + Converts an item that is added to the collection to + a key. + The instance of + to convert into an instance of . + The instance of which is the + key for this item. + + + Determines if a key for an item exists in this + collection. + The instance of + to see if it exists in this collection. + True if the key exists in the collection, false otherwise. + + + Represents a strongly typed list of objects that can be accessed by index. + Provides methods to search, sort, and manipulate lists. Also provides functionality + to compare lists against each other through an implementations of + . + The type of elements in the list. + + + Initializes a new instance of the + class that is empty and has the + default initial capacity. + + + Initializes a new instance of the + class that contains elements copied from the specified collection and has + sufficient capacity to accommodate the number of elements copied. + The collection whose elements are copied to the new list. + + + Initializes a new instance of the + class that is empty and has the specified initial capacity. + The number of elements that the new list can initially store. + + + Adds a range of objects represented by the + implementation. + The + implementation to add to this list. + + + Compares the counts of two + implementations. + This uses a trick in LINQ, sniffing types for implementations + of interfaces that might supply shortcuts when trying to make comparisons. + In this case, that is the and + interfaces, either of which can provide a count + which can be used in determining the equality of sequences (if they don't have + the same count, then they can't be equal). + The from the left hand side of the + comparison to check the count of. + The from the right hand side of the + comparison to check the count of. + Null if the result is indeterminate. This occurs when either + or doesn't implement or . + Otherwise, it will get the count from each and return true if they are equal, false otherwise. + + + Compares the contents of a + implementation to another one to determine equality. + Thinking of the implementation as + a string with any number of characters, the algorithm checks + each item in each list. If any item of the list is not equal (or + one list contains all the elements of another list), then that list + element is compared to the other list element to see which + list is greater. + The implementation + that is considered the left hand side. + The implementation + that is considered the right hand side. + True if the items are equal, false otherwise. + + + Compares this sequence to another + implementation, returning true if they are equal, false otherwise. + The other implementation + to compare against. + True if the sequence in + is the same as this one. + + + Compares this object for equality against other. + The other object to compare this object against. + True if this object and are equal, false + otherwise. + + + Gets the hash code for the list. + The hash code value. + + + Gets the hash code for the list. + The + implementation which will have all the contents hashed. + The hash code value. + + + Clones the . + This is a shallow clone. + A new shallow clone of this + . + + + + A simple wrapper to allow for the use of the GeneralKeyedCollection. The + wrapper is required as there can be several keys for an object depending + on how many interfaces it implements. + + + + + Provides platform infos. + + + + + Whether we run under a Unix platform. + + + + + Whether we run under a supported Windows platform. + + + + + For Debuging purposes. + + + + TimerThread provides a pseudo-clock service to all searching + threads, so that they can count elapsed time with less overhead + than repeatedly calling System.currentTimeMillis. A single + thread should be created to be used for all searches. + + + + Get the timer value in milliseconds. + + + Thrown when elapsed search time exceeds allowed search time. + + + Returns allowed time (milliseconds). + + + Returns elapsed time (milliseconds). + + + Returns last doc(absolute doc id) that was collected when the search time exceeded. + + + Expert: returns a comparator for sorting ScoreDocs. + +

      + Created: Apr 21, 2004 3:49:28 PM + + This class will be used as part of a key to a FieldCache value. You must + implement hashCode and equals to avoid an explosion in RAM usage if you use + instances that are not the same instance. If you are searching using the + Remote contrib, the same instance of this class on the client will be a new + instance on every call to the server, so hashCode/equals is very important in + that situation. + +

      + $Id: SortComparatorSource.java 747019 2009-02-23 13:59:50Z + mikemccand $ + + 1.4 + + Please use instead. + +
      + + Creates a comparator for the field in the given index. + Index to create comparator for. + + Name of the field to create comparator for. + + Comparator of ScoreDoc objects. + + IOException If an error occurs reading the index. + + + Abstract base class for sorting hits returned by a Query. + +

      + This class should only be used if the other SortField types (SCORE, DOC, + STRING, INT, FLOAT) do not provide an adequate sorting. It maintains an + internal cache of values which could be quite large. The cache is an array of + Comparable, one for each document in the index. There is a distinct + Comparable for each unique term in the field - if some documents have the + same term in the field, the cache array will have entries which reference the + same Comparable. + + This class will be used as part of a key to a FieldCache value. You must + implement hashCode and equals to avoid an explosion in RAM usage if you use + instances that are not the same instance. If you are searching using the + Remote contrib, the same instance of this class on the client will be a new + instance on every call to the server, so hashCode/equals is very important in + that situation. + +

      + Created: Apr 21, 2004 5:08:38 PM + + +

      + $Id: SortComparator.java 800119 2009-08-02 17:59:21Z markrmiller $ + + 1.4 + + Please use instead. + +
      + + Returns an object which, when sorted according to natural order, + will order the Term values in the correct order. +

      For example, if the Terms contained integer values, this method + would return new Integer(termtext). Note that this + might not always be the most efficient implementation - for this + particular example, a better implementation might be to make a + ScoreDocLookupComparator that uses an internal lookup table of int. +

      + The textual value of the term. + + An object representing termtext that sorts according to the natural order of termtext. + + + + + +
      + + Returns the maximum payload score seen, else 1 if there are no payloads on the doc. +

      + Is thread safe and completely reusable. + + +

      +
      + + An abstract class that defines a way for Payload*Query instances + to transform the cumulative effects of payload scores for a document. + + + for more information + +

      + This class and its derivations are experimental and subject to change + + + + + +

      Calculate the score up to this point for this doc and field + The current doc + + The field + + The start position of the matching Span + + The end position of the matching Span + + The number of payloads seen so far + + The current score so far + + The score for the current payload + + The new current Score + + + + +
      + + Calculate the final score for all the payloads seen so far for this doc/field + The current doc + + The current field + + The total number of payloads seen on this document + + The raw score for those payloads + + The final score for the payloads + + + + MessageBundles classes extend this class, to implement a bundle. + + For Native Language Support (NLS), system of software internationalization. + + This interface is similar to the NLS class in eclipse.osgi.util.NLS class - + initializeMessages() method resets the values of all static strings, should + only be called by classes that extend from NLS (see TestMessages.java for + reference) - performs validation of all message in a bundle, at class load + time - performs per message validation at runtime - see NLSTest.java for + usage reference + + MessageBundle classes may subclass this type. + + + + Initialize a given class with the message bundle Keys Should be called from + a class that extends NLS in a static block at class load time. + + + Property file with that contains the message bundle + + where constants will reside + + + + + + + + + + + + + + + - Message Key + + + + + Performs the priviliged action. + + A value that may represent the result of the action. + + + The TermVectorOffsetInfo class holds information pertaining to a Term in a 's + offset information. This offset information is the character offset as set during the Analysis phase (and thus may not be the actual offset in the + original content). + + + + Convenience declaration when creating a that stores only position information. + + + The accessor for the ending offset for the term + The offset + + + + The accessor for the starting offset of the term. + + + The offset + + + + Two TermVectorOffsetInfos are equals if both the start and end offsets are the same + The comparison Object + + true if both and are the same for both objects. + + + + A that simply does each merge + sequentially, using the current thread. + + + +

      Expert: uses an instance + implementing this interface to execute the merges + selected by a . The default + MergeScheduler is .

      + +

      NOTE: This API is new and still experimental + (subject to change suddenly in the next release)

      + +

      NOTE: This class typically requires access to + package-private APIs (eg, SegmentInfos) to do its job; + if you implement your own MergePolicy, you'll need to put + it in package Lucene.Net.Index in order to use + these APIs. +

      +
      + + Run the merges provided by . + + + Close this MergeScheduler. + + + Just do the merges in sequence. We do this + "synchronized" so that even if the application is using + multiple threads, only one merge may run at a time. + + + + This class tracks the number and position / offset parameters of terms + being added to the index. The information collected in this class is + also used to calculate the normalization factor for a field. + +

      WARNING: This API is new and experimental, and may suddenly + change.

      +

      +
      + + Re-initialize the state, using this boost value. + boost value to use. + + + + Get the last processed term position. + the position + + + + Get total number of terms in this field. + the length + + + + Get the number of terms with positionIncrement == 0. + the numOverlap + + + + Get end offset of the last processed term. + the offset + + + + Get boost value. This is the cumulative product of + document boost and field boost for all field instances + sharing the same field name. + + the boost + + + + The term text of a Token. + + + Base class for Attributes that can be added to a + . +

      + Attributes are used to add data in a dynamic, yet type-safe way to a source + of usually streamed objects, e. g. a . +

      +
      + + Clears the values in this AttributeImpl and resets it to its + default value. If this implementation implements more than one Attribute interface + it clears all. + + + + The default implementation of this method accesses all declared + fields of this object and prints the values in the following syntax: + + + public String toString() { + return "start=" + startOffset + ",end=" + endOffset; + } + + + This method may be overridden by subclasses. + + + + Subclasses must implement this method and should compute + a hashCode similar to this: + + public int hashCode() { + int code = startOffset; + code = code * 31 + endOffset; + return code; + } + + + see also + + + + All values used for computation of + should be checked here for equality. + + see also + + + + Copies the values from this Attribute into the passed-in + target attribute. The target implementation must support all the + Attributes this implementation supports. + + + + Shallow clone. Subclasses must override this if they + need to clone any members deeply, + + + + The term text of a Token. + + + Returns the Token's term text. + + This method has a performance penalty + because the text is stored internally in a char[]. If + possible, use and + directly instead. If you really need a + String, use this method, which is nothing more than + a convenience call to new String(token.termBuffer(), 0, token.termLength()) + + + + Copies the contents of buffer, starting at offset for + length characters, into the termBuffer array. + + the buffer to copy + + the index in the buffer of the first character to copy + + the number of characters to copy + + + + Copies the contents of buffer into the termBuffer array. + the buffer to copy + + + + Copies the contents of buffer, starting at offset and continuing + for length characters, into the termBuffer array. + + the buffer to copy + + the index in the buffer of the first character to copy + + the number of characters to copy + + + + Returns the internal termBuffer character array which + you can then directly alter. If the array is too + small for your token, use + to increase it. After + altering the buffer be sure to call + to record the number of valid + characters that were placed into the termBuffer. + + + + Grows the termBuffer to at least size newSize, preserving the + existing content. Note: If the next operation is to change + the contents of the term buffer use + , + , or + + to optimally combine the resize with the setting of the termBuffer. + + minimum size of the new termBuffer + + newly created termBuffer with length >= newSize + + + + Return number of valid characters (length of the term) + in the termBuffer array. + + + + Set number of valid characters (length of the term) in + the termBuffer array. Use this to truncate the termBuffer + or to synchronize with external manipulation of the termBuffer. + Note: to grow the size of the array, + use first. + + the truncated length + + + + Returns the Token's term text. + + This method has a performance penalty + because the text is stored internally in a char[]. If + possible, use and + directly instead. If you + really need a String, use this method, which is nothing more than + a convenience call to new String(token.termBuffer(), 0, token.termLength()) + + + + Copies the contents of buffer, starting at offset for + length characters, into the termBuffer array. + + the buffer to copy + + the index in the buffer of the first character to copy + + the number of characters to copy + + + + Copies the contents of buffer into the termBuffer array. + the buffer to copy + + + + Copies the contents of buffer, starting at offset and continuing + for length characters, into the termBuffer array. + + the buffer to copy + + the index in the buffer of the first character to copy + + the number of characters to copy + + + + Returns the internal termBuffer character array which + you can then directly alter. If the array is too + small for your token, use + to increase it. After + altering the buffer be sure to call + to record the number of valid + characters that were placed into the termBuffer. + + + + Grows the termBuffer to at least size newSize, preserving the + existing content. Note: If the next operation is to change + the contents of the term buffer use + , + , or + + to optimally combine the resize with the setting of the termBuffer. + + minimum size of the new termBuffer + + newly created termBuffer with length >= newSize + + + + Allocates a buffer char[] of at least newSize, without preserving the existing content. + its always used in places that set the content + + minimum size of the buffer + + + + Return number of valid characters (length of the term) + in the termBuffer array. + + + + Set number of valid characters (length of the term) in + the termBuffer array. Use this to truncate the termBuffer + or to synchronize with external manipulation of the termBuffer. + Note: to grow the size of the array, + use first. + + the truncated length + + + + This class can be used if the token attributes of a TokenStream + are intended to be consumed more than once. It caches + all token attribute states locally in a List. + +

      CachingTokenFilter implements the optional method + , which repositions the + stream to the first Token. +

      +
      + + Will be removed in Lucene 3.0. This method is final, as it should + not be overridden. Delegates to the backwards compatibility layer. + + + + Will be removed in Lucene 3.0. This method is final, as it should + not be overridden. Delegates to the backwards compatibility layer. + + + + Methods for manipulating strings. + + $Id: StringHelper.java 801344 2009-08-05 18:05:06Z yonik $ + + + + Expert: + The StringInterner implementation used by Lucene. + This shouldn't be changed to an incompatible implementation after other Lucene APIs have been used. + + + + Return the same string object for all equal strings + + + Compares two byte[] arrays, element by element, and returns the + number of elements common to both arrays. + + + The first byte[] to compare + + + The second byte[] to compare + + + The number of common elements. + + + + Compares two strings, character by character, and returns the + first position where the two strings differ from one another. + + + The first string to compare + + The second string to compare + + The first position where the two strings differ. + + + + Base class for cache implementations. + + + Returns a thread-safe cache backed by the specified cache. + In order to guarantee thread-safety, all access to the backed cache must + be accomplished through the returned cache. + + + + Called by . This method + returns a instance that wraps + this instance by default and can be overridden to return + e. g. subclasses of or this + in case this cache is already synchronized. + + + + Puts a (key, value)-pair into the cache. + + + Returns the value for the given key. + + + Returns whether the given key is in this cache. + + + Closes the cache. + + + Simple Cache wrapper that synchronizes all + calls that access the cache. + + + + Implements for a single in-process instance, + meaning all locking will take place through this one instance. + Only use this when you are certain all + IndexReaders and IndexWriters for a given index are running + against a single shared in-process Directory instance. This is + currently the default locking for RAMDirectory. + + + + + + + An interprocess mutex lock. +

      Typical use might look like: + new Lock.With(directory.makeLock("my.lock")) { + public Object doBody() { + ... code to execute while locked ... + } + }.run(); + + + +

      + $Id: Lock.java 769409 2009-04-28 14:05:43Z mikemccand $ + + + +
      + + Pass this value to to try + forever to obtain the lock. + + + + How long waits, in milliseconds, + in between attempts to acquire the lock. + + + + Attempts to obtain exclusive access and immediately return + upon success or failure. + + true iff exclusive access is obtained + + + + If a lock obtain called, this failureReason may be set + with the "root cause" Exception as to why the lock was + not obtained. + + + + Attempts to obtain an exclusive lock within amount of + time given. Polls once per + (currently 1000) milliseconds until lockWaitTimeout is + passed. + + length of time to wait in + milliseconds or + to retry forever + + true if lock was obtained + + LockObtainFailedException if lock wait times out + IllegalArgumentException if lockWaitTimeout is + out of bounds + + IOException if obtain() throws IOException + + + Releases exclusive access. + + + Returns true if the resource is currently locked. Note that one must + still call before using the resource. + + + + Utility class for executing code with exclusive access. + + + Constructs an executor that will grab the named lock. + + + Code to execute with exclusive access. + + + Calls while lock is obtained. Blocks if lock + cannot be obtained immediately. Retries to obtain lock once per second + until it is obtained, or until it has tried ten times. Lock is released when + exits. + + LockObtainFailedException if lock could not + be obtained + + IOException if throws IOException + + + A that sorts by using + s. +

      + See the method + for instantiating a TopFieldCollector. + +

      NOTE: This API is experimental and might change in + incompatible ways in the next release.

      +

      +
      + + A base class for all collectors that return a output. This + collector allows easy extension by providing a single constructor which + accepts a as well as protected members for that + priority queue and a counter of the number of total hits.
      + Extending classes can override and + in order to provide their own implementation. +
      +
      + + The priority queue which holds the top documents. Note that different + implementations of PriorityQueue give different meaning to 'top documents'. + HitQueue for example aggregates the top scoring documents, while other PQ + implementations may hold documents sorted by other criteria. + + + + The total number of documents that the collector encountered. + + + Populates the results array with the ScoreDoc instaces. This can be + overridden in case a different ScoreDoc type should be returned. + + + + Returns a instance containing the given results. If + results is null it means there are no results to return, + either because there were 0 calls to collect() or because the arguments to + topDocs were invalid. + + + + The total number of documents that matched this query. + + + Returns the top docs that were collected by this collector. + + + Returns the documents in the rage [start .. pq.size()) that were collected + by this collector. Note that if start >= pq.size(), an empty TopDocs is + returned.
      + This method is convenient to call if the application allways asks for the + last results, starting from the last 'page'.
      + NOTE: you cannot call this method more than once for each search + execution. If you need to call it more than once, passing each time a + different start, you should call and work + with the returned object, which will contain all the + results this search execution collected. +
      +
      + + Returns the documents in the rage [start .. start+howMany) that were + collected by this collector. Note that if start >= pq.size(), an empty + TopDocs is returned, and if pq.size() - start < howMany, then only the + available documents in [start .. pq.size()) are returned.
      + This method is useful to call in case pagination of search results is + allowed by the search application, as well as it attempts to optimize the + memory used by allocating only as much as requested by howMany.
      + NOTE: you cannot call this method more than once for each search + execution. If you need to call it more than once, passing each time a + different range, you should call and work with the + returned object, which will contain all the results this + search execution collected. +
      +
      + + Creates a new from the given + arguments. + +

      NOTE: The instances returned by this method + pre-allocate a full array of length + numHits. + +

      + the sort criteria (SortFields). + + the number of results to collect. + + specifies whether the actual field values should be returned on + the results (FieldDoc). + + specifies whether document scores should be tracked and set on the + results. Note that if set to false, then the results' scores will + be set to Float.NaN. Setting this to true affects performance, as + it incurs the score computation on each competitive result. + Therefore if document scores are not required by the application, + it is recommended to set it to false. + + specifies whether the query's maxScore should be tracked and set + on the resulting . Note that if set to false, + returns Float.NaN. Setting this to + true affects performance as it incurs the score computation on + each result. Also, setting this true automatically sets + trackDocScores to true as well. + + specifies whether documents are scored in doc Id order or not by + the given in . + + a instance which will sort the results by + the sort criteria. + + IOException +
      + + Calculate the final score as the average score of all payloads seen. +

      + Is thread safe and completely reusable. + + +

      +
      + + Implements search over a single IndexReader. + +

      Applications usually need only call the inherited + or methods. For performance reasons it is + recommended to open only one IndexSearcher and use it for all of your searches. + +

      Note that you can only access Hits from an IndexSearcher as long as it is + not yet closed, otherwise an IOException will be thrown. + +

      NOTE: + instances are completely + thread safe, meaning multiple threads can call any of its + methods, concurrently. If your application requires + external synchronization, you should not + synchronize on the IndexSearcher instance; + use your own (non-Lucene) objects instead.

      +

      +
      + + An abstract base class for search implementations. Implements the main search + methods. + +

      + Note that you can only access hits from a Searcher as long as it is not yet + closed, otherwise an IOException will be thrown. +

      +
      + + The interface for search implementations. + +

      + Searchable is the abstract network protocol for searching. Implementations + provide search over a single index, over multiple indices, and over indices + on remote servers. + +

      + Queries, filters and sort criteria are designed to be compact so that they + may be efficiently passed to a remote index, with only the top-scoring hits + being returned, rather than every matching hit. + + NOTE: this interface is kept public for convenience. Since it is not + expected to be implemented directly, it may be changed unexpectedly between + releases. +

      +
      + + Lower-level search API. + +

      is called for every non-zero + scoring document. +
      HitCollector-based access to remote indexes is discouraged. + +

      Applications should only use this if they need all of the + matching documents. The high-level search API () + is usually more efficient, as it skips + non-high-scoring hits. + +

      + to match documents + + if non-null, used to permit documents to be collected. + + to receive hits + + BooleanQuery.TooManyClauses + use instead. + +
      + + Lower-level search API. + +

      + is called for every document.
      + Collector-based access to remote indexes is discouraged. + +

      + Applications should only use this if they need all of the matching + documents. The high-level search API () is + usually more efficient, as it skips non-high-scoring hits. + +

      + to match documents + + if non-null, used to permit documents to be collected. + + to receive hits + + BooleanQuery.TooManyClauses +
      + + Frees resources associated with this Searcher. + Be careful not to call this method while you are still using objects + like . + + + + Expert: Returns the number of documents containing term. + Called by search code to compute term weights. + + + + + + Expert: For each term in the terms array, calculates the number of + documents containing term. Returns an array with these + document frequencies. Used to minimize number of remote calls. + + + + Expert: Returns one greater than the largest possible document number. + Called by search code to compute term weights. + + + + + + Expert: Low-level search implementation. Finds the top n + hits for query, applying filter if non-null. + +

      Called by . + +

      Applications should usually call or + instead. +

      + BooleanQuery.TooManyClauses +
      + + Expert: Returns the stored fields of document i. + Called by implementations. + + + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Get the at the nth position. The + may be used to determine what s to load and how they should be loaded. + + NOTE: If the underlying Reader (more specifically, the underlying FieldsReader) is closed before the lazy is + loaded an exception may be thrown. If you want the value of a lazy to be available after closing you must + explicitly load it or fetch the Document again with a new loader. + + + + Get the document at the nth position + + The to use to determine what Fields should be loaded on the Document. May be null, in which case all Fields will be loaded. + + The stored fields of the at the nth position + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + + + + + + + + + + + + + Expert: called to re-write queries into primitive queries. + BooleanQuery.TooManyClauses + + + Expert: low-level implementation method + Returns an Explanation that describes how doc scored against + weight. + +

      This is intended to be used in developing Similarity implementations, + and, for good performance, should not be displayed with every hit. + Computing an explanation is as expensive as executing the query over the + entire index. +

      Applications should call . +

      + BooleanQuery.TooManyClauses +
      + + Expert: Low-level search implementation with arbitrary sorting. Finds + the top n hits for query, applying + filter if non-null, and sorting the hits by the criteria in + sort. + +

      Applications should usually call + instead. + +

      + BooleanQuery.TooManyClauses +
      + + Returns the documents matching query. + BooleanQuery.TooManyClauses + Hits will be removed in Lucene 3.0. Use + instead. + + + + Returns the documents matching query and + filter. + + BooleanQuery.TooManyClauses + Hits will be removed in Lucene 3.0. Use + instead. + + + + Returns documents matching query sorted by + sort. + + BooleanQuery.TooManyClauses + Hits will be removed in Lucene 3.0. Use + instead. + + + + Returns documents matching query and filter, + sorted by sort. + + BooleanQuery.TooManyClauses + Hits will be removed in Lucene 3.0. Use + instead. + + + + Search implementation with arbitrary sorting. Finds + the top n hits for query, applying + filter if non-null, and sorting the hits by the criteria in + sort. + +

      NOTE: this does not compute scores by default; use + to enable scoring. + +

      + BooleanQuery.TooManyClauses +
      + + Lower-level search API. + +

      is called for every matching + document. + +

      Applications should only use this if they need all of the + matching documents. The high-level search API () + is usually more efficient, as it skips + non-high-scoring hits. +

      Note: The score passed to this method is a raw score. + In other words, the score will not necessarily be a float whose value is + between 0 and 1. +

      + BooleanQuery.TooManyClauses + use instead. + +
      + + Lower-level search API. + +

      is called for every matching document. + +

      Applications should only use this if they need all of the matching + documents. The high-level search API ( + ) is usually more efficient, as it skips non-high-scoring hits. +

      Note: The score passed to this method is a raw score. + In other words, the score will not necessarily be a float whose value is + between 0 and 1. +

      + BooleanQuery.TooManyClauses +
      + + Lower-level search API. + +

      is called for every matching + document. +
      HitCollector-based access to remote indexes is discouraged. + +

      Applications should only use this if they need all of the + matching documents. The high-level search API () + is usually more efficient, as it skips + non-high-scoring hits. + +

      + to match documents + + if non-null, used to permit documents to be collected. + + to receive hits + + BooleanQuery.TooManyClauses + use instead. + +
      + + Lower-level search API. + +

      is called for every matching + document. +
      Collector-based access to remote indexes is discouraged. + +

      Applications should only use this if they need all of the + matching documents. The high-level search API () + is usually more efficient, as it skips + non-high-scoring hits. + +

      + to match documents + + if non-null, used to permit documents to be collected. + + to receive hits + + BooleanQuery.TooManyClauses +
      + + Finds the top n + hits for query, applying filter if non-null. + + + BooleanQuery.TooManyClauses + + + Finds the top n + hits for query. + + + BooleanQuery.TooManyClauses + + + Returns an Explanation that describes how doc scored against + query. + +

      This is intended to be used in developing Similarity implementations, + and, for good performance, should not be displayed with every hit. + Computing an explanation is as expensive as executing the query over the + entire index. +

      +
      + + The Similarity implementation used by this searcher. + + + Expert: Set the Similarity implementation used by this Searcher. + + + + + + + Expert: Return the Similarity implementation used by this Searcher. + +

      This defaults to the current value of . +

      +
      + + creates a weight for query + new weight + + + + use instead. + + + + Creates a searcher searching the index in the named directory. + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + Use instead + + + + Creates a searcher searching the index in the named + directory. You should pass readOnly=true, since it + gives much better concurrent performance, unless you + intend to do write operations (delete documents or + change norms) with the underlying IndexReader. + + directory where IndexReader will be opened + + if true, the underlying IndexReader + will be opened readOnly + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + Use instead + + + + Creates a searcher searching the index in the provided directory. + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + Use instead + + + + Creates a searcher searching the index in the named + directory. You should pass readOnly=true, since it + gives much better concurrent performance, unless you + intend to do write operations (delete documents or + change norms) with the underlying IndexReader. + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + directory where IndexReader will be opened + + if true, the underlying IndexReader + will be opened readOnly + + + + Creates a searcher searching the provided index. + + + Return the this searches. + + + Note that the underlying IndexReader is not closed, if + IndexSearcher was constructed with IndexSearcher(IndexReader r). + If the IndexReader was supplied implicitly by specifying a directory, then + the IndexReader gets closed. + + + + + .NET + + + + Just like , but you choose + whether or not the fields in the returned instances + should be set by specifying fillFields.
      + +

      + NOTE: this does not compute scores by default. If you need scores, create + a instance by calling + and then pass that to + . +

      +

      +
      + + By default, no scores are computed when sorting by field (using + ). You can change that, per + IndexSearcher instance, by calling this method. Note that this will incur + a CPU cost. + + + If true, then scores are returned for every matching document + in . + + + If true, then the max score for all matching docs is computed. + + + + A query that scores each document as the value of the numeric input field. +

      + The query matches all documents, and scores each document according to the numeric + value of that field. +

      + It is assumed, and expected, that: + + The field used here is indexed, and has exactly + one token in every scored document. + Best if this field is un_tokenized. + That token is parsable to the selected type. + +

      + Combining this query in a FunctionQuery allows much freedom in affecting document scores. + Note, that with this freedom comes responsibility: it is more than likely that the + default Lucene scoring is superior in quality to scoring modified as explained here. + However, in some cases, and certainly for research experiments, this capability may turn useful. +

      + When contructing this query, select the appropriate type. That type should match the data stored in the + field. So in fact the "right" type should be selected before indexing. Type selection + has effect on the RAM usage: + + consumes 1 * maxDocs bytes. + consumes 2 * maxDocs bytes. + consumes 4 * maxDocs bytes. + consumes 8 * maxDocs bytes. + +

      + Caching: + Values for the numeric field are loaded once and cached in memory for further use with the same IndexReader. + To take advantage of this, it is extremely important to reuse index-readers or index-searchers, + otherwise, for instance if for each query a new index reader is opened, large penalties would be + paid for loading the field values into memory over and over again! + +

      + WARNING: The status of the Search.Function package is experimental. + The APIs introduced here might change in the future and will not be + supported anymore in such a case. +

      +
      + + Expert: A Query that sets the scores of document to the + values obtained from a ValueSource. +

      + This query provides a score for each and every undeleted document in the index. +

      + The value source can be based on a (cached) value of an indexed field, but it + can also be based on an external source, e.g. values read from an external database. +

      + Score is set as: Score(doc,query) = query.getBoost()2 * valueSource(doc). + +

      + WARNING: The status of the Search.Function package is experimental. + The APIs introduced here might change in the future and will not be + supported anymore in such a case. +

      +
      + + Create a value source query + provides the values defines the function to be used for scoring + + + + Returns true if o is equal to this. + + + Returns a hash code value for this object. + + + A scorer that (simply) matches all documents, and scores each document with + the value of the value soure in effect. As an example, if the value source + is a (cached) field source, then value of that field in that document will + be used. (assuming field is indexed for this doc, with a single token.) + + + + use instead. + + + + use instead. + + + + use instead. + + + + Create a FieldScoreQuery - a query that scores each document as the value of the numeric input field. +

      + The type param tells how to parse the field string values into a numeric score value. +

      + the numeric field to be used. + + the type of the field: either + , , , or . + +
      + + Type of score field, indicating how field values are interpreted/parsed. +

      + The type selected at search search time should match the data stored in the field. + Different types have different RAM requirements: + + consumes 1 * maxDocs bytes. + consumes 2 * maxDocs bytes. + consumes 4 * maxDocs bytes. + consumes 8 * maxDocs bytes. + +

      +
      + + field values are interpreted as numeric byte values. + + + field values are interpreted as numeric short values. + + + field values are interpreted as numeric int values. + + + field values are interpreted as numeric float values. + + + An alternative to BooleanScorer that also allows a minimum number + of optional scorers that should match. +
      Implements skipTo(), and has no limitations on the numbers of added scorers. +
      Uses ConjunctionScorer, DisjunctionScorer, ReqOptScorer and ReqExclScorer. +
      +
      + + The scorer to which all scoring will be delegated, + except for computing and using the coordination factor. + + + + The number of optionalScorers that need to match (if there are any) + + + Creates a with the given similarity and lists of required, + prohibited and optional scorers. In no required scorers are added, at least + one of the optional scorers will have to match during the search. + + + The similarity to be used. + + The minimum number of optional added scorers that should match + during the search. In case no required scorers are added, at least + one of the optional scorers will have to match during the search. + + the list of required scorers. + + the list of prohibited scorers. + + the list of optional scorers. + + + + Returns the scorer to be used for match counting and score summing. + Uses requiredScorers, optionalScorers and prohibitedScorers. + + + + Returns the scorer to be used for match counting and score summing. + Uses the given required scorer and the prohibitedScorers. + + A required scorer already built. + + + + Scores and collects all matching documents. + The collector to which all matching documents are passed through + . +
      When this method is used the method should not be used. + + use instead. + +
      + + Scores and collects all matching documents. + The collector to which all matching documents are passed through. +
      When this method is used the method should not be used. + +
      + + Expert: Collects matching documents in a range. +
      Note that must be called once before this method is + called for the first time. +
      + The collector to which all matching documents are passed through + . + + Do not score documents past this. + + true if more matching documents may remain. + + use instead. + +
      + + use instead. + + + + use instead. + + + + use instead. + + + + Throws an UnsupportedOperationException. + TODO: Implement an explanation of the coordination factor. + + The document number for the explanation. + + UnsupportedOperationException + + + A Scorer for OR like queries, counterpart of ConjunctionScorer. + This Scorer implements and uses skipTo() on the given Scorers. + TODO: Implement score(HitCollector, int). + + + + The number of subscorers. + + + The subscorers. + + + The minimum number of scorers that should match. + + + The scorerDocQueue contains all subscorers ordered by their current doc(), + with the minimum at the top. +
      The scorerDocQueue is initialized the first time next() or skipTo() is called. +
      An exhausted scorer is immediately removed from the scorerDocQueue. +
      If less than the minimumNrMatchers scorers + remain in the scorerDocQueue next() and skipTo() return false. +

      + After each to call to next() or skipTo() + currentSumScore is the total score of the current matching doc, + nrMatchers is the number of matching scorers, + and all scorers are after the matching doc, or are exhausted. +

      +
      + + The document number of the current match. + + + The number of subscorers that provide the current match. + + + Construct a DisjunctionScorer. + A collection of at least two subscorers. + + The positive minimum number of subscorers that should + match to match this query. +
      When minimumNrMatchers is bigger than + the number of subScorers, + no matches will be produced. +
      When minimumNrMatchers equals the number of subScorers, + it more efficient to use ConjunctionScorer. + +
      + + Construct a DisjunctionScorer, using one as the minimum number + of matching subscorers. + + + + Called the first time next() or skipTo() is called to + initialize scorerDocQueue. + + + + Scores and collects all matching documents. + The collector to which all matching documents are passed through + . +
      When this method is used the method should not be used. + + use instead. + +
      + + Scores and collects all matching documents. + The collector to which all matching documents are passed through. +
      When this method is used the method should not be used. + +
      + + Expert: Collects matching documents in a range. Hook for optimization. + Note that must be called once before this method is called + for the first time. + + The collector to which all matching documents are passed through + . + + Do not score documents past this. + + true if more matching documents may remain. + + use instead. + + + + Expert: Collects matching documents in a range. Hook for optimization. + Note that must be called once before this method is called + for the first time. + + The collector to which all matching documents are passed through. + + Do not score documents past this. + + + true if more matching documents may remain. + + + + use instead. + + + + Advance all subscorers after the current document determined by the + top of the scorerDocQueue. + Repeat until at least the minimum number of subscorers match on the same + document and all subscorers are after that document or are exhausted. +
      On entry the scorerDocQueue has at least minimumNrMatchers + available. At least the scorer with the minimum document number will be advanced. +
      + true iff there is a match. +
      In case there is a match, currentDoc, currentSumScore, + and nrMatchers describe the match. + + TODO: Investigate whether it is possible to use skipTo() when + the minimum number of matchers is bigger than one, ie. try and use the + character of ConjunctionScorer for the minimum number of matchers. + Also delay calling score() on the sub scorers until the minimum number of + matchers is reached. +
      For this, a Scorer array with minimumNrMatchers elements might + hold Scorers at currentDoc that are temporarily popped from scorerQueue. +
      +
      + + Returns the score of the current document matching the query. + Initially invalid, until is called the first time. + + + + use instead. + + + + Returns the number of subscorers matching the current document. + Initially invalid, until is called the first time. + + + + Skips to the first match beyond the current whose document number is + greater than or equal to a given target.
      + When this method is used the method should not be + used.
      + The implementation uses the skipTo() method on the subscorers. + +
      + The target document number. + + true iff there is such a match. + + use instead. + +
      + + Advances to the first match beyond the current whose document number is + greater than or equal to a given target.
      + When this method is used the method should not be + used.
      + The implementation uses the skipTo() method on the subscorers. + +
      + The target document number. + + the document whose number is greater than or equal to the given + target, or -1 if none exist. + +
      + + An explanation for the score of a given document. + + + + Scorer for conjunctions, sets of queries, all of which are required. + + + use instead. + + + + use instead. + + + + use instead. + + + + Count a scorer as a single match. + + + use instead. + + + + use instead. + + + + use instead. + + + + A clause in a BooleanQuery. + + + The query whose matching documents are combined by the boolean query. + + + Constructs a BooleanClause. + + + Returns true if o is equal to this. + + + Returns a hash code value for this object. + + + Specifies how clauses are to occur in matching documents. + + + Use this operator for clauses that must appear in the matching documents. + + + Use this operator for clauses that should appear in the + matching documents. For a BooleanQuery with no MUST + clauses one or more SHOULD clauses must match a document + for the BooleanQuery to match. + + + + + + Use this operator for clauses that must not appear in the matching documents. + Note that it is not possible to search for queries that only consist + of a MUST_NOT clause. + + + + Interface that exceptions should implement to support lazy loading of messages. + + For Native Language Support (NLS), system of software internationalization. + + This Interface should be implemented by all exceptions that require + translation + + + + + a instance of a class that implements the Message interface + + + + Abstract class for enumerating terms. +

      Term enumerations are always ordered by Term.compareTo(). Each term in + the enumeration is greater than all that precede it. +

      +
      + + Increments the enumeration to the next element. True if one exists. + + + Returns the current Term in the enumeration. + + + Returns the docFreq of the current Term in the enumeration. + + + Closes the enumeration to further activity, freeing resources. + + + Skips terms to the first beyond the current whose value is + greater or equal to target.

      Returns true iff there is such + an entry.

      Behaves as if written: + public boolean skipTo(Term target) { + do { + if (!next()) + return false; + } while (target > term()); + return true; + } + + Some implementations *could* be considerably more efficient than a linear scan. + Check the implementation to be sure. +

      + This method is not performant and will be removed in Lucene 3.0. + Use to create a new TermEnum positioned at a + given term. + +
      + + Optimized implementation. + + + Overridden by SegmentTermPositions to skip in prox stream. + + + Optimized implementation. + + + Allows you to iterate over the for multiple s as + a single . + + + + + TermPositions provides an interface for enumerating the <document, + frequency, <position>* > tuples for a term.

      The document and + frequency are the same as for a TermDocs. The positions portion lists the ordinal + positions of each occurrence of a term in a document. + +

      + + +
      + + Returns next position in the current document. It is an error to call + this more than times + without calling

      This is + invalid until is called for + the first time. +

      +
      + + Returns the length of the payload at the current term position. + This is invalid until is called for + the first time.
      +
      + length of the current payload in number of bytes + +
      + + Returns the payload data at the current term position. + This is invalid until is called for + the first time. + This method must not be called more than once after each call + of . However, payloads are loaded lazily, + so if the payload data for the current position is not needed, + this method may not be called at all for performance reasons.
      + +
      + the array into which the data of this payload is to be + stored, if it is big enough; otherwise, a new byte[] array + is allocated for this purpose. + + the offset in the array into which the data of this payload + is to be stored. + + a byte[] array containing the data of this payload + + IOException +
      + + Checks if a payload can be loaded at this position. +

      + Payloads can only be loaded once per call to + . + +

      + true if there is a payload available at this position that can be loaded + +
      + + Creates a new MultipleTermPositions instance. + + + + + + + Not implemented. + UnsupportedOperationException + + + Not implemented. + UnsupportedOperationException + + + Not implemented. + UnsupportedOperationException + + + Not implemented. + UnsupportedOperationException + + + Not implemented. + UnsupportedOperationException + + + + false + + + +

      Expert: policy for deletion of stale index commits. + +

      Implement this interface, and pass it to one + of the or + constructors, to customize when older + point-in-time commits + are deleted from the index directory. The default deletion policy + is , which always + removes old commits as soon as a new commit is done (this + matches the behavior before 2.2).

      + +

      One expected use case for this (and the reason why it + was first created) is to work around problems with an + index directory accessed via filesystems like NFS because + NFS does not provide the "delete on last close" semantics + that Lucene's "point in time" search normally relies on. + By implementing a custom deletion policy, such as "a + commit is only removed once it has been stale for more + than X minutes", you can give your readers time to + refresh to the new commit before + removes the old commits. Note that doing so will + increase the storage requirements of the index. See LUCENE-710 + for details.

      +

      +
      + +

      This is called once when a writer is first + instantiated to give the policy a chance to remove old + commit points.

      + +

      The writer locates all index commits present in the + index directory and calls this method. The policy may + choose to delete some of the commit points, doing so by + calling method + of .

      + +

      Note: the last CommitPoint is the most recent one, + i.e. the "front index state". Be careful not to delete it, + unless you know for sure what you are doing, and unless + you can afford to lose the index content while doing that. + +

      + List of current + point-in-time commits, + sorted by age (the 0th one is the oldest commit). + +
      + +

      This is called each time the writer completed a commit. + This gives the policy a chance to remove old commit points + with each commit.

      + +

      The policy may now choose to delete old commit points + by calling method + of .

      + +

      If writer has autoCommit = true then + this method will in general be called many times during + one instance of . If + autoCommit = false then this method is + only called once when is + called, or not at all if the + is called. + +

      Note: the last CommitPoint is the most recent one, + i.e. the "front index state". Be careful not to delete it, + unless you know for sure what you are doing, and unless + you can afford to lose the index content while doing that. + +

      + List of , + sorted by age (the 0th one is the oldest commit). + +
      + + NOTE: this API is experimental and will likely change + + + Adds a new term in this field; term ends with U+FFFF + char + + + + Called when we are done adding terms to this field + + + Add a new position & payload. If payloadLength > 0 + you must read those bytes from the IndexInput. + + + + Called when we are done adding positions & payloads + + + Add a new position & payload + + + Called when we are done adding positions & payloads + + + This is just a "splitter" class: it lets you wrap two + DocFieldConsumer instances as a single consumer. + + + + Called when DocumentsWriter decides to create a new + segment + + + + Called when DocumentsWriter decides to close the doc + stores + + + + Called when an aborting exception is hit + + + Add a new thread + + + Called when DocumentsWriter is using too much RAM. + The consumer should free RAM, if possible, returning + true if any RAM was in fact freed. + + + + A that runs each merge using a + separate thread, up until a maximum number of threads + () at which when a merge is + needed, the thread(s) that are updating the index will + pause until one or more merges completes. This is a + simple way to use concurrency in the indexing process + without having to create and manage application level + threads. + + + + Sets the max # simultaneous threads that may be + running. If a merge is necessary yet we already have + this many threads running, the incoming thread (that + is calling add/updateDocument) will block until + a merge thread has completed. + + + + Get the max # simultaneous threads that may be + + + + + Return the priority that merge threads run at. By + default the priority is 1 plus the priority of (ie, + slightly higher priority than) the first thread that + calls merge. + + + + Return the priority that merge threads run at. + + + Does the actual merge, by calling + + + Create and return a new MergeThread + + + Called when an exception is hit in a background merge + thread + + + + Used for testing + + + Used for testing + + + Used for testing + + + Used for testing + + + Used for testing + + + Declare what fields to load normally and what fields to load lazily + + + + + + Similar to a + java.io.FileFilter, the FieldSelector allows one to make decisions about + what Fields get loaded on a by + + + + + the field to accept or reject + + an instance of + if the named fieldName should be loaded. + + + + Pass in the Set of names to load and the Set of names to load lazily. If both are null, the + Document will not have any on it. + + A Set of field names to load. May be empty, but not null + + A Set of field names to load lazily. May be empty, but not null + + + + Indicate whether to load the field with the given name or not. If the is not in either of the + initializing Sets, then is returned. If a Field name + is in both fieldsToLoad and lazyFieldsToLoad, lazy has precedence. + + + The name to check + + The + + + + A field is a section of a Document. Each field has two parts, a name and a + value. Values may be free text, provided as a String or as a Reader, or they + may be atomic keywords, which are not further processed. Such keywords may + be used to represent dates, urls, etc. Fields are optionally stored in the + index, so that they may be returned with hits on the document. + + + + + + + + + + Synonymous with . + +

      WARNING: This interface may change within minor versions, despite Lucene's backward compatibility requirements. + This means new methods may be added from version to version. This change only affects the Fieldable API; other backwards + compatibility promises remain intact. For example, Lucene can still + read and write indices created within the same major version. +

      + + +

      +
      + + Sets the boost factor hits on this field. This value will be + multiplied into the score of all hits on this this field of this + document. + +

      The boost is multiplied by of the document + containing this field. If a document has multiple fields with the same + name, all such values are multiplied together. This product is then + used to compute the norm factor for the field. By + default, in the + method, the boost value is multiplied + by the + and then rounded by before it is stored in the + index. One should attempt to ensure that this product does not overflow + the range of that encoding. + +

      + + + + + + +
      + + Returns the boost factor for hits for this field. + +

      The default value is 1.0. + +

      Note: this value is not stored directly with the document in the index. + Documents returned from and + may thus not have the same value present as when + this field was indexed. + +

      + + +
      + + Returns the name of the field as an interned string. + For example "date", "title", "body", ... + + + + The value of the field as a String, or null. +

      + For indexing, if isStored()==true, the stringValue() will be used as the stored field value + unless isBinary()==true, in which case binaryValue() will be used. + + If isIndexed()==true and isTokenized()==false, this String value will be indexed as a single token. + If isIndexed()==true and isTokenized()==true, then tokenStreamValue() will be used to generate indexed tokens if not null, + else readerValue() will be used to generate indexed tokens if not null, else stringValue() will be used to generate tokens. +

      +
      + + The value of the field as a Reader, which can be used at index time to generate indexed tokens. + + + + + The value of the field in Binary, or null. + + + + + The TokenStream for this field to be used when indexing, or null. + + + + + True if the value of the field is to be stored in the index for return + with search hits. + + + + True if the value of the field is to be indexed, so that it may be + searched on. + + + + True if the value of the field should be tokenized as text prior to + indexing. Un-tokenized fields are indexed as a single word and may not be + Reader-valued. + + + + True if the value of the field is stored and compressed within the index + + + True if the term or terms used to index this field are stored as a term + vector, available from . + These methods do not provide access to the original content of the field, + only to terms used to index it. If the original content must be + preserved, use the stored attribute instead. + + + + + + + True if terms are stored as term vector together with their offsets + (start and end positon in source text). + + + + True if terms are stored as term vector together with their token positions. + + + True if the value of the field is stored as binary + + + True if norms are omitted for this indexed field + + + Expert: + + If set, omit normalization factors associated with this indexed field. + This effectively disables indexing boosts and length normalization for this field. + + + + Renamed to + + + + Renamed to + + + + Indicates whether a Field is Lazy or not. The semantics of Lazy loading are such that if a Field is lazily loaded, retrieving + it's values via or is only valid as long as the that + retrieved the is still open. + + + true if this field can be loaded lazily + + + + Returns offset into byte[] segment that is used as value, if Field is not binary + returned value is undefined + + index of the first character in byte[] segment that represents this Field value + + + + Returns length of byte[] segment that is used as value, if Field is not binary + returned value is undefined + + length of byte[] segment that represents this Field value + + + + Return the raw byte[] for the binary field. Note that + you must also call and + to know which range of bytes in this + returned array belong to the field. + + reference to the Field value as byte[]. + + + + Return the raw byte[] for the binary field. Note that + you must also call and + to know which range of bytes in this + returned array belong to the field.

      + About reuse: if you pass in the result byte[] and it is + used, likely the underlying implementation will hold + onto this byte[] and return it in future calls to + or . + So if you subsequently re-use the same byte[] elsewhere + it will alter this Fieldable's value. +

      + User defined buffer that will be used if + possible. If this is null or not large enough, a new + buffer is allocated + + reference to the Field value as byte[]. + +
      + + Sets the boost factor hits on this field. This value will be + multiplied into the score of all hits on this this field of this + document. + +

      The boost is multiplied by of the document + containing this field. If a document has multiple fields with the same + name, all such values are multiplied together. This product is then + used to compute the norm factor for the field. By + default, in the + method, the boost value is multipled + by the and then + rounded by before it is stored in the + index. One should attempt to ensure that this product does not overflow + the range of that encoding. + +

      + + + + + + +
      + + Returns the boost factor for hits for this field. + +

      The default value is 1.0. + +

      Note: this value is not stored directly with the document in the index. + Documents returned from and + may thus not have the same value present as when + this field was indexed. + +

      + + +
      + + Returns the name of the field as an interned string. + For example "date", "title", "body", ... + + + + True iff the value of the field is to be stored in the index for return + with search hits. It is an error for this to be true if a field is + Reader-valued. + + + + True iff the value of the field is to be indexed, so that it may be + searched on. + + + + True iff the value of the field should be tokenized as text prior to + indexing. Un-tokenized fields are indexed as a single word and may not be + Reader-valued. + + + + True if the value of the field is stored and compressed within the index + + + True iff the term or terms used to index this field are stored as a term + vector, available from . + These methods do not provide access to the original content of the field, + only to terms used to index it. If the original content must be + preserved, use the stored attribute instead. + + + + + + + True iff terms are stored as term vector together with their offsets + (start and end position in source text). + + + + True iff terms are stored as term vector together with their token positions. + + + True iff the value of the filed is stored as binary + + + Return the raw byte[] for the binary field. Note that + you must also call and + to know which range of bytes in this + returned array belong to the field. + + reference to the Field value as byte[]. + + + + Returns length of byte[] segment that is used as value, if Field is not binary + returned value is undefined + + length of byte[] segment that represents this Field value + + + + Returns offset into byte[] segment that is used as value, if Field is not binary + returned value is undefined + + index of the first character in byte[] segment that represents this Field value + + + + True if norms are omitted for this indexed field + + + Renamed to + + + + + + + + Expert: + + If set, omit normalization factors associated with this indexed field. + This effectively disables indexing boosts and length normalization for this field. + + + + Renamed to + + + + Expert: + + If set, omit term freq, positions and payloads from + postings for this field. + +

      NOTE: While this option reduces storage space + required in the index, it also means any query + requiring positional information, such as + or subclasses will + silently fail to find results. +

      +
      + + Prints a Field for human consumption. + + + The value of the field as a String, or null. If null, the Reader value or + binary value is used. Exactly one of stringValue(), + readerValue(), and getBinaryValue() must be set. + + + + The value of the field as a Reader, or null. If null, the String value or + binary value is used. Exactly one of stringValue(), + readerValue(), and getBinaryValue() must be set. + + + + The value of the field in Binary, or null. If null, the Reader value, + or String value is used. Exactly one of stringValue(), + readerValue(), and getBinaryValue() must be set. + + This method must allocate a new byte[] if + the is non-zero + or is not the + full length of the byte[]. Please use + instead, which simply + returns the byte[]. + + + + The TokesStream for this field to be used when indexing, or null. If null, the Reader value + or String value is analyzed to produce the indexed tokens. + + + +

      Expert: change the value of this field. This can + be used during indexing to re-use a single Field + instance to improve indexing speed by avoiding GC cost + of new'ing and reclaiming Field instances. Typically + a single instance is re-used as + well. This helps most on small documents.

      + +

      Each Field instance should only be used once + within a single instance. See ImproveIndexingSpeed + for details.

      +

      +
      + + Expert: change the value of this field. See setValue(String). + + + Expert: change the value of this field. See setValue(String). + + + Expert: change the value of this field. See setValue(String). + + + Expert: change the value of this field. See setValue(String). + use + + + + Expert: sets the token stream to be used for indexing and causes isIndexed() and isTokenized() to return true. + May be combined with stored values from stringValue() or binaryValue() + + + + Create a field by specifying its name, value and how it will + be saved in the index. Term vectors will not be stored in the index. + + + The name of the field + + The string to process + + Whether value should be stored in the index + + Whether the field should be indexed, and if so, if it should + be tokenized before indexing + + NullPointerException if name or value is null + IllegalArgumentException if the field is neither stored nor indexed + + + Create a field by specifying its name, value and how it will + be saved in the index. + + + The name of the field + + The string to process + + Whether value should be stored in the index + + Whether the field should be indexed, and if so, if it should + be tokenized before indexing + + Whether term vector should be stored + + NullPointerException if name or value is null + IllegalArgumentException in any of the following situations: + + the field is neither stored nor indexed + the field is not indexed but termVector is TermVector.YES + + + + + Create a field by specifying its name, value and how it will + be saved in the index. + + + The name of the field + + Whether to .intern() name or not + + The string to process + + Whether value should be stored in the index + + Whether the field should be indexed, and if so, if it should + be tokenized before indexing + + Whether term vector should be stored + + NullPointerException if name or value is null + IllegalArgumentException in any of the following situations: + + the field is neither stored nor indexed + the field is not indexed but termVector is TermVector.YES + + + + + Create a tokenized and indexed field that is not stored. Term vectors will + not be stored. The Reader is read only when the Document is added to the index, + i.e. you may not close the Reader until + has been called. + + + The name of the field + + The reader with the content + + NullPointerException if name or reader is null + + + Create a tokenized and indexed field that is not stored, optionally with + storing term vectors. The Reader is read only when the Document is added to the index, + i.e. you may not close the Reader until + has been called. + + + The name of the field + + The reader with the content + + Whether term vector should be stored + + NullPointerException if name or reader is null + + + Create a tokenized and indexed field that is not stored. Term vectors will + not be stored. This is useful for pre-analyzed fields. + The TokenStream is read only when the Document is added to the index, + i.e. you may not close the TokenStream until + has been called. + + + The name of the field + + The TokenStream with the content + + NullPointerException if name or tokenStream is null + + + Create a tokenized and indexed field that is not stored, optionally with + storing term vectors. This is useful for pre-analyzed fields. + The TokenStream is read only when the Document is added to the index, + i.e. you may not close the TokenStream until + has been called. + + + The name of the field + + The TokenStream with the content + + Whether term vector should be stored + + NullPointerException if name or tokenStream is null + + + Create a stored field with binary value. Optionally the value may be compressed. + + + The name of the field + + The binary value + + How value should be stored (compressed or not) + + IllegalArgumentException if store is Store.NO + + + Create a stored field with binary value. Optionally the value may be compressed. + + + The name of the field + + The binary value + + Starting offset in value where this Field's bytes are + + Number of bytes to use for this Field, starting at offset + + How value should be stored (compressed or not) + + IllegalArgumentException if store is Store.NO + + + Specifies whether and how a field should be stored. + + + Store the original field value in the index in a compressed form. This is + useful for long documents and for binary valued fields. + + Please use instead. + For string fields that were previously indexed and stored using compression, + the new way to achieve this is: First add the field indexed-only (no store) + and additionally using the same field name as a binary, stored field + with . + + + + Store the original field value in the index. This is useful for short texts + like a document's title which should be displayed with the results. The + value is stored in its original form, i.e. no analyzer is used before it is + stored. + + + + Do not store the field value in the index. + + + Specifies whether and how a field should be indexed. + + + Do not index the field value. This field can thus not be searched, + but one can still access its contents provided it is + stored. + + + + Index the tokens produced by running the field's + value through an Analyzer. This is useful for + common text. + + + + this has been renamed to + + + + Index the field's value without using an Analyzer, so it can be searched. + As no analyzer is used the value will be stored as a single term. This is + useful for unique Ids like product numbers. + + + + This has been renamed to + + + + Expert: Index the field's value without an Analyzer, + and also disable the storing of norms. Note that you + can also separately enable/disable norms by calling + . No norms means that + index-time field and document boosting and field + length normalization are disabled. The benefit is + less memory usage as norms take up one byte of RAM + per indexed field for every document in the index, + during searching. Note that once you index a given + field with norms enabled, disabling norms will + have no effect. In other words, for this to have the + above described effect on a field, all instances of + that field must be indexed with NOT_ANALYZED_NO_NORMS + from the beginning. + + + + This has been renamed to + + + + + Expert: Index the tokens produced by running the + field's value through an Analyzer, and also + separately disable the storing of norms. See + for what norms are + and why you may want to disable them. + + + + Specifies whether and how a field should have term vectors. + + + Do not store term vectors. + + + Store the term vectors of each document. A term vector is a list + of the document's terms and their number of occurrences in that document. + + + + Store the term vector + token position information + + + + + + + Store the term vector + Token offset information + + + + + + + Store the term vector + Token position and offset information + + + + + + + + + + + A grammar-based tokenizer constructed with JFlex + +

      This should be a good tokenizer for most European-language documents: + + + Splits words at punctuation characters, removing punctuation. However, a + dot that's not followed by whitespace is considered part of a token. + Splits words at hyphens, unless there's a number in the token, in which case + the whole token is interpreted as a product number and is not split. + Recognizes email addresses and internet hostnames as one token. + + +

      Many applications have specific tokenizer needs. If this tokenizer does + not suit your application, please consider copying this source code + directory to your project and maintaining your own grammar-based tokenizer. + + +

      + You must specify the required compatibility when creating + StandardAnalyzer: + + As of 2.4, Tokens incorrectly identified as acronyms are corrected (see + LUCENE-1608 + +

      +
      + + A Tokenizer is a TokenStream whose input is a Reader. +

      + This is an abstract class; subclasses must override +

      + NOTE: Subclasses overriding must call + before setting attributes. + Subclasses overriding must call + before setting Token attributes. +

      +
      + + The text source for this Tokenizer. + + + Construct a tokenizer with null input. + + + Construct a token stream processing the given input. + + + Construct a tokenizer with null input using the given AttributeFactory. + + + Construct a token stream processing the given input using the given AttributeFactory. + + + Construct a token stream processing the given input using the given AttributeSource. + + + Construct a token stream processing the given input using the given AttributeSource. + + + By default, closes the input Reader. + + + Return the corrected offset. If is a subclass + this method calls , else returns currentOff. + + offset as seen in the output + + corrected offset based on the input + + + + + + Expert: Reset the tokenizer to a new reader. Typically, an + analyzer (in its reusableTokenStream method) will use + this to re-use a previously created tokenizer. + + + + this solves a bug where HOSTs that end with '.' are identified + as ACRONYMs. It is deprecated and will be removed in the next + release. + + + + A private instance of the JFlex-constructed scanner + + + String token types that correspond to token type int constants + + + Please use instead + + + + Specifies whether deprecated acronyms should be replaced with HOST type. + This is false by default to support backward compatibility. +

      + See http://issues.apache.org/jira/browse/LUCENE-1068 + +

      + this should be removed in the next release (3.0). + +
      + + Set the max allowed token length. Any token longer + than this is skipped. + + + + + + + + Creates a new instance of the . Attaches the + input to a newly created JFlex scanner. + + Use instead + + + + Creates a new instance of the . Attaches + the input to the newly created JFlex scanner. + + + The input reader + + Set to true to replace mischaracterized acronyms with HOST. + + See http://issues.apache.org/jira/browse/LUCENE-1068 + + Use instead + + + + Creates a new instance of the + . Attaches + the input to the newly created JFlex scanner. + + + + The input reader + + See http://issues.apache.org/jira/browse/LUCENE-1068 + + + + Creates a new StandardTokenizer with a given . + Use + + instead + + + + Creates a new StandardTokenizer with a given . + + + Creates a new StandardTokenizer with a given + Use + + instead + + + + Creates a new StandardTokenizer with a given + + + + + + (non-Javadoc) + + + + + + Will be removed in Lucene 3.0. This method is final, as it should + not be overridden. Delegates to the backwards compatibility layer. + + + + Will be removed in Lucene 3.0. This method is final, as it should + not be overridden. Delegates to the backwards compatibility layer. + + + + Prior to https://issues.apache.org/jira/browse/LUCENE-1068, StandardTokenizer mischaracterized as acronyms tokens like www.abc.com + when they should have been labeled as hosts instead. + + true if StandardTokenizer now returns these tokens as Hosts, otherwise false + + + Remove in 3.X and make true the only valid value + + + + + Set to true to replace mischaracterized acronyms as HOST. + + Remove in 3.X and make true the only valid value + + See https://issues.apache.org/jira/browse/LUCENE-1068 + + + + An that filters + with + + + + This class converts alphabetic, numeric, and symbolic Unicode characters + which are not in the first 127 ASCII characters (the "Basic Latin" Unicode + block) into their ASCII equivalents, if one exists. + + Characters from the following Unicode blocks are converted; however, only + those characters with reasonable ASCII alternatives are converted: + + + C1 Controls and Latin-1 Supplement: http://www.unicode.org/charts/PDF/U0080.pdf + Latin Extended-A: http://www.unicode.org/charts/PDF/U0100.pdf + Latin Extended-B: http://www.unicode.org/charts/PDF/U0180.pdf + Latin Extended Additional: http://www.unicode.org/charts/PDF/U1E00.pdf + Latin Extended-C: http://www.unicode.org/charts/PDF/U2C60.pdf + Latin Extended-D: http://www.unicode.org/charts/PDF/UA720.pdf + IPA Extensions: http://www.unicode.org/charts/PDF/U0250.pdf + Phonetic Extensions: http://www.unicode.org/charts/PDF/U1D00.pdf + Phonetic Extensions Supplement: http://www.unicode.org/charts/PDF/U1D80.pdf + General Punctuation: http://www.unicode.org/charts/PDF/U2000.pdf + Superscripts and Subscripts: http://www.unicode.org/charts/PDF/U2070.pdf + Enclosed Alphanumerics: http://www.unicode.org/charts/PDF/U2460.pdf + Dingbats: http://www.unicode.org/charts/PDF/U2700.pdf + Supplemental Punctuation: http://www.unicode.org/charts/PDF/U2E00.pdf + Alphabetic Presentation Forms: http://www.unicode.org/charts/PDF/UFB00.pdf + Halfwidth and Fullwidth Forms: http://www.unicode.org/charts/PDF/UFF00.pdf + + + See: http://en.wikipedia.org/wiki/Latin_characters_in_Unicode + + The set of character conversions supported by this class is a superset of + those supported by Lucene's which strips + accents from Latin1 characters. For example, 'À' will be replaced by + 'a'. + + + + Converts characters above ASCII to their ASCII equivalents. For example, + accents are removed from accented characters. + + The string to fold + + The number of characters in the input string + + + + Expert: A Scorer for documents matching a Term. + + + Construct a TermScorer. + + + The weight of the Term in the query. + + An iterator over the documents matching the Term. + + The Similarity implementation to be used for score + computations. + + The field norms of the document fields for the Term. + + + + use instead. + + + + use instead. + + + + use instead. + + + + Advances to the next document matching the query.
      + The iterator over the matching documents is buffered using + . + +
      + true iff there is another document matching the query. + + use instead. + +
      + + Advances to the next document matching the query.
      + The iterator over the matching documents is buffered using + . + +
      + the document matching the query or -1 if there are no more documents. + +
      + + Skips to the first match beyond the current whose document number is + greater than or equal to a given target.
      + The implementation uses . + +
      + The target document number. + + true iff there is such a match. + + use instead. + +
      + + Advances to the first match beyond the current whose document number is + greater than or equal to a given target.
      + The implementation uses . + +
      + The target document number. + + the matching document or -1 if none exist. + +
      + + Returns an explanation of the score for a document. +
      When this method is used, the method + and the method should not be used. +
      + The document number for the explanation. + +
      + + Returns a string representation of this TermScorer. + + + The results of a SpanQueryFilter. Wraps the BitSet and the position information from the SpanQuery + +

      + NOTE: This API is still experimental and subject to change. + + +

      +
      + + + + + + + The bits for the Filter + + A List of objects + + Use instead + + + + + The DocIdSet for the Filter + + A List of objects + + + + The first entry in the array corresponds to the first "on" bit. + Entries are increasing by document order + + A List of PositionInfo objects + + + + Use + + + + Returns the docIdSet + + + + A List of objects + + + + + The end position of this match + + + + The Start position + The start position of this match + + + + Expert: Delegating scoring implementation. Useful in + implementations, to override only certain + methods of a Searcher's Similiarty implementation.. + + + + Expert: Scoring API. +

      Subclasses implement search scoring. + +

      The score of query q for document d correlates to the + cosine-distance or dot-product between document and query vectors in a + + Vector Space Model (VSM) of Information Retrieval. + A document whose vector is closer to the query vector in that model is scored higher. + + The score is computed as follows: + +

      + + +
      + + + + + + + + + + + +
      + score(q,d)   =   + coord(q,d)  ·  + queryNorm(q)  ·  + + + + ( + tf(t in d)  ·  + idf(t)2  ·  + t.getBoost() ·  + norm(t,d) + ) +
      t in q
      +
      + +

      where + + + + tf(t in d) + correlates to the term's frequency, + defined as the number of times term t appears in the currently scored document d. + Documents that have more occurrences of a given term receive a higher score. + The default computation for tf(t in d) in + DefaultSimilarity is: + +
       
      + + + + + +
      + tf(t in d)   =   + + frequency½ +
      +
       
      +
      + + + + idf(t) stands for Inverse Document Frequency. This value + correlates to the inverse of docFreq + (the number of documents in which the term t appears). + This means rarer terms give higher contribution to the total score. + The default computation for idf(t) in + DefaultSimilarity is: + +
       
      + + + + + + + +
      + idf(t)  =   + + 1 + log ( + + + + + +
      numDocs
      –––––––––
      docFreq+1
      +
      + ) +
      +
       
      +
      + + + + coord(q,d) + is a score factor based on how many of the query terms are found in the specified document. + Typically, a document that contains more of the query's terms will receive a higher score + than another document with fewer query terms. + This is a search time factor computed in + coord(q,d) + by the Similarity in effect at search time. +
       
      +
      + + + + queryNorm(q) + + is a normalizing factor used to make scores between queries comparable. + This factor does not affect document ranking (since all ranked documents are multiplied by the same factor), + but rather just attempts to make scores from different queries (or even different indexes) comparable. + This is a search time factor computed by the Similarity in effect at search time. + + The default computation in + DefaultSimilarity + is: +
       
      + + + + + +
      + queryNorm(q)   =   + queryNorm(sumOfSquaredWeights) +   =   + + + + + +
      1
      + –––––––––––––– +
      sumOfSquaredWeights½
      +
      +
       
      + + The sum of squared weights (of the query terms) is + computed by the query object. + For example, a boolean query + computes this value as: + +
       
      + + + + + + + + + + + +
      + sumOfSquaredWeights   =   + q.getBoost() 2 +  ·  + + + + ( + idf(t)  ·  + t.getBoost() + ) 2 +
      t in q
      +
       
      + +
      + + + + t.getBoost() + is a search time boost of term t in the query q as + specified in the query text + (see query syntax), + or as set by application calls to + . + Notice that there is really no direct API for accessing a boost of one term in a multi term query, + but rather multi terms are represented in a query as multi + TermQuery objects, + and so the boost of a term in the query is accessible by calling the sub-query + . +
       
      +
      + + + + norm(t,d) encapsulates a few (indexing time) boost and length factors: + + + Document boost - set by calling + doc.setBoost() + before adding the document to the index. + + Field boost - set by calling + field.SetBoost() + before adding the field to a document. + + LengthNorm(field) - computed + when the document is added to the index in accordance with the number of tokens + of this field in the document, so that shorter fields contribute more to the score. + LengthNorm is computed by the Similarity class in effect at indexing. + + + +

      + When a document is added to the index, all the above factors are multiplied. + If the document has multiple fields with the same name, all their boosts are multiplied together: + +
       
      + + + + + + + + + + + +
      + norm(t,d)   =   + doc.GetBoost() +  ·  + LengthNorm(field) +  ·  + + + + field.GetBoost() +
      field f in d named as t
      +
       
      + However the resulted norm value is encoded as a single byte + before being stored. + At search time, the norm byte value is read from the index + directory and + decoded back to a float norm value. + This encoding/decoding, while reducing index size, comes with the price of + precision loss - it is not guaranteed that decode(encode(x)) = x. + For instance, decode(encode(0.89)) = 0.75. + Also notice that search time is too late to modify this norm part of scoring, e.g. by + using a different for search. +
       
      + + + +

      + + + + + + +
      + + Set the default Similarity implementation used by indexing and search + code. + + + + + + + + + Return the default Similarity implementation used by indexing and search + code. + +

      This is initially an instance of . + +

      + + + + +
      + + Cache of decoded bytes. + + + Decodes a normalization factor stored in an index. + + + + + Returns a table for decoding normalization bytes. + + + + + Compute the normalization value for a field, given the accumulated + state of term processing for this field (see ). + +

      Implementations should calculate a float value based on the field + state and then return that value. + +

      For backward compatibility this method by default calls + passing + as the second argument, and + then multiplies this value by .

      + +

      WARNING: This API is new and experimental and may + suddenly change.

      + +

      + field name + + current processing state for this field + + the calculated float norm + +
      + + Computes the normalization value for a field given the total number of + terms contained in a field. These values, together with field boosts, are + stored in an index and multipled into scores for hits on each field by the + search code. + +

      Matches in longer fields are less precise, so implementations of this + method usually return smaller values when numTokens is large, + and larger values when numTokens is small. + +

      Note that the return values are computed under + + and then stored using + . + Thus they have limited precision, and documents + must be re-indexed if this method is altered. + +

      + the name of the field + + the total number of tokens contained in fields named + fieldName of doc. + + a normalization factor for hits on this field of this document + + + + +
      + + Computes the normalization value for a query given the sum of the squared + weights of each of the query terms. This value is then multipled into the + weight of each query term. + +

      This does not affect ranking, but rather just attempts to make scores + from different queries comparable. + +

      + the sum of the squares of query term weights + + a normalization factor for query weights + +
      + + Encodes a normalization factor for storage in an index. + +

      The encoding uses a three-bit mantissa, a five-bit exponent, and + the zero-exponent point at 15, thus + representing values from around 7x10^9 to 2x10^-9 with about one + significant decimal digit of accuracy. Zero is also represented. + Negative numbers are rounded up to zero. Values too large to represent + are rounded down to the largest representable value. Positive values too + small to represent are rounded up to the smallest positive representable + value. + +

      + + + + +
      + + Computes a score factor based on a term or phrase's frequency in a + document. This value is multiplied by the + factor for each term in the query and these products are then summed to + form the initial score for a document. + +

      Terms and phrases repeated in a document indicate the topic of the + document, so implementations of this method usually return larger values + when freq is large, and smaller values when freq + is small. + +

      The default implementation calls . + +

      + the frequency of a term within a document + + a score factor based on a term's within-document frequency + +
      + + Computes the amount of a sloppy phrase match, based on an edit distance. + This value is summed for each sloppy phrase match in a document to form + the frequency that is passed to . + +

      A phrase match with a small edit distance to a document passage more + closely matches the document, so implementations of this method usually + return larger values when the edit distance is small and smaller values + when it is large. + +

      + + + the edit distance of this sloppy phrase match + + the frequency increment for this match + +
      + + Computes a score factor based on a term or phrase's frequency in a + document. This value is multiplied by the + factor for each term in the query and these products are then summed to + form the initial score for a document. + +

      Terms and phrases repeated in a document indicate the topic of the + document, so implementations of this method usually return larger values + when freq is large, and smaller values when freq + is small. + +

      + the frequency of a term within a document + + a score factor based on a term's within-document frequency + +
      + + Computes a score factor for a simple term. + +

      The default implementation is: + return idf(searcher.docFreq(term), searcher.maxDoc()); + + + Note that is used instead of + because it is proportional to + , i.e., when one is inaccurate, + so is the other, and in the same direction. + +

      + the term in question + + the document collection being searched + + a score factor for the term + + see + +
      + + Computes a score factor for a simple term and returns an explanation + for that score factor. + +

      + The default implementation uses: + + + idf(searcher.docFreq(term), searcher.maxDoc()); + + + Note that is used instead of + because it is + proportional to , i.e., when one is + inaccurate, so is the other, and in the same direction. + +

      + the term in question + + the document collection being searched + + an IDFExplain object that includes both an idf score factor + and an explanation for the term. + + IOException +
      + + Computes a score factor for a phrase. + +

      The default implementation sums the factor + for each term in the phrase. + +

      + the terms in the phrase + + the document collection being searched + + idf score factor + + see + +
      + + Computes a score factor for a phrase. + +

      + The default implementation sums the idf factor for + each term in the phrase. + +

      + the terms in the phrase + + the document collection being searched + + an IDFExplain object that includes both an idf + score factor for the phrase and an explanation + for each term. + + IOException +
      + + Computes a score factor based on a term's document frequency (the number + of documents which contain the term). This value is multiplied by the + factor for each term in the query and these products are + then summed to form the initial score for a document. + +

      Terms that occur in fewer documents are better indicators of topic, so + implementations of this method usually return larger values for rare terms, + and smaller values for common terms. + +

      + the number of documents which contain the term + + the total number of documents in the collection + + a score factor based on the term's document frequency + +
      + + Computes a score factor based on the fraction of all query terms that a + document contains. This value is multiplied into scores. + +

      The presence of a large portion of the query terms indicates a better + match with the query, so implementations of this method usually return + larger values when the ratio between these parameters is large and smaller + values when the ratio between them is small. + +

      + the number of query terms matched in the document + + the total number of terms in the query + + a score factor based on term overlap with the query + +
      + + Calculate a scoring factor based on the data in the payload. Overriding implementations + are responsible for interpreting what is in the payload. Lucene makes no assumptions about + what is in the byte array. +

      + The default implementation returns 1. + +

      + The fieldName of the term this payload belongs to + + The payload byte array to be scored + + The offset into the payload array + + The length in the array + + An implementation dependent float to be used as a scoring factor + + + See + +
      + + Calculate a scoring factor based on the data in the payload. Overriding implementations + are responsible for interpreting what is in the payload. Lucene makes no assumptions about + what is in the byte array. +

      + The default implementation returns 1. + +

      + The docId currently being scored. If this value is , then it should be assumed that the PayloadQuery implementation does not provide document information + + The fieldName of the term this payload belongs to + + The start position of the payload + + The end position of the payload + + The payload byte array to be scored + + The offset into the payload array + + The length in the array + + An implementation dependent float to be used as a scoring factor + + +
      + + Remove this when old API is removed! + + + + Remove this when old API is removed! + + + + Remove this when old API is removed! + + + + The Similarity implementation used by default. + TODO: move back to top when old API is removed! + + + + + Small Util class used to pass both an idf factor as well as an + explanation for that factor. + + This class will likely be held on a , so be aware + before storing any large or un-serializable fields. + + + + + Expert: Describes the score computation for document and query. + + + Indicates whether or not this Explanation models a good match. + +

      + By default, an Explanation represents a "match" if the value is positive. +

      +

      + + +
      + + The value assigned to this explanation node. + + + Sets the value assigned to this explanation node. + + + A description of this explanation node. + + + Sets the description of this explanation node. + + + A short one line summary which should contain all high level + information about this Explanation, without the "Details" + + + + The sub-nodes of this explanation node. + + + Adds a sub-node to this explanation node. + + + Render an explanation as text. + + + Render an explanation as HTML. + + + Small Util class used to pass both an idf factor as well as an + explanation for that factor. + + This class will likely be held on a , so be aware + before storing any large or un-serializable fields. + + + + + the idf factor + + + + This should be calculated lazily if possible. + + + the explanation for the idf factor. + + + + Remove this when old API is removed! + + + + Remove this when old API is removed! + + + + Remove this when old API is removed! + + + + Construct a that delegates all methods to another. + + + the Similarity implementation to delegate to + + + + A Query that matches documents within an exclusive range of terms. + +

      This query matches the documents looking for terms that fall into the + supplied range according to . It is not intended + for numerical ranges, use instead. + +

      This query uses + . If you + want to change this, use the new + instead. + +

      + Use for term ranges or + for numeric ranges instead. + This class will be removed in Lucene 3.0. + +
      + + Constructs a query selecting all terms greater than + lowerTerm but less than upperTerm. + There must be at least one term and either term may be null, + in which case there is no bound on that side, but if there are + two terms, both terms must be for the same field. + + + The Term at the lower end of the range + + The Term at the upper end of the range + + If true, both lowerTerm and + upperTerm will themselves be included in the range. + + + + Constructs a query selecting all terms greater than + lowerTerm but less than upperTerm. + There must be at least one term and either term may be null, + in which case there is no bound on that side, but if there are + two terms, both terms must be for the same field. +

      + If collator is not null, it will be used to decide whether + index terms are within the given range, rather than using the Unicode code + point order in which index terms are stored. +

      + WARNING: Using this constructor and supplying a non-null + value in the collator parameter will cause every single + index Term in the Field referenced by lowerTerm and/or upperTerm to be + examined. Depending on the number of index Terms in this Field, the + operation could be very slow. + +

      + The Term at the lower end of the range + + The Term at the upper end of the range + + If true, both lowerTerm and + upperTerm will themselves be included in the range. + + The collator to use to collate index Terms, to determine + their membership in the range bounded by lowerTerm and + upperTerm. + +
      + + Returns the field name for this query + + + Returns the lower term of this range query. + + + Returns the upper term of this range query. + + + Returns true if the range query is inclusive + + + Returns the collator used to determine range inclusion, if any. + + + Prints a user-readable version of this query. + + + Returns true iff o is equal to this. + + + Returns a hash code value for this object. + + + Position of a term in a document that takes into account the term offset within the phrase. + + + Go to next location of this term current document, and set + position as location - offset, so that a + matching exact phrase is easily identified when all PhrasePositions + have exactly the same position. + + + + A query that matches all documents. + + + + + Field used for normalization factor (document boost). Null if nothing. + + + + use instead. + + + + use instead. + + + + use instead. + + + + Lower-level search API.
      + HitCollectors are primarily meant to be used to implement queries, sorting + and filtering. See for a lower level and higher performance + (on a multi-segment index) API. + +
      + + + $Id: HitCollector.java 764551 2009-04-13 18:33:56Z mikemccand $ + + Please use instead. + +
      + + Called once for every document matching a query, with the document + number and its raw score. + +

      If, for example, an application wished to collect all of the hits for a + query in a BitSet, then it might: + + Searcher searcher = new IndexSearcher(indexReader); + final BitSet bits = new BitSet(indexReader.maxDoc()); + searcher.search(query, new HitCollector() { + public void collect(int doc, float score) { + bits.set(doc); + } + }); + + +

      Note: This is called in an inner search loop. For good search + performance, implementations of this method should not call + or + on every + document number encountered. Doing so can slow searches by an order + of magnitude or more. +

      Note: The score passed to this method is a raw score. + In other words, the score will not necessarily be a float whose value is + between 0 and 1. +

      +
      + + Filter caching singleton. It can be used + to save filters locally for reuse. + This class makes it possble to cache Filters even when using RMI, as it + keeps the cache on the seaercher side of the RMI connection. + + Also could be used as a persistent storage for any filter as long as the + filter provides a proper hashCode(), as that is used as the key in the cache. + + The cache is periodically cleaned up from a separate thread to ensure the + cache doesn't exceed the maximum size. + + + + The default maximum number of Filters in the cache + + + The default frequency of cache clenup + + + The cache itself + + + Maximum allowed cache size + + + Cache cleaning frequency + + + Cache cleaner that runs in a separate thread + + + Sets up the FilterManager singleton. + + + Sets the max size that cache should reach before it is cleaned up + maximum allowed cache size + + + + Sets the cache cleaning frequency in milliseconds. + cleaning frequency in millioseconds + + + + Returns the cached version of the filter. Allows the caller to pass up + a small filter but this will keep a persistent version around and allow + the caching filter to do its job. + + + The input filter + + The cached version of the filter + + + + Holds the filter and the last time the filter was used, to make LRU-based + cache cleaning possible. + TODO: Clean this up when we switch to Java 1.5 + + + + Keeps the cache from getting too big. + If we were using Java 1.5, we could use LinkedHashMap and we would not need this thread + to clean out the cache. + + The SortedSet sortedFilterItems is used only to sort the items from the cache, + so when it's time to clean up we have the TreeSet sort the FilterItems by + timestamp. + + Removes 1.5 * the numbers of items to make the cache smaller. + For example: + If cache clean size is 10, and the cache is at 15, we would remove (15 - 10) * 1.5 = 7.5 round up to 8. + This way we clean the cache a bit more, and avoid having the cache cleaner having to do it frequently. + + + + The SegmentMerger class combines two or more Segments, represented by an IndexReader (, + into a single Segment. After adding the appropriate readers, call the merge method to combine the + segments. +

      + If the compoundFile flag is set, then the segments will be merged into a compound file. + + +

      + + + + +
      + + Maximum number of contiguous documents to bulk-copy + when merging stored fields + + + + norms header placeholder + + + This ctor used only by test code. + + + The Directory to merge the other segments into + + The name of the new segment + + + + Add an IndexReader to the collection of readers that are to be merged + + + + + + The index of the reader to return + + The ith reader to be merged + + + + Merges the readers specified by the method into the directory passed to the constructor + The number of documents that were merged + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Merges the readers specified by the method + into the directory passed to the constructor. + + if false, we will not merge the + stored fields nor vectors files + + The number of documents that were merged + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + close all IndexReaders that have been added. + Should not be called before merge(). + + IOException + + + + The number of documents in all of the readers + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Merge the TermVectors from each of the segments into the new one. + IOException + + + Process postings from multiple segments all positioned on the + same term. Writes out merged entries into freqOutput and + the proxOutput streams. + + + array of segments + + number of cells in the array actually occupied + + number of documents across all segments where this term was found + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Records the fact that roughly units amount of work + have been done since this method was last called. + When adding time-consuming code into SegmentMerger, + you should test different values for units to ensure + that the time in between calls to merge.checkAborted + is up to ~ 1 second. + + + + Information about a segment such as it's name, directory, and files related + to the segment. + + *

      NOTE: This API is new and still experimental + (subject to change suddenly in the next release)

      +

      +
      + + Copy everything from src SegmentInfo into our instance. + + + Construct a new SegmentInfo instance by reading a + previously saved SegmentInfo from input. + + + directory to load from + + format of the segments info file + + input handle to read segment info from + + + + Returns total size in bytes of all of files used by + this segment. + + + + Returns true if this field for this segment has saved a separate norms file (_<segment>_N.sX). + + + the field index to check + + + + Returns true if any fields in this segment have separate norms. + + + Increment the generation count for the norms file for + this field. + + + field whose norm file will be rewritten + + + + Get the file name for the norms file for this field. + + + field index + + + + Mark whether this segment is stored as a compound file. + + + true if this is a compound file; + else, false + + + + Returns true if this segment is stored as a compound + file; else, false. + + + + Save this segment's info. + + + Used for debugging + + + We consider another SegmentInfo instance equal if it + has the same dir and same name. + + + + A FilterIndexReader contains another IndexReader, which it + uses as its basic source of data, possibly transforming the data along the + way or providing additional functionality. The class + FilterIndexReader itself simply implements all abstract methods + of IndexReader with versions that pass all requests to the + contained index reader. Subclasses of FilterIndexReader may + further override some of these methods and may also provide additional + methods and fields. + + + +

      Construct a FilterIndexReader based on the specified base reader. + Directory locking for delete, undeleteAll, and setNorm operations is + left to the base reader.

      +

      Note that base reader is closed if this FilterIndexReader is closed.

      +

      + specified base reader. + +
      + + + + + + + If the subclass of FilteredIndexReader modifies the + contents of the FieldCache, you must override this + method to provide a different key */ + + + + + If the subclass of FilteredIndexReader modifies the + deleted docs, you must override this method to provide + a different key */ + + + + Base class for filtering implementations. + + + Base class for filtering implementations. + + + Base class for filtering implementations. + + + Provides support for converting dates to strings and vice-versa. + The strings are structured so that lexicographic sorting orders by date, + which makes them suitable for use as field values and search terms. + +

      Note that this class saves dates with millisecond granularity, + which is bad for and , as those + queries are expanded to a BooleanQuery with a potentially large number + of terms when searching. Thus you might want to use + instead. + +

      + Note: dates before 1970 cannot be used, and therefore cannot be + indexed when using this class. See for an + alternative without such a limitation. + +

      + Another approach is , which provides + a sortable binary representation (prefix encoded) of numeric values, which + date/time are. + For indexing a , convert it to unix timestamp as + long and + index this as a numeric value with + and use to query it. + +

      + If you build a new index, use or + instead. + This class is included for use with existing + indices and will be removed in a future release. + +
      + + Converts a Date to a string suitable for indexing. + RuntimeException if the date specified in the + method argument is before 1970 + + + + Converts a millisecond time to a string suitable for indexing. + RuntimeException if the time specified in the + method argument is negative, that is, before 1970 + + + + Converts a string-encoded date into a millisecond time. + + + Converts a string-encoded date into a Date object. + + + Normalizes tokens extracted with . + + + Construct filtering in. + + + Returns the next token in the stream, or null at EOS. +

      Removes 's from the end of words. +

      Removes dots from acronyms. +

      +
      + + A SinkTokenizer can be used to cache Tokens for use in an Analyzer +

      + WARNING: and only work with the old TokenStream API. + If you switch to the new API, you need to use instead, which offers + the same functionality. +

      + + + Use instead + + + +
      + + Get the tokens in the internal List. +

      + WARNING: Adding tokens to this list requires the method to be called in order for them + to be made available. Also, this Tokenizer does nothing to protect against s + in the case of adds happening while is being called. +

      + WARNING: Since this SinkTokenizer can be reset and the cached tokens made available again, do not modify them. Modify clones instead. + +

      + A List of s + +
      + + Returns the next token out of the list of cached tokens + The next in the Sink. + + IOException + + + Override this method to cache only certain tokens, or new tokens based + on the old tokens. + + + The to add to the sink + + + + Reset the internal data structures to the start at the front of the list of tokens. Should be called + if tokens were added to the list after an invocation of + + IOException + + + Simple cache implementation that uses a HashMap to store (key, value) pairs. + This cache is not synchronized, use + if needed. + + + + Returns a Set containing all keys in this cache. + + +

      Implements using native OS file + locks. Note that because this LockFactory relies on + java.nio.* APIs for locking, any problems with those APIs + will cause locking to fail. Specifically, on certain NFS + environments the java.nio.* locks will fail (the lock can + incorrectly be double acquired) whereas + worked perfectly in those same + environments. For NFS based access to an index, it's + recommended that you try + first and work around the one limitation that a lock file + could be left when the JVM exits abnormally.

      + +

      The primary benefit of is + that lock files will be properly removed (by the OS) if + the JVM has an abnormal exit.

      + +

      Note that, unlike , the existence of + leftover lock files in the filesystem on exiting the JVM + is fine because the OS will free the locks held against + these files even though the files still remain.

      + +

      If you suspect that this or any other LockFactory is + not working properly in your environment, you can easily + test it by using , + and .

      + +

      + + +
      + + Create a NativeFSLockFactory instance, with null (unset) + lock directory. When you pass this factory to a + subclass, the lock directory is automatically set to the + directory itsself. Be sure to create one instance for each directory + your create! + + + + Create a NativeFSLockFactory instance, storing lock + files into the specified lockDirName: + + + where lock files are created. + + + + Create a NativeFSLockFactory instance, storing lock + files into the specified lockDir: + + + where lock files are created. + + + + Create a NativeFSLockFactory instance, storing lock + files into the specified lockDir: + + + where lock files are created. + + + + Writes bytes through to a primary IndexOutput, computing + checksum as it goes. Note that you cannot use seek(). + + + + Stores information about how to sort documents by terms in an individual + field. Fields must be indexed in order to sort by them. + +

      Created: Feb 11, 2004 1:25:29 PM + +

      + lucene 1.4 + + $Id: SortField.java 801344 2009-08-05 18:05:06Z yonik $ + + + +
      + + Sort by document score (relevancy). Sort values are Float and higher + values are at the front. + + + + Sort by document number (index order). Sort values are Integer and lower + values are at the front. + + + + Guess type of sort based on field contents. A regular expression is used + to look at the first term indexed for the field and determine if it + represents an integer number, a floating point number, or just arbitrary + string characters. + + Please specify the exact type, instead. + Especially, guessing does not work with the new + type. + + + + Sort using term values as Strings. Sort values are String and lower + values are at the front. + + + + Sort using term values as encoded Integers. Sort values are Integer and + lower values are at the front. + + + + Sort using term values as encoded Floats. Sort values are Float and + lower values are at the front. + + + + Sort using term values as encoded Longs. Sort values are Long and + lower values are at the front. + + + + Sort using term values as encoded Doubles. Sort values are Double and + lower values are at the front. + + + + Sort using term values as encoded Shorts. Sort values are Short and + lower values are at the front. + + + + Sort using a custom Comparator. Sort values are any Comparable and + sorting is done according to natural order. + + + + Sort using term values as encoded Bytes. Sort values are Byte and + lower values are at the front. + + + + Sort using term values as Strings, but comparing by + value (using String.compareTo) for all comparisons. + This is typically slower than , which + uses ordinals to do the sorting. + + + + Represents sorting by document score (relevancy). + + + Represents sorting by document number (index order). + + + Creates a sort by terms in the given field where the type of term value + is determined dynamically (). + + Name of field to sort by, cannot be + null. + + Please specify the exact type instead. + + + + Creates a sort, possibly in reverse, by terms in the given field where + the type of term value is determined dynamically (). + + Name of field to sort by, cannot be null. + + True if natural order should be reversed. + + Please specify the exact type instead. + + + + Creates a sort by terms in the given field with the type of term + values explicitly given. + + Name of field to sort by. Can be null if + type is SCORE or DOC. + + Type of values in the terms. + + + + Creates a sort, possibly in reverse, by terms in the given field with the + type of term values explicitly given. + + Name of field to sort by. Can be null if + type is SCORE or DOC. + + Type of values in the terms. + + True if natural order should be reversed. + + + + Creates a sort by terms in the given field, parsed + to numeric values using a custom . + + Name of field to sort by. Must not be null. + + Instance of a , + which must subclass one of the existing numeric + parsers from . Sort type is inferred + by testing which numeric parser the parser subclasses. + + IllegalArgumentException if the parser fails to + subclass an existing numeric parser, or field is null + + + + Creates a sort, possibly in reverse, by terms in the given field, parsed + to numeric values using a custom . + + Name of field to sort by. Must not be null. + + Instance of a , + which must subclass one of the existing numeric + parsers from . Sort type is inferred + by testing which numeric parser the parser subclasses. + + True if natural order should be reversed. + + IllegalArgumentException if the parser fails to + subclass an existing numeric parser, or field is null + + + + Creates a sort by terms in the given field sorted + according to the given locale. + + Name of field to sort by, cannot be null. + + Locale of values in the field. + + + + Creates a sort, possibly in reverse, by terms in the given field sorted + according to the given locale. + + Name of field to sort by, cannot be null. + + Locale of values in the field. + + + + Creates a sort with a custom comparison function. + Name of field to sort by; cannot be null. + + Returns a comparator for sorting hits. + + use SortField (String field, FieldComparatorSource comparator) + + + + Creates a sort with a custom comparison function. + Name of field to sort by; cannot be null. + + Returns a comparator for sorting hits. + + + + Creates a sort, possibly in reverse, with a custom comparison function. + Name of field to sort by; cannot be null. + + Returns a comparator for sorting hits. + + True if natural order should be reversed. + + use SortField (String field, FieldComparatorSource comparator, boolean reverse) + + + + Creates a sort, possibly in reverse, with a custom comparison function. + Name of field to sort by; cannot be null. + + Returns a comparator for sorting hits. + + True if natural order should be reversed. + + + + Returns the name of the field. Could return null + if the sort is by SCORE or DOC. + + Name of field, possibly null. + + + + Returns the type of contents in the field. + One of the constants SCORE, DOC, AUTO, STRING, INT or FLOAT. + + + + Returns the Locale by which term values are interpreted. + May return null if no Locale was specified. + + Locale, or null. + + + + Returns the instance of a parser that fits to the given sort type. + May return null if no parser was specified. Sorting is using the default parser then. + + An instance of a parser, or null. + + + + Returns whether the sort should be reversed. + True if natural order should be reversed. + + + + use + + + + Use legacy IndexSearch implementation: search with a DirectoryReader rather + than passing a single hit collector to multiple SegmentReaders. + + + true for legacy behavior + + will be removed in Lucene 3.0. + + + + if true, IndexSearch will use legacy sorting search implementation. + eg. multiple Priority Queues. + + will be removed in Lucene 3.0. + + + + Returns true if o is equal to this. If a + (deprecated) or + was provided, it must properly + implement equals (unless a singleton is always used). + + + + Returns true if o is equal to this. If a + (deprecated) or + was provided, it must properly + implement hashCode (unless a singleton is always + used). + + + + Returns the to use for + sorting. + + NOTE: This API is experimental and might change in + incompatible ways in the next release. + + + number of top hits the queue will store + + position of this SortField within + . The comparator is primary if sortPos==0, + secondary if sortPos==1, etc. Some comparators can + optimize themselves when they are the primary sort. + + to use when sorting + + + + Attempts to detect the given field type for an IndexReader. + + + + + A Filter that restricts search results to values that have a matching prefix in a given + field. + + + + Prints a user-readable version of this query. + + + The BoostingTermQuery is very similar to the except + that it factors in the value of the payload located at each of the positions where the + occurs. +

      + In order to take advantage of this, you must override + which returns 1 by default. +

      + Payload scores are averaged across term occurrences in the document. + +

      + + + + See + +
      + + This class is very similar to + except that it factors + in the value of the payload located at each of the positions where the + occurs. +

      + In order to take advantage of this, you must override + + which returns 1 by default. +

      + Payload scores are aggregated using a pluggable . + +

      +
      + + + * + + IOException + + + Returns the SpanScorer score only. +

      + Should not be overriden without good cause! + +

      + the score for just the Span part w/o the payload + + IOException + + + + +
      + + The score for the payload + + + The score, as calculated by + + + + + A that only accepts numeric values within + a specified range. To use this, you must first index the + numeric values using (expert: + ). + +

      You create a new NumericRangeFilter with the static + factory methods, eg: + + + Filter f = NumericRangeFilter.newFloatRange("weight", + new Float(0.3f), new Float(0.10f), + true, true); + + + accepts all documents whose float valued "weight" field + ranges from 0.3 to 0.10, inclusive. + See for details on how Lucene + indexes and searches numeric valued fields. + +

      NOTE: This API is experimental and + might change in incompatible ways in the next + release. + +

      + 2.9 + + +
      + + Factory that creates a NumericRangeFilter, that filters a long + range using the given precisionStep. + You can have half-open ranges (which are in fact </≤ or >/≥ queries) + by setting the min or max value to null. By setting inclusive to false, it will + match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. + + + + Factory that creates a NumericRangeFilter, that queries a long + range using the default precisionStep (4). + You can have half-open ranges (which are in fact </≤ or >/≥ queries) + by setting the min or max value to null. By setting inclusive to false, it will + match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. + + + + Factory that creates a NumericRangeFilter, that filters a int + range using the given precisionStep. + You can have half-open ranges (which are in fact </≤ or >/≥ queries) + by setting the min or max value to null. By setting inclusive to false, it will + match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. + + + + Factory that creates a NumericRangeFilter, that queries a int + range using the default precisionStep (4). + You can have half-open ranges (which are in fact </≤ or >/≥ queries) + by setting the min or max value to null. By setting inclusive to false, it will + match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. + + + + Factory that creates a NumericRangeFilter, that filters a double + range using the given precisionStep. + You can have half-open ranges (which are in fact </≤ or >/≥ queries) + by setting the min or max value to null. By setting inclusive to false, it will + match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. + + + + Factory that creates a NumericRangeFilter, that queries a double + range using the default precisionStep (4). + You can have half-open ranges (which are in fact </≤ or >/≥ queries) + by setting the min or max value to null. By setting inclusive to false, it will + match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. + + + + Factory that creates a NumericRangeFilter, that filters a float + range using the given precisionStep. + You can have half-open ranges (which are in fact </≤ or >/≥ queries) + by setting the min or max value to null. By setting inclusive to false, it will + match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. + + + + Factory that creates a NumericRangeFilter, that queries a float + range using the default precisionStep (4). + You can have half-open ranges (which are in fact </≤ or >/≥ queries) + by setting the min or max value to null. By setting inclusive to false, it will + match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. + + + + Returns the field name for this filter + + + Returns true if the lower endpoint is inclusive + + + Returns true if the upper endpoint is inclusive + + + Returns the lower value of this range filter + + + Returns the upper value of this range filter + + + Expert: obtains the ordinal of the field value from the default Lucene + FieldCache using getStringIndex() + and reverses the order. +

      + The native lucene index order is used to assign an ordinal value for each field value. +

      + Field values (terms) are lexicographically ordered by unicode value, and numbered starting at 1. +
      + Example of reverse ordinal (rord): +
      If there were only three field values: "apple","banana","pear" +
      then rord("apple")=3, rord("banana")=2, ord("pear")=1 +

      + WARNING: + rord() depends on the position in an index and can thus change + when other documents are inserted or deleted, + or if a MultiSearcher is used. + +

      + WARNING: The status of the Search.Function package is experimental. + The APIs introduced here might change in the future and will not be + supported anymore in such a case. + +

      NOTE: with the switch in 2.9 to segment-based + searching, if is invoked with a + composite (multi-segment) reader, this can easily cause + double RAM usage for the values in the FieldCache. It's + best to switch your application to pass only atomic + (single segment) readers to this API. Alternatively, for + a short-term fix, you could wrap your ValueSource using + , which costs more CPU per lookup + but will not consume double the FieldCache RAM.

      +

      +
      + + Contructor for a certain field. + field whose values reverse order is used. + + + + Expert: obtains float field values from the + FieldCache + using getFloats() and makes those values + available as other numeric types, casting as needed. + +

      + WARNING: The status of the Search.Function package is experimental. + The APIs introduced here might change in the future and will not be + supported anymore in such a case. + +

      + for requirements" + on the field. + +

      NOTE: with the switch in 2.9 to segment-based + searching, if is invoked with a + composite (multi-segment) reader, this can easily cause + double RAM usage for the values in the FieldCache. It's + best to switch your application to pass only atomic + (single segment) readers to this API. Alternatively, for + a short-term fix, you could wrap your ValueSource using + , which costs more CPU per lookup + but will not consume double the FieldCache RAM.

      + + + +

      Create a cached float field source with default string-to-float parser. +
      + + Create a cached float field source with a specific string-to-float parser. + + + Abstract class for enumerating a subset of all terms. +

      Term enumerations are always ordered by Term.compareTo(). Each term in + the enumeration is greater than all that precede it. +

      +
      + + the current term + + + the delegate enum - to set this member use + + + Equality compare on the term + + + Equality measure on the term + + + Indicates the end of the enumeration has been reached + + + use this method to set the actual TermEnum (e.g. in ctor), + it will be automatically positioned on the first matching term. + + + + Returns the docFreq of the current Term in the enumeration. + Returns -1 if no Term matches or all terms have been enumerated. + + + + Increments the enumeration to the next element. True if one exists. + + + Returns the current Term in the enumeration. + Returns null if no Term matches or all terms have been enumerated. + + + + Closes the enumeration to further activity, freeing resources. + + + A range filter built on top of a cached single term field (in ). + +

      FieldCacheRangeFilter builds a single cache for the field the first time it is used. + Each subsequent FieldCacheRangeFilter on the same field then reuses this cache, + even if the range itself changes. + +

      This means that FieldCacheRangeFilter is much faster (sometimes more than 100x as fast) + as building a (or on a ) + for each query, if using a . However, if the range never changes it + is slower (around 2x as slow) than building a CachingWrapperFilter on top of a single TermRangeFilter. + + For numeric data types, this filter may be significantly faster than . + Furthermore, it does not need the numeric values encoded by . But + it has the problem that it only works with exact one value/document (see below). + +

      As with all based functionality, FieldCacheRangeFilter is only valid for + fields which exact one term for each document (except for + where 0 terms are also allowed). Due to a restriction of , for numeric ranges + all terms that do not have a numeric value, 0 is assumed. + +

      Thus it works on dates, prices and other single value fields but will not work on + regular text fields. It is preferable to use a NOT_ANALYZED field to ensure that + there is only a single term. + +

      This class does not have an constructor, use one of the static factory methods available, + that create a correct instance for different data types supported by . +

      +
      + + This method is implemented for each data type + + + Creates a string range query using . This works with all + fields containing zero or one term in the field. The range can be half-open by setting one + of the values to null. + + + + Creates a numeric range query using . This works with all + byte fields containing exactly one numeric term in the field. The range can be half-open by setting one + of the values to null. + + + + Creates a numeric range query using . This works with all + byte fields containing exactly one numeric term in the field. The range can be half-open by setting one + of the values to null. + + + + Creates a numeric range query using . This works with all + short fields containing exactly one numeric term in the field. The range can be half-open by setting one + of the values to null. + + + + Creates a numeric range query using . This works with all + short fields containing exactly one numeric term in the field. The range can be half-open by setting one + of the values to null. + + + + Creates a numeric range query using . This works with all + int fields containing exactly one numeric term in the field. The range can be half-open by setting one + of the values to null. + + + + Creates a numeric range query using . This works with all + int fields containing exactly one numeric term in the field. The range can be half-open by setting one + of the values to null. + + + + Creates a numeric range query using . This works with all + long fields containing exactly one numeric term in the field. The range can be half-open by setting one + of the values to null. + + + + Creates a numeric range query using . This works with all + long fields containing exactly one numeric term in the field. The range can be half-open by setting one + of the values to null. + + + + Creates a numeric range query using . This works with all + float fields containing exactly one numeric term in the field. The range can be half-open by setting one + of the values to null. + + + + Creates a numeric range query using . This works with all + float fields containing exactly one numeric term in the field. The range can be half-open by setting one + of the values to null. + + + + Creates a numeric range query using . This works with all + double fields containing exactly one numeric term in the field. The range can be half-open by setting one + of the values to null. + + + + Creates a numeric range query using . This works with all + double fields containing exactly one numeric term in the field. The range can be half-open by setting one + of the values to null. + + + + this method checks, if a doc is a hit, should throw AIOBE, when position invalid + + + this DocIdSet is cacheable, if it works solely with FieldCache and no TermDocs + + + use instead. + + + + use instead. + + + + use instead. + + + + use instead. + + + + use instead. + + + + The TermVectorMapper can be used to map Term Vectors into your own + structure instead of the parallel array structure used by + . +

      + It is up to the implementation to make sure it is thread-safe. + + + +

      +
      + + + true if this mapper should tell Lucene to ignore positions even if they are stored + + similar to ignoringPositions + + + + Tell the mapper what to expect in regards to field, number of terms, offset and position storage. + This method will be called once before retrieving the vector for a field. + + This method will be called before . + + The field the vector is for + + The number of terms that need to be mapped + + true if the mapper should expect offset information + + true if the mapper should expect positions info + + + + Map the Term Vector information into your own structure + The term to add to the vector + + The frequency of the term in the document + + null if the offset is not specified, otherwise the offset into the field of the term + + null if the position is not specified, otherwise the position in the field of the term + + + + Indicate to Lucene that even if there are positions stored, this mapper is not interested in them and they + can be skipped over. Derived classes should set this to true if they want to ignore positions. The default + is false, meaning positions will be loaded if they are stored. + + false + + + + + Same principal as , but applied to offsets. false by default. + + false + + + + Passes down the index of the document whose term vector is currently being mapped, + once for each top level call to a term vector reader. +

      + Default implementation IGNORES the document number. Override if your implementation needs the document number. +

      + NOTE: Document numbers are internal to Lucene and subject to change depending on indexing operations. + +

      + index of document currently being mapped + +
      + + A Payload is metadata that can be stored together with each occurrence + of a term. This metadata is stored inline in the posting list of the + specific term. +

      + To store payloads in the index a has to be used that + produces payload data. +

      + Use and + to retrieve the payloads from the index.
      + +

      +
      + + the byte array containing the payload data + + + the offset within the byte array + + + the length of the payload data + + + Creates an empty payload and does not allocate a byte array. + + + Creates a new payload with the the given array as data. + A reference to the passed-in array is held, i. e. no + copy is made. + + + the data of this payload + + + + Creates a new payload with the the given array as data. + A reference to the passed-in array is held, i. e. no + copy is made. + + + the data of this payload + + the offset in the data byte array + + the length of the data + + + + Sets this payloads data. + A reference to the passed-in array is held, i. e. no + copy is made. + + + + Sets this payloads data. + A reference to the passed-in array is held, i. e. no + copy is made. + + + + Returns a reference to the underlying byte array + that holds this payloads data. + + + + Returns the offset in the underlying byte array + + + Returns the length of the payload data. + + + Returns the byte at the given index. + + + Allocates a new byte array, copies the payload data into it and returns it. + + + Copies the payload data to a byte array. + + + the target byte array + + the offset in the target byte array + + + + Clones this payload by creating a copy of the underlying + byte array. + + + + Processes all occurrences of a single field + + + Works in conjunction with the SinkTokenizer to provide the ability to set aside tokens + that have already been analyzed. This is useful in situations where multiple fields share + many common analysis steps and then go their separate ways. +

      + It is also useful for doing things like entity extraction or proper noun analysis as + part of the analysis workflow and saving off those tokens for use in another field. + + + SinkTokenizer sink1 = new SinkTokenizer(); + SinkTokenizer sink2 = new SinkTokenizer(); + TokenStream source1 = new TeeTokenFilter(new TeeTokenFilter(new WhitespaceTokenizer(reader1), sink1), sink2); + TokenStream source2 = new TeeTokenFilter(new TeeTokenFilter(new WhitespaceTokenizer(reader2), sink1), sink2); + TokenStream final1 = new LowerCaseFilter(source1); + TokenStream final2 = source2; + TokenStream final3 = new EntityDetect(sink1); + TokenStream final4 = new URLDetect(sink2); + d.add(new Field("f1", final1)); + d.add(new Field("f2", final2)); + d.add(new Field("f3", final3)); + d.add(new Field("f4", final4)); + + In this example, sink1 and sink2 will both get tokens from both + reader1 and reader2 after whitespace tokenizer + and now we can further wrap any of these in extra analysis, and more "sources" can be inserted if desired. + It is important, that tees are consumed before sinks (in the above example, the field names must be + less the sink's field names). + Note, the EntityDetect and URLDetect TokenStreams are for the example and do not currently exist in Lucene +

      + + See LUCENE-1058. +

      + WARNING: and only work with the old TokenStream API. + If you switch to the new API, you need to use instead, which offers + the same functionality. +

      + + + Use instead + + +
      + + This TokenFilter provides the ability to set aside attribute states + that have already been analyzed. This is useful in situations where multiple fields share + many common analysis steps and then go their separate ways. +

      + It is also useful for doing things like entity extraction or proper noun analysis as + part of the analysis workflow and saving off those tokens for use in another field. + + + TeeSinkTokenFilter source1 = new TeeSinkTokenFilter(new WhitespaceTokenizer(reader1)); + TeeSinkTokenFilter.SinkTokenStream sink1 = source1.newSinkTokenStream(); + TeeSinkTokenFilter.SinkTokenStream sink2 = source1.newSinkTokenStream(); + TeeSinkTokenFilter source2 = new TeeSinkTokenFilter(new WhitespaceTokenizer(reader2)); + source2.addSinkTokenStream(sink1); + source2.addSinkTokenStream(sink2); + TokenStream final1 = new LowerCaseFilter(source1); + TokenStream final2 = source2; + TokenStream final3 = new EntityDetect(sink1); + TokenStream final4 = new URLDetect(sink2); + d.add(new Field("f1", final1)); + d.add(new Field("f2", final2)); + d.add(new Field("f3", final3)); + d.add(new Field("f4", final4)); + + In this example, sink1 and sink2 will both get tokens from both + reader1 and reader2 after whitespace tokenizer + and now we can further wrap any of these in extra analysis, and more "sources" can be inserted if desired. + It is important, that tees are consumed before sinks (in the above example, the field names must be + less the sink's field names). If you are not sure, which stream is consumed first, you can simply + add another sink and then pass all tokens to the sinks at once using . + This TokenFilter is exhausted after this. In the above example, change + the example above to: + + ... + TokenStream final1 = new LowerCaseFilter(source1.newSinkTokenStream()); + TokenStream final2 = source2.newSinkTokenStream(); + sink1.consumeAllTokens(); + sink2.consumeAllTokens(); + ... + + In this case, the fields can be added in any order, because the sources are not used anymore and all sinks are ready. +

      Note, the EntityDetect and URLDetect TokenStreams are for the example and do not currently exist in Lucene. +

      +
      + + Instantiates a new TeeSinkTokenFilter. + + + Returns a new that receives all tokens consumed by this stream. + + + Returns a new that receives all tokens consumed by this stream + that pass the supplied filter. + + + + + + Adds a created by another TeeSinkTokenFilter + to this one. The supplied stream will also receive all consumed tokens. + This method can be used to pass tokens from two different tees to one sink. + + + + TeeSinkTokenFilter passes all tokens to the added sinks + when itself is consumed. To be sure, that all tokens from the input + stream are passed to the sinks, you can call this methods. + This instance is exhausted after this, but all sinks are instant available. + + + + A filter that decides which states to store in the sink. + + + Returns true, iff the current state of the passed-in shall be stored + in the sink. + + + + Called by . This method does nothing by default + and can optionally be overridden. + + + + Removes stop words from a token stream. + + + Construct a token stream filtering the given input. + Use instead + + + + Construct a token stream filtering the given input. + true if token positions should record the removed stop words + + input TokenStream + + array of stop words + + Use instead. + + + + Constructs a filter which removes words from the input + TokenStream that are named in the array of words. + + Use instead + + + + Constructs a filter which removes words from the input + TokenStream that are named in the array of words. + + true if token positions should record the removed stop words + + input TokenStream + + array of stop words + + true if case is ignored + + Use instead. + + + + Construct a token stream filtering the given input. + If stopWords is an instance of (true if + makeStopSet() was used to construct the set) it will be directly used + and ignoreCase will be ignored since CharArraySet + directly controls case sensitivity. +

      + If stopWords is not an instance of , + a new CharArraySet will be constructed and ignoreCase will be + used to specify the case sensitivity of that set. + +

      + + + The set of Stop Words. + + -Ignore case when stopping. + + Use instead + +
      + + Construct a token stream filtering the given input. + If stopWords is an instance of (true if + makeStopSet() was used to construct the set) it will be directly used + and ignoreCase will be ignored since CharArraySet + directly controls case sensitivity. +

      + If stopWords is not an instance of , + a new CharArraySet will be constructed and ignoreCase will be + used to specify the case sensitivity of that set. + +

      + true if token positions should record the removed stop words + + Input TokenStream + + The set of Stop Words. + + -Ignore case when stopping. + +
      + + Constructs a filter which removes words from the input + TokenStream that are named in the Set. + + + + + Use instead + + + + Constructs a filter which removes words from the input + TokenStream that are named in the Set. + + + true if token positions should record the removed stop words + + Input stream + + The set of Stop Words. + + + + + + Builds a Set from an array of stop words, + appropriate for passing into the StopFilter constructor. + This permits this stopWords construction to be cached once when + an Analyzer is constructed. + + + passing false to ignoreCase + + + + Builds a Set from an array of stop words, + appropriate for passing into the StopFilter constructor. + This permits this stopWords construction to be cached once when + an Analyzer is constructed. + + + passing false to ignoreCase + + + + + An array of stopwords + + If true, all words are lower cased first. + + a Set containing the words + + + + + A List of Strings representing the stopwords + + if true, all words are lower cased first + + A Set containing the words + + + + Returns the next input Token whose term() is not a stop word. + + + + + Please specify this when you create the StopFilter + + + + Returns version-dependent default for enablePositionIncrements. Analyzers + that embed StopFilter use this method when creating the StopFilter. Prior + to 2.9, this returns . On 2.9 + or later, it returns true. + + + + Set the default position increments behavior of every StopFilter created + from now on. +

      + Note: behavior of a single StopFilter instance can be modified with + . This static method allows + control over behavior of classes using StopFilters internally, for + example + if used with the no-arg ctor. +

      + Default : false. + +

      + + + Please specify this when you create the StopFilter + +
      + + + + + + If true, this StopFilter will preserve + positions of the incoming tokens (ie, accumulate and + set position increments of the removed stop tokens). + Generally, true is best as it does not + lose information (positions of the original tokens) + during indexing. + +

      When set, when a token is stopped + (omitted), the position increment of the following + token is incremented. + +

      NOTE: be sure to also + set if + you use QueryParser to create queries. +

      +
      + + CharReader is a Reader wrapper. It reads chars from + Reader and outputs , defining an + identify function method that + simply returns the provided offset. + + + + Stores and iterate on sorted integers in compressed form in RAM.
      + The code for compressing the differences between ascending integers was + borrowed from and + .

      + NOTE: this class assumes the stored integers are doc Ids (hence why it + extends ). Therefore its assumes + can be used as sentinel. If you intent to use + this value, then make sure it's not used during search flow. +

      +
      + + When a BitSet has fewer than 1 in BITS2VINTLIST_SIZE bits set, + a SortedVIntList representing the index numbers of the set bits + will be smaller than that BitSet. + + + + Create a SortedVIntList from all elements of an array of integers. + + + A sorted array of non negative integers. + + + + Create a SortedVIntList from an array of integers. + An array of sorted non negative integers. + + The number of integers to be used from the array. + + + + Create a SortedVIntList from a BitSet. + A bit set representing a set of integers. + + + + Create a SortedVIntList from an OpenBitSet. + A bit set representing a set of integers. + + + + Create a SortedVIntList. + An iterator providing document numbers as a set of integers. + This DocIdSetIterator is iterated completely when this constructor + is called and it must provide the integers in non + decreasing order. + + + + The total number of sorted integers. + + + + The size of the byte array storing the compressed sorted integers. + + + + This DocIdSet implementation is cacheable. + + + An iterator over the sorted integers. + + + + use instead. + + + + use instead. + + + + use instead. + + + + A ScorerDocQueue maintains a partial ordering of its Scorers such that the + least Scorer can always be found in constant time. Put()'s and pop()'s + require log(size) time. The ordering is by Scorer.doc(). + + + + Create a ScorerDocQueue with a maximum size. + + + Adds a Scorer to a ScorerDocQueue in log(size) time. + If one tries to add more Scorers than maxSize + a RuntimeException (ArrayIndexOutOfBound) is thrown. + + + + Adds a Scorer to the ScorerDocQueue in log(size) time if either + the ScorerDocQueue is not full, or not lessThan(scorer, top()). + + + + true if scorer is added, false otherwise. + + + + Returns the least Scorer of the ScorerDocQueue in constant time. + Should not be used when the queue is empty. + + + + Returns document number of the least Scorer of the ScorerDocQueue + in constant time. + Should not be used when the queue is empty. + + + + Removes and returns the least scorer of the ScorerDocQueue in log(size) + time. + Should not be used when the queue is empty. + + + + Removes the least scorer of the ScorerDocQueue in log(size) time. + Should not be used when the queue is empty. + + + + Should be called when the scorer at top changes doc() value. + Still log(n) worst case, but it's at least twice as fast to + { pq.top().change(); pq.adjustTop(); } + instead of + { o = pq.pop(); o.change(); pq.push(o); } + + + + + Returns the number of scorers currently stored in the ScorerDocQueue. + + + Removes all entries from the ScorerDocQueue. + + + Construct an OpenBitSetDISI with its bits set + from the doc ids of the given DocIdSetIterator. + Also give a maximum size one larger than the largest doc id for which a + bit may ever be set on this OpenBitSetDISI. + + + + Construct an OpenBitSetDISI with no bits set, and a given maximum size + one larger than the largest doc id for which a bit may ever be set + on this OpenBitSetDISI. + + + + Perform an inplace OR with the doc ids from a given DocIdSetIterator, + setting the bit for each such doc id. + These doc ids should be smaller than the maximum size passed to the + constructor. + + + + Perform an inplace AND with the doc ids from a given DocIdSetIterator, + leaving only the bits set for which the doc ids are in common. + These doc ids should be smaller than the maximum size passed to the + constructor. + + + + Perform an inplace NOT with the doc ids from a given DocIdSetIterator, + clearing all the bits for each such doc id. + These doc ids should be smaller than the maximum size passed to the + constructor. + + + + Perform an inplace XOR with the doc ids from a given DocIdSetIterator, + flipping all the bits for each such doc id. + These doc ids should be smaller than the maximum size passed to the + constructor. + + + + Methods for manipulating arrays. + + + Parses the string argument as if it was an int value and returns the + result. Throws NumberFormatException if the string does not represent an + int quantity. + + + a string representation of an int quantity. + + int the value represented by the argument + + NumberFormatException if the argument could not be parsed as an int quantity. + + + Parses a char array into an int. + the character array + + The offset into the array + + The length + + the int + + NumberFormatException if it can't parse + + + Parses the string argument as if it was an int value and returns the + result. Throws NumberFormatException if the string does not represent an + int quantity. The second argument specifies the radix to use when parsing + the value. + + + a string representation of an int quantity. + + + + the base to use for conversion. + + int the value represented by the argument + + NumberFormatException if the argument could not be parsed as an int quantity. + + + Returns hash of chars in range start (inclusive) to + end (inclusive) + + + + Returns hash of chars in range start (inclusive) to + end (inclusive) + + + + A that wraps another + and verifies that each lock obtain/release + is "correct" (never results in two processes holding the + lock at the same time). It does this by contacting an + external server () to assert that + at most one process holds the lock at a time. To use + this, you should also run on the + host & port matching what you pass to the constructor. + + + + + + + + + should be a unique id across all clients + + the LockFactory that we are testing + + host or IP where + is running + + the port is + listening on + + + +

      + The TimeLimitedCollector is used to timeout search requests that take longer + than the maximum allowed search time limit. After this time is exceeded, the + search thread is stopped by throwing a TimeExceeded Exception. +

      + +

      + Use instead, which extends the new + . This class will be removed in 3.0. + +
      + + Default timer resolution. + + + + + Default for . + + + + + Create a TimeLimitedCollector wrapper over another HitCollector with a specified timeout. + the wrapped HitCollector + + max time allowed for collecting hits after which is thrown + + + + Calls collect() on the decorated HitCollector. + + + TimeExceededException if the time allowed has been exceeded. + + + Return the timer resolution. + + + + + Set the timer resolution. + The default timer resolution is 20 milliseconds. + This means that a search required to take no longer than + 800 milliseconds may be stopped after 780 to 820 milliseconds. +
      Note that: + + Finer (smaller) resolution is more accurate but less efficient. + Setting resolution to less than 5 milliseconds will be silently modified to 5 milliseconds. + Setting resolution smaller than current resolution might take effect only after current + resolution. (Assume current resolution of 20 milliseconds is modified to 5 milliseconds, + then it can take up to 20 milliseconds for the change to have effect. + +
      +
      + + Checks if this time limited collector is greedy in collecting the last hit. + A non greedy collector, upon a timeout, would throw a + without allowing the wrapped collector to collect current doc. A greedy one would + first allow the wrapped hit collector to collect current doc and only then + throw a . + + + + + + Sets whether this time limited collector is greedy. + true to make this time limited greedy + + + + + + TimerThread provides a pseudo-clock service to all searching + threads, so that they can count elapsed time with less overhead + than repeatedly calling System.currentTimeMillis. A single + thread should be created to be used for all searches. + + + + Get the timer value in milliseconds. + + + Thrown when elapsed search time exceeds allowed search time. + + + Returns allowed time (milliseconds). + + + Returns elapsed time (milliseconds). + + + Returns last doc that was collected when the search time exceeded. + + + Expert: Compares two ScoreDoc objects for sorting. + +

      Created: Feb 3, 2004 9:00:16 AM + +

      + lucene 1.4 + + $Id: ScoreDocComparator.java 738219 2009-01-27 20:15:21Z mikemccand $ + + use + +
      + + Special comparator for sorting hits according to computed relevance (document score). + + + Special comparator for sorting hits according to index order (document number). + + + Creates a new instance with size elements. If + prePopulate is set to true, the queue will pre-populate itself + with sentinel objects and set its to size. In + that case, you should not rely on to get the number of + actual elements that were added to the queue, but keep track yourself.
      + NOTE: in case prePopulate is true, you should pop + elements from the queue using the following code example: + + + PriorityQueue pq = new HitQueue(10, true); // pre-populate. + ScoreDoc top = pq.top(); + + // Add/Update one element. + top.score = 1.0f; + top.doc = 0; + top = (ScoreDoc) pq.updateTop(); + int totalHits = 1; + + // Now pop only the elements that were *truly* inserted. + // First, pop all the sentinel elements (there are pq.size() - totalHits). + for (int i = pq.size() - totalHits; i > 0; i--) pq.pop(); + + // Now pop the truly added elements. + ScoreDoc[] results = new ScoreDoc[totalHits]; + for (int i = totalHits - 1; i >= 0; i--) { + results[i] = (ScoreDoc) pq.pop(); + } + + +

      NOTE: This class pre-allocate a full array of + length size. + +

      + the requested size of this queue. + + specifies whether to pre-populate the queue with sentinel values. + + + +
      + + Expert: obtains single byte field values from the + FieldCache + using getBytes() and makes those values + available as other numeric types, casting as needed. + +

      + WARNING: The status of the Search.Function package is experimental. + The APIs introduced here might change in the future and will not be + supported anymore in such a case. + +

      + for requirements" + on the field. + +

      NOTE: with the switch in 2.9 to segment-based + searching, if is invoked with a + composite (multi-segment) reader, this can easily cause + double RAM usage for the values in the FieldCache. It's + best to switch your application to pass only atomic + (single segment) readers to this API. Alternatively, for + a short-term fix, you could wrap your ValueSource using + , which costs more CPU per lookup + but will not consume double the FieldCache RAM.

      + + + +

      Create a cached byte field source with default string-to-byte parser. +
      + + Create a cached byte field source with a specific string-to-byte parser. + + + Expert: A hit queue for sorting by hits by terms in more than one field. + Uses FieldCache.DEFAULT for maintaining + internal term lookup tables. + + This class will not resolve SortField.AUTO types, and expects the type + of all SortFields used for construction to already have been resolved. + is a utility method which + may be used for field type detection. + + NOTE: This API is experimental and might change in + incompatible ways in the next release. + + + 2.9 + + $Id: + + + + + + + + Creates a hit queue sorted by the given list of fields. + +

      NOTE: The instances returned by this method + pre-allocate a full array of length numHits. + +

      + SortField array we are sorting by in priority order (highest + priority first); cannot be null or empty + + The number of hits to retain. Must be greater than zero. + + IOException +
      + + Stores the sort criteria being used. + + + Given a queue Entry, creates a corresponding FieldDoc + that contains the values used to sort the given document. + These values are not the raw values out of the index, but the internal + representation of them. This is so the given search hit can be collated by + a MultiSearcher with other search hits. + + + The Entry used to create a FieldDoc + + The newly created FieldDoc + + + + + + Returns the SortFields being used by this hit queue. + + + An implementation of which is optimized in case + there is just one comparator. + + + + Returns whether a is less relevant than b. + ScoreDoc + + ScoreDoc + + true if document a should be sorted after document b. + + + + An implementation of which is optimized in case + there is more than one comparator. + + + + A TermInfo is the record of information stored for a term. + + + The number of documents which contain the term. + + + Call this if the IndexInput passed to + stores terms in the "modified UTF8" (pre LUCENE-510) + format. + + + + This is a DocFieldConsumer that writes stored fields. + + + Fills in any hole in the docIDs + + + A that wraps around any other + and adds the ability to hold and + later release a single "snapshot" of an index. While + the snapshot is held, the will not + remove any files associated with it even if the index is + otherwise being actively, arbitrarily changed. Because + we wrap another arbitrary , this + gives you the freedom to continue using whatever + you would normally want to use with your + index. Note that you can re-use a single instance of + SnapshotDeletionPolicy across multiple writers as long + as they are against the same index Directory. Any + snapshot held when a writer is closed will "survive" + when the next writer is opened. + +

      WARNING: This API is a new and experimental and + may suddenly change.

      +

      +
      + + Take a snapshot of the most recent commit to the + index. You must call release() to free this snapshot. + Note that while the snapshot is held, the files it + references will not be deleted, which will consume + additional disk space in your index. If you take a + snapshot at a particularly bad time (say just before + you call optimize()) then in the worst case this could + consume an extra 1X of your total index size, until + you release the snapshot. + + + + Release the currently held snapshot. + + +

      Expert: represents a single commit into an index as seen by the + or .

      + +

      Changes to the content of an index are made visible + only after the writer who made that change commits by + writing a new segments file + (segments_N). This point in time, when the + action of writing of a new segments file to the directory + is completed, is an index commit.

      + +

      Each index commit point has a unique segments file + associated with it. The segments file associated with a + later index commit point would have a larger N.

      + +

      WARNING: This API is a new and experimental and + may suddenly change.

      +

      +
      + + Please subclass IndexCommit class instead + + + + Get the segments file (segments_N) associated + with this commit point. + + + + Returns all index files referenced by this commit point. + + + Delete this commit point. +

      + Upon calling this, the writer is notified that this commit + point should be deleted. +

      + Decision that a commit-point should be deleted is taken by the in effect + and therefore this should only be called by its or + methods. +

      +
      + + Get the segments file (segments_N) associated + with this commit point. + + + + Returns all index files referenced by this commit point. + + + Returns the for the index. + + + Delete this commit point. This only applies when using + the commit point in the context of IndexWriter's + IndexDeletionPolicy. +

      + Upon calling this, the writer is notified that this commit + point should be deleted. +

      + Decision that a commit-point should be deleted is taken by the in effect + and therefore this should only be called by its or + methods. +

      +
      + + Returns true if this commit is an optimized index. + + + Two IndexCommits are equal if both their Directory and versions are equal. + + + Returns the version for this IndexCommit. This is the + same value that would + return if it were opened on this commit. + + + + Returns the generation (the _N in segments_N) for this + IndexCommit + + + + Convenience method that returns the last modified time + of the segments_N file corresponding to this index + commit, equivalent to + getDirectory().fileModified(getSegmentsFileName()). + + + + Returns userData, previously passed to + + for this commit. IDictionary is String -> String. + + + + $Id + +

      NOTE: This API is new and still experimental + (subject to change suddenly in the next release)

      +

      +
      + + The class which implements SegmentReader. + + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Clones the norm bytes. May be overridden by subclasses. New and experimental. + Byte array to clone + + New BitVector + + + + Clones the deleteDocs BitVector. May be overridden by subclasses. New and experimental. + BitVector to clone + + New BitVector + + + + + + + + + + + + Read norms into a pre-allocated array. + + + Create a clone from the initial TermVectorsReader and store it in the ThreadLocal. + TermVectorsReader + + + + Return a term frequency vector for the specified document and field. The + vector returned contains term numbers and frequencies for all terms in + the specified field of this document, if the field had storeTermVector + flag set. If the flag was not set, the method returns null. + + IOException + + + Return an array of term frequency vectors for the specified document. + The array contains a vector for each vectorized field in the document. + Each vector vector contains term numbers and frequencies for all terms + in a given vectorized field. + If no such fields existed, the method returns null. + + IOException + + + Return the name of the segment this reader is reading. + + + Return the SegmentInfo of the segment this reader is reading. + + + Returns the directory this index resides in. + + + Lotsa tests did hacks like:
      + SegmentReader reader = (SegmentReader) IndexReader.open(dir);
      + They broke. This method serves as a hack to keep hacks working +
      +
      + + Sets the initial value + + + Byte[] referencing is used because a new norm object needs + to be created for each clone, and the byte array is all + that is needed for sharing between cloned readers. The + current norm referencing is for sharing between readers + whereas the byte[] referencing is for copy on write which + is independent of reader references (i.e. incRef, decRef). + + + + Holds buffered deletes, by docID, term or query. We + hold two instances of this class: one for the deletes + prior to the last flush, the other for deletes after + the last flush. This is so if we need to abort + (discard all buffered docs) we can also discard the + buffered deletes yet keep the deletes done during + previously flushed segments. + + + + Provides support for converting longs to Strings, and back again. The strings + are structured so that lexicographic sorting order is preserved. + +

      + That is, if l1 is less than l2 for any two longs l1 and l2, then + NumberTools.longToString(l1) is lexicographically less than + NumberTools.longToString(l2). (Similarly for "greater than" and "equals".) + +

      + This class handles all long values (unlike + ). + +

      + For new indexes use instead, which + provides a sortable binary representation (prefix encoded) of numeric + values. + To index and efficiently query numeric values use + and . + This class is included for use with existing + indices and will be removed in a future release. + +
      + + Equivalent to longToString(Long.MIN_VALUE) + + + Equivalent to longToString(Long.MAX_VALUE) + + + The length of (all) strings returned by + + + Converts a long to a String suitable for indexing. + + + Converts a String that was returned by back to a + long. + + + IllegalArgumentException + if the input is null + + NumberFormatException + if the input does not parse (it was not a String returned by + longToString()). + + + + Documents are the unit of indexing and search. + + A Document is a set of fields. Each field has a name and a textual value. + A field may be stored with the document, in which + case it is returned with search hits on the document. Thus each document + should typically contain one or more stored fields which uniquely identify + it. + +

      Note that fields which are not stored are + not available in documents retrieved from the index, e.g. with , + or . +

      +
      + + Constructs a new document with no fields. + + + Sets a boost factor for hits on any field of this document. This value + will be multiplied into the score of all hits on this document. + +

      The default value is 1.0. + +

      Values are multiplied into the value of of + each field in this document. Thus, this method in effect sets a default + boost for the fields of this document. + +

      + + +
      + + Returns, at indexing time, the boost factor as set by . + +

      Note that once a document is indexed this value is no longer available + from the index. At search time, for retrieved documents, this method always + returns 1. This however does not mean that the boost value set at indexing + time was ignored - it was just combined with other indexing time factors and + stored elsewhere, for better indexing and search performance. (For more + information see the "norm(t,d)" part of the scoring formula in + Similarity.) + +

      + + +
      + +

      Adds a field to a document. Several fields may be added with + the same name. In this case, if the fields are indexed, their text is + treated as though appended for the purposes of search.

      +

      Note that add like the removeField(s) methods only makes sense + prior to adding a document to an index. These methods cannot + be used to change the content of an existing index! In order to achieve this, + a document has to be deleted from an index and a new changed version of that + document has to be added.

      +

      +
      + +

      Removes field with the specified name from the document. + If multiple fields exist with this name, this method removes the first field that has been added. + If there is no field with the specified name, the document remains unchanged.

      +

      Note that the removeField(s) methods like the add method only make sense + prior to adding a document to an index. These methods cannot + be used to change the content of an existing index! In order to achieve this, + a document has to be deleted from an index and a new changed version of that + document has to be added.

      +

      +
      + +

      Removes all fields with the given name from the document. + If there is no field with the specified name, the document remains unchanged.

      +

      Note that the removeField(s) methods like the add method only make sense + prior to adding a document to an index. These methods cannot + be used to change the content of an existing index! In order to achieve this, + a document has to be deleted from an index and a new changed version of that + document has to be added.

      +

      +
      + + Returns a field with the given name if any exist in this document, or + null. If multiple fields exists with this name, this method returns the + first value added. + Do not use this method with lazy loaded fields. + + + + Returns a field with the given name if any exist in this document, or + null. If multiple fields exists with this name, this method returns the + first value added. + + + + Returns the string value of the field with the given name if any exist in + this document, or null. If multiple fields exist with this name, this + method returns the first value added. If only binary fields with this name + exist, returns null. + + + + Returns an Enumeration of all the fields in a document. + use instead + + + + Returns a List of all the fields in a document. +

      Note that fields which are not stored are + not available in documents retrieved from the + index, e.g. or . +

      +
      + + Returns an array of s with the given name. + Do not use with lazy loaded fields. + This method returns an empty array when there are no + matching fields. It never returns null. + + + the name of the field + + a Field[] array + + + + Returns an array of s with the given name. + This method returns an empty array when there are no + matching fields. It never returns null. + + + the name of the field + + a Fieldable[] array + + + + Returns an array of values of the field specified as the method parameter. + This method returns an empty array when there are no + matching fields. It never returns null. + + the name of the field + + a String[] of field values + + + + Returns an array of byte arrays for of the fields that have the name specified + as the method parameter. This method returns an empty + array when there are no matching fields. It never + returns null. + + + the name of the field + + a byte[][] of binary field values + + + + Returns an array of bytes for the first (or only) field that has the name + specified as the method parameter. This method will return null + if no binary fields with the specified name are available. + There may be non-binary fields with the same name. + + + the name of the field. + + a byte[] containing the binary field value or null + + + + Prints the fields of a document for human consumption. + + + Loader for text files that represent a list of stopwords. + + + + $Id: WordlistLoader.java 706342 2008-10-20 17:19:29Z gsingers $ + + + + Loads a text file and adds every line as an entry to a HashSet (omitting + leading and trailing whitespace). Every line of the file should contain only + one word. The words need to be in lowercase if you make use of an + Analyzer which uses LowerCaseFilter (like StandardAnalyzer). + + + File containing the wordlist + + A HashSet with the file's words + + + + Loads a text file and adds every non-comment line as an entry to a HashSet (omitting + leading and trailing whitespace). Every line of the file should contain only + one word. The words need to be in lowercase if you make use of an + Analyzer which uses LowerCaseFilter (like StandardAnalyzer). + + + File containing the wordlist + + The comment string to ignore + + A HashSet with the file's words + + + + Reads lines from a Reader and adds every line as an entry to a HashSet (omitting + leading and trailing whitespace). Every line of the Reader should contain only + one word. The words need to be in lowercase if you make use of an + Analyzer which uses LowerCaseFilter (like StandardAnalyzer). + + + Reader containing the wordlist + + A HashSet with the reader's words + + + + Reads lines from a Reader and adds every non-comment line as an entry to a HashSet (omitting + leading and trailing whitespace). Every line of the Reader should contain only + one word. The words need to be in lowercase if you make use of an + Analyzer which uses LowerCaseFilter (like StandardAnalyzer). + + + Reader containing the wordlist + + The string representing a comment. + + A HashSet with the reader's words + + + + Reads a stem dictionary. Each line contains: + word\tstem + (i.e. two tab seperated words) + + + stem dictionary that overrules the stemming algorithm + + IOException + + + Emits the entire input as a single token. + + + Will be removed in Lucene 3.0. This method is final, as it should + not be overridden. Delegates to the backwards compatibility layer. + + + + Will be removed in Lucene 3.0. This method is final, as it should + not be overridden. Delegates to the backwards compatibility layer. + + + + "Tokenizes" the entire stream as a single token. This is useful + for data like zip codes, ids, and some product names. + + + + A simple class that stores Strings as char[]'s in a + hash table. Note that this is not a general purpose + class. For example, it cannot remove items from the + set, nor does it resize its hash table to be smaller, + etc. It is designed to be quick to test if a char[] + is in the set without the necessity of converting it + to a String first. + + + + Create set with enough capacity to hold startSize + terms + + + + Create set from a Collection of char[] or String + + + Create set from entries + + + true if the len chars of text starting at off + are in the set + + + + true if the System.String is in the set + + + Returns true if the String is in the set + + + Add this String into the set + + + Add this char[] directly to the set. + If ignoreCase is true for this Set, the text array will be directly modified. + The user should never modify this text array after calling this method. + + + + Returns an unmodifiable . This allows to provide + unmodifiable views of internal sets for "read-only" use. + + a set for which the unmodifiable set is returned. + + an new unmodifiable . + + NullReferenceException thrown + if the given set is null. + + + Adds all of the elements in the specified collection to this collection + + + Removes all elements from the set + + + Removes from this set all of its elements that are contained in the specified collection + + + Retains only the elements in this set that are contained in the specified collection + + + The Iterator<String> for this set. Strings are constructed on the fly, so + use nextCharArray for more efficient access. + + + + do not modify the returned char[] + + + Returns the next String, as a Set<String> would... + use nextCharArray() for better efficiency. + + + + Efficient unmodifiable . This implementation does not + delegate calls to a given like + Collections.UnmodifiableSet(java.util.Set) does. Instead is passes + the internal representation of a to a super + constructor and overrides all mutators. + + + + Encapsulates sort criteria for returned hits. + +

      The fields used to determine sort order must be carefully chosen. + Documents must contain a single term in such a field, + and the value of the term should indicate the document's relative position in + a given sort order. The field must be indexed, but should not be tokenized, + and does not need to be stored (unless you happen to want it back with the + rest of your document data). In other words: + +

      document.add (new Field ("byNumber", Integer.toString(x), Field.Store.NO, Field.Index.NOT_ANALYZED));

      + + +

      Valid Types of Values

      + +

      There are four possible kinds of term values which may be put into + sorting fields: Integers, Longs, Floats, or Strings. Unless + SortField objects are specified, the type of value + in the field is determined by parsing the first term in the field. + +

      Integer term values should contain only digits and an optional + preceding negative sign. Values must be base 10 and in the range + Integer.MIN_VALUE and Integer.MAX_VALUE inclusive. + Documents which should appear first in the sort + should have low value integers, later documents high values + (i.e. the documents should be numbered 1..n where + 1 is the first and n the last). + +

      Long term values should contain only digits and an optional + preceding negative sign. Values must be base 10 and in the range + Long.MIN_VALUE and Long.MAX_VALUE inclusive. + Documents which should appear first in the sort + should have low value integers, later documents high values. + +

      Float term values should conform to values accepted by + (except that NaN + and Infinity are not supported). + Documents which should appear first in the sort + should have low values, later documents high values. + +

      String term values can contain any valid String, but should + not be tokenized. The values are sorted according to their + natural order. Note that using this type + of term value has higher memory requirements than the other + two types. + +

      Object Reuse

      + +

      One of these objects can be + used multiple times and the sort order changed between usages. + +

      This class is thread safe. + +

      Memory Usage

      + +

      Sorting uses of caches of term values maintained by the + internal HitQueue(s). The cache is static and contains an integer + or float array of length IndexReader.maxDoc() for each field + name for which a sort is performed. In other words, the size of the + cache in bytes is: + +

      4 * IndexReader.maxDoc() * (# of different fields actually used to sort) + +

      For String fields, the cache is larger: in addition to the + above array, the value of every term in the field is kept in memory. + If there are many unique terms in the field, this could + be quite large. + +

      Note that the size of the cache is not affected by how many + fields are in the index and might be used to sort - only by + the ones actually used to sort a result set. + +

      Created: Feb 12, 2004 10:53:57 AM + +

      + lucene 1.4 + + $Id: Sort.java 795179 2009-07-17 18:23:30Z mikemccand $ + +
      + + Represents sorting by computed relevance. Using this sort criteria returns + the same results as calling + Searcher#search()without a sort criteria, + only with slightly more overhead. + + + + Represents sorting by index order. + + + Sorts by computed relevance. This is the same sort criteria as calling + without a sort criteria, + only with slightly more overhead. + + + + Sorts by the terms in field then by index order (document + number). The type of value in field is determined + automatically. + + + + + Please specify the type explicitly by + first creating a and then use + + + + + Sorts possibly in reverse by the terms in field then by + index order (document number). The type of value in field is + determined automatically. + + + + + Please specify the type explicitly by + first creating a and then use + + + + + Sorts in succession by the terms in each field. The type of value in + field is determined automatically. + + + + + Please specify the type explicitly by + first creating s and then use + + + + + Sorts by the criteria in the given SortField. + + + Sorts in succession by the criteria in each SortField. + + + Sets the sort to the terms in field then by index order + (document number). + + Please specify the type explicitly by + first creating a and then use + + + + + Sets the sort to the terms in field possibly in reverse, + then by index order (document number). + + Please specify the type explicitly by + first creating a and then use + + + + + Sets the sort to the terms in each field in succession. + Please specify the type explicitly by + first creating s and then use + + + + + Sets the sort to the given criteria. + + + Sets the sort to the given criteria in succession. + + + Representation of the sort criteria. + Array of SortField objects used in this sort criteria + + + + Returns true if o is equal to this. + + + Returns a hash code value for this object. + + + A implementation which wraps another + and makes sure only documents with + scores > 0 are collected. + + + + Expert: Scoring functionality for phrase queries. +
      A document is considered matching if it contains the phrase-query terms + at "valid" positons. What "valid positions" are + depends on the type of the phrase query: for an exact phrase query terms are required + to appear in adjacent locations, while for a sloppy phrase query some distance between + the terms is allowed. The abstract method of extending classes + is invoked for each document containing all the phrase query terms, in order to + compute the frequency of the phrase query in that document. A non zero frequency + means a match. +
      +
      + + use instead. + + + + use instead. + + + + use instead. + + + + For a document containing all the phrase query terms, compute the + frequency of the phrase in that document. + A non zero frequency means a match. +
      Note, that containing all phrase terms does not guarantee a match - they have to be found in matching locations. +
      + frequency of the phrase in current doc, 0 if not found. + +
      + + Expert: A ScoreDoc which also contains information about + how to sort the referenced document. In addition to the + document number and score, this object contains an array + of values for the document from the field(s) used to sort. + For example, if the sort criteria was to sort by fields + "a", "b" then "c", the fields object array + will have three elements, corresponding respectively to + the term values for the document in fields "a", "b" and "c". + The class of each element in the array will be either + Integer, Float or String depending on the type of values + in the terms of each field. + +

      Created: Feb 11, 2004 1:23:38 PM + +

      + lucene 1.4 + + $Id: FieldDoc.java 773194 2009-05-09 10:36:41Z mikemccand $ + + + + + +
      + + Expert: Returned by low-level search implementations. + + + + + Expert: The score of this document for the query. + + + Expert: A hit document's number. + + + + + Expert: Constructs a ScoreDoc. + + + Expert: The values which are used to sort the referenced document. + The order of these will match the original sort criteria given by a + Sort object. Each Object will be either an Integer, Float or String, + depending on the type of values in the terms of the original field. + + + + + + + + Expert: Creates one of these objects with empty sort information. + + + Expert: Creates one of these objects with the given sort information. + + + A query that wraps a filter and simply returns a constant score equal to the + query boost for every document in the filter. + + + + $Id: ConstantScoreQuery.java 807180 2009-08-24 12:26:43Z markrmiller $ + + + + Returns the encapsulated filter + + + Prints a user-readable version of this query. + + + Returns true if o is equal to this. + + + Returns a hash code value for this object. + + + use instead. + + + + use instead. + + + + use instead. + + + + This class is generated by JavaCC. The most important method is + . + + The syntax for query strings is as follows: + A Query is a series of clauses. + A clause may be prefixed by: + + a plus (+) or a minus (-) sign, indicating + that the clause is required or prohibited respectively; or + a term followed by a colon, indicating the field to be searched. + This enables one to construct queries which search multiple fields. + + + A clause may be either: + + a term, indicating all the documents that contain this term; or + a nested query, enclosed in parentheses. Note that this may be used + with a +/- prefix to require any of a set of + terms. + + + Thus, in BNF, the query grammar is: + + Query ::= ( Clause )* + Clause ::= ["+", "-"] [<TERM> ":"] ( <TERM> | "(" Query ")" ) + + +

      + Examples of appropriately formatted queries can be found in the query syntax + documentation. +

      + +

      + In s, QueryParser tries to detect date values, e.g. + date:[6/1/2005 TO 6/4/2005] produces a range query that searches + for "date" fields between 2005-06-01 and 2005-06-04. Note that the format + of the accepted input depends on the locale. + By default a date is converted into a search term using the deprecated + for compatibility reasons. + To use the new to convert dates, a + has to be set. +

      +

      + The date resolution that shall be used for RangeQueries can be set + using + or . The former + sets the default date resolution for all fields, whereas the latter can + be used to set field specific date resolutions. Field specific date + resolutions take, if set, precedence over the default date resolution. +

      +

      + If you use neither nor in your + index, you can create your own + query parser that inherits QueryParser and overwrites + to + use a different method for date conversion. +

      + +

      Note that QueryParser is not thread-safe.

      + +

      NOTE: there is a new QueryParser in contrib, which matches + the same syntax as this class, but is more modular, + enabling substantial customization to how a query is created. + +

      NOTE: there is a new QueryParser in contrib, which matches + the same syntax as this class, but is more modular, + enabling substantial customization to how a query is created. + NOTE: You must specify the required compatibility when + creating QueryParser: + + As of 2.9, is true by default. + +

      +
      + + Alternative form of QueryParser.Operator.AND + + + Alternative form of QueryParser.Operator.OR + + + The actual operator that parser uses to combine query terms + + + Constructs a query parser. + the default field for query terms. + + used to find terms in the query text. + + Use instead + + + + Constructs a query parser. + + + Lucene version to match. See above) + + the default field for query terms. + + used to find terms in the query text. + + + + Parses a query string, returning a . + the query string to be parsed. + + ParseException if the parsing fails + + + Returns the analyzer. + + + + Returns the field. + + + + Get the minimal similarity for fuzzy queries. + + + Set the minimum similarity for fuzzy queries. + Default is 0.5f. + + + + Get the prefix length for fuzzy queries. + Returns the fuzzyPrefixLength. + + + + Set the prefix length for fuzzy queries. Default is 0. + The fuzzyPrefixLength to set. + + + + Sets the default slop for phrases. If zero, then exact phrase matches + are required. Default value is zero. + + + + Gets the default slop for phrases. + + + Set to true to allow leading wildcard characters. +

      + When set, * or ? are allowed as + the first character of a PrefixQuery and WildcardQuery. + Note that this can produce very slow + queries on big indexes. +

      + Default: false. +

      +
      + + + + + + Set to true to enable position increments in result query. +

      + When set, result phrase and multi-phrase queries will + be aware of position increments. + Useful when e.g. a StopFilter increases the position increment of + the token that follows an omitted token. +

      + Default: false. +

      +
      + + + + + + Sets the boolean operator of the QueryParser. + In default mode (OR_OPERATOR) terms without any modifiers + are considered optional: for example capital of Hungary is equal to + capital OR of OR Hungary.
      + In AND_OPERATOR mode terms are considered to be in conjunction: the + above mentioned query is parsed as capital AND of AND Hungary +
      +
      + + Gets implicit operator setting, which will be either AND_OPERATOR + or OR_OPERATOR. + + + + Whether terms of wildcard, prefix, fuzzy and range queries are to be automatically + lower-cased or not. Default is true. + + + + + + + + Please use instead. + + + + Please use instead. + + + + By default QueryParser uses + when creating a PrefixQuery, WildcardQuery or RangeQuery. This implementation is generally preferable because it + a) Runs faster b) Does not have the scarcity of terms unduly influence score + c) avoids any "TooManyBooleanClauses" exception. + However, if your application really needs to use the + old-fashioned BooleanQuery expansion rewriting and the above + points are not relevant then use this to change + the rewrite method. + + + + + + + + Set locale used by date range parsing. + + + Returns current locale, allowing access by subclasses. + + + Sets the default date resolution used by RangeQueries for fields for which no + specific date resolutions has been set. Field specific resolutions can be set + with . + + + the default date resolution to set + + + + Sets the date resolution used by RangeQueries for a specific field. + + + field for which the date resolution is to be set + + date resolution to set + + + + Returns the date resolution that is used by RangeQueries for the given field. + Returns null, if no default or field specific date resolution has been set + for the given field. + + + + + Sets the collator used to determine index term inclusion in ranges + for RangeQuerys. +

      + WARNING: Setting the rangeCollator to a non-null + collator using this method will cause every single index Term in the + Field referenced by lowerTerm and/or upperTerm to be examined. + Depending on the number of index Terms in this Field, the operation could + be very slow. + +

      + the collator to use when constructing RangeQuerys + +
      + + the collator used to determine index term inclusion in ranges + for RangeQuerys. + + + + use instead. + + + + throw in overridden method to disallow + + + + Base implementation delegates to . + This method may be overridden, for example, to return + a SpanNearQuery instead of a PhraseQuery. + + + throw in overridden method to disallow + + + + throw in overridden method to disallow + + + + Builds a new BooleanQuery instance + disable coord + + new BooleanQuery instance + + + + Builds a new BooleanClause instance + sub query + + how this clause should occur when matching documents + + new BooleanClause instance + + + + Builds a new TermQuery instance + term + + new TermQuery instance + + + + Builds a new PhraseQuery instance + new PhraseQuery instance + + + + Builds a new MultiPhraseQuery instance + new MultiPhraseQuery instance + + + + Builds a new PrefixQuery instance + Prefix term + + new PrefixQuery instance + + + + Builds a new FuzzyQuery instance + Term + + minimum similarity + + prefix length + + new FuzzyQuery Instance + + + + Builds a new TermRangeQuery instance + Field + + min + + max + + true if range is inclusive + + new TermRangeQuery instance + + + + Builds a new MatchAllDocsQuery instance + new MatchAllDocsQuery instance + + + + Builds a new WildcardQuery instance + wildcard term + + new WildcardQuery instance + + + + Factory method for generating query, given a set of clauses. + By default creates a boolean query composed of clauses passed in. + + Can be overridden by extending classes, to modify query being + returned. + + + List that contains instances + to join. + + + Resulting object. + + throw in overridden method to disallow + + use instead + + + + Factory method for generating query, given a set of clauses. + By default creates a boolean query composed of clauses passed in. + + Can be overridden by extending classes, to modify query being + returned. + + + List that contains instances + to join. + + + Resulting object. + + throw in overridden method to disallow + + + + Factory method for generating query, given a set of clauses. + By default creates a boolean query composed of clauses passed in. + + Can be overridden by extending classes, to modify query being + returned. + + + List that contains instances + to join. + + true if coord scoring should be disabled. + + + Resulting object. + + throw in overridden method to disallow + + use instead + + + + Factory method for generating query, given a set of clauses. + By default creates a boolean query composed of clauses passed in. + + Can be overridden by extending classes, to modify query being + returned. + + + List that contains instances + to join. + + true if coord scoring should be disabled. + + + Resulting object. + + throw in overridden method to disallow + + + + Factory method for generating a query. Called when parser + parses an input term token that contains one or more wildcard + characters (? and *), but is not a prefix term token (one + that has just a single * character at the end) +

      + Depending on settings, prefix term may be lower-cased + automatically. It will not go through the default Analyzer, + however, since normal Analyzers are unlikely to work properly + with wildcard templates. +

      + Can be overridden by extending classes, to provide custom handling for + wildcard queries, which may be necessary due to missing analyzer calls. + +

      + Name of the field query will use. + + Term token that contains one or more wild card + characters (? or *), but is not simple prefix term + + + Resulting built for the term + + throw in overridden method to disallow + +
      + + Factory method for generating a query (similar to + ). Called when parser parses an input term + token that uses prefix notation; that is, contains a single '*' wildcard + character as its last character. Since this is a special case + of generic wildcard term, and such a query can be optimized easily, + this usually results in a different query object. +

      + Depending on settings, a prefix term may be lower-cased + automatically. It will not go through the default Analyzer, + however, since normal Analyzers are unlikely to work properly + with wildcard templates. +

      + Can be overridden by extending classes, to provide custom handling for + wild card queries, which may be necessary due to missing analyzer calls. + +

      + Name of the field query will use. + + Term token to use for building term for the query + (without trailing '*' character!) + + + Resulting built for the term + + throw in overridden method to disallow + +
      + + Factory method for generating a query (similar to + ). Called when parser parses + an input term token that has the fuzzy suffix (~) appended. + + + Name of the field query will use. + + Term token to use for building term for the query + + + Resulting built for the term + + throw in overridden method to disallow + + + + Returns a String where the escape char has been + removed, or kept only once if there was a double escape. + + Supports escaped unicode characters, e. g. translates + \\u0041 to A. + + + + + Returns the numeric value of the hexadecimal character + + + Returns a String where those characters that QueryParser + expects to be escaped are escaped by a preceding \. + + + + Command line tool to test QueryParser, using . + Usage:
      + java Lucene.Net.QueryParsers.QueryParser <input> +
      +
      + + Generated Token Manager. + + + Current token. + + + Next token. + + + Constructor with user supplied CharStream. + + + Reinitialise. + + + Constructor with generated Token Manager. + + + Reinitialise. + + + Get the next Token. + + + Get the specific Token. + + + Generate ParseException. + + + Enable tracing. + + + Disable tracing. + + + The default operator for parsing queries. + Use to change it. + + + +

      [Note that as of 2.1, all but one of the + methods in this class are available via + . The one method that is not available is + .]

      + + A class to modify an index, i.e. to delete and add documents. This + class hides and so that you + do not need to care about implementation details such as that adding + documents is done via IndexWriter and deletion is done via IndexReader. + +

      Note that you cannot create more than one IndexModifier object + on the same directory at the same time. + +

      Example usage: + + + + + +

      + + + + + + +
      + +     Analyzer analyzer = new StandardAnalyzer();
      +     // create an index in /tmp/index, overwriting an existing one:
      +     IndexModifier indexModifier = new IndexModifier("/tmp/index", analyzer, true);
      +     Document doc = new Document();
      +     doc.add(new Field("id""1", Field.Store.YES, Field.Index.NOT_ANALYZED));
      +     doc.add(new Field("body""a simple test", Field.Store.YES, Field.Index.ANALYZED));
      +     indexModifier.addDocument(doc);
      +     int deleted = indexModifier.delete(new Term("id""1"));
      +     System.out.println("Deleted " + deleted + " document");
      +     indexModifier.flush();
      +     System.out.println(indexModifier.docCount() " docs in index");
      +     indexModifier.close();
      +
      +
      + + + +

      Not all methods of IndexReader and IndexWriter are offered by this + class. If you need access to additional methods, either use those classes + directly or implement your own class that extends IndexModifier. + +

      Although an instance of this class can be used from more than one + thread, you will not get the best performance. You might want to use + IndexReader and IndexWriter directly for that (but you will need to + care about synchronization yourself then). + +

      While you can freely mix calls to add() and delete() using this class, + you should batch you calls for best performance. For example, if you + want to update 20 documents, you should first delete all those documents, + then add all the new documents. + +

      + Please use instead. + +
      + + Open an index with write access. + + + the index directory + + the analyzer to use for adding new documents + + true to create the index or overwrite the existing one; + false to append to the existing index + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if there is a low-level IO error + + + Open an index with write access. + + + the index directory + + the analyzer to use for adding new documents + + true to create the index or overwrite the existing one; + false to append to the existing index + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if there is a low-level IO error + + + Open an index with write access. + + + the index directory + + the analyzer to use for adding new documents + + true to create the index or overwrite the existing one; + false to append to the existing index + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if there is a low-level IO error + + + Initialize an IndexWriter. + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if there is a low-level IO error + + + Throw an IllegalStateException if the index is closed. + IllegalStateException + + + Close the IndexReader and open an IndexWriter. + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if there is a low-level IO error + + + Close the IndexWriter and open an IndexReader. + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Make sure all changes are written to disk. + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if there is a low-level IO error + + + Adds a document to this index, using the provided analyzer instead of the + one specific in the constructor. If the document contains more than + terms for a given field, the remainder are + discarded. + + + + IllegalStateException if the index is closed + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if there is a low-level IO error + + + Adds a document to this index. If the document contains more than + terms for a given field, the remainder are + discarded. + + + + IllegalStateException if the index is closed + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if there is a low-level IO error + + + Deletes all documents containing term. + This is useful if one uses a document field to hold a unique ID string for + the document. Then to delete such a document, one merely constructs a + term with the appropriate field and the unique ID string as its text and + passes it to this method. Returns the number of documents deleted. + + the number of documents deleted + + + + IllegalStateException if the index is closed + StaleReaderException if the index has changed + since this reader was opened + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if there is a low-level IO error + + + Deletes the document numbered docNum. + + + StaleReaderException if the index has changed + since this reader was opened + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IllegalStateException if the index is closed + + + Returns the number of documents currently in this + index. If the writer is currently open, this returns + , else + . But, note that + does not take deletions into + account, unlike . + + IllegalStateException if the index is closed + + + Merges all segments together into a single segment, optimizing an index + for search. + + + + IllegalStateException if the index is closed + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if there is a low-level IO error + + + If non-null, information about merges and a message when + is reached will be printed to this. +

      Example: index.setInfoStream(System.err); +

      + + + IllegalStateException if the index is closed +
      + + + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if there is a low-level IO error + + + Setting to turn on usage of a compound file. When on, multiple files + for each segment are merged into a single file once the segment creation + is finished. This is done regardless of what directory is in use. + + + + IllegalStateException if the index is closed + + + + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if there is a low-level IO error + + + The maximum number of terms that will be indexed for a single field in a + document. This limits the amount of memory required for indexing, so that + collections with very large files will not crash the indexing process by + running out of memory.

      + Note that this effectively truncates large documents, excluding from the + index terms that occur further in the document. If you know your source + documents are large, be sure to set this value high enough to accommodate + the expected size. If you set it to Integer.MAX_VALUE, then the only limit + is your memory, but you should anticipate an OutOfMemoryError.

      + By default, no more than 10,000 terms will be indexed for a field. +

      + + + IllegalStateException if the index is closed +
      + + + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if there is a low-level IO error + + + Determines the minimal number of documents required before the buffered + in-memory documents are merging and a new Segment is created. + Since Documents are merged in a , + large value gives faster indexing. At the same time, mergeFactor limits + the number of files open in a FSDirectory. + +

      The default value is 10. + +

      + + + IllegalStateException if the index is closed + IllegalArgumentException if maxBufferedDocs is smaller than 2 +
      + + + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if there is a low-level IO error + + + Determines how often segment indices are merged by addDocument(). With + smaller values, less RAM is used while indexing, and searches on + unoptimized indices are faster, but indexing speed is slower. With larger + values, more RAM is used during indexing, and while searches on unoptimized + indices are slower, indexing is faster. Thus larger values (> 10) are best + for batch index creation, and smaller values (< 10) for indices that are + interactively maintained. +

      This must never be less than 2. The default value is 10. + +

      + + + IllegalStateException if the index is closed +
      + + + + CorruptIndexException if the index is corrupt + LockObtainFailedException if another writer + has this index open (write.lock could not + be obtained) + + IOException if there is a low-level IO error + + + Close this index, writing all pending changes to disk. + + + IllegalStateException if the index has been closed before already + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Used by DocumentsWriter to maintain per-thread state. + We keep a separate Posting hash and other state for each + thread and then merge postings hashes from all threads + when writing the segment. + + + + Load the First field and break. +

      + See +

      +
      + + Common util methods for dealing with s. + + + + + Gathers sub-readers from reader into a List. + + + + + + + + + Returns sub IndexReader that contains the given document id. + + + id of document + + parent reader + + sub reader of parent which contains the specified doc id + + + + Returns sub-reader subIndex from reader. + + + parent reader + + index of desired sub reader + + the subreader at subINdex + + + + Returns index of the searcher/reader for document n in the + array used to construct this searcher/reader. + + + + Estimates the size of a given Object using a given MemoryModel for primitive + size information. + + Resource Usage: + + Internally uses a Map to temporally hold a reference to every + object seen. + + If checkIntered, all Strings checked will be interned, but those + that were not already interned will be released for GC when the + estimate is complete. + + + + Constructs this object with an AverageGuessMemoryModel and + checkInterned = true. + + + + check if Strings are interned and don't add to size + if they are. Defaults to true but if you know the objects you are checking + won't likely contain many interned Strings, it will be faster to turn off + intern checking. + + + + MemoryModel to use for primitive object sizes. + + + + MemoryModel to use for primitive object sizes. + + check if Strings are interned and don't add to size + if they are. Defaults to true but if you know the objects you are checking + won't likely contain many interned Strings, it will be faster to turn off + intern checking. + + + + Return good default units based on byte size. + + + Subclass of FilteredTermEnum for enumerating all terms that match the + specified wildcard filter term. +

      + Term enumerations are always ordered by Term.compareTo(). Each term in + the enumeration is greater than all that precede it. + +

      + $Id: WildcardTermEnum.java 783371 2009-06-10 14:39:56Z mikemccand $ + +
      + + ***************************************** + String equality with support for wildcards + ****************************************** + + + + Creates a new WildcardTermEnum. +

      + After calling the constructor the enumeration is already pointing to the first + valid term if such a term exists. +

      +
      + + Determines if a word matches a wildcard pattern. + Work released by Granta Design Ltd after originally being done on + company time. + + + + Subclass of FilteredTermEnum for enumerating all terms that match the + specified range parameters. +

      + Term enumerations are always ordered by Term.compareTo(). Each term in + the enumeration is greater than all that precede it. +

      + 2.9 + +
      + + Enumerates all terms greater/equal than lowerTerm + but less/equal than upperTerm. + + If an endpoint is null, it is said to be "open". Either or both + endpoints may be open. Open endpoints may not be exclusive + (you can't select all but the first or last term without + explicitly specifying the term to exclude.) + + + + + An interned field that holds both lower and upper terms. + + The term text at the lower end of the range + + The term text at the upper end of the range + + If true, the lowerTerm is included in the range. + + If true, the upperTerm is included in the range. + + The collator to use to collate index Terms, to determine their + membership in the range bounded by lowerTerm and + upperTerm. + + + IOException + + + A Filter that restricts search results to a range of values in a given + field. + +

      This filter matches the documents looking for terms that fall into the + supplied range according to . It is not intended + for numerical ranges, use instead. + +

      If you construct a large number of range filters with different ranges but on the + same field, may have significantly better performance. +

      + 2.9 + +
      + + The field this range applies to + + The lower bound on this range + + The upper bound on this range + + Does this range include the lower bound? + + Does this range include the upper bound? + + IllegalArgumentException if both terms are null or if + lowerTerm is null and includeLower is true (similar for upperTerm + and includeUpper) + + + + WARNING: Using this constructor and supplying a non-null + value in the collator parameter will cause every single + index Term in the Field referenced by lowerTerm and/or upperTerm to be + examined. Depending on the number of index Terms in this Field, the + operation could be very slow. + + + + The lower bound on this range + + The upper bound on this range + + Does this range include the lower bound? + + Does this range include the upper bound? + + The collator to use when determining range inclusion; set + to null to use Unicode code point ordering instead of collation. + + IllegalArgumentException if both terms are null or if + lowerTerm is null and includeLower is true (similar for upperTerm + and includeUpper) + + + + Constructs a filter for field fieldName matching + less than or equal to upperTerm. + + + + Constructs a filter for field fieldName matching + greater than or equal to lowerTerm. + + + + Returns the field name for this filter + + + Returns the lower value of this range filter + + + Returns the upper value of this range filter + + + Returns true if the lower endpoint is inclusive + + + Returns true if the upper endpoint is inclusive + + + Returns the collator used to determine range inclusion, if any. + + + Matches the union of its clauses. + + + Construct a SpanOrQuery merging the provided clauses. + + + Return the clauses whose spans are matched. + + + Returns a collection of all terms matched by this query. + use extractTerms instead + + + + + +

      Wrapper to allow objects participate in composite + single-field SpanQueries by 'lying' about their search field. That is, + the masked SpanQuery will function as normal, + but simply hands back the value supplied + in this class's constructor.

      + +

      This can be used to support Queries like or + across different fields, which is not ordinarily + permitted.

      + +

      This can be useful for denormalized relational data: for example, when + indexing a document with conceptually many 'children':

      + +

      +            teacherid: 1
      +            studentfirstname: james
      +            studentsurname: jones
      +            
      +            teacherid: 2
      +            studenfirstname: james
      +            studentsurname: smith
      +            studentfirstname: sally
      +            studentsurname: jones
      +            
      + +

      a SpanNearQuery with a slop of 0 can be applied across two + objects as follows: + + SpanQuery q1 = new SpanTermQuery(new Term("studentfirstname", "james")); + SpanQuery q2 = new SpanTermQuery(new Term("studentsurname", "jones")); + SpanQuery q2m new FieldMaskingSpanQuery(q2, "studentfirstname"); + Query q = new SpanNearQuery(new SpanQuery[]{q1, q2m}, -1, false); + + to search for 'studentfirstname:james studentsurname:jones' and find + teacherid 1 without matching teacherid 2 (which has a 'james' in position 0 + and 'jones' in position 1).

      + +

      Note: as returns the masked field, scoring will be + done using the norms of the field name supplied. This may lead to unexpected + scoring behaviour.

      +

      +
      + + use instead. + + + + A Filter that restricts search results to a range of values in a given + field. + +

      This filter matches the documents looking for terms that fall into the + supplied range according to . It is not intended + for numerical ranges, use instead. + +

      If you construct a large number of range filters with different ranges but on the + same field, may have significantly better performance. + +

      + Use for term ranges or + for numeric ranges instead. + This class will be removed in Lucene 3.0. + +
      + + The field this range applies to + + The lower bound on this range + + The upper bound on this range + + Does this range include the lower bound? + + Does this range include the upper bound? + + IllegalArgumentException if both terms are null or if + lowerTerm is null and includeLower is true (similar for upperTerm + and includeUpper) + + + + WARNING: Using this constructor and supplying a non-null + value in the collator parameter will cause every single + index Term in the Field referenced by lowerTerm and/or upperTerm to be + examined. Depending on the number of index Terms in this Field, the + operation could be very slow. + + + + The lower bound on this range + + The upper bound on this range + + Does this range include the lower bound? + + Does this range include the upper bound? + + The collator to use when determining range inclusion; set + to null to use Unicode code point ordering instead of collation. + + IllegalArgumentException if both terms are null or if + lowerTerm is null and includeLower is true (similar for upperTerm + and includeUpper) + + + + Constructs a filter for field fieldName matching + less than or equal to upperTerm. + + + + Constructs a filter for field fieldName matching + greater than or equal to lowerTerm. + + + + A ranked list of documents, used to hold search results. +

      + Caution: Iterate only over the hits needed. Iterating over all hits is + generally not desirable and may be the source of performance issues. If you + need to iterate over many or all hits, consider using the search method that + takes a . +

      +

      + Note: Deleting matching documents concurrently with traversing the + hits, might, when deleting hits that were not yet retrieved, decrease + . In such case, an exceptionw is thrown when accessing hit n + > current_ (but n < + _at_start). + +

      + see , + and + :
      + + + TopDocs topDocs = searcher.Search(query, numHits); + ScoreDoc[] hits = topDocs.scoreDocs; + for (int i = 0; i < hits.Length; i++) { + int docId = hits[i].doc; + Document d = searcher.Doc(docId); + // do something with current hit + ... + +
      +
      + + Tries to add new documents to hitDocs. + Ensures that the hit numbered min has been retrieved. + + + + Returns the total number of hits available in this set. + + + Returns the stored fields of the nth document in this set. +

      Documents are cached, so that repeated requests for the same element may + return the same Document object. +

      + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error +
      + + Returns the score for the nth document in this set. + + + Returns the id for the nth document in this set. + Note that ids may change when the index changes, so you cannot + rely on the id to be stable. + + + + Returns a to navigate the Hits. Each item returned + from is a . +

      + Caution: Iterate only over the hits needed. Iterating over all + hits is generally not desirable and may be the source of + performance issues. If you need to iterate over many or all hits, consider + using a search method that takes a . +

      +

      +
      + + Implements the fuzzy search query. The similarity measurement + is based on the Levenshtein (edit distance) algorithm. + + Warning: this query is not very scalable with its default prefix + length of 0 - in this case, *every* term will be enumerated and + cause an edit score calculation. + + + + + Create a new FuzzyQuery that will match terms with a similarity + of at least minimumSimilarity to term. + If a prefixLength > 0 is specified, a common prefix + of that length is also required. + + + the term to search for + + a value between 0 and 1 to set the required similarity + between the query term and the matching terms. For example, for a + minimumSimilarity of 0.5 a term of the same length + as the query term is considered similar to the query term if the edit distance + between both terms is less than length(term)*0.5 + + length of common (non-fuzzy) prefix + + IllegalArgumentException if minimumSimilarity is >= 1 or < 0 + or if prefixLength < 0 + + + + Calls FuzzyQuery(term, minimumSimilarity, 0). + + + Calls FuzzyQuery(term, 0.5f, 0). + + + Returns the minimum similarity that is required for this query to match. + float value between 0.0 and 1.0 + + + + Returns the non-fuzzy prefix length. This is the number of characters at the start + of a term that must be identical (not fuzzy) to the query term if the query + is to match that term. + + + + Returns the pattern term. + + + A query that generates the union of documents produced by its subqueries, and that scores each document with the maximum + score for that document as produced by any subquery, plus a tie breaking increment for any additional matching subqueries. + This is useful when searching for a word in multiple fields with different boost factors (so that the fields cannot be + combined equivalently into a single search field). We want the primary score to be the one associated with the highest boost, + not the sum of the field scores (as BooleanQuery would give). + If the query is "albino elephant" this ensures that "albino" matching one field and "elephant" matching + another gets a higher score than "albino" matching both fields. + To get this result, use both BooleanQuery and DisjunctionMaxQuery: for each term a DisjunctionMaxQuery searches for it in + each field, while the set of these DisjunctionMaxQuery's is combined into a BooleanQuery. + The tie breaker capability allows results that include the same term in multiple fields to be judged better than results that + include this term in only the best of those multiple fields, without confusing this with the better case of two different terms + in the multiple fields. + + + + Creates a new empty DisjunctionMaxQuery. Use add() to add the subqueries. + the score of each non-maximum disjunct for a document is multiplied by this weight + and added into the final score. If non-zero, the value should be small, on the order of 0.1, which says that + 10 occurrences of word in a lower-scored field that is also in a higher scored field is just as good as a unique + word in the lower scored field (i.e., one that is not in any higher scored field. + + + + Creates a new DisjunctionMaxQuery + a Collection<Query> of all the disjuncts to add + + the weight to give to each matching non-maximum disjunct + + + + Add a subquery to this disjunction + the disjunct added + + + + Add a collection of disjuncts to this disjunction + via Iterable + + + + An Iterator<Query> over the disjuncts + + + Optimize our representation and our subqueries representations + the IndexReader we query + + an optimized copy of us (which may not be a copy if there is nothing to optimize) + + + + Create a shallow copy of us -- used in rewriting if necessary + a copy of us (but reuse, don't copy, our subqueries) + + + + Prettyprint us. + the field to which we are applied + + a string that shows what we do, of the form "(disjunct1 | disjunct2 | ... | disjunctn)^boost" + + + + Return true iff we represent the same query as o + another object + + true iff o is a DisjunctionMaxQuery with the same boost and the same subqueries, in the same order, as us + + + + Compute a hash code for hashing us + the hash code + + + + Expert: the Weight for DisjunctionMaxQuery, used to + normalize, score and explain these queries. + +

      NOTE: this API and implementation is subject to + change suddenly in the next release.

      +

      +
      + + The Similarity implementation. + + + The Weights for our subqueries, in 1-1 correspondence with disjuncts + + + A QueryParser which constructs queries to search multiple fields. + + + $Revision: 829134 $ + + + + Creates a MultiFieldQueryParser. Allows passing of a map with term to + Boost, and the boost to apply to each term. + +

      + It will, when parse(String query) is called, construct a query like this + (assuming the query consists of two terms and you specify the two fields + title and body): +

      + + + (title:term1 body:term1) (title:term2 body:term2) + + +

      + When setDefaultOperator(AND_OPERATOR) is set, the result will be: +

      + + + +(title:term1 body:term1) +(title:term2 body:term2) + + +

      + When you pass a boost (title=>5 body=>10) you can get +

      + + + +(title:term1^5.0 body:term1^10.0) +(title:term2^5.0 body:term2^10.0) + + +

      + In other words, all the query's terms must appear, but it doesn't matter + in what fields they appear. +

      + +

      + Please use + + instead + +
      + + Creates a MultiFieldQueryParser. Allows passing of a map with term to + Boost, and the boost to apply to each term. + +

      + It will, when parse(String query) is called, construct a query like this + (assuming the query consists of two terms and you specify the two fields + title and body): +

      + + + (title:term1 body:term1) (title:term2 body:term2) + + +

      + When setDefaultOperator(AND_OPERATOR) is set, the result will be: +

      + + + +(title:term1 body:term1) +(title:term2 body:term2) + + +

      + When you pass a boost (title=>5 body=>10) you can get +

      + + + +(title:term1^5.0 body:term1^10.0) +(title:term2^5.0 body:term2^10.0) + + +

      + In other words, all the query's terms must appear, but it doesn't matter + in what fields they appear. +

      +

      +
      + + Creates a MultiFieldQueryParser. + +

      + It will, when parse(String query) is called, construct a query like this + (assuming the query consists of two terms and you specify the two fields + title and body): +

      + + + (title:term1 body:term1) (title:term2 body:term2) + + +

      + When setDefaultOperator(AND_OPERATOR) is set, the result will be: +

      + + + +(title:term1 body:term1) +(title:term2 body:term2) + + +

      + In other words, all the query's terms must appear, but it doesn't matter + in what fields they appear. +

      + +

      + Please use + + instead + +
      + + Creates a MultiFieldQueryParser. + +

      + It will, when parse(String query) is called, construct a query like this + (assuming the query consists of two terms and you specify the two fields + title and body): +

      + + + (title:term1 body:term1) (title:term2 body:term2) + + +

      + When setDefaultOperator(AND_OPERATOR) is set, the result will be: +

      + + + +(title:term1 body:term1) +(title:term2 body:term2) + + +

      + In other words, all the query's terms must appear, but it doesn't matter + in what fields they appear. +

      +

      +
      + + Parses a query which searches on the fields specified. +

      + If x fields are specified, this effectively constructs: + + + (field1:query1) (field2:query2) (field3:query3)...(fieldx:queryx) + + +

      + Queries strings to parse + + Fields to search on + + Analyzer to use + + ParseException + if query parsing fails + + IllegalArgumentException + if the length of the queries array differs from the length of + the fields array + + Use + instead + +
      + + Parses a query which searches on the fields specified. +

      + If x fields are specified, this effectively constructs: + + + (field1:query1) (field2:query2) (field3:query3)...(fieldx:queryx) + + +

      + Lucene version to match; this is passed through to + QueryParser. + + Queries strings to parse + + Fields to search on + + Analyzer to use + + ParseException + if query parsing fails + + IllegalArgumentException + if the length of the queries array differs from the length of + the fields array + +
      + + Parses a query, searching on the fields specified. + Use this if you need to specify certain fields as required, + and others as prohibited. +

      + Usage: + + String[] fields = {"filename", "contents", "description"}; + BooleanClause.Occur[] flags = {BooleanClause.Occur.SHOULD, + BooleanClause.Occur.MUST, + BooleanClause.Occur.MUST_NOT}; + MultiFieldQueryParser.parse("query", fields, flags, analyzer); + +

      + The code above would construct a query: + + (filename:query) +(contents:query) -(description:query) + + +

      + Query string to parse + + Fields to search on + + Flags describing the fields + + Analyzer to use + + ParseException if query parsing fails + IllegalArgumentException if the length of the fields array differs + from the length of the flags array + + Use + + instead + +
      + + Parses a query, searching on the fields specified. Use this if you need + to specify certain fields as required, and others as prohibited. +

      + Uasge: + + String[] fields = {"filename", "contents", "description"}; + BooleanClause.Occur[] flags = {BooleanClause.Occur.SHOULD, + BooleanClause.Occur.MUST, + BooleanClause.Occur.MUST_NOT}; + MultiFieldQueryParser.parse("query", fields, flags, analyzer); + +

      + The code above would construct a query: + + + (filename:query) +(contents:query) -(description:query) + + +

      + Lucene version to match; this is passed through to + QueryParser. + + Query string to parse + + Fields to search on + + Flags describing the fields + + Analyzer to use + + ParseException + if query parsing fails + + IllegalArgumentException + if the length of the fields array differs from the length of + the flags array + +
      + + Parses a query, searching on the fields specified. + Use this if you need to specify certain fields as required, + and others as prohibited. +

      + Usage: + + String[] query = {"query1", "query2", "query3"}; + String[] fields = {"filename", "contents", "description"}; + BooleanClause.Occur[] flags = {BooleanClause.Occur.SHOULD, + BooleanClause.Occur.MUST, + BooleanClause.Occur.MUST_NOT}; + MultiFieldQueryParser.parse(query, fields, flags, analyzer); + +

      + The code above would construct a query: + + (filename:query1) +(contents:query2) -(description:query3) + + +

      + Queries string to parse + + Fields to search on + + Flags describing the fields + + Analyzer to use + + ParseException if query parsing fails + IllegalArgumentException if the length of the queries, fields, + and flags array differ + + Used + + instead + +
      + + Parses a query, searching on the fields specified. Use this if you need + to specify certain fields as required, and others as prohibited. +

      + Usage: + + String[] query = {"query1", "query2", "query3"}; + String[] fields = {"filename", "contents", "description"}; + BooleanClause.Occur[] flags = {BooleanClause.Occur.SHOULD, + BooleanClause.Occur.MUST, + BooleanClause.Occur.MUST_NOT}; + MultiFieldQueryParser.parse(query, fields, flags, analyzer); + +

      + The code above would construct a query: + + + (filename:query1) +(contents:query2) -(description:query3) + + +

      + Lucene version to match; this is passed through to + QueryParser. + + Queries string to parse + + Fields to search on + + Flags describing the fields + + Analyzer to use + + ParseException + if query parsing fails + + IllegalArgumentException + if the length of the queries, fields, and flags array differ + +
      + + Writes norms. Each thread X field accumulates the norms + for the doc/fields it saw, then the flush method below + merges all of these together into a single _X.nrm file. + + + + Produce _X.nrm if any document had a field with norms + not disabled + + + + Useful constants representing filenames and extensions used by lucene + + + $rcs = ' $Id: Exp $ ' ; + + + + Name of the index segment file + + + Name of the generation reference file name + + + Name of the index deletable file (only used in + pre-lockless indices) + + + + Extension of norms file + + + Extension of freq postings file + + + Extension of prox postings file + + + Extension of terms file + + + Extension of terms index file + + + Extension of stored fields index file + + + Extension of stored fields file + + + Extension of vectors fields file + + + Extension of vectors documents file + + + Extension of vectors index file + + + Extension of compound file + + + Extension of compound file for doc store files + + + Extension of deletes + + + Extension of field infos + + + Extension of plain norms + + + Extension of separate norms + + + Extension of gen file + + + This array contains all filename extensions used by + Lucene's index files, with two exceptions, namely the + extension made up from .f + a number and + from .s + a number. Also note that + Lucene's segments_N files do not have any + filename extension. + + + + File extensions that are added to a compound file + (same as above, minus "del", "gen", "cfs"). + + + + File extensions of old-style index files + + + File extensions for term vector support + + + Computes the full file name from base, extension and + generation. If the generation is -1, the file name is + null. If it's 0, the file name is + If it's > 0, the file name is + + + -- main part of the file name + + -- extension of the filename (including .) + + -- generation + + + + Returns true if the provided filename is one of the doc + store files (ends with an extension in + STORE_INDEX_EXTENSIONS). + + + + NOTE: this API is experimental and will likely change + + + Adds a new doc in this term. If this returns null + then we just skip consuming positions/payloads. + + + + Called when we are done adding docs to this term + + +

      This class provides a that enables indexing + of numeric values for efficient range filtering and + sorting. Here's an example usage, adding an int value: + + document.add(new NumericField(name).setIntValue(value)); + + + For optimal performance, re-use the + NumericField and instance for more than + one document: + + + NumericField field = new NumericField(name); + Document document = new Document(); + document.add(field); + + for(all documents) { + ... + field.setIntValue(value) + writer.addDocument(document); + ... + } + + +

      The .Net native types int, long, + float and double are + directly supported. However, any value that can be + converted into these native types can also be indexed. + For example, date/time values represented by a + can be translated into a long + value using the java.util.Date.getTime method. If you + don't need millisecond precision, you can quantize the + value, either by dividing the result of + java.util.Date.getTime or using the separate getters + (for year, month, etc.) to construct an int or + long value.

      + +

      To perform range querying or filtering against a + NumericField, use or + . To sort according to a + NumericField, use the normal numeric sort types, eg + (note that + will not work with these fields). NumericField values + can also be loaded directly from .

      + +

      By default, a NumericField's value is not stored but + is indexed for range filtering and sorting. You can use + the + constructor if you need to change these defaults.

      + +

      You may add the same field name as a NumericField to + the same document more than once. Range querying and + filtering will be the logical OR of all values; so a range query + will hit all documents that have at least one value in + the range. However sort behavior is not defined. If you need to sort, + you should separately index a single-valued NumericField.

      + +

      A NumericField will consume somewhat more disk space + in the index than an ordinary single-valued field. + However, for a typical index that includes substantial + textual content per document, this increase will likely + be in the noise.

      + +

      Within Lucene, each numeric value is indexed as a + trie structure, where each term is logically + assigned to larger and larger pre-defined brackets (which + are simply lower-precision representations of the value). + The step size between each successive bracket is called the + precisionStep, measured in bits. Smaller + precisionStep values result in larger number + of brackets, which consumes more disk space in the index + but may result in faster range search performance. The + default value, 4, was selected for a reasonable tradeoff + of disk space consumption versus performance. You can + use the expert constructor + if you'd + like to change the value. Note that you must also + specify a congruent value when creating + or . + For low cardinality fields larger precision steps are good. + If the cardinality is < 100, it is fair + to use , which produces one + term per value. + +

      For more information on the internals of numeric trie + indexing, including the precisionStep + configuration, see . The format of + indexed values is described in . + +

      If you only need to sort by numeric value, and never + run range querying/filtering, you can index using a + precisionStep of . + This will minimize disk space consumed.

      + +

      More advanced users can instead use + directly, when indexing numbers. This + class is a wrapper around this token stream type for + easier, more intuitive usage.

      + +

      NOTE: This class is only used during + indexing. When retrieving the stored field value from a + instance after search, you will get a + conventional instance where the numeric + values are returned as s (according to + toString(value) of the used data type). + +

      NOTE: This API is + experimental and might change in incompatible ways in the + next release. + +

      + 2.9 + +
      + + Creates a field for numeric values using the default precisionStep + (4). The instance is not yet initialized with + a numeric value, before indexing a document containing this field, + set a value using the various set???Value() methods. + This constructor creates an indexed, but not stored field. + + the field name + + + + Creates a field for numeric values using the default precisionStep + (4). The instance is not yet initialized with + a numeric value, before indexing a document containing this field, + set a value using the various set???Value() methods. + + the field name + + if the field should be stored in plain text form + (according to toString(value) of the used data type) + + if the field should be indexed using + + + + Creates a field for numeric values with the specified + precisionStep. The instance is not yet initialized with + a numeric value, before indexing a document containing this field, + set a value using the various set???Value() methods. + This constructor creates an indexed, but not stored field. + + the field name + + the used precision step + + + + Creates a field for numeric values with the specified + precisionStep. The instance is not yet initialized with + a numeric value, before indexing a document containing this field, + set a value using the various set???Value() methods. + + the field name + + the used precision step + + if the field should be stored in plain text form + (according to toString(value) of the used data type) + + if the field should be indexed using + + + + Returns a for indexing the numeric value. + + + Returns always null for numeric fields + + + Returns always null for numeric fields + + + Returns always null for numeric fields + + + Returns the numeric value as a string (how it is stored, when is chosen). + + + Returns the current numeric value as a subclass of , null if not yet initialized. + + + Initializes the field with the supplied long value. + the numeric value + + this instance, because of this you can use it the following way: + document.add(new NumericField(name, precisionStep).SetLongValue(value)) + + + + Initializes the field with the supplied int value. + the numeric value + + this instance, because of this you can use it the following way: + document.add(new NumericField(name, precisionStep).setIntValue(value)) + + + + Initializes the field with the supplied double value. + the numeric value + + this instance, because of this you can use it the following way: + document.add(new NumericField(name, precisionStep).setDoubleValue(value)) + + + + Initializes the field with the supplied float value. + the numeric value + + this instance, because of this you can use it the following way: + document.add(new NumericField(name, precisionStep).setFloatValue(value)) + + + + An Analyzer that uses . + + + A Token's lexical type. The Default value is "word". + + + Returns this Token's lexical type. Defaults to "word". + + + Set the lexical type. + + + + + + Stemmer, implementing the Porter Stemming Algorithm + + The Stemmer class transforms a word into its root form. The input + word can be provided a character at time (by calling add()), or at once + by calling one of the various stem(something) methods. + + + + reset() resets the stemmer so it can stem another word. If you invoke + the stemmer by calling add(char) and then stem(), you must call reset() + before starting another word. + + + + Add a character to the word being stemmed. When you are finished + adding characters, you can call stem(void) to process the word. + + + + After a word has been stemmed, it can be retrieved by toString(), + or a reference to the internal buffer can be retrieved by getResultBuffer + and getResultLength (which is generally more efficient.) + + + + Returns the length of the word resulting from the stemming process. + + + Returns a reference to a character buffer containing the results of + the stemming process. You also need to consult getResultLength() + to determine the length of the result. + + + + Stem a word provided as a String. Returns the result as a String. + + + Stem a word contained in a char[]. Returns true if the stemming process + resulted in a word different from the input. You can retrieve the + result with getResultLength()/getResultBuffer() or toString(). + + + + Stem a word contained in a portion of a char[] array. Returns + true if the stemming process resulted in a word different from + the input. You can retrieve the result with + getResultLength()/getResultBuffer() or toString(). + + + + Stem a word contained in a leading portion of a char[] array. + Returns true if the stemming process resulted in a word different + from the input. You can retrieve the result with + getResultLength()/getResultBuffer() or toString(). + + + + Stem the word placed into the Stemmer buffer through calls to add(). + Returns true if the stemming process resulted in a word different + from the input. You can retrieve the result with + getResultLength()/getResultBuffer() or toString(). + + + + Test program for demonstrating the Stemmer. It reads a file and + stems each word, writing the result to standard out. + Usage: Stemmer file-name + + + + Normalizes token text to lower case. + + + $Id: LowerCaseFilter.java 797665 2009-07-24 21:45:48Z buschmi $ + + + + A memory-resident implementation. + + + $Id: RAMOutputStream.java 691694 2008-09-03 17:34:29Z mikemccand $ + + + + Construct an empty output buffer. + + + Copy the current contents of this buffer to the named output. + + + Resets this to an empty buffer. + + + Returns byte usage of all buffers. + + + This exception is thrown when you try to list a + non-existent directory. + + + + A Query that matches documents within an exclusive range of terms. + +

      This query matches the documents looking for terms that fall into the + supplied range according to . It is not intended + for numerical ranges, use instead. + +

      This query uses the + + rewrite method. +

      + 2.9 + +
      + + Constructs a query selecting all terms greater/equal than lowerTerm + but less/equal than upperTerm. + +

      + If an endpoint is null, it is said + to be "open". Either or both endpoints may be open. Open endpoints may not + be exclusive (you can't select all but the first or last term without + explicitly specifying the term to exclude.) + +

      + The field that holds both lower and upper terms. + + The term text at the lower end of the range + + The term text at the upper end of the range + + If true, the lowerTerm is + included in the range. + + If true, the upperTerm is + included in the range. + +
      + + Constructs a query selecting all terms greater/equal than + lowerTerm but less/equal than upperTerm. +

      + If an endpoint is null, it is said + to be "open". Either or both endpoints may be open. Open endpoints may not + be exclusive (you can't select all but the first or last term without + explicitly specifying the term to exclude.) +

      + If collator is not null, it will be used to decide whether + index terms are within the given range, rather than using the Unicode code + point order in which index terms are stored. +

      + WARNING: Using this constructor and supplying a non-null + value in the collator parameter will cause every single + index Term in the Field referenced by lowerTerm and/or upperTerm to be + examined. Depending on the number of index Terms in this Field, the + operation could be very slow. + +

      + + The Term text at the lower end of the range + + The Term text at the upper end of the range + + If true, the lowerTerm is + included in the range. + + If true, the upperTerm is + included in the range. + + The collator to use to collate index Terms, to determine + their membership in the range bounded by lowerTerm and + upperTerm. + +
      + + Returns the field name for this query + + + Returns the lower value of this range query + + + Returns the upper value of this range query + + + Returns true if the lower endpoint is inclusive + + + Returns true if the upper endpoint is inclusive + + + Returns the collator used to determine range inclusion, if any. + + + Prints a user-readable version of this query. + + + Similar to , but for the unordered case. + + Expert: + Only public for subclassing. Most implementations should not need this class + + + + WARNING: The List is not necessarily in order of the the positions + Collection of byte[] payloads + + IOException + + + Wraps a Spans, and can be used to form a linked list. + + + + + + + + + Provides access to stored term vector of + a document field. The vector consists of the name of the field, an array of the terms tha occur in the field of the + and a parallel array of frequencies. Thus, getTermFrequencies()[5] corresponds with the + frequency of getTerms()[5], assuming there are at least 5 terms in the Document. + + + + The name. + The name of the field this vector is associated with. + + + + + The number of terms in the term vector. + + + + An Array of term texts in ascending order. + + + + Array of term frequencies. Locations of the array correspond one to one + to the terms in the array obtained from getTerms + method. Each location in the array contains the number of times this + term occurs in the document or the document field. + + + + Return an index in the term numbers array returned from + getTerms at which the term with the specified + term appears. If this term does not appear in the array, + return -1. + + + + Just like indexOf(int) but searches for a number of terms + at the same time. Returns an array that has the same size as the number + of terms searched for, each slot containing the result of searching for + that term number. + + + array containing terms to look for + + index in the array where the list of terms starts + + the number of terms in the list + + + + + The original list of terms from the query, can contain duplicates + + + +

      A that matches numeric values within a + specified range. To use this, you must first index the + numeric values using (expert: + ). If your terms are instead textual, + you should use . + is the filter equivalent of this + query.

      + +

      You create a new NumericRangeQuery with the static + factory methods, eg: + + + Query q = NumericRangeQuery.newFloatRange("weight", + new Float(0.3f), new Float(0.10f), + true, true); + + + matches all documents whose float valued "weight" field + ranges from 0.3 to 0.10, inclusive. + +

      The performance of NumericRangeQuery is much better + than the corresponding because the + number of terms that must be searched is usually far + fewer, thanks to trie indexing, described below.

      + +

      You can optionally specify a precisionStep + when creating this query. This is necessary if you've + changed this configuration from its default (4) during + indexing. Lower values consume more disk space but speed + up searching. Suitable values are between 1 and + 8. A good starting point to test is 4, + which is the default value for all Numeric* + classes. See below for + details. + +

      This query defaults to + for + 32 bit (int/float) ranges with precisionStep <8 and 64 + bit (long/double) ranges with precisionStep <6. + Otherwise it uses + as the + number of terms is likely to be high. With precision + steps of <4, this query can be run with one of the + BooleanQuery rewrite methods without changing + BooleanQuery's default max clause count. + +

      NOTE: This API is experimental and + might change in incompatible ways in the next release. + +

      How it works

      + +

      See the publication about panFMP, + where this algorithm was described (referred to as TrieRangeQuery): + +

      Schindler, U, Diepenbroek, M, 2008. + Generic XML-based Framework for Metadata Portals. + Computers & Geosciences 34 (12), 1947-1955. + doi:10.1016/j.cageo.2008.02.023
      + +

      A quote from this paper: Because Apache Lucene is a full-text + search engine and not a conventional database, it cannot handle numerical ranges + (e.g., field value is inside user defined bounds, even dates are numerical values). + We have developed an extension to Apache Lucene that stores + the numerical values in a special string-encoded format with variable precision + (all numerical values like doubles, longs, floats, and ints are converted to + lexicographic sortable string representations and stored with different precisions + (for a more detailed description of how the values are stored, + see ). A range is then divided recursively into multiple intervals for searching: + The center of the range is searched only with the lowest possible precision in the trie, + while the boundaries are matched more exactly. This reduces the number of terms dramatically.

      + +

      For the variant that stores long values in 8 different precisions (each reduced by 8 bits) that + uses a lowest precision of 1 byte, the index contains only a maximum of 256 distinct values in the + lowest precision. Overall, a range could consist of a theoretical maximum of + 7*255*2 + 255 = 3825 distinct terms (when there is a term for every distinct value of an + 8-byte-number in the index and the range covers almost all of them; a maximum of 255 distinct values is used + because it would always be possible to reduce the full 256 values to one term with degraded precision). + In practice, we have seen up to 300 terms in most cases (index with 500,000 metadata records + and a uniform value distribution).

      + +

      Precision Step

      +

      You can choose any precisionStep when encoding values. + Lower step values mean more precisions and so more terms in index (and index gets larger). + On the other hand, the maximum number of terms to match reduces, which optimized query speed. + The formula to calculate the maximum term count is: + + n = [ (bitsPerValue/precisionStep - 1) * (2^precisionStep - 1 ) * 2 ] + (2^precisionStep - 1 ) + +

      (this formula is only correct, when bitsPerValue/precisionStep is an integer; + in other cases, the value must be rounded up and the last summand must contain the modulo of the division as + precision step). + For longs stored using a precision step of 4, n = 15*15*2 + 15 = 465, and for a precision + step of 2, n = 31*3*2 + 3 = 189. But the faster search speed is reduced by more seeking + in the term enum of the index. Because of this, the ideal precisionStep value can only + be found out by testing. Important: You can index with a lower precision step value and test search speed + using a multiple of the original step value.

      + +

      Good values for precisionStep are depending on usage and data type: + + The default for all data types is 4, which is used, when no precisionStep is given. + Ideal value in most cases for 64 bit data types (long, double) is 6 or 8. + Ideal value in most cases for 32 bit data types (int, float) is 4. + Steps >64 for long/double and >32 for int/float produces one token + per value in the index and querying is as slow as a conventional . But it can be used + to produce fields, that are solely used for sorting (in this case simply use as + precisionStep). Using NumericFields for sorting + is ideal, because building the field cache is much faster than with text-only numbers. + Sorting is also possible with range query optimized fields using one of the above precisionSteps. + + +

      Comparisons of the different types of RangeQueries on an index with about 500,000 docs showed + that in boolean rewrite mode (with raised clause count) + took about 30-40 secs to complete, in constant score filter rewrite mode took 5 secs + and executing this class took <100ms to complete (on an Opteron64 machine, Java 1.5, 8 bit + precision step). This query type was developed for a geographic portal, where the performance for + e.g. bounding boxes or exact date/time stamps is important.

      + +

      + 2.9 + + +
      + + Factory that creates a NumericRangeQuery, that queries a long + range using the given precisionStep. + You can have half-open ranges (which are in fact </≤ or >/≥ queries) + by setting the min or max value to null. By setting inclusive to false, it will + match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. + + + + Factory that creates a NumericRangeQuery, that queries a long + range using the default precisionStep (4). + You can have half-open ranges (which are in fact </≤ or >/≥ queries) + by setting the min or max value to null. By setting inclusive to false, it will + match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. + + + + Factory that creates a NumericRangeQuery, that queries a int + range using the given precisionStep. + You can have half-open ranges (which are in fact </≤ or >/≥ queries) + by setting the min or max value to null. By setting inclusive to false, it will + match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. + + + + Factory that creates a NumericRangeQuery, that queries a int + range using the default precisionStep (4). + You can have half-open ranges (which are in fact </≤ or >/≥ queries) + by setting the min or max value to null. By setting inclusive to false, it will + match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. + + + + Factory that creates a NumericRangeQuery, that queries a double + range using the given precisionStep. + You can have half-open ranges (which are in fact </≤ or >/≥ queries) + by setting the min or max value to null. By setting inclusive to false, it will + match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. + + + + Factory that creates a NumericRangeQuery, that queries a double + range using the default precisionStep (4). + You can have half-open ranges (which are in fact </≤ or >/≥ queries) + by setting the min or max value to null. By setting inclusive to false, it will + match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. + + + + Factory that creates a NumericRangeQuery, that queries a float + range using the given precisionStep. + You can have half-open ranges (which are in fact </≤ or >/≥ queries) + by setting the min or max value to null. By setting inclusive to false, it will + match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. + + + + Factory that creates a NumericRangeQuery, that queries a float + range using the default precisionStep (4). + You can have half-open ranges (which are in fact </≤ or >/≥ queries) + by setting the min or max value to null. By setting inclusive to false, it will + match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. + + + + Returns the field name for this query + + + Returns true if the lower endpoint is inclusive + + + Returns true if the upper endpoint is inclusive + + + Returns the lower value of this range query + + + Returns the upper value of this range query + + + Subclass of FilteredTermEnum for enumerating all terms that match the + sub-ranges for trie range queries. +

      + WARNING: This term enumeration is not guaranteed to be always ordered by + . + The ordering depends on how and + generates the sub-ranges. For + ordering is not relevant. +

      +
      + + this is a dummy, it is not used by this class. + + + Compares if current upper bound is reached, + this also updates the term count for statistics. + In contrast to , a return value + of false ends iterating the current enum + and forwards to the next sub-range. + + + + Increments the enumeration to the next element. True if one exists. + + + Closes the enumeration to further activity, freeing resources. + + + This interface is obsolete, use instead. + + + Use , this will be removed in Lucene 3.0 + + + + + Use ; this will be removed in Lucene 3.0 + + + + Use , this will be removed in Lucene 3.0 + + + + Use , this will be removed in Lucene 3.0 + + + + Token Manager Error. + + + Lexical error occurred. + + + An attempt was made to create a second instance of a static token manager. + + + Tried to change to an invalid lexical state. + + + Detected (and bailed out of) an infinite loop in the token manager. + + + Indicates the reason why the exception is thrown. It will have + one of the above 4 values. + + + + Replaces unprintable characters by their escaped (or unicode escaped) + equivalents in the given string + + + + Returns a detailed message for the Error when it is thrown by the + token manager to indicate a lexical error. + Parameters : + EOFSeen : indicates if EOF caused the lexical error + curLexState : lexical state in which this error occurred + errorLine : line number when the error occurred + errorColumn : column number when the error occurred + errorAfter : prefix that was seen before this error occurred + curchar : the offending character + Note: You can customize the lexical error message by modifying this method. + + + + No arg constructor. + + + Constructor with message and reason. + + + Full Constructor. + + + You can also modify the body of this method to customize your error messages. + For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not + of end-users concern, so you can return something like : + + "Internal Error : Please file a bug report .... " + + from this method for such cases in the release version of your parser. + + + + Message Interface for a lazy loading. + For Native Language Support (NLS), system of software internationalization. + + + + Collapse the hash table & sort in-place. + + + Compares term text for two Posting instance and + returns -1 if p1 < p2; 1 if p1 > p2; else 0. + + + + Test whether the text for current RawPostingList p equals + current tokenText. + + + + Called when postings hash is too small (> 50% + occupied) or too large (< 20% occupied). + + + + An IndexReader which reads indexes with multiple segments. + + + Construct reading the named set of readers. + + + This constructor is only used for + + + Version number when this IndexReader was opened. + + + Checks is the index is optimized (if it has a single segment and no deletions) + true if the index is optimized; false otherwise + + + + Tries to acquire the WriteLock on this directory. this method is only valid if this IndexReader is directory + owner. + + + StaleReaderException if the index has changed since this reader was opened + CorruptIndexException if the index is corrupt + Lucene.Net.Store.LockObtainFailedException + if another writer has this index open (write.lock could not be + obtained) + + IOException if there is a low-level IO error + + + + + + + Commit changes resulting from delete, undeleteAll, or setNorm operations +

      + If an exception is hit, then either no changes or all changes will have been committed to the index (transactional + semantics). + +

      + IOException if there is a low-level IO error +
      + + Returns the directory this index resides in. + + + Expert: return the IndexCommit that this reader has opened. +

      +

      WARNING: this API is new and experimental and may suddenly change.

      +

      +
      + + + + + + Optimized implementation. + + + An IndexReader which reads multiple indexes, appending their content. + + + $Id: MultiReader.java 782406 2009-06-07 16:31:18Z mikemccand $ + + + +

      Construct a MultiReader aggregating the named set of (sub)readers. + Directory locking for delete, undeleteAll, and setNorm operations is + left to the subreaders.

      +

      Note that all subreaders are closed if this Multireader is closed.

      +

      + set of (sub)readers + + IOException +
      + +

      Construct a MultiReader aggregating the named set of (sub)readers. + Directory locking for delete, undeleteAll, and setNorm operations is + left to the subreaders.

      +

      + indicates whether the subreaders should be closed + when this MultiReader is closed + + set of (sub)readers + + IOException +
      + + Tries to reopen the subreaders. +
      + If one or more subreaders could be re-opened (i. e. subReader.reopen() + returned a new instance != subReader), then a new MultiReader instance + is returned, otherwise this instance is returned. +

      + A re-opened instance might share one or more subreaders with the old + instance. Index modification operations result in undefined behavior + when performed before the old instance is closed. + (see ). +

      + If subreaders are shared, then the reference count of those + readers is increased to ensure that the subreaders remain open + until the last referring reader is closed. + +

      + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error +
      + + Clones the subreaders. + (see ). +
      +

      + If subreaders are shared, then the reference count of those + readers is increased to ensure that the subreaders remain open + until the last referring reader is closed. +

      +
      + + If clone is true then we clone each of the subreaders + + + New IndexReader, or same one (this) if + reopen/clone is not necessary + + CorruptIndexException + IOException + + + + + + + Checks recursively if all subreaders are up to date. + + + Not implemented. + UnsupportedOperationException + + +

      Expert: a MergePolicy determines the sequence of + primitive merge operations to be used for overall merge + and optimize operations.

      + +

      Whenever the segments in an index have been altered by + , either the addition of a newly + flushed segment, addition of many segments from + addIndexes* calls, or a previous merge that may now need + to cascade, invokes + to give the MergePolicy a chance to pick + merges that are now required. This method returns a + instance describing the set of + merges that should be done, or null if no merges are + necessary. When IndexWriter.optimize is called, it calls + and the MergePolicy should + then return the necessary merges.

      + +

      Note that the policy can return more than one merge at + a time. In this case, if the writer is using + , the merges will be run + sequentially but if it is using + they will be run concurrently.

      + +

      The default MergePolicy is + .

      + +

      NOTE: This API is new and still experimental + (subject to change suddenly in the next release)

      + +

      NOTE: This class typically requires access to + package-private APIs (e.g. SegmentInfos) to do its job; + if you implement your own MergePolicy, you'll need to put + it in package Lucene.Net.Index in order to use + these APIs. +

      +
      + + Determine what set of merge operations are now necessary on the index. + calls this whenever there is a change to the segments. + This call is always synchronized on the instance so + only one thread at a time will call this method. + + + the total set of segments in the index + + + + Determine what set of merge operations is necessary in order to optimize + the index. calls this when its + method is called. This call is always + synchronized on the instance so only one thread at a + time will call this method. + + + the total set of segments in the index + + requested maximum number of segments in the index (currently this + is always 1) + + contains the specific SegmentInfo instances that must be merged + away. This may be a subset of all SegmentInfos. + + + + Determine what set of merge operations is necessary in order to expunge all + deletes from the index. + + + the total set of segments in the index + + + + Release all resources for the policy. + + + Returns true if a newly flushed (not from merge) + segment should use the compound file format. + + + + Returns true if the doc store files should use the + compound file format. + + + + OneMerge provides the information necessary to perform + an individual primitive merge operation, resulting in + a single new segment. The merge spec includes the + subset of segments to be merged as well as whether the + new segment should use the compound file format. + + + + Record that an exception occurred while executing + this merge + + + + Retrieve previous exception set by + . + + + + Mark this merge as aborted. If this is called + before the merge is committed then the merge will + not be committed. + + + + Returns true if this merge was aborted. + + + A MergeSpecification instance provides the information + necessary to perform multiple merges. It simply + contains a list of instances. + + + + The subset of segments to be included in the primitive merge. + + + Exception thrown if there are any problems while + executing a merge. + + + + + Use instead + + + + + Use instead + + + + Returns the of the index that hit + the exception. + + + +

      This class implements a that tries + to merge segments into levels of exponentially + increasing size, where each level has fewer segments than + the value of the merge factor. Whenever extra segments + (beyond the merge factor upper bound) are encountered, + all segments within the level are merged. You can get or + set the merge factor using and + respectively.

      + +

      This class is abstract and requires a subclass to + define the method which specifies how a + segment's size is determined. + is one subclass that measures size by document count in + the segment. is another + subclass that measures size as the total byte size of the + file(s) for the segment.

      +

      +
      + + Defines the allowed range of log(size) for each + level. A level is computed by taking the max segment + log size, minus LEVEL_LOG_SPAN, and finding all + segments falling within that range. + + + + Default merge factor, which is how many segments are + merged at a time + + + + Default maximum segment size. A segment of this size + + + + + Default noCFSRatio. If a merge's size is >= 10% of + the index, then we disable compound file for it. + See + + + + + + + + + If a merged segment will be more than this percentage + of the total size of the index, leave the segment as + non-compound file even if compound file is enabled. + Set to 1.0 to always use CFS regardless of merge + size. + + +

      Returns the number of segments that are merged at + once and also controls the total number of segments + allowed to accumulate in the index.

      +

      +
      + + Determines how often segment indices are merged by + addDocument(). With smaller values, less RAM is used + while indexing, and searches on unoptimized indices are + faster, but indexing speed is slower. With larger + values, more RAM is used during indexing, and while + searches on unoptimized indices are slower, indexing is + faster. Thus larger values (> 10) are best for batch + index creation, and smaller values (< 10) for indices + that are interactively maintained. + + + + Sets whether compound file format should be used for + newly flushed and newly merged segments. + + + + Returns true if newly flushed and newly merge segments + + + + + Sets whether compound file format should be used for + newly flushed and newly merged doc store + segment files (term vectors and stored fields). + + + + Returns true if newly flushed and newly merge doc + store segment files (term vectors and stored fields) + + + + + + Sets whether the segment size should be calibrated by + the number of deletes when choosing segments for merge. + + + + Returns true if the segment size should be calibrated + by the number of deletes when choosing segments for merge. + + + + Returns true if this single info is optimized (has no + pending norms or deletes, is in the same dir as the + writer, and matches the current compound file setting + + + + Returns the merges necessary to optimize the index. + This merge policy defines "optimized" to mean only one + segment in the index, where that segment has no + deletions pending nor separate norms, and it is in + compound file format if the current useCompoundFile + setting is true. This method returns multiple merges + (mergeFactor at a time) so the + in use may make use of concurrency. + + + + Finds merges necessary to expunge all deletes from the + index. We simply merge adjacent segments that have + deletes, up to mergeFactor at a time. + + + + Checks if any merges are now necessary and returns a + if so. A merge + is necessary when there are more than + segments at a given level. When + multiple levels have too many segments, this method + will return multiple merges, allowing the + to use concurrency. + + + +

      Determines the largest segment (measured by + document count) that may be merged with other segments. + Small values (e.g., less than 10,000) are best for + interactive indexing, as this limits the length of + pauses while indexing to a few seconds. Larger values + are best for batched indexing and speedier + searches.

      + +

      The default value is .

      + +

      The default merge policy () + also allows you to set this + limit by net size (in MB) of the segment, using + .

      +

      +
      + + Returns the largest segment (measured by document + count) that may be merged with other segments. + + + + + + This is a DocFieldConsumer that inverts each field, + separately, from a Document, and accepts a + InvertedTermsConsumer to process those terms. + + + + The positionIncrement determines the position of this token + relative to the previous Token in a , used in phrase + searching. + +

      The default value is one. + +

      Some common uses for this are: + + Set it to zero to put multiple terms in the same position. This is + useful if, e.g., a word has multiple stems. Searches for phrases + including either stem will match. In this case, all but the first stem's + increment should be set to zero: the increment of the first instance + should be one. Repeating a token with an increment of zero can also be + used to boost the scores of matches on that token. + + Set it to values greater than one to inhibit exact phrase matches. + If, for example, one does not want phrases to match across removed stop + words, then one could build a stop word filter that removes stop words and + also sets the increment to the number of stop words removed before each + non-stop word. Then exact phrase queries will only match when the terms + occur with no intervening stop words. + + +

      +
      + + Set the position increment. The default value is one. + + + the distance from the prior term + + + + Returns the position increment of this Token. + + + + + The start and end character offset of a Token. + + + The start and end character offset of a Token. + + + Returns this Token's starting offset, the position of the first character + corresponding to this token in the source text. + Note that the difference between endOffset() and startOffset() may not be + equal to termText.length(), as the term text may have been altered by a + stemmer or some other filter. + + + + Set the starting and ending offset. + See StartOffset() and EndOffset() + + + + Returns this Token's ending offset, one greater than the position of the + last character corresponding to this token in the source text. The length + of the token in the source text is (endOffset - startOffset). + + + + Returns this Token's starting offset, the position of the first character + corresponding to this token in the source text. + Note that the difference between endOffset() and startOffset() may not be + equal to termText.length(), as the term text may have been altered by a + stemmer or some other filter. + + + + Set the starting and ending offset. + See StartOffset() and EndOffset() + + + + Returns this Token's ending offset, one greater than the position of the + last character corresponding to this token in the source text. The length + of the token in the source text is (endOffset - startOffset). + + + + + The maximum number of items to cache. + + + + + The list to efficiently maintain the LRU state. + + + + + The dictionary to hash into any location in the list. + + + + + The node instance to use/re-use when adding an item to the cache. + + + + + Container to hold the key and value to aid in removal from + the dictionary when an item is removed from cache. + + + + Provides methods for sanity checking that entries in the FieldCache + are not wasteful or inconsistent. +

      +

      + Lucene 2.9 Introduced numerous enhancements into how the FieldCache + is used by the low levels of Lucene searching (for Sorting and + ValueSourceQueries) to improve both the speed for Sorting, as well + as reopening of IndexReaders. But these changes have shifted the + usage of FieldCache from "top level" IndexReaders (frequently a + MultiReader or DirectoryReader) down to the leaf level SegmentReaders. + As a result, existing applications that directly access the FieldCache + may find RAM usage increase significantly when upgrading to 2.9 or + Later. This class provides an API for these applications (or their + Unit tests) to check at run time if the FieldCache contains "insane" + usages of the FieldCache. +

      +

      + EXPERIMENTAL API: This API is considered extremely advanced and + experimental. It may be removed or altered w/o warning in future releases + of Lucene. +

      +

      + + + + + + +
      + + If set, will be used to estimate size for all CacheEntry objects + dealt with. + + + + Quick and dirty convenience method + + + + + Quick and dirty convenience method that instantiates an instance with + "good defaults" and uses it to test the CacheEntry[] + + + + + + Tests a CacheEntry[] for indication of "insane" cache usage. +

      + NOTE:FieldCache CreationPlaceholder objects are ignored. + (:TODO: is this a bad idea? are we masking a real problem?) +

      +

      +
      + + Internal helper method used by check that iterates over + valMismatchKeys and generates a Collection of Insanity + instances accordingly. The MapOfSets are used to populate + the Insantiy objects. + + + + + + Internal helper method used by check that iterates over + the keys of readerFieldToValIds and generates a Collection + of Insanity instances whenever two (or more) ReaderField instances are + found that have an ancestery relationships. + + + + + + + Checks if the seed is an IndexReader, and if so will walk + the hierarchy of subReaders building up a list of the objects + returned by obj.getFieldCacheKey() + + + + Simple pair object for using "readerKey + fieldName" a Map key + + + Simple container for a collection of related CacheEntry objects that + in conjunction with eachother represent some "insane" usage of the + FieldCache. + + + + Type of insane behavior this object represents + + + Description of hte insane behavior + + + CacheEntry objects which suggest a problem + + + Multi-Line representation of this Insanity object, starting with + the Type and Msg, followed by each CacheEntry.toString() on it's + own line prefaced by a tab character + + + + An Enumaration of the differnet types of "insane" behavior that + may be detected in a FieldCache. + + + + + + + + + + + Indicates an overlap in cache usage on a given field + in sub/super readers. + + + +

      + Indicates entries have the same reader+fieldname but + different cached values. This can happen if different datatypes, + or parsers are used -- and while it's not necessarily a bug + it's typically an indication of a possible problem. +

      +

      + PNOTE: Only the reader, fieldname, and cached value are actually + tested -- if two cache entries have different parsers or datatypes but + the cached values are the same Object (== not just equal()) this method + does not consider that a red flag. This allows for subtle variations + in the way a Parser is specified (null vs DEFAULT_LONG_PARSER, etc...) +

      +

      +
      + + Indicates an expected bit of "insanity". This may be useful for + clients that wish to preserve/log information about insane usage + but indicate that it was expected. + + + + Removes matches which overlap with another SpanQuery. + + + Construct a SpanNotQuery matching spans from include which + have no overlap with spans from exclude. + + + + Return the SpanQuery whose matches are filtered. + + + Return the SpanQuery whose matches must not overlap those returned. + + + Returns a collection of all terms matched by this query. + use extractTerms instead + + + + + + Returns true iff o is equal to this. + + + Constrains search results to only match those which also match a provided + query. Also provides position information about where each document matches + at the cost of extra space compared with the QueryWrapperFilter. + There is an added cost to this above what is stored in a . Namely, + the position information for each matching document is stored. +

      + This filter does not cache. See the for a wrapper that + caches. + + +

      + $Id:$ + +
      + + Constructs a filter which only matches documents matching + query. + + The to use as the basis for the Filter. + + + + A Scorer for queries with a required subscorer + and an excluding (prohibited) sub DocIdSetIterator. +
      + This Scorer implements , + and it uses the skipTo() on the given scorers. +
      +
      + + Construct a ReqExclScorer. + The scorer that must match, except where + + indicates exclusion. + + + + use instead. + + + + Advance to non excluded doc. +
      On entry: + + reqScorer != null, + exclScorer != null, + reqScorer was advanced once via next() or skipTo() + and reqScorer.doc() may still be excluded. + + Advances reqScorer a non excluded required doc, if any. +
      + true iff there is a non excluded required doc. + +
      + + use instead. + + + + Returns the score of the current document matching the query. + Initially invalid, until is called the first time. + + The score of the required scorer. + + + + use instead. + + + + A Query that matches documents containing a particular sequence of terms. + A PhraseQuery is built by QueryParser for input like "new york". + +

      This query may be combined with other terms or queries with a . +

      +
      + + Constructs an empty phrase query. + + + Sets the number of other words permitted between words in query phrase. + If zero, then this is an exact phrase search. For larger values this works + like a WITHIN or NEAR operator. +

      The slop is in fact an edit-distance, where the units correspond to + moves of terms in the query phrase out of position. For example, to switch + the order of two words requires two moves (the first move places the words + atop one another), so to permit re-orderings of phrases, the slop must be + at least two. +

      More exact matches are scored higher than sloppier matches, thus search + results are sorted by exactness. +

      The slop is zero by default, requiring exact matches. +

      +
      + + Returns the slop. See setSlop(). + + + Adds a term to the end of the query phrase. + The relative position of the term is the one immediately after the last term added. + + + + Adds a term to the end of the query phrase. + The relative position of the term within the phrase is specified explicitly. + This allows e.g. phrases with more than one term at the same position + or phrases with gaps (e.g. in connection with stopwords). + + + + + + + + + Returns the set of terms in this phrase. + + + Returns the relative positions of terms in this phrase. + + + + + + + Prints a user-readable version of this query. + + + Returns true iff o is equal to this. + + + Returns a hash code value for this object. + + + Convenience class for holding TermVector information. + + + Extends TermFreqVector to provide additional information about + positions in which each of the terms is found. A TermPositionVector not necessarily + contains both positions and offsets, but at least one of these arrays exists. + + + + Returns an array of positions in which the term is found. + Terms are identified by the index at which its number appears in the + term String array obtained from the indexOf method. + May return null if positions have not been stored. + + + + Returns an array of TermVectorOffsetInfo in which the term is found. + May return null if offsets have not been stored. + + + + + + The position in the array to get the offsets from + + An array of TermVectorOffsetInfo objects or the empty list + + + + An IndexReader which reads multiple, parallel indexes. Each index added + must have the same number of documents, but typically each contains + different fields. Each document contains the union of the fields of all + documents with the same document number. When searching, matches for a + query term are from the first index added that has the field. + +

      This is useful, e.g., with collections that have large fields which + change rarely and small fields that change more frequently. The smaller + fields may be re-indexed in a new index and both indexes may be searched + together. + +

      Warning: It is up to you to make sure all indexes + are created and modified the same way. For example, if you add + documents to one index, you need to add the same documents in the + same order to the other indexes. Failure to do so will result in + undefined behavior. +

      +
      + + Construct a ParallelReader. +

      Note that all subreaders are closed if this ParallelReader is closed.

      +

      +
      + + Construct a ParallelReader. + indicates whether the subreaders should be closed + when this ParallelReader is closed + + + + Add an IndexReader. + IOException if there is a low-level IO error + + + Add an IndexReader whose stored fields will not be returned. This can + accellerate search when stored fields are only needed from a subset of + the IndexReaders. + + + IllegalArgumentException if not all indexes contain the same number + of documents + + IllegalArgumentException if not all indexes have the same value + of + + IOException if there is a low-level IO error + + + Tries to reopen the subreaders. +
      + If one or more subreaders could be re-opened (i. e. subReader.reopen() + returned a new instance != subReader), then a new ParallelReader instance + is returned, otherwise this instance is returned. +

      + A re-opened instance might share one or more subreaders with the old + instance. Index modification operations result in undefined behavior + when performed before the old instance is closed. + (see ). +

      + If subreaders are shared, then the reference count of those + readers is increased to ensure that the subreaders remain open + until the last referring reader is closed. + +

      + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error +
      + + Checks recursively if all subreaders are up to date. + + + Checks recursively if all subindexes are optimized + + + Not implemented. + UnsupportedOperationException + + + + + + + + + + + + + Constructs a new runtime exception with null as its + detail message. The cause is not initialized, and may subsequently be + initialized by a call to . + + + + Constructs a new runtime exception with the specified cause and a + detail message of (cause==null ? null : cause.toString()) + (which typically contains the class and detail message of + cause). +

      + This constructor is useful for runtime exceptions + that are little more than wrappers for other throwables. + +

      + the cause (which is saved for later retrieval by the + ). (A null value is + permitted, and indicates that the cause is nonexistent or + unknown.) + + 1.4 + +
      + + Constructs a new runtime exception with the specified detail message. + The cause is not initialized, and may subsequently be initialized by a + call to . + + + the detail message. The detail message is saved for + later retrieval by the method. + + + + Constructs a new runtime exception with the specified detail message and + cause.

      Note that the detail message associated with + cause is not automatically incorporated in + this runtime exception's detail message. + +

      + the detail message (which is saved for later retrieval + by the method). + + the cause (which is saved for later retrieval by the + method). (A null value is + permitted, and indicates that the cause is nonexistent or + unknown.) + + 1.4 + +
      + + Gathers all Fieldables for a document under the same + name, updates FieldInfos, and calls per-field consumers + to process field by field. + + Currently, only a single thread visits the fields, + sequentially, for processing. + + + + If there are fields we've seen but did not see again + in the last run, then free them up. + + + + A Token's lexical type. The Default value is "word". + + + Returns this Token's lexical type. Defaults to "word". + + + Set the lexical type. + + + + + The payload of a Token. See also . + + + The payload of a Token. See also . + + + Returns this Token's payload. + + + Sets this Token's payload. + + + Initialize this attribute with no payload. + + + Initialize this attribute with the given payload. + + + Returns this Token's payload. + + + Sets this Token's payload. + + +

      Implements using + .

      + +

      NOTE: the javadocs + for File.createNewFile contain a vague + yet spooky warning about not using the API for file + locking. This warning was added due to this + bug, and in fact the only known problem with using + this API for locking is that the Lucene write lock may + not be released when the JVM exits abnormally.

      +

      When this happens, a + is hit when trying to create a writer, in which case you + need to explicitly clear the lock file first. You can + either manually remove the file, or use the + + API. But, first be certain that no writer is in fact + writing to the index otherwise you can easily corrupt + your index.

      + +

      If you suspect that this or any other LockFactory is + not working properly in your environment, you can easily + test it by using , + and .

      + +

      + + +
      + + Create a SimpleFSLockFactory instance, with null (unset) + lock directory. When you pass this factory to a + subclass, the lock directory is automatically set to the + directory itsself. Be sure to create one instance for each directory + your create! + + + + Instantiate using the provided directory (as a File instance). + where lock files should be created. + + + + Instantiate using the provided directory (as a File instance). + where lock files should be created. + + + + Instantiate using the provided directory name (String). + where lock files should be created. + + + + A implementation that collects the top-scoring hits, + returning them as a . This is used by to + implement -based search. Hits are sorted by score descending + and then (when the scores are tied) docID ascending. When you create an + instance of this collector you should know in advance whether documents are + going to be collected in doc Id order or not. + +

      NOTE: The values and + are not valid scores. This + collector will not properly collect hits with such + scores. +

      +
      + + Creates a new given the number of hits to + collect and whether documents are scored in order by the input + to . + +

      NOTE: The instances returned by this method + pre-allocate a full array of length + numHits, and fill the array with sentinel + objects. +

      +
      + + Expert: + Public for extension only + + + + MultiPhraseQuery is a generalized version of PhraseQuery, with an added + method . + To use this class, to search for the phrase "Microsoft app*" first use + add(Term) on the term "Microsoft", then find all terms that have "app" as + prefix using IndexReader.terms(Term), and use MultiPhraseQuery.add(Term[] + terms) to add them to the query. + + + 1.0 + + + + Sets the phrase slop for this query. + + + + + Sets the phrase slop for this query. + + + + + Add a single term at the next position in the phrase. + + + + + Add multiple terms at the next position in the phrase. Any of the terms + may match. + + + + + + + Allows to specify the relative position of terms within the phrase. + + + + + + + + + + + Returns a List<Term[]> of the terms in the multiphrase. + Do not modify the List or its contents. + + + + Returns the relative positions of terms in this phrase. + + + Prints a user-readable version of this query. + + + Returns true if o is equal to this. + + + Returns a hash code value for this object. + + + An iterator over that provides lazy fetching of each document. + returns an instance of this class. Calls to + return a instance. + + + Use and instead. Hits will be removed in Lucene 3.0. + + + + Constructed from . + + + true if current hit is less than the total number of . + + + + Unsupported operation. + + + UnsupportedOperationException + + + Returns the total number of hits. + + + Returns a instance representing the next hit in . + + + Next . + + + + Subclass of FilteredTermEnum for enumerating all terms that are similiar + to the specified filter term. + +

      Term enumerations are always ordered by Term.compareTo(). Each term in + the enumeration is greater than all that precede it. +

      +
      + + Creates a FuzzyTermEnum with an empty prefix and a minSimilarity of 0.5f. +

      + After calling the constructor the enumeration is already pointing to the first + valid term if such a term exists. + +

      + + + + + IOException + + +
      + + Creates a FuzzyTermEnum with an empty prefix. +

      + After calling the constructor the enumeration is already pointing to the first + valid term if such a term exists. + +

      + + + + + + + IOException + + +
      + + Constructor for enumeration of all terms from specified reader which share a prefix of + length prefixLength with term and which have a fuzzy similarity > + minSimilarity. +

      + After calling the constructor the enumeration is already pointing to the first + valid term if such a term exists. + +

      + Delivers terms. + + Pattern term. + + Minimum required similarity for terms from the reader. Default value is 0.5f. + + Length of required common prefix. Default value is 0. + + IOException +
      + + The termCompare method in FuzzyTermEnum uses Levenshtein distance to + calculate the distance between the given term and the comparing term. + + + + Finds and returns the smallest of three integers + + +

      Similarity returns a number that is 1.0f or less (including negative numbers) + based on how similar the Term is compared to a target term. It returns + exactly 0.0f when + + editDistance < maximumEditDistance + Otherwise it returns: + + 1 - (editDistance / length) + where length is the length of the shortest term (text or target) including a + prefix that are identical and editDistance is the Levenshtein distance for + the two words.

      + +

      Embedded within this algorithm is a fail-fast Levenshtein distance + algorithm. The fail-fast algorithm differs from the standard Levenshtein + distance algorithm in that it is aborted if it is discovered that the + mimimum distance between the words is greater than some threshold. + +

      To calculate the maximum distance threshold we use the following formula: + + (1 - minimumSimilarity) * length + where length is the shortest term including any prefix that is not part of the + similarity comparision. This formula was derived by solving for what maximum value + of distance returns false for the following statements: + + similarity = 1 - ((float)distance / (float) (prefixLength + Math.min(textlen, targetlen))); + return (similarity > minimumSimilarity); + where distance is the Levenshtein distance for the two words. +

      +

      Levenshtein distance (also known as edit distance) is a measure of similiarity + between two strings where the distance is measured as the number of character + deletions, insertions or substitutions required to transform one string to + the other string. +

      + the target word or phrase + + the similarity, 0.0 or less indicates that it matches less than the required + threshold and 1.0 indicates that the text and target are identical + +
      + + Grow the second dimension of the array, so that we can calculate the + Levenshtein difference. + + + + The max Distance is the maximum Levenshtein distance for the text + compared to some other value that results in score that is + better than the minimum similarity. + + the length of the "other value" + + the maximum levenshtein distance that we care about + + + + A query that applies a filter to the results of another query. + +

      Note: the bits are retrieved from the filter each time this + query is used in a search - use a CachingWrapperFilter to avoid + regenerating the bits every time. + +

      Created: Apr 20, 2004 8:58:29 AM + +

      + 1.4 + + $Id: FilteredQuery.java 807821 2009-08-25 21:55:49Z mikemccand $ + + + +
      + + Constructs a new query which applies a filter to the results of the original query. + Filter.getDocIdSet() will be called every time this query is used in a search. + + Query to be filtered, cannot be null. + + Filter to apply to query results, cannot be null. + + + + Returns a Weight that applies the filter to the enclosed query's Weight. + This is accomplished by overriding the Scorer returned by the Weight. + + + + Rewrites the wrapped query. + + + Prints a user-readable version of this query. + + + Returns true iff o is equal to this. + + + Returns a hash code value for this object. + + + use instead. + + + + use instead. + + + + use instead. + + + + Describes the input token stream. + + + An integer that describes the kind of this token. This numbering + system is determined by JavaCCParser, and a table of these numbers is + stored in the file ...Constants.java. + + + + The line number of the first character of this Token. + + + The column number of the first character of this Token. + + + The line number of the last character of this Token. + + + The column number of the last character of this Token. + + + The string image of the token. + + + A reference to the next regular (non-special) token from the input + stream. If this is the last token from the input stream, or if the + token manager has not read tokens beyond this one, this field is + set to null. This is true only if this token is also a regular + token. Otherwise, see below for a description of the contents of + this field. + + + + This field is used to access special tokens that occur prior to this + token, but after the immediately preceding regular (non-special) token. + If there are no such special tokens, this field is set to null. + When there are more than one such special token, this field refers + to the last of these special tokens, which in turn refers to the next + previous special token through its specialToken field, and so on + until the first special token (whose specialToken field is null). + The next fields of special tokens refer to other special tokens that + immediately follow it (without an intervening regular token). If there + is no such token, this field is null. + + + + An optional attribute value of the Token. + Tokens which are not used as syntactic sugar will often contain + meaningful values that will be used later on by the compiler or + interpreter. This attribute value is often different from the image. + Any subclass of Token that actually wants to return a non-null value can + override this method as appropriate. + + + + No-argument constructor + + + Constructs a new token for the specified Image. + + + Constructs a new token for the specified Image and Kind. + + + Returns the image. + + + Returns a new Token object, by default. However, if you want, you + can create and return subclass objects based on the value of ofKind. + Simply add the cases to the switch for all those special cases. + For example, if you have a subclass of Token called IDToken that + you want to create if ofKind is ID, simply add something like : + + case MyParserConstants.ID : return new IDToken(ofKind, image); + + to the following switch statement. Then you can cast matchedToken + variable to the appropriate type and use sit in your lexical actions. + + + + An efficient implementation of JavaCC's CharStream interface.

      Note that + this does not do line-number counting, but instead keeps track of the + character position of the token in the input, as required by Lucene's + API. + +

      +
      + + Constructs from a Reader. + + + + The number of the field this vector is associated with + + + + For each Field, store position by position information. It ignores frequency information +

      + This is not thread-safe. +

      +
      + + A Map of Integer and TVPositionInfo + + + + + + + + Never ignores positions. This mapper doesn't make much sense unless there are positions + false + + + + Callback for the TermVectorReader. + + + + + + + + + + + Callback mechanism used by the TermVectorReader + The field being read + + The number of terms in the vector + + Whether offsets are available + + Whether positions are available + + + + Get the mapping between fields and terms, sorted by the comparator + + + A map between field names and a Map. The sub-Map key is the position as the integer, the value is . + + + + Container for a term at a position + + + + The position of the term + + + + Note, there may be multiple terms at the same position + A List of Strings + + + + Parallel list (to ) of TermVectorOffsetInfo objects. + There may be multiple entries since there may be multiple terms at a position + A List of TermVectorOffsetInfo objects, if offsets are store. + + + + Abstract API that consumes terms, doc, freq, prox and + payloads postings. Concrete implementations of this + actually do "something" with the postings (write it into + the index in a specific format). + + NOTE: this API is experimental and will likely change + + + + Add a new field + + + Called when we are done adding everything. + + + Add a new field + + + Called when we are done adding everything. + + + This class keeps track of closing the underlying directory. It is used to wrap + DirectoryReaders, that are created using a String/File parameter + in IndexReader.open() with FSDirectory.getDirectory(). + + This helper class is removed with all String/File + IndexReader.open() methods in Lucene 3.0 + + + + This member contains the ref counter, that is passed to each instance after cloning/reopening, + and is global to all DirectoryOwningReader derived from the original one. + This reuses the class + + + + Removes words that are too long or too short from the stream. + + + + $Id: LengthFilter.java 807201 2009-08-24 13:22:34Z markrmiller $ + + + + Build a filter that removes words that are too long or too + short from the text. + + + + Returns the next input Token whose term() is the right len + + + Floating point numbers smaller than 32 bits. + + + $Id$ + + + + Converts a 32 bit float to an 8 bit float. +
      Values less than zero are all mapped to zero. +
      Values are truncated (rounded down) to the nearest 8 bit value. +
      Values between zero and the smallest representable value + are rounded up. + +
      + the 32 bit float to be converted to an 8 bit float (byte) + + the number of mantissa bits to use in the byte, with the remainder to be used in the exponent + + the zero-point in the range of exponent values + + the 8 bit float representation + +
      + + Converts an 8 bit float to a 32 bit float. + + + floatToByte(b, mantissaBits=3, zeroExponent=15) +
      smallest non-zero value = 5.820766E-10 +
      largest value = 7.5161928E9 +
      epsilon = 0.125 +
      +
      + + byteToFloat(b, mantissaBits=3, zeroExponent=15) + + + floatToByte(b, mantissaBits=5, zeroExponent=2) +
      smallest nonzero value = 0.033203125 +
      largest value = 1984.0 +
      epsilon = 0.03125 +
      +
      + + byteToFloat(b, mantissaBits=5, zeroExponent=2) + + + An average, best guess, MemoryModel that should work okay on most systems. + + + + + A implementation that collects the top-scoring + documents, returning them as a . This is used by + to implement -based search. + +

      This may be extended, overriding the collect method to, e.g., + conditionally invoke super() in order to filter which + documents are collected. + +

      + Please use + instead, which has better performance. + + +
      + + The total number of hits the collector encountered. + + + The priority queue which holds the top-scoring documents. + + + Construct to collect a given number of hits. + the maximum number of hits to collect + + + + use TopDocCollector(hq) instead. numHits is not used by this + constructor. It will be removed in a future release. + + + + Constructor to collect the top-scoring documents by using the given PQ. + the PQ to use by this instance. + + + + The total number of documents that matched this query. + + + The top-scoring hits. + + + Implements search over a set of Searchables. + +

      Applications usually need only call the inherited + or methods. +

      +
      + + Creates a searcher which searches searchers. + + + Return the array of s this searches. + + + + .NET + + + + Returns index of the searcher for document n in the array + used to construct this searcher. + + + + Returns the document number of document n within its + sub-index. + + + + Create weight in multiple index scenario. + + Distributed query processing is done in the following steps: + 1. rewrite query + 2. extract necessary terms + 3. collect dfs for these terms from the Searchables + 4. create query weight using aggregate dfs. + 5. distribute that weight to Searchables + 6. merge results + + Steps 1-4 are done here, 5+6 in the search() methods + + + rewritten queries + + + + Document Frequency cache acting as a Dummy-Searcher. This class is no + full-fledged Searcher, but only supports the methods necessary to + initialize Weights. + + + + + .NET + + + + Expert: Default scoring implementation. + + + Implemented as + state.getBoost()*lengthNorm(numTerms), where + numTerms is if + is false, else it's + - + . + +

      WARNING: This API is new and experimental, and may suddenly + change.

      +

      +
      + + Implemented as 1/sqrt(numTerms). + + + Implemented as 1/sqrt(sumOfSquaredWeights). + + + Implemented as sqrt(freq). + + + Implemented as 1 / (distance + 1). + + + Implemented as log(numDocs/(docFreq+1)) + 1. + + + Implemented as overlap / maxOverlap. + + + Determines whether overlap tokens (Tokens with + 0 position increment) are ignored when computing + norm. By default this is false, meaning overlap + tokens are counted just like non-overlap tokens. + +

      WARNING: This API is new and experimental, and may suddenly + change.

      + +

      + + +
      + + + + + + Expert: Describes the score computation for document and query, and + can distinguish a match independent of a positive value. + + + + The match status of this explanation node. + May be null if match status is unknown + + + + Sets the match status assigned to this explanation node. + May be null if match status is unknown + + + + Indicates whether or not this Explanation models a good match. + +

      + If the match status is explicitly set (i.e.: not null) this method + uses it; otherwise it defers to the superclass. +

      +

      + + +
      + + A Query that matches documents matching boolean combinations of other + queries, e.g. s, s or other + BooleanQuerys. + + + + Return the maximum number of clauses permitted, 1024 by default. + Attempts to add more than the permitted number of clauses cause + to be thrown. + + + + + + Set the maximum number of clauses permitted per BooleanQuery. + Default value is 1024. + + + + Constructs an empty boolean query. + + + Constructs an empty boolean query. + + may be disabled in scoring, as + appropriate. For example, this score factor does not make sense for most + automatically generated queries, like and + . + + + disables in scoring. + + + + Returns true iff is disabled in + scoring for this query instance. + + + + + + Specifies a minimum number of the optional BooleanClauses + which must be satisfied. + +

      + By default no optional clauses are necessary for a match + (unless there are no required clauses). If this method is used, + then the specified number of clauses is required. +

      +

      + Use of this method is totally independent of specifying that + any specific clauses are required (or prohibited). This number will + only be compared against the number of matching optional clauses. +

      +

      + EXPERT NOTE: Using this method may force collecting docs in order, + regardless of whether setAllowDocsOutOfOrder(true) has been called. +

      + +

      + the number of optional clauses that must match + + + +
      + + Gets the minimum number of the optional BooleanClauses + which must be satisifed. + + + + Adds a clause to a boolean query. + + + TooManyClauses if the new number of clauses exceeds the maximum clause number + + + + + Adds a clause to a boolean query. + TooManyClauses if the new number of clauses exceeds the maximum clause number + + + + + Returns the set of clauses in this query. + + + Returns the list of clauses in this query. + + + Whether hit docs may be collected out of docid order. + + + this will not be needed anymore, as + is used. + + + + Expert: Indicates whether hit docs may be collected out of docid order. + +

      + Background: although the contract of the Scorer class requires that + documents be iterated in order of doc id, this was not true in early + versions of Lucene. Many pieces of functionality in the current Lucene code + base have undefined behavior if this contract is not upheld, but in some + specific simple cases may be faster. (For example: disjunction queries with + less than 32 prohibited clauses; This setting has no effect for other + queries.) +

      + +

      + Specifics: By setting this option to true, docid N might be scored for a + single segment before docid N-1. Across multiple segments, docs may be + scored out of order regardless of this setting - it only applies to scoring + a single segment. + + Being static, this setting is system wide. +

      + +

      + this is not needed anymore, as + is used. + +
      + + Whether hit docs may be collected out of docid order. + + + + + this is not needed anymore, as + is used. + + + + Use instead. + + + + Use instead. + + + + Prints a user-readable version of this query. + + + Returns true iff o is equal to this. + + + Returns a hash code value for this object. + + + Thrown when an attempt is made to add more than + clauses. This typically happens if + a PrefixQuery, FuzzyQuery, WildcardQuery, or TermRangeQuery + is expanded to many terms during search. + + + + Expert: the Weight for BooleanQuery, used to + normalize, score and explain these queries. + +

      NOTE: this API and implementation is subject to + change suddenly in the next release.

      +

      +
      + + The Similarity implementation. + + + Default implementation of Message interface. + For Native Language Support (NLS), system of software internationalization. + + + + $Id: TermVectorsReader.java 687046 2008-08-19 13:01:11Z mikemccand $ + + + + Retrieve the length (in bytes) of the tvd and tvf + entries for the next numDocs starting with + startDocID. This is used for bulk copying when + merging segments, if the field numbers are + congruent. Once this returns, the tvf & tvd streams + are seeked to the startDocID. + + + + + The number of documents in the reader + + + + Retrieve the term vector for the given document and field + The document number to retrieve the vector for + + The field within the document to retrieve + + The TermFreqVector for the document and field or null if there is no termVector for this field. + + IOException if there is an error reading the term vector files + + + Return all term vectors stored for this document or null if the could not be read in. + + + The document number to retrieve the vector for + + All term frequency vectors + + IOException if there is an error reading the term vector files + + + + The field to read in + + The pointer within the tvf file where we should start reading + + The mapper used to map the TermVector + + IOException + + + Models the existing parallel array structure + + + Construct the vector + The based on the mappings. + + + + Compares s first by frequency and then by + the term (case-sensitive) + + + + + + This stores a monotonically increasing set of <Term, TermInfo> pairs in a + Directory. A TermInfos can be written once, in order. + + + + The file format version, a negative number. + + + Expert: The fraction of terms in the "dictionary" which should be stored + in RAM. Smaller values use more memory, but make searching slightly + faster, while larger values use less memory and make searching slightly + slower. Searching is typically not dominated by dictionary lookup, so + tweaking this is rarely useful. + + + + Expert: The fraction of entries stored in skip tables, + used to accellerate . Larger values result in + smaller indexes, greater acceleration, but fewer accelerable cases, while + smaller values result in bigger indexes, less acceleration and more + accelerable cases. More detailed experiments would be useful here. + + + + Expert: The maximum number of skip levels. Smaller values result in + slightly smaller indexes, but slower skipping in big posting lists. + + + + Adds a new <fieldNumber, termBytes>, TermInfo> pair to the set. + Term must be lexicographically greater than all previous Terms added. + TermInfo pointers must be positive and greater than all previous. + + + + Called to complete TermInfos creation. + + + This stores a monotonically increasing set of <Term, TermInfo> pairs in a + Directory. Pairs are accessed either by Term or by ordinal position the + set. + + + + Returns the number of term/value pairs in the set. + + + Returns the offset of the greatest index entry which is less than or equal to term. + + + Returns the TermInfo for a Term in the set, or null. + + + Returns the TermInfo for a Term in the set, or null. + + + Returns the position of a Term in the set or -1. + + + Returns an enumeration of all the Terms and TermInfos in the set. + + + Returns an enumeration of terms starting at or after the named term. + + + Per-thread resources managed by ThreadLocal + + + This exception is thrown when an + tries to make changes to the index (via + , + or ) + but changes have already been committed to the index + since this reader was instantiated. When this happens + you must open a new reader on the current index to make + the changes. + + + + Store a sorted collection of s. Collects all term information + into a single, SortedSet. +
      + NOTE: This Mapper ignores all Field information for the Document. This means that if you are using offset/positions you will not + know what Fields they correlate with. +
      + This is not thread-safe +
      +
      + + Stand-in name for the field in . + + + + A Comparator for sorting s + + + + + The term to map + + The frequency of the term + + Offset information, may be null + + Position information, may be null + + + + The TermVectorEntrySet. A SortedSet of objects. Sort is by the comparator passed into the constructor. +
      + This set will be empty until after the mapping process takes place. + +
      + The SortedSet of . + +
      + + Increments the enumeration to the next element. True if one exists. + + + Optimized scan, without allocating new terms. + Return number of invocations to next(). + + + + Returns the current Term in the enumeration. + Initially invalid, valid after next() called for the first time. + + + + Returns the previous Term enumerated. Initially null. + + + Returns the current TermInfo in the enumeration. + Initially invalid, valid after next() called for the first time. + + + + Sets the argument to the current TermInfo in the enumeration. + Initially invalid, valid after next() called for the first time. + + + + Returns the docFreq from the current TermInfo in the enumeration. + Initially invalid, valid after next() called for the first time. + + + + Closes the enumeration to further activity, freeing resources. + + + This is a DocFieldConsumer that inverts each field, + separately, from a Document, and accepts a + InvertedTermsConsumer to process those terms. + + + + Holds all per thread, per field state. + + + Helper methods to ease implementing . + + + for printing boost only if not 1.0 + + + A memory-resident implementation. + + + $Id: RAMInputStream.java 632120 2008-02-28 21:13:59Z mikemccand $ + + + + A memory-resident implementation. Locking + implementation is by default the + but can be changed with . + + + $Id: RAMDirectory.java 781333 2009-06-03 10:38:57Z mikemccand $ + + + + Constructs an empty . + + + Creates a new RAMDirectory instance from a different + Directory implementation. This can be used to load + a disk-based index into memory. +

      + This should be used only with indices that can fit into memory. +

      + Note that the resulting RAMDirectory instance is fully + independent from the original Directory (it is a + complete copy). Any subsequent changes to the + original Directory will not be visible in the + RAMDirectory instance. + +

      + a Directory value + + if an error occurs + +
      + + Creates a new RAMDirectory instance from the . + + + a File specifying the index directory + + + + + Use instead + + + + Creates a new RAMDirectory instance from the . + + + a String specifying the full index directory path + + + + + Use instead + + + + Returns true iff the named file exists in this directory. + + + Returns the time the named file was last modified. + IOException if the file does not exist + + + Set the modified time of an existing file to now. + IOException if the file does not exist + + + Returns the length in bytes of a file in the directory. + IOException if the file does not exist + + + Return total size in bytes of all files in this + directory. This is currently quantized to + RAMOutputStream.BUFFER_SIZE. + + + + Removes an existing file in the directory. + IOException if the file does not exist + + + Renames an existing file in the directory. + FileNotFoundException if from does not exist + + + + + Creates a new, empty file in the directory with the given name. Returns a stream writing this file. + + + Returns a stream reading an existing file. + + + Closes the store to future operations, releasing associated memory. + + + + .NET + + + + A implementation that collects the top-sorting + documents, returning them as a . This is used by + to implement -based search. + +

      This may be extended, overriding the collect method to, e.g., + conditionally invoke super() in order to filter which + documents are collected. + +

      + Please use instead. + +
      + + Construct to collect a given number of hits. + the index to be searched + + the sort criteria + + the maximum number of hits to collect + + + + Matches spans near the beginning of a field. + + + Construct a SpanFirstQuery matching spans in match whose end + position is less than or equal to end. + + + + Return the SpanQuery whose matches are filtered. + + + Return the maximum end position permitted in a match. + + + Returns a collection of all terms matched by this query. + use extractTerms instead + + + + + + A Spans that is formed from the ordered subspans of a SpanNearQuery + where the subspans do not overlap and have a maximum slop between them. +

      + The formed spans only contains minimum slop matches.
      + The matching slop is computed from the distance(s) between + the non overlapping matching Spans.
      + Successive matches are always formed from the successive Spans + of the SpanNearQuery. +

      + The formed spans may contain overlaps when the slop is at least 1. + For example, when querying using + t1 t2 t3 + with slop at least 1, the fragment: + t1 t2 t1 t3 t2 t3 + matches twice: + t1 t2 .. t3 + t1 .. t2 t3 + + + Expert: + Only public for subclassing. Most implementations should not need this class +

      +
      + + The spans in the same order as the SpanNearQuery + + + Indicates that all subSpans have same doc() + + + Advances the subSpans to just after an ordered match with a minimum slop + that is smaller than the slop allowed by the SpanNearQuery. + + true iff there is such a match. + + + + Advance the subSpans to the same document + + + Check whether two Spans in the same document are ordered. + + + + + true iff spans1 starts before spans2 + or the spans start at the same position, + and spans1 ends before spans2. + + + + Like , but use the spans + starts and ends as parameters. + + + + Order the subSpans within the same document by advancing all later spans + after the previous one. + + + + The subSpans are ordered in the same doc, so there is a possible match. + Compute the slop while making the match as short as possible by advancing + all subSpans except the last one in reverse order. + + + + A Scorer for queries with a required part and an optional part. + Delays skipTo() on the optional part until a score() is needed. +
      + This Scorer implements . +
      +
      + + The scorers passed from the constructor. + These are set to null as soon as their next() or skipTo() returns false. + + + + Construct a ReqOptScorer. + The required scorer. This must match. + + The optional scorer. This is used for scoring only. + + + + use instead. + + + + use instead. + + + + use instead. + + + + Returns the score of the current document matching the query. + Initially invalid, until is called the first time. + + The score of the required scorer, eventually increased by the score + of the optional scorer when it also matches the current document. + + + + Explain the score of a document. + TODO: Also show the total score. + See BooleanScorer.explain() on how to do this. + + + + Subclass of FilteredTermEnum for enumerating all terms that match the + specified prefix filter term. +

      + Term enumerations are always ordered by Term.compareTo(). Each term in + the enumeration is greater than all that precede it. + +

      +
      + + Calculates the minimum payload seen + + + + + + Expert: obtains int field values from the + FieldCache + using getInts() and makes those values + available as other numeric types, casting as needed. + +

      + WARNING: The status of the Search.Function package is experimental. + The APIs introduced here might change in the future and will not be + supported anymore in such a case. + +

      + for requirements + on the field. + +

      NOTE: with the switch in 2.9 to segment-based + searching, if is invoked with a + composite (multi-segment) reader, this can easily cause + double RAM usage for the values in the FieldCache. It's + best to switch your application to pass only atomic + (single segment) readers to this API. Alternatively, for + a short-term fix, you could wrap your ValueSource using + , which costs more CPU per lookup + but will not consume double the FieldCache RAM.

      + + + +

      Create a cached int field source with default string-to-int parser. +
      + + Create a cached int field source with a specific string-to-int parser. + + + Add a complete document specified by all its term vectors. If document has no + term vectors, add value for tvx. + + + + + IOException + + + Do a bulk copy of numDocs documents from reader to our + streams. This is used to expedite merging, if the + field numbers are congruent. + + + + Close all streams. + + + This class implements , which + is passed each token produced by the analyzer on each + field. It stores these tokens in a hash table, and + allocates separate byte streams per token. Consumers of + this class, eg and + , write their own byte streams + under each term. + + + + Returns an array of TermVectorOffsetInfo in which the term is found. + + + The position in the array to get the offsets from + + An array of TermVectorOffsetInfo objects or the empty list + + + + + + Returns an array of positions in which the term is found. + Terms are identified by the index at which its number appears in the + term String array obtained from the indexOf method. + + + + This is a that measures size of a + segment as the number of documents (not taking deletions + into account). + + + + + + + + Sets the minimum size for the lowest level segments. + Any segments below this size are considered to be on + the same level (even if they vary drastically in size) + and will be merged whenever there are mergeFactor of + them. This effectively truncates the "long tail" of + small segments that would otherwise be created into a + single level. If you set this too large, it could + greatly increase the merging cost during indexing (if + you flush many small segments). + + + + Get the minimum size for a segment to remain + un-merged. + + + + + + This is a that measures size of a + segment as the total byte size of the segment's files. + + + + + + + + Default maximum segment size. A segment of this size + + + + +

      Determines the largest segment (measured by total + byte size of the segment's files, in MB) that may be + merged with other segments. Small values (e.g., less + than 50 MB) are best for interactive indexing, as this + limits the length of pauses while indexing to a few + seconds. Larger values are best for batched indexing + and speedier searches.

      + +

      Note that is also + used to check whether a segment is too large for + merging (it's either or).

      +

      +
      + + Returns the largest segment (meaured by total byte + size of the segment's files, in MB) that may be merged + with other segments. + + + + + + Sets the minimum size for the lowest level segments. + Any segments below this size are considered to be on + the same level (even if they vary drastically in size) + and will be merged whenever there are mergeFactor of + them. This effectively truncates the "long tail" of + small segments that would otherwise be created into a + single level. If you set this too large, it could + greatly increase the merging cost during indexing (if + you flush many small segments). + + + + Get the minimum size for a segment to remain + un-merged. + + + + + + Consumes doc and freq, writing them using the current + index file format + + + + Adds a new doc in this term. If this returns null + then we just skip consuming positions/payloads. + + + + Called when we are done adding docs to this term + + + Bulk write a contiguous series of documents. The + lengths array is the length (in bytes) of each raw + document. The stream IndexInput is the + fieldsStream from which we should bulk-copy all + bytes. + + + + Class responsible for access to stored document fields. +

      + It uses <segment>.fdt and <segment>.fdx; files. + +

      + $Id: FieldsReader.java 801344 2009-08-05 18:05:06Z yonik $ + +
      + + Returns a cloned FieldsReader that shares open + IndexInputs with the original one. It is the caller's + job not to close the original FieldsReader until all + clones are called (eg, currently SegmentReader manages + this logic). + + + + AlreadyClosedException if this FieldsReader is closed + + + Closes the underlying streams, including any ones associated with a + lazy implementation of a Field. This means that the Fields values will not be accessible. + + + IOException + + + Returns the length in bytes of each raw document in a + contiguous range of length numDocs starting with + startDocID. Returns the IndexInput (the fieldStream), + already seeked to the starting point for startDocID. + + + + Skip the field. We still have to read some of the information about the field, but can skip past the actual content. + This will have the most payoff on large fields. + + + + A Lazy implementation of Fieldable that differs loading of fields until asked for, instead of when the Document is + loaded. + + + + The value of the field in Binary, or null. If null, the Reader value, + String value, or TokenStream value is used. Exactly one of stringValue(), + readerValue(), binaryValue(), and tokenStreamValue() must be set. + + + + The value of the field as a Reader, or null. If null, the String value, + binary value, or TokenStream value is used. Exactly one of stringValue(), + readerValue(), binaryValue(), and tokenStreamValue() must be set. + + + + The value of the field as a TokenStream, or null. If null, the Reader value, + String value, or binary value is used. Exactly one of stringValue(), + readerValue(), binaryValue(), and tokenStreamValue() must be set. + + + + The value of the field as a String, or null. If null, the Reader value, + binary value, or TokenStream value is used. Exactly one of stringValue(), + readerValue(), binaryValue(), and tokenStreamValue() must be set. + + + + Holds state for inverting all occurrences of a single + field in the document. This class doesn't do anything + itself; instead, it forwards the tokens produced by + analysis to its own consumer + (InvertedDocConsumerPerField). It also interacts with an + endConsumer (InvertedDocEndConsumerPerField). + + + + Basic tool and API to check the health of an index and + write a new segments file that removes reference to + problematic segments. + +

      As this tool checks every byte in the index, on a large + index it can take quite a long time to run. + +

      WARNING: this tool and API is new and + experimental and is subject to suddenly change in the + next release. Please make a complete backup of your + index before using this to fix your index! +

      +
      + + Default PrintStream for all CheckIndex instances. + Use per instance, + instead. + + + + Create a new CheckIndex on the directory. + + + Set infoStream where messages should go. If null, no + messages are printed + + + + Returns true if index is clean, else false. + Please instantiate a CheckIndex and then use instead + + + + Returns true if index is clean, else false. + Please instantiate a CheckIndex and then use instead + + + + Returns a instance detailing + the state of the index. + +

      As this method checks every byte in the index, on a large + index it can take quite a long time to run. + +

      WARNING: make sure + you only call this when the index is not opened by any + writer. +

      +
      + + Returns a instance detailing + the state of the index. + + + list of specific segment names to check + +

      As this method checks every byte in the specified + segments, on a large index it can take quite a long + time to run. + +

      WARNING: make sure + you only call this when the index is not opened by any + writer. + + + +

      Test field norms. +
      + + Test the term index. + + + Test stored fields for a segment. + + + Test term vectors for a segment. + + + Repairs the index using previously returned result + from . Note that this does not + remove any of the unreferenced files after it's done; + you must separately open an , which + deletes unreferenced files when it's created. + +

      WARNING: this writes a + new segments file into the index, effectively removing + all documents in broken segments from the index. + BE CAREFUL. + +

      WARNING: Make sure you only call this when the + index is not opened by any writer. +

      +
      + + Command-line interface to check and fix an index. +

      + Run it like this: + + java -ea:Lucene.Net... Lucene.Net.Index.CheckIndex pathToIndex [-fix] [-segment X] [-segment Y] + + + -fix: actually write a new segments_N file, removing any problematic segments + -segment X: only check the specified + segment(s). This can be specified multiple times, + to check more than one segment, eg -segment _2 + -segment _a. You can't use this with the -fix + option. + +

      WARNING: -fix should only be used on an emergency basis as it will cause + documents (perhaps many) to be permanently removed from the index. Always make + a backup copy of your index before running this! Do not run this tool on an index + that is actively being written to. You have been warned! +

      Run without -fix, this tool will open the index, report version information + and report any exceptions it hits and what action it would take if -fix were + specified. With -fix, this tool will remove any segments that have issues and + write a new segments_N file. This means all documents contained in the affected + segments will be removed. +

      + This tool exits with exit code 1 if the index cannot be opened or has any + corruption, else 0. +

      +
      + + Returned from detailing the health and status of the index. + +

      WARNING: this API is new and experimental and is + subject to suddenly change in the next release. + +

      +
      + + True if no problems were found with the index. + + + True if we were unable to locate and load the segments_N file. + + + True if we were unable to open the segments_N file. + + + True if we were unable to read the version number from segments_N file. + + + Name of latest segments_N file in the index. + + + Number of segments in the index. + + + String description of the version of the index. + + + Empty unless you passed specific segments list to check as optional 3rd argument. + + + + + True if the index was created with a newer version of Lucene than the CheckIndex tool. + + + List of instances, detailing status of each segment. + + + Directory index is in. + + + SegmentInfos instance containing only segments that + had no problems (this is used with the + method to repair the index. + + + + How many documents will be lost to bad segments. + + + How many bad segments were found. + + + True if we checked only specific segments () + was called with non-null + argument). + + + + Holds the userData of the last commit in the index + + + Holds the status of each segment in the index. + See . + +

      WARNING: this API is new and experimental and is + subject to suddenly change in the next release. +

      +
      + + Name of the segment. + + + Document count (does not take deletions into account). + + + True if segment is compound file format. + + + Number of files referenced by this segment. + + + Net size (MB) of the files referenced by this + segment. + + + + Doc store offset, if this segment shares the doc + store files (stored fields and term vectors) with + other segments. This is -1 if it does not share. + + + + String of the shared doc store segment, or null if + this segment does not share the doc store files. + + + + True if the shared doc store files are compound file + format. + + + + True if this segment has pending deletions. + + + Name of the current deletions file name. + + + Number of deleted documents. + + + True if we were able to open a SegmentReader on this + segment. + + + + Number of fields in this segment. + + + True if at least one of the fields in this segment + does not omitTermFreqAndPositions. + + + + + + Map<String, String> that includes certain + debugging details that IndexWriter records into + each segment it creates + + + + Status for testing of field norms (null if field norms could not be tested). + + + Status for testing of indexed terms (null if indexed terms could not be tested). + + + Status for testing of stored fields (null if stored fields could not be tested). + + + Status for testing of term vectors (null if term vectors could not be tested). + + + Status from testing field norms. + + + Number of fields successfully tested + + + Exception thrown during term index test (null on success) + + + Status from testing term index. + + + Total term count + + + Total frequency across all terms. + + + Total number of positions. + + + Exception thrown during term index test (null on success) + + + Status from testing stored fields. + + + Number of documents tested. + + + Total number of stored fields tested. + + + Exception thrown during stored fields test (null on success) + + + Status from testing stored fields. + + + Number of documents tested. + + + Total number of term vectors tested. + + + Exception thrown during term vector test (null on success) + + + This attribute can be used to pass different flags down the tokenizer chain, + eg from one TokenFilter to another one. + + + + This attribute can be used to pass different flags down the chain, + eg from one TokenFilter to another one. + + + + EXPERIMENTAL: While we think this is here to stay, we may want to change it to be a long. +

      + + Get the bitset for any bits that have been set. This is completely distinct from , although they do share similar purposes. + The flags can be used to encode information about the token for use by other s. + + +

      + The bits + +
      + + + + + + EXPERIMENTAL: While we think this is here to stay, we may want to change it to be a long. +

      + + Get the bitset for any bits that have been set. This is completely distinct from , although they do share similar purposes. + The flags can be used to encode information about the token for use by other s. + + +

      + The bits + +
      + + + + + + A Token is an occurrence of a term from the text of a field. It consists of + a term's text, the start and end offset of the term in the text of the field, + and a type string. +

      + The start and end offsets permit applications to re-associate a token with + its source text, e.g., to display highlighted query terms in a document + browser, or to show matching text fragments in a KWIC display, etc. +

      + The type is a string, assigned by a lexical analyzer + (a.k.a. tokenizer), naming the lexical or syntactic class that the token + belongs to. For example an end of sentence marker token might be implemented + with type "eos". The default token type is "word". +

      + A Token can optionally have metadata (a.k.a. Payload) in the form of a variable + length byte array. Use and + to retrieve the payloads from the index. +

      +

      +
      +

      NOTE: As of 2.9, Token implements all interfaces + that are part of core Lucene and can be found in the namespace. + Even though it is not necessary to use Token anymore, with the new TokenStream API it can + be used as convenience class that implements all s, which is especially useful + to easily switch from the old to the new TokenStream API. +

      +

      +

      NOTE: As of 2.3, Token stores the term text + internally as a malleable char[] termBuffer instead of + String termText. The indexing code and core tokenizers + have been changed to re-use a single Token instance, changing + its buffer and other fields in-place as the Token is + processed. This provides substantially better indexing + performance as it saves the GC cost of new'ing a Token and + String for every term. The APIs that accept String + termText are still available but a warning about the + associated performance cost has been added (below). The + method has been deprecated.

      +

      +

      Tokenizers and TokenFilters should try to re-use a Token instance when + possible for best performance, by implementing the + API. + Failing that, to create a new Token you should first use + one of the constructors that starts with null text. To load + the token from a char[] use . + To load from a String use or . + Alternatively you can get the Token's termBuffer by calling either , + if you know that your text is shorter than the capacity of the termBuffer + or , if there is any possibility + that you may need to grow the buffer. Fill in the characters of your term into this + buffer, with if loading from a string, + or with , and finally call to + set the length of the term text. See LUCENE-969 + for details.

      +

      Typical Token reuse patterns: + + Copying text from a string (type is reset to if not + specified):
      + + return reusableToken.reinit(string, startOffset, endOffset[, type]); + +
      + Copying some text from a string (type is reset to + if not specified):
      + + return reusableToken.reinit(string, 0, string.length(), startOffset, endOffset[, type]); + +
      + Copying text from char[] buffer (type is reset to + if not specified):
      + + return reusableToken.reinit(buffer, 0, buffer.length, startOffset, endOffset[, type]); + +
      + Copying some text from a char[] buffer (type is reset to + if not specified):
      + + return reusableToken.reinit(buffer, start, end - start, startOffset, endOffset[, type]); + +
      + Copying from one one Token to another (type is reset to + if not specified):
      + + return reusableToken.reinit(source.termBuffer(), 0, source.termLength(), source.startOffset(), source.endOffset()[, source.type()]); + +
      +
      + A few things to note: + + clear() initializes all of the fields to default values. This was changed in contrast to Lucene 2.4, but should affect no one. + Because TokenStreams can be chained, one cannot assume that the Token's current type is correct. + The startOffset and endOffset represent the start and offset in the + source text, so be careful in adjusting them. + When caching a reusable token, clone it. When injecting a cached token into a stream that can be reset, clone it again. + +

      +

      + + +
      + + We will remove this when we remove the + deprecated APIs + + + + Characters for the term text. + This will be made private. Instead, use: + , + , + , or + + + + + Length of term text in the buffer. + This will be made private. Instead, use: + , or . + + + + Start in source text. + This will be made private. Instead, use: + , or . + + + + End in source text. + This will be made private. Instead, use: + , or . + + + + The lexical type of the token. + This will be made private. Instead, use: + , or . + + + + This will be made private. Instead, use: + , or . + + + + This will be made private. Instead, use: + , or . + + + + Constructs a Token will null text. + + + Constructs a Token with null text and start & end + offsets. + + start offset in the source text + + end offset in the source text + + + + Constructs a Token with null text and start & end + offsets plus the Token type. + + start offset in the source text + + end offset in the source text + + the lexical type of this Token + + + + Constructs a Token with null text and start & end + offsets plus flags. NOTE: flags is EXPERIMENTAL. + + start offset in the source text + + end offset in the source text + + The bits to set for this token + + + + Constructs a Token with the given term text, and start + & end offsets. The type defaults to "word." + NOTE: for better indexing speed you should + instead use the char[] termBuffer methods to set the + term text. + + term text + + start offset + + end offset + + + + Constructs a Token with the given text, start and end + offsets, & type. NOTE: for better indexing + speed you should instead use the char[] termBuffer + methods to set the term text. + + term text + + start offset + + end offset + + token type + + + + Constructs a Token with the given text, start and end + offsets, & type. NOTE: for better indexing + speed you should instead use the char[] termBuffer + methods to set the term text. + + + + + + + + token type bits + + + + Constructs a Token with the given term buffer (offset + & length), start and end + offsets + + + + + + + + + + + + + + Set the position increment. This determines the position of this token + relative to the previous Token in a , used in phrase + searching. + +

      The default value is one. + +

      Some common uses for this are: + + Set it to zero to put multiple terms in the same position. This is + useful if, e.g., a word has multiple stems. Searches for phrases + including either stem will match. In this case, all but the first stem's + increment should be set to zero: the increment of the first instance + should be one. Repeating a token with an increment of zero can also be + used to boost the scores of matches on that token. + + Set it to values greater than one to inhibit exact phrase matches. + If, for example, one does not want phrases to match across removed stop + words, then one could build a stop word filter that removes stop words and + also sets the increment to the number of stop words removed before each + non-stop word. Then exact phrase queries will only match when the terms + occur with no intervening stop words. + + +

      + the distance from the prior term + + + +
      + + Returns the position increment of this Token. + + + + + Sets the Token's term text. NOTE: for better + indexing speed you should instead use the char[] + termBuffer methods to set the term text. + + use or + or + . + + + + Returns the Token's term text. + + + This method now has a performance penalty + because the text is stored internally in a char[]. If + possible, use and + directly instead. If you really need a + String, use + + + + Returns the Token's term text. + + This method has a performance penalty + because the text is stored internally in a char[]. If + possible, use and + directly instead. If you really need a + String, use this method, which is nothing more than + a convenience call to new String(token.termBuffer(), 0, token.termLength()) + + + + Copies the contents of buffer, starting at offset for + length characters, into the termBuffer array. + + the buffer to copy + + the index in the buffer of the first character to copy + + the number of characters to copy + + + + Copies the contents of buffer into the termBuffer array. + the buffer to copy + + + + Copies the contents of buffer, starting at offset and continuing + for length characters, into the termBuffer array. + + the buffer to copy + + the index in the buffer of the first character to copy + + the number of characters to copy + + + + Returns the internal termBuffer character array which + you can then directly alter. If the array is too + small for your token, use + to increase it. After + altering the buffer be sure to call + to record the number of valid + characters that were placed into the termBuffer. + + + + Grows the termBuffer to at least size newSize, preserving the + existing content. Note: If the next operation is to change + the contents of the term buffer use + , + , or + + to optimally combine the resize with the setting of the termBuffer. + + minimum size of the new termBuffer + + newly created termBuffer with length >= newSize + + + + Allocates a buffer char[] of at least newSize, without preserving the existing content. + its always used in places that set the content + + minimum size of the buffer + + + + Return number of valid characters (length of the term) + in the termBuffer array. + + + + Set number of valid characters (length of the term) in + the termBuffer array. Use this to truncate the termBuffer + or to synchronize with external manipulation of the termBuffer. + Note: to grow the size of the array, + use first. + + the truncated length + + + + Returns this Token's starting offset, the position of the first character + corresponding to this token in the source text. + Note that the difference between endOffset() and startOffset() may not be + equal to termText.length(), as the term text may have been altered by a + stemmer or some other filter. + + + + Set the starting offset. + + + + + Returns this Token's ending offset, one greater than the position of the + last character corresponding to this token in the source text. The length + of the token in the source text is (endOffset - startOffset). + + + + Set the ending offset. + + + + + Set the starting and ending offset. + See StartOffset() and EndOffset() + + + + Returns this Token's lexical type. Defaults to "word". + + + Set the lexical type. + + + + + EXPERIMENTAL: While we think this is here to stay, we may want to change it to be a long. +

      + + Get the bitset for any bits that have been set. This is completely distinct from , although they do share similar purposes. + The flags can be used to encode information about the token for use by other s. + + +

      + The bits + +
      + + + + + + Returns this Token's payload. + + + Sets this Token's payload. + + + Resets the term text, payload, flags, and positionIncrement, + startOffset, endOffset and token type to default. + + + + Makes a clone, but replaces the term buffer & + start/end offset in the process. This is more + efficient than doing a full clone (and then calling + setTermBuffer) because it saves a wasted copy of the old + termBuffer. + + + + Shorthand for calling , + , + , + , + + + this Token instance + + + + Shorthand for calling , + , + , + + on Token.DEFAULT_TYPE + + this Token instance + + + + Shorthand for calling , + , + , + + + + this Token instance + + + + Shorthand for calling , + , + , + + + + this Token instance + + + + Shorthand for calling , + , + , + + on Token.DEFAULT_TYPE + + this Token instance + + + + Shorthand for calling , + , + , + + on Token.DEFAULT_TYPE + + this Token instance + + + + Copy the prototype token's fields into this one. Note: Payloads are shared. + + + + + Copy the prototype token's fields into this one, with a different term. Note: Payloads are shared. + + + + + + + Copy the prototype token's fields into this one, with a different term. Note: Payloads are shared. + + + + + + + + + + + This analyzer is used to facilitate scenarios where different + fields require different analysis techniques. Use + to add a non-default analyzer on a field name basis. + +

      Example usage: + + + PerFieldAnalyzerWrapper aWrapper = + new PerFieldAnalyzerWrapper(new StandardAnalyzer()); + aWrapper.addAnalyzer("firstname", new KeywordAnalyzer()); + aWrapper.addAnalyzer("lastname", new KeywordAnalyzer()); + + +

      In this example, StandardAnalyzer will be used for all fields except "firstname" + and "lastname", for which KeywordAnalyzer will be used. + +

      A PerFieldAnalyzerWrapper can be used like any other analyzer, for both indexing + and query parsing. +

      +
      + + Constructs with default analyzer. + + + Any fields not specifically + defined to use a different analyzer will use the one provided here. + + + + Constructs with default analyzer and a map of analyzers to use for + specific fields. + + + Any fields not specifically + defined to use a different analyzer will use the one provided here. + + a Map (String field name to the Analyzer) to be + used for those fields + + + + Defines an analyzer to use for the specified field. + + + field name requiring a non-default analyzer + + non-default analyzer to use for field + + + + Return the positionIncrementGap from the analyzer assigned to fieldName + + + Return the offsetGap from the analyzer assigned to field + + + Simplistic that applies the mappings + contained in a to the character + stream, and correcting the resulting changes to the + offsets. + + + + Default constructor that takes a . + + + Easy-use constructor that takes a . + + + LowerCaseTokenizer performs the function of LetterTokenizer + and LowerCaseFilter together. It divides text at non-letters and converts + them to lower case. While it is functionally equivalent to the combination + of LetterTokenizer and LowerCaseFilter, there is a performance advantage + to doing the two tasks at once, hence this (redundant) implementation. +

      + Note: this does a decent job for most European languages, but does a terrible + job for some Asian languages, where words are not separated by spaces. +

      +
      + + A LetterTokenizer is a tokenizer that divides text at non-letters. That's + to say, it defines tokens as maximal strings of adjacent letters, as defined + by java.lang.Character.isLetter() predicate. + Note: this does a decent job for most European languages, but does a terrible + job for some Asian languages, where words are not separated by spaces. + + + + An abstract base class for simple, character-oriented tokenizers. + + + Returns true iff a character should be included in a token. This + tokenizer generates as tokens adjacent sequences of characters which + satisfy this predicate. Characters for which this is false are used to + define token boundaries and are not included in tokens. + + + + Called on each token character to normalize it before it is added to the + token. The default implementation does nothing. Subclasses may use this + to, e.g., lowercase tokens. + + + + Will be removed in Lucene 3.0. This method is final, as it should + not be overridden. Delegates to the backwards compatibility layer. + + + + Will be removed in Lucene 3.0. This method is final, as it should + not be overridden. Delegates to the backwards compatibility layer. + + + + Construct a new LetterTokenizer. + + + Construct a new LetterTokenizer using a given . + + + Construct a new LetterTokenizer using a given . + + + Collects only characters which satisfy + . + + + + Construct a new LowerCaseTokenizer. + + + Construct a new LowerCaseTokenizer using a given . + + + Construct a new LowerCaseTokenizer using a given . + + + Converts char to lower case + . + + + + Use by certain classes to match version compatibility + across releases of Lucene. +

      + WARNING: When changing the version parameter + that you supply to components in Lucene, do not simply + change the version at search-time, but instead also adjust + your indexing code to match, and re-index. +

      +
      + + +

      WARNING: if you use this setting, and then + upgrade to a newer release of Lucene, sizable changes + may happen. If precise back compatibility is important + then you should instead explicitly specify an actual + version. + If you use this constant then you may need to + re-index all of your documents when upgrading + Lucene, as the way text is indexed may have changed. + Additionally, you may need to re-test your entire + application to ensure it behaves as expected, as + some defaults may have changed and may break functionality + in your application. +

      +
      + + Match settings and bugs in Lucene's 2.0 release. + + + Match settings and bugs in Lucene's 2.1 release. + + + Match settings and bugs in Lucene's 2.2 release. + + + Match settings and bugs in Lucene's 2.3 release. + + + Match settings and bugs in Lucene's 2.3 release. + + + Match settings and bugs in Lucene's 2.3 release. + Use this to get the latest and greatest settings, bug + fixes, etc, for Lucene. + + + + An iterator to iterate over set bits in an OpenBitSet. + This is faster than nextSetBit() for iterating over the complete set of bits, + especially when the density of the bits set is high. + + + $Id$ + + + + ** the python code that generated bitlist + def bits2int(val): + arr=0 + for shift in range(8,0,-1): + if val & 0x80: + arr = (arr << 4) | shift + val = val << 1 + return arr + def int_table(): + tbl = [ hex(bits2int(val)).strip('L') for val in range(256) ] + return ','.join(tbl) + **** + + + + use instead. + + + + use instead. + + + + use instead. + + + + Expert: A Directory instance that switches files between + two other Directory instances. +

      Files with the specified extensions are placed in the + primary directory; others are placed in the secondary + directory. The provided Set must not change once passed + to this class, and must allow multiple threads to call + contains at once.

      + +

      NOTE: this API is new and experimental and is + subject to suddenly change in the next release. +

      +
      + + Return the primary directory + + + Return the secondary directory + + + + .NET + + + + Utility method to return a file's extension. + + + A Query that matches documents containing a term. + This may be combined with other terms with a . + + + + Constructs a query for the term t. + + + Returns the term of this query. + + + Prints a user-readable version of this query. + + + Returns true iff o is equal to this. + + + Returns a hash code value for this object. + + + Constrains search results to only match those which also match a provided + query. + +

      This could be used, for example, with a on a suitably + formatted date field to implement date filtering. One could re-use a single + QueryFilter that matches, e.g., only documents modified within the last + week. The QueryFilter and TermRangeQuery would only need to be reconstructed + once per day. + +

      + $Id:$ + +
      + + Constructs a filter which only matches documents matching + query. + + + + Use instead. + + + + Constrains search results to only match those which also match a provided + query. Results are cached, so that searches after the first on the same + index using this filter are much faster. + + + $Id: QueryFilter.java 528298 2007-04-13 00:59:28Z hossman $ + + use a CachingWrapperFilter with QueryWrapperFilter + + + + Constructs a filter which only matches documents matching + query. + + + + A Query that matches documents containing terms with a specified prefix. A PrefixQuery + is built by QueryParser for input like app*. + +

      This query uses the + + rewrite method. +

      +
      + + Constructs a query for terms starting with prefix. + + + Returns the prefix of this query. + + + Prints a user-readable version of this query. + + + Experimental class to get set of payloads for most standard Lucene queries. + Operates like Highlighter - IndexReader should only contain doc of interest, + best to use MemoryIndex. + +

      + + WARNING: The status of the Payloads feature is experimental. + The APIs introduced here might change in the future and will not be + supported anymore in such a case. + +

      +
      + + that contains doc with payloads to extract + + + + Query should be rewritten for wild/fuzzy support. + + + + + payloads Collection + + IOException + + + Expert: obtains the ordinal of the field value from the default Lucene + Fieldcache using getStringIndex(). +

      + The native lucene index order is used to assign an ordinal value for each field value. +

      + Field values (terms) are lexicographically ordered by unicode value, and numbered starting at 1. +

      + Example: +
      If there were only three field values: "apple","banana","pear" +
      then ord("apple")=1, ord("banana")=2, ord("pear")=3 +

      + WARNING: + ord() depends on the position in an index and can thus change + when other documents are inserted or deleted, + or if a MultiSearcher is used. + +

      + WARNING: The status of the Search.Function package is experimental. + The APIs introduced here might change in the future and will not be + supported anymore in such a case. + +

      NOTE: with the switch in 2.9 to segment-based + searching, if is invoked with a + composite (multi-segment) reader, this can easily cause + double RAM usage for the values in the FieldCache. It's + best to switch your application to pass only atomic + (single segment) readers to this API. Alternatively, for + a short-term fix, you could wrap your ValueSource using + , which costs more CPU per lookup + but will not consume double the FieldCache RAM.

      +

      +
      + + Constructor for a certain field. + field whose values order is used. + + + + Expert: Collects sorted results from Searchable's and collates them. + The elements put into this queue must be of type FieldDoc. + +

      Created: Feb 11, 2004 2:04:21 PM + +

      + lucene 1.4 + + $Id: FieldDocSortedHitQueue.java 695514 2008-09-15 15:42:11Z otis $ + +
      + + Creates a hit queue sorted by the given list of fields. + Fieldable names, in priority order (highest priority first). + + The number of hits to retain. Must be greater than zero. + + + + Allows redefinition of sort fields if they are null. + This is to handle the case using ParallelMultiSearcher where the + original list contains AUTO and we don't know the actual sort + type until the values come back. The fields can only be set once. + This method is thread safe. + + + + + + Returns the fields being used to sort. + + + Returns an array of collators, possibly null. The collators + correspond to any SortFields which were given a specific locale. + + Array of sort fields. + + Array, possibly null. + + + + Returns whether a is less relevant than b. + ScoreDoc + + ScoreDoc + + true if document a should be sorted after document b. + + + + A range query that returns a constant score equal to its boost for + all documents in the exclusive range of terms. + +

      It does not have an upper bound on the number of clauses covered in the range. + +

      This query matches the documents looking for terms that fall into the + supplied range according to . It is not intended + for numerical ranges, use instead. + +

      This query is hardwired to . + If you want to change this, use instead. + +

      + Use for term ranges or + for numeric ranges instead. + This class will be removed in Lucene 3.0. + + $Id: ConstantScoreRangeQuery.java 797694 2009-07-25 00:03:33Z mikemccand $ + +
      + + Changes of mode are not supported by this class (fixed to constant score rewrite mode) + + + This exception is thrown when parse errors are encountered. + You can explicitly create objects of this exception type by + calling the method generateParseException in the generated + parser. + + You can modify this class to customize your error reporting + mechanisms so long as you retain the public fields. + + + + This constructor is used by the method "generateParseException" + in the generated parser. Calling this constructor generates + a new object of this type with the fields "currentToken", + "expectedTokenSequences", and "tokenImage" set. The boolean + flag "specialConstructor" is also set to true to indicate that + this constructor was used to create this object. + This constructor calls its super class with the empty string + to force the "toString" method of parent class "Throwable" to + print the error message in the form: + ParseException: <result of getMessage> + + + + The following constructors are for use by you for whatever + purpose you can think of. Constructing the exception in this + manner makes the exception behave in the normal way - i.e., as + documented in the class "Throwable". The fields "errorToken", + "expectedTokenSequences", and "tokenImage" do not contain + relevant information. The JavaCC generated code does not use + these constructors. + + + + Constructor with message. + + + Constructor with message. + + + This variable determines which constructor was used to create + this object and thereby affects the semantics of the + "getMessage" method (see below). + + + + This is the last token that has been consumed successfully. If + this object has been created due to a parse error, the token + followng this token will (therefore) be the first error token. + + + + Each entry in this array is an array of integers. Each array + of integers represents a sequence of tokens (by their ordinal + values) that is expected at this point of the parse. + + + + This is a reference to the "tokenImage" array of the generated + parser within which the parse error occurred. This array is + defined in the generated ...Constants interface. + + + + The end of line string for this machine. + + + Used to convert raw characters to their escaped version + when these raw version cannot be used as part of an ASCII + string literal. + + + + This method has the standard behavior when this object has been + created using the standard constructors. Otherwise, it uses + "currentToken" and "expectedTokenSequences" to generate a parse + error message and returns it. If this object has been created + due to a parse error, and you do not catch it (it gets thrown + from the parser), then this method is called during the printing + of the final stack trace, and hence the correct error message + gets displayed. + + + + Taps into DocInverter, as an InvertedDocEndConsumer, + which is called at the end of inverting each field. We + just look at the length for the field (docState.length) + and record the norm. + + + + Used by DocumentsWriter to merge the postings from + multiple ThreadStates when creating a segment + + + + Simple utility class providing static methods to + compress and decompress binary data for stored fields. + This class uses java.util.zip.Deflater and Inflater + classes to compress and decompress, which is the same + format previously used by the now deprecated + Field.Store.COMPRESS. + + + + Compresses the specified byte range using the + specified compressionLevel (constants are defined in + java.util.zip.Deflater). + + + + Compresses the specified byte range, with default BEST_COMPRESSION level + + + Compresses all bytes in the array, with default BEST_COMPRESSION level + + + Compresses the String value, with default BEST_COMPRESSION level + + + Compresses the String value using the specified + compressionLevel (constants are defined in + java.util.zip.Deflater). + + + + Decompress the byte array previously returned by + compress + + + + Decompress the byte array previously returned by + compressString back into a String + + + + Filters with and + . + + +

      + You must specify the required compatibility when creating + StopAnalyzer: + + As of 2.9, position increments are preserved + +

      +
      + + An array containing some common English words that are not usually useful + for searching. + + Use instead + + + + An unmodifiable set containing some common English words that are not usually useful + for searching. + + + + Builds an analyzer which removes words in + ENGLISH_STOP_WORDS. + + Use instead + + + + Builds an analyzer which removes words in ENGLISH_STOP_WORDS. + + + Builds an analyzer which removes words in + ENGLISH_STOP_WORDS. + + + See + + Use instead + + + + Builds an analyzer with the stop words from the given set. + Use instead + + + + Builds an analyzer with the stop words from the given set. + + + Builds an analyzer with the stop words from the given set. + Set of stop words + + + See + + Use instead + + + + Builds an analyzer which removes words in the provided array. + Use instead + + Use instead + + + + Builds an analyzer which removes words in the provided array. + Array of stop words + + + See + + Use instead + + + + Builds an analyzer with the stop words from the given file. + + + Use instead + + + + Builds an analyzer with the stop words from the given file. + + + File to load stop words from + + + See + + Use instead + + + + Builds an analyzer with the stop words from the given file. + + + + + See above + + File to load stop words from + + + + Builds an analyzer with the stop words from the given reader. + + + Use instead + + + + Builds an analyzer with the stop words from the given reader. + + + Reader to load stop words from + + + See + + Use instead + + + + Builds an analyzer with the stop words from the given reader. + + + See above + + Reader to load stop words from + + + + Filters LowerCaseTokenizer with StopFilter. + + + Filters LowerCaseTokenizer with StopFilter. + + + Use this to disable locking entirely. + This LockFactory is used when you call . + Only one instance of this lock is created. You should call + to get the instance. + + + + + + + Simple standalone tool that forever acquires & releases a + lock using a specific LockFactory. Run without any args + to see usage. + + + + + + + + + This exception is thrown when the write.lock + could not be released. + + + + + + Score a candidate doc for all slop-valid position-combinations (matches) + encountered while traversing/hopping the PhrasePositions. +
      The score contribution of a match depends on the distance: +
      - highest score for distance=0 (exact match). +
      - score gets lower as distance gets higher. +
      Example: for query "a b"~2, a document "x a b a y" can be scored twice: + once for "a b" (distance=0), and once for "b a" (distance=2). +
      Possibly not all valid combinations are encountered, because for efficiency + we always propagate the least PhrasePosition. This allows to base on + PriorityQueue and move forward faster. + As result, for example, document "a b c b a" + would score differently for queries "a b c"~4 and "c b a"~4, although + they really are equivalent. + Similarly, for doc "a b c b a f g", query "c b"~2 + would get same score as "g f"~2, although "c b"~2 could be matched twice. + We may want to fix this in the future (currently not, for performance reasons). +
      +
      + + Init PhrasePositions in place. + There is a one time initialization for this scorer: +
      - Put in repeats[] each pp that has another pp with same position in the doc. +
      - Also mark each such pp by pp.repeats = true. +
      Later can consult with repeats[] in termPositionsDiffer(pp), making that check efficient. + In particular, this allows to score queries with no repetitions with no overhead due to this computation. +
      - Example 1 - query with no repetitions: "ho my"~2 +
      - Example 2 - query with repetitions: "ho my my"~2 +
      - Example 3 - query with repetitions: "my ho my"~2 +
      Init per doc w/repeats in query, includes propagating some repeating pp's to avoid false phrase detection. +
      + end (max position), or -1 if any term ran out (i.e. done) + + IOException +
      + + We disallow two pp's to have the same TermPosition, thereby verifying multiple occurrences + in the query of the same word would go elsewhere in the matched doc. + + null if differ (i.e. valid) otherwise return the higher offset PhrasePositions + out of the first two PPs found to not differ. + + + + Implements parallel search over a set of Searchables. + +

      Applications usually need only call the inherited + or methods. +

      +
      + + Creates a searchable which searches searchables. + + + TODO: parallelize this one too + + + A search implementation which spans a new thread for each + Searchable, waits for each search to complete and merge + the results back together. + + + + A search implementation allowing sorting which spans a new thread for each + Searchable, waits for each search to complete and merges + the results back together. + + + + Lower-level search API. + +

      is called for every matching document. + +

      Applications should only use this if they need all of the + matching documents. The high-level search API () + is usually more efficient, as it skips + non-high-scoring hits. + +

      + to match documents + + if non-null, a bitset used to eliminate some documents + + to receive hits + + TODO: parallelize this one too + +
      + + + TODO: this one could be parallelized too + + + + + A thread subclass for searching a single searchable + + + Wrapper used by to provide a lazily loaded hit + from . + + + Use and instead. Hits will be removed in Lucene 3.0. + + + + Constructed from + Hits returned from a search + + Hit index in Hits + + + + Returns document for this hit. + + + + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Returns score for this hit. + + + + + + + Returns id for this hit. + + + + + + + Returns the boost factor for this hit on any field of the underlying document. + + + + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Returns the string value of the field with the given name if any exist in + this document, or null. If multiple fields exist with this name, this + method returns the first value added. If only binary fields with this name + exist, returns null. + + + + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Prints the parameters to be used to discover the promised result. + + + use instead. + + + + use instead. + + + + use instead. + + + + use instead. + + + + use instead. + + + + use instead. + + + + use instead. + + + + use instead. + + + + A simple hash table of document scores within a range. + + + Lucene's package information, including version. * + + + A Term represents a word from text. This is the unit of search. It is + composed of two elements, the text of the word, as a string, and the name of + the field that the text occured in, an interned string. + Note that terms may represent more than words from text fields, but also + things like dates, email addresses, urls, etc. + + + + Constructs a Term with the given field and text. +

      Note that a null field or null text value results in undefined + behavior for most Lucene APIs that accept a Term parameter. +

      +
      + + Constructs a Term with the given field and empty text. + This serves two purposes: 1) reuse of a Term with the same field. + 2) pattern for a query. + + + + + + + Returns the field of this term, an interned string. The field indicates + the part of a document which this term came from. + + + + Returns the text of this term. In the case of words, this is simply the + text of the word. In the case of dates and other types, this is an + encoding of the object as a string. + + + + Optimized construction of new Terms by reusing same field as this Term + - avoids field.intern() overhead + + The text of the new term (field is implicitly same as this Term instance) + + A new Term + + + + Compares two terms, returning a negative integer if this + term belongs before the argument, zero if this term is equal to the + argument, and a positive integer if this term belongs after the argument. + The ordering of terms is first by field, then by text. + + + + Resets the field and text of a Term. + + + Called by super.skipTo(). + + + This implementation that + keeps only the most recent commit and immediately removes + all prior commits after a new commit is done. This is + the default deletion policy. + + + + Deletes all commits except the most recent one. + + + Deletes all commits except the most recent one. + + + + This class keeps track of each SegmentInfos instance that + is still "live", either because it corresponds to a + segments_N file in the Directory (a "commit", i.e. a + committed SegmentInfos) or because it's an in-memory + SegmentInfos that a writer is actively updating but has + not yet committed. This class uses simple reference + counting to map the live SegmentInfos instances to + individual files in the Directory. + + When autoCommit=true, IndexWriter currently commits only + on completion of a merge (though this may change with + time: it is not a guarantee). When autoCommit=false, + IndexWriter only commits when it is closed. Regardless + of autoCommit, the user may call IndexWriter.commit() to + force a blocking commit. + + The same directory file may be referenced by more than + one IndexCommit, i.e. more than one SegmentInfos. + Therefore we count how many commits reference each file. + When all the commits referencing a certain file have been + deleted, the refcount for that file becomes zero, and the + file is deleted. + + A separate deletion policy interface + (IndexDeletionPolicy) is consulted on creation (onInit) + and once per commit (onCommit), to decide when a commit + should be removed. + + It is the business of the IndexDeletionPolicy to choose + when to delete commit points. The actual mechanics of + file deletion, retrying, etc, derived from the deletion + of commit points is the business of the IndexFileDeleter. + + The current default deletion policy is + , which removes all + prior commits when a new commit has completed. This + matches the behavior before 2.2. + + Note that you must hold the write.lock before + instantiating this class. It opens segments_N file(s) + directly with no retry logic. + + + + because they are open and we are running on Windows), + so we will retry them again later: //// + + + Counts how many existing commits reference a file. + Maps String to RefCount (class below) instances: //// + + + This will have just 1 commit if you are using the + default delete policy (KeepOnlyLastCommitDeletionPolicy). + Other policies may leave commit points live for longer + in which case this list would be longer than 1: //// + + + non-commit checkpoint: //// + + + Change to true to see details of reference counts when + infoStream != null + + + + Initialize the deleter: find all previous commits in + the Directory, incref the files they reference, call + the policy to let it delete commits. This will remove + any files not referenced by any of the commits. + + CorruptIndexException if the index is corrupt + IOException if there is a low-level IO error + + + Remove the CommitPoints in the commitsToDelete List by + DecRef'ing all files from each SegmentInfos. + + + + Writer calls this when it has hit an error and had to + roll back, to tell us that there may now be + unreferenced files in the filesystem. So we re-list + the filesystem and delete such files. If segmentName + is non-null, we will only delete files corresponding to + that segment. + + + + For definition of "check point" see IndexWriter comments: + "Clarification: Check Points (and commits)". + + Writer calls this when it has made a "consistent + change" to the index, meaning new files are written to + the index and the in-memory SegmentInfos have been + modified to point to those files. + + This may or may not be a commit (segments_N may or may + not have been written). + + We simply incref the files referenced by the new + SegmentInfos and decref the files we had previously + seen (if any). + + If this is a commit, we also call the policy to give it + a chance to remove other commits. If any commits are + removed, we decref their files as well. + + + + Deletes the specified files, but only if they are new + (have not yet been incref'd). + + + + Tracks the reference count for a single index file: + + + Holds details for each commit point. This class is + also passed to the deletion policy. Note: this class + has a natural ordering that is inconsistent with + equals. + + + + Called only be the deletion policy, to remove this + commit point from the index. + + + + Adds a new term in this field + + + Called when we are done adding terms to this field + + + For each Field, store a sorted collection of s +

      + This is not thread-safe. +

      +
      + + + A Comparator for sorting s + + + + Get the mapping between fields and terms, sorted by the comparator + + + A map between field names and s per field. SortedSet entries are + + + + Access to the Fieldable Info file that describes document fields and whether or + not they are indexed. Each segment has a separate Fieldable Info file. Objects + of this class are thread-safe for multiple readers, but only one thread can + be adding documents at a time, with no other reader or writer threads + accessing this object. + + + + Construct a FieldInfos object using the directory and the name of the file + IndexInput + + The directory to open the IndexInput from + + The name of the file to open the IndexInput from in the Directory + + IOException + + + Returns a deep clone of this FieldInfos instance. + + + Adds field info for a Document. + + + Returns true if any fields do not omitTermFreqAndPositions + + + Add fields that are indexed. Whether they have termvectors has to be specified. + + + The names of the fields + + Whether the fields store term vectors or not + + true if positions should be stored. + + true if offsets should be stored + + + + Assumes the fields are not storing term vectors. + + + The names of the fields + + Whether the fields are indexed or not + + + + + + + Calls 5 parameter add with false for all TermVector parameters. + + + The name of the Fieldable + + true if the field is indexed + + + + + + Calls 5 parameter add with false for term vector positions and offsets. + + + The name of the field + + true if the field is indexed + + true if the term vector should be stored + + + + If the field is not yet known, adds it. If it is known, checks to make + sure that the isIndexed flag is the same as was given previously for this + field. If not - marks it as being indexed. Same goes for the TermVector + parameters. + + + The name of the field + + true if the field is indexed + + true if the term vector should be stored + + true if the term vector with positions should be stored + + true if the term vector with offsets should be stored + + + + If the field is not yet known, adds it. If it is known, checks to make + sure that the isIndexed flag is the same as was given previously for this + field. If not - marks it as being indexed. Same goes for the TermVector + parameters. + + + The name of the field + + true if the field is indexed + + true if the term vector should be stored + + true if the term vector with positions should be stored + + true if the term vector with offsets should be stored + + true if the norms for the indexed field should be omitted + + + + If the field is not yet known, adds it. If it is known, checks to make + sure that the isIndexed flag is the same as was given previously for this + field. If not - marks it as being indexed. Same goes for the TermVector + parameters. + + + The name of the field + + true if the field is indexed + + true if the term vector should be stored + + true if the term vector with positions should be stored + + true if the term vector with offsets should be stored + + true if the norms for the indexed field should be omitted + + true if payloads should be stored for this field + + true if term freqs should be omitted for this field + + + + Return the fieldName identified by its number. + + + + + the fieldName or an empty string when the field + with the given number doesn't exist. + + + + Return the fieldinfo object referenced by the fieldNumber. + + + the FieldInfo object or null when the given fieldNumber + doesn't exist. + + + + Class to write byte streams into slices of shared + byte[]. This is used by DocumentsWriter to hold the + posting list for many terms in RAM. + + + + Set up the writer to write at address. + + + Write byte into byte slice stream + + + A based on a Map of field names to s + + + + + Create a a MapFieldSelector + maps from field names (String) to s + + + + Create a a MapFieldSelector + fields to LOAD. List of Strings. All other fields are NO_LOAD. + + + + Create a a MapFieldSelector + fields to LOAD. All other fields are NO_LOAD. + + + + Load field according to its associated value in fieldSelections + a field name + + the fieldSelections value that field maps to or NO_LOAD if none. + + + + A WhitespaceTokenizer is a tokenizer that divides text at whitespace. + Adjacent sequences of non-Whitespace characters form tokens. + + + + Construct a new WhitespaceTokenizer. + + + Construct a new WhitespaceTokenizer using a given . + + + Construct a new WhitespaceTokenizer using a given . + + + Collects only characters which do not satisfy + . + + + + This class wraps a Token and supplies a single attribute instance + where the delegate token can be replaced. + + Will be removed, when old TokenStream API is removed. + + + + This class is a scanner generated by + JFlex 1.4.1 + on 9/4/08 6:49 PM from the specification file + /tango/mike/src/lucene.standarddigit/src/java/org/apache/lucene/analysis/standard/StandardTokenizerImpl.jflex + + + + This character denotes the end of file + + + initial size of the lookahead buffer + + + lexical states + + + Translates characters to character classes + + + Translates characters to character classes + + + Translates DFA states to action switch labels. + + + Translates a state to a row index in the transition table + + + The transition table of the DFA + + + ZZ_ATTRIBUTE[aState] contains the attributes of state aState + + + the input device + + + the current state of the DFA + + + the current lexical state + + + this buffer contains the current text to be matched and is + the source of the yytext() string + + + + the textposition at the last accepting state + + + the textposition at the last state to be included in yytext + + + the current text position in the buffer + + + startRead marks the beginning of the yytext() string in the buffer + + + endRead marks the last character in the buffer, that has been read + from input + + + + number of newlines encountered up to the start of the matched text + + + the number of characters up to the start of the matched text + + + the number of characters from the last newline up to the start of the + matched text + + + + zzAtBOL == true <=> the scanner is currently at the beginning of a line + + + zzAtEOF == true <=> the scanner is at the EOF + + + this solves a bug where HOSTs that end with '.' are identified + as ACRONYMs. It is deprecated and will be removed in the next + release. + + + + Resets the Tokenizer to a new Reader. + + + Fills Lucene token with the current token text. + + + Fills TermAttribute with the current token text. + + + Creates a new scanner + There is also a java.io.InputStream version of this constructor. + + + the java.io.Reader to read input from. + + + + Creates a new scanner. + There is also java.io.Reader version of this constructor. + + + the java.io.Inputstream to read input from. + + + + Unpacks the compressed character translation table. + + + the packed character translation table + + the unpacked character translation table + + + + Refills the input buffer. + + false, iff there was new input. + + + if any I/O-Error occurs + + + + Closes the input stream. + + + Resets the scanner to read from a new input stream. + Does not close the old reader. + + All internal variables are reset, the old input stream + cannot be reused (internal buffer is discarded and lost). + Lexical state is set to ZZ_INITIAL. + + + the new input stream + + + + Returns the current lexical state. + + + Enters a new lexical state + + + the new lexical state + + + + Returns the text matched by the current regular expression. + + + Returns the character at position pos from the + matched text. + + It is equivalent to yytext().charAt(pos), but faster + + + the position of the character to fetch. + A value from 0 to yylength()-1. + + + the character at position pos + + + + Returns the length of the matched text region. + + + Reports an error that occured while scanning. + + In a wellformed scanner (no or only correct usage of + yypushback(int) and a match-all fallback rule) this method + will only be called with things that "Can't Possibly Happen". + If this method is called, something is seriously wrong + (e.g. a JFlex bug producing a faulty scanner etc.). + + Usual syntax/scanner level error handling should be done + in error fallback rules. + + + the code of the errormessage to display + + + + Pushes the specified amount of characters back into the input stream. + + They will be read again by then next call of the scanning method + + + the number of characters to be read again. + This number must not be greater than yylength()! + + + + Resumes scanning until the next regular expression is matched, + the end of input is encountered or an I/O-Error occurs. + + + the next token + + if any I/O-Error occurs + + +
      +
      diff --git a/lib/moq/Moq.xml b/lib/moq/Moq.xml index eb0fb187230..87e5849d08a 100644 --- a/lib/moq/Moq.xml +++ b/lib/moq/Moq.xml @@ -1,3314 +1,3314 @@ - - - - Moq - - - - - A that returns an empty default value - for invocations that do not have setups or return values, with loose mocks. - This is the default behavior for a mock. - - - - - Interface to be implemented by classes that determine the - default value of non-expected invocations. - - - - - Provides a value for the given member and arguments. - - The member to provide a default - value for. - - - - Implements the fluent API. - - - - - Defines the Callback verb and overloads. - - - - - Helper interface used to hide the base - members from the fluent API to make it much cleaner - in Visual Studio intellisense. - - - - - - - - - - - - - - - - - Specifies a callback to invoke when the method is called. - - Callback method to invoke. - - The following example specifies a callback to set a boolean - value that can be used later: - - bool called = false; - mock.Setup(x => x.Execute()) - .Callback(() => called = true); - - - - - - Specifies a callback to invoke when the method is called that receives the original - arguments. - - Argument type of the invoked method. - Callback method to invoke. - - Invokes the given callback with the concrete invocation argument value. - - Notice how the specific string argument is retrieved by simply declaring - it as part of the lambda expression for the callback: - - - mock.Setup(x => x.Execute(It.IsAny<string>())) - .Callback((string command) => Console.WriteLine(command)); - - - - - - Specifies a callback to invoke when the method is called that receives the original - arguments. - - Type of the first argument of the invoked method. - Type of the second argument of the invoked method. - Callback method to invoke. - - Invokes the given callback with the concrete invocation arguments values. - - Notice how the specific arguments are retrieved by simply declaring - them as part of the lambda expression for the callback: - - - mock.Setup(x => x.Execute( - It.IsAny<string>(), - It.IsAny<string>())) - .Callback((string arg1, string arg2) => Console.WriteLine(arg1 + arg2)); - - - - - - Specifies a callback to invoke when the method is called that receives the original - arguments. - - Type of the first argument of the invoked method. - Type of the second argument of the invoked method. - Type of the third argument of the invoked method. - Callback method to invoke. - - Invokes the given callback with the concrete invocation arguments values. - - Notice how the specific arguments are retrieved by simply declaring - them as part of the lambda expression for the callback: - - - mock.Setup(x => x.Execute( - It.IsAny<string>(), - It.IsAny<string>(), - It.IsAny<int>())) - .Callback((string arg1, string arg2, int arg3) => Console.WriteLine(arg1 + arg2 + arg3)); - - - - - - Specifies a callback to invoke when the method is called that receives the original - arguments. - - Type of the first argument of the invoked method. - Type of the second argument of the invoked method. - Type of the third argument of the invoked method. - Type of the fourth argument of the invoked method. - Callback method to invoke. - - Invokes the given callback with the concrete invocation arguments values. - - Notice how the specific arguments are retrieved by simply declaring - them as part of the lambda expression for the callback: - - - mock.Setup(x => x.Execute( - It.IsAny<string>(), - It.IsAny<string>(), - It.IsAny<int>(), - It.IsAny<bool>())) - .Callback((string arg1, string arg2, int arg3, bool arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4)); - - - - - - Defines occurrence members to constraint setups. - - - - - The expected invocation can happen at most once. - - - - var mock = new Mock<ICommand>(); - mock.Setup(foo => foo.Execute("ping")) - .AtMostOnce(); - - - - - - The expected invocation can happen at most specified number of times. - - The number of times to accept calls. - - - var mock = new Mock<ICommand>(); - mock.Setup(foo => foo.Execute("ping")) - .AtMost( 5 ); - - - - - - Defines the Raises verb. - - - - - Specifies the event that will be raised - when the setup is met. - - An expression that represents an event attach or detach action. - The event arguments to pass for the raised event. - - The following example shows how to raise an event when - the setup is met: - - var mock = new Mock<IContainer>(); - - mock.Setup(add => add.Add(It.IsAny<string>(), It.IsAny<object>())) - .Raises(add => add.Added += null, EventArgs.Empty); - - - - - - Specifies the event that will be raised - when the setup is matched. - - An expression that represents an event attach or detach action. - A function that will build the - to pass when raising the event. - - - - - Specifies the event that will be raised - when the setup is matched. - - An expression that represents an event attach or detach action. - A function that will build the - to pass when raising the event. - Type of the argument received by the expected invocation. - - - - - Specifies the event that will be raised - when the setup is matched. - - An expression that represents an event attach or detach action. - A function that will build the - to pass when raising the event. - Type of the first argument received by the expected invocation. - Type of the second argument received by the expected invocation. - - - - - Specifies the event that will be raised - when the setup is matched. - - An expression that represents an event attach or detach action. - A function that will build the - to pass when raising the event. - Type of the first argument received by the expected invocation. - Type of the second argument received by the expected invocation. - Type of the third argument received by the expected invocation. - - - - - Specifies the event that will be raised - when the setup is matched. - - An expression that represents an event attach or detach action. - A function that will build the - to pass when raising the event. - Type of the first argument received by the expected invocation. - Type of the second argument received by the expected invocation. - Type of the third argument received by the expected invocation. - Type of the fourth argument received by the expected invocation. - - - - - Specifies the custom event that will be raised - when the setup is matched. - - An expression that represents an event attach or detach action. - The arguments to pass to the custom delegate (non EventHandler-compatible). - - - - Defines the Raises verb. - - - - - Specifies the mocked event that will be raised - when the setup is met. - - The mocked event, retrieved from - or . - - The event args to pass when raising the event. - - The following example shows how to raise an event when - the setup is met: - - var mock = new Mock<IContainer>(); - // create handler to associate with the event to raise - var handler = mock.CreateEventHandler(); - // associate the handler with the event to raise - mock.Object.Added += handler; - // setup the invocation and the handler to raise - mock.Setup(add => add.Add(It.IsAny<string>(), It.IsAny<object>())) - .Raises(handler, EventArgs.Empty); - - - - - - Specifies the mocked event that will be raised - when the setup is matched. - - The mocked event, retrieved from - or . - - A function that will build the - to pass when raising the event. - - - - - Specifies the mocked event that will be raised - when the setup is matched. - - The mocked event, retrieved from - or . - - A function that will build the - to pass when raising the event. - Type of the argument received by the expected invocation. - - - - - Specifies the mocked event that will be raised - when the setup is matched. - - The mocked event, retrieved from - or . - - A function that will build the - to pass when raising the event. - Type of the first argument received by the expected invocation. - Type of the second argument received by the expected invocation. - - - - - Specifies the mocked event that will be raised - when the setup is matched. - - The mocked event, retrieved from - or . - - A function that will build the - to pass when raising the event. - Type of the first argument received by the expected invocation. - Type of the second argument received by the expected invocation. - Type of the third argument received by the expected invocation. - - - - - Specifies the mocked event that will be raised - when the setup is matched. - - The mocked event, retrieved from - or . - - A function that will build the - to pass when raising the event. - Type of the first argument received by the expected invocation. - Type of the second argument received by the expected invocation. - Type of the third argument received by the expected invocation. - Type of the fourth argument received by the expected invocation. - - - - - Defines the Verifiable verb. - - - - - Marks the expectation as verifiable, meaning that a call - to will check if this particular - expectation was met. - - - The following example marks the expectation as verifiable: - - mock.Expect(x => x.Execute("ping")) - .Returns(true) - .Verifiable(); - - - - - - Marks the expectation as verifiable, meaning that a call - to will check if this particular - expectation was met, and specifies a message for failures. - - - The following example marks the expectation as verifiable: - - mock.Expect(x => x.Execute("ping")) - .Returns(true) - .Verifiable("Ping should be executed always!"); - - - - - - Marks a method as a matcher, which allows complete replacement - of the built-in class with your own argument - matching rules. - - - This feature has been deprecated in favor of the new - and simpler . - - - The argument matching is used to determine whether a concrete - invocation in the mock matches a given setup. This - matching mechanism is fully extensible. - - - There are two parts of a matcher: the compiler matcher - and the runtime matcher. - - - Compiler matcher - Used to satisfy the compiler requirements for the - argument. Needs to be a method optionally receiving any arguments - you might need for the matching, but with a return type that - matches that of the argument. - - Let's say I want to match a lists of orders that contains - a particular one. I might create a compiler matcher like the following: - - - public static class Orders - { - [Matcher] - public static IEnumerable<Order> Contains(Order order) - { - return null; - } - } - - Now we can invoke this static method instead of an argument in an - invocation: - - var order = new Order { ... }; - var mock = new Mock<IRepository<Order>>(); - - mock.Setup(x => x.Save(Orders.Contains(order))) - .Throws<ArgumentException>(); - - Note that the return value from the compiler matcher is irrelevant. - This method will never be called, and is just used to satisfy the - compiler and to signal Moq that this is not a method that we want - to be invoked at runtime. - - - - Runtime matcher - - The runtime matcher is the one that will actually perform evaluation - when the test is run, and is defined by convention to have the - same signature as the compiler matcher, but where the return - value is the first argument to the call, which contains the - object received by the actual invocation at runtime: - - public static bool Contains(IEnumerable<Order> orders, Order order) - { - return orders.Contains(order); - } - - At runtime, the mocked method will be invoked with a specific - list of orders. This value will be passed to this runtime - matcher as the first argument, while the second argument is the - one specified in the setup (x.Save(Orders.Contains(order))). - - The boolean returned determines whether the given argument has been - matched. If all arguments to the expected method are matched, then - the setup matches and is evaluated. - - - - - - Using this extensible infrastructure, you can easily replace the entire - set of matchers with your own. You can also avoid the - typical (and annoying) lengthy expressions that result when you have - multiple arguments that use generics. - - - The following is the complete example explained above: - - public static class Orders - { - [Matcher] - public static IEnumerable<Order> Contains(Order order) - { - return null; - } - - public static bool Contains(IEnumerable<Order> orders, Order order) - { - return orders.Contains(order); - } - } - - And the concrete test using this matcher: - - var order = new Order { ... }; - var mock = new Mock<IRepository<Order>>(); - - mock.Setup(x => x.Save(Orders.Contains(order))) - .Throws<ArgumentException>(); - - // use mock, invoke Save, and have the matcher filter. - - - - - - Casts the expression to a lambda expression, removing - a cast if there's any. - - - - - Casts the body of the lambda expression to a . - - If the body is not a method call. - - - - Converts the body of the lambda expression into the referenced by it. - - - - - Checks whether the body of the lambda expression is a property access. - - - - - Checks whether the expression is a property access. - - - - - Checks whether the body of the lambda expression is a property indexer, which is true - when the expression is an whose - has - equal to . - - - - - Checks whether the expression is a property indexer, which is true - when the expression is an whose - has - equal to . - - - - - Creates an expression that casts the given expression to the - type. - - - - - TODO: remove this code when https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=331583 - is fixed. - - - - - Provides partial evaluation of subtrees, whenever they can be evaluated locally. - - Matt Warren: http://blogs.msdn.com/mattwar - Documented by InSTEDD: http://www.instedd.org - - - - Performs evaluation and replacement of independent sub-trees - - The root of the expression tree. - A function that decides whether a given expression - node can be part of the local function. - A new tree with sub-trees evaluated and replaced. - - - - Performs evaluation and replacement of independent sub-trees - - The root of the expression tree. - A new tree with sub-trees evaluated and replaced. - - - - Evaluates and replaces sub-trees when first candidate is reached (top-down) - - - - - Performs bottom-up analysis to determine which nodes can possibly - be part of an evaluated sub-tree. - - - - - Checks an argument to ensure it isn't null. - - The argument value to check. - The name of the argument. - - - - Checks a string argument to ensure it isn't null or empty. - - The argument value to check. - The name of the argument. - - - - Checks an argument to ensure it is in the specified range including the edges. - - Type of the argument to check, it must be an type. - - The argument value to check. - The minimun allowed value for the argument. - The maximun allowed value for the argument. - The name of the argument. - - - - Checks an argument to ensure it is in the specified range excluding the edges. - - Type of the argument to check, it must be an type. - - The argument value to check. - The minimun allowed value for the argument. - The maximun allowed value for the argument. - The name of the argument. - - - - Defines the Returns verb for property get setups. - - Mocked type. - Type of the property. - - - - Specifies the value to return. - - The value to return, or . - - Return a true value from the property getter call: - - mock.SetupGet(x => x.Suspended) - .Returns(true); - - - - - - Specifies a function that will calculate the value to return for the property. - - The function that will calculate the return value. - - Return a calculated value when the property is retrieved: - - mock.SetupGet(x => x.Suspended) - .Returns(() => returnValues[0]); - - The lambda expression to retrieve the return value is lazy-executed, - meaning that its value may change depending on the moment the property - is retrieved and the value the returnValues array has at - that moment. - - - - - Defines the Callback verb for property getter setups. - - - Mocked type. - Type of the property. - - - - Specifies a callback to invoke when the property is retrieved. - - Callback method to invoke. - - Invokes the given callback with the property value being set. - - mock.SetupGet(x => x.Suspended) - .Callback(() => called = true) - .Returns(true); - - - - - - Implements the fluent API. - - - - - Implements the fluent API. - - - - - Defines the Returns verb. - - Mocked type. - Type of the return value from the expression. - - - - Specifies the value to return. - - The value to return, or . - - Return a true value from the method call: - - mock.Setup(x => x.Execute("ping")) - .Returns(true); - - - - - - Specifies a function that will calculate the value to return from the method. - - The function that will calculate the return value. - - Return a calculated value when the method is called: - - mock.Setup(x => x.Execute("ping")) - .Returns(() => returnValues[0]); - - The lambda expression to retrieve the return value is lazy-executed, - meaning that its value may change depending on the moment the method - is executed and the value the returnValues array has at - that moment. - - - - - Specifies a function that will calculate the value to return from the method, - retrieving the arguments for the invocation. - - Type of the argument of the invoked method. - The function that will calculate the return value. - - Return a calculated value which is evaluated lazily at the time of the invocation. - - The lookup list can change between invocations and the setup - will return different values accordingly. Also, notice how the specific - string argument is retrieved by simply declaring it as part of the lambda - expression: - - - mock.Setup(x => x.Execute(It.IsAny<string>())) - .Returns((string command) => returnValues[command]); - - - - - - Specifies a function that will calculate the value to return from the method, - retrieving the arguments for the invocation. - - Type of the first argument of the invoked method. - Type of the second argument of the invoked method. - The function that will calculate the return value. - - Return a calculated value which is evaluated lazily at the time of the invocation. - - The return value is calculated from the value of the actual method invocation arguments. - Notice how the arguments are retrieved by simply declaring them as part of the lambda - expression: - - - mock.Setup(x => x.Execute( - It.IsAny<string>(), - It.IsAny<string>())) - .Returns((string arg1, string arg2) => arg1 + arg2); - - - - - - Specifies a function that will calculate the value to return from the method, - retrieving the arguments for the invocation. - - Type of the first argument of the invoked method. - Type of the second argument of the invoked method. - Type of the third argument of the invoked method. - The function that will calculate the return value. - - Return a calculated value which is evaluated lazily at the time of the invocation. - - The return value is calculated from the value of the actual method invocation arguments. - Notice how the arguments are retrieved by simply declaring them as part of the lambda - expression: - - - mock.Setup(x => x.Execute( - It.IsAny<string>(), - It.IsAny<string>(), - It.IsAny<int>())) - .Returns((string arg1, string arg2, int arg3) => arg1 + arg2 + arg3); - - - - - - Specifies a function that will calculate the value to return from the method, - retrieving the arguments for the invocation. - - Type of the first argument of the invoked method. - Type of the second argument of the invoked method. - Type of the third argument of the invoked method. - Type of the fourth argument of the invoked method. - The function that will calculate the return value. - - Return a calculated value which is evaluated lazily at the time of the invocation. - - The return value is calculated from the value of the actual method invocation arguments. - Notice how the arguments are retrieved by simply declaring them as part of the lambda - expression: - - - mock.Setup(x => x.Execute( - It.IsAny<string>(), - It.IsAny<string>(), - It.IsAny<int>(), - It.IsAny<bool>())) - .Returns((string arg1, string arg2, int arg3, bool arg4) => arg1 + arg2 + arg3 + arg4); - - - - - - Defines the Throws verb. - - - - - Specifies the exception to throw when the method is invoked. - - Exception instance to throw. - - This example shows how to throw an exception when the method is - invoked with an empty string argument: - - mock.Setup(x => x.Execute("")) - .Throws(new ArgumentException()); - - - - - - Specifies the type of exception to throw when the method is invoked. - - Type of exception to instantiate and throw when the setup is matched. - - This example shows how to throw an exception when the method is - invoked with an empty string argument: - - mock.Setup(x => x.Execute("")) - .Throws<ArgumentException>(); - - - - - - Implements the fluent API. - - - - - Implements the fluent API. - - - - - Defines the Callback verb and overloads for callbacks on - setups that return a value. - - Mocked type. - Type of the return value of the setup. - - - - Specifies a callback to invoke when the method is called. - - Callback method to invoke. - - The following example specifies a callback to set a boolean - value that can be used later: - - bool called = false; - mock.Setup(x => x.Execute()) - .Callback(() => called = true) - .Returns(true); - - Note that in the case of value-returning methods, after the Callback - call you can still specify the return value. - - - - - Specifies a callback to invoke when the method is called that receives the original - arguments. - - Type of the argument of the invoked method. - Callback method to invoke. - - Invokes the given callback with the concrete invocation argument value. - - Notice how the specific string argument is retrieved by simply declaring - it as part of the lambda expression for the callback: - - - mock.Setup(x => x.Execute(It.IsAny<string>())) - .Callback((string command) => Console.WriteLine(command)) - .Returns(true); - - - - - - Specifies a callback to invoke when the method is called that receives the original - arguments. - - Type of the first argument of the invoked method. - Type of the second argument of the invoked method. - Callback method to invoke. - - Invokes the given callback with the concrete invocation arguments values. - - Notice how the specific arguments are retrieved by simply declaring - them as part of the lambda expression for the callback: - - - mock.Setup(x => x.Execute( - It.IsAny<string>(), - It.IsAny<string>())) - .Callback((string arg1, string arg2) => Console.WriteLine(arg1 + arg2)) - .Returns(true); - - - - - - Specifies a callback to invoke when the method is called that receives the original - arguments. - - Type of the first argument of the invoked method. - Type of the second argument of the invoked method. - Type of the third argument of the invoked method. - Callback method to invoke. - - Invokes the given callback with the concrete invocation arguments values. - - Notice how the specific arguments are retrieved by simply declaring - them as part of the lambda expression for the callback: - - - mock.Setup(x => x.Execute( - It.IsAny<string>(), - It.IsAny<string>(), - It.IsAny<int>())) - .Callback((string arg1, string arg2, int arg3) => Console.WriteLine(arg1 + arg2 + arg3)) - .Returns(true); - - - - - - Specifies a callback to invoke when the method is called that receives the original - arguments. - - Type of the first argument of the invoked method. - Type of the second argument of the invoked method. - Type of the third argument of the invoked method. - Type of the fourth argument of the invoked method. - Callback method to invoke. - - Invokes the given callback with the concrete invocation arguments values. - - Notice how the specific arguments are retrieved by simply declaring - them as part of the lambda expression for the callback: - - - mock.Setup(x => x.Execute( - It.IsAny<string>(), - It.IsAny<string>(), - It.IsAny<int>(), - It.IsAny<bool>())) - .Callback((string arg1, string arg2, int arg3, bool arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4)) - .Returns(true); - - - - - - Implemented by all generated mock object instances. - - - - - Implemented by all generated mock object instances. - - - - - Reference the Mock that contains this as the mock.Object value. - - - - - Reference the Mock that contains this as the mock.Object value. - - - - - Implements the actual interception and method invocation for - all mocks. - - - - - Get an eventInfo for a given event name. Search type ancestors depth first if necessary. - - Name of the event, with the set_ or get_ prefix already removed - - - - Given a type return all of its ancestors, both types and interfaces. - - The type to find immediate ancestors of - - - - Implements the fluent API. - - - - - Defines the Never verb. - - - - - The expected invocation is never expected to happen. - - - - var mock = new Mock<ICommand>(); - mock.Setup(foo => foo.Execute("ping")) - .Never(); - - - - is always verified inmediately as - the invocations are performed, like strict mocks do - with unexpected invocations. - - - - - Implements the fluent API. - - - - - Implements the fluent API. - - - - - Implements the fluent API. - - - - - Defines the Callback verb for property setter setups. - - Type of the property. - - - - Specifies a callback to invoke when the property is set that receives the - property value being set. - - Callback method to invoke. - - Invokes the given callback with the property value being set. - - mock.SetupSet(x => x.Suspended) - .Callback((bool state) => Console.WriteLine(state)); - - - - - - Allows the specification of a matching condition for an - argument in a method invocation, rather than a specific - argument value. "It" refers to the argument being matched. - - This class allows the setup to match a method invocation - with an arbitrary value, with a value in a specified range, or - even one that matches a given predicate. - - - - - Matches any value of the given type. - - Typically used when the actual argument value for a method - call is not relevant. - - - // Throws an exception for a call to Remove with any string value. - mock.Setup(x => x.Remove(It.IsAny<string>())).Throws(new InvalidOperationException()); - - Type of the value. - - - - Matches any value that satisfies the given predicate. - Type of the argument to check.The predicate used to match the method argument. - Allows the specification of a predicate to perform matching - of method call arguments. - - This example shows how to return the value 1 whenever the argument to the - Do method is an even number. - - mock.Setup(x => x.Do(It.Is<int>(i => i % 2 == 0))) - .Returns(1); - - This example shows how to throw an exception if the argument to the - method is a negative number: - - mock.Setup(x => x.GetUser(It.Is<int>(i => i < 0))) - .Throws(new ArgumentException()); - - - - - - Matches any value that is in the range specified. - Type of the argument to check.The lower bound of the range.The upper bound of the range. - The kind of range. See . - - The following example shows how to expect a method call - with an integer argument within the 0..100 range. - - mock.Setup(x => x.HasInventory( - It.IsAny<string>(), - It.IsInRange(0, 100, Range.Inclusive))) - .Returns(false); - - - - - - Matches a string argument if it matches the given regular expression pattern. - The pattern to use to match the string argument value. - The following example shows how to expect a call to a method where the - string argument matches the given regular expression: - - mock.Setup(x => x.Check(It.IsRegex("[a-z]+"))).Returns(1); - - - - - - Matches a string argument if it matches the given regular expression pattern. - The pattern to use to match the string argument value.The options used to interpret the pattern. - The following example shows how to expect a call to a method where the - string argument matches the given regular expression, in a case insensitive way: - - mock.Setup(x => x.Check(It.IsRegex("[a-z]+", RegexOptions.IgnoreCase))).Returns(1); - - - - - - Matcher to treat static functions as matchers. - - mock.Setup(x => x.StringMethod(A.MagicString())); - - pbulic static class A - { - [Matcher] - public static string MagicString() { return null; } - public static bool MagicString(string arg) - { - return arg == "magic"; - } - } - - Will success if: mock.Object.StringMethod("magic"); - and fail with any other call. - - - - - We need this non-generics base class so that - we can use from - generic code. - - - - - Base class for mocks and static helper class with methods that - apply to mocked objects, such as to - retrieve a from an object instance. - - - - - Initializes a new instance of the class. - - - - - Retrieves the mock object for the given object instance. - - Type of the mock to retrieve. Can be omitted as it's inferred - from the object instance passed in as the instance. - The instance of the mocked object.The mock associated with the mocked object. - The received instance - was not created by Moq. - - The following example shows how to add a new setup to an object - instance which is not the original but rather - the object associated with it: - - // Typed instance, not the mock, is retrieved from some test API. - HttpContextBase context = GetMockContext(); - - // context.Request is the typed object from the "real" API - // so in order to add a setup to it, we need to get - // the mock that "owns" it - Mock<HttpRequestBase> request = Mock.Get(context.Request); - mock.Setup(req => req.AppRelativeCurrentExecutionFilePath) - .Returns(tempUrl); - - - - - - Returns the mocked object value. - - - - - Verifies that all verifiable expectations have been met. - - This example sets up an expectation and marks it as verifiable. After - the mock is used, a Verify() call is issued on the mock - to ensure the method in the setup was invoked: - - var mock = new Mock<IWarehouse>(); - this.Setup(x => x.HasInventory(TALISKER, 50)).Verifiable().Returns(true); - ... - // other test code - ... - // Will throw if the test code has didn't call HasInventory. - this.Verify(); - - Not all verifiable expectations were met. - - - - Verifies all expectations regardless of whether they have - been flagged as verifiable. - - This example sets up an expectation without marking it as verifiable. After - the mock is used, a call is issued on the mock - to ensure that all expectations are met: - - var mock = new Mock<IWarehouse>(); - this.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true); - ... - // other test code - ... - // Will throw if the test code has didn't call HasInventory, even - // that expectation was not marked as verifiable. - this.VerifyAll(); - - At least one expectation was not met. - - - - Gets the interceptor target for the given expression and root mock, - building the intermediate hierarchy of mock objects if necessary. - - - - - Creates a handler that can be associated to an event receiving - the given and can be used - to raise the event. - - Type of - data passed in to the event. - - This example shows how to invoke an event with a custom event arguments - class in a view that will cause its corresponding presenter to - react by changing its state: - - var mockView = new Mock<IOrdersView>(); - var mockedEvent = mockView.CreateEventHandler<OrderEventArgs>(); - - var presenter = new OrdersPresenter(mockView.Object); - - // Check that the presenter has no selection by default - Assert.Null(presenter.SelectedOrder); - - // Create a mock event handler of the appropriate type - var handler = mockView.CreateEventHandler<OrderEventArgs>(); - // Associate it with the event we want to raise - mockView.Object.Cancel += handler; - // Finally raise the event with a specific arguments data - handler.Raise(new OrderEventArgs { Order = new Order("moq", 500) }); - - // Now the presenter reacted to the event, and we have a selected order - Assert.NotNull(presenter.SelectedOrder); - Assert.Equal("moq", presenter.SelectedOrder.ProductName); - - - - - - Creates a handler that can be associated to an event receiving - a generic and can be used - to raise the event. - - This example shows how to invoke a generic event in a view that will - cause its corresponding presenter to react by changing its state: - - var mockView = new Mock<IOrdersView>(); - var mockedEvent = mockView.CreateEventHandler(); - - var presenter = new OrdersPresenter(mockView.Object); - - // Check that the presenter is not in the "Canceled" state - Assert.False(presenter.IsCanceled); - - // Create a mock event handler of the appropriate type - var handler = mockView.CreateEventHandler(); - // Associate it with the event we want to raise - mockView.Object.Cancel += handler; - // Finally raise the event - handler.Raise(EventArgs.Empty); - - // Now the presenter reacted to the event, and changed its state - Assert.True(presenter.IsCanceled); - - - - - - Adds an interface implementation to the mock, - allowing setups to be specified for it. - - This method can only be called before the first use - of the mock property, at which - point the runtime type has already been generated - and no more interfaces can be added to it. - - Also, must be an - interface and not a class, which must be specified - when creating the mock instead. - - - The mock type - has already been generated by accessing the property. - - The specified - is not an interface. - - The following example creates a mock for the main interface - and later adds to it to verify - it's called by the consumer code: - - var mock = new Mock<IProcessor>(); - mock.Setup(x => x.Execute("ping")); - - // add IDisposable interface - var disposable = mock.As<IDisposable>(); - disposable.Setup(d => d.Dispose()).Verifiable(); - - Type of interface to cast the mock to. - - - - Base class for mocks and static helper class with methods that - apply to mocked objects, such as to - retrieve a from an object instance. - - - - - Behavior of the mock, according to the value set in the constructor. - - - - - Whether the base member virtual implementation will be called - for mocked classes if no setup is matched. Defaults to . - - - - - Specifies the behavior to use when returning default values for - unexpected invocations on loose mocks. - - - - - Gets the mocked object instance, which is of the mocked type . - - - - - Retrieves the type of the mocked object, its generic type argument. - This is used in the auto-mocking of hierarchy access. - - - - - Specifies the class that will determine the default - value to return when invocations are made that - have no setups and need to return a default - value (for loose mocks). - - - - - Exposes the list of extra interfaces implemented by the mock. - - - - - Options to customize the behavior of the mock. - - - - - Causes the mock to always throw - an exception for invocations that don't have a - corresponding setup. - - - - - Will never throw exceptions, returning default - values when necessary (null for reference types, - zero for value types or empty enumerables and arrays). - - - - - Default mock behavior, which equals . - - - - - Represents a generic event that has been mocked and can - be rised. - - - - - Provided solely to allow the interceptor to determine when the attached - handler is coming from this mocked event so we can assign the - corresponding EventInfo for it. - - - - - Raises the associated event with the given - event argument data. - - - - - Raises the associated event with the given - event argument data. - - - - - Provides support for attaching a to - a generic event. - - Event to convert. - - - - Event raised whenever the mocked event is rised. - - - - - Exception thrown by mocks when setups are not matched, - the mock is not properly setup, etc. - - - A distinct exception type is provided so that exceptions - thrown by the mock can be differentiated in tests that - expect other exceptions to be thrown (i.e. ArgumentException). - - Richer exception hierarchy/types are not provided as - tests typically should not catch or expect exceptions - from the mocks. These are typically the result of changes - in the tested class or its collaborators implementation, and - result in fixes in the mock setup so that they dissapear and - allow the test to pass. - - - - - - Supports the serialization infrastructure. - - Serialization information. - Streaming context. - - - - Supports the serialization infrastructure. - - Serialization information. - Streaming context. - - - - Made internal as it's of no use for - consumers, but it's important for - our own tests. - - - - - Used by the mock factory to accumulate verification - failures. - - - - - Supports the serialization infrastructure. - - - - - Utility factory class to use to construct multiple - mocks when consistent verification is - desired for all of them. - - - If multiple mocks will be created during a test, passing - the desired (if different than the - or the one - passed to the factory constructor) and later verifying each - mock can become repetitive and tedious. - - This factory class helps in that scenario by providing a - simplified creation of multiple mocks with a default - (unless overriden by calling - ) and posterior verification. - - - - The following is a straightforward example on how to - create and automatically verify strict mocks using a : - - var factory = new MockFactory(MockBehavior.Strict); - - var foo = factory.Create<IFoo>(); - var bar = factory.Create<IBar>(); - - // no need to call Verifiable() on the setup - // as we'll be validating all of them anyway. - foo.Setup(f => f.Do()); - bar.Setup(b => b.Redo()); - - // exercise the mocks here - - factory.VerifyAll(); - // At this point all setups are already checked - // and an optional MockException might be thrown. - // Note also that because the mocks are strict, any invocation - // that doesn't have a matching setup will also throw a MockException. - - The following examples shows how to setup the factory - to create loose mocks and later verify only verifiable setups: - - var factory = new MockFactory(MockBehavior.Loose); - - var foo = factory.Create<IFoo>(); - var bar = factory.Create<IBar>(); - - // this setup will be verified when we verify the factory - foo.Setup(f => f.Do()).Verifiable(); - - // this setup will NOT be verified - foo.Setup(f => f.Calculate()); - - // this setup will be verified when we verify the factory - bar.Setup(b => b.Redo()).Verifiable(); - - // exercise the mocks here - // note that because the mocks are Loose, members - // called in the interfaces for which no matching - // setups exist will NOT throw exceptions, - // and will rather return default values. - - factory.Verify(); - // At this point verifiable setups are already checked - // and an optional MockException might be thrown. - - The following examples shows how to setup the factory with a - default strict behavior, overriding that default for a - specific mock: - - var factory = new MockFactory(MockBehavior.Strict); - - // this particular one we want loose - var foo = factory.Create<IFoo>(MockBehavior.Loose); - var bar = factory.Create<IBar>(); - - // specify setups - - // exercise the mocks here - - factory.Verify(); - - - - - - - Initializes the factory with the given - for newly created mocks from the factory. - - The behavior to use for mocks created - using the factory method if not overriden - by using the overload. - - - - Creates a new mock with the default - specified at factory construction time. - - Type to mock. - A new . - - - var factory = new MockFactory(MockBehavior.Strict); - - var foo = factory.Create<IFoo>(); - // use mock on tests - - factory.VerifyAll(); - - - - - - Creates a new mock with the default - specified at factory construction time and with the - the given constructor arguments for the class. - - - The mock will try to find the best match constructor given the - constructor arguments, and invoke that to initialize the instance. - This applies only to classes, not interfaces. - - Type to mock. - Constructor arguments for mocked classes. - A new . - - - var factory = new MockFactory(MockBehavior.Default); - - var mock = factory.Create<MyBase>("Foo", 25, true); - // use mock on tests - - factory.Verify(); - - - - - - Creates a new mock with the given . - - Type to mock. - Behavior to use for the mock, which overrides - the default behavior specified at factory construction time. - A new . - - The following example shows how to create a mock with a different - behavior to that specified as the default for the factory: - - var factory = new MockFactory(MockBehavior.Strict); - - var foo = factory.Create<IFoo>(MockBehavior.Loose); - - - - - - Creates a new mock with the given - and with the the given constructor arguments for the class. - - - The mock will try to find the best match constructor given the - constructor arguments, and invoke that to initialize the instance. - This applies only to classes, not interfaces. - - Type to mock. - Behavior to use for the mock, which overrides - the default behavior specified at factory construction time. - Constructor arguments for mocked classes. - A new . - - The following example shows how to create a mock with a different - behavior to that specified as the default for the factory, passing - constructor arguments: - - var factory = new MockFactory(MockBehavior.Default); - - var mock = factory.Create<MyBase>(MockBehavior.Strict, "Foo", 25, true); - - - - - - Implements creation of a new mock within the factory. - - Type to mock. - The behavior for the new mock. - Optional arguments for the construction of the mock. - - - - Verifies all verifiable expectations on all mocks created - by this factory. - - - One or more mocks had expectations that were not satisfied. - - - - Verifies all verifiable expectations on all mocks created - by this factory. - - - One or more mocks had expectations that were not satisfied. - - - - Invokes for each mock - in , and accumulates the resulting - that might be - thrown from the action. - - The action to execute against - each mock. - - - - Whether the base member virtual implementation will be called - for mocked classes if no setup is matched. Defaults to . - - - - - Specifies the behavior to use when returning default values for - unexpected invocations on loose mocks. - - - - - Gets the mocks that have been created by this factory and - that will get verified together. - - - - - A strongly-typed resource class, for looking up localized strings, etc. - - - - - Returns the cached ResourceManager instance used by this class. - - - - - Overrides the current thread's CurrentUICulture property for all - resource lookups using this strongly typed resource class. - - - - - Looks up a localized string similar to Mock type has already been initialized by accessing its Object property. Adding interfaces must be done before that.. - - - - - Looks up a localized string similar to Value cannot be an empty string.. - - - - - Looks up a localized string similar to Can only add interfaces to the mock.. - - - - - Looks up a localized string similar to Can't set return value for void method {0}.. - - - - - Looks up a localized string similar to Constructor arguments cannot be passed for interface mocks.. - - - - - Looks up a localized string similar to A matching constructor for the given arguments was not found on the mocked type.. - - - - - Looks up a localized string similar to Expression {0} involves a field access, which is not supported. Use properties instead.. - - - - - Looks up a localized string similar to Type to mock must be an interface or an abstract or non-sealed class. . - - - - - Looks up a localized string similar to Cannot retrieve a mock with the given object type {0} as it's not the main type of the mock or any of its additional interfaces. - Please cast the argument to one of the supported types: {1}. - Remember that there's no generics covariance in the CLR, so your object must be one of these types in order for the call to succeed.. - - - - - Looks up a localized string similar to Member {0}.{1} does not exist.. - - - - - Looks up a localized string similar to Method {0}.{1} is public. Use strong-typed Expect overload instead: - mock.Setup(x => x.{1}()); - . - - - - - Looks up a localized string similar to {0} invocation failed with mock behavior {1}. - {2}. - - - - - Looks up a localized string similar to Expected only {0} calls to {1}.. - - - - - Looks up a localized string similar to Expected only one call to {0}.. - - - - - Looks up a localized string similar to {0} - Expected invocation on the mock at least {2} times, but was {4} times: {1}. - - - - - Looks up a localized string similar to {0} - Expected invocation on the mock at least once, but was never performed: {1}. - - - - - Looks up a localized string similar to {0} - Expected invocation on the mock at most {3} times, but was {4} times: {1}. - - - - - Looks up a localized string similar to {0} - Expected invocation on the mock at most once, but was {4} times: {1}. - - - - - Looks up a localized string similar to {0} - Expected invocation on the mock between {2} and {3} times (Exclusive), but was {4} times: {1}. - - - - - Looks up a localized string similar to {0} - Expected invocation on the mock between {2} and {3} times (Inclusive), but was {4} times: {1}. - - - - - Looks up a localized string similar to {0} - Expected invocation on the mock exactly {2} times, but was {4} times: {1}. - - - - - Looks up a localized string similar to {0} - Expected invocation on the mock should never have been performed, but was {4} times: {1}. - - - - - Looks up a localized string similar to {0} - Expected invocation on the mock once, but was {4} times: {1}. - - - - - Looks up a localized string similar to All invocations on the mock must have a corresponding setup.. - - - - - Looks up a localized string similar to Object instance was not created by Moq.. - - - - - Looks up a localized string similar to Property {0}.{1} does not exist.. - - - - - Looks up a localized string similar to Property {0}.{1} is write-only.. - - - - - Looks up a localized string similar to Property {0}.{1} is read-only.. - - - - - Looks up a localized string similar to Cannot raise a mocked event unless it has been associated (attached) to a concrete event in a mocked object.. - - - - - Looks up a localized string similar to Invocation needs to return a value and therefore must have a corresponding setup that provides it.. - - - - - Looks up a localized string similar to A lambda expression is expected as the argument to It.Is<T>.. - - - - - Looks up a localized string similar to Invocation {0} should not have been made.. - - - - - Looks up a localized string similar to Expression is not a method invocation: {0}. - - - - - Looks up a localized string similar to Expression is not a property access: {0}. - - - - - Looks up a localized string similar to Expression is not a property setter invocation.. - - - - - Looks up a localized string similar to Invalid setup on a non-member method: - {0}. - - - - - Looks up a localized string similar to Invalid setup on a non-overridable member: - {0}. - - - - - Looks up a localized string similar to Type {0} does not implement required interface {1}. - - - - - Looks up a localized string similar to Type {0} does not from required type {1}. - - - - - Looks up a localized string similar to To specify a setup for public property {0}.{1}, use the typed overloads, such as: - mock.Setup(x => x.{1}).Returns(value); - mock.SetupGet(x => x.{1}).Returns(value); //equivalent to previous one - mock.SetupSet(x => x.{1}).Callback(callbackDelegate); - . - - - - - Looks up a localized string similar to Expression {0} is not supported.. - - - - - Looks up a localized string similar to Only property accesses are supported in intermediate invocations on a setup. Unsupported expression {0}.. - - - - - Looks up a localized string similar to Expression contains intermediate property access {0}.{1} which is of type {2} and cannot be mocked. Unsupported expression {3}.. - - - - - Looks up a localized string similar to Setter expression cannot use argument matchers that receive parameters.. - - - - - Looks up a localized string similar to Member {0} is not supported for protected mocking.. - - - - - Looks up a localized string similar to Setter expression can only use static custom matchers.. - - - - - Looks up a localized string similar to To specify a setup for protected property {0}.{1}, use: - mock.Setup<{2}>(x => x.{1}).Returns(value); - mock.SetupGet(x => x.{1}).Returns(value); //equivalent to previous one - mock.SetupSet(x => x.{1}).Callback(callbackDelegate);. - - - - - Looks up a localized string similar to The following setups were not matched: - {0}. - - - - - Allows setups to be specified for protected members by using their - name as a string, rather than strong-typing them which is not possible - due to their visibility. - - - - - Specifies a setup for a void method invocation with the given - , optionally specifying - arguments for the method call. - - Name of the void method to be invoke. - Optional arguments for the invocation. If argument matchers are used, - remember to use rather than . - - - - Specifies a setup for an invocation on a property or a non void method with the given - , optionally specifying - arguments for the method call. - - Name of the method or property to be invoke. - Optional arguments for the invocation. If argument matchers are used, - remember to use rather than . - Return type of the method or property. - - - - Specifies a setup for an invocation on a property getter with the given - . - - Name of the property. - Type of the property. - - - - Specifies a setup for an invocation on a property setter with the given - . - - Name of the property. - Type of the property. - - - - Allows the specification of a matching condition for an - argument in a protected member setup, rather than a specific - argument value. "ItExpr" refers to the argument being matched. - - - Use this variant of argument matching instead of - for protected setups. - This class allows the setup to match a method invocation - with an arbitrary value, with a value in a specified range, or - even one that matches a given predicate, or null. - - - - - Matches a null value of the given type. - - - Required for protected mocks as the null value cannot be used - directly as it prevents proper method overload selection. - - - - // Throws an exception for a call to Remove with a null string value. - mock.Protected() - .Setup("Remove", ItExpr.IsNull<string>()) - .Throws(new InvalidOperationException()); - - - Type of the value. - - - - Matches any value of the given type. - - - Typically used when the actual argument value for a method - call is not relevant. - - - - // Throws an exception for a call to Remove with any string value. - mock.Protected() - .Setup("Remove", ItExpr.IsAny<string>()) - .Throws(new InvalidOperationException()); - - - Type of the value. - - - - Matches any value that satisfies the given predicate. - - Type of the argument to check. - The predicate used to match the method argument. - - Allows the specification of a predicate to perform matching - of method call arguments. - - - This example shows how to return the value 1 whenever the argument to the - Do method is an even number. - - mock.Protected() - .Setup("Do", ItExpr.Is<int>(i => i % 2 == 0)) - .Returns(1); - - This example shows how to throw an exception if the argument to the - method is a negative number: - - mock.Protected() - .Setup("GetUser", ItExpr.Is<int>(i => i < 0)) - .Throws(new ArgumentException()); - - - - - - Matches any value that is in the range specified. - - Type of the argument to check. - The lower bound of the range. - The upper bound of the range. - The kind of range. See . - - The following example shows how to expect a method call - with an integer argument within the 0..100 range. - - mock.Protected() - .Setup("HasInventory", - ItExpr.IsAny<string>(), - ItExpr.IsInRange(0, 100, Range.Inclusive)) - .Returns(false); - - - - - - Matches a string argument if it matches the given regular expression pattern. - - The pattern to use to match the string argument value. - - The following example shows how to expect a call to a method where the - string argument matches the given regular expression: - - mock.Protected() - .Setup("Check", ItExpr.IsRegex("[a-z]+")) - .Returns(1); - - - - - - Matches a string argument if it matches the given regular expression pattern. - - The pattern to use to match the string argument value. - The options used to interpret the pattern. - - The following example shows how to expect a call to a method where the - string argument matches the given regular expression, in a case insensitive way: - - mock.Protected() - .Setup("Check", ItExpr.IsRegex("[a-z]+", RegexOptions.IgnoreCase)) - .Returns(1); - - - - - - Enables the Protected() method on , - allowing setups to be set for protected members by using their - name as a string, rather than strong-typing them which is not possible - due to their visibility. - - - - - Enable protected setups for the mock. - - Mocked object type. Typically omitted as it can be inferred from the mock instance. - The mock to set the protected setups on. - - - - - - - - - - - - Kind of range to use in a filter specified through - . - - - - - The range includes the to and - from values. - - - - - The range does not include the to and - from values. - - - - - Provides a mock implementation of . - - Any interface type can be used for mocking, but for classes, only abstract and virtual members can be mocked. - - The behavior of the mock with regards to the setups and the actual calls is determined - by the optional that can be passed to the - constructor. - - Type to mock, which can be an interface or a class. - The following example shows establishing setups with specific values - for method invocations: - - // Arrange - var order = new Order(TALISKER, 50); - var mock = new Mock<IWarehouse>(); - - mock.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true); - - // Act - order.Fill(mock.Object); - - // Assert - Assert.True(order.IsFilled); - - The following example shows how to use the class - to specify conditions for arguments instead of specific values: - - // Arrange - var order = new Order(TALISKER, 50); - var mock = new Mock<IWarehouse>(); - - // shows how to expect a value within a range - mock.Setup(x => x.HasInventory( - It.IsAny<string>(), - It.IsInRange(0, 100, Range.Inclusive))) - .Returns(false); - - // shows how to throw for unexpected calls. - mock.Setup(x => x.Remove( - It.IsAny<string>(), - It.IsAny<int>())) - .Throws(new InvalidOperationException()); - - // Act - order.Fill(mock.Object); - - // Assert - Assert.False(order.IsFilled); - - - - - - Ctor invoked by AsTInterface exclusively. - - - - - Initializes an instance of the mock with default behavior. - - var mock = new Mock<IFormatProvider>(); - - - - - Initializes an instance of the mock with default behavior and with - the given constructor arguments for the class. (Only valid when is a class) - - The mock will try to find the best match constructor given the constructor arguments, and invoke that - to initialize the instance. This applies only for classes, not interfaces. - - var mock = new Mock<MyProvider>(someArgument, 25); - Optional constructor arguments if the mocked type is a class. - - - - Initializes an instance of the mock with the specified behavior. - - var mock = new Mock<IFormatProvider>(MockBehavior.Relaxed); - Behavior of the mock. - - - - Initializes an instance of the mock with a specific behavior with - the given constructor arguments for the class. - - The mock will try to find the best match constructor given the constructor arguments, and invoke that - to initialize the instance. This applies only to classes, not interfaces. - - var mock = new Mock<MyProvider>(someArgument, 25); - Behavior of the mock.Optional constructor arguments if the mocked type is a class. - - - - Returns the mocked object value. - - - - - Specifies a setup on the mocked type for a call to - to a void method. - - If more than one setup is specified for the same method or property, - the latest one wins and is the one that will be executed. - Lambda expression that specifies the expected method invocation. - - var mock = new Mock<IProcessor>(); - mock.Setup(x => x.Execute("ping")); - - - - - - Specifies a setup on the mocked type for a call to - to a value returning method. - Type of the return value. Typically omitted as it can be inferred from the expression. - If more than one setup is specified for the same method or property, - the latest one wins and is the one that will be executed. - Lambda expression that specifies the method invocation. - - mock.Setup(x => x.HasInventory("Talisker", 50)).Returns(true); - - - - - - Specifies a setup on the mocked type for a call to - to a property getter. - - If more than one setup is set for the same property getter, - the latest one wins and is the one that will be executed. - Type of the property. Typically omitted as it can be inferred from the expression.Lambda expression that specifies the property getter. - - mock.SetupGet(x => x.Suspended) - .Returns(true); - - - - - - Specifies a setup on the mocked type for a call to - to a property setter. - - If more than one setup is set for the same property setter, - the latest one wins and is the one that will be executed. - - This overloads allows the use of a callback already - typed for the property type. - - Type of the property. Typically omitted as it can be inferred from the expression.Lambda expression that sets a property to a value. - - mock.SetupSet(x => x.Suspended = true); - - - - - - Specifies a setup on the mocked type for a call to - to a property setter. - - If more than one setup is set for the same property setter, - the latest one wins and is the one that will be executed. - Lambda expression that sets a property to a value. - - mock.SetupSet(x => x.Suspended = true); - - - - - - Specifies that the given property should have "property behavior", - meaning that setting its value will cause it to be saved and - later returned when the property is requested. (this is also - known as "stubbing"). - - Type of the property, inferred from the property - expression (does not need to be specified). - Property expression to stub. - If you have an interface with an int property Value, you might - stub it using the following straightforward call: - - var mock = new Mock<IHaveValue>(); - mock.Stub(v => v.Value); - - After the Stub call has been issued, setting and - retrieving the object value will behave as expected: - - IHaveValue v = mock.Object; - - v.Value = 5; - Assert.Equal(5, v.Value); - - - - - - Specifies that the given property should have "property behavior", - meaning that setting its value will cause it to be saved and - later returned when the property is requested. This overload - allows setting the initial value for the property. (this is also - known as "stubbing"). - - Type of the property, inferred from the property - expression (does not need to be specified). - Property expression to stub.Initial value for the property. - If you have an interface with an int property Value, you might - stub it using the following straightforward call: - - var mock = new Mock<IHaveValue>(); - mock.SetupProperty(v => v.Value, 5); - - After the SetupProperty call has been issued, setting and - retrieving the object value will behave as expected: - - IHaveValue v = mock.Object; - // Initial value was stored - Assert.Equal(5, v.Value); - - // New value set which changes the initial value - v.Value = 6; - Assert.Equal(6, v.Value); - - - - - - Specifies that the all properties on the mock should have "property behavior", - meaning that setting its value will cause it to be saved and - later returned when the property is requested. (this is also - known as "stubbing"). The default value for each property will be the - one generated as specified by the property for the mock. - - If the mock is set to , - the mocked default values will also get all properties setup recursively. - - - - - Verifies that a specific invocation matching the given expression was performed on the mock. Use - in conjuntion with the default . - - This example assumes that the mock has been used, and later we want to verify that a given - invocation with specific parameters was performed: - - var mock = new Mock<IProcessor>(); - // exercise mock - //... - // Will throw if the test code didn't call Execute with a "ping" string argument. - mock.Verify(proc => proc.Execute("ping")); - - The invocation was not performed on the mock.Expression to verify. - - - - Verifies that a specific invocation matching the given expression was performed on the mock. Use - in conjuntion with the default . - - The invocation was not call the times specified by - . - Expression to verify.The number of times a method is allowed to be called. - - - - Verifies that a specific invocation matching the given expression was performed on the mock, - specifying a failure error message. Use in conjuntion with the default - . - - This example assumes that the mock has been used, and later we want to verify that a given - invocation with specific parameters was performed: - - var mock = new Mock<IProcessor>(); - // exercise mock - //... - // Will throw if the test code didn't call Execute with a "ping" string argument. - mock.Verify(proc => proc.Execute("ping")); - - The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. - - - - Verifies that a specific invocation matching the given expression was performed on the mock, - specifying a failure error message. Use in conjuntion with the default - . - - The invocation was not call the times specified by - . - Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails. - - - - Verifies that a specific invocation matching the given expression was performed on the mock. Use - in conjuntion with the default . - - This example assumes that the mock has been used, and later we want to verify that a given - invocation with specific parameters was performed: - - var mock = new Mock<IWarehouse>(); - // exercise mock - //... - // Will throw if the test code didn't call HasInventory. - mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50)); - - The invocation was not performed on the mock.Expression to verify.Type of return value from the expression. - - - - Verifies that a specific invocation matching the given - expression was performed on the mock. Use in conjuntion - with the default . - - The invocation was not call the times specified by - . - Expression to verify.The number of times a method is allowed to be called.Type of return value from the expression. - - - - Verifies that a specific invocation matching the given - expression was performed on the mock, specifying a failure - error message. - - This example assumes that the mock has been used, - and later we want to verify that a given invocation - with specific parameters was performed: - - var mock = new Mock<IWarehouse>(); - // exercise mock - //... - // Will throw if the test code didn't call HasInventory. - mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50), "When filling orders, inventory has to be checked"); - - The invocation was not performed on the mock.Expression to verify.Message to show if verification fails.Type of return value from the expression. - - - - Verifies that a specific invocation matching the given - expression was performed on the mock, specifying a failure - error message. - - The invocation was not call the times specified by - . - Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails.Type of return value from the expression. - - - - Verifies that a property was read on the mock. - - This example assumes that the mock has been used, - and later we want to verify that a given property - was retrieved from it: - - var mock = new Mock<IWarehouse>(); - // exercise mock - //... - // Will throw if the test code didn't retrieve the IsClosed property. - mock.VerifyGet(warehouse => warehouse.IsClosed); - - The invocation was not performed on the mock.Expression to verify. - Type of the property to verify. Typically omitted as it can - be inferred from the expression's return type. - - - - - Verifies that a property was read on the mock. - - The invocation was not call the times specified by - . - The number of times a method is allowed to be called.Expression to verify. - Type of the property to verify. Typically omitted as it can - be inferred from the expression's return type. - - - - - Verifies that a property was read on the mock, specifying a failure - error message. - - This example assumes that the mock has been used, - and later we want to verify that a given property - was retrieved from it: - - var mock = new Mock<IWarehouse>(); - // exercise mock - //... - // Will throw if the test code didn't retrieve the IsClosed property. - mock.VerifyGet(warehouse => warehouse.IsClosed); - - The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. - Type of the property to verify. Typically omitted as it can - be inferred from the expression's return type. - - - - - Verifies that a property was read on the mock, specifying a failure - error message. - - The invocation was not call the times specified by - . - The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. - Type of the property to verify. Typically omitted as it can - be inferred from the expression's return type. - - - - - Verifies that a property was set on the mock. - - This example assumes that the mock has been used, - and later we want to verify that a given property - was set on it: - - var mock = new Mock<IWarehouse>(); - // exercise mock - //... - // Will throw if the test code didn't set the IsClosed property. - mock.VerifySet(warehouse => warehouse.IsClosed = true); - - The invocation was not performed on the mock.Expression to verify. - - - - Verifies that a property was set on the mock. - - The invocation was not call the times specified by - . - The number of times a method is allowed to be called.Expression to verify. - - - - Verifies that a property was set on the mock, specifying - a failure message. - - This example assumes that the mock has been used, - and later we want to verify that a given property - was set on it: - - var mock = new Mock<IWarehouse>(); - // exercise mock - //... - // Will throw if the test code didn't set the IsClosed property. - mock.VerifySet(warehouse => warehouse.IsClosed = true, "Warehouse should always be closed after the action"); - - The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. - - - - Verifies that a property was set on the mock, specifying - a failure message. - - The invocation was not call the times specified by - . - The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. - - - - Raises the event referenced in using - the given and arguments. - - The argument is - invalid for the target event invocation, or the is - not an event attach or detach expression. - - The following example shows how to raise a event: - - var mock = new Mock<IViewModel>(); - - mock.Raise(x => x.PropertyChanged -= null, new PropertyChangedEventArgs("Name")); - - - This example shows how to invoke an event with a custom event arguments - class in a view that will cause its corresponding presenter to - react by changing its state: - - var mockView = new Mock<IOrdersView>(); - var presenter = new OrdersPresenter(mockView.Object); - - // Check that the presenter has no selection by default - Assert.Null(presenter.SelectedOrder); - - // Raise the event with a specific arguments data - mockView.Raise(v => v.SelectionChanged += null, new OrderEventArgs { Order = new Order("moq", 500) }); - - // Now the presenter reacted to the event, and we have a selected order - Assert.NotNull(presenter.SelectedOrder); - Assert.Equal("moq", presenter.SelectedOrder.ProductName); - - - - - - Raises the event referenced in using - the given and arguments - for a non-EventHandler typed event. - - The arguments are - invalid for the target event invocation, or the is - not an event attach or detach expression. - - The following example shows how to raise a custom event that does not adhere to - the standard EventHandler: - - var mock = new Mock<IViewModel>(); - - mock.Raise(x => x.MyEvent -= null, "Name", bool, 25); - - - - - - Obsolete. - - - - - Obsolete. - - - - - Obsolete. - - - - - Obsolete. - - - - - Obsolete. - - - - - Exposes the mocked object instance. - - - - - Determines the way default values are generated - calculated for loose mocks. - - - - - Default behavior, which generates empty values for - value types (i.e. default(int)), empty array and - enumerables, and nulls for all other reference types. - - - - - Whenever the default value generated by - is null, replaces this value with a mock (if the type - can be mocked). - - - For sealed classes, a null value will be generated. - - - - - Replaces references to one specific instance of an expression node with another node - - - - - A default implementation of IQueryable for use with QueryProvider - - - - - A basic abstract LINQ query provider - - - - - Type related helper methods - - - - - Allows creation custom value matchers that can be used on setups and verification, - completely replacing the built-in class with your own argument - matching rules. - - - - - Provided for the sole purpose of rendering the delegate passed to the - matcher constructor if no friendly render lambda is provided. - - - - - Allows creation custom value matchers that can be used on setups and verification, - completely replacing the built-in class with your own argument - matching rules. - Type of the value to match. - The argument matching is used to determine whether a concrete - invocation in the mock matches a given setup. This - matching mechanism is fully extensible. - - Creating a custom matcher is straightforward. You just need to create a method - that returns a value from a call to with - your matching condition and optional friendly render expression: - - public Order IsBigOrder() - { - return Match<Order>.Create( - o => o.GrandTotal >= 5000, - /* a friendly expression to render on failures */ - () => IsBigOrder()); - } - - This method can be used in any mock setup invocation: - - mock.Setup(m => m.Submit(IsBigOrder()).Throws<UnauthorizedAccessException>(); - - At runtime, Moq knows that the return value was a matcher and - evaluates your predicate with the actual value passed into your predicate. - - Another example might be a case where you want to match a lists of orders - that contains a particular one. You might create matcher like the following: - - - public static class Orders - { - public static IEnumerable<Order> Contains(Order order) - { - return Match<IEnumerable<Order>>.Create(orders => orders.Contains(order)); - } - } - - Now we can invoke this static method instead of an argument in an - invocation: - - var order = new Order { ... }; - var mock = new Mock<IRepository<Order>>(); - - mock.Setup(x => x.Save(Orders.Contains(order))) - .Throws<ArgumentException>(); - - - - - - Initializes the match with the condition that - will be checked in order to match invocation - values. - The condition to match against actual values. - - - - - - - - - - - - This method is used to set an expression as the last matcher invoked, - which is used in the SetupSet to allow matchers in the prop = value - delegate expression. This delegate is executed in "fluent" mode in - order to capture the value being set, and construct the corresponding - methodcall. - This is also used in the MatcherFactory for each argument expression. - This method ensures that when we execute the delegate, we - also track the matcher that was invoked, so that when we create the - methodcall we build the expression using it, rather than the null/default - value returned from the actual invocation. - - - - - Provides legacy API members as extensions so that - existing code continues to compile, but new code - doesn't see then. - - - - - Obsolete. - - - - - Obsolete. - - - - - Obsolete. - - - - - Tracks the current mock and interception context. - - - - - Having an active fluent mock context means that the invocation - is being performed in "trial" mode, just to gather the - target method and arguments that need to be matched later - when the actual invocation is made. - - - - - A that returns an empty default value - for non-mockeable types, and mocks for all other types (interfaces and - non-sealed classes) that can be mocked. - - - - - Provides a typed for a - specific type of . - - The type of event arguments required by the event. - - The mocked event can either be a or custom - event handler which follows .NET practice of providing object sender, EventArgs args - kind of signature. - - - - - Raises the associated event with the given - event argument data. - - Data to pass to the event. - - - - Provides support for attaching a to - a generic event. - - Event to convert. - - - - Provided solely to allow the interceptor to determine when the attached - handler is coming from this mocked event so we can assign the - corresponding EventInfo for it. - - - - - Provides additional methods on mocks. - - - Provided as extension methods as they confuse the compiler - with the overloads taking Action. - - - - - Specifies a setup on the mocked type for a call to - to a property setter, regardless of its value. - - - If more than one setup is set for the same property setter, - the latest one wins and is the one that will be executed. - - Type of the property. Typically omitted as it can be inferred from the expression. - Type of the mock. - The target mock for the setup. - Lambda expression that specifies the property setter. - - - mock.SetupSet(x => x.Suspended); - - - - This method is not legacy, but must be on an extension method to avoid - confusing the compiler with the new Action syntax. - - - - - Verifies that a property has been set on the mock, regarless of its value. - - - This example assumes that the mock has been used, - and later we want to verify that a given invocation - with specific parameters was performed: - - var mock = new Mock<IWarehouse>(); - // exercise mock - //... - // Will throw if the test code didn't set the IsClosed property. - mock.VerifySet(warehouse => warehouse.IsClosed); - - - The invocation was not performed on the mock. - Expression to verify. - The mock instance. - Mocked type. - Type of the property to verify. Typically omitted as it can - be inferred from the expression's return type. - - - - Verifies that a property has been set on the mock, specifying a failure - error message. - - - This example assumes that the mock has been used, - and later we want to verify that a given invocation - with specific parameters was performed: - - var mock = new Mock<IWarehouse>(); - // exercise mock - //... - // Will throw if the test code didn't set the IsClosed property. - mock.VerifySet(warehouse => warehouse.IsClosed); - - - The invocation was not performed on the mock. - Expression to verify. - Message to show if verification fails. - The mock instance. - Mocked type. - Type of the property to verify. Typically omitted as it can - be inferred from the expression's return type. - - - - Verifies that a property has been set on the mock, regardless - of the value but only the specified number of times. - - - This example assumes that the mock has been used, - and later we want to verify that a given invocation - with specific parameters was performed: - - var mock = new Mock<IWarehouse>(); - // exercise mock - //... - // Will throw if the test code didn't set the IsClosed property. - mock.VerifySet(warehouse => warehouse.IsClosed); - - - The invocation was not performed on the mock. - The invocation was not call the times specified by - . - The mock instance. - Mocked type. - The number of times a method is allowed to be called. - Expression to verify. - Type of the property to verify. Typically omitted as it can - be inferred from the expression's return type. - - - - Verifies that a property has been set on the mock, regardless - of the value but only the specified number of times, and specifying a failure - error message. - - - This example assumes that the mock has been used, - and later we want to verify that a given invocation - with specific parameters was performed: - - var mock = new Mock<IWarehouse>(); - // exercise mock - //... - // Will throw if the test code didn't set the IsClosed property. - mock.VerifySet(warehouse => warehouse.IsClosed); - - - The invocation was not performed on the mock. - The invocation was not call the times specified by - . - The mock instance. - Mocked type. - The number of times a method is allowed to be called. - Message to show if verification fails. - Expression to verify. - Type of the property to verify. Typically omitted as it can - be inferred from the expression's return type. - - - - Allows querying the universe of mocks for those that behave - according to the query specification. - - - - - Creates a query for mocks of the given type. - - The type of mocked object to query. - - - - Method that is turned into the actual call from .Query{T}, to - transform the queryable query into a normal enumerable query. - This method should not be used by consumers. - - - - - - - The first method call or member access will be the - last segment of the expression (depth-first traversal), - which is the one we have to Setup rather than FluentMock. - And the last one is the one we have to Mock.Get rather - than FluentMock. - - - - - Helper extensions that are used by the query translator. - - - - - Retrieves a fluent mock from the given setup expression. - - - - - Legacy Stub stuff, moved to the core API. - - - - - Obsolete. Use . - - - - - Obsolete. Use . - - - - - Obsolete. Use . - - - - - Defines the number of invocations allowed by a mocked method. - - - - - Specifies that a mocked method should be invoked times as minimum. - - The minimun number of times. - An object defining the allowed number of invocations. - - - - Specifies that a mocked method should be invoked one time as minimum. - - An object defining the allowed number of invocations. - - - - Specifies that a mocked method should be invoked time as maximun. - - The maximun number of times. - An object defining the allowed number of invocations. - - - - Specifies that a mocked method should be invoked one time as maximun. - - An object defining the allowed number of invocations. - - - - Specifies that a mocked method should be invoked between and - times. - - The minimun number of times. - The maximun number of times. - The kind of range. See . - An object defining the allowed number of invocations. - - - - Specifies that a mocked method should be invoked exactly times. - - The times that a method or property can be called. - An object defining the allowed number of invocations. - - - - Specifies that a mocked method should not be invoked. - - An object defining the allowed number of invocations. - - - - Specifies that a mocked method should be invoked exactly one time. - - An object defining the allowed number of invocations. - - - + + + + Moq + + + + + A that returns an empty default value + for invocations that do not have setups or return values, with loose mocks. + This is the default behavior for a mock. + + + + + Interface to be implemented by classes that determine the + default value of non-expected invocations. + + + + + Provides a value for the given member and arguments. + + The member to provide a default + value for. + + + + Implements the fluent API. + + + + + Defines the Callback verb and overloads. + + + + + Helper interface used to hide the base + members from the fluent API to make it much cleaner + in Visual Studio intellisense. + + + + + + + + + + + + + + + + + Specifies a callback to invoke when the method is called. + + Callback method to invoke. + + The following example specifies a callback to set a boolean + value that can be used later: + + bool called = false; + mock.Setup(x => x.Execute()) + .Callback(() => called = true); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + Argument type of the invoked method. + Callback method to invoke. + + Invokes the given callback with the concrete invocation argument value. + + Notice how the specific string argument is retrieved by simply declaring + it as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute(It.IsAny<string>())) + .Callback((string command) => Console.WriteLine(command)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + Type of the first argument of the invoked method. + Type of the second argument of the invoked method. + Callback method to invoke. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2) => Console.WriteLine(arg1 + arg2)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + Type of the first argument of the invoked method. + Type of the second argument of the invoked method. + Type of the third argument of the invoked method. + Callback method to invoke. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<int>())) + .Callback((string arg1, string arg2, int arg3) => Console.WriteLine(arg1 + arg2 + arg3)); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + Type of the first argument of the invoked method. + Type of the second argument of the invoked method. + Type of the third argument of the invoked method. + Type of the fourth argument of the invoked method. + Callback method to invoke. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<int>(), + It.IsAny<bool>())) + .Callback((string arg1, string arg2, int arg3, bool arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4)); + + + + + + Defines occurrence members to constraint setups. + + + + + The expected invocation can happen at most once. + + + + var mock = new Mock<ICommand>(); + mock.Setup(foo => foo.Execute("ping")) + .AtMostOnce(); + + + + + + The expected invocation can happen at most specified number of times. + + The number of times to accept calls. + + + var mock = new Mock<ICommand>(); + mock.Setup(foo => foo.Execute("ping")) + .AtMost( 5 ); + + + + + + Defines the Raises verb. + + + + + Specifies the event that will be raised + when the setup is met. + + An expression that represents an event attach or detach action. + The event arguments to pass for the raised event. + + The following example shows how to raise an event when + the setup is met: + + var mock = new Mock<IContainer>(); + + mock.Setup(add => add.Add(It.IsAny<string>(), It.IsAny<object>())) + .Raises(add => add.Added += null, EventArgs.Empty); + + + + + + Specifies the event that will be raised + when the setup is matched. + + An expression that represents an event attach or detach action. + A function that will build the + to pass when raising the event. + + + + + Specifies the event that will be raised + when the setup is matched. + + An expression that represents an event attach or detach action. + A function that will build the + to pass when raising the event. + Type of the argument received by the expected invocation. + + + + + Specifies the event that will be raised + when the setup is matched. + + An expression that represents an event attach or detach action. + A function that will build the + to pass when raising the event. + Type of the first argument received by the expected invocation. + Type of the second argument received by the expected invocation. + + + + + Specifies the event that will be raised + when the setup is matched. + + An expression that represents an event attach or detach action. + A function that will build the + to pass when raising the event. + Type of the first argument received by the expected invocation. + Type of the second argument received by the expected invocation. + Type of the third argument received by the expected invocation. + + + + + Specifies the event that will be raised + when the setup is matched. + + An expression that represents an event attach or detach action. + A function that will build the + to pass when raising the event. + Type of the first argument received by the expected invocation. + Type of the second argument received by the expected invocation. + Type of the third argument received by the expected invocation. + Type of the fourth argument received by the expected invocation. + + + + + Specifies the custom event that will be raised + when the setup is matched. + + An expression that represents an event attach or detach action. + The arguments to pass to the custom delegate (non EventHandler-compatible). + + + + Defines the Raises verb. + + + + + Specifies the mocked event that will be raised + when the setup is met. + + The mocked event, retrieved from + or . + + The event args to pass when raising the event. + + The following example shows how to raise an event when + the setup is met: + + var mock = new Mock<IContainer>(); + // create handler to associate with the event to raise + var handler = mock.CreateEventHandler(); + // associate the handler with the event to raise + mock.Object.Added += handler; + // setup the invocation and the handler to raise + mock.Setup(add => add.Add(It.IsAny<string>(), It.IsAny<object>())) + .Raises(handler, EventArgs.Empty); + + + + + + Specifies the mocked event that will be raised + when the setup is matched. + + The mocked event, retrieved from + or . + + A function that will build the + to pass when raising the event. + + + + + Specifies the mocked event that will be raised + when the setup is matched. + + The mocked event, retrieved from + or . + + A function that will build the + to pass when raising the event. + Type of the argument received by the expected invocation. + + + + + Specifies the mocked event that will be raised + when the setup is matched. + + The mocked event, retrieved from + or . + + A function that will build the + to pass when raising the event. + Type of the first argument received by the expected invocation. + Type of the second argument received by the expected invocation. + + + + + Specifies the mocked event that will be raised + when the setup is matched. + + The mocked event, retrieved from + or . + + A function that will build the + to pass when raising the event. + Type of the first argument received by the expected invocation. + Type of the second argument received by the expected invocation. + Type of the third argument received by the expected invocation. + + + + + Specifies the mocked event that will be raised + when the setup is matched. + + The mocked event, retrieved from + or . + + A function that will build the + to pass when raising the event. + Type of the first argument received by the expected invocation. + Type of the second argument received by the expected invocation. + Type of the third argument received by the expected invocation. + Type of the fourth argument received by the expected invocation. + + + + + Defines the Verifiable verb. + + + + + Marks the expectation as verifiable, meaning that a call + to will check if this particular + expectation was met. + + + The following example marks the expectation as verifiable: + + mock.Expect(x => x.Execute("ping")) + .Returns(true) + .Verifiable(); + + + + + + Marks the expectation as verifiable, meaning that a call + to will check if this particular + expectation was met, and specifies a message for failures. + + + The following example marks the expectation as verifiable: + + mock.Expect(x => x.Execute("ping")) + .Returns(true) + .Verifiable("Ping should be executed always!"); + + + + + + Marks a method as a matcher, which allows complete replacement + of the built-in class with your own argument + matching rules. + + + This feature has been deprecated in favor of the new + and simpler . + + + The argument matching is used to determine whether a concrete + invocation in the mock matches a given setup. This + matching mechanism is fully extensible. + + + There are two parts of a matcher: the compiler matcher + and the runtime matcher. + + + Compiler matcher + Used to satisfy the compiler requirements for the + argument. Needs to be a method optionally receiving any arguments + you might need for the matching, but with a return type that + matches that of the argument. + + Let's say I want to match a lists of orders that contains + a particular one. I might create a compiler matcher like the following: + + + public static class Orders + { + [Matcher] + public static IEnumerable<Order> Contains(Order order) + { + return null; + } + } + + Now we can invoke this static method instead of an argument in an + invocation: + + var order = new Order { ... }; + var mock = new Mock<IRepository<Order>>(); + + mock.Setup(x => x.Save(Orders.Contains(order))) + .Throws<ArgumentException>(); + + Note that the return value from the compiler matcher is irrelevant. + This method will never be called, and is just used to satisfy the + compiler and to signal Moq that this is not a method that we want + to be invoked at runtime. + + + + Runtime matcher + + The runtime matcher is the one that will actually perform evaluation + when the test is run, and is defined by convention to have the + same signature as the compiler matcher, but where the return + value is the first argument to the call, which contains the + object received by the actual invocation at runtime: + + public static bool Contains(IEnumerable<Order> orders, Order order) + { + return orders.Contains(order); + } + + At runtime, the mocked method will be invoked with a specific + list of orders. This value will be passed to this runtime + matcher as the first argument, while the second argument is the + one specified in the setup (x.Save(Orders.Contains(order))). + + The boolean returned determines whether the given argument has been + matched. If all arguments to the expected method are matched, then + the setup matches and is evaluated. + + + + + + Using this extensible infrastructure, you can easily replace the entire + set of matchers with your own. You can also avoid the + typical (and annoying) lengthy expressions that result when you have + multiple arguments that use generics. + + + The following is the complete example explained above: + + public static class Orders + { + [Matcher] + public static IEnumerable<Order> Contains(Order order) + { + return null; + } + + public static bool Contains(IEnumerable<Order> orders, Order order) + { + return orders.Contains(order); + } + } + + And the concrete test using this matcher: + + var order = new Order { ... }; + var mock = new Mock<IRepository<Order>>(); + + mock.Setup(x => x.Save(Orders.Contains(order))) + .Throws<ArgumentException>(); + + // use mock, invoke Save, and have the matcher filter. + + + + + + Casts the expression to a lambda expression, removing + a cast if there's any. + + + + + Casts the body of the lambda expression to a . + + If the body is not a method call. + + + + Converts the body of the lambda expression into the referenced by it. + + + + + Checks whether the body of the lambda expression is a property access. + + + + + Checks whether the expression is a property access. + + + + + Checks whether the body of the lambda expression is a property indexer, which is true + when the expression is an whose + has + equal to . + + + + + Checks whether the expression is a property indexer, which is true + when the expression is an whose + has + equal to . + + + + + Creates an expression that casts the given expression to the + type. + + + + + TODO: remove this code when https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=331583 + is fixed. + + + + + Provides partial evaluation of subtrees, whenever they can be evaluated locally. + + Matt Warren: http://blogs.msdn.com/mattwar + Documented by InSTEDD: http://www.instedd.org + + + + Performs evaluation and replacement of independent sub-trees + + The root of the expression tree. + A function that decides whether a given expression + node can be part of the local function. + A new tree with sub-trees evaluated and replaced. + + + + Performs evaluation and replacement of independent sub-trees + + The root of the expression tree. + A new tree with sub-trees evaluated and replaced. + + + + Evaluates and replaces sub-trees when first candidate is reached (top-down) + + + + + Performs bottom-up analysis to determine which nodes can possibly + be part of an evaluated sub-tree. + + + + + Checks an argument to ensure it isn't null. + + The argument value to check. + The name of the argument. + + + + Checks a string argument to ensure it isn't null or empty. + + The argument value to check. + The name of the argument. + + + + Checks an argument to ensure it is in the specified range including the edges. + + Type of the argument to check, it must be an type. + + The argument value to check. + The minimun allowed value for the argument. + The maximun allowed value for the argument. + The name of the argument. + + + + Checks an argument to ensure it is in the specified range excluding the edges. + + Type of the argument to check, it must be an type. + + The argument value to check. + The minimun allowed value for the argument. + The maximun allowed value for the argument. + The name of the argument. + + + + Defines the Returns verb for property get setups. + + Mocked type. + Type of the property. + + + + Specifies the value to return. + + The value to return, or . + + Return a true value from the property getter call: + + mock.SetupGet(x => x.Suspended) + .Returns(true); + + + + + + Specifies a function that will calculate the value to return for the property. + + The function that will calculate the return value. + + Return a calculated value when the property is retrieved: + + mock.SetupGet(x => x.Suspended) + .Returns(() => returnValues[0]); + + The lambda expression to retrieve the return value is lazy-executed, + meaning that its value may change depending on the moment the property + is retrieved and the value the returnValues array has at + that moment. + + + + + Defines the Callback verb for property getter setups. + + + Mocked type. + Type of the property. + + + + Specifies a callback to invoke when the property is retrieved. + + Callback method to invoke. + + Invokes the given callback with the property value being set. + + mock.SetupGet(x => x.Suspended) + .Callback(() => called = true) + .Returns(true); + + + + + + Implements the fluent API. + + + + + Implements the fluent API. + + + + + Defines the Returns verb. + + Mocked type. + Type of the return value from the expression. + + + + Specifies the value to return. + + The value to return, or . + + Return a true value from the method call: + + mock.Setup(x => x.Execute("ping")) + .Returns(true); + + + + + + Specifies a function that will calculate the value to return from the method. + + The function that will calculate the return value. + + Return a calculated value when the method is called: + + mock.Setup(x => x.Execute("ping")) + .Returns(() => returnValues[0]); + + The lambda expression to retrieve the return value is lazy-executed, + meaning that its value may change depending on the moment the method + is executed and the value the returnValues array has at + that moment. + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + Type of the argument of the invoked method. + The function that will calculate the return value. + + Return a calculated value which is evaluated lazily at the time of the invocation. + + The lookup list can change between invocations and the setup + will return different values accordingly. Also, notice how the specific + string argument is retrieved by simply declaring it as part of the lambda + expression: + + + mock.Setup(x => x.Execute(It.IsAny<string>())) + .Returns((string command) => returnValues[command]); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + Type of the first argument of the invoked method. + Type of the second argument of the invoked method. + The function that will calculate the return value. + + Return a calculated value which is evaluated lazily at the time of the invocation. + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>())) + .Returns((string arg1, string arg2) => arg1 + arg2); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + Type of the first argument of the invoked method. + Type of the second argument of the invoked method. + Type of the third argument of the invoked method. + The function that will calculate the return value. + + Return a calculated value which is evaluated lazily at the time of the invocation. + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<int>())) + .Returns((string arg1, string arg2, int arg3) => arg1 + arg2 + arg3); + + + + + + Specifies a function that will calculate the value to return from the method, + retrieving the arguments for the invocation. + + Type of the first argument of the invoked method. + Type of the second argument of the invoked method. + Type of the third argument of the invoked method. + Type of the fourth argument of the invoked method. + The function that will calculate the return value. + + Return a calculated value which is evaluated lazily at the time of the invocation. + + The return value is calculated from the value of the actual method invocation arguments. + Notice how the arguments are retrieved by simply declaring them as part of the lambda + expression: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<int>(), + It.IsAny<bool>())) + .Returns((string arg1, string arg2, int arg3, bool arg4) => arg1 + arg2 + arg3 + arg4); + + + + + + Defines the Throws verb. + + + + + Specifies the exception to throw when the method is invoked. + + Exception instance to throw. + + This example shows how to throw an exception when the method is + invoked with an empty string argument: + + mock.Setup(x => x.Execute("")) + .Throws(new ArgumentException()); + + + + + + Specifies the type of exception to throw when the method is invoked. + + Type of exception to instantiate and throw when the setup is matched. + + This example shows how to throw an exception when the method is + invoked with an empty string argument: + + mock.Setup(x => x.Execute("")) + .Throws<ArgumentException>(); + + + + + + Implements the fluent API. + + + + + Implements the fluent API. + + + + + Defines the Callback verb and overloads for callbacks on + setups that return a value. + + Mocked type. + Type of the return value of the setup. + + + + Specifies a callback to invoke when the method is called. + + Callback method to invoke. + + The following example specifies a callback to set a boolean + value that can be used later: + + bool called = false; + mock.Setup(x => x.Execute()) + .Callback(() => called = true) + .Returns(true); + + Note that in the case of value-returning methods, after the Callback + call you can still specify the return value. + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + Type of the argument of the invoked method. + Callback method to invoke. + + Invokes the given callback with the concrete invocation argument value. + + Notice how the specific string argument is retrieved by simply declaring + it as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute(It.IsAny<string>())) + .Callback((string command) => Console.WriteLine(command)) + .Returns(true); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + Type of the first argument of the invoked method. + Type of the second argument of the invoked method. + Callback method to invoke. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>())) + .Callback((string arg1, string arg2) => Console.WriteLine(arg1 + arg2)) + .Returns(true); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + Type of the first argument of the invoked method. + Type of the second argument of the invoked method. + Type of the third argument of the invoked method. + Callback method to invoke. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<int>())) + .Callback((string arg1, string arg2, int arg3) => Console.WriteLine(arg1 + arg2 + arg3)) + .Returns(true); + + + + + + Specifies a callback to invoke when the method is called that receives the original + arguments. + + Type of the first argument of the invoked method. + Type of the second argument of the invoked method. + Type of the third argument of the invoked method. + Type of the fourth argument of the invoked method. + Callback method to invoke. + + Invokes the given callback with the concrete invocation arguments values. + + Notice how the specific arguments are retrieved by simply declaring + them as part of the lambda expression for the callback: + + + mock.Setup(x => x.Execute( + It.IsAny<string>(), + It.IsAny<string>(), + It.IsAny<int>(), + It.IsAny<bool>())) + .Callback((string arg1, string arg2, int arg3, bool arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4)) + .Returns(true); + + + + + + Implemented by all generated mock object instances. + + + + + Implemented by all generated mock object instances. + + + + + Reference the Mock that contains this as the mock.Object value. + + + + + Reference the Mock that contains this as the mock.Object value. + + + + + Implements the actual interception and method invocation for + all mocks. + + + + + Get an eventInfo for a given event name. Search type ancestors depth first if necessary. + + Name of the event, with the set_ or get_ prefix already removed + + + + Given a type return all of its ancestors, both types and interfaces. + + The type to find immediate ancestors of + + + + Implements the fluent API. + + + + + Defines the Never verb. + + + + + The expected invocation is never expected to happen. + + + + var mock = new Mock<ICommand>(); + mock.Setup(foo => foo.Execute("ping")) + .Never(); + + + + is always verified inmediately as + the invocations are performed, like strict mocks do + with unexpected invocations. + + + + + Implements the fluent API. + + + + + Implements the fluent API. + + + + + Implements the fluent API. + + + + + Defines the Callback verb for property setter setups. + + Type of the property. + + + + Specifies a callback to invoke when the property is set that receives the + property value being set. + + Callback method to invoke. + + Invokes the given callback with the property value being set. + + mock.SetupSet(x => x.Suspended) + .Callback((bool state) => Console.WriteLine(state)); + + + + + + Allows the specification of a matching condition for an + argument in a method invocation, rather than a specific + argument value. "It" refers to the argument being matched. + + This class allows the setup to match a method invocation + with an arbitrary value, with a value in a specified range, or + even one that matches a given predicate. + + + + + Matches any value of the given type. + + Typically used when the actual argument value for a method + call is not relevant. + + + // Throws an exception for a call to Remove with any string value. + mock.Setup(x => x.Remove(It.IsAny<string>())).Throws(new InvalidOperationException()); + + Type of the value. + + + + Matches any value that satisfies the given predicate. + Type of the argument to check.The predicate used to match the method argument. + Allows the specification of a predicate to perform matching + of method call arguments. + + This example shows how to return the value 1 whenever the argument to the + Do method is an even number. + + mock.Setup(x => x.Do(It.Is<int>(i => i % 2 == 0))) + .Returns(1); + + This example shows how to throw an exception if the argument to the + method is a negative number: + + mock.Setup(x => x.GetUser(It.Is<int>(i => i < 0))) + .Throws(new ArgumentException()); + + + + + + Matches any value that is in the range specified. + Type of the argument to check.The lower bound of the range.The upper bound of the range. + The kind of range. See . + + The following example shows how to expect a method call + with an integer argument within the 0..100 range. + + mock.Setup(x => x.HasInventory( + It.IsAny<string>(), + It.IsInRange(0, 100, Range.Inclusive))) + .Returns(false); + + + + + + Matches a string argument if it matches the given regular expression pattern. + The pattern to use to match the string argument value. + The following example shows how to expect a call to a method where the + string argument matches the given regular expression: + + mock.Setup(x => x.Check(It.IsRegex("[a-z]+"))).Returns(1); + + + + + + Matches a string argument if it matches the given regular expression pattern. + The pattern to use to match the string argument value.The options used to interpret the pattern. + The following example shows how to expect a call to a method where the + string argument matches the given regular expression, in a case insensitive way: + + mock.Setup(x => x.Check(It.IsRegex("[a-z]+", RegexOptions.IgnoreCase))).Returns(1); + + + + + + Matcher to treat static functions as matchers. + + mock.Setup(x => x.StringMethod(A.MagicString())); + + pbulic static class A + { + [Matcher] + public static string MagicString() { return null; } + public static bool MagicString(string arg) + { + return arg == "magic"; + } + } + + Will success if: mock.Object.StringMethod("magic"); + and fail with any other call. + + + + + We need this non-generics base class so that + we can use from + generic code. + + + + + Base class for mocks and static helper class with methods that + apply to mocked objects, such as to + retrieve a from an object instance. + + + + + Initializes a new instance of the class. + + + + + Retrieves the mock object for the given object instance. + + Type of the mock to retrieve. Can be omitted as it's inferred + from the object instance passed in as the instance. + The instance of the mocked object.The mock associated with the mocked object. + The received instance + was not created by Moq. + + The following example shows how to add a new setup to an object + instance which is not the original but rather + the object associated with it: + + // Typed instance, not the mock, is retrieved from some test API. + HttpContextBase context = GetMockContext(); + + // context.Request is the typed object from the "real" API + // so in order to add a setup to it, we need to get + // the mock that "owns" it + Mock<HttpRequestBase> request = Mock.Get(context.Request); + mock.Setup(req => req.AppRelativeCurrentExecutionFilePath) + .Returns(tempUrl); + + + + + + Returns the mocked object value. + + + + + Verifies that all verifiable expectations have been met. + + This example sets up an expectation and marks it as verifiable. After + the mock is used, a Verify() call is issued on the mock + to ensure the method in the setup was invoked: + + var mock = new Mock<IWarehouse>(); + this.Setup(x => x.HasInventory(TALISKER, 50)).Verifiable().Returns(true); + ... + // other test code + ... + // Will throw if the test code has didn't call HasInventory. + this.Verify(); + + Not all verifiable expectations were met. + + + + Verifies all expectations regardless of whether they have + been flagged as verifiable. + + This example sets up an expectation without marking it as verifiable. After + the mock is used, a call is issued on the mock + to ensure that all expectations are met: + + var mock = new Mock<IWarehouse>(); + this.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true); + ... + // other test code + ... + // Will throw if the test code has didn't call HasInventory, even + // that expectation was not marked as verifiable. + this.VerifyAll(); + + At least one expectation was not met. + + + + Gets the interceptor target for the given expression and root mock, + building the intermediate hierarchy of mock objects if necessary. + + + + + Creates a handler that can be associated to an event receiving + the given and can be used + to raise the event. + + Type of + data passed in to the event. + + This example shows how to invoke an event with a custom event arguments + class in a view that will cause its corresponding presenter to + react by changing its state: + + var mockView = new Mock<IOrdersView>(); + var mockedEvent = mockView.CreateEventHandler<OrderEventArgs>(); + + var presenter = new OrdersPresenter(mockView.Object); + + // Check that the presenter has no selection by default + Assert.Null(presenter.SelectedOrder); + + // Create a mock event handler of the appropriate type + var handler = mockView.CreateEventHandler<OrderEventArgs>(); + // Associate it with the event we want to raise + mockView.Object.Cancel += handler; + // Finally raise the event with a specific arguments data + handler.Raise(new OrderEventArgs { Order = new Order("moq", 500) }); + + // Now the presenter reacted to the event, and we have a selected order + Assert.NotNull(presenter.SelectedOrder); + Assert.Equal("moq", presenter.SelectedOrder.ProductName); + + + + + + Creates a handler that can be associated to an event receiving + a generic and can be used + to raise the event. + + This example shows how to invoke a generic event in a view that will + cause its corresponding presenter to react by changing its state: + + var mockView = new Mock<IOrdersView>(); + var mockedEvent = mockView.CreateEventHandler(); + + var presenter = new OrdersPresenter(mockView.Object); + + // Check that the presenter is not in the "Canceled" state + Assert.False(presenter.IsCanceled); + + // Create a mock event handler of the appropriate type + var handler = mockView.CreateEventHandler(); + // Associate it with the event we want to raise + mockView.Object.Cancel += handler; + // Finally raise the event + handler.Raise(EventArgs.Empty); + + // Now the presenter reacted to the event, and changed its state + Assert.True(presenter.IsCanceled); + + + + + + Adds an interface implementation to the mock, + allowing setups to be specified for it. + + This method can only be called before the first use + of the mock property, at which + point the runtime type has already been generated + and no more interfaces can be added to it. + + Also, must be an + interface and not a class, which must be specified + when creating the mock instead. + + + The mock type + has already been generated by accessing the property. + + The specified + is not an interface. + + The following example creates a mock for the main interface + and later adds to it to verify + it's called by the consumer code: + + var mock = new Mock<IProcessor>(); + mock.Setup(x => x.Execute("ping")); + + // add IDisposable interface + var disposable = mock.As<IDisposable>(); + disposable.Setup(d => d.Dispose()).Verifiable(); + + Type of interface to cast the mock to. + + + + Base class for mocks and static helper class with methods that + apply to mocked objects, such as to + retrieve a from an object instance. + + + + + Behavior of the mock, according to the value set in the constructor. + + + + + Whether the base member virtual implementation will be called + for mocked classes if no setup is matched. Defaults to . + + + + + Specifies the behavior to use when returning default values for + unexpected invocations on loose mocks. + + + + + Gets the mocked object instance, which is of the mocked type . + + + + + Retrieves the type of the mocked object, its generic type argument. + This is used in the auto-mocking of hierarchy access. + + + + + Specifies the class that will determine the default + value to return when invocations are made that + have no setups and need to return a default + value (for loose mocks). + + + + + Exposes the list of extra interfaces implemented by the mock. + + + + + Options to customize the behavior of the mock. + + + + + Causes the mock to always throw + an exception for invocations that don't have a + corresponding setup. + + + + + Will never throw exceptions, returning default + values when necessary (null for reference types, + zero for value types or empty enumerables and arrays). + + + + + Default mock behavior, which equals . + + + + + Represents a generic event that has been mocked and can + be rised. + + + + + Provided solely to allow the interceptor to determine when the attached + handler is coming from this mocked event so we can assign the + corresponding EventInfo for it. + + + + + Raises the associated event with the given + event argument data. + + + + + Raises the associated event with the given + event argument data. + + + + + Provides support for attaching a to + a generic event. + + Event to convert. + + + + Event raised whenever the mocked event is rised. + + + + + Exception thrown by mocks when setups are not matched, + the mock is not properly setup, etc. + + + A distinct exception type is provided so that exceptions + thrown by the mock can be differentiated in tests that + expect other exceptions to be thrown (i.e. ArgumentException). + + Richer exception hierarchy/types are not provided as + tests typically should not catch or expect exceptions + from the mocks. These are typically the result of changes + in the tested class or its collaborators implementation, and + result in fixes in the mock setup so that they dissapear and + allow the test to pass. + + + + + + Supports the serialization infrastructure. + + Serialization information. + Streaming context. + + + + Supports the serialization infrastructure. + + Serialization information. + Streaming context. + + + + Made internal as it's of no use for + consumers, but it's important for + our own tests. + + + + + Used by the mock factory to accumulate verification + failures. + + + + + Supports the serialization infrastructure. + + + + + Utility factory class to use to construct multiple + mocks when consistent verification is + desired for all of them. + + + If multiple mocks will be created during a test, passing + the desired (if different than the + or the one + passed to the factory constructor) and later verifying each + mock can become repetitive and tedious. + + This factory class helps in that scenario by providing a + simplified creation of multiple mocks with a default + (unless overriden by calling + ) and posterior verification. + + + + The following is a straightforward example on how to + create and automatically verify strict mocks using a : + + var factory = new MockFactory(MockBehavior.Strict); + + var foo = factory.Create<IFoo>(); + var bar = factory.Create<IBar>(); + + // no need to call Verifiable() on the setup + // as we'll be validating all of them anyway. + foo.Setup(f => f.Do()); + bar.Setup(b => b.Redo()); + + // exercise the mocks here + + factory.VerifyAll(); + // At this point all setups are already checked + // and an optional MockException might be thrown. + // Note also that because the mocks are strict, any invocation + // that doesn't have a matching setup will also throw a MockException. + + The following examples shows how to setup the factory + to create loose mocks and later verify only verifiable setups: + + var factory = new MockFactory(MockBehavior.Loose); + + var foo = factory.Create<IFoo>(); + var bar = factory.Create<IBar>(); + + // this setup will be verified when we verify the factory + foo.Setup(f => f.Do()).Verifiable(); + + // this setup will NOT be verified + foo.Setup(f => f.Calculate()); + + // this setup will be verified when we verify the factory + bar.Setup(b => b.Redo()).Verifiable(); + + // exercise the mocks here + // note that because the mocks are Loose, members + // called in the interfaces for which no matching + // setups exist will NOT throw exceptions, + // and will rather return default values. + + factory.Verify(); + // At this point verifiable setups are already checked + // and an optional MockException might be thrown. + + The following examples shows how to setup the factory with a + default strict behavior, overriding that default for a + specific mock: + + var factory = new MockFactory(MockBehavior.Strict); + + // this particular one we want loose + var foo = factory.Create<IFoo>(MockBehavior.Loose); + var bar = factory.Create<IBar>(); + + // specify setups + + // exercise the mocks here + + factory.Verify(); + + + + + + + Initializes the factory with the given + for newly created mocks from the factory. + + The behavior to use for mocks created + using the factory method if not overriden + by using the overload. + + + + Creates a new mock with the default + specified at factory construction time. + + Type to mock. + A new . + + + var factory = new MockFactory(MockBehavior.Strict); + + var foo = factory.Create<IFoo>(); + // use mock on tests + + factory.VerifyAll(); + + + + + + Creates a new mock with the default + specified at factory construction time and with the + the given constructor arguments for the class. + + + The mock will try to find the best match constructor given the + constructor arguments, and invoke that to initialize the instance. + This applies only to classes, not interfaces. + + Type to mock. + Constructor arguments for mocked classes. + A new . + + + var factory = new MockFactory(MockBehavior.Default); + + var mock = factory.Create<MyBase>("Foo", 25, true); + // use mock on tests + + factory.Verify(); + + + + + + Creates a new mock with the given . + + Type to mock. + Behavior to use for the mock, which overrides + the default behavior specified at factory construction time. + A new . + + The following example shows how to create a mock with a different + behavior to that specified as the default for the factory: + + var factory = new MockFactory(MockBehavior.Strict); + + var foo = factory.Create<IFoo>(MockBehavior.Loose); + + + + + + Creates a new mock with the given + and with the the given constructor arguments for the class. + + + The mock will try to find the best match constructor given the + constructor arguments, and invoke that to initialize the instance. + This applies only to classes, not interfaces. + + Type to mock. + Behavior to use for the mock, which overrides + the default behavior specified at factory construction time. + Constructor arguments for mocked classes. + A new . + + The following example shows how to create a mock with a different + behavior to that specified as the default for the factory, passing + constructor arguments: + + var factory = new MockFactory(MockBehavior.Default); + + var mock = factory.Create<MyBase>(MockBehavior.Strict, "Foo", 25, true); + + + + + + Implements creation of a new mock within the factory. + + Type to mock. + The behavior for the new mock. + Optional arguments for the construction of the mock. + + + + Verifies all verifiable expectations on all mocks created + by this factory. + + + One or more mocks had expectations that were not satisfied. + + + + Verifies all verifiable expectations on all mocks created + by this factory. + + + One or more mocks had expectations that were not satisfied. + + + + Invokes for each mock + in , and accumulates the resulting + that might be + thrown from the action. + + The action to execute against + each mock. + + + + Whether the base member virtual implementation will be called + for mocked classes if no setup is matched. Defaults to . + + + + + Specifies the behavior to use when returning default values for + unexpected invocations on loose mocks. + + + + + Gets the mocks that have been created by this factory and + that will get verified together. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to Mock type has already been initialized by accessing its Object property. Adding interfaces must be done before that.. + + + + + Looks up a localized string similar to Value cannot be an empty string.. + + + + + Looks up a localized string similar to Can only add interfaces to the mock.. + + + + + Looks up a localized string similar to Can't set return value for void method {0}.. + + + + + Looks up a localized string similar to Constructor arguments cannot be passed for interface mocks.. + + + + + Looks up a localized string similar to A matching constructor for the given arguments was not found on the mocked type.. + + + + + Looks up a localized string similar to Expression {0} involves a field access, which is not supported. Use properties instead.. + + + + + Looks up a localized string similar to Type to mock must be an interface or an abstract or non-sealed class. . + + + + + Looks up a localized string similar to Cannot retrieve a mock with the given object type {0} as it's not the main type of the mock or any of its additional interfaces. + Please cast the argument to one of the supported types: {1}. + Remember that there's no generics covariance in the CLR, so your object must be one of these types in order for the call to succeed.. + + + + + Looks up a localized string similar to Member {0}.{1} does not exist.. + + + + + Looks up a localized string similar to Method {0}.{1} is public. Use strong-typed Expect overload instead: + mock.Setup(x => x.{1}()); + . + + + + + Looks up a localized string similar to {0} invocation failed with mock behavior {1}. + {2}. + + + + + Looks up a localized string similar to Expected only {0} calls to {1}.. + + + + + Looks up a localized string similar to Expected only one call to {0}.. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock at least {2} times, but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock at least once, but was never performed: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock at most {3} times, but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock at most once, but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock between {2} and {3} times (Exclusive), but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock between {2} and {3} times (Inclusive), but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock exactly {2} times, but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock should never have been performed, but was {4} times: {1}. + + + + + Looks up a localized string similar to {0} + Expected invocation on the mock once, but was {4} times: {1}. + + + + + Looks up a localized string similar to All invocations on the mock must have a corresponding setup.. + + + + + Looks up a localized string similar to Object instance was not created by Moq.. + + + + + Looks up a localized string similar to Property {0}.{1} does not exist.. + + + + + Looks up a localized string similar to Property {0}.{1} is write-only.. + + + + + Looks up a localized string similar to Property {0}.{1} is read-only.. + + + + + Looks up a localized string similar to Cannot raise a mocked event unless it has been associated (attached) to a concrete event in a mocked object.. + + + + + Looks up a localized string similar to Invocation needs to return a value and therefore must have a corresponding setup that provides it.. + + + + + Looks up a localized string similar to A lambda expression is expected as the argument to It.Is<T>.. + + + + + Looks up a localized string similar to Invocation {0} should not have been made.. + + + + + Looks up a localized string similar to Expression is not a method invocation: {0}. + + + + + Looks up a localized string similar to Expression is not a property access: {0}. + + + + + Looks up a localized string similar to Expression is not a property setter invocation.. + + + + + Looks up a localized string similar to Invalid setup on a non-member method: + {0}. + + + + + Looks up a localized string similar to Invalid setup on a non-overridable member: + {0}. + + + + + Looks up a localized string similar to Type {0} does not implement required interface {1}. + + + + + Looks up a localized string similar to Type {0} does not from required type {1}. + + + + + Looks up a localized string similar to To specify a setup for public property {0}.{1}, use the typed overloads, such as: + mock.Setup(x => x.{1}).Returns(value); + mock.SetupGet(x => x.{1}).Returns(value); //equivalent to previous one + mock.SetupSet(x => x.{1}).Callback(callbackDelegate); + . + + + + + Looks up a localized string similar to Expression {0} is not supported.. + + + + + Looks up a localized string similar to Only property accesses are supported in intermediate invocations on a setup. Unsupported expression {0}.. + + + + + Looks up a localized string similar to Expression contains intermediate property access {0}.{1} which is of type {2} and cannot be mocked. Unsupported expression {3}.. + + + + + Looks up a localized string similar to Setter expression cannot use argument matchers that receive parameters.. + + + + + Looks up a localized string similar to Member {0} is not supported for protected mocking.. + + + + + Looks up a localized string similar to Setter expression can only use static custom matchers.. + + + + + Looks up a localized string similar to To specify a setup for protected property {0}.{1}, use: + mock.Setup<{2}>(x => x.{1}).Returns(value); + mock.SetupGet(x => x.{1}).Returns(value); //equivalent to previous one + mock.SetupSet(x => x.{1}).Callback(callbackDelegate);. + + + + + Looks up a localized string similar to The following setups were not matched: + {0}. + + + + + Allows setups to be specified for protected members by using their + name as a string, rather than strong-typing them which is not possible + due to their visibility. + + + + + Specifies a setup for a void method invocation with the given + , optionally specifying + arguments for the method call. + + Name of the void method to be invoke. + Optional arguments for the invocation. If argument matchers are used, + remember to use rather than . + + + + Specifies a setup for an invocation on a property or a non void method with the given + , optionally specifying + arguments for the method call. + + Name of the method or property to be invoke. + Optional arguments for the invocation. If argument matchers are used, + remember to use rather than . + Return type of the method or property. + + + + Specifies a setup for an invocation on a property getter with the given + . + + Name of the property. + Type of the property. + + + + Specifies a setup for an invocation on a property setter with the given + . + + Name of the property. + Type of the property. + + + + Allows the specification of a matching condition for an + argument in a protected member setup, rather than a specific + argument value. "ItExpr" refers to the argument being matched. + + + Use this variant of argument matching instead of + for protected setups. + This class allows the setup to match a method invocation + with an arbitrary value, with a value in a specified range, or + even one that matches a given predicate, or null. + + + + + Matches a null value of the given type. + + + Required for protected mocks as the null value cannot be used + directly as it prevents proper method overload selection. + + + + // Throws an exception for a call to Remove with a null string value. + mock.Protected() + .Setup("Remove", ItExpr.IsNull<string>()) + .Throws(new InvalidOperationException()); + + + Type of the value. + + + + Matches any value of the given type. + + + Typically used when the actual argument value for a method + call is not relevant. + + + + // Throws an exception for a call to Remove with any string value. + mock.Protected() + .Setup("Remove", ItExpr.IsAny<string>()) + .Throws(new InvalidOperationException()); + + + Type of the value. + + + + Matches any value that satisfies the given predicate. + + Type of the argument to check. + The predicate used to match the method argument. + + Allows the specification of a predicate to perform matching + of method call arguments. + + + This example shows how to return the value 1 whenever the argument to the + Do method is an even number. + + mock.Protected() + .Setup("Do", ItExpr.Is<int>(i => i % 2 == 0)) + .Returns(1); + + This example shows how to throw an exception if the argument to the + method is a negative number: + + mock.Protected() + .Setup("GetUser", ItExpr.Is<int>(i => i < 0)) + .Throws(new ArgumentException()); + + + + + + Matches any value that is in the range specified. + + Type of the argument to check. + The lower bound of the range. + The upper bound of the range. + The kind of range. See . + + The following example shows how to expect a method call + with an integer argument within the 0..100 range. + + mock.Protected() + .Setup("HasInventory", + ItExpr.IsAny<string>(), + ItExpr.IsInRange(0, 100, Range.Inclusive)) + .Returns(false); + + + + + + Matches a string argument if it matches the given regular expression pattern. + + The pattern to use to match the string argument value. + + The following example shows how to expect a call to a method where the + string argument matches the given regular expression: + + mock.Protected() + .Setup("Check", ItExpr.IsRegex("[a-z]+")) + .Returns(1); + + + + + + Matches a string argument if it matches the given regular expression pattern. + + The pattern to use to match the string argument value. + The options used to interpret the pattern. + + The following example shows how to expect a call to a method where the + string argument matches the given regular expression, in a case insensitive way: + + mock.Protected() + .Setup("Check", ItExpr.IsRegex("[a-z]+", RegexOptions.IgnoreCase)) + .Returns(1); + + + + + + Enables the Protected() method on , + allowing setups to be set for protected members by using their + name as a string, rather than strong-typing them which is not possible + due to their visibility. + + + + + Enable protected setups for the mock. + + Mocked object type. Typically omitted as it can be inferred from the mock instance. + The mock to set the protected setups on. + + + + + + + + + + + + Kind of range to use in a filter specified through + . + + + + + The range includes the to and + from values. + + + + + The range does not include the to and + from values. + + + + + Provides a mock implementation of . + + Any interface type can be used for mocking, but for classes, only abstract and virtual members can be mocked. + + The behavior of the mock with regards to the setups and the actual calls is determined + by the optional that can be passed to the + constructor. + + Type to mock, which can be an interface or a class. + The following example shows establishing setups with specific values + for method invocations: + + // Arrange + var order = new Order(TALISKER, 50); + var mock = new Mock<IWarehouse>(); + + mock.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true); + + // Act + order.Fill(mock.Object); + + // Assert + Assert.True(order.IsFilled); + + The following example shows how to use the class + to specify conditions for arguments instead of specific values: + + // Arrange + var order = new Order(TALISKER, 50); + var mock = new Mock<IWarehouse>(); + + // shows how to expect a value within a range + mock.Setup(x => x.HasInventory( + It.IsAny<string>(), + It.IsInRange(0, 100, Range.Inclusive))) + .Returns(false); + + // shows how to throw for unexpected calls. + mock.Setup(x => x.Remove( + It.IsAny<string>(), + It.IsAny<int>())) + .Throws(new InvalidOperationException()); + + // Act + order.Fill(mock.Object); + + // Assert + Assert.False(order.IsFilled); + + + + + + Ctor invoked by AsTInterface exclusively. + + + + + Initializes an instance of the mock with default behavior. + + var mock = new Mock<IFormatProvider>(); + + + + + Initializes an instance of the mock with default behavior and with + the given constructor arguments for the class. (Only valid when is a class) + + The mock will try to find the best match constructor given the constructor arguments, and invoke that + to initialize the instance. This applies only for classes, not interfaces. + + var mock = new Mock<MyProvider>(someArgument, 25); + Optional constructor arguments if the mocked type is a class. + + + + Initializes an instance of the mock with the specified behavior. + + var mock = new Mock<IFormatProvider>(MockBehavior.Relaxed); + Behavior of the mock. + + + + Initializes an instance of the mock with a specific behavior with + the given constructor arguments for the class. + + The mock will try to find the best match constructor given the constructor arguments, and invoke that + to initialize the instance. This applies only to classes, not interfaces. + + var mock = new Mock<MyProvider>(someArgument, 25); + Behavior of the mock.Optional constructor arguments if the mocked type is a class. + + + + Returns the mocked object value. + + + + + Specifies a setup on the mocked type for a call to + to a void method. + + If more than one setup is specified for the same method or property, + the latest one wins and is the one that will be executed. + Lambda expression that specifies the expected method invocation. + + var mock = new Mock<IProcessor>(); + mock.Setup(x => x.Execute("ping")); + + + + + + Specifies a setup on the mocked type for a call to + to a value returning method. + Type of the return value. Typically omitted as it can be inferred from the expression. + If more than one setup is specified for the same method or property, + the latest one wins and is the one that will be executed. + Lambda expression that specifies the method invocation. + + mock.Setup(x => x.HasInventory("Talisker", 50)).Returns(true); + + + + + + Specifies a setup on the mocked type for a call to + to a property getter. + + If more than one setup is set for the same property getter, + the latest one wins and is the one that will be executed. + Type of the property. Typically omitted as it can be inferred from the expression.Lambda expression that specifies the property getter. + + mock.SetupGet(x => x.Suspended) + .Returns(true); + + + + + + Specifies a setup on the mocked type for a call to + to a property setter. + + If more than one setup is set for the same property setter, + the latest one wins and is the one that will be executed. + + This overloads allows the use of a callback already + typed for the property type. + + Type of the property. Typically omitted as it can be inferred from the expression.Lambda expression that sets a property to a value. + + mock.SetupSet(x => x.Suspended = true); + + + + + + Specifies a setup on the mocked type for a call to + to a property setter. + + If more than one setup is set for the same property setter, + the latest one wins and is the one that will be executed. + Lambda expression that sets a property to a value. + + mock.SetupSet(x => x.Suspended = true); + + + + + + Specifies that the given property should have "property behavior", + meaning that setting its value will cause it to be saved and + later returned when the property is requested. (this is also + known as "stubbing"). + + Type of the property, inferred from the property + expression (does not need to be specified). + Property expression to stub. + If you have an interface with an int property Value, you might + stub it using the following straightforward call: + + var mock = new Mock<IHaveValue>(); + mock.Stub(v => v.Value); + + After the Stub call has been issued, setting and + retrieving the object value will behave as expected: + + IHaveValue v = mock.Object; + + v.Value = 5; + Assert.Equal(5, v.Value); + + + + + + Specifies that the given property should have "property behavior", + meaning that setting its value will cause it to be saved and + later returned when the property is requested. This overload + allows setting the initial value for the property. (this is also + known as "stubbing"). + + Type of the property, inferred from the property + expression (does not need to be specified). + Property expression to stub.Initial value for the property. + If you have an interface with an int property Value, you might + stub it using the following straightforward call: + + var mock = new Mock<IHaveValue>(); + mock.SetupProperty(v => v.Value, 5); + + After the SetupProperty call has been issued, setting and + retrieving the object value will behave as expected: + + IHaveValue v = mock.Object; + // Initial value was stored + Assert.Equal(5, v.Value); + + // New value set which changes the initial value + v.Value = 6; + Assert.Equal(6, v.Value); + + + + + + Specifies that the all properties on the mock should have "property behavior", + meaning that setting its value will cause it to be saved and + later returned when the property is requested. (this is also + known as "stubbing"). The default value for each property will be the + one generated as specified by the property for the mock. + + If the mock is set to , + the mocked default values will also get all properties setup recursively. + + + + + Verifies that a specific invocation matching the given expression was performed on the mock. Use + in conjuntion with the default . + + This example assumes that the mock has been used, and later we want to verify that a given + invocation with specific parameters was performed: + + var mock = new Mock<IProcessor>(); + // exercise mock + //... + // Will throw if the test code didn't call Execute with a "ping" string argument. + mock.Verify(proc => proc.Execute("ping")); + + The invocation was not performed on the mock.Expression to verify. + + + + Verifies that a specific invocation matching the given expression was performed on the mock. Use + in conjuntion with the default . + + The invocation was not call the times specified by + . + Expression to verify.The number of times a method is allowed to be called. + + + + Verifies that a specific invocation matching the given expression was performed on the mock, + specifying a failure error message. Use in conjuntion with the default + . + + This example assumes that the mock has been used, and later we want to verify that a given + invocation with specific parameters was performed: + + var mock = new Mock<IProcessor>(); + // exercise mock + //... + // Will throw if the test code didn't call Execute with a "ping" string argument. + mock.Verify(proc => proc.Execute("ping")); + + The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. + + + + Verifies that a specific invocation matching the given expression was performed on the mock, + specifying a failure error message. Use in conjuntion with the default + . + + The invocation was not call the times specified by + . + Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails. + + + + Verifies that a specific invocation matching the given expression was performed on the mock. Use + in conjuntion with the default . + + This example assumes that the mock has been used, and later we want to verify that a given + invocation with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't call HasInventory. + mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50)); + + The invocation was not performed on the mock.Expression to verify.Type of return value from the expression. + + + + Verifies that a specific invocation matching the given + expression was performed on the mock. Use in conjuntion + with the default . + + The invocation was not call the times specified by + . + Expression to verify.The number of times a method is allowed to be called.Type of return value from the expression. + + + + Verifies that a specific invocation matching the given + expression was performed on the mock, specifying a failure + error message. + + This example assumes that the mock has been used, + and later we want to verify that a given invocation + with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't call HasInventory. + mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50), "When filling orders, inventory has to be checked"); + + The invocation was not performed on the mock.Expression to verify.Message to show if verification fails.Type of return value from the expression. + + + + Verifies that a specific invocation matching the given + expression was performed on the mock, specifying a failure + error message. + + The invocation was not call the times specified by + . + Expression to verify.The number of times a method is allowed to be called.Message to show if verification fails.Type of return value from the expression. + + + + Verifies that a property was read on the mock. + + This example assumes that the mock has been used, + and later we want to verify that a given property + was retrieved from it: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't retrieve the IsClosed property. + mock.VerifyGet(warehouse => warehouse.IsClosed); + + The invocation was not performed on the mock.Expression to verify. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + + Verifies that a property was read on the mock. + + The invocation was not call the times specified by + . + The number of times a method is allowed to be called.Expression to verify. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + + Verifies that a property was read on the mock, specifying a failure + error message. + + This example assumes that the mock has been used, + and later we want to verify that a given property + was retrieved from it: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't retrieve the IsClosed property. + mock.VerifyGet(warehouse => warehouse.IsClosed); + + The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + + Verifies that a property was read on the mock, specifying a failure + error message. + + The invocation was not call the times specified by + . + The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + + Verifies that a property was set on the mock. + + This example assumes that the mock has been used, + and later we want to verify that a given property + was set on it: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed = true); + + The invocation was not performed on the mock.Expression to verify. + + + + Verifies that a property was set on the mock. + + The invocation was not call the times specified by + . + The number of times a method is allowed to be called.Expression to verify. + + + + Verifies that a property was set on the mock, specifying + a failure message. + + This example assumes that the mock has been used, + and later we want to verify that a given property + was set on it: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed = true, "Warehouse should always be closed after the action"); + + The invocation was not performed on the mock.Expression to verify.Message to show if verification fails. + + + + Verifies that a property was set on the mock, specifying + a failure message. + + The invocation was not call the times specified by + . + The number of times a method is allowed to be called.Expression to verify.Message to show if verification fails. + + + + Raises the event referenced in using + the given and arguments. + + The argument is + invalid for the target event invocation, or the is + not an event attach or detach expression. + + The following example shows how to raise a event: + + var mock = new Mock<IViewModel>(); + + mock.Raise(x => x.PropertyChanged -= null, new PropertyChangedEventArgs("Name")); + + + This example shows how to invoke an event with a custom event arguments + class in a view that will cause its corresponding presenter to + react by changing its state: + + var mockView = new Mock<IOrdersView>(); + var presenter = new OrdersPresenter(mockView.Object); + + // Check that the presenter has no selection by default + Assert.Null(presenter.SelectedOrder); + + // Raise the event with a specific arguments data + mockView.Raise(v => v.SelectionChanged += null, new OrderEventArgs { Order = new Order("moq", 500) }); + + // Now the presenter reacted to the event, and we have a selected order + Assert.NotNull(presenter.SelectedOrder); + Assert.Equal("moq", presenter.SelectedOrder.ProductName); + + + + + + Raises the event referenced in using + the given and arguments + for a non-EventHandler typed event. + + The arguments are + invalid for the target event invocation, or the is + not an event attach or detach expression. + + The following example shows how to raise a custom event that does not adhere to + the standard EventHandler: + + var mock = new Mock<IViewModel>(); + + mock.Raise(x => x.MyEvent -= null, "Name", bool, 25); + + + + + + Obsolete. + + + + + Obsolete. + + + + + Obsolete. + + + + + Obsolete. + + + + + Obsolete. + + + + + Exposes the mocked object instance. + + + + + Determines the way default values are generated + calculated for loose mocks. + + + + + Default behavior, which generates empty values for + value types (i.e. default(int)), empty array and + enumerables, and nulls for all other reference types. + + + + + Whenever the default value generated by + is null, replaces this value with a mock (if the type + can be mocked). + + + For sealed classes, a null value will be generated. + + + + + Replaces references to one specific instance of an expression node with another node + + + + + A default implementation of IQueryable for use with QueryProvider + + + + + A basic abstract LINQ query provider + + + + + Type related helper methods + + + + + Allows creation custom value matchers that can be used on setups and verification, + completely replacing the built-in class with your own argument + matching rules. + + + + + Provided for the sole purpose of rendering the delegate passed to the + matcher constructor if no friendly render lambda is provided. + + + + + Allows creation custom value matchers that can be used on setups and verification, + completely replacing the built-in class with your own argument + matching rules. + Type of the value to match. + The argument matching is used to determine whether a concrete + invocation in the mock matches a given setup. This + matching mechanism is fully extensible. + + Creating a custom matcher is straightforward. You just need to create a method + that returns a value from a call to with + your matching condition and optional friendly render expression: + + public Order IsBigOrder() + { + return Match<Order>.Create( + o => o.GrandTotal >= 5000, + /* a friendly expression to render on failures */ + () => IsBigOrder()); + } + + This method can be used in any mock setup invocation: + + mock.Setup(m => m.Submit(IsBigOrder()).Throws<UnauthorizedAccessException>(); + + At runtime, Moq knows that the return value was a matcher and + evaluates your predicate with the actual value passed into your predicate. + + Another example might be a case where you want to match a lists of orders + that contains a particular one. You might create matcher like the following: + + + public static class Orders + { + public static IEnumerable<Order> Contains(Order order) + { + return Match<IEnumerable<Order>>.Create(orders => orders.Contains(order)); + } + } + + Now we can invoke this static method instead of an argument in an + invocation: + + var order = new Order { ... }; + var mock = new Mock<IRepository<Order>>(); + + mock.Setup(x => x.Save(Orders.Contains(order))) + .Throws<ArgumentException>(); + + + + + + Initializes the match with the condition that + will be checked in order to match invocation + values. + The condition to match against actual values. + + + + + + + + + + + + This method is used to set an expression as the last matcher invoked, + which is used in the SetupSet to allow matchers in the prop = value + delegate expression. This delegate is executed in "fluent" mode in + order to capture the value being set, and construct the corresponding + methodcall. + This is also used in the MatcherFactory for each argument expression. + This method ensures that when we execute the delegate, we + also track the matcher that was invoked, so that when we create the + methodcall we build the expression using it, rather than the null/default + value returned from the actual invocation. + + + + + Provides legacy API members as extensions so that + existing code continues to compile, but new code + doesn't see then. + + + + + Obsolete. + + + + + Obsolete. + + + + + Obsolete. + + + + + Tracks the current mock and interception context. + + + + + Having an active fluent mock context means that the invocation + is being performed in "trial" mode, just to gather the + target method and arguments that need to be matched later + when the actual invocation is made. + + + + + A that returns an empty default value + for non-mockeable types, and mocks for all other types (interfaces and + non-sealed classes) that can be mocked. + + + + + Provides a typed for a + specific type of . + + The type of event arguments required by the event. + + The mocked event can either be a or custom + event handler which follows .NET practice of providing object sender, EventArgs args + kind of signature. + + + + + Raises the associated event with the given + event argument data. + + Data to pass to the event. + + + + Provides support for attaching a to + a generic event. + + Event to convert. + + + + Provided solely to allow the interceptor to determine when the attached + handler is coming from this mocked event so we can assign the + corresponding EventInfo for it. + + + + + Provides additional methods on mocks. + + + Provided as extension methods as they confuse the compiler + with the overloads taking Action. + + + + + Specifies a setup on the mocked type for a call to + to a property setter, regardless of its value. + + + If more than one setup is set for the same property setter, + the latest one wins and is the one that will be executed. + + Type of the property. Typically omitted as it can be inferred from the expression. + Type of the mock. + The target mock for the setup. + Lambda expression that specifies the property setter. + + + mock.SetupSet(x => x.Suspended); + + + + This method is not legacy, but must be on an extension method to avoid + confusing the compiler with the new Action syntax. + + + + + Verifies that a property has been set on the mock, regarless of its value. + + + This example assumes that the mock has been used, + and later we want to verify that a given invocation + with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed); + + + The invocation was not performed on the mock. + Expression to verify. + The mock instance. + Mocked type. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + Verifies that a property has been set on the mock, specifying a failure + error message. + + + This example assumes that the mock has been used, + and later we want to verify that a given invocation + with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed); + + + The invocation was not performed on the mock. + Expression to verify. + Message to show if verification fails. + The mock instance. + Mocked type. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + Verifies that a property has been set on the mock, regardless + of the value but only the specified number of times. + + + This example assumes that the mock has been used, + and later we want to verify that a given invocation + with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed); + + + The invocation was not performed on the mock. + The invocation was not call the times specified by + . + The mock instance. + Mocked type. + The number of times a method is allowed to be called. + Expression to verify. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + Verifies that a property has been set on the mock, regardless + of the value but only the specified number of times, and specifying a failure + error message. + + + This example assumes that the mock has been used, + and later we want to verify that a given invocation + with specific parameters was performed: + + var mock = new Mock<IWarehouse>(); + // exercise mock + //... + // Will throw if the test code didn't set the IsClosed property. + mock.VerifySet(warehouse => warehouse.IsClosed); + + + The invocation was not performed on the mock. + The invocation was not call the times specified by + . + The mock instance. + Mocked type. + The number of times a method is allowed to be called. + Message to show if verification fails. + Expression to verify. + Type of the property to verify. Typically omitted as it can + be inferred from the expression's return type. + + + + Allows querying the universe of mocks for those that behave + according to the query specification. + + + + + Creates a query for mocks of the given type. + + The type of mocked object to query. + + + + Method that is turned into the actual call from .Query{T}, to + transform the queryable query into a normal enumerable query. + This method should not be used by consumers. + + + + + + + The first method call or member access will be the + last segment of the expression (depth-first traversal), + which is the one we have to Setup rather than FluentMock. + And the last one is the one we have to Mock.Get rather + than FluentMock. + + + + + Helper extensions that are used by the query translator. + + + + + Retrieves a fluent mock from the given setup expression. + + + + + Legacy Stub stuff, moved to the core API. + + + + + Obsolete. Use . + + + + + Obsolete. Use . + + + + + Obsolete. Use . + + + + + Defines the number of invocations allowed by a mocked method. + + + + + Specifies that a mocked method should be invoked times as minimum. + + The minimun number of times. + An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked one time as minimum. + + An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked time as maximun. + + The maximun number of times. + An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked one time as maximun. + + An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked between and + times. + + The minimun number of times. + The maximun number of times. + The kind of range. See . + An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked exactly times. + + The times that a method or property can be called. + An object defining the allowed number of invocations. + + + + Specifies that a mocked method should not be invoked. + + An object defining the allowed number of invocations. + + + + Specifies that a mocked method should be invoked exactly one time. + + An object defining the allowed number of invocations. + + + diff --git a/lib/msbuild/MSBuild.Community.Tasks.Targets b/lib/msbuild/MSBuild.Community.Tasks.Targets index a04f036a015..6510272f663 100644 --- a/lib/msbuild/MSBuild.Community.Tasks.Targets +++ b/lib/msbuild/MSBuild.Community.Tasks.Targets @@ -1,116 +1,116 @@ - - - - - - - . - $(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + . + $(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/msdeploy/TBEX.xml b/lib/msdeploy/TBEX.xml index f7bc6f3af60..f773b314e96 100644 --- a/lib/msdeploy/TBEX.xml +++ b/lib/msdeploy/TBEX.xml @@ -1,75 +1,75 @@ - - - - - Getting Started with Orchard - Welcome to the Orchard community! We want your experience with your new site to be as smooth as possible. Please read this to get started... - http://docs.orchardproject.net/Documentation/Getting-Started - http://orchardproject.net/Themes/OrchardProject.Net/Images/orchardicon.png - - - Free Pluralsight Training on Orchard - Watch Pluralsight's free introduction to Orchard course. - http://www.pluralsight-training.net/microsoft/players/PSODPlayer.aspx?author=kevin-kuebler&name=introduction-to-orchard&mode=live&clip=0&course=orchard-fundamentals - http://orchardproject.net/Themes/OrchardProject.Net/Images/orchardicon.png - - - More documentation - We have documentation available on a variety of topics. - http://docs.orchardproject.net - http://orchardproject.net/Themes/OrchardProject.Net/Images/orchardicon.png - - - More videos - Learn through these great video tutorials. - http://docs.orchardproject.net/Documentation/Orchard-TV - http://orchardproject.net/Themes/OrchardProject.Net/Images/orchardicon.png - - - Orchard Gallery - Hundreds of free modules and themes are available from our gallery. - http://gallery.orchardproject.net/ - http://orchardproject.net/Themes/OrchardProject.Net/Images/orchardicon.png - - - Orchard Forums - If you have questions, suggestions or just want to hang out with other Orchard users and experts, please visit our forums. - http://orchard.codeplex.com/discussions - http://orchardproject.net/Themes/OrchardProject.Net/Images/orchardicon.png - - - - - - /admin - http://orchardproject.net/Themes/OrchardProject.Net/Images/orchardicon.png - - - - /Packaging/Gallery/Modules - http://orchardproject.net/Themes/OrchardProject.Net/Images/o.png - - - - /Packaging/Gallery/Themes - http://orchardproject.net/Themes/OrchardProject.Net/Images/o.png - - - - - modules - - - themes - - - media - - - web.config - - - * - - - + + + + + Getting Started with Orchard + Welcome to the Orchard community! We want your experience with your new site to be as smooth as possible. Please read this to get started... + http://docs.orchardproject.net/Documentation/Getting-Started + http://orchardproject.net/Themes/OrchardProject.Net/Images/orchardicon.png + + + Free Pluralsight Training on Orchard + Watch Pluralsight's free introduction to Orchard course. + http://www.pluralsight-training.net/microsoft/players/PSODPlayer.aspx?author=kevin-kuebler&name=introduction-to-orchard&mode=live&clip=0&course=orchard-fundamentals + http://orchardproject.net/Themes/OrchardProject.Net/Images/orchardicon.png + + + More documentation + We have documentation available on a variety of topics. + http://docs.orchardproject.net + http://orchardproject.net/Themes/OrchardProject.Net/Images/orchardicon.png + + + More videos + Learn through these great video tutorials. + http://docs.orchardproject.net/Documentation/Orchard-TV + http://orchardproject.net/Themes/OrchardProject.Net/Images/orchardicon.png + + + Orchard Gallery + Hundreds of free modules and themes are available from our gallery. + http://gallery.orchardproject.net/ + http://orchardproject.net/Themes/OrchardProject.Net/Images/orchardicon.png + + + Orchard Forums + If you have questions, suggestions or just want to hang out with other Orchard users and experts, please visit our forums. + http://orchard.codeplex.com/discussions + http://orchardproject.net/Themes/OrchardProject.Net/Images/orchardicon.png + + + + + + /admin + http://orchardproject.net/Themes/OrchardProject.Net/Images/orchardicon.png + + + + /Packaging/Gallery/Modules + http://orchardproject.net/Themes/OrchardProject.Net/Images/o.png + + + + /Packaging/Gallery/Themes + http://orchardproject.net/Themes/OrchardProject.Net/Images/o.png + + + + + modules + + + themes + + + media + + + web.config + + + * + + + diff --git a/lib/msdeploy/manifest.xml b/lib/msdeploy/manifest.xml index 670d2c3e3a9..534d4fdc4b0 100644 --- a/lib/msdeploy/manifest.xml +++ b/lib/msdeploy/manifest.xml @@ -1,13 +1,13 @@ - - - - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/lib/msdeploy/parameters.xml b/lib/msdeploy/parameters.xml index 95b029f92f7..2597677c2ec 100644 --- a/lib/msdeploy/parameters.xml +++ b/lib/msdeploy/parameters.xml @@ -1,66 +1,66 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/newtonsoft.json/Newtonsoft.Json.xml b/lib/newtonsoft.json/Newtonsoft.Json.xml index 687c2770d98..4ecec600bce 100644 --- a/lib/newtonsoft.json/Newtonsoft.Json.xml +++ b/lib/newtonsoft.json/Newtonsoft.Json.xml @@ -1,8777 +1,8777 @@ - - - - Newtonsoft.Json - - - - - Represents a BSON Oid (object id). - - - - - Initializes a new instance of the class. - - The Oid value. - - - - Gets or sets the value of the Oid. - - The value of the Oid. - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized JSON data. - - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized JSON data. - - - - - Initializes a new instance of the class with the specified . - - - - - Reads the next JSON token from the stream. - - true if the next token was read successfully; false if there are no more tokens to read. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a []. - - A [] or a null reference if the next JSON token is null. This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Skips the children of the current token. - - - - - Sets the current token. - - The new token. - - - - Sets the current token and value. - - The new token. - The value. - - - - Sets the state based on current token type. - - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Changes the to Closed. - - - - - Gets the current reader state. - - The current reader state. - - - - Gets or sets a value indicating whether the underlying stream or - should be closed when the reader is closed. - - - true to close the underlying stream or when - the reader is closed; otherwise false. The default is true. - - - - - Gets or sets a value indicating whether multiple pieces of JSON content can - be read from a continuous stream without erroring. - - - true to support reading multiple pieces of JSON content; otherwise false. The default is false. - - - - - Gets the quotation mark character used to enclose the value of a string. - - - - - Get or set how time zones are handling when reading JSON. - - - - - Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - - - - - Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - - - - - Get or set how custom date formatted strings are parsed when reading JSON. - - - - - Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . - - - - - Gets the type of the current JSON token. - - - - - Gets the text value of the current JSON token. - - - - - Gets The Common Language Runtime (CLR) type for the current JSON token. - - - - - Gets the depth of the current token in the JSON document. - - The depth of the current token in the JSON document. - - - - Gets the path of the current JSON token. - - - - - Gets or sets the culture used when reading JSON. Defaults to . - - - - - Specifies the state of the reader. - - - - - The Read method has not been called. - - - - - The end of the file has been reached successfully. - - - - - Reader is at a property. - - - - - Reader is at the start of an object. - - - - - Reader is in an object. - - - - - Reader is at the start of an array. - - - - - Reader is in an array. - - - - - The Close method has been called. - - - - - Reader has just read a value. - - - - - Reader is at the start of a constructor. - - - - - Reader in a constructor. - - - - - An error occurred that prevents the read operation from continuing. - - - - - The end of the file has been reached successfully. - - - - - Initializes a new instance of the class. - - The stream. - - - - Initializes a new instance of the class. - - The reader. - - - - Initializes a new instance of the class. - - The stream. - if set to true the root object will be read as a JSON array. - The used when reading values from BSON. - - - - Initializes a new instance of the class. - - The reader. - if set to true the root object will be read as a JSON array. - The used when reading values from BSON. - - - - Reads the next JSON token from the stream as a []. - - - A [] or a null reference if the next JSON token is null. This method will return null at the end of an array. - - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - - A . This method will return null at the end of an array. - - - - - Reads the next JSON token from the stream. - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Changes the to Closed. - - - - - Gets or sets a value indicating whether binary data reading should compatible with incorrect Json.NET 3.5 written binary. - - - true if binary data reading will be compatible with incorrect Json.NET 3.5 written binary; otherwise, false. - - - - - Gets or sets a value indicating whether the root object will be read as a JSON array. - - - true if the root object will be read as a JSON array; otherwise, false. - - - - - Gets or sets the used when reading values from BSON. - - The used when reading values from BSON. - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. - - - - - Creates an instance of the JsonWriter class. - - - - - Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. - - - - - Closes this stream and the underlying stream. - - - - - Writes the beginning of a Json object. - - - - - Writes the end of a Json object. - - - - - Writes the beginning of a Json array. - - - - - Writes the end of an array. - - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes the end constructor. - - - - - Writes the property name of a name/value pair on a JSON object. - - The name of the property. - - - - Writes the property name of a name/value pair on a JSON object. - - The name of the property. - A flag to indicate whether the text should be escaped when it is written as a JSON property name. - - - - Writes the end of the current Json object or array. - - - - - Writes the current token and its children. - - The to read the token from. - - - - Writes the current token. - - The to read the token from. - A flag indicating whether the current token's children should be written. - - - - Writes the token and its value. - - The to write. - - The value to write. - A value is only required for tokens that have an associated value, e.g. the property name for . - A null value can be passed to the method for token's that don't have a value, e.g. . - - - - Writes the token. - - The to write. - - - - Writes the specified end token. - - The end token to write. - - - - Writes indent characters. - - - - - Writes the JSON value delimiter. - - - - - Writes an indent space. - - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes raw JSON without changing the writer's state. - - The raw JSON to write. - - - - Writes raw JSON where a value is expected and updates the writer's state. - - The raw JSON to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a [] value. - - The [] value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes out a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes out the given white space. - - The string of white space characters. - - - - Sets the state of the JsonWriter, - - The JsonToken being written. - The value being written. - - - - Gets or sets a value indicating whether the underlying stream or - should be closed when the writer is closed. - - - true to close the underlying stream or when - the writer is closed; otherwise false. The default is true. - - - - - Gets the top. - - The top. - - - - Gets the state of the writer. - - - - - Gets the path of the writer. - - - - - Indicates how JSON text output is formatted. - - - - - Get or set how dates are written to JSON text. - - - - - Get or set how time zones are handling when writing JSON text. - - - - - Get or set how strings are escaped when writing JSON text. - - - - - Get or set how special floating point numbers, e.g. , - and , - are written to JSON text. - - - - - Get or set how and values are formatting when writing JSON text. - - - - - Gets or sets the culture used when writing JSON. Defaults to . - - - - - Initializes a new instance of the class. - - The stream. - - - - Initializes a new instance of the class. - - The writer. - - - - Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. - - - - - Writes the end. - - The token. - - - - Writes out a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes raw JSON. - - The raw JSON to write. - - - - Writes raw JSON where a value is expected and updates the writer's state. - - The raw JSON to write. - - - - Writes the beginning of a Json array. - - - - - Writes the beginning of a Json object. - - - - - Writes the property name of a name/value pair on a Json object. - - The name of the property. - - - - Closes this stream and the underlying stream. - - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a [] value. - - The [] value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a [] value that represents a BSON object id. - - The Object ID value to write. - - - - Writes a BSON regex. - - The regex pattern. - The regex options. - - - - Gets or sets the used when writing values to BSON. - When set to no conversion will occur. - - The used when writing values to BSON. - - - - Specifies how constructors are used when initializing objects during deserialization by the . - - - - - First attempt to use the public default constructor, then fall back to single paramatized constructor, then the non-public default constructor. - - - - - Json.NET will use a non-public default constructor before falling back to a paramatized constructor. - - - - - Converts a binary value to and from a base 64 string value. - - - - - Converts an object to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets the of the JSON produced by the JsonConverter. - - The of the JSON produced by the JsonConverter. - - - - Gets a value indicating whether this can read JSON. - - true if this can read JSON; otherwise, false. - - - - Gets a value indicating whether this can write JSON. - - true if this can write JSON; otherwise, false. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a to and from JSON and BSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Create a custom object - - The object type to convert. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Creates an object which will then be populated by the serializer. - - Type of the object. - The created object. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets a value indicating whether this can write JSON. - - - true if this can write JSON; otherwise, false. - - - - - Converts a to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified value type. - - Type of the value. - - true if this instance can convert the specified value type; otherwise, false. - - - - - Converts a to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified value type. - - Type of the value. - - true if this instance can convert the specified value type; otherwise, false. - - - - - Provides a base class for converting a to and from JSON. - - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a F# discriminated union type to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts an Entity Framework EntityKey to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts an ExpandoObject to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets a value indicating whether this can write JSON. - - - true if this can write JSON; otherwise, false. - - - - - Converts a to and from the ISO 8601 date format (e.g. 2008-04-12T12:53Z). - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Gets or sets the date time styles used when converting a date to and from JSON. - - The date time styles used when converting a date to and from JSON. - - - - Gets or sets the date time format used when converting a date to and from JSON. - - The date time format used when converting a date to and from JSON. - - - - Gets or sets the culture used when converting a date to and from JSON. - - The culture used when converting a date to and from JSON. - - - - Converts a to and from a JavaScript date constructor (e.g. new Date(52231943)). - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing property value of the JSON that is being converted. - The calling serializer. - The object value. - - - - Converts a to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a to and from JSON and BSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts an to and from its name string value. - - - - - Initializes a new instance of the class. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets or sets a value indicating whether the written enum text should be camel case. - - true if the written enum text will be camel case; otherwise, false. - - - - Gets or sets a value indicating whether integer values are allowed. - - true if integers are allowed; otherwise, false. - - - - Converts a to and from a string (e.g. "1.2.3.4"). - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing property value of the JSON that is being converted. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts XML to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The calling serializer. - The value. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Checks if the attributeName is a namespace attribute. - - Attribute name to test. - The attribute name prefix if it has one, otherwise an empty string. - True if attribute name is for a namespace attribute, otherwise false. - - - - Determines whether this instance can convert the specified value type. - - Type of the value. - - true if this instance can convert the specified value type; otherwise, false. - - - - - Gets or sets the name of the root element to insert when deserializing to XML if the JSON structure has produces multiple root elements. - - The name of the deserialize root element. - - - - Gets or sets a flag to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - true if the array attibute is written to the XML; otherwise, false. - - - - Gets or sets a value indicating whether to write the root JSON object. - - true if the JSON root object is omitted; otherwise, false. - - - - Specifies how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - - - - - Floating point numbers are parsed to . - - - - - Floating point numbers are parsed to . - - - - - Specifies how dates are formatted when writing JSON text. - - - - - Dates are written in the ISO 8601 format, e.g. "2012-03-21T05:40Z". - - - - - Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/". - - - - - Specifies how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON text. - - - - - Date formatted strings are not parsed to a date type and are read as strings. - - - - - Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . - - - - - Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . - - - - - Specifies how to treat the time value when converting between string and . - - - - - Treat as local time. If the object represents a Coordinated Universal Time (UTC), it is converted to the local time. - - - - - Treat as a UTC. If the object represents a local time, it is converted to a UTC. - - - - - Treat as a local time if a is being converted to a string. - If a string is being converted to , convert to a local time if a time zone is specified. - - - - - Time zone information should be preserved when converting. - - - - - Specifies default value handling options for the . - - - - - - - - - Include members where the member value is the same as the member's default value when serializing objects. - Included members are written to JSON. Has no effect when deserializing. - - - - - Ignore members where the member value is the same as the member's default value when serializing objects - so that is is not written to JSON. - This option will ignore all default values (e.g. null for objects and nullable types; 0 for integers, - decimals and floating point numbers; and false for booleans). The default value ignored can be changed by - placing the on the property. - - - - - Members with a default value but no JSON will be set to their default value when deserializing. - - - - - Ignore members where the member value is the same as the member's default value when serializing objects - and sets members to their default value when deserializing. - - - - - Specifies float format handling options when writing special floating point numbers, e.g. , - and with . - - - - - Write special floating point values as strings in JSON, e.g. "NaN", "Infinity", "-Infinity". - - - - - Write special floating point values as symbols in JSON, e.g. NaN, Infinity, -Infinity. - Note that this will produce non-valid JSON. - - - - - Write special floating point values as the property's default value in JSON, e.g. 0.0 for a property, null for a property. - - - - - Specifies formatting options for the . - - - - - No special formatting is applied. This is the default. - - - - - Causes child objects to be indented according to the and settings. - - - - - Provides an interface to enable a class to return line and position information. - - - - - Gets a value indicating whether the class can return line information. - - - true if LineNumber and LinePosition can be provided; otherwise, false. - - - - - Gets the current line number. - - The current line number or 0 if no line information is available (for example, HasLineInfo returns false). - - - - Gets the current line position. - - The current line position or 0 if no line information is available (for example, HasLineInfo returns false). - - - - Instructs the how to serialize the collection. - - - - - Instructs the how to serialize the object. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - Gets or sets the id. - - The id. - - - - Gets or sets the title. - - The title. - - - - Gets or sets the description. - - The description. - - - - Gets the collection's items converter. - - The collection's items converter. - - - - The parameter list to use when constructing the JsonConverter described by ItemConverterType. - If null, the default constructor is used. - When non-null, there must be a constructor defined in the JsonConverter that exactly matches the number, - order, and type of these parameters. - - - [JsonContainer(ItemConverterType = typeof(MyContainerConverter), ItemConverterParameters = new object[] { 123, "Four" })] - - - - - Gets or sets a value that indicates whether to preserve object references. - - - true to keep object reference; otherwise, false. The default is false. - - - - - Gets or sets a value that indicates whether to preserve collection's items references. - - - true to keep collection's items object references; otherwise, false. The default is false. - - - - - Gets or sets the reference loop handling used when serializing the collection's items. - - The reference loop handling. - - - - Gets or sets the type name handling used when serializing the collection's items. - - The type name handling. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with a flag indicating whether the array can contain null items - - A flag indicating whether the array can contain null items. - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - Gets or sets a value indicating whether null items are allowed in the collection. - - true if null items are allowed in the collection; otherwise, false. - - - - Instructs the to use the specified constructor when deserializing that object. - - - - - Provides methods for converting between common language runtime types and JSON types. - - - - - - - - Represents JavaScript's boolean value true as a string. This field is read-only. - - - - - Represents JavaScript's boolean value false as a string. This field is read-only. - - - - - Represents JavaScript's null as a string. This field is read-only. - - - - - Represents JavaScript's undefined as a string. This field is read-only. - - - - - Represents JavaScript's positive infinity as a string. This field is read-only. - - - - - Represents JavaScript's negative infinity as a string. This field is read-only. - - - - - Represents JavaScript's NaN as a string. This field is read-only. - - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation using the specified. - - The value to convert. - The format the date will be converted to. - The time zone handling when the date is converted to a string. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation using the specified. - - The value to convert. - The format the date will be converted to. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - The string delimiter character. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - The string delimiter character. - The string escape handling. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Serializes the specified object to a JSON string. - - The object to serialize. - A JSON string representation of the object. - - - - Serializes the specified object to a JSON string using formatting. - - The object to serialize. - Indicates how the output is formatted. - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using a collection of . - - The object to serialize. - A collection converters used while serializing. - A JSON string representation of the object. - - - - Serializes the specified object to a JSON string using formatting and a collection of . - - The object to serialize. - Indicates how the output is formatted. - A collection converters used while serializing. - A JSON string representation of the object. - - - - Serializes the specified object to a JSON string using . - - The object to serialize. - The used to serialize the object. - If this is null, default serialization settings will be used. - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using a type, formatting and . - - The object to serialize. - The used to serialize the object. - If this is null, default serialization settings will be used. - - The type of the value being serialized. - This parameter is used when is Auto to write out the type name if the type of the value does not match. - Specifing the type is optional. - - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using formatting and . - - The object to serialize. - Indicates how the output is formatted. - The used to serialize the object. - If this is null, default serialization settings will be used. - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using a type, formatting and . - - The object to serialize. - Indicates how the output is formatted. - The used to serialize the object. - If this is null, default serialization settings will be used. - - The type of the value being serialized. - This parameter is used when is Auto to write out the type name if the type of the value does not match. - Specifing the type is optional. - - - A JSON string representation of the object. - - - - - Asynchronously serializes the specified object to a JSON string. - Serialization will happen on a new thread. - - The object to serialize. - - A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. - - - - - Asynchronously serializes the specified object to a JSON string using formatting. - Serialization will happen on a new thread. - - The object to serialize. - Indicates how the output is formatted. - - A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. - - - - - Asynchronously serializes the specified object to a JSON string using formatting and a collection of . - Serialization will happen on a new thread. - - The object to serialize. - Indicates how the output is formatted. - The used to serialize the object. - If this is null, default serialization settings will be used. - - A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. - - - - - Deserializes the JSON to a .NET object. - - The JSON to deserialize. - The deserialized object from the JSON string. - - - - Deserializes the JSON to a .NET object using . - - The JSON to deserialize. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type. - - The JSON to deserialize. - The of object being deserialized. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type. - - The type of the object to deserialize to. - The JSON to deserialize. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the given anonymous type. - - - The anonymous type to deserialize to. This can't be specified - traditionally and must be infered from the anonymous type passed - as a parameter. - - The JSON to deserialize. - The anonymous type object. - The deserialized anonymous type from the JSON string. - - - - Deserializes the JSON to the given anonymous type using . - - - The anonymous type to deserialize to. This can't be specified - traditionally and must be infered from the anonymous type passed - as a parameter. - - The JSON to deserialize. - The anonymous type object. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - The deserialized anonymous type from the JSON string. - - - - Deserializes the JSON to the specified .NET type using a collection of . - - The type of the object to deserialize to. - The JSON to deserialize. - Converters to use while deserializing. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type using . - - The type of the object to deserialize to. - The object to deserialize. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type using a collection of . - - The JSON to deserialize. - The type of the object to deserialize. - Converters to use while deserializing. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type using . - - The JSON to deserialize. - The type of the object to deserialize to. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - The deserialized object from the JSON string. - - - - Asynchronously deserializes the JSON to the specified .NET type. - Deserialization will happen on a new thread. - - The type of the object to deserialize to. - The JSON to deserialize. - - A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. - - - - - Asynchronously deserializes the JSON to the specified .NET type using . - Deserialization will happen on a new thread. - - The type of the object to deserialize to. - The JSON to deserialize. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - - A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. - - - - - Asynchronously deserializes the JSON to the specified .NET type. - Deserialization will happen on a new thread. - - The JSON to deserialize. - - A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. - - - - - Asynchronously deserializes the JSON to the specified .NET type using . - Deserialization will happen on a new thread. - - The JSON to deserialize. - The type of the object to deserialize to. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - - A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. - - - - - Populates the object with values from the JSON string. - - The JSON to populate values from. - The target object to populate values onto. - - - - Populates the object with values from the JSON string using . - - The JSON to populate values from. - The target object to populate values onto. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - - - - Asynchronously populates the object with values from the JSON string using . - - The JSON to populate values from. - The target object to populate values onto. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - - A task that represents the asynchronous populate operation. - - - - - Serializes the XML node to a JSON string. - - The node to serialize. - A JSON string of the XmlNode. - - - - Serializes the XML node to a JSON string using formatting. - - The node to serialize. - Indicates how the output is formatted. - A JSON string of the XmlNode. - - - - Serializes the XML node to a JSON string using formatting and omits the root object if is true. - - The node to serialize. - Indicates how the output is formatted. - Omits writing the root object. - A JSON string of the XmlNode. - - - - Deserializes the XmlNode from a JSON string. - - The JSON string. - The deserialized XmlNode - - - - Deserializes the XmlNode from a JSON string nested in a root elment specified by . - - The JSON string. - The name of the root element to append when deserializing. - The deserialized XmlNode - - - - Deserializes the XmlNode from a JSON string nested in a root elment specified by - and writes a .NET array attribute for collections. - - The JSON string. - The name of the root element to append when deserializing. - - A flag to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - The deserialized XmlNode - - - - Serializes the to a JSON string. - - The node to convert to JSON. - A JSON string of the XNode. - - - - Serializes the to a JSON string using formatting. - - The node to convert to JSON. - Indicates how the output is formatted. - A JSON string of the XNode. - - - - Serializes the to a JSON string using formatting and omits the root object if is true. - - The node to serialize. - Indicates how the output is formatted. - Omits writing the root object. - A JSON string of the XNode. - - - - Deserializes the from a JSON string. - - The JSON string. - The deserialized XNode - - - - Deserializes the from a JSON string nested in a root elment specified by . - - The JSON string. - The name of the root element to append when deserializing. - The deserialized XNode - - - - Deserializes the from a JSON string nested in a root elment specified by - and writes a .NET array attribute for collections. - - The JSON string. - The name of the root element to append when deserializing. - - A flag to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - The deserialized XNode - - - - Gets or sets a function that creates default . - Default settings are automatically used by serialization methods on , - and and on . - To serialize without using any default settings create a with - . - - - - - Instructs the to use the specified when serializing the member or class. - - - - - Initializes a new instance of the class. - - Type of the converter. - - - - Initializes a new instance of the class. - - Type of the converter. - Parameter list to use when constructing the JsonConverter. Can be null. - - - - Gets the type of the converter. - - The type of the converter. - - - - The parameter list to use when constructing the JsonConverter described by ConverterType. - If null, the default constructor is used. - - - - - Represents a collection of . - - - - - Instructs the how to serialize the collection. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - The exception thrown when an error occurs during Json serialization or deserialization. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Instructs the to deserialize properties with no matching class member into the specified collection - and write values during serialization. - - - - - Initializes a new instance of the class. - - - - - Gets or sets a value that indicates whether to write extension data when serializing the object. - - - true to write extension data when serializing the object; otherwise, false. The default is true. - - - - - Gets or sets a value that indicates whether to read extension data when deserializing the object. - - - true to read extension data when deserializing the object; otherwise, false. The default is true. - - - - - Instructs the not to serialize the public field or public read/write property value. - - - - - Instructs the how to serialize the object. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified member serialization. - - The member serialization. - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - Gets or sets the member serialization. - - The member serialization. - - - - Gets or sets a value that indicates whether the object's properties are required. - - - A value indicating whether the object's properties are required. - - - - - Instructs the to always serialize the member with the specified name. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified name. - - Name of the property. - - - - Gets or sets the converter used when serializing the property's collection items. - - The collection's items converter. - - - - The parameter list to use when constructing the JsonConverter described by ItemConverterType. - If null, the default constructor is used. - When non-null, there must be a constructor defined in the JsonConverter that exactly matches the number, - order, and type of these parameters. - - - [JsonProperty(ItemConverterType = typeof(MyContainerConverter), ItemConverterParameters = new object[] { 123, "Four" })] - - - - - Gets or sets the null value handling used when serializing this property. - - The null value handling. - - - - Gets or sets the default value handling used when serializing this property. - - The default value handling. - - - - Gets or sets the reference loop handling used when serializing this property. - - The reference loop handling. - - - - Gets or sets the object creation handling used when deserializing this property. - - The object creation handling. - - - - Gets or sets the type name handling used when serializing this property. - - The type name handling. - - - - Gets or sets whether this property's value is serialized as a reference. - - Whether this property's value is serialized as a reference. - - - - Gets or sets the order of serialization and deserialization of a member. - - The numeric order of serialization or deserialization. - - - - Gets or sets a value indicating whether this property is required. - - - A value indicating whether this property is required. - - - - - Gets or sets the name of the property. - - The name of the property. - - - - Gets or sets the the reference loop handling used when serializing the property's collection items. - - The collection's items reference loop handling. - - - - Gets or sets the the type name handling used when serializing the property's collection items. - - The collection's items type name handling. - - - - Gets or sets whether this property's collection items are serialized as a reference. - - Whether this property's collection items are serialized as a reference. - - - - The exception thrown when an error occurs while reading Json text. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Gets the line number indicating where the error occurred. - - The line number indicating where the error occurred. - - - - Gets the line position indicating where the error occurred. - - The line position indicating where the error occurred. - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - The exception thrown when an error occurs during Json serialization or deserialization. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Serializes and deserializes objects into and from the JSON format. - The enables you to control how objects are encoded into JSON. - - - - - Initializes a new instance of the class. - - - - - Creates a new instance. - The will not use default settings. - - - A new instance. - The will not use default settings. - - - - - Creates a new instance using the specified . - The will not use default settings. - - The settings to be applied to the . - - A new instance using the specified . - The will not use default settings. - - - - - Creates a new instance. - The will use default settings. - - - A new instance. - The will use default settings. - - - - - Creates a new instance using the specified . - The will use default settings. - - The settings to be applied to the . - - A new instance using the specified . - The will use default settings. - - - - - Populates the JSON values onto the target object. - - The that contains the JSON structure to reader values from. - The target object to populate values onto. - - - - Populates the JSON values onto the target object. - - The that contains the JSON structure to reader values from. - The target object to populate values onto. - - - - Deserializes the Json structure contained by the specified . - - The that contains the JSON structure to deserialize. - The being deserialized. - - - - Deserializes the Json structure contained by the specified - into an instance of the specified type. - - The containing the object. - The of object being deserialized. - The instance of being deserialized. - - - - Deserializes the Json structure contained by the specified - into an instance of the specified type. - - The containing the object. - The type of the object to deserialize. - The instance of being deserialized. - - - - Deserializes the Json structure contained by the specified - into an instance of the specified type. - - The containing the object. - The of object being deserialized. - The instance of being deserialized. - - - - Serializes the specified and writes the Json structure - to a Stream using the specified . - - The used to write the Json structure. - The to serialize. - - - - Serializes the specified and writes the Json structure - to a Stream using the specified . - - The used to write the Json structure. - The to serialize. - - The type of the value being serialized. - This parameter is used when is Auto to write out the type name if the type of the value does not match. - Specifing the type is optional. - - - - - Serializes the specified and writes the Json structure - to a Stream using the specified . - - The used to write the Json structure. - The to serialize. - - The type of the value being serialized. - This parameter is used when is Auto to write out the type name if the type of the value does not match. - Specifing the type is optional. - - - - - Serializes the specified and writes the Json structure - to a Stream using the specified . - - The used to write the Json structure. - The to serialize. - - - - Occurs when the errors during serialization and deserialization. - - - - - Gets or sets the used by the serializer when resolving references. - - - - - Gets or sets the used by the serializer when resolving type names. - - - - - Gets or sets the used by the serializer when writing trace messages. - - The trace writer. - - - - Gets or sets how type name writing and reading is handled by the serializer. - - - - - Gets or sets how a type name assembly is written and resolved by the serializer. - - The type name assembly format. - - - - Gets or sets how object references are preserved by the serializer. - - - - - Get or set how reference loops (e.g. a class referencing itself) is handled. - - - - - Get or set how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. - - - - - Get or set how null values are handled during serialization and deserialization. - - - - - Get or set how null default are handled during serialization and deserialization. - - - - - Gets or sets how objects are created during deserialization. - - The object creation handling. - - - - Gets or sets how constructors are used during deserialization. - - The constructor handling. - - - - Gets or sets how metadata properties are used during deserialization. - - The metadata properties handling. - - - - Gets a collection that will be used during serialization. - - Collection that will be used during serialization. - - - - Gets or sets the contract resolver used by the serializer when - serializing .NET objects to JSON and vice versa. - - - - - Gets or sets the used by the serializer when invoking serialization callback methods. - - The context. - - - - Indicates how JSON text output is formatted. - - - - - Get or set how dates are written to JSON text. - - - - - Get or set how time zones are handling during serialization and deserialization. - - - - - Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - - - - - Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - - - - - Get or set how special floating point numbers, e.g. , - and , - are written as JSON text. - - - - - Get or set how strings are escaped when writing JSON text. - - - - - Get or set how and values are formatting when writing JSON text. - - - - - Gets or sets the culture used when reading JSON. Defaults to . - - - - - Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . - - - - - Gets a value indicating whether there will be a check for additional JSON content after deserializing an object. - - - true if there will be a check for additional JSON content after deserializing an object; otherwise, false. - - - - - Specifies the settings on a object. - - - - - Initializes a new instance of the class. - - - - - Gets or sets how reference loops (e.g. a class referencing itself) is handled. - - Reference loop handling. - - - - Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. - - Missing member handling. - - - - Gets or sets how objects are created during deserialization. - - The object creation handling. - - - - Gets or sets how null values are handled during serialization and deserialization. - - Null value handling. - - - - Gets or sets how null default are handled during serialization and deserialization. - - The default value handling. - - - - Gets or sets a collection that will be used during serialization. - - The converters. - - - - Gets or sets how object references are preserved by the serializer. - - The preserve references handling. - - - - Gets or sets how type name writing and reading is handled by the serializer. - - The type name handling. - - - - Gets or sets how metadata properties are used during deserialization. - - The metadata properties handling. - - - - Gets or sets how a type name assembly is written and resolved by the serializer. - - The type name assembly format. - - - - Gets or sets how constructors are used during deserialization. - - The constructor handling. - - - - Gets or sets the contract resolver used by the serializer when - serializing .NET objects to JSON and vice versa. - - The contract resolver. - - - - Gets or sets the used by the serializer when resolving references. - - The reference resolver. - - - - Gets or sets the used by the serializer when writing trace messages. - - The trace writer. - - - - Gets or sets the used by the serializer when resolving type names. - - The binder. - - - - Gets or sets the error handler called during serialization and deserialization. - - The error handler called during serialization and deserialization. - - - - Gets or sets the used by the serializer when invoking serialization callback methods. - - The context. - - - - Get or set how and values are formatting when writing JSON text. - - - - - Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . - - - - - Indicates how JSON text output is formatted. - - - - - Get or set how dates are written to JSON text. - - - - - Get or set how time zones are handling during serialization and deserialization. - - - - - Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - - - - - Get or set how special floating point numbers, e.g. , - and , - are written as JSON. - - - - - Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - - - - - Get or set how strings are escaped when writing JSON text. - - - - - Gets or sets the culture used when reading JSON. Defaults to . - - - - - Gets a value indicating whether there will be a check for additional content after deserializing an object. - - - true if there will be a check for additional content after deserializing an object; otherwise, false. - - - - - Represents a reader that provides fast, non-cached, forward-only access to JSON text data. - - - - - Initializes a new instance of the class with the specified . - - The TextReader containing the XML data to read. - - - - Reads the next JSON token from the stream. - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Reads the next JSON token from the stream as a []. - - - A [] or a null reference if the next JSON token is null. This method will return null at the end of an array. - - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Changes the state to closed. - - - - - Gets a value indicating whether the class can return line information. - - - true if LineNumber and LinePosition can be provided; otherwise, false. - - - - - Gets the current line number. - - - The current line number or 0 if no line information is available (for example, HasLineInfo returns false). - - - - - Gets the current line position. - - - The current line position or 0 if no line information is available (for example, HasLineInfo returns false). - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. - - - - - Creates an instance of the JsonWriter class using the specified . - - The TextWriter to write to. - - - - Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. - - - - - Closes this stream and the underlying stream. - - - - - Writes the beginning of a Json object. - - - - - Writes the beginning of a Json array. - - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes the specified end token. - - The end token to write. - - - - Writes the property name of a name/value pair on a Json object. - - The name of the property. - - - - Writes the property name of a name/value pair on a JSON object. - - The name of the property. - A flag to indicate whether the text should be escaped when it is written as a JSON property name. - - - - Writes indent characters. - - - - - Writes the JSON value delimiter. - - - - - Writes an indent space. - - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes raw JSON. - - The raw JSON to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a [] value. - - The [] value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes out a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes out the given white space. - - The string of white space characters. - - - - Gets or sets how many IndentChars to write for each level in the hierarchy when is set to Formatting.Indented. - - - - - Gets or sets which character to use to quote attribute values. - - - - - Gets or sets which character to use for indenting when is set to Formatting.Indented. - - - - - Gets or sets a value indicating whether object names will be surrounded with quotes. - - - - - Specifies the type of Json token. - - - - - This is returned by the if a method has not been called. - - - - - An object start token. - - - - - An array start token. - - - - - A constructor start token. - - - - - An object property name. - - - - - A comment. - - - - - Raw JSON. - - - - - An integer. - - - - - A float. - - - - - A string. - - - - - A boolean. - - - - - A null token. - - - - - An undefined token. - - - - - An object end token. - - - - - An array end token. - - - - - A constructor end token. - - - - - A Date. - - - - - Byte data. - - - - - Represents a reader that provides validation. - - - - - Initializes a new instance of the class that - validates the content returned from the given . - - The to read from while validating. - - - - Reads the next JSON token from the stream as a . - - A . - - - - Reads the next JSON token from the stream as a []. - - - A [] or a null reference if the next JSON token is null. - - - - - Reads the next JSON token from the stream as a . - - A . - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . - - - - Reads the next JSON token from the stream. - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Sets an event handler for receiving schema validation errors. - - - - - Gets the text value of the current JSON token. - - - - - - Gets the depth of the current token in the JSON document. - - The depth of the current token in the JSON document. - - - - Gets the path of the current JSON token. - - - - - Gets the quotation mark character used to enclose the value of a string. - - - - - - Gets the type of the current JSON token. - - - - - - Gets the Common Language Runtime (CLR) type for the current JSON token. - - - - - - Gets or sets the schema. - - The schema. - - - - Gets the used to construct this . - - The specified in the constructor. - - - - The exception thrown when an error occurs while reading Json text. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - Contains the LINQ to JSON extension methods. - - - - - Returns a collection of tokens that contains the ancestors of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains the ancestors of every token in the source collection. - - - - Returns a collection of tokens that contains every token in the source collection, and the ancestors of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains every token in the source collection, the ancestors of every token in the source collection. - - - - Returns a collection of tokens that contains the descendants of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains the descendants of every token in the source collection. - - - - Returns a collection of tokens that contains every token in the source collection, and the descendants of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains every token in the source collection, and the descendants of every token in the source collection. - - - - Returns a collection of child properties of every object in the source collection. - - An of that contains the source collection. - An of that contains the properties of every object in the source collection. - - - - Returns a collection of child values of every object in the source collection with the given key. - - An of that contains the source collection. - The token key. - An of that contains the values of every token in the source collection with the given key. - - - - Returns a collection of child values of every object in the source collection. - - An of that contains the source collection. - An of that contains the values of every token in the source collection. - - - - Returns a collection of converted child values of every object in the source collection with the given key. - - The type to convert the values to. - An of that contains the source collection. - The token key. - An that contains the converted values of every token in the source collection with the given key. - - - - Returns a collection of converted child values of every object in the source collection. - - The type to convert the values to. - An of that contains the source collection. - An that contains the converted values of every token in the source collection. - - - - Converts the value. - - The type to convert the value to. - A cast as a of . - A converted value. - - - - Converts the value. - - The source collection type. - The type to convert the value to. - A cast as a of . - A converted value. - - - - Returns a collection of child tokens of every array in the source collection. - - The source collection type. - An of that contains the source collection. - An of that contains the values of every token in the source collection. - - - - Returns a collection of converted child tokens of every array in the source collection. - - An of that contains the source collection. - The type to convert the values to. - The source collection type. - An that contains the converted values of every token in the source collection. - - - - Returns the input typed as . - - An of that contains the source collection. - The input typed as . - - - - Returns the input typed as . - - The source collection type. - An of that contains the source collection. - The input typed as . - - - - Represents a collection of objects. - - The type of token - - - - Gets the with the specified key. - - - - - - Represents a JSON array. - - - - - - - - Represents a token that can contain other tokens. - - - - - Represents an abstract JSON token. - - - - - Compares the values of two tokens, including the values of all descendant tokens. - - The first to compare. - The second to compare. - true if the tokens are equal; otherwise false. - - - - Adds the specified content immediately after this token. - - A content object that contains simple content or a collection of content objects to be added after this token. - - - - Adds the specified content immediately before this token. - - A content object that contains simple content or a collection of content objects to be added before this token. - - - - Returns a collection of the ancestor tokens of this token. - - A collection of the ancestor tokens of this token. - - - - Returns a collection of tokens that contain this token, and the ancestors of this token. - - A collection of tokens that contain this token, and the ancestors of this token. - - - - Returns a collection of the sibling tokens after this token, in document order. - - A collection of the sibling tokens after this tokens, in document order. - - - - Returns a collection of the sibling tokens before this token, in document order. - - A collection of the sibling tokens before this token, in document order. - - - - Gets the with the specified key converted to the specified type. - - The type to convert the token to. - The token key. - The converted token value. - - - - Returns a collection of the child tokens of this token, in document order. - - An of containing the child tokens of this , in document order. - - - - Returns a collection of the child tokens of this token, in document order, filtered by the specified type. - - The type to filter the child tokens on. - A containing the child tokens of this , in document order. - - - - Returns a collection of the child values of this token, in document order. - - The type to convert the values to. - A containing the child values of this , in document order. - - - - Removes this token from its parent. - - - - - Replaces this token with the specified token. - - The value. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Returns the indented JSON for this token. - - - The indented JSON for this token. - - - - - Returns the JSON for this token using the given formatting and converters. - - Indicates how the output is formatted. - A collection of which will be used when writing the token. - The JSON for this token using the given formatting and converters. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to []. - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from [] to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Creates an for this token. - - An that can be used to read this token and its descendants. - - - - Creates a from an object. - - The object that will be used to create . - A with the value of the specified object - - - - Creates a from an object using the specified . - - The object that will be used to create . - The that will be used when reading the object. - A with the value of the specified object - - - - Creates the specified .NET type from the . - - The object type that the token will be deserialized to. - The new object created from the JSON value. - - - - Creates the specified .NET type from the . - - The object type that the token will be deserialized to. - The new object created from the JSON value. - - - - Creates the specified .NET type from the using the specified . - - The object type that the token will be deserialized to. - The that will be used when creating the object. - The new object created from the JSON value. - - - - Creates the specified .NET type from the using the specified . - - The object type that the token will be deserialized to. - The that will be used when creating the object. - The new object created from the JSON value. - - - - Creates a from a . - - An positioned at the token to read into this . - - An that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - Creates a from a . - - An positioned at the token to read into this . - - An that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Selects a using a JPath expression. Selects the token that matches the object path. - - - A that contains a JPath expression. - - A , or null. - - - - Selects a using a JPath expression. Selects the token that matches the object path. - - - A that contains a JPath expression. - - A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. - A . - - - - Selects a collection of elements using a JPath expression. - - - A that contains a JPath expression. - - An that contains the selected elements. - - - - Selects a collection of elements using a JPath expression. - - - A that contains a JPath expression. - - A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. - An that contains the selected elements. - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Creates a new instance of the . All child tokens are recursively cloned. - - A new instance of the . - - - - Adds an object to the annotation list of this . - - The annotation to add. - - - - Get the first annotation object of the specified type from this . - - The type of the annotation to retrieve. - The first annotation object that matches the specified type, or null if no annotation is of the specified type. - - - - Gets the first annotation object of the specified type from this . - - The of the annotation to retrieve. - The first annotation object that matches the specified type, or null if no annotation is of the specified type. - - - - Gets a collection of annotations of the specified type for this . - - The type of the annotations to retrieve. - An that contains the annotations for this . - - - - Gets a collection of annotations of the specified type for this . - - The of the annotations to retrieve. - An of that contains the annotations that match the specified type for this . - - - - Removes the annotations of the specified type from this . - - The type of annotations to remove. - - - - Removes the annotations of the specified type from this . - - The of annotations to remove. - - - - Gets a comparer that can compare two tokens for value equality. - - A that can compare two nodes for value equality. - - - - Gets or sets the parent. - - The parent. - - - - Gets the root of this . - - The root of this . - - - - Gets the node type for this . - - The type. - - - - Gets a value indicating whether this token has child tokens. - - - true if this token has child values; otherwise, false. - - - - - Gets the next sibling token of this node. - - The that contains the next sibling token. - - - - Gets the previous sibling token of this node. - - The that contains the previous sibling token. - - - - Gets the path of the JSON token. - - - - - Gets the with the specified key. - - The with the specified key. - - - - Get the first child token of this token. - - A containing the first child token of the . - - - - Get the last child token of this token. - - A containing the last child token of the . - - - - Raises the event. - - The instance containing the event data. - - - - Raises the event. - - The instance containing the event data. - - - - Raises the event. - - The instance containing the event data. - - - - Returns a collection of the child tokens of this token, in document order. - - - An of containing the child tokens of this , in document order. - - - - - Returns a collection of the child values of this token, in document order. - - The type to convert the values to. - - A containing the child values of this , in document order. - - - - - Returns a collection of the descendant tokens for this token in document order. - - An containing the descendant tokens of the . - - - - Returns a collection of the tokens that contain this token, and all descendant tokens of this token, in document order. - - An containing this token, and all the descendant tokens of the . - - - - Adds the specified content as children of this . - - The content to be added. - - - - Adds the specified content as the first children of this . - - The content to be added. - - - - Creates an that can be used to add tokens to the . - - An that is ready to have content written to it. - - - - Replaces the children nodes of this token with the specified content. - - The content. - - - - Removes the child nodes from this token. - - - - - Merge the specified content into this . - - The content to be merged. - - - - Merge the specified content into this using . - - The content to be merged. - The used to merge the content. - - - - Occurs when the list changes or an item in the list changes. - - - - - Occurs before an item is added to the collection. - - - - - Occurs when the items list of the collection has changed, or the collection is reset. - - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets a value indicating whether this token has child tokens. - - - true if this token has child values; otherwise, false. - - - - - Get the first child token of this token. - - - A containing the first child token of the . - - - - - Get the last child token of this token. - - - A containing the last child token of the . - - - - - Gets the count of child JSON tokens. - - The count of child JSON tokens - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the specified content. - - The contents of the array. - - - - Initializes a new instance of the class with the specified content. - - The contents of the array. - - - - Loads an from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - - - - Creates a from an object. - - The object that will be used to create . - A with the values of the specified object - - - - Creates a from an object. - - The object that will be used to create . - The that will be used to read the object. - A with the values of the specified object - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Determines the index of a specific item in the . - - The object to locate in the . - - The index of if found in the list; otherwise, -1. - - - - - Inserts an item to the at the specified index. - - The zero-based index at which should be inserted. - The object to insert into the . - - is not a valid index in the . - The is read-only. - - - - Removes the item at the specified index. - - The zero-based index of the item to remove. - - is not a valid index in the . - The is read-only. - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Adds an item to the . - - The object to add to the . - The is read-only. - - - - Removes all items from the . - - The is read-only. - - - - Determines whether the contains a specific value. - - The object to locate in the . - - true if is found in the ; otherwise, false. - - - - - Copies to. - - The array. - Index of the array. - - - - Removes the first occurrence of a specific object from the . - - The object to remove from the . - - true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . - - The is read-only. - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets the node type for this . - - The type. - - - - Gets the with the specified key. - - The with the specified key. - - - - Gets or sets the at the specified index. - - - - - - Gets a value indicating whether the is read-only. - - true if the is read-only; otherwise, false. - - - - Represents a JSON constructor. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the specified name and content. - - The constructor name. - The contents of the constructor. - - - - Initializes a new instance of the class with the specified name and content. - - The constructor name. - The contents of the constructor. - - - - Initializes a new instance of the class with the specified name. - - The constructor name. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Loads an from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets or sets the name of this constructor. - - The constructor name. - - - - Gets the node type for this . - - The type. - - - - Gets the with the specified key. - - The with the specified key. - - - - Represents a collection of objects. - - The type of token - - - - An empty collection of objects. - - - - - Initializes a new instance of the struct. - - The enumerable. - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - - - - Determines whether the specified is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Determines whether the specified is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Returns a hash code for this instance. - - - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - - - - - Gets the with the specified key. - - - - - - Represents a JSON object. - - - - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the specified content. - - The contents of the object. - - - - Initializes a new instance of the class with the specified content. - - The contents of the object. - - - - Gets an of this object's properties. - - An of this object's properties. - - - - Gets a the specified name. - - The property name. - A with the specified name or null. - - - - Gets an of this object's property values. - - An of this object's property values. - - - - Loads an from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - - - - Creates a from an object. - - The object that will be used to create . - A with the values of the specified object - - - - Creates a from an object. - - The object that will be used to create . - The that will be used to read the object. - A with the values of the specified object - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Gets the with the specified property name. - - Name of the property. - The with the specified property name. - - - - Gets the with the specified property name. - The exact property name will be searched for first and if no matching property is found then - the will be used to match a property. - - Name of the property. - One of the enumeration values that specifies how the strings will be compared. - The with the specified property name. - - - - Tries to get the with the specified property name. - The exact property name will be searched for first and if no matching property is found then - the will be used to match a property. - - Name of the property. - The value. - One of the enumeration values that specifies how the strings will be compared. - true if a value was successfully retrieved; otherwise, false. - - - - Adds the specified property name. - - Name of the property. - The value. - - - - Removes the property with the specified name. - - Name of the property. - true if item was successfully removed; otherwise, false. - - - - Tries the get value. - - Name of the property. - The value. - true if a value was successfully retrieved; otherwise, false. - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Raises the event with the provided arguments. - - Name of the property. - - - - Raises the event with the provided arguments. - - Name of the property. - - - - Returns the properties for this instance of a component. - - - A that represents the properties for this component instance. - - - - - Returns the properties for this instance of a component using the attribute array as a filter. - - An array of type that is used as a filter. - - A that represents the filtered properties for this component instance. - - - - - Returns a collection of custom attributes for this instance of a component. - - - An containing the attributes for this object. - - - - - Returns the class name of this instance of a component. - - - The class name of the object, or null if the class does not have a name. - - - - - Returns the name of this instance of a component. - - - The name of the object, or null if the object does not have a name. - - - - - Returns a type converter for this instance of a component. - - - A that is the converter for this object, or null if there is no for this object. - - - - - Returns the default event for this instance of a component. - - - An that represents the default event for this object, or null if this object does not have events. - - - - - Returns the default property for this instance of a component. - - - A that represents the default property for this object, or null if this object does not have properties. - - - - - Returns an editor of the specified type for this instance of a component. - - A that represents the editor for this object. - - An of the specified type that is the editor for this object, or null if the editor cannot be found. - - - - - Returns the events for this instance of a component using the specified attribute array as a filter. - - An array of type that is used as a filter. - - An that represents the filtered events for this component instance. - - - - - Returns the events for this instance of a component. - - - An that represents the events for this component instance. - - - - - Returns an object that contains the property described by the specified property descriptor. - - A that represents the property whose owner is to be found. - - An that represents the owner of the specified property. - - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Occurs when a property value changes. - - - - - Occurs when a property value is changing. - - - - - Gets the node type for this . - - The type. - - - - Gets the with the specified key. - - The with the specified key. - - - - Gets or sets the with the specified property name. - - - - - - Specifies the settings used when merging JSON. - - - - - Gets or sets the method used when merging JSON arrays. - - The method used when merging JSON arrays. - - - - Represents a JSON property. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class. - - The property name. - The property content. - - - - Initializes a new instance of the class. - - The property name. - The property content. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Loads an from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets the property name. - - The property name. - - - - Gets or sets the property value. - - The property value. - - - - Gets the node type for this . - - The type. - - - - Represents a view of a . - - - - - Initializes a new instance of the class. - - The name. - - - - When overridden in a derived class, returns whether resetting an object changes its value. - - - true if resetting the component changes its value; otherwise, false. - - The component to test for reset capability. - - - - - When overridden in a derived class, gets the current value of the property on a component. - - - The value of a property for a given component. - - The component with the property for which to retrieve the value. - - - - - When overridden in a derived class, resets the value for this property of the component to the default value. - - The component with the property value that is to be reset to the default value. - - - - - When overridden in a derived class, sets the value of the component to a different value. - - The component with the property value that is to be set. - The new value. - - - - - When overridden in a derived class, determines a value indicating whether the value of this property needs to be persisted. - - - true if the property should be persisted; otherwise, false. - - The component with the property to be examined for persistence. - - - - - When overridden in a derived class, gets the type of the component this property is bound to. - - - A that represents the type of component this property is bound to. When the or methods are invoked, the object specified might be an instance of this type. - - - - - When overridden in a derived class, gets a value indicating whether this property is read-only. - - - true if the property is read-only; otherwise, false. - - - - - When overridden in a derived class, gets the type of the property. - - - A that represents the type of the property. - - - - - Gets the hash code for the name of the member. - - - - The hash code for the name of the member. - - - - - Represents a raw JSON string. - - - - - Represents a value in JSON (string, integer, date, etc). - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Creates a comment with the given value. - - The value. - A comment with the given value. - - - - Creates a string with the given value. - - The value. - A string with the given value. - - - - Creates a null value. - - A null value. - - - - Creates a null value. - - A null value. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Indicates whether the current object is equal to another object of the same type. - - - true if the current object is equal to the parameter; otherwise, false. - - An object to compare with this object. - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - true if the specified is equal to the current ; otherwise, false. - - - The parameter is null. - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format. - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format provider. - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format. - The format provider. - - A that represents this instance. - - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. - - An object to compare with this instance. - - A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: - Value - Meaning - Less than zero - This instance is less than . - Zero - This instance is equal to . - Greater than zero - This instance is greater than . - - - is not the same type as this instance. - - - - - Gets a value indicating whether this token has child tokens. - - - true if this token has child values; otherwise, false. - - - - - Gets the node type for this . - - The type. - - - - Gets or sets the underlying token value. - - The underlying token value. - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class. - - The raw json. - - - - Creates an instance of with the content of the reader's current token. - - The reader. - An instance of with the content of the reader's current token. - - - - Compares tokens to determine whether they are equal. - - - - - Determines whether the specified objects are equal. - - The first object of type to compare. - The second object of type to compare. - - true if the specified objects are equal; otherwise, false. - - - - - Returns a hash code for the specified object. - - The for which a hash code is to be returned. - A hash code for the specified object. - The type of is a reference type and is null. - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized JSON data. - - - - - Initializes a new instance of the class. - - The token to read from. - - - - Reads the next JSON token from the stream as a []. - - - A [] or a null reference if the next JSON token is null. This method will return null at the end of an array. - - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream. - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Gets the at the reader's current position. - - - - - Gets the path of the current JSON token. - - - - - Specifies the type of token. - - - - - No token type has been set. - - - - - A JSON object. - - - - - A JSON array. - - - - - A JSON constructor. - - - - - A JSON object property. - - - - - A comment. - - - - - An integer value. - - - - - A float value. - - - - - A string value. - - - - - A boolean value. - - - - - A null value. - - - - - An undefined value. - - - - - A date value. - - - - - A raw JSON value. - - - - - A collection of bytes value. - - - - - A Guid value. - - - - - A Uri value. - - - - - A TimeSpan value. - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. - - - - - Initializes a new instance of the class writing to the given . - - The container being written to. - - - - Initializes a new instance of the class. - - - - - Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. - - - - - Closes this stream and the underlying stream. - - - - - Writes the beginning of a Json object. - - - - - Writes the beginning of a Json array. - - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes the end. - - The token. - - - - Writes the property name of a name/value pair on a Json object. - - The name of the property. - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes raw JSON. - - The raw JSON to write. - - - - Writes out a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a [] value. - - The [] value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Gets the at the writer's current position. - - - - - Gets the token being writen. - - The token being writen. - - - - Specifies how JSON arrays are merged together. - - - - Concatenate arrays. - - - Union arrays, skipping items that already exist. - - - Replace all array items. - - - Merge array items together, matched by index. - - - - Specifies the member serialization options for the . - - - - - All public members are serialized by default. Members can be excluded using or . - This is the default member serialization mode. - - - - - Only members must be marked with or are serialized. - This member serialization mode can also be set by marking the class with . - - - - - All public and private fields are serialized. Members can be excluded using or . - This member serialization mode can also be set by marking the class with - and setting IgnoreSerializableAttribute on to false. - - - - - Specifies metadata property handling options for the . - - - - - Read metadata properties located at the start of a JSON object. - - - - - Read metadata properties located anywhere in a JSON object. Note that this setting will impact performance. - - - - - Do not try to read metadata properties. - - - - - Specifies missing member handling options for the . - - - - - Ignore a missing member and do not attempt to deserialize it. - - - - - Throw a when a missing member is encountered during deserialization. - - - - - Specifies null value handling options for the . - - - - - - - - - Include null values when serializing and deserializing objects. - - - - - Ignore null values when serializing and deserializing objects. - - - - - Specifies how object creation is handled by the . - - - - - Reuse existing objects, create new objects when needed. - - - - - Only reuse existing objects. - - - - - Always create new objects. - - - - - Specifies reference handling options for the . - Note that references cannot be preserved when a value is set via a non-default constructor such as types that implement ISerializable. - - - - - - - - Do not preserve references when serializing types. - - - - - Preserve references when serializing into a JSON object structure. - - - - - Preserve references when serializing into a JSON array structure. - - - - - Preserve references when serializing. - - - - - Specifies reference loop handling options for the . - - - - - Throw a when a loop is encountered. - - - - - Ignore loop references and do not serialize. - - - - - Serialize loop references. - - - - - Indicating whether a property is required. - - - - - The property is not required. The default state. - - - - - The property must be defined in JSON but can be a null value. - - - - - The property must be defined in JSON and cannot be a null value. - - - - - Contains the JSON schema extension methods. - - - - - Determines whether the is valid. - - The source to test. - The schema to test with. - - true if the specified is valid; otherwise, false. - - - - - Determines whether the is valid. - - The source to test. - The schema to test with. - When this method returns, contains any error messages generated while validating. - - true if the specified is valid; otherwise, false. - - - - - Validates the specified . - - The source to test. - The schema to test with. - - - - Validates the specified . - - The source to test. - The schema to test with. - The validation event handler. - - - - An in-memory representation of a JSON Schema. - - - - - Initializes a new instance of the class. - - - - - Reads a from the specified . - - The containing the JSON Schema to read. - The object representing the JSON Schema. - - - - Reads a from the specified . - - The containing the JSON Schema to read. - The to use when resolving schema references. - The object representing the JSON Schema. - - - - Load a from a string that contains schema JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - Parses the specified json. - - The json. - The resolver. - A populated from the string that contains JSON. - - - - Writes this schema to a . - - A into which this method will write. - - - - Writes this schema to a using the specified . - - A into which this method will write. - The resolver used. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Gets or sets the id. - - - - - Gets or sets the title. - - - - - Gets or sets whether the object is required. - - - - - Gets or sets whether the object is read only. - - - - - Gets or sets whether the object is visible to users. - - - - - Gets or sets whether the object is transient. - - - - - Gets or sets the description of the object. - - - - - Gets or sets the types of values allowed by the object. - - The type. - - - - Gets or sets the pattern. - - The pattern. - - - - Gets or sets the minimum length. - - The minimum length. - - - - Gets or sets the maximum length. - - The maximum length. - - - - Gets or sets a number that the value should be divisble by. - - A number that the value should be divisble by. - - - - Gets or sets the minimum. - - The minimum. - - - - Gets or sets the maximum. - - The maximum. - - - - Gets or sets a flag indicating whether the value can not equal the number defined by the "minimum" attribute. - - A flag indicating whether the value can not equal the number defined by the "minimum" attribute. - - - - Gets or sets a flag indicating whether the value can not equal the number defined by the "maximum" attribute. - - A flag indicating whether the value can not equal the number defined by the "maximum" attribute. - - - - Gets or sets the minimum number of items. - - The minimum number of items. - - - - Gets or sets the maximum number of items. - - The maximum number of items. - - - - Gets or sets the of items. - - The of items. - - - - Gets or sets a value indicating whether items in an array are validated using the instance at their array position from . - - - true if items are validated using their array position; otherwise, false. - - - - - Gets or sets the of additional items. - - The of additional items. - - - - Gets or sets a value indicating whether additional items are allowed. - - - true if additional items are allowed; otherwise, false. - - - - - Gets or sets whether the array items must be unique. - - - - - Gets or sets the of properties. - - The of properties. - - - - Gets or sets the of additional properties. - - The of additional properties. - - - - Gets or sets the pattern properties. - - The pattern properties. - - - - Gets or sets a value indicating whether additional properties are allowed. - - - true if additional properties are allowed; otherwise, false. - - - - - Gets or sets the required property if this property is present. - - The required property if this property is present. - - - - Gets or sets the a collection of valid enum values allowed. - - A collection of valid enum values allowed. - - - - Gets or sets disallowed types. - - The disallow types. - - - - Gets or sets the default value. - - The default value. - - - - Gets or sets the collection of that this schema extends. - - The collection of that this schema extends. - - - - Gets or sets the format. - - The format. - - - - Returns detailed information about the schema exception. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Gets the line number indicating where the error occurred. - - The line number indicating where the error occurred. - - - - Gets the line position indicating where the error occurred. - - The line position indicating where the error occurred. - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - Generates a from a specified . - - - - - Generate a from the specified type. - - The type to generate a from. - A generated from the specified type. - - - - Generate a from the specified type. - - The type to generate a from. - The used to resolve schema references. - A generated from the specified type. - - - - Generate a from the specified type. - - The type to generate a from. - Specify whether the generated root will be nullable. - A generated from the specified type. - - - - Generate a from the specified type. - - The type to generate a from. - The used to resolve schema references. - Specify whether the generated root will be nullable. - A generated from the specified type. - - - - Gets or sets how undefined schemas are handled by the serializer. - - - - - Gets or sets the contract resolver. - - The contract resolver. - - - - Resolves from an id. - - - - - Initializes a new instance of the class. - - - - - Gets a for the specified reference. - - The id. - A for the specified reference. - - - - Gets or sets the loaded schemas. - - The loaded schemas. - - - - The value types allowed by the . - - - - - No type specified. - - - - - String type. - - - - - Float type. - - - - - Integer type. - - - - - Boolean type. - - - - - Object type. - - - - - Array type. - - - - - Null type. - - - - - Any type. - - - - - Specifies undefined schema Id handling options for the . - - - - - Do not infer a schema Id. - - - - - Use the .NET type name as the schema Id. - - - - - Use the assembly qualified .NET type name as the schema Id. - - - - - Returns detailed information related to the . - - - - - Gets the associated with the validation error. - - The JsonSchemaException associated with the validation error. - - - - Gets the path of the JSON location where the validation error occurred. - - The path of the JSON location where the validation error occurred. - - - - Gets the text description corresponding to the validation error. - - The text description. - - - - Represents the callback method that will handle JSON schema validation events and the . - - - - - Resolves member mappings for a type, camel casing property names. - - - - - Used by to resolves a for a given . - - - - - Used by to resolves a for a given . - - - - - - - - - Resolves the contract for a given type. - - The type to resolve a contract for. - The contract for a given type. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - If set to true the will use a cached shared with other resolvers of the same type. - Sharing the cache will significantly improve performance with multiple resolver instances because expensive reflection will only - happen once. This setting can cause unexpected behavior if different instances of the resolver are suppose to produce different - results. When set to false it is highly recommended to reuse instances with the . - - - - - Resolves the contract for a given type. - - The type to resolve a contract for. - The contract for a given type. - - - - Gets the serializable members for the type. - - The type to get serializable members for. - The serializable members for the type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates the constructor parameters. - - The constructor to create properties for. - The type's member properties. - Properties for the given . - - - - Creates a for the given . - - The matching member property. - The constructor parameter. - A created for the given . - - - - Resolves the default for the contract. - - Type of the object. - The contract's default . - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Determines which contract type is created for the given type. - - Type of the object. - A for the given type. - - - - Creates properties for the given . - - The type to create properties for. - /// The member serialization mode for the type. - Properties for the given . - - - - Creates the used by the serializer to get and set values from a member. - - The member. - The used by the serializer to get and set values from a member. - - - - Creates a for the given . - - The member's parent . - The member to create a for. - A created for the given . - - - - Resolves the name of the property. - - Name of the property. - Name of the property. - - - - Gets the resolved name of the property. - - Name of the property. - Name of the property. - - - - Gets a value indicating whether members are being get and set using dynamic code generation. - This value is determined by the runtime permissions available. - - - true if using dynamic code generation; otherwise, false. - - - - - Gets or sets the default members search flags. - - The default members search flags. - - - - Gets or sets a value indicating whether compiler generated members should be serialized. - - - true if serialized compiler generated members; otherwise, false. - - - - - Gets or sets a value indicating whether to ignore the interface when serializing and deserializing types. - - - true if the interface will be ignored when serializing and deserializing types; otherwise, false. - - - - - Gets or sets a value indicating whether to ignore the attribute when serializing and deserializing types. - - - true if the attribute will be ignored when serializing and deserializing types; otherwise, false. - - - - - Initializes a new instance of the class. - - - - - Resolves the name of the property. - - Name of the property. - The property name camel cased. - - - - Used to resolve references when serializing and deserializing JSON by the . - - - - - Resolves a reference to its object. - - The serialization context. - The reference to resolve. - The object that - - - - Gets the reference for the sepecified object. - - The serialization context. - The object to get a reference for. - The reference to the object. - - - - Determines whether the specified object is referenced. - - The serialization context. - The object to test for a reference. - - true if the specified object is referenced; otherwise, false. - - - - - Adds a reference to the specified object. - - The serialization context. - The reference. - The object to reference. - - - - The default serialization binder used when resolving and loading classes from type names. - - - - - When overridden in a derived class, controls the binding of a serialized object to a type. - - Specifies the name of the serialized object. - Specifies the name of the serialized object. - - The type of the object the formatter creates a new instance of. - - - - - When overridden in a derived class, controls the binding of a serialized object to a type. - - The type of the object the formatter creates a new instance of. - Specifies the name of the serialized object. - Specifies the name of the serialized object. - - - - Represents a trace writer that writes to the application's instances. - - - - - Represents a trace writer. - - - - - Writes the specified trace level, message and optional exception. - - The at which to write this trace. - The trace message. - The trace exception. This parameter is optional. - - - - Gets the that will be used to filter the trace messages passed to the writer. - For example a filter level of Info will exclude Verbose messages and include Info, - Warning and Error messages. - - The that will be used to filter the trace messages passed to the writer. - - - - Writes the specified trace level, message and optional exception. - - The at which to write this trace. - The trace message. - The trace exception. This parameter is optional. - - - - Gets the that will be used to filter the trace messages passed to the writer. - For example a filter level of Info will exclude Verbose messages and include Info, - Warning and Error messages. - - - The that will be used to filter the trace messages passed to the writer. - - - - - Get and set values for a using dynamic methods. - - - - - Provides methods to get and set values. - - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Initializes a new instance of the class. - - The member info. - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Provides information surrounding an error. - - - - - Gets the error. - - The error. - - - - Gets the original object that caused the error. - - The original object that caused the error. - - - - Gets the member that caused the error. - - The member that caused the error. - - - - Gets the path of the JSON location where the error occurred. - - The path of the JSON location where the error occurred. - - - - Gets or sets a value indicating whether this is handled. - - true if handled; otherwise, false. - - - - Provides data for the Error event. - - - - - Initializes a new instance of the class. - - The current object. - The error context. - - - - Gets the current object the error event is being raised against. - - The current object the error event is being raised against. - - - - Gets the error context. - - The error context. - - - - Get and set values for a using dynamic methods. - - - - - Initializes a new instance of the class. - - The member info. - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Provides methods to get attributes. - - - - - Returns a collection of all of the attributes, or an empty collection if there are no attributes. - - When true, look up the hierarchy chain for the inherited custom attribute. - A collection of s, or an empty collection. - - - - Returns a collection of attributes, identified by type, or an empty collection if there are no attributes. - - The type of the attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - A collection of s, or an empty collection. - - - - Contract details for a used by the . - - - - - Contract details for a used by the . - - - - - Contract details for a used by the . - - - - - Gets the underlying type for the contract. - - The underlying type for the contract. - - - - Gets or sets the type created during deserialization. - - The type created during deserialization. - - - - Gets or sets whether this type contract is serialized as a reference. - - Whether this type contract is serialized as a reference. - - - - Gets or sets the default for this contract. - - The converter. - - - - Gets or sets all methods called immediately after deserialization of the object. - - The methods called immediately after deserialization of the object. - - - - Gets or sets all methods called during deserialization of the object. - - The methods called during deserialization of the object. - - - - Gets or sets all methods called after serialization of the object graph. - - The methods called after serialization of the object graph. - - - - Gets or sets all methods called before serialization of the object. - - The methods called before serialization of the object. - - - - Gets or sets all method called when an error is thrown during the serialization of the object. - - The methods called when an error is thrown during the serialization of the object. - - - - Gets or sets the method called immediately after deserialization of the object. - - The method called immediately after deserialization of the object. - - - - Gets or sets the method called during deserialization of the object. - - The method called during deserialization of the object. - - - - Gets or sets the method called after serialization of the object graph. - - The method called after serialization of the object graph. - - - - Gets or sets the method called before serialization of the object. - - The method called before serialization of the object. - - - - Gets or sets the method called when an error is thrown during the serialization of the object. - - The method called when an error is thrown during the serialization of the object. - - - - Gets or sets the default creator method used to create the object. - - The default creator method used to create the object. - - - - Gets or sets a value indicating whether the default creator is non public. - - true if the default object creator is non-public; otherwise, false. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets or sets the default collection items . - - The converter. - - - - Gets or sets a value indicating whether the collection items preserve object references. - - true if collection items preserve object references; otherwise, false. - - - - Gets or sets the collection item reference loop handling. - - The reference loop handling. - - - - Gets or sets the collection item type name handling. - - The type name handling. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets the of the collection items. - - The of the collection items. - - - - Gets a value indicating whether the collection type is a multidimensional array. - - true if the collection type is a multidimensional array; otherwise, false. - - - - Handles serialization callback events. - - The object that raised the callback event. - The streaming context. - - - - Handles serialization error callback events. - - The object that raised the callback event. - The streaming context. - The error context. - - - - Sets extension data for an object during deserialization. - - The object to set extension data on. - The extension data key. - The extension data value. - - - - Gets extension data for an object during serialization. - - The object to set extension data on. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets or sets the property name resolver. - - The property name resolver. - - - - Gets the of the dictionary keys. - - The of the dictionary keys. - - - - Gets the of the dictionary values. - - The of the dictionary values. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets the object's properties. - - The object's properties. - - - - Gets or sets the property name resolver. - - The property name resolver. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets or sets the ISerializable object constructor. - - The ISerializable object constructor. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets or sets the object member serialization. - - The member object serialization. - - - - Gets or sets a value that indicates whether the object's properties are required. - - - A value indicating whether the object's properties are required. - - - - - Gets the object's properties. - - The object's properties. - - - - Gets the constructor parameters required for any non-default constructor - - - - - Gets a collection of instances that define the parameters used with . - - - - - Gets or sets the override constructor used to create the object. - This is set when a constructor is marked up using the - JsonConstructor attribute. - - The override constructor. - - - - Gets or sets the parametrized constructor used to create the object. - - The parametrized constructor. - - - - Gets or sets the function used to create the object. When set this function will override . - This function is called with a collection of arguments which are defined by the collection. - - The function used to create the object. - - - - Gets or sets the extension data setter. - - - - - Gets or sets the extension data getter. - - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Maps a JSON property to a .NET member or constructor parameter. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Gets or sets the name of the property. - - The name of the property. - - - - Gets or sets the type that declared this property. - - The type that declared this property. - - - - Gets or sets the order of serialization and deserialization of a member. - - The numeric order of serialization or deserialization. - - - - Gets or sets the name of the underlying member or parameter. - - The name of the underlying member or parameter. - - - - Gets the that will get and set the during serialization. - - The that will get and set the during serialization. - - - - Gets or sets the for this property. - - The for this property. - - - - Gets or sets the type of the property. - - The type of the property. - - - - Gets or sets the for the property. - If set this converter takes presidence over the contract converter for the property type. - - The converter. - - - - Gets or sets the member converter. - - The member converter. - - - - Gets or sets a value indicating whether this is ignored. - - true if ignored; otherwise, false. - - - - Gets or sets a value indicating whether this is readable. - - true if readable; otherwise, false. - - - - Gets or sets a value indicating whether this is writable. - - true if writable; otherwise, false. - - - - Gets or sets a value indicating whether this has a member attribute. - - true if has a member attribute; otherwise, false. - - - - Gets the default value. - - The default value. - - - - Gets or sets a value indicating whether this is required. - - A value indicating whether this is required. - - - - Gets or sets a value indicating whether this property preserves object references. - - - true if this instance is reference; otherwise, false. - - - - - Gets or sets the property null value handling. - - The null value handling. - - - - Gets or sets the property default value handling. - - The default value handling. - - - - Gets or sets the property reference loop handling. - - The reference loop handling. - - - - Gets or sets the property object creation handling. - - The object creation handling. - - - - Gets or sets or sets the type name handling. - - The type name handling. - - - - Gets or sets a predicate used to determine whether the property should be serialize. - - A predicate used to determine whether the property should be serialize. - - - - Gets or sets a predicate used to determine whether the property should be serialized. - - A predicate used to determine whether the property should be serialized. - - - - Gets or sets an action used to set whether the property has been deserialized. - - An action used to set whether the property has been deserialized. - - - - Gets or sets the converter used when serializing the property's collection items. - - The collection's items converter. - - - - Gets or sets whether this property's collection items are serialized as a reference. - - Whether this property's collection items are serialized as a reference. - - - - Gets or sets the the type name handling used when serializing the property's collection items. - - The collection's items type name handling. - - - - Gets or sets the the reference loop handling used when serializing the property's collection items. - - The collection's items reference loop handling. - - - - A collection of objects. - - - - - Initializes a new instance of the class. - - The type. - - - - When implemented in a derived class, extracts the key from the specified element. - - The element from which to extract the key. - The key for the specified element. - - - - Adds a object. - - The property to add to the collection. - - - - Gets the closest matching object. - First attempts to get an exact case match of propertyName and then - a case insensitive match. - - Name of the property. - A matching property if found. - - - - Gets a property by property name. - - The name of the property to get. - Type property name string comparison. - A matching property if found. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Lookup and create an instance of the JsonConverter type described by the argument. - - The JsonConverter type to create. - Optional arguments to pass to an initializing constructor of the JsonConverter. - If null, the default constructor is used. - - - - Create a factory function that can be used to create instances of a JsonConverter described by the - argument type. The returned function can then be used to either invoke the converter's default ctor, or any - parameterized constructors by way of an object array. - - - - - Represents a trace writer that writes to memory. When the trace message limit is - reached then old trace messages will be removed as new messages are added. - - - - - Initializes a new instance of the class. - - - - - Writes the specified trace level, message and optional exception. - - The at which to write this trace. - The trace message. - The trace exception. This parameter is optional. - - - - Returns an enumeration of the most recent trace messages. - - An enumeration of the most recent trace messages. - - - - Returns a of the most recent trace messages. - - - A of the most recent trace messages. - - - - - Gets the that will be used to filter the trace messages passed to the writer. - For example a filter level of Info will exclude Verbose messages and include Info, - Warning and Error messages. - - - The that will be used to filter the trace messages passed to the writer. - - - - - Represents a method that constructs an object. - - The object type to create. - - - - When applied to a method, specifies that the method is called when an error occurs serializing an object. - - - - - Provides methods to get attributes from a , , or . - - - - - Initializes a new instance of the class. - - - - - Returns a collection of all of the attributes, or an empty collection if there are no attributes. - - When true, look up the hierarchy chain for the inherited custom attribute. - A collection of s, or an empty collection. - - - - Returns a collection of attributes, identified by type, or an empty collection if there are no attributes. - - The type of the attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - A collection of s, or an empty collection. - - - - Get and set values for a using reflection. - - - - - Initializes a new instance of the class. - - The member info. - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Specifies how strings are escaped when writing JSON text. - - - - - Only control characters (e.g. newline) are escaped. - - - - - All non-ASCII and control characters (e.g. newline) are escaped. - - - - - HTML (<, >, &, ', ") and control characters (e.g. newline) are escaped. - - - - - Specifies type name handling options for the . - - - - - Do not include the .NET type name when serializing types. - - - - - Include the .NET type name when serializing into a JSON object structure. - - - - - Include the .NET type name when serializing into a JSON array structure. - - - - - Always include the .NET type name when serializing. - - - - - Include the .NET type name when the type of the object being serialized is not the same as its declared type. - - - - - Determines whether the collection is null or empty. - - The collection. - - true if the collection is null or empty; otherwise, false. - - - - - Adds the elements of the specified collection to the specified generic IList. - - The list to add to. - The collection of elements to add. - - - - Returns the index of the first occurrence in a sequence by using a specified IEqualityComparer. - - The type of the elements of source. - A sequence in which to locate a value. - The object to locate in the sequence - An equality comparer to compare values. - The zero-based index of the first occurrence of value within the entire sequence, if found; otherwise, –1. - - - - Converts the value to the specified type. If the value is unable to be converted, the - value is checked whether it assignable to the specified type. - - The value to convert. - The culture to use when converting. - The type to convert or cast the value to. - - The converted type. If conversion was unsuccessful, the initial value - is returned if assignable to the target type. - - - - - Helper method for generating a MetaObject which calls a - specific method on Dynamic that returns a result - - - - - Helper method for generating a MetaObject which calls a - specific method on Dynamic, but uses one of the arguments for - the result. - - - - - Helper method for generating a MetaObject which calls a - specific method on Dynamic, but uses one of the arguments for - the result. - - - - - Returns a Restrictions object which includes our current restrictions merged - with a restriction limiting our type - - - - - Gets a dictionary of the names and values of an Enum type. - - - - - - Gets a dictionary of the names and values of an Enum type. - - The enum type to get names and values for. - - - - - Gets the type of the typed collection's items. - - The type. - The type of the typed collection's items. - - - - Gets the member's underlying type. - - The member. - The underlying type of the member. - - - - Determines whether the member is an indexed property. - - The member. - - true if the member is an indexed property; otherwise, false. - - - - - Determines whether the property is an indexed property. - - The property. - - true if the property is an indexed property; otherwise, false. - - - - - Gets the member's value on the object. - - The member. - The target object. - The member's value on the object. - - - - Sets the member's value on the target object. - - The member. - The target. - The value. - - - - Determines whether the specified MemberInfo can be read. - - The MemberInfo to determine whether can be read. - /// if set to true then allow the member to be gotten non-publicly. - - true if the specified MemberInfo can be read; otherwise, false. - - - - - Determines whether the specified MemberInfo can be set. - - The MemberInfo to determine whether can be set. - if set to true then allow the member to be set non-publicly. - if set to true then allow the member to be set if read-only. - - true if the specified MemberInfo can be set; otherwise, false. - - - - - Builds a string. Unlike StringBuilder this class lets you reuse it's internal buffer. - - - - - Determines whether the string is all white space. Empty string will return false. - - The string to test whether it is all white space. - - true if the string is all white space; otherwise, false. - - - - - Nulls an empty string. - - The string. - Null if the string was null, otherwise the string unchanged. - - - - Specifies the state of the . - - - - - An exception has been thrown, which has left the in an invalid state. - You may call the method to put the in the Closed state. - Any other method calls results in an being thrown. - - - - - The method has been called. - - - - - An object is being written. - - - - - A array is being written. - - - - - A constructor is being written. - - - - - A property is being written. - - - - - A write method has not been called. - - - - + + + + Newtonsoft.Json + + + + + Represents a BSON Oid (object id). + + + + + Initializes a new instance of the class. + + The Oid value. + + + + Gets or sets the value of the Oid. + + The value of the Oid. + + + + Represents a reader that provides fast, non-cached, forward-only access to serialized JSON data. + + + + + Represents a reader that provides fast, non-cached, forward-only access to serialized JSON data. + + + + + Initializes a new instance of the class with the specified . + + + + + Reads the next JSON token from the stream. + + true if the next token was read successfully; false if there are no more tokens to read. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a []. + + A [] or a null reference if the next JSON token is null. This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Skips the children of the current token. + + + + + Sets the current token. + + The new token. + + + + Sets the current token and value. + + The new token. + The value. + + + + Sets the state based on current token type. + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Releases unmanaged and - optionally - managed resources + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Changes the to Closed. + + + + + Gets the current reader state. + + The current reader state. + + + + Gets or sets a value indicating whether the underlying stream or + should be closed when the reader is closed. + + + true to close the underlying stream or when + the reader is closed; otherwise false. The default is true. + + + + + Gets or sets a value indicating whether multiple pieces of JSON content can + be read from a continuous stream without erroring. + + + true to support reading multiple pieces of JSON content; otherwise false. The default is false. + + + + + Gets the quotation mark character used to enclose the value of a string. + + + + + Get or set how time zones are handling when reading JSON. + + + + + Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. + + + + + Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. + + + + + Get or set how custom date formatted strings are parsed when reading JSON. + + + + + Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . + + + + + Gets the type of the current JSON token. + + + + + Gets the text value of the current JSON token. + + + + + Gets The Common Language Runtime (CLR) type for the current JSON token. + + + + + Gets the depth of the current token in the JSON document. + + The depth of the current token in the JSON document. + + + + Gets the path of the current JSON token. + + + + + Gets or sets the culture used when reading JSON. Defaults to . + + + + + Specifies the state of the reader. + + + + + The Read method has not been called. + + + + + The end of the file has been reached successfully. + + + + + Reader is at a property. + + + + + Reader is at the start of an object. + + + + + Reader is in an object. + + + + + Reader is at the start of an array. + + + + + Reader is in an array. + + + + + The Close method has been called. + + + + + Reader has just read a value. + + + + + Reader is at the start of a constructor. + + + + + Reader in a constructor. + + + + + An error occurred that prevents the read operation from continuing. + + + + + The end of the file has been reached successfully. + + + + + Initializes a new instance of the class. + + The stream. + + + + Initializes a new instance of the class. + + The reader. + + + + Initializes a new instance of the class. + + The stream. + if set to true the root object will be read as a JSON array. + The used when reading values from BSON. + + + + Initializes a new instance of the class. + + The reader. + if set to true the root object will be read as a JSON array. + The used when reading values from BSON. + + + + Reads the next JSON token from the stream as a []. + + + A [] or a null reference if the next JSON token is null. This method will return null at the end of an array. + + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + + A . This method will return null at the end of an array. + + + + + Reads the next JSON token from the stream. + + + true if the next token was read successfully; false if there are no more tokens to read. + + + + + Changes the to Closed. + + + + + Gets or sets a value indicating whether binary data reading should compatible with incorrect Json.NET 3.5 written binary. + + + true if binary data reading will be compatible with incorrect Json.NET 3.5 written binary; otherwise, false. + + + + + Gets or sets a value indicating whether the root object will be read as a JSON array. + + + true if the root object will be read as a JSON array; otherwise, false. + + + + + Gets or sets the used when reading values from BSON. + + The used when reading values from BSON. + + + + Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. + + + + + Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. + + + + + Creates an instance of the JsonWriter class. + + + + + Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. + + + + + Closes this stream and the underlying stream. + + + + + Writes the beginning of a Json object. + + + + + Writes the end of a Json object. + + + + + Writes the beginning of a Json array. + + + + + Writes the end of an array. + + + + + Writes the start of a constructor with the given name. + + The name of the constructor. + + + + Writes the end constructor. + + + + + Writes the property name of a name/value pair on a JSON object. + + The name of the property. + + + + Writes the property name of a name/value pair on a JSON object. + + The name of the property. + A flag to indicate whether the text should be escaped when it is written as a JSON property name. + + + + Writes the end of the current Json object or array. + + + + + Writes the current token and its children. + + The to read the token from. + + + + Writes the current token. + + The to read the token from. + A flag indicating whether the current token's children should be written. + + + + Writes the token and its value. + + The to write. + + The value to write. + A value is only required for tokens that have an associated value, e.g. the property name for . + A null value can be passed to the method for token's that don't have a value, e.g. . + + + + Writes the token. + + The to write. + + + + Writes the specified end token. + + The end token to write. + + + + Writes indent characters. + + + + + Writes the JSON value delimiter. + + + + + Writes an indent space. + + + + + Writes a null value. + + + + + Writes an undefined value. + + + + + Writes raw JSON without changing the writer's state. + + The raw JSON to write. + + + + Writes raw JSON where a value is expected and updates the writer's state. + + The raw JSON to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a [] value. + + The [] value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + An error will raised if the value cannot be written as a single JSON token. + + The value to write. + + + + Writes out a comment /*...*/ containing the specified text. + + Text to place inside the comment. + + + + Writes out the given white space. + + The string of white space characters. + + + + Sets the state of the JsonWriter, + + The JsonToken being written. + The value being written. + + + + Gets or sets a value indicating whether the underlying stream or + should be closed when the writer is closed. + + + true to close the underlying stream or when + the writer is closed; otherwise false. The default is true. + + + + + Gets the top. + + The top. + + + + Gets the state of the writer. + + + + + Gets the path of the writer. + + + + + Indicates how JSON text output is formatted. + + + + + Get or set how dates are written to JSON text. + + + + + Get or set how time zones are handling when writing JSON text. + + + + + Get or set how strings are escaped when writing JSON text. + + + + + Get or set how special floating point numbers, e.g. , + and , + are written to JSON text. + + + + + Get or set how and values are formatting when writing JSON text. + + + + + Gets or sets the culture used when writing JSON. Defaults to . + + + + + Initializes a new instance of the class. + + The stream. + + + + Initializes a new instance of the class. + + The writer. + + + + Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. + + + + + Writes the end. + + The token. + + + + Writes out a comment /*...*/ containing the specified text. + + Text to place inside the comment. + + + + Writes the start of a constructor with the given name. + + The name of the constructor. + + + + Writes raw JSON. + + The raw JSON to write. + + + + Writes raw JSON where a value is expected and updates the writer's state. + + The raw JSON to write. + + + + Writes the beginning of a Json array. + + + + + Writes the beginning of a Json object. + + + + + Writes the property name of a name/value pair on a Json object. + + The name of the property. + + + + Closes this stream and the underlying stream. + + + + + Writes a value. + An error will raised if the value cannot be written as a single JSON token. + + The value to write. + + + + Writes a null value. + + + + + Writes an undefined value. + + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a [] value. + + The [] value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a [] value that represents a BSON object id. + + The Object ID value to write. + + + + Writes a BSON regex. + + The regex pattern. + The regex options. + + + + Gets or sets the used when writing values to BSON. + When set to no conversion will occur. + + The used when writing values to BSON. + + + + Specifies how constructors are used when initializing objects during deserialization by the . + + + + + First attempt to use the public default constructor, then fall back to single paramatized constructor, then the non-public default constructor. + + + + + Json.NET will use a non-public default constructor before falling back to a paramatized constructor. + + + + + Converts a binary value to and from a base 64 string value. + + + + + Converts an object to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Gets the of the JSON produced by the JsonConverter. + + The of the JSON produced by the JsonConverter. + + + + Gets a value indicating whether this can read JSON. + + true if this can read JSON; otherwise, false. + + + + Gets a value indicating whether this can write JSON. + + true if this can write JSON; otherwise, false. + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Converts a to and from JSON and BSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Create a custom object + + The object type to convert. + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Creates an object which will then be populated by the serializer. + + Type of the object. + The created object. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Gets a value indicating whether this can write JSON. + + + true if this can write JSON; otherwise, false. + + + + + Converts a to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified value type. + + Type of the value. + + true if this instance can convert the specified value type; otherwise, false. + + + + + Converts a to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified value type. + + Type of the value. + + true if this instance can convert the specified value type; otherwise, false. + + + + + Provides a base class for converting a to and from JSON. + + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Converts a F# discriminated union type to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Converts an Entity Framework EntityKey to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Converts an ExpandoObject to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Gets a value indicating whether this can write JSON. + + + true if this can write JSON; otherwise, false. + + + + + Converts a to and from the ISO 8601 date format (e.g. 2008-04-12T12:53Z). + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Gets or sets the date time styles used when converting a date to and from JSON. + + The date time styles used when converting a date to and from JSON. + + + + Gets or sets the date time format used when converting a date to and from JSON. + + The date time format used when converting a date to and from JSON. + + + + Gets or sets the culture used when converting a date to and from JSON. + + The culture used when converting a date to and from JSON. + + + + Converts a to and from a JavaScript date constructor (e.g. new Date(52231943)). + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing property value of the JSON that is being converted. + The calling serializer. + The object value. + + + + Converts a to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Converts a to and from JSON and BSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Converts an to and from its name string value. + + + + + Initializes a new instance of the class. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Gets or sets a value indicating whether the written enum text should be camel case. + + true if the written enum text will be camel case; otherwise, false. + + + + Gets or sets a value indicating whether integer values are allowed. + + true if integers are allowed; otherwise, false. + + + + Converts a to and from a string (e.g. "1.2.3.4"). + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing property value of the JSON that is being converted. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Converts XML to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The calling serializer. + The value. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Checks if the attributeName is a namespace attribute. + + Attribute name to test. + The attribute name prefix if it has one, otherwise an empty string. + True if attribute name is for a namespace attribute, otherwise false. + + + + Determines whether this instance can convert the specified value type. + + Type of the value. + + true if this instance can convert the specified value type; otherwise, false. + + + + + Gets or sets the name of the root element to insert when deserializing to XML if the JSON structure has produces multiple root elements. + + The name of the deserialize root element. + + + + Gets or sets a flag to indicate whether to write the Json.NET array attribute. + This attribute helps preserve arrays when converting the written XML back to JSON. + + true if the array attibute is written to the XML; otherwise, false. + + + + Gets or sets a value indicating whether to write the root JSON object. + + true if the JSON root object is omitted; otherwise, false. + + + + Specifies how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. + + + + + Floating point numbers are parsed to . + + + + + Floating point numbers are parsed to . + + + + + Specifies how dates are formatted when writing JSON text. + + + + + Dates are written in the ISO 8601 format, e.g. "2012-03-21T05:40Z". + + + + + Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/". + + + + + Specifies how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON text. + + + + + Date formatted strings are not parsed to a date type and are read as strings. + + + + + Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . + + + + + Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . + + + + + Specifies how to treat the time value when converting between string and . + + + + + Treat as local time. If the object represents a Coordinated Universal Time (UTC), it is converted to the local time. + + + + + Treat as a UTC. If the object represents a local time, it is converted to a UTC. + + + + + Treat as a local time if a is being converted to a string. + If a string is being converted to , convert to a local time if a time zone is specified. + + + + + Time zone information should be preserved when converting. + + + + + Specifies default value handling options for the . + + + + + + + + + Include members where the member value is the same as the member's default value when serializing objects. + Included members are written to JSON. Has no effect when deserializing. + + + + + Ignore members where the member value is the same as the member's default value when serializing objects + so that is is not written to JSON. + This option will ignore all default values (e.g. null for objects and nullable types; 0 for integers, + decimals and floating point numbers; and false for booleans). The default value ignored can be changed by + placing the on the property. + + + + + Members with a default value but no JSON will be set to their default value when deserializing. + + + + + Ignore members where the member value is the same as the member's default value when serializing objects + and sets members to their default value when deserializing. + + + + + Specifies float format handling options when writing special floating point numbers, e.g. , + and with . + + + + + Write special floating point values as strings in JSON, e.g. "NaN", "Infinity", "-Infinity". + + + + + Write special floating point values as symbols in JSON, e.g. NaN, Infinity, -Infinity. + Note that this will produce non-valid JSON. + + + + + Write special floating point values as the property's default value in JSON, e.g. 0.0 for a property, null for a property. + + + + + Specifies formatting options for the . + + + + + No special formatting is applied. This is the default. + + + + + Causes child objects to be indented according to the and settings. + + + + + Provides an interface to enable a class to return line and position information. + + + + + Gets a value indicating whether the class can return line information. + + + true if LineNumber and LinePosition can be provided; otherwise, false. + + + + + Gets the current line number. + + The current line number or 0 if no line information is available (for example, HasLineInfo returns false). + + + + Gets the current line position. + + The current line position or 0 if no line information is available (for example, HasLineInfo returns false). + + + + Instructs the how to serialize the collection. + + + + + Instructs the how to serialize the object. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with the specified container Id. + + The container Id. + + + + Gets or sets the id. + + The id. + + + + Gets or sets the title. + + The title. + + + + Gets or sets the description. + + The description. + + + + Gets the collection's items converter. + + The collection's items converter. + + + + The parameter list to use when constructing the JsonConverter described by ItemConverterType. + If null, the default constructor is used. + When non-null, there must be a constructor defined in the JsonConverter that exactly matches the number, + order, and type of these parameters. + + + [JsonContainer(ItemConverterType = typeof(MyContainerConverter), ItemConverterParameters = new object[] { 123, "Four" })] + + + + + Gets or sets a value that indicates whether to preserve object references. + + + true to keep object reference; otherwise, false. The default is false. + + + + + Gets or sets a value that indicates whether to preserve collection's items references. + + + true to keep collection's items object references; otherwise, false. The default is false. + + + + + Gets or sets the reference loop handling used when serializing the collection's items. + + The reference loop handling. + + + + Gets or sets the type name handling used when serializing the collection's items. + + The type name handling. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with a flag indicating whether the array can contain null items + + A flag indicating whether the array can contain null items. + + + + Initializes a new instance of the class with the specified container Id. + + The container Id. + + + + Gets or sets a value indicating whether null items are allowed in the collection. + + true if null items are allowed in the collection; otherwise, false. + + + + Instructs the to use the specified constructor when deserializing that object. + + + + + Provides methods for converting between common language runtime types and JSON types. + + + + + + + + Represents JavaScript's boolean value true as a string. This field is read-only. + + + + + Represents JavaScript's boolean value false as a string. This field is read-only. + + + + + Represents JavaScript's null as a string. This field is read-only. + + + + + Represents JavaScript's undefined as a string. This field is read-only. + + + + + Represents JavaScript's positive infinity as a string. This field is read-only. + + + + + Represents JavaScript's negative infinity as a string. This field is read-only. + + + + + Represents JavaScript's NaN as a string. This field is read-only. + + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation using the specified. + + The value to convert. + The format the date will be converted to. + The time zone handling when the date is converted to a string. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation using the specified. + + The value to convert. + The format the date will be converted to. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + The string delimiter character. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + The string delimiter character. + The string escape handling. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Serializes the specified object to a JSON string. + + The object to serialize. + A JSON string representation of the object. + + + + Serializes the specified object to a JSON string using formatting. + + The object to serialize. + Indicates how the output is formatted. + + A JSON string representation of the object. + + + + + Serializes the specified object to a JSON string using a collection of . + + The object to serialize. + A collection converters used while serializing. + A JSON string representation of the object. + + + + Serializes the specified object to a JSON string using formatting and a collection of . + + The object to serialize. + Indicates how the output is formatted. + A collection converters used while serializing. + A JSON string representation of the object. + + + + Serializes the specified object to a JSON string using . + + The object to serialize. + The used to serialize the object. + If this is null, default serialization settings will be used. + + A JSON string representation of the object. + + + + + Serializes the specified object to a JSON string using a type, formatting and . + + The object to serialize. + The used to serialize the object. + If this is null, default serialization settings will be used. + + The type of the value being serialized. + This parameter is used when is Auto to write out the type name if the type of the value does not match. + Specifing the type is optional. + + + A JSON string representation of the object. + + + + + Serializes the specified object to a JSON string using formatting and . + + The object to serialize. + Indicates how the output is formatted. + The used to serialize the object. + If this is null, default serialization settings will be used. + + A JSON string representation of the object. + + + + + Serializes the specified object to a JSON string using a type, formatting and . + + The object to serialize. + Indicates how the output is formatted. + The used to serialize the object. + If this is null, default serialization settings will be used. + + The type of the value being serialized. + This parameter is used when is Auto to write out the type name if the type of the value does not match. + Specifing the type is optional. + + + A JSON string representation of the object. + + + + + Asynchronously serializes the specified object to a JSON string. + Serialization will happen on a new thread. + + The object to serialize. + + A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. + + + + + Asynchronously serializes the specified object to a JSON string using formatting. + Serialization will happen on a new thread. + + The object to serialize. + Indicates how the output is formatted. + + A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. + + + + + Asynchronously serializes the specified object to a JSON string using formatting and a collection of . + Serialization will happen on a new thread. + + The object to serialize. + Indicates how the output is formatted. + The used to serialize the object. + If this is null, default serialization settings will be used. + + A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. + + + + + Deserializes the JSON to a .NET object. + + The JSON to deserialize. + The deserialized object from the JSON string. + + + + Deserializes the JSON to a .NET object using . + + The JSON to deserialize. + + The used to deserialize the object. + If this is null, default serialization settings will be used. + + The deserialized object from the JSON string. + + + + Deserializes the JSON to the specified .NET type. + + The JSON to deserialize. + The of object being deserialized. + The deserialized object from the JSON string. + + + + Deserializes the JSON to the specified .NET type. + + The type of the object to deserialize to. + The JSON to deserialize. + The deserialized object from the JSON string. + + + + Deserializes the JSON to the given anonymous type. + + + The anonymous type to deserialize to. This can't be specified + traditionally and must be infered from the anonymous type passed + as a parameter. + + The JSON to deserialize. + The anonymous type object. + The deserialized anonymous type from the JSON string. + + + + Deserializes the JSON to the given anonymous type using . + + + The anonymous type to deserialize to. This can't be specified + traditionally and must be infered from the anonymous type passed + as a parameter. + + The JSON to deserialize. + The anonymous type object. + + The used to deserialize the object. + If this is null, default serialization settings will be used. + + The deserialized anonymous type from the JSON string. + + + + Deserializes the JSON to the specified .NET type using a collection of . + + The type of the object to deserialize to. + The JSON to deserialize. + Converters to use while deserializing. + The deserialized object from the JSON string. + + + + Deserializes the JSON to the specified .NET type using . + + The type of the object to deserialize to. + The object to deserialize. + + The used to deserialize the object. + If this is null, default serialization settings will be used. + + The deserialized object from the JSON string. + + + + Deserializes the JSON to the specified .NET type using a collection of . + + The JSON to deserialize. + The type of the object to deserialize. + Converters to use while deserializing. + The deserialized object from the JSON string. + + + + Deserializes the JSON to the specified .NET type using . + + The JSON to deserialize. + The type of the object to deserialize to. + + The used to deserialize the object. + If this is null, default serialization settings will be used. + + The deserialized object from the JSON string. + + + + Asynchronously deserializes the JSON to the specified .NET type. + Deserialization will happen on a new thread. + + The type of the object to deserialize to. + The JSON to deserialize. + + A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. + + + + + Asynchronously deserializes the JSON to the specified .NET type using . + Deserialization will happen on a new thread. + + The type of the object to deserialize to. + The JSON to deserialize. + + The used to deserialize the object. + If this is null, default serialization settings will be used. + + + A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. + + + + + Asynchronously deserializes the JSON to the specified .NET type. + Deserialization will happen on a new thread. + + The JSON to deserialize. + + A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. + + + + + Asynchronously deserializes the JSON to the specified .NET type using . + Deserialization will happen on a new thread. + + The JSON to deserialize. + The type of the object to deserialize to. + + The used to deserialize the object. + If this is null, default serialization settings will be used. + + + A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. + + + + + Populates the object with values from the JSON string. + + The JSON to populate values from. + The target object to populate values onto. + + + + Populates the object with values from the JSON string using . + + The JSON to populate values from. + The target object to populate values onto. + + The used to deserialize the object. + If this is null, default serialization settings will be used. + + + + + Asynchronously populates the object with values from the JSON string using . + + The JSON to populate values from. + The target object to populate values onto. + + The used to deserialize the object. + If this is null, default serialization settings will be used. + + + A task that represents the asynchronous populate operation. + + + + + Serializes the XML node to a JSON string. + + The node to serialize. + A JSON string of the XmlNode. + + + + Serializes the XML node to a JSON string using formatting. + + The node to serialize. + Indicates how the output is formatted. + A JSON string of the XmlNode. + + + + Serializes the XML node to a JSON string using formatting and omits the root object if is true. + + The node to serialize. + Indicates how the output is formatted. + Omits writing the root object. + A JSON string of the XmlNode. + + + + Deserializes the XmlNode from a JSON string. + + The JSON string. + The deserialized XmlNode + + + + Deserializes the XmlNode from a JSON string nested in a root elment specified by . + + The JSON string. + The name of the root element to append when deserializing. + The deserialized XmlNode + + + + Deserializes the XmlNode from a JSON string nested in a root elment specified by + and writes a .NET array attribute for collections. + + The JSON string. + The name of the root element to append when deserializing. + + A flag to indicate whether to write the Json.NET array attribute. + This attribute helps preserve arrays when converting the written XML back to JSON. + + The deserialized XmlNode + + + + Serializes the to a JSON string. + + The node to convert to JSON. + A JSON string of the XNode. + + + + Serializes the to a JSON string using formatting. + + The node to convert to JSON. + Indicates how the output is formatted. + A JSON string of the XNode. + + + + Serializes the to a JSON string using formatting and omits the root object if is true. + + The node to serialize. + Indicates how the output is formatted. + Omits writing the root object. + A JSON string of the XNode. + + + + Deserializes the from a JSON string. + + The JSON string. + The deserialized XNode + + + + Deserializes the from a JSON string nested in a root elment specified by . + + The JSON string. + The name of the root element to append when deserializing. + The deserialized XNode + + + + Deserializes the from a JSON string nested in a root elment specified by + and writes a .NET array attribute for collections. + + The JSON string. + The name of the root element to append when deserializing. + + A flag to indicate whether to write the Json.NET array attribute. + This attribute helps preserve arrays when converting the written XML back to JSON. + + The deserialized XNode + + + + Gets or sets a function that creates default . + Default settings are automatically used by serialization methods on , + and and on . + To serialize without using any default settings create a with + . + + + + + Instructs the to use the specified when serializing the member or class. + + + + + Initializes a new instance of the class. + + Type of the converter. + + + + Initializes a new instance of the class. + + Type of the converter. + Parameter list to use when constructing the JsonConverter. Can be null. + + + + Gets the type of the converter. + + The type of the converter. + + + + The parameter list to use when constructing the JsonConverter described by ConverterType. + If null, the default constructor is used. + + + + + Represents a collection of . + + + + + Instructs the how to serialize the collection. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with the specified container Id. + + The container Id. + + + + The exception thrown when an error occurs during Json serialization or deserialization. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class + with a specified error message. + + The error message that explains the reason for the exception. + + + + Initializes a new instance of the class + with a specified error message and a reference to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. + + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + The parameter is null. + The class name is null or is zero (0). + + + + Instructs the to deserialize properties with no matching class member into the specified collection + and write values during serialization. + + + + + Initializes a new instance of the class. + + + + + Gets or sets a value that indicates whether to write extension data when serializing the object. + + + true to write extension data when serializing the object; otherwise, false. The default is true. + + + + + Gets or sets a value that indicates whether to read extension data when deserializing the object. + + + true to read extension data when deserializing the object; otherwise, false. The default is true. + + + + + Instructs the not to serialize the public field or public read/write property value. + + + + + Instructs the how to serialize the object. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with the specified member serialization. + + The member serialization. + + + + Initializes a new instance of the class with the specified container Id. + + The container Id. + + + + Gets or sets the member serialization. + + The member serialization. + + + + Gets or sets a value that indicates whether the object's properties are required. + + + A value indicating whether the object's properties are required. + + + + + Instructs the to always serialize the member with the specified name. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with the specified name. + + Name of the property. + + + + Gets or sets the converter used when serializing the property's collection items. + + The collection's items converter. + + + + The parameter list to use when constructing the JsonConverter described by ItemConverterType. + If null, the default constructor is used. + When non-null, there must be a constructor defined in the JsonConverter that exactly matches the number, + order, and type of these parameters. + + + [JsonProperty(ItemConverterType = typeof(MyContainerConverter), ItemConverterParameters = new object[] { 123, "Four" })] + + + + + Gets or sets the null value handling used when serializing this property. + + The null value handling. + + + + Gets or sets the default value handling used when serializing this property. + + The default value handling. + + + + Gets or sets the reference loop handling used when serializing this property. + + The reference loop handling. + + + + Gets or sets the object creation handling used when deserializing this property. + + The object creation handling. + + + + Gets or sets the type name handling used when serializing this property. + + The type name handling. + + + + Gets or sets whether this property's value is serialized as a reference. + + Whether this property's value is serialized as a reference. + + + + Gets or sets the order of serialization and deserialization of a member. + + The numeric order of serialization or deserialization. + + + + Gets or sets a value indicating whether this property is required. + + + A value indicating whether this property is required. + + + + + Gets or sets the name of the property. + + The name of the property. + + + + Gets or sets the the reference loop handling used when serializing the property's collection items. + + The collection's items reference loop handling. + + + + Gets or sets the the type name handling used when serializing the property's collection items. + + The collection's items type name handling. + + + + Gets or sets whether this property's collection items are serialized as a reference. + + Whether this property's collection items are serialized as a reference. + + + + The exception thrown when an error occurs while reading Json text. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class + with a specified error message. + + The error message that explains the reason for the exception. + + + + Initializes a new instance of the class + with a specified error message and a reference to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. + + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + The parameter is null. + The class name is null or is zero (0). + + + + Gets the line number indicating where the error occurred. + + The line number indicating where the error occurred. + + + + Gets the line position indicating where the error occurred. + + The line position indicating where the error occurred. + + + + Gets the path to the JSON where the error occurred. + + The path to the JSON where the error occurred. + + + + The exception thrown when an error occurs during Json serialization or deserialization. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class + with a specified error message. + + The error message that explains the reason for the exception. + + + + Initializes a new instance of the class + with a specified error message and a reference to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. + + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + The parameter is null. + The class name is null or is zero (0). + + + + Serializes and deserializes objects into and from the JSON format. + The enables you to control how objects are encoded into JSON. + + + + + Initializes a new instance of the class. + + + + + Creates a new instance. + The will not use default settings. + + + A new instance. + The will not use default settings. + + + + + Creates a new instance using the specified . + The will not use default settings. + + The settings to be applied to the . + + A new instance using the specified . + The will not use default settings. + + + + + Creates a new instance. + The will use default settings. + + + A new instance. + The will use default settings. + + + + + Creates a new instance using the specified . + The will use default settings. + + The settings to be applied to the . + + A new instance using the specified . + The will use default settings. + + + + + Populates the JSON values onto the target object. + + The that contains the JSON structure to reader values from. + The target object to populate values onto. + + + + Populates the JSON values onto the target object. + + The that contains the JSON structure to reader values from. + The target object to populate values onto. + + + + Deserializes the Json structure contained by the specified . + + The that contains the JSON structure to deserialize. + The being deserialized. + + + + Deserializes the Json structure contained by the specified + into an instance of the specified type. + + The containing the object. + The of object being deserialized. + The instance of being deserialized. + + + + Deserializes the Json structure contained by the specified + into an instance of the specified type. + + The containing the object. + The type of the object to deserialize. + The instance of being deserialized. + + + + Deserializes the Json structure contained by the specified + into an instance of the specified type. + + The containing the object. + The of object being deserialized. + The instance of being deserialized. + + + + Serializes the specified and writes the Json structure + to a Stream using the specified . + + The used to write the Json structure. + The to serialize. + + + + Serializes the specified and writes the Json structure + to a Stream using the specified . + + The used to write the Json structure. + The to serialize. + + The type of the value being serialized. + This parameter is used when is Auto to write out the type name if the type of the value does not match. + Specifing the type is optional. + + + + + Serializes the specified and writes the Json structure + to a Stream using the specified . + + The used to write the Json structure. + The to serialize. + + The type of the value being serialized. + This parameter is used when is Auto to write out the type name if the type of the value does not match. + Specifing the type is optional. + + + + + Serializes the specified and writes the Json structure + to a Stream using the specified . + + The used to write the Json structure. + The to serialize. + + + + Occurs when the errors during serialization and deserialization. + + + + + Gets or sets the used by the serializer when resolving references. + + + + + Gets or sets the used by the serializer when resolving type names. + + + + + Gets or sets the used by the serializer when writing trace messages. + + The trace writer. + + + + Gets or sets how type name writing and reading is handled by the serializer. + + + + + Gets or sets how a type name assembly is written and resolved by the serializer. + + The type name assembly format. + + + + Gets or sets how object references are preserved by the serializer. + + + + + Get or set how reference loops (e.g. a class referencing itself) is handled. + + + + + Get or set how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. + + + + + Get or set how null values are handled during serialization and deserialization. + + + + + Get or set how null default are handled during serialization and deserialization. + + + + + Gets or sets how objects are created during deserialization. + + The object creation handling. + + + + Gets or sets how constructors are used during deserialization. + + The constructor handling. + + + + Gets or sets how metadata properties are used during deserialization. + + The metadata properties handling. + + + + Gets a collection that will be used during serialization. + + Collection that will be used during serialization. + + + + Gets or sets the contract resolver used by the serializer when + serializing .NET objects to JSON and vice versa. + + + + + Gets or sets the used by the serializer when invoking serialization callback methods. + + The context. + + + + Indicates how JSON text output is formatted. + + + + + Get or set how dates are written to JSON text. + + + + + Get or set how time zones are handling during serialization and deserialization. + + + + + Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. + + + + + Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. + + + + + Get or set how special floating point numbers, e.g. , + and , + are written as JSON text. + + + + + Get or set how strings are escaped when writing JSON text. + + + + + Get or set how and values are formatting when writing JSON text. + + + + + Gets or sets the culture used when reading JSON. Defaults to . + + + + + Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . + + + + + Gets a value indicating whether there will be a check for additional JSON content after deserializing an object. + + + true if there will be a check for additional JSON content after deserializing an object; otherwise, false. + + + + + Specifies the settings on a object. + + + + + Initializes a new instance of the class. + + + + + Gets or sets how reference loops (e.g. a class referencing itself) is handled. + + Reference loop handling. + + + + Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. + + Missing member handling. + + + + Gets or sets how objects are created during deserialization. + + The object creation handling. + + + + Gets or sets how null values are handled during serialization and deserialization. + + Null value handling. + + + + Gets or sets how null default are handled during serialization and deserialization. + + The default value handling. + + + + Gets or sets a collection that will be used during serialization. + + The converters. + + + + Gets or sets how object references are preserved by the serializer. + + The preserve references handling. + + + + Gets or sets how type name writing and reading is handled by the serializer. + + The type name handling. + + + + Gets or sets how metadata properties are used during deserialization. + + The metadata properties handling. + + + + Gets or sets how a type name assembly is written and resolved by the serializer. + + The type name assembly format. + + + + Gets or sets how constructors are used during deserialization. + + The constructor handling. + + + + Gets or sets the contract resolver used by the serializer when + serializing .NET objects to JSON and vice versa. + + The contract resolver. + + + + Gets or sets the used by the serializer when resolving references. + + The reference resolver. + + + + Gets or sets the used by the serializer when writing trace messages. + + The trace writer. + + + + Gets or sets the used by the serializer when resolving type names. + + The binder. + + + + Gets or sets the error handler called during serialization and deserialization. + + The error handler called during serialization and deserialization. + + + + Gets or sets the used by the serializer when invoking serialization callback methods. + + The context. + + + + Get or set how and values are formatting when writing JSON text. + + + + + Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . + + + + + Indicates how JSON text output is formatted. + + + + + Get or set how dates are written to JSON text. + + + + + Get or set how time zones are handling during serialization and deserialization. + + + + + Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. + + + + + Get or set how special floating point numbers, e.g. , + and , + are written as JSON. + + + + + Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. + + + + + Get or set how strings are escaped when writing JSON text. + + + + + Gets or sets the culture used when reading JSON. Defaults to . + + + + + Gets a value indicating whether there will be a check for additional content after deserializing an object. + + + true if there will be a check for additional content after deserializing an object; otherwise, false. + + + + + Represents a reader that provides fast, non-cached, forward-only access to JSON text data. + + + + + Initializes a new instance of the class with the specified . + + The TextReader containing the XML data to read. + + + + Reads the next JSON token from the stream. + + + true if the next token was read successfully; false if there are no more tokens to read. + + + + + Reads the next JSON token from the stream as a []. + + + A [] or a null reference if the next JSON token is null. This method will return null at the end of an array. + + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Changes the state to closed. + + + + + Gets a value indicating whether the class can return line information. + + + true if LineNumber and LinePosition can be provided; otherwise, false. + + + + + Gets the current line number. + + + The current line number or 0 if no line information is available (for example, HasLineInfo returns false). + + + + + Gets the current line position. + + + The current line position or 0 if no line information is available (for example, HasLineInfo returns false). + + + + + Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. + + + + + Creates an instance of the JsonWriter class using the specified . + + The TextWriter to write to. + + + + Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. + + + + + Closes this stream and the underlying stream. + + + + + Writes the beginning of a Json object. + + + + + Writes the beginning of a Json array. + + + + + Writes the start of a constructor with the given name. + + The name of the constructor. + + + + Writes the specified end token. + + The end token to write. + + + + Writes the property name of a name/value pair on a Json object. + + The name of the property. + + + + Writes the property name of a name/value pair on a JSON object. + + The name of the property. + A flag to indicate whether the text should be escaped when it is written as a JSON property name. + + + + Writes indent characters. + + + + + Writes the JSON value delimiter. + + + + + Writes an indent space. + + + + + Writes a value. + An error will raised if the value cannot be written as a single JSON token. + + The value to write. + + + + Writes a null value. + + + + + Writes an undefined value. + + + + + Writes raw JSON. + + The raw JSON to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a [] value. + + The [] value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes out a comment /*...*/ containing the specified text. + + Text to place inside the comment. + + + + Writes out the given white space. + + The string of white space characters. + + + + Gets or sets how many IndentChars to write for each level in the hierarchy when is set to Formatting.Indented. + + + + + Gets or sets which character to use to quote attribute values. + + + + + Gets or sets which character to use for indenting when is set to Formatting.Indented. + + + + + Gets or sets a value indicating whether object names will be surrounded with quotes. + + + + + Specifies the type of Json token. + + + + + This is returned by the if a method has not been called. + + + + + An object start token. + + + + + An array start token. + + + + + A constructor start token. + + + + + An object property name. + + + + + A comment. + + + + + Raw JSON. + + + + + An integer. + + + + + A float. + + + + + A string. + + + + + A boolean. + + + + + A null token. + + + + + An undefined token. + + + + + An object end token. + + + + + An array end token. + + + + + A constructor end token. + + + + + A Date. + + + + + Byte data. + + + + + Represents a reader that provides validation. + + + + + Initializes a new instance of the class that + validates the content returned from the given . + + The to read from while validating. + + + + Reads the next JSON token from the stream as a . + + A . + + + + Reads the next JSON token from the stream as a []. + + + A [] or a null reference if the next JSON token is null. + + + + + Reads the next JSON token from the stream as a . + + A . + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . + + + + Reads the next JSON token from the stream. + + + true if the next token was read successfully; false if there are no more tokens to read. + + + + + Sets an event handler for receiving schema validation errors. + + + + + Gets the text value of the current JSON token. + + + + + + Gets the depth of the current token in the JSON document. + + The depth of the current token in the JSON document. + + + + Gets the path of the current JSON token. + + + + + Gets the quotation mark character used to enclose the value of a string. + + + + + + Gets the type of the current JSON token. + + + + + + Gets the Common Language Runtime (CLR) type for the current JSON token. + + + + + + Gets or sets the schema. + + The schema. + + + + Gets the used to construct this . + + The specified in the constructor. + + + + The exception thrown when an error occurs while reading Json text. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class + with a specified error message. + + The error message that explains the reason for the exception. + + + + Initializes a new instance of the class + with a specified error message and a reference to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. + + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + The parameter is null. + The class name is null or is zero (0). + + + + Gets the path to the JSON where the error occurred. + + The path to the JSON where the error occurred. + + + + Contains the LINQ to JSON extension methods. + + + + + Returns a collection of tokens that contains the ancestors of every token in the source collection. + + The type of the objects in source, constrained to . + An of that contains the source collection. + An of that contains the ancestors of every token in the source collection. + + + + Returns a collection of tokens that contains every token in the source collection, and the ancestors of every token in the source collection. + + The type of the objects in source, constrained to . + An of that contains the source collection. + An of that contains every token in the source collection, the ancestors of every token in the source collection. + + + + Returns a collection of tokens that contains the descendants of every token in the source collection. + + The type of the objects in source, constrained to . + An of that contains the source collection. + An of that contains the descendants of every token in the source collection. + + + + Returns a collection of tokens that contains every token in the source collection, and the descendants of every token in the source collection. + + The type of the objects in source, constrained to . + An of that contains the source collection. + An of that contains every token in the source collection, and the descendants of every token in the source collection. + + + + Returns a collection of child properties of every object in the source collection. + + An of that contains the source collection. + An of that contains the properties of every object in the source collection. + + + + Returns a collection of child values of every object in the source collection with the given key. + + An of that contains the source collection. + The token key. + An of that contains the values of every token in the source collection with the given key. + + + + Returns a collection of child values of every object in the source collection. + + An of that contains the source collection. + An of that contains the values of every token in the source collection. + + + + Returns a collection of converted child values of every object in the source collection with the given key. + + The type to convert the values to. + An of that contains the source collection. + The token key. + An that contains the converted values of every token in the source collection with the given key. + + + + Returns a collection of converted child values of every object in the source collection. + + The type to convert the values to. + An of that contains the source collection. + An that contains the converted values of every token in the source collection. + + + + Converts the value. + + The type to convert the value to. + A cast as a of . + A converted value. + + + + Converts the value. + + The source collection type. + The type to convert the value to. + A cast as a of . + A converted value. + + + + Returns a collection of child tokens of every array in the source collection. + + The source collection type. + An of that contains the source collection. + An of that contains the values of every token in the source collection. + + + + Returns a collection of converted child tokens of every array in the source collection. + + An of that contains the source collection. + The type to convert the values to. + The source collection type. + An that contains the converted values of every token in the source collection. + + + + Returns the input typed as . + + An of that contains the source collection. + The input typed as . + + + + Returns the input typed as . + + The source collection type. + An of that contains the source collection. + The input typed as . + + + + Represents a collection of objects. + + The type of token + + + + Gets the with the specified key. + + + + + + Represents a JSON array. + + + + + + + + Represents a token that can contain other tokens. + + + + + Represents an abstract JSON token. + + + + + Compares the values of two tokens, including the values of all descendant tokens. + + The first to compare. + The second to compare. + true if the tokens are equal; otherwise false. + + + + Adds the specified content immediately after this token. + + A content object that contains simple content or a collection of content objects to be added after this token. + + + + Adds the specified content immediately before this token. + + A content object that contains simple content or a collection of content objects to be added before this token. + + + + Returns a collection of the ancestor tokens of this token. + + A collection of the ancestor tokens of this token. + + + + Returns a collection of tokens that contain this token, and the ancestors of this token. + + A collection of tokens that contain this token, and the ancestors of this token. + + + + Returns a collection of the sibling tokens after this token, in document order. + + A collection of the sibling tokens after this tokens, in document order. + + + + Returns a collection of the sibling tokens before this token, in document order. + + A collection of the sibling tokens before this token, in document order. + + + + Gets the with the specified key converted to the specified type. + + The type to convert the token to. + The token key. + The converted token value. + + + + Returns a collection of the child tokens of this token, in document order. + + An of containing the child tokens of this , in document order. + + + + Returns a collection of the child tokens of this token, in document order, filtered by the specified type. + + The type to filter the child tokens on. + A containing the child tokens of this , in document order. + + + + Returns a collection of the child values of this token, in document order. + + The type to convert the values to. + A containing the child values of this , in document order. + + + + Removes this token from its parent. + + + + + Replaces this token with the specified token. + + The value. + + + + Writes this token to a . + + A into which this method will write. + A collection of which will be used when writing the token. + + + + Returns the indented JSON for this token. + + + The indented JSON for this token. + + + + + Returns the JSON for this token using the given formatting and converters. + + Indicates how the output is formatted. + A collection of which will be used when writing the token. + The JSON for this token using the given formatting and converters. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to []. + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from [] to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Creates an for this token. + + An that can be used to read this token and its descendants. + + + + Creates a from an object. + + The object that will be used to create . + A with the value of the specified object + + + + Creates a from an object using the specified . + + The object that will be used to create . + The that will be used when reading the object. + A with the value of the specified object + + + + Creates the specified .NET type from the . + + The object type that the token will be deserialized to. + The new object created from the JSON value. + + + + Creates the specified .NET type from the . + + The object type that the token will be deserialized to. + The new object created from the JSON value. + + + + Creates the specified .NET type from the using the specified . + + The object type that the token will be deserialized to. + The that will be used when creating the object. + The new object created from the JSON value. + + + + Creates the specified .NET type from the using the specified . + + The object type that the token will be deserialized to. + The that will be used when creating the object. + The new object created from the JSON value. + + + + Creates a from a . + + An positioned at the token to read into this . + + An that contains the token and its descendant tokens + that were read from the reader. The runtime type of the token is determined + by the token type of the first token encountered in the reader. + + + + + Load a from a string that contains JSON. + + A that contains JSON. + A populated from the string that contains JSON. + + + + Creates a from a . + + An positioned at the token to read into this . + + An that contains the token and its descendant tokens + that were read from the reader. The runtime type of the token is determined + by the token type of the first token encountered in the reader. + + + + + Selects a using a JPath expression. Selects the token that matches the object path. + + + A that contains a JPath expression. + + A , or null. + + + + Selects a using a JPath expression. Selects the token that matches the object path. + + + A that contains a JPath expression. + + A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. + A . + + + + Selects a collection of elements using a JPath expression. + + + A that contains a JPath expression. + + An that contains the selected elements. + + + + Selects a collection of elements using a JPath expression. + + + A that contains a JPath expression. + + A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. + An that contains the selected elements. + + + + Returns the responsible for binding operations performed on this object. + + The expression tree representation of the runtime value. + + The to bind this object. + + + + + Returns the responsible for binding operations performed on this object. + + The expression tree representation of the runtime value. + + The to bind this object. + + + + + Creates a new instance of the . All child tokens are recursively cloned. + + A new instance of the . + + + + Adds an object to the annotation list of this . + + The annotation to add. + + + + Get the first annotation object of the specified type from this . + + The type of the annotation to retrieve. + The first annotation object that matches the specified type, or null if no annotation is of the specified type. + + + + Gets the first annotation object of the specified type from this . + + The of the annotation to retrieve. + The first annotation object that matches the specified type, or null if no annotation is of the specified type. + + + + Gets a collection of annotations of the specified type for this . + + The type of the annotations to retrieve. + An that contains the annotations for this . + + + + Gets a collection of annotations of the specified type for this . + + The of the annotations to retrieve. + An of that contains the annotations that match the specified type for this . + + + + Removes the annotations of the specified type from this . + + The type of annotations to remove. + + + + Removes the annotations of the specified type from this . + + The of annotations to remove. + + + + Gets a comparer that can compare two tokens for value equality. + + A that can compare two nodes for value equality. + + + + Gets or sets the parent. + + The parent. + + + + Gets the root of this . + + The root of this . + + + + Gets the node type for this . + + The type. + + + + Gets a value indicating whether this token has child tokens. + + + true if this token has child values; otherwise, false. + + + + + Gets the next sibling token of this node. + + The that contains the next sibling token. + + + + Gets the previous sibling token of this node. + + The that contains the previous sibling token. + + + + Gets the path of the JSON token. + + + + + Gets the with the specified key. + + The with the specified key. + + + + Get the first child token of this token. + + A containing the first child token of the . + + + + Get the last child token of this token. + + A containing the last child token of the . + + + + Raises the event. + + The instance containing the event data. + + + + Raises the event. + + The instance containing the event data. + + + + Raises the event. + + The instance containing the event data. + + + + Returns a collection of the child tokens of this token, in document order. + + + An of containing the child tokens of this , in document order. + + + + + Returns a collection of the child values of this token, in document order. + + The type to convert the values to. + + A containing the child values of this , in document order. + + + + + Returns a collection of the descendant tokens for this token in document order. + + An containing the descendant tokens of the . + + + + Returns a collection of the tokens that contain this token, and all descendant tokens of this token, in document order. + + An containing this token, and all the descendant tokens of the . + + + + Adds the specified content as children of this . + + The content to be added. + + + + Adds the specified content as the first children of this . + + The content to be added. + + + + Creates an that can be used to add tokens to the . + + An that is ready to have content written to it. + + + + Replaces the children nodes of this token with the specified content. + + The content. + + + + Removes the child nodes from this token. + + + + + Merge the specified content into this . + + The content to be merged. + + + + Merge the specified content into this using . + + The content to be merged. + The used to merge the content. + + + + Occurs when the list changes or an item in the list changes. + + + + + Occurs before an item is added to the collection. + + + + + Occurs when the items list of the collection has changed, or the collection is reset. + + + + + Gets the container's children tokens. + + The container's children tokens. + + + + Gets a value indicating whether this token has child tokens. + + + true if this token has child values; otherwise, false. + + + + + Get the first child token of this token. + + + A containing the first child token of the . + + + + + Get the last child token of this token. + + + A containing the last child token of the . + + + + + Gets the count of child JSON tokens. + + The count of child JSON tokens + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class from another object. + + A object to copy from. + + + + Initializes a new instance of the class with the specified content. + + The contents of the array. + + + + Initializes a new instance of the class with the specified content. + + The contents of the array. + + + + Loads an from a . + + A that will be read for the content of the . + A that contains the JSON that was read from the specified . + + + + Load a from a string that contains JSON. + + A that contains JSON. + A populated from the string that contains JSON. + + + + + + + Creates a from an object. + + The object that will be used to create . + A with the values of the specified object + + + + Creates a from an object. + + The object that will be used to create . + The that will be used to read the object. + A with the values of the specified object + + + + Writes this token to a . + + A into which this method will write. + A collection of which will be used when writing the token. + + + + Determines the index of a specific item in the . + + The object to locate in the . + + The index of if found in the list; otherwise, -1. + + + + + Inserts an item to the at the specified index. + + The zero-based index at which should be inserted. + The object to insert into the . + + is not a valid index in the . + The is read-only. + + + + Removes the item at the specified index. + + The zero-based index of the item to remove. + + is not a valid index in the . + The is read-only. + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + + + + Adds an item to the . + + The object to add to the . + The is read-only. + + + + Removes all items from the . + + The is read-only. + + + + Determines whether the contains a specific value. + + The object to locate in the . + + true if is found in the ; otherwise, false. + + + + + Copies to. + + The array. + Index of the array. + + + + Removes the first occurrence of a specific object from the . + + The object to remove from the . + + true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . + + The is read-only. + + + + Gets the container's children tokens. + + The container's children tokens. + + + + Gets the node type for this . + + The type. + + + + Gets the with the specified key. + + The with the specified key. + + + + Gets or sets the at the specified index. + + + + + + Gets a value indicating whether the is read-only. + + true if the is read-only; otherwise, false. + + + + Represents a JSON constructor. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class from another object. + + A object to copy from. + + + + Initializes a new instance of the class with the specified name and content. + + The constructor name. + The contents of the constructor. + + + + Initializes a new instance of the class with the specified name and content. + + The constructor name. + The contents of the constructor. + + + + Initializes a new instance of the class with the specified name. + + The constructor name. + + + + Writes this token to a . + + A into which this method will write. + A collection of which will be used when writing the token. + + + + Loads an from a . + + A that will be read for the content of the . + A that contains the JSON that was read from the specified . + + + + Gets the container's children tokens. + + The container's children tokens. + + + + Gets or sets the name of this constructor. + + The constructor name. + + + + Gets the node type for this . + + The type. + + + + Gets the with the specified key. + + The with the specified key. + + + + Represents a collection of objects. + + The type of token + + + + An empty collection of objects. + + + + + Initializes a new instance of the struct. + + The enumerable. + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Gets the with the specified key. + + + + + + Represents a JSON object. + + + + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class from another object. + + A object to copy from. + + + + Initializes a new instance of the class with the specified content. + + The contents of the object. + + + + Initializes a new instance of the class with the specified content. + + The contents of the object. + + + + Gets an of this object's properties. + + An of this object's properties. + + + + Gets a the specified name. + + The property name. + A with the specified name or null. + + + + Gets an of this object's property values. + + An of this object's property values. + + + + Loads an from a . + + A that will be read for the content of the . + A that contains the JSON that was read from the specified . + + + + Load a from a string that contains JSON. + + A that contains JSON. + A populated from the string that contains JSON. + + + + + + + Creates a from an object. + + The object that will be used to create . + A with the values of the specified object + + + + Creates a from an object. + + The object that will be used to create . + The that will be used to read the object. + A with the values of the specified object + + + + Writes this token to a . + + A into which this method will write. + A collection of which will be used when writing the token. + + + + Gets the with the specified property name. + + Name of the property. + The with the specified property name. + + + + Gets the with the specified property name. + The exact property name will be searched for first and if no matching property is found then + the will be used to match a property. + + Name of the property. + One of the enumeration values that specifies how the strings will be compared. + The with the specified property name. + + + + Tries to get the with the specified property name. + The exact property name will be searched for first and if no matching property is found then + the will be used to match a property. + + Name of the property. + The value. + One of the enumeration values that specifies how the strings will be compared. + true if a value was successfully retrieved; otherwise, false. + + + + Adds the specified property name. + + Name of the property. + The value. + + + + Removes the property with the specified name. + + Name of the property. + true if item was successfully removed; otherwise, false. + + + + Tries the get value. + + Name of the property. + The value. + true if a value was successfully retrieved; otherwise, false. + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + + + + Raises the event with the provided arguments. + + Name of the property. + + + + Raises the event with the provided arguments. + + Name of the property. + + + + Returns the properties for this instance of a component. + + + A that represents the properties for this component instance. + + + + + Returns the properties for this instance of a component using the attribute array as a filter. + + An array of type that is used as a filter. + + A that represents the filtered properties for this component instance. + + + + + Returns a collection of custom attributes for this instance of a component. + + + An containing the attributes for this object. + + + + + Returns the class name of this instance of a component. + + + The class name of the object, or null if the class does not have a name. + + + + + Returns the name of this instance of a component. + + + The name of the object, or null if the object does not have a name. + + + + + Returns a type converter for this instance of a component. + + + A that is the converter for this object, or null if there is no for this object. + + + + + Returns the default event for this instance of a component. + + + An that represents the default event for this object, or null if this object does not have events. + + + + + Returns the default property for this instance of a component. + + + A that represents the default property for this object, or null if this object does not have properties. + + + + + Returns an editor of the specified type for this instance of a component. + + A that represents the editor for this object. + + An of the specified type that is the editor for this object, or null if the editor cannot be found. + + + + + Returns the events for this instance of a component using the specified attribute array as a filter. + + An array of type that is used as a filter. + + An that represents the filtered events for this component instance. + + + + + Returns the events for this instance of a component. + + + An that represents the events for this component instance. + + + + + Returns an object that contains the property described by the specified property descriptor. + + A that represents the property whose owner is to be found. + + An that represents the owner of the specified property. + + + + + Returns the responsible for binding operations performed on this object. + + The expression tree representation of the runtime value. + + The to bind this object. + + + + + Gets the container's children tokens. + + The container's children tokens. + + + + Occurs when a property value changes. + + + + + Occurs when a property value is changing. + + + + + Gets the node type for this . + + The type. + + + + Gets the with the specified key. + + The with the specified key. + + + + Gets or sets the with the specified property name. + + + + + + Specifies the settings used when merging JSON. + + + + + Gets or sets the method used when merging JSON arrays. + + The method used when merging JSON arrays. + + + + Represents a JSON property. + + + + + Initializes a new instance of the class from another object. + + A object to copy from. + + + + Initializes a new instance of the class. + + The property name. + The property content. + + + + Initializes a new instance of the class. + + The property name. + The property content. + + + + Writes this token to a . + + A into which this method will write. + A collection of which will be used when writing the token. + + + + Loads an from a . + + A that will be read for the content of the . + A that contains the JSON that was read from the specified . + + + + Gets the container's children tokens. + + The container's children tokens. + + + + Gets the property name. + + The property name. + + + + Gets or sets the property value. + + The property value. + + + + Gets the node type for this . + + The type. + + + + Represents a view of a . + + + + + Initializes a new instance of the class. + + The name. + + + + When overridden in a derived class, returns whether resetting an object changes its value. + + + true if resetting the component changes its value; otherwise, false. + + The component to test for reset capability. + + + + + When overridden in a derived class, gets the current value of the property on a component. + + + The value of a property for a given component. + + The component with the property for which to retrieve the value. + + + + + When overridden in a derived class, resets the value for this property of the component to the default value. + + The component with the property value that is to be reset to the default value. + + + + + When overridden in a derived class, sets the value of the component to a different value. + + The component with the property value that is to be set. + The new value. + + + + + When overridden in a derived class, determines a value indicating whether the value of this property needs to be persisted. + + + true if the property should be persisted; otherwise, false. + + The component with the property to be examined for persistence. + + + + + When overridden in a derived class, gets the type of the component this property is bound to. + + + A that represents the type of component this property is bound to. When the or methods are invoked, the object specified might be an instance of this type. + + + + + When overridden in a derived class, gets a value indicating whether this property is read-only. + + + true if the property is read-only; otherwise, false. + + + + + When overridden in a derived class, gets the type of the property. + + + A that represents the type of the property. + + + + + Gets the hash code for the name of the member. + + + + The hash code for the name of the member. + + + + + Represents a raw JSON string. + + + + + Represents a value in JSON (string, integer, date, etc). + + + + + Initializes a new instance of the class from another object. + + A object to copy from. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Creates a comment with the given value. + + The value. + A comment with the given value. + + + + Creates a string with the given value. + + The value. + A string with the given value. + + + + Creates a null value. + + A null value. + + + + Creates a null value. + + A null value. + + + + Writes this token to a . + + A into which this method will write. + A collection of which will be used when writing the token. + + + + Indicates whether the current object is equal to another object of the same type. + + + true if the current object is equal to the parameter; otherwise, false. + + An object to compare with this object. + + + + Determines whether the specified is equal to the current . + + The to compare with the current . + + true if the specified is equal to the current ; otherwise, false. + + + The parameter is null. + + + + + Serves as a hash function for a particular type. + + + A hash code for the current . + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + The format provider. + + A that represents this instance. + + + + + Returns the responsible for binding operations performed on this object. + + The expression tree representation of the runtime value. + + The to bind this object. + + + + + Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. + + An object to compare with this instance. + + A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: + Value + Meaning + Less than zero + This instance is less than . + Zero + This instance is equal to . + Greater than zero + This instance is greater than . + + + is not the same type as this instance. + + + + + Gets a value indicating whether this token has child tokens. + + + true if this token has child values; otherwise, false. + + + + + Gets the node type for this . + + The type. + + + + Gets or sets the underlying token value. + + The underlying token value. + + + + Initializes a new instance of the class from another object. + + A object to copy from. + + + + Initializes a new instance of the class. + + The raw json. + + + + Creates an instance of with the content of the reader's current token. + + The reader. + An instance of with the content of the reader's current token. + + + + Compares tokens to determine whether they are equal. + + + + + Determines whether the specified objects are equal. + + The first object of type to compare. + The second object of type to compare. + + true if the specified objects are equal; otherwise, false. + + + + + Returns a hash code for the specified object. + + The for which a hash code is to be returned. + A hash code for the specified object. + The type of is a reference type and is null. + + + + Represents a reader that provides fast, non-cached, forward-only access to serialized JSON data. + + + + + Initializes a new instance of the class. + + The token to read from. + + + + Reads the next JSON token from the stream as a []. + + + A [] or a null reference if the next JSON token is null. This method will return null at the end of an array. + + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the stream. + + + true if the next token was read successfully; false if there are no more tokens to read. + + + + + Gets the at the reader's current position. + + + + + Gets the path of the current JSON token. + + + + + Specifies the type of token. + + + + + No token type has been set. + + + + + A JSON object. + + + + + A JSON array. + + + + + A JSON constructor. + + + + + A JSON object property. + + + + + A comment. + + + + + An integer value. + + + + + A float value. + + + + + A string value. + + + + + A boolean value. + + + + + A null value. + + + + + An undefined value. + + + + + A date value. + + + + + A raw JSON value. + + + + + A collection of bytes value. + + + + + A Guid value. + + + + + A Uri value. + + + + + A TimeSpan value. + + + + + Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. + + + + + Initializes a new instance of the class writing to the given . + + The container being written to. + + + + Initializes a new instance of the class. + + + + + Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. + + + + + Closes this stream and the underlying stream. + + + + + Writes the beginning of a Json object. + + + + + Writes the beginning of a Json array. + + + + + Writes the start of a constructor with the given name. + + The name of the constructor. + + + + Writes the end. + + The token. + + + + Writes the property name of a name/value pair on a Json object. + + The name of the property. + + + + Writes a value. + An error will raised if the value cannot be written as a single JSON token. + + The value to write. + + + + Writes a null value. + + + + + Writes an undefined value. + + + + + Writes raw JSON. + + The raw JSON to write. + + + + Writes out a comment /*...*/ containing the specified text. + + Text to place inside the comment. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a [] value. + + The [] value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Gets the at the writer's current position. + + + + + Gets the token being writen. + + The token being writen. + + + + Specifies how JSON arrays are merged together. + + + + Concatenate arrays. + + + Union arrays, skipping items that already exist. + + + Replace all array items. + + + Merge array items together, matched by index. + + + + Specifies the member serialization options for the . + + + + + All public members are serialized by default. Members can be excluded using or . + This is the default member serialization mode. + + + + + Only members must be marked with or are serialized. + This member serialization mode can also be set by marking the class with . + + + + + All public and private fields are serialized. Members can be excluded using or . + This member serialization mode can also be set by marking the class with + and setting IgnoreSerializableAttribute on to false. + + + + + Specifies metadata property handling options for the . + + + + + Read metadata properties located at the start of a JSON object. + + + + + Read metadata properties located anywhere in a JSON object. Note that this setting will impact performance. + + + + + Do not try to read metadata properties. + + + + + Specifies missing member handling options for the . + + + + + Ignore a missing member and do not attempt to deserialize it. + + + + + Throw a when a missing member is encountered during deserialization. + + + + + Specifies null value handling options for the . + + + + + + + + + Include null values when serializing and deserializing objects. + + + + + Ignore null values when serializing and deserializing objects. + + + + + Specifies how object creation is handled by the . + + + + + Reuse existing objects, create new objects when needed. + + + + + Only reuse existing objects. + + + + + Always create new objects. + + + + + Specifies reference handling options for the . + Note that references cannot be preserved when a value is set via a non-default constructor such as types that implement ISerializable. + + + + + + + + Do not preserve references when serializing types. + + + + + Preserve references when serializing into a JSON object structure. + + + + + Preserve references when serializing into a JSON array structure. + + + + + Preserve references when serializing. + + + + + Specifies reference loop handling options for the . + + + + + Throw a when a loop is encountered. + + + + + Ignore loop references and do not serialize. + + + + + Serialize loop references. + + + + + Indicating whether a property is required. + + + + + The property is not required. The default state. + + + + + The property must be defined in JSON but can be a null value. + + + + + The property must be defined in JSON and cannot be a null value. + + + + + Contains the JSON schema extension methods. + + + + + Determines whether the is valid. + + The source to test. + The schema to test with. + + true if the specified is valid; otherwise, false. + + + + + Determines whether the is valid. + + The source to test. + The schema to test with. + When this method returns, contains any error messages generated while validating. + + true if the specified is valid; otherwise, false. + + + + + Validates the specified . + + The source to test. + The schema to test with. + + + + Validates the specified . + + The source to test. + The schema to test with. + The validation event handler. + + + + An in-memory representation of a JSON Schema. + + + + + Initializes a new instance of the class. + + + + + Reads a from the specified . + + The containing the JSON Schema to read. + The object representing the JSON Schema. + + + + Reads a from the specified . + + The containing the JSON Schema to read. + The to use when resolving schema references. + The object representing the JSON Schema. + + + + Load a from a string that contains schema JSON. + + A that contains JSON. + A populated from the string that contains JSON. + + + + Parses the specified json. + + The json. + The resolver. + A populated from the string that contains JSON. + + + + Writes this schema to a . + + A into which this method will write. + + + + Writes this schema to a using the specified . + + A into which this method will write. + The resolver used. + + + + Returns a that represents the current . + + + A that represents the current . + + + + + Gets or sets the id. + + + + + Gets or sets the title. + + + + + Gets or sets whether the object is required. + + + + + Gets or sets whether the object is read only. + + + + + Gets or sets whether the object is visible to users. + + + + + Gets or sets whether the object is transient. + + + + + Gets or sets the description of the object. + + + + + Gets or sets the types of values allowed by the object. + + The type. + + + + Gets or sets the pattern. + + The pattern. + + + + Gets or sets the minimum length. + + The minimum length. + + + + Gets or sets the maximum length. + + The maximum length. + + + + Gets or sets a number that the value should be divisble by. + + A number that the value should be divisble by. + + + + Gets or sets the minimum. + + The minimum. + + + + Gets or sets the maximum. + + The maximum. + + + + Gets or sets a flag indicating whether the value can not equal the number defined by the "minimum" attribute. + + A flag indicating whether the value can not equal the number defined by the "minimum" attribute. + + + + Gets or sets a flag indicating whether the value can not equal the number defined by the "maximum" attribute. + + A flag indicating whether the value can not equal the number defined by the "maximum" attribute. + + + + Gets or sets the minimum number of items. + + The minimum number of items. + + + + Gets or sets the maximum number of items. + + The maximum number of items. + + + + Gets or sets the of items. + + The of items. + + + + Gets or sets a value indicating whether items in an array are validated using the instance at their array position from . + + + true if items are validated using their array position; otherwise, false. + + + + + Gets or sets the of additional items. + + The of additional items. + + + + Gets or sets a value indicating whether additional items are allowed. + + + true if additional items are allowed; otherwise, false. + + + + + Gets or sets whether the array items must be unique. + + + + + Gets or sets the of properties. + + The of properties. + + + + Gets or sets the of additional properties. + + The of additional properties. + + + + Gets or sets the pattern properties. + + The pattern properties. + + + + Gets or sets a value indicating whether additional properties are allowed. + + + true if additional properties are allowed; otherwise, false. + + + + + Gets or sets the required property if this property is present. + + The required property if this property is present. + + + + Gets or sets the a collection of valid enum values allowed. + + A collection of valid enum values allowed. + + + + Gets or sets disallowed types. + + The disallow types. + + + + Gets or sets the default value. + + The default value. + + + + Gets or sets the collection of that this schema extends. + + The collection of that this schema extends. + + + + Gets or sets the format. + + The format. + + + + Returns detailed information about the schema exception. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class + with a specified error message. + + The error message that explains the reason for the exception. + + + + Initializes a new instance of the class + with a specified error message and a reference to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. + + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + The parameter is null. + The class name is null or is zero (0). + + + + Gets the line number indicating where the error occurred. + + The line number indicating where the error occurred. + + + + Gets the line position indicating where the error occurred. + + The line position indicating where the error occurred. + + + + Gets the path to the JSON where the error occurred. + + The path to the JSON where the error occurred. + + + + Generates a from a specified . + + + + + Generate a from the specified type. + + The type to generate a from. + A generated from the specified type. + + + + Generate a from the specified type. + + The type to generate a from. + The used to resolve schema references. + A generated from the specified type. + + + + Generate a from the specified type. + + The type to generate a from. + Specify whether the generated root will be nullable. + A generated from the specified type. + + + + Generate a from the specified type. + + The type to generate a from. + The used to resolve schema references. + Specify whether the generated root will be nullable. + A generated from the specified type. + + + + Gets or sets how undefined schemas are handled by the serializer. + + + + + Gets or sets the contract resolver. + + The contract resolver. + + + + Resolves from an id. + + + + + Initializes a new instance of the class. + + + + + Gets a for the specified reference. + + The id. + A for the specified reference. + + + + Gets or sets the loaded schemas. + + The loaded schemas. + + + + The value types allowed by the . + + + + + No type specified. + + + + + String type. + + + + + Float type. + + + + + Integer type. + + + + + Boolean type. + + + + + Object type. + + + + + Array type. + + + + + Null type. + + + + + Any type. + + + + + Specifies undefined schema Id handling options for the . + + + + + Do not infer a schema Id. + + + + + Use the .NET type name as the schema Id. + + + + + Use the assembly qualified .NET type name as the schema Id. + + + + + Returns detailed information related to the . + + + + + Gets the associated with the validation error. + + The JsonSchemaException associated with the validation error. + + + + Gets the path of the JSON location where the validation error occurred. + + The path of the JSON location where the validation error occurred. + + + + Gets the text description corresponding to the validation error. + + The text description. + + + + Represents the callback method that will handle JSON schema validation events and the . + + + + + Resolves member mappings for a type, camel casing property names. + + + + + Used by to resolves a for a given . + + + + + Used by to resolves a for a given . + + + + + + + + + Resolves the contract for a given type. + + The type to resolve a contract for. + The contract for a given type. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + If set to true the will use a cached shared with other resolvers of the same type. + Sharing the cache will significantly improve performance with multiple resolver instances because expensive reflection will only + happen once. This setting can cause unexpected behavior if different instances of the resolver are suppose to produce different + results. When set to false it is highly recommended to reuse instances with the . + + + + + Resolves the contract for a given type. + + The type to resolve a contract for. + The contract for a given type. + + + + Gets the serializable members for the type. + + The type to get serializable members for. + The serializable members for the type. + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Creates the constructor parameters. + + The constructor to create properties for. + The type's member properties. + Properties for the given . + + + + Creates a for the given . + + The matching member property. + The constructor parameter. + A created for the given . + + + + Resolves the default for the contract. + + Type of the object. + The contract's default . + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Determines which contract type is created for the given type. + + Type of the object. + A for the given type. + + + + Creates properties for the given . + + The type to create properties for. + /// The member serialization mode for the type. + Properties for the given . + + + + Creates the used by the serializer to get and set values from a member. + + The member. + The used by the serializer to get and set values from a member. + + + + Creates a for the given . + + The member's parent . + The member to create a for. + A created for the given . + + + + Resolves the name of the property. + + Name of the property. + Name of the property. + + + + Gets the resolved name of the property. + + Name of the property. + Name of the property. + + + + Gets a value indicating whether members are being get and set using dynamic code generation. + This value is determined by the runtime permissions available. + + + true if using dynamic code generation; otherwise, false. + + + + + Gets or sets the default members search flags. + + The default members search flags. + + + + Gets or sets a value indicating whether compiler generated members should be serialized. + + + true if serialized compiler generated members; otherwise, false. + + + + + Gets or sets a value indicating whether to ignore the interface when serializing and deserializing types. + + + true if the interface will be ignored when serializing and deserializing types; otherwise, false. + + + + + Gets or sets a value indicating whether to ignore the attribute when serializing and deserializing types. + + + true if the attribute will be ignored when serializing and deserializing types; otherwise, false. + + + + + Initializes a new instance of the class. + + + + + Resolves the name of the property. + + Name of the property. + The property name camel cased. + + + + Used to resolve references when serializing and deserializing JSON by the . + + + + + Resolves a reference to its object. + + The serialization context. + The reference to resolve. + The object that + + + + Gets the reference for the sepecified object. + + The serialization context. + The object to get a reference for. + The reference to the object. + + + + Determines whether the specified object is referenced. + + The serialization context. + The object to test for a reference. + + true if the specified object is referenced; otherwise, false. + + + + + Adds a reference to the specified object. + + The serialization context. + The reference. + The object to reference. + + + + The default serialization binder used when resolving and loading classes from type names. + + + + + When overridden in a derived class, controls the binding of a serialized object to a type. + + Specifies the name of the serialized object. + Specifies the name of the serialized object. + + The type of the object the formatter creates a new instance of. + + + + + When overridden in a derived class, controls the binding of a serialized object to a type. + + The type of the object the formatter creates a new instance of. + Specifies the name of the serialized object. + Specifies the name of the serialized object. + + + + Represents a trace writer that writes to the application's instances. + + + + + Represents a trace writer. + + + + + Writes the specified trace level, message and optional exception. + + The at which to write this trace. + The trace message. + The trace exception. This parameter is optional. + + + + Gets the that will be used to filter the trace messages passed to the writer. + For example a filter level of Info will exclude Verbose messages and include Info, + Warning and Error messages. + + The that will be used to filter the trace messages passed to the writer. + + + + Writes the specified trace level, message and optional exception. + + The at which to write this trace. + The trace message. + The trace exception. This parameter is optional. + + + + Gets the that will be used to filter the trace messages passed to the writer. + For example a filter level of Info will exclude Verbose messages and include Info, + Warning and Error messages. + + + The that will be used to filter the trace messages passed to the writer. + + + + + Get and set values for a using dynamic methods. + + + + + Provides methods to get and set values. + + + + + Sets the value. + + The target to set the value on. + The value to set on the target. + + + + Gets the value. + + The target to get the value from. + The value. + + + + Initializes a new instance of the class. + + The member info. + + + + Sets the value. + + The target to set the value on. + The value to set on the target. + + + + Gets the value. + + The target to get the value from. + The value. + + + + Provides information surrounding an error. + + + + + Gets the error. + + The error. + + + + Gets the original object that caused the error. + + The original object that caused the error. + + + + Gets the member that caused the error. + + The member that caused the error. + + + + Gets the path of the JSON location where the error occurred. + + The path of the JSON location where the error occurred. + + + + Gets or sets a value indicating whether this is handled. + + true if handled; otherwise, false. + + + + Provides data for the Error event. + + + + + Initializes a new instance of the class. + + The current object. + The error context. + + + + Gets the current object the error event is being raised against. + + The current object the error event is being raised against. + + + + Gets the error context. + + The error context. + + + + Get and set values for a using dynamic methods. + + + + + Initializes a new instance of the class. + + The member info. + + + + Sets the value. + + The target to set the value on. + The value to set on the target. + + + + Gets the value. + + The target to get the value from. + The value. + + + + Provides methods to get attributes. + + + + + Returns a collection of all of the attributes, or an empty collection if there are no attributes. + + When true, look up the hierarchy chain for the inherited custom attribute. + A collection of s, or an empty collection. + + + + Returns a collection of attributes, identified by type, or an empty collection if there are no attributes. + + The type of the attributes. + When true, look up the hierarchy chain for the inherited custom attribute. + A collection of s, or an empty collection. + + + + Contract details for a used by the . + + + + + Contract details for a used by the . + + + + + Contract details for a used by the . + + + + + Gets the underlying type for the contract. + + The underlying type for the contract. + + + + Gets or sets the type created during deserialization. + + The type created during deserialization. + + + + Gets or sets whether this type contract is serialized as a reference. + + Whether this type contract is serialized as a reference. + + + + Gets or sets the default for this contract. + + The converter. + + + + Gets or sets all methods called immediately after deserialization of the object. + + The methods called immediately after deserialization of the object. + + + + Gets or sets all methods called during deserialization of the object. + + The methods called during deserialization of the object. + + + + Gets or sets all methods called after serialization of the object graph. + + The methods called after serialization of the object graph. + + + + Gets or sets all methods called before serialization of the object. + + The methods called before serialization of the object. + + + + Gets or sets all method called when an error is thrown during the serialization of the object. + + The methods called when an error is thrown during the serialization of the object. + + + + Gets or sets the method called immediately after deserialization of the object. + + The method called immediately after deserialization of the object. + + + + Gets or sets the method called during deserialization of the object. + + The method called during deserialization of the object. + + + + Gets or sets the method called after serialization of the object graph. + + The method called after serialization of the object graph. + + + + Gets or sets the method called before serialization of the object. + + The method called before serialization of the object. + + + + Gets or sets the method called when an error is thrown during the serialization of the object. + + The method called when an error is thrown during the serialization of the object. + + + + Gets or sets the default creator method used to create the object. + + The default creator method used to create the object. + + + + Gets or sets a value indicating whether the default creator is non public. + + true if the default object creator is non-public; otherwise, false. + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Gets or sets the default collection items . + + The converter. + + + + Gets or sets a value indicating whether the collection items preserve object references. + + true if collection items preserve object references; otherwise, false. + + + + Gets or sets the collection item reference loop handling. + + The reference loop handling. + + + + Gets or sets the collection item type name handling. + + The type name handling. + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Gets the of the collection items. + + The of the collection items. + + + + Gets a value indicating whether the collection type is a multidimensional array. + + true if the collection type is a multidimensional array; otherwise, false. + + + + Handles serialization callback events. + + The object that raised the callback event. + The streaming context. + + + + Handles serialization error callback events. + + The object that raised the callback event. + The streaming context. + The error context. + + + + Sets extension data for an object during deserialization. + + The object to set extension data on. + The extension data key. + The extension data value. + + + + Gets extension data for an object during serialization. + + The object to set extension data on. + + + + Contract details for a used by the . + + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Gets or sets the property name resolver. + + The property name resolver. + + + + Gets the of the dictionary keys. + + The of the dictionary keys. + + + + Gets the of the dictionary values. + + The of the dictionary values. + + + + Contract details for a used by the . + + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Gets the object's properties. + + The object's properties. + + + + Gets or sets the property name resolver. + + The property name resolver. + + + + Contract details for a used by the . + + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Gets or sets the ISerializable object constructor. + + The ISerializable object constructor. + + + + Contract details for a used by the . + + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Contract details for a used by the . + + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Gets or sets the object member serialization. + + The member object serialization. + + + + Gets or sets a value that indicates whether the object's properties are required. + + + A value indicating whether the object's properties are required. + + + + + Gets the object's properties. + + The object's properties. + + + + Gets the constructor parameters required for any non-default constructor + + + + + Gets a collection of instances that define the parameters used with . + + + + + Gets or sets the override constructor used to create the object. + This is set when a constructor is marked up using the + JsonConstructor attribute. + + The override constructor. + + + + Gets or sets the parametrized constructor used to create the object. + + The parametrized constructor. + + + + Gets or sets the function used to create the object. When set this function will override . + This function is called with a collection of arguments which are defined by the collection. + + The function used to create the object. + + + + Gets or sets the extension data setter. + + + + + Gets or sets the extension data getter. + + + + + Contract details for a used by the . + + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Maps a JSON property to a .NET member or constructor parameter. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Gets or sets the name of the property. + + The name of the property. + + + + Gets or sets the type that declared this property. + + The type that declared this property. + + + + Gets or sets the order of serialization and deserialization of a member. + + The numeric order of serialization or deserialization. + + + + Gets or sets the name of the underlying member or parameter. + + The name of the underlying member or parameter. + + + + Gets the that will get and set the during serialization. + + The that will get and set the during serialization. + + + + Gets or sets the for this property. + + The for this property. + + + + Gets or sets the type of the property. + + The type of the property. + + + + Gets or sets the for the property. + If set this converter takes presidence over the contract converter for the property type. + + The converter. + + + + Gets or sets the member converter. + + The member converter. + + + + Gets or sets a value indicating whether this is ignored. + + true if ignored; otherwise, false. + + + + Gets or sets a value indicating whether this is readable. + + true if readable; otherwise, false. + + + + Gets or sets a value indicating whether this is writable. + + true if writable; otherwise, false. + + + + Gets or sets a value indicating whether this has a member attribute. + + true if has a member attribute; otherwise, false. + + + + Gets the default value. + + The default value. + + + + Gets or sets a value indicating whether this is required. + + A value indicating whether this is required. + + + + Gets or sets a value indicating whether this property preserves object references. + + + true if this instance is reference; otherwise, false. + + + + + Gets or sets the property null value handling. + + The null value handling. + + + + Gets or sets the property default value handling. + + The default value handling. + + + + Gets or sets the property reference loop handling. + + The reference loop handling. + + + + Gets or sets the property object creation handling. + + The object creation handling. + + + + Gets or sets or sets the type name handling. + + The type name handling. + + + + Gets or sets a predicate used to determine whether the property should be serialize. + + A predicate used to determine whether the property should be serialize. + + + + Gets or sets a predicate used to determine whether the property should be serialized. + + A predicate used to determine whether the property should be serialized. + + + + Gets or sets an action used to set whether the property has been deserialized. + + An action used to set whether the property has been deserialized. + + + + Gets or sets the converter used when serializing the property's collection items. + + The collection's items converter. + + + + Gets or sets whether this property's collection items are serialized as a reference. + + Whether this property's collection items are serialized as a reference. + + + + Gets or sets the the type name handling used when serializing the property's collection items. + + The collection's items type name handling. + + + + Gets or sets the the reference loop handling used when serializing the property's collection items. + + The collection's items reference loop handling. + + + + A collection of objects. + + + + + Initializes a new instance of the class. + + The type. + + + + When implemented in a derived class, extracts the key from the specified element. + + The element from which to extract the key. + The key for the specified element. + + + + Adds a object. + + The property to add to the collection. + + + + Gets the closest matching object. + First attempts to get an exact case match of propertyName and then + a case insensitive match. + + Name of the property. + A matching property if found. + + + + Gets a property by property name. + + The name of the property to get. + Type property name string comparison. + A matching property if found. + + + + Contract details for a used by the . + + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Lookup and create an instance of the JsonConverter type described by the argument. + + The JsonConverter type to create. + Optional arguments to pass to an initializing constructor of the JsonConverter. + If null, the default constructor is used. + + + + Create a factory function that can be used to create instances of a JsonConverter described by the + argument type. The returned function can then be used to either invoke the converter's default ctor, or any + parameterized constructors by way of an object array. + + + + + Represents a trace writer that writes to memory. When the trace message limit is + reached then old trace messages will be removed as new messages are added. + + + + + Initializes a new instance of the class. + + + + + Writes the specified trace level, message and optional exception. + + The at which to write this trace. + The trace message. + The trace exception. This parameter is optional. + + + + Returns an enumeration of the most recent trace messages. + + An enumeration of the most recent trace messages. + + + + Returns a of the most recent trace messages. + + + A of the most recent trace messages. + + + + + Gets the that will be used to filter the trace messages passed to the writer. + For example a filter level of Info will exclude Verbose messages and include Info, + Warning and Error messages. + + + The that will be used to filter the trace messages passed to the writer. + + + + + Represents a method that constructs an object. + + The object type to create. + + + + When applied to a method, specifies that the method is called when an error occurs serializing an object. + + + + + Provides methods to get attributes from a , , or . + + + + + Initializes a new instance of the class. + + + + + Returns a collection of all of the attributes, or an empty collection if there are no attributes. + + When true, look up the hierarchy chain for the inherited custom attribute. + A collection of s, or an empty collection. + + + + Returns a collection of attributes, identified by type, or an empty collection if there are no attributes. + + The type of the attributes. + When true, look up the hierarchy chain for the inherited custom attribute. + A collection of s, or an empty collection. + + + + Get and set values for a using reflection. + + + + + Initializes a new instance of the class. + + The member info. + + + + Sets the value. + + The target to set the value on. + The value to set on the target. + + + + Gets the value. + + The target to get the value from. + The value. + + + + Specifies how strings are escaped when writing JSON text. + + + + + Only control characters (e.g. newline) are escaped. + + + + + All non-ASCII and control characters (e.g. newline) are escaped. + + + + + HTML (<, >, &, ', ") and control characters (e.g. newline) are escaped. + + + + + Specifies type name handling options for the . + + + + + Do not include the .NET type name when serializing types. + + + + + Include the .NET type name when serializing into a JSON object structure. + + + + + Include the .NET type name when serializing into a JSON array structure. + + + + + Always include the .NET type name when serializing. + + + + + Include the .NET type name when the type of the object being serialized is not the same as its declared type. + + + + + Determines whether the collection is null or empty. + + The collection. + + true if the collection is null or empty; otherwise, false. + + + + + Adds the elements of the specified collection to the specified generic IList. + + The list to add to. + The collection of elements to add. + + + + Returns the index of the first occurrence in a sequence by using a specified IEqualityComparer. + + The type of the elements of source. + A sequence in which to locate a value. + The object to locate in the sequence + An equality comparer to compare values. + The zero-based index of the first occurrence of value within the entire sequence, if found; otherwise, –1. + + + + Converts the value to the specified type. If the value is unable to be converted, the + value is checked whether it assignable to the specified type. + + The value to convert. + The culture to use when converting. + The type to convert or cast the value to. + + The converted type. If conversion was unsuccessful, the initial value + is returned if assignable to the target type. + + + + + Helper method for generating a MetaObject which calls a + specific method on Dynamic that returns a result + + + + + Helper method for generating a MetaObject which calls a + specific method on Dynamic, but uses one of the arguments for + the result. + + + + + Helper method for generating a MetaObject which calls a + specific method on Dynamic, but uses one of the arguments for + the result. + + + + + Returns a Restrictions object which includes our current restrictions merged + with a restriction limiting our type + + + + + Gets a dictionary of the names and values of an Enum type. + + + + + + Gets a dictionary of the names and values of an Enum type. + + The enum type to get names and values for. + + + + + Gets the type of the typed collection's items. + + The type. + The type of the typed collection's items. + + + + Gets the member's underlying type. + + The member. + The underlying type of the member. + + + + Determines whether the member is an indexed property. + + The member. + + true if the member is an indexed property; otherwise, false. + + + + + Determines whether the property is an indexed property. + + The property. + + true if the property is an indexed property; otherwise, false. + + + + + Gets the member's value on the object. + + The member. + The target object. + The member's value on the object. + + + + Sets the member's value on the target object. + + The member. + The target. + The value. + + + + Determines whether the specified MemberInfo can be read. + + The MemberInfo to determine whether can be read. + /// if set to true then allow the member to be gotten non-publicly. + + true if the specified MemberInfo can be read; otherwise, false. + + + + + Determines whether the specified MemberInfo can be set. + + The MemberInfo to determine whether can be set. + if set to true then allow the member to be set non-publicly. + if set to true then allow the member to be set if read-only. + + true if the specified MemberInfo can be set; otherwise, false. + + + + + Builds a string. Unlike StringBuilder this class lets you reuse it's internal buffer. + + + + + Determines whether the string is all white space. Empty string will return false. + + The string to test whether it is all white space. + + true if the string is all white space; otherwise, false. + + + + + Nulls an empty string. + + The string. + Null if the string was null, otherwise the string unchanged. + + + + Specifies the state of the . + + + + + An exception has been thrown, which has left the in an invalid state. + You may call the method to put the in the Closed state. + Any other method calls results in an being thrown. + + + + + The method has been called. + + + + + An object is being written. + + + + + A array is being written. + + + + + A constructor is being written. + + + + + A property is being written. + + + + + A write method has not been called. + + + + diff --git a/lib/newtonsoft.json/license.txt b/lib/newtonsoft.json/license.txt index 8842027bc80..0c2edce8ba8 100644 --- a/lib/newtonsoft.json/license.txt +++ b/lib/newtonsoft.json/license.txt @@ -1,18 +1,18 @@ -Copyright (c) 2007 James Newton-King - -Permission is hereby granted, free of charge, to any person obtaining a copy of this -software and associated documentation files (the "Software"), to deal in the Software -without restriction, including without limitation the rights to use, copy, modify, -merge, publish, distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be included in all copies -or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE +Copyright (c) 2007 James Newton-King + +Permission is hereby granted, free of charge, to any person obtaining a copy of this +software and associated documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be included in all copies +or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/lib/nhibernate.linq/DetachedCriteriaAdapter.cs b/lib/nhibernate.linq/DetachedCriteriaAdapter.cs index b42e1d0be21..5762ba1d5a9 100644 --- a/lib/nhibernate.linq/DetachedCriteriaAdapter.cs +++ b/lib/nhibernate.linq/DetachedCriteriaAdapter.cs @@ -1,281 +1,281 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using NHibernate.Criterion; -using NHibernate.SqlCommand; -using NHibernate.Transform; - -namespace NHibernate.Linq.Util -{ - public static class DetachedCriteriaExtensions - { - public static ICriteria Adapt(this DetachedCriteria criteria, ISession session) - { - if (criteria == null) return null; - return new DetachedCriteriaAdapter(criteria, session); - } - } - - public class DetachedCriteriaAdapter : ICriteria - { - private readonly DetachedCriteria detachedCriteria; - private readonly ISession session; - - public DetachedCriteriaAdapter(DetachedCriteria detachedCriteria, ISession session) - { - this.detachedCriteria = detachedCriteria; - this.session = session; - } - - public DetachedCriteria DetachedCriteria - { - get { return detachedCriteria; } - } - - public ISession Session - { - get { return session; } - } - - #region ICriteria Members - - public IProjection Projection - { - get - { - return null; - } - } - public ICriteria Add(ICriterion expression) - { - return detachedCriteria.Add(expression).Adapt(session); - } - - public ICriteria AddOrder(Order order) - { - return detachedCriteria.AddOrder(order).Adapt(session); - } - - public string Alias - { - get { return detachedCriteria.Alias; } - } - - public void ClearOrderds() - { - throw new NotSupportedException(); - } - - public ICriteria CreateAlias(string associationPath, string alias, JoinType joinType) - { - return detachedCriteria.CreateAlias(associationPath, alias, joinType).Adapt(session); - } - - public ICriteria CreateAlias(string associationPath, string alias) - { - return detachedCriteria.CreateAlias(associationPath, alias).Adapt(session); - } - - public ICriteria CreateAlias(string associationPath, string alias, JoinType joinType, ICriterion withClause) - { - throw new NotImplementedException(); - } - - public ICriteria CreateCriteria(string associationPath, string alias, JoinType joinType) - { - return detachedCriteria.CreateCriteria(associationPath, alias, joinType).Adapt(session); - } - - public ICriteria CreateCriteria(string associationPath, string alias) - { - return detachedCriteria.CreateCriteria(associationPath, alias).Adapt(session); - } - - public ICriteria CreateCriteria(string associationPath, JoinType joinType) - { - return detachedCriteria.CreateCriteria(associationPath, joinType).Adapt(session); - } - - public ICriteria CreateCriteria(string associationPath, string alias, JoinType joinType, ICriterion withClause) - { - throw new NotImplementedException(); - } - - public ICriteria CreateCriteria(string associationPath) - { - return detachedCriteria.CreateCriteria(associationPath).Adapt(session); - } - - public ICriteria GetCriteriaByAlias(string alias) - { - return detachedCriteria.GetCriteriaByAlias(alias).Adapt(session); - } - - public ICriteria GetCriteriaByPath(string path) - { - return detachedCriteria.GetCriteriaByPath(path).Adapt(session); - } - - public IList List() - { - throw new NotSupportedException(); - } - - public void List(IList results) - { - throw new NotSupportedException(); - } - - public IList List() - { - throw new NotSupportedException(); - } - - public ICriteria SetCacheMode(CacheMode cacheMode) - { - return detachedCriteria.SetCacheMode(cacheMode).Adapt(session); - } - - public ICriteria SetCacheRegion(string cacheRegion) - { - throw new NotSupportedException(); - } - - public ICriteria SetCacheable(bool cacheable) - { - throw new NotSupportedException(); - } - - public ICriteria SetComment(string comment) - { - throw new NotSupportedException(); - } - - public ICriteria SetFetchMode(string associationPath, FetchMode mode) - { - return detachedCriteria.SetFetchMode(associationPath, mode).Adapt(session); - } - - public ICriteria SetFetchSize(int fetchSize) - { - throw new NotSupportedException(); - } - - public ICriteria SetFirstResult(int firstResult) - { - return detachedCriteria.SetFirstResult(firstResult).Adapt(session); - } - - public ICriteria SetFlushMode(FlushMode flushMode) - { - throw new NotSupportedException(); - } - - public ICriteria SetLockMode(string alias, LockMode lockMode) - { - throw new NotSupportedException(); - } - - public ICriteria SetLockMode(LockMode lockMode) - { - throw new NotSupportedException(); - } - - public ICriteria SetMaxResults(int maxResults) - { - return detachedCriteria.SetMaxResults(maxResults).Adapt(session); - } - - public ICriteria SetProjection(IProjection projection) - { - return detachedCriteria.SetProjection(projection).Adapt(session); - } - - public ICriteria SetProjection(params IProjection[] projections) - { - var projectionList = Projections.ProjectionList(); - foreach (var proj in projections) - projectionList.Add(proj); - - return detachedCriteria.SetProjection(projectionList).Adapt(session); - } - - public ICriteria SetResultTransformer(IResultTransformer resultTransformer) - { - return detachedCriteria.SetResultTransformer(resultTransformer).Adapt(session); - } - - public ICriteria SetTimeout(int timeout) - { - throw new NotSupportedException(); - } - - public T UniqueResult() - { - throw new NotSupportedException(); - } - - public object UniqueResult() - { - throw new NotSupportedException(); - } - - public System.Type GetRootEntityTypeIfAvailable() - { - return detachedCriteria.GetRootEntityTypeIfAvailable(); - } - - public void ClearOrders() - { - detachedCriteria.ClearOrders(); - } - - public IEnumerable Future() - { - throw new NotSupportedException(); - } - - public IFutureValue FutureValue() - { - throw new NotSupportedException(); - } - - #endregion - - #region ICloneable Members - - public object Clone() - { - throw new NotSupportedException(); - } - - #endregion - - - private bool _readOnly; - private bool _readOnlyInitialized; - - public bool IsReadOnly - { - get - { - return _readOnly; - } - } - - public bool IsReadOnlyInitialized - { - get - { - return _readOnlyInitialized; - } - } - - public ICriteria SetReadOnly(bool readOnly) - { - _readOnly = readOnly; - _readOnlyInitialized = true; - return this; - } - } +using System; +using System.Collections; +using System.Collections.Generic; +using NHibernate.Criterion; +using NHibernate.SqlCommand; +using NHibernate.Transform; + +namespace NHibernate.Linq.Util +{ + public static class DetachedCriteriaExtensions + { + public static ICriteria Adapt(this DetachedCriteria criteria, ISession session) + { + if (criteria == null) return null; + return new DetachedCriteriaAdapter(criteria, session); + } + } + + public class DetachedCriteriaAdapter : ICriteria + { + private readonly DetachedCriteria detachedCriteria; + private readonly ISession session; + + public DetachedCriteriaAdapter(DetachedCriteria detachedCriteria, ISession session) + { + this.detachedCriteria = detachedCriteria; + this.session = session; + } + + public DetachedCriteria DetachedCriteria + { + get { return detachedCriteria; } + } + + public ISession Session + { + get { return session; } + } + + #region ICriteria Members + + public IProjection Projection + { + get + { + return null; + } + } + public ICriteria Add(ICriterion expression) + { + return detachedCriteria.Add(expression).Adapt(session); + } + + public ICriteria AddOrder(Order order) + { + return detachedCriteria.AddOrder(order).Adapt(session); + } + + public string Alias + { + get { return detachedCriteria.Alias; } + } + + public void ClearOrderds() + { + throw new NotSupportedException(); + } + + public ICriteria CreateAlias(string associationPath, string alias, JoinType joinType) + { + return detachedCriteria.CreateAlias(associationPath, alias, joinType).Adapt(session); + } + + public ICriteria CreateAlias(string associationPath, string alias) + { + return detachedCriteria.CreateAlias(associationPath, alias).Adapt(session); + } + + public ICriteria CreateAlias(string associationPath, string alias, JoinType joinType, ICriterion withClause) + { + throw new NotImplementedException(); + } + + public ICriteria CreateCriteria(string associationPath, string alias, JoinType joinType) + { + return detachedCriteria.CreateCriteria(associationPath, alias, joinType).Adapt(session); + } + + public ICriteria CreateCriteria(string associationPath, string alias) + { + return detachedCriteria.CreateCriteria(associationPath, alias).Adapt(session); + } + + public ICriteria CreateCriteria(string associationPath, JoinType joinType) + { + return detachedCriteria.CreateCriteria(associationPath, joinType).Adapt(session); + } + + public ICriteria CreateCriteria(string associationPath, string alias, JoinType joinType, ICriterion withClause) + { + throw new NotImplementedException(); + } + + public ICriteria CreateCriteria(string associationPath) + { + return detachedCriteria.CreateCriteria(associationPath).Adapt(session); + } + + public ICriteria GetCriteriaByAlias(string alias) + { + return detachedCriteria.GetCriteriaByAlias(alias).Adapt(session); + } + + public ICriteria GetCriteriaByPath(string path) + { + return detachedCriteria.GetCriteriaByPath(path).Adapt(session); + } + + public IList List() + { + throw new NotSupportedException(); + } + + public void List(IList results) + { + throw new NotSupportedException(); + } + + public IList List() + { + throw new NotSupportedException(); + } + + public ICriteria SetCacheMode(CacheMode cacheMode) + { + return detachedCriteria.SetCacheMode(cacheMode).Adapt(session); + } + + public ICriteria SetCacheRegion(string cacheRegion) + { + throw new NotSupportedException(); + } + + public ICriteria SetCacheable(bool cacheable) + { + throw new NotSupportedException(); + } + + public ICriteria SetComment(string comment) + { + throw new NotSupportedException(); + } + + public ICriteria SetFetchMode(string associationPath, FetchMode mode) + { + return detachedCriteria.SetFetchMode(associationPath, mode).Adapt(session); + } + + public ICriteria SetFetchSize(int fetchSize) + { + throw new NotSupportedException(); + } + + public ICriteria SetFirstResult(int firstResult) + { + return detachedCriteria.SetFirstResult(firstResult).Adapt(session); + } + + public ICriteria SetFlushMode(FlushMode flushMode) + { + throw new NotSupportedException(); + } + + public ICriteria SetLockMode(string alias, LockMode lockMode) + { + throw new NotSupportedException(); + } + + public ICriteria SetLockMode(LockMode lockMode) + { + throw new NotSupportedException(); + } + + public ICriteria SetMaxResults(int maxResults) + { + return detachedCriteria.SetMaxResults(maxResults).Adapt(session); + } + + public ICriteria SetProjection(IProjection projection) + { + return detachedCriteria.SetProjection(projection).Adapt(session); + } + + public ICriteria SetProjection(params IProjection[] projections) + { + var projectionList = Projections.ProjectionList(); + foreach (var proj in projections) + projectionList.Add(proj); + + return detachedCriteria.SetProjection(projectionList).Adapt(session); + } + + public ICriteria SetResultTransformer(IResultTransformer resultTransformer) + { + return detachedCriteria.SetResultTransformer(resultTransformer).Adapt(session); + } + + public ICriteria SetTimeout(int timeout) + { + throw new NotSupportedException(); + } + + public T UniqueResult() + { + throw new NotSupportedException(); + } + + public object UniqueResult() + { + throw new NotSupportedException(); + } + + public System.Type GetRootEntityTypeIfAvailable() + { + return detachedCriteria.GetRootEntityTypeIfAvailable(); + } + + public void ClearOrders() + { + detachedCriteria.ClearOrders(); + } + + public IEnumerable Future() + { + throw new NotSupportedException(); + } + + public IFutureValue FutureValue() + { + throw new NotSupportedException(); + } + + #endregion + + #region ICloneable Members + + public object Clone() + { + throw new NotSupportedException(); + } + + #endregion + + + private bool _readOnly; + private bool _readOnlyInitialized; + + public bool IsReadOnly + { + get + { + return _readOnly; + } + } + + public bool IsReadOnlyInitialized + { + get + { + return _readOnlyInitialized; + } + } + + public ICriteria SetReadOnly(bool readOnly) + { + _readOnly = readOnly; + _readOnlyInitialized = true; + return this; + } + } } \ No newline at end of file diff --git a/lib/nhibernate.linq/orchard-customizations.txt b/lib/nhibernate.linq/orchard-customizations.txt index c521eed1abc..ddb2b34c77d 100644 --- a/lib/nhibernate.linq/orchard-customizations.txt +++ b/lib/nhibernate.linq/orchard-customizations.txt @@ -1,4 +1,4 @@ -This library has been modified to be compatible with NH 3.3. -The file DetachedCriteriaAdapter.cs in this folder is used instead of the original onw from soure code. - -Source code can be found at http://sourceforge.net/projects/nhcontrib/files/NHibernate.Linq/1.0/NHibernate.Linq-1.0.0.GA-src.zip +This library has been modified to be compatible with NH 3.3. +The file DetachedCriteriaAdapter.cs in this folder is used instead of the original onw from soure code. + +Source code can be found at http://sourceforge.net/projects/nhcontrib/files/NHibernate.Linq/1.0/NHibernate.Linq-1.0.0.GA-src.zip diff --git a/lib/nhibernate/Iesi.Collections.xml b/lib/nhibernate/Iesi.Collections.xml index dbe93d5f994..d189350cd7c 100644 --- a/lib/nhibernate/Iesi.Collections.xml +++ b/lib/nhibernate/Iesi.Collections.xml @@ -1,541 +1,541 @@ - - - - Iesi.Collections - - - - - Implementation of ISet that also maintains a linked list over all elements. - Enumeration of this set is guaranteed to return the elements in the order - they were added. - - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - 1 - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - 2 - - - - Adds an item to the . - - The object to add to the .The is read-only. - - - - Removes all items from the . - - The is read-only. - - - - Determines whether the contains a specific value. - - - true if is found in the ; otherwise, false. - - The object to locate in the . - - - - Copies the elements of the to an , starting at a particular index. - - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing.The zero-based index in at which copying begins. is null. is less than 0. is multidimensional.-or-The number of elements in the source is greater than the available space from to the end of the destination .-or-Type cannot be cast automatically to the type of the destination . - - - - Removes the first occurrence of a specific object from the . - - - true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . - - The object to remove from the .The is read-only. - - - - Modifies the current set so that it contains all elements that are present in either the current set or the specified collection. - - The collection to compare to the current set. is null. - - - - Modifies the current set so that it contains only elements that are also in a specified collection. - - The collection to compare to the current set. is null. - - - - Removes all elements in the specified collection from the current set. - - The collection of items to remove from the set. is null. - - - - Modifies the current set so that it contains only elements that are present either in the current set or in the specified collection, but not both. - - The collection to compare to the current set. is null. - - - - Determines whether a set is a subset of a specified collection. - - - true if the current set is a subset of ; otherwise, false. - - The collection to compare to the current set. is null. - - - - Determines whether the current set is a superset of a specified collection. - - - true if the current set is a superset of ; otherwise, false. - - The collection to compare to the current set. is null. - - - - Determines whether the current set is a correct superset of a specified collection. - - - true if the object is a correct superset of ; otherwise, false. - - The collection to compare to the current set. is null. - - - - Determines whether the current set is a proper (strict) subset of a specified collection. - - - true if the current set is a correct subset of ; otherwise, false. - - The collection to compare to the current set. is null. - - - - Determines whether the current set overlaps with the specified collection. - - - true if the current set and share at least one common element; otherwise, false. - - The collection to compare to the current set. is null. - - - - Determines whether the current set and the specified collection contain the same elements. - - - true if the current set is equal to ; otherwise, false. - - The collection to compare to the current set. is null. - - - - Adds an element to the current set and returns a value to indicate if the element was successfully added. - - - true if the element is added to the set; false if the element is already in the set. - - The element to add to the set. - - - - Count the elements in the given collection and determine both the total - count and how many of the elements that are present in the current set. - - - - - Cast the given collection to an ISet<T> if possible. If not, - return a new set containing the items. - - - - - Unlink a node from the linked list by updating the node pointers in - its preceeding and subsequent node. Also update the _first and _last - pointers if necessary. - - - - - Gets the number of elements contained in the . - - - The number of elements contained in the . - - - - - Gets a value indicating whether the is read-only. - - - true if the is read-only; otherwise, false. - - - - -

      Implements a read-only Set wrapper.

      -

      Although this is advertised as immutable, it really isn't. Anyone with access to the - wrapped set can still change the set.

      -
      -
      - - - Constructs an immutable (read-only) Set wrapper. - - The Set that is wrapped. - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - 2 - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - 1 - - - - Adds an item to the . - - The object to add to the . - is always thrown - - - - Removes all items from the . - - is always thrown - - - - Determines whether the contains a specific value. - - - true if is found in the ; otherwise, false. - - The object to locate in the . - - - - Copies the elements of the to an , starting at a particular index. - - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing.The zero-based index in at which copying begins. is null. is less than 0. is multidimensional.-or-The number of elements in the source is greater than the available space from to the end of the destination .-or-Type cannot be cast automatically to the type of the destination . - - - - Removes the first occurrence of a specific object from the . - - - true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . - - The object to remove from the . - is always thrown - - - - Adds an element to the current set and returns a value to indicate if the element was successfully added. - - - true if the element is added to the set; false if the element is already in the set. - - The element to add to the set. - is always thrown - - - - Modifies the current set so that it contains all elements that are present in both the current set and in the specified collection. - - The collection to compare to the current set. is null. - is always thrown - - - - Modifies the current set so that it contains only elements that are also in a specified collection. - - The collection to compare to the current set. is null. - is always thrown - - - - Removes all elements in the specified collection from the current set. - - The collection of items to remove from the set. is null. - is always thrown - - - - Modifies the current set so that it contains only elements that are present either in the current set or in the specified collection, but not both. - - The collection to compare to the current set. is null. - is always thrown - - - - Determines whether a set is a subset of a specified collection. - - - true if the current set is a subset of ; otherwise, false. - - The collection to compare to the current set. is null. - - - - Determines whether the current set is a superset of a specified collection. - - - true if the current set is a superset of ; otherwise, false. - - The collection to compare to the current set. is null. - - - - Determines whether the current set is a correct superset of a specified collection. - - - true if the object is a correct superset of ; otherwise, false. - - The collection to compare to the current set. is null. - - - - Determines whether the current set is a property (strict) subset of a specified collection. - - - true if the current set is a correct subset of ; otherwise, false. - - The collection to compare to the current set. is null. - - - - Determines whether the current set overlaps with the specified collection. - - - true if the current set and share at least one common element; otherwise, false. - - The collection to compare to the current set. is null. - - - - Determines whether the current set and the specified collection contain the same elements. - - - true if the current set is equal to ; otherwise, false. - - The collection to compare to the current set. is null. - - - - Gets the number of elements contained in the . - - - The number of elements contained in the . - - - - - Gets a value indicating whether the is read-only. - - - True. - - - - -

      Implements a thread-safe Set wrapper. The implementation is extremely conservative, - serializing critical sections to prevent possible deadlocks, and locking on everything. - The one exception is for enumeration, which is inherently not thread-safe. For this, you - have to lock the SyncRoot object for the duration of the enumeration.

      -
      -
      - - - Constructs a thread-safe ISet wrapper. - - The Set object that this object will wrap. - - - - Adds an item to the . - - The object to add to the .The is read-only. - - - - Removes all items from the . - - The is read-only. - - - - Determines whether the contains a specific value. - - - true if is found in the ; otherwise, false. - - The object to locate in the . - - - - Copies the elements of the to an , starting at a particular index. - - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing.The zero-based index in at which copying begins. is null. is less than 0. is multidimensional.-or-The number of elements in the source is greater than the available space from to the end of the destination .-or-Type cannot be cast automatically to the type of the destination . - - - - Removes the first occurrence of a specific object from the . - - - true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . - - The object to remove from the .The is read-only. - - - - Modifies the current set so that it contains all elements that are present in either the current set or in the specified collection. - - The collection to compare to the current set. is null. - - - - Modifies the current set so that it contains only elements that are also in a specified collection. - - The collection to compare to the current set. is null. - - - - Removes all elements in the specified collection from the current set. - - The collection of items to remove from the set. is null. - - - - Modifies the current set so that it contains only elements that are present either in the current set or in the specified collection, but not both. - - The collection to compare to the current set. is null. - - - - Determines whether a set is a subset of a specified collection. - - - true if the current set is a subset of ; otherwise, false. - - The collection to compare to the current set. is null. - - - - Determines whether the current set is a superset of a specified collection. - - - true if the current set is a superset of ; otherwise, false. - - The collection to compare to the current set. is null. - - - - Determines whether the current set is a correct superset of a specified collection. - - - true if the object is a correct superset of ; otherwise, false. - - The collection to compare to the current set. is null. - - - - Determines whether the current set is a property (strict) subset of a specified collection. - - - true if the current set is a correct subset of ; otherwise, false. - - The collection to compare to the current set. is null. - - - - Determines whether the current set overlaps with the specified collection. - - - true if the current set and share at least one common element; otherwise, false. - - The collection to compare to the current set. is null. - - - - Determines whether the current set and the specified collection contain the same elements. - - - true if the current set is equal to ; otherwise, false. - - The collection to compare to the current set. is null. - - - - Adds an element to the current set and returns a value to indicate if the element was successfully added. - - - true if the element is added to the set; false if the element is already in the set. - - The element to add to the set. - - - - Returns an enumerator that iterates through a collection. Enumeration is inherently not - thread-safe. Use a lock on the SyncRoot to synchronize the entire enumeration process. - - - An object that can be used to iterate through the collection. - - 2 - - - - Returns an enumerator that iterates through the collection. Enumeration is inherently not - thread-safe. Use a lock on the SyncRoot to synchronize the entire enumeration process. - - - A that can be used to iterate through the collection. - - 1 - - - - Gets the number of elements contained in the . - - - The number of elements contained in the . - - - - - Gets a value indicating whether the is read-only. - - - true if the is read-only; otherwise, false. - - -
      -
      + + + + Iesi.Collections + + + + + Implementation of ISet that also maintains a linked list over all elements. + Enumeration of this set is guaranteed to return the elements in the order + they were added. + + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + 1 + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + 2 + + + + Adds an item to the . + + The object to add to the .The is read-only. + + + + Removes all items from the . + + The is read-only. + + + + Determines whether the contains a specific value. + + + true if is found in the ; otherwise, false. + + The object to locate in the . + + + + Copies the elements of the to an , starting at a particular index. + + The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing.The zero-based index in at which copying begins. is null. is less than 0. is multidimensional.-or-The number of elements in the source is greater than the available space from to the end of the destination .-or-Type cannot be cast automatically to the type of the destination . + + + + Removes the first occurrence of a specific object from the . + + + true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . + + The object to remove from the .The is read-only. + + + + Modifies the current set so that it contains all elements that are present in either the current set or the specified collection. + + The collection to compare to the current set. is null. + + + + Modifies the current set so that it contains only elements that are also in a specified collection. + + The collection to compare to the current set. is null. + + + + Removes all elements in the specified collection from the current set. + + The collection of items to remove from the set. is null. + + + + Modifies the current set so that it contains only elements that are present either in the current set or in the specified collection, but not both. + + The collection to compare to the current set. is null. + + + + Determines whether a set is a subset of a specified collection. + + + true if the current set is a subset of ; otherwise, false. + + The collection to compare to the current set. is null. + + + + Determines whether the current set is a superset of a specified collection. + + + true if the current set is a superset of ; otherwise, false. + + The collection to compare to the current set. is null. + + + + Determines whether the current set is a correct superset of a specified collection. + + + true if the object is a correct superset of ; otherwise, false. + + The collection to compare to the current set. is null. + + + + Determines whether the current set is a proper (strict) subset of a specified collection. + + + true if the current set is a correct subset of ; otherwise, false. + + The collection to compare to the current set. is null. + + + + Determines whether the current set overlaps with the specified collection. + + + true if the current set and share at least one common element; otherwise, false. + + The collection to compare to the current set. is null. + + + + Determines whether the current set and the specified collection contain the same elements. + + + true if the current set is equal to ; otherwise, false. + + The collection to compare to the current set. is null. + + + + Adds an element to the current set and returns a value to indicate if the element was successfully added. + + + true if the element is added to the set; false if the element is already in the set. + + The element to add to the set. + + + + Count the elements in the given collection and determine both the total + count and how many of the elements that are present in the current set. + + + + + Cast the given collection to an ISet<T> if possible. If not, + return a new set containing the items. + + + + + Unlink a node from the linked list by updating the node pointers in + its preceeding and subsequent node. Also update the _first and _last + pointers if necessary. + + + + + Gets the number of elements contained in the . + + + The number of elements contained in the . + + + + + Gets a value indicating whether the is read-only. + + + true if the is read-only; otherwise, false. + + + + +

      Implements a read-only Set wrapper.

      +

      Although this is advertised as immutable, it really isn't. Anyone with access to the + wrapped set can still change the set.

      +
      +
      + + + Constructs an immutable (read-only) Set wrapper. + + The Set that is wrapped. + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + 2 + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + 1 + + + + Adds an item to the . + + The object to add to the . + is always thrown + + + + Removes all items from the . + + is always thrown + + + + Determines whether the contains a specific value. + + + true if is found in the ; otherwise, false. + + The object to locate in the . + + + + Copies the elements of the to an , starting at a particular index. + + The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing.The zero-based index in at which copying begins. is null. is less than 0. is multidimensional.-or-The number of elements in the source is greater than the available space from to the end of the destination .-or-Type cannot be cast automatically to the type of the destination . + + + + Removes the first occurrence of a specific object from the . + + + true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . + + The object to remove from the . + is always thrown + + + + Adds an element to the current set and returns a value to indicate if the element was successfully added. + + + true if the element is added to the set; false if the element is already in the set. + + The element to add to the set. + is always thrown + + + + Modifies the current set so that it contains all elements that are present in both the current set and in the specified collection. + + The collection to compare to the current set. is null. + is always thrown + + + + Modifies the current set so that it contains only elements that are also in a specified collection. + + The collection to compare to the current set. is null. + is always thrown + + + + Removes all elements in the specified collection from the current set. + + The collection of items to remove from the set. is null. + is always thrown + + + + Modifies the current set so that it contains only elements that are present either in the current set or in the specified collection, but not both. + + The collection to compare to the current set. is null. + is always thrown + + + + Determines whether a set is a subset of a specified collection. + + + true if the current set is a subset of ; otherwise, false. + + The collection to compare to the current set. is null. + + + + Determines whether the current set is a superset of a specified collection. + + + true if the current set is a superset of ; otherwise, false. + + The collection to compare to the current set. is null. + + + + Determines whether the current set is a correct superset of a specified collection. + + + true if the object is a correct superset of ; otherwise, false. + + The collection to compare to the current set. is null. + + + + Determines whether the current set is a property (strict) subset of a specified collection. + + + true if the current set is a correct subset of ; otherwise, false. + + The collection to compare to the current set. is null. + + + + Determines whether the current set overlaps with the specified collection. + + + true if the current set and share at least one common element; otherwise, false. + + The collection to compare to the current set. is null. + + + + Determines whether the current set and the specified collection contain the same elements. + + + true if the current set is equal to ; otherwise, false. + + The collection to compare to the current set. is null. + + + + Gets the number of elements contained in the . + + + The number of elements contained in the . + + + + + Gets a value indicating whether the is read-only. + + + True. + + + + +

      Implements a thread-safe Set wrapper. The implementation is extremely conservative, + serializing critical sections to prevent possible deadlocks, and locking on everything. + The one exception is for enumeration, which is inherently not thread-safe. For this, you + have to lock the SyncRoot object for the duration of the enumeration.

      +
      +
      + + + Constructs a thread-safe ISet wrapper. + + The Set object that this object will wrap. + + + + Adds an item to the . + + The object to add to the .The is read-only. + + + + Removes all items from the . + + The is read-only. + + + + Determines whether the contains a specific value. + + + true if is found in the ; otherwise, false. + + The object to locate in the . + + + + Copies the elements of the to an , starting at a particular index. + + The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing.The zero-based index in at which copying begins. is null. is less than 0. is multidimensional.-or-The number of elements in the source is greater than the available space from to the end of the destination .-or-Type cannot be cast automatically to the type of the destination . + + + + Removes the first occurrence of a specific object from the . + + + true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . + + The object to remove from the .The is read-only. + + + + Modifies the current set so that it contains all elements that are present in either the current set or in the specified collection. + + The collection to compare to the current set. is null. + + + + Modifies the current set so that it contains only elements that are also in a specified collection. + + The collection to compare to the current set. is null. + + + + Removes all elements in the specified collection from the current set. + + The collection of items to remove from the set. is null. + + + + Modifies the current set so that it contains only elements that are present either in the current set or in the specified collection, but not both. + + The collection to compare to the current set. is null. + + + + Determines whether a set is a subset of a specified collection. + + + true if the current set is a subset of ; otherwise, false. + + The collection to compare to the current set. is null. + + + + Determines whether the current set is a superset of a specified collection. + + + true if the current set is a superset of ; otherwise, false. + + The collection to compare to the current set. is null. + + + + Determines whether the current set is a correct superset of a specified collection. + + + true if the object is a correct superset of ; otherwise, false. + + The collection to compare to the current set. is null. + + + + Determines whether the current set is a property (strict) subset of a specified collection. + + + true if the current set is a correct subset of ; otherwise, false. + + The collection to compare to the current set. is null. + + + + Determines whether the current set overlaps with the specified collection. + + + true if the current set and share at least one common element; otherwise, false. + + The collection to compare to the current set. is null. + + + + Determines whether the current set and the specified collection contain the same elements. + + + true if the current set is equal to ; otherwise, false. + + The collection to compare to the current set. is null. + + + + Adds an element to the current set and returns a value to indicate if the element was successfully added. + + + true if the element is added to the set; false if the element is already in the set. + + The element to add to the set. + + + + Returns an enumerator that iterates through a collection. Enumeration is inherently not + thread-safe. Use a lock on the SyncRoot to synchronize the entire enumeration process. + + + An object that can be used to iterate through the collection. + + 2 + + + + Returns an enumerator that iterates through the collection. Enumeration is inherently not + thread-safe. Use a lock on the SyncRoot to synchronize the entire enumeration process. + + + A that can be used to iterate through the collection. + + 1 + + + + Gets the number of elements contained in the . + + + The number of elements contained in the . + + + + + Gets a value indicating whether the is read-only. + + + true if the is read-only; otherwise, false. + + +
      +
      diff --git a/lib/nuget/COPYRIGHT.txt b/lib/nuget/COPYRIGHT.txt index 5b09ac67245..e1faf6c2df5 100644 --- a/lib/nuget/COPYRIGHT.txt +++ b/lib/nuget/COPYRIGHT.txt @@ -1,13 +1,13 @@ - Copyright 2010 Outercurve Foundation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + Copyright 2010 Outercurve Foundation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/lib/nuget/CREDITS.txt b/lib/nuget/CREDITS.txt index 721492e1bc4..594e8a0f998 100644 --- a/lib/nuget/CREDITS.txt +++ b/lib/nuget/CREDITS.txt @@ -1,14 +1,14 @@ -NuGet Project -ASP.NET Open Source Gallery at Outercurve Foundation -Copyright 2010 Outercurve Foundation - -This product includes software developed at -The Outercurve Foundation (http://www.outercurve.org/). - -NuGet includes or is derivative of works distributed under the licenses listed below. The full text for most of the licenses listed below can be found in the LICENSE.txt file accompanying each work. The original copyright notices have been preserved within the respective files and or packages. Please refer to the specific files and/or packages for more detailed information about the authors, copyright notices, and licenses. - -ProvideBindingPathAttribute (Visual Studio SDK) ------ -Website: http://msdn.microsoft.com/en-us/library/bb166441(VS.80).aspx -Copyright: Copyright (c) 2010 Microsoft -License: Apache 2.0 +NuGet Project +ASP.NET Open Source Gallery at Outercurve Foundation +Copyright 2010 Outercurve Foundation + +This product includes software developed at +The Outercurve Foundation (http://www.outercurve.org/). + +NuGet includes or is derivative of works distributed under the licenses listed below. The full text for most of the licenses listed below can be found in the LICENSE.txt file accompanying each work. The original copyright notices have been preserved within the respective files and or packages. Please refer to the specific files and/or packages for more detailed information about the authors, copyright notices, and licenses. + +ProvideBindingPathAttribute (Visual Studio SDK) +----- +Website: http://msdn.microsoft.com/en-us/library/bb166441(VS.80).aspx +Copyright: Copyright (c) 2010 Microsoft +License: Apache 2.0 diff --git a/lib/nuget/LICENSE.txt b/lib/nuget/LICENSE.txt index 63c0dc17667..dd0f078c6b9 100644 --- a/lib/nuget/LICENSE.txt +++ b/lib/nuget/LICENSE.txt @@ -1,177 +1,177 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/lib/nunit/NUnitFitTests.html b/lib/nunit/NUnitFitTests.html index b7eb5c9117e..ca5cd4ff70d 100644 --- a/lib/nunit/NUnitFitTests.html +++ b/lib/nunit/NUnitFitTests.html @@ -1,277 +1,277 @@ - - - -

      NUnit Acceptance Tests

      -

      - Developers love self-referential programs! Hence, NUnit has always run all it's - own tests, even those that are not really unit tests. -

      Now, beginning with NUnit 2.4, NUnit has top-level tests using Ward Cunningham's - FIT framework. At this time, the tests are pretty rudimentary, but it's a start - and it's a framework for doing more. -

      Running the Tests

      -

      Open a console or shell window and navigate to the NUnit bin directory, which - contains this file. To run the test under Microsoft .Net, enter the command -

          runFile NUnitFitTests.html TestResults.html .
      - To run it under Mono, enter -
          mono runFile.exe NUnitFitTests.html TestResults.html .
      - Note the space and dot at the end of each command. The results of your test - will be in TestResults.html in the same directory. -

      Platform and CLR Version

      - - - - -
      NUnit.Fixtures.PlatformInfo
      -

      Verify Unit Tests

      -

      - Load and run the NUnit unit tests, verifying that the results are as expected. - When these tests are run on different platforms, different numbers of tests may - be skipped, so the values for Skipped and Run tests are informational only. -

      - The number of tests in each assembly should be constant across all platforms - - any discrepancy usually means that one of the test source files was not - compiled on the platform. There should be no failures and no tests ignored. -

      Note: - At the moment, the nunit.extensions.tests assembly is failing because the - fixture doesn't initialize addins in the test domain. -

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      NUnit.Fixtures.AssemblyRunner
      AssemblyTests()Run()Skipped()Ignored()Failures()
      nunit.framework.tests.dll397  00
      nunit.core.tests.dll355  00
      nunit.util.tests.dll238  00
      nunit.mocks.tests.dll43  00
      nunit.extensions.tests.dll5  00
      nunit-console.tests.dll40  00
      nunit.uikit.tests.dll34  00
      nunit-gui.tests.dll15  00
      nunit.fixtures.tests.dll6  00
      -

      Code Snippet Tests

      -

      - These tests create a test assembly from a snippet of code and then load and run - the tests that it contains, verifying that the structure of the loaded tests is - as expected and that the number of tests run, skipped, ignored or failed is - correct. -

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      NUnit.Fixtures.SnippetRunner
      CodeTree()Run()Skipped()Ignored()Failures()
      public class TestClass
      -{
      -}
      -
      EMPTY0000
      using NUnit.Framework;
      -
      -[TestFixture]
      -public class TestClass
      -{
      -}
      -
      TestClass0000
      using NUnit.Framework;
      -
      -[TestFixture]
      -public class TestClass
      -{
      -    [Test]
      -    public void T1() { }
      -    [Test]
      -    public void T2() { }
      -    [Test]
      -    public void T3() { }
      -}
      -
      TestClass
      ->T1
      ->T2
      ->T3
      -
      3000
      using NUnit.Framework;
      -
      -[TestFixture]
      -public class TestClass1
      -{
      -    [Test]
      -    public void T1() { }
      -}
      -
      -[TestFixture]
      -public class TestClass2
      -{
      -    [Test]
      -    public void T2() { }
      -    [Test]
      -    public void T3() { }
      -}
      -
      TestClass1
      ->T1
      -TestClass2
      ->T2
      ->T3
      -
      3000
      using NUnit.Framework;
      -
      -[TestFixture]
      -public class TestClass
      -{
      -    [Test]
      -    public void T1() { }
      -    [Test, Ignore]
      -    public void T2() { }
      -    [Test]
      -    public void T3() { }
      -}
      -
      TestClass
      ->T1
      ->T2
      ->T3
      -
      2010
      using NUnit.Framework;
      -
      -[TestFixture]
      -public class TestClass
      -{
      -    [Test]
      -    public void T1() { }
      -    [Test, Explicit]
      -    public void T2() { }
      -    [Test]
      -    public void T3() { }
      -}
      -
      TestClass
      ->T1
      ->T2
      ->T3
      -
      2100
      -

      Summary Information

      - - - - -
      fit.Summary
      - - + + + +

      NUnit Acceptance Tests

      +

      + Developers love self-referential programs! Hence, NUnit has always run all it's + own tests, even those that are not really unit tests. +

      Now, beginning with NUnit 2.4, NUnit has top-level tests using Ward Cunningham's + FIT framework. At this time, the tests are pretty rudimentary, but it's a start + and it's a framework for doing more. +

      Running the Tests

      +

      Open a console or shell window and navigate to the NUnit bin directory, which + contains this file. To run the test under Microsoft .Net, enter the command +

          runFile NUnitFitTests.html TestResults.html .
      + To run it under Mono, enter +
          mono runFile.exe NUnitFitTests.html TestResults.html .
      + Note the space and dot at the end of each command. The results of your test + will be in TestResults.html in the same directory. +

      Platform and CLR Version

      + + + + +
      NUnit.Fixtures.PlatformInfo
      +

      Verify Unit Tests

      +

      + Load and run the NUnit unit tests, verifying that the results are as expected. + When these tests are run on different platforms, different numbers of tests may + be skipped, so the values for Skipped and Run tests are informational only. +

      + The number of tests in each assembly should be constant across all platforms - + any discrepancy usually means that one of the test source files was not + compiled on the platform. There should be no failures and no tests ignored. +

      Note: + At the moment, the nunit.extensions.tests assembly is failing because the + fixture doesn't initialize addins in the test domain. +

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      NUnit.Fixtures.AssemblyRunner
      AssemblyTests()Run()Skipped()Ignored()Failures()
      nunit.framework.tests.dll397  00
      nunit.core.tests.dll355  00
      nunit.util.tests.dll238  00
      nunit.mocks.tests.dll43  00
      nunit.extensions.tests.dll5  00
      nunit-console.tests.dll40  00
      nunit.uikit.tests.dll34  00
      nunit-gui.tests.dll15  00
      nunit.fixtures.tests.dll6  00
      +

      Code Snippet Tests

      +

      + These tests create a test assembly from a snippet of code and then load and run + the tests that it contains, verifying that the structure of the loaded tests is + as expected and that the number of tests run, skipped, ignored or failed is + correct. +

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      NUnit.Fixtures.SnippetRunner
      CodeTree()Run()Skipped()Ignored()Failures()
      public class TestClass
      +{
      +}
      +
      EMPTY0000
      using NUnit.Framework;
      +
      +[TestFixture]
      +public class TestClass
      +{
      +}
      +
      TestClass0000
      using NUnit.Framework;
      +
      +[TestFixture]
      +public class TestClass
      +{
      +    [Test]
      +    public void T1() { }
      +    [Test]
      +    public void T2() { }
      +    [Test]
      +    public void T3() { }
      +}
      +
      TestClass
      +>T1
      +>T2
      +>T3
      +
      3000
      using NUnit.Framework;
      +
      +[TestFixture]
      +public class TestClass1
      +{
      +    [Test]
      +    public void T1() { }
      +}
      +
      +[TestFixture]
      +public class TestClass2
      +{
      +    [Test]
      +    public void T2() { }
      +    [Test]
      +    public void T3() { }
      +}
      +
      TestClass1
      +>T1
      +TestClass2
      +>T2
      +>T3
      +
      3000
      using NUnit.Framework;
      +
      +[TestFixture]
      +public class TestClass
      +{
      +    [Test]
      +    public void T1() { }
      +    [Test, Ignore]
      +    public void T2() { }
      +    [Test]
      +    public void T3() { }
      +}
      +
      TestClass
      +>T1
      +>T2
      +>T3
      +
      2010
      using NUnit.Framework;
      +
      +[TestFixture]
      +public class TestClass
      +{
      +    [Test]
      +    public void T1() { }
      +    [Test, Explicit]
      +    public void T2() { }
      +    [Test]
      +    public void T3() { }
      +}
      +
      TestClass
      +>T1
      +>T2
      +>T3
      +
      2100
      +

      Summary Information

      + + + + +
      fit.Summary
      + + diff --git a/lib/nunit/NUnitTests.config b/lib/nunit/NUnitTests.config index ecbd55e129d..de8a656988d 100644 --- a/lib/nunit/NUnitTests.config +++ b/lib/nunit/NUnitTests.config @@ -1,84 +1,84 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/nunit/NUnitTests.nunit b/lib/nunit/NUnitTests.nunit index bb80dd64920..e7bb7f432a3 100644 --- a/lib/nunit/NUnitTests.nunit +++ b/lib/nunit/NUnitTests.nunit @@ -1,14 +1,14 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/lib/nunit/agent.conf b/lib/nunit/agent.conf index b4cf5509e7d..ddbcd8ea6d8 100644 --- a/lib/nunit/agent.conf +++ b/lib/nunit/agent.conf @@ -1,4 +1,4 @@ - - 8080 - . + + 8080 + . \ No newline at end of file diff --git a/lib/nunit/agent.log.conf b/lib/nunit/agent.log.conf index d340cad1e93..4bd90ca4931 100644 --- a/lib/nunit/agent.log.conf +++ b/lib/nunit/agent.log.conf @@ -1,18 +1,18 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/lib/nunit/clr.bat b/lib/nunit/clr.bat index 8291f268431..0a838482ca8 100644 --- a/lib/nunit/clr.bat +++ b/lib/nunit/clr.bat @@ -1,96 +1,96 @@ -@echo off -rem Run a program under a particular version of the .Net framework -rem by setting the COMPLUS_Version environment variable. -rem -rem This command was written by Charlie Poole for the NUnit project. -rem You may use it separately from NUnit at your own risk. - -if "%1"=="/?" goto help -if "%1"=="?" goto help -if "%1"=="" goto GetVersion -if /I "%1"=="off" goto RemoveVersion -if "%2"=="" goto SetVersion -goto main - -:help -echo Control the version of the .Net framework that is used. The -echo command has several forms: -echo. -echo CLR -echo Reports the version of the CLR that has been set -echo. -echo CLR version -echo Sets the local shell environment to use a specific -echo version of the CLR for subsequent commands. -echo. -echo CLR version command [arguments] -echo Executes a single command using the specified CLR version. -echo. -echo CLR off -echo Turns off specific version selection for commands -echo. -echo The CLR version may be specified as vn.n.n or n.n.n. In addition, -echo the following shortcuts are recognized: -echo net-1.0, 1.0 For version 1.0.3705 -echo net-1.1, 1.1 For version 1.1.4322 -echo beta2 For version 2.0.50215 -echo net-2.0, 2.0 For version 2.0.50727 -echo. -echo NOTE: -echo Any specific settings for required or supported runtime in -echo the ^ section of a program's config file will -echo override the version specified by this command, and the -echo command will have no effect. -echo. -goto done - -:main - -setlocal -set CMD= -call :SetVersion %1 -shift /1 - -:loop 'Copy remaining arguments to form the command -if "%1"=="" goto run -set CMD=%CMD% %1 -shift /1 -goto :loop - -:run 'Execute the command -%CMD% -endlocal -goto done - -:SetVersion -set COMPLUS_Version=%1 - -rem Substitute proper format for certain names -if /I "%COMPLUS_Version:~0,1%"=="v" goto useit -if /I "%COMPLUS_Version%"=="net-1.0" set COMPLUS_Version=v1.0.3705&goto report -if /I "%COMPLUS_Version%"=="1.0" set COMPLUS_Version=v1.0.3705&goto report -if /I "%COMPLUS_Version%"=="net-1.1" set COMPLUS_Version=v1.1.4322&goto report -if /I "%COMPLUS_Version%"=="1.1" set COMPLUS_Version=v1.1.4322&goto report -if /I "%COMPLUS_Version%"=="beta2" set COMPLUS_Version=v2.0.50215&goto report -if /I "%COMPLUS_Version%"=="net-2.0" set COMPLUS_Version=v2.0.50727&goto report -if /I "%COMPLUS_Version%"=="2.0" set COMPLUS_Version=v2.0.50727&goto report - -rem Add additional substitutions here, branching to report - -rem assume it's a version number without 'v' -set COMPLUS_Version=v%COMPLUS_Version% - -:report -echo Setting CLR version to %COMPLUS_Version% -goto done - -:GetVersion -if "%COMPLUS_Version%"=="" echo CLR version is not set -if NOT "%COMPLUS_Version%"=="" echo CLR version is set to %COMPLUS_Version% -goto done - -:RemoveVersion -set COMPLUS_Version= -echo CLR version is no longer set - +@echo off +rem Run a program under a particular version of the .Net framework +rem by setting the COMPLUS_Version environment variable. +rem +rem This command was written by Charlie Poole for the NUnit project. +rem You may use it separately from NUnit at your own risk. + +if "%1"=="/?" goto help +if "%1"=="?" goto help +if "%1"=="" goto GetVersion +if /I "%1"=="off" goto RemoveVersion +if "%2"=="" goto SetVersion +goto main + +:help +echo Control the version of the .Net framework that is used. The +echo command has several forms: +echo. +echo CLR +echo Reports the version of the CLR that has been set +echo. +echo CLR version +echo Sets the local shell environment to use a specific +echo version of the CLR for subsequent commands. +echo. +echo CLR version command [arguments] +echo Executes a single command using the specified CLR version. +echo. +echo CLR off +echo Turns off specific version selection for commands +echo. +echo The CLR version may be specified as vn.n.n or n.n.n. In addition, +echo the following shortcuts are recognized: +echo net-1.0, 1.0 For version 1.0.3705 +echo net-1.1, 1.1 For version 1.1.4322 +echo beta2 For version 2.0.50215 +echo net-2.0, 2.0 For version 2.0.50727 +echo. +echo NOTE: +echo Any specific settings for required or supported runtime in +echo the ^ section of a program's config file will +echo override the version specified by this command, and the +echo command will have no effect. +echo. +goto done + +:main + +setlocal +set CMD= +call :SetVersion %1 +shift /1 + +:loop 'Copy remaining arguments to form the command +if "%1"=="" goto run +set CMD=%CMD% %1 +shift /1 +goto :loop + +:run 'Execute the command +%CMD% +endlocal +goto done + +:SetVersion +set COMPLUS_Version=%1 + +rem Substitute proper format for certain names +if /I "%COMPLUS_Version:~0,1%"=="v" goto useit +if /I "%COMPLUS_Version%"=="net-1.0" set COMPLUS_Version=v1.0.3705&goto report +if /I "%COMPLUS_Version%"=="1.0" set COMPLUS_Version=v1.0.3705&goto report +if /I "%COMPLUS_Version%"=="net-1.1" set COMPLUS_Version=v1.1.4322&goto report +if /I "%COMPLUS_Version%"=="1.1" set COMPLUS_Version=v1.1.4322&goto report +if /I "%COMPLUS_Version%"=="beta2" set COMPLUS_Version=v2.0.50215&goto report +if /I "%COMPLUS_Version%"=="net-2.0" set COMPLUS_Version=v2.0.50727&goto report +if /I "%COMPLUS_Version%"=="2.0" set COMPLUS_Version=v2.0.50727&goto report + +rem Add additional substitutions here, branching to report + +rem assume it's a version number without 'v' +set COMPLUS_Version=v%COMPLUS_Version% + +:report +echo Setting CLR version to %COMPLUS_Version% +goto done + +:GetVersion +if "%COMPLUS_Version%"=="" echo CLR version is not set +if NOT "%COMPLUS_Version%"=="" echo CLR version is set to %COMPLUS_Version% +goto done + +:RemoveVersion +set COMPLUS_Version= +echo CLR version is no longer set + :done \ No newline at end of file diff --git a/lib/nunit/launcher.log.conf b/lib/nunit/launcher.log.conf index d340cad1e93..4bd90ca4931 100644 --- a/lib/nunit/launcher.log.conf +++ b/lib/nunit/launcher.log.conf @@ -1,18 +1,18 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/lib/nunit/license.txt b/lib/nunit/license.txt index ab91df44969..66a5ebf28bb 100644 --- a/lib/nunit/license.txt +++ b/lib/nunit/license.txt @@ -1,15 +1,15 @@ -Copyright 2002-2008 Charlie Poole -Copyright 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov -Copyright 2000-2002 Philip A. Craig - -This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment (see the following) in the product documentation is required. - -Portions Copyright 2002-2008 Charlie Poole or Copyright 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright 2000-2002 Philip A. Craig - -2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source distribution. +Copyright 2002-2008 Charlie Poole +Copyright 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov +Copyright 2000-2002 Philip A. Craig + +This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment (see the following) in the product documentation is required. + +Portions Copyright 2002-2008 Charlie Poole or Copyright 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright 2000-2002 Philip A. Craig + +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source distribution. diff --git a/lib/nunit/nunit-agent.exe.config b/lib/nunit/nunit-agent.exe.config index c31edbc7bf0..e33ec06e0e2 100644 --- a/lib/nunit/nunit-agent.exe.config +++ b/lib/nunit/nunit-agent.exe.config @@ -1,87 +1,87 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/nunit/nunit-console-x86.exe.config b/lib/nunit/nunit-console-x86.exe.config index f1af5010191..bd83fb17113 100644 --- a/lib/nunit/nunit-console-x86.exe.config +++ b/lib/nunit/nunit-console-x86.exe.config @@ -1,95 +1,95 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/nunit/nunit-console.exe.config b/lib/nunit/nunit-console.exe.config index 3d54204633a..32956794162 100644 --- a/lib/nunit/nunit-console.exe.config +++ b/lib/nunit/nunit-console.exe.config @@ -1,95 +1,95 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/nunit/nunit-x86.exe.config b/lib/nunit/nunit-x86.exe.config index 367c54ca0af..9d5ca14e971 100644 --- a/lib/nunit/nunit-x86.exe.config +++ b/lib/nunit/nunit-x86.exe.config @@ -1,103 +1,103 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/nunit/nunit.exe.config b/lib/nunit/nunit.exe.config index 367c54ca0af..9d5ca14e971 100644 --- a/lib/nunit/nunit.exe.config +++ b/lib/nunit/nunit.exe.config @@ -1,103 +1,103 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/nunit/pnunit-agent.exe.config b/lib/nunit/pnunit-agent.exe.config index 15d4cdbb6c0..f4236b6dd1b 100644 --- a/lib/nunit/pnunit-agent.exe.config +++ b/lib/nunit/pnunit-agent.exe.config @@ -1,87 +1,87 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/nunit/pnunit-launcher.exe.config b/lib/nunit/pnunit-launcher.exe.config index b037b91b3d5..87828f68deb 100644 --- a/lib/nunit/pnunit-launcher.exe.config +++ b/lib/nunit/pnunit-launcher.exe.config @@ -1,87 +1,87 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/nunit/runFile.exe.config b/lib/nunit/runFile.exe.config index 35909b4ced3..f58f099b6a2 100644 --- a/lib/nunit/runFile.exe.config +++ b/lib/nunit/runFile.exe.config @@ -1,43 +1,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/nunit/runpnunit.bat b/lib/nunit/runpnunit.bat index 6efc8b442bc..a05cbb7d95b 100644 --- a/lib/nunit/runpnunit.bat +++ b/lib/nunit/runpnunit.bat @@ -1,2 +1,2 @@ -start pnunit-agent agent.conf +start pnunit-agent agent.conf pnunit-launcher test.conf \ No newline at end of file diff --git a/lib/nunit/test.conf b/lib/nunit/test.conf index a35e7184dab..14cd11307bf 100644 --- a/lib/nunit/test.conf +++ b/lib/nunit/test.conf @@ -1,24 +1,24 @@ - - - - - Testing - - - Testing - pnunit.tests.dll - TestLibraries.Testing.EqualTo19 - localhost:8080 - - ..\server - - - - - - - - - - + + + + + Testing + + + Testing + pnunit.tests.dll + TestLibraries.Testing.EqualTo19 + localhost:8080 + + ..\server + + + + + + + + + + \ No newline at end of file diff --git a/lib/specflow/LICENSE.txt b/lib/specflow/LICENSE.txt index bb870acd02a..665e1cd4809 100644 --- a/lib/specflow/LICENSE.txt +++ b/lib/specflow/LICENSE.txt @@ -1,31 +1,31 @@ -SpecFlow Licence (New BSD License) - -Copyright (c) 2009, TechTalk - -Disclaimer: - * The initial codebase of Specflow was written by TechTalk employees. - No 3rd party code was included. - * No code of customer projects was used to create this project. - * TechTalk had the full rights to publish the initial codebase. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the SpecFlow project nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL TECHTALK OR CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +SpecFlow Licence (New BSD License) + +Copyright (c) 2009, TechTalk + +Disclaimer: + * The initial codebase of Specflow was written by TechTalk employees. + No 3rd party code was included. + * No code of customer projects was used to create this project. + * TechTalk had the full rights to publish the initial codebase. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the SpecFlow project nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL TECHTALK OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/lib/specflow/TechTalk.SpecFlow.targets b/lib/specflow/TechTalk.SpecFlow.targets index 7d016f46112..877db80e248 100644 --- a/lib/specflow/TechTalk.SpecFlow.targets +++ b/lib/specflow/TechTalk.SpecFlow.targets @@ -1,65 +1,65 @@ - - - - - - - - false - - - - false - - false - false - false - - - - false - true - - - - - BeforeUpdateFeatureFilesInProject; - UpdateFeatureFilesInProject; - AfterUpdateFeatureFilesInProject; - $(BuildDependsOn) - - - SwitchToForceGenerate; - $(RebuildDependsOn) - - - - - - true - true - - - - - - - - - - - - - - - + + + + + + + + false + + + + false + + false + false + false + + + + false + true + + + + + BeforeUpdateFeatureFilesInProject; + UpdateFeatureFilesInProject; + AfterUpdateFeatureFilesInProject; + $(BuildDependsOn) + + + SwitchToForceGenerate; + $(RebuildDependsOn) + + + + + + true + true + + + + + + + + + + + + + + + diff --git a/lib/specflow/TechTalk.SpecFlow.tasks b/lib/specflow/TechTalk.SpecFlow.tasks index 3391be4c8c4..c652e133d32 100644 --- a/lib/specflow/TechTalk.SpecFlow.tasks +++ b/lib/specflow/TechTalk.SpecFlow.tasks @@ -1,17 +1,17 @@ - - - - specflow.exe - - - - - <__SpecFlowTasksFullPath>$(SpecFlowTasksPath) - - <__SpecFlowTasksFullPath Condition="Exists('$(MSBuildProjectDirectory)\$(SpecFlowTasksPath)')" - >$(MSBuildProjectDirectory)\$(SpecFlowTasksPath) - - - - - + + + + specflow.exe + + + + + <__SpecFlowTasksFullPath>$(SpecFlowTasksPath) + + <__SpecFlowTasksFullPath Condition="Exists('$(MSBuildProjectDirectory)\$(SpecFlowTasksPath)')" + >$(MSBuildProjectDirectory)\$(SpecFlowTasksPath) + + + + + diff --git a/lib/specflow/changelog.txt b/lib/specflow/changelog.txt index bc4708028e1..e335fc115e9 100644 --- a/lib/specflow/changelog.txt +++ b/lib/specflow/changelog.txt @@ -1,411 +1,411 @@ -1.9.0 - 2012/08/06 - -See detailed feature summary at http://go.specflow.org/whatsnew-19 - -New Features: -+ Visual Studio 2012 support -+ Download IDE integration packages through their own distribution channel: - Visual Studio 2012 and 2010: Visual Studio Gallery (http://go.specflow.org/vsgallery) - MonoDevelop: MonoDevelop Add-in Repository (http://go.specflow.org/monodevelop-addin) - SharpDevelop: download addin and install it from SharpDevelop AddIn Manager (http://go.specflow.org/download-sdaddin) - Visual Studio 2008: download installer (http://go.specflow.org/download-vs2008msi) -+ Visual Studio 2012 generic test runner support -+ Added SpecFlow.xUnit NuGet package -+ Guids can now be used as arguments to step definitions. -+ Any missing characters on a guid in tables or step arguments will be filled with trailing zeroes. ("7" => 70000000-0000-0000-0000-000000000000) -+ Better comparison exceptions when comparing tables to sets. -+ Using standard Gherkin parser (http://github.com/aslakhellesoy/gherkin) v2.6.5 -+ VS2010: Comment and uncomment selection -+ VS2010: Cache analysis result for faster solution startup -+ VS2010: It can now be installed on machines used for SharePoint development -+ Step Definitions without Regular Expressions (underscore style, pascal-case style) -+ F# step definitions (regex method names, Visual Studio integration) -+ SpecFlow.NUnit NuGet package has been split to SpecFlow.NUnit (w/o AddOn for NUnit runner) and SpecFlow.NUnit.Runners (with runner support) -+ ReSharper: editor features (toggle comment, go to step definition, run/debug scenarios) can be used with R# keyboard shortcuts -+ MsTest: Support for MSTest's [Owner] and [WorkItem] attributes with tags like @owner:foo @workitem:123 (Issue 162, Pull 161) -+ NuGet package for creating custom generator extensions: SpecFlow.CustomPlugin -+ VS2010: Integration can track files changed outside of VS (e.g. updated by a SCC pull) -+ VS2010: Collect bindings from assembly references -+ VS2010: Navigation from step definitions to the matching steps (Issue 192) -+ VS2010: Context-dependent navigation (go to step definition / go to steps) with Alt+Ctrl+Shift+S -+ VS2010: Generate missing step definitions from a feature file -+ Support custom step definition skeleton templates (dirrerent style customizable in config, template can be overriden in - "C:\Users\\AppData\Local\SpecFlow\SkeletonTemplates.sftemplate", see http://go.specflow.org/doc-stepdefstyles) (Issue 137, Pull 113) -+ VS2010: Highlight unbound steps and step parameters in the editor (beta, can be switched off in Tools/Options/SpecFlow) (Issue 49, Pull 189, with support of matgiro) -+ Plugin infrastructure -+ The default MsTest unit test provider is changed to the MsTest.2010. If you need to use the MsTest 2008 provider, you have to specify "MsTest.2008". - For newer MsTest providers, you can use "MsTest" (recommended) or "MsTest.2010". - -Fixed issues: -+ VS2010: The message "Step bindings are still being analyzed. Please wait." displayed infinitely (Issue 168) -+ SharePoint: throws errors when creating a test class based on the .feature file generated in SharePoint progress because the content of the file is xml. (Issue 151, Pull 170) -+ VS2010: Formatting table fails if table row does not end with a pipe (Issue 146) -+ Support for missing feature/GenerationTargetLanguage (Issue 163) -+ RuntimePluginLoader: IsAssignableFrom is backwards (Issue 164) -+ VS2010: Specflow options show up as "General" in VS Import/Export settings (Issue 184) -+ Dispose IDisposable user objects created by SpecFlow (Issue 22) - -1.8.1 - 2011/10/25 - -Fixed issues: -+ ReSharper: NUnit scenario outline without tag on example set (rowtest enabled) causes inconclusive result (Issue 116) -+ Step definition with more than 10 parameters causing BindingException (extended now to 20) -+ Run & debug scenarios from the feature file context menu does not work with ReSharper 6 (Issue 138) -+ VS2010 step autocomplete: New steps form external project are not found unless IDE is restarted (Issue 88, by Stanislaw Wozniak) -+ VS2010 step autocomplete: Duplicated steps - -1.8.0 - 2011/10/17 - -Breaking changes: -+ Classes used for context injection must have a single public constructor with maximum parameter count (so far the first constructor was used). -+ After step hook is was not invoked when step definition failed so far. Now it is invoked even in case of a failure. - -New features: -+ Async testing support for Windows Phone 7 (Issue 132, by Jeff Simons) -+ Support for MbUnit v3. Use unit test provider name "mbunit.3". (Issue 133, by Raytheon) -+ SpecFlow framework classes can be used as a dependency for context injection. -+ Custom extensions for the runtime can be specified in the config file (specflow/runtime/dependencies). -+ Better customization possibilities with plugins. -+ [StepScope] attribute can also scope hooks (event bindings) (Issue 95) -+ [StepScope] has been renamed to [Scope]. [StepScope] is kept with obsolete warning. -+ VS2010: Run & debug scenarios from the feature file context menu and solution explorer nodes (feature file, folder, project). -+ VS2010: Use infix word prefix matching for step completion. -+ VS2010: Regenerate feature files from project context menu. -+ VS2010: Go to step definition command in feature file context menu. -+ MsBuild generator can output generated file paths (GeneratedFiles property). The file list is populated to the MsBuild item - @(SpecFlowGeneratedFiles) by the TechTalk.SpecFlow.targets. -+ MsBuild: TechTalk.SpecFlow.targets provides overrideable BeforeUpdateFeatureFilesInProject and AfterUpdateFeatureFilesInProject targets. -+ Cucumber harmonization - + Allow using [Before]/[After] attributes as synonyms of [BeforeScenario]/[AfterScenario] - + Allow using [StepDefinition] attribute that matches to given, when or then steps - + Leading '@' sign can be specified for hooks and [Scope] attribute - -Fixed issues: -+ Instances created for context injection are disposed after scenario execution (Issue 22) -+ Error when opening feature file in VS2008 if VS2008 syntax coloring was enabled. -+ Silverlight: make possible to access SilverlightTest instance (Issue 126, by Matt Ellis) -+ Silverlight: apply feature tags to the test class instead of the methods (Issue 126, by Matt Ellis) -+ SpecFlowContext.TryGetValue does not evaluate Func factory methods (Issue 127, by Matt Ellis) -+ StepArgumentTransformation cannot be used recursively -+ VS2010 locks generator folder -+ After step hook is not invoked when step definition failed. -+ Missing XML comment warnings caused by the generated test class (Issue 121) -+ VS2010: Goto step definition misdiagnoses Given-But as a Then-But (Issue 134, by Raytheon) -+ VS2010: 'Go To Definition' does not work with partial classes. (Issue 53, by Raytheon) -+ AfterTestRun-Hook does not trigger when running in NUnitGui or NUnitConsole. To fix this, you need to add the NUnit addin from - https://raw.github.com/techtalk/SpecFlow/master/Installer/NUnitNuGetPackage/SpecFlowNUnitExtension.cs to the project, or use - the SpecFlow.NUnit combined NuGet package that does this automatically. - -1.7.1 - 2011/08/19 - -Fixed issues: -+ Test execution report displays the feature description instead of the title (Issue 118) -+ Incomprehensible error message when Scenario-description is empty (Issue 117) -+ Assist helpers do not support Singles (Issue 114, by Joe Parkin) -+ Assist helpers do not support unsigned integers (Issue 115, by mdellanoce) -+ The test class is not generated as UTF-8, so some accented characters might be displayed incorrectly. (Issue 112) -+ Fix step definition report broken by v1.7. (Issue 111, by Chris Roff) -+ Intellisense breaks when typing keyword 'E' (And in pt-BR) followed by a space (Issue 109) -+ Intellisense completition removes the non-first words of keywords (e.g. for "Gegeben sei") (Issue 65) -+ Support table delimiter escaping for table formatting (Issue 99) -+ Fixed enum property name match (Issue 119) -+ Added Assist support for byte, float, long, ulong, sbyte, ushort, single. With nullables. (Issue 120) - -1.7.0 - 2011/07/29 - -Breaking changes: -+ There are a few breaking changes in the generated test code. If you upgrade to SpecFlow 1.7, you should either - re-generate the tests, or setup your project to use a version for generating the tests that is compatible with - the runtime you use (see "Using SpecFlow generator from the project's lib folder" feature). - -New features: -+ Using standard Gherkin parser (http://github.com/aslakhellesoy/gherkin) v2.3.6 -+ Using SpecFlow generator from the project's lib folder instead of SpecFlow installed for IDE integration. - The VS2010 integration can be installed independently from projects using a different version. The VS2010 - integration checks the generator in the following paths: - 1. generator path configured in app.config () - 2. generator assembly (TechTalk.SpecFlow.Generator.dll) referenced from the SpecFlow project - 3. generator in the same folder as the runtime (TechTalk.SpecFlow.dll) - 4. generator is near to the runtime ("tools" or "..\tools", relative to the runtime) - 5. generator obtained through NuGet ("..\..\tools", relative to the runtime) - If SpecFlow cannot find the generator or it is older than v1.6.0, the installed SpecFlow generator is used. - If you use any custom plugins (e.g. unit test generator), this has to be in the same folder as the generator - currently. -+ Added ToProjection, ToProjectionOfSet, ToProjectionOfInstance to allow for LINQ-based comparisons. (by Vagif Abilov) -+ Cleaned-up CreateInstance and CreateSet for greater code maintainability. -+ Cleaned-up CompareToInstance and CompareToSet for greater code maintainability, and slightly more accurate value comparisons (like decimals with trailing zeroes). -+ Removed the |Field|Value| requirement for CreateInstance and CompareToInstance. Any header names can be used, so long as the first column is the name of the property and the second column is the value. -+ Can use empty spaces and different casing in the tables used for comparison (i.e. can use |First name| instead of |FirstName| ) -+ Tables used with CreateInstance and CompareToInstance can now be one-row tables with each field as a column (instead of requiring a vertical table with "Field/Value" headers) -+ A default function to create a default instance can be passed to CreateInstance and CreateSet. -+ Syntax coloring support for Visual Studio 2008. Uncheck this option in the installer if you are using cuke4vs. (by Avram Korets) -+ SharpDevelop 4 (#develop) integration. Enable SharpDevelop 4 integration in the installer and use the SharpDevelop AddIn Manager - to install the integration (select addin file from SpecFlow installation folder). (by Charles Weld) -+ Support for testing Silverlight asynchronous code. (by Matt Ellis & Ryan Burnham) - See https://github.com/techtalk/SpecFlow/wiki/Testing-Silverlight-Asynchronous-Code for details. -+ TableRow implements IDictionary -+ Add table row from a (total or partially filled) dictionary -+ Raname table column (Table.RenameColumn(stirng, string)) - -Fixed issues: -+ Installer executes devenv /installtemplates even if VS2008 integration is not selected. -+ Duplicated logic between generator and runtime (generator depends on runtime now) -+ MsTest tests are not properly attached to the right feature (Issue 96) -+ Assist methods now work with classes with multiple properties of the same enum type. -+ Refactor IUnitTestGeneratorProvider interface to be more consistent (Issue 4) - -1.6.1 - 2011/04/15 - -Fixed issues: -+ Windows Phone 7 runtime (TechTalk.SpecFlow.WindowsPhone7.dll) is not included in the NuGet package (Issue 61) -+ Warnings in the generated test classes (Issue 58) -+ Improved tracing for VS2010 integration - -1.6.0 - 2011/04/04 - -Breaking changes: -+ The Silverlight runtime assembly has been renamed to TechTalk.SpecFlow.Silverlight3.dll. - -New features: -+ Added a Set(Func) extension method. The Func method will be invoked whenever ScenarioContext.Current.Get is called. -+ Support for tagging (including @ignore) scenario outline examples. - NUnit and MbUnit: to filter for categories generated for the examples in the unit test runner, you need to - switch off row test generaiton () -+ Using standard Gherkin parser (http://github.com/aslakhellesoy/gherkin) v2.3.5 -+ Support for converting table and multi-line text arguments with [StepArgumentTransformation] (by Chris Roff, roffster) - See examples in Tests/FeatureTests/StepArgumentTransfomation -+ VS2010: Support for specifying color for the step text -+ Added a FillInstance(T) extension method off of Table. When passed an instance of T, it will fill the instance with values from the table (like CreateInstance). -+ VS2010: Re-generate feature file when the configuration has changed or a new version of SpecFlow is installed -+ VS2010: Improved intellisense for steps -+ VS2010: Intellisense for keywords -+ VS2010: "go to binding" -+ VS2010: Automatic table formatting when "|" is typed -+ VS2010: Tracing can be configured from tools / options. The environment variable SPECFLOW_TRACE is not used anymore. -+ Windows Phone 7 support, see https://github.com/techtalk/SpecFlow/wiki/Windows-Phone-7-Support (by Max Paulousky) -+ Silverlight runtime can be configured from query string (by Matt Ellis) -+ Generate test parameters from scenario outline parameters and example set name for MsTest (by Qingsong Yao) -+ Isolated test generator interface (can be used later for using the generator of the project instead of the generator of the IDE integration) -+ Official NuGet integration (by Daniel Sack) - -Fixed issues: -+ Scenario with only "*" steps fails with "System.ArgumentException: Unable to convert block to binding type" -+ Binding is reported as invalid if there is a matching step definition with different scope -+ Support for datetime comparisons that ignore 12:00:00 AM (issue 52) -+ Fix NUnit execution report to properly select features when .features is solely comprised Scenario Outlines. - (by Jon Archer) -+ Tags applied at the feature level are now applied as Silverlight TagAttributes on the class. (by Matt Ellis, citizenmatt) -+ Rethrowing exceptions caught during steps would lose the call stack on Silverlight. (by Matt Ellis, citizenmatt) -+ SpecFlow emits an erroneous suggestion for the step bindings in VB.NET (Issue 32) -+ Refactored VS2010 intagration to better maintanability -+ Refactored CreateSet and CompareToSet extension methods to use the same logic as CreateInstance and CompareToInstance. -+ Step Intellisense doesn't show in Feature Background (Issue 23) -+ Xunit Theory Attribute/InlineAttribute using incorrect namespace. (Issue 40, by Kerry Jones) -+ Scenario Outline - Multiple Scenarios table header row VS formatting issue (Issue 16) -+ SpecFlow step definition report generator throws unhandled exception when a scenario starts with "And" (Issue 45) -+ VS2010: SpecFlow writes out feature and code-behind files with inconsistent line endings (Issue 28) -+ Step definitions can be implemented in abstract base classes (but the abstract base class must not have the [Binding] attribute). SpecFlow no longer tries to instantiate the abstract base class. (Issue 47) - -1.5.0 - 2010/12/17 - -Breaking changes: -+ Changing the default value (true) of the allowRowTests configuration setting is not incompatible with older - runtimes. - -New features: -+ Step Intellisense for Visual Studio 2010 - displays the list of bound steps when pressing space or ctrl+space - after a step keyword - (Thanks to Marcus Hammarberg for the contribution.) -+ Options for Visual Studio 2010 - you can enable/disable the integration features (syntax coloring, outlining, - intellisense) in Visual Studio 2010, Tools / Options / SpecFlow / General -+ Faster installation for VS2010 - if you install SpecFlow only to VS2010, the installation is much faster - as we now entirely using the new VSIX infrastructure for the integaration. -+ Support for row test generation (NUnit, MbUnit and xUnit). This new feature is enabled by default, but can - be switched off from the configuration with . - (Thanks to John Gietzen (otac0n) for the contribution.) -+ Support for specifying property names with blanks and case insensitive for SpecFlow.Assist (by Steven Zhang, jdomzhang) - -Fixed issues: -+ Scoped Steps does not recognize feature tags (Issue 12) -+ Support for double and nullable types in table-helpers of SpecFlow.Assist -+ Support for enum parsing in table-helpers of SpecFlow.Assist -+ Adding comparison helpers to SpecFlow.Assist (by darrencauthon) -+ Support for char parsing in table-helpers of SpecFlow.Assist (Issue 19) -+ VS2010 might crash after pasting into a feature file -+ Excution report should list features ordered by feature title - -1.4.0 - 2010/10/07 - -Breaking changes: -+ The generator has been improved to provide source code language. Because of this, SpecFlow test generated - with this version will be incompatible with older runtimes. - -New features: -+ Scoped Step Definitions: you can scope step definitions (bindings) to tags, features and scenarios. Scope filter - can be applied to a class or a method with the [StepScope] attribute. - See examples in Tests/FeatureTests/ScopedSteps/ScopedSteps.feature and Tests/FeatureTests/ScopedSteps/ScopedStepsBindings.cs - (Thanks to Jose Simas for the contribution.) -+ Adding binding-culture to App.config. If set, this culture is used during execution of steps. -+ VB-Step-Definition Skeleton Provider: For VB-projects, the suggested step skeletons are generated in VB. -+ Merging strongly typed context accessors from Darren Cauthon's SpecFlowAssist -+ Merging table/row extension methods from Darren Cauthon's SpecFlowAssist - Add a using statement for the namespace TechTalk.SpecFlow.Assist to use the extension methods. - See also Darren's youtube tutorial: http://bit.ly/aY4VOd -+ Diagnostic tracing: VS2010 integration can display trace messages to the Output window - if tracing is enabled. Tracing can be enabled by setting the environment variable SPECFLOW_TRACE - to either "all" or to the comma separated list of individual SpecFlow traing categories (currently - only the category "EditorParser" is supported). - -Fixed issues: -+ Better error reporting for wrong Gherkin files (multiple errors displayed, detect duplicate scenario names) -+ Visual Studio 2010 editor slows down after editing a feature file for a longer time (Issue 9) - -1.3.5.2 - 2010/08/11 - -Fixed issues: -+ Sorry, we're ironing out our deploy strategy with the new Mono/MonoDevelop integration. We didn't - change the version in the MonoDevelop Add-In XML file. - -1.3.5.1 - 2010/08/11 - -New features: -+ Support for hosting add-in on http://addins.monodevelop.com - -1.3.5 - 2010/08/11 - -New features: -+ Support for Mono (v2.6.7) & MonoDevelop (v2.4) by Dale Ragan - -Fixed issues: -+ Generating code randomly for the wrong testing engine -+ Test class generation problem for Russian feature files -+ Fix tag support for Silverlight - -1.3.4 - 2010/07/28 - -Fixed issues: -+ Installation fails if Visual Studio 2010 is not installed -+ VS2010: Background section is not colored properly - -1.3.3 - 2010/07/19 - -New features: -+ Support for MsTest report generation - usage: specflow mstestexecutionreport projectFile [/testResult:value] [/xsltFile:value] [/out:value] - projectFile Visual Studio Project File containing specs - [/testResult:value] Test Result file generated by MsTest. Defaults to TestResult.trx - [/out:value] Generated Output File. Defaults to TestResult.html - [/xsltFile:value] Xslt file to use, defaults to built-in stylesheet if not provided -+ Visual Studio 2010 editor support: - - syntax coloring with configurable colors ("Gherkin ...") - - outlining for scenarios - Uninstall the beta integration (TechTalk.SpecFlow.VsIntegration.GherkinFile.vsix) before installing - SpecFlow 1.3.3. - -Fixed issues: -+ MbUnit execution fails for pending steps (Assert method not found: Inconclusive) - -1.3.2 - 2010/06/29 - -New features: -+ Support for MsTest for .NET 4.0 categories. Configure the test provider name to - "MsTest.2010" in order to use the [TestCategory] attribute. -+ Silverlight support (beta), see http://wiki.github.com/techtalk/SpecFlow/silverlight-support - -Fixed issues: -+ Report generation fails if no custom XSLT is provided - - -1.3.1 - 2010/06/21 - -New features: -+ Using standard Gherkin parser (http://github.com/aslakhellesoy/gherkin) v2.0.1 -+ Custom XSLT can be specified for generating reports. - See examples in Tests/ReportingTests/CustomXsltTemplate.feature -+ The test error can be accessed through ScenarioContext.Current.TestError - (e.g. in an AfterScenario event). -+ [StepTransformation] attribute has been renamed to [StepArgumentTransformation] - because this name describe the intention better. Using the old attribute will - generate a warning. -+ Support for MbUnit - -Fixed issues: -+ NullReference exception when using BeforeTestRun event (Issue 41) - -1.3.0 - 2010/05/05 - -New features: -+ Using standard Gherkin parser (http://github.com/aslakhellesoy/gherkin) v1.0.24 -+ Context injection in step definitions. Step definitions can get a context injected with - constructor injection. (Issue 30) - See examples in Tests/FeatureTests/ContextInjection -+ Using steps in other assemblies. This enables writing steps in VB. (Issue 19) - See examples in Tests/FeatureTests/ExternalSteps -+ Steps can be invoked from other steps using step text. See examples in - Tests/FeatureTests/CallingStepsFromStepDefinitions -+ Custom step parameter converters can be defined as a binding. - See examples in Tests/FeatureTests/StepArgumentTransfomation -+ SpecFlow feature files can be added also to VB.NET projects -+ Support for xUnit -+ Single installer for Visual Studio 2008 and 2010 (Issue 6, 10, 11) -+ Place GeneratedCodeAttribute and 'Designer generated code' region on generated code to - avoid having this code parsed by code analysis. (Issue 33) -+ Configuration option to disable all output. (Issue 29) - Use the following config to disable output: - - -Fixed issues: -+ SpecFlow Reporting doesn't work with Firefox (Issue 31) -+ Binding methods are executed using the culture of the feature file. -+ Several parsing issues are solved now (Issue 1, 8, 9, 37) - -1.2.0 - 2009/11/25 - -New features: -+ Generate #line pragmas to the output file (Issue 26) -+ Allow transformation of feature files from command-line and MsBuild (Issue 3) -+ Merge all command-line tool (generation, reports) to a single executable: specflow.exe -+ Support for Dutch and Swedish language -+ Support enumerations in step binding arguments (Issue 28) - -Fixed issues: -+ MsTest does not refresh tests automatically (Issue 25) -+ Fixes in report localization -+ Non-string parameters for bindings are not converted using the feature language (Issue 26) - -1.1.0 - 2009/11/11 - -New features: -+ Support for MsTest (Issue 4) -+ Finalize configuration (Issue 13) -+ Support German, French and Hungarian languages (Issue 5) -+ Add strong-name for specflow assemblies (Issue 2) -+ Allow scenario events to be instance methods (Issue 20) -+ More descriptive name for the scenario outline example tests than XYZ_Variant1 (Issue 18) -+ NUnit SpecFlow test execution report (Issue 23) -+ Step definition usage report (Issue 24) - -Fixed issues: -+ Runtime: Remove direct dependency on nunit.framework.dll from the runtime (Issue 12) -+ Runtime: Binding methods with more than 4 parameters cannot be used (Issue 21) -+ Generator: Special language characters (e.g. accented letters) are removed when generating - test method names (Issue 22) - -1.0.2 - 2009/10/20 - -New features: -+ Runtime: allow non-static bindings -+ Runtime: support multiple step attributes on a single binding method - -Fixed issues: -+ VS: Error message is displayed when you add a SpecFlow project item to your project. -+ Parser: mixed order of Given/When/Then is not supported -+ Runtime: the original phrasing of the keywords (Given/And/But) is not preserved -+ Generator: the generated test class has a "Fixture" suffix -+ Parser: specifying any "given" should be optional - - -1.0.1 - 2009/10/13 - -Initial publish on http://www.specflow.org - +1.9.0 - 2012/08/06 + +See detailed feature summary at http://go.specflow.org/whatsnew-19 + +New Features: ++ Visual Studio 2012 support ++ Download IDE integration packages through their own distribution channel: + Visual Studio 2012 and 2010: Visual Studio Gallery (http://go.specflow.org/vsgallery) + MonoDevelop: MonoDevelop Add-in Repository (http://go.specflow.org/monodevelop-addin) + SharpDevelop: download addin and install it from SharpDevelop AddIn Manager (http://go.specflow.org/download-sdaddin) + Visual Studio 2008: download installer (http://go.specflow.org/download-vs2008msi) ++ Visual Studio 2012 generic test runner support ++ Added SpecFlow.xUnit NuGet package ++ Guids can now be used as arguments to step definitions. ++ Any missing characters on a guid in tables or step arguments will be filled with trailing zeroes. ("7" => 70000000-0000-0000-0000-000000000000) ++ Better comparison exceptions when comparing tables to sets. ++ Using standard Gherkin parser (http://github.com/aslakhellesoy/gherkin) v2.6.5 ++ VS2010: Comment and uncomment selection ++ VS2010: Cache analysis result for faster solution startup ++ VS2010: It can now be installed on machines used for SharePoint development ++ Step Definitions without Regular Expressions (underscore style, pascal-case style) ++ F# step definitions (regex method names, Visual Studio integration) ++ SpecFlow.NUnit NuGet package has been split to SpecFlow.NUnit (w/o AddOn for NUnit runner) and SpecFlow.NUnit.Runners (with runner support) ++ ReSharper: editor features (toggle comment, go to step definition, run/debug scenarios) can be used with R# keyboard shortcuts ++ MsTest: Support for MSTest's [Owner] and [WorkItem] attributes with tags like @owner:foo @workitem:123 (Issue 162, Pull 161) ++ NuGet package for creating custom generator extensions: SpecFlow.CustomPlugin ++ VS2010: Integration can track files changed outside of VS (e.g. updated by a SCC pull) ++ VS2010: Collect bindings from assembly references ++ VS2010: Navigation from step definitions to the matching steps (Issue 192) ++ VS2010: Context-dependent navigation (go to step definition / go to steps) with Alt+Ctrl+Shift+S ++ VS2010: Generate missing step definitions from a feature file ++ Support custom step definition skeleton templates (dirrerent style customizable in config, template can be overriden in + "C:\Users\\AppData\Local\SpecFlow\SkeletonTemplates.sftemplate", see http://go.specflow.org/doc-stepdefstyles) (Issue 137, Pull 113) ++ VS2010: Highlight unbound steps and step parameters in the editor (beta, can be switched off in Tools/Options/SpecFlow) (Issue 49, Pull 189, with support of matgiro) ++ Plugin infrastructure ++ The default MsTest unit test provider is changed to the MsTest.2010. If you need to use the MsTest 2008 provider, you have to specify "MsTest.2008". + For newer MsTest providers, you can use "MsTest" (recommended) or "MsTest.2010". + +Fixed issues: ++ VS2010: The message "Step bindings are still being analyzed. Please wait." displayed infinitely (Issue 168) ++ SharePoint: throws errors when creating a test class based on the .feature file generated in SharePoint progress because the content of the file is xml. (Issue 151, Pull 170) ++ VS2010: Formatting table fails if table row does not end with a pipe (Issue 146) ++ Support for missing feature/GenerationTargetLanguage (Issue 163) ++ RuntimePluginLoader: IsAssignableFrom is backwards (Issue 164) ++ VS2010: Specflow options show up as "General" in VS Import/Export settings (Issue 184) ++ Dispose IDisposable user objects created by SpecFlow (Issue 22) + +1.8.1 - 2011/10/25 + +Fixed issues: ++ ReSharper: NUnit scenario outline without tag on example set (rowtest enabled) causes inconclusive result (Issue 116) ++ Step definition with more than 10 parameters causing BindingException (extended now to 20) ++ Run & debug scenarios from the feature file context menu does not work with ReSharper 6 (Issue 138) ++ VS2010 step autocomplete: New steps form external project are not found unless IDE is restarted (Issue 88, by Stanislaw Wozniak) ++ VS2010 step autocomplete: Duplicated steps + +1.8.0 - 2011/10/17 + +Breaking changes: ++ Classes used for context injection must have a single public constructor with maximum parameter count (so far the first constructor was used). ++ After step hook is was not invoked when step definition failed so far. Now it is invoked even in case of a failure. + +New features: ++ Async testing support for Windows Phone 7 (Issue 132, by Jeff Simons) ++ Support for MbUnit v3. Use unit test provider name "mbunit.3". (Issue 133, by Raytheon) ++ SpecFlow framework classes can be used as a dependency for context injection. ++ Custom extensions for the runtime can be specified in the config file (specflow/runtime/dependencies). ++ Better customization possibilities with plugins. ++ [StepScope] attribute can also scope hooks (event bindings) (Issue 95) ++ [StepScope] has been renamed to [Scope]. [StepScope] is kept with obsolete warning. ++ VS2010: Run & debug scenarios from the feature file context menu and solution explorer nodes (feature file, folder, project). ++ VS2010: Use infix word prefix matching for step completion. ++ VS2010: Regenerate feature files from project context menu. ++ VS2010: Go to step definition command in feature file context menu. ++ MsBuild generator can output generated file paths (GeneratedFiles property). The file list is populated to the MsBuild item + @(SpecFlowGeneratedFiles) by the TechTalk.SpecFlow.targets. ++ MsBuild: TechTalk.SpecFlow.targets provides overrideable BeforeUpdateFeatureFilesInProject and AfterUpdateFeatureFilesInProject targets. ++ Cucumber harmonization + + Allow using [Before]/[After] attributes as synonyms of [BeforeScenario]/[AfterScenario] + + Allow using [StepDefinition] attribute that matches to given, when or then steps + + Leading '@' sign can be specified for hooks and [Scope] attribute + +Fixed issues: ++ Instances created for context injection are disposed after scenario execution (Issue 22) ++ Error when opening feature file in VS2008 if VS2008 syntax coloring was enabled. ++ Silverlight: make possible to access SilverlightTest instance (Issue 126, by Matt Ellis) ++ Silverlight: apply feature tags to the test class instead of the methods (Issue 126, by Matt Ellis) ++ SpecFlowContext.TryGetValue does not evaluate Func factory methods (Issue 127, by Matt Ellis) ++ StepArgumentTransformation cannot be used recursively ++ VS2010 locks generator folder ++ After step hook is not invoked when step definition failed. ++ Missing XML comment warnings caused by the generated test class (Issue 121) ++ VS2010: Goto step definition misdiagnoses Given-But as a Then-But (Issue 134, by Raytheon) ++ VS2010: 'Go To Definition' does not work with partial classes. (Issue 53, by Raytheon) ++ AfterTestRun-Hook does not trigger when running in NUnitGui or NUnitConsole. To fix this, you need to add the NUnit addin from + https://raw.github.com/techtalk/SpecFlow/master/Installer/NUnitNuGetPackage/SpecFlowNUnitExtension.cs to the project, or use + the SpecFlow.NUnit combined NuGet package that does this automatically. + +1.7.1 - 2011/08/19 + +Fixed issues: ++ Test execution report displays the feature description instead of the title (Issue 118) ++ Incomprehensible error message when Scenario-description is empty (Issue 117) ++ Assist helpers do not support Singles (Issue 114, by Joe Parkin) ++ Assist helpers do not support unsigned integers (Issue 115, by mdellanoce) ++ The test class is not generated as UTF-8, so some accented characters might be displayed incorrectly. (Issue 112) ++ Fix step definition report broken by v1.7. (Issue 111, by Chris Roff) ++ Intellisense breaks when typing keyword 'E' (And in pt-BR) followed by a space (Issue 109) ++ Intellisense completition removes the non-first words of keywords (e.g. for "Gegeben sei") (Issue 65) ++ Support table delimiter escaping for table formatting (Issue 99) ++ Fixed enum property name match (Issue 119) ++ Added Assist support for byte, float, long, ulong, sbyte, ushort, single. With nullables. (Issue 120) + +1.7.0 - 2011/07/29 + +Breaking changes: ++ There are a few breaking changes in the generated test code. If you upgrade to SpecFlow 1.7, you should either + re-generate the tests, or setup your project to use a version for generating the tests that is compatible with + the runtime you use (see "Using SpecFlow generator from the project's lib folder" feature). + +New features: ++ Using standard Gherkin parser (http://github.com/aslakhellesoy/gherkin) v2.3.6 ++ Using SpecFlow generator from the project's lib folder instead of SpecFlow installed for IDE integration. + The VS2010 integration can be installed independently from projects using a different version. The VS2010 + integration checks the generator in the following paths: + 1. generator path configured in app.config () + 2. generator assembly (TechTalk.SpecFlow.Generator.dll) referenced from the SpecFlow project + 3. generator in the same folder as the runtime (TechTalk.SpecFlow.dll) + 4. generator is near to the runtime ("tools" or "..\tools", relative to the runtime) + 5. generator obtained through NuGet ("..\..\tools", relative to the runtime) + If SpecFlow cannot find the generator or it is older than v1.6.0, the installed SpecFlow generator is used. + If you use any custom plugins (e.g. unit test generator), this has to be in the same folder as the generator + currently. ++ Added ToProjection, ToProjectionOfSet, ToProjectionOfInstance to allow for LINQ-based comparisons. (by Vagif Abilov) ++ Cleaned-up CreateInstance and CreateSet for greater code maintainability. ++ Cleaned-up CompareToInstance and CompareToSet for greater code maintainability, and slightly more accurate value comparisons (like decimals with trailing zeroes). ++ Removed the |Field|Value| requirement for CreateInstance and CompareToInstance. Any header names can be used, so long as the first column is the name of the property and the second column is the value. ++ Can use empty spaces and different casing in the tables used for comparison (i.e. can use |First name| instead of |FirstName| ) ++ Tables used with CreateInstance and CompareToInstance can now be one-row tables with each field as a column (instead of requiring a vertical table with "Field/Value" headers) ++ A default function to create a default instance can be passed to CreateInstance and CreateSet. ++ Syntax coloring support for Visual Studio 2008. Uncheck this option in the installer if you are using cuke4vs. (by Avram Korets) ++ SharpDevelop 4 (#develop) integration. Enable SharpDevelop 4 integration in the installer and use the SharpDevelop AddIn Manager + to install the integration (select addin file from SpecFlow installation folder). (by Charles Weld) ++ Support for testing Silverlight asynchronous code. (by Matt Ellis & Ryan Burnham) + See https://github.com/techtalk/SpecFlow/wiki/Testing-Silverlight-Asynchronous-Code for details. ++ TableRow implements IDictionary ++ Add table row from a (total or partially filled) dictionary ++ Raname table column (Table.RenameColumn(stirng, string)) + +Fixed issues: ++ Installer executes devenv /installtemplates even if VS2008 integration is not selected. ++ Duplicated logic between generator and runtime (generator depends on runtime now) ++ MsTest tests are not properly attached to the right feature (Issue 96) ++ Assist methods now work with classes with multiple properties of the same enum type. ++ Refactor IUnitTestGeneratorProvider interface to be more consistent (Issue 4) + +1.6.1 - 2011/04/15 + +Fixed issues: ++ Windows Phone 7 runtime (TechTalk.SpecFlow.WindowsPhone7.dll) is not included in the NuGet package (Issue 61) ++ Warnings in the generated test classes (Issue 58) ++ Improved tracing for VS2010 integration + +1.6.0 - 2011/04/04 + +Breaking changes: ++ The Silverlight runtime assembly has been renamed to TechTalk.SpecFlow.Silverlight3.dll. + +New features: ++ Added a Set(Func) extension method. The Func method will be invoked whenever ScenarioContext.Current.Get is called. ++ Support for tagging (including @ignore) scenario outline examples. + NUnit and MbUnit: to filter for categories generated for the examples in the unit test runner, you need to + switch off row test generaiton () ++ Using standard Gherkin parser (http://github.com/aslakhellesoy/gherkin) v2.3.5 ++ Support for converting table and multi-line text arguments with [StepArgumentTransformation] (by Chris Roff, roffster) + See examples in Tests/FeatureTests/StepArgumentTransfomation ++ VS2010: Support for specifying color for the step text ++ Added a FillInstance(T) extension method off of Table. When passed an instance of T, it will fill the instance with values from the table (like CreateInstance). ++ VS2010: Re-generate feature file when the configuration has changed or a new version of SpecFlow is installed ++ VS2010: Improved intellisense for steps ++ VS2010: Intellisense for keywords ++ VS2010: "go to binding" ++ VS2010: Automatic table formatting when "|" is typed ++ VS2010: Tracing can be configured from tools / options. The environment variable SPECFLOW_TRACE is not used anymore. ++ Windows Phone 7 support, see https://github.com/techtalk/SpecFlow/wiki/Windows-Phone-7-Support (by Max Paulousky) ++ Silverlight runtime can be configured from query string (by Matt Ellis) ++ Generate test parameters from scenario outline parameters and example set name for MsTest (by Qingsong Yao) ++ Isolated test generator interface (can be used later for using the generator of the project instead of the generator of the IDE integration) ++ Official NuGet integration (by Daniel Sack) + +Fixed issues: ++ Scenario with only "*" steps fails with "System.ArgumentException: Unable to convert block to binding type" ++ Binding is reported as invalid if there is a matching step definition with different scope ++ Support for datetime comparisons that ignore 12:00:00 AM (issue 52) ++ Fix NUnit execution report to properly select features when .features is solely comprised Scenario Outlines. + (by Jon Archer) ++ Tags applied at the feature level are now applied as Silverlight TagAttributes on the class. (by Matt Ellis, citizenmatt) ++ Rethrowing exceptions caught during steps would lose the call stack on Silverlight. (by Matt Ellis, citizenmatt) ++ SpecFlow emits an erroneous suggestion for the step bindings in VB.NET (Issue 32) ++ Refactored VS2010 intagration to better maintanability ++ Refactored CreateSet and CompareToSet extension methods to use the same logic as CreateInstance and CompareToInstance. ++ Step Intellisense doesn't show in Feature Background (Issue 23) ++ Xunit Theory Attribute/InlineAttribute using incorrect namespace. (Issue 40, by Kerry Jones) ++ Scenario Outline - Multiple Scenarios table header row VS formatting issue (Issue 16) ++ SpecFlow step definition report generator throws unhandled exception when a scenario starts with "And" (Issue 45) ++ VS2010: SpecFlow writes out feature and code-behind files with inconsistent line endings (Issue 28) ++ Step definitions can be implemented in abstract base classes (but the abstract base class must not have the [Binding] attribute). SpecFlow no longer tries to instantiate the abstract base class. (Issue 47) + +1.5.0 - 2010/12/17 + +Breaking changes: ++ Changing the default value (true) of the allowRowTests configuration setting is not incompatible with older + runtimes. + +New features: ++ Step Intellisense for Visual Studio 2010 - displays the list of bound steps when pressing space or ctrl+space + after a step keyword + (Thanks to Marcus Hammarberg for the contribution.) ++ Options for Visual Studio 2010 - you can enable/disable the integration features (syntax coloring, outlining, + intellisense) in Visual Studio 2010, Tools / Options / SpecFlow / General ++ Faster installation for VS2010 - if you install SpecFlow only to VS2010, the installation is much faster + as we now entirely using the new VSIX infrastructure for the integaration. ++ Support for row test generation (NUnit, MbUnit and xUnit). This new feature is enabled by default, but can + be switched off from the configuration with . + (Thanks to John Gietzen (otac0n) for the contribution.) ++ Support for specifying property names with blanks and case insensitive for SpecFlow.Assist (by Steven Zhang, jdomzhang) + +Fixed issues: ++ Scoped Steps does not recognize feature tags (Issue 12) ++ Support for double and nullable types in table-helpers of SpecFlow.Assist ++ Support for enum parsing in table-helpers of SpecFlow.Assist ++ Adding comparison helpers to SpecFlow.Assist (by darrencauthon) ++ Support for char parsing in table-helpers of SpecFlow.Assist (Issue 19) ++ VS2010 might crash after pasting into a feature file ++ Excution report should list features ordered by feature title + +1.4.0 - 2010/10/07 + +Breaking changes: ++ The generator has been improved to provide source code language. Because of this, SpecFlow test generated + with this version will be incompatible with older runtimes. + +New features: ++ Scoped Step Definitions: you can scope step definitions (bindings) to tags, features and scenarios. Scope filter + can be applied to a class or a method with the [StepScope] attribute. + See examples in Tests/FeatureTests/ScopedSteps/ScopedSteps.feature and Tests/FeatureTests/ScopedSteps/ScopedStepsBindings.cs + (Thanks to Jose Simas for the contribution.) ++ Adding binding-culture to App.config. If set, this culture is used during execution of steps. ++ VB-Step-Definition Skeleton Provider: For VB-projects, the suggested step skeletons are generated in VB. ++ Merging strongly typed context accessors from Darren Cauthon's SpecFlowAssist ++ Merging table/row extension methods from Darren Cauthon's SpecFlowAssist + Add a using statement for the namespace TechTalk.SpecFlow.Assist to use the extension methods. + See also Darren's youtube tutorial: http://bit.ly/aY4VOd ++ Diagnostic tracing: VS2010 integration can display trace messages to the Output window + if tracing is enabled. Tracing can be enabled by setting the environment variable SPECFLOW_TRACE + to either "all" or to the comma separated list of individual SpecFlow traing categories (currently + only the category "EditorParser" is supported). + +Fixed issues: ++ Better error reporting for wrong Gherkin files (multiple errors displayed, detect duplicate scenario names) ++ Visual Studio 2010 editor slows down after editing a feature file for a longer time (Issue 9) + +1.3.5.2 - 2010/08/11 + +Fixed issues: ++ Sorry, we're ironing out our deploy strategy with the new Mono/MonoDevelop integration. We didn't + change the version in the MonoDevelop Add-In XML file. + +1.3.5.1 - 2010/08/11 + +New features: ++ Support for hosting add-in on http://addins.monodevelop.com + +1.3.5 - 2010/08/11 + +New features: ++ Support for Mono (v2.6.7) & MonoDevelop (v2.4) by Dale Ragan + +Fixed issues: ++ Generating code randomly for the wrong testing engine ++ Test class generation problem for Russian feature files ++ Fix tag support for Silverlight + +1.3.4 - 2010/07/28 + +Fixed issues: ++ Installation fails if Visual Studio 2010 is not installed ++ VS2010: Background section is not colored properly + +1.3.3 - 2010/07/19 + +New features: ++ Support for MsTest report generation + usage: specflow mstestexecutionreport projectFile [/testResult:value] [/xsltFile:value] [/out:value] + projectFile Visual Studio Project File containing specs + [/testResult:value] Test Result file generated by MsTest. Defaults to TestResult.trx + [/out:value] Generated Output File. Defaults to TestResult.html + [/xsltFile:value] Xslt file to use, defaults to built-in stylesheet if not provided ++ Visual Studio 2010 editor support: + - syntax coloring with configurable colors ("Gherkin ...") + - outlining for scenarios + Uninstall the beta integration (TechTalk.SpecFlow.VsIntegration.GherkinFile.vsix) before installing + SpecFlow 1.3.3. + +Fixed issues: ++ MbUnit execution fails for pending steps (Assert method not found: Inconclusive) + +1.3.2 - 2010/06/29 + +New features: ++ Support for MsTest for .NET 4.0 categories. Configure the test provider name to + "MsTest.2010" in order to use the [TestCategory] attribute. ++ Silverlight support (beta), see http://wiki.github.com/techtalk/SpecFlow/silverlight-support + +Fixed issues: ++ Report generation fails if no custom XSLT is provided + + +1.3.1 - 2010/06/21 + +New features: ++ Using standard Gherkin parser (http://github.com/aslakhellesoy/gherkin) v2.0.1 ++ Custom XSLT can be specified for generating reports. + See examples in Tests/ReportingTests/CustomXsltTemplate.feature ++ The test error can be accessed through ScenarioContext.Current.TestError + (e.g. in an AfterScenario event). ++ [StepTransformation] attribute has been renamed to [StepArgumentTransformation] + because this name describe the intention better. Using the old attribute will + generate a warning. ++ Support for MbUnit + +Fixed issues: ++ NullReference exception when using BeforeTestRun event (Issue 41) + +1.3.0 - 2010/05/05 + +New features: ++ Using standard Gherkin parser (http://github.com/aslakhellesoy/gherkin) v1.0.24 ++ Context injection in step definitions. Step definitions can get a context injected with + constructor injection. (Issue 30) + See examples in Tests/FeatureTests/ContextInjection ++ Using steps in other assemblies. This enables writing steps in VB. (Issue 19) + See examples in Tests/FeatureTests/ExternalSteps ++ Steps can be invoked from other steps using step text. See examples in + Tests/FeatureTests/CallingStepsFromStepDefinitions ++ Custom step parameter converters can be defined as a binding. + See examples in Tests/FeatureTests/StepArgumentTransfomation ++ SpecFlow feature files can be added also to VB.NET projects ++ Support for xUnit ++ Single installer for Visual Studio 2008 and 2010 (Issue 6, 10, 11) ++ Place GeneratedCodeAttribute and 'Designer generated code' region on generated code to + avoid having this code parsed by code analysis. (Issue 33) ++ Configuration option to disable all output. (Issue 29) + Use the following config to disable output: + + +Fixed issues: ++ SpecFlow Reporting doesn't work with Firefox (Issue 31) ++ Binding methods are executed using the culture of the feature file. ++ Several parsing issues are solved now (Issue 1, 8, 9, 37) + +1.2.0 - 2009/11/25 + +New features: ++ Generate #line pragmas to the output file (Issue 26) ++ Allow transformation of feature files from command-line and MsBuild (Issue 3) ++ Merge all command-line tool (generation, reports) to a single executable: specflow.exe ++ Support for Dutch and Swedish language ++ Support enumerations in step binding arguments (Issue 28) + +Fixed issues: ++ MsTest does not refresh tests automatically (Issue 25) ++ Fixes in report localization ++ Non-string parameters for bindings are not converted using the feature language (Issue 26) + +1.1.0 - 2009/11/11 + +New features: ++ Support for MsTest (Issue 4) ++ Finalize configuration (Issue 13) ++ Support German, French and Hungarian languages (Issue 5) ++ Add strong-name for specflow assemblies (Issue 2) ++ Allow scenario events to be instance methods (Issue 20) ++ More descriptive name for the scenario outline example tests than XYZ_Variant1 (Issue 18) ++ NUnit SpecFlow test execution report (Issue 23) ++ Step definition usage report (Issue 24) + +Fixed issues: ++ Runtime: Remove direct dependency on nunit.framework.dll from the runtime (Issue 12) ++ Runtime: Binding methods with more than 4 parameters cannot be used (Issue 21) ++ Generator: Special language characters (e.g. accented letters) are removed when generating + test method names (Issue 22) + +1.0.2 - 2009/10/20 + +New features: ++ Runtime: allow non-static bindings ++ Runtime: support multiple step attributes on a single binding method + +Fixed issues: ++ VS: Error message is displayed when you add a SpecFlow project item to your project. ++ Parser: mixed order of Given/When/Then is not supported ++ Runtime: the original phrasing of the keywords (Given/And/But) is not preserved ++ Generator: the generated test class has a "Fixture" suffix ++ Parser: specifying any "given" should be optional + + +1.0.1 - 2009/10/13 + +Initial publish on http://www.specflow.org + diff --git a/lib/sqlce/EULA_ENU.rtf b/lib/sqlce/EULA_ENU.rtf index 7e5bc3a5a4e..b666bf64c00 100644 --- a/lib/sqlce/EULA_ENU.rtf +++ b/lib/sqlce/EULA_ENU.rtf @@ -1,778 +1,778 @@ -{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff38\deff0\stshfdbch11\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033\themelang1033\themelangfe2052\themelangcs1025{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};} -{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New{\*\falt Arial};}{\f3\fbidi \froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol{\*\falt Bookshelf Symbol 3};} -{\f10\fbidi \fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings{\*\falt Symbol};}{\f11\fbidi \fmodern\fcharset128\fprq1{\*\panose 02020609040205080304}MS Mincho{\*\falt ?l?r ??\'81\'66c};} -{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt ????\'a1\'a7???};}{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt ????\'a1\'a7???};} -{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma{\*\falt ?? ??};}{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0603020202020204}Trebuchet MS{\*\falt Arial};} -{\f40\fbidi \fmodern\fcharset128\fprq1{\*\panose 00000000000000000000}@MS Mincho{\*\falt @MS Gothic};}{\f41\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@SimSun;} -{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt ????\'a1\'a7???};} -{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};} -{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt ????\'a1\'a7???};} -{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}{\f42\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};} -{\f43\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\f45\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};}{\f46\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};} -{\f47\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};}{\f48\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}{\f49\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};} -{\f50\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\f62\fbidi \fmodern\fcharset238\fprq1 Courier New CE{\*\falt Arial};}{\f63\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr{\*\falt Arial};} -{\f65\fbidi \fmodern\fcharset161\fprq1 Courier New Greek{\*\falt Arial};}{\f66\fbidi \fmodern\fcharset162\fprq1 Courier New Tur{\*\falt Arial};}{\f67\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew){\*\falt Arial};} -{\f68\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic){\*\falt Arial};}{\f69\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic{\*\falt Arial};}{\f70\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese){\*\falt Arial};} -{\f154\fbidi \fmodern\fcharset0\fprq1 MS Mincho Western{\*\falt ?l?r ??\'81\'66c};}{\f152\fbidi \fmodern\fcharset238\fprq1 MS Mincho CE{\*\falt ?l?r ??\'81\'66c};}{\f153\fbidi \fmodern\fcharset204\fprq1 MS Mincho Cyr{\*\falt ?l?r ??\'81\'66c};} -{\f155\fbidi \fmodern\fcharset161\fprq1 MS Mincho Greek{\*\falt ?l?r ??\'81\'66c};}{\f156\fbidi \fmodern\fcharset162\fprq1 MS Mincho Tur{\*\falt ?l?r ??\'81\'66c};}{\f159\fbidi \fmodern\fcharset186\fprq1 MS Mincho Baltic{\*\falt ?l?r ??\'81\'66c};} -{\f174\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt ????\'a1\'a7???};}{\f174\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt ????\'a1\'a7???};}{\f422\fbidi \fswiss\fcharset238\fprq2 Tahoma CE{\*\falt ?? ??};} -{\f423\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr{\*\falt ?? ??};}{\f425\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek{\*\falt ?? ??};}{\f426\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur{\*\falt ?? ??};} -{\f427\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew){\*\falt ?? ??};}{\f428\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic){\*\falt ?? ??};}{\f429\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic{\*\falt ?? ??};} -{\f430\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese){\*\falt ?? ??};}{\f431\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai){\*\falt ?? ??};}{\f432\fbidi \fswiss\fcharset238\fprq2 Trebuchet MS CE{\*\falt Arial};} -{\f433\fbidi \fswiss\fcharset204\fprq2 Trebuchet MS Cyr{\*\falt Arial};}{\f435\fbidi \fswiss\fcharset161\fprq2 Trebuchet MS Greek{\*\falt Arial};}{\f436\fbidi \fswiss\fcharset162\fprq2 Trebuchet MS Tur{\*\falt Arial};} -{\f439\fbidi \fswiss\fcharset186\fprq2 Trebuchet MS Baltic{\*\falt Arial};}{\f444\fbidi \fmodern\fcharset0\fprq1 @MS Mincho Western{\*\falt @MS Gothic};}{\f442\fbidi \fmodern\fcharset238\fprq1 @MS Mincho CE{\*\falt @MS Gothic};} -{\f443\fbidi \fmodern\fcharset204\fprq1 @MS Mincho Cyr{\*\falt @MS Gothic};}{\f445\fbidi \fmodern\fcharset161\fprq1 @MS Mincho Greek{\*\falt @MS Gothic};}{\f446\fbidi \fmodern\fcharset162\fprq1 @MS Mincho Tur{\*\falt @MS Gothic};} -{\f449\fbidi \fmodern\fcharset186\fprq1 @MS Mincho Baltic{\*\falt @MS Gothic};}{\f454\fbidi \fnil\fcharset0\fprq2 @SimSun Western;}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};} -{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};} -{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};} -{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};} -{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt ????\'a1\'a7???};}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;} -{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;} -{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};} -{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};} -{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};} -{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};} -{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};} -{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};} -{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};} -{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};} -{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt ????\'a1\'a7???};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;} -{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;} -{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \fswiss\fcharset238\fprq2 Arial CE;} -{\fbiminor\f31579\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}{\fbiminor\f31581\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\fbiminor\f31582\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\fbiminor\f31583\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);} -{\fbiminor\f31584\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}{\fbiminor\f31585\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\fbiminor\f31586\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255; -\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0; -\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red31\green73\blue125;\ctextone\ctint255\cshade255\red0\green0\blue0;}{\*\defchp \fs22\dbch\af11 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1 -\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \snext0 \sautoupd \sqformat \spriority0 \styrsid1456345 Normal;}{\s1\ql \fi-357\li357\ri0\sb120\sa120\widctlpar -\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls12\outlinelevel0\adjustright\rin0\lin357\itap0 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext1 \slink15 \sqformat \styrsid1456345 heading 1;}{\s2\ql \fi-363\li720\ri0\sb120\sa120\widctlpar\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl1\outlinelevel1\adjustright\rin0\lin720\itap0 \rtlch\fcs1 -\ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext2 \slink16 \sqformat \styrsid1456345 heading 2;}{\s3\ql \fi-357\li1077\ri0\sb120\sa120\widctlpar -\tx1077\jclisttab\tx1440\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl2\outlinelevel2\adjustright\rin0\lin1077\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext3 \slink17 \sqformat \styrsid1456345 heading 3;}{\s4\ql \fi-358\li1435\ri0\sb120\sa120\widctlpar\jclisttab\tx1437\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl3\outlinelevel3\adjustright\rin0\lin1435\itap0 \rtlch\fcs1 -\af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext4 \slink18 \sqformat \styrsid1456345 heading 4;}{\s5\ql \fi-357\li1792\ri0\sb120\sa120\widctlpar -\tx1792\jclisttab\tx2155\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl4\outlinelevel4\adjustright\rin0\lin1792\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext5 \slink19 \sqformat \styrsid1456345 heading 5;}{\s6\ql \fi-357\li2149\ri0\sb120\sa120\widctlpar\jclisttab\tx2152\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl5\outlinelevel5\adjustright\rin0\lin2149\itap0 \rtlch\fcs1 -\af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext6 \slink20 \sqformat \styrsid1456345 heading 6;}{\s7\ql \fi-357\li2506\ri0\sb120\sa120\widctlpar -\jclisttab\tx2509\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl6\outlinelevel6\adjustright\rin0\lin2506\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext7 \slink21 \sqformat \styrsid1456345 heading 7;}{\s8\ql \fi-357\li2863\ri0\sb120\sa120\widctlpar\jclisttab\tx2866\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl7\outlinelevel7\adjustright\rin0\lin2863\itap0 \rtlch\fcs1 -\af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext8 \slink22 \sqformat \styrsid1456345 heading 8;}{\s9\ql \fi-358\li3221\ri0\sb120\sa120\widctlpar -\jclisttab\tx3223\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl8\outlinelevel8\adjustright\rin0\lin3221\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext9 \slink23 \sqformat \styrsid1456345 heading 9;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\* -\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1 -\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe1033\loch\f0\hich\af0\dbch\af11\cgrid\langnp1033\langfenp1033 \snext11 \ssemihidden \sunhideused Normal Table;}{\* -\cs15 \additive \rtlch\fcs1 \ab\af38\afs19 \ltrch\fcs0 \b\f38\fs19 \sbasedon10 \slink1 \slocked \styrsid1456345 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\af38\afs19 \ltrch\fcs0 \b\f38\fs19 \sbasedon10 \slink2 \slocked \styrsid1456345 -Heading 2 Char;}{\*\cs17 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 \sbasedon10 \slink3 \slocked \styrsid1456345 Heading 3 Char;}{\*\cs18 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 \sbasedon10 \slink4 \slocked \styrsid1456345 -Heading 4 Char;}{\*\cs19 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 \sbasedon10 \slink5 \slocked \styrsid1456345 Heading 5 Char;}{\*\cs20 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 \sbasedon10 \slink6 \slocked \styrsid1456345 -Heading 6 Char;}{\*\cs21 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 \sbasedon10 \slink7 \slocked \styrsid1456345 Heading 7 Char;}{\*\cs22 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 \sbasedon10 \slink8 \slocked \styrsid1456345 -Heading 8 Char;}{\*\cs23 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 \sbasedon10 \slink9 \slocked \styrsid1456345 Heading 9 Char;}{\s24\ql \li357\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin357\itap0 -\rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext24 \styrsid1456345 Body 1;}{ -\s25\ql \li720\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext25 \styrsid1456345 Body 2;}{\s26\ql \li1077\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin1077\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext26 \styrsid1456345 Body 3;}{\s27\ql \li1435\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin1435\itap0 \rtlch\fcs1 -\af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext27 \styrsid1456345 Body 4;}{ -\s28\ql \li1803\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin1803\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext28 \styrsid1456345 Body 5;}{\s29\ql \li2160\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin2160\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext29 \styrsid1456345 Body 6;}{\s30\ql \li2506\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin2506\itap0 \rtlch\fcs1 -\af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext30 \styrsid1456345 Body 7;}{ -\s31\ql \li2863\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin2863\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext31 \styrsid1456345 Body 8;}{\s32\ql \li3221\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin3221\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext32 \styrsid1456345 Body 9;}{\s33\ql \fi-357\li357\ri0\sb120\sa120\widctlpar -\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls1\adjustright\rin0\lin357\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext33 \styrsid1456345 -Bullet 1;}{\s34\ql \fi-363\li720\ri0\sb120\sa120\widctlpar\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin720\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext34 \styrsid1456345 Bullet 2;}{\s35\ql \fi-357\li1077\ri0\sb120\sa120\widctlpar -\jclisttab\tx1080\wrapdefault\aspalpha\aspnum\faauto\ls3\adjustright\rin0\lin1077\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext35 \slink87 \styrsid1456345 Bullet 3;}{\s36\ql \fi-358\li1435\ri0\sb120\sa120\widctlpar\jclisttab\tx1437\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin1435\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext36 \styrsid1456345 Bullet 4;}{\s37\ql \fi-357\li1792\ri0\sb120\sa120\widctlpar -\jclisttab\tx1795\wrapdefault\aspalpha\aspnum\faauto\ls5\adjustright\rin0\lin1792\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext37 \styrsid1456345 -Bullet 5;}{\s38\ql \fi-357\li2149\ri0\sb120\sa120\widctlpar\jclisttab\tx2152\wrapdefault\aspalpha\aspnum\faauto\ls6\adjustright\rin0\lin2149\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext38 \styrsid1456345 Bullet 6;}{\s39\ql \fi-357\li2506\ri0\sb120\sa120\widctlpar -\jclisttab\tx2509\wrapdefault\aspalpha\aspnum\faauto\ls7\adjustright\rin0\lin2506\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext39 \styrsid1456345 -Bullet 7;}{\s40\ql \fi-357\li2863\ri0\sb120\sa120\widctlpar\jclisttab\tx2866\wrapdefault\aspalpha\aspnum\faauto\ls8\adjustright\rin0\lin2863\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext40 \styrsid1456345 Bullet 8;}{\s41\ql \fi-358\li3221\ri0\sb120\sa120\widctlpar -\jclisttab\tx3223\wrapdefault\aspalpha\aspnum\faauto\ls9\adjustright\rin0\lin3221\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon32 \snext41 \styrsid1456345 Bullet 9;}{\s42\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af38\afs28\alang1025 \ltrch\fcs0 -\b\fs28\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \styrsid1456345 Heading EULA;}{\s43\ql \li0\ri0\sb120\sa120\widctlpar\brdrb\brdrs\brdrw10\brsp20 -\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af38\afs28\alang1025 \ltrch\fcs0 \b\fs28\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \styrsid1456345 -Heading Software Title;}{\s44\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 -\b\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext44 \styrsid1456345 Preamble;}{\s45\ql \li0\ri0\sb120\sa120\widctlpar\brdrb\brdrs\brdrw10\brsp20 -\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext1 \styrsid1456345 Preamble Border;}{ -\s46\qc \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext46 \styrsid1456345 Heading Warranty;}{\s47\ql \fi-360\li360\ri0\sb120\sa120\widctlpar\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls11\outlinelevel0\adjustright\rin0\lin360\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \styrsid1456345 Heading 1 Warranty;}{\s48\ql \fi-360\li720\ri0\sb120\sa120\widctlpar -\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls11\ilvl1\outlinelevel1\adjustright\rin0\lin720\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext0 \styrsid1456345 Heading 2 Warranty;}{\s49\ql \fi-357\li1077\ri0\sb120\sa120\widctlpar\tx1077\jclisttab\tx1440\wrapdefault\aspalpha\aspnum\faauto\ls10\ilvl2\outlinelevel2\adjustright\rin0\lin1077\itap0 \rtlch\fcs1 -\ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon3 \snext49 \styrsid1456345 Heading 3 Bold;}{\s50\ql \fi-358\li1435\ri0\sb120\sa120\widctlpar -\jclisttab\tx1437\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin1435\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\ul\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon36 \snext50 \styrsid1456345 Bullet 4 Underline;}{\s51\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\ul\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon35 \snext51 \styrsid1456345 Bullet 3 Underline;}{\s52\ql \li720\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 -\rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\ul\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon25 \snext52 \styrsid1456345 Body 2 Underline;}{ -\s53\ql \li1077\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin1077\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\ul\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon26 \snext53 \styrsid1456345 Body 3 Underline;}{\s54\ql \li0\ri0\sb120\sa120\sl480\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext54 \slink55 \styrsid1456345 Body Text Indent;}{\*\cs55 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 -\sbasedon10 \slink54 \slocked \ssemihidden \styrsid1456345 Body Text Indent Char;}{\s56\ql \fi-358\li1435\ri0\sb120\sa120\widctlpar\jclisttab\tx1437\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin1435\itap0 \rtlch\fcs1 -\ai\af38\afs19\alang1025 \ltrch\fcs0 \i\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon36 \snext56 \styrsid1456345 Bullet 4 Italics;}{\*\cs57 \additive \rtlch\fcs1 \af38 \ltrch\fcs0 -\f38\lang1033\langfe1033\langnp1033\langfenp1033 \sbasedon10 \styrsid1456345 Body 2 Char;}{\*\cs58 \additive \rtlch\fcs1 \af38 \ltrch\fcs0 \f38\lang1033\langfe1033\langnp1033\langfenp1033 \sbasedon10 \styrsid1456345 Body 3 Char;}{\*\cs59 \additive -\rtlch\fcs1 \af38 \ltrch\fcs0 \f38\lang1033\langfe1033\langnp1033\langfenp1033 \sbasedon10 \styrsid1456345 Body 4 Char;}{\*\cs60 \additive \rtlch\fcs1 \af38 \ltrch\fcs0 \f38\lang1033\langfe1033\langnp1033\langfenp1033 \sbasedon10 \styrsid1456345 -Body 1 Char;}{\s61\ql \li0\ri0\sb120\sa120\widctlpar\brdrt\brdrs\brdrw10\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 -\b\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon44 \snext61 \styrsid1456345 Preamble Border Above;}{\s62\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 -\rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext62 \slink63 \ssemihidden \styrsid1456345 footnote text;}{\*\cs63 \additive \rtlch\fcs1 \af38\afs20 -\ltrch\fcs0 \f38\fs20 \sbasedon10 \slink62 \slocked \ssemihidden \styrsid1456345 Footnote Text Char;}{\*\cs64 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \super \sbasedon10 \ssemihidden \styrsid1456345 footnote reference;}{ -\s65\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext65 \slink66 \ssemihidden \styrsid1456345 endnote text;}{\*\cs66 \additive \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f38\fs20 \sbasedon10 \slink65 \slocked \ssemihidden \styrsid1456345 Endnote Text Char;}{\*\cs67 \additive \rtlch\fcs1 \af0 -\ltrch\fcs0 \super \sbasedon10 \ssemihidden \styrsid1456345 endnote reference;}{\s68\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext68 \slink69 \ssemihidden \styrsid1456345 annotation text;}{\*\cs69 \additive \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f38\fs20 -\sbasedon10 \slink68 \slocked \ssemihidden \styrsid1456345 Comment Text Char;}{\*\cs70 \additive \rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 \sbasedon10 \ssemihidden \styrsid1456345 annotation reference;}{\s71\ql \li0\ri0\sa160\sl-240\slmult0 -\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext71 \styrsid1456345 Char;}{ -\s72\ql \li0\ri0\sa160\sl-240\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext72 \styrsid1456345 Char Char Char Char;}{\*\cs73 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \ul\cf2 \sbasedon10 \styrsid1456345 Hyperlink;}{\s74\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 -\rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0 \fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext74 \slink75 \ssemihidden \styrsid1456345 Balloon Text;}{\*\cs75 \additive \rtlch\fcs1 \af38\afs16 -\ltrch\fcs0 \f38\fs16 \sbasedon10 \slink74 \slocked \ssemihidden \styrsid1456345 Balloon Text Char;}{\*\cs76 \additive \rtlch\fcs1 \ab\af39 \ltrch\fcs0 \b\f39\lang1033\langfe1033\langnp1033\langfenp1033 \sbasedon10 \styrsid1456345 Heading 2 Char1;}{\* -\cs77 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \sbasedon10 \styrsid1456345 page number;}{\s78\ql \li0\ri0\sa160\sl-240\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext78 \styrsid1456345 Char Char Char Char1;}{\s79\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 -\ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \snext0 \styrsid1456345 Body 0 Bold;}{\s80\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 -\rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \snext0 \styrsid1456345 Body 0;}{\s81\ql \li0\ri0\sb120\sa120\widctlpar -\tqc\tx4320\tqr\tx8640\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext81 \slink82 \styrsid1456345 header;}{\*\cs82 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 \sbasedon10 \slink81 \slocked \styrsid1456345 Header Char;}{\s83\ql \li0\ri0\sb120\sa120\widctlpar -\tqc\tx4320\tqr\tx8640\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext83 \slink84 \styrsid1456345 footer;}{\*\cs84 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 \sbasedon10 \slink83 \slocked \ssemihidden \styrsid1456345 Footer Char;}{ -\s85\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af38\afs20\alang1025 \ltrch\fcs0 \b\fs20\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon68 \snext68 \slink86 \ssemihidden \sunhideused \styrsid1456345 annotation subject;}{\*\cs86 \additive \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\f38\fs20 \sbasedon69 \slink85 \slocked \ssemihidden \styrsid1456345 Comment Subject Char;}{\*\cs87 -\additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 \sbasedon10 \slink35 \slocked \styrsid1456345 Bullet 3 Char1;}{\s88\ql \fi-357\li1077\ri0\sb120\sa120\widctlpar\jclisttab\tx1080\wrapdefault\aspalpha\aspnum\faauto\ls3\adjustright\rin0\lin1077\itap0 -\rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\ul\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon35 \snext88 \styrsid1456345 Bullet 3 Underlined;}{\*\cs89 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\langnp1033\langfenp1033 \sbasedon10 \styrsid1456345 Char Char;}{\s90\ql \li0\ri0\sl-240\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 -\af38\afs20\alang1025 \ltrch\fcs0 \fs18\lang1033\langfe1033\loch\f39\hich\af39\dbch\af11\cgrid\langnp1033\langfenp1033 \snext90 \spriority0 \styrsid1456345 AdditionalSoftware;}{\*\cs91 \additive \rtlch\fcs1 \af38\afs24\alang1025 \ltrch\fcs0 -\b\f39\fs24\lang1033\langfe1033\langnp1033\langfenp1033 \sbasedon10 \spriority0 \styrsid1456345 Char Char1;}{\s92\ql \fi-358\li1435\ri0\sb120\sa120\widctlpar\jclisttab\tx1437\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin1435\itap0 -\rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\ul\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon36 \snext92 \spriority0 \styrsid1456345 Bullet 4 Underlined;}{\s93\ql \fi-360\li360\ri0\sb120\sa120\widctlpar -\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls31\adjustright\rin0\lin360\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 -\sbasedon0 \snext93 \spriority0 \styrsid1456345 Heading French Warranty;}{\s94\ql \li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\contextualspace \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 -\fs22\lang1033\langfe1033\loch\f31506\hich\af31506\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext94 \sqformat \spriority34 \styrsid921734 List Paragraph;}}{\*\listtable{\list\listtemplateid1821544400\listhybrid{\listlevel\levelnfc23\levelnfcn23 -\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 -\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1380\jclisttab\tx1380\lin1380 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 -{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2100\jclisttab\tx2100\lin2100 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext -\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2820\jclisttab\tx2820\lin2820 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext -\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3540\jclisttab\tx3540\lin3540 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693 -\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4260\jclisttab\tx4260\lin4260 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689 -\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li4980\jclisttab\tx4980\lin4980 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691 -\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5700\jclisttab\tx5700\lin5700 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693 -\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6420\jclisttab\tx6420\lin6420 }{\listname ;}\listid189493747}{\list\listtemplateid176468498\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0 -\levelindent0{\leveltext\leveltemplateid692200086\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \s41\fi-358\li3221\jclisttab\tx3223\lin3221 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693 -\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;} -\f3\fbias0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600 -\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 } -{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23 -\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 -\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid196815738}{\list\listtemplateid-1793664660{\listlevel\levelnfc3 -\levelnfcn3\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab\ai0\af0 \ltrch\fcs0 \b\i0\fbias0 \s47\fi-360\li360\jclisttab\tx360\lin360 }{\listlevel\levelnfc0\levelnfcn0 -\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab\ai0\af0 \ltrch\fcs0 \b\i0\fbias0 \s48\fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0 -\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'02);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li1080\jclisttab\tx1080\lin1080 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1 -\levelspace0\levelindent0{\leveltext\'03(\'03);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 -{\leveltext\'03(\'04);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li1800\jclisttab\tx1800\lin1800 }{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\'03(\'05);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;} -\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li2520\jclisttab\tx2520\lin2520 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 -\fbias0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li3240 -\jclisttab\tx3240\lin3240 }{\listname ;}\listid394402059}{\list\listtemplateid1928476992{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 -\ab\ai0\af39\afs20 \ltrch\fcs0 \b\i0\f39\fs20\fbias0 \fi-357\li357\jclisttab\tx360\lin357 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 -\ab\ai0\af39\afs20 \ltrch\fcs0 \b\i0\f39\fs20\fbias0 \fi-363\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 -\ab\ai0\af38\afs20 \ltrch\fcs0 \b\i0\f38\fs20\fbias0 \s49\fi-357\li1077\jclisttab\tx1440\lin1077 }{\listlevel\levelnfc3\levelnfcn3\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 -\ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\strike0\f39\fs20\ulnone\fbias0 \fi-358\li1435\jclisttab\tx1437\lin1435 }{\listlevel\levelnfc1\levelnfcn1\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'04.;}{\levelnumbers -\'01;}\rtlch\fcs1 \ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\strike0\f39\fs20\ulnone\fbias0 \fi-357\li1792\jclisttab\tx2155\lin1792 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\f39\fs20\fbias0 \fi-357\li2149\jclisttab\tx2152\lin2149 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\f39\fs20\fbias0 \fi-357\li2506\jclisttab\tx2509\lin2506 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 -{\leveltext\'02i.;}{\levelnumbers;}\rtlch\fcs1 \ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\f39\fs20\fbias0 \fi-357\li2863\jclisttab\tx2866\lin2863 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 -{\leveltext\'02A.;}{\levelnumbers;}\rtlch\fcs1 \ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\f39\fs20\fbias0 \fi-358\li3221\jclisttab\tx3223\lin3221 }{\listname ;}\listid398796681}{\list\listtemplateid789093748\listhybrid{\listlevel\levelnfc23\levelnfcn23 -\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid-317712510\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \s34\fi-363\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 -\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0 -\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691 -\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;} -\f10\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040 -\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel -\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid477573462} -{\list\listtemplateid-53848358{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab\ai0\af38\afs20 \ltrch\fcs0 \b\i0\f38\fs20\fbias0 \s1 -\fi-357\li357\jclisttab\tx360\lin357 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab\ai0\af38\afs20 \ltrch\fcs0 \b\i0\f38\fs20\fbias0 \s2 -\fi-363\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab\ai0\af38\afs20 \ltrch\fcs0 \b\i0\f38\fs20\fbias0 \s3 -\fi-357\li1077\jclisttab\tx1440\lin1077 }{\listlevel\levelnfc3\levelnfcn3\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab0\ai0\af39\afs20 \ltrch\fcs0 -\b0\i0\strike0\f39\fs20\ulnone\fbias0 \s4\fi-358\li1435\jclisttab\tx1437\lin1435 }{\listlevel\levelnfc1\levelnfcn1\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 -\ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\strike0\f39\fs20\ulnone\fbias0 \s5\fi-357\li1792\jclisttab\tx2155\lin1792 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'05.;}{\levelnumbers -\'01;}\rtlch\fcs1 \ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\f39\fs20\fbias0 \s6\fi-357\li2149\jclisttab\tx2152\lin2149 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\f39\fs20\fbias0 \s7\fi-357\li2506\jclisttab\tx2509\lin2506 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 -{\leveltext\'02i.;}{\levelnumbers;}\rtlch\fcs1 \ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\f39\fs20\fbias0 \s8\fi-357\li2863\jclisttab\tx2866\lin2863 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 -{\leveltext\'02A.;}{\levelnumbers;}\rtlch\fcs1 \ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\f39\fs20\fbias0 \s9\fi-358\li3221\jclisttab\tx3223\lin3221 }{\listname ;}\listid752163927}{\list\listtemplateid-296591990\listhybrid{\listlevel\levelnfc23\levelnfcn23 -\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \s40\fi-357\li2863\jclisttab\tx2866\lin2863 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 -\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 -\fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23 -\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 -\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480 -\jclisttab\tx6480\lin6480 }{\listname ;}\listid810947713}{\list\listtemplateid-1813845996\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;} -\f3\fbias0 \s39\fi-357\li2506\jclisttab\tx2509\lin2506 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 } -{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 -\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 -{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 -\fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel -\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 -\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1219436735}{\list\listtemplateid280937824\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0 -\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li1124\lin1124 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 -\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1844\lin1844 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0 -{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2564\lin2564 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689 -\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li3284\lin3284 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 -\fi-360\li4004\lin4004 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4724\lin4724 }{\listlevel -\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5444\lin5444 }{\listlevel\levelnfc23\levelnfcn23\leveljc0 -\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li6164\lin6164 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 -\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6884\lin6884 }{\listname ;}\listid1422722544}{\list\listtemplateid303218272\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0 -\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid612407812\'01\u-3913 ?;}{\levelnumbers;}\f3\cf18\fbias0 \s36\fi-358\li1435\jclisttab\tx1437\lin1435 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 -\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 -\fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23 -\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 -\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480 -\jclisttab\tx6480\lin6480 }{\listname ;}\listid1559511898}{\list\listtemplateid-743794326\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid2033377338 -\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \s35\fi-357\li1077\jclisttab\tx1080\lin1077 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;} -\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160 -\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2880\jclisttab\tx2880\lin2880 } -{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23 -\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 -\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 -\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1567649130}{\list\listtemplateid-154908222\listhybrid{\listlevel\levelnfc3\levelnfcn3\leveljc0\leveljcn0\levelfollow0 -\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid-596080174\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab\ai0\af0 \ltrch\fcs0 \b\i0\fbias0 \s93\fi-360\li360\jclisttab\tx360\lin360 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0 -\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0 -\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1 -\levelspace0\levelindent0{\leveltext\leveltemplateid67698703\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0 -\levelindent0{\leveltext\leveltemplateid67698713\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0 -{\leveltext\leveltemplateid67698715\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\leveltemplateid67698703\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\leveltemplateid67698713\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\leveltemplateid67698715\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1795057320}{\list\listtemplateid-961874242\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 -\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid-1175557160\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \s37\fi-357\li1792\jclisttab\tx1795\lin1792 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 -\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 -{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691 -\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;} -\f10\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040 -\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel -\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1848404271} -{\list\listtemplateid-1802592190\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid1229593488\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \s38\fi-357\li2149 -\jclisttab\tx2152\lin2149 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel -\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23 -\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 -\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 -{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691 -\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;} -\f10\fbias0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1877695764}{\list\listtemplateid1186249844\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext -\leveltemplateid1637229796\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \s33\fi-357\li357\jclisttab\tx360\lin357 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691 -\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;} -\f10\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2880 -\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel -\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23 -\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 -\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 -{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid2054619191}{\list\listtemplateid758572558\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 -\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0 -\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext -\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689 -\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 -\fi-360\li3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4320\lin4320 }{\listlevel -\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0 -\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 -\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480\lin6480 }{\listname ;}\listid2085955335}{\list\listtemplateid-235387302\listhybrid{\listlevel\levelnfc23\levelnfcn23 -\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid-1242156798\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li360\lin360 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 -\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1080\lin1080 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0 -{\leveltext\leveltemplateid67698715\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li1800\lin1800 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698703 -\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2520\lin2520 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'01o;}{\levelnumbers;}\f2\fbias0 -\fi-360\li3240\lin3240 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li3960\lin3960 }{\listlevel -\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698703\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li4680\lin4680 }{\listlevel\levelnfc23\levelnfcn23\leveljc0 -\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5400\lin5400 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 -\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6120\lin6120 }{\listname ;}\listid2106606675}}{\*\listoverridetable{\listoverride\listid2054619191\listoverridecount0\ls1} -{\listoverride\listid477573462\listoverridecount0\ls2}{\listoverride\listid1567649130\listoverridecount0\ls3}{\listoverride\listid1559511898\listoverridecount0\ls4}{\listoverride\listid1848404271\listoverridecount0\ls5}{\listoverride\listid1877695764 -\listoverridecount0\ls6}{\listoverride\listid1219436735\listoverridecount0\ls7}{\listoverride\listid810947713\listoverridecount0\ls8}{\listoverride\listid196815738\listoverridecount0\ls9}{\listoverride\listid398796681\listoverridecount0\ls10} -{\listoverride\listid394402059\listoverridecount0\ls11}{\listoverride\listid752163927\listoverridecount0\ls12}{\listoverride\listid189493747\listoverridecount0\ls13}{\listoverride\listid2106606675\listoverridecount0\ls14}{\listoverride\listid1559511898 -\listoverridecount0\ls15}{\listoverride\listid1848404271\listoverridecount0\ls16}{\listoverride\listid1848404271\listoverridecount0\ls17}{\listoverride\listid1848404271\listoverridecount0\ls18}{\listoverride\listid1848404271\listoverridecount0\ls19} -{\listoverride\listid1848404271\listoverridecount0\ls20}{\listoverride\listid1848404271\listoverridecount0\ls21}{\listoverride\listid1848404271\listoverridecount0\ls22}{\listoverride\listid1848404271\listoverridecount0\ls23}{\listoverride\listid1848404271 -\listoverridecount0\ls24}{\listoverride\listid1422722544\listoverridecount0\ls25}{\listoverride\listid1848404271\listoverridecount0\ls26}{\listoverride\listid1848404271\listoverridecount0\ls27}{\listoverride\listid1848404271\listoverridecount0\ls28} -{\listoverride\listid1559511898\listoverridecount0\ls29}{\listoverride\listid1559511898\listoverridecount0\ls30}{\listoverride\listid1795057320\listoverridecount0\ls31}{\listoverride\listid1559511898\listoverridecount0\ls32}{\listoverride\listid2085955335 -\listoverridecount0\ls33}}{\*\rsidtbl \rsid864014\rsid921734\rsid1456345\rsid1516446\rsid2370159\rsid3171405\rsid3283580\rsid4090875\rsid6695507\rsid6971592\rsid7940540\rsid8259195\rsid8404268\rsid10029334}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0 -\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\title English}{\creatim\yr2010\mo12\dy9\hr23\min18}{\revtim\yr2010\mo12\dy19\hr11\min55}{\version1}{\edmins0}{\nofpages3}{\nofwords1114}{\nofchars6355} -{\nofcharsws7455}{\vern49255}}{\*\userprops {\propname db_document_id}\proptype30{\staticval 8666}{\propname ContentTypeId}\proptype30{\staticval 0x010100BDA1A6A220A40A419EFB9E5917ACC6AD}{\propname _CopySource}\proptype30{\staticval }{\propname LicenseMo -del}\proptype30{\staticval }{\propname ProductID}\proptype30{\staticval }{\propname FileType}\proptype30{\staticval }{\propname MScom}\proptype30{\staticval 1}{\propname Status}\proptype30{\staticval }{\propname Language}\proptype30{\staticval } -{\propname ProductName}\proptype30{\staticval }{\propname Channel}\proptype30{\staticval }{\propname Originator}\proptype30{\staticval }{\propname PublishDate}\proptype30{\staticval }{\propname RetirementDate}\proptype30{\staticval }{\propname SoftwareTyp -e}\proptype30{\staticval }{\propname ProductVersion}\proptype30{\staticval }{\propname Owner}\proptype30{\staticval }}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}} -\paperw12240\paperh15840\margl720\margr720\margt720\margb720\gutter0\ltrsect -\widowctrl\ftnbj\aenddoc\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata0\grfdocevents0\validatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1\noxlattoyen -\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\formshade\horzdoc\dgmargin\dghspace95\dgvspace180\dghorigin720\dgvorigin720\dghshow2\dgvshow1 -\jexpand\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\rempersonalinfo\allowfieldendsel -\wrppunct\asianbrkrule\rsidroot1456345\newtblstyruls\nogrowautofit\usenormstyforlist\noindnmbrts\felnbrelev\nocxsptable\indrlsweleven\noafcnsttbl\afelev\utinl\hwelev\spltpgpar\notcvasp\notbrkcnstfrctbl\notvatxbx\krnprsnet\cachedcolbal \nouicompat \fet0 -{\*\wgrffmtfilter 013f}\nofeaturethrottle1\ilfomacatclnup12{\*\ftnsep \ltrpar \pard\plain \ltrpar\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid2370159 \chftnsep -\par }}{\*\ftnsepc \ltrpar \pard\plain \ltrpar\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid2370159 \chftnsepc -\par }}{\*\aftnsep \ltrpar \pard\plain \ltrpar\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid2370159 \chftnsep -\par }}{\*\aftnsepc \ltrpar \pard\plain \ltrpar\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid2370159 \chftnsepc -\par }}\ltrpar \sectd \ltrsect\psz1\linex0\headery0\footery0\endnhere\sectlinegrid360\sectdefaultcl\sectrsid1456345\sftnbj {\headerl \ltrpar \pard\plain \ltrpar\s81\ql \li0\ri0\sb120\sa120\widctlpar -\tqc\tx4320\tqr\tx8640\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38 \ltrch\fcs0 -\insrsid1456345 -\par }}{\headerr \ltrpar \pard\plain \ltrpar\s81\ql \li0\ri0\sb120\sa120\widctlpar\tqc\tx4320\tqr\tx8640\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38 \ltrch\fcs0 \insrsid1456345 -\par }}{\footerl \ltrpar \pard\plain \ltrpar\s83\ql \li0\ri0\sb120\sa120\widctlpar\tqc\tx4320\tqr\tx8640\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38 \ltrch\fcs0 \insrsid1456345 -\par }}{\footerr \ltrpar \pard\plain \ltrpar\s83\ql \li0\ri0\sb120\sa120\widctlpar\tqc\tx4320\tqr\tx8640\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38 \ltrch\fcs0 \insrsid1456345 -\par }}{\headerf \ltrpar \pard\plain \ltrpar\s81\ql \li0\ri0\sb120\sa120\widctlpar\tqc\tx4320\tqr\tx8640\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38 \ltrch\fcs0 \insrsid1456345 -\par }}{\footerf \ltrpar \pard\plain \ltrpar\s83\ql \li0\ri0\sb120\sa120\widctlpar\tqc\tx4320\tqr\tx8640\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38 \ltrch\fcs0 \insrsid1456345 -\par }}{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}} -{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8 -\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ltrpar -\s42\ql \li0\ri0\sb120\sa120\nowidctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs28\alang1025 \ltrch\fcs0 -\b\fs28\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 {\*\bkmkstart _GoBack}{\*\bkmkend _GoBack}\hich\af38\dbch\af13\loch\f38 -MICROSOFT SOFTWARE LICENSE TERMS}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par }\pard\plain \ltrpar\s43\ql \li0\ri0\sb120\sa120\nowidctlpar\brdrb\brdrs\brdrw10\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs28\alang1025 \ltrch\fcs0 -\b\fs28\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 MICROSOFT SQL SERVER COMPACT 4.0 }{\rtlch\fcs1 \af38\afs20 -\ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par }\pard\plain \ltrpar\s44\ql \li0\ri0\sb120\sa120\nowidctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 -\b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 -These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. The terms -\hich\af38\dbch\af13\loch\f38 a\hich\af38\dbch\af13\loch\f38 lso apply to any Microsoft}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}\pard\plain \ltrpar\s34\ql \fi-360\li360\ri0\sb120\sa120\nowidctlpar -\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin360\itap0\pararsid8259195 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 -\af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 updates,}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 -supplements,}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 -Internet-based services, and}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 -support services}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par }\pard\plain \ltrpar\s44\ql \li0\ri0\sb120\sa120\nowidctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 -\b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 -for this software, unless other terms accompany those items. If so, those terms apply.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 -\par }{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 -\fs20\dbch\af13\insrsid1456345 -\par }\pard\plain \ltrpar\s61\ql \li0\ri0\sb120\sa120\nowidctlpar\brdrt\brdrs\brdrw10\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 -\b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 If you comply with these license terms, you have the rights below.}{ -\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 1.\tab}}\pard\plain \ltrpar\s1\ql \fi-357\li357\ri0\sb120\sa120\nowidctlpar -\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls12\outlinelevel0\adjustright\rin0\lin357\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 { -\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 INSTALLATION AND USE RIGHTS. }{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s2 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid921734 \hich\af38\dbch\af13\loch\f38 a.\tab}}\pard\plain \ltrpar\s2\ql \fi-363\li720\ri0\sb120\sa120\nowidctlpar -\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl1\outlinelevel1\adjustright\rin0\lin720\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 -\b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid921734 \hich\af38\dbch\af13\loch\f38 Installation and Use.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 -\cs57\b0\fs20\dbch\af13\insrsid921734 \hich\af38\dbch\af13\loch\f38 You may install and use any numb\hich\af38\dbch\af13\loch\f38 er of copies of the software on your devices to design, develop and test your programs for use with the software. -\par {\listtext\pard\plain\ltrpar \s2 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid921734\charrsid3283580 \hich\af38\dbch\af13\loch\f38 b.\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 -\fs20\dbch\af13\insrsid921734\charrsid3283580 \hich\af38\dbch\af13\loch\f38 Included Microsoft Programs. }{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid921734\charrsid3283580 \hich\af38\dbch\af13\loch\f38 -The software contains the Microsoft Visual C++ 2008 Express}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid921734 \hich\af38\dbch\af13\loch\f38 }{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid10029334 -\hich\af38\dbch\af13\loch\f38 Edition }{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid921734 \hich\af38\dbch\af13\loch\f38 components listed below}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 -\b0\fs20\dbch\af13\insrsid921734\charrsid3283580 \hich\af38\dbch\af13\loch\f38 . You may only use these components with the software.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8259195 \hich\af38\dbch\af13\loch\f38 }{\rtlch\fcs1 -\ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid921734\charrsid3283580 \hich\af38\dbch\af13\loch\f38 The Microsoft Visual C++ 2008 Express license terms located at }{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf17\insrsid921734\charrsid3283580 -\hich\af38\dbch\af11\loch\f38 %Program Files%\\Microsoft SQL Server Compact Edition\\v4.0 }{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid921734\charrsid3283580 \hich\af38\dbch\af13\loch\f38 -apply to your use of them, except that the components listed below may be used f\hich\af38\dbch\af13\loch\f38 or commercial hosting services when used in conjunction with the}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid921734 -\hich\af38\dbch\af13\loch\f38 software.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid921734\charrsid3283580 \hich\af38\dbch\af13\loch\f38 }{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid921734 -\par {\listtext\pard\plain\ltrpar \s94 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f3\fs20\insrsid921734\charrsid3283580 \loch\af3\dbch\af11\hich\f3 \'b7\tab}}\pard\plain \ltrpar\s94\ql \fi-360\li1080\ri0\sb120\sa120\sl276\slmult1 -\nowidctlpar\wrapdefault\aspalpha\aspnum\faauto\ls33\adjustright\rin0\lin1080\itap0\pararsid8259195\contextualspace \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe1033\loch\af31506\hich\af31506\dbch\af11\cgrid\langnp1033\langfenp1033 { -\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f38\fs20\insrsid921734\charrsid3283580 \hich\af38\dbch\af11\loch\f38 Microsoft_VC90_CRT_x86.msm -\par {\listtext\pard\plain\ltrpar \s94 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f3\fs20\insrsid921734\charrsid3283580 \loch\af3\dbch\af11\hich\f3 \'b7\tab}\hich\af38\dbch\af11\loch\f38 policy_9_0_Microsoft_VC90_CRT_x86.msm -\par {\listtext\pard\plain\ltrpar \s94 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f3\fs20\insrsid921734\charrsid3283580 \loch\af3\dbch\af11\hich\f3 \'b7\tab}\hich\af38\dbch\af11\loch\f38 Microsoft_VC90_CRT_x86_x64.msm -\par {\listtext\pard\plain\ltrpar \s94 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f3\fs20\insrsid921734\charrsid3283580 \loch\af3\dbch\af11\hich\f3 \'b7\tab}\hich\af38\dbch\af11\loch\f38 policy_9_0_Microsoft_VC90_CRT_x86_x64.msm -\par {\listtext\pard\plain\ltrpar \s94 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f3\fs20\insrsid921734\charrsid3283580 \loch\af3\dbch\af11\hich\f3 \'b7\tab}\hich\af38\dbch\af11\loch\f38 VC90.CRT_X86_msvcr90.dll -\par {\listtext\pard\plain\ltrpar \s94 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f3\fs20\lang1046\langfe1033\langnp1046\insrsid921734\charrsid864014 \loch\af3\dbch\af11\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 -\f38\fs20\lang1046\langfe1033\langnp1046\insrsid921734\charrsid864014 \hich\af38\dbch\af11\loch\f38 VC90.\hich\af38\dbch\af11\loch\f38 CRT_X86_Microsoft.VC90.CRT.manifest -\par {\listtext\pard\plain\ltrpar \s94 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f3\fs20\insrsid921734\charrsid3283580 \loch\af3\dbch\af11\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f38\fs20\insrsid921734\charrsid3283580 \hich\af38\dbch\af11\loch\f38 -VC90.CRT_AMD64_msvcr90.dll -\par {\listtext\pard\plain\ltrpar \s94 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f3\fs20\lang1046\langfe1033\langnp1046\insrsid921734\charrsid864014 \loch\af3\dbch\af11\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 -\f38\fs20\lang1046\langfe1033\langnp1046\insrsid921734\charrsid864014 \hich\af38\dbch\af11\loch\f38 VC90.CRT_AMD64_Microsoft.VC90.CRT.manifest -\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 2.\tab}}\pard\plain \ltrpar\s1\ql \fi-357\li357\ri0\sb120\sa120\nowidctlpar -\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls12\outlinelevel0\adjustright\rin0\lin357\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 { -\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s2 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 a.\tab}}\pard\plain \ltrpar\s2\ql \fi-363\li720\ri0\sb120\sa120\nowidctlpar -\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl1\outlinelevel1\adjustright\rin0\lin720\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 -\b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 Distributable Code.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 -\cs57\b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 The software contains code that you are per\hich\af38\dbch\af13\loch\f38 mitted to distribute in programs you develop if you comply with the terms below.}{\rtlch\fcs1 \ab0\af38\afs20 -\ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s49 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 i.\tab}}\pard\plain \ltrpar\s49\ql \fi-357\li1077\ri0\sb120\sa120\nowidctlpar -\jclisttab\tx1080\wrapdefault\aspalpha\aspnum\faauto\ls10\ilvl2\outlinelevel2\adjustright\rin0\lin1077\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 -\b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 Right to Use and Distribute.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 -\cs58\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 \hich\f38 The code and text files listed below are \'93\loch\f38 \hich\f38 Distributable Code.\'94}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s50 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}\pard\plain \ltrpar\s50\ql \fi-358\li1435\ri0\sb120\sa120\nowidctlpar -\jclisttab\tx1437\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin1435\itap0\pararsid8259195 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\ul\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 -\af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 REDIST.TXT Files}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\ulnone\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 -. You may copy and distribute the object code form of code lis\hich\af38\dbch\af13\loch\f38 ted in REDIST.TXT files.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\ulnone\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s50 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 -\hich\af38\dbch\af13\loch\f38 Third Party Distribution}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\ulnone\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 -. You may permit distributors of your programs to copy and distribute the Distributable Code as part of those programs.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\ulnone\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s49 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 ii.\tab}}\pard\plain \ltrpar\s49\ql \fi-357\li1077\ri0\sb120\sa120\nowidctlpar -\jclisttab\tx1077\wrapdefault\aspalpha\aspnum\faauto\ls10\ilvl2\outlinelevel2\adjustright\rin0\lin1077\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 -\b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 Distribution Requirements.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 -\cs58\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 For any Distributable Code you distribute, you must}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}\pard\plain \ltrpar\s36\ql \fi-358\li1435\ri0\sb120\sa120\nowidctlpar -\jclisttab\tx1437\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin1435\itap0\pararsid8259195 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 -\af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 add significant primary functionality to it in your programs;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 -\hich\af38\dbch\af13\loch\f38 for any Distributable Code having a filename extension of .lib, distribute only the results of running such Distributable Code through a linker with your program;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 -\fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 -\hich\af38\dbch\af13\loch\f38 distribute Distributable Co\hich\af38\dbch\af13\loch\f38 de included in a setup program only as part of that setup program without modification;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 -\hich\af38\dbch\af13\loch\f38 require distributors and external end users to agree to terms that protect it at least as much as this agreement; }{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 -\hich\af38\dbch\af13\loch\f38 display your valid copyright notice on your progr\hich\af38\dbch\af13\loch\f38 ams; and}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 -\hich\af38\dbch\af13\loch\f38 indemnify, defend, and hold harmless Microsoft from any claims, including attorneys\hich\f38 \rquote \loch\f38 fees, related to the distribution or use of your programs.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 -\fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s49 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 iii.\tab}}\pard\plain \ltrpar\s49\ql \fi-357\li1077\ri0\sb120\sa120\nowidctlpar -\jclisttab\tx1077\wrapdefault\aspalpha\aspnum\faauto\ls10\ilvl2\outlinelevel2\adjustright\rin0\lin1077\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 -\b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 Distribution Restrictions.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 -\cs58\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 You may not}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}\pard\plain \ltrpar\s36\ql \fi-358\li1435\ri0\sb120\sa120\nowidctlpar -\jclisttab\tx1437\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin1435\itap0\pararsid8259195 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 -\af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 alter any copyright, trademark or patent notice in the Distributable Code;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 -\hich\af38\dbch\af13\loch\f38 use Microsoft\hich\f38 \rquote \loch\f38 s trademarks in your programs\hich\f38 \rquote \loch\f38 names or in a way that suggests your programs come from or are endorsed by Microsoft;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 -\fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 -\hich\af38\dbch\af13\loch\f38 distribute Distributable Code to run on a plat\hich\af38\dbch\af13\loch\f38 form other than the Windows platform;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 -\hich\af38\dbch\af13\loch\f38 include Distributable Code in malicious, deceptive or unlawful programs; or}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 -\hich\af38\dbch\af13\loch\f38 modify or distribute the source code of any Distributable Code so that any part of it becomes subject to an Excluded License. An Excluded \hich\af38\dbch\af13\loch\f38 -License is one that requires, as a condition of use, modification or distribution, that}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s37 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}\pard\plain \ltrpar\s37\ql \fi-357\li1792\ri0\sb120\sa120\nowidctlpar -\jclisttab\tx1795\wrapdefault\aspalpha\aspnum\faauto\ls5\adjustright\rin0\lin1792\itap0\pararsid8259195 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 -\af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 the code be disclosed or distributed in source code form; or}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s37 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 -others have the right to modify it.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 3.\tab}}\pard\plain \ltrpar\s1\ql \fi-357\li357\ri0\sb120\sa120\nowidctlpar -\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls12\outlinelevel0\adjustright\rin0\lin357\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 { -\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 SCOPE OF LICENSE.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 - The software is licensed, not sold. This agree\hich\af38\dbch\af13\loch\f38 -ment only gives you some rights to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must co -\hich\af38\dbch\af13\loch\f38 m\hich\af38\dbch\af13\loch\f38 ply with any technical limitations in the software that only allow you to use it in certain ways. You may not}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}\pard\plain \ltrpar\s34\ql \fi-363\li720\ri0\sb120\sa120\nowidctlpar -\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin720\itap0\pararsid8259195 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 -\af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 work around any technical limitations in the software;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 -reverse engineer, decompile or disassemble the software, except and only to the extent \hich\af38\dbch\af13\loch\f38 that applicable law expressly permits, despite this limitation;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 - -\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 -make more copies of the software than specified in this agreement or allowed by applicable law, despite this limitation;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 -publish the software for others to copy;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 -rent, lease or lend the software;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid921734 \hich\af38\dbch\af13\loch\f38 or}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 -transfer the software or th}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid921734 \hich\af38\dbch\af13\loch\f38 is agreement to any third party. }{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345\charrsid921734 -\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 4.\tab}}\pard\plain \ltrpar\s1\ql \fi-357\li357\ri0\sb120\sa120\nowidctlpar -\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls12\outlinelevel0\adjustright\rin0\lin357\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 { -\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 BACKUP COPY.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 - You may make one backup copy of the software. You may use it only to reinstall the software.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 5.\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 -\hich\af38\dbch\af13\loch\f38 DOCUMENTATION.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 Any person that has valid acc\hich\af38\dbch\af13\loch\f38 -ess to your computer or internal network may copy and use the documentation for your internal, reference purposes.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 6.\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 -\hich\af38\dbch\af13\loch\f38 EXPORT RESTRICTIONS.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 - The software is subject to United States export laws and regulations. You must comply with all domestic and internati\hich\af38\dbch\af13\loch\f38 -onal export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see }{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \cs73\b0\fs20\dbch\af13\insrsid8404268 -\hich\af38\dbch\af13\loch\f38 www.microsoft.com/exporting}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 .}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \cs73\b0\fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 7.\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 -\hich\af38\dbch\af13\loch\f38 SUPPORT SERVICES. }{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 \hich\f38 Because this software is \'93\loch\f38 \hich\f38 as is,\'94\loch\f38 we may -\hich\af38\dbch\af13\loch\f38 not provide support services for it.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 8.\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 -\hich\af38\dbch\af13\loch\f38 ENTIRE AGREEMENT.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 - This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 - -\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 9.\tab}}\pard \ltrpar\s1\ql \fi-360\li360\ri0\sb120\sa120\nowidctlpar -\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls12\outlinelevel0\adjustright\rin0\lin360\itap0\pararsid8259195 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 APPLICABLE LAW.}{\rtlch\fcs1 -\af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s2 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 a.\tab}}\pard\plain \ltrpar\s2\ql \fi-363\li720\ri0\sb120\sa120\nowidctlpar -\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl1\outlinelevel1\adjustright\rin0\lin720\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 -\b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 United States.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 -\b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 - If you acquired the software in the United States, Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live g -\hich\af38\dbch\af13\loch\f38 overn all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s2 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 b.\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 -\hich\af38\dbch\af13\loch\f38 Outside the United States.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 If you acquired the software in any other country, the laws of that country apply.}{ -\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 10.\tab}}\pard\plain \ltrpar\s1\ql \fi-357\li357\ri0\sb120\sa120\nowidctlpar -\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls12\outlinelevel0\adjustright\rin0\lin357\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 { -\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 LEGAL EFFECT.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 This agr\hich\af38\dbch\af13\loch\f38 -eement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your coun -\hich\af38\dbch\af13\loch\f38 t\hich\af38\dbch\af13\loch\f38 ry if the laws of your country do not permit it to do so.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 11.\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 -\hich\af38\dbch\af13\loch\f38 \hich\f38 DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED \'93\loch\f38 \hich\f38 AS-IS.\'94\loch\f38 - YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR CONDITIONS. YOU MAY HAVE ADDITIONAL CONSUMER RIGHTS \hich\af38\dbch\af13\loch\f38 -UNDER YOUR LOCAL LAWS WHICH THIS AGREEMENT CANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.}{\rtlch\fcs1 \af38\afs20 -\ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 12.\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 -\hich\af38\dbch\af13\loch\f38 LIMITATION ON AND EXC\hich\af38\dbch\af13\loch\f38 LUSION OF REMEDIES AND DAMAGES}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\insrsid8404268 \hich\af38\dbch\af11\loch\f38 -. YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 -\fs20\insrsid1456345 -\par }\pard\plain \ltrpar\s24\ql \li357\ri0\sb120\sa120\nowidctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin357\itap0\pararsid8259195 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 This limitation app\hich\af38\dbch\af13\loch\f38 lies to}{\rtlch\fcs1 -\af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}\pard\plain \ltrpar\s34\ql \fi-363\li720\ri0\sb120\sa120\nowidctlpar -\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin720\itap0\pararsid8259195 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 -\af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 -\fs20\dbch\af13\insrsid1456345 -\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 -claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other t\hich\af38\dbch\af13\loch\f38 ort to the extent permitted by applicable law.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 -\fs20\dbch\af13\insrsid1456345 -\par }\pard\plain \ltrpar\ql \li360\ri0\sb120\sa120\nowidctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0\pararsid8259195 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 -\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 -It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limi\hich\af38\dbch\af13\loch\f38 -tation of incidental, consequential or other damages.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 -\par }{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid864014 -\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a -9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad -5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6 -b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0 -0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6 -a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f -c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512 -0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462 -a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865 -6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b -4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b -4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f -7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87 -615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad -79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b -5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab -999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9 -699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586 -8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6 -0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f -9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be -15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979 -3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d -32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a -f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86 -e877f0034e16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb -44f95d843b5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a -6409fb44d08741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c -3d9058edf2c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db0256 -5e85f3b9660d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276 -b9f7dec44b7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8 -c33585b5fb9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e -51440ca2e0088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95 -b21be5ceaf8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff -6dce591a26ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec6 -9ffb9e65d028d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239 -b75a5bb1e6345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a449 -59d366ad93b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e8 -2db8df9f30254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468 -656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4 -350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d2624 -52282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe5141 -73d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000 -0000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000 -000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019 -0200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b00001600000000 -000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027 -00000000000000000000000000a00900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d0100009b0a00000000} -{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d -617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169 -6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363 -656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e} -{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal; -\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3; -\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6; -\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9; -\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7; -\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font; -\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision; -\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6; -\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6; -\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis; -\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference; -\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000 -4d73786d6c322e534158584d4c5265616465722e362e30000000000000000000004a0000 -d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff0900060000000000000000000000010000000100000000000000001000000200000001000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -fffffffffffffffffdffffff04000000feffffff050000000e000000060000000700000008000000090000000a0000000b0000000c0000000d0000000f000000110000001000000022000000feffffff130000001400000015000000160000001700000018000000190000001a0000001b0000001c0000001d0000001e00 -00001f0000002000000021000000feffffff23000000feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffff010000000c6ad98892f1d411a65f0040963251e5000000000000000000000000103c -1c77459fcb0103000000c01a0000000000004d0073006f004400610074006100530074006f0072006500000000000000000000000000000000000000000000000000000000000000000000000000000000001a000101ffffffffffffffff050000000000000000000000000000000000000000000000103c1c77459fcb01 -103c1c77459fcb01000000000000000000000000c70053005a00db00c300dd004e00c300c800d40053003100c800420044005500d80059004600ca00430051003d003d000000000000000000000000000000000032000101ffffffffffffffff030000000000000000000000000000000000000000000000103c1c77459f -cb01103c1c77459fcb010000000000000000000000004900740065006d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffff04000000ffffffff000000000000000000000000000000000000000000000000 -00000000000000000000000000000000c100000000000000010000000200000003000000feffffff0500000006000000070000000800000009000000feffffff0b0000000c0000000d0000000e0000000f000000100000001100000012000000130000001400000015000000160000001700000018000000190000001a00 -00001b0000001c0000001d0000001e0000001f000000200000002100000022000000230000002400000025000000260000002700000028000000290000002a0000002b0000002c0000002d0000002e0000002f00000030000000310000003200000033000000340000003500000036000000370000003800000039000000 -3a0000003b0000003c0000003d0000003e0000003f00000040000000410000004200000043000000440000004500000046000000470000004800000049000000feffffff4b0000004c0000004d0000004e0000004f000000feffffff510000005200000053000000feffffff550000005600000057000000580000005900 -0000feffffff5b0000005c0000005d0000005e0000005f000000600000006100000062000000630000006400000065000000660000006700000068000000690000006a000000feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d227574662d3822207374616e64616c6f6e653d22796573223f3e3c44696374696f6e617279205361766564427956657273696f6e3d22332e362e31382e3022204d -696e696d756d56657273696f6e3d22332e362e342e302220786d6c6e733d22687474703a2f2f736368656d61732e627573696e6573732d696e746567726974792e636f6d2f6465616c6275696c6465722f323030362f64696374696f6e617279222f3e000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000003c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d226e6f223f3e0d0a3c64733a6461746173746f72654974656d2064733a6974656d49443d227b38463742 -323639442d363344332d343441332d394241302d3130443445313831364130397d2220786d6c6e733a64733d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f637573746f6d586d6c223e3c64733a736368656d61526566733e3c -64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e62757369500072006f007000650072007400690065007300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000200ffffffffffffffffffffffff000000000000 -000000000000000000000000000000000000000000000000000000000000040000005401000000000000ce00c90032004a0031005500d600cd004a00c4003400d500db00d8005900d3005800450045004100440041003d003d00000000000000000000000000000000003200010102000000080000000600000000000000 -00000000000000000000000000000000103c1c77459fcb01103c1c77459fcb010000000000000000000000004900740065006d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffff07000000ffffffff0000 -000000000000000000000000000000000000000000000000000000000000000000000a000000f50f000000000000500072006f007000650072007400690065007300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000200ffffffffffffffffffffffff -0000000000000000000000000000000000000000000000000000000000000000000000004a00000051010000000000006e6573732d696e746567726974792e636f6d2f6465616c6275696c6465722f323030362f64696374696f6e617279222f3e3c2f64733a736368656d61526566733e3c2f64733a6461746173746f72 -654974656d3e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d227574662d3822207374616e64616c6f6e653d22796573223f3e3c53657373696f6e20786d6c6e733d22687474703a -2f2f736368656d61732e627573696e6573732d696e746567726974792e636f6d2f6465616c6275696c6465722f323030362f616e7377657273223e3c5661726961626c65204e616d653d22636f6e74726163747265666572656e6365222052656c6576616e743d2266616c7365223e3c56616c75653e323031302d4d4149 -4e422d3030313031333c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d226d73636f6d223e3c56616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d2266696c6574797065223e3c56616c75653e2e7274663c2f56616c7565 -3e3c2f5661726961626c653e3c5661726961626c65204e616d653d226c616e6775616765616c6c223e3c56616c75653e456e676c6973683c2f56616c75653e3c56616c75653e4368696e657365202853696d706c6966696564293c2f56616c75653e3c56616c75653e4368696e6573652028547261646974696f6e616c29 -3c2f56616c75653e3c56616c75653e437a6563683c2f56616c75653e3c56616c75653e4672656e63683c2f56616c75653e3c56616c75653e4765726d616e3c2f56616c75653e3c56616c75653e4974616c69616e3c2f56616c75653e3c56616c75653e4a6170616e6573653c2f56616c75653e3c56616c75653e4b6f7265 -616e3c2f56616c75653e3c56616c75653e506f6c6973683c2f56616c75653e3c56616c75653e506f727475677565736520284272617a696c293c2f56616c75653e3c56616c75653e5275737369616e3c2f56616c75653e3c56616c75653e5370616e6973683c2f56616c75653e3c56616c75653e5475726b6973683c2f56 -616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d225f5f72657175657374646967657374222052656c6576616e743d2266616c7365223e3c56616c75653e3078464532363934364137393337363741383635383139334236383646353743433745453838394237353842444536304337444435 -39313644303831354244424344374335363534444137353735353430323832393342384331414345463833393630344143344634383342454533313330394235394442384434393734454335322c30392044656320323031302032323a32323a3430202d303030303c2f56616c75653e3c2f5661726961626c653e3c5661 -726961626c65204e616d653d225f5f6576656e7476616c69646174696f6e222052656c6576616e743d2266616c7365223e3c56616c75653e2f77455741674b4f3239697043414c623449756d444c2b75437032397970624e71637a6d5230493767414e52424e67333c2f56616c75653e3c2f5661726961626c653e3c5661 -726961626c65204e616d653d2263746c303024706c616365686f6c6465726d61696e24686663657370636f6e74726163747265666572656e6365222052656c6576616e743d2266616c7365223e3c56616c75653e323031302d4d41494e422d3030313031333c2f56616c75653e3c2f5661726961626c653e3c5661726961 -626c65204e616d653d2263616e616461617661696c223e3c56616c75653e747275653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d2263616e6164616672656e6368223e3c56616c75653e747275653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d -653d2266696c65666f726d6174223e3c56616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d22736f66747761726574797065223e3c56616c75653e467265652c205374616e64616c6f6e6520536f6674776172653c2f56616c75653e3c2f5661726961626c65 -3e3c5661726961626c65204e616d653d2270726f647563746e616d65223e3c56616c75653e53514c2053657276657220436f6d7061637420342e303c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d226e756d6265726f66636f70696573223e3c56616c75653e416e79206e756d6265 -72206f6620636f706965733c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d2270726f6475637476657273696f6e223e3c56616c75653e4e6f6e653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d2276657273696f6e76697369626c65223e3c56 -616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d226368616e6e656c223e3c56616c75653e52657461696c3c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d227374616e64616c6f6e657573657269676874223e3c56616c -75653e4f6e6c7920746f2064657369676e2c20646576656c6f7020616e64207465737420746865207573657227732070726f6772616d733c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d226d65646961656c656d656e747374656d706c61746573223e3c56616c75653e66616c7365 -3c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d2264697374726962757461626c65636f6465223e3c56616c75653e747275653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d2264697374726962757461626c65636f646574797065223e3c5661 -6c75653e5265646973742e7478743c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d227265646973747478746f6e6c696e65223e3c56616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d22696e7465726e616c7265617373 -69676e6d656e74223e3c56616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d226c6963656e73657472616e73666572223e3c56616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d226f746865726d -6963726f736f667470726f6772616d73223e3c56616c75653e747275653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d226e65746672616d65776f726b223e3c56616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d226f -746865726d6963726f736f667470726f6772616d737465726d73223e3c56616c75653e546865207365706172617465206c6963656e7365207465726d73206173736f636961746564207769746820746865206f74686572204d6963726f736f66742070726f6772616d733c2f56616c75653e3c2f5661726961626c653e3c -5661726961626c65204e616d653d2270726572656c65617365636f6465223e3c56616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d227468697264706172747970726f6772616d73223e3c56616c75653e66616c73653c2f56616c75653e3c2f566172696162 -6c653e3c5661726961626c65204e616d653d2262656e63686d61726b696e67223e3c56616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d226d706567223e3c56616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65 -204e616d653d22696e7465726e657462617365647365727669636573223e3c56616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d225f5f6576656e7474617267657422204b6e6f776e3d2266616c7365222052656c6576616e743d2266616c7365222f3e3c56 -61726961626c65204e616d653d225f5f6576656e74617267756d656e7422204b6e6f776e3d2266616c7365222052656c6576616e743d2266616c7365222f3e3c5661726961626c65204e616d653d226c61756e6368646976616374696f6e22204b6e6f776e3d2266616c7365222052656c6576616e743d2266616c736522 -2f3e3c5661726961626c65204e616d653d225f5f737064756d6d79746578743122204b6e6f776e3d2266616c7365222052656c6576616e743d2266616c7365222f3e3c5661726961626c65204e616d653d225f5f737064756d6d79746578743222204b6e6f776e3d2266616c7365222052656c6576616e743d2266616c73 -65222f3e3c5661726961626c65204e616d653d226f726967696e61746f72223e3c56616c75653e5245444d4f4e445c64636f7265793c2f56616c75653e3c2f5661726961626c653e3c506172616d65746572204e616d653d2264625f646973706c61795f616c6c5f636f6d6d656e7473223e3c56616c75653e66616c7365 -3c2f56616c75653e3c2f506172616d657465723e3c506172616d65746572204e616d653d2264625f73686f775f73756d6d617279223e3c56616c75653e64697361626c65643c2f56616c75653e3c2f506172616d657465723e3c506172616d65746572204e616d653d2264625f74656d706c6174655f666f726d223e3c56 -616c75653e35323032636439312d396439322d343338612d386637642d3630613864313464336162303c2f56616c75653e3c2f506172616d657465723e3c506172616d65746572204e616d653d2264625f74656d706c6174655f7265666572656e6365223e3c56616c75653e5553455445524d535f4d41494e423c2f5661 -6c75653e3c2f506172616d657465723e3c506172616d65746572204e616d653d2264625f74656d706c6174655f76657273696f6e223e3c56616c75653e32303130313130393c2f56616c75653e3c2f506172616d657465723e3c506172616d65746572204e616d653d2264625f7472616e73616374696f6e5f6578746572 -6e616c5f6c6162656c223e3c56616c75653e323031302d4d41494e422d3030313031333c2f56616c75653e3c2f506172616d657465723e3c506172616d65746572204e616d653d2264625f7472616e73616374696f6e5f6964223e3c56616c75653e333432323c2f56616c75653e3c2f506172616d657465723e3c506172 -616d65746572204e616d653d2264625f766973697465645f7061676573223e3c56616c75653e313c2f56616c75653e3c56616c75653e323c2f56616c75653e3c56616c75653e333c2f56616c75653e3c56616c75653e343c2f56616c75653e3c56616c75653e363c2f56616c75653e3c56616c75653e373c2f56616c7565 -3e3c56616c75653e313c2f56616c75653e3c56616c75653e323c2f56616c75653e3c56616c75653e333c2f56616c75653e3c56616c75653e313c2f56616c75653e3c56616c75653e313c2f56616c75653e3c2f506172616d657465723e3c2f53657373696f6e3e00000000000000000000003c3f786d6c2076657273696f -6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d226e6f223f3e0d0a3c64733a6461746173746f72654974656d2064733a6974656d49443d227b36443039393742412d414434442d343732362d423545462d3836333335433431303030437d2220786d6c6e733a64733d22687474 -703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f637573746f6d586d6c223e3c64733a736368656d61526566733e3c64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e627573696e6573732d696e74 -6567726974792e636f6d2f6465616c6275696c6465722f323030362f616e7377657273222f3e3c2f64733a736368656d61526566733e3c2f64733a6461746173746f72654974656d3e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d100c7003500 -c3004700c200c400d50056005500ca00dc00c600d30051004a004a003200dd00c600320041003d003d000000000000000000000000000000000032000101ffffffff0b000000090000000000000000000000000000000000000000000000103c1c77459fcb01103c1c77459fcb0100000000000000000000000049007400 -65006d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffff0a000000ffffffff00000000000000000000000000000000000000000000000000000000000000000000000050000000db000000000000005000 -72006f007000650072007400690065007300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000200ffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000540000004f01000000000000 -d300c300d4004f005600d400c000440034005500ce00df004400ce005a005100c100df0034005400550051003d003d000000000000000000000000000000000032000100ffffffffffffffff0c0000000000000000000000000000000000000000000000103c1c77459fcb01103c1c77459fcb0100000000000000000000 -00003c3f6d736f2d636f6e74656e74547970653f3e3c466f726d54656d706c6174657320786d6c6e733d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f7368617265706f696e742f76332f636f6e74656e74747970652f666f726d73223e3c446973706c61793e446f63756d656e744c696272 -617279466f726d3c2f446973706c61793e3c456469743e446f63756d656e744c696272617279466f726d3c2f456469743e3c4e65773e446f63756d656e744c696272617279466f726d3c2f4e65773e3c2f466f726d54656d706c617465733e00000000000000000000000000000000000000000000000000000000000000 -0000000000003c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d226e6f223f3e0d0a3c64733a6461746173746f72654974656d2064733a6974656d49443d227b31414533373743362d333532392d344135352d424339422d33343039323543463636 -37307d2220786d6c6e733a64733d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f637573746f6d586d6c223e3c64733a736368656d61526566733e3c64733a736368656d615265662064733a7572693d22687474703a2f2f7363 -68656d61732e6d6963726f736f66742e636f6d2f7368617265706f696e742f76332f636f6e74656e74747970652f666f726d73222f3e3c2f64733a736368656d61526566733e3c2f64733a6461746173746f72654974656d3e00000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000003c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d226e6f223f3e0d0a3c64733a6461746173746f72654974656d2064733a6974656d49443d227b35373045334443452d303334382d344237392d424630452d45363530 -38374637393335317d2220786d6c6e733a64733d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f637573746f6d586d6c223e3c64733a736368656d61526566733e3c64733a736368656d615265662064733a7572693d22687474 -703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f6d657461646174612f636f6e74656e7454797065222f3e3c64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f6d65 -7461646174612f70726f706572746965732f4900740065006d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffff0d000000ffffffff00000000000000000000000000000000000000000000000000000000 -000000000000000012000000761f000000000000500072006f007000650072007400690065007300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000200ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000 -000000000000000000005a00000004040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000003c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d227574662d38223f3e3c63743a636f6e74656e7454797065536368656d612063743a5f3d2222206d613a5f3d2222206d613a636f6e74656e74547970654e616d653d22446f6375 -6d656e7422206d613a636f6e74656e745479706549443d223078303130313030424441314136413232304134304134313945464239453539313741434336414422206d613a636f6e74656e745479706556657273696f6e3d22313722206d613a636f6e74656e74547970654465736372697074696f6e3d22437265617465 -2061206e657720646f63756d656e742e22206d613a636f6e74656e745479706553636f70653d2222206d613a76657273696f6e49443d2266343736346339666166646632336436653035343862333630623130346130332220786d6c6e733a63743d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f -6d2f6f66666963652f323030362f6d657461646174612f636f6e74656e74547970652220786d6c6e733a6d613d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f6d657461646174612f70726f706572746965732f6d65746141747472696275746573223e0d0a3c -7873643a736368656d61207461726765744e616d6573706163653d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f6d657461646174612f70726f7065727469657322206d613a726f6f743d227472756522206d613a6669656c647349443d223732326565636431 -63363230323961373830386363653964376530623264396522206e73323a5f3d222220786d6c6e733a7873643d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612220786d6c6e733a703d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f32 -3030362f6d657461646174612f70726f706572746965732220786d6c6e733a6e73323d2235616265626439612d376264662d343438322d393437632d633333353535323462663833223e0d0a3c7873643a696d706f7274206e616d6573706163653d2235616265626439612d376264662d343438322d393437632d633333 -353535323462663833222f3e0d0a3c7873643a656c656d656e74206e616d653d2270726f70657274696573223e0d0a3c7873643a636f6d706c6578547970653e0d0a3c7873643a73657175656e63653e0d0a3c7873643a656c656d656e74206e616d653d22646f63756d656e744d616e6167656d656e74223e0d0a3c7873 -643a636f6d706c6578547970653e0d0a3c7873643a616c6c3e0d0a3c7873643a656c656d656e74207265663d226e73323a4368616e6e656c222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a4f726967696e61746f72222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a50726f647563 -744e616d6522206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a50726f6475637456657273696f6e22206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a5075626c6973684461746522206d696e4f63637572733d2230 -222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a5265746972656d656e744461746522206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a536f6674776172655479706522206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e7420 -7265663d226e73323a4d53636f6d22206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a53746174757322206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a4c6963656e73654d6f64656c22206d696e4f63637572733d -2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a50726f64756374494422206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a4f776e657222206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a4c -616e677561676522206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a46696c6554797065222f3e0d0a3c2f7873643a616c6c3e0d0a3c2f7873643a636f6d706c6578547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c2f7873643a73657175656e63653e0d0a -3c2f7873643a636f6d706c6578547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c2f7873643a736368656d613e0d0a3c7873643a736368656d61207461726765744e616d6573706163653d2235616265626439612d376264662d343438322d393437632d6333333535353234626638332220656c656d656e7446 -6f726d44656661756c743d227175616c69666965642220786d6c6e733a7873643d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612220786d6c6e733a646d733d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f646f63756d65 -6e744d616e6167656d656e742f7479706573223e0d0a3c7873643a696d706f7274206e616d6573706163653d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f646f63756d656e744d616e6167656d656e742f7479706573222f3e0d0a3c7873643a656c656d656e -74206e616d653d224368616e6e656c22206d613a696e6465783d223822206d613a646973706c61794e616d653d224368616e6e656c22206d613a696e7465726e616c4e616d653d224368616e6e656c223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d -733a54657874223e0d0a3c7873643a6d61784c656e6774682076616c75653d22323535222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d224f726967696e61746f722220 -6d613a696e6465783d223922206d613a646973706c61794e616d653d224f726967696e61746f7222206d613a696e7465726e616c4e616d653d224f726967696e61746f72223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874223e0d0a3c -7873643a6d61784c656e6774682076616c75653d22323535222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d2250726f647563744e616d6522206d613a696e6465783d22 -313022206e696c6c61626c653d227472756522206d613a646973706c61794e616d653d2250726f647563744e616d6522206d613a64656661756c743d2222206d613a696e7465726e616c4e616d653d2250726f647563744e616d65223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374 -696f6e20626173653d22646d733a4e6f7465222f3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d2250726f6475637456657273696f6e22206d613a696e6465783d22313122206e696c6c61626c653d227472756522206d613a -646973706c61794e616d653d2250726f6475637456657273696f6e22206d613a696e7465726e616c4e616d653d2250726f6475637456657273696f6e223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874223e0d0a3c7873643a6d61784c -656e6774682076616c75653d22323535222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d225075626c6973684461746522206d613a696e6465783d22313222206e696c6c -61626c653d227472756522206d613a646973706c61794e616d653d225075626c6973684461746522206d613a666f726d61743d22446174654f6e6c7922206d613a696e7465726e616c4e616d653d225075626c69736844617465223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a726573747269637469 -6f6e20626173653d22646d733a4461746554696d65222f3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d225265746972656d656e744461746522206d613a696e6465783d22313322206e696c6c61626c653d22747275652220 -6d613a646973706c61794e616d653d225265746972656d656e744461746522206d613a666f726d61743d22446174654f6e6c7922206d613a696e7465726e616c4e616d653d225265746972656d656e7444617465223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173 -653d22646d733a4461746554696d65222f3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d22536f6674776172655479706522206d613a696e6465783d22313422206e696c6c61626c653d227472756522206d613a646973706c -61794e616d653d22536f6674776172655479706522206d613a696e7465726e616c4e616d653d22536f66747761726554797065223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874223e0d0a3c7873643a6d61784c656e6774682076616c -75653d22323535222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d224d53636f6d22206d613a696e6465783d22313522206e696c6c61626c653d227472756522206d613a -646973706c61794e616d653d224d53636f6d22206d613a64656661756c743d223122206d613a696e7465726e616c4e616d653d224d53636f6d223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a426f6f6c65616e222f3e0d0a3c2f7873643a7369 -6d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d2253746174757322206d613a696e6465783d22313622206e696c6c61626c653d227472756522206d613a646973706c61794e616d653d2253746174757322206d613a696e7465726e616c4e616d653d2253 -7461747573223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874223e0d0a3c7873643a6d61784c656e6774682076616c75653d22323535222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f7873643a73696d706c655479 -70653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d224c6963656e73654d6f64656c22206d613a696e6465783d22313722206e696c6c61626c653d227472756522206d613a646973706c61794e616d653d224c6963656e73654d6f64656c22206d613a696e7465726e616c4e -616d653d224c6963656e73654d6f64656c223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874223e0d0a3c7873643a6d61784c656e6774682076616c75653d22323535222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f -7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d2250726f64756374494422206d613a696e6465783d22313822206e696c6c61626c653d227472756522206d613a646973706c61794e616d653d2250726f64756374494422206d613a696e74 -65726e616c4e616d653d2250726f647563744944223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874223e0d0a3c7873643a6d61784c656e6774682076616c75653d22323535222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d -0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d224f776e657222206d613a696e6465783d22313922206e696c6c61626c653d227472756522206d613a646973706c61794e616d653d224f776e657222206d613a696e7465726e616c -4e616d653d224f776e6572223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874223e0d0a3c7873643a6d61784c656e6774682076616c75653d22323535222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f7873643a7369 -6d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d224c616e677561676522206d613a696e6465783d22323022206e696c6c61626c653d227472756522206d613a646973706c61794e616d653d224c616e677561676522206d613a696e7465726e616c4e616d -653d224c616e6775616765223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874223e0d0a3c7873643a6d61784c656e6774682076616c75653d22323535222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f7873643a7369 -6d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d2246696c655479706522206d613a696e6465783d22323122206d613a646973706c61794e616d653d2246696c655479706522206d613a696e7465726e616c4e616d653d2246696c6554797065223e0d0a3c -7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874223e0d0a3c7873643a6d61784c656e6774682076616c75653d22323535222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f787364 -3a656c656d656e743e0d0a3c2f7873643a736368656d613e0d0a3c7873643a736368656d61207461726765744e616d6573706163653d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f7061636b6167652f323030362f6d657461646174612f636f72652d70726f70657274696573 -2220656c656d656e74466f726d44656661756c743d227175616c69666965642220617474726962757465466f726d44656661756c743d22756e7175616c69666965642220626c6f636b44656661756c743d2223616c6c2220786d6c6e733d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f -72672f7061636b6167652f323030362f6d657461646174612f636f72652d70726f706572746965732220786d6c6e733a7873643d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c5363 -68656d612d696e7374616e63652220786d6c6e733a64633d22687474703a2f2f7075726c2e6f72672f64632f656c656d656e74732f312e312f2220786d6c6e733a64637465726d733d22687474703a2f2f7075726c2e6f72672f64632f7465726d732f2220786d6c6e733a6f646f633d22687474703a2f2f736368656d61 -732e6d6963726f736f66742e636f6d2f6f66666963652f696e7465726e616c2f323030352f696e7465726e616c446f63756d656e746174696f6e223e0d0a3c7873643a696d706f7274206e616d6573706163653d22687474703a2f2f7075726c2e6f72672f64632f656c656d656e74732f312e312f2220736368656d614c -6f636174696f6e3d22687474703a2f2f6475626c696e636f72652e6f72672f736368656d61732f786d6c732f7164632f323030332f30342f30322f64632e787364222f3e0d0a3c7873643a696d706f7274206e616d6573706163653d22687474703a2f2f7075726c2e6f72672f64632f7465726d732f2220736368656d61 -4c6f636174696f6e3d22687474703a2f2f6475626c696e636f72652e6f72672f736368656d61732f786d6c732f7164632f323030332f30342f30322f64637465726d732e787364222f3e0d0a3c7873643a656c656d656e74206e616d653d22636f726550726f706572746965732220747970653d2243545f636f72655072 -6f70657274696573222f3e0d0a3c7873643a636f6d706c657854797065206e616d653d2243545f636f726550726f70657274696573223e0d0a3c7873643a616c6c3e0d0a3c7873643a656c656d656e74207265663d2264633a63726561746f7222206d696e4f63637572733d223022206d61784f63637572733d2231222f -3e0d0a3c7873643a656c656d656e74207265663d2264637465726d733a6372656174656422206d696e4f63637572733d223022206d61784f63637572733d2231222f3e0d0a3c7873643a656c656d656e74207265663d2264633a6964656e74696669657222206d696e4f63637572733d223022206d61784f63637572733d -2231222f3e0d0a3c7873643a656c656d656e74206e616d653d22636f6e74656e745479706522206d696e4f63637572733d223022206d61784f63637572733d22312220747970653d227873643a737472696e6722206d613a696e6465783d223022206d613a646973706c61794e616d653d22436f6e74656e742054797065 -22206d613a726561644f6e6c793d2274727565222f3e0d0a3c7873643a656c656d656e74207265663d2264633a7469746c6522206d696e4f63637572733d223022206d61784f63637572733d223122206d613a696e6465783d223422206d613a646973706c61794e616d653d225469746c65222f3e0d0a3c7873643a656c -656d656e74207265663d2264633a7375626a65637422206d696e4f63637572733d223022206d61784f63637572733d2231222f3e0d0a3c7873643a656c656d656e74207265663d2264633a6465736372697074696f6e22206d696e4f63637572733d223022206d61784f63637572733d2231222f3e0d0a3c7873643a656c -656d656e74206e616d653d226b6579776f72647322206d696e4f63637572733d223022206d61784f63637572733d22312220747970653d227873643a737472696e67222f3e0d0a3c7873643a656c656d656e74207265663d2264633a6c616e677561676522206d696e4f63637572733d223022206d61784f63637572733d -2231222f3e0d0a3c7873643a656c656d656e74206e616d653d2263617465676f727922206d696e4f63637572733d223022206d61784f63637572733d22312220747970653d227873643a737472696e67222f3e0d0a3c7873643a656c656d656e74206e616d653d2276657273696f6e22206d696e4f63637572733d223022 -206d61784f63637572733d22312220747970653d227873643a737472696e67222f3e0d0a3c7873643a656c656d656e74206e616d653d227265766973696f6e22206d696e4f63637572733d223022206d61784f63637572733d22312220747970653d227873643a737472696e67223e0d0a3c7873643a616e6e6f74617469 -6f6e3e0d0a3c7873643a646f63756d656e746174696f6e3e0d0a202020202020202020202020202020202020202020202020546869732076616c756520696e6469636174657320746865206e756d626572206f66207361766573206f72207265766973696f6e732e20546865206170706c69636174696f6e206973207265 -73706f6e7369626c6520666f72207570646174696e6720746869732076616c75652061667465722065616368207265766973696f6e2e0d0a20202020202020202020202020202020202020203c2f7873643a646f63756d656e746174696f6e3e0d0a3c2f7873643a616e6e6f746174696f6e3e0d0a3c2f7873643a656c65 -6d656e743e0d0a3c7873643a656c656d656e74206e616d653d226c6173744d6f646966696564427922206d696e4f63637572733d223022206d61784f63637572733d22312220747970653d227873643a737472696e67222f3e0d0a3c7873643a656c656d656e74207265663d2264637465726d733a6d6f64696669656422 -206d696e4f63637572733d223022206d61784f63637572733d2231222f3e0d0a3c7873643a656c656d656e74206e616d653d226c6173745072696e74656422206d696e4f63637572733d223022206d61784f63637572733d22312220747970653d227873643a6461746554696d65222f3e0d0a3c7873643a656c656d656e -74206e616d653d22636f6e74656e7453746174757322206d696e4f63637572733d223022206d61784f63637572733d22312220747970653d227873643a737472696e67222f3e0d0a3c2f7873643a616c6c3e0d0a3c2f7873643a636f6d706c6578547970653e0d0a3c2f7873643a736368656d613e0d0a3c2f63743a636f -6e74656e7454797065536368656d613e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000006d65746141747472696275746573222f3e3c64733a736368656d615265662064733a7572693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d61222f3e3c64733a736368656d615265662064733a7572693d226874 -74703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f6d657461646174612f70726f70657274696573222f3e3c64733a736368656d615265662064733a7572693d2235616265626439612d376264662d343438322d393437632d633333353535323462663833222f3e3c64733a -736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f646f63756d656e744d616e6167656d656e742f7479706573222f3e3c64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6f7065 -6e786d6c666f726d6174732e6f72672f7061636b6167652f323030362f6d657461646174612f636f72652d70726f70657274696573222f3e3c64733a736368656d615265662064733a7572693d22687474703a2f2f7075726c2e6f72672f64632f656c656d656e74732f312e312f222f3e3c64733a736368656d61526566 -2064733a7572693d22687474703a2f2f7075726c2e6f72672f64632f7465726d732f222f3e3c64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f696e7465726e616c2f323030352f696e7465726e616c446f63756d656e7461 -74696f6e222f3e3c2f64733a736368656d61526566733e3c2f64733a6461746173746f72654974656d3e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff38\deff0\stshfdbch11\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033\themelang1033\themelangfe2052\themelangcs1025{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};} +{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New{\*\falt Arial};}{\f3\fbidi \froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol{\*\falt Bookshelf Symbol 3};} +{\f10\fbidi \fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings{\*\falt Symbol};}{\f11\fbidi \fmodern\fcharset128\fprq1{\*\panose 02020609040205080304}MS Mincho{\*\falt ?l?r ??\'81\'66c};} +{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt ????\'a1\'a7???};}{\f13\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt ????\'a1\'a7???};} +{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma{\*\falt ?? ??};}{\f39\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0603020202020204}Trebuchet MS{\*\falt Arial};} +{\f40\fbidi \fmodern\fcharset128\fprq1{\*\panose 00000000000000000000}@MS Mincho{\*\falt @MS Gothic};}{\f41\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}@SimSun;} +{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}{\fdbmajor\f31501\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt ????\'a1\'a7???};} +{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};} +{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Times};}{\fdbminor\f31505\fbidi \fnil\fcharset134\fprq2{\*\panose 02010600030101010101}SimSun{\*\falt ????\'a1\'a7???};} +{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\fbiminor\f31507\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}{\f42\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};} +{\f43\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\f45\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};}{\f46\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};} +{\f47\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};}{\f48\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}{\f49\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};} +{\f50\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\f62\fbidi \fmodern\fcharset238\fprq1 Courier New CE{\*\falt Arial};}{\f63\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr{\*\falt Arial};} +{\f65\fbidi \fmodern\fcharset161\fprq1 Courier New Greek{\*\falt Arial};}{\f66\fbidi \fmodern\fcharset162\fprq1 Courier New Tur{\*\falt Arial};}{\f67\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew){\*\falt Arial};} +{\f68\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic){\*\falt Arial};}{\f69\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic{\*\falt Arial};}{\f70\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese){\*\falt Arial};} +{\f154\fbidi \fmodern\fcharset0\fprq1 MS Mincho Western{\*\falt ?l?r ??\'81\'66c};}{\f152\fbidi \fmodern\fcharset238\fprq1 MS Mincho CE{\*\falt ?l?r ??\'81\'66c};}{\f153\fbidi \fmodern\fcharset204\fprq1 MS Mincho Cyr{\*\falt ?l?r ??\'81\'66c};} +{\f155\fbidi \fmodern\fcharset161\fprq1 MS Mincho Greek{\*\falt ?l?r ??\'81\'66c};}{\f156\fbidi \fmodern\fcharset162\fprq1 MS Mincho Tur{\*\falt ?l?r ??\'81\'66c};}{\f159\fbidi \fmodern\fcharset186\fprq1 MS Mincho Baltic{\*\falt ?l?r ??\'81\'66c};} +{\f174\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt ????\'a1\'a7???};}{\f174\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt ????\'a1\'a7???};}{\f422\fbidi \fswiss\fcharset238\fprq2 Tahoma CE{\*\falt ?? ??};} +{\f423\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr{\*\falt ?? ??};}{\f425\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek{\*\falt ?? ??};}{\f426\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur{\*\falt ?? ??};} +{\f427\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew){\*\falt ?? ??};}{\f428\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic){\*\falt ?? ??};}{\f429\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic{\*\falt ?? ??};} +{\f430\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese){\*\falt ?? ??};}{\f431\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai){\*\falt ?? ??};}{\f432\fbidi \fswiss\fcharset238\fprq2 Trebuchet MS CE{\*\falt Arial};} +{\f433\fbidi \fswiss\fcharset204\fprq2 Trebuchet MS Cyr{\*\falt Arial};}{\f435\fbidi \fswiss\fcharset161\fprq2 Trebuchet MS Greek{\*\falt Arial};}{\f436\fbidi \fswiss\fcharset162\fprq2 Trebuchet MS Tur{\*\falt Arial};} +{\f439\fbidi \fswiss\fcharset186\fprq2 Trebuchet MS Baltic{\*\falt Arial};}{\f444\fbidi \fmodern\fcharset0\fprq1 @MS Mincho Western{\*\falt @MS Gothic};}{\f442\fbidi \fmodern\fcharset238\fprq1 @MS Mincho CE{\*\falt @MS Gothic};} +{\f443\fbidi \fmodern\fcharset204\fprq1 @MS Mincho Cyr{\*\falt @MS Gothic};}{\f445\fbidi \fmodern\fcharset161\fprq1 @MS Mincho Greek{\*\falt @MS Gothic};}{\f446\fbidi \fmodern\fcharset162\fprq1 @MS Mincho Tur{\*\falt @MS Gothic};} +{\f449\fbidi \fmodern\fcharset186\fprq1 @MS Mincho Baltic{\*\falt @MS Gothic};}{\f454\fbidi \fnil\fcharset0\fprq2 @SimSun Western;}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};} +{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};} +{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};} +{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};} +{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\fdbmajor\f31520\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt ????\'a1\'a7???};}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;} +{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;} +{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};} +{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};} +{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};} +{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};} +{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE{\*\falt Times};} +{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Times};}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times};} +{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Times};}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Times};} +{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Times};}{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Times};} +{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese){\*\falt Times};}{\fdbminor\f31560\fbidi \fnil\fcharset0\fprq2 SimSun Western{\*\falt ????\'a1\'a7???};}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;} +{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;} +{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \fswiss\fcharset238\fprq2 Arial CE;} +{\fbiminor\f31579\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}{\fbiminor\f31581\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\fbiminor\f31582\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\fbiminor\f31583\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);} +{\fbiminor\f31584\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}{\fbiminor\f31585\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\fbiminor\f31586\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255; +\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0; +\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red31\green73\blue125;\ctextone\ctint255\cshade255\red0\green0\blue0;}{\*\defchp \fs22\dbch\af11 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \snext0 \sautoupd \sqformat \spriority0 \styrsid1456345 Normal;}{\s1\ql \fi-357\li357\ri0\sb120\sa120\widctlpar +\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls12\outlinelevel0\adjustright\rin0\lin357\itap0 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 +\sbasedon0 \snext1 \slink15 \sqformat \styrsid1456345 heading 1;}{\s2\ql \fi-363\li720\ri0\sb120\sa120\widctlpar\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl1\outlinelevel1\adjustright\rin0\lin720\itap0 \rtlch\fcs1 +\ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext2 \slink16 \sqformat \styrsid1456345 heading 2;}{\s3\ql \fi-357\li1077\ri0\sb120\sa120\widctlpar +\tx1077\jclisttab\tx1440\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl2\outlinelevel2\adjustright\rin0\lin1077\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 +\sbasedon0 \snext3 \slink17 \sqformat \styrsid1456345 heading 3;}{\s4\ql \fi-358\li1435\ri0\sb120\sa120\widctlpar\jclisttab\tx1437\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl3\outlinelevel3\adjustright\rin0\lin1435\itap0 \rtlch\fcs1 +\af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext4 \slink18 \sqformat \styrsid1456345 heading 4;}{\s5\ql \fi-357\li1792\ri0\sb120\sa120\widctlpar +\tx1792\jclisttab\tx2155\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl4\outlinelevel4\adjustright\rin0\lin1792\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 +\sbasedon0 \snext5 \slink19 \sqformat \styrsid1456345 heading 5;}{\s6\ql \fi-357\li2149\ri0\sb120\sa120\widctlpar\jclisttab\tx2152\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl5\outlinelevel5\adjustright\rin0\lin2149\itap0 \rtlch\fcs1 +\af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext6 \slink20 \sqformat \styrsid1456345 heading 6;}{\s7\ql \fi-357\li2506\ri0\sb120\sa120\widctlpar +\jclisttab\tx2509\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl6\outlinelevel6\adjustright\rin0\lin2506\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 +\sbasedon0 \snext7 \slink21 \sqformat \styrsid1456345 heading 7;}{\s8\ql \fi-357\li2863\ri0\sb120\sa120\widctlpar\jclisttab\tx2866\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl7\outlinelevel7\adjustright\rin0\lin2863\itap0 \rtlch\fcs1 +\af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext8 \slink22 \sqformat \styrsid1456345 heading 8;}{\s9\ql \fi-358\li3221\ri0\sb120\sa120\widctlpar +\jclisttab\tx3223\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl8\outlinelevel8\adjustright\rin0\lin3221\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 +\sbasedon0 \snext9 \slink23 \sqformat \styrsid1456345 heading 9;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\* +\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe1033\loch\f0\hich\af0\dbch\af11\cgrid\langnp1033\langfenp1033 \snext11 \ssemihidden \sunhideused Normal Table;}{\* +\cs15 \additive \rtlch\fcs1 \ab\af38\afs19 \ltrch\fcs0 \b\f38\fs19 \sbasedon10 \slink1 \slocked \styrsid1456345 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\af38\afs19 \ltrch\fcs0 \b\f38\fs19 \sbasedon10 \slink2 \slocked \styrsid1456345 +Heading 2 Char;}{\*\cs17 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 \sbasedon10 \slink3 \slocked \styrsid1456345 Heading 3 Char;}{\*\cs18 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 \sbasedon10 \slink4 \slocked \styrsid1456345 +Heading 4 Char;}{\*\cs19 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 \sbasedon10 \slink5 \slocked \styrsid1456345 Heading 5 Char;}{\*\cs20 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 \sbasedon10 \slink6 \slocked \styrsid1456345 +Heading 6 Char;}{\*\cs21 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 \sbasedon10 \slink7 \slocked \styrsid1456345 Heading 7 Char;}{\*\cs22 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 \sbasedon10 \slink8 \slocked \styrsid1456345 +Heading 8 Char;}{\*\cs23 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 \sbasedon10 \slink9 \slocked \styrsid1456345 Heading 9 Char;}{\s24\ql \li357\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin357\itap0 +\rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext24 \styrsid1456345 Body 1;}{ +\s25\ql \li720\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 +\sbasedon0 \snext25 \styrsid1456345 Body 2;}{\s26\ql \li1077\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin1077\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext26 \styrsid1456345 Body 3;}{\s27\ql \li1435\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin1435\itap0 \rtlch\fcs1 +\af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext27 \styrsid1456345 Body 4;}{ +\s28\ql \li1803\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin1803\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 +\sbasedon0 \snext28 \styrsid1456345 Body 5;}{\s29\ql \li2160\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin2160\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext29 \styrsid1456345 Body 6;}{\s30\ql \li2506\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin2506\itap0 \rtlch\fcs1 +\af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext30 \styrsid1456345 Body 7;}{ +\s31\ql \li2863\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin2863\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 +\sbasedon0 \snext31 \styrsid1456345 Body 8;}{\s32\ql \li3221\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin3221\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext32 \styrsid1456345 Body 9;}{\s33\ql \fi-357\li357\ri0\sb120\sa120\widctlpar +\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls1\adjustright\rin0\lin357\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext33 \styrsid1456345 +Bullet 1;}{\s34\ql \fi-363\li720\ri0\sb120\sa120\widctlpar\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin720\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext34 \styrsid1456345 Bullet 2;}{\s35\ql \fi-357\li1077\ri0\sb120\sa120\widctlpar +\jclisttab\tx1080\wrapdefault\aspalpha\aspnum\faauto\ls3\adjustright\rin0\lin1077\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 +\sbasedon0 \snext35 \slink87 \styrsid1456345 Bullet 3;}{\s36\ql \fi-358\li1435\ri0\sb120\sa120\widctlpar\jclisttab\tx1437\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin1435\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext36 \styrsid1456345 Bullet 4;}{\s37\ql \fi-357\li1792\ri0\sb120\sa120\widctlpar +\jclisttab\tx1795\wrapdefault\aspalpha\aspnum\faauto\ls5\adjustright\rin0\lin1792\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext37 \styrsid1456345 +Bullet 5;}{\s38\ql \fi-357\li2149\ri0\sb120\sa120\widctlpar\jclisttab\tx2152\wrapdefault\aspalpha\aspnum\faauto\ls6\adjustright\rin0\lin2149\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext38 \styrsid1456345 Bullet 6;}{\s39\ql \fi-357\li2506\ri0\sb120\sa120\widctlpar +\jclisttab\tx2509\wrapdefault\aspalpha\aspnum\faauto\ls7\adjustright\rin0\lin2506\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext39 \styrsid1456345 +Bullet 7;}{\s40\ql \fi-357\li2863\ri0\sb120\sa120\widctlpar\jclisttab\tx2866\wrapdefault\aspalpha\aspnum\faauto\ls8\adjustright\rin0\lin2863\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext40 \styrsid1456345 Bullet 8;}{\s41\ql \fi-358\li3221\ri0\sb120\sa120\widctlpar +\jclisttab\tx3223\wrapdefault\aspalpha\aspnum\faauto\ls9\adjustright\rin0\lin3221\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 +\sbasedon32 \snext41 \styrsid1456345 Bullet 9;}{\s42\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af38\afs28\alang1025 \ltrch\fcs0 +\b\fs28\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \styrsid1456345 Heading EULA;}{\s43\ql \li0\ri0\sb120\sa120\widctlpar\brdrb\brdrs\brdrw10\brsp20 +\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af38\afs28\alang1025 \ltrch\fcs0 \b\fs28\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \styrsid1456345 +Heading Software Title;}{\s44\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 +\b\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext44 \styrsid1456345 Preamble;}{\s45\ql \li0\ri0\sb120\sa120\widctlpar\brdrb\brdrs\brdrw10\brsp20 +\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext1 \styrsid1456345 Preamble Border;}{ +\s46\qc \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 +\sbasedon0 \snext46 \styrsid1456345 Heading Warranty;}{\s47\ql \fi-360\li360\ri0\sb120\sa120\widctlpar\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls11\outlinelevel0\adjustright\rin0\lin360\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \styrsid1456345 Heading 1 Warranty;}{\s48\ql \fi-360\li720\ri0\sb120\sa120\widctlpar +\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls11\ilvl1\outlinelevel1\adjustright\rin0\lin720\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 +\sbasedon0 \snext0 \styrsid1456345 Heading 2 Warranty;}{\s49\ql \fi-357\li1077\ri0\sb120\sa120\widctlpar\tx1077\jclisttab\tx1440\wrapdefault\aspalpha\aspnum\faauto\ls10\ilvl2\outlinelevel2\adjustright\rin0\lin1077\itap0 \rtlch\fcs1 +\ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon3 \snext49 \styrsid1456345 Heading 3 Bold;}{\s50\ql \fi-358\li1435\ri0\sb120\sa120\widctlpar +\jclisttab\tx1437\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin1435\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\ul\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 +\sbasedon36 \snext50 \styrsid1456345 Bullet 4 Underline;}{\s51\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\ul\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon35 \snext51 \styrsid1456345 Bullet 3 Underline;}{\s52\ql \li720\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 +\rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\ul\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon25 \snext52 \styrsid1456345 Body 2 Underline;}{ +\s53\ql \li1077\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin1077\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\ul\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 +\sbasedon26 \snext53 \styrsid1456345 Body 3 Underline;}{\s54\ql \li0\ri0\sb120\sa120\sl480\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext54 \slink55 \styrsid1456345 Body Text Indent;}{\*\cs55 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 +\sbasedon10 \slink54 \slocked \ssemihidden \styrsid1456345 Body Text Indent Char;}{\s56\ql \fi-358\li1435\ri0\sb120\sa120\widctlpar\jclisttab\tx1437\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin1435\itap0 \rtlch\fcs1 +\ai\af38\afs19\alang1025 \ltrch\fcs0 \i\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon36 \snext56 \styrsid1456345 Bullet 4 Italics;}{\*\cs57 \additive \rtlch\fcs1 \af38 \ltrch\fcs0 +\f38\lang1033\langfe1033\langnp1033\langfenp1033 \sbasedon10 \styrsid1456345 Body 2 Char;}{\*\cs58 \additive \rtlch\fcs1 \af38 \ltrch\fcs0 \f38\lang1033\langfe1033\langnp1033\langfenp1033 \sbasedon10 \styrsid1456345 Body 3 Char;}{\*\cs59 \additive +\rtlch\fcs1 \af38 \ltrch\fcs0 \f38\lang1033\langfe1033\langnp1033\langfenp1033 \sbasedon10 \styrsid1456345 Body 4 Char;}{\*\cs60 \additive \rtlch\fcs1 \af38 \ltrch\fcs0 \f38\lang1033\langfe1033\langnp1033\langfenp1033 \sbasedon10 \styrsid1456345 +Body 1 Char;}{\s61\ql \li0\ri0\sb120\sa120\widctlpar\brdrt\brdrs\brdrw10\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 +\b\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon44 \snext61 \styrsid1456345 Preamble Border Above;}{\s62\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 +\rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext62 \slink63 \ssemihidden \styrsid1456345 footnote text;}{\*\cs63 \additive \rtlch\fcs1 \af38\afs20 +\ltrch\fcs0 \f38\fs20 \sbasedon10 \slink62 \slocked \ssemihidden \styrsid1456345 Footnote Text Char;}{\*\cs64 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \super \sbasedon10 \ssemihidden \styrsid1456345 footnote reference;}{ +\s65\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 +\sbasedon0 \snext65 \slink66 \ssemihidden \styrsid1456345 endnote text;}{\*\cs66 \additive \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f38\fs20 \sbasedon10 \slink65 \slocked \ssemihidden \styrsid1456345 Endnote Text Char;}{\*\cs67 \additive \rtlch\fcs1 \af0 +\ltrch\fcs0 \super \sbasedon10 \ssemihidden \styrsid1456345 endnote reference;}{\s68\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext68 \slink69 \ssemihidden \styrsid1456345 annotation text;}{\*\cs69 \additive \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f38\fs20 +\sbasedon10 \slink68 \slocked \ssemihidden \styrsid1456345 Comment Text Char;}{\*\cs70 \additive \rtlch\fcs1 \af0\afs16 \ltrch\fcs0 \fs16 \sbasedon10 \ssemihidden \styrsid1456345 annotation reference;}{\s71\ql \li0\ri0\sa160\sl-240\slmult0 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext71 \styrsid1456345 Char;}{ +\s72\ql \li0\ri0\sa160\sl-240\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 +\sbasedon0 \snext72 \styrsid1456345 Char Char Char Char;}{\*\cs73 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \ul\cf2 \sbasedon10 \styrsid1456345 Hyperlink;}{\s74\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 +\rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0 \fs16\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext74 \slink75 \ssemihidden \styrsid1456345 Balloon Text;}{\*\cs75 \additive \rtlch\fcs1 \af38\afs16 +\ltrch\fcs0 \f38\fs16 \sbasedon10 \slink74 \slocked \ssemihidden \styrsid1456345 Balloon Text Char;}{\*\cs76 \additive \rtlch\fcs1 \ab\af39 \ltrch\fcs0 \b\f39\lang1033\langfe1033\langnp1033\langfenp1033 \sbasedon10 \styrsid1456345 Heading 2 Char1;}{\* +\cs77 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \sbasedon10 \styrsid1456345 page number;}{\s78\ql \li0\ri0\sa160\sl-240\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext78 \styrsid1456345 Char Char Char Char1;}{\s79\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 +\ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \snext0 \styrsid1456345 Body 0 Bold;}{\s80\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 +\rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \snext0 \styrsid1456345 Body 0;}{\s81\ql \li0\ri0\sb120\sa120\widctlpar +\tqc\tx4320\tqr\tx8640\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 +\sbasedon0 \snext81 \slink82 \styrsid1456345 header;}{\*\cs82 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 \sbasedon10 \slink81 \slocked \styrsid1456345 Header Char;}{\s83\ql \li0\ri0\sb120\sa120\widctlpar +\tqc\tx4320\tqr\tx8640\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 +\sbasedon0 \snext83 \slink84 \styrsid1456345 footer;}{\*\cs84 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 \sbasedon10 \slink83 \slocked \ssemihidden \styrsid1456345 Footer Char;}{ +\s85\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af38\afs20\alang1025 \ltrch\fcs0 \b\fs20\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 +\sbasedon68 \snext68 \slink86 \ssemihidden \sunhideused \styrsid1456345 annotation subject;}{\*\cs86 \additive \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\f38\fs20 \sbasedon69 \slink85 \slocked \ssemihidden \styrsid1456345 Comment Subject Char;}{\*\cs87 +\additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 \f38\fs19 \sbasedon10 \slink35 \slocked \styrsid1456345 Bullet 3 Char1;}{\s88\ql \fi-357\li1077\ri0\sb120\sa120\widctlpar\jclisttab\tx1080\wrapdefault\aspalpha\aspnum\faauto\ls3\adjustright\rin0\lin1077\itap0 +\rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\ul\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon35 \snext88 \styrsid1456345 Bullet 3 Underlined;}{\*\cs89 \additive \rtlch\fcs1 \af38\afs19 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\langnp1033\langfenp1033 \sbasedon10 \styrsid1456345 Char Char;}{\s90\ql \li0\ri0\sl-240\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 +\af38\afs20\alang1025 \ltrch\fcs0 \fs18\lang1033\langfe1033\loch\f39\hich\af39\dbch\af11\cgrid\langnp1033\langfenp1033 \snext90 \spriority0 \styrsid1456345 AdditionalSoftware;}{\*\cs91 \additive \rtlch\fcs1 \af38\afs24\alang1025 \ltrch\fcs0 +\b\f39\fs24\lang1033\langfe1033\langnp1033\langfenp1033 \sbasedon10 \spriority0 \styrsid1456345 Char Char1;}{\s92\ql \fi-358\li1435\ri0\sb120\sa120\widctlpar\jclisttab\tx1437\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin1435\itap0 +\rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\ul\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon36 \snext92 \spriority0 \styrsid1456345 Bullet 4 Underlined;}{\s93\ql \fi-360\li360\ri0\sb120\sa120\widctlpar +\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls31\adjustright\rin0\lin360\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\f38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 +\sbasedon0 \snext93 \spriority0 \styrsid1456345 Heading French Warranty;}{\s94\ql \li720\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\contextualspace \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 +\fs22\lang1033\langfe1033\loch\f31506\hich\af31506\dbch\af11\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext94 \sqformat \spriority34 \styrsid921734 List Paragraph;}}{\*\listtable{\list\listtemplateid1821544400\listhybrid{\listlevel\levelnfc23\levelnfcn23 +\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 +\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1380\jclisttab\tx1380\lin1380 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 +{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2100\jclisttab\tx2100\lin2100 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext +\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2820\jclisttab\tx2820\lin2820 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext +\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3540\jclisttab\tx3540\lin3540 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693 +\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4260\jclisttab\tx4260\lin4260 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689 +\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li4980\jclisttab\tx4980\lin4980 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691 +\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5700\jclisttab\tx5700\lin5700 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693 +\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6420\jclisttab\tx6420\lin6420 }{\listname ;}\listid189493747}{\list\listtemplateid176468498\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0 +\levelindent0{\leveltext\leveltemplateid692200086\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \s41\fi-358\li3221\jclisttab\tx3223\lin3221 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693 +\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;} +\f3\fbias0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600 +\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 } +{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23 +\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 +\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid196815738}{\list\listtemplateid-1793664660{\listlevel\levelnfc3 +\levelnfcn3\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab\ai0\af0 \ltrch\fcs0 \b\i0\fbias0 \s47\fi-360\li360\jclisttab\tx360\lin360 }{\listlevel\levelnfc0\levelnfcn0 +\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab\ai0\af0 \ltrch\fcs0 \b\i0\fbias0 \s48\fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0 +\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'02);}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li1080\jclisttab\tx1080\lin1080 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1 +\levelspace0\levelindent0{\leveltext\'03(\'03);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 +{\leveltext\'03(\'04);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li1800\jclisttab\tx1800\lin1800 }{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\'03(\'05);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;} +\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li2520\jclisttab\tx2520\lin2520 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 +\fbias0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li3240 +\jclisttab\tx3240\lin3240 }{\listname ;}\listid394402059}{\list\listtemplateid1928476992{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 +\ab\ai0\af39\afs20 \ltrch\fcs0 \b\i0\f39\fs20\fbias0 \fi-357\li357\jclisttab\tx360\lin357 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 +\ab\ai0\af39\afs20 \ltrch\fcs0 \b\i0\f39\fs20\fbias0 \fi-363\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 +\ab\ai0\af38\afs20 \ltrch\fcs0 \b\i0\f38\fs20\fbias0 \s49\fi-357\li1077\jclisttab\tx1440\lin1077 }{\listlevel\levelnfc3\levelnfcn3\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 +\ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\strike0\f39\fs20\ulnone\fbias0 \fi-358\li1435\jclisttab\tx1437\lin1435 }{\listlevel\levelnfc1\levelnfcn1\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'04.;}{\levelnumbers +\'01;}\rtlch\fcs1 \ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\strike0\f39\fs20\ulnone\fbias0 \fi-357\li1792\jclisttab\tx2155\lin1792 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\f39\fs20\fbias0 \fi-357\li2149\jclisttab\tx2152\lin2149 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\f39\fs20\fbias0 \fi-357\li2506\jclisttab\tx2509\lin2506 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 +{\leveltext\'02i.;}{\levelnumbers;}\rtlch\fcs1 \ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\f39\fs20\fbias0 \fi-357\li2863\jclisttab\tx2866\lin2863 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 +{\leveltext\'02A.;}{\levelnumbers;}\rtlch\fcs1 \ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\f39\fs20\fbias0 \fi-358\li3221\jclisttab\tx3223\lin3221 }{\listname ;}\listid398796681}{\list\listtemplateid789093748\listhybrid{\listlevel\levelnfc23\levelnfcn23 +\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid-317712510\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \s34\fi-363\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 +\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0 +\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691 +\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;} +\f10\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040 +\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel +\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid477573462} +{\list\listtemplateid-53848358{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab\ai0\af38\afs20 \ltrch\fcs0 \b\i0\f38\fs20\fbias0 \s1 +\fi-357\li357\jclisttab\tx360\lin357 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab\ai0\af38\afs20 \ltrch\fcs0 \b\i0\f38\fs20\fbias0 \s2 +\fi-363\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab\ai0\af38\afs20 \ltrch\fcs0 \b\i0\f38\fs20\fbias0 \s3 +\fi-357\li1077\jclisttab\tx1440\lin1077 }{\listlevel\levelnfc3\levelnfcn3\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab0\ai0\af39\afs20 \ltrch\fcs0 +\b0\i0\strike0\f39\fs20\ulnone\fbias0 \s4\fi-358\li1435\jclisttab\tx1437\lin1435 }{\listlevel\levelnfc1\levelnfcn1\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 +\ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\strike0\f39\fs20\ulnone\fbias0 \s5\fi-357\li1792\jclisttab\tx2155\lin1792 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'05.;}{\levelnumbers +\'01;}\rtlch\fcs1 \ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\f39\fs20\fbias0 \s6\fi-357\li2149\jclisttab\tx2152\lin2149 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\f39\fs20\fbias0 \s7\fi-357\li2506\jclisttab\tx2509\lin2506 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 +{\leveltext\'02i.;}{\levelnumbers;}\rtlch\fcs1 \ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\f39\fs20\fbias0 \s8\fi-357\li2863\jclisttab\tx2866\lin2863 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 +{\leveltext\'02A.;}{\levelnumbers;}\rtlch\fcs1 \ab0\ai0\af39\afs20 \ltrch\fcs0 \b0\i0\f39\fs20\fbias0 \s9\fi-358\li3221\jclisttab\tx3223\lin3221 }{\listname ;}\listid752163927}{\list\listtemplateid-296591990\listhybrid{\listlevel\levelnfc23\levelnfcn23 +\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \s40\fi-357\li2863\jclisttab\tx2866\lin2863 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 +\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 +\fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23 +\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 +\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480 +\jclisttab\tx6480\lin6480 }{\listname ;}\listid810947713}{\list\listtemplateid-1813845996\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;} +\f3\fbias0 \s39\fi-357\li2506\jclisttab\tx2509\lin2506 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 } +{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 +\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 +{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 +\fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel +\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 +\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1219436735}{\list\listtemplateid280937824\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0 +\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li1124\lin1124 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 +\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1844\lin1844 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0 +{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2564\lin2564 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689 +\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li3284\lin3284 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 +\fi-360\li4004\lin4004 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4724\lin4724 }{\listlevel +\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5444\lin5444 }{\listlevel\levelnfc23\levelnfcn23\leveljc0 +\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li6164\lin6164 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 +\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6884\lin6884 }{\listname ;}\listid1422722544}{\list\listtemplateid303218272\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0 +\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid612407812\'01\u-3913 ?;}{\levelnumbers;}\f3\cf18\fbias0 \s36\fi-358\li1435\jclisttab\tx1437\lin1435 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 +\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 +\fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23 +\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 +\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480 +\jclisttab\tx6480\lin6480 }{\listname ;}\listid1559511898}{\list\listtemplateid-743794326\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid2033377338 +\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \s35\fi-357\li1077\jclisttab\tx1080\lin1077 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;} +\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160 +\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2880\jclisttab\tx2880\lin2880 } +{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23 +\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 +\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 +\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1567649130}{\list\listtemplateid-154908222\listhybrid{\listlevel\levelnfc3\levelnfcn3\leveljc0\leveljcn0\levelfollow0 +\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid-596080174\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \ab\ai0\af0 \ltrch\fcs0 \b\i0\fbias0 \s93\fi-360\li360\jclisttab\tx360\lin360 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0 +\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0 +\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1 +\levelspace0\levelindent0{\leveltext\leveltemplateid67698703\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0 +\levelindent0{\leveltext\leveltemplateid67698713\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0 +{\leveltext\leveltemplateid67698715\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\leveltemplateid67698703\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\leveltemplateid67698713\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\leveltemplateid67698715\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1795057320}{\list\listtemplateid-961874242\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 +\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid-1175557160\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \s37\fi-357\li1792\jclisttab\tx1795\lin1792 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 +\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 +{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691 +\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;} +\f10\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040 +\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel +\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1848404271} +{\list\listtemplateid-1802592190\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid1229593488\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \s38\fi-357\li2149 +\jclisttab\tx2152\lin2149 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel +\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23 +\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 +\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 +{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691 +\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;} +\f10\fbias0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1877695764}{\list\listtemplateid1186249844\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext +\leveltemplateid1637229796\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \s33\fi-357\li357\jclisttab\tx360\lin357 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691 +\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;} +\f10\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2880 +\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel +\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23 +\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0 +\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 +{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid2054619191}{\list\listtemplateid758572558\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0 +\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0 +\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext +\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689 +\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 +\fi-360\li3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4320\lin4320 }{\listlevel +\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0 +\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 +\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480\lin6480 }{\listname ;}\listid2085955335}{\list\listtemplateid-235387302\listhybrid{\listlevel\levelnfc23\levelnfcn23 +\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid-1242156798\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li360\lin360 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 +\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1080\lin1080 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0 +{\leveltext\leveltemplateid67698715\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li1800\lin1800 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698703 +\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2520\lin2520 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'01o;}{\levelnumbers;}\f2\fbias0 +\fi-360\li3240\lin3240 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li3960\lin3960 }{\listlevel +\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698703\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li4680\lin4680 }{\listlevel\levelnfc23\levelnfcn23\leveljc0 +\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698713\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5400\lin5400 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1 +\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid67698715\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6120\lin6120 }{\listname ;}\listid2106606675}}{\*\listoverridetable{\listoverride\listid2054619191\listoverridecount0\ls1} +{\listoverride\listid477573462\listoverridecount0\ls2}{\listoverride\listid1567649130\listoverridecount0\ls3}{\listoverride\listid1559511898\listoverridecount0\ls4}{\listoverride\listid1848404271\listoverridecount0\ls5}{\listoverride\listid1877695764 +\listoverridecount0\ls6}{\listoverride\listid1219436735\listoverridecount0\ls7}{\listoverride\listid810947713\listoverridecount0\ls8}{\listoverride\listid196815738\listoverridecount0\ls9}{\listoverride\listid398796681\listoverridecount0\ls10} +{\listoverride\listid394402059\listoverridecount0\ls11}{\listoverride\listid752163927\listoverridecount0\ls12}{\listoverride\listid189493747\listoverridecount0\ls13}{\listoverride\listid2106606675\listoverridecount0\ls14}{\listoverride\listid1559511898 +\listoverridecount0\ls15}{\listoverride\listid1848404271\listoverridecount0\ls16}{\listoverride\listid1848404271\listoverridecount0\ls17}{\listoverride\listid1848404271\listoverridecount0\ls18}{\listoverride\listid1848404271\listoverridecount0\ls19} +{\listoverride\listid1848404271\listoverridecount0\ls20}{\listoverride\listid1848404271\listoverridecount0\ls21}{\listoverride\listid1848404271\listoverridecount0\ls22}{\listoverride\listid1848404271\listoverridecount0\ls23}{\listoverride\listid1848404271 +\listoverridecount0\ls24}{\listoverride\listid1422722544\listoverridecount0\ls25}{\listoverride\listid1848404271\listoverridecount0\ls26}{\listoverride\listid1848404271\listoverridecount0\ls27}{\listoverride\listid1848404271\listoverridecount0\ls28} +{\listoverride\listid1559511898\listoverridecount0\ls29}{\listoverride\listid1559511898\listoverridecount0\ls30}{\listoverride\listid1795057320\listoverridecount0\ls31}{\listoverride\listid1559511898\listoverridecount0\ls32}{\listoverride\listid2085955335 +\listoverridecount0\ls33}}{\*\rsidtbl \rsid864014\rsid921734\rsid1456345\rsid1516446\rsid2370159\rsid3171405\rsid3283580\rsid4090875\rsid6695507\rsid6971592\rsid7940540\rsid8259195\rsid8404268\rsid10029334}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0 +\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\title English}{\creatim\yr2010\mo12\dy9\hr23\min18}{\revtim\yr2010\mo12\dy19\hr11\min55}{\version1}{\edmins0}{\nofpages3}{\nofwords1114}{\nofchars6355} +{\nofcharsws7455}{\vern49255}}{\*\userprops {\propname db_document_id}\proptype30{\staticval 8666}{\propname ContentTypeId}\proptype30{\staticval 0x010100BDA1A6A220A40A419EFB9E5917ACC6AD}{\propname _CopySource}\proptype30{\staticval }{\propname LicenseMo +del}\proptype30{\staticval }{\propname ProductID}\proptype30{\staticval }{\propname FileType}\proptype30{\staticval }{\propname MScom}\proptype30{\staticval 1}{\propname Status}\proptype30{\staticval }{\propname Language}\proptype30{\staticval } +{\propname ProductName}\proptype30{\staticval }{\propname Channel}\proptype30{\staticval }{\propname Originator}\proptype30{\staticval }{\propname PublishDate}\proptype30{\staticval }{\propname RetirementDate}\proptype30{\staticval }{\propname SoftwareTyp +e}\proptype30{\staticval }{\propname ProductVersion}\proptype30{\staticval }{\propname Owner}\proptype30{\staticval }}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}} +\paperw12240\paperh15840\margl720\margr720\margt720\margb720\gutter0\ltrsect +\widowctrl\ftnbj\aenddoc\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata0\grfdocevents0\validatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1\noxlattoyen +\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\formshade\horzdoc\dgmargin\dghspace95\dgvspace180\dghorigin720\dgvorigin720\dghshow2\dgvshow1 +\jexpand\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\rempersonalinfo\allowfieldendsel +\wrppunct\asianbrkrule\rsidroot1456345\newtblstyruls\nogrowautofit\usenormstyforlist\noindnmbrts\felnbrelev\nocxsptable\indrlsweleven\noafcnsttbl\afelev\utinl\hwelev\spltpgpar\notcvasp\notbrkcnstfrctbl\notvatxbx\krnprsnet\cachedcolbal \nouicompat \fet0 +{\*\wgrffmtfilter 013f}\nofeaturethrottle1\ilfomacatclnup12{\*\ftnsep \ltrpar \pard\plain \ltrpar\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid2370159 \chftnsep +\par }}{\*\ftnsepc \ltrpar \pard\plain \ltrpar\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid2370159 \chftnsepc +\par }}{\*\aftnsep \ltrpar \pard\plain \ltrpar\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid2370159 \chftnsep +\par }}{\*\aftnsepc \ltrpar \pard\plain \ltrpar\ql \li0\ri0\sb120\sa120\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid2370159 \chftnsepc +\par }}\ltrpar \sectd \ltrsect\psz1\linex0\headery0\footery0\endnhere\sectlinegrid360\sectdefaultcl\sectrsid1456345\sftnbj {\headerl \ltrpar \pard\plain \ltrpar\s81\ql \li0\ri0\sb120\sa120\widctlpar +\tqc\tx4320\tqr\tx8640\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38 \ltrch\fcs0 +\insrsid1456345 +\par }}{\headerr \ltrpar \pard\plain \ltrpar\s81\ql \li0\ri0\sb120\sa120\widctlpar\tqc\tx4320\tqr\tx8640\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38 \ltrch\fcs0 \insrsid1456345 +\par }}{\footerl \ltrpar \pard\plain \ltrpar\s83\ql \li0\ri0\sb120\sa120\widctlpar\tqc\tx4320\tqr\tx8640\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38 \ltrch\fcs0 \insrsid1456345 +\par }}{\footerr \ltrpar \pard\plain \ltrpar\s83\ql \li0\ri0\sb120\sa120\widctlpar\tqc\tx4320\tqr\tx8640\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38 \ltrch\fcs0 \insrsid1456345 +\par }}{\headerf \ltrpar \pard\plain \ltrpar\s81\ql \li0\ri0\sb120\sa120\widctlpar\tqc\tx4320\tqr\tx8640\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38 \ltrch\fcs0 \insrsid1456345 +\par }}{\footerf \ltrpar \pard\plain \ltrpar\s83\ql \li0\ri0\sb120\sa120\widctlpar\tqc\tx4320\tqr\tx8640\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38 \ltrch\fcs0 \insrsid1456345 +\par }}{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}} +{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8 +\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ltrpar +\s42\ql \li0\ri0\sb120\sa120\nowidctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs28\alang1025 \ltrch\fcs0 +\b\fs28\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 {\*\bkmkstart _GoBack}{\*\bkmkend _GoBack}\hich\af38\dbch\af13\loch\f38 +MICROSOFT SOFTWARE LICENSE TERMS}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par }\pard\plain \ltrpar\s43\ql \li0\ri0\sb120\sa120\nowidctlpar\brdrb\brdrs\brdrw10\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs28\alang1025 \ltrch\fcs0 +\b\fs28\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 MICROSOFT SQL SERVER COMPACT 4.0 }{\rtlch\fcs1 \af38\afs20 +\ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par }\pard\plain \ltrpar\s44\ql \li0\ri0\sb120\sa120\nowidctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 +\b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 +These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. The terms +\hich\af38\dbch\af13\loch\f38 a\hich\af38\dbch\af13\loch\f38 lso apply to any Microsoft}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}\pard\plain \ltrpar\s34\ql \fi-360\li360\ri0\sb120\sa120\nowidctlpar +\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin360\itap0\pararsid8259195 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 +\af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 updates,}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 +supplements,}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 +Internet-based services, and}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 +support services}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par }\pard\plain \ltrpar\s44\ql \li0\ri0\sb120\sa120\nowidctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 +\b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 +for this software, unless other terms accompany those items. If so, those terms apply.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 +\par }{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 +\fs20\dbch\af13\insrsid1456345 +\par }\pard\plain \ltrpar\s61\ql \li0\ri0\sb120\sa120\nowidctlpar\brdrt\brdrs\brdrw10\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 +\b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 If you comply with these license terms, you have the rights below.}{ +\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 1.\tab}}\pard\plain \ltrpar\s1\ql \fi-357\li357\ri0\sb120\sa120\nowidctlpar +\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls12\outlinelevel0\adjustright\rin0\lin357\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 { +\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 INSTALLATION AND USE RIGHTS. }{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s2 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid921734 \hich\af38\dbch\af13\loch\f38 a.\tab}}\pard\plain \ltrpar\s2\ql \fi-363\li720\ri0\sb120\sa120\nowidctlpar +\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl1\outlinelevel1\adjustright\rin0\lin720\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 +\b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid921734 \hich\af38\dbch\af13\loch\f38 Installation and Use.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 +\cs57\b0\fs20\dbch\af13\insrsid921734 \hich\af38\dbch\af13\loch\f38 You may install and use any numb\hich\af38\dbch\af13\loch\f38 er of copies of the software on your devices to design, develop and test your programs for use with the software. +\par {\listtext\pard\plain\ltrpar \s2 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid921734\charrsid3283580 \hich\af38\dbch\af13\loch\f38 b.\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 +\fs20\dbch\af13\insrsid921734\charrsid3283580 \hich\af38\dbch\af13\loch\f38 Included Microsoft Programs. }{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid921734\charrsid3283580 \hich\af38\dbch\af13\loch\f38 +The software contains the Microsoft Visual C++ 2008 Express}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid921734 \hich\af38\dbch\af13\loch\f38 }{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid10029334 +\hich\af38\dbch\af13\loch\f38 Edition }{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid921734 \hich\af38\dbch\af13\loch\f38 components listed below}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 +\b0\fs20\dbch\af13\insrsid921734\charrsid3283580 \hich\af38\dbch\af13\loch\f38 . You may only use these components with the software.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8259195 \hich\af38\dbch\af13\loch\f38 }{\rtlch\fcs1 +\ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid921734\charrsid3283580 \hich\af38\dbch\af13\loch\f38 The Microsoft Visual C++ 2008 Express license terms located at }{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf17\insrsid921734\charrsid3283580 +\hich\af38\dbch\af11\loch\f38 %Program Files%\\Microsoft SQL Server Compact Edition\\v4.0 }{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid921734\charrsid3283580 \hich\af38\dbch\af13\loch\f38 +apply to your use of them, except that the components listed below may be used f\hich\af38\dbch\af13\loch\f38 or commercial hosting services when used in conjunction with the}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid921734 +\hich\af38\dbch\af13\loch\f38 software.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid921734\charrsid3283580 \hich\af38\dbch\af13\loch\f38 }{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid921734 +\par {\listtext\pard\plain\ltrpar \s94 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f3\fs20\insrsid921734\charrsid3283580 \loch\af3\dbch\af11\hich\f3 \'b7\tab}}\pard\plain \ltrpar\s94\ql \fi-360\li1080\ri0\sb120\sa120\sl276\slmult1 +\nowidctlpar\wrapdefault\aspalpha\aspnum\faauto\ls33\adjustright\rin0\lin1080\itap0\pararsid8259195\contextualspace \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe1033\loch\af31506\hich\af31506\dbch\af11\cgrid\langnp1033\langfenp1033 { +\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f38\fs20\insrsid921734\charrsid3283580 \hich\af38\dbch\af11\loch\f38 Microsoft_VC90_CRT_x86.msm +\par {\listtext\pard\plain\ltrpar \s94 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f3\fs20\insrsid921734\charrsid3283580 \loch\af3\dbch\af11\hich\f3 \'b7\tab}\hich\af38\dbch\af11\loch\f38 policy_9_0_Microsoft_VC90_CRT_x86.msm +\par {\listtext\pard\plain\ltrpar \s94 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f3\fs20\insrsid921734\charrsid3283580 \loch\af3\dbch\af11\hich\f3 \'b7\tab}\hich\af38\dbch\af11\loch\f38 Microsoft_VC90_CRT_x86_x64.msm +\par {\listtext\pard\plain\ltrpar \s94 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f3\fs20\insrsid921734\charrsid3283580 \loch\af3\dbch\af11\hich\f3 \'b7\tab}\hich\af38\dbch\af11\loch\f38 policy_9_0_Microsoft_VC90_CRT_x86_x64.msm +\par {\listtext\pard\plain\ltrpar \s94 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f3\fs20\insrsid921734\charrsid3283580 \loch\af3\dbch\af11\hich\f3 \'b7\tab}\hich\af38\dbch\af11\loch\f38 VC90.CRT_X86_msvcr90.dll +\par {\listtext\pard\plain\ltrpar \s94 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f3\fs20\lang1046\langfe1033\langnp1046\insrsid921734\charrsid864014 \loch\af3\dbch\af11\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 +\f38\fs20\lang1046\langfe1033\langnp1046\insrsid921734\charrsid864014 \hich\af38\dbch\af11\loch\f38 VC90.\hich\af38\dbch\af11\loch\f38 CRT_X86_Microsoft.VC90.CRT.manifest +\par {\listtext\pard\plain\ltrpar \s94 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f3\fs20\insrsid921734\charrsid3283580 \loch\af3\dbch\af11\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f38\fs20\insrsid921734\charrsid3283580 \hich\af38\dbch\af11\loch\f38 +VC90.CRT_AMD64_msvcr90.dll +\par {\listtext\pard\plain\ltrpar \s94 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \f3\fs20\lang1046\langfe1033\langnp1046\insrsid921734\charrsid864014 \loch\af3\dbch\af11\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 +\f38\fs20\lang1046\langfe1033\langnp1046\insrsid921734\charrsid864014 \hich\af38\dbch\af11\loch\f38 VC90.CRT_AMD64_Microsoft.VC90.CRT.manifest +\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 2.\tab}}\pard\plain \ltrpar\s1\ql \fi-357\li357\ri0\sb120\sa120\nowidctlpar +\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls12\outlinelevel0\adjustright\rin0\lin357\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 { +\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s2 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 a.\tab}}\pard\plain \ltrpar\s2\ql \fi-363\li720\ri0\sb120\sa120\nowidctlpar +\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl1\outlinelevel1\adjustright\rin0\lin720\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 +\b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 Distributable Code.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 +\cs57\b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 The software contains code that you are per\hich\af38\dbch\af13\loch\f38 mitted to distribute in programs you develop if you comply with the terms below.}{\rtlch\fcs1 \ab0\af38\afs20 +\ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s49 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 i.\tab}}\pard\plain \ltrpar\s49\ql \fi-357\li1077\ri0\sb120\sa120\nowidctlpar +\jclisttab\tx1080\wrapdefault\aspalpha\aspnum\faauto\ls10\ilvl2\outlinelevel2\adjustright\rin0\lin1077\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 +\b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 Right to Use and Distribute.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 +\cs58\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 \hich\f38 The code and text files listed below are \'93\loch\f38 \hich\f38 Distributable Code.\'94}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s50 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}\pard\plain \ltrpar\s50\ql \fi-358\li1435\ri0\sb120\sa120\nowidctlpar +\jclisttab\tx1437\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin1435\itap0\pararsid8259195 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\ul\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 +\af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 REDIST.TXT Files}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\ulnone\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 +. You may copy and distribute the object code form of code lis\hich\af38\dbch\af13\loch\f38 ted in REDIST.TXT files.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\ulnone\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s50 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 +\hich\af38\dbch\af13\loch\f38 Third Party Distribution}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\ulnone\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 +. You may permit distributors of your programs to copy and distribute the Distributable Code as part of those programs.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\ulnone\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s49 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 ii.\tab}}\pard\plain \ltrpar\s49\ql \fi-357\li1077\ri0\sb120\sa120\nowidctlpar +\jclisttab\tx1077\wrapdefault\aspalpha\aspnum\faauto\ls10\ilvl2\outlinelevel2\adjustright\rin0\lin1077\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 +\b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 Distribution Requirements.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 +\cs58\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 For any Distributable Code you distribute, you must}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}\pard\plain \ltrpar\s36\ql \fi-358\li1435\ri0\sb120\sa120\nowidctlpar +\jclisttab\tx1437\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin1435\itap0\pararsid8259195 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 +\af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 add significant primary functionality to it in your programs;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 +\hich\af38\dbch\af13\loch\f38 for any Distributable Code having a filename extension of .lib, distribute only the results of running such Distributable Code through a linker with your program;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 +\fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 +\hich\af38\dbch\af13\loch\f38 distribute Distributable Co\hich\af38\dbch\af13\loch\f38 de included in a setup program only as part of that setup program without modification;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 +\hich\af38\dbch\af13\loch\f38 require distributors and external end users to agree to terms that protect it at least as much as this agreement; }{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 +\hich\af38\dbch\af13\loch\f38 display your valid copyright notice on your progr\hich\af38\dbch\af13\loch\f38 ams; and}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 +\hich\af38\dbch\af13\loch\f38 indemnify, defend, and hold harmless Microsoft from any claims, including attorneys\hich\f38 \rquote \loch\f38 fees, related to the distribution or use of your programs.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 +\fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s49 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 iii.\tab}}\pard\plain \ltrpar\s49\ql \fi-357\li1077\ri0\sb120\sa120\nowidctlpar +\jclisttab\tx1077\wrapdefault\aspalpha\aspnum\faauto\ls10\ilvl2\outlinelevel2\adjustright\rin0\lin1077\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 +\b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 Distribution Restrictions.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 +\cs58\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 You may not}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}\pard\plain \ltrpar\s36\ql \fi-358\li1435\ri0\sb120\sa120\nowidctlpar +\jclisttab\tx1437\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin1435\itap0\pararsid8259195 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 +\af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 alter any copyright, trademark or patent notice in the Distributable Code;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 +\hich\af38\dbch\af13\loch\f38 use Microsoft\hich\f38 \rquote \loch\f38 s trademarks in your programs\hich\f38 \rquote \loch\f38 names or in a way that suggests your programs come from or are endorsed by Microsoft;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 +\fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 +\hich\af38\dbch\af13\loch\f38 distribute Distributable Code to run on a plat\hich\af38\dbch\af13\loch\f38 form other than the Windows platform;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 +\hich\af38\dbch\af13\loch\f38 include Distributable Code in malicious, deceptive or unlawful programs; or}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s36 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\cf18\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 +\hich\af38\dbch\af13\loch\f38 modify or distribute the source code of any Distributable Code so that any part of it becomes subject to an Excluded License. An Excluded \hich\af38\dbch\af13\loch\f38 +License is one that requires, as a condition of use, modification or distribution, that}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s37 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}\pard\plain \ltrpar\s37\ql \fi-357\li1792\ri0\sb120\sa120\nowidctlpar +\jclisttab\tx1795\wrapdefault\aspalpha\aspnum\faauto\ls5\adjustright\rin0\lin1792\itap0\pararsid8259195 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 +\af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 the code be disclosed or distributed in source code form; or}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s37 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 +others have the right to modify it.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 3.\tab}}\pard\plain \ltrpar\s1\ql \fi-357\li357\ri0\sb120\sa120\nowidctlpar +\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls12\outlinelevel0\adjustright\rin0\lin357\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 { +\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 SCOPE OF LICENSE.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 + The software is licensed, not sold. This agree\hich\af38\dbch\af13\loch\f38 +ment only gives you some rights to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must co +\hich\af38\dbch\af13\loch\f38 m\hich\af38\dbch\af13\loch\f38 ply with any technical limitations in the software that only allow you to use it in certain ways. You may not}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}\pard\plain \ltrpar\s34\ql \fi-363\li720\ri0\sb120\sa120\nowidctlpar +\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin720\itap0\pararsid8259195 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 +\af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 work around any technical limitations in the software;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 +reverse engineer, decompile or disassemble the software, except and only to the extent \hich\af38\dbch\af13\loch\f38 that applicable law expressly permits, despite this limitation;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 + +\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 +make more copies of the software than specified in this agreement or allowed by applicable law, despite this limitation;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 +publish the software for others to copy;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 +rent, lease or lend the software;}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid921734 \hich\af38\dbch\af13\loch\f38 or}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 +transfer the software or th}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid921734 \hich\af38\dbch\af13\loch\f38 is agreement to any third party. }{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345\charrsid921734 +\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 4.\tab}}\pard\plain \ltrpar\s1\ql \fi-357\li357\ri0\sb120\sa120\nowidctlpar +\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls12\outlinelevel0\adjustright\rin0\lin357\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 { +\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 BACKUP COPY.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 + You may make one backup copy of the software. You may use it only to reinstall the software.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 5.\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 +\hich\af38\dbch\af13\loch\f38 DOCUMENTATION.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 Any person that has valid acc\hich\af38\dbch\af13\loch\f38 +ess to your computer or internal network may copy and use the documentation for your internal, reference purposes.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 6.\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 +\hich\af38\dbch\af13\loch\f38 EXPORT RESTRICTIONS.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 + The software is subject to United States export laws and regulations. You must comply with all domestic and internati\hich\af38\dbch\af13\loch\f38 +onal export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see }{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \cs73\b0\fs20\dbch\af13\insrsid8404268 +\hich\af38\dbch\af13\loch\f38 www.microsoft.com/exporting}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 .}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \cs73\b0\fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 7.\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 +\hich\af38\dbch\af13\loch\f38 SUPPORT SERVICES. }{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 \hich\f38 Because this software is \'93\loch\f38 \hich\f38 as is,\'94\loch\f38 we may +\hich\af38\dbch\af13\loch\f38 not provide support services for it.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 8.\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 +\hich\af38\dbch\af13\loch\f38 ENTIRE AGREEMENT.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 + This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 + +\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 9.\tab}}\pard \ltrpar\s1\ql \fi-360\li360\ri0\sb120\sa120\nowidctlpar +\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls12\outlinelevel0\adjustright\rin0\lin360\itap0\pararsid8259195 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 APPLICABLE LAW.}{\rtlch\fcs1 +\af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s2 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 a.\tab}}\pard\plain \ltrpar\s2\ql \fi-363\li720\ri0\sb120\sa120\nowidctlpar +\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls12\ilvl1\outlinelevel1\adjustright\rin0\lin720\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 +\b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 United States.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 +\b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 + If you acquired the software in the United States, Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live g +\hich\af38\dbch\af13\loch\f38 overn all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s2 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 b.\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 +\hich\af38\dbch\af13\loch\f38 Outside the United States.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 If you acquired the software in any other country, the laws of that country apply.}{ +\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 10.\tab}}\pard\plain \ltrpar\s1\ql \fi-357\li357\ri0\sb120\sa120\nowidctlpar +\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls12\outlinelevel0\adjustright\rin0\lin357\itap0\pararsid8259195 \rtlch\fcs1 \ab\af38\afs19\alang1025 \ltrch\fcs0 \b\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 { +\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 LEGAL EFFECT.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 This agr\hich\af38\dbch\af13\loch\f38 +eement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your coun +\hich\af38\dbch\af13\loch\f38 t\hich\af38\dbch\af13\loch\f38 ry if the laws of your country do not permit it to do so.}{\rtlch\fcs1 \ab0\af38\afs20 \ltrch\fcs0 \b0\fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 11.\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 +\hich\af38\dbch\af13\loch\f38 \hich\f38 DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED \'93\loch\f38 \hich\f38 AS-IS.\'94\loch\f38 + YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR CONDITIONS. YOU MAY HAVE ADDITIONAL CONSUMER RIGHTS \hich\af38\dbch\af13\loch\f38 +UNDER YOUR LOCAL LAWS WHICH THIS AGREEMENT CANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.}{\rtlch\fcs1 \af38\afs20 +\ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s1 \rtlch\fcs1 \ab\af38\afs20 \ltrch\fcs0 \b\fs20\loch\af38\hich\af38\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 12.\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 +\hich\af38\dbch\af13\loch\f38 LIMITATION ON AND EXC\hich\af38\dbch\af13\loch\f38 LUSION OF REMEDIES AND DAMAGES}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\insrsid8404268 \hich\af38\dbch\af11\loch\f38 +. YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 +\fs20\insrsid1456345 +\par }\pard\plain \ltrpar\s24\ql \li357\ri0\sb120\sa120\nowidctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin357\itap0\pararsid8259195 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 This limitation app\hich\af38\dbch\af13\loch\f38 lies to}{\rtlch\fcs1 +\af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}\pard\plain \ltrpar\s34\ql \fi-363\li720\ri0\sb120\sa120\nowidctlpar +\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin720\itap0\pararsid8259195 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 \fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 +\af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 +\fs20\dbch\af13\insrsid1456345 +\par {\listtext\pard\plain\ltrpar \s34 \rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\loch\af3\hich\af3\dbch\af13\insrsid8404268 \loch\af3\dbch\af13\hich\f3 \'b7\tab}}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 +claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other t\hich\af38\dbch\af13\loch\f38 ort to the extent permitted by applicable law.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 +\fs20\dbch\af13\insrsid1456345 +\par }\pard\plain \ltrpar\ql \li360\ri0\sb120\sa120\nowidctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0\pararsid8259195 \rtlch\fcs1 \af38\afs19\alang1025 \ltrch\fcs0 +\fs19\lang1033\langfe1033\loch\af38\hich\af38\dbch\af11\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid8404268 \hich\af38\dbch\af13\loch\f38 +It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limi\hich\af38\dbch\af13\loch\f38 +tation of incidental, consequential or other damages.}{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid1456345 +\par }{\rtlch\fcs1 \af38\afs20 \ltrch\fcs0 \fs20\dbch\af13\insrsid864014 +\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a +9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad +5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6 +b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0 +0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6 +a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f +c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512 +0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462 +a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865 +6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b +4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b +4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f +7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87 +615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad +79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b +5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab +999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9 +699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586 +8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6 +0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f +9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be +15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979 +3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d +32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a +f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86 +e877f0034e16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb +44f95d843b5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a +6409fb44d08741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c +3d9058edf2c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db0256 +5e85f3b9660d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276 +b9f7dec44b7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8 +c33585b5fb9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e +51440ca2e0088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95 +b21be5ceaf8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff +6dce591a26ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec6 +9ffb9e65d028d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239 +b75a5bb1e6345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a449 +59d366ad93b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e8 +2db8df9f30254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468 +656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4 +350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d2624 +52282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe5141 +73d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0fbfff0000001c020000130000000000000000 +0000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b00000000000000 +000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c0000000000000000000000000019 +0200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b00001600000000 +000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b01000027 +00000000000000000000000000a00900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d0100009b0a00000000} +{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d +617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169 +6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363 +656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e} +{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9; +\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7; +\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000 +4d73786d6c322e534158584d4c5265616465722e362e30000000000000000000004a0000 +d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff0900060000000000000000000000010000000100000000000000001000000200000001000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffdffffff04000000feffffff050000000e000000060000000700000008000000090000000a0000000b0000000c0000000d0000000f000000110000001000000022000000feffffff130000001400000015000000160000001700000018000000190000001a0000001b0000001c0000001d0000001e00 +00001f0000002000000021000000feffffff23000000feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffff010000000c6ad98892f1d411a65f0040963251e5000000000000000000000000103c +1c77459fcb0103000000c01a0000000000004d0073006f004400610074006100530074006f0072006500000000000000000000000000000000000000000000000000000000000000000000000000000000001a000101ffffffffffffffff050000000000000000000000000000000000000000000000103c1c77459fcb01 +103c1c77459fcb01000000000000000000000000c70053005a00db00c300dd004e00c300c800d40053003100c800420044005500d80059004600ca00430051003d003d000000000000000000000000000000000032000101ffffffffffffffff030000000000000000000000000000000000000000000000103c1c77459f +cb01103c1c77459fcb010000000000000000000000004900740065006d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffff04000000ffffffff000000000000000000000000000000000000000000000000 +00000000000000000000000000000000c100000000000000010000000200000003000000feffffff0500000006000000070000000800000009000000feffffff0b0000000c0000000d0000000e0000000f000000100000001100000012000000130000001400000015000000160000001700000018000000190000001a00 +00001b0000001c0000001d0000001e0000001f000000200000002100000022000000230000002400000025000000260000002700000028000000290000002a0000002b0000002c0000002d0000002e0000002f00000030000000310000003200000033000000340000003500000036000000370000003800000039000000 +3a0000003b0000003c0000003d0000003e0000003f00000040000000410000004200000043000000440000004500000046000000470000004800000049000000feffffff4b0000004c0000004d0000004e0000004f000000feffffff510000005200000053000000feffffff550000005600000057000000580000005900 +0000feffffff5b0000005c0000005d0000005e0000005f000000600000006100000062000000630000006400000065000000660000006700000068000000690000006a000000feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d227574662d3822207374616e64616c6f6e653d22796573223f3e3c44696374696f6e617279205361766564427956657273696f6e3d22332e362e31382e3022204d +696e696d756d56657273696f6e3d22332e362e342e302220786d6c6e733d22687474703a2f2f736368656d61732e627573696e6573732d696e746567726974792e636f6d2f6465616c6275696c6465722f323030362f64696374696f6e617279222f3e000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000003c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d226e6f223f3e0d0a3c64733a6461746173746f72654974656d2064733a6974656d49443d227b38463742 +323639442d363344332d343441332d394241302d3130443445313831364130397d2220786d6c6e733a64733d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f637573746f6d586d6c223e3c64733a736368656d61526566733e3c +64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e62757369500072006f007000650072007400690065007300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000200ffffffffffffffffffffffff000000000000 +000000000000000000000000000000000000000000000000000000000000040000005401000000000000ce00c90032004a0031005500d600cd004a00c4003400d500db00d8005900d3005800450045004100440041003d003d00000000000000000000000000000000003200010102000000080000000600000000000000 +00000000000000000000000000000000103c1c77459fcb01103c1c77459fcb010000000000000000000000004900740065006d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffff07000000ffffffff0000 +000000000000000000000000000000000000000000000000000000000000000000000a000000f50f000000000000500072006f007000650072007400690065007300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000200ffffffffffffffffffffffff +0000000000000000000000000000000000000000000000000000000000000000000000004a00000051010000000000006e6573732d696e746567726974792e636f6d2f6465616c6275696c6465722f323030362f64696374696f6e617279222f3e3c2f64733a736368656d61526566733e3c2f64733a6461746173746f72 +654974656d3e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d227574662d3822207374616e64616c6f6e653d22796573223f3e3c53657373696f6e20786d6c6e733d22687474703a +2f2f736368656d61732e627573696e6573732d696e746567726974792e636f6d2f6465616c6275696c6465722f323030362f616e7377657273223e3c5661726961626c65204e616d653d22636f6e74726163747265666572656e6365222052656c6576616e743d2266616c7365223e3c56616c75653e323031302d4d4149 +4e422d3030313031333c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d226d73636f6d223e3c56616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d2266696c6574797065223e3c56616c75653e2e7274663c2f56616c7565 +3e3c2f5661726961626c653e3c5661726961626c65204e616d653d226c616e6775616765616c6c223e3c56616c75653e456e676c6973683c2f56616c75653e3c56616c75653e4368696e657365202853696d706c6966696564293c2f56616c75653e3c56616c75653e4368696e6573652028547261646974696f6e616c29 +3c2f56616c75653e3c56616c75653e437a6563683c2f56616c75653e3c56616c75653e4672656e63683c2f56616c75653e3c56616c75653e4765726d616e3c2f56616c75653e3c56616c75653e4974616c69616e3c2f56616c75653e3c56616c75653e4a6170616e6573653c2f56616c75653e3c56616c75653e4b6f7265 +616e3c2f56616c75653e3c56616c75653e506f6c6973683c2f56616c75653e3c56616c75653e506f727475677565736520284272617a696c293c2f56616c75653e3c56616c75653e5275737369616e3c2f56616c75653e3c56616c75653e5370616e6973683c2f56616c75653e3c56616c75653e5475726b6973683c2f56 +616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d225f5f72657175657374646967657374222052656c6576616e743d2266616c7365223e3c56616c75653e3078464532363934364137393337363741383635383139334236383646353743433745453838394237353842444536304337444435 +39313644303831354244424344374335363534444137353735353430323832393342384331414345463833393630344143344634383342454533313330394235394442384434393734454335322c30392044656320323031302032323a32323a3430202d303030303c2f56616c75653e3c2f5661726961626c653e3c5661 +726961626c65204e616d653d225f5f6576656e7476616c69646174696f6e222052656c6576616e743d2266616c7365223e3c56616c75653e2f77455741674b4f3239697043414c623449756d444c2b75437032397970624e71637a6d5230493767414e52424e67333c2f56616c75653e3c2f5661726961626c653e3c5661 +726961626c65204e616d653d2263746c303024706c616365686f6c6465726d61696e24686663657370636f6e74726163747265666572656e6365222052656c6576616e743d2266616c7365223e3c56616c75653e323031302d4d41494e422d3030313031333c2f56616c75653e3c2f5661726961626c653e3c5661726961 +626c65204e616d653d2263616e616461617661696c223e3c56616c75653e747275653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d2263616e6164616672656e6368223e3c56616c75653e747275653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d +653d2266696c65666f726d6174223e3c56616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d22736f66747761726574797065223e3c56616c75653e467265652c205374616e64616c6f6e6520536f6674776172653c2f56616c75653e3c2f5661726961626c65 +3e3c5661726961626c65204e616d653d2270726f647563746e616d65223e3c56616c75653e53514c2053657276657220436f6d7061637420342e303c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d226e756d6265726f66636f70696573223e3c56616c75653e416e79206e756d6265 +72206f6620636f706965733c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d2270726f6475637476657273696f6e223e3c56616c75653e4e6f6e653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d2276657273696f6e76697369626c65223e3c56 +616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d226368616e6e656c223e3c56616c75653e52657461696c3c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d227374616e64616c6f6e657573657269676874223e3c56616c +75653e4f6e6c7920746f2064657369676e2c20646576656c6f7020616e64207465737420746865207573657227732070726f6772616d733c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d226d65646961656c656d656e747374656d706c61746573223e3c56616c75653e66616c7365 +3c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d2264697374726962757461626c65636f6465223e3c56616c75653e747275653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d2264697374726962757461626c65636f646574797065223e3c5661 +6c75653e5265646973742e7478743c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d227265646973747478746f6e6c696e65223e3c56616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d22696e7465726e616c7265617373 +69676e6d656e74223e3c56616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d226c6963656e73657472616e73666572223e3c56616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d226f746865726d +6963726f736f667470726f6772616d73223e3c56616c75653e747275653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d226e65746672616d65776f726b223e3c56616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d226f +746865726d6963726f736f667470726f6772616d737465726d73223e3c56616c75653e546865207365706172617465206c6963656e7365207465726d73206173736f636961746564207769746820746865206f74686572204d6963726f736f66742070726f6772616d733c2f56616c75653e3c2f5661726961626c653e3c +5661726961626c65204e616d653d2270726572656c65617365636f6465223e3c56616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d227468697264706172747970726f6772616d73223e3c56616c75653e66616c73653c2f56616c75653e3c2f566172696162 +6c653e3c5661726961626c65204e616d653d2262656e63686d61726b696e67223e3c56616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d226d706567223e3c56616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65 +204e616d653d22696e7465726e657462617365647365727669636573223e3c56616c75653e66616c73653c2f56616c75653e3c2f5661726961626c653e3c5661726961626c65204e616d653d225f5f6576656e7474617267657422204b6e6f776e3d2266616c7365222052656c6576616e743d2266616c7365222f3e3c56 +61726961626c65204e616d653d225f5f6576656e74617267756d656e7422204b6e6f776e3d2266616c7365222052656c6576616e743d2266616c7365222f3e3c5661726961626c65204e616d653d226c61756e6368646976616374696f6e22204b6e6f776e3d2266616c7365222052656c6576616e743d2266616c736522 +2f3e3c5661726961626c65204e616d653d225f5f737064756d6d79746578743122204b6e6f776e3d2266616c7365222052656c6576616e743d2266616c7365222f3e3c5661726961626c65204e616d653d225f5f737064756d6d79746578743222204b6e6f776e3d2266616c7365222052656c6576616e743d2266616c73 +65222f3e3c5661726961626c65204e616d653d226f726967696e61746f72223e3c56616c75653e5245444d4f4e445c64636f7265793c2f56616c75653e3c2f5661726961626c653e3c506172616d65746572204e616d653d2264625f646973706c61795f616c6c5f636f6d6d656e7473223e3c56616c75653e66616c7365 +3c2f56616c75653e3c2f506172616d657465723e3c506172616d65746572204e616d653d2264625f73686f775f73756d6d617279223e3c56616c75653e64697361626c65643c2f56616c75653e3c2f506172616d657465723e3c506172616d65746572204e616d653d2264625f74656d706c6174655f666f726d223e3c56 +616c75653e35323032636439312d396439322d343338612d386637642d3630613864313464336162303c2f56616c75653e3c2f506172616d657465723e3c506172616d65746572204e616d653d2264625f74656d706c6174655f7265666572656e6365223e3c56616c75653e5553455445524d535f4d41494e423c2f5661 +6c75653e3c2f506172616d657465723e3c506172616d65746572204e616d653d2264625f74656d706c6174655f76657273696f6e223e3c56616c75653e32303130313130393c2f56616c75653e3c2f506172616d657465723e3c506172616d65746572204e616d653d2264625f7472616e73616374696f6e5f6578746572 +6e616c5f6c6162656c223e3c56616c75653e323031302d4d41494e422d3030313031333c2f56616c75653e3c2f506172616d657465723e3c506172616d65746572204e616d653d2264625f7472616e73616374696f6e5f6964223e3c56616c75653e333432323c2f56616c75653e3c2f506172616d657465723e3c506172 +616d65746572204e616d653d2264625f766973697465645f7061676573223e3c56616c75653e313c2f56616c75653e3c56616c75653e323c2f56616c75653e3c56616c75653e333c2f56616c75653e3c56616c75653e343c2f56616c75653e3c56616c75653e363c2f56616c75653e3c56616c75653e373c2f56616c7565 +3e3c56616c75653e313c2f56616c75653e3c56616c75653e323c2f56616c75653e3c56616c75653e333c2f56616c75653e3c56616c75653e313c2f56616c75653e3c56616c75653e313c2f56616c75653e3c2f506172616d657465723e3c2f53657373696f6e3e00000000000000000000003c3f786d6c2076657273696f +6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d226e6f223f3e0d0a3c64733a6461746173746f72654974656d2064733a6974656d49443d227b36443039393742412d414434442d343732362d423545462d3836333335433431303030437d2220786d6c6e733a64733d22687474 +703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f637573746f6d586d6c223e3c64733a736368656d61526566733e3c64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e627573696e6573732d696e74 +6567726974792e636f6d2f6465616c6275696c6465722f323030362f616e7377657273222f3e3c2f64733a736368656d61526566733e3c2f64733a6461746173746f72654974656d3e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d100c7003500 +c3004700c200c400d50056005500ca00dc00c600d30051004a004a003200dd00c600320041003d003d000000000000000000000000000000000032000101ffffffff0b000000090000000000000000000000000000000000000000000000103c1c77459fcb01103c1c77459fcb0100000000000000000000000049007400 +65006d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffff0a000000ffffffff00000000000000000000000000000000000000000000000000000000000000000000000050000000db000000000000005000 +72006f007000650072007400690065007300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000200ffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000540000004f01000000000000 +d300c300d4004f005600d400c000440034005500ce00df004400ce005a005100c100df0034005400550051003d003d000000000000000000000000000000000032000100ffffffffffffffff0c0000000000000000000000000000000000000000000000103c1c77459fcb01103c1c77459fcb0100000000000000000000 +00003c3f6d736f2d636f6e74656e74547970653f3e3c466f726d54656d706c6174657320786d6c6e733d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f7368617265706f696e742f76332f636f6e74656e74747970652f666f726d73223e3c446973706c61793e446f63756d656e744c696272 +617279466f726d3c2f446973706c61793e3c456469743e446f63756d656e744c696272617279466f726d3c2f456469743e3c4e65773e446f63756d656e744c696272617279466f726d3c2f4e65773e3c2f466f726d54656d706c617465733e00000000000000000000000000000000000000000000000000000000000000 +0000000000003c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d226e6f223f3e0d0a3c64733a6461746173746f72654974656d2064733a6974656d49443d227b31414533373743362d333532392d344135352d424339422d33343039323543463636 +37307d2220786d6c6e733a64733d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f637573746f6d586d6c223e3c64733a736368656d61526566733e3c64733a736368656d615265662064733a7572693d22687474703a2f2f7363 +68656d61732e6d6963726f736f66742e636f6d2f7368617265706f696e742f76332f636f6e74656e74747970652f666f726d73222f3e3c2f64733a736368656d61526566733e3c2f64733a6461746173746f72654974656d3e00000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000003c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d226e6f223f3e0d0a3c64733a6461746173746f72654974656d2064733a6974656d49443d227b35373045334443452d303334382d344237392d424630452d45363530 +38374637393335317d2220786d6c6e733a64733d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f637573746f6d586d6c223e3c64733a736368656d61526566733e3c64733a736368656d615265662064733a7572693d22687474 +703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f6d657461646174612f636f6e74656e7454797065222f3e3c64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f6d65 +7461646174612f70726f706572746965732f4900740065006d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffff0d000000ffffffff00000000000000000000000000000000000000000000000000000000 +000000000000000012000000761f000000000000500072006f007000650072007400690065007300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000200ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000 +000000000000000000005a00000004040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000003c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d227574662d38223f3e3c63743a636f6e74656e7454797065536368656d612063743a5f3d2222206d613a5f3d2222206d613a636f6e74656e74547970654e616d653d22446f6375 +6d656e7422206d613a636f6e74656e745479706549443d223078303130313030424441314136413232304134304134313945464239453539313741434336414422206d613a636f6e74656e745479706556657273696f6e3d22313722206d613a636f6e74656e74547970654465736372697074696f6e3d22437265617465 +2061206e657720646f63756d656e742e22206d613a636f6e74656e745479706553636f70653d2222206d613a76657273696f6e49443d2266343736346339666166646632336436653035343862333630623130346130332220786d6c6e733a63743d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f +6d2f6f66666963652f323030362f6d657461646174612f636f6e74656e74547970652220786d6c6e733a6d613d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f6d657461646174612f70726f706572746965732f6d65746141747472696275746573223e0d0a3c +7873643a736368656d61207461726765744e616d6573706163653d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f6d657461646174612f70726f7065727469657322206d613a726f6f743d227472756522206d613a6669656c647349443d223732326565636431 +63363230323961373830386363653964376530623264396522206e73323a5f3d222220786d6c6e733a7873643d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612220786d6c6e733a703d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f32 +3030362f6d657461646174612f70726f706572746965732220786d6c6e733a6e73323d2235616265626439612d376264662d343438322d393437632d633333353535323462663833223e0d0a3c7873643a696d706f7274206e616d6573706163653d2235616265626439612d376264662d343438322d393437632d633333 +353535323462663833222f3e0d0a3c7873643a656c656d656e74206e616d653d2270726f70657274696573223e0d0a3c7873643a636f6d706c6578547970653e0d0a3c7873643a73657175656e63653e0d0a3c7873643a656c656d656e74206e616d653d22646f63756d656e744d616e6167656d656e74223e0d0a3c7873 +643a636f6d706c6578547970653e0d0a3c7873643a616c6c3e0d0a3c7873643a656c656d656e74207265663d226e73323a4368616e6e656c222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a4f726967696e61746f72222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a50726f647563 +744e616d6522206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a50726f6475637456657273696f6e22206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a5075626c6973684461746522206d696e4f63637572733d2230 +222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a5265746972656d656e744461746522206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a536f6674776172655479706522206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e7420 +7265663d226e73323a4d53636f6d22206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a53746174757322206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a4c6963656e73654d6f64656c22206d696e4f63637572733d +2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a50726f64756374494422206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a4f776e657222206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a4c +616e677561676522206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a46696c6554797065222f3e0d0a3c2f7873643a616c6c3e0d0a3c2f7873643a636f6d706c6578547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c2f7873643a73657175656e63653e0d0a +3c2f7873643a636f6d706c6578547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c2f7873643a736368656d613e0d0a3c7873643a736368656d61207461726765744e616d6573706163653d2235616265626439612d376264662d343438322d393437632d6333333535353234626638332220656c656d656e7446 +6f726d44656661756c743d227175616c69666965642220786d6c6e733a7873643d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612220786d6c6e733a646d733d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f646f63756d65 +6e744d616e6167656d656e742f7479706573223e0d0a3c7873643a696d706f7274206e616d6573706163653d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f646f63756d656e744d616e6167656d656e742f7479706573222f3e0d0a3c7873643a656c656d656e +74206e616d653d224368616e6e656c22206d613a696e6465783d223822206d613a646973706c61794e616d653d224368616e6e656c22206d613a696e7465726e616c4e616d653d224368616e6e656c223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d +733a54657874223e0d0a3c7873643a6d61784c656e6774682076616c75653d22323535222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d224f726967696e61746f722220 +6d613a696e6465783d223922206d613a646973706c61794e616d653d224f726967696e61746f7222206d613a696e7465726e616c4e616d653d224f726967696e61746f72223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874223e0d0a3c +7873643a6d61784c656e6774682076616c75653d22323535222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d2250726f647563744e616d6522206d613a696e6465783d22 +313022206e696c6c61626c653d227472756522206d613a646973706c61794e616d653d2250726f647563744e616d6522206d613a64656661756c743d2222206d613a696e7465726e616c4e616d653d2250726f647563744e616d65223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374 +696f6e20626173653d22646d733a4e6f7465222f3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d2250726f6475637456657273696f6e22206d613a696e6465783d22313122206e696c6c61626c653d227472756522206d613a +646973706c61794e616d653d2250726f6475637456657273696f6e22206d613a696e7465726e616c4e616d653d2250726f6475637456657273696f6e223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874223e0d0a3c7873643a6d61784c +656e6774682076616c75653d22323535222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d225075626c6973684461746522206d613a696e6465783d22313222206e696c6c +61626c653d227472756522206d613a646973706c61794e616d653d225075626c6973684461746522206d613a666f726d61743d22446174654f6e6c7922206d613a696e7465726e616c4e616d653d225075626c69736844617465223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a726573747269637469 +6f6e20626173653d22646d733a4461746554696d65222f3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d225265746972656d656e744461746522206d613a696e6465783d22313322206e696c6c61626c653d22747275652220 +6d613a646973706c61794e616d653d225265746972656d656e744461746522206d613a666f726d61743d22446174654f6e6c7922206d613a696e7465726e616c4e616d653d225265746972656d656e7444617465223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173 +653d22646d733a4461746554696d65222f3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d22536f6674776172655479706522206d613a696e6465783d22313422206e696c6c61626c653d227472756522206d613a646973706c +61794e616d653d22536f6674776172655479706522206d613a696e7465726e616c4e616d653d22536f66747761726554797065223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874223e0d0a3c7873643a6d61784c656e6774682076616c +75653d22323535222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d224d53636f6d22206d613a696e6465783d22313522206e696c6c61626c653d227472756522206d613a +646973706c61794e616d653d224d53636f6d22206d613a64656661756c743d223122206d613a696e7465726e616c4e616d653d224d53636f6d223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a426f6f6c65616e222f3e0d0a3c2f7873643a7369 +6d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d2253746174757322206d613a696e6465783d22313622206e696c6c61626c653d227472756522206d613a646973706c61794e616d653d2253746174757322206d613a696e7465726e616c4e616d653d2253 +7461747573223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874223e0d0a3c7873643a6d61784c656e6774682076616c75653d22323535222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f7873643a73696d706c655479 +70653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d224c6963656e73654d6f64656c22206d613a696e6465783d22313722206e696c6c61626c653d227472756522206d613a646973706c61794e616d653d224c6963656e73654d6f64656c22206d613a696e7465726e616c4e +616d653d224c6963656e73654d6f64656c223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874223e0d0a3c7873643a6d61784c656e6774682076616c75653d22323535222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f +7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d2250726f64756374494422206d613a696e6465783d22313822206e696c6c61626c653d227472756522206d613a646973706c61794e616d653d2250726f64756374494422206d613a696e74 +65726e616c4e616d653d2250726f647563744944223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874223e0d0a3c7873643a6d61784c656e6774682076616c75653d22323535222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d +0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d224f776e657222206d613a696e6465783d22313922206e696c6c61626c653d227472756522206d613a646973706c61794e616d653d224f776e657222206d613a696e7465726e616c +4e616d653d224f776e6572223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874223e0d0a3c7873643a6d61784c656e6774682076616c75653d22323535222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f7873643a7369 +6d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d224c616e677561676522206d613a696e6465783d22323022206e696c6c61626c653d227472756522206d613a646973706c61794e616d653d224c616e677561676522206d613a696e7465726e616c4e616d +653d224c616e6775616765223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874223e0d0a3c7873643a6d61784c656e6774682076616c75653d22323535222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f7873643a7369 +6d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d2246696c655479706522206d613a696e6465783d22323122206d613a646973706c61794e616d653d2246696c655479706522206d613a696e7465726e616c4e616d653d2246696c6554797065223e0d0a3c +7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874223e0d0a3c7873643a6d61784c656e6774682076616c75653d22323535222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f787364 +3a656c656d656e743e0d0a3c2f7873643a736368656d613e0d0a3c7873643a736368656d61207461726765744e616d6573706163653d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f7061636b6167652f323030362f6d657461646174612f636f72652d70726f70657274696573 +2220656c656d656e74466f726d44656661756c743d227175616c69666965642220617474726962757465466f726d44656661756c743d22756e7175616c69666965642220626c6f636b44656661756c743d2223616c6c2220786d6c6e733d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f +72672f7061636b6167652f323030362f6d657461646174612f636f72652d70726f706572746965732220786d6c6e733a7873643d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c5363 +68656d612d696e7374616e63652220786d6c6e733a64633d22687474703a2f2f7075726c2e6f72672f64632f656c656d656e74732f312e312f2220786d6c6e733a64637465726d733d22687474703a2f2f7075726c2e6f72672f64632f7465726d732f2220786d6c6e733a6f646f633d22687474703a2f2f736368656d61 +732e6d6963726f736f66742e636f6d2f6f66666963652f696e7465726e616c2f323030352f696e7465726e616c446f63756d656e746174696f6e223e0d0a3c7873643a696d706f7274206e616d6573706163653d22687474703a2f2f7075726c2e6f72672f64632f656c656d656e74732f312e312f2220736368656d614c +6f636174696f6e3d22687474703a2f2f6475626c696e636f72652e6f72672f736368656d61732f786d6c732f7164632f323030332f30342f30322f64632e787364222f3e0d0a3c7873643a696d706f7274206e616d6573706163653d22687474703a2f2f7075726c2e6f72672f64632f7465726d732f2220736368656d61 +4c6f636174696f6e3d22687474703a2f2f6475626c696e636f72652e6f72672f736368656d61732f786d6c732f7164632f323030332f30342f30322f64637465726d732e787364222f3e0d0a3c7873643a656c656d656e74206e616d653d22636f726550726f706572746965732220747970653d2243545f636f72655072 +6f70657274696573222f3e0d0a3c7873643a636f6d706c657854797065206e616d653d2243545f636f726550726f70657274696573223e0d0a3c7873643a616c6c3e0d0a3c7873643a656c656d656e74207265663d2264633a63726561746f7222206d696e4f63637572733d223022206d61784f63637572733d2231222f +3e0d0a3c7873643a656c656d656e74207265663d2264637465726d733a6372656174656422206d696e4f63637572733d223022206d61784f63637572733d2231222f3e0d0a3c7873643a656c656d656e74207265663d2264633a6964656e74696669657222206d696e4f63637572733d223022206d61784f63637572733d +2231222f3e0d0a3c7873643a656c656d656e74206e616d653d22636f6e74656e745479706522206d696e4f63637572733d223022206d61784f63637572733d22312220747970653d227873643a737472696e6722206d613a696e6465783d223022206d613a646973706c61794e616d653d22436f6e74656e742054797065 +22206d613a726561644f6e6c793d2274727565222f3e0d0a3c7873643a656c656d656e74207265663d2264633a7469746c6522206d696e4f63637572733d223022206d61784f63637572733d223122206d613a696e6465783d223422206d613a646973706c61794e616d653d225469746c65222f3e0d0a3c7873643a656c +656d656e74207265663d2264633a7375626a65637422206d696e4f63637572733d223022206d61784f63637572733d2231222f3e0d0a3c7873643a656c656d656e74207265663d2264633a6465736372697074696f6e22206d696e4f63637572733d223022206d61784f63637572733d2231222f3e0d0a3c7873643a656c +656d656e74206e616d653d226b6579776f72647322206d696e4f63637572733d223022206d61784f63637572733d22312220747970653d227873643a737472696e67222f3e0d0a3c7873643a656c656d656e74207265663d2264633a6c616e677561676522206d696e4f63637572733d223022206d61784f63637572733d +2231222f3e0d0a3c7873643a656c656d656e74206e616d653d2263617465676f727922206d696e4f63637572733d223022206d61784f63637572733d22312220747970653d227873643a737472696e67222f3e0d0a3c7873643a656c656d656e74206e616d653d2276657273696f6e22206d696e4f63637572733d223022 +206d61784f63637572733d22312220747970653d227873643a737472696e67222f3e0d0a3c7873643a656c656d656e74206e616d653d227265766973696f6e22206d696e4f63637572733d223022206d61784f63637572733d22312220747970653d227873643a737472696e67223e0d0a3c7873643a616e6e6f74617469 +6f6e3e0d0a3c7873643a646f63756d656e746174696f6e3e0d0a202020202020202020202020202020202020202020202020546869732076616c756520696e6469636174657320746865206e756d626572206f66207361766573206f72207265766973696f6e732e20546865206170706c69636174696f6e206973207265 +73706f6e7369626c6520666f72207570646174696e6720746869732076616c75652061667465722065616368207265766973696f6e2e0d0a20202020202020202020202020202020202020203c2f7873643a646f63756d656e746174696f6e3e0d0a3c2f7873643a616e6e6f746174696f6e3e0d0a3c2f7873643a656c65 +6d656e743e0d0a3c7873643a656c656d656e74206e616d653d226c6173744d6f646966696564427922206d696e4f63637572733d223022206d61784f63637572733d22312220747970653d227873643a737472696e67222f3e0d0a3c7873643a656c656d656e74207265663d2264637465726d733a6d6f64696669656422 +206d696e4f63637572733d223022206d61784f63637572733d2231222f3e0d0a3c7873643a656c656d656e74206e616d653d226c6173745072696e74656422206d696e4f63637572733d223022206d61784f63637572733d22312220747970653d227873643a6461746554696d65222f3e0d0a3c7873643a656c656d656e +74206e616d653d22636f6e74656e7453746174757322206d696e4f63637572733d223022206d61784f63637572733d22312220747970653d227873643a737472696e67222f3e0d0a3c2f7873643a616c6c3e0d0a3c2f7873643a636f6d706c6578547970653e0d0a3c2f7873643a736368656d613e0d0a3c2f63743a636f +6e74656e7454797065536368656d613e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000006d65746141747472696275746573222f3e3c64733a736368656d615265662064733a7572693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d61222f3e3c64733a736368656d615265662064733a7572693d226874 +74703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f6d657461646174612f70726f70657274696573222f3e3c64733a736368656d615265662064733a7572693d2235616265626439612d376264662d343438322d393437632d633333353535323462663833222f3e3c64733a +736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f646f63756d656e744d616e6167656d656e742f7479706573222f3e3c64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6f7065 +6e786d6c666f726d6174732e6f72672f7061636b6167652f323030362f6d657461646174612f636f72652d70726f70657274696573222f3e3c64733a736368656d615265662064733a7572693d22687474703a2f2f7075726c2e6f72672f64632f656c656d656e74732f312e312f222f3e3c64733a736368656d61526566 +2064733a7572693d22687474703a2f2f7075726c2e6f72672f64632f7465726d732f222f3e3c64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f696e7465726e616c2f323030352f696e7465726e616c446f63756d656e7461 +74696f6e222f3e3c2f64733a736368656d61526566733e3c2f64733a6461746173746f72654974656d3e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file diff --git a/lib/sqlce/ReadmeSSCE_ENU.htm b/lib/sqlce/ReadmeSSCE_ENU.htm index b02df9609ba..bfb72e6ed2a 100644 --- a/lib/sqlce/ReadmeSSCE_ENU.htm +++ b/lib/sqlce/ReadmeSSCE_ENU.htm @@ -1,532 +1,532 @@ -Readme for Microsoft SQL Server Compact 4.0

      11/06/2010 17:55:22

      The most up-to-date version of this file is available online at the Microsoft Download Center

      The SQL Server documentation team welcomes your documentation feedback. We view and investigate all documentation issues but do not answer technical support questions here. For help with technical issues not related to documentation, see Getting Assistance with SQL Server Compact. If it is possible, submit feedback to us in English.

      Contents

      1.0 Introduction

      Microsoft® SQL Server™ Compact 4.0 is a small footprint, in-process database engine that allows developers to build robust applications for Windows desktop computers and for starter ASP.NET websites.

      1.1 Obtaining SQL Server Compact 4.0

      SQL Server Compact 4.0 is available from the following Web download:

      Important

      The installation behavior of SQL Server Compact 4.0 on 32-bit and 64-bit operating systems has changed as compared to the previous versions of SQL Server Compact. The installation of SQL Server Compact 4.0 on 32-bit and 64-bit operating systems is as given below:

      Version

      Operating system

      Result

      32-bit, SQL Server Compact 4.0

      32-bit

      Successful

      64-bit, SQL Server Compact 4.0

      64-bit

      Successful

      32-bit, SQL Server Compact 4.0

      64-bit

      Error

      64-bit, SQL Server Compact 4.0

      32-bit

      Error

      [Return to Contents]

      1.2 SQL Server Compact 4.0 Books Online

      2.0 Supported Operating Systems and Platforms for SQL Server Compact 4.0

      SQL Server Compact 4.0 supports the following operating systems.

      Windows Desktop Computers

      • Microsoft Windows XP Professional SP3

      • Microsoft Windows XP Home Edition SP3

      • Microsoft Windows XP Media Center Edition 2004 SP3

      • Microsoft Windows XP Media Center Edition 2005

      • Microsoft Windows XP Tablet PC Edition SP3

      • Microsoft Windows XP Embedded SP3

      • Microsoft Windows XP Professional x64 SP3

      • Windows Embedded for Point of Service SP3

      • Microsoft Windows Server 2003, Standard Edition SP2

      • Microsoft Windows Server 2003, Enterprise Edition SP2

      • Microsoft Windows Server 2003, Datacenter Edition SP2

      • Microsoft Windows Server 2003 R2, Standard Edition

      • Microsoft Windows Server 2003 R2, Enterprise Edition

      • Microsoft Windows Server 2003 R2, Datacenter Edition

      • Microsoft Windows Server 2003 x64, Standard Edition

      • Microsoft Windows Server 2003 x64, Enterprise x64 Edition

      • Microsoft Windows Server 2003 x64, Datacenter Edition

      • Microsoft Windows Server 2003 R2 x64, Standard Edition

      • Microsoft Windows Server 2003 R2 x64, Enterprise Edition

      • Microsoft Windows Server 2003 R2 x64, Datacenter Edition

      • Windows Vista Home Basic SP2

      • Windows Vista Home Premium SP2

      • Windows Vista Business SP2

      • Windows Vista Enterprise SP2

      • Windows Vista Ultimate SP2

      • Windows Vista Starter Edition SP2

      • Windows Vista Home Basic x64 SP2

      • Windows Vista Home Premium x64 SP2

      • Windows Vista Business x64 SP2

      • Windows Vista Enterprise x64 SP2

      • Windows Vista Ultimate x64 SP2

      • Windows Server 2008 Standard Server SP2

      • Windows Server 2008 Standard Server SP2 (without Hyper-V)

      • Windows Server 2008 Enterprise SP2

      • Windows Server 2008 Enterprise SP2 (without Hyper-V)

      • Windows Server 2008 Data Center SP2

      • Windows Server 2008 Data Center SP2 (without Hyper-V)

      • Windows Server 2008 Web Edition SP2

      • Windows Server 2008 Standard Server SP2 x64

      • Windows Server 2008 Standard Server SP2 x64 (without Hyper-V)

      • Windows Server 2008 Enterprise SP2 x64

      • Windows Server 2008 Enterprise SP2 x64 (without Hyper-V)

      • Windows Server 2008 Data Center SP2 x64

      • Windows Server 2008 Data Center SP2 x64 (without Hyper-V)

      • Windows Server 2008 Web Edition SP2 x64

      • Windows 7 Starter

      • Windows 7 Starter x64

      • Windows 7 Home Premium

      • Windows 7 Home Premium x64

      • Windows 7 Professional

      • Windows 7 Professional x64

      • Windows 7 Ultimate

      • Windows 7 Ultimate x64

      • Windows Server 2008 R2 Foundation x64

      • Windows Server 2008 R2 Standard x64

      • Windows Server 2008 R2 Enterprise x64

      • Windows Server 2008 R2 Datacenter x64

      • Windows Web Server 2008 R2 x64

      .NET Framework

      3.0 Known Issues

      3.1

      3.2

      If the SQL Server Compact Runtime installer is run on a machine which does not have a .Net Framework installed, the installation proceeds without any errors but there are a few steps which are not performed. It may cause errors on such a machine. The steps which are not performed are:

      • The machine.config entry for .NET would not have entry for SQL Server Compact as a data provider.

      • The relevant assemblies of Compact runtime are not put in the Global Assembly Cache.

      This can also happen if a user performs the following steps:

      • Install SQL Server Compact 4.0 runtime

      • Install .NET Framework 3.5 SP1 or 4.0

      To solve this problem, Reinstall / Repair SQL Server Compact runtime post .NET Framework installation.

      3.3

      SQL Server Compact 4.0 does not recognize the Encrypt property of the SqlCeConnection class, and you should not use this property to encrypt database files.

      Note

      The Encrypt property was deprecated in SQL Server Compact v3.5 release. This property was retained in SQL Server Compact 4.0 only for backward compatibility.

      Use the Encryption Mode property of the SqlCeConnection class to encrypt SQL Server Compact 4.0 database files. The following examples show uses of the Encryption Mode property.

      • To create a new encrypted SQL Server Compact 4.0 database:

        C#:

         
        SqlCeEngine engine = new SqlCeEngine("Data Source=Northwind.sdf;encryption mode=platform default;Password=<enterStrongPasswordHere>;");
        -engine.CreateDatabase();

        Visual Basic:

         
        Dim engine As SqlCeEngine = New SqlCeEngine("Data Source=Northwind.sdf;encryption mode=platform default;Password=<enterStrongPasswordHere>;")
        -engine.CreateDatabase()
      • To change the encryption mode of an existing SQL Server Compact 4.0 database:

        C#:

         
        SqlCeEngine engine = new SqlCeEngine("Data Source=Northwind.sdf;Password=<enterStrongPasswordHere>;");
        -engine.Compact("Data Source=Northwind.sdf;encryption mode= enginedefault;Password=<enterStrongPasswordHere>;");

        Visual Basic:

         
        Dim engine As SqlCeEngine = New SqlCeEngine("Data Source=Northwind.sdf;Password=<enterStrongPasswordHere>;") 
        -engine.Compact("Data Source=Northwind.sdf;encryption mode= engine default;Password=<enterStrongPasswordHere>;")
      • To encrypt an unencrypted SQL Server Compact 4.0 database: -

        C#:

         
        SqlCeEngine engine = new SqlCeEngine("Data Source=Northwind.sdf");
        -engine.Compact("Data Source=Northwind.sdf;encryption mode=platform default;Password=<enterStrongPasswordHere>;");

        Visual Basic:

         
        Dim engine As SqlCeEngine = New SqlCeEngine("Data Source=Northwind.sdf;") 
        -engine.Compact("Data Source=Northwind.sdf;encryption mode=platform default;Password=<enterStrongPasswordHere>;"

      3.4

      SQL Server Compact 4.0 data types for parameters like SqlDbType or DbType should be explicitly set. -

      If the data types for parameters such as SqlDbType or DbType are not explicitly set, an exception is be thrown. To resolve this issue, explicitly set the data type for parameters such as SqlDbType or DbType. This is critical in the case of BLOB data types (image and ntext). A code example is given below:

      C#:

       
      SqlCeEngine engine = new SqlCeEngine(connString);
      -engine.CreateDatabase();
      -engine.Dispose();
      -
      -SqlCeConnection conn = new SqlCeConnection(connString);
      -conn.Open();
      -
      -SqlCeCommand cmd = conn.CreateCommand();
      -cmd.CommandText = "CREATE TABLE BlobTable(name nvarchar(128), blob ntext);";
      -cmd.ExecuteNonQuery();
      -
      -cmd.CommandText = "INSERT INTO BlobTable(name, blob) VALUES (@name, @blob);";
      -SqlCeParameter paramName = cmd.Parameters.Add("name", SqlDbType.NVarChar, 128);
      -SqlCeParameter paramBlob = cmd.Parameters.Add("blob", SqlDbType.NText);
      -paramName.Value = "Name1";
      -paramBlob.Value = "Name1".PadLeft(4001);
      -
      -cmd.ExecuteNonQuery();

      Visual Basic:

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0.00 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - - - -
      -
      - -
      - - - - - - - - - - w__ - - popup() - .style.display='none' - - - - - - - - - - - - - - - - - - - - - - popup_ - - popup() - .style.display='none' - - - - - -
      -
      - -
      -
      -
      -
      -
      - -
      - - - - - - - -
       
      Dim engine As SqlCeEngine = New SqlCeEngine(connString)
      -engine.CreateDatabase()
      -engine.Dispose()
      -
      -Dim conn As SqlCeConnection = New SqlCeConnection(connString)
      -conn.Open()
      -
      -Dim cmd As SqlCeCommand = conn.CreateCommand()
      -cmd.CommandText = "CREATE TABLE BlobTable(name nvarchar(128), blob ntext);"
      -cmd.ExecuteNonQuery() 
      -
      -cmd.CommandText = "INSERT INTO BlobTable(name, blob) VALUES (@name, @blob);"
      -Dim paramName As SqlCeParameter
      -Dim paramBlob As SqlCeParameter
      -paramName = cmd.Parameters.Add("name", SqlDbType.NVarChar, 128)
      -paramBlob = cmd.Parameters.Add("blob", SqlDbType.NText)
      -paramName.Value = "Name1"
      -paramBlob.Value = "Name1".PadLeft(4001)
      -
      +Readme for Microsoft SQL Server Compact 4.0

      11/06/2010 17:55:22

      The most up-to-date version of this file is available online at the Microsoft Download Center

      The SQL Server documentation team welcomes your documentation feedback. We view and investigate all documentation issues but do not answer technical support questions here. For help with technical issues not related to documentation, see Getting Assistance with SQL Server Compact. If it is possible, submit feedback to us in English.

      Contents

      1.0 Introduction

      Microsoft® SQL Server™ Compact 4.0 is a small footprint, in-process database engine that allows developers to build robust applications for Windows desktop computers and for starter ASP.NET websites.

      1.1 Obtaining SQL Server Compact 4.0

      SQL Server Compact 4.0 is available from the following Web download:

      Important

      The installation behavior of SQL Server Compact 4.0 on 32-bit and 64-bit operating systems has changed as compared to the previous versions of SQL Server Compact. The installation of SQL Server Compact 4.0 on 32-bit and 64-bit operating systems is as given below:

      Version

      Operating system

      Result

      32-bit, SQL Server Compact 4.0

      32-bit

      Successful

      64-bit, SQL Server Compact 4.0

      64-bit

      Successful

      32-bit, SQL Server Compact 4.0

      64-bit

      Error

      64-bit, SQL Server Compact 4.0

      32-bit

      Error

      [Return to Contents]

      1.2 SQL Server Compact 4.0 Books Online

      2.0 Supported Operating Systems and Platforms for SQL Server Compact 4.0

      SQL Server Compact 4.0 supports the following operating systems.

      Windows Desktop Computers

      • Microsoft Windows XP Professional SP3

      • Microsoft Windows XP Home Edition SP3

      • Microsoft Windows XP Media Center Edition 2004 SP3

      • Microsoft Windows XP Media Center Edition 2005

      • Microsoft Windows XP Tablet PC Edition SP3

      • Microsoft Windows XP Embedded SP3

      • Microsoft Windows XP Professional x64 SP3

      • Windows Embedded for Point of Service SP3

      • Microsoft Windows Server 2003, Standard Edition SP2

      • Microsoft Windows Server 2003, Enterprise Edition SP2

      • Microsoft Windows Server 2003, Datacenter Edition SP2

      • Microsoft Windows Server 2003 R2, Standard Edition

      • Microsoft Windows Server 2003 R2, Enterprise Edition

      • Microsoft Windows Server 2003 R2, Datacenter Edition

      • Microsoft Windows Server 2003 x64, Standard Edition

      • Microsoft Windows Server 2003 x64, Enterprise x64 Edition

      • Microsoft Windows Server 2003 x64, Datacenter Edition

      • Microsoft Windows Server 2003 R2 x64, Standard Edition

      • Microsoft Windows Server 2003 R2 x64, Enterprise Edition

      • Microsoft Windows Server 2003 R2 x64, Datacenter Edition

      • Windows Vista Home Basic SP2

      • Windows Vista Home Premium SP2

      • Windows Vista Business SP2

      • Windows Vista Enterprise SP2

      • Windows Vista Ultimate SP2

      • Windows Vista Starter Edition SP2

      • Windows Vista Home Basic x64 SP2

      • Windows Vista Home Premium x64 SP2

      • Windows Vista Business x64 SP2

      • Windows Vista Enterprise x64 SP2

      • Windows Vista Ultimate x64 SP2

      • Windows Server 2008 Standard Server SP2

      • Windows Server 2008 Standard Server SP2 (without Hyper-V)

      • Windows Server 2008 Enterprise SP2

      • Windows Server 2008 Enterprise SP2 (without Hyper-V)

      • Windows Server 2008 Data Center SP2

      • Windows Server 2008 Data Center SP2 (without Hyper-V)

      • Windows Server 2008 Web Edition SP2

      • Windows Server 2008 Standard Server SP2 x64

      • Windows Server 2008 Standard Server SP2 x64 (without Hyper-V)

      • Windows Server 2008 Enterprise SP2 x64

      • Windows Server 2008 Enterprise SP2 x64 (without Hyper-V)

      • Windows Server 2008 Data Center SP2 x64

      • Windows Server 2008 Data Center SP2 x64 (without Hyper-V)

      • Windows Server 2008 Web Edition SP2 x64

      • Windows 7 Starter

      • Windows 7 Starter x64

      • Windows 7 Home Premium

      • Windows 7 Home Premium x64

      • Windows 7 Professional

      • Windows 7 Professional x64

      • Windows 7 Ultimate

      • Windows 7 Ultimate x64

      • Windows Server 2008 R2 Foundation x64

      • Windows Server 2008 R2 Standard x64

      • Windows Server 2008 R2 Enterprise x64

      • Windows Server 2008 R2 Datacenter x64

      • Windows Web Server 2008 R2 x64

      .NET Framework

      3.0 Known Issues

      3.1

      3.2

      If the SQL Server Compact Runtime installer is run on a machine which does not have a .Net Framework installed, the installation proceeds without any errors but there are a few steps which are not performed. It may cause errors on such a machine. The steps which are not performed are:

      • The machine.config entry for .NET would not have entry for SQL Server Compact as a data provider.

      • The relevant assemblies of Compact runtime are not put in the Global Assembly Cache.

      This can also happen if a user performs the following steps:

      • Install SQL Server Compact 4.0 runtime

      • Install .NET Framework 3.5 SP1 or 4.0

      To solve this problem, Reinstall / Repair SQL Server Compact runtime post .NET Framework installation.

      3.3

      SQL Server Compact 4.0 does not recognize the Encrypt property of the SqlCeConnection class, and you should not use this property to encrypt database files.

      Note

      The Encrypt property was deprecated in SQL Server Compact v3.5 release. This property was retained in SQL Server Compact 4.0 only for backward compatibility.

      Use the Encryption Mode property of the SqlCeConnection class to encrypt SQL Server Compact 4.0 database files. The following examples show uses of the Encryption Mode property.

      • To create a new encrypted SQL Server Compact 4.0 database:

        C#:

         
        SqlCeEngine engine = new SqlCeEngine("Data Source=Northwind.sdf;encryption mode=platform default;Password=<enterStrongPasswordHere>;");
        +engine.CreateDatabase();

        Visual Basic:

         
        Dim engine As SqlCeEngine = New SqlCeEngine("Data Source=Northwind.sdf;encryption mode=platform default;Password=<enterStrongPasswordHere>;")
        +engine.CreateDatabase()
      • To change the encryption mode of an existing SQL Server Compact 4.0 database:

        C#:

         
        SqlCeEngine engine = new SqlCeEngine("Data Source=Northwind.sdf;Password=<enterStrongPasswordHere>;");
        +engine.Compact("Data Source=Northwind.sdf;encryption mode= enginedefault;Password=<enterStrongPasswordHere>;");

        Visual Basic:

         
        Dim engine As SqlCeEngine = New SqlCeEngine("Data Source=Northwind.sdf;Password=<enterStrongPasswordHere>;") 
        +engine.Compact("Data Source=Northwind.sdf;encryption mode= engine default;Password=<enterStrongPasswordHere>;")
      • To encrypt an unencrypted SQL Server Compact 4.0 database: +

        C#:

         
        SqlCeEngine engine = new SqlCeEngine("Data Source=Northwind.sdf");
        +engine.Compact("Data Source=Northwind.sdf;encryption mode=platform default;Password=<enterStrongPasswordHere>;");

        Visual Basic:

         
        Dim engine As SqlCeEngine = New SqlCeEngine("Data Source=Northwind.sdf;") 
        +engine.Compact("Data Source=Northwind.sdf;encryption mode=platform default;Password=<enterStrongPasswordHere>;"

      3.4

      SQL Server Compact 4.0 data types for parameters like SqlDbType or DbType should be explicitly set. +

      If the data types for parameters such as SqlDbType or DbType are not explicitly set, an exception is be thrown. To resolve this issue, explicitly set the data type for parameters such as SqlDbType or DbType. This is critical in the case of BLOB data types (image and ntext). A code example is given below:

      C#:

       
      SqlCeEngine engine = new SqlCeEngine(connString);
      +engine.CreateDatabase();
      +engine.Dispose();
      +
      +SqlCeConnection conn = new SqlCeConnection(connString);
      +conn.Open();
      +
      +SqlCeCommand cmd = conn.CreateCommand();
      +cmd.CommandText = "CREATE TABLE BlobTable(name nvarchar(128), blob ntext);";
      +cmd.ExecuteNonQuery();
      +
      +cmd.CommandText = "INSERT INTO BlobTable(name, blob) VALUES (@name, @blob);";
      +SqlCeParameter paramName = cmd.Parameters.Add("name", SqlDbType.NVarChar, 128);
      +SqlCeParameter paramBlob = cmd.Parameters.Add("blob", SqlDbType.NText);
      +paramName.Value = "Name1";
      +paramBlob.Value = "Name1".PadLeft(4001);
      +
      +cmd.ExecuteNonQuery();

      Visual Basic:

       
      Dim engine As SqlCeEngine = New SqlCeEngine(connString)
      +engine.CreateDatabase()
      +engine.Dispose()
      +
      +Dim conn As SqlCeConnection = New SqlCeConnection(connString)
      +conn.Open()
      +
      +Dim cmd As SqlCeCommand = conn.CreateCommand()
      +cmd.CommandText = "CREATE TABLE BlobTable(name nvarchar(128), blob ntext);"
      +cmd.ExecuteNonQuery() 
      +
      +cmd.CommandText = "INSERT INTO BlobTable(name, blob) VALUES (@name, @blob);"
      +Dim paramName As SqlCeParameter
      +Dim paramBlob As SqlCeParameter
      +paramName = cmd.Parameters.Add("name", SqlDbType.NVarChar, 128)
      +paramBlob = cmd.Parameters.Add("blob", SqlDbType.NText)
      +paramName.Value = "Name1"
      +paramBlob.Value = "Name1".PadLeft(4001)
      +
       cmd.ExecuteNonQuery()

      3.5

      The SQL Server Compact 4.0 release does not support syncing of data with SQL Server using technologies like Microsoft Sync Framework, or merge replication, or remote data access (RDA).

      3.6

      The generation of the Entity Data Model for SQL Server Compact will fail if there are duplicate constraint names in the SQL Server Compact schema.

      In SQL Server Compact, the constraint names are unique within a table and this can allow duplicate constraint names in the database. The behavior is different from SQL Server, where the constraint names are unique across the database. If a SQL Server Compact schema has duplicate referential integrity (primary key – foreign key relationship) constraint names, the generation of the Entity Data Model using the ADO.NET Entity Framework’s Entity Data Model Wizard will fail. The workaround is to change the name of the duplicate constraint name to be unique across the database, like by adding the name of the table to the constraint name.

      [Return to Contents]

      4.0 Additional Information

      \ No newline at end of file diff --git a/lib/sqlce/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest b/lib/sqlce/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest index a7a7026c61c..47bd4a04ac2 100644 --- a/lib/sqlce/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest +++ b/lib/sqlce/amd64/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest @@ -1,6 +1,6 @@ - - - - - Vy8CgQgbu3qH5JHTK0op4kR8114= QTJu3Gttpt8hhCktGelNeXj4Yp8= 1ruqF7/L+m1tqnJVscaOtNRNHIE= + + + + + Vy8CgQgbu3qH5JHTK0op4kR8114= QTJu3Gttpt8hhCktGelNeXj4Yp8= 1ruqF7/L+m1tqnJVscaOtNRNHIE= \ No newline at end of file diff --git a/lib/sqlce/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest b/lib/sqlce/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest index 9090f295822..bbd12ccde9a 100644 --- a/lib/sqlce/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest +++ b/lib/sqlce/x86/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest @@ -1,6 +1,6 @@ - - - - - +CXED+6HzJlSphyMNOn27ujadC0= MyKED+9DyS+1XcMeaC0Zlw2vFZ0= EeyDE7og6WoPd2oBhYbMEnpFHhY= + + + + + +CXED+6HzJlSphyMNOn27ujadC0= MyKED+9DyS+1XcMeaC0Zlw2vFZ0= EeyDE7og6WoPd2oBhYbMEnpFHhY= \ No newline at end of file diff --git a/lib/wcat/doc/readme.txt b/lib/wcat/doc/readme.txt index f23569562d7..6236d21a5f7 100644 --- a/lib/wcat/doc/readme.txt +++ b/lib/wcat/doc/readme.txt @@ -1,37 +1,37 @@ -Getting Started with WCAT -====================================== - -Documentation - It is suggested that you read the documentation for WCAT in order to understand - the environment and configuration needed. Documentation can be found under the - doc folder in the directory that you installed WCAT to. - -Installing WCAT - Prerequisite: all machines that will run WCAT must have the administrator account - enabled and must all share a common password. - - 1. Log into the WCAT Controller as administrator. - 2. Install wcat.msi on the machine to be used as a WCAT Controller. - 3. If any WCAT extension DLLs will be used, copy them to the WCAT installation - directory. (typically c:\Program Files\WCAT) - 4. Open a command prompt; navigate to the WCAT installation directory. - 5. Run cscript //H:Cscript - 6. Run wcat.wsf terminate update clients {comma separated list of WCAT client - machines} where the clients parameter accepts a comma separated list (no - spaces) of the machines you plan on using as WCAT Client machines. Note: If - the WCAT Controller machine will also be used as a WCAT Client, include - localhost OR the name of the WCAT Controller machine in the list of clients. - - NOTE: If WCAT has never been installed on the WCAT Client machines before, - this will cause the machines to reboot. - -Running WCAT - 1. Log into the WCAT Controller as administrator. - 2. Install wcat.msi on the machine to be used as a WCAT Controller. - 3. Open a command prompt, navigate to the WCAT installation directory (typically - c:\Program Files\WCAT) - 4. Run wcat.wsf terminate run clients {comma separated client list} t - {scenario file} f {settings file} s {name of the Web Server} singleip -x - 5. Output will be generated in the current directory, log.xml. To change this, - use the -o flag. For more help on options to pass to wcat.wsf type - wcctl.exe -? +Getting Started with WCAT +====================================== + +Documentation + It is suggested that you read the documentation for WCAT in order to understand + the environment and configuration needed. Documentation can be found under the + doc folder in the directory that you installed WCAT to. + +Installing WCAT + Prerequisite: all machines that will run WCAT must have the administrator account + enabled and must all share a common password. + + 1. Log into the WCAT Controller as administrator. + 2. Install wcat.msi on the machine to be used as a WCAT Controller. + 3. If any WCAT extension DLLs will be used, copy them to the WCAT installation + directory. (typically c:\Program Files\WCAT) + 4. Open a command prompt; navigate to the WCAT installation directory. + 5. Run cscript //H:Cscript + 6. Run wcat.wsf terminate update clients {comma separated list of WCAT client + machines} where the clients parameter accepts a comma separated list (no + spaces) of the machines you plan on using as WCAT Client machines. Note: If + the WCAT Controller machine will also be used as a WCAT Client, include + localhost OR the name of the WCAT Controller machine in the list of clients. + + NOTE: If WCAT has never been installed on the WCAT Client machines before, + this will cause the machines to reboot. + +Running WCAT + 1. Log into the WCAT Controller as administrator. + 2. Install wcat.msi on the machine to be used as a WCAT Controller. + 3. Open a command prompt, navigate to the WCAT installation directory (typically + c:\Program Files\WCAT) + 4. Run wcat.wsf terminate run clients {comma separated client list} t + {scenario file} f {settings file} s {name of the Web Server} singleip -x + 5. Output will be generated in the current directory, log.xml. To change this, + use the -o flag. For more help on options to pass to wcat.wsf type + wcctl.exe -? diff --git a/lib/wcat/report.xsl b/lib/wcat/report.xsl index 2045aafbe3c..c354fd0bab3 100644 --- a/lib/wcat/report.xsl +++ b/lib/wcat/report.xsl @@ -1,1786 +1,1786 @@ - - - - - - - - - - - - - - - topValue ){ - topIndex = i; - topValue = test; - } - } - } - - return (topIndex+1) * 1; - - }catch(e){ - return 0; - } -} - -function tag(){ - return ++g_tag; -} - -]]> - - - - Contents - Summary - Top: - of - Warnings - Type - Item - Warning - Help - Total - Average - Transactions: - Total Records: - - - - - - - - - - - - - 10 - - - - - - - - 1 - - - - - - - - - - - - -
      - - - - - - - - - - - - - - - - - - -
      - -

      - - - - - - - -
      - - - : - - - - -
      -
      -
      -
      - - - - - - - - - - - - -
      - - - - - - - -
      - - - - - -
      -
      - -
      -
      - - - - - - - - - - - -
      - - - -
      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - bold - - - - # - - - - - - - -
      - b3 - - - - - - - 40% - - - - - - - - - - b3 - - - - 0.00 - - - - - b3 - - - - 0.00 - - - - - - - - - - b3 - - 40% - - - - - - - - - -
      -
      -
      -
      - - - - - - - - - - - - - - - - - -
      - b3 - - - - - -
      - - - - - - - - - - - -
      -
      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - - -
      - - - -
      -
      -
      - - - - - -
      - -
      - - - - - - - -
      - -
      - - -
      - - - - - - - -table_ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - - - - - -
      - - - - - - - - - - - - - - - - top_ - show() - pressTop() - - - - - - - - - - - - - - -
      - - - - - - -
      -
      - -
      -
      - -
      - - - - - -
      -
      -
      - -
      - - - - - - - - - - - - - - - -
      - -

      - - -
      - - - - - - - - - - - - - - - - - all - - - - - - - - - - - - - - - all - - - - - - - - - - - - 0 - - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - all - - - - - - - - - - - - table_ - - - - - - - ascending - - - - - - number - - - - - - ascending - - - - - - number - - - - - - - - - - - - - - - - - - - - - - - - - b3 - b1 - - - - - - - display:'' - display:'none' - - - - - - - - - - - - - + - - - - - - - - - - - c_ - - - - display:'none'; - - - - - - - - - - - - - - - - - - - - - -
      - - - - true - -
      - - folder( c_ ) - - e_c_ - - - - - - - - - - - -
      - - - - -
      - - - - child - -
      -
      - - - - - - border-top: 1px solid black; - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      -
      - - - - - - -
      -
      -
      - -
      -
      - -
      - -
      - - - - - - - - - - - - - - - - - - - - - - -
      - - - - : - - - - info b3 - - - - - - -

      -
      - - - - - - - - - - - - - - - - - - -
      - - 8% - - - - - - - - - - - - - - - - - - - - - - - - - - - string - - - span - - - number - - - - - sort(); - cursor:hand; - - - - - - - -
      - - - -
      - - - - - -
      - - - - - - - - - -
      -
      - - - - - - - - - - - - - - - b3 - - - - - - - - - - - -
      - - - - - - - - - - - - - - - -
      - - -
      Information
      -
      - -
      Warning
      -
      - -
      Error
      -
      -
      -
      - - - # - - - - - - - - - - - - - - - - - - - - help('') - - - -
      -
      -
      - - - - -
      - -
      - -
      -
      - i -
      -
      -
      - - -
      - -
      - ! -
      -
      - -
      -
      - ! -
      -
      -
      - - -
      - -
      - -
      -
      - -
      -
      -
      - - -
      - -
      - -
      -
      -
      - - - - - - -
      -
      - - -
      -
      -
      -
      -
      -
      - - - + + + + + + + + + + + + + + + topValue ){ + topIndex = i; + topValue = test; + } + } + } + + return (topIndex+1) * 1; + + }catch(e){ + return 0; + } +} + +function tag(){ + return ++g_tag; +} + +]]> + + + + Contents + Summary + Top: + of + Warnings + Type + Item + Warning + Help + Total + Average + Transactions: + Total Records: + + + + + + + + + + + + + 10 + + + + + + + + 1 + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + +
      + +

      + + + + + + + +
      + + + : + + + + +
      +
      +
      +
      + + + + + + + + + + + + +
      + + + + + + + +
      + + + + + +
      +
      + +
      +
      + + + + + + + + + + + +
      + + + +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + bold + + + + # + + + + + + + +
      + b3 + + + + + + + 40% + + + + + + + + + + b3 + + + + 0.00 + + + + + b3 + + + + 0.00 + + + + + + + + + + b3 + + 40% + + + + + + + + + +
      +
      +
      +
      + + + + + + + + + + + + + + + + + +
      + b3 + + + + + +
      + + + + + + + + + + + +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + + +
      +
      +
      + + + + + +
      + +
      + + + + + + + +
      + +
      + + +
      + + + + + + + +table_ +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + + + + + + + + top_ + show() + pressTop() + + + + + + + + + + + + + + +
      + + + + + + +
      +
      + +
      +
      + +
      + + + + + +
      +
      +
      + +
      + + + + + + + + + + + + + + + +
      + +

      + + + + + + + + + + + + + + + + + + + + all + + + + + + + + + + + + + + + all + + + + + + + + + + + + 0 + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + all + + + + + + + + + + + + table_ + + + + + + + ascending + + + + + + number + + + + + + ascending + + + + + + number + + + + + + + + + + + + + + + + + + + + + + + + + b3 + b1 + + + + + + + display:'' + display:'none' + + + + + + + + + + + - + + + + + + + + + + + + + c_ + + + + display:'none'; + + + + + + + + + + + + + + + + + + + + + +
      + + + + true + +
      + + folder( c_ ) + + e_c_ + + + + + + + + + + + +
      + + + + +
      + + + + child + +
      +
      + + + + + + border-top: 1px solid black; + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +
      + + + + + + +
      +
      +
      + +
      +
      + +
      + +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + + + : + + + + info b3 + + + + + + +

      +
      + + + + + + + + + + + + + + + + + + + + + 8% + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.00 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + string + + + span + + + number + + + + + sort(); + cursor:hand; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + +
      +
      + +
      + + + + + + + + + + w__ + + popup() + .style.display='none' + + + + + + + + + + + + + + + + + + + + + + popup_ + + popup() + .style.display='none' + + + + + +
      +
      + +
      +
      +
      +
      +
      + +
      + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + +
      +
      + + + + + + + + + + + + + + + b3 + + + + + + + + + + + +
      + + + + + + + + + + + + + + + +
      + + +
      Information
      +
      + +
      Warning
      +
      + +
      Error
      +
      +
      +
      + + + # + + + + + + + + + + + + + + + + + + + + help('') + + + +
      +
      +
      +
      +
      + + +
      + +
      + +
      +
      + i +
      +
      +
      + + +
      + +
      + ! +
      +
      + +
      +
      + ! +
      +
      +
      + + +
      + +
      + +
      +
      + +
      +
      +
      + + +
      + +
      + +
      +
      +
      + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      + + + diff --git a/lib/wcat/samples/scripts/home.ubr b/lib/wcat/samples/scripts/home.ubr index 2b0ccc56df6..138c698751d 100644 --- a/lib/wcat/samples/scripts/home.ubr +++ b/lib/wcat/samples/scripts/home.ubr @@ -1,66 +1,66 @@ -scenario -{ - name = "IIS Home Page"; - - warmup = 30; - duration = 120; - cooldown = 10; - - ///////////////////////////////////////////////////////////////// - // - // All requests inherit the settings from the default request. - // Defaults are overridden if specified in the request itself. - // - ///////////////////////////////////////////////////////////////// - default - { - // send keep-alive header - setheader - { - name = "Connection"; - value = "keep-alive"; - } - - // set the host header - setheader - { - name = "Host"; - value = server(); - } - - // HTTP1.1 request - version = HTTP11; - - // keep the connection alive after the request - close = ka; - } - - // - // This script is made for IIS7 - // - transaction - { - id = "Default Web Site Homepage"; - weight = 1; - - request - { - url = "/"; - statuscode = 200; - } - - request - { - url = "/welcome.png"; - statuscode = 200; - } - - // - // specifically close the connection after both files are requested - // - close - { - method = reset; - } - } -} +scenario +{ + name = "IIS Home Page"; + + warmup = 30; + duration = 120; + cooldown = 10; + + ///////////////////////////////////////////////////////////////// + // + // All requests inherit the settings from the default request. + // Defaults are overridden if specified in the request itself. + // + ///////////////////////////////////////////////////////////////// + default + { + // send keep-alive header + setheader + { + name = "Connection"; + value = "keep-alive"; + } + + // set the host header + setheader + { + name = "Host"; + value = server(); + } + + // HTTP1.1 request + version = HTTP11; + + // keep the connection alive after the request + close = ka; + } + + // + // This script is made for IIS7 + // + transaction + { + id = "Default Web Site Homepage"; + weight = 1; + + request + { + url = "/"; + statuscode = 200; + } + + request + { + url = "/welcome.png"; + statuscode = 200; + } + + // + // specifically close the connection after both files are requested + // + close + { + method = reset; + } + } +} diff --git a/lib/wcat/samples/scripts/settings.ubr b/lib/wcat/samples/scripts/settings.ubr index 9f1607ad422..5fb3a735d03 100644 --- a/lib/wcat/samples/scripts/settings.ubr +++ b/lib/wcat/samples/scripts/settings.ubr @@ -1,102 +1,102 @@ -settings -{ - //-------------------------------------------------------------------------- - // General controller settings - // - // clientfile - specifies the client file, relative to working dir - // server - host name of the webserver - // virtualclients - number of 'threads' per physical client - // clients - number of physical webcat client machines - // - //-------------------------------------------------------------------------- - // Example: - // - // clientfile = "ubr\lcw2.light.ubr"; - // server = "webserver"; - // clients = 10; - // virtualclients = 100; - // - //-------------------------------------------------------------------------- - - //-------------------------------------------------------------------------- - // Performance counters (pass '-x' option to wcctl.exe to enable) - // - // interval - polling interval in seconds (default=10) - // host - host name of machine to monitor (default=webserver) - // counter - path of counter to monitor - // - //-------------------------------------------------------------------------- - // Optional: - // - // Additional machines can be monitored by adding more counters blocks. - // - // Example: - // - // counters { - // host = "sqlserver"; // name of remote machine - // interval = 5; - // counter = "..."; - // } - // - //-------------------------------------------------------------------------- - - counters - { - interval = 10; - - counter = "Processor(_Total)\\% Processor Time"; - counter = "Processor(_Total)\\% Privileged Time"; - counter = "Processor(_Total)\\% User Time"; - counter = "Processor(_Total)\\Interrupts/sec"; - - counter = "Memory\\Available KBytes"; - - counter = "Process(w3wp)\\Working Set"; - - counter = "System\\Context Switches/sec"; - counter = "System\\System Calls/sec"; - - counter = "Web Service(_Total)\\Bytes Received/sec" ; - counter = "Web Service(_Total)\\Bytes Sent/sec" ; - counter = "Web Service(_Total)\\Connection Attempts/sec" ; - counter = "Web Service(_Total)\\Get Requests/sec" ; - } - - //-------------------------------------------------------------------------- - // Registry Key Monitors (pass '-x' option to wcctl.exe to enable) - // - // path - registry path, relative to HKLM - // name - name of registry key - // type - type of value (REG_SZ | REG_DWORD) - // - //-------------------------------------------------------------------------- - // Optional: - // - // Additional registry keys can be monitored on the web server by - // adding more registry blocks to this file. Note that simple strings and - // dwords are all that webcat currently supports. - // - // Example: - // - // registry { - // path = "System\\CurrentControlSet\\Services\\Tcpip\\Parameters"; - // name = "DhcpDomain"; - // type = REG_SZ; - // } - // - //-------------------------------------------------------------------------- - - registry - { - path = "System\\CurrentControlSet\\Control\\FileSystem"; - name = "NtfsDisableLastAccessUpdate"; - type = REG_DWORD; - } - - registry - { - path = "System\\CurrentControlSet\\Services\\Tcpip\\Parameters"; - name = "SynAttackProtect"; - type = REG_DWORD; - } -} +settings +{ + //-------------------------------------------------------------------------- + // General controller settings + // + // clientfile - specifies the client file, relative to working dir + // server - host name of the webserver + // virtualclients - number of 'threads' per physical client + // clients - number of physical webcat client machines + // + //-------------------------------------------------------------------------- + // Example: + // + // clientfile = "ubr\lcw2.light.ubr"; + // server = "webserver"; + // clients = 10; + // virtualclients = 100; + // + //-------------------------------------------------------------------------- + + //-------------------------------------------------------------------------- + // Performance counters (pass '-x' option to wcctl.exe to enable) + // + // interval - polling interval in seconds (default=10) + // host - host name of machine to monitor (default=webserver) + // counter - path of counter to monitor + // + //-------------------------------------------------------------------------- + // Optional: + // + // Additional machines can be monitored by adding more counters blocks. + // + // Example: + // + // counters { + // host = "sqlserver"; // name of remote machine + // interval = 5; + // counter = "..."; + // } + // + //-------------------------------------------------------------------------- + + counters + { + interval = 10; + + counter = "Processor(_Total)\\% Processor Time"; + counter = "Processor(_Total)\\% Privileged Time"; + counter = "Processor(_Total)\\% User Time"; + counter = "Processor(_Total)\\Interrupts/sec"; + + counter = "Memory\\Available KBytes"; + + counter = "Process(w3wp)\\Working Set"; + + counter = "System\\Context Switches/sec"; + counter = "System\\System Calls/sec"; + + counter = "Web Service(_Total)\\Bytes Received/sec" ; + counter = "Web Service(_Total)\\Bytes Sent/sec" ; + counter = "Web Service(_Total)\\Connection Attempts/sec" ; + counter = "Web Service(_Total)\\Get Requests/sec" ; + } + + //-------------------------------------------------------------------------- + // Registry Key Monitors (pass '-x' option to wcctl.exe to enable) + // + // path - registry path, relative to HKLM + // name - name of registry key + // type - type of value (REG_SZ | REG_DWORD) + // + //-------------------------------------------------------------------------- + // Optional: + // + // Additional registry keys can be monitored on the web server by + // adding more registry blocks to this file. Note that simple strings and + // dwords are all that webcat currently supports. + // + // Example: + // + // registry { + // path = "System\\CurrentControlSet\\Services\\Tcpip\\Parameters"; + // name = "DhcpDomain"; + // type = REG_SZ; + // } + // + //-------------------------------------------------------------------------- + + registry + { + path = "System\\CurrentControlSet\\Control\\FileSystem"; + name = "NtfsDisableLastAccessUpdate"; + type = REG_DWORD; + } + + registry + { + path = "System\\CurrentControlSet\\Services\\Tcpip\\Parameters"; + name = "SynAttackProtect"; + type = REG_DWORD; + } +} diff --git a/lib/wcat/samples/src/precomp.h b/lib/wcat/samples/src/precomp.h index c63ddad18df..bd3147ecd15 100644 --- a/lib/wcat/samples/src/precomp.h +++ b/lib/wcat/samples/src/precomp.h @@ -1,14 +1,14 @@ -#ifndef _PRECOMP_H -#define _PRECOMP_H - -#include -#include -#include -#include -#include -#include - -#include -#include - -#endif // _PRECOMP_H +#ifndef _PRECOMP_H +#define _PRECOMP_H + +#include +#include +#include +#include +#include +#include + +#include +#include + +#endif // _PRECOMP_H diff --git a/lib/wcat/samples/src/viewstate.c b/lib/wcat/samples/src/viewstate.c index c0499f42a8e..fa6ac223cf2 100644 --- a/lib/wcat/samples/src/viewstate.c +++ b/lib/wcat/samples/src/viewstate.c @@ -1,186 +1,186 @@ -#include -#include -#include "precomp.h" - -#define MAX_VIEWSTATE (1024) -#define VIEWSTATE "__VIEWSTATE" -#define VIEWSTATE_LEN (10) -#define MAX_TAG_NAME (128) - -#define WCATRESULT_ERROR (-1) -#define WCATRESULT_SUCCESS (0) -#define WCATRESULT_MORE_DATA_NEEDED (1) -#define WCATRESULT_NEXT_PACKET (2) - -typedef enum _USER_STATE -{ - UserStateFindViewState, - UserStateFindValue, - UserStateFindEqual, - UserStateFindFirstQuote, - UserStateGetValue, - UserStateFinished -} USER_STATE; - -typedef struct _USER_DATA -{ - USER_STATE state; - char viewstate[MAX_VIEWSTATE]; -} USER_DATA, *PUSER_DATA; - -BOOL WINAPI DllMain( - IN HINSTANCE hinstDll, - IN DWORD dwReason, - IN LPVOID lpvContext - ) -{ - switch( dwReason ) { - - case DLL_PROCESS_ATTACH: - break; - - case DLL_PROCESS_DETACH: - break; - - default: - return FALSE; - } - - return TRUE; -} - -DWORD GetViewstate(PVOID *context, DWORD argc, PCHAR argv[], PCHAR *result) -{ - PUSER_DATA user; - - if (*context == NULL) - { - *result = NULL; - return 0; - } - - user = *context; - - *result = user->viewstate; - - return 0; -} - -DWORD ResponseFilter(PVOID *context, DWORD argc, PCHAR argv[], PCHAR packet, ULONG_PTR len, ULONG_PTR sequence) -{ - PCHAR buffer = packet; - DWORD i = 0; - PUSER_DATA user = NULL; - - if (*context == NULL) - { - *context = calloc(1, sizeof(USER_DATA)); - - if (NULL == *context) - { - return -1; - } - } - - user = *context; - - if (sequence == 0) - { - user->state = UserStateFindViewState; - user->viewstate[0] = '\0'; - } - - // - // fastpath for when we don't have any work to do - // - if (user->state == UserStateFinished) - { - return WCATRESULT_SUCCESS; - } - - while (len && *buffer) - { - switch (user->state) - { - case UserStateFindViewState: - if (*buffer == '_') - { - if (len < VIEWSTATE_LEN) - { - return WCATRESULT_MORE_DATA_NEEDED; - } - - if (_strnicmp(buffer, VIEWSTATE, VIEWSTATE_LEN) == 0) - { - len -= VIEWSTATE_LEN-1; - buffer += VIEWSTATE_LEN-1; - - user->state = UserStateFindValue; - } - } - - break; - case UserStateFindValue: - if (*buffer == 'v' || *buffer == 'V') - { - if (len < 5) - { - return WCATRESULT_MORE_DATA_NEEDED; - } - - if (_strnicmp(buffer, "value", 5) == 0) - { - len -= 4; - buffer += 4; - - user->state = UserStateFindEqual; - } - } - break; - case UserStateFindEqual: - if (*buffer == '=') - { - user->state = UserStateFindFirstQuote; - } - - break; - case UserStateFindFirstQuote: - if (*buffer == '"') - { - user->state = UserStateGetValue; - } - - break; - case UserStateGetValue: - i = 0; - - for (i=0; len && *buffer && *buffer != '"'; i++, len--, buffer++) - { - if (i > MAX_VIEWSTATE) - { - return WCATRESULT_ERROR; - } - - user->viewstate[i] = *buffer; - } - - if (len == 0 || *buffer != '"') - { - return WCATRESULT_MORE_DATA_NEEDED; - } - - user->viewstate[i] = '\0'; - - user->state = UserStateFinished; - break; - case UserStateFinished: - break; - default: - break; - } - - len--; buffer++; - } - - return WCATRESULT_SUCCESS; -} +#include +#include +#include "precomp.h" + +#define MAX_VIEWSTATE (1024) +#define VIEWSTATE "__VIEWSTATE" +#define VIEWSTATE_LEN (10) +#define MAX_TAG_NAME (128) + +#define WCATRESULT_ERROR (-1) +#define WCATRESULT_SUCCESS (0) +#define WCATRESULT_MORE_DATA_NEEDED (1) +#define WCATRESULT_NEXT_PACKET (2) + +typedef enum _USER_STATE +{ + UserStateFindViewState, + UserStateFindValue, + UserStateFindEqual, + UserStateFindFirstQuote, + UserStateGetValue, + UserStateFinished +} USER_STATE; + +typedef struct _USER_DATA +{ + USER_STATE state; + char viewstate[MAX_VIEWSTATE]; +} USER_DATA, *PUSER_DATA; + +BOOL WINAPI DllMain( + IN HINSTANCE hinstDll, + IN DWORD dwReason, + IN LPVOID lpvContext + ) +{ + switch( dwReason ) { + + case DLL_PROCESS_ATTACH: + break; + + case DLL_PROCESS_DETACH: + break; + + default: + return FALSE; + } + + return TRUE; +} + +DWORD GetViewstate(PVOID *context, DWORD argc, PCHAR argv[], PCHAR *result) +{ + PUSER_DATA user; + + if (*context == NULL) + { + *result = NULL; + return 0; + } + + user = *context; + + *result = user->viewstate; + + return 0; +} + +DWORD ResponseFilter(PVOID *context, DWORD argc, PCHAR argv[], PCHAR packet, ULONG_PTR len, ULONG_PTR sequence) +{ + PCHAR buffer = packet; + DWORD i = 0; + PUSER_DATA user = NULL; + + if (*context == NULL) + { + *context = calloc(1, sizeof(USER_DATA)); + + if (NULL == *context) + { + return -1; + } + } + + user = *context; + + if (sequence == 0) + { + user->state = UserStateFindViewState; + user->viewstate[0] = '\0'; + } + + // + // fastpath for when we don't have any work to do + // + if (user->state == UserStateFinished) + { + return WCATRESULT_SUCCESS; + } + + while (len && *buffer) + { + switch (user->state) + { + case UserStateFindViewState: + if (*buffer == '_') + { + if (len < VIEWSTATE_LEN) + { + return WCATRESULT_MORE_DATA_NEEDED; + } + + if (_strnicmp(buffer, VIEWSTATE, VIEWSTATE_LEN) == 0) + { + len -= VIEWSTATE_LEN-1; + buffer += VIEWSTATE_LEN-1; + + user->state = UserStateFindValue; + } + } + + break; + case UserStateFindValue: + if (*buffer == 'v' || *buffer == 'V') + { + if (len < 5) + { + return WCATRESULT_MORE_DATA_NEEDED; + } + + if (_strnicmp(buffer, "value", 5) == 0) + { + len -= 4; + buffer += 4; + + user->state = UserStateFindEqual; + } + } + break; + case UserStateFindEqual: + if (*buffer == '=') + { + user->state = UserStateFindFirstQuote; + } + + break; + case UserStateFindFirstQuote: + if (*buffer == '"') + { + user->state = UserStateGetValue; + } + + break; + case UserStateGetValue: + i = 0; + + for (i=0; len && *buffer && *buffer != '"'; i++, len--, buffer++) + { + if (i > MAX_VIEWSTATE) + { + return WCATRESULT_ERROR; + } + + user->viewstate[i] = *buffer; + } + + if (len == 0 || *buffer != '"') + { + return WCATRESULT_MORE_DATA_NEEDED; + } + + user->viewstate[i] = '\0'; + + user->state = UserStateFinished; + break; + case UserStateFinished: + break; + default: + break; + } + + len--; buffer++; + } + + return WCATRESULT_SUCCESS; +} diff --git a/lib/wcat/samples/src/viewstate.def b/lib/wcat/samples/src/viewstate.def index 77a7c582938..7023c879655 100644 --- a/lib/wcat/samples/src/viewstate.def +++ b/lib/wcat/samples/src/viewstate.def @@ -1,7 +1,7 @@ -; MYTESTSERVICE.def : declares the module parameters for the DLL. - -LIBRARY "Viewstate" - -EXPORTS - GetViewstate - ResponseFilter +; MYTESTSERVICE.def : declares the module parameters for the DLL. + +LIBRARY "Viewstate" + +EXPORTS + GetViewstate + ResponseFilter diff --git a/lib/wcat/samples/src/wcat.h b/lib/wcat/samples/src/wcat.h index 8f88906db50..6c422702a41 100644 --- a/lib/wcat/samples/src/wcat.h +++ b/lib/wcat/samples/src/wcat.h @@ -1,9 +1,9 @@ -#ifndef _WCAT_H -#define _WCAT_H - -#define WCATRESULT_ERROR (-1) -#define WCATRESULT_SUCCESS (0) -#define WCATRESULT_MORE_DATA_NEEDED (1) -#define WCATRESULT_NEXT_PACKET (2) - -#endif // define _WCAT_H +#ifndef _WCAT_H +#define _WCAT_H + +#define WCATRESULT_ERROR (-1) +#define WCATRESULT_SUCCESS (0) +#define WCATRESULT_MORE_DATA_NEEDED (1) +#define WCATRESULT_NEXT_PACKET (2) + +#endif // define _WCAT_H diff --git a/lib/wcat/wcat.wsf b/lib/wcat/wcat.wsf index 74f0702e334..34f0fc8a23d 100644 --- a/lib/wcat/wcat.wsf +++ b/lib/wcat/wcat.wsf @@ -1,1134 +1,1134 @@ - - - - + + + + diff --git a/lib/windowsazure/Microsoft.ApplicationServer.Caching.AzureCommon.xml b/lib/windowsazure/Microsoft.ApplicationServer.Caching.AzureCommon.xml index cc2a3c9f6eb..837da4c56a7 100644 --- a/lib/windowsazure/Microsoft.ApplicationServer.Caching.AzureCommon.xml +++ b/lib/windowsazure/Microsoft.ApplicationServer.Caching.AzureCommon.xml @@ -1,27 +1,27 @@ - - - - Microsoft.ApplicationServer.Caching.AzureCommon - - - - Used to configure cache diagnostics. - - - Configures cache diagnostics using the specified diagnostic monitor configuration. This uses the diagnostic configuration setting to update any dynamic changes. - Returns . - DiagnosticMonitorConfiguration object used to start the diagnostic service. - - - Configures cache diagnostics using the specified diagnostic monitor configuration. This uses the diagnostic configuration setting to update any dynamic changes. - Returns . - Connection string to the storage account that stores the diagnostic monitor configuration in the wad-control-container blob. - DiagnosticMonitorConfiguration object used to start the diagnostic service. - - - Configures memcache shim diagnostics using the specified diagnostic monitor configuration. - Returns . - DiagnosticMonitorConfiguration object used to start the diagnostic service. - - + + + + Microsoft.ApplicationServer.Caching.AzureCommon + + + + Used to configure cache diagnostics. + + + Configures cache diagnostics using the specified diagnostic monitor configuration. This uses the diagnostic configuration setting to update any dynamic changes. + Returns . + DiagnosticMonitorConfiguration object used to start the diagnostic service. + + + Configures cache diagnostics using the specified diagnostic monitor configuration. This uses the diagnostic configuration setting to update any dynamic changes. + Returns . + Connection string to the storage account that stores the diagnostic monitor configuration in the wad-control-container blob. + DiagnosticMonitorConfiguration object used to start the diagnostic service. + + + Configures memcache shim diagnostics using the specified diagnostic monitor configuration. + Returns . + DiagnosticMonitorConfiguration object used to start the diagnostic service. + + \ No newline at end of file diff --git a/lib/windowsazure/Microsoft.ApplicationServer.Caching.Client.xml b/lib/windowsazure/Microsoft.ApplicationServer.Caching.Client.xml index cd17df46352..1aad1091b9f 100644 --- a/lib/windowsazure/Microsoft.ApplicationServer.Caching.Client.xml +++ b/lib/windowsazure/Microsoft.ApplicationServer.Caching.Client.xml @@ -1,1045 +1,1045 @@ - - - - Microsoft.ApplicationServer.Caching.Client - - - - - Returns . - - - Returns . - - - Returns . - - - Returns . - - - - - Returns . - - - Returns . - - - -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Internal. - - - - - - - - - - - - - - - - - - - - - - - - - - - - The object that is used by cache-enabled applications for storing and retrieving objects from the cache. An instance of this object is referred to as the cache client. - - - Creates a DataCache that accesses the "default" cache; uses settings in the "default" cache client configuration. - - - Creates a DataCache that accesses the specified cache name; uses settings in the "default" cache client configuration. - The named cache to use. For Windows Azure Shared Caching, this must be "default". - - - Creates a DataCache that accesses the specified cache name; uses settings in the named cache client configuration. - The named cache to use. For Windows Azure Shared Caching, this must be "default". - The cache client configuration to use to initialize the DataCache object. - - - Adds an object to the cache. - A object that represents the version of the object saved to the cache under the key value. - A unique value that is used to store and retrieve the object from the cache. Key names must be less than 65 KB. - The object saved to the cache. - - - Adds an object to the cache. This method enables associating tags with the cached object. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the object saved to the cache under the key value. - A unique value that is used to store and retrieve the object from the cache. Key names must be less than 65 KB. - The object saved to the cache. - An array of objects to associate with the cached object. - - - Adds an object to a region in the cache. This method enables association of tags with objects in the cache. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the object saved to the cache under the key value. - A unique value that is used to store and retrieve the object from the cache. Key names must be less than 65 KB. - The object saved to the cache. - An array of objects to associate with the cached object. - The name of the region to save the object in. - - - Adds an object to a region in the cache. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the object saved to the cache under the key value. - A unique value that is used to store and retrieve the object from the cache. Key names must be less than 65 KB. - The object saved to the cache. - The name of the region to save the object in. - - - Adds an object to the cache. This method provides the ability to specify when the object should be expired. - A object that represents the version of the object saved to the cache under the key value. - A unique value that is used to store and retrieve the object from the cache. Key names must be less than 65 KB. - The object saved to the cache. - The amount of time the object should reside in the cache before expiration. - - - Adds an object to the cache. This method enables associating tags with the cached object and specifying when the object should be expired. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the object saved to the cache under the key value. - A unique value that is used to store and retrieve the object from the cache. Key names must be less than 65 KB. - The object saved to the cache. - The amount of time that the object should reside in the cache before expiration. - An array of objects to associate with the cached object. - - - Adds an object to a region in the cache. This method enables associating tags with the cached object and specifying when the object should be expired. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the object saved to the cache under the key value. - A unique value that is used to store and retrieve the object from the cache. Key names must be less than 65 KB. - The object saved to the cache. - The amount of time that the object should reside in the cache before expiration. - An array of objects to associate with the cached object. - The name of the region to save the object. - - - Adds an object to a region in the cache. This method provides the ability to specify when the object should be expired. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the object saved to the cache under the key value. - A unique value that is used to store and retrieve the object from the cache. Key names must be less than 65 KB. - The object saved to the cache. - The amount of time that the object should reside in the cache before expiration. - The name of the region to save the object. - - - Adds a bulk cache notification callback for cache operations occurring on all regions and items. Not supported in Windows Azure Shared Caching. - A object used to identify the cache bulk notification callback. - The name of the method you want to invoke when these notifications occur. - - - Adds a cache notification callback for cache operations occurring on all regions and items. Not supported in Windows Azure Shared Caching. - A object used to identify the cache notification callback. - The type of cache operation(s) that will trigger cache notifications. - The name of the method you want to invoke when these notifications occur. - - - Adds a failure notification callback, for notifications indicating that a client has missed one or more cache notifications. Not supported in Windows Azure Shared Caching. - A object used to identify the cache notification callback. - The name of the method that you want to invoke when the failure notification occurs. - - - Adds a cache notification callback for cache operations occurring on one specific item that is not stored in a region. Not supported in Windows Azure Shared Caching. - A object used to identify the cache notification callback. - The key used to store the object in the cache. - The type of cache operation(s) that will trigger cache notifications. - The name of the method you want to invoke when these notifications occur. - - - Adds a cache notification callback for cache operations occurring on one specific item that is stored in region. Not supported in Windows Azure Shared Caching. - A object used to identify the cache notification callback. - The key used to store the object in the cache. - The type of cache operation(s) that will trigger cache notifications. - The name of the method you want to invoke when these notifications occur. - The name of the region where the object is stored. - - - Adds a cache notification callback for cache operations occurring on one specific region. Not supported in Windows Azure Shared Caching. - A object used to identify the cache notification callback. - The name of the region for which the specified item or region operations can trigger cache notifications. - The type of cache operation(s) that will trigger cache notifications. - The name of the method you want to invoke when these notifications occur. - - - Concatenates a string to a string object stored in the cache. - The key of the object stored in the cache. The object must be a string. - The string to concatenate to the stored object. - - - Concatenates a string to a string object stored in the cache in the specified region. - The key of the object stored in the cache. The object must be a string. - The string to concatenate to the stored object. - The user-defined region in which the object is stored. - - - Gets all of the objects associated with the specified keys across all system regions. This method does not search user-defined regions. - Returns an object with a list of key and value pairs. - List of keys for the objects to retrieve, cannot be null. - - - Returns objects for the specified keys from the specified region of the cache. Not supported in Windows Azure Shared Caching. - Returns an object with a list of key and value pairs. - List of keys for the objects to retrieve, cannot be null. - Name of the region, cannot be null. - - - Internal. - - - Internal. - - - Removes all objects from the cache associated with the DataCache object. - - - Deletes all objects in the specified region. Not supported in Windows Azure Shared Caching. - The name of the region whose objects are removed. - - - Creates a region. Not supported in Windows Azure Shared Caching. - Returns a value.. - The name of the region that is created. Region names must be less than 65 KB. - - - Decrements a long value stored in the cache. - Returns the decremented value. - The key of the object stored in the cache. The object must be a long. - The amount to decrease the stored value. - The initial value to use if the object does not exist in the cache. - - - Decrements a long value stored in the cache in the specified region. - Returns the decremented value. - The key of the object stored in the cache. The object must be a long. - The amount to decrease the stored value. - The initial value to use if the object does not exist in the cache. - The user-defined region in which the object is stored. - - - Gets an object from the cache using the specified key. - The object that was cached by using the specified key. Null is returned if the key does not exist. - The unique value that is used to identify the object in the cache. - - - Gets an object from the cache using the specified key. You may also provide the version to obtain a specific version of a key, if that version is still the most current in the cache. - The object that was cached by using the specified key. Null is returned if the key does not exist. Even if the key does exist, Null may also be returned because the object has been updated to a new version. - The unique value that is used to identify the object in the cache. - The version of the desired object. If this parameter is null, the version of the current object is retrieved. - - - Gets an object from the specified region by using the specified key. You may also provide the version to obtain the specific version of a key, if that version is still the most current in the region. This overload is not supported in Windows Azure Shared Caching. - The object that was cached by using the specified key. Null is returned if the key does not exist. Even if the key does exist, Null may also be returned because the object has been updated to a new version. - The unique value that is used to identify the object in the region. - The version of the desired object. If this parameter is null, the version of the current object is retrieved. - The name of the region where the object resides. - - - Gets an object from the specified region by using the specified key. This overload is not supported in Windows Azure Shared Caching. - The object that was cached by using the specified key. Null is returned if the key does not exist. - The unique value that is used to identify the object in the region. - The name of the region where the object resides. - - - Locks the key if the key is present and it is not locked and returns the object corresponding to the key. - Returns matching the specified parameter if the is present and is not locked. If the key does not exist, a DataCacheException object is thrown with the ErrorCode set to . Create objects based on the referenced key to resolve this error.If the object is already locked by another cache client, a DataCacheException object is thrown with the ErrorCode set to . The object will be inaccessible until it is unlocked by the locking client. - The unique value that is used to identify the object in the cache. - The amount of time that the object should remain locked. - The object required to unlock the object. The output parameter is passed by reference. - - - Lock the key if key is present and it is not locked by any clients and returns the object corresponding to the key. - Returns matching the specified parameter if the is present and is not locked. If the key does not exist, a DataCacheException object is thrown with the ErrorCode set to . Create objects based on the referenced key to resolve this error.If the object is already locked by another cache client, a DataCacheException object is thrown with the ErrorCode set to . The object will be inaccessible until it is unlocked by the locking client. - The unique value that is used to identify the object in the region. - The amount of time that object remains locked. - The object required to unlock the object. The output parameter is passed by reference. - If forceLock is true, key is locked irrespective of key-value pair presence in cache. - - - Locks the key if the key is present and is not locked and returns the object corresponding to the key. For objects stored in regions. This overload is not supported in Windows Azure Shared Caching. - Returns matching the specified parameter if the is present and is not locked.If the key does not exist, a DataCacheException object is thrown with the ErrorCode set to . Create objects based on the referenced key to resolve this error.If the object is already locked by another cache client, a DataCacheException object is thrown with the ErrorCode set to . The object will be inaccessible until it is unlocked by the locking client. - The unique value that is used to identify the object in the region. - The amount of time that the object remains locked. - The object required to unlock the object. The output parameter is passed by reference. - The name of the region where the object resides. - - - Lock the key if key is present and it is not locked by any clients and returns the object corresponding to the key. For objects stored in regions. This overload is not supported in Windows Azure Shared Caching. - Returns matching the specified parameter if the is present and is not locked.If the key does not exist, a DataCacheException object is thrown with the ErrorCode set to . Create objects based on the referenced key to resolve this error.If the object is already locked by another cache client, a DataCacheException object is thrown with the ErrorCode set to . The object will be inaccessible until it is unlocked by the locking client. - The unique value that is used to identify the object in the region. - The amount of time that the object remains locked. - The object required to unlock the object. The output parameter is passed by reference. - The name of the region where the object resides. - If forceLock is true, key is locked irrespective of key-value pair presence in cache. - - - Gets a object to retrieve all information associated with your cached object in the cluster. - A object that contains all information associated with your cached object. Null is returned if the key does not exist. - The unique value that is used to identify the object in the cache. - - - Gets a object to retrieve all information associated with your cached object in the cluster. For objects stored in regions. This overload is not supported in Windows Azure Shared Caching. - A object that contains all information associated with your cached object. Null is returned if the key does not exist. - The unique value that is used to identify the object in the region. - The name of the region where the object resides. - - - Gets an object from the cache, but only if a newer version of the object resides in the cache. - If the version in the cache differs from the version parameter, the corresponding cached object is returned. If the version in the cache is the same as the version parameter, null is returned. - The unique value that is used to identify the object in the cache. - The version of the desired object, passed by reference. - - - Gets an object from the specified region, but only if a newer version of the object resides in the region. This overload is not supported in Windows Azure Shared Caching. - If the version in the region differs from the version parameter, the corresponding cached object is returned. If the version in the region is the same as the version parameter, null is returned. - The unique value that is used to identify the object in the cache. - The version of the desired object, passed by reference. - The name of the region where the object resides. - - - Gets an enumerable list of all cached objects in the specified region that have all the same tags in common. Not supported in Windows Azure Shared Caching. - An enumerable list of all cached objects in the specified region that have all the same tags in common. - A list of tags for which to search. - The name of the region to search. Tags are not supported outside regions. Therefore, a region name is required. - - - Gets an enumerable list of all cached objects in the specified region that have any of the same tags in common. Not supported in Windows Azure Shared Caching. - An enumerable list of all cached objects in the specified region that have any of the same tags in common. Null is returned if no objects in the specified region have any of the tags specified. - A list of tags for which to search. - The name of the region to search. Tags are not supported outside regions. Therefore, a region name is required. - - - Gets an enumerable list of all cached objects in the specified region that have the specified tag. Not supported in Windows Azure Shared Caching. - An enumerable list of all cached objects in the specified region that have the specified tag. Null is returned if no objects in the specified region have the tag specified. - The tag for which to search. - The name of the region to search. Tags are not supported outside regions. Therefore, a region name is required. - - - Gets an enumerable list of all cached objects in the specified region. Not supported in Windows Azure Shared Caching. - An enumerable list of all cached objects in the specified region. - The name of the region for which to return a list of all resident objects. - - - Returns the system region name for the specified key. Not supported in Windows Azure Shared Caching. - Returns the region name as a . - The key for which to find the associated system region. - - - Used to determine the default regions for the cache. Not supported in Windows Azure Shared Caching. - Returns an enumerable list of default regions as an object. - - - Increments a long value stored in the cache. - Returns the incremented value. - The key of the object stored in the cache. The object must be a long. - The amount to increase the stored value. - The initial value to use if the object does not exist in the cache. - - - Increments a long value stored in the cache in the specified region. - Returns the incremented value. - The key of the object stored in the cache. The object must be a long. - The amount to increase the stored value. - The initial value to use if the object does not exist in the cache. - The user-defined region in which the object is stored. - - - Allows for the use of array notation to access cached objects. - A deserialized object that was saved to the cache that uses the key. - The key that is used to save the cached object. - - - The name of the cache associated with the DataCache object. - Returns . - - - Prepends a string to a string object stored in the cache. - The key of the object stored in the cache. The object must be a string. - The string to prepend to the stored object. - - - Prepends a string to a string object stored in the cache in the specified region. - The key of the object stored in the cache. The object must be a string. - The string to prepend to the stored object. - The user-defined region in which the object is stored. - - - Adds or replaces an object in the cache. - A object that represents the version of the object saved to the cache under the key value. - The unique value that is used to identify the object in the cache. Key names must be less than 65 KB. - The object to add or replace. - - - Adds or replaces an object in the cache if it is at the specified version. - A object that represents the version of the object saved to the cache under the value. - The unique value that is used to identify the object in the cache. Key names must be less than 65 KB. - The object to add or replace. - The object that represents the version of the cached object that is to be replaced. - - - Adds or replaces an object in the cache if it is at the specified version. Associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the object saved to the cache under the value. - The unique value that is used to identify the object in the cache. Key names must be less than 65 KB. - The object to add or replace. - The object that represents the version of the cached object that is to be replaced. - A list of tags to associate with the object. - - - Adds or replaces an object in the specified region if it is at the specified version. Associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the object saved to the cache under the value. - The unique value that is used to identify the object in the region. Key names must be less than 65 KB. - The object to add or replace. - The object that represents the version of the cached object that is to be replaced. - A list of tags to associate with the object. - The name of the region the object resides in. - - - Adds or replaces an object in the specified region if it is at the specified version. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the object saved to the cache under the value. - The unique value that is used to identify the object in the region. Key names must be less than 65 KB. - The object to add or replace. - The object that represents the version of the cached object that is to be replaced. - The name of the region the object resides in. - - - Adds or replaces an object in the cache if it is at the specified version. Specifies the timeout value of the cached object. - A object that represents the version of the object saved to the cache under the key value. - The unique value that is used to identify the object in the region. Key names must be less than 65 KB. - The object to add or replace. - The object that represents the version of the cached object that is to be replaced. - The amount of time that the object should reside in the cache before expiration. - - - Adds or replaces an object in the cache if it is at the specified version. Specifies the timeout value and associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the object saved to the cache under the key value. - The unique value that is used to identify the object in the cache. Key names must be less than 65 KB. - The object to add or replace. - The object that represents the version of the cached object that is to be replaced. - The amount of time that the object should reside in the cache before expiration. - A list of tags to associate with the object. - - - Adds or replaces an object in the specified region if it is at the specified version. Specifies the timeout value and associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the object saved to the cache under the key value. - The unique value that is used to identify the object in the region. Key names must be less than 65 KB. - The object to add or replace. - The object that represents the version of the cached object that is to be replaced. - The amount of time that the object should reside in the cache before expiration. - A list of tags to associate with the object. - The name of the region the object resides in. - - - Adds or replaces an object in the specified region if it is at the specified version. Specifies the timeout value of the cached object. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the object saved to the cache under the value. - The unique value that is used to identify the object in the region. Key names must be less than 65 KB. - The object to add or replace. - The object that represents the version of the cached object that is to be replaced. - The amount of time that the object should reside in the cache before expiration. - The name of the region the object resides in. - - - Adds or replaces an object in the cache. Associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the object saved to the cache under the key value. - The unique value that is used to identify the object in the cache. Key names must be less than 65 KB. - The object to add or replace. - A list of tags to associate with the object. - - - Adds or replaces an object in the specified region. Associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the object saved to the cache under the value. - The unique value that is used to identify the object in the region. Key names must be less than 65 KB. - The object to add or replace. - A list of tags to associate with the object. - The name of the region the object resides in. - - - Adds or replaces an object in the specified region. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the object saved to the cache under the value. - The unique value that is used to identify the object in the region. Key names must be less than 65 KB. - The object to add or replace. - The name of the region the object resides in. - - - Adds or replaces an object in the cache. Specifies the timeout value of the cached object. - A object that represents the version of the object saved to the cache under the value. - The unique value that is used to identify the object in the cache. Key names must be less than 65 KB. - The object to add or replace. - The amount of time that the object should reside in the cache before expiration. - - - Adds or replaces an object in the cache. Specifies the timeout value and associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the object saved to the cache under the value. - The unique value that is used to identify the object in the cache. Key names must be less than 65 KB. - The object to add or replace. - The amount of time that the object should reside in the cache before expiration. - A list of tags to associate with the object. - - - Adds or replaces an object in the specified region. Specifies the timeout value and associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the object saved to the cache under the value. - The unique value that is used to identify the object in the region. Key names must be less than 65 KB. - The object to add or replace. - The amount of time that the object should reside in the cache before expiration. - A list of tags to associate with the object. - The name of the region the object resides in. - - - Adds or replaces an object in the specified region. Specifies the timeout value of the cached object. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the object saved to the cache under the value. - Adds or replaces an object in the specified region. Specifies the timeout value of the cached object. Key names must be less than 65 KB. - The object to add or replace. - The amount of time that the object should reside in the cache before expiration. - The name of the region the object resides in. - - - Replaces and unlocks an object in the cache. - A object that represents the version of the cached object after it has been updated by this method. - The unique value that is used to identify the object in the cache. - The object to add or replace. - The object that was returned when the object was locked. - - - Replaces and unlocks an object in the cache. Associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the cached object after it has been updated by this method. - The unique value that is used to identify the object in the cache. - The object to add or replace. - The object that was returned when the object was locked. - A list of tags to associate with the object. - - - Replaces and unlocks an object in the specified region. Associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the cached object after it has been updated by this method. - The unique value that is used to identify the object in the region. - The object to add or replace. - The object that was returned when the object was locked. - A list of tags to associate with the object. - The name of the region the object resides in. - - - Replaces and unlocks an object in the specified region. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the cached object after it has been updated by this method. - The unique value that is used to identify the object in the region. - The object to add or replace. - The object that was returned when the object was locked. - The name of the region the object resides in. - - - Replaces and unlocks an object in the cache. Specifies the timeout value of the cached object. - A object that represents the version of the cached object after it has been updated by this method. - The unique value that is used to identify the object in the cache. - The object to add or replace. - The object that was returned when the object was locked. - The amount of time that the object should reside in the cache before expiration. - - - Replaces and unlocks an object in the cache. Specifies the timeout value and associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the cached object after it has been updated by this method. - The unique value that is used to identify the object in the cache. - The object to add or replace. - The object that was returned when the object was locked. - The amount of time that the object should reside in the cache before expiration. - A list of tags to associate with the object. - - - Replaces and unlocks an object in the specified region. Specifies the timeout value and associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the cached object after it has been updated by this method. - The unique value that is used to identify the object in the region. - The object to add or replace. - The object that was returned when the object was locked. - The amount of time that the object should reside in the cache before expiration. - A list of tags to associate with the object. - The name of the region the object resides in. - - - Replaces and unlocks an object in the specified region. Specifies the timeout value of the cached object. This overload is not supported in Windows Azure Shared Caching. - A object that represents the version of the cached object after it has been updated by this method. The timeout value associated with the cached object overrides expiration settings specified in the named cache configuration. - The unique value that is used to identify the object in the region. - The object to add or replace. - The object that was returned when the object was locked. - The amount of time that the object should reside in the cache before expiration. - The name of the region the object resides in. - - - Removes an object from the cache. - True if the object identified by the key is removed; otherwise, false. - The unique value that is used to identify the object in the region. - - - Removes an object with a specific version from the cache. - True if the object is removed; otherwise, false. - The unique value that is used to identify the object in the region. - The object that represents the version of the cached object that is to be removed. - - - Removes an object with a specific version from the cache in a region. This overload is not supported in Windows Azure Shared Caching. - True if the object is removed; otherwise, false. - The unique value that is used to identify the object in the region. - The object that represents the version of the cached object that is to be removed. - The name of the region the object resides in. - - - Removes an object from the cache with an associated lock handle. - True if an object from the cache was removed; otherwise, false. - The unique value that is used to identify the object in the cache. - The object that was returned when the object is removed. - - - Removes an object from the cache with an associated lock handle in a region. This overload is not supported in Windows Azure Shared Caching. - True if the object is removed; otherwise, false. - The unique value that is used to identify the object in the region. - The object that was returned when the object was removed. - The name of the region the object resides in. - - - Removes an object from the cache in a region. This overload is not supported in Windows Azure Shared Caching. - True if the object is removed; otherwise, false. - The unique value that is used to identify the object in the region. - The name of the region the object resides in. - - - Removes a cache notification callback. Not supported in Windows Azure Shared Caching. - - - Deletes a region. All cached objects inside the region are also removed. Not supported in Windows Azure Shared Caching. - Returns true if the region is removed. Returns false if the region does not exist. - The name of the region. - - - Resets the object timeout value, defining how long objects reside in the cache before expiring. The value specified for the object overrides the default settings for the cache. - The unique value that is used to identify the object in the region. - The amount of time that the object should reside in the cache before expiration. - - - Resets the object timeout value, defining how long objects reside in the region before expiring. The value specified for the object overrides the default settings for the cache. - The unique value that is used to identify the object in the region. - The amount of time that the object should reside in the cache before expiration. - The name of the region where the object resides. - - - Releases objects locked in the cache. This method supports pessimistic concurrency by making sure that the appropriate DataCacheLockHandle is used for unlocking the object. - The unique value that is used to identify the object in the region. - The object that was returned when the object was locked - - - Releases objects locked in the specified region. This method supports pessimistic concurrency by making sure that the appropriate DataCacheLockHandle is used for unlocking the object. This overload is not supported in Windows Azure Shared Caching. - The unique value that is used to identify the object in the region. - The object that was returned when the object was locked. - The name of the region where the object resides. - - - Releases objects locked in the cache. This method supports pessimistic concurrency by making sure that the appropriate DataCacheLockHandle is used for unlocking the object. Specifies a new timeout value for the cached object. - The unique value that is used to identify the object in the region. - The object that was returned when the object was locked. - The amount of time that the object should reside in the cache before expiration. - - - Releases objects locked in the specified region. This method supports pessimistic concurrency by making sure that the appropriate DataCacheLockHandle is used for unlocking the object. Specifies a new timeout value for the cached object. This overload is not supported in Windows Azure Shared Caching. - The unique value that is used to identify the object in the region. - The object that was returned when the object was locked. - The amount of time that the object should reside in the cache before expiration. - The name of the region where the object resides. - - - Specifies whether automatic discovery is enabled for the role or endpoint that hosts Windows Azure Caching. - - - Creates a new DataCacheAutoDiscoverProperty object. - A value of true enables automatic discovery. - - - Creates a new DataCacheAutoDiscoverProperty object; specifies the web role, worker role or endpoint that hosts Caching. - A value of true enables automatic discovery. - The name of the web role, worker role or endpoint that hosts Caching in the cloud service deployment. - - - Specifies a callback which is called with a list of cache operations. Not supported in Windows Azure Shared Caching. - The name of the cache where the object is stored. - A list of cache operations. - The associated with the cache notification that invoked the delegate method. - - - Provides methods to return objects that are mapped to a named cache. This class also enables programmatic configuration of the cache client. - - - Used for configuring a cache client based on the application configuration file. - - - Used for programmatically configuring a cache client. - A object that specifies the cache client configuration settings for the DataCacheFactory instance. - - - Closes the object and releases all associated resources. - - - Returns the cache client, an instance of the object. - The cache client, an instance of the DataCache object. - The named cache to use for cache operations. For , the cache name must be “default”, which is the same as calling . - - - Returns the cache client corresponding to the default cache, an instance of the object. - The cache client, an instance of the DataCache object. - - - Specifies the configuration settings for a new cache client. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. This overload specifies a specific name for the cache client. - The name of the cache client. If the application configuration file specifies multiple named dataCacheClient sections, this parameter can be used to specify which dataCacheClient section to use. - - - Specifies whether automatic discovery is enabled for the role or endpoint that hosts Windows Azure Caching. - Returns . - - - Specifies the retry policy for the cache client. - Returns . - - - Gets or sets the length of time that the cache client waits to establish a network connection with the server. - A object.. - - - Create a duplicate DataCacheFactoryConfiguration object. - Returns a that can be cast to a object. - - - Create a new cache client configuration. - Returns . - The name of the new cache client configuration. - A DataCacheFactoryConfiguration object that contains the settings for the new client configuration. - A value of true enables connection pooling. - - - The type of account that runs the Caching service. - Returns . - - - Specifies whether compression is enabled. A value of true enables compression. The default is false. - Returns . - - - Gets or sets the local cache settings for the cache client. - A object. - - - Specifies the maximum number of channels to open to the cache cluster. - Returns . - - - Gets or sets the notification settings for the cache client. Not supported in Windows Azure Shared Caching. - A object. - - - Removes a cache client configuration and its settings from memory. - Returns . - The name of the cache client configuration. - - - Gets or sets the length of time that the cache client waits for a response from the server for each request. - A object. - - - Gets or sets the security properties for the cache client. - A object. - - - Specifies the type of serialization to use. - Returns . - - - Gets or sets an array of objects. - Returns . - - - Gets or sets the transport properties for the cache client. - A object. - - - A value of true specifies that the legacy protocol should be used for connecting to the cache. - Returns . - - - Specifies the parameters required for a method to be invoked by a failure notification when the cache client misses cache notifications. Not supported in Windows Azure Shared Caching. - The name of the cache associated with the missing notifications. - The object associated with the failure notification that invoked the delegate method. - - - Specifies the local cache settings for a cache client. - - - Creates a new instance of the class. - - - Creates a new instance of the class. This overloaded constructor accepts parameters that configure the properties of local cache. - The maximum number of objects in the local cache. - The time that objects reside in the local cache before invalidation. - The invalidation policy for the local cache. This can be set to either or . - - - Gets the default timeout for items in the local cache. - Returns . - - - Gets the invalidation policy for items in the local cache. - Returns . - - - Gets a Boolean value indicating whether local cache is enabled for the cache client. - Returns . - - - Gets the maximum number of objects permitted in the local cache. - Returns . - - - Represents a callback method that is to be invoked by a cache notification when one or more cache operations take place. Applies only to the server versions of AppFabric. - The name of the region associated with the cache operation. A zero-length string indicates that a specific region is not associated with the cache operation. - The name of the key associated with the cache operation. A zero-length string indicates that a specific cached item is not associated with the cache operation. - The of the cached object associated with the cache operation that triggered the notification. A null version indicates that a specific cached item is not associated with the cache operation. - The enumeration specifying which cache event triggered the cache notification. - The object associated with the cache notification that invoked the delegate method. - - - Identifies a cache notification callback. This identifier is required to remove the corresponding cache notification callback. Applies only to the server versions of AppFabric. - - - The name of the cache triggering the cache notification. - A string value represents the name of the cache triggering the cache notification. - - - Identifier for the object. Used to distinguish between DataCacheNotificationDescriptor objects. - A value used to identify DataCacheNotificationDescriptor objects. - - - Creates a copy of the object. - A string value representing the and property values. - - - Specifies the notification settings for a cache client. Applies only to the server versions of AppFabric. - - - Creates a new instance of the class. - The maximum queue length for stored notifications on the cache cluster. - The frequency with which the cache client communicates with the server to check for notifications. - - - Gets the maximum queue length for notifications on the cache cluster. - Returns . - - - Gets the polling interval that the cache client uses to check for notifications on the cache cluster. - Returns . - - - Controls the retry policy that is used at startup of a Windows Azure cloud service. - - - The maximum number of seconds between retries. - Returns . - - - The number of retry attempts. - Returns . - - - Used to specify an individual cache host when programmatically configuring the cache client. - - - Used to define a cache host in the cache cluster for programmatic configuration of the cache client. - The computer name of the cache server or the service URL. - The cache port number of the cache host. - - - The cache port on the cache server. - A value that represents the cache port number on the cache server. - - - Returns true if the DataCacheServerEndpoint objects are equal. - Returns . - The DataCacheServerEndpoint object to compare. - - - Returns the hash code for the DataCacheServerEndpoint. - Returns . - - - The computer name or service URL of the cache server. - A string representing the computer name or service URL of the cache server. - - - A session storage provider that enables Web applications to store session-state data to a distributed cache system. - - - Initializes a new instance of the class. - - - The application name. This is used to differentiate sessions in the data source by application. - Returns . - - - Creates a new data storage object for the current request. - A SessionStateStoreData object, used for storing session data in the distributed cache. - The HttpContext for the current request. - The session state Timeout value for the new SessionStateStoreData object. - - - Adds a new session state to the distributed cache. - The HttpContext for the current request. - The session identifier for the current request. - The session Timeout for the current request. - - - Releases all resources used by the class. - - - Called by the SessionStateModule class at the end of a request - The HttpContext for the current request. - - - Returns read-only session-state data from the cache. - A SessionStateStoreData object populated with session values and information from the cache - The HttpContext of the current request. - The session identifier for the current request. - When this method returns, contains a Boolean value that is set to true if the requested session item is locked in the cache; otherwise, false. - When this method returns, contains a TimeSpan object that is set to the period of time that an item in the cache has been locked. - When this method returns, contains an object that is set to the lock identifier for the current request. - When this method returns, contains one of the SessionStateActions values. This indicates whether the current session is an uninitialized, cookieless session. - - - Returns and locks the read-only session-state data from the cache. - A SessionStateStoreData object populated with session values and information from the cache. - The HttpContext of the current request. - The session identifier for the current request. - When this method returns, contains a Boolean value that is set to true if a lock in the cache is successfully obtained; otherwise, false. - When this method returns, contains a TimeSpan object that is set to the period of time that an item in the cache has been locked. - When this method returns, contains an object that is set to the lock identifier for the current request. - When this method returns, contains one of the SessionStateActions values. This indicates whether the current session is an uninitialized, cookieless session. - - - Initializes the distributed cache provider. - The name of the application. - The configuration details specified in the application configuration file for cacheName and regionName. - - - Initializes the outgoing HTTP request. - The context for the current request. - - - Releases a lock on the session data in the cache. - The HttpContext of the current request. - The session identifier of the current request. - The lock identifier of the current request. - - - Deletes session data from the cache. - The HttpContext of the current request. - The session identifier of the current request. - The lock identifier of the current request. - The SessionStateStoreData that represents the item to delete from the cache. - - - Updates the expiration date and time of session data in the cache. - The context for the current request. - The session identifier of the current request. - - - Updates the session item information in the cache with values from the current request and clears the lock on the session item. - The HttpContext of the current request. - The session identifier of the current request.. - The SessionStateStoreData object that contains the current session values to be stored. - The lock identifier for the current request. - If true, identifies the session item as a new item if true; otherwise, identifies the session item as an existing item. - - - Sets a reference to the SessionStateItemExpireCallback delegate for the Session_OnEnd event defined in the Global.asax file. - Cache does not support notification of the expiration; therefore this method always returns false. - The SessionStateItemExpireCallback delegate for the Session_OnEnd event defined in the Global.asax file. - - + + + + Microsoft.ApplicationServer.Caching.Client + + + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + + + Returns . + + + Returns . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Internal. + + + + + + + + + + + + + + + + + + + + + + + + + + + + The object that is used by cache-enabled applications for storing and retrieving objects from the cache. An instance of this object is referred to as the cache client. + + + Creates a DataCache that accesses the "default" cache; uses settings in the "default" cache client configuration. + + + Creates a DataCache that accesses the specified cache name; uses settings in the "default" cache client configuration. + The named cache to use. For Windows Azure Shared Caching, this must be "default". + + + Creates a DataCache that accesses the specified cache name; uses settings in the named cache client configuration. + The named cache to use. For Windows Azure Shared Caching, this must be "default". + The cache client configuration to use to initialize the DataCache object. + + + Adds an object to the cache. + A object that represents the version of the object saved to the cache under the key value. + A unique value that is used to store and retrieve the object from the cache. Key names must be less than 65 KB. + The object saved to the cache. + + + Adds an object to the cache. This method enables associating tags with the cached object. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the object saved to the cache under the key value. + A unique value that is used to store and retrieve the object from the cache. Key names must be less than 65 KB. + The object saved to the cache. + An array of objects to associate with the cached object. + + + Adds an object to a region in the cache. This method enables association of tags with objects in the cache. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the object saved to the cache under the key value. + A unique value that is used to store and retrieve the object from the cache. Key names must be less than 65 KB. + The object saved to the cache. + An array of objects to associate with the cached object. + The name of the region to save the object in. + + + Adds an object to a region in the cache. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the object saved to the cache under the key value. + A unique value that is used to store and retrieve the object from the cache. Key names must be less than 65 KB. + The object saved to the cache. + The name of the region to save the object in. + + + Adds an object to the cache. This method provides the ability to specify when the object should be expired. + A object that represents the version of the object saved to the cache under the key value. + A unique value that is used to store and retrieve the object from the cache. Key names must be less than 65 KB. + The object saved to the cache. + The amount of time the object should reside in the cache before expiration. + + + Adds an object to the cache. This method enables associating tags with the cached object and specifying when the object should be expired. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the object saved to the cache under the key value. + A unique value that is used to store and retrieve the object from the cache. Key names must be less than 65 KB. + The object saved to the cache. + The amount of time that the object should reside in the cache before expiration. + An array of objects to associate with the cached object. + + + Adds an object to a region in the cache. This method enables associating tags with the cached object and specifying when the object should be expired. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the object saved to the cache under the key value. + A unique value that is used to store and retrieve the object from the cache. Key names must be less than 65 KB. + The object saved to the cache. + The amount of time that the object should reside in the cache before expiration. + An array of objects to associate with the cached object. + The name of the region to save the object. + + + Adds an object to a region in the cache. This method provides the ability to specify when the object should be expired. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the object saved to the cache under the key value. + A unique value that is used to store and retrieve the object from the cache. Key names must be less than 65 KB. + The object saved to the cache. + The amount of time that the object should reside in the cache before expiration. + The name of the region to save the object. + + + Adds a bulk cache notification callback for cache operations occurring on all regions and items. Not supported in Windows Azure Shared Caching. + A object used to identify the cache bulk notification callback. + The name of the method you want to invoke when these notifications occur. + + + Adds a cache notification callback for cache operations occurring on all regions and items. Not supported in Windows Azure Shared Caching. + A object used to identify the cache notification callback. + The type of cache operation(s) that will trigger cache notifications. + The name of the method you want to invoke when these notifications occur. + + + Adds a failure notification callback, for notifications indicating that a client has missed one or more cache notifications. Not supported in Windows Azure Shared Caching. + A object used to identify the cache notification callback. + The name of the method that you want to invoke when the failure notification occurs. + + + Adds a cache notification callback for cache operations occurring on one specific item that is not stored in a region. Not supported in Windows Azure Shared Caching. + A object used to identify the cache notification callback. + The key used to store the object in the cache. + The type of cache operation(s) that will trigger cache notifications. + The name of the method you want to invoke when these notifications occur. + + + Adds a cache notification callback for cache operations occurring on one specific item that is stored in region. Not supported in Windows Azure Shared Caching. + A object used to identify the cache notification callback. + The key used to store the object in the cache. + The type of cache operation(s) that will trigger cache notifications. + The name of the method you want to invoke when these notifications occur. + The name of the region where the object is stored. + + + Adds a cache notification callback for cache operations occurring on one specific region. Not supported in Windows Azure Shared Caching. + A object used to identify the cache notification callback. + The name of the region for which the specified item or region operations can trigger cache notifications. + The type of cache operation(s) that will trigger cache notifications. + The name of the method you want to invoke when these notifications occur. + + + Concatenates a string to a string object stored in the cache. + The key of the object stored in the cache. The object must be a string. + The string to concatenate to the stored object. + + + Concatenates a string to a string object stored in the cache in the specified region. + The key of the object stored in the cache. The object must be a string. + The string to concatenate to the stored object. + The user-defined region in which the object is stored. + + + Gets all of the objects associated with the specified keys across all system regions. This method does not search user-defined regions. + Returns an object with a list of key and value pairs. + List of keys for the objects to retrieve, cannot be null. + + + Returns objects for the specified keys from the specified region of the cache. Not supported in Windows Azure Shared Caching. + Returns an object with a list of key and value pairs. + List of keys for the objects to retrieve, cannot be null. + Name of the region, cannot be null. + + + Internal. + + + Internal. + + + Removes all objects from the cache associated with the DataCache object. + + + Deletes all objects in the specified region. Not supported in Windows Azure Shared Caching. + The name of the region whose objects are removed. + + + Creates a region. Not supported in Windows Azure Shared Caching. + Returns a value.. + The name of the region that is created. Region names must be less than 65 KB. + + + Decrements a long value stored in the cache. + Returns the decremented value. + The key of the object stored in the cache. The object must be a long. + The amount to decrease the stored value. + The initial value to use if the object does not exist in the cache. + + + Decrements a long value stored in the cache in the specified region. + Returns the decremented value. + The key of the object stored in the cache. The object must be a long. + The amount to decrease the stored value. + The initial value to use if the object does not exist in the cache. + The user-defined region in which the object is stored. + + + Gets an object from the cache using the specified key. + The object that was cached by using the specified key. Null is returned if the key does not exist. + The unique value that is used to identify the object in the cache. + + + Gets an object from the cache using the specified key. You may also provide the version to obtain a specific version of a key, if that version is still the most current in the cache. + The object that was cached by using the specified key. Null is returned if the key does not exist. Even if the key does exist, Null may also be returned because the object has been updated to a new version. + The unique value that is used to identify the object in the cache. + The version of the desired object. If this parameter is null, the version of the current object is retrieved. + + + Gets an object from the specified region by using the specified key. You may also provide the version to obtain the specific version of a key, if that version is still the most current in the region. This overload is not supported in Windows Azure Shared Caching. + The object that was cached by using the specified key. Null is returned if the key does not exist. Even if the key does exist, Null may also be returned because the object has been updated to a new version. + The unique value that is used to identify the object in the region. + The version of the desired object. If this parameter is null, the version of the current object is retrieved. + The name of the region where the object resides. + + + Gets an object from the specified region by using the specified key. This overload is not supported in Windows Azure Shared Caching. + The object that was cached by using the specified key. Null is returned if the key does not exist. + The unique value that is used to identify the object in the region. + The name of the region where the object resides. + + + Locks the key if the key is present and it is not locked and returns the object corresponding to the key. + Returns matching the specified parameter if the is present and is not locked. If the key does not exist, a DataCacheException object is thrown with the ErrorCode set to . Create objects based on the referenced key to resolve this error.If the object is already locked by another cache client, a DataCacheException object is thrown with the ErrorCode set to . The object will be inaccessible until it is unlocked by the locking client. + The unique value that is used to identify the object in the cache. + The amount of time that the object should remain locked. + The object required to unlock the object. The output parameter is passed by reference. + + + Lock the key if key is present and it is not locked by any clients and returns the object corresponding to the key. + Returns matching the specified parameter if the is present and is not locked. If the key does not exist, a DataCacheException object is thrown with the ErrorCode set to . Create objects based on the referenced key to resolve this error.If the object is already locked by another cache client, a DataCacheException object is thrown with the ErrorCode set to . The object will be inaccessible until it is unlocked by the locking client. + The unique value that is used to identify the object in the region. + The amount of time that object remains locked. + The object required to unlock the object. The output parameter is passed by reference. + If forceLock is true, key is locked irrespective of key-value pair presence in cache. + + + Locks the key if the key is present and is not locked and returns the object corresponding to the key. For objects stored in regions. This overload is not supported in Windows Azure Shared Caching. + Returns matching the specified parameter if the is present and is not locked.If the key does not exist, a DataCacheException object is thrown with the ErrorCode set to . Create objects based on the referenced key to resolve this error.If the object is already locked by another cache client, a DataCacheException object is thrown with the ErrorCode set to . The object will be inaccessible until it is unlocked by the locking client. + The unique value that is used to identify the object in the region. + The amount of time that the object remains locked. + The object required to unlock the object. The output parameter is passed by reference. + The name of the region where the object resides. + + + Lock the key if key is present and it is not locked by any clients and returns the object corresponding to the key. For objects stored in regions. This overload is not supported in Windows Azure Shared Caching. + Returns matching the specified parameter if the is present and is not locked.If the key does not exist, a DataCacheException object is thrown with the ErrorCode set to . Create objects based on the referenced key to resolve this error.If the object is already locked by another cache client, a DataCacheException object is thrown with the ErrorCode set to . The object will be inaccessible until it is unlocked by the locking client. + The unique value that is used to identify the object in the region. + The amount of time that the object remains locked. + The object required to unlock the object. The output parameter is passed by reference. + The name of the region where the object resides. + If forceLock is true, key is locked irrespective of key-value pair presence in cache. + + + Gets a object to retrieve all information associated with your cached object in the cluster. + A object that contains all information associated with your cached object. Null is returned if the key does not exist. + The unique value that is used to identify the object in the cache. + + + Gets a object to retrieve all information associated with your cached object in the cluster. For objects stored in regions. This overload is not supported in Windows Azure Shared Caching. + A object that contains all information associated with your cached object. Null is returned if the key does not exist. + The unique value that is used to identify the object in the region. + The name of the region where the object resides. + + + Gets an object from the cache, but only if a newer version of the object resides in the cache. + If the version in the cache differs from the version parameter, the corresponding cached object is returned. If the version in the cache is the same as the version parameter, null is returned. + The unique value that is used to identify the object in the cache. + The version of the desired object, passed by reference. + + + Gets an object from the specified region, but only if a newer version of the object resides in the region. This overload is not supported in Windows Azure Shared Caching. + If the version in the region differs from the version parameter, the corresponding cached object is returned. If the version in the region is the same as the version parameter, null is returned. + The unique value that is used to identify the object in the cache. + The version of the desired object, passed by reference. + The name of the region where the object resides. + + + Gets an enumerable list of all cached objects in the specified region that have all the same tags in common. Not supported in Windows Azure Shared Caching. + An enumerable list of all cached objects in the specified region that have all the same tags in common. + A list of tags for which to search. + The name of the region to search. Tags are not supported outside regions. Therefore, a region name is required. + + + Gets an enumerable list of all cached objects in the specified region that have any of the same tags in common. Not supported in Windows Azure Shared Caching. + An enumerable list of all cached objects in the specified region that have any of the same tags in common. Null is returned if no objects in the specified region have any of the tags specified. + A list of tags for which to search. + The name of the region to search. Tags are not supported outside regions. Therefore, a region name is required. + + + Gets an enumerable list of all cached objects in the specified region that have the specified tag. Not supported in Windows Azure Shared Caching. + An enumerable list of all cached objects in the specified region that have the specified tag. Null is returned if no objects in the specified region have the tag specified. + The tag for which to search. + The name of the region to search. Tags are not supported outside regions. Therefore, a region name is required. + + + Gets an enumerable list of all cached objects in the specified region. Not supported in Windows Azure Shared Caching. + An enumerable list of all cached objects in the specified region. + The name of the region for which to return a list of all resident objects. + + + Returns the system region name for the specified key. Not supported in Windows Azure Shared Caching. + Returns the region name as a . + The key for which to find the associated system region. + + + Used to determine the default regions for the cache. Not supported in Windows Azure Shared Caching. + Returns an enumerable list of default regions as an object. + + + Increments a long value stored in the cache. + Returns the incremented value. + The key of the object stored in the cache. The object must be a long. + The amount to increase the stored value. + The initial value to use if the object does not exist in the cache. + + + Increments a long value stored in the cache in the specified region. + Returns the incremented value. + The key of the object stored in the cache. The object must be a long. + The amount to increase the stored value. + The initial value to use if the object does not exist in the cache. + The user-defined region in which the object is stored. + + + Allows for the use of array notation to access cached objects. + A deserialized object that was saved to the cache that uses the key. + The key that is used to save the cached object. + + + The name of the cache associated with the DataCache object. + Returns . + + + Prepends a string to a string object stored in the cache. + The key of the object stored in the cache. The object must be a string. + The string to prepend to the stored object. + + + Prepends a string to a string object stored in the cache in the specified region. + The key of the object stored in the cache. The object must be a string. + The string to prepend to the stored object. + The user-defined region in which the object is stored. + + + Adds or replaces an object in the cache. + A object that represents the version of the object saved to the cache under the key value. + The unique value that is used to identify the object in the cache. Key names must be less than 65 KB. + The object to add or replace. + + + Adds or replaces an object in the cache if it is at the specified version. + A object that represents the version of the object saved to the cache under the value. + The unique value that is used to identify the object in the cache. Key names must be less than 65 KB. + The object to add or replace. + The object that represents the version of the cached object that is to be replaced. + + + Adds or replaces an object in the cache if it is at the specified version. Associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the object saved to the cache under the value. + The unique value that is used to identify the object in the cache. Key names must be less than 65 KB. + The object to add or replace. + The object that represents the version of the cached object that is to be replaced. + A list of tags to associate with the object. + + + Adds or replaces an object in the specified region if it is at the specified version. Associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the object saved to the cache under the value. + The unique value that is used to identify the object in the region. Key names must be less than 65 KB. + The object to add or replace. + The object that represents the version of the cached object that is to be replaced. + A list of tags to associate with the object. + The name of the region the object resides in. + + + Adds or replaces an object in the specified region if it is at the specified version. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the object saved to the cache under the value. + The unique value that is used to identify the object in the region. Key names must be less than 65 KB. + The object to add or replace. + The object that represents the version of the cached object that is to be replaced. + The name of the region the object resides in. + + + Adds or replaces an object in the cache if it is at the specified version. Specifies the timeout value of the cached object. + A object that represents the version of the object saved to the cache under the key value. + The unique value that is used to identify the object in the region. Key names must be less than 65 KB. + The object to add or replace. + The object that represents the version of the cached object that is to be replaced. + The amount of time that the object should reside in the cache before expiration. + + + Adds or replaces an object in the cache if it is at the specified version. Specifies the timeout value and associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the object saved to the cache under the key value. + The unique value that is used to identify the object in the cache. Key names must be less than 65 KB. + The object to add or replace. + The object that represents the version of the cached object that is to be replaced. + The amount of time that the object should reside in the cache before expiration. + A list of tags to associate with the object. + + + Adds or replaces an object in the specified region if it is at the specified version. Specifies the timeout value and associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the object saved to the cache under the key value. + The unique value that is used to identify the object in the region. Key names must be less than 65 KB. + The object to add or replace. + The object that represents the version of the cached object that is to be replaced. + The amount of time that the object should reside in the cache before expiration. + A list of tags to associate with the object. + The name of the region the object resides in. + + + Adds or replaces an object in the specified region if it is at the specified version. Specifies the timeout value of the cached object. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the object saved to the cache under the value. + The unique value that is used to identify the object in the region. Key names must be less than 65 KB. + The object to add or replace. + The object that represents the version of the cached object that is to be replaced. + The amount of time that the object should reside in the cache before expiration. + The name of the region the object resides in. + + + Adds or replaces an object in the cache. Associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the object saved to the cache under the key value. + The unique value that is used to identify the object in the cache. Key names must be less than 65 KB. + The object to add or replace. + A list of tags to associate with the object. + + + Adds or replaces an object in the specified region. Associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the object saved to the cache under the value. + The unique value that is used to identify the object in the region. Key names must be less than 65 KB. + The object to add or replace. + A list of tags to associate with the object. + The name of the region the object resides in. + + + Adds or replaces an object in the specified region. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the object saved to the cache under the value. + The unique value that is used to identify the object in the region. Key names must be less than 65 KB. + The object to add or replace. + The name of the region the object resides in. + + + Adds or replaces an object in the cache. Specifies the timeout value of the cached object. + A object that represents the version of the object saved to the cache under the value. + The unique value that is used to identify the object in the cache. Key names must be less than 65 KB. + The object to add or replace. + The amount of time that the object should reside in the cache before expiration. + + + Adds or replaces an object in the cache. Specifies the timeout value and associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the object saved to the cache under the value. + The unique value that is used to identify the object in the cache. Key names must be less than 65 KB. + The object to add or replace. + The amount of time that the object should reside in the cache before expiration. + A list of tags to associate with the object. + + + Adds or replaces an object in the specified region. Specifies the timeout value and associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the object saved to the cache under the value. + The unique value that is used to identify the object in the region. Key names must be less than 65 KB. + The object to add or replace. + The amount of time that the object should reside in the cache before expiration. + A list of tags to associate with the object. + The name of the region the object resides in. + + + Adds or replaces an object in the specified region. Specifies the timeout value of the cached object. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the object saved to the cache under the value. + Adds or replaces an object in the specified region. Specifies the timeout value of the cached object. Key names must be less than 65 KB. + The object to add or replace. + The amount of time that the object should reside in the cache before expiration. + The name of the region the object resides in. + + + Replaces and unlocks an object in the cache. + A object that represents the version of the cached object after it has been updated by this method. + The unique value that is used to identify the object in the cache. + The object to add or replace. + The object that was returned when the object was locked. + + + Replaces and unlocks an object in the cache. Associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the cached object after it has been updated by this method. + The unique value that is used to identify the object in the cache. + The object to add or replace. + The object that was returned when the object was locked. + A list of tags to associate with the object. + + + Replaces and unlocks an object in the specified region. Associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the cached object after it has been updated by this method. + The unique value that is used to identify the object in the region. + The object to add or replace. + The object that was returned when the object was locked. + A list of tags to associate with the object. + The name of the region the object resides in. + + + Replaces and unlocks an object in the specified region. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the cached object after it has been updated by this method. + The unique value that is used to identify the object in the region. + The object to add or replace. + The object that was returned when the object was locked. + The name of the region the object resides in. + + + Replaces and unlocks an object in the cache. Specifies the timeout value of the cached object. + A object that represents the version of the cached object after it has been updated by this method. + The unique value that is used to identify the object in the cache. + The object to add or replace. + The object that was returned when the object was locked. + The amount of time that the object should reside in the cache before expiration. + + + Replaces and unlocks an object in the cache. Specifies the timeout value and associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the cached object after it has been updated by this method. + The unique value that is used to identify the object in the cache. + The object to add or replace. + The object that was returned when the object was locked. + The amount of time that the object should reside in the cache before expiration. + A list of tags to associate with the object. + + + Replaces and unlocks an object in the specified region. Specifies the timeout value and associates tags with the cached object. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the cached object after it has been updated by this method. + The unique value that is used to identify the object in the region. + The object to add or replace. + The object that was returned when the object was locked. + The amount of time that the object should reside in the cache before expiration. + A list of tags to associate with the object. + The name of the region the object resides in. + + + Replaces and unlocks an object in the specified region. Specifies the timeout value of the cached object. This overload is not supported in Windows Azure Shared Caching. + A object that represents the version of the cached object after it has been updated by this method. The timeout value associated with the cached object overrides expiration settings specified in the named cache configuration. + The unique value that is used to identify the object in the region. + The object to add or replace. + The object that was returned when the object was locked. + The amount of time that the object should reside in the cache before expiration. + The name of the region the object resides in. + + + Removes an object from the cache. + True if the object identified by the key is removed; otherwise, false. + The unique value that is used to identify the object in the region. + + + Removes an object with a specific version from the cache. + True if the object is removed; otherwise, false. + The unique value that is used to identify the object in the region. + The object that represents the version of the cached object that is to be removed. + + + Removes an object with a specific version from the cache in a region. This overload is not supported in Windows Azure Shared Caching. + True if the object is removed; otherwise, false. + The unique value that is used to identify the object in the region. + The object that represents the version of the cached object that is to be removed. + The name of the region the object resides in. + + + Removes an object from the cache with an associated lock handle. + True if an object from the cache was removed; otherwise, false. + The unique value that is used to identify the object in the cache. + The object that was returned when the object is removed. + + + Removes an object from the cache with an associated lock handle in a region. This overload is not supported in Windows Azure Shared Caching. + True if the object is removed; otherwise, false. + The unique value that is used to identify the object in the region. + The object that was returned when the object was removed. + The name of the region the object resides in. + + + Removes an object from the cache in a region. This overload is not supported in Windows Azure Shared Caching. + True if the object is removed; otherwise, false. + The unique value that is used to identify the object in the region. + The name of the region the object resides in. + + + Removes a cache notification callback. Not supported in Windows Azure Shared Caching. + + + Deletes a region. All cached objects inside the region are also removed. Not supported in Windows Azure Shared Caching. + Returns true if the region is removed. Returns false if the region does not exist. + The name of the region. + + + Resets the object timeout value, defining how long objects reside in the cache before expiring. The value specified for the object overrides the default settings for the cache. + The unique value that is used to identify the object in the region. + The amount of time that the object should reside in the cache before expiration. + + + Resets the object timeout value, defining how long objects reside in the region before expiring. The value specified for the object overrides the default settings for the cache. + The unique value that is used to identify the object in the region. + The amount of time that the object should reside in the cache before expiration. + The name of the region where the object resides. + + + Releases objects locked in the cache. This method supports pessimistic concurrency by making sure that the appropriate DataCacheLockHandle is used for unlocking the object. + The unique value that is used to identify the object in the region. + The object that was returned when the object was locked + + + Releases objects locked in the specified region. This method supports pessimistic concurrency by making sure that the appropriate DataCacheLockHandle is used for unlocking the object. This overload is not supported in Windows Azure Shared Caching. + The unique value that is used to identify the object in the region. + The object that was returned when the object was locked. + The name of the region where the object resides. + + + Releases objects locked in the cache. This method supports pessimistic concurrency by making sure that the appropriate DataCacheLockHandle is used for unlocking the object. Specifies a new timeout value for the cached object. + The unique value that is used to identify the object in the region. + The object that was returned when the object was locked. + The amount of time that the object should reside in the cache before expiration. + + + Releases objects locked in the specified region. This method supports pessimistic concurrency by making sure that the appropriate DataCacheLockHandle is used for unlocking the object. Specifies a new timeout value for the cached object. This overload is not supported in Windows Azure Shared Caching. + The unique value that is used to identify the object in the region. + The object that was returned when the object was locked. + The amount of time that the object should reside in the cache before expiration. + The name of the region where the object resides. + + + Specifies whether automatic discovery is enabled for the role or endpoint that hosts Windows Azure Caching. + + + Creates a new DataCacheAutoDiscoverProperty object. + A value of true enables automatic discovery. + + + Creates a new DataCacheAutoDiscoverProperty object; specifies the web role, worker role or endpoint that hosts Caching. + A value of true enables automatic discovery. + The name of the web role, worker role or endpoint that hosts Caching in the cloud service deployment. + + + Specifies a callback which is called with a list of cache operations. Not supported in Windows Azure Shared Caching. + The name of the cache where the object is stored. + A list of cache operations. + The associated with the cache notification that invoked the delegate method. + + + Provides methods to return objects that are mapped to a named cache. This class also enables programmatic configuration of the cache client. + + + Used for configuring a cache client based on the application configuration file. + + + Used for programmatically configuring a cache client. + A object that specifies the cache client configuration settings for the DataCacheFactory instance. + + + Closes the object and releases all associated resources. + + + Returns the cache client, an instance of the object. + The cache client, an instance of the DataCache object. + The named cache to use for cache operations. For , the cache name must be “default”, which is the same as calling . + + + Returns the cache client corresponding to the default cache, an instance of the object. + The cache client, an instance of the DataCache object. + + + Specifies the configuration settings for a new cache client. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. This overload specifies a specific name for the cache client. + The name of the cache client. If the application configuration file specifies multiple named dataCacheClient sections, this parameter can be used to specify which dataCacheClient section to use. + + + Specifies whether automatic discovery is enabled for the role or endpoint that hosts Windows Azure Caching. + Returns . + + + Specifies the retry policy for the cache client. + Returns . + + + Gets or sets the length of time that the cache client waits to establish a network connection with the server. + A object.. + + + Create a duplicate DataCacheFactoryConfiguration object. + Returns a that can be cast to a object. + + + Create a new cache client configuration. + Returns . + The name of the new cache client configuration. + A DataCacheFactoryConfiguration object that contains the settings for the new client configuration. + A value of true enables connection pooling. + + + The type of account that runs the Caching service. + Returns . + + + Specifies whether compression is enabled. A value of true enables compression. The default is false. + Returns . + + + Gets or sets the local cache settings for the cache client. + A object. + + + Specifies the maximum number of channels to open to the cache cluster. + Returns . + + + Gets or sets the notification settings for the cache client. Not supported in Windows Azure Shared Caching. + A object. + + + Removes a cache client configuration and its settings from memory. + Returns . + The name of the cache client configuration. + + + Gets or sets the length of time that the cache client waits for a response from the server for each request. + A object. + + + Gets or sets the security properties for the cache client. + A object. + + + Specifies the type of serialization to use. + Returns . + + + Gets or sets an array of objects. + Returns . + + + Gets or sets the transport properties for the cache client. + A object. + + + A value of true specifies that the legacy protocol should be used for connecting to the cache. + Returns . + + + Specifies the parameters required for a method to be invoked by a failure notification when the cache client misses cache notifications. Not supported in Windows Azure Shared Caching. + The name of the cache associated with the missing notifications. + The object associated with the failure notification that invoked the delegate method. + + + Specifies the local cache settings for a cache client. + + + Creates a new instance of the class. + + + Creates a new instance of the class. This overloaded constructor accepts parameters that configure the properties of local cache. + The maximum number of objects in the local cache. + The time that objects reside in the local cache before invalidation. + The invalidation policy for the local cache. This can be set to either or . + + + Gets the default timeout for items in the local cache. + Returns . + + + Gets the invalidation policy for items in the local cache. + Returns . + + + Gets a Boolean value indicating whether local cache is enabled for the cache client. + Returns . + + + Gets the maximum number of objects permitted in the local cache. + Returns . + + + Represents a callback method that is to be invoked by a cache notification when one or more cache operations take place. Applies only to the server versions of AppFabric. + The name of the region associated with the cache operation. A zero-length string indicates that a specific region is not associated with the cache operation. + The name of the key associated with the cache operation. A zero-length string indicates that a specific cached item is not associated with the cache operation. + The of the cached object associated with the cache operation that triggered the notification. A null version indicates that a specific cached item is not associated with the cache operation. + The enumeration specifying which cache event triggered the cache notification. + The object associated with the cache notification that invoked the delegate method. + + + Identifies a cache notification callback. This identifier is required to remove the corresponding cache notification callback. Applies only to the server versions of AppFabric. + + + The name of the cache triggering the cache notification. + A string value represents the name of the cache triggering the cache notification. + + + Identifier for the object. Used to distinguish between DataCacheNotificationDescriptor objects. + A value used to identify DataCacheNotificationDescriptor objects. + + + Creates a copy of the object. + A string value representing the and property values. + + + Specifies the notification settings for a cache client. Applies only to the server versions of AppFabric. + + + Creates a new instance of the class. + The maximum queue length for stored notifications on the cache cluster. + The frequency with which the cache client communicates with the server to check for notifications. + + + Gets the maximum queue length for notifications on the cache cluster. + Returns . + + + Gets the polling interval that the cache client uses to check for notifications on the cache cluster. + Returns . + + + Controls the retry policy that is used at startup of a Windows Azure cloud service. + + + The maximum number of seconds between retries. + Returns . + + + The number of retry attempts. + Returns . + + + Used to specify an individual cache host when programmatically configuring the cache client. + + + Used to define a cache host in the cache cluster for programmatic configuration of the cache client. + The computer name of the cache server or the service URL. + The cache port number of the cache host. + + + The cache port on the cache server. + A value that represents the cache port number on the cache server. + + + Returns true if the DataCacheServerEndpoint objects are equal. + Returns . + The DataCacheServerEndpoint object to compare. + + + Returns the hash code for the DataCacheServerEndpoint. + Returns . + + + The computer name or service URL of the cache server. + A string representing the computer name or service URL of the cache server. + + + A session storage provider that enables Web applications to store session-state data to a distributed cache system. + + + Initializes a new instance of the class. + + + The application name. This is used to differentiate sessions in the data source by application. + Returns . + + + Creates a new data storage object for the current request. + A SessionStateStoreData object, used for storing session data in the distributed cache. + The HttpContext for the current request. + The session state Timeout value for the new SessionStateStoreData object. + + + Adds a new session state to the distributed cache. + The HttpContext for the current request. + The session identifier for the current request. + The session Timeout for the current request. + + + Releases all resources used by the class. + + + Called by the SessionStateModule class at the end of a request + The HttpContext for the current request. + + + Returns read-only session-state data from the cache. + A SessionStateStoreData object populated with session values and information from the cache + The HttpContext of the current request. + The session identifier for the current request. + When this method returns, contains a Boolean value that is set to true if the requested session item is locked in the cache; otherwise, false. + When this method returns, contains a TimeSpan object that is set to the period of time that an item in the cache has been locked. + When this method returns, contains an object that is set to the lock identifier for the current request. + When this method returns, contains one of the SessionStateActions values. This indicates whether the current session is an uninitialized, cookieless session. + + + Returns and locks the read-only session-state data from the cache. + A SessionStateStoreData object populated with session values and information from the cache. + The HttpContext of the current request. + The session identifier for the current request. + When this method returns, contains a Boolean value that is set to true if a lock in the cache is successfully obtained; otherwise, false. + When this method returns, contains a TimeSpan object that is set to the period of time that an item in the cache has been locked. + When this method returns, contains an object that is set to the lock identifier for the current request. + When this method returns, contains one of the SessionStateActions values. This indicates whether the current session is an uninitialized, cookieless session. + + + Initializes the distributed cache provider. + The name of the application. + The configuration details specified in the application configuration file for cacheName and regionName. + + + Initializes the outgoing HTTP request. + The context for the current request. + + + Releases a lock on the session data in the cache. + The HttpContext of the current request. + The session identifier of the current request. + The lock identifier of the current request. + + + Deletes session data from the cache. + The HttpContext of the current request. + The session identifier of the current request. + The lock identifier of the current request. + The SessionStateStoreData that represents the item to delete from the cache. + + + Updates the expiration date and time of session data in the cache. + The context for the current request. + The session identifier of the current request. + + + Updates the session item information in the cache with values from the current request and clears the lock on the session item. + The HttpContext of the current request. + The session identifier of the current request.. + The SessionStateStoreData object that contains the current session values to be stored. + The lock identifier for the current request. + If true, identifies the session item as a new item if true; otherwise, identifies the session item as an existing item. + + + Sets a reference to the SessionStateItemExpireCallback delegate for the Session_OnEnd event defined in the Global.asax file. + Cache does not support notification of the expiration; therefore this method always returns false. + The SessionStateItemExpireCallback delegate for the Session_OnEnd event defined in the Global.asax file. + + \ No newline at end of file diff --git a/lib/windowsazure/Microsoft.ApplicationServer.Caching.Core.xml b/lib/windowsazure/Microsoft.ApplicationServer.Caching.Core.xml index baf540a40fb..48850f2f646 100644 --- a/lib/windowsazure/Microsoft.ApplicationServer.Caching.Core.xml +++ b/lib/windowsazure/Microsoft.ApplicationServer.Caching.Core.xml @@ -1,1208 +1,1208 @@ - - - - Microsoft.ApplicationServer.Caching.Core - - - - - - Returns . - - - Returns . - - - The base class for an event used for notifications. Applies only to the server versions of AppFabric. - - - Initializes a new instance of the class. Applies only to the server versions of AppFabric. - Name of the cache in which the operation occurred. - Type of the operation which caused the notification. - Version of the operation which caused the notification. - - - Name of the cache in which the operation occurred. Applies only to the server versions of AppFabric. - Returns . - - - The type of the operation which caused the notification. Applies only to the server versions of AppFabric. - Returns . - - - Returns the string representation of the BaseOperationNotification event. Applies only to the server versions of AppFabric. - Returns . - - - The version of the operation which caused the notification. Applies only to the server versions of AppFabric. - Returns . - - - Represents a key-value pair that can be used by a custom provider for the cache cluster configuration store. Applies only to the server versions of AppFabric. - - - Creates a new instance of the class. Applies only to the server versions of AppFabric. - The key of the entry. - The value of the entry. - The version of the entry. - - - The key of the entry. Applies only to the server versions of AppFabric. - A object. - - - The version of the entry. Applies only to the server versions of AppFabric. - A value that is greater than 0. - - - An exception that should be thrown from an implementation of the interface. Applies only to the server versions of AppFabric. - - - Creates a new instance of the class. Applies only to the server versions of AppFabric. - - - Creates a new instance of the class. Applies only to the server versions of AppFabric. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Creates a new instance of the class. Applies only to the server versions of AppFabric. - The message string that describes the error. - - - Creates a new instance of the class. Applies only to the server versions of AppFabric. - The message string that describes the error. - The inner exception that caused the current exception. - - - Provides support for changing the logging level of Windows Azure Caching. - - - Changes the logging level of the Event Tracing for Windows (ETW) log for Windows Azure Caching. - Returns . - The trace level for the log. - - - Enables tracing for a cache client. - The type of tracing. This can be set to or . - The trace level. - - - A static class used to store global error codes. - - - The ACS token provided failed the authentication process. - - - Cache Administration is already configured on the machine. - - - Cache Administration is not configured on the machine. - - - The authentication token provided is not in a valid format. - - - The named cache already exists in the cache cluster. - - - - The named cache could not be created due to a detected inconsistency in the configuration store. - - - The specified named cache does not exist in the cache cluster. - - - - The cache cluster is not running. - - - The cache cluster is not ready to perform the requested operation. - - - The cache cluster experienced an error while attempting to refresh the list of cache hosts on all of the cache hosts. - - - - An error occurred attempting to read the configuration store provider name and connection string from the registry. - - - A Cache Administration timeout occurred. - - - - An error occurred attempt to add a cache host to the cache cluster configuration store. - - - An error occurred attempting to delete a cache host from the cache cluster configuration store. - - - An error occurred while creating the default cache. - - - The specified cache is in the process of being removed. - - - An error occurred attempting to add an account to the allowed client accounts list. - - - - The name 'localhost' is unable to be resolved to the current host name. - - - The specified cache host is not part of the cache cluster. - - - - The specified cache host is not currently running. - - - - The cache cluster experienced an error while attempting to refresh the list of cache hosts on each of the specified cache host. - - - The specified cache host is already in the running state. - - - - No cache hosts are running in the cache cluster. - - - One or more cache hosts are running in the cache cluster. - - - - - An error occurred reading the installation path from the registry. - - - - The specified provider string or connection string is invalid. - - - The specified operation is invalid. - - - - - The specified security settings are invalid. - - - The specified named cache cannot be created, because the cache cluster has reached the maximum number of named caches. - - - - There are no cache hosts in the cache cluster. - - - The specified host cannot be stopped, because the number of hosts would drop below the required quorum. - - - There are no seed nodes present in the cache cluster. - - - - A required argument is null. - - - - - - One or more port numbers have duplicate values. - - - - The required quorum of hosts is not running. - - - The specified region does not exist in the cache cluster. - - - An error occurred while attempting to access the registry on a remote cache host. - - - The request timed out, but the result of the request is unknown. - - - An error occurred attempting to remove an account from the list of allowed client accounts. - - - - - - The returned status information might be incorrect, because one or more cache hosts could not be reached. - - - An error occurred attempting to access the cache cluster configuration store. - - - A timeout occurred. - - - An unknown error occurred. - - - The specified Windows account already exists in the list of allowed client accounts. - - - The specified Windows account is not valid. - - - The specified Windows account is not present in the list of allowed client accounts. - - - The cache has been disabled. One possible cause could be a failure to reconcile charges associated with the specified cache. - - - The object in the cache does not match with the specified version. - - - - - Unable to establish an SSL channel. - - - The cache client assemblies are a different version than the cache host assemblies. - - - The cache cluster has already been initialized. - - - An error occurred while attempting to connect to the cache cluster configuration store. - - - An error occurred while reading the cache cluster configuration store. - - - The cache cluster is not initialized. - - - An error occurred while attempting to save the configuration state. - - - An error occurred while attempting to save the connection settings to the registry. - - - The connection was terminated. This could be caused by server or network problems. - - - - - - An error occurred while attempting to get the computer domain. - - - An error occurred while attempting to add a cache host to the cache cluster. - - - - An error occurred while attempting to remove a host from the cache cluster. - - - The specified cache host entry was not found in the cache cluster configuration. - - - - The specified connection parameters are incomplete. - - - An error occurred while attempting to read the install path from the registry. - - - The argument is not valid. - - - AutoDiscover property is not valid. - - - The specified lock handle is not valid. - - - An invalid enumerator is specified. - - - The key is already present in the cache or region. - - - An object cached with the specified key does not exist in the cache or region. - - - The named cache count exceeded the maximum value. - - - The request failed because either the response or the request message was larger than configured message size in the transport properties. - - - The named cache does not exist. - - - A network path was expected, but a local path was provided. - - - The specified network file share does not have appropriate permissions. - - - An error occurred while attempting to connect to the shared network folder. - - - An error occurred attempting to write the configuration store files at the specified shared network folder. - - - The domain account is blocked for the workgroup configuration. - - - The Network Service account is not permitted for a workgroup-based configuration of the Caching Service. - - - Cache notifications are not supported because the named cache has been created without notifications enabled. - - - The cached object has already been locked. - - - The object is not locked. - - - - - An error occurred while setting permissions on the cache cluster configuration. - - - The specified port is already in-use. - - - One or more ports have duplicate values. - - - - - - - The region already exists. - - - The region does not exist. - - - An error occurred while attempting to access the registry. - - - An error occurred while attempting to open a registry key for reading. - - - Temporary failure, retry the operation later. - - - An exception was encountered during object serialization. - - - The server passed to the constructor is null. - - - An error occurred while accessing the Caching Service. - - - The Caching Service is already configured on the specified cache host. - - - The Caching Service is not configured on the specified cache host. - - - The operation cannot be completed, because the Caching Service is still running. - - - SQL Server authentication is not permitted with the SQL Server provider for the cache cluster configuration store. Windows authentication must be used. - - - - The test connection failed. - - - Communications with the cache cluster has experienced a delay past the timeout value. - - - An unknown error has occurred. - - - The current operation is not supported on this port. - - - - Used to retrieve substatus codes for errors returned to the client. - - - The primary cache server is unavailable. - - - - Unable to validate the SSL certificate. - - - An internal error has occurred. - - - The client failed to update a key when adding or replacing an object in the cache. - - - The specified key name is too large. The key size is calculated after serialization and UTF-8 encoding of the string. It must be less than 65 KB. - - - There is no specific substatus code. - - - The request did not find the primary server. - - - Unable to satisfy the specified write quorum of cache hosts. - - - A resource quota for the Windows Azure Caching namespace has been exceeded. - - - Internal. - - - The specified region name is too large. The name size is calculated after serialization and UTF-8 encoding of the string. It must be less than 65 KB. - - - Replication failed. - - - The replication queue is full. - - - The memory available for the caching service is low. - - - The specified tag name is too large. The name size is calculated after serialization and UTF-8 encoding of the string. It must be less than 65 KB. - - - The requested operation failed, because the required cache host is in a throttled state. - - - Used for cache-related exceptions. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class; allows you to provide serialization information with the exception. - Stores serialization information about an object. - Describes the source, destination, and context of a serialized stream. - - - Initializes a new instance of the class; allows you to provide a message with the exception. - The message describing the exception. - - - Initializes a new instance of the class; allows you to provide a message and another exception with the exception. - The message describing the exception. - Another exception related to this exception. - - - The integer used to identify the type of exception encountered. - An specifying the type of exception encountered. - - - The interface that is used for serialization. - The SerializationInfo class used to store all the data that you need to serialize the exception. - The StreamingContext class used to describe the source and destination of the exception. - - - A link to help for the exception. - Returns . - - - The description of the exception encountered. - A that describes the type of exception encountered. - - - The of the exception encountered. - An indicating the exception substatus. - - - The tracking identifier related to the exception. Only valid if tracing is enabled. - Returns . - - - Used to retrieve all information associated with the cached object in the cluster. - - - Initializes a new instance of the class. - - - The name of the cache where the object is stored. - A string value that represents the name of the cache where the object is stored. - - - The amount of time to extend the object lifetime on each access. - Returns . - - - The identifier that is used to distinguish the cached object in the cache or region. - A string value that represents the identifier that is used to distinguish the cached object in the cache or region. - - - If applicable, the name of the region where the object is stored. - A string value that represents, if applicable, the name of the region where the object is stored. - - - The approximate size of the cached item. This field is intended for internal use only. - Returns . - - - A generic list of tags associated with the cached object. - An generic list of objects associated with the cached object. - - - Specifies the length of time for which the object will remain in the cache. - Returns . - - - Creates a string representation of the DataCacheItem object. - Returns . - - - The object stored in cache. - An object representing the deserialized form of the cached object. - - - The version of the cached object. - The . - - - Used to create objects as a part of implementing a read-through or write-behind provider. - - - Creates a DataCacheItem object using the specified parameters. - Returns . - The that is passed to the read-through or write-behind provider methods. - The name of the cache that is associated with this item. - The value of the cache item. - A collection of tags associated with this item. - - - A cache item key used in the implementation of a read-through or write-behind provider. - - - Create a new object. - The region name for the cache item. - The key name for the cache item. - - - Returns true if the DataCacheItemKey objects are equal. - Returns . - The DataCacheItemKey object to compare. - - - Returns the hash code for the DataCacheItemKey. - Returns . - - - The name of the data cache item key. - Returns . - - - The region of the cache item. - Returns . - - - Returns a string representation of the DataCacheItemKey. - Returns . - - - Used to represent the version of a cached object. - - - Used to compare two versions of the same item, specified with the same key. - An value: 0 if the versions are equal, greater than zero if the instance is greater than the version parameter value, or less than zero if the instance is less than the version parameter value. - The to be compared. - - - Used to determine whether another object is the same. - A value: true, if the objects are the same; false, if they are different. - Another object for comparison. - - - Returns the hash code of the object. - An value that represents the hash code of the DataCacheItemVersion object. - - - Indicates whether the DataCacheItemVersion object points to a null version. This is intended for internal use only. - Returns . - The DataCacheItemVersion object to examine. - - - Indicates whether the two objects are equal. - True if the two specified objects are equal; otherwise, false. - The first object to compare. - The second object to compare. - - - Indicates whether the first object is greater than the second object. - True if the first object is greater than the second object; otherwise, false. - The first object to compare. - The second object to compare. - - - Indicates whether the two objects are unequal. - True if the two objects are not equal; otherwise, false. - The first object to compare. - The second object to compare. - - - Indicates whether the value of the first object is less than the second object. - True if the value of the first object is less than the value of the second object; otherwise, false. - The first object to compare. - The second object to compare. - - - Specifies the way locally cached objects should be invalidated. - - - Specifies that objects will stay in local cache until they are automatically invalidated by a cache notification.  Not supported in Windows Azure Shared Caching. - - - Specifies that objects will stay in local cache until their lifetime reaches the localCacheTimeout duration specified in the DataCacheFactory constructor.  - - - Represents the structure used as a key to lock and unlock cached objects in a pessimistic concurrency scenario. - - - Returns the specified object to string. - A string that represents the object. - - - An enumeration of the serialization types. - - - Items are serialized with a binary formatter. - - - Items are serialized with a custom formatter. - - - Items are serialized with a NetDataContractSerializer formatter. This is the default. - - - Represents a notification event for operations performed against the cache, such as Add or Remove. - - - Creates a new instance of the DataCacheOperationDescriptor class using the specified parameters. - Name of the cache in which the operation occurred. - The name of the region where the object is stored. - The key used to store the object in the cache. - The type of operation that occurred. - The version of the cached object. - - - Returns the property. - A string representing the current value of the property. - - - Returns the property. - A string representing the current value of the property. - - - Returns the string representation of the object. - A string representing the current value of the object. - - - An enumeration used to specify specific item or region events that can trigger a cache notification. - - - Indicates that an object was added to the cache. - - - Indicates that a region in the cache was cleared with the method. - - - Indicates that a region in the cache was created with the method.  - - - Indicates that an object was removed from the cache.  - - - Indicates that a region in the cache was removed with the method.  - - - Indicates that an object was replaced in the cache.  - - - Enumeration indicating whether data sent between client and server is signed and/or encrypted. - - - Indicates both encryption and signing are used. - - - Indicates that neither encryption nor signing is used. - - - Indicates that signing without encryption is used. - - - Used to enable signing and/or encryption of data sent between client and server. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class, allows you to specify the and for the instance. Applies only to the server versions of AppFabric. - Enumeration indicating if channel security is disabled by setting to None; or if channel security is enabled by setting to Transport. - Enumeration indicating whether data sent between client and server is signed and/or encrypted.This property is only valid when the property is set to Transport. - - - Initializes a new instance of the class. Applies only to Windows Azure Shared Caching. - A SecureString object that contains the authorization token from the Windows Azure Management Portal. - - - Initializes a new instance of the class. Applies only to Windows Azure Shared Caching. - A SecureString object that contains the authorization token from the Windows Azure Management Portal. - Specifies whether SSL should be used. - - - Initializes a new instance of the class. - The authorization token. - - - Initializes a new instance of the class. - The authorization token. - Specifies whether SSL should be used. - - - The set for the object. - Returns the set for the object. - - - The set for the object. - Returns the set for the object. - - - Enumeration indicating whether channel security is enabled for data sent between client and server. Applies only to the server versions of AppFabric. - - - Specifies that message security is used. This is the security mode required for AppFabric caches, which use the Access Control Service (ACS). Applies only to the server versions of AppFabric. - - - Specifies that no security is enabled. Applies only to the server versions of AppFabric. - - - Specifies that transport security is enabled. Applies only to the server versions of AppFabric. - - - Specifies the serialization properties for a cache client. - - - Creates a new DataCacheSerializationProperties object. - The serializer type to use for cached objects. - Specifies an object that implements the IDataCacheObjectSerializer interface for custom serialization. - - - The type of serialization to use for cached objects. - Returns . - - - Returns the IDataCacheObjectSerializer for a custom serializer. - Returns . - - - Specifies the type of account that is used to run the AppFabric Caching service. - - - The AppFabric Caching service runs under a domain account on the cache cluster. - - - The AppFabric Caching service runs under a built-in system account on the cache cluster. For example, NETWORK SERVICE. - - - An exception object that should be used by read-through or write-behind providers. - - - Creates a new instance of the class. - - - Creates a new instance of the class. - Internal. - Internal. - - - Creates a new instance of the class. - An error message to associate with this exception object. - - - Creates a new instance of the class. - An error message to associate with this exception object. - An inner exception to associate with this exception object. - - - An abstract class that must implemented by read-through or write-behind providers. - - - Creates a new instance of the class. - - - This Delete overload is called for a single item that is deleted from the cache associated with the read-through or write-behind provider. - The DataCacheItemKey for the item that has been deleted. - - - This Delete overload is called for multiple items that are deleted from the cache associated with the read-through or write-behind provider. - A collection of DataCacheItemKeys that should be removed. - - - Used to dispose the DataCacheStoreProvider class. - - - Used to dispose the DataCacheStoreProvider class. - - - This Read overload is called to read a single item from the read-through provider. - Returns . - The DataCacheItemKey for the item that should be returned. - - - This Read overload is called to read a multiple items from the read-through provider. - A collection of DataCacheItemKey objects for the objects that should be read. - A dictionary of DataCacheItemKey objects and DataCacheItem objects that is used to return the results of the read request. - - - This Write method is called to write a single item to the backend associated with the write-behind provider. - The DataCacheItem object that should be written to the backend. - - - This Write method is called to write multiple items to the backend associated with the write-behind provider. - A collection of DataCacheItem objects that should be written to the backend. - - - Represents an optional string-based identifier that you can associate with a cached object. - - - Initializes a new instance of the class. - The string-based identifier to associate with a cached object. Tags must be less than 65 KB. - - - Compares the current DataCacheTag object for equality with the specified DataCacheTag object. - True if the object implements the ToString method and its value is the same as the string representation of the current DataCacheTag; otherwise, false. - The object whose string representation is compared for equality to the current object. - - - Returns the hash code for the current object. - An integer representing the hash code for the current DataCacheTag object. - - - Returns the string representation of the current object. - A string representing the current value of the DataCacheTag object - - - Provides fields that specify the type of cache client tracing to use with the method. Applies only to Windows Azure Caching. - - - A trace sink that uses standard Windows Azure Caching diagnostics. Applies only to Windows Azure Caching. - - - A trace sink that uses Event Tracing for Windows (ETW) to record the trace data. Not supported in Windows Azure Shared Caching. - - - Specifies the transport settings for a cache client. - - - Creates a new instance of the class. - - - Gets or sets the length of time to wait for a WCF channel initialization before timing out. - Returns . - - - Creates a copy of the current object. - Returns . - - - Gets or sets the size of the receive buffers used by transport channels. - Returns . - - - Gets or sets the maximum buffer pool size used by the WCF buffer manager. - Returns . - - - Gets or sets the maximum buffer size. - Returns . - - - Gets or sets the maximum length of time to wait before requests are batched and sent to the client. - Returns . - - - Gets or sets the length of time to wait for a request before aborting the channel. - Returns . - - - Specifies the eviction used for a cache. - - - The cache uses an eviction policy of Least-Recently-Used (LRU). - - - The cache does not evict objects. - - - - - - - - - - - - - - - - - - - Stores cache statistics used in conjunction with the Get-CacheStatistics Windows PowerShell command. - - - Creates a new object. - - - The number of items in the cache. - Returns . - - - The number of cache misses for requested items that were not present in the cache. - Returns . - - - The number of named caches. - Returns . - - - The number of regions. - Returns . - - - The total number of requests. - Returns . - - - The size in bytes of cached items. - Returns . - - - - Represent an ICustomProvider interface. Applies only to the server versions of AppFabric. - - - Adds a Windows account to the list of allowed users that have access to the configuration store.. - Returns a that can be passed to the method in the case of a rollback. - The machine name. - The user name. - - - Begins a transaction to provide isolation from other configuration store access. - Returns a that represents the transaction context.. - - - Enables the provider to clean up any data in the cache cluster configuration store. - - - Deletes an existing entry from the configuration store. - The transaction context object associated with this entry. - The type of entry to be enumerated. - - - Deletes an existing entry from the configuration store. - Returns . If the deletion succeeds, the return value is true. If the entry does not exist or if the version does not match, the return value is false. - The transaction context object associated with this entry. - The type of entry to be enumerated. - The key of the entry. - The version of the entry. If this value is less than or equal to 0, the deletion occurs regardless of the version. If this value is greater than 0, then the deletion is only performed if the version of the entry matches the version provided. - - - Commits or rollbacks a transaction previously started with the method. - An object that represents the transaction context. This object is returned from the method. - If true, the transaction should be rolled back. If false, the transaction should be committed. - - - Enumerates all the entries of the specified type. - Returns a of entries. - The transaction context object. - The type of entry to enumerate. - - - Retrieves a object from the configuration store. - Returns a object. - The transaction context object. - The type of the entry. - The key of the entry. - - - Obtains the current UTC time based on the clock for the configuration store. - Returns . - The transaction context object. - - - Retrieves the value of a specific entry in the configuration store. - The value of a specified entry in the configuration store. - The transaction context. - The type of the entry. - The key for the entry. - - - Enables the custom provider to initialize the cache cluster configuration store. - - - Inserts an entry into the configuration store. - Return true if the entry is successfully inserted. Return false if the entry with the same key and type already exists. For all other failures, a must be thrown. - The transaction context object. - The type of the entry. - The key of the entry. - The value of the entry. - The version of the entry. - - - Gets the initialization status of the configuration store. - Returns true if the configuration store is initialized. - - - Initializes the configuration store with a connection string that is used for subsequent calls. - The connection string to the configuration store. - - - Removes a Windows account from the list of accounts that have permission t the access the configuration store. - The machine name. - The user name. - An object that represents the state if this call is being used to rollback a previous call to . - - - Retrieves the version of the configuration store. - Returns . - - - Determines whether the configuration store is available. - - - Updates an entry in the store. - Returns . If the update succeeds, the return value is true. If the entry does not exist or if the version does not match, the return value is false. - The transaction context object. - The type of the entry. - The key of the entry. - The updated value of the entry. - The version of the entry. If this value is less than or equal to 0, the update occurs regardless of the version. If this value is greater than 0, then the update is only performed if the version of the entry matches the version provided. - - - Implement this interface to provide custom serialization for cached objects. - - - Deserializes a memory stream to an object. - Returns . - The memory stream returned from the cache. - - - Serializes an object to a memory stream. - A memory stream to use to store the serialized object. - The object to serialize. - - - Stores cache statistics used in conjunction with the Get-CacheStatistics Windows PowerShell command. - - - Creates a new object. - - - The total size in bytes of requests sent to the cache. - Returns . - - - The number of items in the cache. - Returns . - - - The number of cache misses for requested items that were not present in the cache. - Returns . - - - The total size in bytes of responses sent from the cache. - Returns . - - - The number of read operations from the cache. - Returns . - - - The number of regions in the cache. - Returns . - - - The number of requests on the cache. - Returns . - - - - The size in bytes of the cache. - Returns . - - - The number of write operations to the cache. - Returns . - - - - Internal. - - - Internal. - - - Internal. - Internal. - - - - - - - - - - - - - - - Internal. - Internal. - - - Internal. - - - Internal. - Internal. - - - - - Internal. - Internal. - - - Internal. - - - Internal. - Internal. - - - - - Internal. - - - Internal. - Internal. - - + + + + Microsoft.ApplicationServer.Caching.Core + + + + + + Returns . + + + Returns . + + + The base class for an event used for notifications. Applies only to the server versions of AppFabric. + + + Initializes a new instance of the class. Applies only to the server versions of AppFabric. + Name of the cache in which the operation occurred. + Type of the operation which caused the notification. + Version of the operation which caused the notification. + + + Name of the cache in which the operation occurred. Applies only to the server versions of AppFabric. + Returns . + + + The type of the operation which caused the notification. Applies only to the server versions of AppFabric. + Returns . + + + Returns the string representation of the BaseOperationNotification event. Applies only to the server versions of AppFabric. + Returns . + + + The version of the operation which caused the notification. Applies only to the server versions of AppFabric. + Returns . + + + Represents a key-value pair that can be used by a custom provider for the cache cluster configuration store. Applies only to the server versions of AppFabric. + + + Creates a new instance of the class. Applies only to the server versions of AppFabric. + The key of the entry. + The value of the entry. + The version of the entry. + + + The key of the entry. Applies only to the server versions of AppFabric. + A object. + + + The version of the entry. Applies only to the server versions of AppFabric. + A value that is greater than 0. + + + An exception that should be thrown from an implementation of the interface. Applies only to the server versions of AppFabric. + + + Creates a new instance of the class. Applies only to the server versions of AppFabric. + + + Creates a new instance of the class. Applies only to the server versions of AppFabric. + The object that holds the serialized object data. + The contextual information about the source or destination. + + + Creates a new instance of the class. Applies only to the server versions of AppFabric. + The message string that describes the error. + + + Creates a new instance of the class. Applies only to the server versions of AppFabric. + The message string that describes the error. + The inner exception that caused the current exception. + + + Provides support for changing the logging level of Windows Azure Caching. + + + Changes the logging level of the Event Tracing for Windows (ETW) log for Windows Azure Caching. + Returns . + The trace level for the log. + + + Enables tracing for a cache client. + The type of tracing. This can be set to or . + The trace level. + + + A static class used to store global error codes. + + + The ACS token provided failed the authentication process. + + + Cache Administration is already configured on the machine. + + + Cache Administration is not configured on the machine. + + + The authentication token provided is not in a valid format. + + + The named cache already exists in the cache cluster. + + + + The named cache could not be created due to a detected inconsistency in the configuration store. + + + The specified named cache does not exist in the cache cluster. + + + + The cache cluster is not running. + + + The cache cluster is not ready to perform the requested operation. + + + The cache cluster experienced an error while attempting to refresh the list of cache hosts on all of the cache hosts. + + + + An error occurred attempting to read the configuration store provider name and connection string from the registry. + + + A Cache Administration timeout occurred. + + + + An error occurred attempt to add a cache host to the cache cluster configuration store. + + + An error occurred attempting to delete a cache host from the cache cluster configuration store. + + + An error occurred while creating the default cache. + + + The specified cache is in the process of being removed. + + + An error occurred attempting to add an account to the allowed client accounts list. + + + + The name 'localhost' is unable to be resolved to the current host name. + + + The specified cache host is not part of the cache cluster. + + + + The specified cache host is not currently running. + + + + The cache cluster experienced an error while attempting to refresh the list of cache hosts on each of the specified cache host. + + + The specified cache host is already in the running state. + + + + No cache hosts are running in the cache cluster. + + + One or more cache hosts are running in the cache cluster. + + + + + An error occurred reading the installation path from the registry. + + + + The specified provider string or connection string is invalid. + + + The specified operation is invalid. + + + + + The specified security settings are invalid. + + + The specified named cache cannot be created, because the cache cluster has reached the maximum number of named caches. + + + + There are no cache hosts in the cache cluster. + + + The specified host cannot be stopped, because the number of hosts would drop below the required quorum. + + + There are no seed nodes present in the cache cluster. + + + + A required argument is null. + + + + + + One or more port numbers have duplicate values. + + + + The required quorum of hosts is not running. + + + The specified region does not exist in the cache cluster. + + + An error occurred while attempting to access the registry on a remote cache host. + + + The request timed out, but the result of the request is unknown. + + + An error occurred attempting to remove an account from the list of allowed client accounts. + + + + + + The returned status information might be incorrect, because one or more cache hosts could not be reached. + + + An error occurred attempting to access the cache cluster configuration store. + + + A timeout occurred. + + + An unknown error occurred. + + + The specified Windows account already exists in the list of allowed client accounts. + + + The specified Windows account is not valid. + + + The specified Windows account is not present in the list of allowed client accounts. + + + The cache has been disabled. One possible cause could be a failure to reconcile charges associated with the specified cache. + + + The object in the cache does not match with the specified version. + + + + + Unable to establish an SSL channel. + + + The cache client assemblies are a different version than the cache host assemblies. + + + The cache cluster has already been initialized. + + + An error occurred while attempting to connect to the cache cluster configuration store. + + + An error occurred while reading the cache cluster configuration store. + + + The cache cluster is not initialized. + + + An error occurred while attempting to save the configuration state. + + + An error occurred while attempting to save the connection settings to the registry. + + + The connection was terminated. This could be caused by server or network problems. + + + + + + An error occurred while attempting to get the computer domain. + + + An error occurred while attempting to add a cache host to the cache cluster. + + + + An error occurred while attempting to remove a host from the cache cluster. + + + The specified cache host entry was not found in the cache cluster configuration. + + + + The specified connection parameters are incomplete. + + + An error occurred while attempting to read the install path from the registry. + + + The argument is not valid. + + + AutoDiscover property is not valid. + + + The specified lock handle is not valid. + + + An invalid enumerator is specified. + + + The key is already present in the cache or region. + + + An object cached with the specified key does not exist in the cache or region. + + + The named cache count exceeded the maximum value. + + + The request failed because either the response or the request message was larger than configured message size in the transport properties. + + + The named cache does not exist. + + + A network path was expected, but a local path was provided. + + + The specified network file share does not have appropriate permissions. + + + An error occurred while attempting to connect to the shared network folder. + + + An error occurred attempting to write the configuration store files at the specified shared network folder. + + + The domain account is blocked for the workgroup configuration. + + + The Network Service account is not permitted for a workgroup-based configuration of the Caching Service. + + + Cache notifications are not supported because the named cache has been created without notifications enabled. + + + The cached object has already been locked. + + + The object is not locked. + + + + + An error occurred while setting permissions on the cache cluster configuration. + + + The specified port is already in-use. + + + One or more ports have duplicate values. + + + + + + + The region already exists. + + + The region does not exist. + + + An error occurred while attempting to access the registry. + + + An error occurred while attempting to open a registry key for reading. + + + Temporary failure, retry the operation later. + + + An exception was encountered during object serialization. + + + The server passed to the constructor is null. + + + An error occurred while accessing the Caching Service. + + + The Caching Service is already configured on the specified cache host. + + + The Caching Service is not configured on the specified cache host. + + + The operation cannot be completed, because the Caching Service is still running. + + + SQL Server authentication is not permitted with the SQL Server provider for the cache cluster configuration store. Windows authentication must be used. + + + + The test connection failed. + + + Communications with the cache cluster has experienced a delay past the timeout value. + + + An unknown error has occurred. + + + The current operation is not supported on this port. + + + + Used to retrieve substatus codes for errors returned to the client. + + + The primary cache server is unavailable. + + + + Unable to validate the SSL certificate. + + + An internal error has occurred. + + + The client failed to update a key when adding or replacing an object in the cache. + + + The specified key name is too large. The key size is calculated after serialization and UTF-8 encoding of the string. It must be less than 65 KB. + + + There is no specific substatus code. + + + The request did not find the primary server. + + + Unable to satisfy the specified write quorum of cache hosts. + + + A resource quota for the Windows Azure Caching namespace has been exceeded. + + + Internal. + + + The specified region name is too large. The name size is calculated after serialization and UTF-8 encoding of the string. It must be less than 65 KB. + + + Replication failed. + + + The replication queue is full. + + + The memory available for the caching service is low. + + + The specified tag name is too large. The name size is calculated after serialization and UTF-8 encoding of the string. It must be less than 65 KB. + + + The requested operation failed, because the required cache host is in a throttled state. + + + Used for cache-related exceptions. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class; allows you to provide serialization information with the exception. + Stores serialization information about an object. + Describes the source, destination, and context of a serialized stream. + + + Initializes a new instance of the class; allows you to provide a message with the exception. + The message describing the exception. + + + Initializes a new instance of the class; allows you to provide a message and another exception with the exception. + The message describing the exception. + Another exception related to this exception. + + + The integer used to identify the type of exception encountered. + An specifying the type of exception encountered. + + + The interface that is used for serialization. + The SerializationInfo class used to store all the data that you need to serialize the exception. + The StreamingContext class used to describe the source and destination of the exception. + + + A link to help for the exception. + Returns . + + + The description of the exception encountered. + A that describes the type of exception encountered. + + + The of the exception encountered. + An indicating the exception substatus. + + + The tracking identifier related to the exception. Only valid if tracing is enabled. + Returns . + + + Used to retrieve all information associated with the cached object in the cluster. + + + Initializes a new instance of the class. + + + The name of the cache where the object is stored. + A string value that represents the name of the cache where the object is stored. + + + The amount of time to extend the object lifetime on each access. + Returns . + + + The identifier that is used to distinguish the cached object in the cache or region. + A string value that represents the identifier that is used to distinguish the cached object in the cache or region. + + + If applicable, the name of the region where the object is stored. + A string value that represents, if applicable, the name of the region where the object is stored. + + + The approximate size of the cached item. This field is intended for internal use only. + Returns . + + + A generic list of tags associated with the cached object. + An generic list of objects associated with the cached object. + + + Specifies the length of time for which the object will remain in the cache. + Returns . + + + Creates a string representation of the DataCacheItem object. + Returns . + + + The object stored in cache. + An object representing the deserialized form of the cached object. + + + The version of the cached object. + The . + + + Used to create objects as a part of implementing a read-through or write-behind provider. + + + Creates a DataCacheItem object using the specified parameters. + Returns . + The that is passed to the read-through or write-behind provider methods. + The name of the cache that is associated with this item. + The value of the cache item. + A collection of tags associated with this item. + + + A cache item key used in the implementation of a read-through or write-behind provider. + + + Create a new object. + The region name for the cache item. + The key name for the cache item. + + + Returns true if the DataCacheItemKey objects are equal. + Returns . + The DataCacheItemKey object to compare. + + + Returns the hash code for the DataCacheItemKey. + Returns . + + + The name of the data cache item key. + Returns . + + + The region of the cache item. + Returns . + + + Returns a string representation of the DataCacheItemKey. + Returns . + + + Used to represent the version of a cached object. + + + Used to compare two versions of the same item, specified with the same key. + An value: 0 if the versions are equal, greater than zero if the instance is greater than the version parameter value, or less than zero if the instance is less than the version parameter value. + The to be compared. + + + Used to determine whether another object is the same. + A value: true, if the objects are the same; false, if they are different. + Another object for comparison. + + + Returns the hash code of the object. + An value that represents the hash code of the DataCacheItemVersion object. + + + Indicates whether the DataCacheItemVersion object points to a null version. This is intended for internal use only. + Returns . + The DataCacheItemVersion object to examine. + + + Indicates whether the two objects are equal. + True if the two specified objects are equal; otherwise, false. + The first object to compare. + The second object to compare. + + + Indicates whether the first object is greater than the second object. + True if the first object is greater than the second object; otherwise, false. + The first object to compare. + The second object to compare. + + + Indicates whether the two objects are unequal. + True if the two objects are not equal; otherwise, false. + The first object to compare. + The second object to compare. + + + Indicates whether the value of the first object is less than the second object. + True if the value of the first object is less than the value of the second object; otherwise, false. + The first object to compare. + The second object to compare. + + + Specifies the way locally cached objects should be invalidated. + + + Specifies that objects will stay in local cache until they are automatically invalidated by a cache notification.  Not supported in Windows Azure Shared Caching. + + + Specifies that objects will stay in local cache until their lifetime reaches the localCacheTimeout duration specified in the DataCacheFactory constructor.  + + + Represents the structure used as a key to lock and unlock cached objects in a pessimistic concurrency scenario. + + + Returns the specified object to string. + A string that represents the object. + + + An enumeration of the serialization types. + + + Items are serialized with a binary formatter. + + + Items are serialized with a custom formatter. + + + Items are serialized with a NetDataContractSerializer formatter. This is the default. + + + Represents a notification event for operations performed against the cache, such as Add or Remove. + + + Creates a new instance of the DataCacheOperationDescriptor class using the specified parameters. + Name of the cache in which the operation occurred. + The name of the region where the object is stored. + The key used to store the object in the cache. + The type of operation that occurred. + The version of the cached object. + + + Returns the property. + A string representing the current value of the property. + + + Returns the property. + A string representing the current value of the property. + + + Returns the string representation of the object. + A string representing the current value of the object. + + + An enumeration used to specify specific item or region events that can trigger a cache notification. + + + Indicates that an object was added to the cache. + + + Indicates that a region in the cache was cleared with the method. + + + Indicates that a region in the cache was created with the method.  + + + Indicates that an object was removed from the cache.  + + + Indicates that a region in the cache was removed with the method.  + + + Indicates that an object was replaced in the cache.  + + + Enumeration indicating whether data sent between client and server is signed and/or encrypted. + + + Indicates both encryption and signing are used. + + + Indicates that neither encryption nor signing is used. + + + Indicates that signing without encryption is used. + + + Used to enable signing and/or encryption of data sent between client and server. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class, allows you to specify the and for the instance. Applies only to the server versions of AppFabric. + Enumeration indicating if channel security is disabled by setting to None; or if channel security is enabled by setting to Transport. + Enumeration indicating whether data sent between client and server is signed and/or encrypted.This property is only valid when the property is set to Transport. + + + Initializes a new instance of the class. Applies only to Windows Azure Shared Caching. + A SecureString object that contains the authorization token from the Windows Azure Management Portal. + + + Initializes a new instance of the class. Applies only to Windows Azure Shared Caching. + A SecureString object that contains the authorization token from the Windows Azure Management Portal. + Specifies whether SSL should be used. + + + Initializes a new instance of the class. + The authorization token. + + + Initializes a new instance of the class. + The authorization token. + Specifies whether SSL should be used. + + + The set for the object. + Returns the set for the object. + + + The set for the object. + Returns the set for the object. + + + Enumeration indicating whether channel security is enabled for data sent between client and server. Applies only to the server versions of AppFabric. + + + Specifies that message security is used. This is the security mode required for AppFabric caches, which use the Access Control Service (ACS). Applies only to the server versions of AppFabric. + + + Specifies that no security is enabled. Applies only to the server versions of AppFabric. + + + Specifies that transport security is enabled. Applies only to the server versions of AppFabric. + + + Specifies the serialization properties for a cache client. + + + Creates a new DataCacheSerializationProperties object. + The serializer type to use for cached objects. + Specifies an object that implements the IDataCacheObjectSerializer interface for custom serialization. + + + The type of serialization to use for cached objects. + Returns . + + + Returns the IDataCacheObjectSerializer for a custom serializer. + Returns . + + + Specifies the type of account that is used to run the AppFabric Caching service. + + + The AppFabric Caching service runs under a domain account on the cache cluster. + + + The AppFabric Caching service runs under a built-in system account on the cache cluster. For example, NETWORK SERVICE. + + + An exception object that should be used by read-through or write-behind providers. + + + Creates a new instance of the class. + + + Creates a new instance of the class. + Internal. + Internal. + + + Creates a new instance of the class. + An error message to associate with this exception object. + + + Creates a new instance of the class. + An error message to associate with this exception object. + An inner exception to associate with this exception object. + + + An abstract class that must implemented by read-through or write-behind providers. + + + Creates a new instance of the class. + + + This Delete overload is called for a single item that is deleted from the cache associated with the read-through or write-behind provider. + The DataCacheItemKey for the item that has been deleted. + + + This Delete overload is called for multiple items that are deleted from the cache associated with the read-through or write-behind provider. + A collection of DataCacheItemKeys that should be removed. + + + Used to dispose the DataCacheStoreProvider class. + + + Used to dispose the DataCacheStoreProvider class. + + + This Read overload is called to read a single item from the read-through provider. + Returns . + The DataCacheItemKey for the item that should be returned. + + + This Read overload is called to read a multiple items from the read-through provider. + A collection of DataCacheItemKey objects for the objects that should be read. + A dictionary of DataCacheItemKey objects and DataCacheItem objects that is used to return the results of the read request. + + + This Write method is called to write a single item to the backend associated with the write-behind provider. + The DataCacheItem object that should be written to the backend. + + + This Write method is called to write multiple items to the backend associated with the write-behind provider. + A collection of DataCacheItem objects that should be written to the backend. + + + Represents an optional string-based identifier that you can associate with a cached object. + + + Initializes a new instance of the class. + The string-based identifier to associate with a cached object. Tags must be less than 65 KB. + + + Compares the current DataCacheTag object for equality with the specified DataCacheTag object. + True if the object implements the ToString method and its value is the same as the string representation of the current DataCacheTag; otherwise, false. + The object whose string representation is compared for equality to the current object. + + + Returns the hash code for the current object. + An integer representing the hash code for the current DataCacheTag object. + + + Returns the string representation of the current object. + A string representing the current value of the DataCacheTag object + + + Provides fields that specify the type of cache client tracing to use with the method. Applies only to Windows Azure Caching. + + + A trace sink that uses standard Windows Azure Caching diagnostics. Applies only to Windows Azure Caching. + + + A trace sink that uses Event Tracing for Windows (ETW) to record the trace data. Not supported in Windows Azure Shared Caching. + + + Specifies the transport settings for a cache client. + + + Creates a new instance of the class. + + + Gets or sets the length of time to wait for a WCF channel initialization before timing out. + Returns . + + + Creates a copy of the current object. + Returns . + + + Gets or sets the size of the receive buffers used by transport channels. + Returns . + + + Gets or sets the maximum buffer pool size used by the WCF buffer manager. + Returns . + + + Gets or sets the maximum buffer size. + Returns . + + + Gets or sets the maximum length of time to wait before requests are batched and sent to the client. + Returns . + + + Gets or sets the length of time to wait for a request before aborting the channel. + Returns . + + + Specifies the eviction used for a cache. + + + The cache uses an eviction policy of Least-Recently-Used (LRU). + + + The cache does not evict objects. + + + + + + + + + + + + + + + + + + + Stores cache statistics used in conjunction with the Get-CacheStatistics Windows PowerShell command. + + + Creates a new object. + + + The number of items in the cache. + Returns . + + + The number of cache misses for requested items that were not present in the cache. + Returns . + + + The number of named caches. + Returns . + + + The number of regions. + Returns . + + + The total number of requests. + Returns . + + + The size in bytes of cached items. + Returns . + + + + Represent an ICustomProvider interface. Applies only to the server versions of AppFabric. + + + Adds a Windows account to the list of allowed users that have access to the configuration store.. + Returns a that can be passed to the method in the case of a rollback. + The machine name. + The user name. + + + Begins a transaction to provide isolation from other configuration store access. + Returns a that represents the transaction context.. + + + Enables the provider to clean up any data in the cache cluster configuration store. + + + Deletes an existing entry from the configuration store. + The transaction context object associated with this entry. + The type of entry to be enumerated. + + + Deletes an existing entry from the configuration store. + Returns . If the deletion succeeds, the return value is true. If the entry does not exist or if the version does not match, the return value is false. + The transaction context object associated with this entry. + The type of entry to be enumerated. + The key of the entry. + The version of the entry. If this value is less than or equal to 0, the deletion occurs regardless of the version. If this value is greater than 0, then the deletion is only performed if the version of the entry matches the version provided. + + + Commits or rollbacks a transaction previously started with the method. + An object that represents the transaction context. This object is returned from the method. + If true, the transaction should be rolled back. If false, the transaction should be committed. + + + Enumerates all the entries of the specified type. + Returns a of entries. + The transaction context object. + The type of entry to enumerate. + + + Retrieves a object from the configuration store. + Returns a object. + The transaction context object. + The type of the entry. + The key of the entry. + + + Obtains the current UTC time based on the clock for the configuration store. + Returns . + The transaction context object. + + + Retrieves the value of a specific entry in the configuration store. + The value of a specified entry in the configuration store. + The transaction context. + The type of the entry. + The key for the entry. + + + Enables the custom provider to initialize the cache cluster configuration store. + + + Inserts an entry into the configuration store. + Return true if the entry is successfully inserted. Return false if the entry with the same key and type already exists. For all other failures, a must be thrown. + The transaction context object. + The type of the entry. + The key of the entry. + The value of the entry. + The version of the entry. + + + Gets the initialization status of the configuration store. + Returns true if the configuration store is initialized. + + + Initializes the configuration store with a connection string that is used for subsequent calls. + The connection string to the configuration store. + + + Removes a Windows account from the list of accounts that have permission t the access the configuration store. + The machine name. + The user name. + An object that represents the state if this call is being used to rollback a previous call to . + + + Retrieves the version of the configuration store. + Returns . + + + Determines whether the configuration store is available. + + + Updates an entry in the store. + Returns . If the update succeeds, the return value is true. If the entry does not exist or if the version does not match, the return value is false. + The transaction context object. + The type of the entry. + The key of the entry. + The updated value of the entry. + The version of the entry. If this value is less than or equal to 0, the update occurs regardless of the version. If this value is greater than 0, then the update is only performed if the version of the entry matches the version provided. + + + Implement this interface to provide custom serialization for cached objects. + + + Deserializes a memory stream to an object. + Returns . + The memory stream returned from the cache. + + + Serializes an object to a memory stream. + A memory stream to use to store the serialized object. + The object to serialize. + + + Stores cache statistics used in conjunction with the Get-CacheStatistics Windows PowerShell command. + + + Creates a new object. + + + The total size in bytes of requests sent to the cache. + Returns . + + + The number of items in the cache. + Returns . + + + The number of cache misses for requested items that were not present in the cache. + Returns . + + + The total size in bytes of responses sent from the cache. + Returns . + + + The number of read operations from the cache. + Returns . + + + The number of regions in the cache. + Returns . + + + The number of requests on the cache. + Returns . + + + + The size in bytes of the cache. + Returns . + + + The number of write operations to the cache. + Returns . + + + + Internal. + + + Internal. + + + Internal. + Internal. + + + + + + + + + + + + + + + Internal. + Internal. + + + Internal. + + + Internal. + Internal. + + + + + Internal. + Internal. + + + Internal. + + + Internal. + Internal. + + + + + Internal. + + + Internal. + Internal. + + \ No newline at end of file diff --git a/lib/windowsazure/Microsoft.WindowsAzure.Diagnostics.xml b/lib/windowsazure/Microsoft.WindowsAzure.Diagnostics.xml index 915f4abb20e..a536beb941e 100644 --- a/lib/windowsazure/Microsoft.WindowsAzure.Diagnostics.xml +++ b/lib/windowsazure/Microsoft.WindowsAzure.Diagnostics.xml @@ -1,2206 +1,2206 @@ - - - - Microsoft.WindowsAzure.Diagnostics - - - - - Provides access to common SDK constants. - - - - - The version to display in the command line tools banners. - - - - - Path to the SDK installation registry key. - - - - - Name of the registry value that contains the SDK installation path. - - - - - Name of the registry value that contains the SDK version string. - - - - - The version to display in the command line tools banners. - - - - - The GUID of the ETW log to use for Azure infrastructure logging. - - - - - Environment variable read by hosts to enable partial trust. - - - - - Environment variable for Agent RPC Endpoint. - - - - - String environment variable that defines the module name for system plugin tasks. - It is required to differenciate user startup task and system startup task. - - - - - Boolean environment variable that causes IISConfigurator to delete existing sites. - - - - - Boolean environment variable that causes IISConfigurator to configure URL rewrite. - - - - - Configurable operation timeout for IISConfigurator client connection through WCF. - This is in terms of minutes. - - - - - The name of the environment variable that contains the role type. - - - - - The role type value indicating a worker role. - - - - - The role type value indicating a web role hosted in HWC. - - - - - The role type value indicating a web role hosted in IIS. - - - - - Base path to SDK runtime endpoint discovery (no version specified). - - - - - Path to SDK runtime endpoint discovery. - - - - - Name of the runtime endpoint value. - - - - - Name of the runtime endpoint value. - - - - - Subject name of generated management certificates. - - - - - Registry key path to storage key path. - - - - - Registry key path to cloud drive devpath. - - - - - Name of the registry value that contains path for the devpath. - - - - - Name of the registry value that contains path for the devpath. - - - - - Name of the event log. - - - - - Name of the event guest agent source. - - - - - Name of the event runtime source. - - - - - The name of the private configuration setting use to determine if code is running under - the devfabric or not. - - - This is shared between the runtime and the devfabric. Do not change this, as it breaks - a contract between the two. - - - - - The name of the private configuration setting use to pass the path to the IIS Express installation root. - - - This is shared between the runtime and the devfabric. Do not change this, as it breaks - a contract between the two. - - - - - Path to a debugger to launch the role host process under. - - - - - Provides extension methods to the DiagnosticMonitor class - - - - - Creates a new instance of the class for the specified deployment - - Storage account connection string. - The deployment ID for the current deployment. - A object. - - - - Creates an new instance of the class for the specified deployment, role, - and instance. - " - Storage account connection string. - The deployment ID for the current deployment. - The name of the role in the specified deployment. - The role instance ID. - A object. - - - - Allows sending configuration requests to a ConfigChannelServer. - - - - - Stores the name of the pipe. - - - - - Initializes a new instance of the class. - - Name of the pipe. - - - - Sends the configuration request. - - The config request. - The timeout. - true if the config was sent; otherwise false. - - - - Starts a named pipe server that listens for configuration change events. - - - - - Stores the name of the pipe. - - - - - Stores the server pipe. - - - - - Initializes a new instance of the class. - - Name of the pipe. - - - - Starts a named pipe server. - - - - - Stops the server. - - - - - Raises the event. - - The instance containing the event data. - - - - Handles client connections. - - The async result. - - - - Raised when a new configuration is sent. - - - - - Stores the data required for the ConfigurationRequest event. - - - - - Initializes a new instance of the class. - - The request. - - - - Gets the config request. - - The config request. - - - - XML serializer for configuration request. - - - - - Advanced class used to explicitly configure the monitoring agent. - - - - - Creates an inital configuration for the diagnostic monitor. - - - - - Gets or sets the connection string for storage account to which logs are transferrred. - - - - - Gets or sets the deployment ID of the role instance for which this diagnostic monitor is running. - - - - - Gets or sets the role instance ID. - - - - - Gets or sets the name of the role. - - - - - Gets or sets the name of the local directory where diagnostic monitor state is written. - - - - - Gets or sets the diagnostic monitor tools directory. - - - - - Gets or sets the polling interval for the diagnostic monitor. - - - - - Represents the configuation for performance counter data sources. - - - - - Gets or sets the rate at which to sample the performance counter, rounded up to the nearest second. - - - - - Gets or sets a performance counter specifier using standard Windows counter syntax. - - - See Specifying a Counter Path - for more information on performance counters. - - - - - Class to configure data buffers used to store diagnostic information. - - - - - Gets or sets the interval between scheduled transfers for this data buffer, in minutes. - - - This value is rounded up to the nearest minute. A value of TimeSpan.Zero disables any scheduled - data transfer. - - - - - Gets or sets the maximum amount of file system storage available to the specified data buffer. - - - By default buffer sizes are automatically allocated by Windows Azure. You can set this property - if you need to manage the buffer size explicitly. - - - - - Configuration class for data buffers that contain file-based logs. - - - Represents the configuration for file-based data buffers. - - - - - Gets a list of configured directories for file-based logs. - - - - - Configuation class for data buffers that hold performance counter information. - - - Represents the buffer configuration for performance counters. - - - - - Gets a list of configurations for performance counters that are being collected. - - - - - Configuration class for buffers used to hold information gathered from the Windows event logs. - - - Represents the buffer configuration for Windows event logs. - - - - - Gets a list of configured data sources for Windows event logs. - - - - - Specifies a logging level by which to filter records when performing a scheduled transfer. - - - When this property is set to LogLevel.Undefined, no filter is applied and all logging events at all levels are transferred. - - - - - Represents the configuration for a set of standard fixed data buffers for logging and diagnostic information. - - - - - Gets or sets the interval at which the diagnostic monitor polls for diagnostic configuration changes. - - - - Increasing the rate at which your service polls for configuration changes may affect your - storage costs. For more information, see . - - - Note that the configuration change polling interval cannot be set remotely. - - - - - - Gets or sets the total amount of file system storage allocated for all logging buffers. - - - - - Gets or sets the buffer configuration for basic Windows Azure logs. - - - - - - Gets or sets the buffer configuration for the logs generated by the underlying diagnostics infrastructure. - The diagnostic infrastructure logs are useful for troubleshooting the diagnostics system itself. - - - - - Gets or sets the buffer configuration for performance counter data. - - - - - Gets or sets the buffer configuration for Windows event logs. - - - - - Gets or sets the buffer configuration for file-based logs defined by the developer. - - - - - Represents information about ongoing data transfers from the local logs to a Windows Azure storage account. - - - - - Constructs an OnDemandTransferInfo object from queue messages sent by a diagnostic monitor on completion of an on-demand - transfer. - - The queue message content. - An object. - - - - Gets or sets the unique ID for a given transfer request. - - - - - Gets or sets the deployment ID from which the source data is being transferred. - - - - - Gets or sets the name of the role from which the source data is being transferred. - - - - - Gets or sets the ID of the role instance from which the source data is being transferred. - - - - - Gets or sets the name of a queue where a completion message will be enqueued to provide information - about this transfer. - - - If notification of completion is requested, a single message will - be placed in the specified queue to signal completion. - - - - - Enumeration of a standard set of data buffers for logging. - - - - - Basic Windows Azure logs - - - - - Diagnostic infrastructure logs - - - - - Performance counters - - - - - Windows event logs - - - - - File-based logs defined by the developer. - - - IIS logs, Failed Request logs, and application crash dumps are a special case of file-based logs that are automatically - configured for the service. - - - - - Describes the configuration of a directory to which file-based logs are written. - - - IIS logs, Failed Request logs, and application crash dumps are a special case of file-based logs that are automatically - configured for the service. - - - - - Gets or sets the absolute path for the local directory to which file-based logs are being written. - - - - - Gets or sets the name of a container defined in a storage account where the - contents of file-based logs are to be transferred. - - - - A container is a resource defined by the Blob service under which blob data is stored. File-based logs are - copied from the local directory to blobs within this container when a scheduled or on-demand transfer is performed. - - - The Blob service endpoint is determined by the cloud storage account used to initialize the - for the role instance. - - - The directory from which file-based logs are transferred is the directory defined by the property - for this object. - - - - - - Gets or sets the maximum size of the directory defined by the property to which - file-based logs are written. - - - - - Defines a standard set of logging levels. - - - - - Logs all events at all levels. - - - - - Logs a critical alert. - - - - - Logs an error. - - - - - Logs a warning. - - - - - Logs an informational message. - - - - - Logs a verbose message. - - - - - Represents the buffer configuration for basic Windows Azure logs. - - - - - Gets or sets the logging level by which to filter records when performing a scheduled transfer. - - - When this property is set to LogLevel.Undefined, no filter is applied and all logging events at all levels are transferred. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Represents an active instance of a diagnostic monitor. - - - - - Returns the default initial diagnostic monitor configuration for the current role instance. - - A object. - - - Call this method to retrieve the initial configuration for all logging and diagnostic parameters for the current - role instance. Once you retrieve the initial configuration, you can modify configuration parameters and - update the configuration for the current instance. - - - By default, the overall quota for file system storage for all logging buffers is approximately 4 GB. This - storage space is automatically allocated across the various logging buffers in a dynamic fashion. - You can also configure individual buffer quotas if you prefer to manage them yourself. - - - The size of the overall quota for logging buffers is limited by the size of the DiagnosticStore local resource. - To increase the size of the overall quota, first increase the size of the DiagnosticStore resource. - - - - - - Starts a diagnostic monitor. - - The name of a configuration setting that - provides a connection string to a storage account. - - A object. - - - This method starts a diagnostic monitor with the default initial configuration. - Data buffers are written to the storage account indicated by the specified configuration setting. The storage - account may be the well-known development storage account, or a Windows Azure storage account in the cloud. - - - See Configuring Connection Strings for more information - about how to construct a connection string to a storage account. - - - This method also registers for notification of changes to configuration settings. - If the value of the connection string is changed, the diagnostic monitor will be - automatically reconfigured to use the new connection. - - - See Configuring Connection Strings for more information - about how to construct a connection string to a storage account. - - - - - - Starts a diagnostic monitor with a user-defined initial configuration. - - The name of a configuration setting that - provides a connection string to a storage account. - A object that - provides a custom initial configuration. - A object. - - - This method starts a diagnostic monitor with the specified initial configuration. - Data buffers are written to the storage account indicated by the specified configuration setting. The storage - account may be the well-known development storage account, or a Windows Azure storage account in the cloud. - - - This method also registers for notification of changes to configuration settings. - If the value of the connection string is changed, the monitoring agent will be - automatically reconfigured to use the new connection. - - - See Configuring Connection Strings for more information - about how to construct a connection string to a storage account. - - - - - - Starts a diagnostic monitor with an explicitly supplied storage connection string and initial configuration. - - The connection string to a storage account. - A object that - provides a custom initial configuration. - A object. - - - This method starts a diagnostic monitor with the specified initial configuration. - Data buffers are written to the storage account indicated by the connection string. The storage - account may be the well-known development storage account, or a Windows Azure storage account in the cloud. - - - See Configuring Connection Strings for more information - about how to construct a connection string to a storage account. - - - - - - Updates the storage account information for the current diagnostic monitor. - - Storage account connection string. - - - - Stops the diagnostic monitor. - - - - - Specifies that the diagnostic monitor may use non-secure (HTTP) connections to - communicate with the storage account. - - - true if [allow insecure remote connections]; otherwise, false. - - - - This property should be set to true only in debugging - scenarios. In a production environment, the default connection used by the diagnostic monitor is secure (HTTPS). - When the diagnostic monitor is configured to use the development storage account, this property is ignored. - - - - - - Gets the local directory where state information for the diagnostic monitor is stored. - - - - - Represents the application crash dumps. - - - - - Enables collection of application crash dumps (mini dumps or full dumps) for this process. - - if set to true [enable full dumps]; if false, collect mini dumps only. - - - When you enable collection of crash dumps with this method, crash dumps are written to the crash dumps - directory (named "CrashDumps") in the default diagnostic store. The default diagnostic store is a local - resource that is automatically configured for the role and is named "DiagnosticStore". - You can retrieve the default diagnostic store by calling the - method. - - - - - - Enables collection of crash dumps (mini dumps or full dumps) for this process to a specified local directory. - - The absolute path to the local directory. - if set to true [enable full dumps]; if false, collect mini dumps only. - - - - Provides a class for managing the configuration of diagnostic monitors remotely. - - - - - Creates a new instance of the class. - - A connection string for a storage account. - The deployment ID. - - - See Configuring Connection Strings for more information - about how to construct a connection string to a storage account. - - - - - - Lists the set of roles which have successfully started at least one diagnostic monitor. - - A list of role names. - This method does not return a list of all roles in a deployment, but only the roles for which there is currently at least - once instance running a diagnostic monitor. - - - - Returns a list of IDs of active role instances that have a diagnostic monitor running. - - The name of the role. - A list of role instance IDs. - - - - Returns the list of role instance diagnostic managers for the specified role. - - The name of the role. - A list of objects. - - - - Returns the for the specified role instance. - - The name of the role. - The role instance ID. - A object. - - - - Specifies that the deployment diagnostic manager may use non-secure (HTTP) connections to - communicate with the storage account. - - - true if [allow insecure remote connections]; otherwise, false. - - - - This property should be set to true only in debugging - scenarios. In a production environment, the default connection used by the deployment diagnostic manager is secure (HTTPS). - When the deployment diagnostic manager is configured to use the development storage account, this property is ignored. - - - - - - Specifies options for an on-demand transfer. - - - - - Gets or sets the start of the time window for which event data is to be transferred. - - - - - Gets or sets the end of the time window for which event data is to be transferred. - - - - - Gets or sets the filter level for event data that has been logged with level information. - - - If the logging level is set to LogLevel.Undefined, all data is transferred regardless of logging level. - - - - - Gets or sets the name of the queue where transfer completion notification can optionally be sent. - - - - - Class for remotely mananging the configruation and diagnostic data for a given role instnace. - - - - - Initializes a new instance of the class. - - Storage account connection string. - The deployment ID. - The name of the role. - The role instance ID. - - - - Gets the current diagnostic monitor configuration. - - A object. - - - - Sets the configuration for the diagnostic monitor. - - A object representing the new configuration. - - Setting the current configuration while on-demand transfers are pending results in an error. - - - - - Returns the set of active transfers, with associated transfer information. - - A Dictionary of data buffers and their associated on-demand transfer information. - - - - Begins an on-demand transfer of the specified data buffer. - - The name of the source buffer. - A request ID identifying the transfer. - - - - Begins an on-demand transfer of the specified data buffer. - - The name of the source buffer. - Options for the on-demand transfer. - A request ID identifying the transfer. - - - - Cancel all on-demand transfers that are currently in progress, returning the request ID for each transfer. - - Name of the data buffer. - A list of request IDs for the on-demand transfers that are in progress. - Currently there can be at most one active transfer per data buffer. - - - - Stops an on-demand transfer based on its request ID. - - The request ID. - - A boolean indicating whether the on-demand transfer was stopped. This method - may return false if the there is no active tranfer with the given request ID. - - - - - Specifies that the role instance diagnostic manager may use non-secure (HTTP) connections to - communicate with the storage account. - - - true if [allow insecure remote connections]; otherwise, false. - - - - This property should be set to true only in debugging - scenarios. In a production environment, the default connection used by the role instance diagnostic manager is secure (HTTPS). - When the role instance diagnostic manager is configured to use the development storage account, this property is ignored. - - - - - - Gets the deployment ID of this role instance. - - - - - Gets the name of the role for this role instance. - - - - - Gets the ID of this role instance. - - - - - Represents the trace listener used for basic Windows Azure logs. - - - - - Constructor for the class. - - - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - When overridden in a derived class, writes the specified message to the listener you create in the derived class. - - The message to write. - - - - When overridden in a derived class, writes a message to the listener you create in the derived class, followed by a line terminator. - - A message to write. - - - - Writes trace and event information to the listener specific output. - - A object that contains the current process ID, thread ID, and stack trace information. - A name used to identify the output, typically the name of the application that generated the trace event. - One of the values specifying the type of event that has caused the trace. - A numeric identifier for the event. - - - - - - - - Writes trace information, a message, and event information to the listener specific output. - - A object that contains the current process ID, thread ID, and stack trace information. - A name used to identify the output, typically the name of the application that generated the trace event. - One of the values specifying the type of event that has caused the trace. - A numeric identifier for the event. - A message to write. - - - - - - - - Writes trace information, a formatted array of objects and event information to the listener specific output. - - A object that contains the current process ID, thread ID, and stack trace information. - A name used to identify the output, typically the name of the application that generated the trace event. - One of the values specifying the type of event that has caused the trace. - A numeric identifier for the event. - A format string that contains zero or more format items, which correspond to objects in the array. - An object array containing zero or more objects to format. - - - - - - - - Writes trace information, an array of data objects and event information to the listener specific output. - - A object that contains the current process ID, thread ID, and stack trace information. - A name used to identify the output, typically the name of the application that generated the trace event. - One of the values specifying the type of event that has caused the trace. - A numeric identifier for the event. - An array of objects to emit as data. - - - - - - - - Writes trace information, a data object and event information to the listener specific output. - - A object that contains the current process ID, thread ID, and stack trace information. - A name used to identify the output, typically the name of the application that generated the trace event. - One of the values specifying the type of event that has caused the trace. - A numeric identifier for the event. - The trace data to emit. - - - - - - - - Indicates whether the diagnostic monitor trace listener is thread-safe. - - - - + + + + Microsoft.WindowsAzure.Diagnostics + + + + + Provides access to common SDK constants. + + + + + The version to display in the command line tools banners. + + + + + Path to the SDK installation registry key. + + + + + Name of the registry value that contains the SDK installation path. + + + + + Name of the registry value that contains the SDK version string. + + + + + The version to display in the command line tools banners. + + + + + The GUID of the ETW log to use for Azure infrastructure logging. + + + + + Environment variable read by hosts to enable partial trust. + + + + + Environment variable for Agent RPC Endpoint. + + + + + String environment variable that defines the module name for system plugin tasks. + It is required to differenciate user startup task and system startup task. + + + + + Boolean environment variable that causes IISConfigurator to delete existing sites. + + + + + Boolean environment variable that causes IISConfigurator to configure URL rewrite. + + + + + Configurable operation timeout for IISConfigurator client connection through WCF. + This is in terms of minutes. + + + + + The name of the environment variable that contains the role type. + + + + + The role type value indicating a worker role. + + + + + The role type value indicating a web role hosted in HWC. + + + + + The role type value indicating a web role hosted in IIS. + + + + + Base path to SDK runtime endpoint discovery (no version specified). + + + + + Path to SDK runtime endpoint discovery. + + + + + Name of the runtime endpoint value. + + + + + Name of the runtime endpoint value. + + + + + Subject name of generated management certificates. + + + + + Registry key path to storage key path. + + + + + Registry key path to cloud drive devpath. + + + + + Name of the registry value that contains path for the devpath. + + + + + Name of the registry value that contains path for the devpath. + + + + + Name of the event log. + + + + + Name of the event guest agent source. + + + + + Name of the event runtime source. + + + + + The name of the private configuration setting use to determine if code is running under + the devfabric or not. + + + This is shared between the runtime and the devfabric. Do not change this, as it breaks + a contract between the two. + + + + + The name of the private configuration setting use to pass the path to the IIS Express installation root. + + + This is shared between the runtime and the devfabric. Do not change this, as it breaks + a contract between the two. + + + + + Path to a debugger to launch the role host process under. + + + + + Provides extension methods to the DiagnosticMonitor class + + + + + Creates a new instance of the class for the specified deployment + + Storage account connection string. + The deployment ID for the current deployment. + A object. + + + + Creates an new instance of the class for the specified deployment, role, + and instance. + " + Storage account connection string. + The deployment ID for the current deployment. + The name of the role in the specified deployment. + The role instance ID. + A object. + + + + Allows sending configuration requests to a ConfigChannelServer. + + + + + Stores the name of the pipe. + + + + + Initializes a new instance of the class. + + Name of the pipe. + + + + Sends the configuration request. + + The config request. + The timeout. + true if the config was sent; otherwise false. + + + + Starts a named pipe server that listens for configuration change events. + + + + + Stores the name of the pipe. + + + + + Stores the server pipe. + + + + + Initializes a new instance of the class. + + Name of the pipe. + + + + Starts a named pipe server. + + + + + Stops the server. + + + + + Raises the event. + + The instance containing the event data. + + + + Handles client connections. + + The async result. + + + + Raised when a new configuration is sent. + + + + + Stores the data required for the ConfigurationRequest event. + + + + + Initializes a new instance of the class. + + The request. + + + + Gets the config request. + + The config request. + + + + XML serializer for configuration request. + + + + + Advanced class used to explicitly configure the monitoring agent. + + + + + Creates an inital configuration for the diagnostic monitor. + + + + + Gets or sets the connection string for storage account to which logs are transferrred. + + + + + Gets or sets the deployment ID of the role instance for which this diagnostic monitor is running. + + + + + Gets or sets the role instance ID. + + + + + Gets or sets the name of the role. + + + + + Gets or sets the name of the local directory where diagnostic monitor state is written. + + + + + Gets or sets the diagnostic monitor tools directory. + + + + + Gets or sets the polling interval for the diagnostic monitor. + + + + + Represents the configuation for performance counter data sources. + + + + + Gets or sets the rate at which to sample the performance counter, rounded up to the nearest second. + + + + + Gets or sets a performance counter specifier using standard Windows counter syntax. + + + See Specifying a Counter Path + for more information on performance counters. + + + + + Class to configure data buffers used to store diagnostic information. + + + + + Gets or sets the interval between scheduled transfers for this data buffer, in minutes. + + + This value is rounded up to the nearest minute. A value of TimeSpan.Zero disables any scheduled + data transfer. + + + + + Gets or sets the maximum amount of file system storage available to the specified data buffer. + + + By default buffer sizes are automatically allocated by Windows Azure. You can set this property + if you need to manage the buffer size explicitly. + + + + + Configuration class for data buffers that contain file-based logs. + + + Represents the configuration for file-based data buffers. + + + + + Gets a list of configured directories for file-based logs. + + + + + Configuation class for data buffers that hold performance counter information. + + + Represents the buffer configuration for performance counters. + + + + + Gets a list of configurations for performance counters that are being collected. + + + + + Configuration class for buffers used to hold information gathered from the Windows event logs. + + + Represents the buffer configuration for Windows event logs. + + + + + Gets a list of configured data sources for Windows event logs. + + + + + Specifies a logging level by which to filter records when performing a scheduled transfer. + + + When this property is set to LogLevel.Undefined, no filter is applied and all logging events at all levels are transferred. + + + + + Represents the configuration for a set of standard fixed data buffers for logging and diagnostic information. + + + + + Gets or sets the interval at which the diagnostic monitor polls for diagnostic configuration changes. + + + + Increasing the rate at which your service polls for configuration changes may affect your + storage costs. For more information, see . + + + Note that the configuration change polling interval cannot be set remotely. + + + + + + Gets or sets the total amount of file system storage allocated for all logging buffers. + + + + + Gets or sets the buffer configuration for basic Windows Azure logs. + + + + + + Gets or sets the buffer configuration for the logs generated by the underlying diagnostics infrastructure. + The diagnostic infrastructure logs are useful for troubleshooting the diagnostics system itself. + + + + + Gets or sets the buffer configuration for performance counter data. + + + + + Gets or sets the buffer configuration for Windows event logs. + + + + + Gets or sets the buffer configuration for file-based logs defined by the developer. + + + + + Represents information about ongoing data transfers from the local logs to a Windows Azure storage account. + + + + + Constructs an OnDemandTransferInfo object from queue messages sent by a diagnostic monitor on completion of an on-demand + transfer. + + The queue message content. + An object. + + + + Gets or sets the unique ID for a given transfer request. + + + + + Gets or sets the deployment ID from which the source data is being transferred. + + + + + Gets or sets the name of the role from which the source data is being transferred. + + + + + Gets or sets the ID of the role instance from which the source data is being transferred. + + + + + Gets or sets the name of a queue where a completion message will be enqueued to provide information + about this transfer. + + + If notification of completion is requested, a single message will + be placed in the specified queue to signal completion. + + + + + Enumeration of a standard set of data buffers for logging. + + + + + Basic Windows Azure logs + + + + + Diagnostic infrastructure logs + + + + + Performance counters + + + + + Windows event logs + + + + + File-based logs defined by the developer. + + + IIS logs, Failed Request logs, and application crash dumps are a special case of file-based logs that are automatically + configured for the service. + + + + + Describes the configuration of a directory to which file-based logs are written. + + + IIS logs, Failed Request logs, and application crash dumps are a special case of file-based logs that are automatically + configured for the service. + + + + + Gets or sets the absolute path for the local directory to which file-based logs are being written. + + + + + Gets or sets the name of a container defined in a storage account where the + contents of file-based logs are to be transferred. + + + + A container is a resource defined by the Blob service under which blob data is stored. File-based logs are + copied from the local directory to blobs within this container when a scheduled or on-demand transfer is performed. + + + The Blob service endpoint is determined by the cloud storage account used to initialize the + for the role instance. + + + The directory from which file-based logs are transferred is the directory defined by the property + for this object. + + + + + + Gets or sets the maximum size of the directory defined by the property to which + file-based logs are written. + + + + + Defines a standard set of logging levels. + + + + + Logs all events at all levels. + + + + + Logs a critical alert. + + + + + Logs an error. + + + + + Logs a warning. + + + + + Logs an informational message. + + + + + Logs a verbose message. + + + + + Represents the buffer configuration for basic Windows Azure logs. + + + + + Gets or sets the logging level by which to filter records when performing a scheduled transfer. + + + When this property is set to LogLevel.Undefined, no filter is applied and all logging events at all levels are transferred. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents an active instance of a diagnostic monitor. + + + + + Returns the default initial diagnostic monitor configuration for the current role instance. + + A object. + + + Call this method to retrieve the initial configuration for all logging and diagnostic parameters for the current + role instance. Once you retrieve the initial configuration, you can modify configuration parameters and + update the configuration for the current instance. + + + By default, the overall quota for file system storage for all logging buffers is approximately 4 GB. This + storage space is automatically allocated across the various logging buffers in a dynamic fashion. + You can also configure individual buffer quotas if you prefer to manage them yourself. + + + The size of the overall quota for logging buffers is limited by the size of the DiagnosticStore local resource. + To increase the size of the overall quota, first increase the size of the DiagnosticStore resource. + + + + + + Starts a diagnostic monitor. + + The name of a configuration setting that + provides a connection string to a storage account. + + A object. + + + This method starts a diagnostic monitor with the default initial configuration. + Data buffers are written to the storage account indicated by the specified configuration setting. The storage + account may be the well-known development storage account, or a Windows Azure storage account in the cloud. + + + See Configuring Connection Strings for more information + about how to construct a connection string to a storage account. + + + This method also registers for notification of changes to configuration settings. + If the value of the connection string is changed, the diagnostic monitor will be + automatically reconfigured to use the new connection. + + + See Configuring Connection Strings for more information + about how to construct a connection string to a storage account. + + + + + + Starts a diagnostic monitor with a user-defined initial configuration. + + The name of a configuration setting that + provides a connection string to a storage account. + A object that + provides a custom initial configuration. + A object. + + + This method starts a diagnostic monitor with the specified initial configuration. + Data buffers are written to the storage account indicated by the specified configuration setting. The storage + account may be the well-known development storage account, or a Windows Azure storage account in the cloud. + + + This method also registers for notification of changes to configuration settings. + If the value of the connection string is changed, the monitoring agent will be + automatically reconfigured to use the new connection. + + + See Configuring Connection Strings for more information + about how to construct a connection string to a storage account. + + + + + + Starts a diagnostic monitor with an explicitly supplied storage connection string and initial configuration. + + The connection string to a storage account. + A object that + provides a custom initial configuration. + A object. + + + This method starts a diagnostic monitor with the specified initial configuration. + Data buffers are written to the storage account indicated by the connection string. The storage + account may be the well-known development storage account, or a Windows Azure storage account in the cloud. + + + See Configuring Connection Strings for more information + about how to construct a connection string to a storage account. + + + + + + Updates the storage account information for the current diagnostic monitor. + + Storage account connection string. + + + + Stops the diagnostic monitor. + + + + + Specifies that the diagnostic monitor may use non-secure (HTTP) connections to + communicate with the storage account. + + + true if [allow insecure remote connections]; otherwise, false. + + + + This property should be set to true only in debugging + scenarios. In a production environment, the default connection used by the diagnostic monitor is secure (HTTPS). + When the diagnostic monitor is configured to use the development storage account, this property is ignored. + + + + + + Gets the local directory where state information for the diagnostic monitor is stored. + + + + + Represents the application crash dumps. + + + + + Enables collection of application crash dumps (mini dumps or full dumps) for this process. + + if set to true [enable full dumps]; if false, collect mini dumps only. + + + When you enable collection of crash dumps with this method, crash dumps are written to the crash dumps + directory (named "CrashDumps") in the default diagnostic store. The default diagnostic store is a local + resource that is automatically configured for the role and is named "DiagnosticStore". + You can retrieve the default diagnostic store by calling the + method. + + + + + + Enables collection of crash dumps (mini dumps or full dumps) for this process to a specified local directory. + + The absolute path to the local directory. + if set to true [enable full dumps]; if false, collect mini dumps only. + + + + Provides a class for managing the configuration of diagnostic monitors remotely. + + + + + Creates a new instance of the class. + + A connection string for a storage account. + The deployment ID. + + + See Configuring Connection Strings for more information + about how to construct a connection string to a storage account. + + + + + + Lists the set of roles which have successfully started at least one diagnostic monitor. + + A list of role names. + This method does not return a list of all roles in a deployment, but only the roles for which there is currently at least + once instance running a diagnostic monitor. + + + + Returns a list of IDs of active role instances that have a diagnostic monitor running. + + The name of the role. + A list of role instance IDs. + + + + Returns the list of role instance diagnostic managers for the specified role. + + The name of the role. + A list of objects. + + + + Returns the for the specified role instance. + + The name of the role. + The role instance ID. + A object. + + + + Specifies that the deployment diagnostic manager may use non-secure (HTTP) connections to + communicate with the storage account. + + + true if [allow insecure remote connections]; otherwise, false. + + + + This property should be set to true only in debugging + scenarios. In a production environment, the default connection used by the deployment diagnostic manager is secure (HTTPS). + When the deployment diagnostic manager is configured to use the development storage account, this property is ignored. + + + + + + Specifies options for an on-demand transfer. + + + + + Gets or sets the start of the time window for which event data is to be transferred. + + + + + Gets or sets the end of the time window for which event data is to be transferred. + + + + + Gets or sets the filter level for event data that has been logged with level information. + + + If the logging level is set to LogLevel.Undefined, all data is transferred regardless of logging level. + + + + + Gets or sets the name of the queue where transfer completion notification can optionally be sent. + + + + + Class for remotely mananging the configruation and diagnostic data for a given role instnace. + + + + + Initializes a new instance of the class. + + Storage account connection string. + The deployment ID. + The name of the role. + The role instance ID. + + + + Gets the current diagnostic monitor configuration. + + A object. + + + + Sets the configuration for the diagnostic monitor. + + A object representing the new configuration. + + Setting the current configuration while on-demand transfers are pending results in an error. + + + + + Returns the set of active transfers, with associated transfer information. + + A Dictionary of data buffers and their associated on-demand transfer information. + + + + Begins an on-demand transfer of the specified data buffer. + + The name of the source buffer. + A request ID identifying the transfer. + + + + Begins an on-demand transfer of the specified data buffer. + + The name of the source buffer. + Options for the on-demand transfer. + A request ID identifying the transfer. + + + + Cancel all on-demand transfers that are currently in progress, returning the request ID for each transfer. + + Name of the data buffer. + A list of request IDs for the on-demand transfers that are in progress. + Currently there can be at most one active transfer per data buffer. + + + + Stops an on-demand transfer based on its request ID. + + The request ID. + + A boolean indicating whether the on-demand transfer was stopped. This method + may return false if the there is no active tranfer with the given request ID. + + + + + Specifies that the role instance diagnostic manager may use non-secure (HTTP) connections to + communicate with the storage account. + + + true if [allow insecure remote connections]; otherwise, false. + + + + This property should be set to true only in debugging + scenarios. In a production environment, the default connection used by the role instance diagnostic manager is secure (HTTPS). + When the role instance diagnostic manager is configured to use the development storage account, this property is ignored. + + + + + + Gets the deployment ID of this role instance. + + + + + Gets the name of the role for this role instance. + + + + + Gets the ID of this role instance. + + + + + Represents the trace listener used for basic Windows Azure logs. + + + + + Constructor for the class. + + + + + Releases the unmanaged resources used by the and optionally releases the managed resources. + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + When overridden in a derived class, writes the specified message to the listener you create in the derived class. + + The message to write. + + + + When overridden in a derived class, writes a message to the listener you create in the derived class, followed by a line terminator. + + A message to write. + + + + Writes trace and event information to the listener specific output. + + A object that contains the current process ID, thread ID, and stack trace information. + A name used to identify the output, typically the name of the application that generated the trace event. + One of the values specifying the type of event that has caused the trace. + A numeric identifier for the event. + + + + + + + + Writes trace information, a message, and event information to the listener specific output. + + A object that contains the current process ID, thread ID, and stack trace information. + A name used to identify the output, typically the name of the application that generated the trace event. + One of the values specifying the type of event that has caused the trace. + A numeric identifier for the event. + A message to write. + + + + + + + + Writes trace information, a formatted array of objects and event information to the listener specific output. + + A object that contains the current process ID, thread ID, and stack trace information. + A name used to identify the output, typically the name of the application that generated the trace event. + One of the values specifying the type of event that has caused the trace. + A numeric identifier for the event. + A format string that contains zero or more format items, which correspond to objects in the array. + An object array containing zero or more objects to format. + + + + + + + + Writes trace information, an array of data objects and event information to the listener specific output. + + A object that contains the current process ID, thread ID, and stack trace information. + A name used to identify the output, typically the name of the application that generated the trace event. + One of the values specifying the type of event that has caused the trace. + A numeric identifier for the event. + An array of objects to emit as data. + + + + + + + + Writes trace information, a data object and event information to the listener specific output. + + A object that contains the current process ID, thread ID, and stack trace information. + A name used to identify the output, typically the name of the application that generated the trace event. + One of the values specifying the type of event that has caused the trace. + A numeric identifier for the event. + The trace data to emit. + + + + + + + + Indicates whether the diagnostic monitor trace listener is thread-safe. + + + + diff --git a/src/Orchard.4.5.resharper b/src/Orchard.4.5.resharper index 863e0ddeeb4..ccc935b6f13 100644 --- a/src/Orchard.4.5.resharper +++ b/src/Orchard.4.5.resharper @@ -1,90 +1,90 @@ - - - - - SOLUTION - - - END_OF_LINE - END_OF_LINE - ALWAYS_ADD - ALWAYS_ADD - ALWAYS_ADD - ALWAYS_ADD - ALWAYS_ADD - ALWAYS_ADD - 4 - END_OF_LINE - END_OF_LINE - - public - protected - internal - private - new - abstract - virtual - override - sealed - static - readonly - extern - unsafe - volatile - - END_OF_LINE - END_OF_LINE - - - - - - - - - - - - - - - - - - - - - - - - - - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + SOLUTION + + + END_OF_LINE + END_OF_LINE + ALWAYS_ADD + ALWAYS_ADD + ALWAYS_ADD + ALWAYS_ADD + ALWAYS_ADD + ALWAYS_ADD + 4 + END_OF_LINE + END_OF_LINE + + public + protected + internal + private + new + abstract + virtual + override + sealed + static + readonly + extern + unsafe + volatile + + END_OF_LINE + END_OF_LINE + + + + + + + + + + + + + + + + + + + + + + + + + + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Orchard.5.0.ReSharper b/src/Orchard.5.0.ReSharper index 470d2dcf237..3e79278c4e3 100644 --- a/src/Orchard.5.0.ReSharper +++ b/src/Orchard.5.0.ReSharper @@ -1,108 +1,108 @@ - - - - - SOLUTION - - - False - False - False - END_OF_LINE - END_OF_LINE - TOGETHER - ALWAYS_ADD - ALWAYS_ADD - ALWAYS_ADD - ALWAYS_ADD - ALWAYS_ADD - ALWAYS_ADD - END_OF_LINE - END_OF_LINE - - public - protected - internal - private - new - abstract - virtual - override - sealed - static - readonly - extern - unsafe - volatile - - END_OF_LINE - END_OF_LINE - False - - - - $object$_On$event$ - $event$Handler - - - - - - - - - - - - - - - - - - - - - - - - - $object$_On$event$ - $event$Handler - - - - - - - - - - - - - - $object$_On$event$ - $event$Handler - - - - - - - - - - - - - - - - - - - - - + + + + + SOLUTION + + + False + False + False + END_OF_LINE + END_OF_LINE + TOGETHER + ALWAYS_ADD + ALWAYS_ADD + ALWAYS_ADD + ALWAYS_ADD + ALWAYS_ADD + ALWAYS_ADD + END_OF_LINE + END_OF_LINE + + public + protected + internal + private + new + abstract + virtual + override + sealed + static + readonly + extern + unsafe + volatile + + END_OF_LINE + END_OF_LINE + False + + + + $object$_On$event$ + $event$Handler + + + + + + + + + + + + + + + + + + + + + + + + + $object$_On$event$ + $event$Handler + + + + + + + + + + + + + + $object$_On$event$ + $event$Handler + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Azure.Tests/App.config b/src/Orchard.Azure.Tests/App.config index ba89594a46e..2914f4609c1 100644 --- a/src/Orchard.Azure.Tests/App.config +++ b/src/Orchard.Azure.Tests/App.config @@ -1,12 +1,12 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/src/Orchard.Azure.Tests/AzureVirtualEnvironmentTest.cs b/src/Orchard.Azure.Tests/AzureVirtualEnvironmentTest.cs index 329b0d3b235..e53c2c02cc1 100644 --- a/src/Orchard.Azure.Tests/AzureVirtualEnvironmentTest.cs +++ b/src/Orchard.Azure.Tests/AzureVirtualEnvironmentTest.cs @@ -1,66 +1,66 @@ -using System.Configuration; -using System.Diagnostics; -using System.IO; -using Microsoft.WindowsAzure; -using Microsoft.WindowsAzure.StorageClient; -using NUnit.Framework; - -namespace Orchard.Azure.Tests { - public abstract class AzureVirtualEnvironmentTest { - private Process _dsService; - - protected abstract void OnInit(); - - [TestFixtureSetUp] - public void FixtureSetup() { - var count = Process.GetProcessesByName("DSService").Length; - if ( count == 0 ) { - var start = new ProcessStartInfo { - Arguments = "/devstore:start", - FileName = Path.Combine(ConfigurationManager.AppSettings["AzureSDK"], @"emulator\csrun.exe") - }; - - _dsService = new Process { StartInfo = start }; - _dsService.Start(); - _dsService.WaitForExit(); - } - - OnInit(); - } - - [TestFixtureTearDown] - public void FixtureTearDown() { - - if ( _dsService != null ) - _dsService.Close(); - } - - protected void DeleteAllBlobs(string containerName, CloudStorageAccount account) - { - var blobClient = account.CreateCloudBlobClient(); - var container = blobClient.GetContainerReference(containerName); - - foreach ( var blob in container.ListBlobs() ) { - if ( blob is CloudBlob ) { - ( (CloudBlob)blob ).DeleteIfExists(); - } - - if ( blob is CloudBlobDirectory ) { - DeleteAllBlobs((CloudBlobDirectory)blob); - } - } - } - - private static void DeleteAllBlobs(CloudBlobDirectory cloudBlobDirectory) { - foreach ( var blob in cloudBlobDirectory.ListBlobs() ) { - if ( blob is CloudBlob ) { - ( (CloudBlob)blob ).DeleteIfExists(); - } - - if ( blob is CloudBlobDirectory ) { - DeleteAllBlobs((CloudBlobDirectory)blob); - } - } - } - } -} +using System.Configuration; +using System.Diagnostics; +using System.IO; +using Microsoft.WindowsAzure; +using Microsoft.WindowsAzure.StorageClient; +using NUnit.Framework; + +namespace Orchard.Azure.Tests { + public abstract class AzureVirtualEnvironmentTest { + private Process _dsService; + + protected abstract void OnInit(); + + [TestFixtureSetUp] + public void FixtureSetup() { + var count = Process.GetProcessesByName("DSService").Length; + if ( count == 0 ) { + var start = new ProcessStartInfo { + Arguments = "/devstore:start", + FileName = Path.Combine(ConfigurationManager.AppSettings["AzureSDK"], @"emulator\csrun.exe") + }; + + _dsService = new Process { StartInfo = start }; + _dsService.Start(); + _dsService.WaitForExit(); + } + + OnInit(); + } + + [TestFixtureTearDown] + public void FixtureTearDown() { + + if ( _dsService != null ) + _dsService.Close(); + } + + protected void DeleteAllBlobs(string containerName, CloudStorageAccount account) + { + var blobClient = account.CreateCloudBlobClient(); + var container = blobClient.GetContainerReference(containerName); + + foreach ( var blob in container.ListBlobs() ) { + if ( blob is CloudBlob ) { + ( (CloudBlob)blob ).DeleteIfExists(); + } + + if ( blob is CloudBlobDirectory ) { + DeleteAllBlobs((CloudBlobDirectory)blob); + } + } + } + + private static void DeleteAllBlobs(CloudBlobDirectory cloudBlobDirectory) { + foreach ( var blob in cloudBlobDirectory.ListBlobs() ) { + if ( blob is CloudBlob ) { + ( (CloudBlob)blob ).DeleteIfExists(); + } + + if ( blob is CloudBlobDirectory ) { + DeleteAllBlobs((CloudBlobDirectory)blob); + } + } + } + } +} diff --git a/src/Orchard.Azure.Tests/Environment/Configuration/AzureShellSettingsManagerTests.cs b/src/Orchard.Azure.Tests/Environment/Configuration/AzureShellSettingsManagerTests.cs index b4fd623a5cf..b23e6d22d48 100644 --- a/src/Orchard.Azure.Tests/Environment/Configuration/AzureShellSettingsManagerTests.cs +++ b/src/Orchard.Azure.Tests/Environment/Configuration/AzureShellSettingsManagerTests.cs @@ -1,101 +1,101 @@ -using System.Linq; -using Microsoft.WindowsAzure; -using NUnit.Framework; -using Orchard.Azure.Services.Environment.Configuration; -using Orchard.Environment.Configuration; -using Orchard.FileSystems.Media; - -namespace Orchard.Azure.Tests.Environment.Configuration { - [TestFixture] - public class AzureShellSettingsManagerTests : AzureVirtualEnvironmentTest { - - protected CloudStorageAccount DevAccount; - protected IShellSettingsManager ShellSettingsManager; - - protected override void OnInit() { - - CloudStorageAccount.TryParse("UseDevelopmentStorage=true", out DevAccount); - ShellSettingsManager = new AzureBlobShellSettingsManager(new Moq.Mock().Object, new Moq.Mock().Object); - } - - [SetUp] - public void Setup() { - // ensure default container is empty before running any test - DeleteAllBlobs(Constants.ShellSettingsContainerName, DevAccount); - } - - [TearDown] - public void TearDown() { - // ensure default container is empty after running tests - DeleteAllBlobs(Constants.ShellSettingsContainerName, DevAccount); - } - - [Test] - public void SingleSettingsFileShouldComeBackAsExpected() { - - ShellSettingsManager.SaveSettings(new ShellSettings { Name = "Default", DataProvider = "SQLCe", DataConnectionString = "something else" }); - - var settings = ShellSettingsManager.LoadSettings().Single(); - Assert.That(settings, Is.Not.Null); - Assert.That(settings.Name, Is.EqualTo("Default")); - Assert.That(settings.DataProvider, Is.EqualTo("SQLCe")); - Assert.That(settings.DataConnectionString, Is.EqualTo("something else")); - } - - [Test] - public void SettingsShouldBeOverwritable() { - ShellSettingsManager.SaveSettings(new ShellSettings { Name = "Default", DataProvider = "SQLCe", DataConnectionString = "something else" }); - ShellSettingsManager.SaveSettings(new ShellSettings { Name = "Default", DataProvider = "SQLCe2", DataConnectionString = "something else2" }); - - var settings = ShellSettingsManager.LoadSettings().Single(); - Assert.That(settings, Is.Not.Null); - Assert.That(settings.Name, Is.EqualTo("Default")); - Assert.That(settings.DataProvider, Is.EqualTo("SQLCe2")); - Assert.That(settings.DataConnectionString, Is.EqualTo("something else2")); - } - - [Test] - public void MultipleFilesCanBeDetected() { - - ShellSettingsManager.SaveSettings(new ShellSettings { Name = "Default", DataProvider = "SQLCe", DataConnectionString = "something else" }); - ShellSettingsManager.SaveSettings(new ShellSettings { Name = "Another", DataProvider = "SQLCe2", DataConnectionString = "something else2" }); - - var settings = ShellSettingsManager.LoadSettings(); - Assert.That(settings.Count(), Is.EqualTo(2)); - - var def = settings.Single(x => x.Name == "Default"); - Assert.That(def.Name, Is.EqualTo("Default")); - Assert.That(def.DataProvider, Is.EqualTo("SQLCe")); - Assert.That(def.DataConnectionString, Is.EqualTo("something else")); - - var alt = settings.Single(x => x.Name == "Another"); - Assert.That(alt.Name, Is.EqualTo("Another")); - Assert.That(alt.DataProvider, Is.EqualTo("SQLCe2")); - Assert.That(alt.DataConnectionString, Is.EqualTo("something else2")); - } - - [Test] - public void NewSettingsCanBeStored() { - ShellSettingsManager.SaveSettings(new ShellSettings { Name = "Default", DataProvider = "SQLite", DataConnectionString = "something else" }); - - var foo = new ShellSettings { Name = "Foo", DataProvider = "Bar", DataConnectionString = "Quux" }; - - Assert.That(ShellSettingsManager.LoadSettings().Count(), Is.EqualTo(1)); - ShellSettingsManager.SaveSettings(foo); - Assert.That(ShellSettingsManager.LoadSettings().Count(), Is.EqualTo(2)); - - foo = ShellSettingsManager.LoadSettings().Where(s => s.Name == "Foo").Single(); - Assert.That(foo.Name, Is.StringContaining("Foo")); - Assert.That(foo.DataProvider, Is.StringContaining("Bar")); - Assert.That(foo.DataConnectionString, Is.StringContaining("Quux")); - } - - [Test] - public void SettingsCanContainSeparatorChar() { - ShellSettingsManager.SaveSettings(new ShellSettings { Name = "Default", DataProvider = "SQLite", DataConnectionString = "Server=tcp:tjyptm5sfc.database.windows.net;Database=orchard;User ID=foo@bar;Password=foo;Trusted_Connection=False;Encrypt=True;" }); - - var settings = ShellSettingsManager.LoadSettings().Where(s => s.Name == "Default").Single(); - Assert.That(settings.DataConnectionString, Is.EqualTo("Server=tcp:tjyptm5sfc.database.windows.net;Database=orchard;User ID=foo@bar;Password=foo;Trusted_Connection=False;Encrypt=True;")); - } - } -} +using System.Linq; +using Microsoft.WindowsAzure; +using NUnit.Framework; +using Orchard.Azure.Services.Environment.Configuration; +using Orchard.Environment.Configuration; +using Orchard.FileSystems.Media; + +namespace Orchard.Azure.Tests.Environment.Configuration { + [TestFixture] + public class AzureShellSettingsManagerTests : AzureVirtualEnvironmentTest { + + protected CloudStorageAccount DevAccount; + protected IShellSettingsManager ShellSettingsManager; + + protected override void OnInit() { + + CloudStorageAccount.TryParse("UseDevelopmentStorage=true", out DevAccount); + ShellSettingsManager = new AzureBlobShellSettingsManager(new Moq.Mock().Object, new Moq.Mock().Object); + } + + [SetUp] + public void Setup() { + // ensure default container is empty before running any test + DeleteAllBlobs(Constants.ShellSettingsContainerName, DevAccount); + } + + [TearDown] + public void TearDown() { + // ensure default container is empty after running tests + DeleteAllBlobs(Constants.ShellSettingsContainerName, DevAccount); + } + + [Test] + public void SingleSettingsFileShouldComeBackAsExpected() { + + ShellSettingsManager.SaveSettings(new ShellSettings { Name = "Default", DataProvider = "SQLCe", DataConnectionString = "something else" }); + + var settings = ShellSettingsManager.LoadSettings().Single(); + Assert.That(settings, Is.Not.Null); + Assert.That(settings.Name, Is.EqualTo("Default")); + Assert.That(settings.DataProvider, Is.EqualTo("SQLCe")); + Assert.That(settings.DataConnectionString, Is.EqualTo("something else")); + } + + [Test] + public void SettingsShouldBeOverwritable() { + ShellSettingsManager.SaveSettings(new ShellSettings { Name = "Default", DataProvider = "SQLCe", DataConnectionString = "something else" }); + ShellSettingsManager.SaveSettings(new ShellSettings { Name = "Default", DataProvider = "SQLCe2", DataConnectionString = "something else2" }); + + var settings = ShellSettingsManager.LoadSettings().Single(); + Assert.That(settings, Is.Not.Null); + Assert.That(settings.Name, Is.EqualTo("Default")); + Assert.That(settings.DataProvider, Is.EqualTo("SQLCe2")); + Assert.That(settings.DataConnectionString, Is.EqualTo("something else2")); + } + + [Test] + public void MultipleFilesCanBeDetected() { + + ShellSettingsManager.SaveSettings(new ShellSettings { Name = "Default", DataProvider = "SQLCe", DataConnectionString = "something else" }); + ShellSettingsManager.SaveSettings(new ShellSettings { Name = "Another", DataProvider = "SQLCe2", DataConnectionString = "something else2" }); + + var settings = ShellSettingsManager.LoadSettings(); + Assert.That(settings.Count(), Is.EqualTo(2)); + + var def = settings.Single(x => x.Name == "Default"); + Assert.That(def.Name, Is.EqualTo("Default")); + Assert.That(def.DataProvider, Is.EqualTo("SQLCe")); + Assert.That(def.DataConnectionString, Is.EqualTo("something else")); + + var alt = settings.Single(x => x.Name == "Another"); + Assert.That(alt.Name, Is.EqualTo("Another")); + Assert.That(alt.DataProvider, Is.EqualTo("SQLCe2")); + Assert.That(alt.DataConnectionString, Is.EqualTo("something else2")); + } + + [Test] + public void NewSettingsCanBeStored() { + ShellSettingsManager.SaveSettings(new ShellSettings { Name = "Default", DataProvider = "SQLite", DataConnectionString = "something else" }); + + var foo = new ShellSettings { Name = "Foo", DataProvider = "Bar", DataConnectionString = "Quux" }; + + Assert.That(ShellSettingsManager.LoadSettings().Count(), Is.EqualTo(1)); + ShellSettingsManager.SaveSettings(foo); + Assert.That(ShellSettingsManager.LoadSettings().Count(), Is.EqualTo(2)); + + foo = ShellSettingsManager.LoadSettings().Where(s => s.Name == "Foo").Single(); + Assert.That(foo.Name, Is.StringContaining("Foo")); + Assert.That(foo.DataProvider, Is.StringContaining("Bar")); + Assert.That(foo.DataConnectionString, Is.StringContaining("Quux")); + } + + [Test] + public void SettingsCanContainSeparatorChar() { + ShellSettingsManager.SaveSettings(new ShellSettings { Name = "Default", DataProvider = "SQLite", DataConnectionString = "Server=tcp:tjyptm5sfc.database.windows.net;Database=orchard;User ID=foo@bar;Password=foo;Trusted_Connection=False;Encrypt=True;" }); + + var settings = ShellSettingsManager.LoadSettings().Where(s => s.Name == "Default").Single(); + Assert.That(settings.DataConnectionString, Is.EqualTo("Server=tcp:tjyptm5sfc.database.windows.net;Database=orchard;User ID=foo@bar;Password=foo;Trusted_Connection=False;Encrypt=True;")); + } + } +} diff --git a/src/Orchard.Azure.Tests/FileSystems/Media/AzureBlobStorageProviderTests.cs b/src/Orchard.Azure.Tests/FileSystems/Media/AzureBlobStorageProviderTests.cs index 321a4c5671a..dd1b05288f6 100644 --- a/src/Orchard.Azure.Tests/FileSystems/Media/AzureBlobStorageProviderTests.cs +++ b/src/Orchard.Azure.Tests/FileSystems/Media/AzureBlobStorageProviderTests.cs @@ -1,298 +1,298 @@ -using System; -using System.IO; -using System.Web; -using NUnit.Framework; -using Microsoft.WindowsAzure; -using System.Linq; -using Orchard.Caching; -using Orchard.Environment.Configuration; -using Orchard.Azure.Services.FileSystems.Media; -using Orchard.FileSystems.Media; - -namespace Orchard.Azure.Tests.FileSystems.Media { - [TestFixture] - public class AzureBlobStorageProviderTests : AzureVirtualEnvironmentTest { - - CloudStorageAccount _devAccount; - private AzureBlobStorageProvider _azureBlobStorageProvider; - - protected override void OnInit() { - CloudStorageAccount.TryParse("UseDevelopmentStorage=true", out _devAccount); - - _azureBlobStorageProvider = new AzureBlobStorageProvider(new ShellSettings { Name = "default" }, new ConfigurationMimeTypeProvider(new DefaultCacheManager(typeof(ConfigurationMimeTypeProvider), new DefaultCacheHolder(new DefaultCacheContextAccessor())))); - } - - [SetUp] - public void Setup() { - // ensure default container is empty before running any test - DeleteAllBlobs(_azureBlobStorageProvider.Container.Name, _devAccount); - } - - [Test] - [ExpectedException(typeof(ArgumentException))] - public void GetFileShouldOnlyAcceptRelativePath() { - _azureBlobStorageProvider.CreateFile("foo.txt"); - _azureBlobStorageProvider.GetFile("/foot.txt"); - } - - [Test] - [ExpectedException(typeof(ArgumentException))] - public void GetFileThatDoesNotExistShouldThrow() { - _azureBlobStorageProvider.GetFile("notexisting"); - } - - [Test] - [ExpectedException(typeof(ArgumentException))] - public void DeleteFileThatDoesNotExistShouldThrow() { - _azureBlobStorageProvider.DeleteFile("notexisting"); - } - - [Test] - public void RootFolderAreNotCropped() { - _azureBlobStorageProvider.CreateFolder("default"); - _azureBlobStorageProvider.CreateFolder("foo"); - - var folders = _azureBlobStorageProvider.ListFolders(""); - - Assert.That(folders.Count(), Is.EqualTo(2)); - Assert.That(folders.Any(f => f.GetName() == "default"), Is.True); - Assert.That(folders.Any(f => f.GetName() == "foo"), Is.True); - } - - [Test] - public void CreateFileShouldReturnCorrectStorageFile() { - var storageFile = _azureBlobStorageProvider.CreateFile("foo.txt"); - - Assert.AreEqual(".txt", storageFile.GetFileType()); - Assert.AreEqual("foo.txt", storageFile.GetName()); - Assert.AreEqual("foo.txt", storageFile.GetPath()); - Assert.AreEqual(0, storageFile.GetSize()); - } - - [Test] - [ExpectedException(typeof(ArgumentException))] - public void CreateFileShouldThrowAnExceptionIfAlreadyExisting() { - var storageFile = _azureBlobStorageProvider.CreateFile("foo.txt"); - Assert.AreEqual(storageFile.GetSize(), 0); - - _azureBlobStorageProvider.CreateFile("foo.txt"); - } - - [Test] - public void RenameFileShouldCreateANewFileAndRemoveTheOld() { - _azureBlobStorageProvider.CreateFile("foo1.txt"); - _azureBlobStorageProvider.RenameFile("foo1.txt", "foo2.txt"); - - var files = _azureBlobStorageProvider.ListFiles(""); - - Assert.AreEqual(1, files.Count()); - Assert.That(files.First().GetPath().Equals("foo2.txt"), Is.True); - Assert.That(files.First().GetName().Equals("foo2.txt"), Is.True); - } - - [Test] - public void CreateFileShouldBeFolderAgnostic() { - _azureBlobStorageProvider.CreateFile("foo.txt"); - _azureBlobStorageProvider.CreateFile("folder/foo.txt"); - _azureBlobStorageProvider.CreateFile("folder/folder/foo.txt"); - - Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("").Count()); - Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder").Count()); - Assert.AreEqual("folder/foo.txt", _azureBlobStorageProvider.ListFiles("folder").First().GetPath()); - Assert.AreEqual("foo.txt", _azureBlobStorageProvider.ListFiles("folder").First().GetName()); - Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder/folder").Count()); - Assert.AreEqual("folder/folder/foo.txt", _azureBlobStorageProvider.ListFiles("folder/folder").First().GetPath()); - Assert.AreEqual("foo.txt", _azureBlobStorageProvider.ListFiles("folder/folder").First().GetName()); - } - - [Test] - [ExpectedException(typeof(ArgumentException))] - public void CreateFolderThatExistsShouldThrow() { - _azureBlobStorageProvider.CreateFile("folder/foo.txt"); - _azureBlobStorageProvider.CreateFolder("folder"); - } - - [Test] - public void ListFolderShouldAcceptNullPath() { - _azureBlobStorageProvider.CreateFolder("folder"); - Assert.AreEqual(1, _azureBlobStorageProvider.ListFolders(null).Count()); - Assert.AreEqual("folder", _azureBlobStorageProvider.ListFolders(null).First().GetName()); - Assert.AreEqual("folder", _azureBlobStorageProvider.ListFolders(null).First().GetPath()); - } - - [Test] - public void CreateFolderWithSubFolder() { - _azureBlobStorageProvider.CreateFolder("folder"); - Assert.AreEqual(0, _azureBlobStorageProvider.ListFolders("folder").Count()); - - _azureBlobStorageProvider.CreateFolder("folder/folder"); - Assert.AreEqual(1, _azureBlobStorageProvider.ListFolders("folder").Count()); - Assert.AreEqual(0, _azureBlobStorageProvider.ListFiles("folder/folder").Count()); - Assert.AreEqual("folder", _azureBlobStorageProvider.ListFolders("folder").First().GetName()); - } - - [Test] - public void FoldersShouldBeCreatedRecursively() { - _azureBlobStorageProvider.CreateFolder("foo/bar/baz"); - Assert.That(_azureBlobStorageProvider.ListFolders("").Count(), Is.EqualTo(1)); - Assert.That(_azureBlobStorageProvider.ListFolders("foo").Count(), Is.EqualTo(1)); - Assert.That(_azureBlobStorageProvider.ListFolders("foo/bar").Count(), Is.EqualTo(1)); - } - - [Test] - public void ShouldDeleteFiles() { - _azureBlobStorageProvider.CreateFile("folder/foo1.txt"); - _azureBlobStorageProvider.CreateFile("folder/foo2.txt"); - _azureBlobStorageProvider.CreateFile("folder/folder/foo1.txt"); - _azureBlobStorageProvider.CreateFile("folder/folder/foo2.txt"); - - Assert.That(_azureBlobStorageProvider.ListFiles("folder").Count(), Is.EqualTo(2)); - Assert.That(_azureBlobStorageProvider.ListFiles("folder/folder").Count(), Is.EqualTo(2)); - - _azureBlobStorageProvider.DeleteFile("folder/foo1.txt"); - _azureBlobStorageProvider.DeleteFile("folder/folder/foo2.txt"); - - Assert.That(_azureBlobStorageProvider.ListFiles("folder").Count(), Is.EqualTo(1)); - Assert.That(_azureBlobStorageProvider.ListFiles("folder/folder").Count(), Is.EqualTo(1)); - } - - [Test] - public void DeleteFolderShouldDeleteFilesAlso() { - _azureBlobStorageProvider.CreateFile("folder/foo1.txt"); - _azureBlobStorageProvider.CreateFile("folder/foo2.txt"); - _azureBlobStorageProvider.CreateFile("folder/folder/foo1.txt"); - _azureBlobStorageProvider.CreateFile("folder/folder/foo2.txt"); - - Assert.AreEqual(2, _azureBlobStorageProvider.ListFiles("folder").Count()); - Assert.AreEqual(2, _azureBlobStorageProvider.ListFiles("folder/folder").Count()); - - _azureBlobStorageProvider.DeleteFolder("folder"); - - Assert.AreEqual(0, _azureBlobStorageProvider.ListFiles("folder").Count()); - Assert.AreEqual(0, _azureBlobStorageProvider.ListFiles("folder/folder").Count()); - } - - [Test] - public void ShouldRenameFolders() { - _azureBlobStorageProvider.CreateFile("folder1/foo.txt"); - _azureBlobStorageProvider.CreateFile("folder2/foo.txt"); - _azureBlobStorageProvider.CreateFile("folder1/folder2/foo.txt"); - _azureBlobStorageProvider.CreateFile("folder1/folder2/folder3/foo.txt"); - - Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder1").Count()); - Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder2").Count()); - Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder1/folder2").Count()); - Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder1/folder2/folder3").Count()); - - _azureBlobStorageProvider.RenameFolder("folder1/folder2", "folder1/folder4"); - - Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder1").Count()); - Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder2").Count()); - Assert.AreEqual(0, _azureBlobStorageProvider.ListFiles("folder1/folder2").Count()); - Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder1/folder4").Count()); - Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder1/folder4/folder3").Count()); - } - - [Test] - [ExpectedException(typeof(ArgumentException))] - public void CannotCreateAlreadyExistingFolders() { - _azureBlobStorageProvider.CreateFile("folder1/foo.txt"); - _azureBlobStorageProvider.CreateFolder("folder1"); - } - - [Test] - public void TryCreateFolderShouldReturnFalseIfFolderAlreadyExists() { - _azureBlobStorageProvider.CreateFile("folder1/foo.txt"); - Assert.That(_azureBlobStorageProvider.TryCreateFolder("folder1"), Is.False); - } - - [Test] - public void ShouldReadWriteFiles() { - const string teststring = "This is a test string."; - - var foo = _azureBlobStorageProvider.CreateFile("folder1/foo.txt"); - - using ( var stream = foo.OpenWrite() ) - using ( var writer = new StreamWriter(stream) ) - writer.Write(teststring); - - string content; - using ( var stream = foo.OpenRead() ) - using ( var reader = new StreamReader(stream) ) { - content = reader.ReadToEnd(); - } - - Assert.AreEqual(teststring, content); - } - - [Test] - public void ShouldTruncateFile() { - var sf = _azureBlobStorageProvider.CreateFile("folder/foo1.txt"); - using (var sw = new StreamWriter(sf.OpenWrite())) { - sw.Write("foo"); - } - - using (var sw = new StreamWriter(sf.CreateFile())) { - sw.Write("fo"); - } - - sf = _azureBlobStorageProvider.GetFile("folder/foo1.txt"); - string content; - using (var sr = new StreamReader(sf.OpenRead())) { - content = sr.ReadToEnd(); - } - - Assert.That(content, Is.EqualTo("fo")); - } - - [Test] - public void HttpContextWeaverShouldBeDisposed() - { - _azureBlobStorageProvider.CreateFile("foo1.txt"); - _azureBlobStorageProvider.CreateFile("foo2.txt"); - _azureBlobStorageProvider.CreateFile("foo3.txt"); - - foreach(var f in _azureBlobStorageProvider.ListFiles("")) - { - Assert.That(HttpContext.Current, Is.Null); - } - } - - [Test] - public void MimeTypeShouldBeSet() { - _azureBlobStorageProvider.CreateFile("foo1.txt"); - var file = _azureBlobStorageProvider.Container.GetBlockBlobReference("default/foo1.txt"); - file.FetchAttributes(); - Assert.That(file.Properties.ContentType, Is.EqualTo("text/plain")); - } - - [Test] - public void UnknownMimeTypeShouldBeAssigned() { - _azureBlobStorageProvider.CreateFile("foo1.xyz"); - var file = _azureBlobStorageProvider.Container.GetBlockBlobReference("default/foo1.xyz"); - file.FetchAttributes(); - Assert.That(file.Properties.ContentType, Is.EqualTo("application/unknown")); - } - - - [Test] - public void GetStoragePathShouldReturnAValidLocalPath() - { - _azureBlobStorageProvider.CreateFile("folder1/foo.txt"); - var publicPath = _azureBlobStorageProvider.GetPublicUrl("folder1/foo.txt"); - var storagePath = _azureBlobStorageProvider.GetStoragePath(publicPath); - - Assert.IsNotNull(storagePath); - Assert.That(storagePath, Is.EqualTo("folder1/foo.txt")); - } - - [Test] - public void GetStoragePathShouldReturnNullIfPathIsNotLocal() - { - var storagePath = _azureBlobStorageProvider.GetStoragePath("foo"); - - Assert.IsNull(storagePath); - } - - } +using System; +using System.IO; +using System.Web; +using NUnit.Framework; +using Microsoft.WindowsAzure; +using System.Linq; +using Orchard.Caching; +using Orchard.Environment.Configuration; +using Orchard.Azure.Services.FileSystems.Media; +using Orchard.FileSystems.Media; + +namespace Orchard.Azure.Tests.FileSystems.Media { + [TestFixture] + public class AzureBlobStorageProviderTests : AzureVirtualEnvironmentTest { + + CloudStorageAccount _devAccount; + private AzureBlobStorageProvider _azureBlobStorageProvider; + + protected override void OnInit() { + CloudStorageAccount.TryParse("UseDevelopmentStorage=true", out _devAccount); + + _azureBlobStorageProvider = new AzureBlobStorageProvider(new ShellSettings { Name = "default" }, new ConfigurationMimeTypeProvider(new DefaultCacheManager(typeof(ConfigurationMimeTypeProvider), new DefaultCacheHolder(new DefaultCacheContextAccessor())))); + } + + [SetUp] + public void Setup() { + // ensure default container is empty before running any test + DeleteAllBlobs(_azureBlobStorageProvider.Container.Name, _devAccount); + } + + [Test] + [ExpectedException(typeof(ArgumentException))] + public void GetFileShouldOnlyAcceptRelativePath() { + _azureBlobStorageProvider.CreateFile("foo.txt"); + _azureBlobStorageProvider.GetFile("/foot.txt"); + } + + [Test] + [ExpectedException(typeof(ArgumentException))] + public void GetFileThatDoesNotExistShouldThrow() { + _azureBlobStorageProvider.GetFile("notexisting"); + } + + [Test] + [ExpectedException(typeof(ArgumentException))] + public void DeleteFileThatDoesNotExistShouldThrow() { + _azureBlobStorageProvider.DeleteFile("notexisting"); + } + + [Test] + public void RootFolderAreNotCropped() { + _azureBlobStorageProvider.CreateFolder("default"); + _azureBlobStorageProvider.CreateFolder("foo"); + + var folders = _azureBlobStorageProvider.ListFolders(""); + + Assert.That(folders.Count(), Is.EqualTo(2)); + Assert.That(folders.Any(f => f.GetName() == "default"), Is.True); + Assert.That(folders.Any(f => f.GetName() == "foo"), Is.True); + } + + [Test] + public void CreateFileShouldReturnCorrectStorageFile() { + var storageFile = _azureBlobStorageProvider.CreateFile("foo.txt"); + + Assert.AreEqual(".txt", storageFile.GetFileType()); + Assert.AreEqual("foo.txt", storageFile.GetName()); + Assert.AreEqual("foo.txt", storageFile.GetPath()); + Assert.AreEqual(0, storageFile.GetSize()); + } + + [Test] + [ExpectedException(typeof(ArgumentException))] + public void CreateFileShouldThrowAnExceptionIfAlreadyExisting() { + var storageFile = _azureBlobStorageProvider.CreateFile("foo.txt"); + Assert.AreEqual(storageFile.GetSize(), 0); + + _azureBlobStorageProvider.CreateFile("foo.txt"); + } + + [Test] + public void RenameFileShouldCreateANewFileAndRemoveTheOld() { + _azureBlobStorageProvider.CreateFile("foo1.txt"); + _azureBlobStorageProvider.RenameFile("foo1.txt", "foo2.txt"); + + var files = _azureBlobStorageProvider.ListFiles(""); + + Assert.AreEqual(1, files.Count()); + Assert.That(files.First().GetPath().Equals("foo2.txt"), Is.True); + Assert.That(files.First().GetName().Equals("foo2.txt"), Is.True); + } + + [Test] + public void CreateFileShouldBeFolderAgnostic() { + _azureBlobStorageProvider.CreateFile("foo.txt"); + _azureBlobStorageProvider.CreateFile("folder/foo.txt"); + _azureBlobStorageProvider.CreateFile("folder/folder/foo.txt"); + + Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("").Count()); + Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder").Count()); + Assert.AreEqual("folder/foo.txt", _azureBlobStorageProvider.ListFiles("folder").First().GetPath()); + Assert.AreEqual("foo.txt", _azureBlobStorageProvider.ListFiles("folder").First().GetName()); + Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder/folder").Count()); + Assert.AreEqual("folder/folder/foo.txt", _azureBlobStorageProvider.ListFiles("folder/folder").First().GetPath()); + Assert.AreEqual("foo.txt", _azureBlobStorageProvider.ListFiles("folder/folder").First().GetName()); + } + + [Test] + [ExpectedException(typeof(ArgumentException))] + public void CreateFolderThatExistsShouldThrow() { + _azureBlobStorageProvider.CreateFile("folder/foo.txt"); + _azureBlobStorageProvider.CreateFolder("folder"); + } + + [Test] + public void ListFolderShouldAcceptNullPath() { + _azureBlobStorageProvider.CreateFolder("folder"); + Assert.AreEqual(1, _azureBlobStorageProvider.ListFolders(null).Count()); + Assert.AreEqual("folder", _azureBlobStorageProvider.ListFolders(null).First().GetName()); + Assert.AreEqual("folder", _azureBlobStorageProvider.ListFolders(null).First().GetPath()); + } + + [Test] + public void CreateFolderWithSubFolder() { + _azureBlobStorageProvider.CreateFolder("folder"); + Assert.AreEqual(0, _azureBlobStorageProvider.ListFolders("folder").Count()); + + _azureBlobStorageProvider.CreateFolder("folder/folder"); + Assert.AreEqual(1, _azureBlobStorageProvider.ListFolders("folder").Count()); + Assert.AreEqual(0, _azureBlobStorageProvider.ListFiles("folder/folder").Count()); + Assert.AreEqual("folder", _azureBlobStorageProvider.ListFolders("folder").First().GetName()); + } + + [Test] + public void FoldersShouldBeCreatedRecursively() { + _azureBlobStorageProvider.CreateFolder("foo/bar/baz"); + Assert.That(_azureBlobStorageProvider.ListFolders("").Count(), Is.EqualTo(1)); + Assert.That(_azureBlobStorageProvider.ListFolders("foo").Count(), Is.EqualTo(1)); + Assert.That(_azureBlobStorageProvider.ListFolders("foo/bar").Count(), Is.EqualTo(1)); + } + + [Test] + public void ShouldDeleteFiles() { + _azureBlobStorageProvider.CreateFile("folder/foo1.txt"); + _azureBlobStorageProvider.CreateFile("folder/foo2.txt"); + _azureBlobStorageProvider.CreateFile("folder/folder/foo1.txt"); + _azureBlobStorageProvider.CreateFile("folder/folder/foo2.txt"); + + Assert.That(_azureBlobStorageProvider.ListFiles("folder").Count(), Is.EqualTo(2)); + Assert.That(_azureBlobStorageProvider.ListFiles("folder/folder").Count(), Is.EqualTo(2)); + + _azureBlobStorageProvider.DeleteFile("folder/foo1.txt"); + _azureBlobStorageProvider.DeleteFile("folder/folder/foo2.txt"); + + Assert.That(_azureBlobStorageProvider.ListFiles("folder").Count(), Is.EqualTo(1)); + Assert.That(_azureBlobStorageProvider.ListFiles("folder/folder").Count(), Is.EqualTo(1)); + } + + [Test] + public void DeleteFolderShouldDeleteFilesAlso() { + _azureBlobStorageProvider.CreateFile("folder/foo1.txt"); + _azureBlobStorageProvider.CreateFile("folder/foo2.txt"); + _azureBlobStorageProvider.CreateFile("folder/folder/foo1.txt"); + _azureBlobStorageProvider.CreateFile("folder/folder/foo2.txt"); + + Assert.AreEqual(2, _azureBlobStorageProvider.ListFiles("folder").Count()); + Assert.AreEqual(2, _azureBlobStorageProvider.ListFiles("folder/folder").Count()); + + _azureBlobStorageProvider.DeleteFolder("folder"); + + Assert.AreEqual(0, _azureBlobStorageProvider.ListFiles("folder").Count()); + Assert.AreEqual(0, _azureBlobStorageProvider.ListFiles("folder/folder").Count()); + } + + [Test] + public void ShouldRenameFolders() { + _azureBlobStorageProvider.CreateFile("folder1/foo.txt"); + _azureBlobStorageProvider.CreateFile("folder2/foo.txt"); + _azureBlobStorageProvider.CreateFile("folder1/folder2/foo.txt"); + _azureBlobStorageProvider.CreateFile("folder1/folder2/folder3/foo.txt"); + + Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder1").Count()); + Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder2").Count()); + Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder1/folder2").Count()); + Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder1/folder2/folder3").Count()); + + _azureBlobStorageProvider.RenameFolder("folder1/folder2", "folder1/folder4"); + + Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder1").Count()); + Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder2").Count()); + Assert.AreEqual(0, _azureBlobStorageProvider.ListFiles("folder1/folder2").Count()); + Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder1/folder4").Count()); + Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder1/folder4/folder3").Count()); + } + + [Test] + [ExpectedException(typeof(ArgumentException))] + public void CannotCreateAlreadyExistingFolders() { + _azureBlobStorageProvider.CreateFile("folder1/foo.txt"); + _azureBlobStorageProvider.CreateFolder("folder1"); + } + + [Test] + public void TryCreateFolderShouldReturnFalseIfFolderAlreadyExists() { + _azureBlobStorageProvider.CreateFile("folder1/foo.txt"); + Assert.That(_azureBlobStorageProvider.TryCreateFolder("folder1"), Is.False); + } + + [Test] + public void ShouldReadWriteFiles() { + const string teststring = "This is a test string."; + + var foo = _azureBlobStorageProvider.CreateFile("folder1/foo.txt"); + + using ( var stream = foo.OpenWrite() ) + using ( var writer = new StreamWriter(stream) ) + writer.Write(teststring); + + string content; + using ( var stream = foo.OpenRead() ) + using ( var reader = new StreamReader(stream) ) { + content = reader.ReadToEnd(); + } + + Assert.AreEqual(teststring, content); + } + + [Test] + public void ShouldTruncateFile() { + var sf = _azureBlobStorageProvider.CreateFile("folder/foo1.txt"); + using (var sw = new StreamWriter(sf.OpenWrite())) { + sw.Write("foo"); + } + + using (var sw = new StreamWriter(sf.CreateFile())) { + sw.Write("fo"); + } + + sf = _azureBlobStorageProvider.GetFile("folder/foo1.txt"); + string content; + using (var sr = new StreamReader(sf.OpenRead())) { + content = sr.ReadToEnd(); + } + + Assert.That(content, Is.EqualTo("fo")); + } + + [Test] + public void HttpContextWeaverShouldBeDisposed() + { + _azureBlobStorageProvider.CreateFile("foo1.txt"); + _azureBlobStorageProvider.CreateFile("foo2.txt"); + _azureBlobStorageProvider.CreateFile("foo3.txt"); + + foreach(var f in _azureBlobStorageProvider.ListFiles("")) + { + Assert.That(HttpContext.Current, Is.Null); + } + } + + [Test] + public void MimeTypeShouldBeSet() { + _azureBlobStorageProvider.CreateFile("foo1.txt"); + var file = _azureBlobStorageProvider.Container.GetBlockBlobReference("default/foo1.txt"); + file.FetchAttributes(); + Assert.That(file.Properties.ContentType, Is.EqualTo("text/plain")); + } + + [Test] + public void UnknownMimeTypeShouldBeAssigned() { + _azureBlobStorageProvider.CreateFile("foo1.xyz"); + var file = _azureBlobStorageProvider.Container.GetBlockBlobReference("default/foo1.xyz"); + file.FetchAttributes(); + Assert.That(file.Properties.ContentType, Is.EqualTo("application/unknown")); + } + + + [Test] + public void GetStoragePathShouldReturnAValidLocalPath() + { + _azureBlobStorageProvider.CreateFile("folder1/foo.txt"); + var publicPath = _azureBlobStorageProvider.GetPublicUrl("folder1/foo.txt"); + var storagePath = _azureBlobStorageProvider.GetStoragePath(publicPath); + + Assert.IsNotNull(storagePath); + Assert.That(storagePath, Is.EqualTo("folder1/foo.txt")); + } + + [Test] + public void GetStoragePathShouldReturnNullIfPathIsNotLocal() + { + var storagePath = _azureBlobStorageProvider.GetStoragePath("foo"); + + Assert.IsNull(storagePath); + } + + } } \ No newline at end of file diff --git a/src/Orchard.Azure.Tests/Orchard.Azure.Tests.csproj b/src/Orchard.Azure.Tests/Orchard.Azure.Tests.csproj index a9cdcf7df66..0e7ad2eb5fd 100644 --- a/src/Orchard.Azure.Tests/Orchard.Azure.Tests.csproj +++ b/src/Orchard.Azure.Tests/Orchard.Azure.Tests.csproj @@ -1,136 +1,136 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1CC62F45-E6FF-43D5-84BF-509A1085D994} - Library - Properties - Orchard.Azure.Tests - Orchard.Azure.Tests - v4.0 - 512 - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - True - - - False - ..\..\lib\windowsazure\Microsoft.WindowsAzure.Storage.dll - - - False - - - False - ..\..\lib\moq\Moq.dll - - - False - ..\..\lib\nunit\nunit.framework.dll - - - - - 3.5 - - - - 3.5 - - - 3.5 - - - - - - - - - - - - - {cbc7993c-57d8-4a6c-992c-19e849dfe71d} - Orchard.Azure - - - {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} - Orchard.Framework - - - - - Designer - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {1CC62F45-E6FF-43D5-84BF-509A1085D994} + Library + Properties + Orchard.Azure.Tests + Orchard.Azure.Tests + v4.0 + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + False + True + + + False + ..\..\lib\windowsazure\Microsoft.WindowsAzure.Storage.dll + + + False + + + False + ..\..\lib\moq\Moq.dll + + + False + ..\..\lib\nunit\nunit.framework.dll + + + + + 3.5 + + + + 3.5 + + + 3.5 + + + + + + + + + + + + + {cbc7993c-57d8-4a6c-992c-19e849dfe71d} + Orchard.Azure + + + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} + Orchard.Framework + + + + + Designer + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + \ No newline at end of file diff --git a/src/Orchard.Azure.Tests/Orchard.Azure.Tests.sln b/src/Orchard.Azure.Tests/Orchard.Azure.Tests.sln index 1f9de26d5ea..7579c678638 100644 --- a/src/Orchard.Azure.Tests/Orchard.Azure.Tests.sln +++ b/src/Orchard.Azure.Tests/Orchard.Azure.Tests.sln @@ -1,32 +1,32 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Azure.Tests", "Orchard.Azure.Tests.csproj", "{1CC62F45-E6FF-43D5-84BF-509A1085D994}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Framework", "..\Orchard\Orchard.Framework.csproj", "{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Azure", "..\Orchard.Web\Modules\Orchard.Azure\Orchard.Azure.csproj", "{CBC7993C-57D8-4A6C-992C-19E849DFE71D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1CC62F45-E6FF-43D5-84BF-509A1085D994}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1CC62F45-E6FF-43D5-84BF-509A1085D994}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1CC62F45-E6FF-43D5-84BF-509A1085D994}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1CC62F45-E6FF-43D5-84BF-509A1085D994}.Release|Any CPU.Build.0 = Release|Any CPU - {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Release|Any CPU.Build.0 = Release|Any CPU - {CBC7993C-57D8-4A6C-992C-19E849DFE71D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CBC7993C-57D8-4A6C-992C-19E849DFE71D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CBC7993C-57D8-4A6C-992C-19E849DFE71D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CBC7993C-57D8-4A6C-992C-19E849DFE71D}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Azure.Tests", "Orchard.Azure.Tests.csproj", "{1CC62F45-E6FF-43D5-84BF-509A1085D994}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Framework", "..\Orchard\Orchard.Framework.csproj", "{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Azure", "..\Orchard.Web\Modules\Orchard.Azure\Orchard.Azure.csproj", "{CBC7993C-57D8-4A6C-992C-19E849DFE71D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1CC62F45-E6FF-43D5-84BF-509A1085D994}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1CC62F45-E6FF-43D5-84BF-509A1085D994}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1CC62F45-E6FF-43D5-84BF-509A1085D994}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1CC62F45-E6FF-43D5-84BF-509A1085D994}.Release|Any CPU.Build.0 = Release|Any CPU + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Release|Any CPU.Build.0 = Release|Any CPU + {CBC7993C-57D8-4A6C-992C-19E849DFE71D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CBC7993C-57D8-4A6C-992C-19E849DFE71D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CBC7993C-57D8-4A6C-992C-19E849DFE71D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CBC7993C-57D8-4A6C-992C-19E849DFE71D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/src/Orchard.Azure.Tests/Properties/AssemblyInfo.cs b/src/Orchard.Azure.Tests/Properties/AssemblyInfo.cs index 8f74efedce1..c094b071136 100644 --- a/src/Orchard.Azure.Tests/Properties/AssemblyInfo.cs +++ b/src/Orchard.Azure.Tests/Properties/AssemblyInfo.cs @@ -1,36 +1,36 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Orchard.Azure.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("Orchard.Azure.Tests")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("21e6aa35-d13d-495b-af35-bc066a1a8bf2")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.41")] -[assembly: AssemblyFileVersion("1.2.41")] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Orchard.Azure.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Orchard.Azure.Tests")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("21e6aa35-d13d-495b-af35-bc066a1a8bf2")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.2.41")] +[assembly: AssemblyFileVersion("1.2.41")] diff --git a/src/Orchard.Azure/Orchard.Azure.5.0.ReSharper b/src/Orchard.Azure/Orchard.Azure.5.0.ReSharper index 470d2dcf237..3e79278c4e3 100644 --- a/src/Orchard.Azure/Orchard.Azure.5.0.ReSharper +++ b/src/Orchard.Azure/Orchard.Azure.5.0.ReSharper @@ -1,108 +1,108 @@ - - - - - SOLUTION - - - False - False - False - END_OF_LINE - END_OF_LINE - TOGETHER - ALWAYS_ADD - ALWAYS_ADD - ALWAYS_ADD - ALWAYS_ADD - ALWAYS_ADD - ALWAYS_ADD - END_OF_LINE - END_OF_LINE - - public - protected - internal - private - new - abstract - virtual - override - sealed - static - readonly - extern - unsafe - volatile - - END_OF_LINE - END_OF_LINE - False - - - - $object$_On$event$ - $event$Handler - - - - - - - - - - - - - - - - - - - - - - - - - $object$_On$event$ - $event$Handler - - - - - - - - - - - - - - $object$_On$event$ - $event$Handler - - - - - - - - - - - - - - - - - - - - - + + + + + SOLUTION + + + False + False + False + END_OF_LINE + END_OF_LINE + TOGETHER + ALWAYS_ADD + ALWAYS_ADD + ALWAYS_ADD + ALWAYS_ADD + ALWAYS_ADD + ALWAYS_ADD + END_OF_LINE + END_OF_LINE + + public + protected + internal + private + new + abstract + virtual + override + sealed + static + readonly + extern + unsafe + volatile + + END_OF_LINE + END_OF_LINE + False + + + + $object$_On$event$ + $event$Handler + + + + + + + + + + + + + + + + + + + + + + + + + $object$_On$event$ + $event$Handler + + + + + + + + + + + + + + $object$_On$event$ + $event$Handler + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Azure/Orchard.Azure.CloudService/Orchard.Azure.CloudService.ccproj b/src/Orchard.Azure/Orchard.Azure.CloudService/Orchard.Azure.CloudService.ccproj index 0008ce82945..ba7bc32d602 100644 --- a/src/Orchard.Azure/Orchard.Azure.CloudService/Orchard.Azure.CloudService.ccproj +++ b/src/Orchard.Azure/Orchard.Azure.CloudService/Orchard.Azure.CloudService.ccproj @@ -1,129 +1,129 @@ - - - - - Debug - AnyCPU - 2.7 - {03c5327d-4e8e-45a7-acd1-e18e7caa3c4a} - Library - Properties - Orchard.Azure.CloudService - Orchard.Azure.CloudService - True - OrchardCloudService - False - False - False - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - Orchard.Azure.Web - {0df8f426-9f30-4918-8f64-a5b40ba12d10} - True - Web - Orchard.Azure.Web - True - - - - - - - - - - - Content - - - - - - - - 10.0 - $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.7\ - - - - - $(MSBuildProjectDirectory)\..\..\..\lib - $(MSBuildProjectDirectory)\..\.. - $(MSBuildProjectDirectory)\Staging - - - - - - - - - - - - - - - - - - - - - - - - - - - - Orchard.Azure.Web - ..\sitesroot\0\Themes - - - Orchard.Azure.Web - ..\sitesroot\0\Core - - - Orchard.Azure.Web - ..\sitesroot\0\Modules - - - Orchard.Azure.Web - ..\sitesroot\0\bin\x86 - - - Orchard.Azure.Web - ..\sitesroot\0\bin\amd64 - - - + + + + + Debug + AnyCPU + 2.7 + {03c5327d-4e8e-45a7-acd1-e18e7caa3c4a} + Library + Properties + Orchard.Azure.CloudService + Orchard.Azure.CloudService + True + OrchardCloudService + False + False + False + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + Orchard.Azure.Web + {0df8f426-9f30-4918-8f64-a5b40ba12d10} + True + Web + Orchard.Azure.Web + True + + + + + + + + + + + Content + + + + + + + + 10.0 + $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.7\ + + + + + $(MSBuildProjectDirectory)\..\..\..\lib + $(MSBuildProjectDirectory)\..\.. + $(MSBuildProjectDirectory)\Staging + + + + + + + + + + + + + + + + + + + + + + + + + + + + Orchard.Azure.Web + ..\sitesroot\0\Themes + + + Orchard.Azure.Web + ..\sitesroot\0\Core + + + Orchard.Azure.Web + ..\sitesroot\0\Modules + + + Orchard.Azure.Web + ..\sitesroot\0\bin\x86 + + + Orchard.Azure.Web + ..\sitesroot\0\bin\amd64 + + + \ No newline at end of file diff --git a/src/Orchard.Azure/Orchard.Azure.CloudService/Properties.txt b/src/Orchard.Azure/Orchard.Azure.CloudService/Properties.txt index 6157c1029fd..249e3585043 100644 --- a/src/Orchard.Azure/Orchard.Azure.CloudService/Properties.txt +++ b/src/Orchard.Azure/Orchard.Azure.CloudService/Properties.txt @@ -1 +1 @@ -TargetFrameWorkVersion=v4.0 +TargetFrameWorkVersion=v4.0 diff --git a/src/Orchard.Azure/Orchard.Azure.CloudService/ServiceDefinition.csdef b/src/Orchard.Azure/Orchard.Azure.CloudService/ServiceDefinition.csdef index 429b612ec5b..9b5bdd7fa05 100644 --- a/src/Orchard.Azure/Orchard.Azure.CloudService/ServiceDefinition.csdef +++ b/src/Orchard.Azure/Orchard.Azure.CloudService/ServiceDefinition.csdef @@ -1,43 +1,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Config/Host.config b/src/Orchard.Azure/Orchard.Azure.Web/Config/Host.config index 1593a1e2c1c..364cbfabf11 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/Config/Host.config +++ b/src/Orchard.Azure/Orchard.Azure.Web/Config/Host.config @@ -1,23 +1,23 @@ - - - - -
      - - - - - - - - - - - - - - - - - - + + + + +
      + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Config/HostComponents.config b/src/Orchard.Azure/Orchard.Azure.Web/Config/HostComponents.config index 91ea6a690eb..1640404306f 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/Config/HostComponents.config +++ b/src/Orchard.Azure/Orchard.Azure.Web/Config/HostComponents.config @@ -1,110 +1,110 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Config/log4net.Debug.config b/src/Orchard.Azure/Orchard.Azure.Web/Config/log4net.Debug.config index 49bc2c5d2c2..080ce9ef2ef 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/Config/log4net.Debug.config +++ b/src/Orchard.Azure/Orchard.Azure.Web/Config/log4net.Debug.config @@ -1,4 +1,4 @@ - - - + + + \ No newline at end of file diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Config/log4net.Release.config b/src/Orchard.Azure/Orchard.Azure.Web/Config/log4net.Release.config index 49bc2c5d2c2..080ce9ef2ef 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/Config/log4net.Release.config +++ b/src/Orchard.Azure/Orchard.Azure.Web/Config/log4net.Release.config @@ -1,4 +1,4 @@ - - - + + + \ No newline at end of file diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Config/log4net.config b/src/Orchard.Azure/Orchard.Azure.Web/Config/log4net.config index 1aaf635bed1..7a6b2f13288 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/Config/log4net.config +++ b/src/Orchard.Azure/Orchard.Azure.Web/Config/log4net.config @@ -1,20 +1,20 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Global.asax b/src/Orchard.Azure/Orchard.Azure.Web/Global.asax index 8d7ecf44863..caae6e4e514 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/Global.asax +++ b/src/Orchard.Azure/Orchard.Azure.Web/Global.asax @@ -1 +1 @@ -<%@ Application Codebehind="Global.asax.cs" Inherits="Orchard.Azure.Web.MvcApplication" Language="C#" %> +<%@ Application Codebehind="Global.asax.cs" Inherits="Orchard.Azure.Web.MvcApplication" Language="C#" %> diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Global.asax.cs b/src/Orchard.Azure/Orchard.Azure.Web/Global.asax.cs index 673b932342b..a49851dbc10 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/Global.asax.cs +++ b/src/Orchard.Azure/Orchard.Azure.Web/Global.asax.cs @@ -1,56 +1,56 @@ -using System.Linq; -using System.Web; -using System.Web.Mvc; -using System.Web.Routing; -using Autofac; -using Microsoft.WindowsAzure.ServiceRuntime; -using Microsoft.WindowsAzure.Storage; -using Orchard.Environment; - -namespace Orchard.Azure.Web { - // Note: For instructions on enabling IIS6 or IIS7 classic mode, - // visit http://go.microsoft.com/?LinkId=9394801 - - public class MvcApplication : HttpApplication { - private static IOrchardHost _host; - - public static void RegisterRoutes(RouteCollection routes) { - routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); - } - - protected void Application_Start() { - - // For information on handling configuration changes - // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357. - RoleEnvironment.Changing += (sender, e) => { - // If a configuration setting is changing - if (e.Changes.Any(change => change is RoleEnvironmentConfigurationSettingChange)) { - // Set e.Cancel to true to restart this role instance - e.Cancel = true; - } - }; - - RegisterRoutes(RouteTable.Routes); - - _host = OrchardStarter.CreateHost(MvcSingletons); - _host.Initialize(); - } - - protected void Application_BeginRequest() { - Context.Items["originalHttpContext"] = Context; - - _host.BeginRequest(); - } - - protected void Application_EndRequest() { - _host.EndRequest(); - } - - static void MvcSingletons(ContainerBuilder builder) { - builder.Register(ctx => RouteTable.Routes).SingleInstance(); - builder.Register(ctx => ModelBinders.Binders).SingleInstance(); - builder.Register(ctx => ViewEngines.Engines).SingleInstance(); - } - - } -} +using System.Linq; +using System.Web; +using System.Web.Mvc; +using System.Web.Routing; +using Autofac; +using Microsoft.WindowsAzure.ServiceRuntime; +using Microsoft.WindowsAzure.Storage; +using Orchard.Environment; + +namespace Orchard.Azure.Web { + // Note: For instructions on enabling IIS6 or IIS7 classic mode, + // visit http://go.microsoft.com/?LinkId=9394801 + + public class MvcApplication : HttpApplication { + private static IOrchardHost _host; + + public static void RegisterRoutes(RouteCollection routes) { + routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); + } + + protected void Application_Start() { + + // For information on handling configuration changes + // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357. + RoleEnvironment.Changing += (sender, e) => { + // If a configuration setting is changing + if (e.Changes.Any(change => change is RoleEnvironmentConfigurationSettingChange)) { + // Set e.Cancel to true to restart this role instance + e.Cancel = true; + } + }; + + RegisterRoutes(RouteTable.Routes); + + _host = OrchardStarter.CreateHost(MvcSingletons); + _host.Initialize(); + } + + protected void Application_BeginRequest() { + Context.Items["originalHttpContext"] = Context; + + _host.BeginRequest(); + } + + protected void Application_EndRequest() { + _host.EndRequest(); + } + + static void MvcSingletons(ContainerBuilder builder) { + builder.Register(ctx => RouteTable.Routes).SingleInstance(); + builder.Register(ctx => ModelBinders.Binders).SingleInstance(); + builder.Register(ctx => ViewEngines.Engines).SingleInstance(); + } + + } +} diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Orchard.Azure.Web.csproj b/src/Orchard.Azure/Orchard.Azure.Web/Orchard.Azure.Web.csproj index 7521b517bd2..aa13bc7b015 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/Orchard.Azure.Web.csproj +++ b/src/Orchard.Azure/Orchard.Azure.Web/Orchard.Azure.Web.csproj @@ -1,611 +1,611 @@ - - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0DF8F426-9F30-4918-8F64-A5B40BA12D10} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Orchard.Azure.Web - Orchard.Azure.Web - v4.5.1 - false - false - - - - - - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - false - - - pdbonly - true - bin\ - TRACE - prompt - 4 - AllRules.ruleset - AnyCPU - false - - - - False - ..\..\..\lib\autofac\Autofac.dll - True - - - ..\..\..\lib\autofac\Autofac.Integration.Web.dll - True - - - False - ..\..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.AzureClientHelper.dll - - - False - ..\..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.AzureCommon.dll - - - False - ..\..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.Client.dll - - - False - ..\..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.Core.dll - - - False - ..\..\..\lib\windowsazure\Microsoft.Data.Edm.dll - - - False - ..\..\..\lib\windowsazure\Microsoft.Data.OData.dll - - - False - ..\..\..\lib\windowsazure\Microsoft.Web.DistributedCache.dll - - - False - ..\..\..\lib\aspnetmvc\Microsoft.Web.Infrastructure.dll - True - - - False - ..\..\..\lib\windowsazure\Microsoft.WindowsAzure.Configuration.dll - - - ..\..\..\lib\windowsazure\Microsoft.WindowsAzure.Diagnostics.dll - True - - - ..\..\..\lib\windowsazure\Microsoft.WindowsAzure.ServiceRuntime.dll - False - - - False - ..\..\..\lib\windowsazure\Microsoft.WindowsAzure.Storage.dll - - - ..\..\..\lib\newtonsoft.json\Newtonsoft.Json.dll - True - - - False - - - False - - - 3.5 - False - - - - - False - ..\..\..\lib\sqlce\System.Data.SqlServerCe.dll - True - - - False - - - False - - - False - - - - ..\..\..\lib\aspnetmvc\System.Web.Helpers.dll - True - - - False - ..\..\..\lib\aspnetmvc\System.Web.Mvc.dll - True - - - False - - - False - - - ..\..\..\lib\aspnetmvc\System.Web.Razor.dll - True - - - False - - - ..\..\..\lib\aspnetmvc\System.Web.WebPages.dll - True - - - False - ..\..\..\lib\aspnetmvc\System.Web.WebPages.Deployment.dll - True - - - ..\..\..\lib\aspnetmvc\System.Web.WebPages.Razor.dll - True - - - False - - - False - - - False - - - False - - - - - - Global.asax - - - - - - - - - Designer - - - - - - Web.config - - - Web.config - - - - - {9916839C-39FC-4CEB-A5AF-89CA7E87119F} - Orchard.Core - True - - - {D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D} - Lucene - True - - - {3158C928-888C-4A84-8BC1-4A8257489538} - Markdown - - - {475B6C45-B27C-438B-8966-908B9D6D1077} - Orchard.Alias - - - {91bc2e7f-da04-421c-98ef-76d37cec130c} - Orchard.AntiSpam - - - {1C981BB3-26F7-494C-9005-CC27A5144233} - Orchard.ArchiveLater - True - - - {3dd574cd-9c5d-4a45-85e1-ebba64c22b5f} - Orchard.AuditTrail - - - {66FCCD76-2761-47E3-8D11-B45D0001DDAA} - Orchard.Autoroute - - - {14a96b1a-9dc9-44c8-a675-206329e15263} - Orchard.Azure.MediaServices - - - {cbc7993c-57d8-4a6c-992c-19e849dfe71d} - Orchard.Azure - - - {63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867} - Orchard.Blogs - True - - - {7528bf74-25c7-4abe-883a-443b4eec4776} - Orchard.Caching - - - {C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962} - Orchard.CodeGeneration - True - - - {14C049FD-B35B-415A-A824-87F26B26E7FD} - Orchard.Comments - True - - - {e826f796-8ce3-4b5b-8423-5aa5f81d2fc3} - Orchard.ContentPermissions - - - {f301ef7d-f19c-4d83-aa94-cb64f29c037d} - Orchard.ContentPicker - - - {0E7646E8-FE8F-43C1-8799-D97860925EC4} - Orchard.ContentTypes - True - - - {2cf067ca-064b-43c6-8b88-5e3b99a65f1d} - Orchard.CustomForms - - - {4A4595EF-6C37-4F99-96ED-4AE0B9E438D3} - Orchard.DesignerTools - True - - - {82190f52-2901-46d6-8a4c-34649959483f} - Orchard.DynamicForms - - - {05660F47-D649-48BD-9DED-DF4E01E7CFF9} - Orchard.Email - True - - - {3787DDE5-E5C8-4841-BDA7-DCB325388064} - Orchard.Fields - - - {642A49D7-8752-4177-80D6-BFBBCFAD3DE0} - Orchard.Forms - - - {1f0b6b85-8b0b-47ca-899d-f25b4f1b52c3} - Orchard.ImageEditor - - - {fe5c5947-d2d5-42c5-992a-13d672946135} - Orchard.ImportExport - - - {EA2B9121-EF54-40A6-A53E-6593C86EE696} - Orchard.Indexing - True - - - {085948ff-0e9b-4a9a-b564-f8b8b4bdddbc} - Orchard.JobsQueue - - - {8F116B06-1C0E-4E4C-9A0A-D2FAB851E768} - Orchard.jQuery - True - - - {6bd8b2fa-f2e3-4ac8-a4c3-2925a653889a} - Orchard.Layouts - - - {137906EA-15FE-4AD8-A6A0-27528F0477D6} - Orchard.Lists - True - - - {FBC8B571-ED50-49D8-8D9D-64AB7454A0D6} - Orchard.Localization - True - - - {73a7688a-5bd3-4f7e-adfa-ce36c5a10e3b} - Orchard.MediaLibrary - - - {43D0EC0B-1955-4566-8D31-7B9102DA1703} - Orchard.MediaPicker - True - - - {08191fcd-7258-4f19-95fb-aec3de77b2eb} - Orchard.MediaProcessing - - - {D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB} - Orchard.Media - True - - - {ed715544-e649-4f48-b8ee-9368c41c3ac0} - Orchard.MessageBus - - - {EA4F1DA7-F2AB-4384-9AA4-9B756E2026B1} - Orchard.Migrations - True - - - {17F86780-9A1F-4AA1-86F1-875EEC2730C7} - Orchard.Modules - True - - - {72457126-E118-4171-A08F-9A709EE4B7FC} - Orchard.MultiTenancy - True - - - {6e444ff1-a47c-4cf6-bb3f-507c8ebd776d} - Orchard.OutputCache - - - {DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059} - Orchard.Packaging - True - - - {3420C92A-747F-4990-BA08-F2C9531E44AD} - Orchard.Pages - True - - - {5531E894-D259-45A3-AA61-26DBE720C1CE} - Orchard.Projections - - - {C889167C-E52C-4A65-A419-224B3D1B957D} - Orchard.PublishLater - True - - - {FC1D74E8-7A4D-48F4-83DE-95C6173780C4} - Orchard.Recipes - True - - - {2c5eb8b3-a313-413d-baa0-5c21d2a6ec6e} - Orchard.Redis - - - {D10AD48F-407D-4DB5-A328-173EC7CB010F} - Orchard.Roles - True - - - {966EC390-3C7F-4D98-92A6-F0F30D02E9B1} - Orchard.Rules - - - {5d13ef34-8b39-4ec5-847f-e12892acf841} - Orchard.Scripting.CSharp - - - {2AD6973D-C7BB-416E-89FE-EEE34664E05F} - Orchard.Scripting.Dlr - True - - - {2AD6973D-C7BB-416E-89FE-EEE34664E05F} - Orchard.Scripting.Dlr - True - - - {99002b65-86f7-415e-bf4a-381aa8ab9ccc} - Orchard.Scripting - - - {4BE4EB01-AC56-4048-924E-2CA77F509ABA} - Orchard.Search - True - - - {36b82383-d69e-4897-a24a-648babdf80ec} - Orchard.SecureSocketsLayer - - - {8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4} - Orchard.Setup - True - - - {5D0F00F0-26C9-4785-AD61-B85710C60EB0} - Orchard.Tags - True - - - {3F72A4E9-7B72-4260-B010-C16EC54F9BAF} - Orchard.TaskLease - - - {e649ea64-d213-461b-87f7-d67035801443} - Orchard.Taxonomies - - - {10ab3ce2-a720-467f-9ec8-ebb4bac9a1c9} - Orchard.Templates - - - {CDE24A24-01D3-403C-84B9-37722E18DFB7} - Orchard.Themes - True - - - {6F759635-13D7-4E94-BCC9-80445D63F117} - Orchard.Tokens - - - {79AED36E-ABD0-4747-93D3-8722B042454B} - Orchard.Users - True - - - {9cd5c81f-5828-4384-8474-2e2be71d5edd} - Orchard.Warmup - - - {194D3CCC-1153-474D-8176-FDE8D7D0D0BD} - Orchard.Widgets - True - - - {7059493c-8251-4764-9c1e-2368b8b485bc} - Orchard.Workflows - - - {3bd22132-d538-48c6-8854-f71333c798eb} - SysCache - - - {954CA994-D204-468B-9D69-51F6AD3E1C29} - TinyMce - True - - - {8a9fdb57-342d-49c2-bafc-d885aae5cc7c} - Upgrade - - - {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} - Orchard.Framework - False - True - - - {33B1BC8D-E292-4972-A363-22056B207156} - Orchard %28Tools\Orchard%29 - True - - - - - - Designer - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - Config\log4net.config - False - $(TransformWebConfigIntermediateLocation)\original - Config\log4net.$(Configuration).config - $(TransformWebConfigIntermediateLocation)\original - $(TransformWebConfigIntermediateLocation)\original\%(DestinationRelativePath) - $(TransformWebConfigIntermediateLocation)\transformed\%(DestinationRelativePath) - $(_PackageTempDir)\%(DestinationRelativePath) - Designer - - - log4net.config - - - log4net.config - - - - - - - - - - - ..\.. - - - - - - - - - - - - - - - - False - True - 60453 - / - - - False - False - - - False - - - - - - del "$(TargetDir)\Modules" -del "$(TargetDir)\Themes" -del "$(TargetDir)\Media" - - + + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {0DF8F426-9F30-4918-8F64-A5B40BA12D10} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Orchard.Azure.Web + Orchard.Azure.Web + v4.5.1 + false + false + + + + + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + false + + + pdbonly + true + bin\ + TRACE + prompt + 4 + AllRules.ruleset + AnyCPU + false + + + + False + ..\..\..\lib\autofac\Autofac.dll + True + + + ..\..\..\lib\autofac\Autofac.Integration.Web.dll + True + + + False + ..\..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.AzureClientHelper.dll + + + False + ..\..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.AzureCommon.dll + + + False + ..\..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.Client.dll + + + False + ..\..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.Core.dll + + + False + ..\..\..\lib\windowsazure\Microsoft.Data.Edm.dll + + + False + ..\..\..\lib\windowsazure\Microsoft.Data.OData.dll + + + False + ..\..\..\lib\windowsazure\Microsoft.Web.DistributedCache.dll + + + False + ..\..\..\lib\aspnetmvc\Microsoft.Web.Infrastructure.dll + True + + + False + ..\..\..\lib\windowsazure\Microsoft.WindowsAzure.Configuration.dll + + + ..\..\..\lib\windowsazure\Microsoft.WindowsAzure.Diagnostics.dll + True + + + ..\..\..\lib\windowsazure\Microsoft.WindowsAzure.ServiceRuntime.dll + False + + + False + ..\..\..\lib\windowsazure\Microsoft.WindowsAzure.Storage.dll + + + ..\..\..\lib\newtonsoft.json\Newtonsoft.Json.dll + True + + + False + + + False + + + 3.5 + False + + + + + False + ..\..\..\lib\sqlce\System.Data.SqlServerCe.dll + True + + + False + + + False + + + False + + + + ..\..\..\lib\aspnetmvc\System.Web.Helpers.dll + True + + + False + ..\..\..\lib\aspnetmvc\System.Web.Mvc.dll + True + + + False + + + False + + + ..\..\..\lib\aspnetmvc\System.Web.Razor.dll + True + + + False + + + ..\..\..\lib\aspnetmvc\System.Web.WebPages.dll + True + + + False + ..\..\..\lib\aspnetmvc\System.Web.WebPages.Deployment.dll + True + + + ..\..\..\lib\aspnetmvc\System.Web.WebPages.Razor.dll + True + + + False + + + False + + + False + + + False + + + + + + Global.asax + + + + + + + + + Designer + + + + + + Web.config + + + Web.config + + + + + {9916839C-39FC-4CEB-A5AF-89CA7E87119F} + Orchard.Core + True + + + {D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D} + Lucene + True + + + {3158C928-888C-4A84-8BC1-4A8257489538} + Markdown + + + {475B6C45-B27C-438B-8966-908B9D6D1077} + Orchard.Alias + + + {91bc2e7f-da04-421c-98ef-76d37cec130c} + Orchard.AntiSpam + + + {1C981BB3-26F7-494C-9005-CC27A5144233} + Orchard.ArchiveLater + True + + + {3dd574cd-9c5d-4a45-85e1-ebba64c22b5f} + Orchard.AuditTrail + + + {66FCCD76-2761-47E3-8D11-B45D0001DDAA} + Orchard.Autoroute + + + {14a96b1a-9dc9-44c8-a675-206329e15263} + Orchard.Azure.MediaServices + + + {cbc7993c-57d8-4a6c-992c-19e849dfe71d} + Orchard.Azure + + + {63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867} + Orchard.Blogs + True + + + {7528bf74-25c7-4abe-883a-443b4eec4776} + Orchard.Caching + + + {C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962} + Orchard.CodeGeneration + True + + + {14C049FD-B35B-415A-A824-87F26B26E7FD} + Orchard.Comments + True + + + {e826f796-8ce3-4b5b-8423-5aa5f81d2fc3} + Orchard.ContentPermissions + + + {f301ef7d-f19c-4d83-aa94-cb64f29c037d} + Orchard.ContentPicker + + + {0E7646E8-FE8F-43C1-8799-D97860925EC4} + Orchard.ContentTypes + True + + + {2cf067ca-064b-43c6-8b88-5e3b99a65f1d} + Orchard.CustomForms + + + {4A4595EF-6C37-4F99-96ED-4AE0B9E438D3} + Orchard.DesignerTools + True + + + {82190f52-2901-46d6-8a4c-34649959483f} + Orchard.DynamicForms + + + {05660F47-D649-48BD-9DED-DF4E01E7CFF9} + Orchard.Email + True + + + {3787DDE5-E5C8-4841-BDA7-DCB325388064} + Orchard.Fields + + + {642A49D7-8752-4177-80D6-BFBBCFAD3DE0} + Orchard.Forms + + + {1f0b6b85-8b0b-47ca-899d-f25b4f1b52c3} + Orchard.ImageEditor + + + {fe5c5947-d2d5-42c5-992a-13d672946135} + Orchard.ImportExport + + + {EA2B9121-EF54-40A6-A53E-6593C86EE696} + Orchard.Indexing + True + + + {085948ff-0e9b-4a9a-b564-f8b8b4bdddbc} + Orchard.JobsQueue + + + {8F116B06-1C0E-4E4C-9A0A-D2FAB851E768} + Orchard.jQuery + True + + + {6bd8b2fa-f2e3-4ac8-a4c3-2925a653889a} + Orchard.Layouts + + + {137906EA-15FE-4AD8-A6A0-27528F0477D6} + Orchard.Lists + True + + + {FBC8B571-ED50-49D8-8D9D-64AB7454A0D6} + Orchard.Localization + True + + + {73a7688a-5bd3-4f7e-adfa-ce36c5a10e3b} + Orchard.MediaLibrary + + + {43D0EC0B-1955-4566-8D31-7B9102DA1703} + Orchard.MediaPicker + True + + + {08191fcd-7258-4f19-95fb-aec3de77b2eb} + Orchard.MediaProcessing + + + {D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB} + Orchard.Media + True + + + {ed715544-e649-4f48-b8ee-9368c41c3ac0} + Orchard.MessageBus + + + {EA4F1DA7-F2AB-4384-9AA4-9B756E2026B1} + Orchard.Migrations + True + + + {17F86780-9A1F-4AA1-86F1-875EEC2730C7} + Orchard.Modules + True + + + {72457126-E118-4171-A08F-9A709EE4B7FC} + Orchard.MultiTenancy + True + + + {6e444ff1-a47c-4cf6-bb3f-507c8ebd776d} + Orchard.OutputCache + + + {DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059} + Orchard.Packaging + True + + + {3420C92A-747F-4990-BA08-F2C9531E44AD} + Orchard.Pages + True + + + {5531E894-D259-45A3-AA61-26DBE720C1CE} + Orchard.Projections + + + {C889167C-E52C-4A65-A419-224B3D1B957D} + Orchard.PublishLater + True + + + {FC1D74E8-7A4D-48F4-83DE-95C6173780C4} + Orchard.Recipes + True + + + {2c5eb8b3-a313-413d-baa0-5c21d2a6ec6e} + Orchard.Redis + + + {D10AD48F-407D-4DB5-A328-173EC7CB010F} + Orchard.Roles + True + + + {966EC390-3C7F-4D98-92A6-F0F30D02E9B1} + Orchard.Rules + + + {5d13ef34-8b39-4ec5-847f-e12892acf841} + Orchard.Scripting.CSharp + + + {2AD6973D-C7BB-416E-89FE-EEE34664E05F} + Orchard.Scripting.Dlr + True + + + {2AD6973D-C7BB-416E-89FE-EEE34664E05F} + Orchard.Scripting.Dlr + True + + + {99002b65-86f7-415e-bf4a-381aa8ab9ccc} + Orchard.Scripting + + + {4BE4EB01-AC56-4048-924E-2CA77F509ABA} + Orchard.Search + True + + + {36b82383-d69e-4897-a24a-648babdf80ec} + Orchard.SecureSocketsLayer + + + {8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4} + Orchard.Setup + True + + + {5D0F00F0-26C9-4785-AD61-B85710C60EB0} + Orchard.Tags + True + + + {3F72A4E9-7B72-4260-B010-C16EC54F9BAF} + Orchard.TaskLease + + + {e649ea64-d213-461b-87f7-d67035801443} + Orchard.Taxonomies + + + {10ab3ce2-a720-467f-9ec8-ebb4bac9a1c9} + Orchard.Templates + + + {CDE24A24-01D3-403C-84B9-37722E18DFB7} + Orchard.Themes + True + + + {6F759635-13D7-4E94-BCC9-80445D63F117} + Orchard.Tokens + + + {79AED36E-ABD0-4747-93D3-8722B042454B} + Orchard.Users + True + + + {9cd5c81f-5828-4384-8474-2e2be71d5edd} + Orchard.Warmup + + + {194D3CCC-1153-474D-8176-FDE8D7D0D0BD} + Orchard.Widgets + True + + + {7059493c-8251-4764-9c1e-2368b8b485bc} + Orchard.Workflows + + + {3bd22132-d538-48c6-8854-f71333c798eb} + SysCache + + + {954CA994-D204-468B-9D69-51F6AD3E1C29} + TinyMce + True + + + {8a9fdb57-342d-49c2-bafc-d885aae5cc7c} + Upgrade + + + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} + Orchard.Framework + False + True + + + {33B1BC8D-E292-4972-A363-22056B207156} + Orchard %28Tools\Orchard%29 + True + + + + + + Designer + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + Config\log4net.config + False + $(TransformWebConfigIntermediateLocation)\original + Config\log4net.$(Configuration).config + $(TransformWebConfigIntermediateLocation)\original + $(TransformWebConfigIntermediateLocation)\original\%(DestinationRelativePath) + $(TransformWebConfigIntermediateLocation)\transformed\%(DestinationRelativePath) + $(_PackageTempDir)\%(DestinationRelativePath) + Designer + + + log4net.config + + + log4net.config + + + + + + + + + + + ..\.. + + + + + + + + + + + + + + + + False + True + 60453 + / + + + False + False + + + False + + + + + + del "$(TargetDir)\Modules" +del "$(TargetDir)\Themes" +del "$(TargetDir)\Media" + + \ No newline at end of file diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Properties/AssemblyInfo.cs b/src/Orchard.Azure/Orchard.Azure.Web/Properties/AssemblyInfo.cs index a7339c54916..a54b35cb3d1 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/Properties/AssemblyInfo.cs +++ b/src/Orchard.Azure/Orchard.Azure.Web/Properties/AssemblyInfo.cs @@ -1,35 +1,35 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Orchard.Azure.Web")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("Orchard.Azure.Web")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("76077e05-d95f-49c7-b11a-2b0fc9176e7c")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.2.41")] -[assembly: AssemblyFileVersion("1.2.41")] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Orchard.Azure.Web")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Orchard.Azure.Web")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("76077e05-d95f-49c7-b11a-2b0fc9176e7c")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.2.41")] +[assembly: AssemblyFileVersion("1.2.41")] diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Refresh.html b/src/Orchard.Azure/Orchard.Azure.Web/Refresh.html index d113ec29672..25ac3277f28 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/Refresh.html +++ b/src/Orchard.Azure/Orchard.Azure.Web/Refresh.html @@ -1,15 +1,15 @@ - - - - Configuration Changing... - - -

      - Orchard is temporarily unavailable as a change in configuration requires a restart. - A simple page refresh usually solves this issue.

      - - - - + + + + Configuration Changing... + + +

      + Orchard is temporarily unavailable as a change in configuration requires a restart. + A simple page refresh usually solves this issue.

      + + + + diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Web.Debug.config b/src/Orchard.Azure/Orchard.Azure.Web/Web.Debug.config index 1c6ccb00c98..f1807a5112e 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/Web.Debug.config +++ b/src/Orchard.Azure/Orchard.Azure.Web/Web.Debug.config @@ -1,4 +1,4 @@ - - - + + + \ No newline at end of file diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Web.Release.config b/src/Orchard.Azure/Orchard.Azure.Web/Web.Release.config index cec79bc785c..d96dd5b5b60 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/Web.Release.config +++ b/src/Orchard.Azure/Orchard.Azure.Web/Web.Release.config @@ -1,11 +1,11 @@ - - - - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Web.config b/src/Orchard.Azure/Orchard.Azure.Web/Web.config index 5914bd1edf9..aebd411e57f 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/Web.config +++ b/src/Orchard.Azure/Orchard.Azure.Web/Web.config @@ -1,212 +1,212 @@ - - - - - - - -
      -
      - -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + +
      +
      + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Azure/Orchard.Azure.sln b/src/Orchard.Azure/Orchard.Azure.sln index aa1a74e0520..91a5fa96b3e 100644 --- a/src/Orchard.Azure/Orchard.Azure.sln +++ b/src/Orchard.Azure/Orchard.Azure.sln @@ -1,529 +1,529 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.23107.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{75E7476C-C05B-4C41-8E38-081D3EB55659}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Themes", "Themes", "{84650275-884D-4CBB-9CC0-67553996E211}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules.Deprecated", "Modules.Deprecated", "{B6092A92-1071-4C30-AD55-8E8D46BC2F14}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Orchard", "Orchard", "{F2AB7512-139A-420F-AE3A-9ED22CA52CE1}" -EndProject -Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "Orchard.Azure.CloudService", "Orchard.Azure.CloudService\Orchard.Azure.CloudService.ccproj", "{03C5327D-4E8E-45A7-ACD1-E18E7CAA3C4A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Azure.Web", "Orchard.Azure.Web\Orchard.Azure.Web.csproj", "{0DF8F426-9F30-4918-8F64-A5B40BA12D10}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Framework", "..\Orchard\Orchard.Framework.csproj", "{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Core", "..\Orchard.Web\Core\Orchard.Core.csproj", "{9916839C-39FC-4CEB-A5AF-89CA7E87119F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Blogs", "..\Orchard.Web\Modules\Orchard.Blogs\Orchard.Blogs.csproj", "{63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Comments", "..\Orchard.Web\Modules\Orchard.Comments\Orchard.Comments.csproj", "{14C049FD-B35B-415A-A824-87F26B26E7FD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.ContentTypes", "..\Orchard.Web\Modules\Orchard.ContentTypes\Orchard.ContentTypes.csproj", "{0E7646E8-FE8F-43C1-8799-D97860925EC4}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Indexing", "..\Orchard.Web\Modules\Orchard.Indexing\Orchard.Indexing.csproj", "{EA2B9121-EF54-40A6-A53E-6593C86EE696}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Media", "..\Orchard.Web\Modules\Orchard.Media\Orchard.Media.csproj", "{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Modules", "..\Orchard.Web\Modules\Orchard.Modules\Orchard.Modules.csproj", "{17F86780-9A1F-4AA1-86F1-875EEC2730C7}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.MultiTenancy", "..\Orchard.Web\Modules\Orchard.MultiTenancy\Orchard.MultiTenancy.csproj", "{72457126-E118-4171-A08F-9A709EE4B7FC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Roles", "..\Orchard.Web\Modules\Orchard.Roles\Orchard.Roles.csproj", "{D10AD48F-407D-4DB5-A328-173EC7CB010F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Search", "..\Orchard.Web\Modules\Orchard.Search\Orchard.Search.csproj", "{4BE4EB01-AC56-4048-924E-2CA77F509ABA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Setup", "..\Orchard.Web\Modules\Orchard.Setup\Orchard.Setup.csproj", "{8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Tags", "..\Orchard.Web\Modules\Orchard.Tags\Orchard.Tags.csproj", "{5D0F00F0-26C9-4785-AD61-B85710C60EB0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Themes", "..\Orchard.Web\Modules\Orchard.Themes\Orchard.Themes.csproj", "{CDE24A24-01D3-403C-84B9-37722E18DFB7}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Users", "..\Orchard.Web\Modules\Orchard.Users\Orchard.Users.csproj", "{79AED36E-ABD0-4747-93D3-8722B042454B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinyMce", "..\Orchard.Web\Modules\TinyMce\TinyMce.csproj", "{954CA994-D204-468B-9D69-51F6AD3E1C29}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard", "..\Tools\Orchard\Orchard.csproj", "{33B1BC8D-E292-4972-A363-22056B207156}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lucene", "..\Orchard.Web\Modules\Lucene\Lucene.csproj", "{D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Packaging", "..\Orchard.Web\Modules\Orchard.Packaging\Orchard.Packaging.csproj", "{DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.CodeGeneration", "..\Orchard.Web\Modules\Orchard.CodeGeneration\Orchard.CodeGeneration.csproj", "{C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.ArchiveLater", "..\Orchard.Web\Modules\Orchard.ArchiveLater\Orchard.ArchiveLater.csproj", "{1C981BB3-26F7-494C-9005-CC27A5144233}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Email", "..\Orchard.Web\Modules\Orchard.Email\Orchard.Email.csproj", "{05660F47-D649-48BD-9DED-DF4E01E7CFF9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.jQuery", "..\Orchard.Web\Modules\Orchard.jQuery\Orchard.jQuery.csproj", "{8F116B06-1C0E-4E4C-9A0A-D2FAB851E768}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Migrations", "..\Orchard.Web\Modules\Orchard.Migrations\Orchard.Migrations.csproj", "{EA4F1DA7-F2AB-4384-9AA4-9B756E2026B1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Widgets", "..\Orchard.Web\Modules\Orchard.Widgets\Orchard.Widgets.csproj", "{194D3CCC-1153-474D-8176-FDE8D7D0D0BD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Themes", "..\Orchard.Web\Themes\Themes.csproj", "{CB70A642-8CEC-4DDE-8C9F-AD08900EC98D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Localization", "..\Orchard.Web\Modules\Orchard.Localization\Orchard.Localization.csproj", "{FBC8B571-ED50-49D8-8D9D-64AB7454A0D6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Lists", "..\Orchard.Web\Modules\Orchard.Lists\Orchard.Lists.csproj", "{137906EA-15FE-4AD8-A6A0-27528F0477D6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Pages", "..\Orchard.Web\Modules\Orchard.Pages\Orchard.Pages.csproj", "{3420C92A-747F-4990-BA08-F2C9531E44AD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.PublishLater", "..\Orchard.Web\Modules\Orchard.PublishLater\Orchard.PublishLater.csproj", "{C889167C-E52C-4A65-A419-224B3D1B957D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Scripting", "..\Orchard.Web\Modules\Orchard.Scripting\Orchard.Scripting.csproj", "{99002B65-86F7-415E-BF4A-381AA8AB9CCC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Scripting.Dlr", "..\Orchard.Web\Modules\Orchard.Scripting.Dlr\Orchard.Scripting.Dlr.csproj", "{2AD6973D-C7BB-416E-89FE-EEE34664E05F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.DesignerTools", "..\Orchard.Web\Modules\Orchard.DesignerTools\Orchard.DesignerTools.csproj", "{4A4595EF-6C37-4F99-96ED-4AE0B9E438D3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.MediaPicker", "..\Orchard.Web\Modules\Orchard.MediaPicker\Orchard.MediaPicker.csproj", "{43D0EC0B-1955-4566-8D31-7B9102DA1703}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Recipes", "..\Orchard.Web\Modules\Orchard.Recipes\Orchard.Recipes.csproj", "{FC1D74E8-7A4D-48F4-83DE-95C6173780C4}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Markdown", "..\Orchard.Web\Modules\Markdown\Markdown.csproj", "{3158C928-888C-4A84-8BC1-4A8257489538}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Forms", "..\Orchard.Web\Modules\Orchard.Forms\Orchard.Forms.csproj", "{642A49D7-8752-4177-80D6-BFBBCFAD3DE0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Tokens", "..\Orchard.Web\Modules\Orchard.Tokens\Orchard.Tokens.csproj", "{6F759635-13D7-4E94-BCC9-80445D63F117}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Rules", "..\Orchard.Web\Modules\Orchard.Rules\Orchard.Rules.csproj", "{966EC390-3C7F-4D98-92A6-F0F30D02E9B1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.TaskLease", "..\Orchard.Web\Modules\Orchard.TaskLease\Orchard.TaskLease.csproj", "{3F72A4E9-7B72-4260-B010-C16EC54F9BAF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Alias", "..\Orchard.Web\Modules\Orchard.Alias\Orchard.Alias.csproj", "{475B6C45-B27C-438B-8966-908B9D6D1077}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Autoroute", "..\Orchard.Web\Modules\Orchard.Autoroute\Orchard.Autoroute.csproj", "{66FCCD76-2761-47E3-8D11-B45D0001DDAA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Fields", "..\Orchard.Web\Modules\Orchard.Fields\Orchard.Fields.csproj", "{3787DDE5-E5C8-4841-BDA7-DCB325388064}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Projections", "..\Orchard.Web\Modules\Orchard.Projections\Orchard.Projections.csproj", "{5531E894-D259-45A3-AA61-26DBE720C1CE}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.AntiSpam", "..\Orchard.Web\Modules\Orchard.AntiSpam\Orchard.AntiSpam.csproj", "{91BC2E7F-DA04-421C-98EF-76D37CEC130C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.ContentPermissions", "..\Orchard.Web\Modules\Orchard.ContentPermissions\Orchard.ContentPermissions.csproj", "{E826F796-8CE3-4B5B-8423-5AA5F81D2FC3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.CustomForms", "..\Orchard.Web\Modules\Orchard.CustomForms\Orchard.CustomForms.csproj", "{2CF067CA-064B-43C6-8B88-5E3B99A65F1D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.ContentPicker", "..\Orchard.Web\Modules\Orchard.ContentPicker\Orchard.ContentPicker.csproj", "{F301EF7D-F19C-4D83-AA94-CB64F29C037D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.ImportExport", "..\Orchard.Web\Modules\Orchard.ImportExport\Orchard.ImportExport.csproj", "{FE5C5947-D2D5-42C5-992A-13D672946135}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Warmup", "..\Orchard.Web\Modules\Orchard.Warmup\Orchard.Warmup.csproj", "{9CD5C81F-5828-4384-8474-2E2BE71D5EDD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SysCache", "..\Orchard.Web\Modules\SysCache\SysCache.csproj", "{3BD22132-D538-48C6-8854-F71333C798EB}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.ImageEditor", "..\Orchard.Web\Modules\Orchard.ImageEditor\Orchard.ImageEditor.csproj", "{1F0B6B85-8B0B-47CA-899D-F25B4F1B52C3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.MediaProcessing", "..\Orchard.Web\Modules\Orchard.MediaProcessing\Orchard.MediaProcessing.csproj", "{08191FCD-7258-4F19-95FB-AEC3DE77B2EB}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.MediaLibrary", "..\Orchard.Web\Modules\Orchard.MediaLibrary\Orchard.MediaLibrary.csproj", "{73A7688A-5BD3-4F7E-ADFA-CE36C5A10E3B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.OutputCache", "..\Orchard.Web\Modules\Orchard.OutputCache\Orchard.OutputCache.csproj", "{6E444FF1-A47C-4CF6-BB3F-507C8EBD776D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Workflows", "..\Orchard.Web\Modules\Orchard.Workflows\Orchard.Workflows.csproj", "{7059493C-8251-4764-9C1E-2368B8B485BC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Upgrade", "..\Orchard.Web\Modules\Upgrade\Upgrade.csproj", "{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Scripting.CSharp", "..\Orchard.Web\Modules\Orchard.Scripting.CSharp\Orchard.Scripting.CSharp.csproj", "{5D13EF34-8B39-4EC5-847F-E12892ACF841}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Taxonomies", "..\Orchard.Web\Modules\Orchard.Taxonomies\Orchard.Taxonomies.csproj", "{E649EA64-D213-461B-87F7-D67035801443}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Azure", "..\Orchard.Web\Modules\Orchard.Azure\Orchard.Azure.csproj", "{CBC7993C-57D8-4A6C-992C-19E849DFE71D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Caching", "..\Orchard.Web\Modules\Orchard.Caching\Orchard.Caching.csproj", "{7528BF74-25C7-4ABE-883A-443B4EEC4776}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.SecureSocketsLayer", "..\Orchard.Web\Modules\Orchard.SecureSocketsLayer\Orchard.SecureSocketsLayer.csproj", "{36B82383-D69E-4897-A24A-648BABDF80EC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Templates", "..\Orchard.Web\Modules\Orchard.Templates\Orchard.Templates.csproj", "{10AB3CE2-A720-467F-9EC8-EBB4BAC9A1C9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Azure.MediaServices", "..\Orchard.Web\Modules\Orchard.Azure.MediaServices\Orchard.Azure.MediaServices.csproj", "{14A96B1A-9DC9-44C8-A675-206329E15263}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.AuditTrail", "..\Orchard.Web\Modules\Orchard.AuditTrail\Orchard.AuditTrail.csproj", "{3DD574CD-9C5D-4A45-85E1-EBBA64C22B5F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.DynamicForms", "..\Orchard.Web\Modules\Orchard.DynamicForms\Orchard.DynamicForms.csproj", "{82190F52-2901-46D6-8A4C-34649959483F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.JobsQueue", "..\Orchard.Web\Modules\Orchard.JobsQueue\Orchard.JobsQueue.csproj", "{085948FF-0E9B-4A9A-B564-F8B8B4BDDDBC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Layouts", "..\Orchard.Web\Modules\Orchard.Layouts\Orchard.Layouts.csproj", "{6BD8B2FA-F2E3-4AC8-A4C3-2925A653889A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.MessageBus", "..\Orchard.Web\Modules\Orchard.MessageBus\Orchard.MessageBus.csproj", "{ED715544-E649-4F48-B8EE-9368C41C3AC0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Redis", "..\Orchard.Web\Modules\Orchard.Redis\Orchard.Redis.csproj", "{2C5EB8B3-A313-413D-BAA0-5C21D2A6EC6E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {03C5327D-4E8E-45A7-ACD1-E18E7CAA3C4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {03C5327D-4E8E-45A7-ACD1-E18E7CAA3C4A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {03C5327D-4E8E-45A7-ACD1-E18E7CAA3C4A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {03C5327D-4E8E-45A7-ACD1-E18E7CAA3C4A}.Release|Any CPU.Build.0 = Release|Any CPU - {0DF8F426-9F30-4918-8F64-A5B40BA12D10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0DF8F426-9F30-4918-8F64-A5B40BA12D10}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0DF8F426-9F30-4918-8F64-A5B40BA12D10}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0DF8F426-9F30-4918-8F64-A5B40BA12D10}.Release|Any CPU.Build.0 = Release|Any CPU - {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Release|Any CPU.Build.0 = Release|Any CPU - {9916839C-39FC-4CEB-A5AF-89CA7E87119F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9916839C-39FC-4CEB-A5AF-89CA7E87119F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9916839C-39FC-4CEB-A5AF-89CA7E87119F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9916839C-39FC-4CEB-A5AF-89CA7E87119F}.Release|Any CPU.Build.0 = Release|Any CPU - {63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867}.Debug|Any CPU.Build.0 = Debug|Any CPU - {63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867}.Release|Any CPU.ActiveCfg = Release|Any CPU - {63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867}.Release|Any CPU.Build.0 = Release|Any CPU - {14C049FD-B35B-415A-A824-87F26B26E7FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {14C049FD-B35B-415A-A824-87F26B26E7FD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {14C049FD-B35B-415A-A824-87F26B26E7FD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {14C049FD-B35B-415A-A824-87F26B26E7FD}.Release|Any CPU.Build.0 = Release|Any CPU - {0E7646E8-FE8F-43C1-8799-D97860925EC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0E7646E8-FE8F-43C1-8799-D97860925EC4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0E7646E8-FE8F-43C1-8799-D97860925EC4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0E7646E8-FE8F-43C1-8799-D97860925EC4}.Release|Any CPU.Build.0 = Release|Any CPU - {EA2B9121-EF54-40A6-A53E-6593C86EE696}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EA2B9121-EF54-40A6-A53E-6593C86EE696}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EA2B9121-EF54-40A6-A53E-6593C86EE696}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EA2B9121-EF54-40A6-A53E-6593C86EE696}.Release|Any CPU.Build.0 = Release|Any CPU - {D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.Release|Any CPU.Build.0 = Release|Any CPU - {17F86780-9A1F-4AA1-86F1-875EEC2730C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {17F86780-9A1F-4AA1-86F1-875EEC2730C7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {17F86780-9A1F-4AA1-86F1-875EEC2730C7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {17F86780-9A1F-4AA1-86F1-875EEC2730C7}.Release|Any CPU.Build.0 = Release|Any CPU - {72457126-E118-4171-A08F-9A709EE4B7FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {72457126-E118-4171-A08F-9A709EE4B7FC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {72457126-E118-4171-A08F-9A709EE4B7FC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {72457126-E118-4171-A08F-9A709EE4B7FC}.Release|Any CPU.Build.0 = Release|Any CPU - {D10AD48F-407D-4DB5-A328-173EC7CB010F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D10AD48F-407D-4DB5-A328-173EC7CB010F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D10AD48F-407D-4DB5-A328-173EC7CB010F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D10AD48F-407D-4DB5-A328-173EC7CB010F}.Release|Any CPU.Build.0 = Release|Any CPU - {4BE4EB01-AC56-4048-924E-2CA77F509ABA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4BE4EB01-AC56-4048-924E-2CA77F509ABA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4BE4EB01-AC56-4048-924E-2CA77F509ABA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4BE4EB01-AC56-4048-924E-2CA77F509ABA}.Release|Any CPU.Build.0 = Release|Any CPU - {8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4}.Release|Any CPU.Build.0 = Release|Any CPU - {5D0F00F0-26C9-4785-AD61-B85710C60EB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5D0F00F0-26C9-4785-AD61-B85710C60EB0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5D0F00F0-26C9-4785-AD61-B85710C60EB0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5D0F00F0-26C9-4785-AD61-B85710C60EB0}.Release|Any CPU.Build.0 = Release|Any CPU - {CDE24A24-01D3-403C-84B9-37722E18DFB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CDE24A24-01D3-403C-84B9-37722E18DFB7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CDE24A24-01D3-403C-84B9-37722E18DFB7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CDE24A24-01D3-403C-84B9-37722E18DFB7}.Release|Any CPU.Build.0 = Release|Any CPU - {79AED36E-ABD0-4747-93D3-8722B042454B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {79AED36E-ABD0-4747-93D3-8722B042454B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {79AED36E-ABD0-4747-93D3-8722B042454B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {79AED36E-ABD0-4747-93D3-8722B042454B}.Release|Any CPU.Build.0 = Release|Any CPU - {954CA994-D204-468B-9D69-51F6AD3E1C29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {954CA994-D204-468B-9D69-51F6AD3E1C29}.Debug|Any CPU.Build.0 = Debug|Any CPU - {954CA994-D204-468B-9D69-51F6AD3E1C29}.Release|Any CPU.ActiveCfg = Release|Any CPU - {954CA994-D204-468B-9D69-51F6AD3E1C29}.Release|Any CPU.Build.0 = Release|Any CPU - {33B1BC8D-E292-4972-A363-22056B207156}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {33B1BC8D-E292-4972-A363-22056B207156}.Debug|Any CPU.Build.0 = Debug|Any CPU - {33B1BC8D-E292-4972-A363-22056B207156}.Release|Any CPU.ActiveCfg = Release|Any CPU - {33B1BC8D-E292-4972-A363-22056B207156}.Release|Any CPU.Build.0 = Release|Any CPU - {D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D}.Release|Any CPU.Build.0 = Release|Any CPU - {DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059}.Release|Any CPU.Build.0 = Release|Any CPU - {C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}.Release|Any CPU.Build.0 = Release|Any CPU - {1C981BB3-26F7-494C-9005-CC27A5144233}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1C981BB3-26F7-494C-9005-CC27A5144233}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1C981BB3-26F7-494C-9005-CC27A5144233}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1C981BB3-26F7-494C-9005-CC27A5144233}.Release|Any CPU.Build.0 = Release|Any CPU - {05660F47-D649-48BD-9DED-DF4E01E7CFF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {05660F47-D649-48BD-9DED-DF4E01E7CFF9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {05660F47-D649-48BD-9DED-DF4E01E7CFF9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {05660F47-D649-48BD-9DED-DF4E01E7CFF9}.Release|Any CPU.Build.0 = Release|Any CPU - {8F116B06-1C0E-4E4C-9A0A-D2FAB851E768}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8F116B06-1C0E-4E4C-9A0A-D2FAB851E768}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8F116B06-1C0E-4E4C-9A0A-D2FAB851E768}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8F116B06-1C0E-4E4C-9A0A-D2FAB851E768}.Release|Any CPU.Build.0 = Release|Any CPU - {EA4F1DA7-F2AB-4384-9AA4-9B756E2026B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EA4F1DA7-F2AB-4384-9AA4-9B756E2026B1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EA4F1DA7-F2AB-4384-9AA4-9B756E2026B1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EA4F1DA7-F2AB-4384-9AA4-9B756E2026B1}.Release|Any CPU.Build.0 = Release|Any CPU - {194D3CCC-1153-474D-8176-FDE8D7D0D0BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {194D3CCC-1153-474D-8176-FDE8D7D0D0BD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {194D3CCC-1153-474D-8176-FDE8D7D0D0BD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {194D3CCC-1153-474D-8176-FDE8D7D0D0BD}.Release|Any CPU.Build.0 = Release|Any CPU - {CB70A642-8CEC-4DDE-8C9F-AD08900EC98D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CB70A642-8CEC-4DDE-8C9F-AD08900EC98D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CB70A642-8CEC-4DDE-8C9F-AD08900EC98D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CB70A642-8CEC-4DDE-8C9F-AD08900EC98D}.Release|Any CPU.Build.0 = Release|Any CPU - {FBC8B571-ED50-49D8-8D9D-64AB7454A0D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FBC8B571-ED50-49D8-8D9D-64AB7454A0D6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FBC8B571-ED50-49D8-8D9D-64AB7454A0D6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FBC8B571-ED50-49D8-8D9D-64AB7454A0D6}.Release|Any CPU.Build.0 = Release|Any CPU - {137906EA-15FE-4AD8-A6A0-27528F0477D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {137906EA-15FE-4AD8-A6A0-27528F0477D6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {137906EA-15FE-4AD8-A6A0-27528F0477D6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {137906EA-15FE-4AD8-A6A0-27528F0477D6}.Release|Any CPU.Build.0 = Release|Any CPU - {3420C92A-747F-4990-BA08-F2C9531E44AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3420C92A-747F-4990-BA08-F2C9531E44AD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3420C92A-747F-4990-BA08-F2C9531E44AD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3420C92A-747F-4990-BA08-F2C9531E44AD}.Release|Any CPU.Build.0 = Release|Any CPU - {C889167C-E52C-4A65-A419-224B3D1B957D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C889167C-E52C-4A65-A419-224B3D1B957D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C889167C-E52C-4A65-A419-224B3D1B957D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C889167C-E52C-4A65-A419-224B3D1B957D}.Release|Any CPU.Build.0 = Release|Any CPU - {99002B65-86F7-415E-BF4A-381AA8AB9CCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {99002B65-86F7-415E-BF4A-381AA8AB9CCC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {99002B65-86F7-415E-BF4A-381AA8AB9CCC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {99002B65-86F7-415E-BF4A-381AA8AB9CCC}.Release|Any CPU.Build.0 = Release|Any CPU - {2AD6973D-C7BB-416E-89FE-EEE34664E05F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2AD6973D-C7BB-416E-89FE-EEE34664E05F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2AD6973D-C7BB-416E-89FE-EEE34664E05F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2AD6973D-C7BB-416E-89FE-EEE34664E05F}.Release|Any CPU.Build.0 = Release|Any CPU - {4A4595EF-6C37-4F99-96ED-4AE0B9E438D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4A4595EF-6C37-4F99-96ED-4AE0B9E438D3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4A4595EF-6C37-4F99-96ED-4AE0B9E438D3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4A4595EF-6C37-4F99-96ED-4AE0B9E438D3}.Release|Any CPU.Build.0 = Release|Any CPU - {43D0EC0B-1955-4566-8D31-7B9102DA1703}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {43D0EC0B-1955-4566-8D31-7B9102DA1703}.Debug|Any CPU.Build.0 = Debug|Any CPU - {43D0EC0B-1955-4566-8D31-7B9102DA1703}.Release|Any CPU.ActiveCfg = Release|Any CPU - {43D0EC0B-1955-4566-8D31-7B9102DA1703}.Release|Any CPU.Build.0 = Release|Any CPU - {FC1D74E8-7A4D-48F4-83DE-95C6173780C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FC1D74E8-7A4D-48F4-83DE-95C6173780C4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FC1D74E8-7A4D-48F4-83DE-95C6173780C4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FC1D74E8-7A4D-48F4-83DE-95C6173780C4}.Release|Any CPU.Build.0 = Release|Any CPU - {3158C928-888C-4A84-8BC1-4A8257489538}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3158C928-888C-4A84-8BC1-4A8257489538}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3158C928-888C-4A84-8BC1-4A8257489538}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3158C928-888C-4A84-8BC1-4A8257489538}.Release|Any CPU.Build.0 = Release|Any CPU - {642A49D7-8752-4177-80D6-BFBBCFAD3DE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {642A49D7-8752-4177-80D6-BFBBCFAD3DE0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {642A49D7-8752-4177-80D6-BFBBCFAD3DE0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {642A49D7-8752-4177-80D6-BFBBCFAD3DE0}.Release|Any CPU.Build.0 = Release|Any CPU - {6F759635-13D7-4E94-BCC9-80445D63F117}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6F759635-13D7-4E94-BCC9-80445D63F117}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6F759635-13D7-4E94-BCC9-80445D63F117}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6F759635-13D7-4E94-BCC9-80445D63F117}.Release|Any CPU.Build.0 = Release|Any CPU - {966EC390-3C7F-4D98-92A6-F0F30D02E9B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {966EC390-3C7F-4D98-92A6-F0F30D02E9B1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {966EC390-3C7F-4D98-92A6-F0F30D02E9B1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {966EC390-3C7F-4D98-92A6-F0F30D02E9B1}.Release|Any CPU.Build.0 = Release|Any CPU - {3F72A4E9-7B72-4260-B010-C16EC54F9BAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3F72A4E9-7B72-4260-B010-C16EC54F9BAF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3F72A4E9-7B72-4260-B010-C16EC54F9BAF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3F72A4E9-7B72-4260-B010-C16EC54F9BAF}.Release|Any CPU.Build.0 = Release|Any CPU - {475B6C45-B27C-438B-8966-908B9D6D1077}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {475B6C45-B27C-438B-8966-908B9D6D1077}.Debug|Any CPU.Build.0 = Debug|Any CPU - {475B6C45-B27C-438B-8966-908B9D6D1077}.Release|Any CPU.ActiveCfg = Release|Any CPU - {475B6C45-B27C-438B-8966-908B9D6D1077}.Release|Any CPU.Build.0 = Release|Any CPU - {66FCCD76-2761-47E3-8D11-B45D0001DDAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {66FCCD76-2761-47E3-8D11-B45D0001DDAA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {66FCCD76-2761-47E3-8D11-B45D0001DDAA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {66FCCD76-2761-47E3-8D11-B45D0001DDAA}.Release|Any CPU.Build.0 = Release|Any CPU - {3787DDE5-E5C8-4841-BDA7-DCB325388064}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3787DDE5-E5C8-4841-BDA7-DCB325388064}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3787DDE5-E5C8-4841-BDA7-DCB325388064}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3787DDE5-E5C8-4841-BDA7-DCB325388064}.Release|Any CPU.Build.0 = Release|Any CPU - {5531E894-D259-45A3-AA61-26DBE720C1CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5531E894-D259-45A3-AA61-26DBE720C1CE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5531E894-D259-45A3-AA61-26DBE720C1CE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5531E894-D259-45A3-AA61-26DBE720C1CE}.Release|Any CPU.Build.0 = Release|Any CPU - {91BC2E7F-DA04-421C-98EF-76D37CEC130C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {91BC2E7F-DA04-421C-98EF-76D37CEC130C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {91BC2E7F-DA04-421C-98EF-76D37CEC130C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {91BC2E7F-DA04-421C-98EF-76D37CEC130C}.Release|Any CPU.Build.0 = Release|Any CPU - {E826F796-8CE3-4B5B-8423-5AA5F81D2FC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E826F796-8CE3-4B5B-8423-5AA5F81D2FC3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E826F796-8CE3-4B5B-8423-5AA5F81D2FC3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E826F796-8CE3-4B5B-8423-5AA5F81D2FC3}.Release|Any CPU.Build.0 = Release|Any CPU - {2CF067CA-064B-43C6-8B88-5E3B99A65F1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2CF067CA-064B-43C6-8B88-5E3B99A65F1D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2CF067CA-064B-43C6-8B88-5E3B99A65F1D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2CF067CA-064B-43C6-8B88-5E3B99A65F1D}.Release|Any CPU.Build.0 = Release|Any CPU - {F301EF7D-F19C-4D83-AA94-CB64F29C037D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F301EF7D-F19C-4D83-AA94-CB64F29C037D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F301EF7D-F19C-4D83-AA94-CB64F29C037D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F301EF7D-F19C-4D83-AA94-CB64F29C037D}.Release|Any CPU.Build.0 = Release|Any CPU - {FE5C5947-D2D5-42C5-992A-13D672946135}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FE5C5947-D2D5-42C5-992A-13D672946135}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FE5C5947-D2D5-42C5-992A-13D672946135}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FE5C5947-D2D5-42C5-992A-13D672946135}.Release|Any CPU.Build.0 = Release|Any CPU - {9CD5C81F-5828-4384-8474-2E2BE71D5EDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9CD5C81F-5828-4384-8474-2E2BE71D5EDD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9CD5C81F-5828-4384-8474-2E2BE71D5EDD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9CD5C81F-5828-4384-8474-2E2BE71D5EDD}.Release|Any CPU.Build.0 = Release|Any CPU - {3BD22132-D538-48C6-8854-F71333C798EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3BD22132-D538-48C6-8854-F71333C798EB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3BD22132-D538-48C6-8854-F71333C798EB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3BD22132-D538-48C6-8854-F71333C798EB}.Release|Any CPU.Build.0 = Release|Any CPU - {1F0B6B85-8B0B-47CA-899D-F25B4F1B52C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1F0B6B85-8B0B-47CA-899D-F25B4F1B52C3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1F0B6B85-8B0B-47CA-899D-F25B4F1B52C3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1F0B6B85-8B0B-47CA-899D-F25B4F1B52C3}.Release|Any CPU.Build.0 = Release|Any CPU - {08191FCD-7258-4F19-95FB-AEC3DE77B2EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {08191FCD-7258-4F19-95FB-AEC3DE77B2EB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {08191FCD-7258-4F19-95FB-AEC3DE77B2EB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {08191FCD-7258-4F19-95FB-AEC3DE77B2EB}.Release|Any CPU.Build.0 = Release|Any CPU - {73A7688A-5BD3-4F7E-ADFA-CE36C5A10E3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {73A7688A-5BD3-4F7E-ADFA-CE36C5A10E3B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {73A7688A-5BD3-4F7E-ADFA-CE36C5A10E3B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {73A7688A-5BD3-4F7E-ADFA-CE36C5A10E3B}.Release|Any CPU.Build.0 = Release|Any CPU - {6E444FF1-A47C-4CF6-BB3F-507C8EBD776D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6E444FF1-A47C-4CF6-BB3F-507C8EBD776D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6E444FF1-A47C-4CF6-BB3F-507C8EBD776D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6E444FF1-A47C-4CF6-BB3F-507C8EBD776D}.Release|Any CPU.Build.0 = Release|Any CPU - {7059493C-8251-4764-9C1E-2368B8B485BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7059493C-8251-4764-9C1E-2368B8B485BC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7059493C-8251-4764-9C1E-2368B8B485BC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7059493C-8251-4764-9C1E-2368B8B485BC}.Release|Any CPU.Build.0 = Release|Any CPU - {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Release|Any CPU.Build.0 = Release|Any CPU - {5D13EF34-8B39-4EC5-847F-E12892ACF841}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5D13EF34-8B39-4EC5-847F-E12892ACF841}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5D13EF34-8B39-4EC5-847F-E12892ACF841}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5D13EF34-8B39-4EC5-847F-E12892ACF841}.Release|Any CPU.Build.0 = Release|Any CPU - {E649EA64-D213-461B-87F7-D67035801443}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E649EA64-D213-461B-87F7-D67035801443}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E649EA64-D213-461B-87F7-D67035801443}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E649EA64-D213-461B-87F7-D67035801443}.Release|Any CPU.Build.0 = Release|Any CPU - {CBC7993C-57D8-4A6C-992C-19E849DFE71D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CBC7993C-57D8-4A6C-992C-19E849DFE71D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CBC7993C-57D8-4A6C-992C-19E849DFE71D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CBC7993C-57D8-4A6C-992C-19E849DFE71D}.Release|Any CPU.Build.0 = Release|Any CPU - {7528BF74-25C7-4ABE-883A-443B4EEC4776}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7528BF74-25C7-4ABE-883A-443B4EEC4776}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7528BF74-25C7-4ABE-883A-443B4EEC4776}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7528BF74-25C7-4ABE-883A-443B4EEC4776}.Release|Any CPU.Build.0 = Release|Any CPU - {36B82383-D69E-4897-A24A-648BABDF80EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {36B82383-D69E-4897-A24A-648BABDF80EC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {36B82383-D69E-4897-A24A-648BABDF80EC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {36B82383-D69E-4897-A24A-648BABDF80EC}.Release|Any CPU.Build.0 = Release|Any CPU - {10AB3CE2-A720-467F-9EC8-EBB4BAC9A1C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {10AB3CE2-A720-467F-9EC8-EBB4BAC9A1C9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {10AB3CE2-A720-467F-9EC8-EBB4BAC9A1C9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {10AB3CE2-A720-467F-9EC8-EBB4BAC9A1C9}.Release|Any CPU.Build.0 = Release|Any CPU - {14A96B1A-9DC9-44C8-A675-206329E15263}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {14A96B1A-9DC9-44C8-A675-206329E15263}.Debug|Any CPU.Build.0 = Debug|Any CPU - {14A96B1A-9DC9-44C8-A675-206329E15263}.Release|Any CPU.ActiveCfg = Release|Any CPU - {14A96B1A-9DC9-44C8-A675-206329E15263}.Release|Any CPU.Build.0 = Release|Any CPU - {3DD574CD-9C5D-4A45-85E1-EBBA64C22B5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3DD574CD-9C5D-4A45-85E1-EBBA64C22B5F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3DD574CD-9C5D-4A45-85E1-EBBA64C22B5F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3DD574CD-9C5D-4A45-85E1-EBBA64C22B5F}.Release|Any CPU.Build.0 = Release|Any CPU - {82190F52-2901-46D6-8A4C-34649959483F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {82190F52-2901-46D6-8A4C-34649959483F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {82190F52-2901-46D6-8A4C-34649959483F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {82190F52-2901-46D6-8A4C-34649959483F}.Release|Any CPU.Build.0 = Release|Any CPU - {085948FF-0E9B-4A9A-B564-F8B8B4BDDDBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {085948FF-0E9B-4A9A-B564-F8B8B4BDDDBC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {085948FF-0E9B-4A9A-B564-F8B8B4BDDDBC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {085948FF-0E9B-4A9A-B564-F8B8B4BDDDBC}.Release|Any CPU.Build.0 = Release|Any CPU - {6BD8B2FA-F2E3-4AC8-A4C3-2925A653889A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6BD8B2FA-F2E3-4AC8-A4C3-2925A653889A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6BD8B2FA-F2E3-4AC8-A4C3-2925A653889A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6BD8B2FA-F2E3-4AC8-A4C3-2925A653889A}.Release|Any CPU.Build.0 = Release|Any CPU - {ED715544-E649-4F48-B8EE-9368C41C3AC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ED715544-E649-4F48-B8EE-9368C41C3AC0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ED715544-E649-4F48-B8EE-9368C41C3AC0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ED715544-E649-4F48-B8EE-9368C41C3AC0}.Release|Any CPU.Build.0 = Release|Any CPU - {2C5EB8B3-A313-413D-BAA0-5C21D2A6EC6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2C5EB8B3-A313-413D-BAA0-5C21D2A6EC6E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2C5EB8B3-A313-413D-BAA0-5C21D2A6EC6E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2C5EB8B3-A313-413D-BAA0-5C21D2A6EC6E}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} = {F2AB7512-139A-420F-AE3A-9ED22CA52CE1} - {9916839C-39FC-4CEB-A5AF-89CA7E87119F} = {F2AB7512-139A-420F-AE3A-9ED22CA52CE1} - {63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {14C049FD-B35B-415A-A824-87F26B26E7FD} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {0E7646E8-FE8F-43C1-8799-D97860925EC4} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {EA2B9121-EF54-40A6-A53E-6593C86EE696} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB} = {B6092A92-1071-4C30-AD55-8E8D46BC2F14} - {17F86780-9A1F-4AA1-86F1-875EEC2730C7} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {72457126-E118-4171-A08F-9A709EE4B7FC} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {D10AD48F-407D-4DB5-A328-173EC7CB010F} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {4BE4EB01-AC56-4048-924E-2CA77F509ABA} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {5D0F00F0-26C9-4785-AD61-B85710C60EB0} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {CDE24A24-01D3-403C-84B9-37722E18DFB7} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {79AED36E-ABD0-4747-93D3-8722B042454B} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {954CA994-D204-468B-9D69-51F6AD3E1C29} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {33B1BC8D-E292-4972-A363-22056B207156} = {75E7476C-C05B-4C41-8E38-081D3EB55659} - {D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {1C981BB3-26F7-494C-9005-CC27A5144233} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {05660F47-D649-48BD-9DED-DF4E01E7CFF9} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {8F116B06-1C0E-4E4C-9A0A-D2FAB851E768} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {EA4F1DA7-F2AB-4384-9AA4-9B756E2026B1} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {194D3CCC-1153-474D-8176-FDE8D7D0D0BD} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {CB70A642-8CEC-4DDE-8C9F-AD08900EC98D} = {84650275-884D-4CBB-9CC0-67553996E211} - {FBC8B571-ED50-49D8-8D9D-64AB7454A0D6} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {137906EA-15FE-4AD8-A6A0-27528F0477D6} = {B6092A92-1071-4C30-AD55-8E8D46BC2F14} - {3420C92A-747F-4990-BA08-F2C9531E44AD} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {C889167C-E52C-4A65-A419-224B3D1B957D} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {99002B65-86F7-415E-BF4A-381AA8AB9CCC} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {2AD6973D-C7BB-416E-89FE-EEE34664E05F} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {4A4595EF-6C37-4F99-96ED-4AE0B9E438D3} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {43D0EC0B-1955-4566-8D31-7B9102DA1703} = {B6092A92-1071-4C30-AD55-8E8D46BC2F14} - {FC1D74E8-7A4D-48F4-83DE-95C6173780C4} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {3158C928-888C-4A84-8BC1-4A8257489538} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {642A49D7-8752-4177-80D6-BFBBCFAD3DE0} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {6F759635-13D7-4E94-BCC9-80445D63F117} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {966EC390-3C7F-4D98-92A6-F0F30D02E9B1} = {B6092A92-1071-4C30-AD55-8E8D46BC2F14} - {3F72A4E9-7B72-4260-B010-C16EC54F9BAF} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {475B6C45-B27C-438B-8966-908B9D6D1077} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {66FCCD76-2761-47E3-8D11-B45D0001DDAA} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {3787DDE5-E5C8-4841-BDA7-DCB325388064} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {5531E894-D259-45A3-AA61-26DBE720C1CE} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {91BC2E7F-DA04-421C-98EF-76D37CEC130C} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {E826F796-8CE3-4B5B-8423-5AA5F81D2FC3} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {2CF067CA-064B-43C6-8B88-5E3B99A65F1D} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {F301EF7D-F19C-4D83-AA94-CB64F29C037D} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {FE5C5947-D2D5-42C5-992A-13D672946135} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {9CD5C81F-5828-4384-8474-2E2BE71D5EDD} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {3BD22132-D538-48C6-8854-F71333C798EB} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {1F0B6B85-8B0B-47CA-899D-F25B4F1B52C3} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {08191FCD-7258-4F19-95FB-AEC3DE77B2EB} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {73A7688A-5BD3-4F7E-ADFA-CE36C5A10E3B} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {6E444FF1-A47C-4CF6-BB3F-507C8EBD776D} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {7059493C-8251-4764-9C1E-2368B8B485BC} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {5D13EF34-8B39-4EC5-847F-E12892ACF841} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {E649EA64-D213-461B-87F7-D67035801443} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {7528BF74-25C7-4ABE-883A-443B4EEC4776} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {36B82383-D69E-4897-A24A-648BABDF80EC} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {10AB3CE2-A720-467F-9EC8-EBB4BAC9A1C9} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {14A96B1A-9DC9-44C8-A675-206329E15263} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {3DD574CD-9C5D-4A45-85E1-EBBA64C22B5F} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {82190F52-2901-46D6-8A4C-34649959483F} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {085948FF-0E9B-4A9A-B564-F8B8B4BDDDBC} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {6BD8B2FA-F2E3-4AC8-A4C3-2925A653889A} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {ED715544-E649-4F48-B8EE-9368C41C3AC0} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - {2C5EB8B3-A313-413D-BAA0-5C21D2A6EC6E} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{75E7476C-C05B-4C41-8E38-081D3EB55659}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Themes", "Themes", "{84650275-884D-4CBB-9CC0-67553996E211}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules.Deprecated", "Modules.Deprecated", "{B6092A92-1071-4C30-AD55-8E8D46BC2F14}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Orchard", "Orchard", "{F2AB7512-139A-420F-AE3A-9ED22CA52CE1}" +EndProject +Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "Orchard.Azure.CloudService", "Orchard.Azure.CloudService\Orchard.Azure.CloudService.ccproj", "{03C5327D-4E8E-45A7-ACD1-E18E7CAA3C4A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Azure.Web", "Orchard.Azure.Web\Orchard.Azure.Web.csproj", "{0DF8F426-9F30-4918-8F64-A5B40BA12D10}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Framework", "..\Orchard\Orchard.Framework.csproj", "{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Core", "..\Orchard.Web\Core\Orchard.Core.csproj", "{9916839C-39FC-4CEB-A5AF-89CA7E87119F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Blogs", "..\Orchard.Web\Modules\Orchard.Blogs\Orchard.Blogs.csproj", "{63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Comments", "..\Orchard.Web\Modules\Orchard.Comments\Orchard.Comments.csproj", "{14C049FD-B35B-415A-A824-87F26B26E7FD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.ContentTypes", "..\Orchard.Web\Modules\Orchard.ContentTypes\Orchard.ContentTypes.csproj", "{0E7646E8-FE8F-43C1-8799-D97860925EC4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Indexing", "..\Orchard.Web\Modules\Orchard.Indexing\Orchard.Indexing.csproj", "{EA2B9121-EF54-40A6-A53E-6593C86EE696}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Media", "..\Orchard.Web\Modules\Orchard.Media\Orchard.Media.csproj", "{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Modules", "..\Orchard.Web\Modules\Orchard.Modules\Orchard.Modules.csproj", "{17F86780-9A1F-4AA1-86F1-875EEC2730C7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.MultiTenancy", "..\Orchard.Web\Modules\Orchard.MultiTenancy\Orchard.MultiTenancy.csproj", "{72457126-E118-4171-A08F-9A709EE4B7FC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Roles", "..\Orchard.Web\Modules\Orchard.Roles\Orchard.Roles.csproj", "{D10AD48F-407D-4DB5-A328-173EC7CB010F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Search", "..\Orchard.Web\Modules\Orchard.Search\Orchard.Search.csproj", "{4BE4EB01-AC56-4048-924E-2CA77F509ABA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Setup", "..\Orchard.Web\Modules\Orchard.Setup\Orchard.Setup.csproj", "{8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Tags", "..\Orchard.Web\Modules\Orchard.Tags\Orchard.Tags.csproj", "{5D0F00F0-26C9-4785-AD61-B85710C60EB0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Themes", "..\Orchard.Web\Modules\Orchard.Themes\Orchard.Themes.csproj", "{CDE24A24-01D3-403C-84B9-37722E18DFB7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Users", "..\Orchard.Web\Modules\Orchard.Users\Orchard.Users.csproj", "{79AED36E-ABD0-4747-93D3-8722B042454B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinyMce", "..\Orchard.Web\Modules\TinyMce\TinyMce.csproj", "{954CA994-D204-468B-9D69-51F6AD3E1C29}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard", "..\Tools\Orchard\Orchard.csproj", "{33B1BC8D-E292-4972-A363-22056B207156}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lucene", "..\Orchard.Web\Modules\Lucene\Lucene.csproj", "{D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Packaging", "..\Orchard.Web\Modules\Orchard.Packaging\Orchard.Packaging.csproj", "{DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.CodeGeneration", "..\Orchard.Web\Modules\Orchard.CodeGeneration\Orchard.CodeGeneration.csproj", "{C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.ArchiveLater", "..\Orchard.Web\Modules\Orchard.ArchiveLater\Orchard.ArchiveLater.csproj", "{1C981BB3-26F7-494C-9005-CC27A5144233}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Email", "..\Orchard.Web\Modules\Orchard.Email\Orchard.Email.csproj", "{05660F47-D649-48BD-9DED-DF4E01E7CFF9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.jQuery", "..\Orchard.Web\Modules\Orchard.jQuery\Orchard.jQuery.csproj", "{8F116B06-1C0E-4E4C-9A0A-D2FAB851E768}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Migrations", "..\Orchard.Web\Modules\Orchard.Migrations\Orchard.Migrations.csproj", "{EA4F1DA7-F2AB-4384-9AA4-9B756E2026B1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Widgets", "..\Orchard.Web\Modules\Orchard.Widgets\Orchard.Widgets.csproj", "{194D3CCC-1153-474D-8176-FDE8D7D0D0BD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Themes", "..\Orchard.Web\Themes\Themes.csproj", "{CB70A642-8CEC-4DDE-8C9F-AD08900EC98D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Localization", "..\Orchard.Web\Modules\Orchard.Localization\Orchard.Localization.csproj", "{FBC8B571-ED50-49D8-8D9D-64AB7454A0D6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Lists", "..\Orchard.Web\Modules\Orchard.Lists\Orchard.Lists.csproj", "{137906EA-15FE-4AD8-A6A0-27528F0477D6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Pages", "..\Orchard.Web\Modules\Orchard.Pages\Orchard.Pages.csproj", "{3420C92A-747F-4990-BA08-F2C9531E44AD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.PublishLater", "..\Orchard.Web\Modules\Orchard.PublishLater\Orchard.PublishLater.csproj", "{C889167C-E52C-4A65-A419-224B3D1B957D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Scripting", "..\Orchard.Web\Modules\Orchard.Scripting\Orchard.Scripting.csproj", "{99002B65-86F7-415E-BF4A-381AA8AB9CCC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Scripting.Dlr", "..\Orchard.Web\Modules\Orchard.Scripting.Dlr\Orchard.Scripting.Dlr.csproj", "{2AD6973D-C7BB-416E-89FE-EEE34664E05F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.DesignerTools", "..\Orchard.Web\Modules\Orchard.DesignerTools\Orchard.DesignerTools.csproj", "{4A4595EF-6C37-4F99-96ED-4AE0B9E438D3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.MediaPicker", "..\Orchard.Web\Modules\Orchard.MediaPicker\Orchard.MediaPicker.csproj", "{43D0EC0B-1955-4566-8D31-7B9102DA1703}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Recipes", "..\Orchard.Web\Modules\Orchard.Recipes\Orchard.Recipes.csproj", "{FC1D74E8-7A4D-48F4-83DE-95C6173780C4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Markdown", "..\Orchard.Web\Modules\Markdown\Markdown.csproj", "{3158C928-888C-4A84-8BC1-4A8257489538}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Forms", "..\Orchard.Web\Modules\Orchard.Forms\Orchard.Forms.csproj", "{642A49D7-8752-4177-80D6-BFBBCFAD3DE0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Tokens", "..\Orchard.Web\Modules\Orchard.Tokens\Orchard.Tokens.csproj", "{6F759635-13D7-4E94-BCC9-80445D63F117}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Rules", "..\Orchard.Web\Modules\Orchard.Rules\Orchard.Rules.csproj", "{966EC390-3C7F-4D98-92A6-F0F30D02E9B1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.TaskLease", "..\Orchard.Web\Modules\Orchard.TaskLease\Orchard.TaskLease.csproj", "{3F72A4E9-7B72-4260-B010-C16EC54F9BAF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Alias", "..\Orchard.Web\Modules\Orchard.Alias\Orchard.Alias.csproj", "{475B6C45-B27C-438B-8966-908B9D6D1077}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Autoroute", "..\Orchard.Web\Modules\Orchard.Autoroute\Orchard.Autoroute.csproj", "{66FCCD76-2761-47E3-8D11-B45D0001DDAA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Fields", "..\Orchard.Web\Modules\Orchard.Fields\Orchard.Fields.csproj", "{3787DDE5-E5C8-4841-BDA7-DCB325388064}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Projections", "..\Orchard.Web\Modules\Orchard.Projections\Orchard.Projections.csproj", "{5531E894-D259-45A3-AA61-26DBE720C1CE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.AntiSpam", "..\Orchard.Web\Modules\Orchard.AntiSpam\Orchard.AntiSpam.csproj", "{91BC2E7F-DA04-421C-98EF-76D37CEC130C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.ContentPermissions", "..\Orchard.Web\Modules\Orchard.ContentPermissions\Orchard.ContentPermissions.csproj", "{E826F796-8CE3-4B5B-8423-5AA5F81D2FC3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.CustomForms", "..\Orchard.Web\Modules\Orchard.CustomForms\Orchard.CustomForms.csproj", "{2CF067CA-064B-43C6-8B88-5E3B99A65F1D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.ContentPicker", "..\Orchard.Web\Modules\Orchard.ContentPicker\Orchard.ContentPicker.csproj", "{F301EF7D-F19C-4D83-AA94-CB64F29C037D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.ImportExport", "..\Orchard.Web\Modules\Orchard.ImportExport\Orchard.ImportExport.csproj", "{FE5C5947-D2D5-42C5-992A-13D672946135}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Warmup", "..\Orchard.Web\Modules\Orchard.Warmup\Orchard.Warmup.csproj", "{9CD5C81F-5828-4384-8474-2E2BE71D5EDD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SysCache", "..\Orchard.Web\Modules\SysCache\SysCache.csproj", "{3BD22132-D538-48C6-8854-F71333C798EB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.ImageEditor", "..\Orchard.Web\Modules\Orchard.ImageEditor\Orchard.ImageEditor.csproj", "{1F0B6B85-8B0B-47CA-899D-F25B4F1B52C3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.MediaProcessing", "..\Orchard.Web\Modules\Orchard.MediaProcessing\Orchard.MediaProcessing.csproj", "{08191FCD-7258-4F19-95FB-AEC3DE77B2EB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.MediaLibrary", "..\Orchard.Web\Modules\Orchard.MediaLibrary\Orchard.MediaLibrary.csproj", "{73A7688A-5BD3-4F7E-ADFA-CE36C5A10E3B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.OutputCache", "..\Orchard.Web\Modules\Orchard.OutputCache\Orchard.OutputCache.csproj", "{6E444FF1-A47C-4CF6-BB3F-507C8EBD776D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Workflows", "..\Orchard.Web\Modules\Orchard.Workflows\Orchard.Workflows.csproj", "{7059493C-8251-4764-9C1E-2368B8B485BC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Upgrade", "..\Orchard.Web\Modules\Upgrade\Upgrade.csproj", "{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Scripting.CSharp", "..\Orchard.Web\Modules\Orchard.Scripting.CSharp\Orchard.Scripting.CSharp.csproj", "{5D13EF34-8B39-4EC5-847F-E12892ACF841}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Taxonomies", "..\Orchard.Web\Modules\Orchard.Taxonomies\Orchard.Taxonomies.csproj", "{E649EA64-D213-461B-87F7-D67035801443}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Azure", "..\Orchard.Web\Modules\Orchard.Azure\Orchard.Azure.csproj", "{CBC7993C-57D8-4A6C-992C-19E849DFE71D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Caching", "..\Orchard.Web\Modules\Orchard.Caching\Orchard.Caching.csproj", "{7528BF74-25C7-4ABE-883A-443B4EEC4776}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.SecureSocketsLayer", "..\Orchard.Web\Modules\Orchard.SecureSocketsLayer\Orchard.SecureSocketsLayer.csproj", "{36B82383-D69E-4897-A24A-648BABDF80EC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Templates", "..\Orchard.Web\Modules\Orchard.Templates\Orchard.Templates.csproj", "{10AB3CE2-A720-467F-9EC8-EBB4BAC9A1C9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Azure.MediaServices", "..\Orchard.Web\Modules\Orchard.Azure.MediaServices\Orchard.Azure.MediaServices.csproj", "{14A96B1A-9DC9-44C8-A675-206329E15263}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.AuditTrail", "..\Orchard.Web\Modules\Orchard.AuditTrail\Orchard.AuditTrail.csproj", "{3DD574CD-9C5D-4A45-85E1-EBBA64C22B5F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.DynamicForms", "..\Orchard.Web\Modules\Orchard.DynamicForms\Orchard.DynamicForms.csproj", "{82190F52-2901-46D6-8A4C-34649959483F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.JobsQueue", "..\Orchard.Web\Modules\Orchard.JobsQueue\Orchard.JobsQueue.csproj", "{085948FF-0E9B-4A9A-B564-F8B8B4BDDDBC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Layouts", "..\Orchard.Web\Modules\Orchard.Layouts\Orchard.Layouts.csproj", "{6BD8B2FA-F2E3-4AC8-A4C3-2925A653889A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.MessageBus", "..\Orchard.Web\Modules\Orchard.MessageBus\Orchard.MessageBus.csproj", "{ED715544-E649-4F48-B8EE-9368C41C3AC0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Redis", "..\Orchard.Web\Modules\Orchard.Redis\Orchard.Redis.csproj", "{2C5EB8B3-A313-413D-BAA0-5C21D2A6EC6E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {03C5327D-4E8E-45A7-ACD1-E18E7CAA3C4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {03C5327D-4E8E-45A7-ACD1-E18E7CAA3C4A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {03C5327D-4E8E-45A7-ACD1-E18E7CAA3C4A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {03C5327D-4E8E-45A7-ACD1-E18E7CAA3C4A}.Release|Any CPU.Build.0 = Release|Any CPU + {0DF8F426-9F30-4918-8F64-A5B40BA12D10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0DF8F426-9F30-4918-8F64-A5B40BA12D10}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0DF8F426-9F30-4918-8F64-A5B40BA12D10}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0DF8F426-9F30-4918-8F64-A5B40BA12D10}.Release|Any CPU.Build.0 = Release|Any CPU + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}.Release|Any CPU.Build.0 = Release|Any CPU + {9916839C-39FC-4CEB-A5AF-89CA7E87119F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9916839C-39FC-4CEB-A5AF-89CA7E87119F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9916839C-39FC-4CEB-A5AF-89CA7E87119F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9916839C-39FC-4CEB-A5AF-89CA7E87119F}.Release|Any CPU.Build.0 = Release|Any CPU + {63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867}.Debug|Any CPU.Build.0 = Debug|Any CPU + {63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867}.Release|Any CPU.ActiveCfg = Release|Any CPU + {63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867}.Release|Any CPU.Build.0 = Release|Any CPU + {14C049FD-B35B-415A-A824-87F26B26E7FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {14C049FD-B35B-415A-A824-87F26B26E7FD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {14C049FD-B35B-415A-A824-87F26B26E7FD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {14C049FD-B35B-415A-A824-87F26B26E7FD}.Release|Any CPU.Build.0 = Release|Any CPU + {0E7646E8-FE8F-43C1-8799-D97860925EC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0E7646E8-FE8F-43C1-8799-D97860925EC4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0E7646E8-FE8F-43C1-8799-D97860925EC4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0E7646E8-FE8F-43C1-8799-D97860925EC4}.Release|Any CPU.Build.0 = Release|Any CPU + {EA2B9121-EF54-40A6-A53E-6593C86EE696}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EA2B9121-EF54-40A6-A53E-6593C86EE696}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EA2B9121-EF54-40A6-A53E-6593C86EE696}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EA2B9121-EF54-40A6-A53E-6593C86EE696}.Release|Any CPU.Build.0 = Release|Any CPU + {D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.Release|Any CPU.Build.0 = Release|Any CPU + {17F86780-9A1F-4AA1-86F1-875EEC2730C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {17F86780-9A1F-4AA1-86F1-875EEC2730C7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {17F86780-9A1F-4AA1-86F1-875EEC2730C7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {17F86780-9A1F-4AA1-86F1-875EEC2730C7}.Release|Any CPU.Build.0 = Release|Any CPU + {72457126-E118-4171-A08F-9A709EE4B7FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {72457126-E118-4171-A08F-9A709EE4B7FC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {72457126-E118-4171-A08F-9A709EE4B7FC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {72457126-E118-4171-A08F-9A709EE4B7FC}.Release|Any CPU.Build.0 = Release|Any CPU + {D10AD48F-407D-4DB5-A328-173EC7CB010F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D10AD48F-407D-4DB5-A328-173EC7CB010F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D10AD48F-407D-4DB5-A328-173EC7CB010F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D10AD48F-407D-4DB5-A328-173EC7CB010F}.Release|Any CPU.Build.0 = Release|Any CPU + {4BE4EB01-AC56-4048-924E-2CA77F509ABA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4BE4EB01-AC56-4048-924E-2CA77F509ABA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4BE4EB01-AC56-4048-924E-2CA77F509ABA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4BE4EB01-AC56-4048-924E-2CA77F509ABA}.Release|Any CPU.Build.0 = Release|Any CPU + {8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4}.Release|Any CPU.Build.0 = Release|Any CPU + {5D0F00F0-26C9-4785-AD61-B85710C60EB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5D0F00F0-26C9-4785-AD61-B85710C60EB0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5D0F00F0-26C9-4785-AD61-B85710C60EB0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5D0F00F0-26C9-4785-AD61-B85710C60EB0}.Release|Any CPU.Build.0 = Release|Any CPU + {CDE24A24-01D3-403C-84B9-37722E18DFB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CDE24A24-01D3-403C-84B9-37722E18DFB7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CDE24A24-01D3-403C-84B9-37722E18DFB7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CDE24A24-01D3-403C-84B9-37722E18DFB7}.Release|Any CPU.Build.0 = Release|Any CPU + {79AED36E-ABD0-4747-93D3-8722B042454B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {79AED36E-ABD0-4747-93D3-8722B042454B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {79AED36E-ABD0-4747-93D3-8722B042454B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {79AED36E-ABD0-4747-93D3-8722B042454B}.Release|Any CPU.Build.0 = Release|Any CPU + {954CA994-D204-468B-9D69-51F6AD3E1C29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {954CA994-D204-468B-9D69-51F6AD3E1C29}.Debug|Any CPU.Build.0 = Debug|Any CPU + {954CA994-D204-468B-9D69-51F6AD3E1C29}.Release|Any CPU.ActiveCfg = Release|Any CPU + {954CA994-D204-468B-9D69-51F6AD3E1C29}.Release|Any CPU.Build.0 = Release|Any CPU + {33B1BC8D-E292-4972-A363-22056B207156}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {33B1BC8D-E292-4972-A363-22056B207156}.Debug|Any CPU.Build.0 = Debug|Any CPU + {33B1BC8D-E292-4972-A363-22056B207156}.Release|Any CPU.ActiveCfg = Release|Any CPU + {33B1BC8D-E292-4972-A363-22056B207156}.Release|Any CPU.Build.0 = Release|Any CPU + {D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D}.Release|Any CPU.Build.0 = Release|Any CPU + {DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059}.Release|Any CPU.Build.0 = Release|Any CPU + {C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962}.Release|Any CPU.Build.0 = Release|Any CPU + {1C981BB3-26F7-494C-9005-CC27A5144233}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1C981BB3-26F7-494C-9005-CC27A5144233}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1C981BB3-26F7-494C-9005-CC27A5144233}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1C981BB3-26F7-494C-9005-CC27A5144233}.Release|Any CPU.Build.0 = Release|Any CPU + {05660F47-D649-48BD-9DED-DF4E01E7CFF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {05660F47-D649-48BD-9DED-DF4E01E7CFF9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {05660F47-D649-48BD-9DED-DF4E01E7CFF9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {05660F47-D649-48BD-9DED-DF4E01E7CFF9}.Release|Any CPU.Build.0 = Release|Any CPU + {8F116B06-1C0E-4E4C-9A0A-D2FAB851E768}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8F116B06-1C0E-4E4C-9A0A-D2FAB851E768}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8F116B06-1C0E-4E4C-9A0A-D2FAB851E768}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8F116B06-1C0E-4E4C-9A0A-D2FAB851E768}.Release|Any CPU.Build.0 = Release|Any CPU + {EA4F1DA7-F2AB-4384-9AA4-9B756E2026B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EA4F1DA7-F2AB-4384-9AA4-9B756E2026B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EA4F1DA7-F2AB-4384-9AA4-9B756E2026B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EA4F1DA7-F2AB-4384-9AA4-9B756E2026B1}.Release|Any CPU.Build.0 = Release|Any CPU + {194D3CCC-1153-474D-8176-FDE8D7D0D0BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {194D3CCC-1153-474D-8176-FDE8D7D0D0BD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {194D3CCC-1153-474D-8176-FDE8D7D0D0BD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {194D3CCC-1153-474D-8176-FDE8D7D0D0BD}.Release|Any CPU.Build.0 = Release|Any CPU + {CB70A642-8CEC-4DDE-8C9F-AD08900EC98D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CB70A642-8CEC-4DDE-8C9F-AD08900EC98D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CB70A642-8CEC-4DDE-8C9F-AD08900EC98D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CB70A642-8CEC-4DDE-8C9F-AD08900EC98D}.Release|Any CPU.Build.0 = Release|Any CPU + {FBC8B571-ED50-49D8-8D9D-64AB7454A0D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FBC8B571-ED50-49D8-8D9D-64AB7454A0D6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FBC8B571-ED50-49D8-8D9D-64AB7454A0D6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FBC8B571-ED50-49D8-8D9D-64AB7454A0D6}.Release|Any CPU.Build.0 = Release|Any CPU + {137906EA-15FE-4AD8-A6A0-27528F0477D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {137906EA-15FE-4AD8-A6A0-27528F0477D6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {137906EA-15FE-4AD8-A6A0-27528F0477D6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {137906EA-15FE-4AD8-A6A0-27528F0477D6}.Release|Any CPU.Build.0 = Release|Any CPU + {3420C92A-747F-4990-BA08-F2C9531E44AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3420C92A-747F-4990-BA08-F2C9531E44AD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3420C92A-747F-4990-BA08-F2C9531E44AD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3420C92A-747F-4990-BA08-F2C9531E44AD}.Release|Any CPU.Build.0 = Release|Any CPU + {C889167C-E52C-4A65-A419-224B3D1B957D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C889167C-E52C-4A65-A419-224B3D1B957D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C889167C-E52C-4A65-A419-224B3D1B957D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C889167C-E52C-4A65-A419-224B3D1B957D}.Release|Any CPU.Build.0 = Release|Any CPU + {99002B65-86F7-415E-BF4A-381AA8AB9CCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {99002B65-86F7-415E-BF4A-381AA8AB9CCC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {99002B65-86F7-415E-BF4A-381AA8AB9CCC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {99002B65-86F7-415E-BF4A-381AA8AB9CCC}.Release|Any CPU.Build.0 = Release|Any CPU + {2AD6973D-C7BB-416E-89FE-EEE34664E05F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2AD6973D-C7BB-416E-89FE-EEE34664E05F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2AD6973D-C7BB-416E-89FE-EEE34664E05F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2AD6973D-C7BB-416E-89FE-EEE34664E05F}.Release|Any CPU.Build.0 = Release|Any CPU + {4A4595EF-6C37-4F99-96ED-4AE0B9E438D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4A4595EF-6C37-4F99-96ED-4AE0B9E438D3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4A4595EF-6C37-4F99-96ED-4AE0B9E438D3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4A4595EF-6C37-4F99-96ED-4AE0B9E438D3}.Release|Any CPU.Build.0 = Release|Any CPU + {43D0EC0B-1955-4566-8D31-7B9102DA1703}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {43D0EC0B-1955-4566-8D31-7B9102DA1703}.Debug|Any CPU.Build.0 = Debug|Any CPU + {43D0EC0B-1955-4566-8D31-7B9102DA1703}.Release|Any CPU.ActiveCfg = Release|Any CPU + {43D0EC0B-1955-4566-8D31-7B9102DA1703}.Release|Any CPU.Build.0 = Release|Any CPU + {FC1D74E8-7A4D-48F4-83DE-95C6173780C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FC1D74E8-7A4D-48F4-83DE-95C6173780C4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FC1D74E8-7A4D-48F4-83DE-95C6173780C4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FC1D74E8-7A4D-48F4-83DE-95C6173780C4}.Release|Any CPU.Build.0 = Release|Any CPU + {3158C928-888C-4A84-8BC1-4A8257489538}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3158C928-888C-4A84-8BC1-4A8257489538}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3158C928-888C-4A84-8BC1-4A8257489538}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3158C928-888C-4A84-8BC1-4A8257489538}.Release|Any CPU.Build.0 = Release|Any CPU + {642A49D7-8752-4177-80D6-BFBBCFAD3DE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {642A49D7-8752-4177-80D6-BFBBCFAD3DE0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {642A49D7-8752-4177-80D6-BFBBCFAD3DE0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {642A49D7-8752-4177-80D6-BFBBCFAD3DE0}.Release|Any CPU.Build.0 = Release|Any CPU + {6F759635-13D7-4E94-BCC9-80445D63F117}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6F759635-13D7-4E94-BCC9-80445D63F117}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6F759635-13D7-4E94-BCC9-80445D63F117}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6F759635-13D7-4E94-BCC9-80445D63F117}.Release|Any CPU.Build.0 = Release|Any CPU + {966EC390-3C7F-4D98-92A6-F0F30D02E9B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {966EC390-3C7F-4D98-92A6-F0F30D02E9B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {966EC390-3C7F-4D98-92A6-F0F30D02E9B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {966EC390-3C7F-4D98-92A6-F0F30D02E9B1}.Release|Any CPU.Build.0 = Release|Any CPU + {3F72A4E9-7B72-4260-B010-C16EC54F9BAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3F72A4E9-7B72-4260-B010-C16EC54F9BAF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3F72A4E9-7B72-4260-B010-C16EC54F9BAF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3F72A4E9-7B72-4260-B010-C16EC54F9BAF}.Release|Any CPU.Build.0 = Release|Any CPU + {475B6C45-B27C-438B-8966-908B9D6D1077}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {475B6C45-B27C-438B-8966-908B9D6D1077}.Debug|Any CPU.Build.0 = Debug|Any CPU + {475B6C45-B27C-438B-8966-908B9D6D1077}.Release|Any CPU.ActiveCfg = Release|Any CPU + {475B6C45-B27C-438B-8966-908B9D6D1077}.Release|Any CPU.Build.0 = Release|Any CPU + {66FCCD76-2761-47E3-8D11-B45D0001DDAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {66FCCD76-2761-47E3-8D11-B45D0001DDAA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {66FCCD76-2761-47E3-8D11-B45D0001DDAA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {66FCCD76-2761-47E3-8D11-B45D0001DDAA}.Release|Any CPU.Build.0 = Release|Any CPU + {3787DDE5-E5C8-4841-BDA7-DCB325388064}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3787DDE5-E5C8-4841-BDA7-DCB325388064}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3787DDE5-E5C8-4841-BDA7-DCB325388064}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3787DDE5-E5C8-4841-BDA7-DCB325388064}.Release|Any CPU.Build.0 = Release|Any CPU + {5531E894-D259-45A3-AA61-26DBE720C1CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5531E894-D259-45A3-AA61-26DBE720C1CE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5531E894-D259-45A3-AA61-26DBE720C1CE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5531E894-D259-45A3-AA61-26DBE720C1CE}.Release|Any CPU.Build.0 = Release|Any CPU + {91BC2E7F-DA04-421C-98EF-76D37CEC130C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {91BC2E7F-DA04-421C-98EF-76D37CEC130C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {91BC2E7F-DA04-421C-98EF-76D37CEC130C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {91BC2E7F-DA04-421C-98EF-76D37CEC130C}.Release|Any CPU.Build.0 = Release|Any CPU + {E826F796-8CE3-4B5B-8423-5AA5F81D2FC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E826F796-8CE3-4B5B-8423-5AA5F81D2FC3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E826F796-8CE3-4B5B-8423-5AA5F81D2FC3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E826F796-8CE3-4B5B-8423-5AA5F81D2FC3}.Release|Any CPU.Build.0 = Release|Any CPU + {2CF067CA-064B-43C6-8B88-5E3B99A65F1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2CF067CA-064B-43C6-8B88-5E3B99A65F1D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2CF067CA-064B-43C6-8B88-5E3B99A65F1D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2CF067CA-064B-43C6-8B88-5E3B99A65F1D}.Release|Any CPU.Build.0 = Release|Any CPU + {F301EF7D-F19C-4D83-AA94-CB64F29C037D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F301EF7D-F19C-4D83-AA94-CB64F29C037D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F301EF7D-F19C-4D83-AA94-CB64F29C037D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F301EF7D-F19C-4D83-AA94-CB64F29C037D}.Release|Any CPU.Build.0 = Release|Any CPU + {FE5C5947-D2D5-42C5-992A-13D672946135}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FE5C5947-D2D5-42C5-992A-13D672946135}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FE5C5947-D2D5-42C5-992A-13D672946135}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FE5C5947-D2D5-42C5-992A-13D672946135}.Release|Any CPU.Build.0 = Release|Any CPU + {9CD5C81F-5828-4384-8474-2E2BE71D5EDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9CD5C81F-5828-4384-8474-2E2BE71D5EDD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9CD5C81F-5828-4384-8474-2E2BE71D5EDD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9CD5C81F-5828-4384-8474-2E2BE71D5EDD}.Release|Any CPU.Build.0 = Release|Any CPU + {3BD22132-D538-48C6-8854-F71333C798EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3BD22132-D538-48C6-8854-F71333C798EB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3BD22132-D538-48C6-8854-F71333C798EB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3BD22132-D538-48C6-8854-F71333C798EB}.Release|Any CPU.Build.0 = Release|Any CPU + {1F0B6B85-8B0B-47CA-899D-F25B4F1B52C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F0B6B85-8B0B-47CA-899D-F25B4F1B52C3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F0B6B85-8B0B-47CA-899D-F25B4F1B52C3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F0B6B85-8B0B-47CA-899D-F25B4F1B52C3}.Release|Any CPU.Build.0 = Release|Any CPU + {08191FCD-7258-4F19-95FB-AEC3DE77B2EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {08191FCD-7258-4F19-95FB-AEC3DE77B2EB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {08191FCD-7258-4F19-95FB-AEC3DE77B2EB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {08191FCD-7258-4F19-95FB-AEC3DE77B2EB}.Release|Any CPU.Build.0 = Release|Any CPU + {73A7688A-5BD3-4F7E-ADFA-CE36C5A10E3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {73A7688A-5BD3-4F7E-ADFA-CE36C5A10E3B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {73A7688A-5BD3-4F7E-ADFA-CE36C5A10E3B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {73A7688A-5BD3-4F7E-ADFA-CE36C5A10E3B}.Release|Any CPU.Build.0 = Release|Any CPU + {6E444FF1-A47C-4CF6-BB3F-507C8EBD776D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6E444FF1-A47C-4CF6-BB3F-507C8EBD776D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6E444FF1-A47C-4CF6-BB3F-507C8EBD776D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6E444FF1-A47C-4CF6-BB3F-507C8EBD776D}.Release|Any CPU.Build.0 = Release|Any CPU + {7059493C-8251-4764-9C1E-2368B8B485BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7059493C-8251-4764-9C1E-2368B8B485BC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7059493C-8251-4764-9C1E-2368B8B485BC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7059493C-8251-4764-9C1E-2368B8B485BC}.Release|Any CPU.Build.0 = Release|Any CPU + {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Release|Any CPU.Build.0 = Release|Any CPU + {5D13EF34-8B39-4EC5-847F-E12892ACF841}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5D13EF34-8B39-4EC5-847F-E12892ACF841}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5D13EF34-8B39-4EC5-847F-E12892ACF841}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5D13EF34-8B39-4EC5-847F-E12892ACF841}.Release|Any CPU.Build.0 = Release|Any CPU + {E649EA64-D213-461B-87F7-D67035801443}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E649EA64-D213-461B-87F7-D67035801443}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E649EA64-D213-461B-87F7-D67035801443}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E649EA64-D213-461B-87F7-D67035801443}.Release|Any CPU.Build.0 = Release|Any CPU + {CBC7993C-57D8-4A6C-992C-19E849DFE71D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CBC7993C-57D8-4A6C-992C-19E849DFE71D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CBC7993C-57D8-4A6C-992C-19E849DFE71D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CBC7993C-57D8-4A6C-992C-19E849DFE71D}.Release|Any CPU.Build.0 = Release|Any CPU + {7528BF74-25C7-4ABE-883A-443B4EEC4776}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7528BF74-25C7-4ABE-883A-443B4EEC4776}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7528BF74-25C7-4ABE-883A-443B4EEC4776}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7528BF74-25C7-4ABE-883A-443B4EEC4776}.Release|Any CPU.Build.0 = Release|Any CPU + {36B82383-D69E-4897-A24A-648BABDF80EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {36B82383-D69E-4897-A24A-648BABDF80EC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {36B82383-D69E-4897-A24A-648BABDF80EC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {36B82383-D69E-4897-A24A-648BABDF80EC}.Release|Any CPU.Build.0 = Release|Any CPU + {10AB3CE2-A720-467F-9EC8-EBB4BAC9A1C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {10AB3CE2-A720-467F-9EC8-EBB4BAC9A1C9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {10AB3CE2-A720-467F-9EC8-EBB4BAC9A1C9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {10AB3CE2-A720-467F-9EC8-EBB4BAC9A1C9}.Release|Any CPU.Build.0 = Release|Any CPU + {14A96B1A-9DC9-44C8-A675-206329E15263}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {14A96B1A-9DC9-44C8-A675-206329E15263}.Debug|Any CPU.Build.0 = Debug|Any CPU + {14A96B1A-9DC9-44C8-A675-206329E15263}.Release|Any CPU.ActiveCfg = Release|Any CPU + {14A96B1A-9DC9-44C8-A675-206329E15263}.Release|Any CPU.Build.0 = Release|Any CPU + {3DD574CD-9C5D-4A45-85E1-EBBA64C22B5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3DD574CD-9C5D-4A45-85E1-EBBA64C22B5F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3DD574CD-9C5D-4A45-85E1-EBBA64C22B5F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3DD574CD-9C5D-4A45-85E1-EBBA64C22B5F}.Release|Any CPU.Build.0 = Release|Any CPU + {82190F52-2901-46D6-8A4C-34649959483F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {82190F52-2901-46D6-8A4C-34649959483F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {82190F52-2901-46D6-8A4C-34649959483F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {82190F52-2901-46D6-8A4C-34649959483F}.Release|Any CPU.Build.0 = Release|Any CPU + {085948FF-0E9B-4A9A-B564-F8B8B4BDDDBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {085948FF-0E9B-4A9A-B564-F8B8B4BDDDBC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {085948FF-0E9B-4A9A-B564-F8B8B4BDDDBC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {085948FF-0E9B-4A9A-B564-F8B8B4BDDDBC}.Release|Any CPU.Build.0 = Release|Any CPU + {6BD8B2FA-F2E3-4AC8-A4C3-2925A653889A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6BD8B2FA-F2E3-4AC8-A4C3-2925A653889A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6BD8B2FA-F2E3-4AC8-A4C3-2925A653889A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6BD8B2FA-F2E3-4AC8-A4C3-2925A653889A}.Release|Any CPU.Build.0 = Release|Any CPU + {ED715544-E649-4F48-B8EE-9368C41C3AC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ED715544-E649-4F48-B8EE-9368C41C3AC0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ED715544-E649-4F48-B8EE-9368C41C3AC0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ED715544-E649-4F48-B8EE-9368C41C3AC0}.Release|Any CPU.Build.0 = Release|Any CPU + {2C5EB8B3-A313-413D-BAA0-5C21D2A6EC6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2C5EB8B3-A313-413D-BAA0-5C21D2A6EC6E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2C5EB8B3-A313-413D-BAA0-5C21D2A6EC6E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2C5EB8B3-A313-413D-BAA0-5C21D2A6EC6E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} = {F2AB7512-139A-420F-AE3A-9ED22CA52CE1} + {9916839C-39FC-4CEB-A5AF-89CA7E87119F} = {F2AB7512-139A-420F-AE3A-9ED22CA52CE1} + {63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {14C049FD-B35B-415A-A824-87F26B26E7FD} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {0E7646E8-FE8F-43C1-8799-D97860925EC4} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {EA2B9121-EF54-40A6-A53E-6593C86EE696} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB} = {B6092A92-1071-4C30-AD55-8E8D46BC2F14} + {17F86780-9A1F-4AA1-86F1-875EEC2730C7} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {72457126-E118-4171-A08F-9A709EE4B7FC} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {D10AD48F-407D-4DB5-A328-173EC7CB010F} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {4BE4EB01-AC56-4048-924E-2CA77F509ABA} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {5D0F00F0-26C9-4785-AD61-B85710C60EB0} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {CDE24A24-01D3-403C-84B9-37722E18DFB7} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {79AED36E-ABD0-4747-93D3-8722B042454B} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {954CA994-D204-468B-9D69-51F6AD3E1C29} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {33B1BC8D-E292-4972-A363-22056B207156} = {75E7476C-C05B-4C41-8E38-081D3EB55659} + {D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {1C981BB3-26F7-494C-9005-CC27A5144233} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {05660F47-D649-48BD-9DED-DF4E01E7CFF9} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {8F116B06-1C0E-4E4C-9A0A-D2FAB851E768} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {EA4F1DA7-F2AB-4384-9AA4-9B756E2026B1} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {194D3CCC-1153-474D-8176-FDE8D7D0D0BD} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {CB70A642-8CEC-4DDE-8C9F-AD08900EC98D} = {84650275-884D-4CBB-9CC0-67553996E211} + {FBC8B571-ED50-49D8-8D9D-64AB7454A0D6} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {137906EA-15FE-4AD8-A6A0-27528F0477D6} = {B6092A92-1071-4C30-AD55-8E8D46BC2F14} + {3420C92A-747F-4990-BA08-F2C9531E44AD} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {C889167C-E52C-4A65-A419-224B3D1B957D} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {99002B65-86F7-415E-BF4A-381AA8AB9CCC} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {2AD6973D-C7BB-416E-89FE-EEE34664E05F} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {4A4595EF-6C37-4F99-96ED-4AE0B9E438D3} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {43D0EC0B-1955-4566-8D31-7B9102DA1703} = {B6092A92-1071-4C30-AD55-8E8D46BC2F14} + {FC1D74E8-7A4D-48F4-83DE-95C6173780C4} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {3158C928-888C-4A84-8BC1-4A8257489538} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {642A49D7-8752-4177-80D6-BFBBCFAD3DE0} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {6F759635-13D7-4E94-BCC9-80445D63F117} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {966EC390-3C7F-4D98-92A6-F0F30D02E9B1} = {B6092A92-1071-4C30-AD55-8E8D46BC2F14} + {3F72A4E9-7B72-4260-B010-C16EC54F9BAF} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {475B6C45-B27C-438B-8966-908B9D6D1077} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {66FCCD76-2761-47E3-8D11-B45D0001DDAA} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {3787DDE5-E5C8-4841-BDA7-DCB325388064} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {5531E894-D259-45A3-AA61-26DBE720C1CE} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {91BC2E7F-DA04-421C-98EF-76D37CEC130C} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {E826F796-8CE3-4B5B-8423-5AA5F81D2FC3} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {2CF067CA-064B-43C6-8B88-5E3B99A65F1D} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {F301EF7D-F19C-4D83-AA94-CB64F29C037D} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {FE5C5947-D2D5-42C5-992A-13D672946135} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {9CD5C81F-5828-4384-8474-2E2BE71D5EDD} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {3BD22132-D538-48C6-8854-F71333C798EB} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {1F0B6B85-8B0B-47CA-899D-F25B4F1B52C3} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {08191FCD-7258-4F19-95FB-AEC3DE77B2EB} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {73A7688A-5BD3-4F7E-ADFA-CE36C5A10E3B} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {6E444FF1-A47C-4CF6-BB3F-507C8EBD776D} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {7059493C-8251-4764-9C1E-2368B8B485BC} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {5D13EF34-8B39-4EC5-847F-E12892ACF841} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {E649EA64-D213-461B-87F7-D67035801443} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {7528BF74-25C7-4ABE-883A-443B4EEC4776} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {36B82383-D69E-4897-A24A-648BABDF80EC} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {10AB3CE2-A720-467F-9EC8-EBB4BAC9A1C9} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {14A96B1A-9DC9-44C8-A675-206329E15263} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {3DD574CD-9C5D-4A45-85E1-EBBA64C22B5F} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {82190F52-2901-46D6-8A4C-34649959483F} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {085948FF-0E9B-4A9A-B564-F8B8B4BDDDBC} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {6BD8B2FA-F2E3-4AC8-A4C3-2925A653889A} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {ED715544-E649-4F48-B8EE-9368C41C3AC0} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + {2C5EB8B3-A313-413D-BAA0-5C21D2A6EC6E} = {8E3DE014-9B28-4B32-8AC1-B2BE404E9B2D} + EndGlobalSection +EndGlobal diff --git a/src/Orchard.Core.Tests/Body/BodyPartTests.cs b/src/Orchard.Core.Tests/Body/BodyPartTests.cs index 29a490f9410..c0ed3a71ccc 100644 --- a/src/Orchard.Core.Tests/Body/BodyPartTests.cs +++ b/src/Orchard.Core.Tests/Body/BodyPartTests.cs @@ -1,109 +1,109 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Autofac; -using JetBrains.Annotations; -using Moq; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Drivers; -using Orchard.ContentManagement.Handlers; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.Records; -using Orchard.Core.Common.Handlers; -using Orchard.Core.Common.Models; -using Orchard.Data; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.DisplayManagement.Implementation; -using Orchard.Environment; -using Orchard.Environment.Extensions; -using Orchard.Security; -using Orchard.Tests.ContentManagement; -using Orchard.Tests.Modules; -using Orchard.Tests.Stubs; -using Orchard.UI.Notify; -using Orchard.UI.PageClass; - -namespace Orchard.Core.Tests.Body { - [TestFixture] - public class BodyPartTests : DatabaseEnabledTestsBase { - - public override void Register(ContainerBuilder builder) { - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - builder.RegisterType().As(); - - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - - } - - [Test] - public void BodyCanHandleLongText() { - var contentManager = _container.Resolve(); - - contentManager.Create(ThingDriver.ContentTypeName, t => { - t.As().Record = new BodyPartRecord(); - t.Text = new String('x', 10000); - }); - - var bodies = contentManager.Query().List(); - Assert.That(bodies, Is.Not.Null); - Assert.That(bodies.Any(), Is.True); - Assert.That(bodies.First().Text, Is.EqualTo(new String('x', 10000))); - - } - - protected override IEnumerable DatabaseTypes { - get { - return new[] { - typeof(BodyPartRecord), - typeof(ContentTypeRecord), - typeof(ContentItemRecord), - typeof(ContentItemVersionRecord), - typeof(CommonPartRecord), - typeof(CommonPartVersionRecord), - }; - } - } - - [UsedImplicitly] - public class ThingHandler : ContentHandler { - public ThingHandler() { - Filters.Add(new ActivatingFilter(ThingDriver.ContentTypeName)); - Filters.Add(new ActivatingFilter>(ThingDriver.ContentTypeName)); - Filters.Add(new ActivatingFilter(ThingDriver.ContentTypeName)); - Filters.Add(new ActivatingFilter(ThingDriver.ContentTypeName)); - } - } - - public class Thing : ContentPart { - public string Text { - get { return this.As().Text; } - set { this.As().Text = value; } - } - - } - - public class ThingDriver : ContentPartDriver { - public static readonly string ContentTypeName = "thing"; - } - - } +using System; +using System.Collections.Generic; +using System.Linq; +using Autofac; +using JetBrains.Annotations; +using Moq; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Drivers; +using Orchard.ContentManagement.Handlers; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.Records; +using Orchard.Core.Common.Handlers; +using Orchard.Core.Common.Models; +using Orchard.Data; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.DisplayManagement.Implementation; +using Orchard.Environment; +using Orchard.Environment.Extensions; +using Orchard.Security; +using Orchard.Tests.ContentManagement; +using Orchard.Tests.Modules; +using Orchard.Tests.Stubs; +using Orchard.UI.Notify; +using Orchard.UI.PageClass; + +namespace Orchard.Core.Tests.Body { + [TestFixture] + public class BodyPartTests : DatabaseEnabledTestsBase { + + public override void Register(ContainerBuilder builder) { + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + builder.RegisterType().As(); + + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + + } + + [Test] + public void BodyCanHandleLongText() { + var contentManager = _container.Resolve(); + + contentManager.Create(ThingDriver.ContentTypeName, t => { + t.As().Record = new BodyPartRecord(); + t.Text = new String('x', 10000); + }); + + var bodies = contentManager.Query().List(); + Assert.That(bodies, Is.Not.Null); + Assert.That(bodies.Any(), Is.True); + Assert.That(bodies.First().Text, Is.EqualTo(new String('x', 10000))); + + } + + protected override IEnumerable DatabaseTypes { + get { + return new[] { + typeof(BodyPartRecord), + typeof(ContentTypeRecord), + typeof(ContentItemRecord), + typeof(ContentItemVersionRecord), + typeof(CommonPartRecord), + typeof(CommonPartVersionRecord), + }; + } + } + + [UsedImplicitly] + public class ThingHandler : ContentHandler { + public ThingHandler() { + Filters.Add(new ActivatingFilter(ThingDriver.ContentTypeName)); + Filters.Add(new ActivatingFilter>(ThingDriver.ContentTypeName)); + Filters.Add(new ActivatingFilter(ThingDriver.ContentTypeName)); + Filters.Add(new ActivatingFilter(ThingDriver.ContentTypeName)); + } + } + + public class Thing : ContentPart { + public string Text { + get { return this.As().Text; } + set { this.As().Text = value; } + } + + } + + public class ThingDriver : ContentPartDriver { + public static readonly string ContentTypeName = "thing"; + } + + } } \ No newline at end of file diff --git a/src/Orchard.Core.Tests/Common/BbcodeFilterTests.cs b/src/Orchard.Core.Tests/Common/BbcodeFilterTests.cs index 984ac276d08..99f521f5b85 100644 --- a/src/Orchard.Core.Tests/Common/BbcodeFilterTests.cs +++ b/src/Orchard.Core.Tests/Common/BbcodeFilterTests.cs @@ -1,61 +1,61 @@ -using NUnit.Framework; -using Orchard.Core.Common.Services; - -namespace Orchard.Core.Tests.Common { - [TestFixture] - public class BbcodeFilterTests { - - private readonly BbcodeFilter _filter = new BbcodeFilter(); - - [Test] - public void ShouldIgnoreText() { - const string text = "foo bar baz"; - var processed = _filter.ProcessContent(text, null); - Assert.That(processed, Is.EqualTo(text)); - } - - [Test] - public void ShouldReplaceUrl() { - const string text = "foo [url]bar[/url] baz"; - var processed = _filter.ProcessContent(text, null); - Assert.That(processed, Is.EqualTo("foo bar baz")); - } - - [Test] - public void ShouldReplaceImg() { - const string text = "foo [img]bar[/img] baz"; - var processed = _filter.ProcessContent(text, null); - Assert.That(processed, Is.EqualTo("foo baz")); - } - - [Test] - public void ShouldReplaceUrlWithTitle() { - const string text = "foo [url=alink]bar[/url] baz"; - var processed = _filter.ProcessContent(text, null); - Assert.That(processed, Is.EqualTo("foo bar baz")); - } - - [Test] - public void ShouldIgnoreMalformedUrl() { - const string text = "foo [url]bar baz"; - var processed = _filter.ProcessContent(text, null); - Assert.That(processed, Is.EqualTo("foo [url]bar baz")); - } - - [Test] - public void ShouldIgnoreMalformedUrlWithTitle() { - const string text = "foo [url=alink]bar baz"; - var processed = _filter.ProcessContent(text, null); - Assert.That(processed, Is.EqualTo("foo [url=alink]bar baz")); - } - - [Test] - public void ShouldIgnoreMalformedImg() { - const string text = "foo [img]bar baz"; - var processed = _filter.ProcessContent(text, null); - Assert.That(processed, Is.EqualTo("foo [img]bar baz")); - } - - - } +using NUnit.Framework; +using Orchard.Core.Common.Services; + +namespace Orchard.Core.Tests.Common { + [TestFixture] + public class BbcodeFilterTests { + + private readonly BbcodeFilter _filter = new BbcodeFilter(); + + [Test] + public void ShouldIgnoreText() { + const string text = "foo bar baz"; + var processed = _filter.ProcessContent(text, null); + Assert.That(processed, Is.EqualTo(text)); + } + + [Test] + public void ShouldReplaceUrl() { + const string text = "foo [url]bar[/url] baz"; + var processed = _filter.ProcessContent(text, null); + Assert.That(processed, Is.EqualTo("foo bar baz")); + } + + [Test] + public void ShouldReplaceImg() { + const string text = "foo [img]bar[/img] baz"; + var processed = _filter.ProcessContent(text, null); + Assert.That(processed, Is.EqualTo("foo baz")); + } + + [Test] + public void ShouldReplaceUrlWithTitle() { + const string text = "foo [url=alink]bar[/url] baz"; + var processed = _filter.ProcessContent(text, null); + Assert.That(processed, Is.EqualTo("foo bar baz")); + } + + [Test] + public void ShouldIgnoreMalformedUrl() { + const string text = "foo [url]bar baz"; + var processed = _filter.ProcessContent(text, null); + Assert.That(processed, Is.EqualTo("foo [url]bar baz")); + } + + [Test] + public void ShouldIgnoreMalformedUrlWithTitle() { + const string text = "foo [url=alink]bar baz"; + var processed = _filter.ProcessContent(text, null); + Assert.That(processed, Is.EqualTo("foo [url=alink]bar baz")); + } + + [Test] + public void ShouldIgnoreMalformedImg() { + const string text = "foo [img]bar baz"; + var processed = _filter.ProcessContent(text, null); + Assert.That(processed, Is.EqualTo("foo [img]bar baz")); + } + + + } } \ No newline at end of file diff --git a/src/Orchard.Core.Tests/Common/Providers/CommonPartProviderTests.cs b/src/Orchard.Core.Tests/Common/Providers/CommonPartProviderTests.cs index 443f1d55765..b676f925c78 100644 --- a/src/Orchard.Core.Tests/Common/Providers/CommonPartProviderTests.cs +++ b/src/Orchard.Core.Tests/Common/Providers/CommonPartProviderTests.cs @@ -1,466 +1,466 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Routing; -using Autofac; -using JetBrains.Annotations; -using Moq; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.ContentManagement.Aspects; -using Orchard.ContentManagement.Drivers; -using Orchard.ContentManagement.Drivers.Coordinators; -using Orchard.ContentManagement.MetaData; -using Orchard.Core.Common.Drivers; -using Orchard.Core.Common.Handlers; -using Orchard.Core.Common.Models; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Handlers; -using Orchard.ContentManagement.Records; -using Orchard.Core.Common.OwnerEditor; -using Orchard.Core.Common.Services; -using Orchard.Core.Scheduling.Models; -using Orchard.Core.Scheduling.Services; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.DisplayManagement.Descriptors.ShapeAttributeStrategy; -using Orchard.DisplayManagement.Descriptors.ShapePlacementStrategy; -using Orchard.DisplayManagement.Implementation; -using Orchard.Environment.Extensions; -using Orchard.Environment.Extensions.Models; -using Orchard.FileSystems.VirtualPath; -using Orchard.Localization; -using Orchard.Security; -using Orchard.Tasks.Scheduling; -using Orchard.Tests.DisplayManagement; -using Orchard.Tests.DisplayManagement.Descriptors; -using Orchard.Tests.Modules; -using System.Web.Mvc; -using Orchard.Tests.Stubs; -using Orchard.Themes; -using Orchard.UI.PageClass; - -namespace Orchard.Core.Tests.Common.Providers { - [TestFixture] - public class CommonPartProviderTests : DatabaseEnabledTestsBase { - private Mock _authn; - private Mock _authz; - private Mock _membership; - private Mock _contentDefinitionManager; - - public override void Register(ContainerBuilder builder) { - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - - builder.RegisterInstance(new RequestContext(new StubHttpContext(), new RouteData())); - builder.RegisterInstance(new Orchard.Environment.Work>(resolve => _container.Resolve>())).AsSelf(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - // IContentDisplay - var workContext = new DefaultDisplayManagerTests.TestWorkContext { - CurrentTheme = new ExtensionDescriptor { Id = "Hello" } - }; - builder.RegisterInstance(new DefaultDisplayManagerTests.TestWorkContextAccessor(workContext)).As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - - DefaultShapeTableManagerTests.TestShapeProvider.FeatureShapes = new Dictionary> { - { TestFeature(), new[] { "Parts_Common_Owner_Edit" } } - }; - - builder.RegisterType().As() - .As() - .InstancePerLifetimeScope(); - - builder.RegisterInstance(new RouteCollection()); - builder.RegisterModule(new ShapeAttributeBindingModule()); - - _authn = new Mock(); - _authz = new Mock(); - _membership = new Mock(); - _contentDefinitionManager = new Mock(); - - builder.RegisterInstance(_authn.Object); - builder.RegisterInstance(_authz.Object); - builder.RegisterInstance(_membership.Object); - builder.RegisterInstance(_contentDefinitionManager.Object); - - var virtualPathProviderMock = new Mock(); - virtualPathProviderMock.Setup(a => a.ToAppRelative(It.IsAny())).Returns("~/yadda"); - - builder.RegisterInstance(virtualPathProviderMock.Object); - } - - static Feature TestFeature() { - return new Feature { - Descriptor = new FeatureDescriptor { - Id = "Testing", - Dependencies = Enumerable.Empty(), - Extension = new ExtensionDescriptor { - Id = "Testing", - ExtensionType = DefaultExtensionTypes.Module, - } - } - }; - } - - protected override IEnumerable DatabaseTypes { - get { - return new[] { - typeof(ContentTypeRecord), - typeof(ContentItemRecord), - typeof(ContentItemVersionRecord), - typeof(CommonPartRecord), - typeof(CommonPartVersionRecord), - typeof(ScheduledTaskRecord), - }; - } - } - - [UsedImplicitly] - class TestHandler : ContentHandler { - public TestHandler() { - Filters.Add(new ActivatingFilter("test-item")); - Filters.Add(new ActivatingFilter>("test-item")); - Filters.Add(new ActivatingFilter("User")); - } - } - - class TestUser : ContentPart, IUser { - public new int Id { get { return 6655321; } } - public string UserName { get { return "x"; } } - public string Email { get { return "y"; } } - } - - [Test] - public void OwnerShouldBeNullAndZeroByDefault() { - var contentManager = _container.Resolve(); - var item = contentManager.Create("test-item", init => { }); - ClearSession(); - - Assert.That(item.Owner, Is.Null); - Assert.That(item.Record.OwnerId, Is.EqualTo(0)); - } - - [Test] - public void PublishingShouldFailIfOwnerIsUnknown() { - var contentManager = _container.Resolve(); - var updateModel = new Mock(); - - var user = contentManager.New("User"); - _authn.Setup(x => x.GetAuthenticatedUser()).Returns(user); - - var item = contentManager.Create("test-item", VersionOptions.Draft, init => { }); - var viewModel = new OwnerEditorViewModel { Owner = "User" }; - updateModel.Setup(x => x.TryUpdateModel(viewModel, "", null, null)).Returns(true); - contentManager.UpdateEditor(item.ContentItem, updateModel.Object); - } - - class UpdatModelStub : IUpdateModel { - - ModelStateDictionary _modelState = new ModelStateDictionary(); - - public ModelStateDictionary ModelErrors { - get { return _modelState; } - } - - public string Owner { get; set; } - - public bool TryUpdateModel(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) where TModel : class { - (model as OwnerEditorViewModel).Owner = Owner; - return true; - } - - public void AddModelError(string key, LocalizedString errorMessage) { - _modelState.AddModelError(key, errorMessage.ToString()); - } - } - - class StubThemeService : IThemeManager { - private readonly ExtensionDescriptor _theme = new ExtensionDescriptor { - Id = "SafeMode", - Name = "SafeMode", - Location = "~/Themes", - }; - - public ExtensionDescriptor GetRequestTheme(RequestContext requestContext) { return _theme; } - } - - [Test] - public void PublishingShouldNotThrowExceptionIfOwnerIsNull() { - var contentManager = _container.Resolve(); - - var item = contentManager.Create("test-item", VersionOptions.Draft, init => { }); - - var user = contentManager.New("User"); - _authn.Setup(x => x.GetAuthenticatedUser()).Returns(user); - _authz.Setup(x => x.TryCheckAccess(StandardPermissions.SiteOwner, user, item)).Returns(true); - - item.Owner = user; - - var updater = new UpdatModelStub() { Owner = null }; - - contentManager.UpdateEditor(item.ContentItem, updater); - } - - [Test] - public void PublishingShouldFailIfOwnerIsEmpty() { - var contentManager = _container.Resolve(); - - var item = contentManager.Create("test-item", VersionOptions.Draft, init => { }); - - var user = contentManager.New("User"); - _authn.Setup(x => x.GetAuthenticatedUser()).Returns(user); - _authz.Setup(x => x.TryCheckAccess(StandardPermissions.SiteOwner, user, item)).Returns(true); - - item.Owner = user; - - var updater = new UpdatModelStub() { Owner = "" }; - - _container.Resolve().Discover = - b => b.Describe("Parts_Common_Owner_Edit").From(TestFeature()) - .Placement(ctx => new PlacementInfo { Location = "Content" }); - - contentManager.UpdateEditor(item.ContentItem, updater); - - Assert.That(updater.ModelErrors.ContainsKey("OwnerEditor.Owner"), Is.True); - } - - [Test] - public void PublishingShouldNotFailIfOwnerIsEmptyAndShapeIsHidden() { - var contentManager = _container.Resolve(); - - var item = contentManager.Create("test-item", VersionOptions.Draft, init => { }); - - var user = contentManager.New("User"); - _authn.Setup(x => x.GetAuthenticatedUser()).Returns(user); - _authz.Setup(x => x.TryCheckAccess(StandardPermissions.SiteOwner, user, item)).Returns(true); - - item.Owner = user; - - var updater = new UpdatModelStub() { Owner = "" }; - - _container.Resolve().Discover = - b => b.Describe("Parts_Common_Owner_Edit").From(TestFeature()) - .Placement(ctx => new PlacementInfo { Location = "-" }); - - contentManager.UpdateEditor(item.ContentItem, updater); - - Assert.That(updater.ModelErrors.ContainsKey("OwnerEditor.Owner"), Is.False); - } - [Test] - public void CreatingShouldSetCreatedAndModifiedUtc() { - var contentManager = _container.Resolve(); - - var createUtc = _clock.UtcNow; - var item = contentManager.Create("test-item", VersionOptions.Draft, init => { }); - - Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); - Assert.That(item.ModifiedUtc, Is.EqualTo(createUtc)); - Assert.That(item.PublishedUtc, Is.Null); - } - - [Test] - public void PublishingShouldSetPublishUtcAndShouldNotChangeModifiedUtc() { - var contentManager = _container.Resolve(); - - var createUtc = _clock.UtcNow; - var item = contentManager.Create("test-item", VersionOptions.Draft, init => { }); - - Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); - Assert.That(item.ModifiedUtc, Is.EqualTo(createUtc)); - Assert.That(item.PublishedUtc, Is.Null); - - _clock.Advance(TimeSpan.FromMinutes(1)); - var publishUtc = _clock.UtcNow; - - contentManager.Publish(item.ContentItem); - - Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); - Assert.That(item.ModifiedUtc, Is.EqualTo(createUtc)); - Assert.That(item.PublishedUtc, Is.EqualTo(publishUtc)); - } - - [Test] - public void PublishingTwiceShouldKeepSettingPublishUtcAndShouldNotChangeModifiedUtc() { - var contentManager = _container.Resolve(); - - var createUtc = _clock.UtcNow; - var item = contentManager.Create("test-item", VersionOptions.Draft, init => { }); - - Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); - Assert.That(item.ModifiedUtc, Is.EqualTo(createUtc)); - Assert.That(item.PublishedUtc, Is.Null); - - _clock.Advance(TimeSpan.FromMinutes(1)); - var publishUtc1 = _clock.UtcNow; - - contentManager.Publish(item.ContentItem); - - Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); - Assert.That(item.ModifiedUtc, Is.EqualTo(createUtc)); - Assert.That(item.PublishedUtc, Is.EqualTo(publishUtc1)); - - contentManager.Unpublish(item.ContentItem); - - _clock.Advance(TimeSpan.FromMinutes(1)); - var publishUtc2 = _clock.UtcNow; - - contentManager.Publish(item.ContentItem); - - Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); - Assert.That(item.ModifiedUtc, Is.EqualTo(createUtc)); - Assert.That(item.PublishedUtc, Is.EqualTo(publishUtc2)); - } - - [Test] - public void UnpublishingShouldNotChangePublishUtcAndModifiedUtc() { - var contentManager = _container.Resolve(); - - var createUtc = _clock.UtcNow; - var item = contentManager.Create("test-item", VersionOptions.Draft, init => { }); - - Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); - Assert.That(item.ModifiedUtc, Is.EqualTo(createUtc)); - Assert.That(item.PublishedUtc, Is.Null); - - _clock.Advance(TimeSpan.FromMinutes(1)); - var publishUtc = _clock.UtcNow; - - contentManager.Publish(item.ContentItem); - - Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); - Assert.That(item.ModifiedUtc, Is.EqualTo(createUtc)); - Assert.That(item.PublishedUtc, Is.EqualTo(publishUtc)); - - contentManager.Unpublish(item.ContentItem); - - Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); - Assert.That(item.ModifiedUtc, Is.EqualTo(createUtc)); - Assert.That(item.PublishedUtc, Is.EqualTo(publishUtc)); - } - - [Test] - public void EditingShouldSetModifiedUtc() { - var contentManager = _container.Resolve(); - - var createUtc = _clock.UtcNow; - var item = contentManager.Create("test-item", VersionOptions.Draft, init => { }); - contentManager.Publish(item.ContentItem); - - Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); - Assert.That(item.ModifiedUtc, Is.EqualTo(createUtc)); - Assert.That(item.PublishedUtc, Is.EqualTo(createUtc)); - - _clock.Advance(TimeSpan.FromMinutes(1)); - var editUtc = _clock.UtcNow; - - var updater = new UpdatModelStub() { Owner = "" }; - contentManager.UpdateEditor(item.ContentItem, updater); - - Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); - Assert.That(item.ModifiedUtc, Is.EqualTo(editUtc)); - Assert.That(item.PublishedUtc, Is.EqualTo(createUtc)); - Assert.That(updater.ModelErrors.Count, Is.EqualTo(0)); - } - - [Test] - public void VersioningItemShouldCreatedAndPublishedUtcValuesPerVersion() { - var contentManager = _container.Resolve(); - - var createUtc = _clock.UtcNow; - var item1 = contentManager.Create("test-item", VersionOptions.Draft, init => { }); - - Assert.That(item1.CreatedUtc, Is.EqualTo(createUtc)); - Assert.That(item1.PublishedUtc, Is.Null); - - _clock.Advance(TimeSpan.FromMinutes(1)); - var publish1Utc = _clock.UtcNow; - contentManager.Publish(item1.ContentItem); - - // db records need to be updated before demanding draft as item2 below - _session.Flush(); - - _clock.Advance(TimeSpan.FromMinutes(1)); - var draftUtc = _clock.UtcNow; - var item2 = contentManager.GetDraftRequired(item1.ContentItem.Id); - - _clock.Advance(TimeSpan.FromMinutes(1)); - var publish2Utc = _clock.UtcNow; - contentManager.Publish(item2.ContentItem); - - // both instances non-versioned dates show it was created upfront - Assert.That(item1.CreatedUtc, Is.EqualTo(createUtc)); - Assert.That(item2.CreatedUtc, Is.EqualTo(createUtc)); - - // both instances non-versioned dates show the most recent publish - Assert.That(item1.PublishedUtc, Is.EqualTo(publish2Utc)); - Assert.That(item2.PublishedUtc, Is.EqualTo(publish2Utc)); - - // version1 versioned dates show create was upfront and publish was oldest - Assert.That(item1.VersionCreatedUtc, Is.EqualTo(createUtc)); - Assert.That(item1.VersionPublishedUtc, Is.EqualTo(publish1Utc)); - - // version2 versioned dates show create was midway and publish was most recent - Assert.That(item2.VersionCreatedUtc, Is.EqualTo(draftUtc)); - Assert.That(item2.VersionPublishedUtc, Is.EqualTo(publish2Utc)); - } - - [Test] - public void UnpublishShouldClearFlagButLeaveMostrecentPublishDatesIntact() { - var contentManager = _container.Resolve(); - - var createUtc = _clock.UtcNow; - var item = contentManager.Create("test-item", VersionOptions.Draft, init => { }); - - Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); - Assert.That(item.PublishedUtc, Is.Null); - - _clock.Advance(TimeSpan.FromMinutes(1)); - var publishUtc = _clock.UtcNow; - contentManager.Publish(item.ContentItem); - - // db records need to be updated before seeking by published flags - _session.Flush(); - - _clock.Advance(TimeSpan.FromMinutes(1)); - var unpublishUtc = _clock.UtcNow; - contentManager.Unpublish(item.ContentItem); - - // db records need to be updated before seeking by published flags - ClearSession(); - - var publishedItem = contentManager.Get(item.ContentItem.Id, VersionOptions.Published); - var latestItem = contentManager.Get(item.ContentItem.Id, VersionOptions.Latest); - var draftItem = contentManager.Get(item.ContentItem.Id, VersionOptions.Draft); - var allVersions = contentManager.GetAllVersions(item.ContentItem.Id); - - Assert.That(publishedItem, Is.Null); - Assert.That(latestItem, Is.Not.Null); - Assert.That(draftItem, Is.Not.Null); - Assert.That(allVersions.Count(), Is.EqualTo(1)); - Assert.That(publishUtc, Is.Not.EqualTo(unpublishUtc)); - Assert.That(latestItem.PublishedUtc, Is.EqualTo(publishUtc)); - Assert.That(latestItem.VersionPublishedUtc, Is.EqualTo(publishUtc)); - Assert.That(latestItem.ContentItem.VersionRecord.Latest, Is.True); - Assert.That(latestItem.ContentItem.VersionRecord.Published, Is.False); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Routing; +using Autofac; +using JetBrains.Annotations; +using Moq; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.ContentManagement.Aspects; +using Orchard.ContentManagement.Drivers; +using Orchard.ContentManagement.Drivers.Coordinators; +using Orchard.ContentManagement.MetaData; +using Orchard.Core.Common.Drivers; +using Orchard.Core.Common.Handlers; +using Orchard.Core.Common.Models; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Handlers; +using Orchard.ContentManagement.Records; +using Orchard.Core.Common.OwnerEditor; +using Orchard.Core.Common.Services; +using Orchard.Core.Scheduling.Models; +using Orchard.Core.Scheduling.Services; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.DisplayManagement.Descriptors.ShapeAttributeStrategy; +using Orchard.DisplayManagement.Descriptors.ShapePlacementStrategy; +using Orchard.DisplayManagement.Implementation; +using Orchard.Environment.Extensions; +using Orchard.Environment.Extensions.Models; +using Orchard.FileSystems.VirtualPath; +using Orchard.Localization; +using Orchard.Security; +using Orchard.Tasks.Scheduling; +using Orchard.Tests.DisplayManagement; +using Orchard.Tests.DisplayManagement.Descriptors; +using Orchard.Tests.Modules; +using System.Web.Mvc; +using Orchard.Tests.Stubs; +using Orchard.Themes; +using Orchard.UI.PageClass; + +namespace Orchard.Core.Tests.Common.Providers { + [TestFixture] + public class CommonPartProviderTests : DatabaseEnabledTestsBase { + private Mock _authn; + private Mock _authz; + private Mock _membership; + private Mock _contentDefinitionManager; + + public override void Register(ContainerBuilder builder) { + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + + builder.RegisterInstance(new RequestContext(new StubHttpContext(), new RouteData())); + builder.RegisterInstance(new Orchard.Environment.Work>(resolve => _container.Resolve>())).AsSelf(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + // IContentDisplay + var workContext = new DefaultDisplayManagerTests.TestWorkContext { + CurrentTheme = new ExtensionDescriptor { Id = "Hello" } + }; + builder.RegisterInstance(new DefaultDisplayManagerTests.TestWorkContextAccessor(workContext)).As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + + DefaultShapeTableManagerTests.TestShapeProvider.FeatureShapes = new Dictionary> { + { TestFeature(), new[] { "Parts_Common_Owner_Edit" } } + }; + + builder.RegisterType().As() + .As() + .InstancePerLifetimeScope(); + + builder.RegisterInstance(new RouteCollection()); + builder.RegisterModule(new ShapeAttributeBindingModule()); + + _authn = new Mock(); + _authz = new Mock(); + _membership = new Mock(); + _contentDefinitionManager = new Mock(); + + builder.RegisterInstance(_authn.Object); + builder.RegisterInstance(_authz.Object); + builder.RegisterInstance(_membership.Object); + builder.RegisterInstance(_contentDefinitionManager.Object); + + var virtualPathProviderMock = new Mock(); + virtualPathProviderMock.Setup(a => a.ToAppRelative(It.IsAny())).Returns("~/yadda"); + + builder.RegisterInstance(virtualPathProviderMock.Object); + } + + static Feature TestFeature() { + return new Feature { + Descriptor = new FeatureDescriptor { + Id = "Testing", + Dependencies = Enumerable.Empty(), + Extension = new ExtensionDescriptor { + Id = "Testing", + ExtensionType = DefaultExtensionTypes.Module, + } + } + }; + } + + protected override IEnumerable DatabaseTypes { + get { + return new[] { + typeof(ContentTypeRecord), + typeof(ContentItemRecord), + typeof(ContentItemVersionRecord), + typeof(CommonPartRecord), + typeof(CommonPartVersionRecord), + typeof(ScheduledTaskRecord), + }; + } + } + + [UsedImplicitly] + class TestHandler : ContentHandler { + public TestHandler() { + Filters.Add(new ActivatingFilter("test-item")); + Filters.Add(new ActivatingFilter>("test-item")); + Filters.Add(new ActivatingFilter("User")); + } + } + + class TestUser : ContentPart, IUser { + public new int Id { get { return 6655321; } } + public string UserName { get { return "x"; } } + public string Email { get { return "y"; } } + } + + [Test] + public void OwnerShouldBeNullAndZeroByDefault() { + var contentManager = _container.Resolve(); + var item = contentManager.Create("test-item", init => { }); + ClearSession(); + + Assert.That(item.Owner, Is.Null); + Assert.That(item.Record.OwnerId, Is.EqualTo(0)); + } + + [Test] + public void PublishingShouldFailIfOwnerIsUnknown() { + var contentManager = _container.Resolve(); + var updateModel = new Mock(); + + var user = contentManager.New("User"); + _authn.Setup(x => x.GetAuthenticatedUser()).Returns(user); + + var item = contentManager.Create("test-item", VersionOptions.Draft, init => { }); + var viewModel = new OwnerEditorViewModel { Owner = "User" }; + updateModel.Setup(x => x.TryUpdateModel(viewModel, "", null, null)).Returns(true); + contentManager.UpdateEditor(item.ContentItem, updateModel.Object); + } + + class UpdatModelStub : IUpdateModel { + + ModelStateDictionary _modelState = new ModelStateDictionary(); + + public ModelStateDictionary ModelErrors { + get { return _modelState; } + } + + public string Owner { get; set; } + + public bool TryUpdateModel(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) where TModel : class { + (model as OwnerEditorViewModel).Owner = Owner; + return true; + } + + public void AddModelError(string key, LocalizedString errorMessage) { + _modelState.AddModelError(key, errorMessage.ToString()); + } + } + + class StubThemeService : IThemeManager { + private readonly ExtensionDescriptor _theme = new ExtensionDescriptor { + Id = "SafeMode", + Name = "SafeMode", + Location = "~/Themes", + }; + + public ExtensionDescriptor GetRequestTheme(RequestContext requestContext) { return _theme; } + } + + [Test] + public void PublishingShouldNotThrowExceptionIfOwnerIsNull() { + var contentManager = _container.Resolve(); + + var item = contentManager.Create("test-item", VersionOptions.Draft, init => { }); + + var user = contentManager.New("User"); + _authn.Setup(x => x.GetAuthenticatedUser()).Returns(user); + _authz.Setup(x => x.TryCheckAccess(StandardPermissions.SiteOwner, user, item)).Returns(true); + + item.Owner = user; + + var updater = new UpdatModelStub() { Owner = null }; + + contentManager.UpdateEditor(item.ContentItem, updater); + } + + [Test] + public void PublishingShouldFailIfOwnerIsEmpty() { + var contentManager = _container.Resolve(); + + var item = contentManager.Create("test-item", VersionOptions.Draft, init => { }); + + var user = contentManager.New("User"); + _authn.Setup(x => x.GetAuthenticatedUser()).Returns(user); + _authz.Setup(x => x.TryCheckAccess(StandardPermissions.SiteOwner, user, item)).Returns(true); + + item.Owner = user; + + var updater = new UpdatModelStub() { Owner = "" }; + + _container.Resolve().Discover = + b => b.Describe("Parts_Common_Owner_Edit").From(TestFeature()) + .Placement(ctx => new PlacementInfo { Location = "Content" }); + + contentManager.UpdateEditor(item.ContentItem, updater); + + Assert.That(updater.ModelErrors.ContainsKey("OwnerEditor.Owner"), Is.True); + } + + [Test] + public void PublishingShouldNotFailIfOwnerIsEmptyAndShapeIsHidden() { + var contentManager = _container.Resolve(); + + var item = contentManager.Create("test-item", VersionOptions.Draft, init => { }); + + var user = contentManager.New("User"); + _authn.Setup(x => x.GetAuthenticatedUser()).Returns(user); + _authz.Setup(x => x.TryCheckAccess(StandardPermissions.SiteOwner, user, item)).Returns(true); + + item.Owner = user; + + var updater = new UpdatModelStub() { Owner = "" }; + + _container.Resolve().Discover = + b => b.Describe("Parts_Common_Owner_Edit").From(TestFeature()) + .Placement(ctx => new PlacementInfo { Location = "-" }); + + contentManager.UpdateEditor(item.ContentItem, updater); + + Assert.That(updater.ModelErrors.ContainsKey("OwnerEditor.Owner"), Is.False); + } + [Test] + public void CreatingShouldSetCreatedAndModifiedUtc() { + var contentManager = _container.Resolve(); + + var createUtc = _clock.UtcNow; + var item = contentManager.Create("test-item", VersionOptions.Draft, init => { }); + + Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); + Assert.That(item.ModifiedUtc, Is.EqualTo(createUtc)); + Assert.That(item.PublishedUtc, Is.Null); + } + + [Test] + public void PublishingShouldSetPublishUtcAndShouldNotChangeModifiedUtc() { + var contentManager = _container.Resolve(); + + var createUtc = _clock.UtcNow; + var item = contentManager.Create("test-item", VersionOptions.Draft, init => { }); + + Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); + Assert.That(item.ModifiedUtc, Is.EqualTo(createUtc)); + Assert.That(item.PublishedUtc, Is.Null); + + _clock.Advance(TimeSpan.FromMinutes(1)); + var publishUtc = _clock.UtcNow; + + contentManager.Publish(item.ContentItem); + + Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); + Assert.That(item.ModifiedUtc, Is.EqualTo(createUtc)); + Assert.That(item.PublishedUtc, Is.EqualTo(publishUtc)); + } + + [Test] + public void PublishingTwiceShouldKeepSettingPublishUtcAndShouldNotChangeModifiedUtc() { + var contentManager = _container.Resolve(); + + var createUtc = _clock.UtcNow; + var item = contentManager.Create("test-item", VersionOptions.Draft, init => { }); + + Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); + Assert.That(item.ModifiedUtc, Is.EqualTo(createUtc)); + Assert.That(item.PublishedUtc, Is.Null); + + _clock.Advance(TimeSpan.FromMinutes(1)); + var publishUtc1 = _clock.UtcNow; + + contentManager.Publish(item.ContentItem); + + Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); + Assert.That(item.ModifiedUtc, Is.EqualTo(createUtc)); + Assert.That(item.PublishedUtc, Is.EqualTo(publishUtc1)); + + contentManager.Unpublish(item.ContentItem); + + _clock.Advance(TimeSpan.FromMinutes(1)); + var publishUtc2 = _clock.UtcNow; + + contentManager.Publish(item.ContentItem); + + Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); + Assert.That(item.ModifiedUtc, Is.EqualTo(createUtc)); + Assert.That(item.PublishedUtc, Is.EqualTo(publishUtc2)); + } + + [Test] + public void UnpublishingShouldNotChangePublishUtcAndModifiedUtc() { + var contentManager = _container.Resolve(); + + var createUtc = _clock.UtcNow; + var item = contentManager.Create("test-item", VersionOptions.Draft, init => { }); + + Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); + Assert.That(item.ModifiedUtc, Is.EqualTo(createUtc)); + Assert.That(item.PublishedUtc, Is.Null); + + _clock.Advance(TimeSpan.FromMinutes(1)); + var publishUtc = _clock.UtcNow; + + contentManager.Publish(item.ContentItem); + + Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); + Assert.That(item.ModifiedUtc, Is.EqualTo(createUtc)); + Assert.That(item.PublishedUtc, Is.EqualTo(publishUtc)); + + contentManager.Unpublish(item.ContentItem); + + Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); + Assert.That(item.ModifiedUtc, Is.EqualTo(createUtc)); + Assert.That(item.PublishedUtc, Is.EqualTo(publishUtc)); + } + + [Test] + public void EditingShouldSetModifiedUtc() { + var contentManager = _container.Resolve(); + + var createUtc = _clock.UtcNow; + var item = contentManager.Create("test-item", VersionOptions.Draft, init => { }); + contentManager.Publish(item.ContentItem); + + Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); + Assert.That(item.ModifiedUtc, Is.EqualTo(createUtc)); + Assert.That(item.PublishedUtc, Is.EqualTo(createUtc)); + + _clock.Advance(TimeSpan.FromMinutes(1)); + var editUtc = _clock.UtcNow; + + var updater = new UpdatModelStub() { Owner = "" }; + contentManager.UpdateEditor(item.ContentItem, updater); + + Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); + Assert.That(item.ModifiedUtc, Is.EqualTo(editUtc)); + Assert.That(item.PublishedUtc, Is.EqualTo(createUtc)); + Assert.That(updater.ModelErrors.Count, Is.EqualTo(0)); + } + + [Test] + public void VersioningItemShouldCreatedAndPublishedUtcValuesPerVersion() { + var contentManager = _container.Resolve(); + + var createUtc = _clock.UtcNow; + var item1 = contentManager.Create("test-item", VersionOptions.Draft, init => { }); + + Assert.That(item1.CreatedUtc, Is.EqualTo(createUtc)); + Assert.That(item1.PublishedUtc, Is.Null); + + _clock.Advance(TimeSpan.FromMinutes(1)); + var publish1Utc = _clock.UtcNow; + contentManager.Publish(item1.ContentItem); + + // db records need to be updated before demanding draft as item2 below + _session.Flush(); + + _clock.Advance(TimeSpan.FromMinutes(1)); + var draftUtc = _clock.UtcNow; + var item2 = contentManager.GetDraftRequired(item1.ContentItem.Id); + + _clock.Advance(TimeSpan.FromMinutes(1)); + var publish2Utc = _clock.UtcNow; + contentManager.Publish(item2.ContentItem); + + // both instances non-versioned dates show it was created upfront + Assert.That(item1.CreatedUtc, Is.EqualTo(createUtc)); + Assert.That(item2.CreatedUtc, Is.EqualTo(createUtc)); + + // both instances non-versioned dates show the most recent publish + Assert.That(item1.PublishedUtc, Is.EqualTo(publish2Utc)); + Assert.That(item2.PublishedUtc, Is.EqualTo(publish2Utc)); + + // version1 versioned dates show create was upfront and publish was oldest + Assert.That(item1.VersionCreatedUtc, Is.EqualTo(createUtc)); + Assert.That(item1.VersionPublishedUtc, Is.EqualTo(publish1Utc)); + + // version2 versioned dates show create was midway and publish was most recent + Assert.That(item2.VersionCreatedUtc, Is.EqualTo(draftUtc)); + Assert.That(item2.VersionPublishedUtc, Is.EqualTo(publish2Utc)); + } + + [Test] + public void UnpublishShouldClearFlagButLeaveMostrecentPublishDatesIntact() { + var contentManager = _container.Resolve(); + + var createUtc = _clock.UtcNow; + var item = contentManager.Create("test-item", VersionOptions.Draft, init => { }); + + Assert.That(item.CreatedUtc, Is.EqualTo(createUtc)); + Assert.That(item.PublishedUtc, Is.Null); + + _clock.Advance(TimeSpan.FromMinutes(1)); + var publishUtc = _clock.UtcNow; + contentManager.Publish(item.ContentItem); + + // db records need to be updated before seeking by published flags + _session.Flush(); + + _clock.Advance(TimeSpan.FromMinutes(1)); + var unpublishUtc = _clock.UtcNow; + contentManager.Unpublish(item.ContentItem); + + // db records need to be updated before seeking by published flags + ClearSession(); + + var publishedItem = contentManager.Get(item.ContentItem.Id, VersionOptions.Published); + var latestItem = contentManager.Get(item.ContentItem.Id, VersionOptions.Latest); + var draftItem = contentManager.Get(item.ContentItem.Id, VersionOptions.Draft); + var allVersions = contentManager.GetAllVersions(item.ContentItem.Id); + + Assert.That(publishedItem, Is.Null); + Assert.That(latestItem, Is.Not.Null); + Assert.That(draftItem, Is.Not.Null); + Assert.That(allVersions.Count(), Is.EqualTo(1)); + Assert.That(publishUtc, Is.Not.EqualTo(unpublishUtc)); + Assert.That(latestItem.PublishedUtc, Is.EqualTo(publishUtc)); + Assert.That(latestItem.VersionPublishedUtc, Is.EqualTo(publishUtc)); + Assert.That(latestItem.ContentItem.VersionRecord.Latest, Is.True); + Assert.That(latestItem.ContentItem.VersionRecord.Published, Is.False); + } + } +} diff --git a/src/Orchard.Core.Tests/Feeds/Controllers/FeedControllerTests.cs b/src/Orchard.Core.Tests/Feeds/Controllers/FeedControllerTests.cs index c32a9987ef7..56c07dc076f 100644 --- a/src/Orchard.Core.Tests/Feeds/Controllers/FeedControllerTests.cs +++ b/src/Orchard.Core.Tests/Feeds/Controllers/FeedControllerTests.cs @@ -1,198 +1,198 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web.Mvc; -using System.Web.Routing; -using System.Xml.Linq; -using Autofac; -using Moq; -using NUnit.Framework; -using Orchard.ContentManagement; -using Orchard.ContentManagement.FieldStorage.InfosetStorage; -using Orchard.ContentManagement.Handlers; -using Orchard.ContentManagement.MetaData.Builders; -using Orchard.Core.Common.Models; -using Orchard.Core.Feeds; -using Orchard.Core.Feeds.Controllers; -using Orchard.Core.Feeds.Models; -using Orchard.Core.Feeds.Rss; -using Orchard.Core.Feeds.StandardBuilders; -using Orchard.Tests.Modules; -using Orchard.Tests.Stubs; -using Orchard.Core.Title.Models; - -namespace Orchard.Core.Tests.Feeds.Controllers { - [TestFixture] - public class FeedControllerTests { - [Test] - public void InvalidFormatShpuldReturnNotFoundResult() { - var controller = new FeedController( - Enumerable.Empty(), - Enumerable.Empty(), - new StubItemBuilder() - ) { - ValueProvider = Values.From(new { }) - }; - - var result = controller.Index("no-such-format"); - Assert.That(result, Is.Not.Null); - Assert.That(result, Is.TypeOf()); - } - - [Test] - public void ControllerShouldReturnAnActionResult() { - var formatProvider = new Mock(); - var format = new Mock(); - formatProvider.Setup(x => x.Match(It.IsAny())) - .Returns(new FeedBuilderMatch { FeedBuilder = format.Object, Priority = 10 }); - - var queryProvider = new Mock(); - var query = new Mock(); - queryProvider.Setup(x => x.Match(It.IsAny())) - .Returns(new FeedQueryMatch { FeedQuery = query.Object, Priority = 10 }); - - - format.Setup(x => x.Process(It.IsAny(), It.IsAny())).Returns(new ContentResult()); - - var controller = new FeedController( - new[] { queryProvider.Object }, - new[] { formatProvider.Object }, - new StubItemBuilder() - ) { - ValueProvider = Values.From(new { }) - }; - - var result = controller.Index("test-format"); - Assert.That(result, Is.Not.Null); - Assert.That(result, Is.InstanceOf()); - - formatProvider.Verify(); - queryProvider.Verify(); - format.Verify(); - } - - - class StubQuery : IFeedQueryProvider, IFeedQuery { - private readonly IEnumerable _items; - - public StubQuery(IEnumerable items) { - _items = items; - } - - public FeedQueryMatch Match(FeedContext context) { - return new FeedQueryMatch { FeedQuery = this, Priority = 10 }; - } - - public void Execute(FeedContext context) { - foreach (var item in _items) { - context.Builder.AddItem(context, item); - } - } - } - - class StubItemBuilder : IFeedItemBuilder { - public void Populate(FeedContext context) { - } - } - - [Test] - public void RssFeedShouldBeStructuredAppropriately() { - var query = new StubQuery(Enumerable.Empty()); - - var builder = new ContainerBuilder(); - builder.RegisterType(); - builder.RegisterType().As(); - builder.RegisterInstance(query).As(); - builder.RegisterInstance(new StubItemBuilder()).As(); - var container = builder.Build(); - - var controller = container.Resolve(); - controller.ValueProvider = Values.From(new { }); - - var result = controller.Index("rss"); - Assert.That(result, Is.Not.Null); - Assert.That(result, Is.InstanceOf()); - - var doc = ((RssResult)result).Document; - Assert.That(doc.Root.Name, Is.EqualTo(XName.Get("rss"))); - Assert.That(doc.Root.Elements().Single().Name, Is.EqualTo(XName.Get("channel"))); - } - - [Test] - public void OneItemPerContentItemShouldBeCreated() { - var query = new StubQuery(new[] { - new ContentItem(), - new ContentItem(), - }); - - var builder = new ContainerBuilder(); - builder.RegisterType(); - builder.RegisterType().As(); - builder.RegisterInstance(new StubItemBuilder()).As(); - builder.RegisterInstance(query).As(); - var container = builder.Build(); - - var controller = container.Resolve(); - controller.ValueProvider = Values.From(new { }); - - var result = controller.Index("rss"); - Assert.That(result, Is.Not.Null); - Assert.That(result, Is.InstanceOf()); - - var doc = ((RssResult)result).Document; - var items = doc.Elements("rss").Elements("channel").Elements("item"); - Assert.That(items.Count(), Is.EqualTo(2)); - } - - [Test] - public void CorePartValuesAreExtracted() { - var clock = new StubClock(); - var hello = new ContentItemBuilder(new ContentTypeDefinitionBuilder().Named("hello").Build()) - .Weld() - .Weld() - .Weld() - .Weld() - .Build(); - hello.As().Record = new CommonPartRecord(); - hello.As().Record = new TitlePartRecord(); - hello.As().Record = new BodyPartRecord(); - - hello.As().PublishedUtc = clock.UtcNow; - hello.As().Title = "alpha"; - // hello.As().Slug = "beta"; - hello.As().Text = "gamma"; - - var query = new StubQuery(new[] { - hello, - }); - - var mockContentManager = new Mock(); - mockContentManager.Setup(x => x.GetItemMetadata(It.IsAny())) - .Returns(new ContentItemMetadata() { DisplayText = "foo" }); - - var builder = new ContainerBuilder(); - //builder.RegisterModule(new ImplicitCollectionSupportModule()); - builder.RegisterType(); - builder.RegisterInstance(new RouteCollection()); - builder.RegisterInstance(mockContentManager.Object).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(query).As(); - var container = builder.Build(); - - var controller = container.Resolve(); - controller.ValueProvider = Values.From(new { }); - - var result = controller.Index("rss"); - Assert.That(result, Is.Not.Null); - Assert.That(result, Is.InstanceOf()); - - var doc = ((RssResult)result).Document; - var item = doc.Elements("rss").Elements("channel").Elements("item").Single(); - Assert.That(item.Element("title").Value, Is.EqualTo("foo")); - Assert.That(item.Element("description").Value, Is.EqualTo("gamma")); - - } - } -} - +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web.Mvc; +using System.Web.Routing; +using System.Xml.Linq; +using Autofac; +using Moq; +using NUnit.Framework; +using Orchard.ContentManagement; +using Orchard.ContentManagement.FieldStorage.InfosetStorage; +using Orchard.ContentManagement.Handlers; +using Orchard.ContentManagement.MetaData.Builders; +using Orchard.Core.Common.Models; +using Orchard.Core.Feeds; +using Orchard.Core.Feeds.Controllers; +using Orchard.Core.Feeds.Models; +using Orchard.Core.Feeds.Rss; +using Orchard.Core.Feeds.StandardBuilders; +using Orchard.Tests.Modules; +using Orchard.Tests.Stubs; +using Orchard.Core.Title.Models; + +namespace Orchard.Core.Tests.Feeds.Controllers { + [TestFixture] + public class FeedControllerTests { + [Test] + public void InvalidFormatShpuldReturnNotFoundResult() { + var controller = new FeedController( + Enumerable.Empty(), + Enumerable.Empty(), + new StubItemBuilder() + ) { + ValueProvider = Values.From(new { }) + }; + + var result = controller.Index("no-such-format"); + Assert.That(result, Is.Not.Null); + Assert.That(result, Is.TypeOf()); + } + + [Test] + public void ControllerShouldReturnAnActionResult() { + var formatProvider = new Mock(); + var format = new Mock(); + formatProvider.Setup(x => x.Match(It.IsAny())) + .Returns(new FeedBuilderMatch { FeedBuilder = format.Object, Priority = 10 }); + + var queryProvider = new Mock(); + var query = new Mock(); + queryProvider.Setup(x => x.Match(It.IsAny())) + .Returns(new FeedQueryMatch { FeedQuery = query.Object, Priority = 10 }); + + + format.Setup(x => x.Process(It.IsAny(), It.IsAny())).Returns(new ContentResult()); + + var controller = new FeedController( + new[] { queryProvider.Object }, + new[] { formatProvider.Object }, + new StubItemBuilder() + ) { + ValueProvider = Values.From(new { }) + }; + + var result = controller.Index("test-format"); + Assert.That(result, Is.Not.Null); + Assert.That(result, Is.InstanceOf()); + + formatProvider.Verify(); + queryProvider.Verify(); + format.Verify(); + } + + + class StubQuery : IFeedQueryProvider, IFeedQuery { + private readonly IEnumerable _items; + + public StubQuery(IEnumerable items) { + _items = items; + } + + public FeedQueryMatch Match(FeedContext context) { + return new FeedQueryMatch { FeedQuery = this, Priority = 10 }; + } + + public void Execute(FeedContext context) { + foreach (var item in _items) { + context.Builder.AddItem(context, item); + } + } + } + + class StubItemBuilder : IFeedItemBuilder { + public void Populate(FeedContext context) { + } + } + + [Test] + public void RssFeedShouldBeStructuredAppropriately() { + var query = new StubQuery(Enumerable.Empty()); + + var builder = new ContainerBuilder(); + builder.RegisterType(); + builder.RegisterType().As(); + builder.RegisterInstance(query).As(); + builder.RegisterInstance(new StubItemBuilder()).As(); + var container = builder.Build(); + + var controller = container.Resolve(); + controller.ValueProvider = Values.From(new { }); + + var result = controller.Index("rss"); + Assert.That(result, Is.Not.Null); + Assert.That(result, Is.InstanceOf()); + + var doc = ((RssResult)result).Document; + Assert.That(doc.Root.Name, Is.EqualTo(XName.Get("rss"))); + Assert.That(doc.Root.Elements().Single().Name, Is.EqualTo(XName.Get("channel"))); + } + + [Test] + public void OneItemPerContentItemShouldBeCreated() { + var query = new StubQuery(new[] { + new ContentItem(), + new ContentItem(), + }); + + var builder = new ContainerBuilder(); + builder.RegisterType(); + builder.RegisterType().As(); + builder.RegisterInstance(new StubItemBuilder()).As(); + builder.RegisterInstance(query).As(); + var container = builder.Build(); + + var controller = container.Resolve(); + controller.ValueProvider = Values.From(new { }); + + var result = controller.Index("rss"); + Assert.That(result, Is.Not.Null); + Assert.That(result, Is.InstanceOf()); + + var doc = ((RssResult)result).Document; + var items = doc.Elements("rss").Elements("channel").Elements("item"); + Assert.That(items.Count(), Is.EqualTo(2)); + } + + [Test] + public void CorePartValuesAreExtracted() { + var clock = new StubClock(); + var hello = new ContentItemBuilder(new ContentTypeDefinitionBuilder().Named("hello").Build()) + .Weld() + .Weld() + .Weld() + .Weld() + .Build(); + hello.As().Record = new CommonPartRecord(); + hello.As().Record = new TitlePartRecord(); + hello.As().Record = new BodyPartRecord(); + + hello.As().PublishedUtc = clock.UtcNow; + hello.As().Title = "alpha"; + // hello.As().Slug = "beta"; + hello.As().Text = "gamma"; + + var query = new StubQuery(new[] { + hello, + }); + + var mockContentManager = new Mock(); + mockContentManager.Setup(x => x.GetItemMetadata(It.IsAny())) + .Returns(new ContentItemMetadata() { DisplayText = "foo" }); + + var builder = new ContainerBuilder(); + //builder.RegisterModule(new ImplicitCollectionSupportModule()); + builder.RegisterType(); + builder.RegisterInstance(new RouteCollection()); + builder.RegisterInstance(mockContentManager.Object).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(query).As(); + var container = builder.Build(); + + var controller = container.Resolve(); + controller.ValueProvider = Values.From(new { }); + + var result = controller.Index("rss"); + Assert.That(result, Is.Not.Null); + Assert.That(result, Is.InstanceOf()); + + var doc = ((RssResult)result).Document; + var item = doc.Elements("rss").Elements("channel").Elements("item").Single(); + Assert.That(item.Element("title").Value, Is.EqualTo("foo")); + Assert.That(item.Element("description").Value, Is.EqualTo("gamma")); + + } + } +} + diff --git a/src/Orchard.Core.Tests/Orchard.Core.Tests.csproj b/src/Orchard.Core.Tests/Orchard.Core.Tests.csproj index 412f4d7d5e3..ebefc6ce8b3 100644 --- a/src/Orchard.Core.Tests/Orchard.Core.Tests.csproj +++ b/src/Orchard.Core.Tests/Orchard.Core.Tests.csproj @@ -1,174 +1,174 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2FC1D9C8-446D-4414-B252-5E9FBE61EB63} - Library - Properties - Orchard.Core.Tests - Orchard.Core.Tests - v4.5.1 - 512 - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - ..\OrchardBasicCorrectness.ruleset - AnyCPU - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - AnyCPU - false - - - - False - ..\..\lib\autofac\Autofac.dll - - - False - ..\..\lib\nhibernate\FluentNHibernate.dll - - - False - ..\..\lib\nhibernate\Iesi.Collections.dll - - - False - ..\..\lib\moq\Moq.dll - - - False - ..\..\lib\nhibernate\NHibernate.dll - - - False - ..\..\lib\nunit\nunit.framework.dll - - - - 3.5 - - - - ..\..\lib\sqlce\System.Data.SqlServerCe.dll - True - - - - 3.5 - - - False - ..\..\lib\aspnetmvc\System.Web.Mvc.dll - - - 3.5 - - - - 3.5 - - - - - - - - - - - - - - - {6CB3EB30-F725-45C0-9742-42599BA8E8D2} - Orchard.Tests.Modules - - - {ABC826D4-2FA1-4F2F-87DE-E6095F653810} - Orchard.Framework.Tests - - - {9916839C-39FC-4CEB-A5AF-89CA7E87119F} - Orchard.Core - - - {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} - Orchard.Framework - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - - - - - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {2FC1D9C8-446D-4414-B252-5E9FBE61EB63} + Library + Properties + Orchard.Core.Tests + Orchard.Core.Tests + v4.5.1 + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + ..\OrchardBasicCorrectness.ruleset + AnyCPU + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + AnyCPU + false + + + + False + ..\..\lib\autofac\Autofac.dll + + + False + ..\..\lib\nhibernate\FluentNHibernate.dll + + + False + ..\..\lib\nhibernate\Iesi.Collections.dll + + + False + ..\..\lib\moq\Moq.dll + + + False + ..\..\lib\nhibernate\NHibernate.dll + + + False + ..\..\lib\nunit\nunit.framework.dll + + + + 3.5 + + + + ..\..\lib\sqlce\System.Data.SqlServerCe.dll + True + + + + 3.5 + + + False + ..\..\lib\aspnetmvc\System.Web.Mvc.dll + + + 3.5 + + + + 3.5 + + + + + + + + + + + + + + + {6CB3EB30-F725-45C0-9742-42599BA8E8D2} + Orchard.Tests.Modules + + + {ABC826D4-2FA1-4F2F-87DE-E6095F653810} + Orchard.Framework.Tests + + + {9916839C-39FC-4CEB-A5AF-89CA7E87119F} + Orchard.Core + + + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} + Orchard.Framework + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Core.Tests/Properties/AssemblyInfo.cs b/src/Orchard.Core.Tests/Properties/AssemblyInfo.cs index eb30815309e..e11b0eb989b 100644 --- a/src/Orchard.Core.Tests/Properties/AssemblyInfo.cs +++ b/src/Orchard.Core.Tests/Properties/AssemblyInfo.cs @@ -1,34 +1,34 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Orchard.Core.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyProduct("Orchard")] -[assembly: AssemblyCopyright("Copyright © .NET Foundation")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("883a3424-7500-43a5-8207-6552e580229f")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.9.2")] -[assembly: AssemblyFileVersion("1.9.2")] +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Orchard.Core.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyProduct("Orchard")] +[assembly: AssemblyCopyright("Copyright © .NET Foundation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("883a3424-7500-43a5-8207-6552e580229f")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.9.2")] +[assembly: AssemblyFileVersion("1.9.2")] diff --git a/src/Orchard.Core.Tests/Scheduling/ScheduledTaskExecutorTests.cs b/src/Orchard.Core.Tests/Scheduling/ScheduledTaskExecutorTests.cs index 3fedf4bbd62..f78970ebd85 100644 --- a/src/Orchard.Core.Tests/Scheduling/ScheduledTaskExecutorTests.cs +++ b/src/Orchard.Core.Tests/Scheduling/ScheduledTaskExecutorTests.cs @@ -1,128 +1,128 @@ -using System; -using System.Collections.Generic; -using Autofac; -using Moq; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.ContentManagement; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.Records; -using Orchard.Core.Scheduling.Models; -using Orchard.Core.Scheduling.Services; -using Orchard.Data; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.DisplayManagement.Implementation; -using Orchard.Environment.Extensions; -using Orchard.Tasks; -using Orchard.Tasks.Scheduling; -using Orchard.Tests.Modules; -using Orchard.Tests.Stubs; -using Orchard.UI.PageClass; - -namespace Orchard.Core.Tests.Scheduling { - [TestFixture] - public class ScheduledTaskExecutorTests : DatabaseEnabledTestsBase { - private StubTaskHandler _handler; - private IBackgroundTask _executor; - private IRepository _repository; - - public override void Init() { - base.Init(); - _repository = _container.Resolve>(); - _executor = _container.ResolveNamed("ScheduledTaskExecutor"); - } - public override void Register(ContainerBuilder builder) { - _handler = new StubTaskHandler(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - - builder.RegisterType().As().Named("ScheduledTaskExecutor", typeof(IBackgroundTask)); - builder.RegisterInstance(_handler).As(); - - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - } - - protected override IEnumerable DatabaseTypes { - get { - return new[] { - typeof(ContentTypeRecord), - typeof(ContentItemRecord), - typeof(ContentItemVersionRecord), - typeof(ScheduledTaskRecord), - }; - } - } - - public class StubTaskHandler : IScheduledTaskHandler { - public void Process(ScheduledTaskContext context) { - TaskContext = context; - } - - public ScheduledTaskContext TaskContext { get; private set; } - } - - - [Test] - public void SweepShouldBeCallable() { - _executor.Sweep(); - } - - [Test] - public void RecordsForTheFutureShouldBeIgnored() { - _repository.Create(new ScheduledTaskRecord { ScheduledUtc = _clock.UtcNow.Add(TimeSpan.FromHours(2)) }); - _repository.Flush(); - _executor.Sweep(); - _repository.Flush(); - Assert.That(_repository.Count(x => x != null), Is.EqualTo(1)); - } - - - [Test] - public void RecordsWhenTheyAreExecutedShouldBeDeleted() { - var task = new ScheduledTaskRecord { TaskType = "Ignore", ScheduledUtc = _clock.UtcNow.Add(TimeSpan.FromHours(2)) }; - _repository.Create(task); - - _repository.Flush(); - _executor.Sweep(); - - _repository.Flush(); - Assert.That(_repository.Count(x => x.TaskType == "Ignore"), Is.EqualTo(1)); - - _clock.Advance(TimeSpan.FromHours(3)); - - _repository.Flush(); - _executor.Sweep(); - - _repository.Flush(); - Assert.That(_repository.Count(x => x.TaskType == "Ignore"), Is.EqualTo(0)); - } - - [Test] - public void ScheduledTaskHandlersShouldBeCalledWhenTasksAreExecuted() { - var task = new ScheduledTaskRecord { TaskType = "Ignore", ScheduledUtc = _clock.UtcNow.Add(TimeSpan.FromHours(2)) }; - _repository.Create(task); - - _repository.Flush(); - _clock.Advance(TimeSpan.FromHours(3)); - - Assert.That(_handler.TaskContext, Is.Null); - _executor.Sweep(); - Assert.That(_handler.TaskContext, Is.Not.Null); - - Assert.That(_handler.TaskContext.Task.TaskType, Is.EqualTo("Ignore")); - Assert.That(_handler.TaskContext.Task.ContentItem, Is.Null); - } - } -} - +using System; +using System.Collections.Generic; +using Autofac; +using Moq; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.ContentManagement; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.Records; +using Orchard.Core.Scheduling.Models; +using Orchard.Core.Scheduling.Services; +using Orchard.Data; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.DisplayManagement.Implementation; +using Orchard.Environment.Extensions; +using Orchard.Tasks; +using Orchard.Tasks.Scheduling; +using Orchard.Tests.Modules; +using Orchard.Tests.Stubs; +using Orchard.UI.PageClass; + +namespace Orchard.Core.Tests.Scheduling { + [TestFixture] + public class ScheduledTaskExecutorTests : DatabaseEnabledTestsBase { + private StubTaskHandler _handler; + private IBackgroundTask _executor; + private IRepository _repository; + + public override void Init() { + base.Init(); + _repository = _container.Resolve>(); + _executor = _container.ResolveNamed("ScheduledTaskExecutor"); + } + public override void Register(ContainerBuilder builder) { + _handler = new StubTaskHandler(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + + builder.RegisterType().As().Named("ScheduledTaskExecutor", typeof(IBackgroundTask)); + builder.RegisterInstance(_handler).As(); + + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + } + + protected override IEnumerable DatabaseTypes { + get { + return new[] { + typeof(ContentTypeRecord), + typeof(ContentItemRecord), + typeof(ContentItemVersionRecord), + typeof(ScheduledTaskRecord), + }; + } + } + + public class StubTaskHandler : IScheduledTaskHandler { + public void Process(ScheduledTaskContext context) { + TaskContext = context; + } + + public ScheduledTaskContext TaskContext { get; private set; } + } + + + [Test] + public void SweepShouldBeCallable() { + _executor.Sweep(); + } + + [Test] + public void RecordsForTheFutureShouldBeIgnored() { + _repository.Create(new ScheduledTaskRecord { ScheduledUtc = _clock.UtcNow.Add(TimeSpan.FromHours(2)) }); + _repository.Flush(); + _executor.Sweep(); + _repository.Flush(); + Assert.That(_repository.Count(x => x != null), Is.EqualTo(1)); + } + + + [Test] + public void RecordsWhenTheyAreExecutedShouldBeDeleted() { + var task = new ScheduledTaskRecord { TaskType = "Ignore", ScheduledUtc = _clock.UtcNow.Add(TimeSpan.FromHours(2)) }; + _repository.Create(task); + + _repository.Flush(); + _executor.Sweep(); + + _repository.Flush(); + Assert.That(_repository.Count(x => x.TaskType == "Ignore"), Is.EqualTo(1)); + + _clock.Advance(TimeSpan.FromHours(3)); + + _repository.Flush(); + _executor.Sweep(); + + _repository.Flush(); + Assert.That(_repository.Count(x => x.TaskType == "Ignore"), Is.EqualTo(0)); + } + + [Test] + public void ScheduledTaskHandlersShouldBeCalledWhenTasksAreExecuted() { + var task = new ScheduledTaskRecord { TaskType = "Ignore", ScheduledUtc = _clock.UtcNow.Add(TimeSpan.FromHours(2)) }; + _repository.Create(task); + + _repository.Flush(); + _clock.Advance(TimeSpan.FromHours(3)); + + Assert.That(_handler.TaskContext, Is.Null); + _executor.Sweep(); + Assert.That(_handler.TaskContext, Is.Not.Null); + + Assert.That(_handler.TaskContext.Task.TaskType, Is.EqualTo("Ignore")); + Assert.That(_handler.TaskContext.Task.ContentItem, Is.Null); + } + } +} + diff --git a/src/Orchard.Core.Tests/Scheduling/ScheduledTaskManagerTests.cs b/src/Orchard.Core.Tests/Scheduling/ScheduledTaskManagerTests.cs index 10daf173c39..afda1852223 100644 --- a/src/Orchard.Core.Tests/Scheduling/ScheduledTaskManagerTests.cs +++ b/src/Orchard.Core.Tests/Scheduling/ScheduledTaskManagerTests.cs @@ -1,169 +1,169 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Autofac; -using Moq; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.ContentManagement; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.Records; -using Orchard.Core.Scheduling.Models; -using Orchard.Core.Scheduling.Services; -using Orchard.Data; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.DisplayManagement.Implementation; -using Orchard.Environment.Extensions; -using Orchard.Tasks.Scheduling; -using Orchard.Tests.Modules; -using Orchard.Tests.Stubs; -using Orchard.UI.PageClass; - -namespace Orchard.Core.Tests.Scheduling { - [TestFixture] - public class ScheduledTaskManagerTests : DatabaseEnabledTestsBase { - private IRepository _repository; - private IScheduledTaskManager _scheduledTaskManager; - private IContentManager _contentManager; - private Mock _mockServices; - - public override void Init() { - _mockServices = new Mock(); - base.Init(); - _repository = _container.Resolve>(); - _scheduledTaskManager = _container.Resolve(); - _contentManager = _container.Resolve(); - _mockServices.SetupGet(x => x.ContentManager).Returns(_contentManager); - } - - public override void Register(ContainerBuilder builder) { - builder.RegisterInstance(_mockServices.Object); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - - builder.RegisterType().As(); - - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - } - - protected override IEnumerable DatabaseTypes { - get { - return new[] { - typeof(ContentTypeRecord), - typeof(ContentItemRecord), - typeof(ContentItemVersionRecord), - typeof(ScheduledTaskRecord), - }; - } - } - - [Test] - public void TestFixtureShouldBeAbleToCreateContentItem() { - var hello = _contentManager.New("hello"); - _contentManager.Create(hello); - _session.Flush(); - _session.Clear(); - - var hello2 = _contentManager.Get(hello.Id); - Assert.That(hello2, Is.Not.Null); - Assert.That(hello2.Record, Is.Not.SameAs(hello.Record)); - Assert.That(hello2.Id, Is.EqualTo(hello.Id)); - } - - [Test] - public void TaskManagerShouldCreateTaskRecordsWithOrWithoutContentItem() { - var hello = _contentManager.New("hello"); - _contentManager.Create(hello); - - _scheduledTaskManager.CreateTask("Ignore", _clock.UtcNow.AddHours(1), null); - _scheduledTaskManager.CreateTask("Ignore", _clock.UtcNow.AddHours(2), hello); - _session.Flush(); - _session.Clear(); - - var tasks = _repository.Fetch(x => x != null); - Assert.That(tasks.Count(), Is.EqualTo(2)); - Assert.That(tasks, Has.All.Property("TaskType").EqualTo("Ignore")); - - var noContentItemTask = tasks.Single(x => x.ContentItemVersionRecord == null); - Assert.That(noContentItemTask.ScheduledUtc, Is.EqualTo(_clock.UtcNow.AddHours(1))); - Assert.That(noContentItemTask.ContentItemVersionRecord, Is.Null); - - var hasContentItemTask = tasks.Single(x => x.ContentItemVersionRecord != null); - Assert.That(hasContentItemTask.ContentItemVersionRecord.ContentItemRecord.Id, Is.EqualTo(hello.Id)); - Assert.That(hasContentItemTask.ContentItemVersionRecord.Id, Is.EqualTo(hello.VersionRecord.Id)); - } - - [Test] - public void TasksForAllVersionsOfContenItemShouldBeReturned() { - var hello1 = _contentManager.New("hello"); - _contentManager.Create(hello1); - - var hello2 = _contentManager.GetDraftRequired(hello1.Id); - - Assert.That(hello1.Version, Is.EqualTo(1)); - Assert.That(hello2.Version, Is.EqualTo(2)); - - _scheduledTaskManager.CreateTask("First", _clock.UtcNow.AddHours(1), hello1); - _scheduledTaskManager.CreateTask("Second", _clock.UtcNow.AddHours(2), hello2); - _scheduledTaskManager.CreateTask("Third", _clock.UtcNow.AddHours(3), null); - - _session.Flush(); - _session.Clear(); - - var hello = _contentManager.Get(hello1.Id); - var tasks = _scheduledTaskManager.GetTasks(hello); - Assert.That(tasks.Count(), Is.EqualTo(2)); - - var firstTask = tasks.Single(x => x.TaskType == "First"); - Assert.That(firstTask.ContentItem.Version, Is.EqualTo(1)); - - var secondTask = tasks.Single(x => x.TaskType == "Second"); - Assert.That(secondTask.ContentItem.Version, Is.EqualTo(2)); - } - - [Test] - public void ShouldGetTasksByType() { - _scheduledTaskManager.CreateTask("First", _clock.UtcNow, null); - _scheduledTaskManager.CreateTask("First", _clock.UtcNow, null); - _scheduledTaskManager.CreateTask("First", _clock.UtcNow, null); - _scheduledTaskManager.CreateTask("Second", _clock.UtcNow, null); - _scheduledTaskManager.CreateTask("Second", _clock.UtcNow, null); - _scheduledTaskManager.CreateTask("Third", _clock.UtcNow, null); - - _session.Flush(); - _session.Clear(); - - Assert.That(_scheduledTaskManager.GetTasks("First").Count(), Is.EqualTo(3)); - Assert.That(_scheduledTaskManager.GetTasks("Second").Count(), Is.EqualTo(2)); - Assert.That(_scheduledTaskManager.GetTasks("Third").Count(), Is.EqualTo(1)); - Assert.That(_scheduledTaskManager.GetTasks("Fourth").Count(), Is.EqualTo(0)); - } - - [Test] - public void ShouldGetTasksByTypeAndScheduledDate() { - _scheduledTaskManager.CreateTask("First", _clock.UtcNow, null); - _scheduledTaskManager.CreateTask("First", _clock.UtcNow.AddHours(1), null); - _scheduledTaskManager.CreateTask("First", _clock.UtcNow.AddHours(2), null); - - _session.Flush(); - _session.Clear(); - - Assert.That(_scheduledTaskManager.GetTasks("Foo", _clock.UtcNow.AddHours(5)).Count(), Is.EqualTo(0)); - - Assert.That(_scheduledTaskManager.GetTasks("First", _clock.UtcNow.AddMinutes(-1)).Count(), Is.EqualTo(0)); - Assert.That(_scheduledTaskManager.GetTasks("First", _clock.UtcNow.AddMinutes(1)).Count(), Is.EqualTo(1)); - Assert.That(_scheduledTaskManager.GetTasks("First", _clock.UtcNow.AddHours(1)).Count(), Is.EqualTo(2)); - Assert.That(_scheduledTaskManager.GetTasks("First", _clock.UtcNow.AddHours(2)).Count(), Is.EqualTo(3)); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using Autofac; +using Moq; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.ContentManagement; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.Records; +using Orchard.Core.Scheduling.Models; +using Orchard.Core.Scheduling.Services; +using Orchard.Data; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.DisplayManagement.Implementation; +using Orchard.Environment.Extensions; +using Orchard.Tasks.Scheduling; +using Orchard.Tests.Modules; +using Orchard.Tests.Stubs; +using Orchard.UI.PageClass; + +namespace Orchard.Core.Tests.Scheduling { + [TestFixture] + public class ScheduledTaskManagerTests : DatabaseEnabledTestsBase { + private IRepository _repository; + private IScheduledTaskManager _scheduledTaskManager; + private IContentManager _contentManager; + private Mock _mockServices; + + public override void Init() { + _mockServices = new Mock(); + base.Init(); + _repository = _container.Resolve>(); + _scheduledTaskManager = _container.Resolve(); + _contentManager = _container.Resolve(); + _mockServices.SetupGet(x => x.ContentManager).Returns(_contentManager); + } + + public override void Register(ContainerBuilder builder) { + builder.RegisterInstance(_mockServices.Object); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + + builder.RegisterType().As(); + + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + } + + protected override IEnumerable DatabaseTypes { + get { + return new[] { + typeof(ContentTypeRecord), + typeof(ContentItemRecord), + typeof(ContentItemVersionRecord), + typeof(ScheduledTaskRecord), + }; + } + } + + [Test] + public void TestFixtureShouldBeAbleToCreateContentItem() { + var hello = _contentManager.New("hello"); + _contentManager.Create(hello); + _session.Flush(); + _session.Clear(); + + var hello2 = _contentManager.Get(hello.Id); + Assert.That(hello2, Is.Not.Null); + Assert.That(hello2.Record, Is.Not.SameAs(hello.Record)); + Assert.That(hello2.Id, Is.EqualTo(hello.Id)); + } + + [Test] + public void TaskManagerShouldCreateTaskRecordsWithOrWithoutContentItem() { + var hello = _contentManager.New("hello"); + _contentManager.Create(hello); + + _scheduledTaskManager.CreateTask("Ignore", _clock.UtcNow.AddHours(1), null); + _scheduledTaskManager.CreateTask("Ignore", _clock.UtcNow.AddHours(2), hello); + _session.Flush(); + _session.Clear(); + + var tasks = _repository.Fetch(x => x != null); + Assert.That(tasks.Count(), Is.EqualTo(2)); + Assert.That(tasks, Has.All.Property("TaskType").EqualTo("Ignore")); + + var noContentItemTask = tasks.Single(x => x.ContentItemVersionRecord == null); + Assert.That(noContentItemTask.ScheduledUtc, Is.EqualTo(_clock.UtcNow.AddHours(1))); + Assert.That(noContentItemTask.ContentItemVersionRecord, Is.Null); + + var hasContentItemTask = tasks.Single(x => x.ContentItemVersionRecord != null); + Assert.That(hasContentItemTask.ContentItemVersionRecord.ContentItemRecord.Id, Is.EqualTo(hello.Id)); + Assert.That(hasContentItemTask.ContentItemVersionRecord.Id, Is.EqualTo(hello.VersionRecord.Id)); + } + + [Test] + public void TasksForAllVersionsOfContenItemShouldBeReturned() { + var hello1 = _contentManager.New("hello"); + _contentManager.Create(hello1); + + var hello2 = _contentManager.GetDraftRequired(hello1.Id); + + Assert.That(hello1.Version, Is.EqualTo(1)); + Assert.That(hello2.Version, Is.EqualTo(2)); + + _scheduledTaskManager.CreateTask("First", _clock.UtcNow.AddHours(1), hello1); + _scheduledTaskManager.CreateTask("Second", _clock.UtcNow.AddHours(2), hello2); + _scheduledTaskManager.CreateTask("Third", _clock.UtcNow.AddHours(3), null); + + _session.Flush(); + _session.Clear(); + + var hello = _contentManager.Get(hello1.Id); + var tasks = _scheduledTaskManager.GetTasks(hello); + Assert.That(tasks.Count(), Is.EqualTo(2)); + + var firstTask = tasks.Single(x => x.TaskType == "First"); + Assert.That(firstTask.ContentItem.Version, Is.EqualTo(1)); + + var secondTask = tasks.Single(x => x.TaskType == "Second"); + Assert.That(secondTask.ContentItem.Version, Is.EqualTo(2)); + } + + [Test] + public void ShouldGetTasksByType() { + _scheduledTaskManager.CreateTask("First", _clock.UtcNow, null); + _scheduledTaskManager.CreateTask("First", _clock.UtcNow, null); + _scheduledTaskManager.CreateTask("First", _clock.UtcNow, null); + _scheduledTaskManager.CreateTask("Second", _clock.UtcNow, null); + _scheduledTaskManager.CreateTask("Second", _clock.UtcNow, null); + _scheduledTaskManager.CreateTask("Third", _clock.UtcNow, null); + + _session.Flush(); + _session.Clear(); + + Assert.That(_scheduledTaskManager.GetTasks("First").Count(), Is.EqualTo(3)); + Assert.That(_scheduledTaskManager.GetTasks("Second").Count(), Is.EqualTo(2)); + Assert.That(_scheduledTaskManager.GetTasks("Third").Count(), Is.EqualTo(1)); + Assert.That(_scheduledTaskManager.GetTasks("Fourth").Count(), Is.EqualTo(0)); + } + + [Test] + public void ShouldGetTasksByTypeAndScheduledDate() { + _scheduledTaskManager.CreateTask("First", _clock.UtcNow, null); + _scheduledTaskManager.CreateTask("First", _clock.UtcNow.AddHours(1), null); + _scheduledTaskManager.CreateTask("First", _clock.UtcNow.AddHours(2), null); + + _session.Flush(); + _session.Clear(); + + Assert.That(_scheduledTaskManager.GetTasks("Foo", _clock.UtcNow.AddHours(5)).Count(), Is.EqualTo(0)); + + Assert.That(_scheduledTaskManager.GetTasks("First", _clock.UtcNow.AddMinutes(-1)).Count(), Is.EqualTo(0)); + Assert.That(_scheduledTaskManager.GetTasks("First", _clock.UtcNow.AddMinutes(1)).Count(), Is.EqualTo(1)); + Assert.That(_scheduledTaskManager.GetTasks("First", _clock.UtcNow.AddHours(1)).Count(), Is.EqualTo(2)); + Assert.That(_scheduledTaskManager.GetTasks("First", _clock.UtcNow.AddHours(2)).Count(), Is.EqualTo(3)); + } + } +} diff --git a/src/Orchard.Core.Tests/Settings/Metadata/ContentDefinitionManagerTests.cs b/src/Orchard.Core.Tests/Settings/Metadata/ContentDefinitionManagerTests.cs index 12ca48c6d8d..c8868da12e7 100644 --- a/src/Orchard.Core.Tests/Settings/Metadata/ContentDefinitionManagerTests.cs +++ b/src/Orchard.Core.Tests/Settings/Metadata/ContentDefinitionManagerTests.cs @@ -1,323 +1,323 @@ -using System; -using System.IO; -using System.Linq; -using Autofac; -using Moq; -using NHibernate; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.MetaData.Builders; -using Orchard.ContentManagement.MetaData.Services; -using Orchard.Core.Settings.Metadata; -using Orchard.Core.Settings.Metadata.Records; -using Orchard.Data; -using Orchard.Tests; -using Orchard.Tests.ContentManagement; -using Orchard.Tests.Stubs; -using Orchard.Tests.Utility; - -namespace Orchard.Core.Tests.Settings.Metadata { - [TestFixture] - public class ContentDefinitionManagerTests { - private string _databaseFileName; - private ISessionFactory _sessionFactory; - private ISession _session; - private IContainer _container; - private ITransactionManager _transactionManager; - - [TestFixtureSetUp] - public void InitFixture() { - _databaseFileName = Path.GetTempFileName(); - _sessionFactory = DataUtility.CreateSessionFactory( - _databaseFileName, - typeof(ContentTypeDefinitionRecord), - typeof(ContentTypePartDefinitionRecord), - typeof(ContentPartDefinitionRecord), - typeof(ContentPartFieldDefinitionRecord), - typeof(ContentFieldDefinitionRecord) - ); - } - - [SetUp] - public void Init() { - _session = _sessionFactory.OpenSession(); - foreach (var killType in new[] { typeof(ContentTypeDefinitionRecord), typeof(ContentPartDefinitionRecord), typeof(ContentFieldDefinitionRecord) }) { - foreach (var killRecord in _session.CreateCriteria(killType).List()) { - _session.Delete(killRecord); - } - } - _session.Flush(); - _session.Close(); - _session.Dispose(); - _session = _sessionFactory.OpenSession(); - - var builder = new ContainerBuilder(); - builder.RegisterAutoMocking(); - builder.RegisterType().As(); - builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); - builder.RegisterType(typeof(SettingsFormatter)).As(typeof(ISettingsFormatter)); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - _session = _sessionFactory.OpenSession(); - builder.RegisterInstance(_transactionManager = new TestTransactionManager(_session)).As(); - - _container = builder.Build(); - - } - - void ResetSession() { - _transactionManager.RequireNew(); - } - - [TearDown] - public void Term() { - _session.Dispose(); - } - - [TestFixtureTearDown] - public void TermFixture() { - File.Delete(_databaseFileName); - } - - [Test] - public void NoTypesAreAvailableByDefault() { - var types = _container.Resolve().ListTypeDefinitions(); - Assert.That(types.Count(), Is.EqualTo(0)); - } - - [Test] - public void TypeRecordsAreReturned() { - var repository = _container.Resolve>(); - repository.Create(new ContentTypeDefinitionRecord { Name = "alpha" }); - repository.Create(new ContentTypeDefinitionRecord { Name = "beta" }); - ResetSession(); - var types = _container.Resolve().ListTypeDefinitions(); - Assert.That(types.Count(), Is.EqualTo(2)); - } - - [Test] - public void TypeSettingsAreParsed() { - var repository = _container.Resolve>(); - repository.Create(new ContentTypeDefinitionRecord { Name = "alpha", Settings = "" }); - ResetSession(); - var alpha = _container.Resolve().ListTypeDefinitions().Single(); - Assert.That(alpha.Settings["a"], Is.EqualTo("1")); - Assert.That(alpha.Settings["b"], Is.EqualTo("2")); - } - - [Test] - public void ContentTypesWithSettingsCanBeCreatedAndModified() { - var manager = _container.Resolve(); - manager.StoreTypeDefinition(new ContentTypeDefinitionBuilder() - .Named("alpha") - .WithSetting("a", "1") - .WithSetting("b", "2") - .Build()); - - manager.StoreTypeDefinition(new ContentTypeDefinitionBuilder() - .Named("beta") - .WithSetting("c", "3") - .WithSetting("d", "4") - .Build()); - - ResetSession(); - - var types1 = manager.ListTypeDefinitions(); - Assert.That(types1.Count(), Is.EqualTo(2)); - var alpha1 = types1.Single(t => t.Name == "alpha"); - Assert.That(alpha1.Settings["a"], Is.EqualTo("1")); - manager.StoreTypeDefinition(new ContentTypeDefinitionBuilder(alpha1).WithSetting("a", "5").Build()); - ResetSession(); - - var types2 = manager.ListTypeDefinitions(); - Assert.That(types2.Count(), Is.EqualTo(2)); - var alpha2 = types2.Single(t => t.Name == "alpha"); - Assert.That(alpha2.Settings["a"], Is.EqualTo("5")); - Assert.That(alpha2.Settings["a"], Is.EqualTo("5")); - } - - [Test] - public void StubPartDefinitionsAreCreatedWhenContentTypesAreStored() { - var manager = _container.Resolve(); - manager.StoreTypeDefinition(new ContentTypeDefinitionBuilder() - .Named("alpha") - .WithPart("foo", pb => { }) - .Build()); - - ResetSession(); - - var fooRecord = _container.Resolve>().Fetch(r => r.Name == "foo").SingleOrDefault(); - Assert.That(fooRecord, Is.Not.Null); - Assert.That(fooRecord.Name, Is.EqualTo("foo")); - - var foo = manager.GetPartDefinition("foo"); - Assert.That(foo, Is.Not.Null); - Assert.That(foo.Name, Is.EqualTo("foo")); - - var alpha = manager.GetTypeDefinition("alpha"); - Assert.That(alpha, Is.Not.Null); - Assert.That(alpha.Parts.Count(), Is.EqualTo(1)); - Assert.That(alpha.Parts.Single().PartDefinition.Name, Is.EqualTo("foo")); - } - - [Test] - public void GettingDefinitionsByNameCanReturnNullAndWillAcceptNullEmptyOrInvalidNames() { - var manager = _container.Resolve(); - Assert.That(manager.GetTypeDefinition("no such name"), Is.Null); - Assert.That(manager.GetTypeDefinition(string.Empty), Is.Null); - Assert.That(manager.GetTypeDefinition(null), Is.Null); - Assert.That(manager.GetPartDefinition("no such name"), Is.Null); - Assert.That(manager.GetPartDefinition(string.Empty), Is.Null); - Assert.That(manager.GetPartDefinition(null), Is.Null); - } - - [Test] - public void PartsAreRemovedWhenNotReferencedButPartDefinitionRemains() { - var manager = _container.Resolve(); - manager.StoreTypeDefinition( - new ContentTypeDefinitionBuilder() - .Named("alpha") - .WithPart("foo", pb => { }) - .WithPart("bar", pb => { }) - .Build()); - - AssertThatTypeHasParts("alpha","foo","bar"); - Assert.That(manager.ListPartDefinitions().Count(), Is.EqualTo(2)); - ResetSession(); - AssertThatTypeHasParts("alpha","foo","bar"); - Assert.That(manager.ListPartDefinitions().Count(), Is.EqualTo(2)); - - manager.StoreTypeDefinition( - new ContentTypeDefinitionBuilder(manager.GetTypeDefinition("alpha")) - .WithPart("frap", pb => { }) - .RemovePart("bar") - .Build()); - - AssertThatTypeHasParts("alpha","foo","frap"); - Assert.That(manager.ListPartDefinitions().Count(), Is.EqualTo(3)); - ResetSession(); - AssertThatTypeHasParts("alpha","foo","frap"); - Assert.That(manager.ListPartDefinitions().Count(), Is.EqualTo(3)); - } - - [Test] - public void PartsCanBeDeleted() { - var manager = _container.Resolve(); - manager.StoreTypeDefinition( - new ContentTypeDefinitionBuilder() - .Named("alpha") - .WithPart("foo", pb => { }) - .WithPart("bar", pb => { }) - .Build()); - - AssertThatTypeHasParts("alpha", "foo", "bar"); - Assert.That(manager.ListPartDefinitions().Count(), Is.EqualTo(2)); - - manager.DeletePartDefinition("foo"); - ResetSession(); - - AssertThatTypeHasParts("alpha", "bar"); - Assert.That(manager.ListPartDefinitions().Count(), Is.EqualTo(1)); - } - - [Test] - public void ContentTypesCanBeDeleted() { - var manager = _container.Resolve(); - manager.StoreTypeDefinition( - new ContentTypeDefinitionBuilder() - .Named("alpha") - .WithPart("foo", pb => { }) - .WithPart("bar", pb => { }) - .Build()); - - Assert.That(manager.GetTypeDefinition("alpha"), Is.Not.Null); - manager.DeleteTypeDefinition("alpha"); - ResetSession(); - - Assert.That(manager.GetTypeDefinition("alpha"), Is.Null); - } - - [Test] - public void MultipleFieldsCanBeAddedToImplicitParts() { - var manager = _container.Resolve(); - manager.StorePartDefinition( - new ContentPartDefinitionBuilder() - .Named("alpha") - .WithField("field1", f => f.OfType("TextField")) - .WithField("field2", f => f.OfType("TextField")) - .Build() - ); - - manager.StoreTypeDefinition( - new ContentTypeDefinitionBuilder() - .Named("alpha") - .WithPart("foo") - .Build() - ); - - ResetSession(); - - var types = manager.ListTypeDefinitions(); - Assert.That(types.Count(), Is.EqualTo(1)); - var parts = manager.ListPartDefinitions(); - Assert.That(parts.Count(), Is.EqualTo(2)); - var fields = manager.ListFieldDefinitions(); - Assert.That(fields.Count(), Is.EqualTo(1)); - - var alpha = manager.GetTypeDefinition("alpha"); - Assert.That(alpha.Parts.Count(), Is.EqualTo(1)); - - var part = manager.GetPartDefinition("alpha"); - Assert.That(part.Fields.Count(), Is.EqualTo(2)); - - manager.AlterPartDefinition("alpha", p=>p - .WithField("field3", f => f.OfType("TextField")) - .WithField("field4", f => f.OfType("TextField")) - ); - - ResetSession(); - - part = manager.GetPartDefinition("alpha"); - Assert.That(part.Fields.Count(), Is.EqualTo(4)); - - alpha = manager.GetTypeDefinition("alpha"); - Assert.That(alpha.Parts.Count(), Is.EqualTo(1)); - } - - [Test] - public void DontCreateMultiplePartsWhenAddingMultipleFields() { - var manager = _container.Resolve(); - - manager.AlterPartDefinition("alpha", - part => part - .WithField("StartDate", cfg => cfg - .WithDisplayName("Start Date") - .OfType("DateTimeField") - .WithSetting("DateTimeFieldSettings.Display", "DateAndTime")) - .WithField("EndDate", cfg => cfg - .WithDisplayName("End Date") - .OfType("DateTimeField") - .WithSetting("DateTimeFieldSettings.Display", "DateAndTime")) - ); - - - Assert.That(manager.ListPartDefinitions().Count(), Is.EqualTo(1)); - - var p = manager.GetPartDefinition("alpha"); - Assert.That(p.Fields.Count(), Is.EqualTo(2)); - } - - private void AssertThatTypeHasParts(string typeName, params string[] partNames) { - var type = _container.Resolve().GetTypeDefinition(typeName); - Assert.That(type, Is.Not.Null); - Assert.That(type.Parts.Count(), Is.EqualTo(partNames.Count())); - foreach(var partName in partNames) { - Assert.That(type.Parts.Select(p=>p.PartDefinition.Name), Has.Some.EqualTo(partName)); - } - } - - } -} +using System; +using System.IO; +using System.Linq; +using Autofac; +using Moq; +using NHibernate; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Builders; +using Orchard.ContentManagement.MetaData.Services; +using Orchard.Core.Settings.Metadata; +using Orchard.Core.Settings.Metadata.Records; +using Orchard.Data; +using Orchard.Tests; +using Orchard.Tests.ContentManagement; +using Orchard.Tests.Stubs; +using Orchard.Tests.Utility; + +namespace Orchard.Core.Tests.Settings.Metadata { + [TestFixture] + public class ContentDefinitionManagerTests { + private string _databaseFileName; + private ISessionFactory _sessionFactory; + private ISession _session; + private IContainer _container; + private ITransactionManager _transactionManager; + + [TestFixtureSetUp] + public void InitFixture() { + _databaseFileName = Path.GetTempFileName(); + _sessionFactory = DataUtility.CreateSessionFactory( + _databaseFileName, + typeof(ContentTypeDefinitionRecord), + typeof(ContentTypePartDefinitionRecord), + typeof(ContentPartDefinitionRecord), + typeof(ContentPartFieldDefinitionRecord), + typeof(ContentFieldDefinitionRecord) + ); + } + + [SetUp] + public void Init() { + _session = _sessionFactory.OpenSession(); + foreach (var killType in new[] { typeof(ContentTypeDefinitionRecord), typeof(ContentPartDefinitionRecord), typeof(ContentFieldDefinitionRecord) }) { + foreach (var killRecord in _session.CreateCriteria(killType).List()) { + _session.Delete(killRecord); + } + } + _session.Flush(); + _session.Close(); + _session.Dispose(); + _session = _sessionFactory.OpenSession(); + + var builder = new ContainerBuilder(); + builder.RegisterAutoMocking(); + builder.RegisterType().As(); + builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); + builder.RegisterType(typeof(SettingsFormatter)).As(typeof(ISettingsFormatter)); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + _session = _sessionFactory.OpenSession(); + builder.RegisterInstance(_transactionManager = new TestTransactionManager(_session)).As(); + + _container = builder.Build(); + + } + + void ResetSession() { + _transactionManager.RequireNew(); + } + + [TearDown] + public void Term() { + _session.Dispose(); + } + + [TestFixtureTearDown] + public void TermFixture() { + File.Delete(_databaseFileName); + } + + [Test] + public void NoTypesAreAvailableByDefault() { + var types = _container.Resolve().ListTypeDefinitions(); + Assert.That(types.Count(), Is.EqualTo(0)); + } + + [Test] + public void TypeRecordsAreReturned() { + var repository = _container.Resolve>(); + repository.Create(new ContentTypeDefinitionRecord { Name = "alpha" }); + repository.Create(new ContentTypeDefinitionRecord { Name = "beta" }); + ResetSession(); + var types = _container.Resolve().ListTypeDefinitions(); + Assert.That(types.Count(), Is.EqualTo(2)); + } + + [Test] + public void TypeSettingsAreParsed() { + var repository = _container.Resolve>(); + repository.Create(new ContentTypeDefinitionRecord { Name = "alpha", Settings = "" }); + ResetSession(); + var alpha = _container.Resolve().ListTypeDefinitions().Single(); + Assert.That(alpha.Settings["a"], Is.EqualTo("1")); + Assert.That(alpha.Settings["b"], Is.EqualTo("2")); + } + + [Test] + public void ContentTypesWithSettingsCanBeCreatedAndModified() { + var manager = _container.Resolve(); + manager.StoreTypeDefinition(new ContentTypeDefinitionBuilder() + .Named("alpha") + .WithSetting("a", "1") + .WithSetting("b", "2") + .Build()); + + manager.StoreTypeDefinition(new ContentTypeDefinitionBuilder() + .Named("beta") + .WithSetting("c", "3") + .WithSetting("d", "4") + .Build()); + + ResetSession(); + + var types1 = manager.ListTypeDefinitions(); + Assert.That(types1.Count(), Is.EqualTo(2)); + var alpha1 = types1.Single(t => t.Name == "alpha"); + Assert.That(alpha1.Settings["a"], Is.EqualTo("1")); + manager.StoreTypeDefinition(new ContentTypeDefinitionBuilder(alpha1).WithSetting("a", "5").Build()); + ResetSession(); + + var types2 = manager.ListTypeDefinitions(); + Assert.That(types2.Count(), Is.EqualTo(2)); + var alpha2 = types2.Single(t => t.Name == "alpha"); + Assert.That(alpha2.Settings["a"], Is.EqualTo("5")); + Assert.That(alpha2.Settings["a"], Is.EqualTo("5")); + } + + [Test] + public void StubPartDefinitionsAreCreatedWhenContentTypesAreStored() { + var manager = _container.Resolve(); + manager.StoreTypeDefinition(new ContentTypeDefinitionBuilder() + .Named("alpha") + .WithPart("foo", pb => { }) + .Build()); + + ResetSession(); + + var fooRecord = _container.Resolve>().Fetch(r => r.Name == "foo").SingleOrDefault(); + Assert.That(fooRecord, Is.Not.Null); + Assert.That(fooRecord.Name, Is.EqualTo("foo")); + + var foo = manager.GetPartDefinition("foo"); + Assert.That(foo, Is.Not.Null); + Assert.That(foo.Name, Is.EqualTo("foo")); + + var alpha = manager.GetTypeDefinition("alpha"); + Assert.That(alpha, Is.Not.Null); + Assert.That(alpha.Parts.Count(), Is.EqualTo(1)); + Assert.That(alpha.Parts.Single().PartDefinition.Name, Is.EqualTo("foo")); + } + + [Test] + public void GettingDefinitionsByNameCanReturnNullAndWillAcceptNullEmptyOrInvalidNames() { + var manager = _container.Resolve(); + Assert.That(manager.GetTypeDefinition("no such name"), Is.Null); + Assert.That(manager.GetTypeDefinition(string.Empty), Is.Null); + Assert.That(manager.GetTypeDefinition(null), Is.Null); + Assert.That(manager.GetPartDefinition("no such name"), Is.Null); + Assert.That(manager.GetPartDefinition(string.Empty), Is.Null); + Assert.That(manager.GetPartDefinition(null), Is.Null); + } + + [Test] + public void PartsAreRemovedWhenNotReferencedButPartDefinitionRemains() { + var manager = _container.Resolve(); + manager.StoreTypeDefinition( + new ContentTypeDefinitionBuilder() + .Named("alpha") + .WithPart("foo", pb => { }) + .WithPart("bar", pb => { }) + .Build()); + + AssertThatTypeHasParts("alpha","foo","bar"); + Assert.That(manager.ListPartDefinitions().Count(), Is.EqualTo(2)); + ResetSession(); + AssertThatTypeHasParts("alpha","foo","bar"); + Assert.That(manager.ListPartDefinitions().Count(), Is.EqualTo(2)); + + manager.StoreTypeDefinition( + new ContentTypeDefinitionBuilder(manager.GetTypeDefinition("alpha")) + .WithPart("frap", pb => { }) + .RemovePart("bar") + .Build()); + + AssertThatTypeHasParts("alpha","foo","frap"); + Assert.That(manager.ListPartDefinitions().Count(), Is.EqualTo(3)); + ResetSession(); + AssertThatTypeHasParts("alpha","foo","frap"); + Assert.That(manager.ListPartDefinitions().Count(), Is.EqualTo(3)); + } + + [Test] + public void PartsCanBeDeleted() { + var manager = _container.Resolve(); + manager.StoreTypeDefinition( + new ContentTypeDefinitionBuilder() + .Named("alpha") + .WithPart("foo", pb => { }) + .WithPart("bar", pb => { }) + .Build()); + + AssertThatTypeHasParts("alpha", "foo", "bar"); + Assert.That(manager.ListPartDefinitions().Count(), Is.EqualTo(2)); + + manager.DeletePartDefinition("foo"); + ResetSession(); + + AssertThatTypeHasParts("alpha", "bar"); + Assert.That(manager.ListPartDefinitions().Count(), Is.EqualTo(1)); + } + + [Test] + public void ContentTypesCanBeDeleted() { + var manager = _container.Resolve(); + manager.StoreTypeDefinition( + new ContentTypeDefinitionBuilder() + .Named("alpha") + .WithPart("foo", pb => { }) + .WithPart("bar", pb => { }) + .Build()); + + Assert.That(manager.GetTypeDefinition("alpha"), Is.Not.Null); + manager.DeleteTypeDefinition("alpha"); + ResetSession(); + + Assert.That(manager.GetTypeDefinition("alpha"), Is.Null); + } + + [Test] + public void MultipleFieldsCanBeAddedToImplicitParts() { + var manager = _container.Resolve(); + manager.StorePartDefinition( + new ContentPartDefinitionBuilder() + .Named("alpha") + .WithField("field1", f => f.OfType("TextField")) + .WithField("field2", f => f.OfType("TextField")) + .Build() + ); + + manager.StoreTypeDefinition( + new ContentTypeDefinitionBuilder() + .Named("alpha") + .WithPart("foo") + .Build() + ); + + ResetSession(); + + var types = manager.ListTypeDefinitions(); + Assert.That(types.Count(), Is.EqualTo(1)); + var parts = manager.ListPartDefinitions(); + Assert.That(parts.Count(), Is.EqualTo(2)); + var fields = manager.ListFieldDefinitions(); + Assert.That(fields.Count(), Is.EqualTo(1)); + + var alpha = manager.GetTypeDefinition("alpha"); + Assert.That(alpha.Parts.Count(), Is.EqualTo(1)); + + var part = manager.GetPartDefinition("alpha"); + Assert.That(part.Fields.Count(), Is.EqualTo(2)); + + manager.AlterPartDefinition("alpha", p=>p + .WithField("field3", f => f.OfType("TextField")) + .WithField("field4", f => f.OfType("TextField")) + ); + + ResetSession(); + + part = manager.GetPartDefinition("alpha"); + Assert.That(part.Fields.Count(), Is.EqualTo(4)); + + alpha = manager.GetTypeDefinition("alpha"); + Assert.That(alpha.Parts.Count(), Is.EqualTo(1)); + } + + [Test] + public void DontCreateMultiplePartsWhenAddingMultipleFields() { + var manager = _container.Resolve(); + + manager.AlterPartDefinition("alpha", + part => part + .WithField("StartDate", cfg => cfg + .WithDisplayName("Start Date") + .OfType("DateTimeField") + .WithSetting("DateTimeFieldSettings.Display", "DateAndTime")) + .WithField("EndDate", cfg => cfg + .WithDisplayName("End Date") + .OfType("DateTimeField") + .WithSetting("DateTimeFieldSettings.Display", "DateAndTime")) + ); + + + Assert.That(manager.ListPartDefinitions().Count(), Is.EqualTo(1)); + + var p = manager.GetPartDefinition("alpha"); + Assert.That(p.Fields.Count(), Is.EqualTo(2)); + } + + private void AssertThatTypeHasParts(string typeName, params string[] partNames) { + var type = _container.Resolve().GetTypeDefinition(typeName); + Assert.That(type, Is.Not.Null); + Assert.That(type.Parts.Count(), Is.EqualTo(partNames.Count())); + foreach(var partName in partNames) { + Assert.That(type.Parts.Select(p=>p.PartDefinition.Name), Has.Some.EqualTo(partName)); + } + } + + } +} diff --git a/src/Orchard.Profile/Go.cmd b/src/Orchard.Profile/Go.cmd index 33add4a4233..d6b2b7807a6 100644 --- a/src/Orchard.Profile/Go.cmd +++ b/src/Orchard.Profile/Go.cmd @@ -1,3 +1,3 @@ -@echo off -call "%~dp0\_environment" -"%wcatfiles%\wcat.wsf" -terminate -run -clients localhost -t ".\Scripts\%1.txt" -f ".\settings.txt" -s localhost -singleip -x +@echo off +call "%~dp0\_environment" +"%wcatfiles%\wcat.wsf" -terminate -run -clients localhost -t ".\Scripts\%1.txt" -f ".\settings.txt" -s localhost -singleip -x diff --git a/src/Orchard.Profile/Initialize.cmd b/src/Orchard.Profile/Initialize.cmd index ed9183461cc..0100badf082 100644 --- a/src/Orchard.Profile/Initialize.cmd +++ b/src/Orchard.Profile/Initialize.cmd @@ -1,4 +1,4 @@ -@echo off -call "%~dp0\_environment" -"%wcatfiles%\wcat.wsf" -terminate -update -clients localhost - +@echo off +call "%~dp0\_environment" +"%wcatfiles%\wcat.wsf" -terminate -update -clients localhost + diff --git a/src/Orchard.Profile/Orchard.Profile.csproj b/src/Orchard.Profile/Orchard.Profile.csproj index 46dbbe0569e..424b20ec151 100644 --- a/src/Orchard.Profile/Orchard.Profile.csproj +++ b/src/Orchard.Profile/Orchard.Profile.csproj @@ -1,135 +1,135 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {94E694A2-D140-468D-A277-C5FCE1D13E9B} - Library - Properties - Orchard.Profile - Orchard.Profile - v4.5.1 - 512 - - - 3.5 - - false - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AnyCPU - ..\OrchardBasicCorrectness.ruleset - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - false - - - - False - ..\..\lib\nunit\nunit.framework.dll - - - - 3.5 - - - - 3.5 - - - 3.5 - - - - - False - ..\..\lib\specflow\TechTalk.SpecFlow.dll - - - - - - - True - True - Profiling.feature - - - - - SpecFlowSingleFileGenerator - Profiling.feature.cs - - - - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {94E694A2-D140-468D-A277-C5FCE1D13E9B} + Library + Properties + Orchard.Profile + Orchard.Profile + v4.5.1 + 512 + + + 3.5 + + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AnyCPU + ..\OrchardBasicCorrectness.ruleset + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + false + + + + False + ..\..\lib\nunit\nunit.framework.dll + + + + 3.5 + + + + 3.5 + + + 3.5 + + + + + False + ..\..\lib\specflow\TechTalk.SpecFlow.dll + + + + + + + True + True + Profiling.feature + + + + + SpecFlowSingleFileGenerator + Profiling.feature.cs + + + + + + + + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Profile/Properties/AssemblyInfo.cs b/src/Orchard.Profile/Properties/AssemblyInfo.cs index c26e4ba29a0..783fa2f02db 100644 --- a/src/Orchard.Profile/Properties/AssemblyInfo.cs +++ b/src/Orchard.Profile/Properties/AssemblyInfo.cs @@ -1,34 +1,34 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Orchard.Profile")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyProduct("Orchard")] -[assembly: AssemblyCopyright("Copyright © .NET Foundation")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("669564db-5b8e-4378-b40a-03d3b9bec4c9")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.9.2")] -[assembly: AssemblyFileVersion("1.9.2")] +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Orchard.Profile")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyProduct("Orchard")] +[assembly: AssemblyCopyright("Copyright © .NET Foundation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("669564db-5b8e-4378-b40a-03d3b9bec4c9")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.9.2")] +[assembly: AssemblyFileVersion("1.9.2")] diff --git a/src/Orchard.Profile/Readme.txt b/src/Orchard.Profile/Readme.txt index 6a040b5aa1d..6df576c8c22 100644 --- a/src/Orchard.Profile/Readme.txt +++ b/src/Orchard.Profile/Readme.txt @@ -1,39 +1,39 @@ - -== creating profiling image == - -Create a SQL Server database named Orchard, on the . instance. This can be changed in profiling-setup-commands.txt - -From the base of the checkout, execute ->./build.cmd profiling - -* the ./orchard.proj creates an orchard web site at ./build/Profiling -* the ./src/Orchard.Profile/profiling-setup-commands.txt holds the additional orchard.exe steps used to initialize - -The localhost:80 web server should be pointed to the ./build/Profiling folder at this point -The "admin" password is "profiling-secret" without quotes - - - -== repeatable load for code profiling == - -Attach your profiler to the web server -Run one of the unit tests from the ./src/Orchard.Profile class library -Each test produces a specific, repeatable set of requests against localhost:80 - - - -== stess load wcat capacity profiling == - -This will be done from a command prompt running as administrator in the ./src/Orchard.Profile folder - -If wcat is not already configured for your system, execute -./src/Orchard.Profile>Initialize.cmd - -To run one of the scenario scripts, like dashboard.txt, execute -./src/Orchard.Profile>Go.cmd dashboard - -Scenarios are located at ./src/Orchard.Profile/Scripts with a .txt extension -They generate a variable, high level of load against localhost:80 - -(see wcat documentation for further information about scenario files and wcat capabilities) - + +== creating profiling image == + +Create a SQL Server database named Orchard, on the . instance. This can be changed in profiling-setup-commands.txt + +From the base of the checkout, execute +>./build.cmd profiling + +* the ./orchard.proj creates an orchard web site at ./build/Profiling +* the ./src/Orchard.Profile/profiling-setup-commands.txt holds the additional orchard.exe steps used to initialize + +The localhost:80 web server should be pointed to the ./build/Profiling folder at this point +The "admin" password is "profiling-secret" without quotes + + + +== repeatable load for code profiling == + +Attach your profiler to the web server +Run one of the unit tests from the ./src/Orchard.Profile class library +Each test produces a specific, repeatable set of requests against localhost:80 + + + +== stess load wcat capacity profiling == + +This will be done from a command prompt running as administrator in the ./src/Orchard.Profile folder + +If wcat is not already configured for your system, execute +./src/Orchard.Profile>Initialize.cmd + +To run one of the scenario scripts, like dashboard.txt, execute +./src/Orchard.Profile>Go.cmd dashboard + +Scenarios are located at ./src/Orchard.Profile/Scripts with a .txt extension +They generate a variable, high level of load against localhost:80 + +(see wcat documentation for further information about scenario files and wcat capabilities) + diff --git a/src/Orchard.Profile/Scripts/dashboard.txt b/src/Orchard.Profile/Scripts/dashboard.txt index 3611252402b..70d78fa0b89 100644 --- a/src/Orchard.Profile/Scripts/dashboard.txt +++ b/src/Orchard.Profile/Scripts/dashboard.txt @@ -1,70 +1,70 @@ -scenario -{ - name = "Orchard Dashboard"; - - warmup = 10; - duration = 30; - cooldown = 1; - - ///////////////////////////////////////////////////////////////// - // - // All requests inherit the settings from the default request. - // Defaults are overridden if specified in the request itself. - // - ///////////////////////////////////////////////////////////////// - default - { - // send keep-alive header - setheader - { - name = "Connection"; - value = "keep-alive"; - } - - // set the host header - setheader - { - name = "Host"; - value = server(); - } - - // HTTP1.1 request - version = HTTP11; - - // keep the connection alive after the request - close = ka; - } - - // - // This script is made for IIS7 - // - transaction - { - id = "Login and view admin"; - weight = 1; - - request - { - url = "/Users/Account/LogOn"; - verb = POST; - postdata = "username=admin&password=profiling-secret"; - redirect = true; - redirverb = GET; - statuscode = 200; - } - - request - { - url = "/admin"; - statuscode = 200; - } - - // - // specifically close the connection after both files are requested - // - close - { - method = reset; - } - } -} +scenario +{ + name = "Orchard Dashboard"; + + warmup = 10; + duration = 30; + cooldown = 1; + + ///////////////////////////////////////////////////////////////// + // + // All requests inherit the settings from the default request. + // Defaults are overridden if specified in the request itself. + // + ///////////////////////////////////////////////////////////////// + default + { + // send keep-alive header + setheader + { + name = "Connection"; + value = "keep-alive"; + } + + // set the host header + setheader + { + name = "Host"; + value = server(); + } + + // HTTP1.1 request + version = HTTP11; + + // keep the connection alive after the request + close = ka; + } + + // + // This script is made for IIS7 + // + transaction + { + id = "Login and view admin"; + weight = 1; + + request + { + url = "/Users/Account/LogOn"; + verb = POST; + postdata = "username=admin&password=profiling-secret"; + redirect = true; + redirverb = GET; + statuscode = 200; + } + + request + { + url = "/admin"; + statuscode = 200; + } + + // + // specifically close the connection after both files are requested + // + close + { + method = reset; + } + } +} diff --git a/src/Orchard.Profile/Scripts/homepage.txt b/src/Orchard.Profile/Scripts/homepage.txt index e4cdb99f864..b467ac0bfce 100644 --- a/src/Orchard.Profile/Scripts/homepage.txt +++ b/src/Orchard.Profile/Scripts/homepage.txt @@ -1,63 +1,63 @@ -scenario -{ - name = "Fiddler WCAT Script "; - warmup = 10; - duration = 30; - cooldown = 1; - - default - { - version = HTTP11; - setheader - { - name = "Connection"; - value = "keep-alive"; - } - close = ka; - } - - transaction - { - id = "1"; - weight = 1; - request - { - url = "/"; - setheader - { - name="Host"; - value="localhost"; - } - setheader - { - name="Connection"; - value="keep-alive"; - } - setheader - { - name="User-Agent"; - value="Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7"; - } - setheader - { - name="Accept"; - value="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; - } - setheader - { - name="Accept-Encoding"; - value="gzip,deflate,sdch"; - } - setheader - { - name="Accept-Language"; - value="en-US,en;q=0.8"; - } - setheader - { - name="Accept-Charset"; - value="ISO-8859-1,utf-8;q=0.7,*;q=0.3"; - } - } - } -} +scenario +{ + name = "Fiddler WCAT Script "; + warmup = 10; + duration = 30; + cooldown = 1; + + default + { + version = HTTP11; + setheader + { + name = "Connection"; + value = "keep-alive"; + } + close = ka; + } + + transaction + { + id = "1"; + weight = 1; + request + { + url = "/"; + setheader + { + name="Host"; + value="localhost"; + } + setheader + { + name="Connection"; + value="keep-alive"; + } + setheader + { + name="User-Agent"; + value="Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7"; + } + setheader + { + name="Accept"; + value="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; + } + setheader + { + name="Accept-Encoding"; + value="gzip,deflate,sdch"; + } + setheader + { + name="Accept-Language"; + value="en-US,en;q=0.8"; + } + setheader + { + name="Accept-Charset"; + value="ISO-8859-1,utf-8;q=0.7,*;q=0.3"; + } + } + } +} diff --git a/src/Orchard.Profile/Scripts/scenario.txt b/src/Orchard.Profile/Scripts/scenario.txt index 47e2149ff9e..1e3b9aace1d 100644 --- a/src/Orchard.Profile/Scripts/scenario.txt +++ b/src/Orchard.Profile/Scripts/scenario.txt @@ -1,66 +1,66 @@ -scenario -{ - name = "IIS Home Page"; - - warmup = 10; - duration = 30; - cooldown = 1; - - ///////////////////////////////////////////////////////////////// - // - // All requests inherit the settings from the default request. - // Defaults are overridden if specified in the request itself. - // - ///////////////////////////////////////////////////////////////// - default - { - // send keep-alive header - setheader - { - name = "Connection"; - value = "keep-alive"; - } - - // set the host header - setheader - { - name = "Host"; - value = server(); - } - - // HTTP1.1 request - version = HTTP11; - - // keep the connection alive after the request - close = ka; - } - - // - // This script is made for IIS7 - // - transaction - { - id = "Default Web Site Homepage"; - weight = 1; - - request - { - url = "/"; - statuscode = 200; - } - - request - { - url = "/welcome.png"; - statuscode = 200; - } - - // - // specifically close the connection after both files are requested - // - close - { - method = reset; - } - } -} +scenario +{ + name = "IIS Home Page"; + + warmup = 10; + duration = 30; + cooldown = 1; + + ///////////////////////////////////////////////////////////////// + // + // All requests inherit the settings from the default request. + // Defaults are overridden if specified in the request itself. + // + ///////////////////////////////////////////////////////////////// + default + { + // send keep-alive header + setheader + { + name = "Connection"; + value = "keep-alive"; + } + + // set the host header + setheader + { + name = "Host"; + value = server(); + } + + // HTTP1.1 request + version = HTTP11; + + // keep the connection alive after the request + close = ka; + } + + // + // This script is made for IIS7 + // + transaction + { + id = "Default Web Site Homepage"; + weight = 1; + + request + { + url = "/"; + statuscode = 200; + } + + request + { + url = "/welcome.png"; + statuscode = 200; + } + + // + // specifically close the connection after both files are requested + // + close + { + method = reset; + } + } +} diff --git a/src/Orchard.Profile/Tests/HttpClient.cs b/src/Orchard.Profile/Tests/HttpClient.cs index 94fc3cbf0e8..530c02aace2 100644 --- a/src/Orchard.Profile/Tests/HttpClient.cs +++ b/src/Orchard.Profile/Tests/HttpClient.cs @@ -1,70 +1,70 @@ -using System.IO; -using System.Net; -using TechTalk.SpecFlow; - -namespace Orchard.Profile.Tests { - [Binding] - public class HttpClient { - private readonly CookieContainer _cookieContainer = new CookieContainer(); - private HttpWebRequest _request; - private HttpWebResponse _response; - private string _text; - - [Given(@"I am logged in")] - public void GivenIAmLoggedIn() { - DoRequest("/Users/Account/LogOn"); - - const string requestVerificationTokenName = "__RequestVerificationToken"; - const string valueMarker = "value=\""; - - var tokenIndex = _text.IndexOf(requestVerificationTokenName); - var valueIndex = _text.IndexOf(valueMarker, tokenIndex); - var valueStart = valueIndex + valueMarker.Length; - var valueEnd = _text.IndexOf("\"", valueStart); - var requestVerificationTokenValue = _text.Substring(valueStart, valueEnd - valueStart); - - DoRequest("/Users/Account/LogOn", "userNameOrEmail=admin&password=profiling-secret&rememberMe=false&" + requestVerificationTokenName + "=" + requestVerificationTokenValue); - } - - [When(@"I go to ""(.*)""")] - public void WhenIGoTo(string url) { - DoRequest(url); - } - - [When(@"I go to ""(.*)"" (.*) times")] - public void WhenIGoTo(string url, int times) { - for (int i = 0; i != times; ++i) - DoRequest(url); - } - - private void DoRequest(string url) { - DoRequest(url, null); - } - - private void DoRequest(string url, string postData) { - _request = (HttpWebRequest)WebRequest.Create("http://localhost" + url); - _request.CookieContainer = _cookieContainer; - if (postData != null) { - _request.Method = "POST"; - _request.ContentType = "application/x-www-form-urlencoded"; - using (var stream = _request.GetRequestStream()) { - using (var writer = new StreamWriter(stream)) { - writer.Write(postData); - } - } - } - try { - _response = (HttpWebResponse)_request.GetResponse(); - } - catch (WebException ex) { - _response = (HttpWebResponse)ex.Response; - } - - using (var stream = _response.GetResponseStream()) { - using (var reader = new StreamReader(stream)) { - _text = reader.ReadToEnd(); - } - } - } - } -} +using System.IO; +using System.Net; +using TechTalk.SpecFlow; + +namespace Orchard.Profile.Tests { + [Binding] + public class HttpClient { + private readonly CookieContainer _cookieContainer = new CookieContainer(); + private HttpWebRequest _request; + private HttpWebResponse _response; + private string _text; + + [Given(@"I am logged in")] + public void GivenIAmLoggedIn() { + DoRequest("/Users/Account/LogOn"); + + const string requestVerificationTokenName = "__RequestVerificationToken"; + const string valueMarker = "value=\""; + + var tokenIndex = _text.IndexOf(requestVerificationTokenName); + var valueIndex = _text.IndexOf(valueMarker, tokenIndex); + var valueStart = valueIndex + valueMarker.Length; + var valueEnd = _text.IndexOf("\"", valueStart); + var requestVerificationTokenValue = _text.Substring(valueStart, valueEnd - valueStart); + + DoRequest("/Users/Account/LogOn", "userNameOrEmail=admin&password=profiling-secret&rememberMe=false&" + requestVerificationTokenName + "=" + requestVerificationTokenValue); + } + + [When(@"I go to ""(.*)""")] + public void WhenIGoTo(string url) { + DoRequest(url); + } + + [When(@"I go to ""(.*)"" (.*) times")] + public void WhenIGoTo(string url, int times) { + for (int i = 0; i != times; ++i) + DoRequest(url); + } + + private void DoRequest(string url) { + DoRequest(url, null); + } + + private void DoRequest(string url, string postData) { + _request = (HttpWebRequest)WebRequest.Create("http://localhost" + url); + _request.CookieContainer = _cookieContainer; + if (postData != null) { + _request.Method = "POST"; + _request.ContentType = "application/x-www-form-urlencoded"; + using (var stream = _request.GetRequestStream()) { + using (var writer = new StreamWriter(stream)) { + writer.Write(postData); + } + } + } + try { + _response = (HttpWebResponse)_request.GetResponse(); + } + catch (WebException ex) { + _response = (HttpWebResponse)ex.Response; + } + + using (var stream = _response.GetResponseStream()) { + using (var reader = new StreamReader(stream)) { + _text = reader.ReadToEnd(); + } + } + } + } +} diff --git a/src/Orchard.Profile/Tests/Profiling.feature b/src/Orchard.Profile/Tests/Profiling.feature index cadf674cb63..72bb21d3a9b 100644 --- a/src/Orchard.Profile/Tests/Profiling.feature +++ b/src/Orchard.Profile/Tests/Profiling.feature @@ -1,29 +1,29 @@ -Feature: Profiling - In order to profile the site - As a developer - I want to generate a fixed number of repeatable requests - -Scenario: Warmup - Given I am logged in - When I go to "/admin" - When I go to "/blog0" - When I go to "/" - -Scenario: Dashboard - Given I am logged in - When I go to "/admin" 40 times - -Scenario: Hitting blogs - Given I am logged in - When I go to "/blog0" 10 times - When I go to "/blog1" 10 times - When I go to "/blog2" 10 times - When I go to "/blog3" 10 times - When I go to "/blog4" 10 times - -Scenario: Hitting home page - //Given I am logged in - When I go to "/" 10 times - When I go to "/" 10 times - When I go to "/" 10 times - When I go to "/" 10 times +Feature: Profiling + In order to profile the site + As a developer + I want to generate a fixed number of repeatable requests + +Scenario: Warmup + Given I am logged in + When I go to "/admin" + When I go to "/blog0" + When I go to "/" + +Scenario: Dashboard + Given I am logged in + When I go to "/admin" 40 times + +Scenario: Hitting blogs + Given I am logged in + When I go to "/blog0" 10 times + When I go to "/blog1" 10 times + When I go to "/blog2" 10 times + When I go to "/blog3" 10 times + When I go to "/blog4" 10 times + +Scenario: Hitting home page + //Given I am logged in + When I go to "/" 10 times + When I go to "/" 10 times + When I go to "/" 10 times + When I go to "/" 10 times diff --git a/src/Orchard.Profile/Tests/Profiling.feature.cs b/src/Orchard.Profile/Tests/Profiling.feature.cs index 3633721e3d8..8c0012fbcf8 100644 --- a/src/Orchard.Profile/Tests/Profiling.feature.cs +++ b/src/Orchard.Profile/Tests/Profiling.feature.cs @@ -1,146 +1,146 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by SpecFlow (http://www.specflow.org/). -// SpecFlow Version:1.9.0.0 -// SpecFlow Generator Version:1.9.0.0 -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ -#region Designer generated code -#pragma warning disable -namespace Orchard.Profile.Tests -{ - using TechTalk.SpecFlow; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.0")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [NUnit.Framework.TestFixtureAttribute()] - [NUnit.Framework.DescriptionAttribute("Profiling")] - public partial class ProfilingFeature - { - - private static TechTalk.SpecFlow.ITestRunner testRunner; - -#line 1 "Profiling.feature" -#line hidden - - [NUnit.Framework.TestFixtureSetUpAttribute()] - public virtual void FeatureSetup() - { - testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Profiling", " In order to profile the site\r\n As a developer\r\n I want to generate a fixed nu" + - "mber of repeatable requests", ProgrammingLanguage.CSharp, ((string[])(null))); - testRunner.OnFeatureStart(featureInfo); - } - - [NUnit.Framework.TestFixtureTearDownAttribute()] - public virtual void FeatureTearDown() - { - testRunner.OnFeatureEnd(); - testRunner = null; - } - - [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() - { - } - - [NUnit.Framework.TearDownAttribute()] - public virtual void ScenarioTearDown() - { - testRunner.OnScenarioEnd(); - } - - public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) - { - testRunner.OnScenarioStart(scenarioInfo); - } - - public virtual void ScenarioCleanup() - { - testRunner.CollectScenarioErrors(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Warmup")] - public virtual void Warmup() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Warmup", ((string[])(null))); -#line 6 -this.ScenarioSetup(scenarioInfo); -#line 7 - testRunner.Given("I am logged in", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 8 - testRunner.When("I go to \"/admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 9 - testRunner.When("I go to \"/blog0\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 10 - testRunner.When("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Dashboard")] - public virtual void Dashboard() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Dashboard", ((string[])(null))); -#line 12 -this.ScenarioSetup(scenarioInfo); -#line 13 - testRunner.Given("I am logged in", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 14 - testRunner.When("I go to \"/admin\" 40 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Hitting blogs")] - public virtual void HittingBlogs() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Hitting blogs", ((string[])(null))); -#line 16 -this.ScenarioSetup(scenarioInfo); -#line 17 - testRunner.Given("I am logged in", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 18 - testRunner.When("I go to \"/blog0\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 19 - testRunner.When("I go to \"/blog1\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 20 - testRunner.When("I go to \"/blog2\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 21 - testRunner.When("I go to \"/blog3\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 22 - testRunner.When("I go to \"/blog4\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Hitting home page")] - public virtual void HittingHomePage() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Hitting home page", ((string[])(null))); -#line 24 -this.ScenarioSetup(scenarioInfo); -#line 26 - testRunner.When("I go to \"/\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 27 - testRunner.When("I go to \"/\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 28 - testRunner.When("I go to \"/\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 29 - testRunner.When("I go to \"/\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - this.ScenarioCleanup(); - } - } -} -#pragma warning restore -#endregion +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.9.0.0 +// SpecFlow Generator Version:1.9.0.0 +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +#pragma warning disable +namespace Orchard.Profile.Tests +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.0")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("Profiling")] + public partial class ProfilingFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "Profiling.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Profiling", " In order to profile the site\r\n As a developer\r\n I want to generate a fixed nu" + + "mber of repeatable requests", ProgrammingLanguage.CSharp, ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + [NUnit.Framework.SetUpAttribute()] + public virtual void TestInitialize() + { + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + public virtual void ScenarioCleanup() + { + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Warmup")] + public virtual void Warmup() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Warmup", ((string[])(null))); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 + testRunner.Given("I am logged in", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 8 + testRunner.When("I go to \"/admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 9 + testRunner.When("I go to \"/blog0\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 10 + testRunner.When("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Dashboard")] + public virtual void Dashboard() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Dashboard", ((string[])(null))); +#line 12 +this.ScenarioSetup(scenarioInfo); +#line 13 + testRunner.Given("I am logged in", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 14 + testRunner.When("I go to \"/admin\" 40 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Hitting blogs")] + public virtual void HittingBlogs() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Hitting blogs", ((string[])(null))); +#line 16 +this.ScenarioSetup(scenarioInfo); +#line 17 + testRunner.Given("I am logged in", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 18 + testRunner.When("I go to \"/blog0\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 19 + testRunner.When("I go to \"/blog1\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 20 + testRunner.When("I go to \"/blog2\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 21 + testRunner.When("I go to \"/blog3\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 22 + testRunner.When("I go to \"/blog4\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Hitting home page")] + public virtual void HittingHomePage() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Hitting home page", ((string[])(null))); +#line 24 +this.ScenarioSetup(scenarioInfo); +#line 26 + testRunner.When("I go to \"/\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 27 + testRunner.When("I go to \"/\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 28 + testRunner.When("I go to \"/\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 29 + testRunner.When("I go to \"/\" 10 times", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + this.ScenarioCleanup(); + } + } +} +#pragma warning restore +#endregion diff --git a/src/Orchard.Profile/_environment.cmd b/src/Orchard.Profile/_environment.cmd index a3af1cc384f..031f5d0b476 100644 --- a/src/Orchard.Profile/_environment.cmd +++ b/src/Orchard.Profile/_environment.cmd @@ -1,5 +1,5 @@ -CScript //H:CScript - -set wcatfiles=%programfiles%\wcat -if not "%programfiles(x86)%"=="" set wcatfiles=%programfiles(x86)%\wcat -if not exist "%wcatfiles%" set wcatfiles="%~dp0\..\..\lib\wcat" +CScript //H:CScript + +set wcatfiles=%programfiles%\wcat +if not "%programfiles(x86)%"=="" set wcatfiles=%programfiles(x86)%\wcat +if not exist "%wcatfiles%" set wcatfiles="%~dp0\..\..\lib\wcat" diff --git a/src/Orchard.Profile/profiling-setup-commands.txt b/src/Orchard.Profile/profiling-setup-commands.txt index 4d3228c372a..23f706bcb89 100644 --- a/src/Orchard.Profile/profiling-setup-commands.txt +++ b/src/Orchard.Profile/profiling-setup-commands.txt @@ -1 +1 @@ -setup /SiteName:Profiling /AdminUsername:admin /AdminPassword:profiling-secret /DatabaseProvider:SQLServer /DatabaseConnectionString:"Data Source=.;Initial Catalog=Orchard;Integrated Security=True" /EnabledFeatures:Profiling,Orchard.Framework,Common,Containers,Contents,Dashboard,Feeds,Navigation,Reports,Scheduling,Settings,Shapes,Title,PackagingServices,Gallery,Orchard.PublishLater,Orchard.Blogs,Orchard.Comments,Orchard.ContentTypes,Orchard.jQuery,Orchard.Lists,Orchard.MediaLibrary,Orchard.ContentPicker,Orchard.MediaPicker,Orchard.Modules,Orchard.Packaging,Orchard.Pages,Orchard.Recipes,Orchard.Roles,Orchard.Tags,Orchard.Themes,Orchard.Users,Orchard.Scripting,Orchard.Scripting.Lightweight,Orchard.Widgets,TinyMce,TheThemeMachine,Orchard.Tokens,Orchard.Alias,Orchard.Autoroute +setup /SiteName:Profiling /AdminUsername:admin /AdminPassword:profiling-secret /DatabaseProvider:SQLServer /DatabaseConnectionString:"Data Source=.;Initial Catalog=Orchard;Integrated Security=True" /EnabledFeatures:Profiling,Orchard.Framework,Common,Containers,Contents,Dashboard,Feeds,Navigation,Reports,Scheduling,Settings,Shapes,Title,PackagingServices,Gallery,Orchard.PublishLater,Orchard.Blogs,Orchard.Comments,Orchard.ContentTypes,Orchard.jQuery,Orchard.Lists,Orchard.MediaLibrary,Orchard.ContentPicker,Orchard.MediaPicker,Orchard.Modules,Orchard.Packaging,Orchard.Pages,Orchard.Recipes,Orchard.Roles,Orchard.Tags,Orchard.Themes,Orchard.Users,Orchard.Scripting,Orchard.Scripting.Lightweight,Orchard.Widgets,TinyMce,TheThemeMachine,Orchard.Tokens,Orchard.Alias,Orchard.Autoroute diff --git a/src/Orchard.Profile/report.xsl b/src/Orchard.Profile/report.xsl index 2045aafbe3c..c354fd0bab3 100644 --- a/src/Orchard.Profile/report.xsl +++ b/src/Orchard.Profile/report.xsl @@ -1,1786 +1,1786 @@ - - - - - - - - - - - - - - - topValue ){ - topIndex = i; - topValue = test; - } - } - } - - return (topIndex+1) * 1; - - }catch(e){ - return 0; - } -} - -function tag(){ - return ++g_tag; -} - -]]> - - - - Contents - Summary - Top: - of - Warnings - Type - Item - Warning - Help - Total - Average - Transactions: - Total Records: - - - - - - - - - - - - - 10 - - - - - - - - 1 - - - - - - - - - - - - -
      - - - - - - - - - - - - - - - - - - -
      - -

      - - - - - - - -
      - - - : - - - - -
      -
      -
      -
      - - - - - - - - - - - - -
      - - - - - - - -
      - - - - - -
      -
      - -
      -
      - - - - - - - - - - - -
      - - - -
      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - bold - - - - # - - - - - - - -
      - b3 - - - - - - - 40% - - - - - - - - - - b3 - - - - 0.00 - - - - - b3 - - - - 0.00 - - - - - - - - - - b3 - - 40% - - - - - - - - - -
      -
      -
      -
      - - - - - - - - - - - - - - - - - -
      - b3 - - - - - -
      - - - - - - - - - - - -
      -
      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - - -
      - - - -
      -
      -
      - - - - - -
      - -
      - - - - - - - -
      - -
      - - -
      - - - - - - - -table_ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - - - - - -
      - - - - - - - - - - - - - - - - top_ - show() - pressTop() - - - - - - - - - - - - - - -
      - - - - - - -
      -
      - -
      -
      - -
      - - - - - -
      -
      -
      - -
      - - - - - - - - - - - - - - - -
      - -

      - - -
      - - - - - - - - - - - - - - - - - all - - - - - - - - - - - - - - - all - - - - - - - - - - - - 0 - - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - all - - - - - - - - - - - - table_ - - - - - - - ascending - - - - - - number - - - - - - ascending - - - - - - number - - - - - - - - - - - - - - - - - - - - - - - - - b3 - b1 - - - - - - - display:'' - display:'none' - - - - - - - - - - - - - + - - - - - - - - - - - c_ - - - - display:'none'; - - - - - - - - - - - - - - - - - - - - - -
      - - - - true - -
      - - folder( c_ ) - - e_c_ - - - - - - - - - - - -
      - - - - -
      - - - - child - -
      -
      - - - - - - border-top: 1px solid black; - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      -
      - - - - - - -
      -
      -
      - -
      -
      - -
      - -
      - - - - - - - - - - - - - - - - - - - - - - -
      - - - - : - - - - info b3 - - - - - - -

      -
      - - - - - - - - - - - - - - - - - - - - - 8% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0.00 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - string - - - span - - - number - - - - - sort(); - cursor:hand; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - - - -
      -
      - -
      - - - - - - - - - - w__ - - popup() - .style.display='none' - - - - - - - - - - - - - - - - - - - - - - popup_ - - popup() - .style.display='none' - - - - - -
      -
      - -
      -
      -
      -
      -
      - -
      - - - - - - - - - - - -
      - - - - - -
      - - - - - - - - - -
      -
      - - - - - - - - - - - - - - - b3 - - - - - - - - - - - -
      - - - - - - - - - - - - - - - -
      - - -
      Information
      -
      - -
      Warning
      -
      - -
      Error
      -
      -
      -
      - - - # - - - - - - - - - - - - - - - - - - - - help('') - - - -
      -
      -
      -
      -
      - - -
      - -
      - -
      -
      - i -
      -
      -
      - - -
      - -
      - ! -
      -
      - -
      -
      - ! -
      -
      -
      - - -
      - -
      - -
      -
      - -
      -
      -
      - - -
      - -
      - -
      -
      -
      - - - - - - -
      -
      - - -
      -
      -
      -
      -
      -
      - - -
      + + + + + + + + + + + + + + + topValue ){ + topIndex = i; + topValue = test; + } + } + } + + return (topIndex+1) * 1; + + }catch(e){ + return 0; + } +} + +function tag(){ + return ++g_tag; +} + +]]> + + + + Contents + Summary + Top: + of + Warnings + Type + Item + Warning + Help + Total + Average + Transactions: + Total Records: + + + + + + + + + + + + + 10 + + + + + + + + 1 + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + +
      + +

      + + + + + + + +
      + + + : + + + + +
      +
      +
      +
      + + + + + + + + + + + + +
      + + + + + + + +
      + + + + + +
      +
      + +
      +
      + + + + + + + + + + + +
      + + + +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + bold + + + + # + + + + + + + +
      + b3 + + + + + + + 40% + + + + + + + + + + b3 + + + + 0.00 + + + + + b3 + + + + 0.00 + + + + + + + + + + b3 + + 40% + + + + + + + + + +
      +
      +
      +
      + + + + + + + + + + + + + + + + + +
      + b3 + + + + + +
      + + + + + + + + + + + +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + + +
      +
      +
      + + + + + +
      + +
      + + + + + + + +
      + +
      + + +
      + + + + + + + +table_ +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + + + + + + + + top_ + show() + pressTop() + + + + + + + + + + + + + + +
      + + + + + + +
      +
      + +
      +
      + +
      + + + + + +
      +
      +
      + +
      + + + + + + + + + + + + + + + +
      + +

      + + + + + + + + + + + + + + + + + + + + all + + + + + + + + + + + + + + + all + + + + + + + + + + + + 0 + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + all + + + + + + + + + + + + table_ + + + + + + + ascending + + + + + + number + + + + + + ascending + + + + + + number + + + + + + + + + + + + + + + + + + + + + + + + + b3 + b1 + + + + + + + display:'' + display:'none' + + + + + + + + + + + - + + + + + + + + + + + + + c_ + + + + display:'none'; + + + + + + + + + + + + + + + + + + + + + +
      + + + + true + +
      + + folder( c_ ) + + e_c_ + + + + + + + + + + + +
      + + + + +
      + + + + child + +
      +
      + + + + + + border-top: 1px solid black; + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +
      + + + + + + +
      +
      +
      + +
      +
      + +
      + +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + + + : + + + + info b3 + + + + + + +

      +
      + + + + + + + + + + + + + + + + + + + + + 8% + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.00 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + string + + + span + + + number + + + + + sort(); + cursor:hand; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + +
      +
      + +
      + + + + + + + + + + w__ + + popup() + .style.display='none' + + + + + + + + + + + + + + + + + + + + + + popup_ + + popup() + .style.display='none' + + + + + +
      +
      + +
      +
      +
      +
      +
      + +
      + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + +
      +
      + + + + + + + + + + + + + + + b3 + + + + + + + + + + + +
      + + + + + + + + + + + + + + + +
      + + +
      Information
      +
      + +
      Warning
      +
      + +
      Error
      +
      +
      +
      + + + # + + + + + + + + + + + + + + + + + + + + help('') + + + +
      +
      +
      +
      +
      + + +
      + +
      + +
      +
      + i +
      +
      +
      + + +
      + +
      + ! +
      +
      + +
      +
      + ! +
      +
      +
      + + +
      + +
      + +
      +
      + +
      +
      +
      + + +
      + +
      + +
      +
      +
      + + + + + + +
      +
      + + +
      +
      +
      +
      +
      +
      + + + diff --git a/src/Orchard.Profile/settings.txt b/src/Orchard.Profile/settings.txt index d376cfef4f8..cfe8358d5c0 100644 --- a/src/Orchard.Profile/settings.txt +++ b/src/Orchard.Profile/settings.txt @@ -1,104 +1,104 @@ -settings -{ - //-------------------------------------------------------------------------- - // General controller settings - // - // clientfile - specifies the client file, relative to working dir - // server - host name of the webserver - // virtualclients - number of 'threads' per physical client - // clients - number of physical webcat client machines - // - //-------------------------------------------------------------------------- - // Example: - // - // clientfile = "ubr\lcw2.light.ubr"; - // server = "webserver"; - // clients = 10; - // virtualclients = 100; - // - //-------------------------------------------------------------------------- - - virtualclients = 20; - - //-------------------------------------------------------------------------- - // Performance counters (pass '-x' option to wcctl.exe to enable) - // - // interval - polling interval in seconds (default=10) - // host - host name of machine to monitor (default=webserver) - // counter - path of counter to monitor - // - //-------------------------------------------------------------------------- - // Optional: - // - // Additional machines can be monitored by adding more counters blocks. - // - // Example: - // - // counters { - // host = "sqlserver"; // name of remote machine - // interval = 5; - // counter = "..."; - // } - // - //-------------------------------------------------------------------------- - - counters - { - interval = 10; - - counter = "Processor(_Total)\\% Processor Time"; - counter = "Processor(_Total)\\% Privileged Time"; - counter = "Processor(_Total)\\% User Time"; - counter = "Processor(_Total)\\Interrupts/sec"; - - counter = "Memory\\Available KBytes"; - - counter = "Process(w3wp)\\Working Set"; - - counter = "System\\Context Switches/sec"; - counter = "System\\System Calls/sec"; - - counter = "Web Service(_Total)\\Bytes Received/sec" ; - counter = "Web Service(_Total)\\Bytes Sent/sec" ; - counter = "Web Service(_Total)\\Connection Attempts/sec" ; - counter = "Web Service(_Total)\\Get Requests/sec" ; - } - - //-------------------------------------------------------------------------- - // Registry Key Monitors (pass '-x' option to wcctl.exe to enable) - // - // path - registry path, relative to HKLM - // name - name of registry key - // type - type of value (REG_SZ | REG_DWORD) - // - //-------------------------------------------------------------------------- - // Optional: - // - // Additional registry keys can be monitored on the web server by - // adding more registry blocks to this file. Note that simple strings and - // dwords are all that webcat currently supports. - // - // Example: - // - // registry { - // path = "System\\CurrentControlSet\\Services\\Tcpip\\Parameters"; - // name = "DhcpDomain"; - // type = REG_SZ; - // } - // - //-------------------------------------------------------------------------- - - registry - { - path = "System\\CurrentControlSet\\Control\\FileSystem"; - name = "NtfsDisableLastAccessUpdate"; - type = REG_DWORD; - } - - registry - { - path = "System\\CurrentControlSet\\Services\\Tcpip\\Parameters"; - name = "SynAttackProtect"; - type = REG_DWORD; - } -} +settings +{ + //-------------------------------------------------------------------------- + // General controller settings + // + // clientfile - specifies the client file, relative to working dir + // server - host name of the webserver + // virtualclients - number of 'threads' per physical client + // clients - number of physical webcat client machines + // + //-------------------------------------------------------------------------- + // Example: + // + // clientfile = "ubr\lcw2.light.ubr"; + // server = "webserver"; + // clients = 10; + // virtualclients = 100; + // + //-------------------------------------------------------------------------- + + virtualclients = 20; + + //-------------------------------------------------------------------------- + // Performance counters (pass '-x' option to wcctl.exe to enable) + // + // interval - polling interval in seconds (default=10) + // host - host name of machine to monitor (default=webserver) + // counter - path of counter to monitor + // + //-------------------------------------------------------------------------- + // Optional: + // + // Additional machines can be monitored by adding more counters blocks. + // + // Example: + // + // counters { + // host = "sqlserver"; // name of remote machine + // interval = 5; + // counter = "..."; + // } + // + //-------------------------------------------------------------------------- + + counters + { + interval = 10; + + counter = "Processor(_Total)\\% Processor Time"; + counter = "Processor(_Total)\\% Privileged Time"; + counter = "Processor(_Total)\\% User Time"; + counter = "Processor(_Total)\\Interrupts/sec"; + + counter = "Memory\\Available KBytes"; + + counter = "Process(w3wp)\\Working Set"; + + counter = "System\\Context Switches/sec"; + counter = "System\\System Calls/sec"; + + counter = "Web Service(_Total)\\Bytes Received/sec" ; + counter = "Web Service(_Total)\\Bytes Sent/sec" ; + counter = "Web Service(_Total)\\Connection Attempts/sec" ; + counter = "Web Service(_Total)\\Get Requests/sec" ; + } + + //-------------------------------------------------------------------------- + // Registry Key Monitors (pass '-x' option to wcctl.exe to enable) + // + // path - registry path, relative to HKLM + // name - name of registry key + // type - type of value (REG_SZ | REG_DWORD) + // + //-------------------------------------------------------------------------- + // Optional: + // + // Additional registry keys can be monitored on the web server by + // adding more registry blocks to this file. Note that simple strings and + // dwords are all that webcat currently supports. + // + // Example: + // + // registry { + // path = "System\\CurrentControlSet\\Services\\Tcpip\\Parameters"; + // name = "DhcpDomain"; + // type = REG_SZ; + // } + // + //-------------------------------------------------------------------------- + + registry + { + path = "System\\CurrentControlSet\\Control\\FileSystem"; + name = "NtfsDisableLastAccessUpdate"; + type = REG_DWORD; + } + + registry + { + path = "System\\CurrentControlSet\\Services\\Tcpip\\Parameters"; + name = "SynAttackProtect"; + type = REG_DWORD; + } +} diff --git a/src/Orchard.Specs/Admin.feature b/src/Orchard.Specs/Admin.feature index d9f623abb5c..0a8cd8a76a5 100644 --- a/src/Orchard.Specs/Admin.feature +++ b/src/Orchard.Specs/Admin.feature @@ -1,9 +1,9 @@ -Feature: The Admin side of the app - In order to manage my site - As a privileged user - I want to not have my cheese moved in the admin - -Scenario: The current version of Orchard is displayed in the admin - Given I have installed Orchard - When I go to "admin" +Feature: The Admin side of the app + In order to manage my site + As a privileged user + I want to not have my cheese moved in the admin + +Scenario: The current version of Orchard is displayed in the admin + Given I have installed Orchard + When I go to "admin" Then I should see "
      Orchard v(?:\.\d+){2,4}
      " \ No newline at end of file diff --git a/src/Orchard.Specs/Admin.feature.cs b/src/Orchard.Specs/Admin.feature.cs index af6c44c5f04..26d73d58f70 100644 --- a/src/Orchard.Specs/Admin.feature.cs +++ b/src/Orchard.Specs/Admin.feature.cs @@ -1,87 +1,87 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by SpecFlow (http://www.specflow.org/). -// SpecFlow Version:1.9.0.77 -// SpecFlow Generator Version:1.9.0.0 -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ -#region Designer generated code -#pragma warning disable -namespace Orchard.Specs -{ - using TechTalk.SpecFlow; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [NUnit.Framework.TestFixtureAttribute()] - [NUnit.Framework.DescriptionAttribute("The Admin side of the app")] - public partial class TheAdminSideOfTheAppFeature - { - - private static TechTalk.SpecFlow.ITestRunner testRunner; - -#line 1 "Admin.feature" -#line hidden - - [NUnit.Framework.TestFixtureSetUpAttribute()] - public virtual void FeatureSetup() - { - testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "The Admin side of the app", " In order to manage my site\r\n As a privileged user\r\n I want to not have my che" + - "ese moved in the admin", ProgrammingLanguage.CSharp, ((string[])(null))); - testRunner.OnFeatureStart(featureInfo); - } - - [NUnit.Framework.TestFixtureTearDownAttribute()] - public virtual void FeatureTearDown() - { - testRunner.OnFeatureEnd(); - testRunner = null; - } - - [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() - { - } - - [NUnit.Framework.TearDownAttribute()] - public virtual void ScenarioTearDown() - { - testRunner.OnScenarioEnd(); - } - - public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) - { - testRunner.OnScenarioStart(scenarioInfo); - } - - public virtual void ScenarioCleanup() - { - testRunner.CollectScenarioErrors(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("The current version of Orchard is displayed in the admin")] - public virtual void TheCurrentVersionOfOrchardIsDisplayedInTheAdmin() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("The current version of Orchard is displayed in the admin", ((string[])(null))); -#line 6 -this.ScenarioSetup(scenarioInfo); -#line 7 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 8 - testRunner.When("I go to \"admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 9 - testRunner.Then("I should see \"
      Orchard v(?:\\.\\d+){2,4}
      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - } -} -#pragma warning restore -#endregion +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.9.0.77 +// SpecFlow Generator Version:1.9.0.0 +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +#pragma warning disable +namespace Orchard.Specs +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("The Admin side of the app")] + public partial class TheAdminSideOfTheAppFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "Admin.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "The Admin side of the app", " In order to manage my site\r\n As a privileged user\r\n I want to not have my che" + + "ese moved in the admin", ProgrammingLanguage.CSharp, ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + [NUnit.Framework.SetUpAttribute()] + public virtual void TestInitialize() + { + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + public virtual void ScenarioCleanup() + { + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("The current version of Orchard is displayed in the admin")] + public virtual void TheCurrentVersionOfOrchardIsDisplayedInTheAdmin() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("The current version of Orchard is displayed in the admin", ((string[])(null))); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 8 + testRunner.When("I go to \"admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 9 + testRunner.Then("I should see \"
      Orchard v(?:\\.\\d+){2,4}
      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + } +} +#pragma warning restore +#endregion diff --git a/src/Orchard.Specs/App.Config b/src/Orchard.Specs/App.Config index 22c902af424..37fee690a3f 100644 --- a/src/Orchard.Specs/App.Config +++ b/src/Orchard.Specs/App.Config @@ -1,3 +1,3 @@ - - - + + + diff --git a/src/Orchard.Specs/Bindings/BindingBase.cs b/src/Orchard.Specs/Bindings/BindingBase.cs index a02839d2908..618f385ead3 100644 --- a/src/Orchard.Specs/Bindings/BindingBase.cs +++ b/src/Orchard.Specs/Bindings/BindingBase.cs @@ -1,30 +1,30 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using TechTalk.SpecFlow; - -namespace Orchard.Specs.Bindings { - public class BindingBase { - protected static T Binding() { - return (T)ScenarioContext.Current.GetBindingInstance(typeof(T)); - } - - protected Table TableData(params T[] rows) { - return BuildTable(rows); - } - - protected Table TableData(IEnumerable rows) { - return BuildTable(rows); - } - - private Table BuildTable(IEnumerable rows) { - var properties = typeof(T).GetProperties(); - var table = new Table(properties.Select(x => x.Name).ToArray()); - foreach (var row in rows) { - var row1 = row; - table.AddRow(properties.Select(p => Convert.ToString(p.GetValue(row1, null))).ToArray()); - } - return table; - } - } +using System; +using System.Collections.Generic; +using System.Linq; +using TechTalk.SpecFlow; + +namespace Orchard.Specs.Bindings { + public class BindingBase { + protected static T Binding() { + return (T)ScenarioContext.Current.GetBindingInstance(typeof(T)); + } + + protected Table TableData(params T[] rows) { + return BuildTable(rows); + } + + protected Table TableData(IEnumerable rows) { + return BuildTable(rows); + } + + private Table BuildTable(IEnumerable rows) { + var properties = typeof(T).GetProperties(); + var table = new Table(properties.Select(x => x.Name).ToArray()); + foreach (var row in rows) { + var row1 = row; + table.AddRow(properties.Select(p => Convert.ToString(p.GetValue(row1, null))).ToArray()); + } + return table; + } + } } \ No newline at end of file diff --git a/src/Orchard.Specs/Bindings/CommandLine.cs b/src/Orchard.Specs/Bindings/CommandLine.cs index 84a71491920..1e1458f2b25 100644 --- a/src/Orchard.Specs/Bindings/CommandLine.cs +++ b/src/Orchard.Specs/Bindings/CommandLine.cs @@ -1,33 +1,33 @@ -using System.IO; -using System.Linq; -using Orchard.Commands; -using Orchard.Parameters; -using Orchard.Specs.Hosting; -using TechTalk.SpecFlow; - -namespace Orchard.Specs.Bindings { - [Binding] - public class CommandLine : BindingBase { - [When(@"I execute >(.*)")] - public void WhenIExecute(string commandLine) { - var details = new RequestDetails(); - Binding().Host.Execute(() => { - var args = new CommandLineParser().Parse(commandLine); - var parameters = new CommandParametersParser().Parse(args); - var agent = new CommandHostAgent(); - var input = new StringReader(""); - var output = new StringWriter(); - details.StatusCode = (int)agent.RunSingleCommand( - input, - output, - "Default", - parameters.Arguments.ToArray(), - parameters.Switches.ToDictionary(kv => kv.Key, kv => kv.Value)); - details.StatusDescription = details.StatusCode.ToString(); - details.ResponseText = output.ToString(); - }); - - Binding().Details = details; - } - } -} +using System.IO; +using System.Linq; +using Orchard.Commands; +using Orchard.Parameters; +using Orchard.Specs.Hosting; +using TechTalk.SpecFlow; + +namespace Orchard.Specs.Bindings { + [Binding] + public class CommandLine : BindingBase { + [When(@"I execute >(.*)")] + public void WhenIExecute(string commandLine) { + var details = new RequestDetails(); + Binding().Host.Execute(() => { + var args = new CommandLineParser().Parse(commandLine); + var parameters = new CommandParametersParser().Parse(args); + var agent = new CommandHostAgent(); + var input = new StringReader(""); + var output = new StringWriter(); + details.StatusCode = (int)agent.RunSingleCommand( + input, + output, + "Default", + parameters.Arguments.ToArray(), + parameters.Switches.ToDictionary(kv => kv.Key, kv => kv.Value)); + details.StatusDescription = details.StatusCode.ToString(); + details.ResponseText = output.ToString(); + }); + + Binding().Details = details; + } + } +} diff --git a/src/Orchard.Specs/Bindings/ContentRights.cs b/src/Orchard.Specs/Bindings/ContentRights.cs index e4c2f827450..0bddd599119 100644 --- a/src/Orchard.Specs/Bindings/ContentRights.cs +++ b/src/Orchard.Specs/Bindings/ContentRights.cs @@ -1,73 +1,73 @@ -using System; -using NUnit.Framework; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Aspects; -using Orchard.Core.Contents; -using Orchard.Data; -using Orchard.Roles.Models; -using Orchard.Roles.Services; -using Orchard.Security; -using Orchard.Security.Permissions; -using Orchard.Specs.Hosting.Orchard.Web; -using TechTalk.SpecFlow; - -namespace Orchard.Specs.Bindings { - [Binding] - public class ContentRights : BindingBase { - - [Then(@"""(.*)\"" should be able to ""(.*)\"" a ""(.*)\"" owned by ""(.*)\""")] - public void UserShouldBeAbleToForOthers(string username, string action, string contentType, string otherName) { - - var webApp = Binding(); - webApp.Host.Execute(() => { - using ( var environment = MvcApplication.CreateStandaloneEnvironment("Default") ) { - var memberShipService = environment.Resolve(); - var authorizationService = environment.Resolve(); - var contentManager = environment.Resolve(); - - var contentItem = contentManager.Create(contentType); - var user = memberShipService.GetUser(username); - var otherUser = memberShipService.GetUser(otherName); - contentItem.As().Owner = otherUser; - - Assert.That(authorizationService.TryCheckAccess(GetPermissionForAction(action), user, contentItem), Is.True); - } - }); - } - - [Then(@"""(.*)\"" should not be able to ""(.*)\"" a ""(.*)\"" owned by ""(.*)\""")] - public void UserShouldNotBeAbleToForOthers(string username, string action, string contentType, string otherName) { - - var webApp = Binding(); - webApp.Host.Execute(() => { - using ( var environment = MvcApplication.CreateStandaloneEnvironment("Default") ) { - var memberShipService = environment.Resolve(); - var athorizationService = environment.Resolve(); - var contentManager = environment.Resolve(); - - var contentItem = contentManager.Create(contentType); - var user = memberShipService.GetUser(username); - var otherUser = memberShipService.GetUser(otherName); - contentItem.As().Owner = otherUser; - - Assert.That(athorizationService.TryCheckAccess(GetPermissionForAction(action), user, contentItem), Is.False); - } - }); - } - - // returns permissions as they are used in controllers for each action - private static Permission GetPermissionForAction(string action) { - switch ( action ) { - case "publish": - return Permissions.PublishContent; - case "edit": - return Permissions.EditContent; - case "delete": - return Permissions.DeleteContent; - default: - return null; - } - } - - } -} +using System; +using NUnit.Framework; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Aspects; +using Orchard.Core.Contents; +using Orchard.Data; +using Orchard.Roles.Models; +using Orchard.Roles.Services; +using Orchard.Security; +using Orchard.Security.Permissions; +using Orchard.Specs.Hosting.Orchard.Web; +using TechTalk.SpecFlow; + +namespace Orchard.Specs.Bindings { + [Binding] + public class ContentRights : BindingBase { + + [Then(@"""(.*)\"" should be able to ""(.*)\"" a ""(.*)\"" owned by ""(.*)\""")] + public void UserShouldBeAbleToForOthers(string username, string action, string contentType, string otherName) { + + var webApp = Binding(); + webApp.Host.Execute(() => { + using ( var environment = MvcApplication.CreateStandaloneEnvironment("Default") ) { + var memberShipService = environment.Resolve(); + var authorizationService = environment.Resolve(); + var contentManager = environment.Resolve(); + + var contentItem = contentManager.Create(contentType); + var user = memberShipService.GetUser(username); + var otherUser = memberShipService.GetUser(otherName); + contentItem.As().Owner = otherUser; + + Assert.That(authorizationService.TryCheckAccess(GetPermissionForAction(action), user, contentItem), Is.True); + } + }); + } + + [Then(@"""(.*)\"" should not be able to ""(.*)\"" a ""(.*)\"" owned by ""(.*)\""")] + public void UserShouldNotBeAbleToForOthers(string username, string action, string contentType, string otherName) { + + var webApp = Binding(); + webApp.Host.Execute(() => { + using ( var environment = MvcApplication.CreateStandaloneEnvironment("Default") ) { + var memberShipService = environment.Resolve(); + var athorizationService = environment.Resolve(); + var contentManager = environment.Resolve(); + + var contentItem = contentManager.Create(contentType); + var user = memberShipService.GetUser(username); + var otherUser = memberShipService.GetUser(otherName); + contentItem.As().Owner = otherUser; + + Assert.That(athorizationService.TryCheckAccess(GetPermissionForAction(action), user, contentItem), Is.False); + } + }); + } + + // returns permissions as they are used in controllers for each action + private static Permission GetPermissionForAction(string action) { + switch ( action ) { + case "publish": + return Permissions.PublishContent; + case "edit": + return Permissions.EditContent; + case "delete": + return Permissions.DeleteContent; + default: + return null; + } + } + + } +} diff --git a/src/Orchard.Specs/Bindings/HtmlNodeExtensions.cs b/src/Orchard.Specs/Bindings/HtmlNodeExtensions.cs index 0a8b4281c0a..fdc370e9413 100644 --- a/src/Orchard.Specs/Bindings/HtmlNodeExtensions.cs +++ b/src/Orchard.Specs/Bindings/HtmlNodeExtensions.cs @@ -1,11 +1,11 @@ -using HtmlAgilityPack; - -namespace Orchard.Specs.Bindings { - public static class HtmlNodeExtensions { - public static string GetOptionValue(this HtmlNode node) { - return node.Attributes.Contains("value") - ? node.GetAttributeValue("value", "") - : node.NextSibling != null && node.NextSibling.NodeType == HtmlNodeType.Text ? node.NextSibling.InnerText : ""; - } - } +using HtmlAgilityPack; + +namespace Orchard.Specs.Bindings { + public static class HtmlNodeExtensions { + public static string GetOptionValue(this HtmlNode node) { + return node.Attributes.Contains("value") + ? node.GetAttributeValue("value", "") + : node.NextSibling != null && node.NextSibling.NodeType == HtmlNodeType.Text ? node.NextSibling.InnerText : ""; + } + } } \ No newline at end of file diff --git a/src/Orchard.Specs/Bindings/OrchardSiteFactory.cs b/src/Orchard.Specs/Bindings/OrchardSiteFactory.cs index f83c4786850..a2e72893c89 100644 --- a/src/Orchard.Specs/Bindings/OrchardSiteFactory.cs +++ b/src/Orchard.Specs/Bindings/OrchardSiteFactory.cs @@ -1,120 +1,120 @@ -using System.Linq; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.MetaData.Models; -using Orchard.Core.Contents.Extensions; -using Orchard.Environment.Configuration; -using Orchard.Environment.Descriptor; -using Orchard.Environment.Descriptor.Models; -using Orchard.Specs.Hosting.Orchard.Web; -using TechTalk.SpecFlow; - -namespace Orchard.Specs.Bindings { - [Binding] - public class OrchardSiteFactory : BindingBase { - [Given(@"I have installed Orchard")] - public void GivenIHaveInstalledOrchard() { - GivenIHaveInstalledOrchard("/"); - } - - [Given(@"I have installed Orchard at ""(.*)\""")] - public void GivenIHaveInstalledOrchard(string virtualDirectory) { - var webApp = Binding(); - - // this is the list of module which will be copied over into the temporary Orchard folder - webApp.GivenIHaveACleanSiteWith( - virtualDirectory, - TableData( - new { extension = "Module", names = "Lucene, Markdown, Orchard.Alias, Orchard.AntiSpam, Orchard.ArchiveLater, Orchard.Autoroute, Orchard.Azure, Orchard.Blogs, Orchard.Caching, Orchard.CodeGeneration, Orchard.Comments, Orchard.ContentPermissions, Orchard.ContentPicker, Orchard.ContentTypes, Orchard.CustomForms, Orchard.DesignerTools, Orchard.Email, Orchard.Fields, Orchard.Forms, Orchard.ImageEditor, Orchard.ImportExport, Orchard.Indexing, Orchard.JobsQueue, Orchard.jQuery, Orchard.Layouts, Orchard.Lists, Orchard.Localization, Orchard.Media, Orchard.MediaLibrary, Orchard.MediaPicker, Orchard.MediaProcessing, Orchard.Migrations, Orchard.Modules, Orchard.MultiTenancy, Orchard.OutputCache, Orchard.Packaging, Orchard.Pages, Orchard.Projections, Orchard.PublishLater, Orchard.Recipes, Orchard.Roles, Orchard.Rules, Orchard.Scripting, Orchard.Scripting.CSharp, Orchard.Scripting.Dlr, Orchard.Search, Orchard.SecureSocketsLayer, Orchard.Setup, Orchard.Tags, Orchard.TaskLease, Orchard.Taxonomies, Orchard.Templates, Orchard.Themes, Orchard.Tokens, Orchard.Users, Orchard.Warmup, Orchard.Widgets, Orchard.Workflows, SysCache, TinyMce, Upgrade" }, - new { extension = "Core", names = "Common, Containers, Contents, Dashboard, Feeds, Navigation, Reports, Scheduling, Settings, Shapes, Title, XmlRpc" }, - new { extension = "Theme", names = "SafeMode, TheAdmin, TheThemeMachine" })); - - webApp.WhenIGoTo("Setup"); - - webApp.WhenIFillIn(TableData( - new { name = "SiteName", value = "My Site" }, - new { name = "AdminPassword", value = "6655321" }, - new { name = "ConfirmPassword", value = "6655321" })); - - webApp.WhenIHit("Finish Setup"); - } - - [Given(@"I have installed ""(.*)\""")] - public void GivenIHaveInstalled(string name) { - var webApp = Binding(); - webApp.GivenIHaveModule(name); - webApp.Host.Execute(MvcApplication.ReloadExtensions); - - GivenIHaveEnabled(name); - } - - [Given(@"I have enabled ""(.*)\""")] - public void GivenIHaveEnabled(string name) { - var webApp = Binding(); - webApp.Host.Execute(() => { - using (var environment = MvcApplication.CreateStandaloneEnvironment("Default")) { - var descriptorManager = environment.Resolve(); - var descriptor = descriptorManager.GetShellDescriptor(); - descriptorManager.UpdateShellDescriptor( - descriptor.SerialNumber, - descriptor.Features.Concat(new[] { new ShellFeature { Name = name } }), - descriptor.Parameters); - } - - // this is needed to force the tenant to restart when a new feature is enabled, - // as DefaultOrchardHost maintains this list in a thread context otherwise - // and looses the information - MvcApplication.RestartTenant("Default"); - }); - - } - - [Given(@"I have a containable content type ""(.*)\""")] - public void GivenIHaveAContainableContentType(string name) { - var webApp = Binding(); - webApp.Host.Execute(() => { - using (var environment = MvcApplication.CreateStandaloneEnvironment("Default")) { - var cdm = environment.Resolve(); - - var contentTypeDefinition = new ContentTypeDefinition(name, name); - cdm.StoreTypeDefinition(contentTypeDefinition); - cdm.AlterTypeDefinition(name, cfg => cfg.WithPart("CommonPart").WithPart("BodyPart").WithPart("TitlePart").WithPart("ContainablePart").Creatable().Draftable()); - - cdm.AlterTypeDefinition(name, - cfg => cfg.WithPart("AutoroutePart", - builder => builder - .WithSetting("AutorouteSettings.AllowCustomPattern", "true") - .WithSetting("AutorouteSettings.AutomaticAdjustmentOnEdit", "false") - .WithSetting("AutorouteSettings.PatternDefinitions", "[{Name:'Title', Pattern: '{Content.Slug}', Description: 'my-list'}]") - .WithSetting("AutorouteSettings.DefaultPatternIndex", "0") - )); - - } - }); - } - - [Given(@"I have tenant ""(.*)\"" on ""(.*)\"" as ""(.*)\""")] - public void GivenIHaveTenantOnSiteAsName(string shellName, string hostName, string siteName) { - var webApp = Binding(); - webApp.Host.Execute(() => { - var shellSettings = new ShellSettings { - Name = shellName, - RequestUrlHost = hostName, - State = TenantState.Uninitialized, - }; - using (var environment = MvcApplication.CreateStandaloneEnvironment("Default")) { - environment.Resolve().SaveSettings(shellSettings); - } - - MvcApplication.RestartTenant(shellName); - }); - - webApp.WhenIGoToPathOnHost("Setup", hostName); - - webApp.WhenIFillIn(TableData( - new { name = "SiteName", value = siteName }, - new { name = "AdminPassword", value = "6655321" })); - - webApp.WhenIHit("Finish Setup"); - } - } -} +using System.Linq; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.Core.Contents.Extensions; +using Orchard.Environment.Configuration; +using Orchard.Environment.Descriptor; +using Orchard.Environment.Descriptor.Models; +using Orchard.Specs.Hosting.Orchard.Web; +using TechTalk.SpecFlow; + +namespace Orchard.Specs.Bindings { + [Binding] + public class OrchardSiteFactory : BindingBase { + [Given(@"I have installed Orchard")] + public void GivenIHaveInstalledOrchard() { + GivenIHaveInstalledOrchard("/"); + } + + [Given(@"I have installed Orchard at ""(.*)\""")] + public void GivenIHaveInstalledOrchard(string virtualDirectory) { + var webApp = Binding(); + + // this is the list of module which will be copied over into the temporary Orchard folder + webApp.GivenIHaveACleanSiteWith( + virtualDirectory, + TableData( + new { extension = "Module", names = "Lucene, Markdown, Orchard.Alias, Orchard.AntiSpam, Orchard.ArchiveLater, Orchard.Autoroute, Orchard.Azure, Orchard.Blogs, Orchard.Caching, Orchard.CodeGeneration, Orchard.Comments, Orchard.ContentPermissions, Orchard.ContentPicker, Orchard.ContentTypes, Orchard.CustomForms, Orchard.DesignerTools, Orchard.Email, Orchard.Fields, Orchard.Forms, Orchard.ImageEditor, Orchard.ImportExport, Orchard.Indexing, Orchard.JobsQueue, Orchard.jQuery, Orchard.Layouts, Orchard.Lists, Orchard.Localization, Orchard.Media, Orchard.MediaLibrary, Orchard.MediaPicker, Orchard.MediaProcessing, Orchard.Migrations, Orchard.Modules, Orchard.MultiTenancy, Orchard.OutputCache, Orchard.Packaging, Orchard.Pages, Orchard.Projections, Orchard.PublishLater, Orchard.Recipes, Orchard.Roles, Orchard.Rules, Orchard.Scripting, Orchard.Scripting.CSharp, Orchard.Scripting.Dlr, Orchard.Search, Orchard.SecureSocketsLayer, Orchard.Setup, Orchard.Tags, Orchard.TaskLease, Orchard.Taxonomies, Orchard.Templates, Orchard.Themes, Orchard.Tokens, Orchard.Users, Orchard.Warmup, Orchard.Widgets, Orchard.Workflows, SysCache, TinyMce, Upgrade" }, + new { extension = "Core", names = "Common, Containers, Contents, Dashboard, Feeds, Navigation, Reports, Scheduling, Settings, Shapes, Title, XmlRpc" }, + new { extension = "Theme", names = "SafeMode, TheAdmin, TheThemeMachine" })); + + webApp.WhenIGoTo("Setup"); + + webApp.WhenIFillIn(TableData( + new { name = "SiteName", value = "My Site" }, + new { name = "AdminPassword", value = "6655321" }, + new { name = "ConfirmPassword", value = "6655321" })); + + webApp.WhenIHit("Finish Setup"); + } + + [Given(@"I have installed ""(.*)\""")] + public void GivenIHaveInstalled(string name) { + var webApp = Binding(); + webApp.GivenIHaveModule(name); + webApp.Host.Execute(MvcApplication.ReloadExtensions); + + GivenIHaveEnabled(name); + } + + [Given(@"I have enabled ""(.*)\""")] + public void GivenIHaveEnabled(string name) { + var webApp = Binding(); + webApp.Host.Execute(() => { + using (var environment = MvcApplication.CreateStandaloneEnvironment("Default")) { + var descriptorManager = environment.Resolve(); + var descriptor = descriptorManager.GetShellDescriptor(); + descriptorManager.UpdateShellDescriptor( + descriptor.SerialNumber, + descriptor.Features.Concat(new[] { new ShellFeature { Name = name } }), + descriptor.Parameters); + } + + // this is needed to force the tenant to restart when a new feature is enabled, + // as DefaultOrchardHost maintains this list in a thread context otherwise + // and looses the information + MvcApplication.RestartTenant("Default"); + }); + + } + + [Given(@"I have a containable content type ""(.*)\""")] + public void GivenIHaveAContainableContentType(string name) { + var webApp = Binding(); + webApp.Host.Execute(() => { + using (var environment = MvcApplication.CreateStandaloneEnvironment("Default")) { + var cdm = environment.Resolve(); + + var contentTypeDefinition = new ContentTypeDefinition(name, name); + cdm.StoreTypeDefinition(contentTypeDefinition); + cdm.AlterTypeDefinition(name, cfg => cfg.WithPart("CommonPart").WithPart("BodyPart").WithPart("TitlePart").WithPart("ContainablePart").Creatable().Draftable()); + + cdm.AlterTypeDefinition(name, + cfg => cfg.WithPart("AutoroutePart", + builder => builder + .WithSetting("AutorouteSettings.AllowCustomPattern", "true") + .WithSetting("AutorouteSettings.AutomaticAdjustmentOnEdit", "false") + .WithSetting("AutorouteSettings.PatternDefinitions", "[{Name:'Title', Pattern: '{Content.Slug}', Description: 'my-list'}]") + .WithSetting("AutorouteSettings.DefaultPatternIndex", "0") + )); + + } + }); + } + + [Given(@"I have tenant ""(.*)\"" on ""(.*)\"" as ""(.*)\""")] + public void GivenIHaveTenantOnSiteAsName(string shellName, string hostName, string siteName) { + var webApp = Binding(); + webApp.Host.Execute(() => { + var shellSettings = new ShellSettings { + Name = shellName, + RequestUrlHost = hostName, + State = TenantState.Uninitialized, + }; + using (var environment = MvcApplication.CreateStandaloneEnvironment("Default")) { + environment.Resolve().SaveSettings(shellSettings); + } + + MvcApplication.RestartTenant(shellName); + }); + + webApp.WhenIGoToPathOnHost("Setup", hostName); + + webApp.WhenIFillIn(TableData( + new { name = "SiteName", value = siteName }, + new { name = "AdminPassword", value = "6655321" })); + + webApp.WhenIHit("Finish Setup"); + } + } +} diff --git a/src/Orchard.Specs/Bindings/SanityCheck.cs b/src/Orchard.Specs/Bindings/SanityCheck.cs index f6719679683..9f1363dbbd6 100644 --- a/src/Orchard.Specs/Bindings/SanityCheck.cs +++ b/src/Orchard.Specs/Bindings/SanityCheck.cs @@ -1,40 +1,40 @@ -using NUnit.Framework; -using TechTalk.SpecFlow; - -namespace Orchard.Specs.Bindings { - [Binding] - public class SanityCheck { - private bool _runSteps; - private bool _valueSet; - private int _value; - - [Given("I have a scenario")] - public void GivenIHaveAScenario() { - - } - - [When("I run steps")] - public void WhenIRunSteps() { - _runSteps = true; - } - - - [When(@"they have values like ""(.*)""")] - public void WhenTheyHaveValuesLike(int value) { - Assert.That(_valueSet, Is.False); - _value = value; - _valueSet = true; - } - - [Then("they run")] - public void ThenTheyRun() { - Assert.That(_runSteps, Is.True); - } - - [Then("values like five are captured")] - public void ThenValuesLikeFiveAreCaptured() { - Assert.That(_valueSet, Is.True); - Assert.That(_value, Is.EqualTo(5)); - } - } -} +using NUnit.Framework; +using TechTalk.SpecFlow; + +namespace Orchard.Specs.Bindings { + [Binding] + public class SanityCheck { + private bool _runSteps; + private bool _valueSet; + private int _value; + + [Given("I have a scenario")] + public void GivenIHaveAScenario() { + + } + + [When("I run steps")] + public void WhenIRunSteps() { + _runSteps = true; + } + + + [When(@"they have values like ""(.*)""")] + public void WhenTheyHaveValuesLike(int value) { + Assert.That(_valueSet, Is.False); + _value = value; + _valueSet = true; + } + + [Then("they run")] + public void ThenTheyRun() { + Assert.That(_runSteps, Is.True); + } + + [Then("values like five are captured")] + public void ThenValuesLikeFiveAreCaptured() { + Assert.That(_valueSet, Is.True); + Assert.That(_value, Is.EqualTo(5)); + } + } +} diff --git a/src/Orchard.Specs/Bindings/Settings.cs b/src/Orchard.Specs/Bindings/Settings.cs index 69d13968882..9c4cabfc0d5 100644 --- a/src/Orchard.Specs/Bindings/Settings.cs +++ b/src/Orchard.Specs/Bindings/Settings.cs @@ -1,39 +1,39 @@ -using System; -using NUnit.Framework; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Aspects; -using Orchard.Core.Contents; -using Orchard.Data; -using Orchard.Roles.Models; -using Orchard.Roles.Services; -using Orchard.Security; -using Orchard.Security.Permissions; -using Orchard.Specs.Hosting.Orchard.Web; -using TechTalk.SpecFlow; -using Orchard.Localization.Services; -using System.Linq; - -namespace Orchard.Specs.Bindings { - [Binding] - public class Settings : BindingBase { - - [When(@"I have ""(.*)"" as the default culture")] - public void DefineDefaultCulture(string cultureName) { - - var webApp = Binding(); - webApp.Host.Execute(() => { - using ( var environment = MvcApplication.CreateStandaloneEnvironment("Default") ) { - var orchardServices = environment.Resolve(); - var cultureManager = environment.Resolve(); - - var currentCultures = cultureManager.ListCultures(); - if (!currentCultures.Contains(cultureName)) { - cultureManager.AddCulture(cultureName); - } - - orchardServices.WorkContext.CurrentSite.SiteCulture = cultureName; - } - }); - } - } -} +using System; +using NUnit.Framework; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Aspects; +using Orchard.Core.Contents; +using Orchard.Data; +using Orchard.Roles.Models; +using Orchard.Roles.Services; +using Orchard.Security; +using Orchard.Security.Permissions; +using Orchard.Specs.Hosting.Orchard.Web; +using TechTalk.SpecFlow; +using Orchard.Localization.Services; +using System.Linq; + +namespace Orchard.Specs.Bindings { + [Binding] + public class Settings : BindingBase { + + [When(@"I have ""(.*)"" as the default culture")] + public void DefineDefaultCulture(string cultureName) { + + var webApp = Binding(); + webApp.Host.Execute(() => { + using ( var environment = MvcApplication.CreateStandaloneEnvironment("Default") ) { + var orchardServices = environment.Resolve(); + var cultureManager = environment.Resolve(); + + var currentCultures = cultureManager.ListCultures(); + if (!currentCultures.Contains(cultureName)) { + cultureManager.AddCulture(cultureName); + } + + orchardServices.WorkContext.CurrentSite.SiteCulture = cultureName; + } + }); + } + } +} diff --git a/src/Orchard.Specs/Bindings/UsersPermissionsAndRoles.cs b/src/Orchard.Specs/Bindings/UsersPermissionsAndRoles.cs index 321b1b901a9..15048f9fbd8 100644 --- a/src/Orchard.Specs/Bindings/UsersPermissionsAndRoles.cs +++ b/src/Orchard.Specs/Bindings/UsersPermissionsAndRoles.cs @@ -1,74 +1,74 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Orchard.Data; -using Orchard.Roles.Models; -using Orchard.Roles.Services; -using Orchard.Security; -using Orchard.Specs.Hosting.Orchard.Web; -using TechTalk.SpecFlow; - -namespace Orchard.Specs.Bindings { - [Binding] - public class UsersPermissionsAndRoles : BindingBase { - - - [When(@"I have a role ""(.*)\"" with permissions ""(.*)\""")] - public void WhenIHaveARoleWithPermissions(string roleName, string permissions) { - var webApp = Binding(); - webApp.Host.Execute(() => { - using (var environment = MvcApplication.CreateStandaloneEnvironment("Default")) { - var roleService = environment.Resolve(); - - roleService.CreateRole(roleName); - - foreach (var permissionName in permissions.Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries)) { - roleService.CreatePermissionForRole(roleName, permissionName); - } - } - }); - } - - - [When(@"I have a user ""(.*)\"" with roles ""(.*)\""")] - public void GivenIHaveCreatedAUser(string username, string roles) { - - var webApp = Binding(); - webApp.Host.Execute(() => { - using (var environment = MvcApplication.CreateStandaloneEnvironment("Default")) { - var memberShipService = environment.Resolve(); - var roleService = environment.Resolve(); - var userRoleRepository = environment.Resolve>(); - var user = memberShipService.CreateUser(new CreateUserParams(username, "qwerty123!", username + "@foo.com", "", "", true)); - - foreach (var roleName in roles.Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries)) { - var role = roleService.GetRoleByName(roleName); - userRoleRepository.Create(new UserRolesPartRecord { UserId = user.Id, Role = role }); - } - } - }); - } - - [Given(@"I have a user ""(.*)"" with permissions ""(.*)""")] - public void GivenIHaveAUserWithPermissions(string username, string permissions) { - var roleName = Guid.NewGuid().ToString("n"); - WhenIHaveARoleWithPermissions(roleName, permissions); - GivenIHaveCreatedAUser(username, roleName); - } - - [When(@"I sign in as ""(.*)""")] - public void WhenISignInAs(string username) { - var webApp = Binding(); - var logonForm = TableData( - new { name = "userNameOrEmail", value = username }, - new { name = "password", value = "qwerty123!" }); - - webApp.WhenIGoTo("/users/account/logoff"); - webApp.WhenIGoTo("/users/account/logon"); - webApp.WhenIFillIn(logonForm); - webApp.WhenIHit("Sign In"); - webApp.WhenIAmRedirected(); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Orchard.Data; +using Orchard.Roles.Models; +using Orchard.Roles.Services; +using Orchard.Security; +using Orchard.Specs.Hosting.Orchard.Web; +using TechTalk.SpecFlow; + +namespace Orchard.Specs.Bindings { + [Binding] + public class UsersPermissionsAndRoles : BindingBase { + + + [When(@"I have a role ""(.*)\"" with permissions ""(.*)\""")] + public void WhenIHaveARoleWithPermissions(string roleName, string permissions) { + var webApp = Binding(); + webApp.Host.Execute(() => { + using (var environment = MvcApplication.CreateStandaloneEnvironment("Default")) { + var roleService = environment.Resolve(); + + roleService.CreateRole(roleName); + + foreach (var permissionName in permissions.Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries)) { + roleService.CreatePermissionForRole(roleName, permissionName); + } + } + }); + } + + + [When(@"I have a user ""(.*)\"" with roles ""(.*)\""")] + public void GivenIHaveCreatedAUser(string username, string roles) { + + var webApp = Binding(); + webApp.Host.Execute(() => { + using (var environment = MvcApplication.CreateStandaloneEnvironment("Default")) { + var memberShipService = environment.Resolve(); + var roleService = environment.Resolve(); + var userRoleRepository = environment.Resolve>(); + var user = memberShipService.CreateUser(new CreateUserParams(username, "qwerty123!", username + "@foo.com", "", "", true)); + + foreach (var roleName in roles.Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries)) { + var role = roleService.GetRoleByName(roleName); + userRoleRepository.Create(new UserRolesPartRecord { UserId = user.Id, Role = role }); + } + } + }); + } + + [Given(@"I have a user ""(.*)"" with permissions ""(.*)""")] + public void GivenIHaveAUserWithPermissions(string username, string permissions) { + var roleName = Guid.NewGuid().ToString("n"); + WhenIHaveARoleWithPermissions(roleName, permissions); + GivenIHaveCreatedAUser(username, roleName); + } + + [When(@"I sign in as ""(.*)""")] + public void WhenISignInAs(string username) { + var webApp = Binding(); + var logonForm = TableData( + new { name = "userNameOrEmail", value = username }, + new { name = "password", value = "qwerty123!" }); + + webApp.WhenIGoTo("/users/account/logoff"); + webApp.WhenIGoTo("/users/account/logon"); + webApp.WhenIFillIn(logonForm); + webApp.WhenIHit("Sign In"); + webApp.WhenIAmRedirected(); + } + } +} diff --git a/src/Orchard.Specs/Bindings/WebAppHosting.cs b/src/Orchard.Specs/Bindings/WebAppHosting.cs index 2bebf0bcde3..e6790ece344 100644 --- a/src/Orchard.Specs/Bindings/WebAppHosting.cs +++ b/src/Orchard.Specs/Bindings/WebAppHosting.cs @@ -1,447 +1,447 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text.RegularExpressions; -using System.Web; -using Castle.Core.Logging; -using HtmlAgilityPack; -using log4net.Appender; -using log4net.Core; -using NUnit.Framework; -using Orchard.Specs.Hosting; -using TechTalk.SpecFlow; -using Path = Bleroy.FluentPath.Path; - -namespace Orchard.Specs.Bindings { - [Binding] - public class WebAppHosting { - private WebHost _webHost; - private RequestDetails _details; - private HtmlDocument _doc; - private MessageSink _messages; - private static readonly Path _orchardTemp = Path.Get(System.IO.Path.GetTempPath()).Combine("Orchard.Specs"); - private ExtensionDeploymentOptions _moduleDeploymentOptions = ExtensionDeploymentOptions.CompiledAssembly; - private DynamicCompilationOption _dynamicCompilationOption = DynamicCompilationOption.Enabled; - - public WebHost Host { - get { return _webHost; } - } - - public RequestDetails Details { - get { return _details; } - set { _details = value; } - } - - [BeforeTestRun] - public static void BeforeTestRun() { - try { _orchardTemp.Delete(true).CreateDirectory(); } - catch { } - } - - [AfterTestRun] - public static void AfterTestRun() { - try { - _orchardTemp.Delete(true); // <- try to clear any stragglers on the way out - } - catch { } - } - - [BeforeScenario] - public void CleanOutTheOldWebHost() { - if (_webHost != null) { - _webHost.Clean(); - _webHost = null; - } - } - - [AfterScenario] - public void AfterScenario() { - if (_webHost != null) { - _webHost.Dispose(); - } - } - - [Given(@"I have a clean site")] - public void GivenIHaveACleanSite(string virtualDirectory = "/") { - GivenIHaveACleanSiteBasedOn("Orchard.Web", virtualDirectory); - } - - [Given(@"I have chosen to deploy modules as source files only")] - public void GivenIHaveChosenToDeployModulesAsSourceFilesOnly() { - _moduleDeploymentOptions = ExtensionDeploymentOptions.SourceCode; - } - - [Given(@"I have chosen to load modules using dymamic compilation only")] - public void GivenIHaveChosenToLoadModulesUsingDynamicComilationOnly() { - _moduleDeploymentOptions = ExtensionDeploymentOptions.SourceCode; - _dynamicCompilationOption = DynamicCompilationOption.Force; - } - - [Given(@"I have chosen to load modules with dynamic compilation disabled")] - public void GivenIHaveChosenToLoadModulesAsSourceFilesOnly() { - _dynamicCompilationOption = DynamicCompilationOption.Disabled; - } - - [Given(@"I have a clean site based on (.*)")] - public void GivenIHaveACleanSiteBasedOn(string siteFolder) { - GivenIHaveACleanSiteBasedOn(siteFolder, "/"); - } - - [Given(@"I have a clean site based on (.*) at ""(.*)""")] - public void GivenIHaveACleanSiteBasedOn(string siteFolder, string virtualDirectory) { - _webHost = new WebHost(_orchardTemp); - Host.Initialize(siteFolder, virtualDirectory ?? "/", _dynamicCompilationOption); - var shuttle = new Shuttle(); - Host.Execute(() => Executor(shuttle)); - _messages = shuttle._sink; - } - - private static void Executor(Shuttle shuttle) { - HostingTraceListener.SetHook(msg => shuttle._sink.Receive(msg)); - } - - private class CastleAppender : IAppender { - public void Close() { } - public string Name { get; set; } - - public void DoAppend(LoggingEvent loggingEvent) { - var traceLoggerFactory = new TraceLoggerFactory(); - var logger = traceLoggerFactory.Create(loggingEvent.LoggerName); - if (loggingEvent.Level <= Level.Debug) - logger.Debug(loggingEvent.RenderedMessage); - else if (loggingEvent.Level <= Level.Info) - logger.Info(loggingEvent.RenderedMessage); - else if (loggingEvent.Level <= Level.Warn) - logger.Warn(loggingEvent.RenderedMessage); - else if (loggingEvent.Level <= Level.Error) - logger.Error(loggingEvent.RenderedMessage); - else - logger.Fatal(loggingEvent.RenderedMessage); - } - } - - [Serializable] - class Shuttle { - public readonly MessageSink _sink = new MessageSink(); - } - - - [Given(@"I have module ""(.*)""")] - public void GivenIHaveModule(string moduleName) { - Host.CopyExtension("Modules", moduleName, _moduleDeploymentOptions); - } - - [Given(@"I have theme ""(.*)""")] - public void GivenIHaveTheme(string themeName) { - Host.CopyExtension("Themes", themeName, ExtensionDeploymentOptions.CompiledAssembly); - } - - [Given(@"I have core ""(.*)""")] - public void GivenIHaveCore(string moduleName) { - Host.CopyExtension("Core", moduleName, ExtensionDeploymentOptions.CompiledAssembly); - } - - [Given(@"I have a clean site with")] - public void GivenIHaveACleanSiteWith(Table table) { - GivenIHaveACleanSiteWith("/", table); - } - - - [Given(@"I have a clean site at ""(.*)"" with")] - public void GivenIHaveACleanSiteWith(string virtualDirectory, Table table) { - GivenIHaveACleanSite(virtualDirectory); - foreach (var row in table.Rows) { - foreach (var name in row["names"].Split(',').Select(x => x.Trim())) { - switch (row["extension"]) { - case "Core": - GivenIHaveCore(name); - break; - case "Module": - GivenIHaveModule(name); - break; - case "Theme": - GivenIHaveTheme(name); - break; - default: - Assert.Fail("Unknown extension type {0}", row["extension"]); - break; - } - } - } - } - - [Given(@"I am on ""(.*)""")] - public void GivenIAmOn(string urlPath) { - WhenIGoTo(urlPath); - } - - [Given(@"I have the file ""(.*)"" in ""(.*)""")] - public void GivenIHaveFile(string sourceFileName, string destination) { - Host.CopyFile(sourceFileName, destination); - } - - [When(@"I go to ""(.*)"" on host (.*)")] - public void WhenIGoToPathOnHost(string urlPath, string host) { - Host.HostName = host; - Details = Host.SendRequest(urlPath); - _doc = new HtmlDocument(); - _doc.Load(new StringReader(Regex.Replace(Details.ResponseText, @">\s+<", "><"))); - } - - [When(@"I go to ""(.*)""")] - public void WhenIGoTo(string urlPath) { - Details = Host.SendRequest(urlPath); - _doc = new HtmlDocument(); - _doc.Load(new StringReader(Regex.Replace(Details.ResponseText, @">\s+<", "><"))); - } - - [When(@"I follow ""([^""]*)""")] - public void WhenIFollow(string linkText) { - var link = _doc.DocumentNode - .SelectNodes("//a") - .SingleOrDefault(elt => elt.InnerHtml == linkText) - ?? _doc.DocumentNode - .SelectSingleNode(string.Format("//a[@title='{0}']", linkText)); - - var urlPath = HttpUtility.HtmlDecode(link.Attributes["href"].Value); - - WhenIGoTo(urlPath); - } - - [When(@"I follow ""([^""]+)"" where href has ""([^""]+)""")] - public void WhenIFollow(string linkText, string hrefFilter) { - var link = _doc.DocumentNode - .SelectNodes("//a[@href]").Where(elt => - (elt.InnerHtml == linkText || - (elt.Attributes["title"] != null && elt.Attributes["title"].Value == linkText)) && - elt.Attributes["href"].Value.IndexOf(hrefFilter, StringComparison.OrdinalIgnoreCase) != -1).SingleOrDefault(); - - if (link == null) { - throw new InvalidOperationException(string.Format("Could not find an anchor with matching text '{0}' and href '{1}'. Document: {2}", linkText, hrefFilter, _doc.DocumentNode.InnerHtml)); - } - var href = link.Attributes["href"].Value; - var urlPath = HttpUtility.HtmlDecode(href); - - WhenIGoTo(urlPath); - } - - [When(@"I follow ""([^""]+)"" where class name has ""([^""]+)""")] - public void WhenIFollowClass(string linkText, string className) { - var link = _doc.DocumentNode - .SelectNodes("//a[@href]").Where(elt => - (elt.InnerText == linkText || - (elt.Attributes["title"] != null && elt.Attributes["title"].Value == linkText)) && - elt.Attributes["class"].Value.IndexOf(className, StringComparison.OrdinalIgnoreCase) != -1).SingleOrDefault(); - - if (link == null) { - throw new InvalidOperationException(string.Format("Could not find an anchor with matching text '{0}' and class '{1}'. Document: {2}", linkText, className, _doc.DocumentNode.InnerHtml)); - } - var href = link.Attributes["href"].Value; - var urlPath = HttpUtility.HtmlDecode(href); - - WhenIGoTo(urlPath); - } - - [When(@"I fill in")] - public void WhenIFillIn(Table table) { - var inputs = _doc.DocumentNode - .SelectNodes("(//input|//textarea|//select)") ?? Enumerable.Empty(); - - foreach (var row in table.Rows) { - var r = row; - var input = inputs.FirstOrDefault(x => x.GetAttributeValue("name", x.GetAttributeValue("id", "")) == r["name"]); - Assert.That(input, Is.Not.Null, "Unable to locate name {0} in page html:\r\n\r\n{1}", r["name"], Details.ResponseText); - var inputType = input.GetAttributeValue("type", ""); - switch(inputType) { - case "radio": - var radios = inputs.Where( - x => - x.GetAttributeValue("type", "") == "radio" && - x.GetAttributeValue("name", x.GetAttributeValue("id", "")) == r["name"]); - foreach(var radio in radios) { - if (radio.GetAttributeValue("value", "") == row["value"]) - radio.Attributes.Add("checked", "checked"); - else if (radio.Attributes.Contains("checked")) - radio.Attributes.Remove("checked"); - } - break; - case "checkbox": - if (string.Equals(row["value"], "true", StringComparison.OrdinalIgnoreCase)) { - input.Attributes.Add("checked", "checked"); - } - else { - input.Attributes.Remove("checked"); - } - - var hiddenForCheckbox = inputs.Where( - x => - x.GetAttributeValue("type", "") == "hidden" && - x.GetAttributeValue("name", x.GetAttributeValue("id", "")) == r["name"] - ).FirstOrDefault(); - if (hiddenForCheckbox != null) - hiddenForCheckbox.Attributes.Add("value", row["value"]); - - break; - default: - if (string.Equals(input.Name, "select", StringComparison.OrdinalIgnoreCase)) { - var options = input.Descendants("option"); - foreach (var option in options) { - if (option.GetAttributeValue("value", "") == row["value"] || (option.NextSibling.NodeType == HtmlNodeType.Text && option.NextSibling.InnerText == row["value"])) - option.Attributes.Add("selected", "selected"); - else if (option.Attributes.Contains("selected")) - option.Attributes.Remove("selected"); - } - - } - else { - input.Attributes.Add("value", row["value"]); - } - break; - } - } - } - - [When(@"I hit ""(.*)""")] - public void WhenIHit(string submitText) { - var submit = _doc.DocumentNode - .SelectSingleNode(string.Format("(//input[@type='submit'][@value='{0}']|//button[@type='submit'][text()='{0}'])", submitText)); - - string urlPath = null; - - if (submit == null) { - // could be a simple link using "unsafeurl" property - - submit = _doc.DocumentNode - .SelectNodes("//a") - .SingleOrDefault(elt => elt.InnerHtml == submitText) - ?? _doc.DocumentNode - .SelectSingleNode(string.Format("//a[@title='{0}']", submitText)); - - urlPath = HttpUtility.HtmlDecode(submit.Attributes["href"].Value); - } - - var form = Form.LocateAround(submit); - - if (urlPath == null) { - urlPath = HttpUtility.HtmlDecode(form.Start.GetAttributeValue("action", Details.UrlPath)); - } - - var inputs = form.Children - .SelectMany(elt => elt.DescendantsAndSelf("input").Concat(elt.Descendants("textarea"))) - .Where(node => !((node.GetAttributeValue("type", "") == "radio" || node.GetAttributeValue("type", "") == "checkbox") && node.GetAttributeValue("checked", "") != "checked")) - .GroupBy(elt => elt.GetAttributeValue("name", elt.GetAttributeValue("id", "")), elt => elt.GetAttributeValue("value", "")) - .Where(g => !string.IsNullOrEmpty(g.Key)) - // add values of elements - form.Children.SelectMany(elt => elt.DescendantsAndSelf("select")).Where(elt => elt.Name.Equals("select", StringComparison.OrdinalIgnoreCase)) - // group them by their name with value that comes from first of: - // (1) value of option with 'selecturlPath.Replace("127.0.0.1", "localhost")ed' attribute, - // (2) value of first option (none have 'selected'), - // (3) empty value (e.g. select with no options) - .GroupBy( - sel => sel.GetAttributeValue("name", sel.GetAttributeValue("id", "")), - sel => (sel.Descendants("option").SingleOrDefault(opt => opt.Attributes["selected"] != null) ?? sel.Descendants("option").FirstOrDefault() ?? new HtmlNode(HtmlNodeType.Element, _doc, 0)).GetOptionValue())) - .ToDictionary(elt => elt.Key, elt => (IEnumerable)elt); - - if (submit.Attributes.Contains("name")) - inputs.Add(submit.GetAttributeValue("name", ""), new[] {submit.GetAttributeValue("value", "yes")}); - - Details = Host.SendRequest(urlPath, inputs, form.Start.GetAttributeValue("method", "GET").ToUpperInvariant()); - _doc = new HtmlDocument(); - _doc.Load(new StringReader(Details.ResponseText)); - } - - [When(@"I am redirected")] - public void WhenIAmRedirected() { - var urlPath = ""; - if (Details.ResponseHeaders.TryGetValue("Location", out urlPath)) { - WhenIGoTo(urlPath); - } - else { - Assert.Fail("Expected to be redirected but no Location header returned"); - } - } - - [Then(@"the status should be (.*) ""(.*)""")] - public void ThenTheStatusShouldBe(int statusCode, string statusDescription) { - Assert.That(Details.StatusCode, Is.EqualTo(statusCode)); - Assert.That(Details.StatusDescription, Is.EqualTo(statusDescription)); - } - - [Then(@"the content type should be ""(.*)""")] - public void ThenTheContentTypeShouldBe(string contentType) { - Assert.That(Details.ResponseHeaders["Content-Type"], Is.StringMatching(contentType)); - } - - [Then(@"I should see ""(.*)""")] - public void ThenIShouldSee(string text) { - Assert.That(Details.ResponseText, Is.StringMatching(text)); - } - - [Then(@"I should not see ""(.*)""")] - public void ThenIShouldNotSee(string text) { - Assert.That(Details.ResponseText, Is.Not.StringContaining(text)); - } - - [Then(@"the title contains ""(.*)""")] - public void ThenTheTitleContainsText(string text) { - ScenarioContext.Current.Pending(); - } - - [Then(@"I should be denied access when I go to ""(.*)""")] - public void ThenIShouldBeDeniedAccessWhenIGoTo(string urlPath) { - WhenIGoTo(urlPath); - WhenIAmRedirected(); - ThenIShouldSee("Access Denied"); - } - } - - public class Form { - public static Form LocateAround(HtmlNode cornerstone) { - foreach (var inspect in cornerstone.AncestorsAndSelf()) { - - var form = inspect.PreviousSiblingsAndSelf().FirstOrDefault( - n => n.NodeType == HtmlNodeType.Element && n.Name == "form"); - if (form == null) - continue; - - var endForm = inspect.NextSiblingsAndSelf().FirstOrDefault( - n => n.NodeType == HtmlNodeType.Text && n.InnerText == ""); - if (endForm == null) - continue; - - return new Form { - Start = form, - End = endForm, - Children = form.NextSibling.NextSiblingsAndSelf().TakeWhile(n => n != endForm).ToArray() - }; - } - - return null; - } - - - public HtmlNode Start { get; set; } - public HtmlNode End { get; set; } - public IEnumerable Children { get; set; } - } - - static class HtmlExtensions { - public static IEnumerable PreviousSiblingsAndSelf(this HtmlNode node) { - var scan = node; - while (scan != null) { - yield return scan; - scan = scan.PreviousSibling; - } - } - public static IEnumerable NextSiblingsAndSelf(this HtmlNode node) { - var scan = node; - while (scan != null) { - yield return scan; - scan = scan.NextSibling; - } - } - } -} +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text.RegularExpressions; +using System.Web; +using Castle.Core.Logging; +using HtmlAgilityPack; +using log4net.Appender; +using log4net.Core; +using NUnit.Framework; +using Orchard.Specs.Hosting; +using TechTalk.SpecFlow; +using Path = Bleroy.FluentPath.Path; + +namespace Orchard.Specs.Bindings { + [Binding] + public class WebAppHosting { + private WebHost _webHost; + private RequestDetails _details; + private HtmlDocument _doc; + private MessageSink _messages; + private static readonly Path _orchardTemp = Path.Get(System.IO.Path.GetTempPath()).Combine("Orchard.Specs"); + private ExtensionDeploymentOptions _moduleDeploymentOptions = ExtensionDeploymentOptions.CompiledAssembly; + private DynamicCompilationOption _dynamicCompilationOption = DynamicCompilationOption.Enabled; + + public WebHost Host { + get { return _webHost; } + } + + public RequestDetails Details { + get { return _details; } + set { _details = value; } + } + + [BeforeTestRun] + public static void BeforeTestRun() { + try { _orchardTemp.Delete(true).CreateDirectory(); } + catch { } + } + + [AfterTestRun] + public static void AfterTestRun() { + try { + _orchardTemp.Delete(true); // <- try to clear any stragglers on the way out + } + catch { } + } + + [BeforeScenario] + public void CleanOutTheOldWebHost() { + if (_webHost != null) { + _webHost.Clean(); + _webHost = null; + } + } + + [AfterScenario] + public void AfterScenario() { + if (_webHost != null) { + _webHost.Dispose(); + } + } + + [Given(@"I have a clean site")] + public void GivenIHaveACleanSite(string virtualDirectory = "/") { + GivenIHaveACleanSiteBasedOn("Orchard.Web", virtualDirectory); + } + + [Given(@"I have chosen to deploy modules as source files only")] + public void GivenIHaveChosenToDeployModulesAsSourceFilesOnly() { + _moduleDeploymentOptions = ExtensionDeploymentOptions.SourceCode; + } + + [Given(@"I have chosen to load modules using dymamic compilation only")] + public void GivenIHaveChosenToLoadModulesUsingDynamicComilationOnly() { + _moduleDeploymentOptions = ExtensionDeploymentOptions.SourceCode; + _dynamicCompilationOption = DynamicCompilationOption.Force; + } + + [Given(@"I have chosen to load modules with dynamic compilation disabled")] + public void GivenIHaveChosenToLoadModulesAsSourceFilesOnly() { + _dynamicCompilationOption = DynamicCompilationOption.Disabled; + } + + [Given(@"I have a clean site based on (.*)")] + public void GivenIHaveACleanSiteBasedOn(string siteFolder) { + GivenIHaveACleanSiteBasedOn(siteFolder, "/"); + } + + [Given(@"I have a clean site based on (.*) at ""(.*)""")] + public void GivenIHaveACleanSiteBasedOn(string siteFolder, string virtualDirectory) { + _webHost = new WebHost(_orchardTemp); + Host.Initialize(siteFolder, virtualDirectory ?? "/", _dynamicCompilationOption); + var shuttle = new Shuttle(); + Host.Execute(() => Executor(shuttle)); + _messages = shuttle._sink; + } + + private static void Executor(Shuttle shuttle) { + HostingTraceListener.SetHook(msg => shuttle._sink.Receive(msg)); + } + + private class CastleAppender : IAppender { + public void Close() { } + public string Name { get; set; } + + public void DoAppend(LoggingEvent loggingEvent) { + var traceLoggerFactory = new TraceLoggerFactory(); + var logger = traceLoggerFactory.Create(loggingEvent.LoggerName); + if (loggingEvent.Level <= Level.Debug) + logger.Debug(loggingEvent.RenderedMessage); + else if (loggingEvent.Level <= Level.Info) + logger.Info(loggingEvent.RenderedMessage); + else if (loggingEvent.Level <= Level.Warn) + logger.Warn(loggingEvent.RenderedMessage); + else if (loggingEvent.Level <= Level.Error) + logger.Error(loggingEvent.RenderedMessage); + else + logger.Fatal(loggingEvent.RenderedMessage); + } + } + + [Serializable] + class Shuttle { + public readonly MessageSink _sink = new MessageSink(); + } + + + [Given(@"I have module ""(.*)""")] + public void GivenIHaveModule(string moduleName) { + Host.CopyExtension("Modules", moduleName, _moduleDeploymentOptions); + } + + [Given(@"I have theme ""(.*)""")] + public void GivenIHaveTheme(string themeName) { + Host.CopyExtension("Themes", themeName, ExtensionDeploymentOptions.CompiledAssembly); + } + + [Given(@"I have core ""(.*)""")] + public void GivenIHaveCore(string moduleName) { + Host.CopyExtension("Core", moduleName, ExtensionDeploymentOptions.CompiledAssembly); + } + + [Given(@"I have a clean site with")] + public void GivenIHaveACleanSiteWith(Table table) { + GivenIHaveACleanSiteWith("/", table); + } + + + [Given(@"I have a clean site at ""(.*)"" with")] + public void GivenIHaveACleanSiteWith(string virtualDirectory, Table table) { + GivenIHaveACleanSite(virtualDirectory); + foreach (var row in table.Rows) { + foreach (var name in row["names"].Split(',').Select(x => x.Trim())) { + switch (row["extension"]) { + case "Core": + GivenIHaveCore(name); + break; + case "Module": + GivenIHaveModule(name); + break; + case "Theme": + GivenIHaveTheme(name); + break; + default: + Assert.Fail("Unknown extension type {0}", row["extension"]); + break; + } + } + } + } + + [Given(@"I am on ""(.*)""")] + public void GivenIAmOn(string urlPath) { + WhenIGoTo(urlPath); + } + + [Given(@"I have the file ""(.*)"" in ""(.*)""")] + public void GivenIHaveFile(string sourceFileName, string destination) { + Host.CopyFile(sourceFileName, destination); + } + + [When(@"I go to ""(.*)"" on host (.*)")] + public void WhenIGoToPathOnHost(string urlPath, string host) { + Host.HostName = host; + Details = Host.SendRequest(urlPath); + _doc = new HtmlDocument(); + _doc.Load(new StringReader(Regex.Replace(Details.ResponseText, @">\s+<", "><"))); + } + + [When(@"I go to ""(.*)""")] + public void WhenIGoTo(string urlPath) { + Details = Host.SendRequest(urlPath); + _doc = new HtmlDocument(); + _doc.Load(new StringReader(Regex.Replace(Details.ResponseText, @">\s+<", "><"))); + } + + [When(@"I follow ""([^""]*)""")] + public void WhenIFollow(string linkText) { + var link = _doc.DocumentNode + .SelectNodes("//a") + .SingleOrDefault(elt => elt.InnerHtml == linkText) + ?? _doc.DocumentNode + .SelectSingleNode(string.Format("//a[@title='{0}']", linkText)); + + var urlPath = HttpUtility.HtmlDecode(link.Attributes["href"].Value); + + WhenIGoTo(urlPath); + } + + [When(@"I follow ""([^""]+)"" where href has ""([^""]+)""")] + public void WhenIFollow(string linkText, string hrefFilter) { + var link = _doc.DocumentNode + .SelectNodes("//a[@href]").Where(elt => + (elt.InnerHtml == linkText || + (elt.Attributes["title"] != null && elt.Attributes["title"].Value == linkText)) && + elt.Attributes["href"].Value.IndexOf(hrefFilter, StringComparison.OrdinalIgnoreCase) != -1).SingleOrDefault(); + + if (link == null) { + throw new InvalidOperationException(string.Format("Could not find an anchor with matching text '{0}' and href '{1}'. Document: {2}", linkText, hrefFilter, _doc.DocumentNode.InnerHtml)); + } + var href = link.Attributes["href"].Value; + var urlPath = HttpUtility.HtmlDecode(href); + + WhenIGoTo(urlPath); + } + + [When(@"I follow ""([^""]+)"" where class name has ""([^""]+)""")] + public void WhenIFollowClass(string linkText, string className) { + var link = _doc.DocumentNode + .SelectNodes("//a[@href]").Where(elt => + (elt.InnerText == linkText || + (elt.Attributes["title"] != null && elt.Attributes["title"].Value == linkText)) && + elt.Attributes["class"].Value.IndexOf(className, StringComparison.OrdinalIgnoreCase) != -1).SingleOrDefault(); + + if (link == null) { + throw new InvalidOperationException(string.Format("Could not find an anchor with matching text '{0}' and class '{1}'. Document: {2}", linkText, className, _doc.DocumentNode.InnerHtml)); + } + var href = link.Attributes["href"].Value; + var urlPath = HttpUtility.HtmlDecode(href); + + WhenIGoTo(urlPath); + } + + [When(@"I fill in")] + public void WhenIFillIn(Table table) { + var inputs = _doc.DocumentNode + .SelectNodes("(//input|//textarea|//select)") ?? Enumerable.Empty(); + + foreach (var row in table.Rows) { + var r = row; + var input = inputs.FirstOrDefault(x => x.GetAttributeValue("name", x.GetAttributeValue("id", "")) == r["name"]); + Assert.That(input, Is.Not.Null, "Unable to locate name {0} in page html:\r\n\r\n{1}", r["name"], Details.ResponseText); + var inputType = input.GetAttributeValue("type", ""); + switch(inputType) { + case "radio": + var radios = inputs.Where( + x => + x.GetAttributeValue("type", "") == "radio" && + x.GetAttributeValue("name", x.GetAttributeValue("id", "")) == r["name"]); + foreach(var radio in radios) { + if (radio.GetAttributeValue("value", "") == row["value"]) + radio.Attributes.Add("checked", "checked"); + else if (radio.Attributes.Contains("checked")) + radio.Attributes.Remove("checked"); + } + break; + case "checkbox": + if (string.Equals(row["value"], "true", StringComparison.OrdinalIgnoreCase)) { + input.Attributes.Add("checked", "checked"); + } + else { + input.Attributes.Remove("checked"); + } + + var hiddenForCheckbox = inputs.Where( + x => + x.GetAttributeValue("type", "") == "hidden" && + x.GetAttributeValue("name", x.GetAttributeValue("id", "")) == r["name"] + ).FirstOrDefault(); + if (hiddenForCheckbox != null) + hiddenForCheckbox.Attributes.Add("value", row["value"]); + + break; + default: + if (string.Equals(input.Name, "select", StringComparison.OrdinalIgnoreCase)) { + var options = input.Descendants("option"); + foreach (var option in options) { + if (option.GetAttributeValue("value", "") == row["value"] || (option.NextSibling.NodeType == HtmlNodeType.Text && option.NextSibling.InnerText == row["value"])) + option.Attributes.Add("selected", "selected"); + else if (option.Attributes.Contains("selected")) + option.Attributes.Remove("selected"); + } + + } + else { + input.Attributes.Add("value", row["value"]); + } + break; + } + } + } + + [When(@"I hit ""(.*)""")] + public void WhenIHit(string submitText) { + var submit = _doc.DocumentNode + .SelectSingleNode(string.Format("(//input[@type='submit'][@value='{0}']|//button[@type='submit'][text()='{0}'])", submitText)); + + string urlPath = null; + + if (submit == null) { + // could be a simple link using "unsafeurl" property + + submit = _doc.DocumentNode + .SelectNodes("//a") + .SingleOrDefault(elt => elt.InnerHtml == submitText) + ?? _doc.DocumentNode + .SelectSingleNode(string.Format("//a[@title='{0}']", submitText)); + + urlPath = HttpUtility.HtmlDecode(submit.Attributes["href"].Value); + } + + var form = Form.LocateAround(submit); + + if (urlPath == null) { + urlPath = HttpUtility.HtmlDecode(form.Start.GetAttributeValue("action", Details.UrlPath)); + } + + var inputs = form.Children + .SelectMany(elt => elt.DescendantsAndSelf("input").Concat(elt.Descendants("textarea"))) + .Where(node => !((node.GetAttributeValue("type", "") == "radio" || node.GetAttributeValue("type", "") == "checkbox") && node.GetAttributeValue("checked", "") != "checked")) + .GroupBy(elt => elt.GetAttributeValue("name", elt.GetAttributeValue("id", "")), elt => elt.GetAttributeValue("value", "")) + .Where(g => !string.IsNullOrEmpty(g.Key)) + // add values of elements + form.Children.SelectMany(elt => elt.DescendantsAndSelf("select")).Where(elt => elt.Name.Equals("select", StringComparison.OrdinalIgnoreCase)) + // group them by their name with value that comes from first of: + // (1) value of option with 'selecturlPath.Replace("127.0.0.1", "localhost")ed' attribute, + // (2) value of first option (none have 'selected'), + // (3) empty value (e.g. select with no options) + .GroupBy( + sel => sel.GetAttributeValue("name", sel.GetAttributeValue("id", "")), + sel => (sel.Descendants("option").SingleOrDefault(opt => opt.Attributes["selected"] != null) ?? sel.Descendants("option").FirstOrDefault() ?? new HtmlNode(HtmlNodeType.Element, _doc, 0)).GetOptionValue())) + .ToDictionary(elt => elt.Key, elt => (IEnumerable)elt); + + if (submit.Attributes.Contains("name")) + inputs.Add(submit.GetAttributeValue("name", ""), new[] {submit.GetAttributeValue("value", "yes")}); + + Details = Host.SendRequest(urlPath, inputs, form.Start.GetAttributeValue("method", "GET").ToUpperInvariant()); + _doc = new HtmlDocument(); + _doc.Load(new StringReader(Details.ResponseText)); + } + + [When(@"I am redirected")] + public void WhenIAmRedirected() { + var urlPath = ""; + if (Details.ResponseHeaders.TryGetValue("Location", out urlPath)) { + WhenIGoTo(urlPath); + } + else { + Assert.Fail("Expected to be redirected but no Location header returned"); + } + } + + [Then(@"the status should be (.*) ""(.*)""")] + public void ThenTheStatusShouldBe(int statusCode, string statusDescription) { + Assert.That(Details.StatusCode, Is.EqualTo(statusCode)); + Assert.That(Details.StatusDescription, Is.EqualTo(statusDescription)); + } + + [Then(@"the content type should be ""(.*)""")] + public void ThenTheContentTypeShouldBe(string contentType) { + Assert.That(Details.ResponseHeaders["Content-Type"], Is.StringMatching(contentType)); + } + + [Then(@"I should see ""(.*)""")] + public void ThenIShouldSee(string text) { + Assert.That(Details.ResponseText, Is.StringMatching(text)); + } + + [Then(@"I should not see ""(.*)""")] + public void ThenIShouldNotSee(string text) { + Assert.That(Details.ResponseText, Is.Not.StringContaining(text)); + } + + [Then(@"the title contains ""(.*)""")] + public void ThenTheTitleContainsText(string text) { + ScenarioContext.Current.Pending(); + } + + [Then(@"I should be denied access when I go to ""(.*)""")] + public void ThenIShouldBeDeniedAccessWhenIGoTo(string urlPath) { + WhenIGoTo(urlPath); + WhenIAmRedirected(); + ThenIShouldSee("Access Denied"); + } + } + + public class Form { + public static Form LocateAround(HtmlNode cornerstone) { + foreach (var inspect in cornerstone.AncestorsAndSelf()) { + + var form = inspect.PreviousSiblingsAndSelf().FirstOrDefault( + n => n.NodeType == HtmlNodeType.Element && n.Name == "form"); + if (form == null) + continue; + + var endForm = inspect.NextSiblingsAndSelf().FirstOrDefault( + n => n.NodeType == HtmlNodeType.Text && n.InnerText == ""); + if (endForm == null) + continue; + + return new Form { + Start = form, + End = endForm, + Children = form.NextSibling.NextSiblingsAndSelf().TakeWhile(n => n != endForm).ToArray() + }; + } + + return null; + } + + + public HtmlNode Start { get; set; } + public HtmlNode End { get; set; } + public IEnumerable Children { get; set; } + } + + static class HtmlExtensions { + public static IEnumerable PreviousSiblingsAndSelf(this HtmlNode node) { + var scan = node; + while (scan != null) { + yield return scan; + scan = scan.PreviousSibling; + } + } + public static IEnumerable NextSiblingsAndSelf(this HtmlNode node) { + var scan = node; + while (scan != null) { + yield return scan; + scan = scan.NextSibling; + } + } + } +} diff --git a/src/Orchard.Specs/Blogs.feature b/src/Orchard.Specs/Blogs.feature index c3e87d12ff6..a6095508715 100644 --- a/src/Orchard.Specs/Blogs.feature +++ b/src/Orchard.Specs/Blogs.feature @@ -1,294 +1,294 @@ -Feature: Blog - In order to add blogs to my site - As an author - I want to create blogs and create, publish and edit blog posts - -Scenario: In the admin (menu) there is a link to create a Blog - Given I have installed Orchard - When I go to "admin" - Then I should see "]*href="/Admin/Blogs/Create"[^>]*>Blog
      " - -Scenario: I can create a new blog and blog post - Given I have installed Orchard - When I go to "admin/blogs/create" - And I fill in - | name | value | - | Title.Title | My Blog | - And I hit "Save" - And I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - And I fill in - | name | value | - | Title.Title | My Post | - | Body.Text | Hi there. | - And I hit "Publish Now" - And I am redirected - Then I should see "Your Blog Post has been created." - When I go to "my-blog" - Then I should see "]*>.*?My Blog.*?" - And I should see "]*>.*?My Post.*?" - When I go to "my-blog/my-post" - Then I should see "]*>.*?My Post.*?" - And I should see "Hi there." - -Scenario: I can create a new blog with multiple blog posts each with the same title and unique slugs are generated or given for said posts - Given I have installed Orchard - When I go to "admin/blogs/create" - And I fill in - | name | value | - | Title.Title | My Blog | - And I hit "Save" - And I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - And I fill in - | name | value | - | Title.Title | My Post | - | Body.Text | Hi there. | - And I hit "Publish Now" - And I go to "my-blog/my-post" - Then I should see "]*>.*?My Post.*?" - And I should see "Hi there." - When I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - And I fill in - | name | value | - | Title.Title | My Post | - | Body.Text | Hi there, again. | - And I hit "Publish Now" - And I go to "my-blog/my-post-2" - Then I should see "]*>.*?My Post.*?" - And I should see "Hi there, again." - When I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - And I fill in - | name | value | - | Title.Title | My Post | - | Autoroute.CurrentUrl | my-blog/my-post | - | Body.Text | Are you still there? | - And I hit "Publish Now" - And I go to "my-blog/my-post-3" - Then I should see "]*>.*?My Post.*?" - And I should see "Are you still there?" - -Scenario: When viewing a blog the user agent is given an RSS feed of the blog's posts - Given I have installed Orchard - When I go to "admin/blogs/create" - And I fill in - | name | value | - | Title.Title | My Blog | - And I hit "Save" - And I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - And I fill in - | name | value | - | Title.Title | My Post | - | Body.Text | Hi there. | - And I hit "Publish Now" - And I am redirected - And I go to "my-blog/my-post" - Then I should see "" - -Scenario: Enabling remote blog publishing inserts the appropriate metaweblogapi markup into the blog's page - Given I have installed Orchard - And I have enabled "XmlRpc" - And I have enabled "Orchard.Blogs.RemotePublishing" - When I go to "admin/blogs/create" - And I fill in - | name | value | - | Title.Title | My Blog | - And I hit "Save" - And I go to "my-blog" - Then I should see "" - When I go to "/XmlRpc/LiveWriter/Manifest" - Then the content type should be "\btext/xml\b" - And I should see "" - And I should see "Metaweblog" - -Scenario: The virtual path of my installation when not at the root is reflected in the URL example for the slug field when creating a blog or blog post - Given I have installed Orchard at "/OrchardLocal" - When I go to "admin/blogs/create" - Then I should see "http\://localhost/OrchardLocal/" - When I fill in - | name | value | - | Title.Title | My Blog | - And I hit "Save" - And I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - Then I should see "http\://localhost/OrchardLocal/" - -Scenario: The virtual path of my installation when at the root is reflected in the URL example for the slug field when creating a blog or blog post - Given I have installed Orchard at "/" - When I go to "admin/blogs/create" - Then I should see "http\://localhost/" - When I fill in - | name | value | - | Title.Title | My Blog | - And I hit "Save" - And I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - Then I should see "http\://localhost/" - -Scenario: I set my blog to be the content for the home page and the posts for the blog be rooted to the app - Given I have installed Orchard - When I go to "admin/blogs/create" - And I fill in - | name | value | - | Title.Title | My Blog | - | Autoroute.PromoteToHomePage | true | - And I hit "Save" - And I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - And I fill in - | name | value | - | Title.Title | My Post | - | Body.Text | Hi there. | - And I hit "Publish Now" - And I am redirected - And I go to "/" - Then I should see "

      My Blog

      " - When I go to "/my-blog" - Then the status should be 404 "Not Found" - When I go to "/my-post" - Then I should see "

      My Post

      " - -Scenario: I can create browse blog posts on several pages - Given I have installed Orchard - When I go to "admin/blogs/create" - And I fill in - | name | value | - | Title.Title | My Blog | - And I hit "Save" - And I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - And I fill in - | name | value | - | Title.Title | My Post 1 | - And I hit "Publish Now" - And I am redirected - And I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - And I fill in - | name | value | - | Title.Title | My Post 2 | - And I hit "Publish Now" - And I am redirected - And I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - And I fill in - | name | value | - | Title.Title | My Post 3 | - And I hit "Publish Now" - And I am redirected - And I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - And I fill in - | name | value | - | Title.Title | My Post 4 | - And I hit "Publish Now" - And I am redirected - And I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - And I fill in - | name | value | - | Title.Title | My Post 5 | - And I hit "Publish Now" - And I am redirected - And I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - And I fill in - | name | value | - | Title.Title | My Post 6 | - And I hit "Publish Now" - And I am redirected - And I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - And I fill in - | name | value | - | Title.Title | My Post 7 | - And I hit "Publish Now" - And I am redirected - And I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - And I fill in - | name | value | - | Title.Title | My Post 8 | - And I hit "Publish Now" - And I am redirected - And I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - And I fill in - | name | value | - | Title.Title | My Post 9 | - And I hit "Publish Now" - And I am redirected - And I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - And I fill in - | name | value | - | Title.Title | My Post 10 | - And I hit "Publish Now" - And I am redirected - And I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - And I fill in - | name | value | - | Title.Title | My Post 11 | - And I hit "Publish Now" - And I am redirected - And I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - And I fill in - | name | value | - | Title.Title | My Post 12 | - And I hit "Publish Now" - And I am redirected - Then I should see "Your Blog Post has been created." - When I go to "my-blog" - Then I should see "]*>.*?My Blog.*?" - And I should see "]*>.*?My Post 12.*?" - And I should see "]*>.*?My Post 11.*?" - And I should not see "]*>.*?My Post 10.*?" - When I go to "my-blog?page=2" - Then I should see "]*>.*?My Blog.*?" - And I should see "]*>.*?My Post 1.*?" - And I should see "]*>.*?My Post 2.*?" - And I should not see "]*>.*?My Post 3.*?" - -Scenario: I can create a new blog with a percent sign in the title and it gets stripped out of the slug - Given I have installed Orchard - When I go to "admin/blogs/create" - And I fill in - | name | value | - | Title.Title | My Blog | - And I hit "Save" - And I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - And I fill in - | name | value | - | Title.Title | My Post with a % Sign | - | Body.Text | Hi there. | - And I hit "Publish Now" - And I go to "my-blog/my-post-with-a-sign" - Then I should see "]*>.*?My Post with a % Sign.*?" +Feature: Blog + In order to add blogs to my site + As an author + I want to create blogs and create, publish and edit blog posts + +Scenario: In the admin (menu) there is a link to create a Blog + Given I have installed Orchard + When I go to "admin" + Then I should see "]*href="/Admin/Blogs/Create"[^>]*>Blog" + +Scenario: I can create a new blog and blog post + Given I have installed Orchard + When I go to "admin/blogs/create" + And I fill in + | name | value | + | Title.Title | My Blog | + And I hit "Save" + And I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + And I fill in + | name | value | + | Title.Title | My Post | + | Body.Text | Hi there. | + And I hit "Publish Now" + And I am redirected + Then I should see "Your Blog Post has been created." + When I go to "my-blog" + Then I should see "]*>.*?My Blog.*?" + And I should see "]*>.*?My Post.*?" + When I go to "my-blog/my-post" + Then I should see "]*>.*?My Post.*?" + And I should see "Hi there." + +Scenario: I can create a new blog with multiple blog posts each with the same title and unique slugs are generated or given for said posts + Given I have installed Orchard + When I go to "admin/blogs/create" + And I fill in + | name | value | + | Title.Title | My Blog | + And I hit "Save" + And I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + And I fill in + | name | value | + | Title.Title | My Post | + | Body.Text | Hi there. | + And I hit "Publish Now" + And I go to "my-blog/my-post" + Then I should see "]*>.*?My Post.*?" + And I should see "Hi there." + When I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + And I fill in + | name | value | + | Title.Title | My Post | + | Body.Text | Hi there, again. | + And I hit "Publish Now" + And I go to "my-blog/my-post-2" + Then I should see "]*>.*?My Post.*?" + And I should see "Hi there, again." + When I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + And I fill in + | name | value | + | Title.Title | My Post | + | Autoroute.CurrentUrl | my-blog/my-post | + | Body.Text | Are you still there? | + And I hit "Publish Now" + And I go to "my-blog/my-post-3" + Then I should see "]*>.*?My Post.*?" + And I should see "Are you still there?" + +Scenario: When viewing a blog the user agent is given an RSS feed of the blog's posts + Given I have installed Orchard + When I go to "admin/blogs/create" + And I fill in + | name | value | + | Title.Title | My Blog | + And I hit "Save" + And I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + And I fill in + | name | value | + | Title.Title | My Post | + | Body.Text | Hi there. | + And I hit "Publish Now" + And I am redirected + And I go to "my-blog/my-post" + Then I should see "" + +Scenario: Enabling remote blog publishing inserts the appropriate metaweblogapi markup into the blog's page + Given I have installed Orchard + And I have enabled "XmlRpc" + And I have enabled "Orchard.Blogs.RemotePublishing" + When I go to "admin/blogs/create" + And I fill in + | name | value | + | Title.Title | My Blog | + And I hit "Save" + And I go to "my-blog" + Then I should see "" + When I go to "/XmlRpc/LiveWriter/Manifest" + Then the content type should be "\btext/xml\b" + And I should see "" + And I should see "Metaweblog" + +Scenario: The virtual path of my installation when not at the root is reflected in the URL example for the slug field when creating a blog or blog post + Given I have installed Orchard at "/OrchardLocal" + When I go to "admin/blogs/create" + Then I should see "http\://localhost/OrchardLocal/" + When I fill in + | name | value | + | Title.Title | My Blog | + And I hit "Save" + And I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + Then I should see "http\://localhost/OrchardLocal/" + +Scenario: The virtual path of my installation when at the root is reflected in the URL example for the slug field when creating a blog or blog post + Given I have installed Orchard at "/" + When I go to "admin/blogs/create" + Then I should see "http\://localhost/" + When I fill in + | name | value | + | Title.Title | My Blog | + And I hit "Save" + And I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + Then I should see "http\://localhost/" + +Scenario: I set my blog to be the content for the home page and the posts for the blog be rooted to the app + Given I have installed Orchard + When I go to "admin/blogs/create" + And I fill in + | name | value | + | Title.Title | My Blog | + | Autoroute.PromoteToHomePage | true | + And I hit "Save" + And I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + And I fill in + | name | value | + | Title.Title | My Post | + | Body.Text | Hi there. | + And I hit "Publish Now" + And I am redirected + And I go to "/" + Then I should see "

      My Blog

      " + When I go to "/my-blog" + Then the status should be 404 "Not Found" + When I go to "/my-post" + Then I should see "

      My Post

      " + +Scenario: I can create browse blog posts on several pages + Given I have installed Orchard + When I go to "admin/blogs/create" + And I fill in + | name | value | + | Title.Title | My Blog | + And I hit "Save" + And I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + And I fill in + | name | value | + | Title.Title | My Post 1 | + And I hit "Publish Now" + And I am redirected + And I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + And I fill in + | name | value | + | Title.Title | My Post 2 | + And I hit "Publish Now" + And I am redirected + And I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + And I fill in + | name | value | + | Title.Title | My Post 3 | + And I hit "Publish Now" + And I am redirected + And I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + And I fill in + | name | value | + | Title.Title | My Post 4 | + And I hit "Publish Now" + And I am redirected + And I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + And I fill in + | name | value | + | Title.Title | My Post 5 | + And I hit "Publish Now" + And I am redirected + And I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + And I fill in + | name | value | + | Title.Title | My Post 6 | + And I hit "Publish Now" + And I am redirected + And I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + And I fill in + | name | value | + | Title.Title | My Post 7 | + And I hit "Publish Now" + And I am redirected + And I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + And I fill in + | name | value | + | Title.Title | My Post 8 | + And I hit "Publish Now" + And I am redirected + And I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + And I fill in + | name | value | + | Title.Title | My Post 9 | + And I hit "Publish Now" + And I am redirected + And I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + And I fill in + | name | value | + | Title.Title | My Post 10 | + And I hit "Publish Now" + And I am redirected + And I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + And I fill in + | name | value | + | Title.Title | My Post 11 | + And I hit "Publish Now" + And I am redirected + And I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + And I fill in + | name | value | + | Title.Title | My Post 12 | + And I hit "Publish Now" + And I am redirected + Then I should see "Your Blog Post has been created." + When I go to "my-blog" + Then I should see "]*>.*?My Blog.*?" + And I should see "]*>.*?My Post 12.*?" + And I should see "]*>.*?My Post 11.*?" + And I should not see "]*>.*?My Post 10.*?" + When I go to "my-blog?page=2" + Then I should see "]*>.*?My Blog.*?" + And I should see "]*>.*?My Post 1.*?" + And I should see "]*>.*?My Post 2.*?" + And I should not see "]*>.*?My Post 3.*?" + +Scenario: I can create a new blog with a percent sign in the title and it gets stripped out of the slug + Given I have installed Orchard + When I go to "admin/blogs/create" + And I fill in + | name | value | + | Title.Title | My Blog | + And I hit "Save" + And I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + And I fill in + | name | value | + | Title.Title | My Post with a % Sign | + | Body.Text | Hi there. | + And I hit "Publish Now" + And I go to "my-blog/my-post-with-a-sign" + Then I should see "]*>.*?My Post with a % Sign.*?" And I should see "Hi there." \ No newline at end of file diff --git a/src/Orchard.Specs/Blogs.feature.cs b/src/Orchard.Specs/Blogs.feature.cs index f420e713309..61b4c3b02c1 100644 --- a/src/Orchard.Specs/Blogs.feature.cs +++ b/src/Orchard.Specs/Blogs.feature.cs @@ -1,828 +1,828 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by SpecFlow (http://www.specflow.org/). -// SpecFlow Version:1.9.0.77 -// SpecFlow Generator Version:1.9.0.0 -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ -#region Designer generated code -#pragma warning disable -namespace Orchard.Specs -{ - using TechTalk.SpecFlow; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [NUnit.Framework.TestFixtureAttribute()] - [NUnit.Framework.DescriptionAttribute("Blog")] - public partial class BlogFeature - { - - private static TechTalk.SpecFlow.ITestRunner testRunner; - -#line 1 "Blogs.feature" -#line hidden - - [NUnit.Framework.TestFixtureSetUpAttribute()] - public virtual void FeatureSetup() - { - testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Blog", " In order to add blogs to my site\r\n As an author\r\n I want to create blogs and " + - "create, publish and edit blog posts", ProgrammingLanguage.CSharp, ((string[])(null))); - testRunner.OnFeatureStart(featureInfo); - } - - [NUnit.Framework.TestFixtureTearDownAttribute()] - public virtual void FeatureTearDown() - { - testRunner.OnFeatureEnd(); - testRunner = null; - } - - [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() - { - } - - [NUnit.Framework.TearDownAttribute()] - public virtual void ScenarioTearDown() - { - testRunner.OnScenarioEnd(); - } - - public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) - { - testRunner.OnScenarioStart(scenarioInfo); - } - - public virtual void ScenarioCleanup() - { - testRunner.CollectScenarioErrors(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("In the admin (menu) there is a link to create a Blog")] - public virtual void InTheAdminMenuThereIsALinkToCreateABlog() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("In the admin (menu) there is a link to create a Blog", ((string[])(null))); -#line 6 -this.ScenarioSetup(scenarioInfo); -#line 7 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 8 - testRunner.When("I go to \"admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 9 - testRunner.Then("I should see \"]*href=\"/Admin/Blogs/Create\"[^>]*>Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I can create a new blog and blog post")] - public virtual void ICanCreateANewBlogAndBlogPost() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create a new blog and blog post", ((string[])(null))); -#line 11 -this.ScenarioSetup(scenarioInfo); -#line 12 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 13 - testRunner.When("I go to \"admin/blogs/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table1.AddRow(new string[] { - "Title.Title", - "My Blog"}); -#line 14 - testRunner.And("I fill in", ((string)(null)), table1, "And "); -#line 17 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 18 - testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 19 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 20 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table2.AddRow(new string[] { - "Title.Title", - "My Post"}); - table2.AddRow(new string[] { - "Body.Text", - "Hi there."}); -#line 21 - testRunner.And("I fill in", ((string)(null)), table2, "And "); -#line 25 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 26 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 27 - testRunner.Then("I should see \"Your Blog Post has been created.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 28 - testRunner.When("I go to \"my-blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 29 - testRunner.Then("I should see \"]*>.*?My Blog.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 30 - testRunner.And("I should see \"]*>.*?My Post.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 31 - testRunner.When("I go to \"my-blog/my-post\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 32 - testRunner.Then("I should see \"]*>.*?My Post.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 33 - testRunner.And("I should see \"Hi there.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I can create a new blog with multiple blog posts each with the same title and uni" + - "que slugs are generated or given for said posts")] - public virtual void ICanCreateANewBlogWithMultipleBlogPostsEachWithTheSameTitleAndUniqueSlugsAreGeneratedOrGivenForSaidPosts() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create a new blog with multiple blog posts each with the same title and uni" + - "que slugs are generated or given for said posts", ((string[])(null))); -#line 35 -this.ScenarioSetup(scenarioInfo); -#line 36 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 37 - testRunner.When("I go to \"admin/blogs/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table3.AddRow(new string[] { - "Title.Title", - "My Blog"}); -#line 38 - testRunner.And("I fill in", ((string)(null)), table3, "And "); -#line 41 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 42 - testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 43 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 44 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table4.AddRow(new string[] { - "Title.Title", - "My Post"}); - table4.AddRow(new string[] { - "Body.Text", - "Hi there."}); -#line 45 - testRunner.And("I fill in", ((string)(null)), table4, "And "); -#line 49 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 50 - testRunner.And("I go to \"my-blog/my-post\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 51 - testRunner.Then("I should see \"]*>.*?My Post.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 52 - testRunner.And("I should see \"Hi there.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 53 - testRunner.When("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 54 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 55 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table5.AddRow(new string[] { - "Title.Title", - "My Post"}); - table5.AddRow(new string[] { - "Body.Text", - "Hi there, again."}); -#line 56 - testRunner.And("I fill in", ((string)(null)), table5, "And "); -#line 60 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 61 - testRunner.And("I go to \"my-blog/my-post-2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 62 - testRunner.Then("I should see \"]*>.*?My Post.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 63 - testRunner.And("I should see \"Hi there, again.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 64 - testRunner.When("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 65 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 66 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table6 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table6.AddRow(new string[] { - "Title.Title", - "My Post"}); - table6.AddRow(new string[] { - "Autoroute.CurrentUrl", - "my-blog/my-post"}); - table6.AddRow(new string[] { - "Body.Text", - "Are you still there?"}); -#line 67 - testRunner.And("I fill in", ((string)(null)), table6, "And "); -#line 72 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 73 - testRunner.And("I go to \"my-blog/my-post-3\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 74 - testRunner.Then("I should see \"]*>.*?My Post.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 75 - testRunner.And("I should see \"Are you still there?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("When viewing a blog the user agent is given an RSS feed of the blog\'s posts")] - public virtual void WhenViewingABlogTheUserAgentIsGivenAnRSSFeedOfTheBlogSPosts() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("When viewing a blog the user agent is given an RSS feed of the blog\'s posts", ((string[])(null))); -#line 77 -this.ScenarioSetup(scenarioInfo); -#line 78 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 79 - testRunner.When("I go to \"admin/blogs/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table7 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table7.AddRow(new string[] { - "Title.Title", - "My Blog"}); -#line 80 - testRunner.And("I fill in", ((string)(null)), table7, "And "); -#line 83 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 84 - testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 85 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 86 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table8 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table8.AddRow(new string[] { - "Title.Title", - "My Post"}); - table8.AddRow(new string[] { - "Body.Text", - "Hi there."}); -#line 87 - testRunner.And("I fill in", ((string)(null)), table8, "And "); -#line 91 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 92 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 93 - testRunner.And("I go to \"my-blog/my-post\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 94 - testRunner.Then("I should see \"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Enabling remote blog publishing inserts the appropriate metaweblogapi markup into" + - " the blog\'s page")] - public virtual void EnablingRemoteBlogPublishingInsertsTheAppropriateMetaweblogapiMarkupIntoTheBlogSPage() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Enabling remote blog publishing inserts the appropriate metaweblogapi markup into" + - " the blog\'s page", ((string[])(null))); -#line 96 -this.ScenarioSetup(scenarioInfo); -#line 97 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 98 - testRunner.And("I have enabled \"XmlRpc\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 99 - testRunner.And("I have enabled \"Orchard.Blogs.RemotePublishing\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 100 - testRunner.When("I go to \"admin/blogs/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table9 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table9.AddRow(new string[] { - "Title.Title", - "My Blog"}); -#line 101 - testRunner.And("I fill in", ((string)(null)), table9, "And "); -#line 104 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 105 - testRunner.And("I go to \"my-blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 106 - testRunner.Then("I should see \"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 107 - testRunner.When("I go to \"/XmlRpc/LiveWriter/Manifest\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 108 - testRunner.Then("the content type should be \"\\btext/xml\\b\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 109 - testRunner.And("I should see \"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 110 - testRunner.And("I should see \"Metaweblog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("The virtual path of my installation when not at the root is reflected in the URL " + - "example for the slug field when creating a blog or blog post")] - public virtual void TheVirtualPathOfMyInstallationWhenNotAtTheRootIsReflectedInTheURLExampleForTheSlugFieldWhenCreatingABlogOrBlogPost() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("The virtual path of my installation when not at the root is reflected in the URL " + - "example for the slug field when creating a blog or blog post", ((string[])(null))); -#line 112 -this.ScenarioSetup(scenarioInfo); -#line 113 - testRunner.Given("I have installed Orchard at \"/OrchardLocal\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 114 - testRunner.When("I go to \"admin/blogs/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 115 - testRunner.Then("I should see \"http\\://localhost/OrchardLocal/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - TechTalk.SpecFlow.Table table10 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table10.AddRow(new string[] { - "Title.Title", - "My Blog"}); -#line 116 - testRunner.When("I fill in", ((string)(null)), table10, "When "); -#line 119 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 120 - testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 121 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 122 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 123 - testRunner.Then("I should see \"http\\://localhost/OrchardLocal/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("The virtual path of my installation when at the root is reflected in the URL exam" + - "ple for the slug field when creating a blog or blog post")] - public virtual void TheVirtualPathOfMyInstallationWhenAtTheRootIsReflectedInTheURLExampleForTheSlugFieldWhenCreatingABlogOrBlogPost() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("The virtual path of my installation when at the root is reflected in the URL exam" + - "ple for the slug field when creating a blog or blog post", ((string[])(null))); -#line 125 -this.ScenarioSetup(scenarioInfo); -#line 126 - testRunner.Given("I have installed Orchard at \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 127 - testRunner.When("I go to \"admin/blogs/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 128 - testRunner.Then("I should see \"http\\://localhost/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - TechTalk.SpecFlow.Table table11 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table11.AddRow(new string[] { - "Title.Title", - "My Blog"}); -#line 129 - testRunner.When("I fill in", ((string)(null)), table11, "When "); -#line 132 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 133 - testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 134 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 135 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 136 - testRunner.Then("I should see \"http\\://localhost/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I set my blog to be the content for the home page and the posts for the blog be r" + - "ooted to the app")] - public virtual void ISetMyBlogToBeTheContentForTheHomePageAndThePostsForTheBlogBeRootedToTheApp() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I set my blog to be the content for the home page and the posts for the blog be r" + - "ooted to the app", ((string[])(null))); -#line 138 -this.ScenarioSetup(scenarioInfo); -#line 139 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 140 - testRunner.When("I go to \"admin/blogs/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table12 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table12.AddRow(new string[] { - "Title.Title", - "My Blog"}); - table12.AddRow(new string[] { - "Autoroute.PromoteToHomePage", - "true"}); -#line 141 - testRunner.And("I fill in", ((string)(null)), table12, "And "); -#line 145 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 146 - testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 147 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 148 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table13 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table13.AddRow(new string[] { - "Title.Title", - "My Post"}); - table13.AddRow(new string[] { - "Body.Text", - "Hi there."}); -#line 149 - testRunner.And("I fill in", ((string)(null)), table13, "And "); -#line 153 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 154 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 155 - testRunner.And("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 156 - testRunner.Then("I should see \"

      My Blog

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 157 - testRunner.When("I go to \"/my-blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 158 - testRunner.Then("the status should be 404 \"Not Found\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 159 - testRunner.When("I go to \"/my-post\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 160 - testRunner.Then("I should see \"

      My Post

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I can create browse blog posts on several pages")] - public virtual void ICanCreateBrowseBlogPostsOnSeveralPages() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create browse blog posts on several pages", ((string[])(null))); -#line 162 -this.ScenarioSetup(scenarioInfo); -#line 163 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 164 - testRunner.When("I go to \"admin/blogs/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table14 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table14.AddRow(new string[] { - "Title.Title", - "My Blog"}); -#line 165 - testRunner.And("I fill in", ((string)(null)), table14, "And "); -#line 168 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 169 - testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 170 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 171 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table15 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table15.AddRow(new string[] { - "Title.Title", - "My Post 1"}); -#line 172 - testRunner.And("I fill in", ((string)(null)), table15, "And "); -#line 175 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 176 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 177 - testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 178 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 179 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table16 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table16.AddRow(new string[] { - "Title.Title", - "My Post 2"}); -#line 180 - testRunner.And("I fill in", ((string)(null)), table16, "And "); -#line 183 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 184 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 185 - testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 186 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 187 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table17 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table17.AddRow(new string[] { - "Title.Title", - "My Post 3"}); -#line 188 - testRunner.And("I fill in", ((string)(null)), table17, "And "); -#line 191 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 192 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 193 - testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 194 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 195 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table18 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table18.AddRow(new string[] { - "Title.Title", - "My Post 4"}); -#line 196 - testRunner.And("I fill in", ((string)(null)), table18, "And "); -#line 199 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 200 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 201 - testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 202 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 203 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table19 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table19.AddRow(new string[] { - "Title.Title", - "My Post 5"}); -#line 204 - testRunner.And("I fill in", ((string)(null)), table19, "And "); -#line 207 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 208 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 209 - testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 210 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 211 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table20 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table20.AddRow(new string[] { - "Title.Title", - "My Post 6"}); -#line 212 - testRunner.And("I fill in", ((string)(null)), table20, "And "); -#line 215 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 216 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 217 - testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 218 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 219 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table21 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table21.AddRow(new string[] { - "Title.Title", - "My Post 7"}); -#line 220 - testRunner.And("I fill in", ((string)(null)), table21, "And "); -#line 223 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 224 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 225 - testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 226 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 227 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table22 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table22.AddRow(new string[] { - "Title.Title", - "My Post 8"}); -#line 228 - testRunner.And("I fill in", ((string)(null)), table22, "And "); -#line 231 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 232 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 233 - testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 234 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 235 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table23 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table23.AddRow(new string[] { - "Title.Title", - "My Post 9"}); -#line 236 - testRunner.And("I fill in", ((string)(null)), table23, "And "); -#line 239 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 240 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 241 - testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 242 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 243 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table24 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table24.AddRow(new string[] { - "Title.Title", - "My Post 10"}); -#line 244 - testRunner.And("I fill in", ((string)(null)), table24, "And "); -#line 247 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 248 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 249 - testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 250 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 251 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table25 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table25.AddRow(new string[] { - "Title.Title", - "My Post 11"}); -#line 252 - testRunner.And("I fill in", ((string)(null)), table25, "And "); -#line 255 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 256 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 257 - testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 258 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 259 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table26 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table26.AddRow(new string[] { - "Title.Title", - "My Post 12"}); -#line 260 - testRunner.And("I fill in", ((string)(null)), table26, "And "); -#line 263 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 264 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 265 - testRunner.Then("I should see \"Your Blog Post has been created.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 266 - testRunner.When("I go to \"my-blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 267 - testRunner.Then("I should see \"]*>.*?My Blog.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 268 - testRunner.And("I should see \"]*>.*?My Post 12.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 269 - testRunner.And("I should see \"]*>.*?My Post 11.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 270 - testRunner.And("I should not see \"]*>.*?My Post 10.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 271 - testRunner.When("I go to \"my-blog?page=2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 272 - testRunner.Then("I should see \"]*>.*?My Blog.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 273 - testRunner.And("I should see \"]*>.*?My Post 1.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 274 - testRunner.And("I should see \"]*>.*?My Post 2.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 275 - testRunner.And("I should not see \"]*>.*?My Post 3.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I can create a new blog with a percent sign in the title and it gets stripped out" + - " of the slug")] - public virtual void ICanCreateANewBlogWithAPercentSignInTheTitleAndItGetsStrippedOutOfTheSlug() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create a new blog with a percent sign in the title and it gets stripped out" + - " of the slug", ((string[])(null))); -#line 277 -this.ScenarioSetup(scenarioInfo); -#line 278 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 279 - testRunner.When("I go to \"admin/blogs/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table27 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table27.AddRow(new string[] { - "Title.Title", - "My Blog"}); -#line 280 - testRunner.And("I fill in", ((string)(null)), table27, "And "); -#line 283 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 284 - testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 285 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 286 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table28 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table28.AddRow(new string[] { - "Title.Title", - "My Post with a % Sign"}); - table28.AddRow(new string[] { - "Body.Text", - "Hi there."}); -#line 287 - testRunner.And("I fill in", ((string)(null)), table28, "And "); -#line 291 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 292 - testRunner.And("I go to \"my-blog/my-post-with-a-sign\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 293 - testRunner.Then("I should see \"]*>.*?My Post with a % Sign.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 294 - testRunner.And("I should see \"Hi there.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - } -} -#pragma warning restore -#endregion +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.9.0.77 +// SpecFlow Generator Version:1.9.0.0 +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +#pragma warning disable +namespace Orchard.Specs +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("Blog")] + public partial class BlogFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "Blogs.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Blog", " In order to add blogs to my site\r\n As an author\r\n I want to create blogs and " + + "create, publish and edit blog posts", ProgrammingLanguage.CSharp, ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + [NUnit.Framework.SetUpAttribute()] + public virtual void TestInitialize() + { + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + public virtual void ScenarioCleanup() + { + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("In the admin (menu) there is a link to create a Blog")] + public virtual void InTheAdminMenuThereIsALinkToCreateABlog() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("In the admin (menu) there is a link to create a Blog", ((string[])(null))); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 8 + testRunner.When("I go to \"admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 9 + testRunner.Then("I should see \"]*href=\"/Admin/Blogs/Create\"[^>]*>Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I can create a new blog and blog post")] + public virtual void ICanCreateANewBlogAndBlogPost() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create a new blog and blog post", ((string[])(null))); +#line 11 +this.ScenarioSetup(scenarioInfo); +#line 12 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 13 + testRunner.When("I go to \"admin/blogs/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table1.AddRow(new string[] { + "Title.Title", + "My Blog"}); +#line 14 + testRunner.And("I fill in", ((string)(null)), table1, "And "); +#line 17 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 18 + testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 19 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 20 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table2.AddRow(new string[] { + "Title.Title", + "My Post"}); + table2.AddRow(new string[] { + "Body.Text", + "Hi there."}); +#line 21 + testRunner.And("I fill in", ((string)(null)), table2, "And "); +#line 25 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 26 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 27 + testRunner.Then("I should see \"Your Blog Post has been created.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 28 + testRunner.When("I go to \"my-blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 29 + testRunner.Then("I should see \"]*>.*?My Blog.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 30 + testRunner.And("I should see \"]*>.*?My Post.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 31 + testRunner.When("I go to \"my-blog/my-post\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 32 + testRunner.Then("I should see \"]*>.*?My Post.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 33 + testRunner.And("I should see \"Hi there.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I can create a new blog with multiple blog posts each with the same title and uni" + + "que slugs are generated or given for said posts")] + public virtual void ICanCreateANewBlogWithMultipleBlogPostsEachWithTheSameTitleAndUniqueSlugsAreGeneratedOrGivenForSaidPosts() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create a new blog with multiple blog posts each with the same title and uni" + + "que slugs are generated or given for said posts", ((string[])(null))); +#line 35 +this.ScenarioSetup(scenarioInfo); +#line 36 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 37 + testRunner.When("I go to \"admin/blogs/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table3.AddRow(new string[] { + "Title.Title", + "My Blog"}); +#line 38 + testRunner.And("I fill in", ((string)(null)), table3, "And "); +#line 41 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 42 + testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 43 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 44 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table4.AddRow(new string[] { + "Title.Title", + "My Post"}); + table4.AddRow(new string[] { + "Body.Text", + "Hi there."}); +#line 45 + testRunner.And("I fill in", ((string)(null)), table4, "And "); +#line 49 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 50 + testRunner.And("I go to \"my-blog/my-post\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 51 + testRunner.Then("I should see \"]*>.*?My Post.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 52 + testRunner.And("I should see \"Hi there.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 53 + testRunner.When("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 54 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 55 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table5.AddRow(new string[] { + "Title.Title", + "My Post"}); + table5.AddRow(new string[] { + "Body.Text", + "Hi there, again."}); +#line 56 + testRunner.And("I fill in", ((string)(null)), table5, "And "); +#line 60 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 61 + testRunner.And("I go to \"my-blog/my-post-2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 62 + testRunner.Then("I should see \"]*>.*?My Post.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 63 + testRunner.And("I should see \"Hi there, again.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 64 + testRunner.When("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 65 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 66 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table6 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table6.AddRow(new string[] { + "Title.Title", + "My Post"}); + table6.AddRow(new string[] { + "Autoroute.CurrentUrl", + "my-blog/my-post"}); + table6.AddRow(new string[] { + "Body.Text", + "Are you still there?"}); +#line 67 + testRunner.And("I fill in", ((string)(null)), table6, "And "); +#line 72 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 73 + testRunner.And("I go to \"my-blog/my-post-3\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 74 + testRunner.Then("I should see \"]*>.*?My Post.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 75 + testRunner.And("I should see \"Are you still there?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("When viewing a blog the user agent is given an RSS feed of the blog\'s posts")] + public virtual void WhenViewingABlogTheUserAgentIsGivenAnRSSFeedOfTheBlogSPosts() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("When viewing a blog the user agent is given an RSS feed of the blog\'s posts", ((string[])(null))); +#line 77 +this.ScenarioSetup(scenarioInfo); +#line 78 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 79 + testRunner.When("I go to \"admin/blogs/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table7 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table7.AddRow(new string[] { + "Title.Title", + "My Blog"}); +#line 80 + testRunner.And("I fill in", ((string)(null)), table7, "And "); +#line 83 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 84 + testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 85 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 86 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table8 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table8.AddRow(new string[] { + "Title.Title", + "My Post"}); + table8.AddRow(new string[] { + "Body.Text", + "Hi there."}); +#line 87 + testRunner.And("I fill in", ((string)(null)), table8, "And "); +#line 91 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 92 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 93 + testRunner.And("I go to \"my-blog/my-post\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 94 + testRunner.Then("I should see \"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Enabling remote blog publishing inserts the appropriate metaweblogapi markup into" + + " the blog\'s page")] + public virtual void EnablingRemoteBlogPublishingInsertsTheAppropriateMetaweblogapiMarkupIntoTheBlogSPage() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Enabling remote blog publishing inserts the appropriate metaweblogapi markup into" + + " the blog\'s page", ((string[])(null))); +#line 96 +this.ScenarioSetup(scenarioInfo); +#line 97 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 98 + testRunner.And("I have enabled \"XmlRpc\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 99 + testRunner.And("I have enabled \"Orchard.Blogs.RemotePublishing\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 100 + testRunner.When("I go to \"admin/blogs/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table9 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table9.AddRow(new string[] { + "Title.Title", + "My Blog"}); +#line 101 + testRunner.And("I fill in", ((string)(null)), table9, "And "); +#line 104 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 105 + testRunner.And("I go to \"my-blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 106 + testRunner.Then("I should see \"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 107 + testRunner.When("I go to \"/XmlRpc/LiveWriter/Manifest\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 108 + testRunner.Then("the content type should be \"\\btext/xml\\b\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 109 + testRunner.And("I should see \"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 110 + testRunner.And("I should see \"Metaweblog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("The virtual path of my installation when not at the root is reflected in the URL " + + "example for the slug field when creating a blog or blog post")] + public virtual void TheVirtualPathOfMyInstallationWhenNotAtTheRootIsReflectedInTheURLExampleForTheSlugFieldWhenCreatingABlogOrBlogPost() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("The virtual path of my installation when not at the root is reflected in the URL " + + "example for the slug field when creating a blog or blog post", ((string[])(null))); +#line 112 +this.ScenarioSetup(scenarioInfo); +#line 113 + testRunner.Given("I have installed Orchard at \"/OrchardLocal\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 114 + testRunner.When("I go to \"admin/blogs/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 115 + testRunner.Then("I should see \"http\\://localhost/OrchardLocal/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + TechTalk.SpecFlow.Table table10 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table10.AddRow(new string[] { + "Title.Title", + "My Blog"}); +#line 116 + testRunner.When("I fill in", ((string)(null)), table10, "When "); +#line 119 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 120 + testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 121 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 122 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 123 + testRunner.Then("I should see \"http\\://localhost/OrchardLocal/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("The virtual path of my installation when at the root is reflected in the URL exam" + + "ple for the slug field when creating a blog or blog post")] + public virtual void TheVirtualPathOfMyInstallationWhenAtTheRootIsReflectedInTheURLExampleForTheSlugFieldWhenCreatingABlogOrBlogPost() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("The virtual path of my installation when at the root is reflected in the URL exam" + + "ple for the slug field when creating a blog or blog post", ((string[])(null))); +#line 125 +this.ScenarioSetup(scenarioInfo); +#line 126 + testRunner.Given("I have installed Orchard at \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 127 + testRunner.When("I go to \"admin/blogs/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 128 + testRunner.Then("I should see \"http\\://localhost/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + TechTalk.SpecFlow.Table table11 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table11.AddRow(new string[] { + "Title.Title", + "My Blog"}); +#line 129 + testRunner.When("I fill in", ((string)(null)), table11, "When "); +#line 132 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 133 + testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 134 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 135 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 136 + testRunner.Then("I should see \"http\\://localhost/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I set my blog to be the content for the home page and the posts for the blog be r" + + "ooted to the app")] + public virtual void ISetMyBlogToBeTheContentForTheHomePageAndThePostsForTheBlogBeRootedToTheApp() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I set my blog to be the content for the home page and the posts for the blog be r" + + "ooted to the app", ((string[])(null))); +#line 138 +this.ScenarioSetup(scenarioInfo); +#line 139 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 140 + testRunner.When("I go to \"admin/blogs/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table12 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table12.AddRow(new string[] { + "Title.Title", + "My Blog"}); + table12.AddRow(new string[] { + "Autoroute.PromoteToHomePage", + "true"}); +#line 141 + testRunner.And("I fill in", ((string)(null)), table12, "And "); +#line 145 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 146 + testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 147 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 148 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table13 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table13.AddRow(new string[] { + "Title.Title", + "My Post"}); + table13.AddRow(new string[] { + "Body.Text", + "Hi there."}); +#line 149 + testRunner.And("I fill in", ((string)(null)), table13, "And "); +#line 153 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 154 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 155 + testRunner.And("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 156 + testRunner.Then("I should see \"

      My Blog

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 157 + testRunner.When("I go to \"/my-blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 158 + testRunner.Then("the status should be 404 \"Not Found\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 159 + testRunner.When("I go to \"/my-post\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 160 + testRunner.Then("I should see \"

      My Post

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I can create browse blog posts on several pages")] + public virtual void ICanCreateBrowseBlogPostsOnSeveralPages() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create browse blog posts on several pages", ((string[])(null))); +#line 162 +this.ScenarioSetup(scenarioInfo); +#line 163 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 164 + testRunner.When("I go to \"admin/blogs/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table14 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table14.AddRow(new string[] { + "Title.Title", + "My Blog"}); +#line 165 + testRunner.And("I fill in", ((string)(null)), table14, "And "); +#line 168 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 169 + testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 170 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 171 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table15 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table15.AddRow(new string[] { + "Title.Title", + "My Post 1"}); +#line 172 + testRunner.And("I fill in", ((string)(null)), table15, "And "); +#line 175 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 176 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 177 + testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 178 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 179 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table16 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table16.AddRow(new string[] { + "Title.Title", + "My Post 2"}); +#line 180 + testRunner.And("I fill in", ((string)(null)), table16, "And "); +#line 183 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 184 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 185 + testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 186 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 187 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table17 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table17.AddRow(new string[] { + "Title.Title", + "My Post 3"}); +#line 188 + testRunner.And("I fill in", ((string)(null)), table17, "And "); +#line 191 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 192 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 193 + testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 194 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 195 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table18 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table18.AddRow(new string[] { + "Title.Title", + "My Post 4"}); +#line 196 + testRunner.And("I fill in", ((string)(null)), table18, "And "); +#line 199 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 200 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 201 + testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 202 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 203 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table19 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table19.AddRow(new string[] { + "Title.Title", + "My Post 5"}); +#line 204 + testRunner.And("I fill in", ((string)(null)), table19, "And "); +#line 207 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 208 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 209 + testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 210 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 211 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table20 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table20.AddRow(new string[] { + "Title.Title", + "My Post 6"}); +#line 212 + testRunner.And("I fill in", ((string)(null)), table20, "And "); +#line 215 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 216 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 217 + testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 218 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 219 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table21 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table21.AddRow(new string[] { + "Title.Title", + "My Post 7"}); +#line 220 + testRunner.And("I fill in", ((string)(null)), table21, "And "); +#line 223 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 224 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 225 + testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 226 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 227 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table22 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table22.AddRow(new string[] { + "Title.Title", + "My Post 8"}); +#line 228 + testRunner.And("I fill in", ((string)(null)), table22, "And "); +#line 231 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 232 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 233 + testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 234 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 235 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table23 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table23.AddRow(new string[] { + "Title.Title", + "My Post 9"}); +#line 236 + testRunner.And("I fill in", ((string)(null)), table23, "And "); +#line 239 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 240 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 241 + testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 242 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 243 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table24 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table24.AddRow(new string[] { + "Title.Title", + "My Post 10"}); +#line 244 + testRunner.And("I fill in", ((string)(null)), table24, "And "); +#line 247 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 248 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 249 + testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 250 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 251 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table25 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table25.AddRow(new string[] { + "Title.Title", + "My Post 11"}); +#line 252 + testRunner.And("I fill in", ((string)(null)), table25, "And "); +#line 255 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 256 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 257 + testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 258 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 259 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table26 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table26.AddRow(new string[] { + "Title.Title", + "My Post 12"}); +#line 260 + testRunner.And("I fill in", ((string)(null)), table26, "And "); +#line 263 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 264 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 265 + testRunner.Then("I should see \"Your Blog Post has been created.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 266 + testRunner.When("I go to \"my-blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 267 + testRunner.Then("I should see \"]*>.*?My Blog.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 268 + testRunner.And("I should see \"]*>.*?My Post 12.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 269 + testRunner.And("I should see \"]*>.*?My Post 11.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 270 + testRunner.And("I should not see \"]*>.*?My Post 10.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 271 + testRunner.When("I go to \"my-blog?page=2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 272 + testRunner.Then("I should see \"]*>.*?My Blog.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 273 + testRunner.And("I should see \"]*>.*?My Post 1.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 274 + testRunner.And("I should see \"]*>.*?My Post 2.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 275 + testRunner.And("I should not see \"]*>.*?My Post 3.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I can create a new blog with a percent sign in the title and it gets stripped out" + + " of the slug")] + public virtual void ICanCreateANewBlogWithAPercentSignInTheTitleAndItGetsStrippedOutOfTheSlug() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create a new blog with a percent sign in the title and it gets stripped out" + + " of the slug", ((string[])(null))); +#line 277 +this.ScenarioSetup(scenarioInfo); +#line 278 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 279 + testRunner.When("I go to \"admin/blogs/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table27 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table27.AddRow(new string[] { + "Title.Title", + "My Blog"}); +#line 280 + testRunner.And("I fill in", ((string)(null)), table27, "And "); +#line 283 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 284 + testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 285 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 286 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table28 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table28.AddRow(new string[] { + "Title.Title", + "My Post with a % Sign"}); + table28.AddRow(new string[] { + "Body.Text", + "Hi there."}); +#line 287 + testRunner.And("I fill in", ((string)(null)), table28, "And "); +#line 291 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 292 + testRunner.And("I go to \"my-blog/my-post-with-a-sign\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 293 + testRunner.Then("I should see \"]*>.*?My Post with a % Sign.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 294 + testRunner.And("I should see \"Hi there.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + } +} +#pragma warning restore +#endregion diff --git a/src/Orchard.Specs/Comments.feature b/src/Orchard.Specs/Comments.feature index 22ca0eb1bb2..67a0b1b0dd0 100644 --- a/src/Orchard.Specs/Comments.feature +++ b/src/Orchard.Specs/Comments.feature @@ -1,73 +1,73 @@ -Feature: Comments - In order to enable simple comment capabilities on my site - As an author - I want to allow comments to be safely posted on specific content item pages - -Scenario: HTML markup in any given comment is encoded - Given I have installed Orchard - When I go to "admin/blogs/create" - And I fill in - | name | value | - | Title.Title | My Blog | - And I hit "Save" - And I go to "admin/blogs" - And I follow "My Blog" - And I follow "New Post" where class name has "primaryAction" - And I fill in - | name | value | - | Title.Title | My Post | - | Body.Text | Hi there. | - And I hit "Publish Now" - And I go to "my-blog/my-post" - And I fill in - | name | value | - | Comments.CommentText | This is
      a link. | - And I hit "Submit Comment" - And I am redirected - # because the ToUrlString extension method breaks in this specific (test) environment, the returnUrl is broken... - And I go to "my-blog/my-post" - Then I should see "This is<br id="bad-br" />a <a href" - And I should not see "
      " - # another workaround because of ToUrlString in this environment - When I go to "Users/Account/LogOff" - And I am redirected - And I go to "my-blog/my-post" - And I fill in - | name | value | - | Comments.Author | Some One | - | Comments.CommentText | This is
      a link. | - And I hit "Submit Comment" - And I am redirected - # because the ToUrlString extension method breaks in this specific (test) environment, the returnUrl is broken... - And I go to "my-blog/my-post" - # And I go to "my-blog/my-post" - Then I should see "This is<br id="bad-anon-br" />a <a href" - And I should not see "
      " - - # Moderated comments are not displayed - When I go to "users/account/logon" - And I fill in - | name | value | - | userNameOrEmail | admin | - | password | 6655321 | - And I hit "Sign In" - And I am redirected - And I go to "admin/settings/comments" - And I fill in - | name | value | - | CommentSettings.ModerateComments | true | - And I hit "Save" - And I am redirected - Then I should see "Settings updated" - When I go to "users/account/logoff" - And I go to "my-blog/my-post" - And I fill in - | name | value | - | Comments.Author | Bill | - | Comments.CommentText | This is a moderated comment. | - And I hit "Submit Comment" - And I am redirected - # because the ToUrlString extension method breaks in this specific (test) environment, the returnUrl is broken... - And I go to "my-blog/my-post" - Then I should see "Hi there" - And I should not see "This is a moderated comment" +Feature: Comments + In order to enable simple comment capabilities on my site + As an author + I want to allow comments to be safely posted on specific content item pages + +Scenario: HTML markup in any given comment is encoded + Given I have installed Orchard + When I go to "admin/blogs/create" + And I fill in + | name | value | + | Title.Title | My Blog | + And I hit "Save" + And I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" where class name has "primaryAction" + And I fill in + | name | value | + | Title.Title | My Post | + | Body.Text | Hi there. | + And I hit "Publish Now" + And I go to "my-blog/my-post" + And I fill in + | name | value | + | Comments.CommentText | This is
      a link. | + And I hit "Submit Comment" + And I am redirected + # because the ToUrlString extension method breaks in this specific (test) environment, the returnUrl is broken... + And I go to "my-blog/my-post" + Then I should see "This is<br id="bad-br" />a <a href" + And I should not see "
      " + # another workaround because of ToUrlString in this environment + When I go to "Users/Account/LogOff" + And I am redirected + And I go to "my-blog/my-post" + And I fill in + | name | value | + | Comments.Author | Some One | + | Comments.CommentText | This is
      a link. | + And I hit "Submit Comment" + And I am redirected + # because the ToUrlString extension method breaks in this specific (test) environment, the returnUrl is broken... + And I go to "my-blog/my-post" + # And I go to "my-blog/my-post" + Then I should see "This is<br id="bad-anon-br" />a <a href" + And I should not see "
      " + + # Moderated comments are not displayed + When I go to "users/account/logon" + And I fill in + | name | value | + | userNameOrEmail | admin | + | password | 6655321 | + And I hit "Sign In" + And I am redirected + And I go to "admin/settings/comments" + And I fill in + | name | value | + | CommentSettings.ModerateComments | true | + And I hit "Save" + And I am redirected + Then I should see "Settings updated" + When I go to "users/account/logoff" + And I go to "my-blog/my-post" + And I fill in + | name | value | + | Comments.Author | Bill | + | Comments.CommentText | This is a moderated comment. | + And I hit "Submit Comment" + And I am redirected + # because the ToUrlString extension method breaks in this specific (test) environment, the returnUrl is broken... + And I go to "my-blog/my-post" + Then I should see "Hi there" + And I should not see "This is a moderated comment" diff --git a/src/Orchard.Specs/Comments.feature.cs b/src/Orchard.Specs/Comments.feature.cs index 4c48a16bbda..fae9ea640da 100644 --- a/src/Orchard.Specs/Comments.feature.cs +++ b/src/Orchard.Specs/Comments.feature.cs @@ -1,226 +1,226 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by SpecFlow (http://www.specflow.org/). -// SpecFlow Version:1.9.0.77 -// SpecFlow Generator Version:1.9.0.0 -// Runtime Version:4.0.30319.0 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ -#region Designer generated code -#pragma warning disable -namespace Orchard.Specs -{ - using TechTalk.SpecFlow; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [NUnit.Framework.TestFixtureAttribute()] - [NUnit.Framework.DescriptionAttribute("Comments")] - public partial class CommentsFeature - { - - private static TechTalk.SpecFlow.ITestRunner testRunner; - -#line 1 "Comments.feature" -#line hidden - - [NUnit.Framework.TestFixtureSetUpAttribute()] - public virtual void FeatureSetup() - { - testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Comments", " In order to enable simple comment capabilities on my site\r\n As an author\r\n I " + - "want to allow comments to be safely posted on specific content item pages", ProgrammingLanguage.CSharp, ((string[])(null))); - testRunner.OnFeatureStart(featureInfo); - } - - [NUnit.Framework.TestFixtureTearDownAttribute()] - public virtual void FeatureTearDown() - { - testRunner.OnFeatureEnd(); - testRunner = null; - } - - [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() - { - } - - [NUnit.Framework.TearDownAttribute()] - public virtual void ScenarioTearDown() - { - testRunner.OnScenarioEnd(); - } - - public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) - { - testRunner.OnScenarioStart(scenarioInfo); - } - - public virtual void ScenarioCleanup() - { - testRunner.CollectScenarioErrors(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("HTML markup in any given comment is encoded")] - public virtual void HTMLMarkupInAnyGivenCommentIsEncoded() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("HTML markup in any given comment is encoded", ((string[])(null))); -#line 6 -this.ScenarioSetup(scenarioInfo); -#line 7 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 8 - testRunner.When("I go to \"admin/blogs/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table1.AddRow(new string[] { - "Title.Title", - "My Blog"}); -#line 9 - testRunner.And("I fill in", ((string)(null)), table1, "And "); -#line 12 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 13 - testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 14 - testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 15 - testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table2.AddRow(new string[] { - "Title.Title", - "My Post"}); - table2.AddRow(new string[] { - "Body.Text", - "Hi there."}); -#line 16 - testRunner.And("I fill in", ((string)(null)), table2, "And "); -#line 20 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 21 - testRunner.And("I go to \"my-blog/my-post\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table3.AddRow(new string[] { - "Comments.CommentText", - "This is
      a link."}); -#line 22 - testRunner.And("I fill in", ((string)(null)), table3, "And "); -#line 25 - testRunner.And("I hit \"Submit Comment\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 26 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 28 - testRunner.And("I go to \"my-blog/my-post\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 29 - testRunner.Then("I should see \"This is<br id="bad-br" />a <a href\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 30 - testRunner.And("I should not see \"
      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 32 - testRunner.When("I go to \"Users/Account/LogOff\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 33 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 34 - testRunner.And("I go to \"my-blog/my-post\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table4.AddRow(new string[] { - "Comments.Author", - "Some One"}); - table4.AddRow(new string[] { - "Comments.CommentText", - "This is
      a link."}); -#line 35 - testRunner.And("I fill in", ((string)(null)), table4, "And "); -#line 39 - testRunner.And("I hit \"Submit Comment\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 40 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 42 - testRunner.And("I go to \"my-blog/my-post\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 44 - testRunner.Then("I should see \"This is<br id="bad-anon-br" />a <a href\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 45 - testRunner.And("I should not see \"
      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 48 - testRunner.When("I go to \"users/account/logon\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table5.AddRow(new string[] { - "userNameOrEmail", - "admin"}); - table5.AddRow(new string[] { - "password", - "6655321"}); -#line 49 - testRunner.And("I fill in", ((string)(null)), table5, "And "); -#line 53 - testRunner.And("I hit \"Sign In\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 54 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 55 - testRunner.And("I go to \"admin/settings/comments\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table6 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table6.AddRow(new string[] { - "CommentSettings.ModerateComments", - "true"}); -#line 56 - testRunner.And("I fill in", ((string)(null)), table6, "And "); -#line 59 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 60 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 61 - testRunner.Then("I should see \"Settings updated\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 62 - testRunner.When("I go to \"users/account/logoff\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 63 - testRunner.And("I go to \"my-blog/my-post\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table7 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table7.AddRow(new string[] { - "Comments.Author", - "Bill"}); - table7.AddRow(new string[] { - "Comments.CommentText", - "This is a moderated comment."}); -#line 64 - testRunner.And("I fill in", ((string)(null)), table7, "And "); -#line 68 - testRunner.And("I hit \"Submit Comment\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 69 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 71 - testRunner.And("I go to \"my-blog/my-post\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 72 - testRunner.Then("I should see \"Hi there\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 73 - testRunner.And("I should not see \"This is a moderated comment\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - } -} -#pragma warning restore -#endregion +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.9.0.77 +// SpecFlow Generator Version:1.9.0.0 +// Runtime Version:4.0.30319.0 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +#pragma warning disable +namespace Orchard.Specs +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("Comments")] + public partial class CommentsFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "Comments.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Comments", " In order to enable simple comment capabilities on my site\r\n As an author\r\n I " + + "want to allow comments to be safely posted on specific content item pages", ProgrammingLanguage.CSharp, ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + [NUnit.Framework.SetUpAttribute()] + public virtual void TestInitialize() + { + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + public virtual void ScenarioCleanup() + { + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("HTML markup in any given comment is encoded")] + public virtual void HTMLMarkupInAnyGivenCommentIsEncoded() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("HTML markup in any given comment is encoded", ((string[])(null))); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 8 + testRunner.When("I go to \"admin/blogs/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table1.AddRow(new string[] { + "Title.Title", + "My Blog"}); +#line 9 + testRunner.And("I fill in", ((string)(null)), table1, "And "); +#line 12 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 13 + testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 14 + testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 15 + testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table2.AddRow(new string[] { + "Title.Title", + "My Post"}); + table2.AddRow(new string[] { + "Body.Text", + "Hi there."}); +#line 16 + testRunner.And("I fill in", ((string)(null)), table2, "And "); +#line 20 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 21 + testRunner.And("I go to \"my-blog/my-post\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table3.AddRow(new string[] { + "Comments.CommentText", + "This is
      a link."}); +#line 22 + testRunner.And("I fill in", ((string)(null)), table3, "And "); +#line 25 + testRunner.And("I hit \"Submit Comment\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 26 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 28 + testRunner.And("I go to \"my-blog/my-post\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 29 + testRunner.Then("I should see \"This is<br id="bad-br" />a <a href\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 30 + testRunner.And("I should not see \"
      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 32 + testRunner.When("I go to \"Users/Account/LogOff\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 33 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 34 + testRunner.And("I go to \"my-blog/my-post\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table4.AddRow(new string[] { + "Comments.Author", + "Some One"}); + table4.AddRow(new string[] { + "Comments.CommentText", + "This is
      a link."}); +#line 35 + testRunner.And("I fill in", ((string)(null)), table4, "And "); +#line 39 + testRunner.And("I hit \"Submit Comment\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 40 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 42 + testRunner.And("I go to \"my-blog/my-post\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 44 + testRunner.Then("I should see \"This is<br id="bad-anon-br" />a <a href\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 45 + testRunner.And("I should not see \"
      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 48 + testRunner.When("I go to \"users/account/logon\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table5.AddRow(new string[] { + "userNameOrEmail", + "admin"}); + table5.AddRow(new string[] { + "password", + "6655321"}); +#line 49 + testRunner.And("I fill in", ((string)(null)), table5, "And "); +#line 53 + testRunner.And("I hit \"Sign In\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 54 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 55 + testRunner.And("I go to \"admin/settings/comments\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table6 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table6.AddRow(new string[] { + "CommentSettings.ModerateComments", + "true"}); +#line 56 + testRunner.And("I fill in", ((string)(null)), table6, "And "); +#line 59 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 60 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 61 + testRunner.Then("I should see \"Settings updated\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 62 + testRunner.When("I go to \"users/account/logoff\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 63 + testRunner.And("I go to \"my-blog/my-post\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table7 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table7.AddRow(new string[] { + "Comments.Author", + "Bill"}); + table7.AddRow(new string[] { + "Comments.CommentText", + "This is a moderated comment."}); +#line 64 + testRunner.And("I fill in", ((string)(null)), table7, "And "); +#line 68 + testRunner.And("I hit \"Submit Comment\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 69 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 71 + testRunner.And("I go to \"my-blog/my-post\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 72 + testRunner.Then("I should see \"Hi there\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 73 + testRunner.And("I should not see \"This is a moderated comment\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + } +} +#pragma warning restore +#endregion diff --git a/src/Orchard.Specs/ContentRights.feature b/src/Orchard.Specs/ContentRights.feature index b4bd77f9b1d..37213060acb 100644 --- a/src/Orchard.Specs/ContentRights.feature +++ b/src/Orchard.Specs/ContentRights.feature @@ -1,97 +1,97 @@ -Feature: Content rights management - In order to ensure security - As a root Orchard system operator - I want only the allowed users to edit the content - -Scenario: Administrators can manage a Page - Given I have installed Orchard - When I have a user "user1" with roles "Administrator" - Then "user1" should be able to "publish" a "Page" owned by "user1" - And "user1" should be able to "edit" a "Page" owned by "user1" - -Scenario: Users can't create a Page if they don't have the PublishContent permission - Given I have installed Orchard - When I have a role "CustomRole" with permissions "EditContent, DeleteContent" - And I have a user "user1" with roles "CustomRole" - Then "user1" should not be able to "publish" a "Page" owned by "user1" - And "user1" should be able to "edit" a "Page" owned by "user1" - And "user1" should be able to "delete" a "Page" owned by "user1" - -Scenario: Users can create a Page of others if they have PublishContent permission - Given I have installed Orchard - When I have a role "CustomRole" with permissions "PublishContent" - And I have a user "user1" with roles "CustomRole" - And I have a user "user2" with roles "Administrator" - Then "user1" should be able to "publish" a "Page" owned by "user2" - And "user1" should be able to "edit" a "Page" owned by "user2" - And "user1" should not be able to "delete" a "Page" owned by "user2" - -Scenario: Users can create a Page if they have PublishOwnContent for Page - Given I have installed Orchard - When I have a role "CustomRole" with permissions "Publish_Page" - And I have a user "user1" with roles "CustomRole" - Then "user1" should be able to "publish" a "Page" owned by "user1" - And "user1" should be able to "edit" a "Page" owned by "user1" - And "user1" should not be able to "delete" a "Page" owned by "user1" - -Scenario: Users can create and edit a Page even if they only have the PublishOwnContent permission - Given I have installed Orchard - When I have a role "CustomRole" with permissions "PublishOwnContent" - And I have a user "user1" with roles "CustomRole" - Then "user1" should be able to "publish" a "Page" owned by "user1" - And "user1" should be able to "edit" a "Page" owned by "user1" - And "user1" should not be able to "delete" a "Page" owned by "user1" - -Scenario: Users can't edit a Page if they don't have the EditContent permission - Given I have installed Orchard - When I have a role "CustomRole" with permissions "DeleteContent" - And I have a user "user1" with roles "CustomRole" - Then "user1" should not be able to "publish" a "Page" owned by "user1" - And "user1" should not be able to "edit" a "Page" owned by "user1" - And "user1" should be able to "delete" a "Page" owned by "user1" - -Scenario: Users can't create a Page for others if they only have PublishOwnContent - Given I have installed Orchard - When I have a role "CustomRole" with permissions "PublishOwnContent" - And I have a user "user1" with roles "CustomRole" - And I have a user "user2" with roles "Administrator" - Then "user1" should not be able to "publish" a "Page" owned by "user2" - And "user1" should not be able to "edit" a "Page" owned by "user2" - And "user1" should not be able to "delete" a "Page" owned by "user2" - -Scenario: Users can't create a Page for others if they only have Publish_Page - Given I have installed Orchard - When I have a role "CustomRole" with permissions "Publish_Page" - And I have a user "user1" with roles "CustomRole" - And I have a user "user2" with roles "Administrator" - Then "user1" should be able to "publish" a "Page" owned by "user2" - And "user1" should be able to "edit" a "Page" owned by "user2" - And "user1" should not be able to "delete" a "Page" owned by "user2" - -Scenario: Users can create a Page for others if they only have Publish_Page - Given I have installed Orchard - When I have a role "CustomRole" with permissions "Publish_Page" - And I have a user "user1" with roles "CustomRole" - And I have a user "user2" with roles "Administrator" - Then "user1" should be able to "publish" a "Page" owned by "user2" - And "user1" should be able to "edit" a "Page" owned by "user2" - And "user1" should not be able to "delete" a "Page" owned by "user2" - -Scenario: Users can delete a Page for others if they only have Delete_Page - Given I have installed Orchard - When I have a role "CustomRole" with permissions "Delete_Page" - And I have a user "user1" with roles "CustomRole" - And I have a user "user2" with roles "Administrator" - Then "user1" should not be able to "publish" a "Page" owned by "user2" - And "user1" should not be able to "edit" a "Page" owned by "user2" - And "user1" should be able to "delete" a "Page" owned by "user2" - - -Scenario: Users can't delete a Page for others if they only have DeleteOwn_Page - Given I have installed Orchard - When I have a role "CustomRole" with permissions "DeleteOwn_Page" - And I have a user "user1" with roles "CustomRole" - And I have a user "user2" with roles "Administrator" - Then "user1" should not be able to "publish" a "Page" owned by "user2" - And "user1" should not be able to "edit" a "Page" owned by "user2" +Feature: Content rights management + In order to ensure security + As a root Orchard system operator + I want only the allowed users to edit the content + +Scenario: Administrators can manage a Page + Given I have installed Orchard + When I have a user "user1" with roles "Administrator" + Then "user1" should be able to "publish" a "Page" owned by "user1" + And "user1" should be able to "edit" a "Page" owned by "user1" + +Scenario: Users can't create a Page if they don't have the PublishContent permission + Given I have installed Orchard + When I have a role "CustomRole" with permissions "EditContent, DeleteContent" + And I have a user "user1" with roles "CustomRole" + Then "user1" should not be able to "publish" a "Page" owned by "user1" + And "user1" should be able to "edit" a "Page" owned by "user1" + And "user1" should be able to "delete" a "Page" owned by "user1" + +Scenario: Users can create a Page of others if they have PublishContent permission + Given I have installed Orchard + When I have a role "CustomRole" with permissions "PublishContent" + And I have a user "user1" with roles "CustomRole" + And I have a user "user2" with roles "Administrator" + Then "user1" should be able to "publish" a "Page" owned by "user2" + And "user1" should be able to "edit" a "Page" owned by "user2" + And "user1" should not be able to "delete" a "Page" owned by "user2" + +Scenario: Users can create a Page if they have PublishOwnContent for Page + Given I have installed Orchard + When I have a role "CustomRole" with permissions "Publish_Page" + And I have a user "user1" with roles "CustomRole" + Then "user1" should be able to "publish" a "Page" owned by "user1" + And "user1" should be able to "edit" a "Page" owned by "user1" + And "user1" should not be able to "delete" a "Page" owned by "user1" + +Scenario: Users can create and edit a Page even if they only have the PublishOwnContent permission + Given I have installed Orchard + When I have a role "CustomRole" with permissions "PublishOwnContent" + And I have a user "user1" with roles "CustomRole" + Then "user1" should be able to "publish" a "Page" owned by "user1" + And "user1" should be able to "edit" a "Page" owned by "user1" + And "user1" should not be able to "delete" a "Page" owned by "user1" + +Scenario: Users can't edit a Page if they don't have the EditContent permission + Given I have installed Orchard + When I have a role "CustomRole" with permissions "DeleteContent" + And I have a user "user1" with roles "CustomRole" + Then "user1" should not be able to "publish" a "Page" owned by "user1" + And "user1" should not be able to "edit" a "Page" owned by "user1" + And "user1" should be able to "delete" a "Page" owned by "user1" + +Scenario: Users can't create a Page for others if they only have PublishOwnContent + Given I have installed Orchard + When I have a role "CustomRole" with permissions "PublishOwnContent" + And I have a user "user1" with roles "CustomRole" + And I have a user "user2" with roles "Administrator" + Then "user1" should not be able to "publish" a "Page" owned by "user2" + And "user1" should not be able to "edit" a "Page" owned by "user2" + And "user1" should not be able to "delete" a "Page" owned by "user2" + +Scenario: Users can't create a Page for others if they only have Publish_Page + Given I have installed Orchard + When I have a role "CustomRole" with permissions "Publish_Page" + And I have a user "user1" with roles "CustomRole" + And I have a user "user2" with roles "Administrator" + Then "user1" should be able to "publish" a "Page" owned by "user2" + And "user1" should be able to "edit" a "Page" owned by "user2" + And "user1" should not be able to "delete" a "Page" owned by "user2" + +Scenario: Users can create a Page for others if they only have Publish_Page + Given I have installed Orchard + When I have a role "CustomRole" with permissions "Publish_Page" + And I have a user "user1" with roles "CustomRole" + And I have a user "user2" with roles "Administrator" + Then "user1" should be able to "publish" a "Page" owned by "user2" + And "user1" should be able to "edit" a "Page" owned by "user2" + And "user1" should not be able to "delete" a "Page" owned by "user2" + +Scenario: Users can delete a Page for others if they only have Delete_Page + Given I have installed Orchard + When I have a role "CustomRole" with permissions "Delete_Page" + And I have a user "user1" with roles "CustomRole" + And I have a user "user2" with roles "Administrator" + Then "user1" should not be able to "publish" a "Page" owned by "user2" + And "user1" should not be able to "edit" a "Page" owned by "user2" + And "user1" should be able to "delete" a "Page" owned by "user2" + + +Scenario: Users can't delete a Page for others if they only have DeleteOwn_Page + Given I have installed Orchard + When I have a role "CustomRole" with permissions "DeleteOwn_Page" + And I have a user "user1" with roles "CustomRole" + And I have a user "user2" with roles "Administrator" + Then "user1" should not be able to "publish" a "Page" owned by "user2" + And "user1" should not be able to "edit" a "Page" owned by "user2" And "user1" should not be able to "delete" a "Page" owned by "user2" \ No newline at end of file diff --git a/src/Orchard.Specs/ContentRights.feature.cs b/src/Orchard.Specs/ContentRights.feature.cs index 2a3cdae4769..d7b6dfe7bf4 100644 --- a/src/Orchard.Specs/ContentRights.feature.cs +++ b/src/Orchard.Specs/ContentRights.feature.cs @@ -1,333 +1,333 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by SpecFlow (http://www.specflow.org/). -// SpecFlow Version:1.9.0.77 -// SpecFlow Generator Version:1.9.0.0 -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ -#region Designer generated code -#pragma warning disable -namespace Orchard.Specs -{ - using TechTalk.SpecFlow; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [NUnit.Framework.TestFixtureAttribute()] - [NUnit.Framework.DescriptionAttribute("Content rights management")] - public partial class ContentRightsManagementFeature - { - - private static TechTalk.SpecFlow.ITestRunner testRunner; - -#line 1 "ContentRights.feature" -#line hidden - - [NUnit.Framework.TestFixtureSetUpAttribute()] - public virtual void FeatureSetup() - { - testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Content rights management", " In order to ensure security\r\n As a root Orchard system operator\r\n I want only" + - " the allowed users to edit the content", ProgrammingLanguage.CSharp, ((string[])(null))); - testRunner.OnFeatureStart(featureInfo); - } - - [NUnit.Framework.TestFixtureTearDownAttribute()] - public virtual void FeatureTearDown() - { - testRunner.OnFeatureEnd(); - testRunner = null; - } - - [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() - { - } - - [NUnit.Framework.TearDownAttribute()] - public virtual void ScenarioTearDown() - { - testRunner.OnScenarioEnd(); - } - - public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) - { - testRunner.OnScenarioStart(scenarioInfo); - } - - public virtual void ScenarioCleanup() - { - testRunner.CollectScenarioErrors(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Administrators can manage a Page")] - public virtual void AdministratorsCanManageAPage() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Administrators can manage a Page", ((string[])(null))); -#line 6 -this.ScenarioSetup(scenarioInfo); -#line 7 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 8 - testRunner.When("I have a user \"user1\" with roles \"Administrator\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 9 - testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 10 - testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Users can\'t create a Page if they don\'t have the PublishContent permission")] - public virtual void UsersCanTCreateAPageIfTheyDonTHaveThePublishContentPermission() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Users can\'t create a Page if they don\'t have the PublishContent permission", ((string[])(null))); -#line 12 -this.ScenarioSetup(scenarioInfo); -#line 13 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 14 - testRunner.When("I have a role \"CustomRole\" with permissions \"EditContent, DeleteContent\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 15 - testRunner.And("I have a user \"user1\" with roles \"CustomRole\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 16 - testRunner.Then("\"user1\" should not be able to \"publish\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 17 - testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 18 - testRunner.And("\"user1\" should be able to \"delete\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Users can create a Page of others if they have PublishContent permission")] - public virtual void UsersCanCreateAPageOfOthersIfTheyHavePublishContentPermission() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Users can create a Page of others if they have PublishContent permission", ((string[])(null))); -#line 20 -this.ScenarioSetup(scenarioInfo); -#line 21 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 22 - testRunner.When("I have a role \"CustomRole\" with permissions \"PublishContent\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 23 - testRunner.And("I have a user \"user1\" with roles \"CustomRole\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 24 - testRunner.And("I have a user \"user2\" with roles \"Administrator\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 25 - testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 26 - testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 27 - testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Users can create a Page if they have PublishOwnContent for Page")] - public virtual void UsersCanCreateAPageIfTheyHavePublishOwnContentForPage() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Users can create a Page if they have PublishOwnContent for Page", ((string[])(null))); -#line 29 -this.ScenarioSetup(scenarioInfo); -#line 30 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 31 - testRunner.When("I have a role \"CustomRole\" with permissions \"Publish_Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 32 - testRunner.And("I have a user \"user1\" with roles \"CustomRole\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 33 - testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 34 - testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 35 - testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Users can create and edit a Page even if they only have the PublishOwnContent per" + - "mission")] - public virtual void UsersCanCreateAndEditAPageEvenIfTheyOnlyHaveThePublishOwnContentPermission() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Users can create and edit a Page even if they only have the PublishOwnContent per" + - "mission", ((string[])(null))); -#line 37 -this.ScenarioSetup(scenarioInfo); -#line 38 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 39 - testRunner.When("I have a role \"CustomRole\" with permissions \"PublishOwnContent\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 40 - testRunner.And("I have a user \"user1\" with roles \"CustomRole\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 41 - testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 42 - testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 43 - testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Users can\'t edit a Page if they don\'t have the EditContent permission")] - public virtual void UsersCanTEditAPageIfTheyDonTHaveTheEditContentPermission() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Users can\'t edit a Page if they don\'t have the EditContent permission", ((string[])(null))); -#line 45 -this.ScenarioSetup(scenarioInfo); -#line 46 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 47 - testRunner.When("I have a role \"CustomRole\" with permissions \"DeleteContent\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 48 - testRunner.And("I have a user \"user1\" with roles \"CustomRole\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 49 - testRunner.Then("\"user1\" should not be able to \"publish\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 50 - testRunner.And("\"user1\" should not be able to \"edit\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 51 - testRunner.And("\"user1\" should be able to \"delete\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Users can\'t create a Page for others if they only have PublishOwnContent")] - public virtual void UsersCanTCreateAPageForOthersIfTheyOnlyHavePublishOwnContent() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Users can\'t create a Page for others if they only have PublishOwnContent", ((string[])(null))); -#line 53 -this.ScenarioSetup(scenarioInfo); -#line 54 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 55 - testRunner.When("I have a role \"CustomRole\" with permissions \"PublishOwnContent\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 56 - testRunner.And("I have a user \"user1\" with roles \"CustomRole\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 57 - testRunner.And("I have a user \"user2\" with roles \"Administrator\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 58 - testRunner.Then("\"user1\" should not be able to \"publish\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 59 - testRunner.And("\"user1\" should not be able to \"edit\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 60 - testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Users can\'t create a Page for others if they only have Publish_Page")] - public virtual void UsersCanTCreateAPageForOthersIfTheyOnlyHavePublish_Page() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Users can\'t create a Page for others if they only have Publish_Page", ((string[])(null))); -#line 62 -this.ScenarioSetup(scenarioInfo); -#line 63 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 64 - testRunner.When("I have a role \"CustomRole\" with permissions \"Publish_Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 65 - testRunner.And("I have a user \"user1\" with roles \"CustomRole\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 66 - testRunner.And("I have a user \"user2\" with roles \"Administrator\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 67 - testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 68 - testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 69 - testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Users can create a Page for others if they only have Publish_Page")] - public virtual void UsersCanCreateAPageForOthersIfTheyOnlyHavePublish_Page() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Users can create a Page for others if they only have Publish_Page", ((string[])(null))); -#line 71 -this.ScenarioSetup(scenarioInfo); -#line 72 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 73 - testRunner.When("I have a role \"CustomRole\" with permissions \"Publish_Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 74 - testRunner.And("I have a user \"user1\" with roles \"CustomRole\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 75 - testRunner.And("I have a user \"user2\" with roles \"Administrator\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 76 - testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 77 - testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 78 - testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Users can delete a Page for others if they only have Delete_Page")] - public virtual void UsersCanDeleteAPageForOthersIfTheyOnlyHaveDelete_Page() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Users can delete a Page for others if they only have Delete_Page", ((string[])(null))); -#line 80 -this.ScenarioSetup(scenarioInfo); -#line 81 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 82 - testRunner.When("I have a role \"CustomRole\" with permissions \"Delete_Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 83 - testRunner.And("I have a user \"user1\" with roles \"CustomRole\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 84 - testRunner.And("I have a user \"user2\" with roles \"Administrator\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 85 - testRunner.Then("\"user1\" should not be able to \"publish\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 86 - testRunner.And("\"user1\" should not be able to \"edit\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 87 - testRunner.And("\"user1\" should be able to \"delete\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Users can\'t delete a Page for others if they only have DeleteOwn_Page")] - public virtual void UsersCanTDeleteAPageForOthersIfTheyOnlyHaveDeleteOwn_Page() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Users can\'t delete a Page for others if they only have DeleteOwn_Page", ((string[])(null))); -#line 90 -this.ScenarioSetup(scenarioInfo); -#line 91 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 92 - testRunner.When("I have a role \"CustomRole\" with permissions \"DeleteOwn_Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 93 - testRunner.And("I have a user \"user1\" with roles \"CustomRole\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 94 - testRunner.And("I have a user \"user2\" with roles \"Administrator\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 95 - testRunner.Then("\"user1\" should not be able to \"publish\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 96 - testRunner.And("\"user1\" should not be able to \"edit\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 97 - testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - } -} -#pragma warning restore -#endregion +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.9.0.77 +// SpecFlow Generator Version:1.9.0.0 +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +#pragma warning disable +namespace Orchard.Specs +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("Content rights management")] + public partial class ContentRightsManagementFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "ContentRights.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Content rights management", " In order to ensure security\r\n As a root Orchard system operator\r\n I want only" + + " the allowed users to edit the content", ProgrammingLanguage.CSharp, ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + [NUnit.Framework.SetUpAttribute()] + public virtual void TestInitialize() + { + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + public virtual void ScenarioCleanup() + { + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Administrators can manage a Page")] + public virtual void AdministratorsCanManageAPage() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Administrators can manage a Page", ((string[])(null))); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 8 + testRunner.When("I have a user \"user1\" with roles \"Administrator\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 9 + testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 10 + testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Users can\'t create a Page if they don\'t have the PublishContent permission")] + public virtual void UsersCanTCreateAPageIfTheyDonTHaveThePublishContentPermission() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Users can\'t create a Page if they don\'t have the PublishContent permission", ((string[])(null))); +#line 12 +this.ScenarioSetup(scenarioInfo); +#line 13 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 14 + testRunner.When("I have a role \"CustomRole\" with permissions \"EditContent, DeleteContent\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 15 + testRunner.And("I have a user \"user1\" with roles \"CustomRole\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 16 + testRunner.Then("\"user1\" should not be able to \"publish\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 17 + testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 18 + testRunner.And("\"user1\" should be able to \"delete\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Users can create a Page of others if they have PublishContent permission")] + public virtual void UsersCanCreateAPageOfOthersIfTheyHavePublishContentPermission() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Users can create a Page of others if they have PublishContent permission", ((string[])(null))); +#line 20 +this.ScenarioSetup(scenarioInfo); +#line 21 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 22 + testRunner.When("I have a role \"CustomRole\" with permissions \"PublishContent\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 23 + testRunner.And("I have a user \"user1\" with roles \"CustomRole\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 24 + testRunner.And("I have a user \"user2\" with roles \"Administrator\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 25 + testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 26 + testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 27 + testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Users can create a Page if they have PublishOwnContent for Page")] + public virtual void UsersCanCreateAPageIfTheyHavePublishOwnContentForPage() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Users can create a Page if they have PublishOwnContent for Page", ((string[])(null))); +#line 29 +this.ScenarioSetup(scenarioInfo); +#line 30 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 31 + testRunner.When("I have a role \"CustomRole\" with permissions \"Publish_Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 32 + testRunner.And("I have a user \"user1\" with roles \"CustomRole\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 33 + testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 34 + testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 35 + testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Users can create and edit a Page even if they only have the PublishOwnContent per" + + "mission")] + public virtual void UsersCanCreateAndEditAPageEvenIfTheyOnlyHaveThePublishOwnContentPermission() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Users can create and edit a Page even if they only have the PublishOwnContent per" + + "mission", ((string[])(null))); +#line 37 +this.ScenarioSetup(scenarioInfo); +#line 38 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 39 + testRunner.When("I have a role \"CustomRole\" with permissions \"PublishOwnContent\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 40 + testRunner.And("I have a user \"user1\" with roles \"CustomRole\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 41 + testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 42 + testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 43 + testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Users can\'t edit a Page if they don\'t have the EditContent permission")] + public virtual void UsersCanTEditAPageIfTheyDonTHaveTheEditContentPermission() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Users can\'t edit a Page if they don\'t have the EditContent permission", ((string[])(null))); +#line 45 +this.ScenarioSetup(scenarioInfo); +#line 46 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 47 + testRunner.When("I have a role \"CustomRole\" with permissions \"DeleteContent\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 48 + testRunner.And("I have a user \"user1\" with roles \"CustomRole\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 49 + testRunner.Then("\"user1\" should not be able to \"publish\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 50 + testRunner.And("\"user1\" should not be able to \"edit\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 51 + testRunner.And("\"user1\" should be able to \"delete\" a \"Page\" owned by \"user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Users can\'t create a Page for others if they only have PublishOwnContent")] + public virtual void UsersCanTCreateAPageForOthersIfTheyOnlyHavePublishOwnContent() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Users can\'t create a Page for others if they only have PublishOwnContent", ((string[])(null))); +#line 53 +this.ScenarioSetup(scenarioInfo); +#line 54 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 55 + testRunner.When("I have a role \"CustomRole\" with permissions \"PublishOwnContent\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 56 + testRunner.And("I have a user \"user1\" with roles \"CustomRole\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 57 + testRunner.And("I have a user \"user2\" with roles \"Administrator\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 58 + testRunner.Then("\"user1\" should not be able to \"publish\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 59 + testRunner.And("\"user1\" should not be able to \"edit\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 60 + testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Users can\'t create a Page for others if they only have Publish_Page")] + public virtual void UsersCanTCreateAPageForOthersIfTheyOnlyHavePublish_Page() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Users can\'t create a Page for others if they only have Publish_Page", ((string[])(null))); +#line 62 +this.ScenarioSetup(scenarioInfo); +#line 63 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 64 + testRunner.When("I have a role \"CustomRole\" with permissions \"Publish_Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 65 + testRunner.And("I have a user \"user1\" with roles \"CustomRole\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 66 + testRunner.And("I have a user \"user2\" with roles \"Administrator\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 67 + testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 68 + testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 69 + testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Users can create a Page for others if they only have Publish_Page")] + public virtual void UsersCanCreateAPageForOthersIfTheyOnlyHavePublish_Page() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Users can create a Page for others if they only have Publish_Page", ((string[])(null))); +#line 71 +this.ScenarioSetup(scenarioInfo); +#line 72 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 73 + testRunner.When("I have a role \"CustomRole\" with permissions \"Publish_Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 74 + testRunner.And("I have a user \"user1\" with roles \"CustomRole\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 75 + testRunner.And("I have a user \"user2\" with roles \"Administrator\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 76 + testRunner.Then("\"user1\" should be able to \"publish\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 77 + testRunner.And("\"user1\" should be able to \"edit\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 78 + testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Users can delete a Page for others if they only have Delete_Page")] + public virtual void UsersCanDeleteAPageForOthersIfTheyOnlyHaveDelete_Page() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Users can delete a Page for others if they only have Delete_Page", ((string[])(null))); +#line 80 +this.ScenarioSetup(scenarioInfo); +#line 81 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 82 + testRunner.When("I have a role \"CustomRole\" with permissions \"Delete_Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 83 + testRunner.And("I have a user \"user1\" with roles \"CustomRole\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 84 + testRunner.And("I have a user \"user2\" with roles \"Administrator\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 85 + testRunner.Then("\"user1\" should not be able to \"publish\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 86 + testRunner.And("\"user1\" should not be able to \"edit\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 87 + testRunner.And("\"user1\" should be able to \"delete\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Users can\'t delete a Page for others if they only have DeleteOwn_Page")] + public virtual void UsersCanTDeleteAPageForOthersIfTheyOnlyHaveDeleteOwn_Page() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Users can\'t delete a Page for others if they only have DeleteOwn_Page", ((string[])(null))); +#line 90 +this.ScenarioSetup(scenarioInfo); +#line 91 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 92 + testRunner.When("I have a role \"CustomRole\" with permissions \"DeleteOwn_Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 93 + testRunner.And("I have a user \"user1\" with roles \"CustomRole\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 94 + testRunner.And("I have a user \"user2\" with roles \"Administrator\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 95 + testRunner.Then("\"user1\" should not be able to \"publish\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 96 + testRunner.And("\"user1\" should not be able to \"edit\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 97 + testRunner.And("\"user1\" should not be able to \"delete\" a \"Page\" owned by \"user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + } +} +#pragma warning restore +#endregion diff --git a/src/Orchard.Specs/ContentTypes.feature b/src/Orchard.Specs/ContentTypes.feature index 31b4f22255b..b92d540b2ff 100644 --- a/src/Orchard.Specs/ContentTypes.feature +++ b/src/Orchard.Specs/ContentTypes.feature @@ -1,80 +1,80 @@ -Feature: Content Types - In order to add new types to my site - As an adminitrator - I want to create create content types - -Scenario: I can create a new content type - Given I have installed Orchard - When I go to "Admin/ContentTypes" - Then I should see "]*>.*?Create new type" - When I go to "Admin/ContentTypes/Create" - And I fill in - | name | value | - | DisplayName | Event | - | Name | Event | - And I hit "Create" - And I go to "Admin/ContentTypes/" - Then I should see "Event" - -Scenario: I can't create a content type with an already existing name - Given I have installed Orchard - When I go to "Admin/ContentTypes/Create" - And I fill in - | name | value | - | DisplayName | Event | - | Name | Event | - And I hit "Create" - And I go to "Admin/ContentTypes/" - Then I should see "Event" - When I go to "Admin/ContentTypes/Create" - And I fill in - | name | value | - | DisplayName | Event | - | Name | Event-2 | - And I hit "Create" - Then I should see "]*>.*?New Content Type.*?" - And I should see "validation-summary-errors" - -Scenario: I can't create a content type with an already existing technical name - Given I have installed Orchard - When I go to "Admin/ContentTypes/Create" - And I fill in - | name | value | - | DisplayName | Dinner | - | Name | Dinner | - And I hit "Create" - And I go to "Admin/ContentTypes/" - Then I should see "Dinner" - When I go to "Admin/ContentTypes/Create" - And I fill in - | name | value | - | DisplayName | Dinner2 | - | Name | Dinner | - And I hit "Create" - Then I should see "]*>.*?New Content Type.*?" - And I should see "validation-summary-errors" - -Scenario: I can't rename a content type with an already existing name - Given I have installed Orchard - When I go to "Admin/ContentTypes/Create" - And I fill in - | name | value | - | DisplayName | Dinner | - | Name | Dinner | - And I hit "Create" - And I go to "Admin/ContentTypes/" - Then I should see "Dinner" - When I go to "Admin/ContentTypes/Create" - And I fill in - | name | value | - | DisplayName | Event | - | Name | Event | - And I hit "Create" - And I go to "Admin/ContentTypes/" - Then I should see "Event" - When I go to "Admin/ContentTypes/Edit/Dinner" - And I fill in - | name | value | - | DisplayName | Event | - And I hit "Save" +Feature: Content Types + In order to add new types to my site + As an adminitrator + I want to create create content types + +Scenario: I can create a new content type + Given I have installed Orchard + When I go to "Admin/ContentTypes" + Then I should see "]*>.*?Create new type" + When I go to "Admin/ContentTypes/Create" + And I fill in + | name | value | + | DisplayName | Event | + | Name | Event | + And I hit "Create" + And I go to "Admin/ContentTypes/" + Then I should see "Event" + +Scenario: I can't create a content type with an already existing name + Given I have installed Orchard + When I go to "Admin/ContentTypes/Create" + And I fill in + | name | value | + | DisplayName | Event | + | Name | Event | + And I hit "Create" + And I go to "Admin/ContentTypes/" + Then I should see "Event" + When I go to "Admin/ContentTypes/Create" + And I fill in + | name | value | + | DisplayName | Event | + | Name | Event-2 | + And I hit "Create" + Then I should see "]*>.*?New Content Type.*?" + And I should see "validation-summary-errors" + +Scenario: I can't create a content type with an already existing technical name + Given I have installed Orchard + When I go to "Admin/ContentTypes/Create" + And I fill in + | name | value | + | DisplayName | Dinner | + | Name | Dinner | + And I hit "Create" + And I go to "Admin/ContentTypes/" + Then I should see "Dinner" + When I go to "Admin/ContentTypes/Create" + And I fill in + | name | value | + | DisplayName | Dinner2 | + | Name | Dinner | + And I hit "Create" + Then I should see "]*>.*?New Content Type.*?" + And I should see "validation-summary-errors" + +Scenario: I can't rename a content type with an already existing name + Given I have installed Orchard + When I go to "Admin/ContentTypes/Create" + And I fill in + | name | value | + | DisplayName | Dinner | + | Name | Dinner | + And I hit "Create" + And I go to "Admin/ContentTypes/" + Then I should see "Dinner" + When I go to "Admin/ContentTypes/Create" + And I fill in + | name | value | + | DisplayName | Event | + | Name | Event | + And I hit "Create" + And I go to "Admin/ContentTypes/" + Then I should see "Event" + When I go to "Admin/ContentTypes/Edit/Dinner" + And I fill in + | name | value | + | DisplayName | Event | + And I hit "Save" Then I should see "validation-summary-errors" \ No newline at end of file diff --git a/src/Orchard.Specs/ContentTypes.feature.cs b/src/Orchard.Specs/ContentTypes.feature.cs index 3e9066312a0..1e890aec401 100644 --- a/src/Orchard.Specs/ContentTypes.feature.cs +++ b/src/Orchard.Specs/ContentTypes.feature.cs @@ -1,281 +1,281 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by SpecFlow (http://www.specflow.org/). -// SpecFlow Version:1.9.0.77 -// SpecFlow Generator Version:1.9.0.0 -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ -#region Designer generated code -#pragma warning disable -namespace Orchard.Specs -{ - using TechTalk.SpecFlow; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [NUnit.Framework.TestFixtureAttribute()] - [NUnit.Framework.DescriptionAttribute("Content Types")] - public partial class ContentTypesFeature - { - - private static TechTalk.SpecFlow.ITestRunner testRunner; - -#line 1 "ContentTypes.feature" -#line hidden - - [NUnit.Framework.TestFixtureSetUpAttribute()] - public virtual void FeatureSetup() - { - testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Content Types", " In order to add new types to my site\r\n As an adminitrator\r\n I want to create " + - "create content types", ProgrammingLanguage.CSharp, ((string[])(null))); - testRunner.OnFeatureStart(featureInfo); - } - - [NUnit.Framework.TestFixtureTearDownAttribute()] - public virtual void FeatureTearDown() - { - testRunner.OnFeatureEnd(); - testRunner = null; - } - - [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() - { - } - - [NUnit.Framework.TearDownAttribute()] - public virtual void ScenarioTearDown() - { - testRunner.OnScenarioEnd(); - } - - public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) - { - testRunner.OnScenarioStart(scenarioInfo); - } - - public virtual void ScenarioCleanup() - { - testRunner.CollectScenarioErrors(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I can create a new content type")] - public virtual void ICanCreateANewContentType() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create a new content type", ((string[])(null))); -#line 6 -this.ScenarioSetup(scenarioInfo); -#line 7 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 8 - testRunner.When("I go to \"Admin/ContentTypes\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 9 - testRunner.Then("I should see \"]*>.*?Create new type\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 10 - testRunner.When("I go to \"Admin/ContentTypes/Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table1.AddRow(new string[] { - "DisplayName", - "Event"}); - table1.AddRow(new string[] { - "Name", - "Event"}); -#line 11 - testRunner.And("I fill in", ((string)(null)), table1, "And "); -#line 15 - testRunner.And("I hit \"Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 16 - testRunner.And("I go to \"Admin/ContentTypes/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 17 - testRunner.Then("I should see \"Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I can\'t create a content type with an already existing name")] - public virtual void ICanTCreateAContentTypeWithAnAlreadyExistingName() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can\'t create a content type with an already existing name", ((string[])(null))); -#line 19 -this.ScenarioSetup(scenarioInfo); -#line 20 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 21 - testRunner.When("I go to \"Admin/ContentTypes/Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table2.AddRow(new string[] { - "DisplayName", - "Event"}); - table2.AddRow(new string[] { - "Name", - "Event"}); -#line 22 - testRunner.And("I fill in", ((string)(null)), table2, "And "); -#line 26 - testRunner.And("I hit \"Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 27 - testRunner.And("I go to \"Admin/ContentTypes/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 28 - testRunner.Then("I should see \"Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 29 - testRunner.When("I go to \"Admin/ContentTypes/Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table3.AddRow(new string[] { - "DisplayName", - "Event"}); - table3.AddRow(new string[] { - "Name", - "Event-2"}); -#line 30 - testRunner.And("I fill in", ((string)(null)), table3, "And "); -#line 34 - testRunner.And("I hit \"Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 35 - testRunner.Then("I should see \"]*>.*?New Content Type.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 36 - testRunner.And("I should see \"validation-summary-errors\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I can\'t create a content type with an already existing technical name")] - public virtual void ICanTCreateAContentTypeWithAnAlreadyExistingTechnicalName() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can\'t create a content type with an already existing technical name", ((string[])(null))); -#line 38 -this.ScenarioSetup(scenarioInfo); -#line 39 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 40 - testRunner.When("I go to \"Admin/ContentTypes/Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table4.AddRow(new string[] { - "DisplayName", - "Dinner"}); - table4.AddRow(new string[] { - "Name", - "Dinner"}); -#line 41 - testRunner.And("I fill in", ((string)(null)), table4, "And "); -#line 45 - testRunner.And("I hit \"Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 46 - testRunner.And("I go to \"Admin/ContentTypes/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 47 - testRunner.Then("I should see \"Dinner\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 48 - testRunner.When("I go to \"Admin/ContentTypes/Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table5.AddRow(new string[] { - "DisplayName", - "Dinner2"}); - table5.AddRow(new string[] { - "Name", - "Dinner"}); -#line 49 - testRunner.And("I fill in", ((string)(null)), table5, "And "); -#line 53 - testRunner.And("I hit \"Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 54 - testRunner.Then("I should see \"]*>.*?New Content Type.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 55 - testRunner.And("I should see \"validation-summary-errors\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I can\'t rename a content type with an already existing name")] - public virtual void ICanTRenameAContentTypeWithAnAlreadyExistingName() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can\'t rename a content type with an already existing name", ((string[])(null))); -#line 57 -this.ScenarioSetup(scenarioInfo); -#line 58 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 59 - testRunner.When("I go to \"Admin/ContentTypes/Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table6 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table6.AddRow(new string[] { - "DisplayName", - "Dinner"}); - table6.AddRow(new string[] { - "Name", - "Dinner"}); -#line 60 - testRunner.And("I fill in", ((string)(null)), table6, "And "); -#line 64 - testRunner.And("I hit \"Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 65 - testRunner.And("I go to \"Admin/ContentTypes/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 66 - testRunner.Then("I should see \"Dinner\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 67 - testRunner.When("I go to \"Admin/ContentTypes/Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table7 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table7.AddRow(new string[] { - "DisplayName", - "Event"}); - table7.AddRow(new string[] { - "Name", - "Event"}); -#line 68 - testRunner.And("I fill in", ((string)(null)), table7, "And "); -#line 72 - testRunner.And("I hit \"Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 73 - testRunner.And("I go to \"Admin/ContentTypes/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 74 - testRunner.Then("I should see \"Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 75 - testRunner.When("I go to \"Admin/ContentTypes/Edit/Dinner\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table8 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table8.AddRow(new string[] { - "DisplayName", - "Event"}); -#line 76 - testRunner.And("I fill in", ((string)(null)), table8, "And "); -#line 79 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 80 - testRunner.Then("I should see \"validation-summary-errors\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - } -} -#pragma warning restore -#endregion +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.9.0.77 +// SpecFlow Generator Version:1.9.0.0 +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +#pragma warning disable +namespace Orchard.Specs +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("Content Types")] + public partial class ContentTypesFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "ContentTypes.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Content Types", " In order to add new types to my site\r\n As an adminitrator\r\n I want to create " + + "create content types", ProgrammingLanguage.CSharp, ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + [NUnit.Framework.SetUpAttribute()] + public virtual void TestInitialize() + { + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + public virtual void ScenarioCleanup() + { + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I can create a new content type")] + public virtual void ICanCreateANewContentType() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create a new content type", ((string[])(null))); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 8 + testRunner.When("I go to \"Admin/ContentTypes\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 9 + testRunner.Then("I should see \"]*>.*?Create new type\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 10 + testRunner.When("I go to \"Admin/ContentTypes/Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table1.AddRow(new string[] { + "DisplayName", + "Event"}); + table1.AddRow(new string[] { + "Name", + "Event"}); +#line 11 + testRunner.And("I fill in", ((string)(null)), table1, "And "); +#line 15 + testRunner.And("I hit \"Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 16 + testRunner.And("I go to \"Admin/ContentTypes/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 17 + testRunner.Then("I should see \"Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I can\'t create a content type with an already existing name")] + public virtual void ICanTCreateAContentTypeWithAnAlreadyExistingName() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can\'t create a content type with an already existing name", ((string[])(null))); +#line 19 +this.ScenarioSetup(scenarioInfo); +#line 20 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 21 + testRunner.When("I go to \"Admin/ContentTypes/Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table2.AddRow(new string[] { + "DisplayName", + "Event"}); + table2.AddRow(new string[] { + "Name", + "Event"}); +#line 22 + testRunner.And("I fill in", ((string)(null)), table2, "And "); +#line 26 + testRunner.And("I hit \"Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 27 + testRunner.And("I go to \"Admin/ContentTypes/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 28 + testRunner.Then("I should see \"Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 29 + testRunner.When("I go to \"Admin/ContentTypes/Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table3.AddRow(new string[] { + "DisplayName", + "Event"}); + table3.AddRow(new string[] { + "Name", + "Event-2"}); +#line 30 + testRunner.And("I fill in", ((string)(null)), table3, "And "); +#line 34 + testRunner.And("I hit \"Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 35 + testRunner.Then("I should see \"]*>.*?New Content Type.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 36 + testRunner.And("I should see \"validation-summary-errors\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I can\'t create a content type with an already existing technical name")] + public virtual void ICanTCreateAContentTypeWithAnAlreadyExistingTechnicalName() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can\'t create a content type with an already existing technical name", ((string[])(null))); +#line 38 +this.ScenarioSetup(scenarioInfo); +#line 39 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 40 + testRunner.When("I go to \"Admin/ContentTypes/Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table4.AddRow(new string[] { + "DisplayName", + "Dinner"}); + table4.AddRow(new string[] { + "Name", + "Dinner"}); +#line 41 + testRunner.And("I fill in", ((string)(null)), table4, "And "); +#line 45 + testRunner.And("I hit \"Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 46 + testRunner.And("I go to \"Admin/ContentTypes/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 47 + testRunner.Then("I should see \"Dinner\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 48 + testRunner.When("I go to \"Admin/ContentTypes/Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table5.AddRow(new string[] { + "DisplayName", + "Dinner2"}); + table5.AddRow(new string[] { + "Name", + "Dinner"}); +#line 49 + testRunner.And("I fill in", ((string)(null)), table5, "And "); +#line 53 + testRunner.And("I hit \"Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 54 + testRunner.Then("I should see \"]*>.*?New Content Type.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 55 + testRunner.And("I should see \"validation-summary-errors\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I can\'t rename a content type with an already existing name")] + public virtual void ICanTRenameAContentTypeWithAnAlreadyExistingName() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can\'t rename a content type with an already existing name", ((string[])(null))); +#line 57 +this.ScenarioSetup(scenarioInfo); +#line 58 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 59 + testRunner.When("I go to \"Admin/ContentTypes/Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table6 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table6.AddRow(new string[] { + "DisplayName", + "Dinner"}); + table6.AddRow(new string[] { + "Name", + "Dinner"}); +#line 60 + testRunner.And("I fill in", ((string)(null)), table6, "And "); +#line 64 + testRunner.And("I hit \"Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 65 + testRunner.And("I go to \"Admin/ContentTypes/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 66 + testRunner.Then("I should see \"Dinner\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 67 + testRunner.When("I go to \"Admin/ContentTypes/Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table7 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table7.AddRow(new string[] { + "DisplayName", + "Event"}); + table7.AddRow(new string[] { + "Name", + "Event"}); +#line 68 + testRunner.And("I fill in", ((string)(null)), table7, "And "); +#line 72 + testRunner.And("I hit \"Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 73 + testRunner.And("I go to \"Admin/ContentTypes/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 74 + testRunner.Then("I should see \"Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 75 + testRunner.When("I go to \"Admin/ContentTypes/Edit/Dinner\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table8 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table8.AddRow(new string[] { + "DisplayName", + "Event"}); +#line 76 + testRunner.And("I fill in", ((string)(null)), table8, "And "); +#line 79 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 80 + testRunner.Then("I should see \"validation-summary-errors\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + } +} +#pragma warning restore +#endregion diff --git a/src/Orchard.Specs/Hosting/ExtensionDeploymentOptions.cs b/src/Orchard.Specs/Hosting/ExtensionDeploymentOptions.cs index b1a4db6437f..ff0fd16613d 100644 --- a/src/Orchard.Specs/Hosting/ExtensionDeploymentOptions.cs +++ b/src/Orchard.Specs/Hosting/ExtensionDeploymentOptions.cs @@ -1,15 +1,15 @@ -using System; - -namespace Orchard.Specs.Hosting { - [Flags] - public enum ExtensionDeploymentOptions { - CompiledAssembly = 0x01, - SourceCode = 0x02, - } - - public enum DynamicCompilationOption { - Enabled, // Allow compiling of csproj files as needed - Disabled, // Never compile csproj files - Force // Force loading modules by compiling csproj files - } +using System; + +namespace Orchard.Specs.Hosting { + [Flags] + public enum ExtensionDeploymentOptions { + CompiledAssembly = 0x01, + SourceCode = 0x02, + } + + public enum DynamicCompilationOption { + Enabled, // Allow compiling of csproj files as needed + Disabled, // Never compile csproj files + Force // Force loading modules by compiling csproj files + } } \ No newline at end of file diff --git a/src/Orchard.Specs/Hosting/HostingTraceListener.cs b/src/Orchard.Specs/Hosting/HostingTraceListener.cs index f7f925d0972..4ba673a4d06 100644 --- a/src/Orchard.Specs/Hosting/HostingTraceListener.cs +++ b/src/Orchard.Specs/Hosting/HostingTraceListener.cs @@ -1,24 +1,24 @@ -using System; -using System.Diagnostics; - -namespace Orchard.Specs.Hosting { - public class HostingTraceListener : TraceListener { - private static Action _hook = ignored => { }; - private string _message; - - public static void SetHook(Action hook) { - _hook = hook; - } - - public override void Write(string message) { - var cumulative = _message + message; - _message = cumulative; - } - - public override void WriteLine(string message) { - var cumulative = _message + message; - _message = null; - _hook(cumulative); - } - } -} +using System; +using System.Diagnostics; + +namespace Orchard.Specs.Hosting { + public class HostingTraceListener : TraceListener { + private static Action _hook = ignored => { }; + private string _message; + + public static void SetHook(Action hook) { + _hook = hook; + } + + public override void Write(string message) { + var cumulative = _message + message; + _message = cumulative; + } + + public override void WriteLine(string message) { + var cumulative = _message + message; + _message = null; + _hook(cumulative); + } + } +} diff --git a/src/Orchard.Specs/Hosting/MessageSink.cs b/src/Orchard.Specs/Hosting/MessageSink.cs index 602425697a8..6bdf9798458 100644 --- a/src/Orchard.Specs/Hosting/MessageSink.cs +++ b/src/Orchard.Specs/Hosting/MessageSink.cs @@ -1,14 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; - -namespace Orchard.Specs.Hosting { - public class MessageSink : MarshalByRefObject { - readonly IList _messages = new List(); - - public void Receive(string message) { - Trace.WriteLine(" "+message); - _messages.Add(message); - } - } +using System; +using System.Collections.Generic; +using System.Diagnostics; + +namespace Orchard.Specs.Hosting { + public class MessageSink : MarshalByRefObject { + readonly IList _messages = new List(); + + public void Receive(string message) { + Trace.WriteLine(" "+message); + _messages.Add(message); + } + } } \ No newline at end of file diff --git a/src/Orchard.Specs/Hosting/Orchard.Web/Config/Diagnostics.config b/src/Orchard.Specs/Hosting/Orchard.Web/Config/Diagnostics.config index d7803841d05..4bacb1b7585 100644 --- a/src/Orchard.Specs/Hosting/Orchard.Web/Config/Diagnostics.config +++ b/src/Orchard.Specs/Hosting/Orchard.Web/Config/Diagnostics.config @@ -1,38 +1,38 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Specs/Hosting/Orchard.Web/Config/Host.config b/src/Orchard.Specs/Hosting/Orchard.Web/Config/Host.config index 27f896868aa..50f22aeca81 100644 --- a/src/Orchard.Specs/Hosting/Orchard.Web/Config/Host.config +++ b/src/Orchard.Specs/Hosting/Orchard.Web/Config/Host.config @@ -1,25 +1,25 @@ - - - - -
      - - - - - - - - - - - - + + + + +
      + + + + + + + + + + + + diff --git a/src/Orchard.Specs/Hosting/Orchard.Web/Config/Sites.config b/src/Orchard.Specs/Hosting/Orchard.Web/Config/Sites.config index 5aa6c986bf3..355d8bbf34d 100644 --- a/src/Orchard.Specs/Hosting/Orchard.Web/Config/Sites.config +++ b/src/Orchard.Specs/Hosting/Orchard.Web/Config/Sites.config @@ -1,19 +1,19 @@ - - - - -
      - - - - - - - - - - - - + + + + +
      + + + + + + + + + + + + diff --git a/src/Orchard.Specs/Hosting/Orchard.Web/Core/Web.config b/src/Orchard.Specs/Hosting/Orchard.Web/Core/Web.config index 896faec86da..ad94792207e 100644 --- a/src/Orchard.Specs/Hosting/Orchard.Web/Core/Web.config +++ b/src/Orchard.Specs/Hosting/Orchard.Web/Core/Web.config @@ -1,26 +1,26 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Specs/Hosting/Orchard.Web/Global.asax.cs b/src/Orchard.Specs/Hosting/Orchard.Web/Global.asax.cs index 985a7b3cc7b..f98e7cf48fd 100644 --- a/src/Orchard.Specs/Hosting/Orchard.Web/Global.asax.cs +++ b/src/Orchard.Specs/Hosting/Orchard.Web/Global.asax.cs @@ -1,73 +1,73 @@ -using System.Linq; -using System.Web; -using System.Web.Mvc; -using System.Web.Routing; -using Autofac; -using Orchard.Environment; -using Orchard.Environment.Configuration; - -namespace Orchard.Specs.Hosting.Orchard.Web { - public class MvcApplication : HttpApplication { - private static IOrchardHost _host; - private static IContainer _container; - - public static void RegisterRoutes(RouteCollection routes) { - routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); - } - - protected void Application_Start() { - RegisterRoutes(RouteTable.Routes); - _container = OrchardStarter.CreateHostContainer(MvcSingletons); - _host = _container.Resolve(); - - _host.Initialize(); - - // initialize shells to speed up the first dynamic query - _host.BeginRequest(); - _host.EndRequest(); - } - - protected void Application_BeginRequest() { - Context.Items["originalHttpContext"] = Context; - _host.BeginRequest(); - } - - protected void Application_EndRequest() { - _host.EndRequest(); - } - - static void MvcSingletons(ContainerBuilder builder) { - builder.Register(ctx => RouteTable.Routes).SingleInstance(); - builder.Register(ctx => ModelBinders.Binders).SingleInstance(); - builder.Register(ctx => ViewEngines.Engines).SingleInstance(); - } - - public static void ReloadExtensions() { - _host.ReloadExtensions(); - } - - public static void RestartTenant(string name) { - var settings = _container.Resolve().LoadSettings().SingleOrDefault(x => x.Name == name); - if (settings == null) { - settings = new ShellSettings { - Name = name, - State = TenantState.Uninitialized - }; - } - - ((DefaultOrchardHost)_host).ActivateShell(settings); - } - - public static IWorkContextScope CreateStandaloneEnvironment(string name) { - var settings = _container.Resolve().LoadSettings().SingleOrDefault(x => x.Name == name); - if (settings == null) { - settings = new ShellSettings { - Name = name, - State = TenantState.Uninitialized - }; - } - - return _host.CreateStandaloneEnvironment(settings); - } - } +using System.Linq; +using System.Web; +using System.Web.Mvc; +using System.Web.Routing; +using Autofac; +using Orchard.Environment; +using Orchard.Environment.Configuration; + +namespace Orchard.Specs.Hosting.Orchard.Web { + public class MvcApplication : HttpApplication { + private static IOrchardHost _host; + private static IContainer _container; + + public static void RegisterRoutes(RouteCollection routes) { + routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); + } + + protected void Application_Start() { + RegisterRoutes(RouteTable.Routes); + _container = OrchardStarter.CreateHostContainer(MvcSingletons); + _host = _container.Resolve(); + + _host.Initialize(); + + // initialize shells to speed up the first dynamic query + _host.BeginRequest(); + _host.EndRequest(); + } + + protected void Application_BeginRequest() { + Context.Items["originalHttpContext"] = Context; + _host.BeginRequest(); + } + + protected void Application_EndRequest() { + _host.EndRequest(); + } + + static void MvcSingletons(ContainerBuilder builder) { + builder.Register(ctx => RouteTable.Routes).SingleInstance(); + builder.Register(ctx => ModelBinders.Binders).SingleInstance(); + builder.Register(ctx => ViewEngines.Engines).SingleInstance(); + } + + public static void ReloadExtensions() { + _host.ReloadExtensions(); + } + + public static void RestartTenant(string name) { + var settings = _container.Resolve().LoadSettings().SingleOrDefault(x => x.Name == name); + if (settings == null) { + settings = new ShellSettings { + Name = name, + State = TenantState.Uninitialized + }; + } + + ((DefaultOrchardHost)_host).ActivateShell(settings); + } + + public static IWorkContextScope CreateStandaloneEnvironment(string name) { + var settings = _container.Resolve().LoadSettings().SingleOrDefault(x => x.Name == name); + if (settings == null) { + settings = new ShellSettings { + Name = name, + State = TenantState.Uninitialized + }; + } + + return _host.CreateStandaloneEnvironment(settings); + } + } } \ No newline at end of file diff --git a/src/Orchard.Specs/Hosting/Orchard.Web/Themes/Web.config b/src/Orchard.Specs/Hosting/Orchard.Web/Themes/Web.config index f9cf5ea9549..e3b346fe3c8 100644 --- a/src/Orchard.Specs/Hosting/Orchard.Web/Themes/Web.config +++ b/src/Orchard.Specs/Hosting/Orchard.Web/Themes/Web.config @@ -1,22 +1,22 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/src/Orchard.Specs/Hosting/Orchard.Web/Web.config b/src/Orchard.Specs/Hosting/Orchard.Web/Web.config index b38e8f0286b..c9655548de2 100644 --- a/src/Orchard.Specs/Hosting/Orchard.Web/Web.config +++ b/src/Orchard.Specs/Hosting/Orchard.Web/Web.config @@ -1,223 +1,223 @@ - - - - - - - -
      -
      - - -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + +
      +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Specs/Hosting/RequestDetails.cs b/src/Orchard.Specs/Hosting/RequestDetails.cs index 0cf9df35747..9346f6e506c 100644 --- a/src/Orchard.Specs/Hosting/RequestDetails.cs +++ b/src/Orchard.Specs/Hosting/RequestDetails.cs @@ -1,25 +1,25 @@ -using System; -using System.Collections.Generic; - -namespace Orchard.Specs.Hosting { - [Serializable] - public class RequestDetails { - public RequestDetails() { - RequestHeaders = new Dictionary(); - ResponseHeaders = new Dictionary(); - } - - public string HostName { get; set; } - public string UrlPath { get; set; } - public string Page { get; set; } - public string Query { get; set; } - public byte[] PostData { get; set; } - - public int StatusCode { get; set; } - public string StatusDescription { get; set; } - public string ResponseText { get; set; } - - public IDictionary RequestHeaders { get; set; } - public IDictionary ResponseHeaders { get; set; } - } -} +using System; +using System.Collections.Generic; + +namespace Orchard.Specs.Hosting { + [Serializable] + public class RequestDetails { + public RequestDetails() { + RequestHeaders = new Dictionary(); + ResponseHeaders = new Dictionary(); + } + + public string HostName { get; set; } + public string UrlPath { get; set; } + public string Page { get; set; } + public string Query { get; set; } + public byte[] PostData { get; set; } + + public int StatusCode { get; set; } + public string StatusDescription { get; set; } + public string ResponseText { get; set; } + + public IDictionary RequestHeaders { get; set; } + public IDictionary ResponseHeaders { get; set; } + } +} diff --git a/src/Orchard.Specs/Hosting/RequestExtensions.cs b/src/Orchard.Specs/Hosting/RequestExtensions.cs index 4d0fe6a16d9..3c7a7e1859b 100644 --- a/src/Orchard.Specs/Hosting/RequestExtensions.cs +++ b/src/Orchard.Specs/Hosting/RequestExtensions.cs @@ -1,199 +1,199 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Net; -using System.Text; -using System.Text.RegularExpressions; -using System.Web; -using System.Web.Hosting; -using Orchard.Specs.Util; - -namespace Orchard.Specs.Hosting { - public static class RequestExtensions { - public static RequestDetails SendRequest(this WebHost webHost, string urlPath, IDictionary> postData, string requestMethod = null) { - - var physicalPath = Bleroy.FluentPath.Path.Get(webHost.PhysicalDirectory); - - bool isHomepage = urlPath == "/"; - - if (!isHomepage) - urlPath = StripVDir(urlPath, webHost.VirtualDirectory); - - var details = new RequestDetails { - HostName = webHost.HostName, - UrlPath = urlPath.Replace('\\', '/'), - }; - - int queryIndex = urlPath.IndexOf('?'); - if (queryIndex >= 0) { - details.UrlPath = urlPath.Substring(0, queryIndex).Replace('\\', '/'); - details.Query = urlPath.Substring(queryIndex + 1); - } - - var physicalFilePath = physicalPath.Combine(details.UrlPath.TrimStart('/', '\\')); - details.Page = (isHomepage ? "" : physicalFilePath.GetRelativePath(physicalPath).ToString()); - - if (!File.Exists(physicalFilePath)) - details.Page = details.Page.Replace('\\', '/'); - - if (!string.IsNullOrEmpty(webHost.Cookies)) { - details.RequestHeaders.Add("Cookie", webHost.Cookies); - } - - details.RequestHeaders.Add("Accept-Charset", "utf-8"); - - if (postData != null) { - var requestBodyText = postData - .SelectMany(kv => kv.Value.Select(v => new { k = kv.Key, v })) - .Select((kv, n) => new { p = HttpUtility.UrlEncode(kv.k) + "=" + HttpUtility.UrlEncode(kv.v), n }) - .Aggregate("", (a, x) => a + (x.n == 0 ? "" : "&") + x.p); - - if (requestMethod == "POST") - details.PostData = Encoding.Default.GetBytes(requestBodyText); - else - details.Query = requestBodyText; - } - - webHost.Execute(() => { - var output = new StringWriter(); - var worker = new Worker(details, output); - HttpRuntime.ProcessRequest(worker); - details.ResponseText = output.ToString(); - }); - - string setCookie; - if (details.ResponseHeaders.TryGetValue("Set-Cookie", out setCookie)) { - // Trace.WriteLine(string.Format("Set-Cookie: {0}", setCookie)); - var cookieName = setCookie.Split(';')[0].Split('=')[0]; - DateTime expires; - if (!string.IsNullOrEmpty(webHost.Cookies) - && setCookie.Contains("expires=") - && DateTime.TryParse(setCookie.Split(new[] { "expires=" }, 2, StringSplitOptions.None)[1].Split(';')[0], out expires) - && expires < DateTime.Now) { - // remove - // Trace.WriteLine(string.Format("Removing cookie: {0}", cookieName)); - webHost.Cookies = Regex.Replace(webHost.Cookies, string.Format("{0}=[^;]*;?", cookieName), ""); - } - else if (!string.IsNullOrEmpty(webHost.Cookies) - && Regex.IsMatch(webHost.Cookies, string.Format("\b{0}=", cookieName))) { - // replace - // Trace.WriteLine(string.Format("Replacing cookie: {0}", cookieName)); - webHost.Cookies = Regex.Replace(webHost.Cookies, string.Format("{0}=[^;]*(;?)", cookieName), string.Format("{0}$1", setCookie.Split(';')[0])); - } - else { - // add - // Trace.WriteLine(string.Format("Adding cookie: {0}", cookieName)); - webHost.Cookies = (webHost.Cookies + ';' + setCookie.Split(';').FirstOrDefault()).Trim(';'); - } - // Trace.WriteLine(string.Format("Cookie jar: {0}", webHost.Cookies)); - } - - return details; - } - - private static string StripVDir(string urlPath, string virtualDirectory) { - if (urlPath == "/") - return urlPath; - - return urlPath.StartsWith(virtualDirectory, StringComparison.OrdinalIgnoreCase) - ? urlPath.Substring(virtualDirectory.Length) - : urlPath; - } - - public static RequestDetails SendRequest(this WebHost webHost, string urlPath) { - return webHost.SendRequest(urlPath, null); - } - - class Worker : SimpleWorkerRequest { - private readonly RequestDetails _details; - private readonly TextWriter _output; - - public Worker(RequestDetails details, TextWriter output) - : base(details.Page, details.Query, output) { - _details = details; - _output = output; - PostContentType = "application/x-www-form-urlencoded; charset=utf-8"; - } - - public string PostContentType { get; set; } - - - public override String GetHttpVerbName() { - if (_details.PostData == null) - return base.GetHttpVerbName(); - - return "POST"; - } - - public override string GetKnownRequestHeader(int index) { - if (index == HeaderContentLength) { - if (_details.PostData != null) - return _details.PostData.Length.ToString(); - } - else if (index == HeaderContentType) { - if (_details.PostData != null) - return PostContentType; - } - else if (index == HeaderCookie) { - string value; - if (_details.RequestHeaders.TryGetValue("Cookie", out value)) - return value; - } - else if (index == HeaderHost) { - return _details.HostName; - } - return base.GetKnownRequestHeader(index); - - } - - public override byte[] GetPreloadedEntityBody() { - if (_details.PostData != null) - return _details.PostData; - - return base.GetPreloadedEntityBody(); - } - - public override void SendStatus(int statusCode, string statusDescription) { - _details.StatusCode = statusCode; - _details.StatusDescription = statusDescription; - - base.SendStatus(statusCode, statusDescription); - } - - public override void SendKnownResponseHeader(int index, string value) { - switch (index) { - case HeaderSetCookie: - _details.ResponseHeaders.Add("Set-Cookie", value); - break; - case HeaderLocation: - _details.ResponseHeaders.Add("Location", value); - break; - case HeaderContentType: - _details.ResponseHeaders.Add("Content-Type", value); - break; - default: - _details.ResponseHeaders.Add("known header #" + index, value); - break; - } - base.SendKnownResponseHeader(index, value); - } - - public override void SendUnknownResponseHeader(string name, string value) { - _details.ResponseHeaders[name] = value; - - base.SendUnknownResponseHeader(name, value); - } - - public override void SendResponseFromFile(string filename, long offset, long length) { - _output.Write(System.Text.Encoding.UTF8.GetString(File.ReadAllBytes(filename))); - } - - public override void SendResponseFromMemory(byte[] data, int length) { - _output.Write(System.Text.Encoding.UTF8.GetString(data)); - } - } - } -} - +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Net; +using System.Text; +using System.Text.RegularExpressions; +using System.Web; +using System.Web.Hosting; +using Orchard.Specs.Util; + +namespace Orchard.Specs.Hosting { + public static class RequestExtensions { + public static RequestDetails SendRequest(this WebHost webHost, string urlPath, IDictionary> postData, string requestMethod = null) { + + var physicalPath = Bleroy.FluentPath.Path.Get(webHost.PhysicalDirectory); + + bool isHomepage = urlPath == "/"; + + if (!isHomepage) + urlPath = StripVDir(urlPath, webHost.VirtualDirectory); + + var details = new RequestDetails { + HostName = webHost.HostName, + UrlPath = urlPath.Replace('\\', '/'), + }; + + int queryIndex = urlPath.IndexOf('?'); + if (queryIndex >= 0) { + details.UrlPath = urlPath.Substring(0, queryIndex).Replace('\\', '/'); + details.Query = urlPath.Substring(queryIndex + 1); + } + + var physicalFilePath = physicalPath.Combine(details.UrlPath.TrimStart('/', '\\')); + details.Page = (isHomepage ? "" : physicalFilePath.GetRelativePath(physicalPath).ToString()); + + if (!File.Exists(physicalFilePath)) + details.Page = details.Page.Replace('\\', '/'); + + if (!string.IsNullOrEmpty(webHost.Cookies)) { + details.RequestHeaders.Add("Cookie", webHost.Cookies); + } + + details.RequestHeaders.Add("Accept-Charset", "utf-8"); + + if (postData != null) { + var requestBodyText = postData + .SelectMany(kv => kv.Value.Select(v => new { k = kv.Key, v })) + .Select((kv, n) => new { p = HttpUtility.UrlEncode(kv.k) + "=" + HttpUtility.UrlEncode(kv.v), n }) + .Aggregate("", (a, x) => a + (x.n == 0 ? "" : "&") + x.p); + + if (requestMethod == "POST") + details.PostData = Encoding.Default.GetBytes(requestBodyText); + else + details.Query = requestBodyText; + } + + webHost.Execute(() => { + var output = new StringWriter(); + var worker = new Worker(details, output); + HttpRuntime.ProcessRequest(worker); + details.ResponseText = output.ToString(); + }); + + string setCookie; + if (details.ResponseHeaders.TryGetValue("Set-Cookie", out setCookie)) { + // Trace.WriteLine(string.Format("Set-Cookie: {0}", setCookie)); + var cookieName = setCookie.Split(';')[0].Split('=')[0]; + DateTime expires; + if (!string.IsNullOrEmpty(webHost.Cookies) + && setCookie.Contains("expires=") + && DateTime.TryParse(setCookie.Split(new[] { "expires=" }, 2, StringSplitOptions.None)[1].Split(';')[0], out expires) + && expires < DateTime.Now) { + // remove + // Trace.WriteLine(string.Format("Removing cookie: {0}", cookieName)); + webHost.Cookies = Regex.Replace(webHost.Cookies, string.Format("{0}=[^;]*;?", cookieName), ""); + } + else if (!string.IsNullOrEmpty(webHost.Cookies) + && Regex.IsMatch(webHost.Cookies, string.Format("\b{0}=", cookieName))) { + // replace + // Trace.WriteLine(string.Format("Replacing cookie: {0}", cookieName)); + webHost.Cookies = Regex.Replace(webHost.Cookies, string.Format("{0}=[^;]*(;?)", cookieName), string.Format("{0}$1", setCookie.Split(';')[0])); + } + else { + // add + // Trace.WriteLine(string.Format("Adding cookie: {0}", cookieName)); + webHost.Cookies = (webHost.Cookies + ';' + setCookie.Split(';').FirstOrDefault()).Trim(';'); + } + // Trace.WriteLine(string.Format("Cookie jar: {0}", webHost.Cookies)); + } + + return details; + } + + private static string StripVDir(string urlPath, string virtualDirectory) { + if (urlPath == "/") + return urlPath; + + return urlPath.StartsWith(virtualDirectory, StringComparison.OrdinalIgnoreCase) + ? urlPath.Substring(virtualDirectory.Length) + : urlPath; + } + + public static RequestDetails SendRequest(this WebHost webHost, string urlPath) { + return webHost.SendRequest(urlPath, null); + } + + class Worker : SimpleWorkerRequest { + private readonly RequestDetails _details; + private readonly TextWriter _output; + + public Worker(RequestDetails details, TextWriter output) + : base(details.Page, details.Query, output) { + _details = details; + _output = output; + PostContentType = "application/x-www-form-urlencoded; charset=utf-8"; + } + + public string PostContentType { get; set; } + + + public override String GetHttpVerbName() { + if (_details.PostData == null) + return base.GetHttpVerbName(); + + return "POST"; + } + + public override string GetKnownRequestHeader(int index) { + if (index == HeaderContentLength) { + if (_details.PostData != null) + return _details.PostData.Length.ToString(); + } + else if (index == HeaderContentType) { + if (_details.PostData != null) + return PostContentType; + } + else if (index == HeaderCookie) { + string value; + if (_details.RequestHeaders.TryGetValue("Cookie", out value)) + return value; + } + else if (index == HeaderHost) { + return _details.HostName; + } + return base.GetKnownRequestHeader(index); + + } + + public override byte[] GetPreloadedEntityBody() { + if (_details.PostData != null) + return _details.PostData; + + return base.GetPreloadedEntityBody(); + } + + public override void SendStatus(int statusCode, string statusDescription) { + _details.StatusCode = statusCode; + _details.StatusDescription = statusDescription; + + base.SendStatus(statusCode, statusDescription); + } + + public override void SendKnownResponseHeader(int index, string value) { + switch (index) { + case HeaderSetCookie: + _details.ResponseHeaders.Add("Set-Cookie", value); + break; + case HeaderLocation: + _details.ResponseHeaders.Add("Location", value); + break; + case HeaderContentType: + _details.ResponseHeaders.Add("Content-Type", value); + break; + default: + _details.ResponseHeaders.Add("known header #" + index, value); + break; + } + base.SendKnownResponseHeader(index, value); + } + + public override void SendUnknownResponseHeader(string name, string value) { + _details.ResponseHeaders[name] = value; + + base.SendUnknownResponseHeader(name, value); + } + + public override void SendResponseFromFile(string filename, long offset, long length) { + _output.Write(System.Text.Encoding.UTF8.GetString(File.ReadAllBytes(filename))); + } + + public override void SendResponseFromMemory(byte[] data, int length) { + _output.Write(System.Text.Encoding.UTF8.GetString(data)); + } + } + } +} + diff --git a/src/Orchard.Specs/Hosting/SerializableDelegate.cs b/src/Orchard.Specs/Hosting/SerializableDelegate.cs index 13162100e40..90567302c78 100644 --- a/src/Orchard.Specs/Hosting/SerializableDelegate.cs +++ b/src/Orchard.Specs/Hosting/SerializableDelegate.cs @@ -1,103 +1,103 @@ -using System; -using System.Reflection; -using System.Runtime.Serialization; - -namespace Orchard.Specs.Hosting { - /// - /// Makes delegates serializable where possible - /// Adapted from http://www.codeproject.com/KB/cs/AnonymousSerialization.aspx - /// - [Serializable] - public class SerializableDelegate : ISerializable where TDelegate : class - { - public TDelegate Delegate { get; private set; } - - public SerializableDelegate(TDelegate @delegate) - { - Delegate = @delegate; - } - - internal SerializableDelegate(SerializationInfo info, StreamingContext context) - { - var delegateType = (Type) info.GetValue("delegateType", typeof (Type)); - - if (info.GetBoolean("isSerializable")) - //If it's a "simple" delegate we just read it straight off - Delegate = (TDelegate) info.GetValue("delegate", delegateType); - else { - //otherwise, we need to read its anonymous class - var methodInfo = (MethodInfo) info.GetValue("method", typeof (MethodInfo)); - var anonymousClassWrapper = (AnonymousClassWrapper) info.GetValue("class", typeof (AnonymousClassWrapper)); - Delegate = (TDelegate)(object)System.Delegate.CreateDelegate(delegateType, anonymousClassWrapper.TargetInstance, methodInfo); - } - } - - void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue("delegateType", Delegate.GetType()); - var untypedDelegate = (Delegate) (object) Delegate; - //If it's an "simple" delegate we can serialize it directly - if ((untypedDelegate.Target == null || untypedDelegate.Method.DeclaringType.GetCustomAttributes(typeof(SerializableAttribute), false).Length > 0) && Delegate != null) - { - info.AddValue("isSerializable", true); - info.AddValue("delegate", Delegate); - } - else { - //otherwise, serialize anonymous class - info.AddValue("isSerializable", false); - info.AddValue("method", untypedDelegate.Method); - info.AddValue("class", new AnonymousClassWrapper(untypedDelegate.Method.DeclaringType, untypedDelegate.Target)); - } - } - - [Serializable] - private class AnonymousClassWrapper : ISerializable - { - public object TargetInstance { get; private set; } - private readonly Type targetType; - - internal AnonymousClassWrapper(Type targetType, object targetInstance) - { - this.targetType = targetType; - TargetInstance = targetInstance; - } - - internal AnonymousClassWrapper(SerializationInfo info, StreamingContext context) - { - var classType = (Type) info.GetValue("classType", typeof (Type)); - TargetInstance = Activator.CreateInstance(classType); - - foreach (FieldInfo field in classType.GetFields()) { - if (typeof (TDelegate).IsAssignableFrom(field.FieldType)) - //If the field is a delegate - field.SetValue(TargetInstance, ((SerializableDelegate)info.GetValue(field.Name, typeof(SerializableDelegate))).Delegate); - else if (!field.FieldType.IsSerializable) - //If the field is an anonymous class - field.SetValue(TargetInstance, ((AnonymousClassWrapper) info.GetValue(field.Name, typeof (AnonymousClassWrapper))).TargetInstance); - else - //otherwise - field.SetValue(TargetInstance, info.GetValue(field.Name, field.FieldType)); - } - } - - void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue("classType", targetType); - - foreach (FieldInfo field in targetType.GetFields()) { - //See corresponding comments above - if (typeof (TDelegate).IsAssignableFrom(field.FieldType)) { - var value = (TDelegate)field.GetValue(TargetInstance); - if (value != null) { - info.AddValue(field.Name, new SerializableDelegate(value)); - } - } - else if (!field.FieldType.IsSerializable) - info.AddValue(field.Name, new AnonymousClassWrapper(field.FieldType, field.GetValue(TargetInstance))); - else - info.AddValue(field.Name, field.GetValue(TargetInstance)); - } - } - } - } +using System; +using System.Reflection; +using System.Runtime.Serialization; + +namespace Orchard.Specs.Hosting { + /// + /// Makes delegates serializable where possible + /// Adapted from http://www.codeproject.com/KB/cs/AnonymousSerialization.aspx + /// + [Serializable] + public class SerializableDelegate : ISerializable where TDelegate : class + { + public TDelegate Delegate { get; private set; } + + public SerializableDelegate(TDelegate @delegate) + { + Delegate = @delegate; + } + + internal SerializableDelegate(SerializationInfo info, StreamingContext context) + { + var delegateType = (Type) info.GetValue("delegateType", typeof (Type)); + + if (info.GetBoolean("isSerializable")) + //If it's a "simple" delegate we just read it straight off + Delegate = (TDelegate) info.GetValue("delegate", delegateType); + else { + //otherwise, we need to read its anonymous class + var methodInfo = (MethodInfo) info.GetValue("method", typeof (MethodInfo)); + var anonymousClassWrapper = (AnonymousClassWrapper) info.GetValue("class", typeof (AnonymousClassWrapper)); + Delegate = (TDelegate)(object)System.Delegate.CreateDelegate(delegateType, anonymousClassWrapper.TargetInstance, methodInfo); + } + } + + void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) + { + info.AddValue("delegateType", Delegate.GetType()); + var untypedDelegate = (Delegate) (object) Delegate; + //If it's an "simple" delegate we can serialize it directly + if ((untypedDelegate.Target == null || untypedDelegate.Method.DeclaringType.GetCustomAttributes(typeof(SerializableAttribute), false).Length > 0) && Delegate != null) + { + info.AddValue("isSerializable", true); + info.AddValue("delegate", Delegate); + } + else { + //otherwise, serialize anonymous class + info.AddValue("isSerializable", false); + info.AddValue("method", untypedDelegate.Method); + info.AddValue("class", new AnonymousClassWrapper(untypedDelegate.Method.DeclaringType, untypedDelegate.Target)); + } + } + + [Serializable] + private class AnonymousClassWrapper : ISerializable + { + public object TargetInstance { get; private set; } + private readonly Type targetType; + + internal AnonymousClassWrapper(Type targetType, object targetInstance) + { + this.targetType = targetType; + TargetInstance = targetInstance; + } + + internal AnonymousClassWrapper(SerializationInfo info, StreamingContext context) + { + var classType = (Type) info.GetValue("classType", typeof (Type)); + TargetInstance = Activator.CreateInstance(classType); + + foreach (FieldInfo field in classType.GetFields()) { + if (typeof (TDelegate).IsAssignableFrom(field.FieldType)) + //If the field is a delegate + field.SetValue(TargetInstance, ((SerializableDelegate)info.GetValue(field.Name, typeof(SerializableDelegate))).Delegate); + else if (!field.FieldType.IsSerializable) + //If the field is an anonymous class + field.SetValue(TargetInstance, ((AnonymousClassWrapper) info.GetValue(field.Name, typeof (AnonymousClassWrapper))).TargetInstance); + else + //otherwise + field.SetValue(TargetInstance, info.GetValue(field.Name, field.FieldType)); + } + } + + void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) + { + info.AddValue("classType", targetType); + + foreach (FieldInfo field in targetType.GetFields()) { + //See corresponding comments above + if (typeof (TDelegate).IsAssignableFrom(field.FieldType)) { + var value = (TDelegate)field.GetValue(TargetInstance); + if (value != null) { + info.AddValue(field.Name, new SerializableDelegate(value)); + } + } + else if (!field.FieldType.IsSerializable) + info.AddValue(field.Name, new AnonymousClassWrapper(field.FieldType, field.GetValue(TargetInstance))); + else + info.AddValue(field.Name, field.GetValue(TargetInstance)); + } + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Specs/Hosting/Simple.Web/Global.asax.cs b/src/Orchard.Specs/Hosting/Simple.Web/Global.asax.cs index 81aa9073290..3617c43bc37 100644 --- a/src/Orchard.Specs/Hosting/Simple.Web/Global.asax.cs +++ b/src/Orchard.Specs/Hosting/Simple.Web/Global.asax.cs @@ -1,18 +1,18 @@ -using System.Web; -using System.Web.Mvc; -using System.Web.Routing; -using Orchard.Specs.Hosting.Orchard.Web; - -namespace Orchard.Specs.Hosting.Simple.Web { - public class MvcApplication : HttpApplication - { - protected void Application_Start() - { - - var route = RouteTable.Routes.MapRoute("foo", "hello-world", new { controller = "Home", action = "Index" }); - route.RouteHandler = new HelloYetAgainHandler(); - - } - - } +using System.Web; +using System.Web.Mvc; +using System.Web.Routing; +using Orchard.Specs.Hosting.Orchard.Web; + +namespace Orchard.Specs.Hosting.Simple.Web { + public class MvcApplication : HttpApplication + { + protected void Application_Start() + { + + var route = RouteTable.Routes.MapRoute("foo", "hello-world", new { controller = "Home", action = "Index" }); + route.RouteHandler = new HelloYetAgainHandler(); + + } + + } } \ No newline at end of file diff --git a/src/Orchard.Specs/Hosting/Simple.Web/HelloYetAgainHandler.cs b/src/Orchard.Specs/Hosting/Simple.Web/HelloYetAgainHandler.cs index 9c08e154c2f..cdcd8b5ede4 100644 --- a/src/Orchard.Specs/Hosting/Simple.Web/HelloYetAgainHandler.cs +++ b/src/Orchard.Specs/Hosting/Simple.Web/HelloYetAgainHandler.cs @@ -1,20 +1,20 @@ -using System.Web; -using System.Web.Routing; - -namespace Orchard.Specs.Hosting.Orchard.Web -{ - public class HelloYetAgainHandler : IRouteHandler, IHttpHandler - { - public IHttpHandler GetHttpHandler(RequestContext requestContext) - { - return this; - } - - public void ProcessRequest(HttpContext context) - { - context.Response.Write("Hello yet again"); - } - - public bool IsReusable { get { return false; } } - } +using System.Web; +using System.Web.Routing; + +namespace Orchard.Specs.Hosting.Orchard.Web +{ + public class HelloYetAgainHandler : IRouteHandler, IHttpHandler + { + public IHttpHandler GetHttpHandler(RequestContext requestContext) + { + return this; + } + + public void ProcessRequest(HttpContext context) + { + context.Response.Write("Hello yet again"); + } + + public bool IsReusable { get { return false; } } + } } \ No newline at end of file diff --git a/src/Orchard.Specs/Hosting/Simple.Web/Simple/Cookie-Set.aspx b/src/Orchard.Specs/Hosting/Simple.Web/Simple/Cookie-Set.aspx index 8c447aef593..4577c69d23f 100644 --- a/src/Orchard.Specs/Hosting/Simple.Web/Simple/Cookie-Set.aspx +++ b/src/Orchard.Specs/Hosting/Simple.Web/Simple/Cookie-Set.aspx @@ -1,3 +1,3 @@ -<%@ Page %> - -<% Response.Cookies.Add(new HttpCookie("foo", "bar")); %> +<%@ Page %> + +<% Response.Cookies.Add(new HttpCookie("foo", "bar")); %> diff --git a/src/Orchard.Specs/Hosting/Simple.Web/Simple/Cookie-Show.aspx b/src/Orchard.Specs/Hosting/Simple.Web/Simple/Cookie-Show.aspx index 82c486b477b..cf95824621b 100644 --- a/src/Orchard.Specs/Hosting/Simple.Web/Simple/Cookie-Show.aspx +++ b/src/Orchard.Specs/Hosting/Simple.Web/Simple/Cookie-Show.aspx @@ -1,8 +1,8 @@ -<%@ Page %> - -
        - <% foreach(string name in Request.Cookies) {%> -
      • - <%=name %>:<%=Request.Cookies[name].Value %>
      • - <%}%> -
      +<%@ Page %> + +
        + <% foreach(string name in Request.Cookies) {%> +
      • + <%=name %>:<%=Request.Cookies[name].Value %>
      • + <%}%> +
      diff --git a/src/Orchard.Specs/Hosting/Simple.Web/Simple/Page.aspx b/src/Orchard.Specs/Hosting/Simple.Web/Simple/Page.aspx index e823f1d4afb..a644d284c83 100644 --- a/src/Orchard.Specs/Hosting/Simple.Web/Simple/Page.aspx +++ b/src/Orchard.Specs/Hosting/Simple.Web/Simple/Page.aspx @@ -1,17 +1,17 @@ -<%@ Page %> - -

      - Hello again

      -

      - RawUrl: - <%=Page.Request.RawUrl%>

      -

      - Moving along to next page

      -

      -

      " method="post"> - - - - -
      -

      +<%@ Page %> + +

      + Hello again

      +

      + RawUrl: + <%=Page.Request.RawUrl%>

      +

      + Moving along to next page

      +

      +

      " method="post"> + + + + +
      +

      diff --git a/src/Orchard.Specs/Hosting/Simple.Web/Simple/Redir.aspx b/src/Orchard.Specs/Hosting/Simple.Web/Simple/Redir.aspx index f88a1b3ff29..a14fb861948 100644 --- a/src/Orchard.Specs/Hosting/Simple.Web/Simple/Redir.aspx +++ b/src/Orchard.Specs/Hosting/Simple.Web/Simple/Redir.aspx @@ -1,5 +1,5 @@ -<%@ Page %> - -<% - Response.Redirect("Page.aspx"); %> +<%@ Page %> + +<% + Response.Redirect("Page.aspx"); %> \ No newline at end of file diff --git a/src/Orchard.Specs/Hosting/Simple.Web/Simple/Results.aspx b/src/Orchard.Specs/Hosting/Simple.Web/Simple/Results.aspx index 1eef63ee170..bfacb5cb8c9 100644 --- a/src/Orchard.Specs/Hosting/Simple.Web/Simple/Results.aspx +++ b/src/Orchard.Specs/Hosting/Simple.Web/Simple/Results.aspx @@ -1,7 +1,7 @@ -<%@ Page %> - -
        -
      • passthrough1:<%=Server.HtmlEncode(Request.Form.Get("passthrough1")) %>
      • -
      • passthrough2:<%=Server.HtmlEncode(Request.Form.Get("passthrough2")) %>
      • -
      • input1:<%=Server.HtmlEncode(Request.Form.Get("input1")) %>
      • -
      +<%@ Page %> + +
        +
      • passthrough1:<%=Server.HtmlEncode(Request.Form.Get("passthrough1")) %>
      • +
      • passthrough2:<%=Server.HtmlEncode(Request.Form.Get("passthrough2")) %>
      • +
      • input1:<%=Server.HtmlEncode(Request.Form.Get("input1")) %>
      • +
      diff --git a/src/Orchard.Specs/Hosting/Simple.Web/Web.config b/src/Orchard.Specs/Hosting/Simple.Web/Web.config index d355cd06d63..e6ca00a772f 100644 --- a/src/Orchard.Specs/Hosting/Simple.Web/Web.config +++ b/src/Orchard.Specs/Hosting/Simple.Web/Web.config @@ -1,220 +1,220 @@ - - - - - - - -
      - -
      -
      -
      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + +
      + +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Specs/Hosting/TemplateConfigs/DisableDynamicCompilation.HostComponents.config b/src/Orchard.Specs/Hosting/TemplateConfigs/DisableDynamicCompilation.HostComponents.config index 091842834de..0df9c3cc645 100644 --- a/src/Orchard.Specs/Hosting/TemplateConfigs/DisableDynamicCompilation.HostComponents.config +++ b/src/Orchard.Specs/Hosting/TemplateConfigs/DisableDynamicCompilation.HostComponents.config @@ -1,101 +1,101 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Specs/Hosting/TemplateConfigs/ForceDynamicCompilation.HostComponents.config b/src/Orchard.Specs/Hosting/TemplateConfigs/ForceDynamicCompilation.HostComponents.config index 353d23a0cac..3b18e16bb70 100644 --- a/src/Orchard.Specs/Hosting/TemplateConfigs/ForceDynamicCompilation.HostComponents.config +++ b/src/Orchard.Specs/Hosting/TemplateConfigs/ForceDynamicCompilation.HostComponents.config @@ -1,107 +1,107 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Specs/Hosting/TraceEnabledDataServicesProviderFactory.cs b/src/Orchard.Specs/Hosting/TraceEnabledDataServicesProviderFactory.cs index 37819ffd713..8e79f2b7a51 100644 --- a/src/Orchard.Specs/Hosting/TraceEnabledDataServicesProviderFactory.cs +++ b/src/Orchard.Specs/Hosting/TraceEnabledDataServicesProviderFactory.cs @@ -1,21 +1,21 @@ -using FluentNHibernate.Cfg.Db; -using Orchard.Data.Providers; -using MsSqlCeConfiguration = Orchard.Data.Providers.MsSqlCeConfiguration; - -namespace Orchard.Specs.Hosting { - public class TraceEnabledDataServicesProviderFactory : IDataServicesProviderFactory { - public IDataServicesProvider CreateProvider(DataServiceParameters sessionFactoryParameters) { - return new TraceEnabledBuilder(sessionFactoryParameters.DataFolder, sessionFactoryParameters.ConnectionString); - } - - class TraceEnabledBuilder : SqlCeDataServicesProvider { - public TraceEnabledBuilder(string dataFolder, string connectionString) : base(dataFolder, connectionString) { - } - public override IPersistenceConfigurer GetPersistenceConfigurer(bool createDatabase) { - var config = (MsSqlCeConfiguration)base.GetPersistenceConfigurer(createDatabase); - config.ShowSql(); - return config; - } - } - } +using FluentNHibernate.Cfg.Db; +using Orchard.Data.Providers; +using MsSqlCeConfiguration = Orchard.Data.Providers.MsSqlCeConfiguration; + +namespace Orchard.Specs.Hosting { + public class TraceEnabledDataServicesProviderFactory : IDataServicesProviderFactory { + public IDataServicesProvider CreateProvider(DataServiceParameters sessionFactoryParameters) { + return new TraceEnabledBuilder(sessionFactoryParameters.DataFolder, sessionFactoryParameters.ConnectionString); + } + + class TraceEnabledBuilder : SqlCeDataServicesProvider { + public TraceEnabledBuilder(string dataFolder, string connectionString) : base(dataFolder, connectionString) { + } + public override IPersistenceConfigurer GetPersistenceConfigurer(bool createDatabase) { + var config = (MsSqlCeConfiguration)base.GetPersistenceConfigurer(createDatabase); + config.ShowSql(); + return config; + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Specs/Hosting/WebHost.cs b/src/Orchard.Specs/Hosting/WebHost.cs index fb86c392dc5..be8eeb35409 100644 --- a/src/Orchard.Specs/Hosting/WebHost.cs +++ b/src/Orchard.Specs/Hosting/WebHost.cs @@ -1,302 +1,302 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Threading; -using System.Web; -using System.Web.Hosting; -using Orchard.Specs.Util; -using Path = Bleroy.FluentPath.Path; - -namespace Orchard.Specs.Hosting { - public class WebHost { - private readonly Path _orchardTemp; - private WebHostAgent _webHostAgent; - private Path _tempSite; - private Path _orchardWebPath; - private Path _codeGenDir; - private IEnumerable _knownModules; - private IEnumerable _knownThemes; - private IEnumerable _knownBinAssemblies; - - public WebHost(Path orchardTemp) { - _orchardTemp = orchardTemp; - } - - public void Initialize(string templateName, string virtualDirectory, DynamicCompilationOption dynamicCompilationOption) { - var stopwatch = new Stopwatch(); - stopwatch.Start(); - - var baseDir = Path.Get(AppDomain.CurrentDomain.BaseDirectory); - - _tempSite = _orchardTemp.Combine(System.IO.Path.GetRandomFileName()); - try { _tempSite.Delete(); } - catch { } - - // Trying the two known relative paths to the Orchard.Web directory. - // The second one is for the target "spec" in orchard.proj. - - _orchardWebPath = baseDir; - - while (!_orchardWebPath.Combine("Orchard.proj").Exists && _orchardWebPath.Parent != null) { - _orchardWebPath = _orchardWebPath.Parent; - } - - _orchardWebPath = _orchardWebPath.Combine("src").Combine("Orchard.Web"); - - Log("Initialization of ASP.NET host for template web site \"{0}\":", templateName); - Log(" Source location: \"{0}\"", _orchardWebPath); - Log(" Temporary location: \"{0}\"", _tempSite); - - _knownModules = _orchardWebPath.Combine("Modules").Directories.Where(d => d.Combine("module.txt").Exists).Select(d => d.FileName).ToList(); - //foreach (var filename in _knownModules) - // Log("Available Module: \"{0}\"", filename); - - _knownThemes = _orchardWebPath.Combine("Themes").Directories.Where(d => d.Combine("theme.txt").Exists).Select(d => d.FileName).ToList(); - //foreach (var filename in _knownThemes) - // Log("Available Theme: \"{0}\"", filename); - - _knownBinAssemblies = _orchardWebPath.Combine("bin").GetFiles("*.dll").Select(f => f.FileNameWithoutExtension); - //foreach (var filename in _knownBinAssemblies) - // Log("Assembly in ~/bin: \"{0}\"", filename); - - Log("Copy files from template \"{0}\"", templateName); - baseDir.Combine("Hosting").Combine(templateName) - .DeepCopy(_tempSite); - - if (dynamicCompilationOption != DynamicCompilationOption.Enabled) { - var sourceConfig = baseDir.Combine("Hosting").Combine("TemplateConfigs"); - var siteConfig = _tempSite.Combine("Config"); - switch (dynamicCompilationOption) { - case DynamicCompilationOption.Disabled: - File.Copy(sourceConfig.Combine("DisableDynamicCompilation.HostComponents.config"), siteConfig.Combine("HostComponents.config")); - break; - case DynamicCompilationOption.Force: - File.Copy(sourceConfig.Combine("ForceDynamicCompilation.HostComponents.config"), siteConfig.Combine("HostComponents.config")); - break; - } - } - - Log("Copy binaries of the \"Orchard.Web\" project"); - _orchardWebPath.Combine("bin") - .ShallowCopy("*.dll", _tempSite.Combine("bin")) - .ShallowCopy("*.pdb", _tempSite.Combine("bin")); - - Log("Copy SqlCe native binaries"); - if (_orchardWebPath.Combine("bin").Combine("x86").IsDirectory) { - _orchardWebPath.Combine("bin").Combine("x86") - .DeepCopy("*.*", _tempSite.Combine("bin").Combine("x86")); - } - - if (_orchardWebPath.Combine("bin").Combine("amd64").IsDirectory) { - _orchardWebPath.Combine("bin").Combine("amd64") - .DeepCopy("*.*", _tempSite.Combine("bin").Combine("amd64")); - } - - // Copy binaries of this project, so that remote execution of lambda - // can be achieved through serialization to the ASP.NET appdomain - // (see Execute(Action) method) - Log("Copy Orchard.Specflow test project binaries"); - baseDir.ShallowCopy( - path => IsSpecFlowTestAssembly(path) && !_tempSite.Combine("bin").Combine(path.FileName).Exists, - _tempSite.Combine("bin")); - - Log("Copy Orchard recipes"); - _orchardWebPath.Combine("Modules").Combine("Orchard.Setup").Combine("Recipes").DeepCopy("*.xml", _tempSite.Combine("Modules").Combine("Orchard.Setup").Combine("Recipes")); - - StartAspNetHost(virtualDirectory); - - Log("ASP.NET host initialization completed in {0} sec", stopwatch.Elapsed.TotalSeconds); - } - - private void StartAspNetHost(string virtualDirectory) { - Log("Starting up ASP.NET host"); - HostName = "localhost"; - PhysicalDirectory = _tempSite; - VirtualDirectory = virtualDirectory; - - _webHostAgent = (WebHostAgent)ApplicationHost.CreateApplicationHost(typeof(WebHostAgent), VirtualDirectory, PhysicalDirectory); - - - var shuttle = new Shuttle(); - Execute(() => { shuttle.CodeGenDir = HttpRuntime.CodegenDir; }); - - // ASP.NET folder seems to be always nested into an empty directory - _codeGenDir = shuttle.CodeGenDir; - _codeGenDir = _codeGenDir.Parent; - Log("ASP.NET CodeGenDir: \"{0}\"", _codeGenDir); - } - - [Serializable] - public class Shuttle { - public string CodeGenDir; - } - - public void Dispose() { - if (_webHostAgent != null) { - _webHostAgent.Shutdown(); - _webHostAgent = null; - } - Clean(); - } - - private void Log(string format, params object[] args) { - Trace.WriteLine(string.Format(format, args)); - } - - public void Clean() { - // Try to delete temporary files for up to ~1.2 seconds. - for (int i = 0; i < 4; i++) { - Log("Waiting 300msec before trying to delete temporary files"); - Thread.Sleep(300); - - if (TryDeleteTempFiles(i == 4)) { - Log("Successfully deleted all temporary files"); - break; - } - } - } - - private bool TryDeleteTempFiles(bool lastTry) { - var result = true; - if (_codeGenDir != null && _codeGenDir.Exists) { - Log("Trying to delete temporary files at \"{0}\"", _codeGenDir); - try { - _codeGenDir.Delete(true); // <- clean as much as possible - } - catch (Exception e) { - if (lastTry) - Log("Failure: \"{0}\"", e); - result = false; - } - } - - if (_tempSite != null && _tempSite.Exists) - try { - Log("Trying to delete temporary files at \"{0}\"", _tempSite); - _tempSite.Delete(true); // <- progressively clean as much as possible - } - catch (Exception e) { - if (lastTry) - Log("failure: \"{0}\"", e); - result = false; - } - - return result; - } - - public void CopyExtension(string extensionFolder, string extensionName, ExtensionDeploymentOptions deploymentOptions) { - Log("Copy extension \"{0}\\{1}\" (options={2})", extensionFolder, extensionName, deploymentOptions); - var sourceModule = _orchardWebPath.Combine(extensionFolder).Combine(extensionName); - var targetModule = _tempSite.Combine(extensionFolder).Combine(extensionName); - - sourceModule.ShallowCopy("*.txt", targetModule); - sourceModule.ShallowCopy("*.info", targetModule); - sourceModule.ShallowCopy("*.config", targetModule); - - if ((deploymentOptions & ExtensionDeploymentOptions.SourceCode) == ExtensionDeploymentOptions.SourceCode) { - sourceModule.ShallowCopy("*.csproj", targetModule); - sourceModule.DeepCopy("*.cs", targetModule); - } - - if (sourceModule.Combine("bin").IsDirectory) { - sourceModule.Combine("bin").ShallowCopy(path => IsExtensionBinaryFile(path, extensionName, deploymentOptions), targetModule.Combine("bin")); - } - - if (sourceModule.Combine("Views").IsDirectory) - sourceModule.Combine("Views").DeepCopy(targetModule.Combine("Views")); - - // don't copy content folders as they are useless in this headless scenario - } - - public void CopyFile(string source, string destination) { - - StackTrace st = new StackTrace(true); - Path origin = null; - foreach(var sf in st.GetFrames()) { - var sourceFile = sf.GetFileName(); - if(String.IsNullOrEmpty(sourceFile)) { - continue; - } - - var testOrigin = Path.Get(sourceFile).Parent.Combine(source); - if(testOrigin.Exists) { - origin = testOrigin; - break; - } - } - - if(origin == null) { - throw new FileNotFoundException("File not found: " + source); - } - - var target = _tempSite.Combine(destination); - - Directory.CreateDirectory(target.DirectoryName); - File.Copy(origin, target); - } - - private bool IsExtensionBinaryFile(Path path, string extensionName, ExtensionDeploymentOptions deploymentOptions) { - bool isValidExtension = IsAssemblyFile(path); - if (!isValidExtension) - return false; - - bool isAssemblyInWebAppBin = _knownBinAssemblies.Contains(path.FileNameWithoutExtension, StringComparer.OrdinalIgnoreCase); - if (isAssemblyInWebAppBin) - return false; - - bool isExtensionAssembly = IsOrchardExtensionFile(path); - bool copyExtensionAssembly = (deploymentOptions & ExtensionDeploymentOptions.CompiledAssembly) == ExtensionDeploymentOptions.CompiledAssembly; - if (isExtensionAssembly && !copyExtensionAssembly) - return false; - - return true; - } - - private bool IsSpecFlowTestAssembly(Path path) { - if (!IsAssemblyFile(path)) - return false; - - if (IsOrchardExtensionFile(path)) - return false; - - return true; - } - - private bool IsAssemblyFile(Path path) { - return StringComparer.OrdinalIgnoreCase.Equals(path.Extension, ".exe") || - StringComparer.OrdinalIgnoreCase.Equals(path.Extension, ".dll") || - StringComparer.OrdinalIgnoreCase.Equals(path.Extension, ".pdb"); - } - - private bool IsOrchardExtensionFile(Path path) { - return _knownModules.Where(name => StringComparer.OrdinalIgnoreCase.Equals(name, path.FileNameWithoutExtension)).Any() || - _knownThemes.Where(name => StringComparer.OrdinalIgnoreCase.Equals(name, path.FileNameWithoutExtension)).Any(); - } - - public string HostName { get; set; } - public string PhysicalDirectory { get; private set; } - public string VirtualDirectory { get; private set; } - - public string Cookies { get; set; } - - - public void Execute(Action action) { - var shuttleSend = new SerializableDelegate(action); - var shuttleRecv = _webHostAgent.Execute(shuttleSend); - CopyFields(shuttleRecv.Delegate.Target, shuttleSend.Delegate.Target); - } - - private static void CopyFields(T from, T to) where T : class { - if (from == null || to == null) - return; - foreach (FieldInfo fieldInfo in from.GetType().GetFields()) { - var value = fieldInfo.GetValue(from); - fieldInfo.SetValue(to, value); - } - } - } +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Threading; +using System.Web; +using System.Web.Hosting; +using Orchard.Specs.Util; +using Path = Bleroy.FluentPath.Path; + +namespace Orchard.Specs.Hosting { + public class WebHost { + private readonly Path _orchardTemp; + private WebHostAgent _webHostAgent; + private Path _tempSite; + private Path _orchardWebPath; + private Path _codeGenDir; + private IEnumerable _knownModules; + private IEnumerable _knownThemes; + private IEnumerable _knownBinAssemblies; + + public WebHost(Path orchardTemp) { + _orchardTemp = orchardTemp; + } + + public void Initialize(string templateName, string virtualDirectory, DynamicCompilationOption dynamicCompilationOption) { + var stopwatch = new Stopwatch(); + stopwatch.Start(); + + var baseDir = Path.Get(AppDomain.CurrentDomain.BaseDirectory); + + _tempSite = _orchardTemp.Combine(System.IO.Path.GetRandomFileName()); + try { _tempSite.Delete(); } + catch { } + + // Trying the two known relative paths to the Orchard.Web directory. + // The second one is for the target "spec" in orchard.proj. + + _orchardWebPath = baseDir; + + while (!_orchardWebPath.Combine("Orchard.proj").Exists && _orchardWebPath.Parent != null) { + _orchardWebPath = _orchardWebPath.Parent; + } + + _orchardWebPath = _orchardWebPath.Combine("src").Combine("Orchard.Web"); + + Log("Initialization of ASP.NET host for template web site \"{0}\":", templateName); + Log(" Source location: \"{0}\"", _orchardWebPath); + Log(" Temporary location: \"{0}\"", _tempSite); + + _knownModules = _orchardWebPath.Combine("Modules").Directories.Where(d => d.Combine("module.txt").Exists).Select(d => d.FileName).ToList(); + //foreach (var filename in _knownModules) + // Log("Available Module: \"{0}\"", filename); + + _knownThemes = _orchardWebPath.Combine("Themes").Directories.Where(d => d.Combine("theme.txt").Exists).Select(d => d.FileName).ToList(); + //foreach (var filename in _knownThemes) + // Log("Available Theme: \"{0}\"", filename); + + _knownBinAssemblies = _orchardWebPath.Combine("bin").GetFiles("*.dll").Select(f => f.FileNameWithoutExtension); + //foreach (var filename in _knownBinAssemblies) + // Log("Assembly in ~/bin: \"{0}\"", filename); + + Log("Copy files from template \"{0}\"", templateName); + baseDir.Combine("Hosting").Combine(templateName) + .DeepCopy(_tempSite); + + if (dynamicCompilationOption != DynamicCompilationOption.Enabled) { + var sourceConfig = baseDir.Combine("Hosting").Combine("TemplateConfigs"); + var siteConfig = _tempSite.Combine("Config"); + switch (dynamicCompilationOption) { + case DynamicCompilationOption.Disabled: + File.Copy(sourceConfig.Combine("DisableDynamicCompilation.HostComponents.config"), siteConfig.Combine("HostComponents.config")); + break; + case DynamicCompilationOption.Force: + File.Copy(sourceConfig.Combine("ForceDynamicCompilation.HostComponents.config"), siteConfig.Combine("HostComponents.config")); + break; + } + } + + Log("Copy binaries of the \"Orchard.Web\" project"); + _orchardWebPath.Combine("bin") + .ShallowCopy("*.dll", _tempSite.Combine("bin")) + .ShallowCopy("*.pdb", _tempSite.Combine("bin")); + + Log("Copy SqlCe native binaries"); + if (_orchardWebPath.Combine("bin").Combine("x86").IsDirectory) { + _orchardWebPath.Combine("bin").Combine("x86") + .DeepCopy("*.*", _tempSite.Combine("bin").Combine("x86")); + } + + if (_orchardWebPath.Combine("bin").Combine("amd64").IsDirectory) { + _orchardWebPath.Combine("bin").Combine("amd64") + .DeepCopy("*.*", _tempSite.Combine("bin").Combine("amd64")); + } + + // Copy binaries of this project, so that remote execution of lambda + // can be achieved through serialization to the ASP.NET appdomain + // (see Execute(Action) method) + Log("Copy Orchard.Specflow test project binaries"); + baseDir.ShallowCopy( + path => IsSpecFlowTestAssembly(path) && !_tempSite.Combine("bin").Combine(path.FileName).Exists, + _tempSite.Combine("bin")); + + Log("Copy Orchard recipes"); + _orchardWebPath.Combine("Modules").Combine("Orchard.Setup").Combine("Recipes").DeepCopy("*.xml", _tempSite.Combine("Modules").Combine("Orchard.Setup").Combine("Recipes")); + + StartAspNetHost(virtualDirectory); + + Log("ASP.NET host initialization completed in {0} sec", stopwatch.Elapsed.TotalSeconds); + } + + private void StartAspNetHost(string virtualDirectory) { + Log("Starting up ASP.NET host"); + HostName = "localhost"; + PhysicalDirectory = _tempSite; + VirtualDirectory = virtualDirectory; + + _webHostAgent = (WebHostAgent)ApplicationHost.CreateApplicationHost(typeof(WebHostAgent), VirtualDirectory, PhysicalDirectory); + + + var shuttle = new Shuttle(); + Execute(() => { shuttle.CodeGenDir = HttpRuntime.CodegenDir; }); + + // ASP.NET folder seems to be always nested into an empty directory + _codeGenDir = shuttle.CodeGenDir; + _codeGenDir = _codeGenDir.Parent; + Log("ASP.NET CodeGenDir: \"{0}\"", _codeGenDir); + } + + [Serializable] + public class Shuttle { + public string CodeGenDir; + } + + public void Dispose() { + if (_webHostAgent != null) { + _webHostAgent.Shutdown(); + _webHostAgent = null; + } + Clean(); + } + + private void Log(string format, params object[] args) { + Trace.WriteLine(string.Format(format, args)); + } + + public void Clean() { + // Try to delete temporary files for up to ~1.2 seconds. + for (int i = 0; i < 4; i++) { + Log("Waiting 300msec before trying to delete temporary files"); + Thread.Sleep(300); + + if (TryDeleteTempFiles(i == 4)) { + Log("Successfully deleted all temporary files"); + break; + } + } + } + + private bool TryDeleteTempFiles(bool lastTry) { + var result = true; + if (_codeGenDir != null && _codeGenDir.Exists) { + Log("Trying to delete temporary files at \"{0}\"", _codeGenDir); + try { + _codeGenDir.Delete(true); // <- clean as much as possible + } + catch (Exception e) { + if (lastTry) + Log("Failure: \"{0}\"", e); + result = false; + } + } + + if (_tempSite != null && _tempSite.Exists) + try { + Log("Trying to delete temporary files at \"{0}\"", _tempSite); + _tempSite.Delete(true); // <- progressively clean as much as possible + } + catch (Exception e) { + if (lastTry) + Log("failure: \"{0}\"", e); + result = false; + } + + return result; + } + + public void CopyExtension(string extensionFolder, string extensionName, ExtensionDeploymentOptions deploymentOptions) { + Log("Copy extension \"{0}\\{1}\" (options={2})", extensionFolder, extensionName, deploymentOptions); + var sourceModule = _orchardWebPath.Combine(extensionFolder).Combine(extensionName); + var targetModule = _tempSite.Combine(extensionFolder).Combine(extensionName); + + sourceModule.ShallowCopy("*.txt", targetModule); + sourceModule.ShallowCopy("*.info", targetModule); + sourceModule.ShallowCopy("*.config", targetModule); + + if ((deploymentOptions & ExtensionDeploymentOptions.SourceCode) == ExtensionDeploymentOptions.SourceCode) { + sourceModule.ShallowCopy("*.csproj", targetModule); + sourceModule.DeepCopy("*.cs", targetModule); + } + + if (sourceModule.Combine("bin").IsDirectory) { + sourceModule.Combine("bin").ShallowCopy(path => IsExtensionBinaryFile(path, extensionName, deploymentOptions), targetModule.Combine("bin")); + } + + if (sourceModule.Combine("Views").IsDirectory) + sourceModule.Combine("Views").DeepCopy(targetModule.Combine("Views")); + + // don't copy content folders as they are useless in this headless scenario + } + + public void CopyFile(string source, string destination) { + + StackTrace st = new StackTrace(true); + Path origin = null; + foreach(var sf in st.GetFrames()) { + var sourceFile = sf.GetFileName(); + if(String.IsNullOrEmpty(sourceFile)) { + continue; + } + + var testOrigin = Path.Get(sourceFile).Parent.Combine(source); + if(testOrigin.Exists) { + origin = testOrigin; + break; + } + } + + if(origin == null) { + throw new FileNotFoundException("File not found: " + source); + } + + var target = _tempSite.Combine(destination); + + Directory.CreateDirectory(target.DirectoryName); + File.Copy(origin, target); + } + + private bool IsExtensionBinaryFile(Path path, string extensionName, ExtensionDeploymentOptions deploymentOptions) { + bool isValidExtension = IsAssemblyFile(path); + if (!isValidExtension) + return false; + + bool isAssemblyInWebAppBin = _knownBinAssemblies.Contains(path.FileNameWithoutExtension, StringComparer.OrdinalIgnoreCase); + if (isAssemblyInWebAppBin) + return false; + + bool isExtensionAssembly = IsOrchardExtensionFile(path); + bool copyExtensionAssembly = (deploymentOptions & ExtensionDeploymentOptions.CompiledAssembly) == ExtensionDeploymentOptions.CompiledAssembly; + if (isExtensionAssembly && !copyExtensionAssembly) + return false; + + return true; + } + + private bool IsSpecFlowTestAssembly(Path path) { + if (!IsAssemblyFile(path)) + return false; + + if (IsOrchardExtensionFile(path)) + return false; + + return true; + } + + private bool IsAssemblyFile(Path path) { + return StringComparer.OrdinalIgnoreCase.Equals(path.Extension, ".exe") || + StringComparer.OrdinalIgnoreCase.Equals(path.Extension, ".dll") || + StringComparer.OrdinalIgnoreCase.Equals(path.Extension, ".pdb"); + } + + private bool IsOrchardExtensionFile(Path path) { + return _knownModules.Where(name => StringComparer.OrdinalIgnoreCase.Equals(name, path.FileNameWithoutExtension)).Any() || + _knownThemes.Where(name => StringComparer.OrdinalIgnoreCase.Equals(name, path.FileNameWithoutExtension)).Any(); + } + + public string HostName { get; set; } + public string PhysicalDirectory { get; private set; } + public string VirtualDirectory { get; private set; } + + public string Cookies { get; set; } + + + public void Execute(Action action) { + var shuttleSend = new SerializableDelegate(action); + var shuttleRecv = _webHostAgent.Execute(shuttleSend); + CopyFields(shuttleRecv.Delegate.Target, shuttleSend.Delegate.Target); + } + + private static void CopyFields(T from, T to) where T : class { + if (from == null || to == null) + return; + foreach (FieldInfo fieldInfo in from.GetType().GetFields()) { + var value = fieldInfo.GetValue(from); + fieldInfo.SetValue(to, value); + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Specs/Hosting/WebHostAgent.cs b/src/Orchard.Specs/Hosting/WebHostAgent.cs index 229eeb90a6f..e9e854ba6af 100644 --- a/src/Orchard.Specs/Hosting/WebHostAgent.cs +++ b/src/Orchard.Specs/Hosting/WebHostAgent.cs @@ -1,15 +1,15 @@ -using System; -using System.Web.Hosting; - -namespace Orchard.Specs.Hosting { - public class WebHostAgent : MarshalByRefObject { - public SerializableDelegate Execute(SerializableDelegate shuttle) { - shuttle.Delegate(); - return shuttle; - } - - public void Shutdown() { - HostingEnvironment.InitiateShutdown(); - } - } +using System; +using System.Web.Hosting; + +namespace Orchard.Specs.Hosting { + public class WebHostAgent : MarshalByRefObject { + public SerializableDelegate Execute(SerializableDelegate shuttle) { + shuttle.Delegate(); + return shuttle; + } + + public void Shutdown() { + HostingEnvironment.InitiateShutdown(); + } + } } \ No newline at end of file diff --git a/src/Orchard.Specs/Lists.feature b/src/Orchard.Specs/Lists.feature index 5074e822c08..54da2f37af2 100644 --- a/src/Orchard.Specs/Lists.feature +++ b/src/Orchard.Specs/Lists.feature @@ -1,35 +1,35 @@ -Feature: Lists - In order to add new lists to my site - As an administrator - I want to create lists - -Scenario: I can create a new list - Given I have installed Orchard - And I have installed "Orchard.Lists" - When I go to "Admin/ContentTypes" - And I go to "Admin/ContentTypes/Create" - And I fill in - | name | value | - | DisplayName | Event | - | Name | Event | - And I hit "Create" - And I am redirected - And I fill in - | name | value | - | PartSelections[5].IsSelected | True | - And I hit "Save" - And I go to "Admin/ContentTypes/" - Then I should see "Event" - - When I go to "Admin/Contents/Create/List" - And I fill in - | name | value | - | Title.Title | MyList | - | Container.SelectedItemContentTypes | Event | - And I hit "Save" - And I am redirected - Then I should see "Your List has been created" - When I go to "Admin/Lists" - Then I should see "MyList" - When I follow "Contained Items (0)" - Then I should see "'MyList' has no content items" +Feature: Lists + In order to add new lists to my site + As an administrator + I want to create lists + +Scenario: I can create a new list + Given I have installed Orchard + And I have installed "Orchard.Lists" + When I go to "Admin/ContentTypes" + And I go to "Admin/ContentTypes/Create" + And I fill in + | name | value | + | DisplayName | Event | + | Name | Event | + And I hit "Create" + And I am redirected + And I fill in + | name | value | + | PartSelections[5].IsSelected | True | + And I hit "Save" + And I go to "Admin/ContentTypes/" + Then I should see "Event" + + When I go to "Admin/Contents/Create/List" + And I fill in + | name | value | + | Title.Title | MyList | + | Container.SelectedItemContentTypes | Event | + And I hit "Save" + And I am redirected + Then I should see "Your List has been created" + When I go to "Admin/Lists" + Then I should see "MyList" + When I follow "Contained Items (0)" + Then I should see "'MyList' has no content items" diff --git a/src/Orchard.Specs/Lists.feature.cs b/src/Orchard.Specs/Lists.feature.cs index a5bd6ef8b93..10bd693c9bb 100644 --- a/src/Orchard.Specs/Lists.feature.cs +++ b/src/Orchard.Specs/Lists.feature.cs @@ -1,148 +1,148 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by SpecFlow (http://www.specflow.org/). -// SpecFlow Version:1.9.0.77 -// SpecFlow Generator Version:1.9.0.0 -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ -#region Designer generated code -#pragma warning disable -namespace Orchard.Specs -{ - using TechTalk.SpecFlow; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [NUnit.Framework.TestFixtureAttribute()] - [NUnit.Framework.DescriptionAttribute("Lists")] - public partial class ListsFeature - { - - private static TechTalk.SpecFlow.ITestRunner testRunner; - -#line 1 "Lists.feature" -#line hidden - - [NUnit.Framework.TestFixtureSetUpAttribute()] - public virtual void FeatureSetup() - { - testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Lists", " In order to add new lists to my site\r\n As an administrator\r\n I want to create" + - " lists", ProgrammingLanguage.CSharp, ((string[])(null))); - testRunner.OnFeatureStart(featureInfo); - } - - [NUnit.Framework.TestFixtureTearDownAttribute()] - public virtual void FeatureTearDown() - { - testRunner.OnFeatureEnd(); - testRunner = null; - } - - [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() - { - } - - [NUnit.Framework.TearDownAttribute()] - public virtual void ScenarioTearDown() - { - testRunner.OnScenarioEnd(); - } - - public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) - { - testRunner.OnScenarioStart(scenarioInfo); - } - - public virtual void ScenarioCleanup() - { - testRunner.CollectScenarioErrors(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I can create a new list")] - public virtual void ICanCreateANewList() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create a new list", ((string[])(null))); -#line 6 -this.ScenarioSetup(scenarioInfo); -#line 7 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 8 - testRunner.And("I have installed \"Orchard.Lists\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 9 - testRunner.When("I go to \"Admin/ContentTypes\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 10 - testRunner.And("I go to \"Admin/ContentTypes/Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table1.AddRow(new string[] { - "DisplayName", - "Event"}); - table1.AddRow(new string[] { - "Name", - "Event"}); -#line 11 - testRunner.And("I fill in", ((string)(null)), table1, "And "); -#line 15 - testRunner.And("I hit \"Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 16 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table2.AddRow(new string[] { - "PartSelections[5].IsSelected", - "True"}); -#line 17 - testRunner.And("I fill in", ((string)(null)), table2, "And "); -#line 20 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 21 - testRunner.And("I go to \"Admin/ContentTypes/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 22 - testRunner.Then("I should see \"Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 24 - testRunner.When("I go to \"Admin/Contents/Create/List\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table3.AddRow(new string[] { - "Title.Title", - "MyList"}); - table3.AddRow(new string[] { - "Container.SelectedItemContentTypes", - "Event"}); -#line 25 - testRunner.And("I fill in", ((string)(null)), table3, "And "); -#line 29 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 30 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 31 - testRunner.Then("I should see \"Your List has been created\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 32 - testRunner.When("I go to \"Admin/Lists\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 33 - testRunner.Then("I should see \"MyList\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 34 - testRunner.When("I follow \"Contained Items (0)\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 35 - testRunner.Then("I should see \"\'MyList\' has no content items\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - } -} -#pragma warning restore -#endregion +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.9.0.77 +// SpecFlow Generator Version:1.9.0.0 +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +#pragma warning disable +namespace Orchard.Specs +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("Lists")] + public partial class ListsFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "Lists.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Lists", " In order to add new lists to my site\r\n As an administrator\r\n I want to create" + + " lists", ProgrammingLanguage.CSharp, ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + [NUnit.Framework.SetUpAttribute()] + public virtual void TestInitialize() + { + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + public virtual void ScenarioCleanup() + { + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I can create a new list")] + public virtual void ICanCreateANewList() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create a new list", ((string[])(null))); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 8 + testRunner.And("I have installed \"Orchard.Lists\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 9 + testRunner.When("I go to \"Admin/ContentTypes\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 10 + testRunner.And("I go to \"Admin/ContentTypes/Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table1.AddRow(new string[] { + "DisplayName", + "Event"}); + table1.AddRow(new string[] { + "Name", + "Event"}); +#line 11 + testRunner.And("I fill in", ((string)(null)), table1, "And "); +#line 15 + testRunner.And("I hit \"Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 16 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table2.AddRow(new string[] { + "PartSelections[5].IsSelected", + "True"}); +#line 17 + testRunner.And("I fill in", ((string)(null)), table2, "And "); +#line 20 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 21 + testRunner.And("I go to \"Admin/ContentTypes/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 22 + testRunner.Then("I should see \"Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 24 + testRunner.When("I go to \"Admin/Contents/Create/List\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table3.AddRow(new string[] { + "Title.Title", + "MyList"}); + table3.AddRow(new string[] { + "Container.SelectedItemContentTypes", + "Event"}); +#line 25 + testRunner.And("I fill in", ((string)(null)), table3, "And "); +#line 29 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 30 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 31 + testRunner.Then("I should see \"Your List has been created\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 32 + testRunner.When("I go to \"Admin/Lists\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 33 + testRunner.Then("I should see \"MyList\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 34 + testRunner.When("I follow \"Contained Items (0)\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 35 + testRunner.Then("I should see \"\'MyList\' has no content items\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + } +} +#pragma warning restore +#endregion diff --git a/src/Orchard.Specs/Media.feature b/src/Orchard.Specs/Media.feature index dd018ab394e..99b69c44f51 100644 --- a/src/Orchard.Specs/Media.feature +++ b/src/Orchard.Specs/Media.feature @@ -1,31 +1,31 @@ -Feature: Media management - In order to reference images and such from content - As an author - I want to upload and manage files in a media folder - -Scenario: Media admin is available - Given I have installed Orchard - And I have installed "Orchard.Media" - - # Accessing the media page - When I go to "admin/media" - Then I should see "Media" - And the status should be 200 "OK" - - # Creating a folder - When I go to "admin/media/create" - And I fill in - | name | value | - | Name | Hello World | - And I hit "Save" - And I am redirected - Then I should see "Media" - And I should see "Hello World" - And the status should be 200 "OK" - - # Editing a media with limited rights - When I go to "admin/media/edit?name=..\..\bin&mediaPath=..\..\bin" - And I am redirected - Then I should see "Media" - And I should see "Editing failed: Invalid path" - And the status should be 200 "OK" +Feature: Media management + In order to reference images and such from content + As an author + I want to upload and manage files in a media folder + +Scenario: Media admin is available + Given I have installed Orchard + And I have installed "Orchard.Media" + + # Accessing the media page + When I go to "admin/media" + Then I should see "Media" + And the status should be 200 "OK" + + # Creating a folder + When I go to "admin/media/create" + And I fill in + | name | value | + | Name | Hello World | + And I hit "Save" + And I am redirected + Then I should see "Media" + And I should see "Hello World" + And the status should be 200 "OK" + + # Editing a media with limited rights + When I go to "admin/media/edit?name=..\..\bin&mediaPath=..\..\bin" + And I am redirected + Then I should see "Media" + And I should see "Editing failed: Invalid path" + And the status should be 200 "OK" diff --git a/src/Orchard.Specs/Media.feature.cs b/src/Orchard.Specs/Media.feature.cs index a9da6dd428a..d8c9f9e5a39 100644 --- a/src/Orchard.Specs/Media.feature.cs +++ b/src/Orchard.Specs/Media.feature.cs @@ -1,122 +1,122 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by SpecFlow (http://www.specflow.org/). -// SpecFlow Version:1.9.0.77 -// SpecFlow Generator Version:1.9.0.0 -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ -#region Designer generated code -#pragma warning disable -namespace Orchard.Specs -{ - using TechTalk.SpecFlow; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [NUnit.Framework.TestFixtureAttribute()] - [NUnit.Framework.DescriptionAttribute("Media management")] - public partial class MediaManagementFeature - { - - private static TechTalk.SpecFlow.ITestRunner testRunner; - -#line 1 "Media.feature" -#line hidden - - [NUnit.Framework.TestFixtureSetUpAttribute()] - public virtual void FeatureSetup() - { - testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Media management", " In order to reference images and such from content\r\n As an author\r\n I want to" + - " upload and manage files in a media folder", ProgrammingLanguage.CSharp, ((string[])(null))); - testRunner.OnFeatureStart(featureInfo); - } - - [NUnit.Framework.TestFixtureTearDownAttribute()] - public virtual void FeatureTearDown() - { - testRunner.OnFeatureEnd(); - testRunner = null; - } - - [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() - { - } - - [NUnit.Framework.TearDownAttribute()] - public virtual void ScenarioTearDown() - { - testRunner.OnScenarioEnd(); - } - - public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) - { - testRunner.OnScenarioStart(scenarioInfo); - } - - public virtual void ScenarioCleanup() - { - testRunner.CollectScenarioErrors(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Media admin is available")] - public virtual void MediaAdminIsAvailable() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Media admin is available", ((string[])(null))); -#line 6 -this.ScenarioSetup(scenarioInfo); -#line 7 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 8 - testRunner.And("I have installed \"Orchard.Media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 11 - testRunner.When("I go to \"admin/media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 12 - testRunner.Then("I should see \"Media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 13 - testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 16 - testRunner.When("I go to \"admin/media/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table1.AddRow(new string[] { - "Name", - "Hello World"}); -#line 17 - testRunner.And("I fill in", ((string)(null)), table1, "And "); -#line 20 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 21 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 22 - testRunner.Then("I should see \"Media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 23 - testRunner.And("I should see \"Hello World\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 24 - testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 27 - testRunner.When("I go to \"admin/media/edit?name=..\\..\\bin&mediaPath=..\\..\\bin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 28 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 29 - testRunner.Then("I should see \"Media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 30 - testRunner.And("I should see \"Editing failed: Invalid path\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 31 - testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - } -} -#pragma warning restore -#endregion +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.9.0.77 +// SpecFlow Generator Version:1.9.0.0 +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +#pragma warning disable +namespace Orchard.Specs +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("Media management")] + public partial class MediaManagementFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "Media.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Media management", " In order to reference images and such from content\r\n As an author\r\n I want to" + + " upload and manage files in a media folder", ProgrammingLanguage.CSharp, ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + [NUnit.Framework.SetUpAttribute()] + public virtual void TestInitialize() + { + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + public virtual void ScenarioCleanup() + { + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Media admin is available")] + public virtual void MediaAdminIsAvailable() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Media admin is available", ((string[])(null))); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 8 + testRunner.And("I have installed \"Orchard.Media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 11 + testRunner.When("I go to \"admin/media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 12 + testRunner.Then("I should see \"Media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 13 + testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 16 + testRunner.When("I go to \"admin/media/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table1.AddRow(new string[] { + "Name", + "Hello World"}); +#line 17 + testRunner.And("I fill in", ((string)(null)), table1, "And "); +#line 20 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 21 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 22 + testRunner.Then("I should see \"Media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 23 + testRunner.And("I should see \"Hello World\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 24 + testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 27 + testRunner.When("I go to \"admin/media/edit?name=..\\..\\bin&mediaPath=..\\..\\bin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 28 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 29 + testRunner.Then("I should see \"Media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 30 + testRunner.And("I should see \"Editing failed: Invalid path\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 31 + testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + } +} +#pragma warning restore +#endregion diff --git a/src/Orchard.Specs/Modules.feature b/src/Orchard.Specs/Modules.feature index 1c094a2a875..df7f47de264 100644 --- a/src/Orchard.Specs/Modules.feature +++ b/src/Orchard.Specs/Modules.feature @@ -1,23 +1,23 @@ -Feature: Module management - In order add and enable features - As a root Orchard system operator - I want to install and enable modules and enable features - -Scenario: Installed modules are listed - Given I have installed Orchard - When I go to "admin/modules" - Then I should see "

      Modules

      " - When I fill in - | name | value | - | Options.SearchText | Themes | - And I hit "Search" - Then I should see "

      Modules

      " - And I should see "]*>\s*Themes" - And the status should be 200 "OK" - -Scenario: Features of installed modules are listed - Given I have installed Orchard - When I go to "admin/modules/features" - Then I should see "

      \s*Common\s*

      " - And I should see "
    3. ]*>" +Feature: Module management + In order add and enable features + As a root Orchard system operator + I want to install and enable modules and enable features + +Scenario: Installed modules are listed + Given I have installed Orchard + When I go to "admin/modules" + Then I should see "

      Modules

      " + When I fill in + | name | value | + | Options.SearchText | Themes | + And I hit "Search" + Then I should see "

      Modules

      " + And I should see "]*>\s*Themes" + And the status should be 200 "OK" + +Scenario: Features of installed modules are listed + Given I have installed Orchard + When I go to "admin/modules/features" + Then I should see "

      \s*Common\s*

      " + And I should see "
    4. ]*>" And the status should be 200 "OK" \ No newline at end of file diff --git a/src/Orchard.Specs/Modules.feature.cs b/src/Orchard.Specs/Modules.feature.cs index a774c8e8059..cd57ba75c09 100644 --- a/src/Orchard.Specs/Modules.feature.cs +++ b/src/Orchard.Specs/Modules.feature.cs @@ -1,125 +1,125 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by SpecFlow (http://www.specflow.org/). -// SpecFlow Version:1.9.0.77 -// SpecFlow Generator Version:1.9.0.0 -// Runtime Version:4.0.30319.0 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ -#region Designer generated code -#pragma warning disable -namespace Orchard.Specs -{ - using TechTalk.SpecFlow; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [NUnit.Framework.TestFixtureAttribute()] - [NUnit.Framework.DescriptionAttribute("Module management")] - public partial class ModuleManagementFeature - { - - private static TechTalk.SpecFlow.ITestRunner testRunner; - -#line 1 "Modules.feature" -#line hidden - - [NUnit.Framework.TestFixtureSetUpAttribute()] - public virtual void FeatureSetup() - { - testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Module management", " In order add and enable features\r\n As a root Orchard system operator\r\n I want" + - " to install and enable modules and enable features", ProgrammingLanguage.CSharp, ((string[])(null))); - testRunner.OnFeatureStart(featureInfo); - } - - [NUnit.Framework.TestFixtureTearDownAttribute()] - public virtual void FeatureTearDown() - { - testRunner.OnFeatureEnd(); - testRunner = null; - } - - [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() - { - } - - [NUnit.Framework.TearDownAttribute()] - public virtual void ScenarioTearDown() - { - testRunner.OnScenarioEnd(); - } - - public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) - { - testRunner.OnScenarioStart(scenarioInfo); - } - - public virtual void ScenarioCleanup() - { - testRunner.CollectScenarioErrors(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Installed modules are listed")] - public virtual void InstalledModulesAreListed() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Installed modules are listed", ((string[])(null))); -#line 6 -this.ScenarioSetup(scenarioInfo); -#line 7 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 8 - testRunner.When("I go to \"admin/modules\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 9 - testRunner.Then("I should see \"

      Modules

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table1.AddRow(new string[] { - "Options.SearchText", - "Themes"}); -#line 10 - testRunner.When("I fill in", ((string)(null)), table1, "When "); -#line 13 - testRunner.And("I hit \"Search\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 14 - testRunner.Then("I should see \"

      Modules

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 15 - testRunner.And("I should see \"]*>\\s*Themes\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 16 - testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Features of installed modules are listed")] - public virtual void FeaturesOfInstalledModulesAreListed() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Features of installed modules are listed", ((string[])(null))); -#line 18 -this.ScenarioSetup(scenarioInfo); -#line 19 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 20 - testRunner.When("I go to \"admin/modules/features\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 21 - testRunner.Then("I should see \"

      \\s*Common\\s*

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 22 - testRunner.And("I should see \"
    5. ]*>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 23 - testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - } -} -#pragma warning restore -#endregion +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.9.0.77 +// SpecFlow Generator Version:1.9.0.0 +// Runtime Version:4.0.30319.0 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +#pragma warning disable +namespace Orchard.Specs +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("Module management")] + public partial class ModuleManagementFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "Modules.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Module management", " In order add and enable features\r\n As a root Orchard system operator\r\n I want" + + " to install and enable modules and enable features", ProgrammingLanguage.CSharp, ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + [NUnit.Framework.SetUpAttribute()] + public virtual void TestInitialize() + { + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + public virtual void ScenarioCleanup() + { + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Installed modules are listed")] + public virtual void InstalledModulesAreListed() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Installed modules are listed", ((string[])(null))); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 8 + testRunner.When("I go to \"admin/modules\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 9 + testRunner.Then("I should see \"

      Modules

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table1.AddRow(new string[] { + "Options.SearchText", + "Themes"}); +#line 10 + testRunner.When("I fill in", ((string)(null)), table1, "When "); +#line 13 + testRunner.And("I hit \"Search\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 14 + testRunner.Then("I should see \"

      Modules

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 15 + testRunner.And("I should see \"]*>\\s*Themes\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 16 + testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Features of installed modules are listed")] + public virtual void FeaturesOfInstalledModulesAreListed() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Features of installed modules are listed", ((string[])(null))); +#line 18 +this.ScenarioSetup(scenarioInfo); +#line 19 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 20 + testRunner.When("I go to \"admin/modules/features\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 21 + testRunner.Then("I should see \"

      \\s*Common\\s*

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 22 + testRunner.And("I should see \"
    6. ]*>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 23 + testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + } +} +#pragma warning restore +#endregion diff --git a/src/Orchard.Specs/MultiTenancy.feature b/src/Orchard.Specs/MultiTenancy.feature index ae586c30960..59caddb6bdc 100644 --- a/src/Orchard.Specs/MultiTenancy.feature +++ b/src/Orchard.Specs/MultiTenancy.feature @@ -1,202 +1,202 @@ -Feature: Multiple tenant management - In order to host several isolated web applications - As a root Orchard system operator - I want to create and manage tenant configurations - -Scenario: Default site is listed - Given I have installed Orchard - And I have installed "Orchard.MultiTenancy" - When I go to "Admin/MultiTenancy" - Then I should see "List of Site's Tenants" - And I should see "

      Default\s*

      " - And the status should be 200 "OK" - -Scenario: New tenant fields are required - Given I have installed Orchard - And I have installed "Orchard.MultiTenancy" - When I go to "Admin/MultiTenancy/Add" - And I hit "Save" - Then I should see "is required" - -Scenario: A new tenant is created - Given I have installed Orchard - And I have installed "Orchard.MultiTenancy" - When I go to "Admin/MultiTenancy/Add" - And I fill in - | name | value | - | Name | Scott | - And I hit "Save" - And I am redirected - Then I should see "

      Scott\s*

      " - And the status should be 200 "OK" - -Scenario: A new tenant is created with uninitialized state - Given I have installed Orchard - And I have installed "Orchard.MultiTenancy" - When I go to "Admin/MultiTenancy/Add" - And I fill in - | name | value | - | Name | Scott | - And I hit "Save" - And I am redirected - Then I should see "
    7. " - And the status should be 200 "OK" - -Scenario: A new tenant goes to the setup screen - Given I have installed Orchard - And I have installed "Orchard.MultiTenancy" - When I go to "Admin/MultiTenancy/Add" - And I fill in - | name | value | - | Name | Scott | - | RequestUrlHost | scott.example.org | - And I hit "Save" - And I go to "/Setup" on host scott.example.org - Then I should see "Welcome to Orchard" - And I should see "Finish Setup" - And the status should be 200 "OK" - -Scenario: Several tenants are configured and go to setup screen - Given I have installed Orchard - And I have installed "Orchard.MultiTenancy" - When I go to "Admin/MultiTenancy/Add" - And I fill in - | name | value | - | Name | Scott1 | - | RequestUrlHost | scott1.example.org | - And I hit "Save" - And I am redirected - And I go to "Admin/MultiTenancy/Add" - And I fill in - | name | value | - | Name | Scott2 | - | RequestUrlHost | scott2.example.org | - And I hit "Save" - And I am redirected - And I go to "Admin/MultiTenancy/Add" - And I fill in - | name | value | - | Name | Scott3 | - | RequestUrlHost | scott3.example.org | - And I hit "Save" - And I am redirected - And I go to "/Setup" on host scott1.example.org - And I go to "/Setup" on host scott2.example.org - And I go to "/Setup" on host scott3.example.org - Then I should see "Welcome to Orchard" - -Scenario: A new tenant with preconfigured database goes to the setup screen - Given I have installed Orchard - And I have installed "Orchard.MultiTenancy" - When I go to "Admin/MultiTenancy/Add" - And I fill in - | name | value | - | Name | Scott | - | RequestUrlHost | scott.example.org | - | DataProvider | SqlCe | - And I hit "Save" - And I am redirected - And I go to "/Setup" on host scott.example.org - Then I should see "Welcome to Orchard" - And I should see "Finish Setup" - And I should not see "SQL Server Compact" - And the status should be 200 "OK" - -Scenario: A new tenant runs the setup - Given I have installed Orchard - And I have installed "Orchard.MultiTenancy" - When I go to "Admin/MultiTenancy/Add" - And I fill in - | name | value | - | Name | Scott | - | RequestUrlHost | scott.example.org | - And I hit "Save" - And I go to "/Setup" on host scott.example.org - And I fill in - | name | value | - | SiteName | Scott Site | - | AdminPassword | 6655321 | - | ConfirmPassword | 6655321 | - And I hit "Finish Setup" - And I go to "/" - Then I should see "Scott Site" - And I should see "Welcome" - -Scenario: An existing initialized tenant cannot have its database option cleared - Given I have installed Orchard - And I have installed "Orchard.MultiTenancy" - When I go to "Admin/MultiTenancy/Add" - And I fill in - | name | value | - | Name | Scott | - | RequestUrlHost | scott.example.org | - And I hit "Save" - And I go to "/Setup" on host scott.example.org - And I fill in - | name | value | - | SiteName | Scott Site | - | AdminPassword | 6655321 | - | ConfirmPassword | 6655321 | - And I hit "Finish Setup" - And I go to "/Admin/MultiTenancy/Edit/Scott" on host localhost - Then I should see "

      Edit Tenant

      " - And I should see "

      Scott

      " - And I should not see "Allow the tenant to set up the database" - -Scenario: Default tenant cannot be disabled - Given I have installed Orchard - And I have installed "Orchard.MultiTenancy" - When I go to "Admin/MultiTenancy" - Then I should not see "
      tenant list - Then I should see "Name: Alpha" +Feature: Multiple tenant management + In order to host several isolated web applications + As a root Orchard system operator + I want to create and manage tenant configurations + +Scenario: Default site is listed + Given I have installed Orchard + And I have installed "Orchard.MultiTenancy" + When I go to "Admin/MultiTenancy" + Then I should see "List of Site's Tenants" + And I should see "

      Default\s*

      " + And the status should be 200 "OK" + +Scenario: New tenant fields are required + Given I have installed Orchard + And I have installed "Orchard.MultiTenancy" + When I go to "Admin/MultiTenancy/Add" + And I hit "Save" + Then I should see "is required" + +Scenario: A new tenant is created + Given I have installed Orchard + And I have installed "Orchard.MultiTenancy" + When I go to "Admin/MultiTenancy/Add" + And I fill in + | name | value | + | Name | Scott | + And I hit "Save" + And I am redirected + Then I should see "

      Scott\s*

      " + And the status should be 200 "OK" + +Scenario: A new tenant is created with uninitialized state + Given I have installed Orchard + And I have installed "Orchard.MultiTenancy" + When I go to "Admin/MultiTenancy/Add" + And I fill in + | name | value | + | Name | Scott | + And I hit "Save" + And I am redirected + Then I should see "
    8. " + And the status should be 200 "OK" + +Scenario: A new tenant goes to the setup screen + Given I have installed Orchard + And I have installed "Orchard.MultiTenancy" + When I go to "Admin/MultiTenancy/Add" + And I fill in + | name | value | + | Name | Scott | + | RequestUrlHost | scott.example.org | + And I hit "Save" + And I go to "/Setup" on host scott.example.org + Then I should see "Welcome to Orchard" + And I should see "Finish Setup" + And the status should be 200 "OK" + +Scenario: Several tenants are configured and go to setup screen + Given I have installed Orchard + And I have installed "Orchard.MultiTenancy" + When I go to "Admin/MultiTenancy/Add" + And I fill in + | name | value | + | Name | Scott1 | + | RequestUrlHost | scott1.example.org | + And I hit "Save" + And I am redirected + And I go to "Admin/MultiTenancy/Add" + And I fill in + | name | value | + | Name | Scott2 | + | RequestUrlHost | scott2.example.org | + And I hit "Save" + And I am redirected + And I go to "Admin/MultiTenancy/Add" + And I fill in + | name | value | + | Name | Scott3 | + | RequestUrlHost | scott3.example.org | + And I hit "Save" + And I am redirected + And I go to "/Setup" on host scott1.example.org + And I go to "/Setup" on host scott2.example.org + And I go to "/Setup" on host scott3.example.org + Then I should see "Welcome to Orchard" + +Scenario: A new tenant with preconfigured database goes to the setup screen + Given I have installed Orchard + And I have installed "Orchard.MultiTenancy" + When I go to "Admin/MultiTenancy/Add" + And I fill in + | name | value | + | Name | Scott | + | RequestUrlHost | scott.example.org | + | DataProvider | SqlCe | + And I hit "Save" + And I am redirected + And I go to "/Setup" on host scott.example.org + Then I should see "Welcome to Orchard" + And I should see "Finish Setup" + And I should not see "SQL Server Compact" + And the status should be 200 "OK" + +Scenario: A new tenant runs the setup + Given I have installed Orchard + And I have installed "Orchard.MultiTenancy" + When I go to "Admin/MultiTenancy/Add" + And I fill in + | name | value | + | Name | Scott | + | RequestUrlHost | scott.example.org | + And I hit "Save" + And I go to "/Setup" on host scott.example.org + And I fill in + | name | value | + | SiteName | Scott Site | + | AdminPassword | 6655321 | + | ConfirmPassword | 6655321 | + And I hit "Finish Setup" + And I go to "/" + Then I should see "Scott Site" + And I should see "Welcome" + +Scenario: An existing initialized tenant cannot have its database option cleared + Given I have installed Orchard + And I have installed "Orchard.MultiTenancy" + When I go to "Admin/MultiTenancy/Add" + And I fill in + | name | value | + | Name | Scott | + | RequestUrlHost | scott.example.org | + And I hit "Save" + And I go to "/Setup" on host scott.example.org + And I fill in + | name | value | + | SiteName | Scott Site | + | AdminPassword | 6655321 | + | ConfirmPassword | 6655321 | + And I hit "Finish Setup" + And I go to "/Admin/MultiTenancy/Edit/Scott" on host localhost + Then I should see "

      Edit Tenant

      " + And I should see "

      Scott

      " + And I should not see "Allow the tenant to set up the database" + +Scenario: Default tenant cannot be disabled + Given I have installed Orchard + And I have installed "Orchard.MultiTenancy" + When I go to "Admin/MultiTenancy" + Then I should not see "tenant list + Then I should see "Name: Alpha" And I should see "Request Url Host: example.org" \ No newline at end of file diff --git a/src/Orchard.Specs/MultiTenancy.feature.cs b/src/Orchard.Specs/MultiTenancy.feature.cs index d1d54d065fe..44a76620a9c 100644 --- a/src/Orchard.Specs/MultiTenancy.feature.cs +++ b/src/Orchard.Specs/MultiTenancy.feature.cs @@ -1,620 +1,620 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by SpecFlow (http://www.specflow.org/). -// SpecFlow Version:1.9.0.77 -// SpecFlow Generator Version:1.9.0.0 -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ -#region Designer generated code -#pragma warning disable -namespace Orchard.Specs -{ - using TechTalk.SpecFlow; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [NUnit.Framework.TestFixtureAttribute()] - [NUnit.Framework.DescriptionAttribute("Multiple tenant management")] - public partial class MultipleTenantManagementFeature - { - - private static TechTalk.SpecFlow.ITestRunner testRunner; - -#line 1 "MultiTenancy.feature" -#line hidden - - [NUnit.Framework.TestFixtureSetUpAttribute()] - public virtual void FeatureSetup() - { - testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Multiple tenant management", " In order to host several isolated web applications\r\n As a root Orchard system " + - "operator\r\n I want to create and manage tenant configurations", ProgrammingLanguage.CSharp, ((string[])(null))); - testRunner.OnFeatureStart(featureInfo); - } - - [NUnit.Framework.TestFixtureTearDownAttribute()] - public virtual void FeatureTearDown() - { - testRunner.OnFeatureEnd(); - testRunner = null; - } - - [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() - { - } - - [NUnit.Framework.TearDownAttribute()] - public virtual void ScenarioTearDown() - { - testRunner.OnScenarioEnd(); - } - - public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) - { - testRunner.OnScenarioStart(scenarioInfo); - } - - public virtual void ScenarioCleanup() - { - testRunner.CollectScenarioErrors(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Default site is listed")] - public virtual void DefaultSiteIsListed() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Default site is listed", ((string[])(null))); -#line 6 -this.ScenarioSetup(scenarioInfo); -#line 7 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 8 - testRunner.And("I have installed \"Orchard.MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 9 - testRunner.When("I go to \"Admin/MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 10 - testRunner.Then("I should see \"List of Site's Tenants\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 11 - testRunner.And("I should see \"

      Default\\s*

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 12 - testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("New tenant fields are required")] - public virtual void NewTenantFieldsAreRequired() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("New tenant fields are required", ((string[])(null))); -#line 14 -this.ScenarioSetup(scenarioInfo); -#line 15 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 16 - testRunner.And("I have installed \"Orchard.MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 17 - testRunner.When("I go to \"Admin/MultiTenancy/Add\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 18 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 19 - testRunner.Then("I should see \"is required\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("A new tenant is created")] - public virtual void ANewTenantIsCreated() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A new tenant is created", ((string[])(null))); -#line 21 -this.ScenarioSetup(scenarioInfo); -#line 22 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 23 - testRunner.And("I have installed \"Orchard.MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 24 - testRunner.When("I go to \"Admin/MultiTenancy/Add\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table1.AddRow(new string[] { - "Name", - "Scott"}); -#line 25 - testRunner.And("I fill in", ((string)(null)), table1, "And "); -#line 28 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 29 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 30 - testRunner.Then("I should see \"

      Scott\\s*

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 31 - testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("A new tenant is created with uninitialized state")] - public virtual void ANewTenantIsCreatedWithUninitializedState() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A new tenant is created with uninitialized state", ((string[])(null))); -#line 33 -this.ScenarioSetup(scenarioInfo); -#line 34 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 35 - testRunner.And("I have installed \"Orchard.MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 36 - testRunner.When("I go to \"Admin/MultiTenancy/Add\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table2.AddRow(new string[] { - "Name", - "Scott"}); -#line 37 - testRunner.And("I fill in", ((string)(null)), table2, "And "); -#line 40 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 41 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 42 - testRunner.Then("I should see \"
    9. \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 43 - testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("A new tenant goes to the setup screen")] - public virtual void ANewTenantGoesToTheSetupScreen() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A new tenant goes to the setup screen", ((string[])(null))); -#line 45 -this.ScenarioSetup(scenarioInfo); -#line 46 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 47 - testRunner.And("I have installed \"Orchard.MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 48 - testRunner.When("I go to \"Admin/MultiTenancy/Add\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table3.AddRow(new string[] { - "Name", - "Scott"}); - table3.AddRow(new string[] { - "RequestUrlHost", - "scott.example.org"}); -#line 49 - testRunner.And("I fill in", ((string)(null)), table3, "And "); -#line 53 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 54 - testRunner.And("I go to \"/Setup\" on host scott.example.org", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 55 - testRunner.Then("I should see \"Welcome to Orchard\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 56 - testRunner.And("I should see \"Finish Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 57 - testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Several tenants are configured and go to setup screen")] - public virtual void SeveralTenantsAreConfiguredAndGoToSetupScreen() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Several tenants are configured and go to setup screen", ((string[])(null))); -#line 59 -this.ScenarioSetup(scenarioInfo); -#line 60 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 61 - testRunner.And("I have installed \"Orchard.MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 62 - testRunner.When("I go to \"Admin/MultiTenancy/Add\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table4.AddRow(new string[] { - "Name", - "Scott1"}); - table4.AddRow(new string[] { - "RequestUrlHost", - "scott1.example.org"}); -#line 63 - testRunner.And("I fill in", ((string)(null)), table4, "And "); -#line 67 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 68 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 69 - testRunner.And("I go to \"Admin/MultiTenancy/Add\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table5.AddRow(new string[] { - "Name", - "Scott2"}); - table5.AddRow(new string[] { - "RequestUrlHost", - "scott2.example.org"}); -#line 70 - testRunner.And("I fill in", ((string)(null)), table5, "And "); -#line 74 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 75 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 76 - testRunner.And("I go to \"Admin/MultiTenancy/Add\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table6 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table6.AddRow(new string[] { - "Name", - "Scott3"}); - table6.AddRow(new string[] { - "RequestUrlHost", - "scott3.example.org"}); -#line 77 - testRunner.And("I fill in", ((string)(null)), table6, "And "); -#line 81 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 82 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 83 - testRunner.And("I go to \"/Setup\" on host scott1.example.org", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 84 - testRunner.And("I go to \"/Setup\" on host scott2.example.org", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 85 - testRunner.And("I go to \"/Setup\" on host scott3.example.org", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 86 - testRunner.Then("I should see \"Welcome to Orchard\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("A new tenant with preconfigured database goes to the setup screen")] - public virtual void ANewTenantWithPreconfiguredDatabaseGoesToTheSetupScreen() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A new tenant with preconfigured database goes to the setup screen", ((string[])(null))); -#line 88 -this.ScenarioSetup(scenarioInfo); -#line 89 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 90 - testRunner.And("I have installed \"Orchard.MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 91 - testRunner.When("I go to \"Admin/MultiTenancy/Add\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table7 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table7.AddRow(new string[] { - "Name", - "Scott"}); - table7.AddRow(new string[] { - "RequestUrlHost", - "scott.example.org"}); - table7.AddRow(new string[] { - "DataProvider", - "SqlCe"}); -#line 92 - testRunner.And("I fill in", ((string)(null)), table7, "And "); -#line 97 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 98 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 99 - testRunner.And("I go to \"/Setup\" on host scott.example.org", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 100 - testRunner.Then("I should see \"Welcome to Orchard\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 101 - testRunner.And("I should see \"Finish Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 102 - testRunner.And("I should not see \"SQL Server Compact\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 103 - testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("A new tenant runs the setup")] - public virtual void ANewTenantRunsTheSetup() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A new tenant runs the setup", ((string[])(null))); -#line 105 -this.ScenarioSetup(scenarioInfo); -#line 106 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 107 - testRunner.And("I have installed \"Orchard.MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 108 - testRunner.When("I go to \"Admin/MultiTenancy/Add\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table8 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table8.AddRow(new string[] { - "Name", - "Scott"}); - table8.AddRow(new string[] { - "RequestUrlHost", - "scott.example.org"}); -#line 109 - testRunner.And("I fill in", ((string)(null)), table8, "And "); -#line 113 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 114 - testRunner.And("I go to \"/Setup\" on host scott.example.org", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table9 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table9.AddRow(new string[] { - "SiteName", - "Scott Site"}); - table9.AddRow(new string[] { - "AdminPassword", - "6655321"}); - table9.AddRow(new string[] { - "ConfirmPassword", - "6655321"}); -#line 115 - testRunner.And("I fill in", ((string)(null)), table9, "And "); -#line 120 - testRunner.And("I hit \"Finish Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 121 - testRunner.And("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 122 - testRunner.Then("I should see \"Scott Site\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 123 - testRunner.And("I should see \"Welcome\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("An existing initialized tenant cannot have its database option cleared")] - public virtual void AnExistingInitializedTenantCannotHaveItsDatabaseOptionCleared() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("An existing initialized tenant cannot have its database option cleared", ((string[])(null))); -#line 125 -this.ScenarioSetup(scenarioInfo); -#line 126 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 127 - testRunner.And("I have installed \"Orchard.MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 128 - testRunner.When("I go to \"Admin/MultiTenancy/Add\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table10 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table10.AddRow(new string[] { - "Name", - "Scott"}); - table10.AddRow(new string[] { - "RequestUrlHost", - "scott.example.org"}); -#line 129 - testRunner.And("I fill in", ((string)(null)), table10, "And "); -#line 133 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 134 - testRunner.And("I go to \"/Setup\" on host scott.example.org", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table11 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table11.AddRow(new string[] { - "SiteName", - "Scott Site"}); - table11.AddRow(new string[] { - "AdminPassword", - "6655321"}); - table11.AddRow(new string[] { - "ConfirmPassword", - "6655321"}); -#line 135 - testRunner.And("I fill in", ((string)(null)), table11, "And "); -#line 140 - testRunner.And("I hit \"Finish Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 141 - testRunner.And("I go to \"/Admin/MultiTenancy/Edit/Scott\" on host localhost", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 142 - testRunner.Then("I should see \"

      Edit Tenant

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 143 - testRunner.And("I should see \"

      Scott

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 144 - testRunner.And("I should not see \"Allow the tenant to set up the database\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Default tenant cannot be disabled")] - public virtual void DefaultTenantCannotBeDisabled() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Default tenant cannot be disabled", ((string[])(null))); -#line 146 -this.ScenarioSetup(scenarioInfo); -#line 147 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 148 - testRunner.And("I have installed \"Orchard.MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 149 - testRunner.When("I go to \"Admin/MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 150 - testRunner.Then("I should not see \"tenant list", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 201 - testRunner.Then("I should see \"Name: Alpha\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 202 - testRunner.And("I should see \"Request Url Host: example.org\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - } -} -#pragma warning restore -#endregion +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.9.0.77 +// SpecFlow Generator Version:1.9.0.0 +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +#pragma warning disable +namespace Orchard.Specs +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("Multiple tenant management")] + public partial class MultipleTenantManagementFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "MultiTenancy.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Multiple tenant management", " In order to host several isolated web applications\r\n As a root Orchard system " + + "operator\r\n I want to create and manage tenant configurations", ProgrammingLanguage.CSharp, ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + [NUnit.Framework.SetUpAttribute()] + public virtual void TestInitialize() + { + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + public virtual void ScenarioCleanup() + { + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Default site is listed")] + public virtual void DefaultSiteIsListed() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Default site is listed", ((string[])(null))); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 8 + testRunner.And("I have installed \"Orchard.MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 9 + testRunner.When("I go to \"Admin/MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 10 + testRunner.Then("I should see \"List of Site's Tenants\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 11 + testRunner.And("I should see \"

      Default\\s*

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 12 + testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("New tenant fields are required")] + public virtual void NewTenantFieldsAreRequired() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("New tenant fields are required", ((string[])(null))); +#line 14 +this.ScenarioSetup(scenarioInfo); +#line 15 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 16 + testRunner.And("I have installed \"Orchard.MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 17 + testRunner.When("I go to \"Admin/MultiTenancy/Add\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 18 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 19 + testRunner.Then("I should see \"is required\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("A new tenant is created")] + public virtual void ANewTenantIsCreated() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A new tenant is created", ((string[])(null))); +#line 21 +this.ScenarioSetup(scenarioInfo); +#line 22 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 23 + testRunner.And("I have installed \"Orchard.MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 24 + testRunner.When("I go to \"Admin/MultiTenancy/Add\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table1.AddRow(new string[] { + "Name", + "Scott"}); +#line 25 + testRunner.And("I fill in", ((string)(null)), table1, "And "); +#line 28 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 29 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 30 + testRunner.Then("I should see \"

      Scott\\s*

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 31 + testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("A new tenant is created with uninitialized state")] + public virtual void ANewTenantIsCreatedWithUninitializedState() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A new tenant is created with uninitialized state", ((string[])(null))); +#line 33 +this.ScenarioSetup(scenarioInfo); +#line 34 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 35 + testRunner.And("I have installed \"Orchard.MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 36 + testRunner.When("I go to \"Admin/MultiTenancy/Add\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table2.AddRow(new string[] { + "Name", + "Scott"}); +#line 37 + testRunner.And("I fill in", ((string)(null)), table2, "And "); +#line 40 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 41 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 42 + testRunner.Then("I should see \"
    10. \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 43 + testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("A new tenant goes to the setup screen")] + public virtual void ANewTenantGoesToTheSetupScreen() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A new tenant goes to the setup screen", ((string[])(null))); +#line 45 +this.ScenarioSetup(scenarioInfo); +#line 46 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 47 + testRunner.And("I have installed \"Orchard.MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 48 + testRunner.When("I go to \"Admin/MultiTenancy/Add\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table3.AddRow(new string[] { + "Name", + "Scott"}); + table3.AddRow(new string[] { + "RequestUrlHost", + "scott.example.org"}); +#line 49 + testRunner.And("I fill in", ((string)(null)), table3, "And "); +#line 53 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 54 + testRunner.And("I go to \"/Setup\" on host scott.example.org", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 55 + testRunner.Then("I should see \"Welcome to Orchard\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 56 + testRunner.And("I should see \"Finish Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 57 + testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Several tenants are configured and go to setup screen")] + public virtual void SeveralTenantsAreConfiguredAndGoToSetupScreen() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Several tenants are configured and go to setup screen", ((string[])(null))); +#line 59 +this.ScenarioSetup(scenarioInfo); +#line 60 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 61 + testRunner.And("I have installed \"Orchard.MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 62 + testRunner.When("I go to \"Admin/MultiTenancy/Add\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table4.AddRow(new string[] { + "Name", + "Scott1"}); + table4.AddRow(new string[] { + "RequestUrlHost", + "scott1.example.org"}); +#line 63 + testRunner.And("I fill in", ((string)(null)), table4, "And "); +#line 67 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 68 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 69 + testRunner.And("I go to \"Admin/MultiTenancy/Add\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table5.AddRow(new string[] { + "Name", + "Scott2"}); + table5.AddRow(new string[] { + "RequestUrlHost", + "scott2.example.org"}); +#line 70 + testRunner.And("I fill in", ((string)(null)), table5, "And "); +#line 74 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 75 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 76 + testRunner.And("I go to \"Admin/MultiTenancy/Add\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table6 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table6.AddRow(new string[] { + "Name", + "Scott3"}); + table6.AddRow(new string[] { + "RequestUrlHost", + "scott3.example.org"}); +#line 77 + testRunner.And("I fill in", ((string)(null)), table6, "And "); +#line 81 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 82 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 83 + testRunner.And("I go to \"/Setup\" on host scott1.example.org", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 84 + testRunner.And("I go to \"/Setup\" on host scott2.example.org", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 85 + testRunner.And("I go to \"/Setup\" on host scott3.example.org", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 86 + testRunner.Then("I should see \"Welcome to Orchard\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("A new tenant with preconfigured database goes to the setup screen")] + public virtual void ANewTenantWithPreconfiguredDatabaseGoesToTheSetupScreen() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A new tenant with preconfigured database goes to the setup screen", ((string[])(null))); +#line 88 +this.ScenarioSetup(scenarioInfo); +#line 89 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 90 + testRunner.And("I have installed \"Orchard.MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 91 + testRunner.When("I go to \"Admin/MultiTenancy/Add\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table7 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table7.AddRow(new string[] { + "Name", + "Scott"}); + table7.AddRow(new string[] { + "RequestUrlHost", + "scott.example.org"}); + table7.AddRow(new string[] { + "DataProvider", + "SqlCe"}); +#line 92 + testRunner.And("I fill in", ((string)(null)), table7, "And "); +#line 97 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 98 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 99 + testRunner.And("I go to \"/Setup\" on host scott.example.org", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 100 + testRunner.Then("I should see \"Welcome to Orchard\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 101 + testRunner.And("I should see \"Finish Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 102 + testRunner.And("I should not see \"SQL Server Compact\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 103 + testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("A new tenant runs the setup")] + public virtual void ANewTenantRunsTheSetup() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A new tenant runs the setup", ((string[])(null))); +#line 105 +this.ScenarioSetup(scenarioInfo); +#line 106 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 107 + testRunner.And("I have installed \"Orchard.MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 108 + testRunner.When("I go to \"Admin/MultiTenancy/Add\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table8 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table8.AddRow(new string[] { + "Name", + "Scott"}); + table8.AddRow(new string[] { + "RequestUrlHost", + "scott.example.org"}); +#line 109 + testRunner.And("I fill in", ((string)(null)), table8, "And "); +#line 113 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 114 + testRunner.And("I go to \"/Setup\" on host scott.example.org", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table9 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table9.AddRow(new string[] { + "SiteName", + "Scott Site"}); + table9.AddRow(new string[] { + "AdminPassword", + "6655321"}); + table9.AddRow(new string[] { + "ConfirmPassword", + "6655321"}); +#line 115 + testRunner.And("I fill in", ((string)(null)), table9, "And "); +#line 120 + testRunner.And("I hit \"Finish Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 121 + testRunner.And("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 122 + testRunner.Then("I should see \"Scott Site\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 123 + testRunner.And("I should see \"Welcome\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("An existing initialized tenant cannot have its database option cleared")] + public virtual void AnExistingInitializedTenantCannotHaveItsDatabaseOptionCleared() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("An existing initialized tenant cannot have its database option cleared", ((string[])(null))); +#line 125 +this.ScenarioSetup(scenarioInfo); +#line 126 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 127 + testRunner.And("I have installed \"Orchard.MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 128 + testRunner.When("I go to \"Admin/MultiTenancy/Add\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table10 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table10.AddRow(new string[] { + "Name", + "Scott"}); + table10.AddRow(new string[] { + "RequestUrlHost", + "scott.example.org"}); +#line 129 + testRunner.And("I fill in", ((string)(null)), table10, "And "); +#line 133 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 134 + testRunner.And("I go to \"/Setup\" on host scott.example.org", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table11 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table11.AddRow(new string[] { + "SiteName", + "Scott Site"}); + table11.AddRow(new string[] { + "AdminPassword", + "6655321"}); + table11.AddRow(new string[] { + "ConfirmPassword", + "6655321"}); +#line 135 + testRunner.And("I fill in", ((string)(null)), table11, "And "); +#line 140 + testRunner.And("I hit \"Finish Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 141 + testRunner.And("I go to \"/Admin/MultiTenancy/Edit/Scott\" on host localhost", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 142 + testRunner.Then("I should see \"

      Edit Tenant

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 143 + testRunner.And("I should see \"

      Scott

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 144 + testRunner.And("I should not see \"Allow the tenant to set up the database\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Default tenant cannot be disabled")] + public virtual void DefaultTenantCannotBeDisabled() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Default tenant cannot be disabled", ((string[])(null))); +#line 146 +this.ScenarioSetup(scenarioInfo); +#line 147 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 148 + testRunner.And("I have installed \"Orchard.MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 149 + testRunner.When("I go to \"Admin/MultiTenancy\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 150 + testRunner.Then("I should not see \"tenant list", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 201 + testRunner.Then("I should see \"Name: Alpha\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 202 + testRunner.And("I should see \"Request Url Host: example.org\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + } +} +#pragma warning restore +#endregion diff --git a/src/Orchard.Specs/Orchard.Specs.csproj b/src/Orchard.Specs/Orchard.Specs.csproj index adac5f67648..a03d6ca007e 100644 --- a/src/Orchard.Specs/Orchard.Specs.csproj +++ b/src/Orchard.Specs/Orchard.Specs.csproj @@ -1,512 +1,512 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7354DF37-934B-46CF-A13C-455D5F5F5413} - Library - Properties - Orchard.Specs - Orchard.Specs - v4.5.1 - 512 - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - ..\OrchardBasicCorrectness.ruleset - AnyCPU - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - AnyCPU - false - - - - False - ..\..\lib\autofac\Autofac.dll - - - False - ..\..\lib\castle\net45\Castle.Core.dll - - - False - ..\..\lib\nhibernate\FluentNHibernate.dll - - - False - ..\..\lib\fluentpath\FluentPath.dll - - - False - ..\..\lib\htmlagilitypack\HtmlAgilityPack.dll - - - False - ..\..\lib\nhibernate\Iesi.Collections.dll - - - ..\..\lib\log4net\log4net.dll - - - False - ..\..\lib\nhibernate\NHibernate.dll - - - False - ..\..\lib\nunit\nunit.framework.dll - - - - - 3.5 - - - - False - ..\..\lib\aspnetmvc\System.Web.Mvc.dll - - - 3.5 - False - - - 3.5 - - - 3.5 - - - - - False - ..\..\lib\specflow\TechTalk.SpecFlow.dll - - - - - True - True - Admin.feature - - - Autoroute.feature - True - True - - - - - - - - - - True - True - Blogs.feature - - - Boolean.feature - True - True - - - True - True - Comments.feature - - - True - True - ContentRights.feature - - - True - True - ContentTypes.feature - - - DateTime.feature - True - True - - - Enumeration.feature - True - True - - - Input.feature - True - True - - - Link.feature - True - True - - - MediaPicker.feature - True - True - - - Numeric.feature - True - True - - - Tags.feature - True - True - - - - - - - - - - - True - True - Lists.feature - - - True - True - Media.feature - - - True - True - Modules.feature - - - True - True - MultiTenancy.feature - - - True - True - Pages.feature - - - True - True - PermissionModel.feature - - - True - True - Setup.feature - - - True - True - SiteCompilation.feature - - - True - True - Users.feature - - - True - True - UsingSpecFlow.feature - - - - - - - - - - - True - True - WebHosting.feature - - - True - True - Widgets.feature - - - - - Always - Designer - - - Always - Designer - - - Always - - - Always - - - SpecFlowSingleFileGenerator - Admin.feature.cs - - - - SpecFlowSingleFileGenerator - Autoroute.feature.cs - - - SpecFlowSingleFileGenerator - Blogs.feature.cs - - - SpecFlowSingleFileGenerator - Boolean.feature.cs - - - SpecFlowSingleFileGenerator - Comments.feature.cs - - - SpecFlowSingleFileGenerator - ContentRights.feature.cs - - - SpecFlowSingleFileGenerator - ContentTypes.feature.cs - - - - SpecFlowSingleFileGenerator - DateTime.feature.cs - - - SpecFlowSingleFileGenerator - Enumeration.feature.cs - - - Designer - - - HostComponents.config - - - HostComponents.config - - - SpecFlowSingleFileGenerator - Input.feature.cs - - - SpecFlowSingleFileGenerator - Link.feature.cs - - - SpecFlowSingleFileGenerator - MediaPicker.feature.cs - - - SpecFlowSingleFileGenerator - Numeric.feature.cs - - - SpecFlowSingleFileGenerator - Tags.feature.cs - - - SpecFlowSingleFileGenerator - Lists.feature.cs - - - SpecFlowSingleFileGenerator - PermissionModel.feature.cs - - - Designer - Always - - - Designer - Always - - - SpecFlowSingleFileGenerator - SiteCompilation.feature.cs - - - Always - - - Always - - - Always - - - SpecFlowSingleFileGenerator - Media.feature.cs - - - SpecFlowSingleFileGenerator - Modules.feature.cs - - - SpecFlowSingleFileGenerator - MultiTenancy.feature.cs - - - SpecFlowSingleFileGenerator - Pages.feature.cs - - - SpecFlowSingleFileGenerator - Users.feature.cs - - - SpecFlowSingleFileGenerator - WebHosting.feature.cs - - - SpecFlowSingleFileGenerator - Setup.feature.cs - - - SpecFlowSingleFileGenerator - UsingSpecFlow.feature.cs - - - SpecFlowSingleFileGenerator - Widgets.feature.cs - - - - - {9916839C-39FC-4CEB-A5AF-89CA7E87119F} - Orchard.Core - - - {D10AD48F-407D-4DB5-A328-173EC7CB010F} - Orchard.Roles - - - {8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4} - Orchard.Setup - - - {79AED36E-ABD0-4747-93D3-8722B042454B} - Orchard.Users - - - {50B779EA-EC00-4699-84C0-03B395C365D2} - Orchard.Web - - - {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} - Orchard.Framework - - - {33B1BC8D-E292-4972-A363-22056B207156} - Orchard - - - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {7354DF37-934B-46CF-A13C-455D5F5F5413} + Library + Properties + Orchard.Specs + Orchard.Specs + v4.5.1 + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + ..\OrchardBasicCorrectness.ruleset + AnyCPU + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + AnyCPU + false + + + + False + ..\..\lib\autofac\Autofac.dll + + + False + ..\..\lib\castle\net45\Castle.Core.dll + + + False + ..\..\lib\nhibernate\FluentNHibernate.dll + + + False + ..\..\lib\fluentpath\FluentPath.dll + + + False + ..\..\lib\htmlagilitypack\HtmlAgilityPack.dll + + + False + ..\..\lib\nhibernate\Iesi.Collections.dll + + + ..\..\lib\log4net\log4net.dll + + + False + ..\..\lib\nhibernate\NHibernate.dll + + + False + ..\..\lib\nunit\nunit.framework.dll + + + + + 3.5 + + + + False + ..\..\lib\aspnetmvc\System.Web.Mvc.dll + + + 3.5 + False + + + 3.5 + + + 3.5 + + + + + False + ..\..\lib\specflow\TechTalk.SpecFlow.dll + + + + + True + True + Admin.feature + + + Autoroute.feature + True + True + + + + + + + + + + True + True + Blogs.feature + + + Boolean.feature + True + True + + + True + True + Comments.feature + + + True + True + ContentRights.feature + + + True + True + ContentTypes.feature + + + DateTime.feature + True + True + + + Enumeration.feature + True + True + + + Input.feature + True + True + + + Link.feature + True + True + + + MediaPicker.feature + True + True + + + Numeric.feature + True + True + + + Tags.feature + True + True + + + + + + + + + + + True + True + Lists.feature + + + True + True + Media.feature + + + True + True + Modules.feature + + + True + True + MultiTenancy.feature + + + True + True + Pages.feature + + + True + True + PermissionModel.feature + + + True + True + Setup.feature + + + True + True + SiteCompilation.feature + + + True + True + Users.feature + + + True + True + UsingSpecFlow.feature + + + + + + + + + + + True + True + WebHosting.feature + + + True + True + Widgets.feature + + + + + Always + Designer + + + Always + Designer + + + Always + + + Always + + + SpecFlowSingleFileGenerator + Admin.feature.cs + + + + SpecFlowSingleFileGenerator + Autoroute.feature.cs + + + SpecFlowSingleFileGenerator + Blogs.feature.cs + + + SpecFlowSingleFileGenerator + Boolean.feature.cs + + + SpecFlowSingleFileGenerator + Comments.feature.cs + + + SpecFlowSingleFileGenerator + ContentRights.feature.cs + + + SpecFlowSingleFileGenerator + ContentTypes.feature.cs + + + + SpecFlowSingleFileGenerator + DateTime.feature.cs + + + SpecFlowSingleFileGenerator + Enumeration.feature.cs + + + Designer + + + HostComponents.config + + + HostComponents.config + + + SpecFlowSingleFileGenerator + Input.feature.cs + + + SpecFlowSingleFileGenerator + Link.feature.cs + + + SpecFlowSingleFileGenerator + MediaPicker.feature.cs + + + SpecFlowSingleFileGenerator + Numeric.feature.cs + + + SpecFlowSingleFileGenerator + Tags.feature.cs + + + SpecFlowSingleFileGenerator + Lists.feature.cs + + + SpecFlowSingleFileGenerator + PermissionModel.feature.cs + + + Designer + Always + + + Designer + Always + + + SpecFlowSingleFileGenerator + SiteCompilation.feature.cs + + + Always + + + Always + + + Always + + + SpecFlowSingleFileGenerator + Media.feature.cs + + + SpecFlowSingleFileGenerator + Modules.feature.cs + + + SpecFlowSingleFileGenerator + MultiTenancy.feature.cs + + + SpecFlowSingleFileGenerator + Pages.feature.cs + + + SpecFlowSingleFileGenerator + Users.feature.cs + + + SpecFlowSingleFileGenerator + WebHosting.feature.cs + + + SpecFlowSingleFileGenerator + Setup.feature.cs + + + SpecFlowSingleFileGenerator + UsingSpecFlow.feature.cs + + + SpecFlowSingleFileGenerator + Widgets.feature.cs + + + + + {9916839C-39FC-4CEB-A5AF-89CA7E87119F} + Orchard.Core + + + {D10AD48F-407D-4DB5-A328-173EC7CB010F} + Orchard.Roles + + + {8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4} + Orchard.Setup + + + {79AED36E-ABD0-4747-93D3-8722B042454B} + Orchard.Users + + + {50B779EA-EC00-4699-84C0-03B395C365D2} + Orchard.Web + + + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} + Orchard.Framework + + + {33B1BC8D-E292-4972-A363-22056B207156} + Orchard + + + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Specs/Pages.feature b/src/Orchard.Specs/Pages.feature index 5352b3df954..91f2a2ed6e2 100644 --- a/src/Orchard.Specs/Pages.feature +++ b/src/Orchard.Specs/Pages.feature @@ -1,54 +1,54 @@ -Feature: Pages - In order to add content pages to my site - As an author - I want to create, publish and edit pages - -Scenario: In the admin (menu) there is a link to create a Page - Given I have installed Orchard - - When I go to "Admin" - Then I should see "]*>Page" - - # I can create and publish a new Page - When I go to "Admin/Contents/Create/Page" - And I fill in - | name | value | - | Title.Title | Super Duper | - | LayoutPart.LayoutEditor.Data | { "type": "Content", "data": "TypeName=Orchard.Layouts.Elements.Text&Content=This+is+super", "isTemplated": false, "contentType": "Orchard.Layouts.Elements.Text", "contentTypeLabel": "Text", "contentTypeClass": "text", "html": "This is super", "hasEditor": true } | - And I hit "Publish Now" - And I go to "super-duper" - Then I should see "]*>.*?Super Duper.*?" - And I should see "This is super." - - # If I create a page which gets a conflicting path generated its path is made to be unique - When I go to "Admin/Contents/Create/Page" - And I fill in - | name | value | - | Title.Title | Super Duper | - | LayoutPart.LayoutEditor.Data | { "type": "Content", "data": "TypeName=Orchard.Layouts.Elements.Text&Content=This+is+super+number+two", "isTemplated": false, "contentType": "Orchard.Layouts.Elements.Text", "contentTypeLabel": "Text", "contentTypeClass": "text", "html": "This is super number two", "hasEditor": true } | - And I hit "Publish Now" - And I go to "super-duper-2" - Then I should see "]*>.*?Super Duper.*?" - And I should see "This is super number two." - - # A new page marked to be the home page and publish does take over the home page and is not accessible from its own standard path - When I go to "Admin/Contents/Create/Page" - And I fill in - | name | value | - | Title.Title | Another | - | Autoroute.PromoteToHomePage | true | - And I hit "Publish Now" - And I go to "/" - Then I should see "

      Another

      " - When I go to "another" - Then the status should be 404 "Not Found" - - # A new page marked to be the home page but only saved as draft does not take over the home page - When I go to "Admin/Contents/Create/Page" - And I fill in - | name | value | - | Title.Title | Drafty | - | Autoroute.PromoteToHomePage | true | - And I hit "Save" - And I go to "/" - Then I should see "

      Another

      " +Feature: Pages + In order to add content pages to my site + As an author + I want to create, publish and edit pages + +Scenario: In the admin (menu) there is a link to create a Page + Given I have installed Orchard + + When I go to "Admin" + Then I should see "]*>Page" + + # I can create and publish a new Page + When I go to "Admin/Contents/Create/Page" + And I fill in + | name | value | + | Title.Title | Super Duper | + | LayoutPart.LayoutEditor.Data | { "type": "Content", "data": "TypeName=Orchard.Layouts.Elements.Text&Content=This+is+super", "isTemplated": false, "contentType": "Orchard.Layouts.Elements.Text", "contentTypeLabel": "Text", "contentTypeClass": "text", "html": "This is super", "hasEditor": true } | + And I hit "Publish Now" + And I go to "super-duper" + Then I should see "]*>.*?Super Duper.*?" + And I should see "This is super." + + # If I create a page which gets a conflicting path generated its path is made to be unique + When I go to "Admin/Contents/Create/Page" + And I fill in + | name | value | + | Title.Title | Super Duper | + | LayoutPart.LayoutEditor.Data | { "type": "Content", "data": "TypeName=Orchard.Layouts.Elements.Text&Content=This+is+super+number+two", "isTemplated": false, "contentType": "Orchard.Layouts.Elements.Text", "contentTypeLabel": "Text", "contentTypeClass": "text", "html": "This is super number two", "hasEditor": true } | + And I hit "Publish Now" + And I go to "super-duper-2" + Then I should see "]*>.*?Super Duper.*?" + And I should see "This is super number two." + + # A new page marked to be the home page and publish does take over the home page and is not accessible from its own standard path + When I go to "Admin/Contents/Create/Page" + And I fill in + | name | value | + | Title.Title | Another | + | Autoroute.PromoteToHomePage | true | + And I hit "Publish Now" + And I go to "/" + Then I should see "

      Another

      " + When I go to "another" + Then the status should be 404 "Not Found" + + # A new page marked to be the home page but only saved as draft does not take over the home page + When I go to "Admin/Contents/Create/Page" + And I fill in + | name | value | + | Title.Title | Drafty | + | Autoroute.PromoteToHomePage | true | + And I hit "Save" + And I go to "/" + Then I should see "

      Another

      " diff --git a/src/Orchard.Specs/Pages.feature.cs b/src/Orchard.Specs/Pages.feature.cs index 7ea3cf7d505..3dd6d00a89c 100644 --- a/src/Orchard.Specs/Pages.feature.cs +++ b/src/Orchard.Specs/Pages.feature.cs @@ -1,175 +1,175 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by SpecFlow (http://www.specflow.org/). -// SpecFlow Version:1.9.0.77 -// SpecFlow Generator Version:1.9.0.0 -// Runtime Version:4.0.30319.0 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ -#region Designer generated code -#pragma warning disable -namespace Orchard.Specs -{ - using TechTalk.SpecFlow; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [NUnit.Framework.TestFixtureAttribute()] - [NUnit.Framework.DescriptionAttribute("Pages")] - public partial class PagesFeature - { - - private static TechTalk.SpecFlow.ITestRunner testRunner; - -#line 1 "Pages.feature" -#line hidden - - [NUnit.Framework.TestFixtureSetUpAttribute()] - public virtual void FeatureSetup() - { - testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Pages", " In order to add content pages to my site\r\n As an author\r\n I want to create, p" + - "ublish and edit pages", ProgrammingLanguage.CSharp, ((string[])(null))); - testRunner.OnFeatureStart(featureInfo); - } - - [NUnit.Framework.TestFixtureTearDownAttribute()] - public virtual void FeatureTearDown() - { - testRunner.OnFeatureEnd(); - testRunner = null; - } - - [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() - { - } - - [NUnit.Framework.TearDownAttribute()] - public virtual void ScenarioTearDown() - { - testRunner.OnScenarioEnd(); - } - - public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) - { - testRunner.OnScenarioStart(scenarioInfo); - } - - public virtual void ScenarioCleanup() - { - testRunner.CollectScenarioErrors(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("In the admin (menu) there is a link to create a Page")] - public virtual void InTheAdminMenuThereIsALinkToCreateAPage() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("In the admin (menu) there is a link to create a Page", ((string[])(null))); -#line 6 -this.ScenarioSetup(scenarioInfo); -#line 7 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 9 - testRunner.When("I go to \"Admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 10 - testRunner.Then("I should see \"]*>Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 13 - testRunner.When("I go to \"Admin/Contents/Create/Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table1.AddRow(new string[] { - "Title.Title", - "Super Duper"}); - table1.AddRow(new string[] { - "LayoutPart.LayoutEditor.Data", - @"{ ""type"": ""Content"", ""data"": ""TypeName=Orchard.Layouts.Elements.Text&Content=This+is+super"", ""isTemplated"": false, ""contentType"": ""Orchard.Layouts.Elements.Text"", ""contentTypeLabel"": ""Text"", ""contentTypeClass"": ""text"", ""html"": ""This is super"", ""hasEditor"": true }"}); -#line 14 - testRunner.And("I fill in", ((string)(null)), table1, "And "); -#line 18 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 19 - testRunner.And("I go to \"super-duper\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 20 - testRunner.Then("I should see \"]*>.*?Super Duper.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 21 - testRunner.And("I should see \"This is super.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 24 - testRunner.When("I go to \"Admin/Contents/Create/Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table2.AddRow(new string[] { - "Title.Title", - "Super Duper"}); - table2.AddRow(new string[] { - "LayoutPart.LayoutEditor.Data", - @"{ ""type"": ""Content"", ""data"": ""TypeName=Orchard.Layouts.Elements.Text&Content=This+is+super+number+two"", ""isTemplated"": false, ""contentType"": ""Orchard.Layouts.Elements.Text"", ""contentTypeLabel"": ""Text"", ""contentTypeClass"": ""text"", ""html"": ""This is super number two"", ""hasEditor"": true }"}); -#line 25 - testRunner.And("I fill in", ((string)(null)), table2, "And "); -#line 29 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 30 - testRunner.And("I go to \"super-duper-2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 31 - testRunner.Then("I should see \"]*>.*?Super Duper.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 32 - testRunner.And("I should see \"This is super number two.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 35 - testRunner.When("I go to \"Admin/Contents/Create/Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table3.AddRow(new string[] { - "Title.Title", - "Another"}); - table3.AddRow(new string[] { - "Autoroute.PromoteToHomePage", - "true"}); -#line 36 - testRunner.And("I fill in", ((string)(null)), table3, "And "); -#line 40 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 41 - testRunner.And("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 42 - testRunner.Then("I should see \"

      Another

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 43 - testRunner.When("I go to \"another\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 44 - testRunner.Then("the status should be 404 \"Not Found\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 47 - testRunner.When("I go to \"Admin/Contents/Create/Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table4.AddRow(new string[] { - "Title.Title", - "Drafty"}); - table4.AddRow(new string[] { - "Autoroute.PromoteToHomePage", - "true"}); -#line 48 - testRunner.And("I fill in", ((string)(null)), table4, "And "); -#line 52 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 53 - testRunner.And("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 54 - testRunner.Then("I should see \"

      Another

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - } -} -#pragma warning restore -#endregion +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.9.0.77 +// SpecFlow Generator Version:1.9.0.0 +// Runtime Version:4.0.30319.0 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +#pragma warning disable +namespace Orchard.Specs +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("Pages")] + public partial class PagesFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "Pages.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Pages", " In order to add content pages to my site\r\n As an author\r\n I want to create, p" + + "ublish and edit pages", ProgrammingLanguage.CSharp, ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + [NUnit.Framework.SetUpAttribute()] + public virtual void TestInitialize() + { + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + public virtual void ScenarioCleanup() + { + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("In the admin (menu) there is a link to create a Page")] + public virtual void InTheAdminMenuThereIsALinkToCreateAPage() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("In the admin (menu) there is a link to create a Page", ((string[])(null))); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 9 + testRunner.When("I go to \"Admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 10 + testRunner.Then("I should see \"]*>Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 13 + testRunner.When("I go to \"Admin/Contents/Create/Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table1.AddRow(new string[] { + "Title.Title", + "Super Duper"}); + table1.AddRow(new string[] { + "LayoutPart.LayoutEditor.Data", + @"{ ""type"": ""Content"", ""data"": ""TypeName=Orchard.Layouts.Elements.Text&Content=This+is+super"", ""isTemplated"": false, ""contentType"": ""Orchard.Layouts.Elements.Text"", ""contentTypeLabel"": ""Text"", ""contentTypeClass"": ""text"", ""html"": ""This is super"", ""hasEditor"": true }"}); +#line 14 + testRunner.And("I fill in", ((string)(null)), table1, "And "); +#line 18 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 19 + testRunner.And("I go to \"super-duper\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 20 + testRunner.Then("I should see \"]*>.*?Super Duper.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 21 + testRunner.And("I should see \"This is super.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 24 + testRunner.When("I go to \"Admin/Contents/Create/Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table2.AddRow(new string[] { + "Title.Title", + "Super Duper"}); + table2.AddRow(new string[] { + "LayoutPart.LayoutEditor.Data", + @"{ ""type"": ""Content"", ""data"": ""TypeName=Orchard.Layouts.Elements.Text&Content=This+is+super+number+two"", ""isTemplated"": false, ""contentType"": ""Orchard.Layouts.Elements.Text"", ""contentTypeLabel"": ""Text"", ""contentTypeClass"": ""text"", ""html"": ""This is super number two"", ""hasEditor"": true }"}); +#line 25 + testRunner.And("I fill in", ((string)(null)), table2, "And "); +#line 29 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 30 + testRunner.And("I go to \"super-duper-2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 31 + testRunner.Then("I should see \"]*>.*?Super Duper.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 32 + testRunner.And("I should see \"This is super number two.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 35 + testRunner.When("I go to \"Admin/Contents/Create/Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table3.AddRow(new string[] { + "Title.Title", + "Another"}); + table3.AddRow(new string[] { + "Autoroute.PromoteToHomePage", + "true"}); +#line 36 + testRunner.And("I fill in", ((string)(null)), table3, "And "); +#line 40 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 41 + testRunner.And("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 42 + testRunner.Then("I should see \"

      Another

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 43 + testRunner.When("I go to \"another\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 44 + testRunner.Then("the status should be 404 \"Not Found\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 47 + testRunner.When("I go to \"Admin/Contents/Create/Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table4.AddRow(new string[] { + "Title.Title", + "Drafty"}); + table4.AddRow(new string[] { + "Autoroute.PromoteToHomePage", + "true"}); +#line 48 + testRunner.And("I fill in", ((string)(null)), table4, "And "); +#line 52 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 53 + testRunner.And("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 54 + testRunner.Then("I should see \"

      Another

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + } +} +#pragma warning restore +#endregion diff --git a/src/Orchard.Specs/PermissionModel.feature b/src/Orchard.Specs/PermissionModel.feature index aa480a61464..9af33e5bcf8 100644 --- a/src/Orchard.Specs/PermissionModel.feature +++ b/src/Orchard.Specs/PermissionModel.feature @@ -1,29 +1,29 @@ -Feature: Addition - In order to prevent security model regressions - As a user with specific permissions - I should to be granted or denied access to various actions - -@security -Scenario: Login can be automated - Given I have installed Orchard - And I have a user "bob" with permissions "AccessFrontEnd" - When I go to "users/account/logoff" - And I go to "users/account/logon" - And I fill in - | name | value | - | userNameOrEmail | bob | - | password | qwerty123! | - And I hit "Sign In" - And I am redirected - Then I should see "Welcome" - And I should see "bob" - -@security -Scenario: Anonymous user can see the home page but not the dashboard - Given I have installed Orchard - And I have a user "bob" with permissions "AccessFrontEnd" - When I sign in as "bob" - And I go to "/" - Then I should see "this is the homepage of your new site" - And I should be denied access when I go to "admin" - +Feature: Addition + In order to prevent security model regressions + As a user with specific permissions + I should to be granted or denied access to various actions + +@security +Scenario: Login can be automated + Given I have installed Orchard + And I have a user "bob" with permissions "AccessFrontEnd" + When I go to "users/account/logoff" + And I go to "users/account/logon" + And I fill in + | name | value | + | userNameOrEmail | bob | + | password | qwerty123! | + And I hit "Sign In" + And I am redirected + Then I should see "Welcome" + And I should see "bob" + +@security +Scenario: Anonymous user can see the home page but not the dashboard + Given I have installed Orchard + And I have a user "bob" with permissions "AccessFrontEnd" + When I sign in as "bob" + And I go to "/" + Then I should see "this is the homepage of your new site" + And I should be denied access when I go to "admin" + diff --git a/src/Orchard.Specs/PermissionModel.feature.cs b/src/Orchard.Specs/PermissionModel.feature.cs index 5d5cdd39124..c30c3a4658f 100644 --- a/src/Orchard.Specs/PermissionModel.feature.cs +++ b/src/Orchard.Specs/PermissionModel.feature.cs @@ -1,136 +1,136 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by SpecFlow (http://www.specflow.org/). -// SpecFlow Version:1.9.0.77 -// SpecFlow Generator Version:1.9.0.0 -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ -#region Designer generated code -#pragma warning disable -namespace Orchard.Specs -{ - using TechTalk.SpecFlow; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [NUnit.Framework.TestFixtureAttribute()] - [NUnit.Framework.DescriptionAttribute("Addition")] - public partial class AdditionFeature - { - - private static TechTalk.SpecFlow.ITestRunner testRunner; - -#line 1 "PermissionModel.feature" -#line hidden - - [NUnit.Framework.TestFixtureSetUpAttribute()] - public virtual void FeatureSetup() - { - testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Addition", " In order to prevent security model regressions\r\n As a user with specific permi" + - "ssions\r\n I should to be granted or denied access to various actions", ProgrammingLanguage.CSharp, ((string[])(null))); - testRunner.OnFeatureStart(featureInfo); - } - - [NUnit.Framework.TestFixtureTearDownAttribute()] - public virtual void FeatureTearDown() - { - testRunner.OnFeatureEnd(); - testRunner = null; - } - - [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() - { - } - - [NUnit.Framework.TearDownAttribute()] - public virtual void ScenarioTearDown() - { - testRunner.OnScenarioEnd(); - } - - public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) - { - testRunner.OnScenarioStart(scenarioInfo); - } - - public virtual void ScenarioCleanup() - { - testRunner.CollectScenarioErrors(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Login can be automated")] - [NUnit.Framework.CategoryAttribute("security")] - public virtual void LoginCanBeAutomated() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Login can be automated", new string[] { - "security"}); -#line 7 -this.ScenarioSetup(scenarioInfo); -#line 8 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 9 - testRunner.And("I have a user \"bob\" with permissions \"AccessFrontEnd\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 10 - testRunner.When("I go to \"users/account/logoff\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 11 - testRunner.And("I go to \"users/account/logon\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table1.AddRow(new string[] { - "userNameOrEmail", - "bob"}); - table1.AddRow(new string[] { - "password", - "qwerty123!"}); -#line 12 - testRunner.And("I fill in", ((string)(null)), table1, "And "); -#line 16 - testRunner.And("I hit \"Sign In\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 17 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 18 - testRunner.Then("I should see \"Welcome\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 19 - testRunner.And("I should see \"bob\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Anonymous user can see the home page but not the dashboard")] - [NUnit.Framework.CategoryAttribute("security")] - public virtual void AnonymousUserCanSeeTheHomePageButNotTheDashboard() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Anonymous user can see the home page but not the dashboard", new string[] { - "security"}); -#line 22 -this.ScenarioSetup(scenarioInfo); -#line 23 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 24 - testRunner.And("I have a user \"bob\" with permissions \"AccessFrontEnd\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 25 - testRunner.When("I sign in as \"bob\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 26 - testRunner.And("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 27 - testRunner.Then("I should see \"this is the homepage of your new site\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 28 - testRunner.And("I should be denied access when I go to \"admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - } -} -#pragma warning restore -#endregion +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.9.0.77 +// SpecFlow Generator Version:1.9.0.0 +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +#pragma warning disable +namespace Orchard.Specs +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("Addition")] + public partial class AdditionFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "PermissionModel.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Addition", " In order to prevent security model regressions\r\n As a user with specific permi" + + "ssions\r\n I should to be granted or denied access to various actions", ProgrammingLanguage.CSharp, ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + [NUnit.Framework.SetUpAttribute()] + public virtual void TestInitialize() + { + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + public virtual void ScenarioCleanup() + { + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Login can be automated")] + [NUnit.Framework.CategoryAttribute("security")] + public virtual void LoginCanBeAutomated() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Login can be automated", new string[] { + "security"}); +#line 7 +this.ScenarioSetup(scenarioInfo); +#line 8 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 9 + testRunner.And("I have a user \"bob\" with permissions \"AccessFrontEnd\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 10 + testRunner.When("I go to \"users/account/logoff\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 11 + testRunner.And("I go to \"users/account/logon\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table1.AddRow(new string[] { + "userNameOrEmail", + "bob"}); + table1.AddRow(new string[] { + "password", + "qwerty123!"}); +#line 12 + testRunner.And("I fill in", ((string)(null)), table1, "And "); +#line 16 + testRunner.And("I hit \"Sign In\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 17 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 18 + testRunner.Then("I should see \"Welcome\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 19 + testRunner.And("I should see \"bob\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Anonymous user can see the home page but not the dashboard")] + [NUnit.Framework.CategoryAttribute("security")] + public virtual void AnonymousUserCanSeeTheHomePageButNotTheDashboard() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Anonymous user can see the home page but not the dashboard", new string[] { + "security"}); +#line 22 +this.ScenarioSetup(scenarioInfo); +#line 23 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 24 + testRunner.And("I have a user \"bob\" with permissions \"AccessFrontEnd\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 25 + testRunner.When("I sign in as \"bob\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 26 + testRunner.And("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 27 + testRunner.Then("I should see \"this is the homepage of your new site\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 28 + testRunner.And("I should be denied access when I go to \"admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + } +} +#pragma warning restore +#endregion diff --git a/src/Orchard.Specs/Properties/AssemblyInfo.cs b/src/Orchard.Specs/Properties/AssemblyInfo.cs index be243121849..e167db0df75 100644 --- a/src/Orchard.Specs/Properties/AssemblyInfo.cs +++ b/src/Orchard.Specs/Properties/AssemblyInfo.cs @@ -1,34 +1,34 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Orchard.Specs")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyProduct("Orchard")] -[assembly: AssemblyCopyright("Copyright © .NET Foundation")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("c33d89c4-824c-4859-bd89-695aa1efd17b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.9.2")] -[assembly: AssemblyFileVersion("1.9.2")] +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Orchard.Specs")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyProduct("Orchard")] +[assembly: AssemblyCopyright("Copyright © .NET Foundation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c33d89c4-824c-4859-bd89-695aa1efd17b")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.9.2")] +[assembly: AssemblyFileVersion("1.9.2")] diff --git a/src/Orchard.Specs/Setup.feature b/src/Orchard.Specs/Setup.feature index de394b9de01..762644243c5 100644 --- a/src/Orchard.Specs/Setup.feature +++ b/src/Orchard.Specs/Setup.feature @@ -1,55 +1,55 @@ -Feature: Setup - In order to install orchard - As a new user - I want to setup a new site from the default screen - -Scenario: Root request shows setup form - Given I have a clean site with - | extension | names | - | Module | Orchard.Setup, Orchard.Layouts, Orchard.Pages, Orchard.ContentPicker, Orchard.Blogs, Orchard.MediaLibrary, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Scripting, Orchard.Widgets, Orchard.Users, Orchard.ContentTypes, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce, Orchard.Recipes, Orchard.Warmup, Orchard.Alias, Orchard.Forms, Orchard.Tokens, Orchard.Autoroute, Orchard.Projections, Orchard.Fields, Orchard.MediaProcessing, Orchard.OutputCache, Orchard.Taxonomies, Orchard.Workflows, Orchard.Scripting.CSharp | - | Core | Common, Containers, Dashboard, Feeds, Navigation, Contents, Scheduling, Settings, Shapes, XmlRpc, Title, Reports | - | Theme | SafeMode | - When I go to "/" - Then I should see "Welcome to Orchard" - And I should see "Finish Setup" - And the status should be 200 "OK" - -Scenario: Setup folder also shows setup form - Given I have a clean site with - | extension | names | - | Module | Orchard.Setup, Orchard.Layouts, Orchard.Pages, Orchard.ContentPicker, Orchard.Blogs, Orchard.MediaLibrary, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Scripting, Orchard.Widgets, Orchard.Users, Orchard.ContentTypes, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce, Orchard.Recipes, Orchard.Warmup, Orchard.Alias, Orchard.Forms, Orchard.Tokens, Orchard.Autoroute, Orchard.Projections, Orchard.Fields, Orchard.MediaProcessing, Orchard.OutputCache, Orchard.Taxonomies, Orchard.Workflows, Orchard.Scripting.CSharp | - | Core | Common, Containers, Dashboard, Feeds, Navigation, Contents, Scheduling, Settings, Shapes, XmlRpc, Title, Reports | - | Theme | SafeMode | - When I go to "/Setup" - Then I should see "Welcome to Orchard" - And I should see "Finish Setup" - And the status should be 200 "OK" - -Scenario: Some of the initial form values are required - Given I have a clean site with - | extension | names | - | Module | Orchard.Setup, Orchard.Layouts, Orchard.Pages, Orchard.ContentPicker, Orchard.Blogs, Orchard.MediaLibrary, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Scripting, Orchard.Widgets, Orchard.Users, Orchard.ContentTypes, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce, Orchard.Recipes, Orchard.Warmup, Orchard.Alias, Orchard.Forms, Orchard.Tokens, Orchard.Autoroute, Orchard.Projections, Orchard.Fields, Orchard.MediaProcessing, Orchard.OutputCache, Orchard.Taxonomies, Orchard.Workflows, Orchard.Scripting.CSharp | - | Core | Common, Containers, Dashboard, Feeds, Navigation, Contents, Scheduling, Settings, Shapes, XmlRpc, Title, Reports | - | Theme | SafeMode | - When I go to "/Setup" - And I hit "Finish Setup" - Then I should see "Site name is required." - And I should see "Password is required." - And I should see "Password confirmation is required." - -Scenario: Calling setup on a brand new install - Given I have a clean site with - | extension | names | - | Module | Orchard.Setup, Orchard.Layouts, Orchard.Pages, Orchard.ContentPicker, Orchard.Blogs, Orchard.MediaLibrary, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Scripting, Orchard.Widgets, Orchard.Users, Orchard.ContentTypes, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce, Orchard.Recipes, Orchard.Warmup, Orchard.Alias, Orchard.Forms, Orchard.Tokens, Orchard.Autoroute, Orchard.Projections, Orchard.Fields, Orchard.MediaProcessing, Orchard.OutputCache, Orchard.Taxonomies, Orchard.Workflows, Orchard.Scripting.CSharp | - | Core | Common, Containers, Dashboard, Feeds, Navigation, Contents, Scheduling, Settings, Shapes, XmlRpc, Title, Reports | - | Theme | SafeMode, TheAdmin, TheThemeMachine | - And I am on "/Setup" - When I fill in - | name | value | - | SiteName | My Site | - | AdminPassword | 6655321 | - | ConfirmPassword | 6655321 | - And I hit "Finish Setup" - And I go to "/" - Then I should see "My Site" - And I should see "Welcome, admin!" +Feature: Setup + In order to install orchard + As a new user + I want to setup a new site from the default screen + +Scenario: Root request shows setup form + Given I have a clean site with + | extension | names | + | Module | Orchard.Setup, Orchard.Layouts, Orchard.Pages, Orchard.ContentPicker, Orchard.Blogs, Orchard.MediaLibrary, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Scripting, Orchard.Widgets, Orchard.Users, Orchard.ContentTypes, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce, Orchard.Recipes, Orchard.Warmup, Orchard.Alias, Orchard.Forms, Orchard.Tokens, Orchard.Autoroute, Orchard.Projections, Orchard.Fields, Orchard.MediaProcessing, Orchard.OutputCache, Orchard.Taxonomies, Orchard.Workflows, Orchard.Scripting.CSharp | + | Core | Common, Containers, Dashboard, Feeds, Navigation, Contents, Scheduling, Settings, Shapes, XmlRpc, Title, Reports | + | Theme | SafeMode | + When I go to "/" + Then I should see "Welcome to Orchard" + And I should see "Finish Setup" + And the status should be 200 "OK" + +Scenario: Setup folder also shows setup form + Given I have a clean site with + | extension | names | + | Module | Orchard.Setup, Orchard.Layouts, Orchard.Pages, Orchard.ContentPicker, Orchard.Blogs, Orchard.MediaLibrary, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Scripting, Orchard.Widgets, Orchard.Users, Orchard.ContentTypes, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce, Orchard.Recipes, Orchard.Warmup, Orchard.Alias, Orchard.Forms, Orchard.Tokens, Orchard.Autoroute, Orchard.Projections, Orchard.Fields, Orchard.MediaProcessing, Orchard.OutputCache, Orchard.Taxonomies, Orchard.Workflows, Orchard.Scripting.CSharp | + | Core | Common, Containers, Dashboard, Feeds, Navigation, Contents, Scheduling, Settings, Shapes, XmlRpc, Title, Reports | + | Theme | SafeMode | + When I go to "/Setup" + Then I should see "Welcome to Orchard" + And I should see "Finish Setup" + And the status should be 200 "OK" + +Scenario: Some of the initial form values are required + Given I have a clean site with + | extension | names | + | Module | Orchard.Setup, Orchard.Layouts, Orchard.Pages, Orchard.ContentPicker, Orchard.Blogs, Orchard.MediaLibrary, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Scripting, Orchard.Widgets, Orchard.Users, Orchard.ContentTypes, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce, Orchard.Recipes, Orchard.Warmup, Orchard.Alias, Orchard.Forms, Orchard.Tokens, Orchard.Autoroute, Orchard.Projections, Orchard.Fields, Orchard.MediaProcessing, Orchard.OutputCache, Orchard.Taxonomies, Orchard.Workflows, Orchard.Scripting.CSharp | + | Core | Common, Containers, Dashboard, Feeds, Navigation, Contents, Scheduling, Settings, Shapes, XmlRpc, Title, Reports | + | Theme | SafeMode | + When I go to "/Setup" + And I hit "Finish Setup" + Then I should see "Site name is required." + And I should see "Password is required." + And I should see "Password confirmation is required." + +Scenario: Calling setup on a brand new install + Given I have a clean site with + | extension | names | + | Module | Orchard.Setup, Orchard.Layouts, Orchard.Pages, Orchard.ContentPicker, Orchard.Blogs, Orchard.MediaLibrary, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Scripting, Orchard.Widgets, Orchard.Users, Orchard.ContentTypes, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce, Orchard.Recipes, Orchard.Warmup, Orchard.Alias, Orchard.Forms, Orchard.Tokens, Orchard.Autoroute, Orchard.Projections, Orchard.Fields, Orchard.MediaProcessing, Orchard.OutputCache, Orchard.Taxonomies, Orchard.Workflows, Orchard.Scripting.CSharp | + | Core | Common, Containers, Dashboard, Feeds, Navigation, Contents, Scheduling, Settings, Shapes, XmlRpc, Title, Reports | + | Theme | SafeMode, TheAdmin, TheThemeMachine | + And I am on "/Setup" + When I fill in + | name | value | + | SiteName | My Site | + | AdminPassword | 6655321 | + | ConfirmPassword | 6655321 | + And I hit "Finish Setup" + And I go to "/" + Then I should see "My Site" + And I should see "Welcome, admin!" diff --git a/src/Orchard.Specs/Setup.feature.cs b/src/Orchard.Specs/Setup.feature.cs index a46b066efc7..2797e9ea603 100644 --- a/src/Orchard.Specs/Setup.feature.cs +++ b/src/Orchard.Specs/Setup.feature.cs @@ -1,230 +1,230 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by SpecFlow (http://www.specflow.org/). -// SpecFlow Version:1.9.0.77 -// SpecFlow Generator Version:1.9.0.0 -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ -#region Designer generated code -#pragma warning disable -namespace Orchard.Specs -{ - using TechTalk.SpecFlow; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [NUnit.Framework.TestFixtureAttribute()] - [NUnit.Framework.DescriptionAttribute("Setup")] - public partial class SetupFeature - { - - private static TechTalk.SpecFlow.ITestRunner testRunner; - -#line 1 "Setup.feature" -#line hidden - - [NUnit.Framework.TestFixtureSetUpAttribute()] - public virtual void FeatureSetup() - { - testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Setup", " In order to install orchard\r\n As a new user\r\n I want to setup a new site from" + - " the default screen", ProgrammingLanguage.CSharp, ((string[])(null))); - testRunner.OnFeatureStart(featureInfo); - } - - [NUnit.Framework.TestFixtureTearDownAttribute()] - public virtual void FeatureTearDown() - { - testRunner.OnFeatureEnd(); - testRunner = null; - } - - [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() - { - } - - [NUnit.Framework.TearDownAttribute()] - public virtual void ScenarioTearDown() - { - testRunner.OnScenarioEnd(); - } - - public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) - { - testRunner.OnScenarioStart(scenarioInfo); - } - - public virtual void ScenarioCleanup() - { - testRunner.CollectScenarioErrors(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Root request shows setup form")] - public virtual void RootRequestShowsSetupForm() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Root request shows setup form", ((string[])(null))); -#line 6 -this.ScenarioSetup(scenarioInfo); -#line hidden - TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { - "extension", - "names"}); - table1.AddRow(new string[] { - "Module", - @"Orchard.Setup, Orchard.Layouts, Orchard.Pages, Orchard.ContentPicker, Orchard.Blogs, Orchard.MediaLibrary, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Scripting, Orchard.Widgets, Orchard.Users, Orchard.ContentTypes, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce, Orchard.Recipes, Orchard.Warmup, Orchard.Alias, Orchard.Forms, Orchard.Tokens, Orchard.Autoroute, Orchard.Projections, Orchard.Fields, Orchard.MediaProcessing, Orchard.OutputCache, Orchard.Taxonomies, Orchard.Workflows, Orchard.Scripting.CSharp"}); - table1.AddRow(new string[] { - "Core", - "Common, Containers, Dashboard, Feeds, Navigation, Contents, Scheduling, Settings," + - " Shapes, XmlRpc, Title, Reports"}); - table1.AddRow(new string[] { - "Theme", - "SafeMode"}); -#line 7 - testRunner.Given("I have a clean site with", ((string)(null)), table1, "Given "); -#line 12 - testRunner.When("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 13 - testRunner.Then("I should see \"Welcome to Orchard\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 14 - testRunner.And("I should see \"Finish Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 15 - testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Setup folder also shows setup form")] - public virtual void SetupFolderAlsoShowsSetupForm() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Setup folder also shows setup form", ((string[])(null))); -#line 17 -this.ScenarioSetup(scenarioInfo); -#line hidden - TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { - "extension", - "names"}); - table2.AddRow(new string[] { - "Module", - @"Orchard.Setup, Orchard.Layouts, Orchard.Pages, Orchard.ContentPicker, Orchard.Blogs, Orchard.MediaLibrary, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Scripting, Orchard.Widgets, Orchard.Users, Orchard.ContentTypes, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce, Orchard.Recipes, Orchard.Warmup, Orchard.Alias, Orchard.Forms, Orchard.Tokens, Orchard.Autoroute, Orchard.Projections, Orchard.Fields, Orchard.MediaProcessing, Orchard.OutputCache, Orchard.Taxonomies, Orchard.Workflows, Orchard.Scripting.CSharp"}); - table2.AddRow(new string[] { - "Core", - "Common, Containers, Dashboard, Feeds, Navigation, Contents, Scheduling, Settings," + - " Shapes, XmlRpc, Title, Reports"}); - table2.AddRow(new string[] { - "Theme", - "SafeMode"}); -#line 18 - testRunner.Given("I have a clean site with", ((string)(null)), table2, "Given "); -#line 23 - testRunner.When("I go to \"/Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 24 - testRunner.Then("I should see \"Welcome to Orchard\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 25 - testRunner.And("I should see \"Finish Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 26 - testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Some of the initial form values are required")] - public virtual void SomeOfTheInitialFormValuesAreRequired() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Some of the initial form values are required", ((string[])(null))); -#line 28 -this.ScenarioSetup(scenarioInfo); -#line hidden - TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { - "extension", - "names"}); - table3.AddRow(new string[] { - "Module", - @"Orchard.Setup, Orchard.Layouts, Orchard.Pages, Orchard.ContentPicker, Orchard.Blogs, Orchard.MediaLibrary, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Scripting, Orchard.Widgets, Orchard.Users, Orchard.ContentTypes, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce, Orchard.Recipes, Orchard.Warmup, Orchard.Alias, Orchard.Forms, Orchard.Tokens, Orchard.Autoroute, Orchard.Projections, Orchard.Fields, Orchard.MediaProcessing, Orchard.OutputCache, Orchard.Taxonomies, Orchard.Workflows, Orchard.Scripting.CSharp"}); - table3.AddRow(new string[] { - "Core", - "Common, Containers, Dashboard, Feeds, Navigation, Contents, Scheduling, Settings," + - " Shapes, XmlRpc, Title, Reports"}); - table3.AddRow(new string[] { - "Theme", - "SafeMode"}); -#line 29 - testRunner.Given("I have a clean site with", ((string)(null)), table3, "Given "); -#line 34 - testRunner.When("I go to \"/Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 35 - testRunner.And("I hit \"Finish Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 36 - testRunner.Then("I should see \"Site name is required.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 37 - testRunner.And("I should see \"Password is required.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 38 - testRunner.And("I should see \"Password confirmation is required.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Calling setup on a brand new install")] - public virtual void CallingSetupOnABrandNewInstall() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Calling setup on a brand new install", ((string[])(null))); -#line 40 -this.ScenarioSetup(scenarioInfo); -#line hidden - TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] { - "extension", - "names"}); - table4.AddRow(new string[] { - "Module", - @"Orchard.Setup, Orchard.Layouts, Orchard.Pages, Orchard.ContentPicker, Orchard.Blogs, Orchard.MediaLibrary, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Scripting, Orchard.Widgets, Orchard.Users, Orchard.ContentTypes, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce, Orchard.Recipes, Orchard.Warmup, Orchard.Alias, Orchard.Forms, Orchard.Tokens, Orchard.Autoroute, Orchard.Projections, Orchard.Fields, Orchard.MediaProcessing, Orchard.OutputCache, Orchard.Taxonomies, Orchard.Workflows, Orchard.Scripting.CSharp"}); - table4.AddRow(new string[] { - "Core", - "Common, Containers, Dashboard, Feeds, Navigation, Contents, Scheduling, Settings," + - " Shapes, XmlRpc, Title, Reports"}); - table4.AddRow(new string[] { - "Theme", - "SafeMode, TheAdmin, TheThemeMachine"}); -#line 41 - testRunner.Given("I have a clean site with", ((string)(null)), table4, "Given "); -#line 46 - testRunner.And("I am on \"/Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table5.AddRow(new string[] { - "SiteName", - "My Site"}); - table5.AddRow(new string[] { - "AdminPassword", - "6655321"}); - table5.AddRow(new string[] { - "ConfirmPassword", - "6655321"}); -#line 47 - testRunner.When("I fill in", ((string)(null)), table5, "When "); -#line 52 - testRunner.And("I hit \"Finish Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 53 - testRunner.And("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 54 - testRunner.Then("I should see \"My Site\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 55 - testRunner.And("I should see \"Welcome, admin<" + - "/strong>!\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - } -} -#pragma warning restore -#endregion +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.9.0.77 +// SpecFlow Generator Version:1.9.0.0 +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +#pragma warning disable +namespace Orchard.Specs +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("Setup")] + public partial class SetupFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "Setup.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Setup", " In order to install orchard\r\n As a new user\r\n I want to setup a new site from" + + " the default screen", ProgrammingLanguage.CSharp, ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + [NUnit.Framework.SetUpAttribute()] + public virtual void TestInitialize() + { + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + public virtual void ScenarioCleanup() + { + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Root request shows setup form")] + public virtual void RootRequestShowsSetupForm() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Root request shows setup form", ((string[])(null))); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line hidden + TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { + "extension", + "names"}); + table1.AddRow(new string[] { + "Module", + @"Orchard.Setup, Orchard.Layouts, Orchard.Pages, Orchard.ContentPicker, Orchard.Blogs, Orchard.MediaLibrary, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Scripting, Orchard.Widgets, Orchard.Users, Orchard.ContentTypes, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce, Orchard.Recipes, Orchard.Warmup, Orchard.Alias, Orchard.Forms, Orchard.Tokens, Orchard.Autoroute, Orchard.Projections, Orchard.Fields, Orchard.MediaProcessing, Orchard.OutputCache, Orchard.Taxonomies, Orchard.Workflows, Orchard.Scripting.CSharp"}); + table1.AddRow(new string[] { + "Core", + "Common, Containers, Dashboard, Feeds, Navigation, Contents, Scheduling, Settings," + + " Shapes, XmlRpc, Title, Reports"}); + table1.AddRow(new string[] { + "Theme", + "SafeMode"}); +#line 7 + testRunner.Given("I have a clean site with", ((string)(null)), table1, "Given "); +#line 12 + testRunner.When("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 13 + testRunner.Then("I should see \"Welcome to Orchard\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 14 + testRunner.And("I should see \"Finish Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 15 + testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Setup folder also shows setup form")] + public virtual void SetupFolderAlsoShowsSetupForm() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Setup folder also shows setup form", ((string[])(null))); +#line 17 +this.ScenarioSetup(scenarioInfo); +#line hidden + TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { + "extension", + "names"}); + table2.AddRow(new string[] { + "Module", + @"Orchard.Setup, Orchard.Layouts, Orchard.Pages, Orchard.ContentPicker, Orchard.Blogs, Orchard.MediaLibrary, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Scripting, Orchard.Widgets, Orchard.Users, Orchard.ContentTypes, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce, Orchard.Recipes, Orchard.Warmup, Orchard.Alias, Orchard.Forms, Orchard.Tokens, Orchard.Autoroute, Orchard.Projections, Orchard.Fields, Orchard.MediaProcessing, Orchard.OutputCache, Orchard.Taxonomies, Orchard.Workflows, Orchard.Scripting.CSharp"}); + table2.AddRow(new string[] { + "Core", + "Common, Containers, Dashboard, Feeds, Navigation, Contents, Scheduling, Settings," + + " Shapes, XmlRpc, Title, Reports"}); + table2.AddRow(new string[] { + "Theme", + "SafeMode"}); +#line 18 + testRunner.Given("I have a clean site with", ((string)(null)), table2, "Given "); +#line 23 + testRunner.When("I go to \"/Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 24 + testRunner.Then("I should see \"Welcome to Orchard\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 25 + testRunner.And("I should see \"Finish Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 26 + testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Some of the initial form values are required")] + public virtual void SomeOfTheInitialFormValuesAreRequired() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Some of the initial form values are required", ((string[])(null))); +#line 28 +this.ScenarioSetup(scenarioInfo); +#line hidden + TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { + "extension", + "names"}); + table3.AddRow(new string[] { + "Module", + @"Orchard.Setup, Orchard.Layouts, Orchard.Pages, Orchard.ContentPicker, Orchard.Blogs, Orchard.MediaLibrary, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Scripting, Orchard.Widgets, Orchard.Users, Orchard.ContentTypes, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce, Orchard.Recipes, Orchard.Warmup, Orchard.Alias, Orchard.Forms, Orchard.Tokens, Orchard.Autoroute, Orchard.Projections, Orchard.Fields, Orchard.MediaProcessing, Orchard.OutputCache, Orchard.Taxonomies, Orchard.Workflows, Orchard.Scripting.CSharp"}); + table3.AddRow(new string[] { + "Core", + "Common, Containers, Dashboard, Feeds, Navigation, Contents, Scheduling, Settings," + + " Shapes, XmlRpc, Title, Reports"}); + table3.AddRow(new string[] { + "Theme", + "SafeMode"}); +#line 29 + testRunner.Given("I have a clean site with", ((string)(null)), table3, "Given "); +#line 34 + testRunner.When("I go to \"/Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 35 + testRunner.And("I hit \"Finish Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 36 + testRunner.Then("I should see \"Site name is required.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 37 + testRunner.And("I should see \"Password is required.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 38 + testRunner.And("I should see \"Password confirmation is required.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Calling setup on a brand new install")] + public virtual void CallingSetupOnABrandNewInstall() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Calling setup on a brand new install", ((string[])(null))); +#line 40 +this.ScenarioSetup(scenarioInfo); +#line hidden + TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] { + "extension", + "names"}); + table4.AddRow(new string[] { + "Module", + @"Orchard.Setup, Orchard.Layouts, Orchard.Pages, Orchard.ContentPicker, Orchard.Blogs, Orchard.MediaLibrary, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Scripting, Orchard.Widgets, Orchard.Users, Orchard.ContentTypes, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce, Orchard.Recipes, Orchard.Warmup, Orchard.Alias, Orchard.Forms, Orchard.Tokens, Orchard.Autoroute, Orchard.Projections, Orchard.Fields, Orchard.MediaProcessing, Orchard.OutputCache, Orchard.Taxonomies, Orchard.Workflows, Orchard.Scripting.CSharp"}); + table4.AddRow(new string[] { + "Core", + "Common, Containers, Dashboard, Feeds, Navigation, Contents, Scheduling, Settings," + + " Shapes, XmlRpc, Title, Reports"}); + table4.AddRow(new string[] { + "Theme", + "SafeMode, TheAdmin, TheThemeMachine"}); +#line 41 + testRunner.Given("I have a clean site with", ((string)(null)), table4, "Given "); +#line 46 + testRunner.And("I am on \"/Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table5.AddRow(new string[] { + "SiteName", + "My Site"}); + table5.AddRow(new string[] { + "AdminPassword", + "6655321"}); + table5.AddRow(new string[] { + "ConfirmPassword", + "6655321"}); +#line 47 + testRunner.When("I fill in", ((string)(null)), table5, "When "); +#line 52 + testRunner.And("I hit \"Finish Setup\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 53 + testRunner.And("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 54 + testRunner.Then("I should see \"My Site\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 55 + testRunner.And("I should see \"Welcome, admin<" + + "/strong>!\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + } +} +#pragma warning restore +#endregion diff --git a/src/Orchard.Specs/SiteCompilation.feature b/src/Orchard.Specs/SiteCompilation.feature index 565f4fe32de..83504130bba 100644 --- a/src/Orchard.Specs/SiteCompilation.feature +++ b/src/Orchard.Specs/SiteCompilation.feature @@ -1,24 +1,24 @@ -Feature: The compilation of modules installed in a site - In order to install on Orchard site - As a privileged user - I want to have the modules compiled/installed properly - -Scenario: Dynamic compilation can be disabled - Given I have chosen to load modules with dynamic compilation disabled - And I have installed Orchard - When I go to "admin" - Then I should see "
      Orchard v(?:\.\d+){2,4}
      " - -@ignore -Scenario: Dynamic compilation will kick in if modules are deployed as source files only - Given I have chosen to deploy modules as source files only - And I have installed Orchard - When I go to "admin" - Then I should see "
      Orchard v(?:\.\d+){2,4}
      " - -@ignore -Scenario: Dynamic compilation can be forced by disabling the precompiled module loader - Given I have chosen to load modules using dymamic compilation only - And I have installed Orchard - When I go to "admin" - Then I should see "
      Orchard v(?:\.\d+){2,4}
      " +Feature: The compilation of modules installed in a site + In order to install on Orchard site + As a privileged user + I want to have the modules compiled/installed properly + +Scenario: Dynamic compilation can be disabled + Given I have chosen to load modules with dynamic compilation disabled + And I have installed Orchard + When I go to "admin" + Then I should see "
      Orchard v(?:\.\d+){2,4}
      " + +@ignore +Scenario: Dynamic compilation will kick in if modules are deployed as source files only + Given I have chosen to deploy modules as source files only + And I have installed Orchard + When I go to "admin" + Then I should see "
      Orchard v(?:\.\d+){2,4}
      " + +@ignore +Scenario: Dynamic compilation can be forced by disabling the precompiled module loader + Given I have chosen to load modules using dymamic compilation only + And I have installed Orchard + When I go to "admin" + Then I should see "
      Orchard v(?:\.\d+){2,4}
      " diff --git a/src/Orchard.Specs/SiteCompilation.feature.cs b/src/Orchard.Specs/SiteCompilation.feature.cs index 79924449bb3..dfd3970734f 100644 --- a/src/Orchard.Specs/SiteCompilation.feature.cs +++ b/src/Orchard.Specs/SiteCompilation.feature.cs @@ -1,131 +1,131 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by SpecFlow (http://www.specflow.org/). -// SpecFlow Version:1.9.0.77 -// SpecFlow Generator Version:1.9.0.0 -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ -#region Designer generated code -#pragma warning disable -namespace Orchard.Specs -{ - using TechTalk.SpecFlow; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [NUnit.Framework.TestFixtureAttribute()] - [NUnit.Framework.DescriptionAttribute("The compilation of modules installed in a site")] - public partial class TheCompilationOfModulesInstalledInASiteFeature - { - - private static TechTalk.SpecFlow.ITestRunner testRunner; - -#line 1 "SiteCompilation.feature" -#line hidden - - [NUnit.Framework.TestFixtureSetUpAttribute()] - public virtual void FeatureSetup() - { - testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "The compilation of modules installed in a site", " In order to install on Orchard site\r\n As a privileged user\r\n I want to have t" + - "he modules compiled/installed properly", ProgrammingLanguage.CSharp, ((string[])(null))); - testRunner.OnFeatureStart(featureInfo); - } - - [NUnit.Framework.TestFixtureTearDownAttribute()] - public virtual void FeatureTearDown() - { - testRunner.OnFeatureEnd(); - testRunner = null; - } - - [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() - { - } - - [NUnit.Framework.TearDownAttribute()] - public virtual void ScenarioTearDown() - { - testRunner.OnScenarioEnd(); - } - - public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) - { - testRunner.OnScenarioStart(scenarioInfo); - } - - public virtual void ScenarioCleanup() - { - testRunner.CollectScenarioErrors(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Dynamic compilation can be disabled")] - public virtual void DynamicCompilationCanBeDisabled() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Dynamic compilation can be disabled", ((string[])(null))); -#line 6 -this.ScenarioSetup(scenarioInfo); -#line 7 - testRunner.Given("I have chosen to load modules with dynamic compilation disabled", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 8 - testRunner.And("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 9 - testRunner.When("I go to \"admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 10 - testRunner.Then("I should see \"
      Orchard v(?:\\.\\d+){2,4}
      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Dynamic compilation will kick in if modules are deployed as source files only")] - [NUnit.Framework.IgnoreAttribute()] - public virtual void DynamicCompilationWillKickInIfModulesAreDeployedAsSourceFilesOnly() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Dynamic compilation will kick in if modules are deployed as source files only", new string[] { - "ignore"}); -#line 13 -this.ScenarioSetup(scenarioInfo); -#line 14 - testRunner.Given("I have chosen to deploy modules as source files only", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 15 - testRunner.And("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 16 - testRunner.When("I go to \"admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 17 - testRunner.Then("I should see \"
      Orchard v(?:\\.\\d+){2,4}
      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Dynamic compilation can be forced by disabling the precompiled module loader")] - [NUnit.Framework.IgnoreAttribute()] - public virtual void DynamicCompilationCanBeForcedByDisablingThePrecompiledModuleLoader() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Dynamic compilation can be forced by disabling the precompiled module loader", new string[] { - "ignore"}); -#line 20 -this.ScenarioSetup(scenarioInfo); -#line 21 - testRunner.Given("I have chosen to load modules using dymamic compilation only", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 22 - testRunner.And("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 23 - testRunner.When("I go to \"admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 24 - testRunner.Then("I should see \"
      Orchard v(?:\\.\\d+){2,4}
      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - } -} -#pragma warning restore -#endregion +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.9.0.77 +// SpecFlow Generator Version:1.9.0.0 +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +#pragma warning disable +namespace Orchard.Specs +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("The compilation of modules installed in a site")] + public partial class TheCompilationOfModulesInstalledInASiteFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "SiteCompilation.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "The compilation of modules installed in a site", " In order to install on Orchard site\r\n As a privileged user\r\n I want to have t" + + "he modules compiled/installed properly", ProgrammingLanguage.CSharp, ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + [NUnit.Framework.SetUpAttribute()] + public virtual void TestInitialize() + { + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + public virtual void ScenarioCleanup() + { + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Dynamic compilation can be disabled")] + public virtual void DynamicCompilationCanBeDisabled() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Dynamic compilation can be disabled", ((string[])(null))); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 + testRunner.Given("I have chosen to load modules with dynamic compilation disabled", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 8 + testRunner.And("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 9 + testRunner.When("I go to \"admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 10 + testRunner.Then("I should see \"
      Orchard v(?:\\.\\d+){2,4}
      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Dynamic compilation will kick in if modules are deployed as source files only")] + [NUnit.Framework.IgnoreAttribute()] + public virtual void DynamicCompilationWillKickInIfModulesAreDeployedAsSourceFilesOnly() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Dynamic compilation will kick in if modules are deployed as source files only", new string[] { + "ignore"}); +#line 13 +this.ScenarioSetup(scenarioInfo); +#line 14 + testRunner.Given("I have chosen to deploy modules as source files only", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 15 + testRunner.And("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 16 + testRunner.When("I go to \"admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 17 + testRunner.Then("I should see \"
      Orchard v(?:\\.\\d+){2,4}
      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Dynamic compilation can be forced by disabling the precompiled module loader")] + [NUnit.Framework.IgnoreAttribute()] + public virtual void DynamicCompilationCanBeForcedByDisablingThePrecompiledModuleLoader() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Dynamic compilation can be forced by disabling the precompiled module loader", new string[] { + "ignore"}); +#line 20 +this.ScenarioSetup(scenarioInfo); +#line 21 + testRunner.Given("I have chosen to load modules using dymamic compilation only", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 22 + testRunner.And("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 23 + testRunner.When("I go to \"admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 24 + testRunner.Then("I should see \"
      Orchard v(?:\\.\\d+){2,4}
      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + } +} +#pragma warning restore +#endregion diff --git a/src/Orchard.Specs/Tags.feature b/src/Orchard.Specs/Tags.feature index af72b03e623..002255b5604 100644 --- a/src/Orchard.Specs/Tags.feature +++ b/src/Orchard.Specs/Tags.feature @@ -1,30 +1,30 @@ -Feature: Tags - In order to add tags to my content - As an author - I want to create, publish and edit pages - -Scenario: I can add a tag to a new Page - Given I have installed Orchard - When I go to "admin/contents/create/page" - And I fill in - | name | value | - | Title.Title | Super Duper | - | LayoutPart.LayoutEditor.Data | { "elements": [ { "typeName": "Orchard.Layouts.Elements.Text", "state": "Content=This+is+super."} ] } | - | Tags.Tags | Foo, Bar | - And I hit "Publish Now" - And I go to "super-duper" - Then I should see "]*>.*?Super Duper.*?" - And I should see "Foo" - And I should see "Bar" - -Scenario: I can't add a tag with disallowed chars to a new Page - Given I have installed Orchard - When I go to "admin/contents/create/page" - And I fill in - | name | value | - | Title.Title | Super Duper | - | LayoutPart.LayoutEditor.Data | { "elements": [ { "typeName": "Orchard.Layouts.Elements.Text", "state": "Content=This+is+super."} ] } | - | Tags.Tags | Foo, I <3 Orchard | - And I hit "Publish Now" - And I am redirected - Then I should see "forbidden chars" +Feature: Tags + In order to add tags to my content + As an author + I want to create, publish and edit pages + +Scenario: I can add a tag to a new Page + Given I have installed Orchard + When I go to "admin/contents/create/page" + And I fill in + | name | value | + | Title.Title | Super Duper | + | LayoutPart.LayoutEditor.Data | { "elements": [ { "typeName": "Orchard.Layouts.Elements.Text", "state": "Content=This+is+super."} ] } | + | Tags.Tags | Foo, Bar | + And I hit "Publish Now" + And I go to "super-duper" + Then I should see "]*>.*?Super Duper.*?" + And I should see "Foo" + And I should see "Bar" + +Scenario: I can't add a tag with disallowed chars to a new Page + Given I have installed Orchard + When I go to "admin/contents/create/page" + And I fill in + | name | value | + | Title.Title | Super Duper | + | LayoutPart.LayoutEditor.Data | { "elements": [ { "typeName": "Orchard.Layouts.Elements.Text", "state": "Content=This+is+super."} ] } | + | Tags.Tags | Foo, I <3 Orchard | + And I hit "Publish Now" + And I am redirected + Then I should see "forbidden chars" diff --git a/src/Orchard.Specs/Tags.feature.cs b/src/Orchard.Specs/Tags.feature.cs index ef767cd6175..8ca64c7f3df 100644 --- a/src/Orchard.Specs/Tags.feature.cs +++ b/src/Orchard.Specs/Tags.feature.cs @@ -1,148 +1,148 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by SpecFlow (http://www.specflow.org/). -// SpecFlow Version:1.9.0.77 -// SpecFlow Generator Version:1.9.0.0 -// Runtime Version:4.0.30319.0 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ -#region Designer generated code -#pragma warning disable -namespace Orchard.Specs -{ - using TechTalk.SpecFlow; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [NUnit.Framework.TestFixtureAttribute()] - [NUnit.Framework.DescriptionAttribute("Tags")] - public partial class TagsFeature - { - - private static TechTalk.SpecFlow.ITestRunner testRunner; - -#line 1 "Tags.feature" -#line hidden - - [NUnit.Framework.TestFixtureSetUpAttribute()] - public virtual void FeatureSetup() - { - testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Tags", " In order to add tags to my content\r\n As an author\r\n I want to create, publish" + - " and edit pages", ProgrammingLanguage.CSharp, ((string[])(null))); - testRunner.OnFeatureStart(featureInfo); - } - - [NUnit.Framework.TestFixtureTearDownAttribute()] - public virtual void FeatureTearDown() - { - testRunner.OnFeatureEnd(); - testRunner = null; - } - - [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() - { - } - - [NUnit.Framework.TearDownAttribute()] - public virtual void ScenarioTearDown() - { - testRunner.OnScenarioEnd(); - } - - public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) - { - testRunner.OnScenarioStart(scenarioInfo); - } - - public virtual void ScenarioCleanup() - { - testRunner.CollectScenarioErrors(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I can add a tag to a new Page")] - public virtual void ICanAddATagToANewPage() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can add a tag to a new Page", ((string[])(null))); -#line 6 -this.ScenarioSetup(scenarioInfo); -#line 7 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 8 - testRunner.When("I go to \"admin/contents/create/page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table1.AddRow(new string[] { - "Title.Title", - "Super Duper"}); - table1.AddRow(new string[] { - "LayoutPart.LayoutEditor.Data", - "{ \"elements\": [ { \"typeName\": \"Orchard.Layouts.Elements.Text\", \"state\": \"Content=" + - "This+is+super.\"} ] }"}); - table1.AddRow(new string[] { - "Tags.Tags", - "Foo, Bar"}); -#line 9 - testRunner.And("I fill in", ((string)(null)), table1, "And "); -#line 14 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 15 - testRunner.And("I go to \"super-duper\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 16 - testRunner.Then("I should see \"]*>.*?Super Duper.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 17 - testRunner.And("I should see \"Foo\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 18 - testRunner.And("I should see \"Bar\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I can\'t add a tag with disallowed chars to a new Page")] - public virtual void ICanTAddATagWithDisallowedCharsToANewPage() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can\'t add a tag with disallowed chars to a new Page", ((string[])(null))); -#line 20 -this.ScenarioSetup(scenarioInfo); -#line 21 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 22 - testRunner.When("I go to \"admin/contents/create/page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table2.AddRow(new string[] { - "Title.Title", - "Super Duper"}); - table2.AddRow(new string[] { - "LayoutPart.LayoutEditor.Data", - "{ \"elements\": [ { \"typeName\": \"Orchard.Layouts.Elements.Text\", \"state\": \"Content=" + - "This+is+super.\"} ] }"}); - table2.AddRow(new string[] { - "Tags.Tags", - "Foo, I <3 Orchard"}); -#line 23 - testRunner.And("I fill in", ((string)(null)), table2, "And "); -#line 28 - testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 29 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 30 - testRunner.Then("I should see \"forbidden chars\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - } -} -#pragma warning restore -#endregion +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.9.0.77 +// SpecFlow Generator Version:1.9.0.0 +// Runtime Version:4.0.30319.0 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +#pragma warning disable +namespace Orchard.Specs +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("Tags")] + public partial class TagsFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "Tags.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Tags", " In order to add tags to my content\r\n As an author\r\n I want to create, publish" + + " and edit pages", ProgrammingLanguage.CSharp, ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + [NUnit.Framework.SetUpAttribute()] + public virtual void TestInitialize() + { + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + public virtual void ScenarioCleanup() + { + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I can add a tag to a new Page")] + public virtual void ICanAddATagToANewPage() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can add a tag to a new Page", ((string[])(null))); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 8 + testRunner.When("I go to \"admin/contents/create/page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table1.AddRow(new string[] { + "Title.Title", + "Super Duper"}); + table1.AddRow(new string[] { + "LayoutPart.LayoutEditor.Data", + "{ \"elements\": [ { \"typeName\": \"Orchard.Layouts.Elements.Text\", \"state\": \"Content=" + + "This+is+super.\"} ] }"}); + table1.AddRow(new string[] { + "Tags.Tags", + "Foo, Bar"}); +#line 9 + testRunner.And("I fill in", ((string)(null)), table1, "And "); +#line 14 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 15 + testRunner.And("I go to \"super-duper\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 16 + testRunner.Then("I should see \"]*>.*?Super Duper.*?\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 17 + testRunner.And("I should see \"Foo\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 18 + testRunner.And("I should see \"Bar\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I can\'t add a tag with disallowed chars to a new Page")] + public virtual void ICanTAddATagWithDisallowedCharsToANewPage() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can\'t add a tag with disallowed chars to a new Page", ((string[])(null))); +#line 20 +this.ScenarioSetup(scenarioInfo); +#line 21 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 22 + testRunner.When("I go to \"admin/contents/create/page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table2.AddRow(new string[] { + "Title.Title", + "Super Duper"}); + table2.AddRow(new string[] { + "LayoutPart.LayoutEditor.Data", + "{ \"elements\": [ { \"typeName\": \"Orchard.Layouts.Elements.Text\", \"state\": \"Content=" + + "This+is+super.\"} ] }"}); + table2.AddRow(new string[] { + "Tags.Tags", + "Foo, I <3 Orchard"}); +#line 23 + testRunner.And("I fill in", ((string)(null)), table2, "And "); +#line 28 + testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 29 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 30 + testRunner.Then("I should see \"forbidden chars\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + } +} +#pragma warning restore +#endregion diff --git a/src/Orchard.Specs/Users.feature b/src/Orchard.Specs/Users.feature index dafcf1ebd80..22411febddd 100644 --- a/src/Orchard.Specs/Users.feature +++ b/src/Orchard.Specs/Users.feature @@ -1,320 +1,320 @@ -Feature: Users - In order to prevent users module regressions - As a site owner - I want to create, search and modify user accounts - -@management -Scenario: There is only one user by default - Given I have installed Orchard - When I go to "admin/users" - Then I should see "Users" - And I should see "]*>admin" - -@management -Scenario: I can create a new user - Given I have installed Orchard - When I go to "admin/users" - Then I should see "Users" - When I follow "Add a new user" - And I fill in - | name | value | - | UserName | user1 | - | Email | user1@domain.com | - | Password | a12345! | - | ConfirmPassword | a12345! | - And I hit "Save" - And I am redirected - Then I should see "User created" - When I follow "Add a new user" - And I fill in - | name | value | - | UserName | user2 | - | Email | user2@domain.com | - | Password | a12345! | - | ConfirmPassword | a12345! | - | UserRoles.Roles[0].Granted | true | - And I hit "Save" - And I am redirected - Then I should see "User created" - And I should see "Adding role Administrator to user user2" - When I follow "Add a new user" - And I fill in - | name | value | - | UserName | user3 | - | Email | user3@domain.com | - | Password | a12345! | - | ConfirmPassword | a12345! | - | UserRoles.Roles[0].Granted | true | - | UserRoles.Roles[1].Granted | true | - | UserRoles.Roles[2].Granted | true | - | UserRoles.Roles[3].Granted | true | - | UserRoles.Roles[4].Granted | true | - And I hit "Save" - And I am redirected - Then I should see "User created" - And I should see "Adding role Administrator to user user3" - And I should see "Adding role Editor to user user3" - And I should see "Adding role Moderator to user user3" - And I should see "Adding role Author to user user3" - And I should see "Adding role Contributor to user user3" - When I follow "Add a new user" - And I hit "Save" - Then I should see "The UserName field is required." - Then I should see "The Email field is required." - Then I should see "The Password field is required." - Then I should see "The ConfirmPassword field is required." - When I go to "admin/users" - And I follow "Add a new user" - And I fill in - | name | value | - | UserName | user4 | - | Email | user4@domain.com | - | Password | a12345! | - | ConfirmPassword | a123456! | - And I hit "Save" - Then I should see "Password confirmation must match" - -@management -Scenario: I can edit an existing user - Given I have installed Orchard - When I go to "admin/users" - And I follow "Add a new user" - And I fill in - | name | value | - | UserName | user1 | - | Email | user1@domain.com | - | Password | a12345! | - | ConfirmPassword | a12345! | - And I hit "Save" - And I am redirected - Then I should see "User created" - When I fill in - | name | value | - | Options.Search | user1 | - And I hit "Filter" - Then I should see "]*>user1" - When I follow "Edit" - And I fill in - | name | value | - | UserName | user2 | - | Email | user2@domain.com | - And I hit "Save" - And I am redirected - Then I should see "User information updated" - And I should see "]*>user2" - And I should see "user2@domain.com" - -@management -Scenario: I should not be able to reuse an existing username or email - Given I have installed Orchard - When I go to "admin/users" -# create user1 - And I follow "Add a new user" - And I fill in - | name | value | - | UserName | user1 | - | Email | user1@domain.com | - | Password | a12345! | - | ConfirmPassword | a12345! | - And I hit "Save" - And I am redirected -# create user2 - And I follow "Add a new user" - And I fill in - | name | value | - | UserName | user2 | - | Email | user2@domain.com | - | Password | a12345! | - | ConfirmPassword | a12345! | - And I hit "Save" - And I am redirected - Then I should see "]*>user1" - And I should see "]*>user2" -# filtering on 'user1' to have only one Edit link to follow - When I fill in - | name | value | - | Options.Search | user1 | - And I hit "Filter" - Then I should see "]*>user1" - When I follow "Edit" - And I fill in - | name | value | - | UserName | user2 | - | Email | user1@domain.com | - And I hit "Save" - Then I should see "User with that username and/or email already exists." - When I fill in - | name | value | - | UserName | user1 | - | Email | user2@domain.com | - And I hit "Save" - Then I should see "User with that username and/or email already exists." - -@management -@ignore -Scenario: I should be able to remove an existing user - Given I have installed Orchard - When I go to "admin/users" -# create user1 - And I follow "Add a new user" - And I fill in - | name | value | - | UserName | user1 | - | Email | user1@domain.com | - | Password | a12345! | - | ConfirmPassword | a12345! | - And I hit "Save" - And I am redirected - Then I should see "]*>user1" -# filtering on 'user1' to have only one Delete link to follow - When I fill in - | name | value | - | Options.Search | user1 | - And I hit "Filter" - Then I should see "]*>user1" - When I follow "Delete" - And I am redirected - Then I should see "User user1 deleted" - And I should not see "]*>user1" - -@filtering -Scenario: I should not be able to filter users by name - Given I have installed Orchard - When I go to "admin/users" -# create user1 - And I follow "Add a new user" - And I fill in - | name | value | - | UserName | user1 | - | Email | user1@domain.com | - | Password | a12345! | - | ConfirmPassword | a12345! | - And I hit "Save" - And I am redirected -# create user2 - And I follow "Add a new user" - And I fill in - | name | value | - | UserName | user2 | - | Email | user2@domain.com | - | Password | a12345! | - | ConfirmPassword | a12345! | - And I hit "Save" - And I am redirected - Then I should see "]*>user1" - And I should see "]*>user2" - When I fill in - | name | value | - | Options.Search | user1 | - And I hit "Filter" - Then I should see "]*>user1" - And I should not see "]*>admin" - And I should not see "]*>user2" - When I fill in - | name | value | - | Options.Search | user1@domain.com | - And I hit "Filter" - Then I should see "]*>user1" - And I should not see "]*>admin" - And I should not see "]*>user2" - When I fill in - | name | value | - | Options.Search | @domain.com | - And I hit "Filter" - Then I should see "]*>user1" - And I should see "]*>user2" - And I should not see "]*>admin" - -@filtering -Scenario: I should be able to filter users by status - Given I have installed Orchard - When I go to "admin/users" -# create user1 - And I follow "Add a new user" - And I fill in - | name | value | - | UserName | user1 | - | Email | user1@domain.com | - | Password | a12345! | - | ConfirmPassword | a12345! | - And I hit "Save" - And I am redirected -# create user2 - And I follow "Add a new user" - And I fill in - | name | value | - | UserName | user2 | - | Email | user2@domain.com | - | Password | a12345! | - | ConfirmPassword | a12345! | - And I hit "Save" - And I am redirected - Then I should see "]*>user1" - And I should see "]*>user2" - When I fill in - | name | value | - | Options.Search | user1 | - And I hit "Filter" - Then I should see "]*>user1" - When I hit "Disable" - And I am redirected - Then I should see "User user1 disabled" - When I fill in - | name | value | - | Options.Search | | - | Options.Filter | Pending | - And I hit "Filter" - Then I should see "]*>user1" - And I should not see "]*>user2" - And I should not see "]*>admin" - When I fill in - | name | value | - | Options.Search | | - | Options.Filter | EmailPending | - And I hit "Filter" - Then I should not see "]*>user1" - And I should not see "]*>user2" - And I should not see "]*>admin" - When I fill in - | name | value | - | Options.Search | | - | Options.Filter | Approved | - And I hit "Filter" - Then I should not see "]*>user1" - And I should see "]*>user2" - And I should see "]*>admin" - When I fill in - | name | value | - | Options.Search | | - | Options.Filter | All | - And I hit "Filter" - Then I should see "]*>user1" - And I should see "]*>user2" - And I should see "]*>admin" -@email -Scenario: I should not be able to add users with invalid email addresses - Given I have installed Orchard - When I go to "admin/users" - And I follow "Add a new user" - And I fill in - | name | value | - | UserName | user1 | - | Email | NotAnEmail | - | Password | a12345! | - | ConfirmPassword | a12345! | - And I hit "Save" - Then I should see "You must specify a valid email address." -@email -Scenario: I should be able to add users with valid email addresses - Given I have installed Orchard - When I go to "admin/users" - And I follow "Add a new user" - And I fill in - | name | value | - | UserName | user1 | - | Email | user1@domain.com | - | Password | a12345! | - | ConfirmPassword | a12345! | - And I hit "Save" - And I am redirected - Then I should see "User created" +Feature: Users + In order to prevent users module regressions + As a site owner + I want to create, search and modify user accounts + +@management +Scenario: There is only one user by default + Given I have installed Orchard + When I go to "admin/users" + Then I should see "Users" + And I should see "]*>admin" + +@management +Scenario: I can create a new user + Given I have installed Orchard + When I go to "admin/users" + Then I should see "Users" + When I follow "Add a new user" + And I fill in + | name | value | + | UserName | user1 | + | Email | user1@domain.com | + | Password | a12345! | + | ConfirmPassword | a12345! | + And I hit "Save" + And I am redirected + Then I should see "User created" + When I follow "Add a new user" + And I fill in + | name | value | + | UserName | user2 | + | Email | user2@domain.com | + | Password | a12345! | + | ConfirmPassword | a12345! | + | UserRoles.Roles[0].Granted | true | + And I hit "Save" + And I am redirected + Then I should see "User created" + And I should see "Adding role Administrator to user user2" + When I follow "Add a new user" + And I fill in + | name | value | + | UserName | user3 | + | Email | user3@domain.com | + | Password | a12345! | + | ConfirmPassword | a12345! | + | UserRoles.Roles[0].Granted | true | + | UserRoles.Roles[1].Granted | true | + | UserRoles.Roles[2].Granted | true | + | UserRoles.Roles[3].Granted | true | + | UserRoles.Roles[4].Granted | true | + And I hit "Save" + And I am redirected + Then I should see "User created" + And I should see "Adding role Administrator to user user3" + And I should see "Adding role Editor to user user3" + And I should see "Adding role Moderator to user user3" + And I should see "Adding role Author to user user3" + And I should see "Adding role Contributor to user user3" + When I follow "Add a new user" + And I hit "Save" + Then I should see "The UserName field is required." + Then I should see "The Email field is required." + Then I should see "The Password field is required." + Then I should see "The ConfirmPassword field is required." + When I go to "admin/users" + And I follow "Add a new user" + And I fill in + | name | value | + | UserName | user4 | + | Email | user4@domain.com | + | Password | a12345! | + | ConfirmPassword | a123456! | + And I hit "Save" + Then I should see "Password confirmation must match" + +@management +Scenario: I can edit an existing user + Given I have installed Orchard + When I go to "admin/users" + And I follow "Add a new user" + And I fill in + | name | value | + | UserName | user1 | + | Email | user1@domain.com | + | Password | a12345! | + | ConfirmPassword | a12345! | + And I hit "Save" + And I am redirected + Then I should see "User created" + When I fill in + | name | value | + | Options.Search | user1 | + And I hit "Filter" + Then I should see "]*>user1" + When I follow "Edit" + And I fill in + | name | value | + | UserName | user2 | + | Email | user2@domain.com | + And I hit "Save" + And I am redirected + Then I should see "User information updated" + And I should see "]*>user2" + And I should see "user2@domain.com" + +@management +Scenario: I should not be able to reuse an existing username or email + Given I have installed Orchard + When I go to "admin/users" +# create user1 + And I follow "Add a new user" + And I fill in + | name | value | + | UserName | user1 | + | Email | user1@domain.com | + | Password | a12345! | + | ConfirmPassword | a12345! | + And I hit "Save" + And I am redirected +# create user2 + And I follow "Add a new user" + And I fill in + | name | value | + | UserName | user2 | + | Email | user2@domain.com | + | Password | a12345! | + | ConfirmPassword | a12345! | + And I hit "Save" + And I am redirected + Then I should see "]*>user1" + And I should see "]*>user2" +# filtering on 'user1' to have only one Edit link to follow + When I fill in + | name | value | + | Options.Search | user1 | + And I hit "Filter" + Then I should see "]*>user1" + When I follow "Edit" + And I fill in + | name | value | + | UserName | user2 | + | Email | user1@domain.com | + And I hit "Save" + Then I should see "User with that username and/or email already exists." + When I fill in + | name | value | + | UserName | user1 | + | Email | user2@domain.com | + And I hit "Save" + Then I should see "User with that username and/or email already exists." + +@management +@ignore +Scenario: I should be able to remove an existing user + Given I have installed Orchard + When I go to "admin/users" +# create user1 + And I follow "Add a new user" + And I fill in + | name | value | + | UserName | user1 | + | Email | user1@domain.com | + | Password | a12345! | + | ConfirmPassword | a12345! | + And I hit "Save" + And I am redirected + Then I should see "]*>user1" +# filtering on 'user1' to have only one Delete link to follow + When I fill in + | name | value | + | Options.Search | user1 | + And I hit "Filter" + Then I should see "]*>user1" + When I follow "Delete" + And I am redirected + Then I should see "User user1 deleted" + And I should not see "]*>user1" + +@filtering +Scenario: I should not be able to filter users by name + Given I have installed Orchard + When I go to "admin/users" +# create user1 + And I follow "Add a new user" + And I fill in + | name | value | + | UserName | user1 | + | Email | user1@domain.com | + | Password | a12345! | + | ConfirmPassword | a12345! | + And I hit "Save" + And I am redirected +# create user2 + And I follow "Add a new user" + And I fill in + | name | value | + | UserName | user2 | + | Email | user2@domain.com | + | Password | a12345! | + | ConfirmPassword | a12345! | + And I hit "Save" + And I am redirected + Then I should see "]*>user1" + And I should see "]*>user2" + When I fill in + | name | value | + | Options.Search | user1 | + And I hit "Filter" + Then I should see "]*>user1" + And I should not see "]*>admin" + And I should not see "]*>user2" + When I fill in + | name | value | + | Options.Search | user1@domain.com | + And I hit "Filter" + Then I should see "]*>user1" + And I should not see "]*>admin" + And I should not see "]*>user2" + When I fill in + | name | value | + | Options.Search | @domain.com | + And I hit "Filter" + Then I should see "]*>user1" + And I should see "]*>user2" + And I should not see "]*>admin" + +@filtering +Scenario: I should be able to filter users by status + Given I have installed Orchard + When I go to "admin/users" +# create user1 + And I follow "Add a new user" + And I fill in + | name | value | + | UserName | user1 | + | Email | user1@domain.com | + | Password | a12345! | + | ConfirmPassword | a12345! | + And I hit "Save" + And I am redirected +# create user2 + And I follow "Add a new user" + And I fill in + | name | value | + | UserName | user2 | + | Email | user2@domain.com | + | Password | a12345! | + | ConfirmPassword | a12345! | + And I hit "Save" + And I am redirected + Then I should see "]*>user1" + And I should see "]*>user2" + When I fill in + | name | value | + | Options.Search | user1 | + And I hit "Filter" + Then I should see "]*>user1" + When I hit "Disable" + And I am redirected + Then I should see "User user1 disabled" + When I fill in + | name | value | + | Options.Search | | + | Options.Filter | Pending | + And I hit "Filter" + Then I should see "]*>user1" + And I should not see "]*>user2" + And I should not see "]*>admin" + When I fill in + | name | value | + | Options.Search | | + | Options.Filter | EmailPending | + And I hit "Filter" + Then I should not see "]*>user1" + And I should not see "]*>user2" + And I should not see "]*>admin" + When I fill in + | name | value | + | Options.Search | | + | Options.Filter | Approved | + And I hit "Filter" + Then I should not see "]*>user1" + And I should see "]*>user2" + And I should see "]*>admin" + When I fill in + | name | value | + | Options.Search | | + | Options.Filter | All | + And I hit "Filter" + Then I should see "]*>user1" + And I should see "]*>user2" + And I should see "]*>admin" +@email +Scenario: I should not be able to add users with invalid email addresses + Given I have installed Orchard + When I go to "admin/users" + And I follow "Add a new user" + And I fill in + | name | value | + | UserName | user1 | + | Email | NotAnEmail | + | Password | a12345! | + | ConfirmPassword | a12345! | + And I hit "Save" + Then I should see "You must specify a valid email address." +@email +Scenario: I should be able to add users with valid email addresses + Given I have installed Orchard + When I go to "admin/users" + And I follow "Add a new user" + And I fill in + | name | value | + | UserName | user1 | + | Email | user1@domain.com | + | Password | a12345! | + | ConfirmPassword | a12345! | + And I hit "Save" + And I am redirected + Then I should see "User created" diff --git a/src/Orchard.Specs/Users.feature.cs b/src/Orchard.Specs/Users.feature.cs index e1d2337e285..208fb618670 100644 --- a/src/Orchard.Specs/Users.feature.cs +++ b/src/Orchard.Specs/Users.feature.cs @@ -1,890 +1,890 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by SpecFlow (http://www.specflow.org/). -// SpecFlow Version:1.9.0.77 -// SpecFlow Generator Version:1.9.0.0 -// Runtime Version:4.0.30319.0 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ -#region Designer generated code -#pragma warning disable -namespace Orchard.Specs -{ - using TechTalk.SpecFlow; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [NUnit.Framework.TestFixtureAttribute()] - [NUnit.Framework.DescriptionAttribute("Users")] - public partial class UsersFeature - { - - private static TechTalk.SpecFlow.ITestRunner testRunner; - -#line 1 "Users.feature" -#line hidden - - [NUnit.Framework.TestFixtureSetUpAttribute()] - public virtual void FeatureSetup() - { - testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Users", " In order to prevent users module regressions\r\n As a site owner\r\n I want to cr" + - "eate, search and modify user accounts", ProgrammingLanguage.CSharp, ((string[])(null))); - testRunner.OnFeatureStart(featureInfo); - } - - [NUnit.Framework.TestFixtureTearDownAttribute()] - public virtual void FeatureTearDown() - { - testRunner.OnFeatureEnd(); - testRunner = null; - } - - [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() - { - } - - [NUnit.Framework.TearDownAttribute()] - public virtual void ScenarioTearDown() - { - testRunner.OnScenarioEnd(); - } - - public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) - { - testRunner.OnScenarioStart(scenarioInfo); - } - - public virtual void ScenarioCleanup() - { - testRunner.CollectScenarioErrors(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("There is only one user by default")] - [NUnit.Framework.CategoryAttribute("management")] - public virtual void ThereIsOnlyOneUserByDefault() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("There is only one user by default", new string[] { - "management"}); -#line 7 -this.ScenarioSetup(scenarioInfo); -#line 8 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 9 - testRunner.When("I go to \"admin/users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 10 - testRunner.Then("I should see \"Users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 11 - testRunner.And("I should see \"]*>admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I can create a new user")] - [NUnit.Framework.CategoryAttribute("management")] - public virtual void ICanCreateANewUser() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create a new user", new string[] { - "management"}); -#line 14 -this.ScenarioSetup(scenarioInfo); -#line 15 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 16 - testRunner.When("I go to \"admin/users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 17 - testRunner.Then("I should see \"Users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 18 - testRunner.When("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table1.AddRow(new string[] { - "UserName", - "user1"}); - table1.AddRow(new string[] { - "Email", - "user1@domain.com"}); - table1.AddRow(new string[] { - "Password", - "a12345!"}); - table1.AddRow(new string[] { - "ConfirmPassword", - "a12345!"}); -#line 19 - testRunner.And("I fill in", ((string)(null)), table1, "And "); -#line 25 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 26 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 27 - testRunner.Then("I should see \"User created\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 28 - testRunner.When("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table2.AddRow(new string[] { - "UserName", - "user2"}); - table2.AddRow(new string[] { - "Email", - "user2@domain.com"}); - table2.AddRow(new string[] { - "Password", - "a12345!"}); - table2.AddRow(new string[] { - "ConfirmPassword", - "a12345!"}); - table2.AddRow(new string[] { - "UserRoles.Roles[0].Granted", - "true"}); -#line 29 - testRunner.And("I fill in", ((string)(null)), table2, "And "); -#line 36 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 37 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 38 - testRunner.Then("I should see \"User created\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 39 - testRunner.And("I should see \"Adding role Administrator to user user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 40 - testRunner.When("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table3.AddRow(new string[] { - "UserName", - "user3"}); - table3.AddRow(new string[] { - "Email", - "user3@domain.com"}); - table3.AddRow(new string[] { - "Password", - "a12345!"}); - table3.AddRow(new string[] { - "ConfirmPassword", - "a12345!"}); - table3.AddRow(new string[] { - "UserRoles.Roles[0].Granted", - "true"}); - table3.AddRow(new string[] { - "UserRoles.Roles[1].Granted", - "true"}); - table3.AddRow(new string[] { - "UserRoles.Roles[2].Granted", - "true"}); - table3.AddRow(new string[] { - "UserRoles.Roles[3].Granted", - "true"}); - table3.AddRow(new string[] { - "UserRoles.Roles[4].Granted", - "true"}); -#line 41 - testRunner.And("I fill in", ((string)(null)), table3, "And "); -#line 52 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 53 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 54 - testRunner.Then("I should see \"User created\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 55 - testRunner.And("I should see \"Adding role Administrator to user user3\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 56 - testRunner.And("I should see \"Adding role Editor to user user3\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 57 - testRunner.And("I should see \"Adding role Moderator to user user3\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 58 - testRunner.And("I should see \"Adding role Author to user user3\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 59 - testRunner.And("I should see \"Adding role Contributor to user user3\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 60 - testRunner.When("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 61 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 62 - testRunner.Then("I should see \"The UserName field is required.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 63 - testRunner.Then("I should see \"The Email field is required.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 64 - testRunner.Then("I should see \"The Password field is required.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 65 - testRunner.Then("I should see \"The ConfirmPassword field is required.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 66 - testRunner.When("I go to \"admin/users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 67 - testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table4.AddRow(new string[] { - "UserName", - "user4"}); - table4.AddRow(new string[] { - "Email", - "user4@domain.com"}); - table4.AddRow(new string[] { - "Password", - "a12345!"}); - table4.AddRow(new string[] { - "ConfirmPassword", - "a123456!"}); -#line 68 - testRunner.And("I fill in", ((string)(null)), table4, "And "); -#line 74 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 75 - testRunner.Then("I should see \"Password confirmation must match\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I can edit an existing user")] - [NUnit.Framework.CategoryAttribute("management")] - public virtual void ICanEditAnExistingUser() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can edit an existing user", new string[] { - "management"}); -#line 78 -this.ScenarioSetup(scenarioInfo); -#line 79 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 80 - testRunner.When("I go to \"admin/users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 81 - testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table5.AddRow(new string[] { - "UserName", - "user1"}); - table5.AddRow(new string[] { - "Email", - "user1@domain.com"}); - table5.AddRow(new string[] { - "Password", - "a12345!"}); - table5.AddRow(new string[] { - "ConfirmPassword", - "a12345!"}); -#line 82 - testRunner.And("I fill in", ((string)(null)), table5, "And "); -#line 88 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 89 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 90 - testRunner.Then("I should see \"User created\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - TechTalk.SpecFlow.Table table6 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table6.AddRow(new string[] { - "Options.Search", - "user1"}); -#line 91 - testRunner.When("I fill in", ((string)(null)), table6, "When "); -#line 94 - testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 95 - testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 96 - testRunner.When("I follow \"Edit\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table7 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table7.AddRow(new string[] { - "UserName", - "user2"}); - table7.AddRow(new string[] { - "Email", - "user2@domain.com"}); -#line 97 - testRunner.And("I fill in", ((string)(null)), table7, "And "); -#line 101 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 102 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 103 - testRunner.Then("I should see \"User information updated\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 104 - testRunner.And("I should see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 105 - testRunner.And("I should see \"user2@domain.com\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I should not be able to reuse an existing username or email")] - [NUnit.Framework.CategoryAttribute("management")] - public virtual void IShouldNotBeAbleToReuseAnExistingUsernameOrEmail() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I should not be able to reuse an existing username or email", new string[] { - "management"}); -#line 108 -this.ScenarioSetup(scenarioInfo); -#line 109 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 110 - testRunner.When("I go to \"admin/users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 112 - testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table8 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table8.AddRow(new string[] { - "UserName", - "user1"}); - table8.AddRow(new string[] { - "Email", - "user1@domain.com"}); - table8.AddRow(new string[] { - "Password", - "a12345!"}); - table8.AddRow(new string[] { - "ConfirmPassword", - "a12345!"}); -#line 113 - testRunner.And("I fill in", ((string)(null)), table8, "And "); -#line 119 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 120 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 122 - testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table9 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table9.AddRow(new string[] { - "UserName", - "user2"}); - table9.AddRow(new string[] { - "Email", - "user2@domain.com"}); - table9.AddRow(new string[] { - "Password", - "a12345!"}); - table9.AddRow(new string[] { - "ConfirmPassword", - "a12345!"}); -#line 123 - testRunner.And("I fill in", ((string)(null)), table9, "And "); -#line 129 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 130 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 131 - testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 132 - testRunner.And("I should see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table10 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table10.AddRow(new string[] { - "Options.Search", - "user1"}); -#line 134 - testRunner.When("I fill in", ((string)(null)), table10, "When "); -#line 137 - testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 138 - testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 139 - testRunner.When("I follow \"Edit\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table11 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table11.AddRow(new string[] { - "UserName", - "user2"}); - table11.AddRow(new string[] { - "Email", - "user1@domain.com"}); -#line 140 - testRunner.And("I fill in", ((string)(null)), table11, "And "); -#line 144 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 145 - testRunner.Then("I should see \"User with that username and/or email already exists.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - TechTalk.SpecFlow.Table table12 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table12.AddRow(new string[] { - "UserName", - "user1"}); - table12.AddRow(new string[] { - "Email", - "user2@domain.com"}); -#line 146 - testRunner.When("I fill in", ((string)(null)), table12, "When "); -#line 150 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 151 - testRunner.Then("I should see \"User with that username and/or email already exists.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I should be able to remove an existing user")] - [NUnit.Framework.IgnoreAttribute()] - [NUnit.Framework.CategoryAttribute("management")] - public virtual void IShouldBeAbleToRemoveAnExistingUser() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I should be able to remove an existing user", new string[] { - "management", - "ignore"}); -#line 155 -this.ScenarioSetup(scenarioInfo); -#line 156 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 157 - testRunner.When("I go to \"admin/users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 159 - testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table13 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table13.AddRow(new string[] { - "UserName", - "user1"}); - table13.AddRow(new string[] { - "Email", - "user1@domain.com"}); - table13.AddRow(new string[] { - "Password", - "a12345!"}); - table13.AddRow(new string[] { - "ConfirmPassword", - "a12345!"}); -#line 160 - testRunner.And("I fill in", ((string)(null)), table13, "And "); -#line 166 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 167 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 168 - testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - TechTalk.SpecFlow.Table table14 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table14.AddRow(new string[] { - "Options.Search", - "user1"}); -#line 170 - testRunner.When("I fill in", ((string)(null)), table14, "When "); -#line 173 - testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 174 - testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 175 - testRunner.When("I follow \"Delete\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 176 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 177 - testRunner.Then("I should see \"User user1 deleted\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 178 - testRunner.And("I should not see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I should not be able to filter users by name")] - [NUnit.Framework.CategoryAttribute("filtering")] - public virtual void IShouldNotBeAbleToFilterUsersByName() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I should not be able to filter users by name", new string[] { - "filtering"}); -#line 181 -this.ScenarioSetup(scenarioInfo); -#line 182 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 183 - testRunner.When("I go to \"admin/users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 185 - testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table15 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table15.AddRow(new string[] { - "UserName", - "user1"}); - table15.AddRow(new string[] { - "Email", - "user1@domain.com"}); - table15.AddRow(new string[] { - "Password", - "a12345!"}); - table15.AddRow(new string[] { - "ConfirmPassword", - "a12345!"}); -#line 186 - testRunner.And("I fill in", ((string)(null)), table15, "And "); -#line 192 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 193 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 195 - testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table16 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table16.AddRow(new string[] { - "UserName", - "user2"}); - table16.AddRow(new string[] { - "Email", - "user2@domain.com"}); - table16.AddRow(new string[] { - "Password", - "a12345!"}); - table16.AddRow(new string[] { - "ConfirmPassword", - "a12345!"}); -#line 196 - testRunner.And("I fill in", ((string)(null)), table16, "And "); -#line 202 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 203 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 204 - testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 205 - testRunner.And("I should see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table17 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table17.AddRow(new string[] { - "Options.Search", - "user1"}); -#line 206 - testRunner.When("I fill in", ((string)(null)), table17, "When "); -#line 209 - testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 210 - testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 211 - testRunner.And("I should not see \"]*>admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 212 - testRunner.And("I should not see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table18 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table18.AddRow(new string[] { - "Options.Search", - "user1@domain.com"}); -#line 213 - testRunner.When("I fill in", ((string)(null)), table18, "When "); -#line 216 - testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 217 - testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 218 - testRunner.And("I should not see \"]*>admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 219 - testRunner.And("I should not see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table19 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table19.AddRow(new string[] { - "Options.Search", - "@domain.com"}); -#line 220 - testRunner.When("I fill in", ((string)(null)), table19, "When "); -#line 223 - testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 224 - testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 225 - testRunner.And("I should see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 226 - testRunner.And("I should not see \"]*>admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I should be able to filter users by status")] - [NUnit.Framework.CategoryAttribute("filtering")] - public virtual void IShouldBeAbleToFilterUsersByStatus() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I should be able to filter users by status", new string[] { - "filtering"}); -#line 229 -this.ScenarioSetup(scenarioInfo); -#line 230 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 231 - testRunner.When("I go to \"admin/users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 233 - testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table20 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table20.AddRow(new string[] { - "UserName", - "user1"}); - table20.AddRow(new string[] { - "Email", - "user1@domain.com"}); - table20.AddRow(new string[] { - "Password", - "a12345!"}); - table20.AddRow(new string[] { - "ConfirmPassword", - "a12345!"}); -#line 234 - testRunner.And("I fill in", ((string)(null)), table20, "And "); -#line 240 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 241 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 243 - testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table21 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table21.AddRow(new string[] { - "UserName", - "user2"}); - table21.AddRow(new string[] { - "Email", - "user2@domain.com"}); - table21.AddRow(new string[] { - "Password", - "a12345!"}); - table21.AddRow(new string[] { - "ConfirmPassword", - "a12345!"}); -#line 244 - testRunner.And("I fill in", ((string)(null)), table21, "And "); -#line 250 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 251 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 252 - testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 253 - testRunner.And("I should see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table22 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table22.AddRow(new string[] { - "Options.Search", - "user1"}); -#line 254 - testRunner.When("I fill in", ((string)(null)), table22, "When "); -#line 257 - testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 258 - testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 259 - testRunner.When("I hit \"Disable\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 260 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 261 - testRunner.Then("I should see \"User user1 disabled\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - TechTalk.SpecFlow.Table table23 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table23.AddRow(new string[] { - "Options.Search", - ""}); - table23.AddRow(new string[] { - "Options.Filter", - "Pending"}); -#line 262 - testRunner.When("I fill in", ((string)(null)), table23, "When "); -#line 266 - testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 267 - testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 268 - testRunner.And("I should not see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 269 - testRunner.And("I should not see \"]*>admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table24 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table24.AddRow(new string[] { - "Options.Search", - ""}); - table24.AddRow(new string[] { - "Options.Filter", - "EmailPending"}); -#line 270 - testRunner.When("I fill in", ((string)(null)), table24, "When "); -#line 274 - testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 275 - testRunner.Then("I should not see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 276 - testRunner.And("I should not see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 277 - testRunner.And("I should not see \"]*>admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table25 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table25.AddRow(new string[] { - "Options.Search", - ""}); - table25.AddRow(new string[] { - "Options.Filter", - "Approved"}); -#line 278 - testRunner.When("I fill in", ((string)(null)), table25, "When "); -#line 282 - testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 283 - testRunner.Then("I should not see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 284 - testRunner.And("I should see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 285 - testRunner.And("I should see \"]*>admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table26 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table26.AddRow(new string[] { - "Options.Search", - ""}); - table26.AddRow(new string[] { - "Options.Filter", - "All"}); -#line 286 - testRunner.When("I fill in", ((string)(null)), table26, "When "); -#line 290 - testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 291 - testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 292 - testRunner.And("I should see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 293 - testRunner.And("I should see \"]*>admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I should not be able to add users with invalid email addresses")] - [NUnit.Framework.CategoryAttribute("email")] - public virtual void IShouldNotBeAbleToAddUsersWithInvalidEmailAddresses() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I should not be able to add users with invalid email addresses", new string[] { - "email"}); -#line 295 -this.ScenarioSetup(scenarioInfo); -#line 296 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 297 - testRunner.When("I go to \"admin/users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 298 - testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table27 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table27.AddRow(new string[] { - "UserName", - "user1"}); - table27.AddRow(new string[] { - "Email", - "NotAnEmail"}); - table27.AddRow(new string[] { - "Password", - "a12345!"}); - table27.AddRow(new string[] { - "ConfirmPassword", - "a12345!"}); -#line 299 - testRunner.And("I fill in", ((string)(null)), table27, "And "); -#line 305 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 306 - testRunner.Then("I should see \"You must specify a valid email address.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I should be able to add users with valid email addresses")] - [NUnit.Framework.CategoryAttribute("email")] - public virtual void IShouldBeAbleToAddUsersWithValidEmailAddresses() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I should be able to add users with valid email addresses", new string[] { - "email"}); -#line 308 -this.ScenarioSetup(scenarioInfo); -#line 309 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 310 - testRunner.When("I go to \"admin/users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 311 - testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table28 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table28.AddRow(new string[] { - "UserName", - "user1"}); - table28.AddRow(new string[] { - "Email", - "user1@domain.com"}); - table28.AddRow(new string[] { - "Password", - "a12345!"}); - table28.AddRow(new string[] { - "ConfirmPassword", - "a12345!"}); -#line 312 - testRunner.And("I fill in", ((string)(null)), table28, "And "); -#line 318 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 319 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 320 - testRunner.Then("I should see \"User created\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - } -} -#pragma warning restore -#endregion +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.9.0.77 +// SpecFlow Generator Version:1.9.0.0 +// Runtime Version:4.0.30319.0 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +#pragma warning disable +namespace Orchard.Specs +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("Users")] + public partial class UsersFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "Users.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Users", " In order to prevent users module regressions\r\n As a site owner\r\n I want to cr" + + "eate, search and modify user accounts", ProgrammingLanguage.CSharp, ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + [NUnit.Framework.SetUpAttribute()] + public virtual void TestInitialize() + { + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + public virtual void ScenarioCleanup() + { + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("There is only one user by default")] + [NUnit.Framework.CategoryAttribute("management")] + public virtual void ThereIsOnlyOneUserByDefault() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("There is only one user by default", new string[] { + "management"}); +#line 7 +this.ScenarioSetup(scenarioInfo); +#line 8 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 9 + testRunner.When("I go to \"admin/users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 10 + testRunner.Then("I should see \"Users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 11 + testRunner.And("I should see \"]*>admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I can create a new user")] + [NUnit.Framework.CategoryAttribute("management")] + public virtual void ICanCreateANewUser() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create a new user", new string[] { + "management"}); +#line 14 +this.ScenarioSetup(scenarioInfo); +#line 15 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 16 + testRunner.When("I go to \"admin/users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 17 + testRunner.Then("I should see \"Users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 18 + testRunner.When("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table1.AddRow(new string[] { + "UserName", + "user1"}); + table1.AddRow(new string[] { + "Email", + "user1@domain.com"}); + table1.AddRow(new string[] { + "Password", + "a12345!"}); + table1.AddRow(new string[] { + "ConfirmPassword", + "a12345!"}); +#line 19 + testRunner.And("I fill in", ((string)(null)), table1, "And "); +#line 25 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 26 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 27 + testRunner.Then("I should see \"User created\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 28 + testRunner.When("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table2.AddRow(new string[] { + "UserName", + "user2"}); + table2.AddRow(new string[] { + "Email", + "user2@domain.com"}); + table2.AddRow(new string[] { + "Password", + "a12345!"}); + table2.AddRow(new string[] { + "ConfirmPassword", + "a12345!"}); + table2.AddRow(new string[] { + "UserRoles.Roles[0].Granted", + "true"}); +#line 29 + testRunner.And("I fill in", ((string)(null)), table2, "And "); +#line 36 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 37 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 38 + testRunner.Then("I should see \"User created\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 39 + testRunner.And("I should see \"Adding role Administrator to user user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 40 + testRunner.When("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table3.AddRow(new string[] { + "UserName", + "user3"}); + table3.AddRow(new string[] { + "Email", + "user3@domain.com"}); + table3.AddRow(new string[] { + "Password", + "a12345!"}); + table3.AddRow(new string[] { + "ConfirmPassword", + "a12345!"}); + table3.AddRow(new string[] { + "UserRoles.Roles[0].Granted", + "true"}); + table3.AddRow(new string[] { + "UserRoles.Roles[1].Granted", + "true"}); + table3.AddRow(new string[] { + "UserRoles.Roles[2].Granted", + "true"}); + table3.AddRow(new string[] { + "UserRoles.Roles[3].Granted", + "true"}); + table3.AddRow(new string[] { + "UserRoles.Roles[4].Granted", + "true"}); +#line 41 + testRunner.And("I fill in", ((string)(null)), table3, "And "); +#line 52 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 53 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 54 + testRunner.Then("I should see \"User created\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 55 + testRunner.And("I should see \"Adding role Administrator to user user3\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 56 + testRunner.And("I should see \"Adding role Editor to user user3\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 57 + testRunner.And("I should see \"Adding role Moderator to user user3\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 58 + testRunner.And("I should see \"Adding role Author to user user3\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 59 + testRunner.And("I should see \"Adding role Contributor to user user3\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 60 + testRunner.When("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 61 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 62 + testRunner.Then("I should see \"The UserName field is required.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 63 + testRunner.Then("I should see \"The Email field is required.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 64 + testRunner.Then("I should see \"The Password field is required.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 65 + testRunner.Then("I should see \"The ConfirmPassword field is required.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 66 + testRunner.When("I go to \"admin/users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 67 + testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table4.AddRow(new string[] { + "UserName", + "user4"}); + table4.AddRow(new string[] { + "Email", + "user4@domain.com"}); + table4.AddRow(new string[] { + "Password", + "a12345!"}); + table4.AddRow(new string[] { + "ConfirmPassword", + "a123456!"}); +#line 68 + testRunner.And("I fill in", ((string)(null)), table4, "And "); +#line 74 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 75 + testRunner.Then("I should see \"Password confirmation must match\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I can edit an existing user")] + [NUnit.Framework.CategoryAttribute("management")] + public virtual void ICanEditAnExistingUser() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can edit an existing user", new string[] { + "management"}); +#line 78 +this.ScenarioSetup(scenarioInfo); +#line 79 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 80 + testRunner.When("I go to \"admin/users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 81 + testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table5.AddRow(new string[] { + "UserName", + "user1"}); + table5.AddRow(new string[] { + "Email", + "user1@domain.com"}); + table5.AddRow(new string[] { + "Password", + "a12345!"}); + table5.AddRow(new string[] { + "ConfirmPassword", + "a12345!"}); +#line 82 + testRunner.And("I fill in", ((string)(null)), table5, "And "); +#line 88 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 89 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 90 + testRunner.Then("I should see \"User created\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + TechTalk.SpecFlow.Table table6 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table6.AddRow(new string[] { + "Options.Search", + "user1"}); +#line 91 + testRunner.When("I fill in", ((string)(null)), table6, "When "); +#line 94 + testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 95 + testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 96 + testRunner.When("I follow \"Edit\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table7 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table7.AddRow(new string[] { + "UserName", + "user2"}); + table7.AddRow(new string[] { + "Email", + "user2@domain.com"}); +#line 97 + testRunner.And("I fill in", ((string)(null)), table7, "And "); +#line 101 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 102 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 103 + testRunner.Then("I should see \"User information updated\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 104 + testRunner.And("I should see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 105 + testRunner.And("I should see \"user2@domain.com\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I should not be able to reuse an existing username or email")] + [NUnit.Framework.CategoryAttribute("management")] + public virtual void IShouldNotBeAbleToReuseAnExistingUsernameOrEmail() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I should not be able to reuse an existing username or email", new string[] { + "management"}); +#line 108 +this.ScenarioSetup(scenarioInfo); +#line 109 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 110 + testRunner.When("I go to \"admin/users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 112 + testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table8 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table8.AddRow(new string[] { + "UserName", + "user1"}); + table8.AddRow(new string[] { + "Email", + "user1@domain.com"}); + table8.AddRow(new string[] { + "Password", + "a12345!"}); + table8.AddRow(new string[] { + "ConfirmPassword", + "a12345!"}); +#line 113 + testRunner.And("I fill in", ((string)(null)), table8, "And "); +#line 119 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 120 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 122 + testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table9 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table9.AddRow(new string[] { + "UserName", + "user2"}); + table9.AddRow(new string[] { + "Email", + "user2@domain.com"}); + table9.AddRow(new string[] { + "Password", + "a12345!"}); + table9.AddRow(new string[] { + "ConfirmPassword", + "a12345!"}); +#line 123 + testRunner.And("I fill in", ((string)(null)), table9, "And "); +#line 129 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 130 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 131 + testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 132 + testRunner.And("I should see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table10 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table10.AddRow(new string[] { + "Options.Search", + "user1"}); +#line 134 + testRunner.When("I fill in", ((string)(null)), table10, "When "); +#line 137 + testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 138 + testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 139 + testRunner.When("I follow \"Edit\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table11 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table11.AddRow(new string[] { + "UserName", + "user2"}); + table11.AddRow(new string[] { + "Email", + "user1@domain.com"}); +#line 140 + testRunner.And("I fill in", ((string)(null)), table11, "And "); +#line 144 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 145 + testRunner.Then("I should see \"User with that username and/or email already exists.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + TechTalk.SpecFlow.Table table12 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table12.AddRow(new string[] { + "UserName", + "user1"}); + table12.AddRow(new string[] { + "Email", + "user2@domain.com"}); +#line 146 + testRunner.When("I fill in", ((string)(null)), table12, "When "); +#line 150 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 151 + testRunner.Then("I should see \"User with that username and/or email already exists.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I should be able to remove an existing user")] + [NUnit.Framework.IgnoreAttribute()] + [NUnit.Framework.CategoryAttribute("management")] + public virtual void IShouldBeAbleToRemoveAnExistingUser() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I should be able to remove an existing user", new string[] { + "management", + "ignore"}); +#line 155 +this.ScenarioSetup(scenarioInfo); +#line 156 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 157 + testRunner.When("I go to \"admin/users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 159 + testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table13 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table13.AddRow(new string[] { + "UserName", + "user1"}); + table13.AddRow(new string[] { + "Email", + "user1@domain.com"}); + table13.AddRow(new string[] { + "Password", + "a12345!"}); + table13.AddRow(new string[] { + "ConfirmPassword", + "a12345!"}); +#line 160 + testRunner.And("I fill in", ((string)(null)), table13, "And "); +#line 166 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 167 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 168 + testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + TechTalk.SpecFlow.Table table14 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table14.AddRow(new string[] { + "Options.Search", + "user1"}); +#line 170 + testRunner.When("I fill in", ((string)(null)), table14, "When "); +#line 173 + testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 174 + testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 175 + testRunner.When("I follow \"Delete\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 176 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 177 + testRunner.Then("I should see \"User user1 deleted\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 178 + testRunner.And("I should not see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I should not be able to filter users by name")] + [NUnit.Framework.CategoryAttribute("filtering")] + public virtual void IShouldNotBeAbleToFilterUsersByName() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I should not be able to filter users by name", new string[] { + "filtering"}); +#line 181 +this.ScenarioSetup(scenarioInfo); +#line 182 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 183 + testRunner.When("I go to \"admin/users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 185 + testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table15 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table15.AddRow(new string[] { + "UserName", + "user1"}); + table15.AddRow(new string[] { + "Email", + "user1@domain.com"}); + table15.AddRow(new string[] { + "Password", + "a12345!"}); + table15.AddRow(new string[] { + "ConfirmPassword", + "a12345!"}); +#line 186 + testRunner.And("I fill in", ((string)(null)), table15, "And "); +#line 192 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 193 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 195 + testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table16 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table16.AddRow(new string[] { + "UserName", + "user2"}); + table16.AddRow(new string[] { + "Email", + "user2@domain.com"}); + table16.AddRow(new string[] { + "Password", + "a12345!"}); + table16.AddRow(new string[] { + "ConfirmPassword", + "a12345!"}); +#line 196 + testRunner.And("I fill in", ((string)(null)), table16, "And "); +#line 202 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 203 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 204 + testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 205 + testRunner.And("I should see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table17 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table17.AddRow(new string[] { + "Options.Search", + "user1"}); +#line 206 + testRunner.When("I fill in", ((string)(null)), table17, "When "); +#line 209 + testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 210 + testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 211 + testRunner.And("I should not see \"]*>admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 212 + testRunner.And("I should not see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table18 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table18.AddRow(new string[] { + "Options.Search", + "user1@domain.com"}); +#line 213 + testRunner.When("I fill in", ((string)(null)), table18, "When "); +#line 216 + testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 217 + testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 218 + testRunner.And("I should not see \"]*>admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 219 + testRunner.And("I should not see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table19 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table19.AddRow(new string[] { + "Options.Search", + "@domain.com"}); +#line 220 + testRunner.When("I fill in", ((string)(null)), table19, "When "); +#line 223 + testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 224 + testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 225 + testRunner.And("I should see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 226 + testRunner.And("I should not see \"]*>admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I should be able to filter users by status")] + [NUnit.Framework.CategoryAttribute("filtering")] + public virtual void IShouldBeAbleToFilterUsersByStatus() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I should be able to filter users by status", new string[] { + "filtering"}); +#line 229 +this.ScenarioSetup(scenarioInfo); +#line 230 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 231 + testRunner.When("I go to \"admin/users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 233 + testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table20 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table20.AddRow(new string[] { + "UserName", + "user1"}); + table20.AddRow(new string[] { + "Email", + "user1@domain.com"}); + table20.AddRow(new string[] { + "Password", + "a12345!"}); + table20.AddRow(new string[] { + "ConfirmPassword", + "a12345!"}); +#line 234 + testRunner.And("I fill in", ((string)(null)), table20, "And "); +#line 240 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 241 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 243 + testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table21 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table21.AddRow(new string[] { + "UserName", + "user2"}); + table21.AddRow(new string[] { + "Email", + "user2@domain.com"}); + table21.AddRow(new string[] { + "Password", + "a12345!"}); + table21.AddRow(new string[] { + "ConfirmPassword", + "a12345!"}); +#line 244 + testRunner.And("I fill in", ((string)(null)), table21, "And "); +#line 250 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 251 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 252 + testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 253 + testRunner.And("I should see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table22 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table22.AddRow(new string[] { + "Options.Search", + "user1"}); +#line 254 + testRunner.When("I fill in", ((string)(null)), table22, "When "); +#line 257 + testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 258 + testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 259 + testRunner.When("I hit \"Disable\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 260 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 261 + testRunner.Then("I should see \"User user1 disabled\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + TechTalk.SpecFlow.Table table23 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table23.AddRow(new string[] { + "Options.Search", + ""}); + table23.AddRow(new string[] { + "Options.Filter", + "Pending"}); +#line 262 + testRunner.When("I fill in", ((string)(null)), table23, "When "); +#line 266 + testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 267 + testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 268 + testRunner.And("I should not see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 269 + testRunner.And("I should not see \"]*>admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table24 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table24.AddRow(new string[] { + "Options.Search", + ""}); + table24.AddRow(new string[] { + "Options.Filter", + "EmailPending"}); +#line 270 + testRunner.When("I fill in", ((string)(null)), table24, "When "); +#line 274 + testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 275 + testRunner.Then("I should not see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 276 + testRunner.And("I should not see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 277 + testRunner.And("I should not see \"]*>admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table25 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table25.AddRow(new string[] { + "Options.Search", + ""}); + table25.AddRow(new string[] { + "Options.Filter", + "Approved"}); +#line 278 + testRunner.When("I fill in", ((string)(null)), table25, "When "); +#line 282 + testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 283 + testRunner.Then("I should not see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 284 + testRunner.And("I should see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 285 + testRunner.And("I should see \"]*>admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table26 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table26.AddRow(new string[] { + "Options.Search", + ""}); + table26.AddRow(new string[] { + "Options.Filter", + "All"}); +#line 286 + testRunner.When("I fill in", ((string)(null)), table26, "When "); +#line 290 + testRunner.And("I hit \"Filter\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 291 + testRunner.Then("I should see \"]*>user1\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 292 + testRunner.And("I should see \"]*>user2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 293 + testRunner.And("I should see \"]*>admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I should not be able to add users with invalid email addresses")] + [NUnit.Framework.CategoryAttribute("email")] + public virtual void IShouldNotBeAbleToAddUsersWithInvalidEmailAddresses() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I should not be able to add users with invalid email addresses", new string[] { + "email"}); +#line 295 +this.ScenarioSetup(scenarioInfo); +#line 296 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 297 + testRunner.When("I go to \"admin/users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 298 + testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table27 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table27.AddRow(new string[] { + "UserName", + "user1"}); + table27.AddRow(new string[] { + "Email", + "NotAnEmail"}); + table27.AddRow(new string[] { + "Password", + "a12345!"}); + table27.AddRow(new string[] { + "ConfirmPassword", + "a12345!"}); +#line 299 + testRunner.And("I fill in", ((string)(null)), table27, "And "); +#line 305 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 306 + testRunner.Then("I should see \"You must specify a valid email address.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I should be able to add users with valid email addresses")] + [NUnit.Framework.CategoryAttribute("email")] + public virtual void IShouldBeAbleToAddUsersWithValidEmailAddresses() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I should be able to add users with valid email addresses", new string[] { + "email"}); +#line 308 +this.ScenarioSetup(scenarioInfo); +#line 309 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 310 + testRunner.When("I go to \"admin/users\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 311 + testRunner.And("I follow \"Add a new user\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table28 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table28.AddRow(new string[] { + "UserName", + "user1"}); + table28.AddRow(new string[] { + "Email", + "user1@domain.com"}); + table28.AddRow(new string[] { + "Password", + "a12345!"}); + table28.AddRow(new string[] { + "ConfirmPassword", + "a12345!"}); +#line 312 + testRunner.And("I fill in", ((string)(null)), table28, "And "); +#line 318 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 319 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 320 + testRunner.Then("I should see \"User created\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + } +} +#pragma warning restore +#endregion diff --git a/src/Orchard.Specs/UsingSpecFlow.feature b/src/Orchard.Specs/UsingSpecFlow.feature index 853de0cd003..6dd611a3ec0 100644 --- a/src/Orchard.Specs/UsingSpecFlow.feature +++ b/src/Orchard.Specs/UsingSpecFlow.feature @@ -1,11 +1,11 @@ -Feature: Using SpecFlow - In order to test Orchard - As a developer or contributor - I want to define scenarios that ensure functionality - -Scenario: Spec flow generates and runs via nunit - Given I have a scenario - When I run steps - And they have values like "5" - Then they run +Feature: Using SpecFlow + In order to test Orchard + As a developer or contributor + I want to define scenarios that ensure functionality + +Scenario: Spec flow generates and runs via nunit + Given I have a scenario + When I run steps + And they have values like "5" + Then they run And values like five are captured \ No newline at end of file diff --git a/src/Orchard.Specs/UsingSpecFlow.feature.cs b/src/Orchard.Specs/UsingSpecFlow.feature.cs index 1db7c00fceb..3fd0a1d0b06 100644 --- a/src/Orchard.Specs/UsingSpecFlow.feature.cs +++ b/src/Orchard.Specs/UsingSpecFlow.feature.cs @@ -1,91 +1,91 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by SpecFlow (http://www.specflow.org/). -// SpecFlow Version:1.9.0.77 -// SpecFlow Generator Version:1.9.0.0 -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ -#region Designer generated code -#pragma warning disable -namespace Orchard.Specs -{ - using TechTalk.SpecFlow; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [NUnit.Framework.TestFixtureAttribute()] - [NUnit.Framework.DescriptionAttribute("Using SpecFlow")] - public partial class UsingSpecFlowFeature - { - - private static TechTalk.SpecFlow.ITestRunner testRunner; - -#line 1 "UsingSpecFlow.feature" -#line hidden - - [NUnit.Framework.TestFixtureSetUpAttribute()] - public virtual void FeatureSetup() - { - testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Using SpecFlow", " In order to test Orchard\r\n As a developer or contributor\r\n I want to define s" + - "cenarios that ensure functionality", ProgrammingLanguage.CSharp, ((string[])(null))); - testRunner.OnFeatureStart(featureInfo); - } - - [NUnit.Framework.TestFixtureTearDownAttribute()] - public virtual void FeatureTearDown() - { - testRunner.OnFeatureEnd(); - testRunner = null; - } - - [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() - { - } - - [NUnit.Framework.TearDownAttribute()] - public virtual void ScenarioTearDown() - { - testRunner.OnScenarioEnd(); - } - - public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) - { - testRunner.OnScenarioStart(scenarioInfo); - } - - public virtual void ScenarioCleanup() - { - testRunner.CollectScenarioErrors(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Spec flow generates and runs via nunit")] - public virtual void SpecFlowGeneratesAndRunsViaNunit() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Spec flow generates and runs via nunit", ((string[])(null))); -#line 6 -this.ScenarioSetup(scenarioInfo); -#line 7 - testRunner.Given("I have a scenario", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 8 - testRunner.When("I run steps", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 9 - testRunner.And("they have values like \"5\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 10 - testRunner.Then("they run", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 11 - testRunner.And("values like five are captured", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - } -} -#pragma warning restore -#endregion +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.9.0.77 +// SpecFlow Generator Version:1.9.0.0 +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +#pragma warning disable +namespace Orchard.Specs +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("Using SpecFlow")] + public partial class UsingSpecFlowFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "UsingSpecFlow.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Using SpecFlow", " In order to test Orchard\r\n As a developer or contributor\r\n I want to define s" + + "cenarios that ensure functionality", ProgrammingLanguage.CSharp, ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + [NUnit.Framework.SetUpAttribute()] + public virtual void TestInitialize() + { + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + public virtual void ScenarioCleanup() + { + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Spec flow generates and runs via nunit")] + public virtual void SpecFlowGeneratesAndRunsViaNunit() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Spec flow generates and runs via nunit", ((string[])(null))); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 + testRunner.Given("I have a scenario", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 8 + testRunner.When("I run steps", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 9 + testRunner.And("they have values like \"5\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 10 + testRunner.Then("they run", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 11 + testRunner.And("values like five are captured", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + } +} +#pragma warning restore +#endregion diff --git a/src/Orchard.Specs/Util/PathExtensions.cs b/src/Orchard.Specs/Util/PathExtensions.cs index b0ce62a517c..9d358b0e63b 100644 --- a/src/Orchard.Specs/Util/PathExtensions.cs +++ b/src/Orchard.Specs/Util/PathExtensions.cs @@ -1,57 +1,57 @@ -using System; -using System.Diagnostics; -using System.IO; -using Path = Bleroy.FluentPath.Path; - -namespace Orchard.Specs.Util { - public static class PathExtensions { - public static Path GetRelativePath(this Path path, Path basePath) { - if (path.Equals(basePath)) - return Path.Get("."); - - if (path.Parent.Equals(basePath)) - return path.FileName; - - if (!path.IsDirectory && path.DirectoryName.Equals(basePath.DirectoryName)) - return path.FileName; - - return path.Parent.GetRelativePath(basePath).Combine(path.FileName); - } - - - public static Path DeepCopy(this Path sourcePath, Path targetPath) { - sourcePath - .GetFiles("*", true /*recursive*/) - .ForEach(file => FileCopy(sourcePath, targetPath, file)); - return sourcePath; - } - - public static Path DeepCopy(this Path sourcePath, string pattern, Path targetPath) { - sourcePath - .GetFiles(pattern, true /*recursive*/) - .ForEach(file => FileCopy(sourcePath, targetPath, file)); - return sourcePath; - } - - public static Path ShallowCopy(this Path sourcePath, string pattern, Path targetPath) { - sourcePath - .GetFiles(pattern, false /*recursive*/) - .ForEach(file => FileCopy(sourcePath, targetPath, file)); - return sourcePath; - } - - public static Path ShallowCopy(this Path sourcePath, Predicate predicatePath, Path targetPath) { - sourcePath - .GetFiles(predicatePath, false /*recursive*/) - .ForEach(file => FileCopy(sourcePath, targetPath, file)); - return sourcePath; - } - - private static void FileCopy(Path sourcePath, Path targetPath, Path sourceFile) { - var targetFile = targetPath.Combine(sourceFile.GetRelativePath(sourcePath)); - targetFile.Parent.CreateDirectory(); - // Trace.WriteLine(string.Format("Copying file '{0}' to '{1}'", sourceFile, targetFile)); - File.Copy(sourceFile, targetFile, true /*overwrite*/); - } - } -} +using System; +using System.Diagnostics; +using System.IO; +using Path = Bleroy.FluentPath.Path; + +namespace Orchard.Specs.Util { + public static class PathExtensions { + public static Path GetRelativePath(this Path path, Path basePath) { + if (path.Equals(basePath)) + return Path.Get("."); + + if (path.Parent.Equals(basePath)) + return path.FileName; + + if (!path.IsDirectory && path.DirectoryName.Equals(basePath.DirectoryName)) + return path.FileName; + + return path.Parent.GetRelativePath(basePath).Combine(path.FileName); + } + + + public static Path DeepCopy(this Path sourcePath, Path targetPath) { + sourcePath + .GetFiles("*", true /*recursive*/) + .ForEach(file => FileCopy(sourcePath, targetPath, file)); + return sourcePath; + } + + public static Path DeepCopy(this Path sourcePath, string pattern, Path targetPath) { + sourcePath + .GetFiles(pattern, true /*recursive*/) + .ForEach(file => FileCopy(sourcePath, targetPath, file)); + return sourcePath; + } + + public static Path ShallowCopy(this Path sourcePath, string pattern, Path targetPath) { + sourcePath + .GetFiles(pattern, false /*recursive*/) + .ForEach(file => FileCopy(sourcePath, targetPath, file)); + return sourcePath; + } + + public static Path ShallowCopy(this Path sourcePath, Predicate predicatePath, Path targetPath) { + sourcePath + .GetFiles(predicatePath, false /*recursive*/) + .ForEach(file => FileCopy(sourcePath, targetPath, file)); + return sourcePath; + } + + private static void FileCopy(Path sourcePath, Path targetPath, Path sourceFile) { + var targetFile = targetPath.Combine(sourceFile.GetRelativePath(sourcePath)); + targetFile.Parent.CreateDirectory(); + // Trace.WriteLine(string.Format("Copying file '{0}' to '{1}'", sourceFile, targetFile)); + File.Copy(sourceFile, targetFile, true /*overwrite*/); + } + } +} diff --git a/src/Orchard.Specs/WebHosting.feature b/src/Orchard.Specs/WebHosting.feature index 90d7ecb7a0c..a16d0a96339 100644 --- a/src/Orchard.Specs/WebHosting.feature +++ b/src/Orchard.Specs/WebHosting.feature @@ -1,62 +1,62 @@ -Feature: Web Hosting - In order to test orchard - As an integration runner - I want to verify basic hosting is working - -Scenario: Returning static files - Given I have a clean site based on Simple.Web - When I go to "Content/Static.txt" - Then I should see "Hello world!" - And the status should be 200 "OK" - -Scenario: Returning web forms page - Given I have a clean site based on Simple.Web - When I go to "Simple/Page.aspx" - Then I should see "Hello again" - And the status should be 200 "OK" - -Scenario: Returning a routed request - Given I have a clean site based on Simple.Web - When I go to "hello-world" - Then the status should be 200 "OK" - And I should see "Hello yet again" - -Scenario: Following a link - Given I have a clean site based on Simple.Web - When I go to "/simple/page.aspx" - And I follow "next page" - Then the status should be 200 "OK" - And I should see "Hello yet again" - -Scenario: Submitting a form with input, default, and hidden fields - Given I have a clean site based on Simple.Web - And I am on "/simple/page.aspx" - When I fill in - | name | value | - | input1 | gamma | - And I hit "Go!" - Then I should see "passthrough1:alpha" - And I should see "passthrough2:beta" - And I should see "input1:gamma" - -Scenario: Cookies follow along your request - Given I have a clean site based on Simple.Web - When I go to "/simple/cookie-set.aspx" - And I go to "/simple/cookie-show.aspx" - Then I should see "foo:bar" - -Scenario: Being redirected - Given I have a clean site based on Simple.Web - When I go to "/simple/redir.aspx" - And I am redirected - Then I should see "Hello again" - -Scenario: Not found modules file - Given I have a clean site based on Simple.Web - When I go to "/Modules/Orchard.Blogs/module.txt" - Then the status should be 404 "Not Found" - -Scenario: Not found themes file - Given I have a clean site based on Simple.Web - When I go to "/Themes/Classic/theme.txt" +Feature: Web Hosting + In order to test orchard + As an integration runner + I want to verify basic hosting is working + +Scenario: Returning static files + Given I have a clean site based on Simple.Web + When I go to "Content/Static.txt" + Then I should see "Hello world!" + And the status should be 200 "OK" + +Scenario: Returning web forms page + Given I have a clean site based on Simple.Web + When I go to "Simple/Page.aspx" + Then I should see "Hello again" + And the status should be 200 "OK" + +Scenario: Returning a routed request + Given I have a clean site based on Simple.Web + When I go to "hello-world" + Then the status should be 200 "OK" + And I should see "Hello yet again" + +Scenario: Following a link + Given I have a clean site based on Simple.Web + When I go to "/simple/page.aspx" + And I follow "next page" + Then the status should be 200 "OK" + And I should see "Hello yet again" + +Scenario: Submitting a form with input, default, and hidden fields + Given I have a clean site based on Simple.Web + And I am on "/simple/page.aspx" + When I fill in + | name | value | + | input1 | gamma | + And I hit "Go!" + Then I should see "passthrough1:alpha" + And I should see "passthrough2:beta" + And I should see "input1:gamma" + +Scenario: Cookies follow along your request + Given I have a clean site based on Simple.Web + When I go to "/simple/cookie-set.aspx" + And I go to "/simple/cookie-show.aspx" + Then I should see "foo:bar" + +Scenario: Being redirected + Given I have a clean site based on Simple.Web + When I go to "/simple/redir.aspx" + And I am redirected + Then I should see "Hello again" + +Scenario: Not found modules file + Given I have a clean site based on Simple.Web + When I go to "/Modules/Orchard.Blogs/module.txt" + Then the status should be 404 "Not Found" + +Scenario: Not found themes file + Given I have a clean site based on Simple.Web + When I go to "/Themes/Classic/theme.txt" Then the status should be 404 "Not Found" \ No newline at end of file diff --git a/src/Orchard.Specs/WebHosting.feature.cs b/src/Orchard.Specs/WebHosting.feature.cs index 351b33053f9..c6da2cd9802 100644 --- a/src/Orchard.Specs/WebHosting.feature.cs +++ b/src/Orchard.Specs/WebHosting.feature.cs @@ -1,252 +1,252 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by SpecFlow (http://www.specflow.org/). -// SpecFlow Version:1.9.0.77 -// SpecFlow Generator Version:1.9.0.0 -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ -#region Designer generated code -#pragma warning disable -namespace Orchard.Specs -{ - using TechTalk.SpecFlow; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [NUnit.Framework.TestFixtureAttribute()] - [NUnit.Framework.DescriptionAttribute("Web Hosting")] - public partial class WebHostingFeature - { - - private static TechTalk.SpecFlow.ITestRunner testRunner; - -#line 1 "WebHosting.feature" -#line hidden - - [NUnit.Framework.TestFixtureSetUpAttribute()] - public virtual void FeatureSetup() - { - testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Web Hosting", " In order to test orchard\r\n As an integration runner\r\n I want to verify basic " + - "hosting is working", ProgrammingLanguage.CSharp, ((string[])(null))); - testRunner.OnFeatureStart(featureInfo); - } - - [NUnit.Framework.TestFixtureTearDownAttribute()] - public virtual void FeatureTearDown() - { - testRunner.OnFeatureEnd(); - testRunner = null; - } - - [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() - { - } - - [NUnit.Framework.TearDownAttribute()] - public virtual void ScenarioTearDown() - { - testRunner.OnScenarioEnd(); - } - - public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) - { - testRunner.OnScenarioStart(scenarioInfo); - } - - public virtual void ScenarioCleanup() - { - testRunner.CollectScenarioErrors(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Returning static files")] - public virtual void ReturningStaticFiles() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Returning static files", ((string[])(null))); -#line 6 -this.ScenarioSetup(scenarioInfo); -#line 7 - testRunner.Given("I have a clean site based on Simple.Web", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 8 - testRunner.When("I go to \"Content/Static.txt\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 9 - testRunner.Then("I should see \"Hello world!\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 10 - testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Returning web forms page")] - public virtual void ReturningWebFormsPage() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Returning web forms page", ((string[])(null))); -#line 12 -this.ScenarioSetup(scenarioInfo); -#line 13 - testRunner.Given("I have a clean site based on Simple.Web", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 14 - testRunner.When("I go to \"Simple/Page.aspx\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 15 - testRunner.Then("I should see \"Hello again\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 16 - testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Returning a routed request")] - public virtual void ReturningARoutedRequest() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Returning a routed request", ((string[])(null))); -#line 18 -this.ScenarioSetup(scenarioInfo); -#line 19 - testRunner.Given("I have a clean site based on Simple.Web", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 20 - testRunner.When("I go to \"hello-world\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 21 - testRunner.Then("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 22 - testRunner.And("I should see \"Hello yet again\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Following a link")] - public virtual void FollowingALink() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Following a link", ((string[])(null))); -#line 24 -this.ScenarioSetup(scenarioInfo); -#line 25 - testRunner.Given("I have a clean site based on Simple.Web", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 26 - testRunner.When("I go to \"/simple/page.aspx\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 27 - testRunner.And("I follow \"next page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 28 - testRunner.Then("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 29 - testRunner.And("I should see \"Hello yet again\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Submitting a form with input, default, and hidden fields")] - public virtual void SubmittingAFormWithInputDefaultAndHiddenFields() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Submitting a form with input, default, and hidden fields", ((string[])(null))); -#line 31 -this.ScenarioSetup(scenarioInfo); -#line 32 - testRunner.Given("I have a clean site based on Simple.Web", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 33 - testRunner.And("I am on \"/simple/page.aspx\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table1.AddRow(new string[] { - "input1", - "gamma"}); -#line 34 - testRunner.When("I fill in", ((string)(null)), table1, "When "); -#line 37 - testRunner.And("I hit \"Go!\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 38 - testRunner.Then("I should see \"passthrough1:alpha\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 39 - testRunner.And("I should see \"passthrough2:beta\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 40 - testRunner.And("I should see \"input1:gamma\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Cookies follow along your request")] - public virtual void CookiesFollowAlongYourRequest() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Cookies follow along your request", ((string[])(null))); -#line 42 -this.ScenarioSetup(scenarioInfo); -#line 43 - testRunner.Given("I have a clean site based on Simple.Web", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 44 - testRunner.When("I go to \"/simple/cookie-set.aspx\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 45 - testRunner.And("I go to \"/simple/cookie-show.aspx\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 46 - testRunner.Then("I should see \"foo:bar\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Being redirected")] - public virtual void BeingRedirected() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Being redirected", ((string[])(null))); -#line 48 -this.ScenarioSetup(scenarioInfo); -#line 49 - testRunner.Given("I have a clean site based on Simple.Web", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 50 - testRunner.When("I go to \"/simple/redir.aspx\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 51 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 52 - testRunner.Then("I should see \"Hello again\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Not found modules file")] - public virtual void NotFoundModulesFile() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Not found modules file", ((string[])(null))); -#line 54 -this.ScenarioSetup(scenarioInfo); -#line 55 - testRunner.Given("I have a clean site based on Simple.Web", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 56 - testRunner.When("I go to \"/Modules/Orchard.Blogs/module.txt\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 57 - testRunner.Then("the status should be 404 \"Not Found\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("Not found themes file")] - public virtual void NotFoundThemesFile() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Not found themes file", ((string[])(null))); -#line 59 -this.ScenarioSetup(scenarioInfo); -#line 60 - testRunner.Given("I have a clean site based on Simple.Web", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 61 - testRunner.When("I go to \"/Themes/Classic/theme.txt\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 62 - testRunner.Then("the status should be 404 \"Not Found\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - } -} -#pragma warning restore -#endregion +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.9.0.77 +// SpecFlow Generator Version:1.9.0.0 +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +#pragma warning disable +namespace Orchard.Specs +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("Web Hosting")] + public partial class WebHostingFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "WebHosting.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Web Hosting", " In order to test orchard\r\n As an integration runner\r\n I want to verify basic " + + "hosting is working", ProgrammingLanguage.CSharp, ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + [NUnit.Framework.SetUpAttribute()] + public virtual void TestInitialize() + { + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + public virtual void ScenarioCleanup() + { + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Returning static files")] + public virtual void ReturningStaticFiles() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Returning static files", ((string[])(null))); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 + testRunner.Given("I have a clean site based on Simple.Web", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 8 + testRunner.When("I go to \"Content/Static.txt\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 9 + testRunner.Then("I should see \"Hello world!\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 10 + testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Returning web forms page")] + public virtual void ReturningWebFormsPage() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Returning web forms page", ((string[])(null))); +#line 12 +this.ScenarioSetup(scenarioInfo); +#line 13 + testRunner.Given("I have a clean site based on Simple.Web", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 14 + testRunner.When("I go to \"Simple/Page.aspx\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 15 + testRunner.Then("I should see \"Hello again\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 16 + testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Returning a routed request")] + public virtual void ReturningARoutedRequest() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Returning a routed request", ((string[])(null))); +#line 18 +this.ScenarioSetup(scenarioInfo); +#line 19 + testRunner.Given("I have a clean site based on Simple.Web", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 20 + testRunner.When("I go to \"hello-world\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 21 + testRunner.Then("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 22 + testRunner.And("I should see \"Hello yet again\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Following a link")] + public virtual void FollowingALink() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Following a link", ((string[])(null))); +#line 24 +this.ScenarioSetup(scenarioInfo); +#line 25 + testRunner.Given("I have a clean site based on Simple.Web", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 26 + testRunner.When("I go to \"/simple/page.aspx\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 27 + testRunner.And("I follow \"next page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 28 + testRunner.Then("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 29 + testRunner.And("I should see \"Hello yet again\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Submitting a form with input, default, and hidden fields")] + public virtual void SubmittingAFormWithInputDefaultAndHiddenFields() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Submitting a form with input, default, and hidden fields", ((string[])(null))); +#line 31 +this.ScenarioSetup(scenarioInfo); +#line 32 + testRunner.Given("I have a clean site based on Simple.Web", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 33 + testRunner.And("I am on \"/simple/page.aspx\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table1.AddRow(new string[] { + "input1", + "gamma"}); +#line 34 + testRunner.When("I fill in", ((string)(null)), table1, "When "); +#line 37 + testRunner.And("I hit \"Go!\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 38 + testRunner.Then("I should see \"passthrough1:alpha\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 39 + testRunner.And("I should see \"passthrough2:beta\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 40 + testRunner.And("I should see \"input1:gamma\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Cookies follow along your request")] + public virtual void CookiesFollowAlongYourRequest() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Cookies follow along your request", ((string[])(null))); +#line 42 +this.ScenarioSetup(scenarioInfo); +#line 43 + testRunner.Given("I have a clean site based on Simple.Web", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 44 + testRunner.When("I go to \"/simple/cookie-set.aspx\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 45 + testRunner.And("I go to \"/simple/cookie-show.aspx\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 46 + testRunner.Then("I should see \"foo:bar\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Being redirected")] + public virtual void BeingRedirected() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Being redirected", ((string[])(null))); +#line 48 +this.ScenarioSetup(scenarioInfo); +#line 49 + testRunner.Given("I have a clean site based on Simple.Web", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 50 + testRunner.When("I go to \"/simple/redir.aspx\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 51 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 52 + testRunner.Then("I should see \"Hello again\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Not found modules file")] + public virtual void NotFoundModulesFile() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Not found modules file", ((string[])(null))); +#line 54 +this.ScenarioSetup(scenarioInfo); +#line 55 + testRunner.Given("I have a clean site based on Simple.Web", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 56 + testRunner.When("I go to \"/Modules/Orchard.Blogs/module.txt\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 57 + testRunner.Then("the status should be 404 \"Not Found\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Not found themes file")] + public virtual void NotFoundThemesFile() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Not found themes file", ((string[])(null))); +#line 59 +this.ScenarioSetup(scenarioInfo); +#line 60 + testRunner.Given("I have a clean site based on Simple.Web", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 61 + testRunner.When("I go to \"/Themes/Classic/theme.txt\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 62 + testRunner.Then("the status should be 404 \"Not Found\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + } +} +#pragma warning restore +#endregion diff --git a/src/Orchard.Specs/Widgets.feature b/src/Orchard.Specs/Widgets.feature index 95d282ce6f2..eb2e61d5637 100644 --- a/src/Orchard.Specs/Widgets.feature +++ b/src/Orchard.Specs/Widgets.feature @@ -1,66 +1,66 @@ -Feature: Widgets - In order to add and manage widgets on my site - As an author - I want to create and edit widgets and layers - -Scenario: I can edit a default layer - Given I have installed Orchard - When I go to "Admin/Widgets" - Then I should see "]*>Widgets[^>]*>" - When I follow "Edit" - Then I should see "]*name="LayerPart.Name"[^>]*value="Default"[^>]*>" - When I fill in - | name | value | - | LayerPart.Description | This is the default layer. | - And I hit "Save" - And I am redirected - Then I should see "Your Layer has been saved" - When I follow "Edit" - Then I should see "]*>\s*This is the default layer.\s*" - -Scenario: I can add a new layer and that layer is active when I'm redirected to the widget management page - Given I have installed Orchard - When I go to "Admin/Widgets" - And I follow "Add a new layer..." - Then I should see "]*>Add Layer" - When I fill in - | name | value | - | LayerPart.Name | For awesome stuff | - | LayerPart.LayerRule | url "~/awesome*" | - And I hit "Save" - And I am redirected - Then I should see "Your Layer has been created." - And I should see "]+selected="selected"[^>]+value="\d+">For awesome stuff" - -Scenario: I can delete a layer - Given I have installed Orchard - When I go to "Admin/Widgets" - Then I should see "]*>Default" - When I follow "Edit" - Then I should see "]*name="LayerPart.Name"[^>]*value="Default"[^>]*>" - When I hit "Delete" - And I am redirected - Then I should see "Layer was successfully deleted" - And I should not see "]*>Default" - -Scenario: I can add a widget to a specific zone in a specific layer - Given I have installed Orchard - When I go to "Admin/Widgets" - And I fill in - | name | value | - | layerId | Disabled | - And I hit "Show" - Then I should see "]*selected[^>]*>Disabled" - When I follow "Add" where href has "zone=Header" - Then I should see "]*>Choose A Widget" - When I follow "

      Html Widget

      " - Then I should see "]*>Add Widget" - When I fill in - | name | value | - | WidgetPart.Title | Flashy HTML Widget | - | Body.Text |

      hi

      | - And I hit "Save" - And I am redirected - Then I should see "Your Html Widget has been added." - And I should see "]*selected[^>]*>Disabled" - And I should see "]*class="[^"]*widgets-this-layer[^"]*"[^>]*>\s*]*>\s*]*>\s*]*>Flashy HTML Widget\s*" +Feature: Widgets + In order to add and manage widgets on my site + As an author + I want to create and edit widgets and layers + +Scenario: I can edit a default layer + Given I have installed Orchard + When I go to "Admin/Widgets" + Then I should see "]*>Widgets[^>]*>" + When I follow "Edit" + Then I should see "]*name="LayerPart.Name"[^>]*value="Default"[^>]*>" + When I fill in + | name | value | + | LayerPart.Description | This is the default layer. | + And I hit "Save" + And I am redirected + Then I should see "Your Layer has been saved" + When I follow "Edit" + Then I should see "]*>\s*This is the default layer.\s*" + +Scenario: I can add a new layer and that layer is active when I'm redirected to the widget management page + Given I have installed Orchard + When I go to "Admin/Widgets" + And I follow "Add a new layer..." + Then I should see "]*>Add Layer" + When I fill in + | name | value | + | LayerPart.Name | For awesome stuff | + | LayerPart.LayerRule | url "~/awesome*" | + And I hit "Save" + And I am redirected + Then I should see "Your Layer has been created." + And I should see "]+selected="selected"[^>]+value="\d+">For awesome stuff" + +Scenario: I can delete a layer + Given I have installed Orchard + When I go to "Admin/Widgets" + Then I should see "]*>Default" + When I follow "Edit" + Then I should see "]*name="LayerPart.Name"[^>]*value="Default"[^>]*>" + When I hit "Delete" + And I am redirected + Then I should see "Layer was successfully deleted" + And I should not see "]*>Default" + +Scenario: I can add a widget to a specific zone in a specific layer + Given I have installed Orchard + When I go to "Admin/Widgets" + And I fill in + | name | value | + | layerId | Disabled | + And I hit "Show" + Then I should see "]*selected[^>]*>Disabled" + When I follow "Add" where href has "zone=Header" + Then I should see "]*>Choose A Widget" + When I follow "

      Html Widget

      " + Then I should see "]*>Add Widget" + When I fill in + | name | value | + | WidgetPart.Title | Flashy HTML Widget | + | Body.Text |

      hi

      | + And I hit "Save" + And I am redirected + Then I should see "Your Html Widget has been added." + And I should see "]*selected[^>]*>Disabled" + And I should see "]*class="[^"]*widgets-this-layer[^"]*"[^>]*>\s*]*>\s*]*>\s*]*>Flashy HTML Widget\s*" diff --git a/src/Orchard.Specs/Widgets.feature.cs b/src/Orchard.Specs/Widgets.feature.cs index eb10c308f37..a26698b6d43 100644 --- a/src/Orchard.Specs/Widgets.feature.cs +++ b/src/Orchard.Specs/Widgets.feature.cs @@ -1,240 +1,240 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by SpecFlow (http://www.specflow.org/). -// SpecFlow Version:1.9.0.77 -// SpecFlow Generator Version:1.9.0.0 -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ -#region Designer generated code -#pragma warning disable -namespace Orchard.Specs -{ - using TechTalk.SpecFlow; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [NUnit.Framework.TestFixtureAttribute()] - [NUnit.Framework.DescriptionAttribute("Widgets")] - public partial class WidgetsFeature - { - - private static TechTalk.SpecFlow.ITestRunner testRunner; - -#line 1 "Widgets.feature" -#line hidden - - [NUnit.Framework.TestFixtureSetUpAttribute()] - public virtual void FeatureSetup() - { - testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); - TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Widgets", " In order to add and manage widgets on my site\r\n As an author\r\n I want to crea" + - "te and edit widgets and layers", ProgrammingLanguage.CSharp, ((string[])(null))); - testRunner.OnFeatureStart(featureInfo); - } - - [NUnit.Framework.TestFixtureTearDownAttribute()] - public virtual void FeatureTearDown() - { - testRunner.OnFeatureEnd(); - testRunner = null; - } - - [NUnit.Framework.SetUpAttribute()] - public virtual void TestInitialize() - { - } - - [NUnit.Framework.TearDownAttribute()] - public virtual void ScenarioTearDown() - { - testRunner.OnScenarioEnd(); - } - - public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) - { - testRunner.OnScenarioStart(scenarioInfo); - } - - public virtual void ScenarioCleanup() - { - testRunner.CollectScenarioErrors(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I can edit a default layer")] - public virtual void ICanEditADefaultLayer() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can edit a default layer", ((string[])(null))); -#line 6 -this.ScenarioSetup(scenarioInfo); -#line 7 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 8 - testRunner.When("I go to \"Admin/Widgets\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 9 - testRunner.Then("I should see \"]*>Widgets[^>]*>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 10 - testRunner.When("I follow \"Edit\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 11 - testRunner.Then("I should see \"]*name=\"LayerPart.Name\"[^>]*value=\"Default\"[^>]*>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table1.AddRow(new string[] { - "LayerPart.Description", - "This is the default layer."}); -#line 12 - testRunner.When("I fill in", ((string)(null)), table1, "When "); -#line 15 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 16 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 17 - testRunner.Then("I should see \"Your Layer has been saved\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 18 - testRunner.When("I follow \"Edit\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 19 - testRunner.Then("I should see \"]*>\\s*This is the default layer.\\s*\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I can add a new layer and that layer is active when I\'m redirected to the widget " + - "management page")] - public virtual void ICanAddANewLayerAndThatLayerIsActiveWhenIMRedirectedToTheWidgetManagementPage() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can add a new layer and that layer is active when I\'m redirected to the widget " + - "management page", ((string[])(null))); -#line 21 -this.ScenarioSetup(scenarioInfo); -#line 22 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 23 - testRunner.When("I go to \"Admin/Widgets\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 24 - testRunner.And("I follow \"Add a new layer...\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 25 - testRunner.Then("I should see \"]*>Add Layer\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table2.AddRow(new string[] { - "LayerPart.Name", - "For awesome stuff"}); - table2.AddRow(new string[] { - "LayerPart.LayerRule", - "url \"~/awesome*\""}); -#line 26 - testRunner.When("I fill in", ((string)(null)), table2, "When "); -#line 30 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 31 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 32 - testRunner.Then("I should see \"Your Layer has been created.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 33 - testRunner.And("I should see \"]+selected=\"selected\"[^>]+value=\"\\d+\">For awesome stuff\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I can delete a layer")] - public virtual void ICanDeleteALayer() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can delete a layer", ((string[])(null))); -#line 35 -this.ScenarioSetup(scenarioInfo); -#line 36 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 37 - testRunner.When("I go to \"Admin/Widgets\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 38 - testRunner.Then("I should see \"]*>Default\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 39 - testRunner.When("I follow \"Edit\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 40 - testRunner.Then("I should see \"]*name=\"LayerPart.Name\"[^>]*value=\"Default\"[^>]*>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 41 - testRunner.When("I hit \"Delete\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 42 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 43 - testRunner.Then("I should see \"Layer was successfully deleted\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 44 - testRunner.And("I should not see \"]*>Default\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - - [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("I can add a widget to a specific zone in a specific layer")] - public virtual void ICanAddAWidgetToASpecificZoneInASpecificLayer() - { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can add a widget to a specific zone in a specific layer", ((string[])(null))); -#line 46 -this.ScenarioSetup(scenarioInfo); -#line 47 - testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); -#line 48 - testRunner.When("I go to \"Admin/Widgets\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line hidden - TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table3.AddRow(new string[] { - "layerId", - "Disabled"}); -#line 49 - testRunner.And("I fill in", ((string)(null)), table3, "And "); -#line 52 - testRunner.And("I hit \"Show\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 53 - testRunner.Then("I should see \"]*selected[^>]*>Disabled\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 54 - testRunner.When("I follow \"Add\" where href has \"zone=Header\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 55 - testRunner.Then("I should see \"]*>Choose A Widget\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 56 - testRunner.When("I follow \"

      Html Widget

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); -#line 57 - testRunner.Then("I should see \"]*>Add Widget\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line hidden - TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] { - "name", - "value"}); - table4.AddRow(new string[] { - "WidgetPart.Title", - "Flashy HTML Widget"}); - table4.AddRow(new string[] { - "Body.Text", - "

      hi

      "}); -#line 58 - testRunner.When("I fill in", ((string)(null)), table4, "When "); -#line 62 - testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 63 - testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 64 - testRunner.Then("I should see \"Your Html Widget has been added.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); -#line 65 - testRunner.And("I should see \"]*selected[^>]*>Disabled\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line 66 - testRunner.And("I should see \"]*class=\"[^\"]*widgets-this-layer[^\"]*\"[^>]*>\\s*]*>\\s*" + - "]*>\\s*]*>Flashy HTML Widget\\s*\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); -#line hidden - this.ScenarioCleanup(); - } - } -} -#pragma warning restore -#endregion +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.9.0.77 +// SpecFlow Generator Version:1.9.0.0 +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +#pragma warning disable +namespace Orchard.Specs +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("Widgets")] + public partial class WidgetsFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "Widgets.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Widgets", " In order to add and manage widgets on my site\r\n As an author\r\n I want to crea" + + "te and edit widgets and layers", ProgrammingLanguage.CSharp, ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + [NUnit.Framework.SetUpAttribute()] + public virtual void TestInitialize() + { + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + public virtual void ScenarioCleanup() + { + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I can edit a default layer")] + public virtual void ICanEditADefaultLayer() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can edit a default layer", ((string[])(null))); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 8 + testRunner.When("I go to \"Admin/Widgets\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 9 + testRunner.Then("I should see \"]*>Widgets[^>]*>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 10 + testRunner.When("I follow \"Edit\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 11 + testRunner.Then("I should see \"]*name=\"LayerPart.Name\"[^>]*value=\"Default\"[^>]*>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table1.AddRow(new string[] { + "LayerPart.Description", + "This is the default layer."}); +#line 12 + testRunner.When("I fill in", ((string)(null)), table1, "When "); +#line 15 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 16 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 17 + testRunner.Then("I should see \"Your Layer has been saved\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 18 + testRunner.When("I follow \"Edit\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 19 + testRunner.Then("I should see \"]*>\\s*This is the default layer.\\s*\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I can add a new layer and that layer is active when I\'m redirected to the widget " + + "management page")] + public virtual void ICanAddANewLayerAndThatLayerIsActiveWhenIMRedirectedToTheWidgetManagementPage() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can add a new layer and that layer is active when I\'m redirected to the widget " + + "management page", ((string[])(null))); +#line 21 +this.ScenarioSetup(scenarioInfo); +#line 22 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 23 + testRunner.When("I go to \"Admin/Widgets\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 24 + testRunner.And("I follow \"Add a new layer...\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 25 + testRunner.Then("I should see \"]*>Add Layer\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table2.AddRow(new string[] { + "LayerPart.Name", + "For awesome stuff"}); + table2.AddRow(new string[] { + "LayerPart.LayerRule", + "url \"~/awesome*\""}); +#line 26 + testRunner.When("I fill in", ((string)(null)), table2, "When "); +#line 30 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 31 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 32 + testRunner.Then("I should see \"Your Layer has been created.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 33 + testRunner.And("I should see \"]+selected=\"selected\"[^>]+value=\"\\d+\">For awesome stuff\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I can delete a layer")] + public virtual void ICanDeleteALayer() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can delete a layer", ((string[])(null))); +#line 35 +this.ScenarioSetup(scenarioInfo); +#line 36 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 37 + testRunner.When("I go to \"Admin/Widgets\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 38 + testRunner.Then("I should see \"]*>Default\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 39 + testRunner.When("I follow \"Edit\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 40 + testRunner.Then("I should see \"]*name=\"LayerPart.Name\"[^>]*value=\"Default\"[^>]*>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 41 + testRunner.When("I hit \"Delete\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 42 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 43 + testRunner.Then("I should see \"Layer was successfully deleted\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 44 + testRunner.And("I should not see \"]*>Default\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I can add a widget to a specific zone in a specific layer")] + public virtual void ICanAddAWidgetToASpecificZoneInASpecificLayer() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can add a widget to a specific zone in a specific layer", ((string[])(null))); +#line 46 +this.ScenarioSetup(scenarioInfo); +#line 47 + testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given "); +#line 48 + testRunner.When("I go to \"Admin/Widgets\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line hidden + TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table3.AddRow(new string[] { + "layerId", + "Disabled"}); +#line 49 + testRunner.And("I fill in", ((string)(null)), table3, "And "); +#line 52 + testRunner.And("I hit \"Show\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 53 + testRunner.Then("I should see \"]*selected[^>]*>Disabled\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 54 + testRunner.When("I follow \"Add\" where href has \"zone=Header\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 55 + testRunner.Then("I should see \"]*>Choose A Widget\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 56 + testRunner.When("I follow \"

      Html Widget

      \"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When "); +#line 57 + testRunner.Then("I should see \"]*>Add Widget\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line hidden + TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table4.AddRow(new string[] { + "WidgetPart.Title", + "Flashy HTML Widget"}); + table4.AddRow(new string[] { + "Body.Text", + "

      hi

      "}); +#line 58 + testRunner.When("I fill in", ((string)(null)), table4, "When "); +#line 62 + testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 63 + testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 64 + testRunner.Then("I should see \"Your Html Widget has been added.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then "); +#line 65 + testRunner.And("I should see \"]*selected[^>]*>Disabled\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line 66 + testRunner.And("I should see \"]*class=\"[^\"]*widgets-this-layer[^\"]*\"[^>]*>\\s*]*>\\s*" + + "]*>\\s*]*>Flashy HTML Widget\\s*\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And "); +#line hidden + this.ScenarioCleanup(); + } + } +} +#pragma warning restore +#endregion diff --git a/src/Orchard.Tests.Modules/Autoroute/DefaultSlugServiceTests.cs b/src/Orchard.Tests.Modules/Autoroute/DefaultSlugServiceTests.cs index 812be0baa2f..54d0cb980fc 100644 --- a/src/Orchard.Tests.Modules/Autoroute/DefaultSlugServiceTests.cs +++ b/src/Orchard.Tests.Modules/Autoroute/DefaultSlugServiceTests.cs @@ -1,76 +1,76 @@ -using Moq; -using NUnit.Framework; -using Orchard.Autoroute.Services; - -namespace Orchard.Tests.Modules.Autoroute { - [TestFixture] - public class DefaultSlugServiceTests { - - private DefaultSlugService _slugService = new DefaultSlugService(new Mock().Object); - - [Test] - public void ShouldStripContiguousDashes() { - Assert.That(_slugService.Slugify("a - b"), Is.EqualTo("a-b")); - } - - [Test] - public void ShouldStripContiguousDashes2() { - Assert.That(_slugService.Slugify("a - - - - - -b"), Is.EqualTo("a-b")); - } - - [Test] - public void ShouldStripContiguousDashesEverywhere() { - Assert.That(_slugService.Slugify("a - b - c -- d"), Is.EqualTo("a-b-c-d")); - } - - [Test] - public void ShouldChangePercentSymbolsToHyphans() { - Assert.That(_slugService.Slugify("a%d"), Is.EqualTo("a-d")); - } - - [Test] - public void ShouldChangeDotSymbolsToHyphans() { - Assert.That(_slugService.Slugify("a,d"), Is.EqualTo("a-d")); - } - - [Test] - public void ShouldMakeSureFunkycharactersAndHyphansOnlyReturnSingleHyphan() { - Assert.That(_slugService.Slugify("«a»-%-.d"), Is.EqualTo("a-d")); - } - - [Test] - public void ShouldConvertToLowercase() { - Assert.That(_slugService.Slugify("ABCDE"), Is.EqualTo("abcde")); - } - - [Test] - public void ShouldRemoveDiacritics() { - Assert.That(_slugService.Slugify("àçéïôù"), Is.EqualTo("aceiou")); - } - - [Test] - public void ShouldPreserveCyrilicCharacters() { - Assert.That(_slugService.Slugify("джинсы_клеш"), Is.EqualTo("джинсы_клеш")); - } - - [Test] - public void ShouldPreserveHebrewCharacters() { - Assert.That(_slugService.Slugify("צוות_אורצ_רד"), Is.EqualTo("צוות_אורצ_רד")); - } - - [Test] - public void ShouldPreserveChineseCharacters() { - Assert.That(_slugService.Slugify("调度模块允许后台任务调度"), Is.EqualTo("调度模块允许后台任务调度")); - } - - [Test] - public void ShouldPreserveArabicCharacters() { - Assert.That(_slugService.Slugify("فريق_الاورشارد"), Is.EqualTo("فريق_الاورشارد")); - } - - [Test] - public void ShouldPreserveJapaneseCharacters() { - Assert.That(_slugService.Slugify("不正なコンテナ"), Is.EqualTo("不正なコンテナ")); - } - } -} +using Moq; +using NUnit.Framework; +using Orchard.Autoroute.Services; + +namespace Orchard.Tests.Modules.Autoroute { + [TestFixture] + public class DefaultSlugServiceTests { + + private DefaultSlugService _slugService = new DefaultSlugService(new Mock().Object); + + [Test] + public void ShouldStripContiguousDashes() { + Assert.That(_slugService.Slugify("a - b"), Is.EqualTo("a-b")); + } + + [Test] + public void ShouldStripContiguousDashes2() { + Assert.That(_slugService.Slugify("a - - - - - -b"), Is.EqualTo("a-b")); + } + + [Test] + public void ShouldStripContiguousDashesEverywhere() { + Assert.That(_slugService.Slugify("a - b - c -- d"), Is.EqualTo("a-b-c-d")); + } + + [Test] + public void ShouldChangePercentSymbolsToHyphans() { + Assert.That(_slugService.Slugify("a%d"), Is.EqualTo("a-d")); + } + + [Test] + public void ShouldChangeDotSymbolsToHyphans() { + Assert.That(_slugService.Slugify("a,d"), Is.EqualTo("a-d")); + } + + [Test] + public void ShouldMakeSureFunkycharactersAndHyphansOnlyReturnSingleHyphan() { + Assert.That(_slugService.Slugify("«a»-%-.d"), Is.EqualTo("a-d")); + } + + [Test] + public void ShouldConvertToLowercase() { + Assert.That(_slugService.Slugify("ABCDE"), Is.EqualTo("abcde")); + } + + [Test] + public void ShouldRemoveDiacritics() { + Assert.That(_slugService.Slugify("àçéïôù"), Is.EqualTo("aceiou")); + } + + [Test] + public void ShouldPreserveCyrilicCharacters() { + Assert.That(_slugService.Slugify("джинсы_клеш"), Is.EqualTo("джинсы_клеш")); + } + + [Test] + public void ShouldPreserveHebrewCharacters() { + Assert.That(_slugService.Slugify("צוות_אורצ_רד"), Is.EqualTo("צוות_אורצ_רד")); + } + + [Test] + public void ShouldPreserveChineseCharacters() { + Assert.That(_slugService.Slugify("调度模块允许后台任务调度"), Is.EqualTo("调度模块允许后台任务调度")); + } + + [Test] + public void ShouldPreserveArabicCharacters() { + Assert.That(_slugService.Slugify("فريق_الاورشارد"), Is.EqualTo("فريق_الاورشارد")); + } + + [Test] + public void ShouldPreserveJapaneseCharacters() { + Assert.That(_slugService.Slugify("不正なコンテナ"), Is.EqualTo("不正なコンテナ")); + } + } +} diff --git a/src/Orchard.Tests.Modules/CodeGeneration/Commands/CodeGenerationCommandsTests.cs b/src/Orchard.Tests.Modules/CodeGeneration/Commands/CodeGenerationCommandsTests.cs index d56638e13cb..064386453a0 100644 --- a/src/Orchard.Tests.Modules/CodeGeneration/Commands/CodeGenerationCommandsTests.cs +++ b/src/Orchard.Tests.Modules/CodeGeneration/Commands/CodeGenerationCommandsTests.cs @@ -1,75 +1,75 @@ -using System.Collections.Generic; -using System.IO; -using Autofac; -using Autofac.Features.Metadata; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.CodeGeneration.Commands; -using Orchard.Commands; -using Orchard.Data; -using Orchard.Data.Migration.Generator; -using Orchard.Data.Providers; -using Orchard.Environment; -using Orchard.Environment.Configuration; -using Orchard.Environment.Extensions; -using Orchard.Environment.ShellBuilders; -using Orchard.Environment.ShellBuilders.Models; -using Orchard.FileSystems.AppData; -using Orchard.Tests.Environment; -using Orchard.Tests.FileSystems.AppData; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.Modules.CodeGeneration.Commands { - [TestFixture] - public class CodeGenerationCommandsTests { - - private IContainer _container; - private IExtensionManager _extensionManager; - private ISchemaCommandGenerator _schemaCommandGenerator; - - [SetUp] - public void Init() { - string databaseFileName = Path.GetTempFileName(); - IDataServicesProviderFactory dataServicesProviderFactory = new DataServicesProviderFactory(new[] { - new Meta( - (dataFolder, connectionString) => new SqlCeDataServicesProvider(dataFolder, connectionString), - new Dictionary {{"ProviderName", "SqlCe"}}) - }); - - var builder = new ContainerBuilder(); - - builder.RegisterInstance(new ShellBlueprint()); - builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataTablePrefix = "Test", DataProvider = "SqlCe" }); - builder.RegisterInstance(dataServicesProviderFactory).As(); - builder.RegisterInstance(AppDataFolderTests.CreateAppDataFolder(Path.GetDirectoryName(databaseFileName))).As(); - - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - _container = builder.Build(); - _extensionManager = _container.Resolve(); - _schemaCommandGenerator = _container.Resolve(); - } - - [Test] - public void CreateDataMigrationTestNonExistentFeature() { - CodeGenerationCommands codeGenerationCommands = new CodeGenerationCommands(_extensionManager, - _schemaCommandGenerator); - - TextWriter textWriterOutput = new StringWriter(); - codeGenerationCommands.Context = new CommandContext { Output = textWriterOutput }; - codeGenerationCommands.CreateDataMigration("feature"); - - Assert.That(textWriterOutput.ToString(), Is.StringContaining("Creating data migration failed")); - } - } +using System.Collections.Generic; +using System.IO; +using Autofac; +using Autofac.Features.Metadata; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.CodeGeneration.Commands; +using Orchard.Commands; +using Orchard.Data; +using Orchard.Data.Migration.Generator; +using Orchard.Data.Providers; +using Orchard.Environment; +using Orchard.Environment.Configuration; +using Orchard.Environment.Extensions; +using Orchard.Environment.ShellBuilders; +using Orchard.Environment.ShellBuilders.Models; +using Orchard.FileSystems.AppData; +using Orchard.Tests.Environment; +using Orchard.Tests.FileSystems.AppData; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.Modules.CodeGeneration.Commands { + [TestFixture] + public class CodeGenerationCommandsTests { + + private IContainer _container; + private IExtensionManager _extensionManager; + private ISchemaCommandGenerator _schemaCommandGenerator; + + [SetUp] + public void Init() { + string databaseFileName = Path.GetTempFileName(); + IDataServicesProviderFactory dataServicesProviderFactory = new DataServicesProviderFactory(new[] { + new Meta( + (dataFolder, connectionString) => new SqlCeDataServicesProvider(dataFolder, connectionString), + new Dictionary {{"ProviderName", "SqlCe"}}) + }); + + var builder = new ContainerBuilder(); + + builder.RegisterInstance(new ShellBlueprint()); + builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataTablePrefix = "Test", DataProvider = "SqlCe" }); + builder.RegisterInstance(dataServicesProviderFactory).As(); + builder.RegisterInstance(AppDataFolderTests.CreateAppDataFolder(Path.GetDirectoryName(databaseFileName))).As(); + + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + _container = builder.Build(); + _extensionManager = _container.Resolve(); + _schemaCommandGenerator = _container.Resolve(); + } + + [Test] + public void CreateDataMigrationTestNonExistentFeature() { + CodeGenerationCommands codeGenerationCommands = new CodeGenerationCommands(_extensionManager, + _schemaCommandGenerator); + + TextWriter textWriterOutput = new StringWriter(); + codeGenerationCommands.Context = new CommandContext { Output = textWriterOutput }; + codeGenerationCommands.CreateDataMigration("feature"); + + Assert.That(textWriterOutput.ToString(), Is.StringContaining("Creating data migration failed")); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests.Modules/Comments/Services/CommentServiceTests.cs b/src/Orchard.Tests.Modules/Comments/Services/CommentServiceTests.cs index a238f62d53c..9fb3dcd45ac 100644 --- a/src/Orchard.Tests.Modules/Comments/Services/CommentServiceTests.cs +++ b/src/Orchard.Tests.Modules/Comments/Services/CommentServiceTests.cs @@ -1,219 +1,219 @@ -using System; -using System.Collections.Generic; -using Autofac; -using JetBrains.Annotations; -using Moq; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.Comments.Handlers; -using Orchard.Comments.Models; -using Orchard.Comments.Services; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Drivers; -using Orchard.ContentManagement.Handlers; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.Records; -using Orchard.Core.Common.Handlers; -using Orchard.Core.Common.Models; -using Orchard.Data; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.DisplayManagement.Implementation; -using Orchard.Environment; -using Orchard.Environment.Configuration; -using Orchard.Environment.Descriptor; -using Orchard.Environment.Descriptor.Models; -using Orchard.Environment.Extensions; -using Orchard.Environment.ShellBuilders; -using Orchard.Environment.State; -using Orchard.Security; -using Orchard.Security.Providers; -using Orchard.Services; -using Orchard.Tests.Modules.ImportExport.Services; -using Orchard.Tests.Modules.Users; -using Orchard.Tests.Stubs; -using Orchard.UI.Notify; -using Orchard.UI.PageClass; -using Orchard.Tests.Utility; -using Orchard.Messaging.Services; -using Orchard.Users.Services; - -namespace Orchard.Tests.Modules.Comments.Services { - [TestFixture] - public class CommentServiceTests : DatabaseEnabledTestsBase { - private IContentManager _contentManager; - private ICommentService _commentService; - - public override void Register(ContainerBuilder builder) { - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(ShellSettingsUtility.CreateEncryptionEnabled()); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); - - } - - public override void Init() { - base.Init(); - _commentService = _container.Resolve(); - _contentManager = _container.Resolve(); - } - - - protected override IEnumerable DatabaseTypes { - get { - return new[] { - typeof(CommentsPartRecord), - typeof(CommentPartRecord), - typeof(ContentItemRecord), - typeof(ContentItemVersionRecord), - typeof(ContentTypeRecord), - }; - } - } - - [Test] - public void CommentedItemShouldHaveACommentPart() { - var commentedItem = _contentManager.New("commentedItem"); - _contentManager.Create(commentedItem); - _contentManager.Create(commentedItem, VersionOptions.Published); - - Assert.That(commentedItem.As(), Is.Not.Null); - } - - [Test] - public void GetCommentsShouldReturnAllComments() { - for (int i = 0; i < 12; i++) { - var commentedItem = _contentManager.New("commentedItem"); - _contentManager.Create(commentedItem); - _contentManager.Create(commentedItem, VersionOptions.Published); - - } - - Assert.That(_commentService.GetComments().Count(), Is.EqualTo(12)); - } - - [Test] - public void GetCommentedContentShouldReturnCommentedContentItem() { - var commentedItem = _contentManager.New("commentedItem"); - _contentManager.Create(commentedItem); - _contentManager.Create(commentedItem, VersionOptions.Published); - int commentId = commentedItem.As().Id; - - Assert.That(_commentService.GetCommentedContent(commentId), Is.Not.Null); - } - - [Test] - public void CommentsShouldBePendingByDefault() { - var commentedItem = _contentManager.New("commentedItem"); - _contentManager.Create(commentedItem); - _contentManager.Create(commentedItem, VersionOptions.Published); - int commentId = commentedItem.As().Id; - - Assert.That(_commentService.GetComment(commentId).Record.Status, Is.EqualTo(CommentStatus.Pending)); - } - - [Test] - public void ApproveShouldUpdateCommentStatus() { - var commentedItem = _contentManager.New("commentedItem"); - _contentManager.Create(commentedItem); - _contentManager.Create(commentedItem, VersionOptions.Published); - int commentId = commentedItem.As().Id; - _commentService.ApproveComment(commentId); - - Assert.That(_commentService.GetComment(commentId).Record.Status, Is.EqualTo(CommentStatus.Approved)); - } - - [Test] - public void UnapproveShouldPendComment() { - var commentedItem = _contentManager.New("commentedItem"); - _contentManager.Create(commentedItem); - _contentManager.Create(commentedItem, VersionOptions.Published); - int commentId = commentedItem.As().Id; - _commentService.ApproveComment(commentId); - - Assert.That(_commentService.GetComment(commentId).Record.Status, Is.EqualTo(CommentStatus.Approved)); - - _commentService.UnapproveComment(commentId); - - Assert.That(_commentService.GetComment(commentId).Record.Status, Is.EqualTo(CommentStatus.Pending)); - } - - [Test] - public void DeleteShouldRemoveComments() { - var commentIds = new int[12]; - - for (int i = 0; i < 12; i++) { - var commentedItem = _contentManager.New("commentedItem"); - _contentManager.Create(commentedItem); - _contentManager.Create(commentedItem, VersionOptions.Published); - commentIds[i] = commentedItem.As().Id; - } - - Assert.That(_commentService.GetComments().Count(), Is.EqualTo(12)); - - for (int i = 0; i < 12; i++) { - _commentService.DeleteComment(commentIds[i]); - } - - Assert.That(_commentService.GetComments().Count(), Is.EqualTo(0)); - } - } - - [UsedImplicitly] - public class CommentedItemHandler : ContentHandler { - public CommentedItemHandler() { - Filters.Add(new ActivatingFilter("commentedItem")); - Filters.Add(new ActivatingFilter("commentedItem")); - Filters.Add(new ActivatingFilter("commentedItem")); - } - } - - public class CommentedItem : ContentPart { - } - - public class CommentedItemDriver : ContentPartDriver { - public static readonly string ContentTypeName = "commentedItem"; - } - - public class ProcessingEngineStub : IProcessingEngine { - - public string AddTask(ShellSettings shellSettings, ShellDescriptor shellDescriptor, string messageName, Dictionary parameters) { - return ""; - } - - public bool AreTasksPending() { - return false; - } - - public void ExecuteNextTask() { - } - } -} +using System; +using System.Collections.Generic; +using Autofac; +using JetBrains.Annotations; +using Moq; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.Comments.Handlers; +using Orchard.Comments.Models; +using Orchard.Comments.Services; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Drivers; +using Orchard.ContentManagement.Handlers; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.Records; +using Orchard.Core.Common.Handlers; +using Orchard.Core.Common.Models; +using Orchard.Data; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.DisplayManagement.Implementation; +using Orchard.Environment; +using Orchard.Environment.Configuration; +using Orchard.Environment.Descriptor; +using Orchard.Environment.Descriptor.Models; +using Orchard.Environment.Extensions; +using Orchard.Environment.ShellBuilders; +using Orchard.Environment.State; +using Orchard.Security; +using Orchard.Security.Providers; +using Orchard.Services; +using Orchard.Tests.Modules.ImportExport.Services; +using Orchard.Tests.Modules.Users; +using Orchard.Tests.Stubs; +using Orchard.UI.Notify; +using Orchard.UI.PageClass; +using Orchard.Tests.Utility; +using Orchard.Messaging.Services; +using Orchard.Users.Services; + +namespace Orchard.Tests.Modules.Comments.Services { + [TestFixture] + public class CommentServiceTests : DatabaseEnabledTestsBase { + private IContentManager _contentManager; + private ICommentService _commentService; + + public override void Register(ContainerBuilder builder) { + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(ShellSettingsUtility.CreateEncryptionEnabled()); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); + + } + + public override void Init() { + base.Init(); + _commentService = _container.Resolve(); + _contentManager = _container.Resolve(); + } + + + protected override IEnumerable DatabaseTypes { + get { + return new[] { + typeof(CommentsPartRecord), + typeof(CommentPartRecord), + typeof(ContentItemRecord), + typeof(ContentItemVersionRecord), + typeof(ContentTypeRecord), + }; + } + } + + [Test] + public void CommentedItemShouldHaveACommentPart() { + var commentedItem = _contentManager.New("commentedItem"); + _contentManager.Create(commentedItem); + _contentManager.Create(commentedItem, VersionOptions.Published); + + Assert.That(commentedItem.As(), Is.Not.Null); + } + + [Test] + public void GetCommentsShouldReturnAllComments() { + for (int i = 0; i < 12; i++) { + var commentedItem = _contentManager.New("commentedItem"); + _contentManager.Create(commentedItem); + _contentManager.Create(commentedItem, VersionOptions.Published); + + } + + Assert.That(_commentService.GetComments().Count(), Is.EqualTo(12)); + } + + [Test] + public void GetCommentedContentShouldReturnCommentedContentItem() { + var commentedItem = _contentManager.New("commentedItem"); + _contentManager.Create(commentedItem); + _contentManager.Create(commentedItem, VersionOptions.Published); + int commentId = commentedItem.As().Id; + + Assert.That(_commentService.GetCommentedContent(commentId), Is.Not.Null); + } + + [Test] + public void CommentsShouldBePendingByDefault() { + var commentedItem = _contentManager.New("commentedItem"); + _contentManager.Create(commentedItem); + _contentManager.Create(commentedItem, VersionOptions.Published); + int commentId = commentedItem.As().Id; + + Assert.That(_commentService.GetComment(commentId).Record.Status, Is.EqualTo(CommentStatus.Pending)); + } + + [Test] + public void ApproveShouldUpdateCommentStatus() { + var commentedItem = _contentManager.New("commentedItem"); + _contentManager.Create(commentedItem); + _contentManager.Create(commentedItem, VersionOptions.Published); + int commentId = commentedItem.As().Id; + _commentService.ApproveComment(commentId); + + Assert.That(_commentService.GetComment(commentId).Record.Status, Is.EqualTo(CommentStatus.Approved)); + } + + [Test] + public void UnapproveShouldPendComment() { + var commentedItem = _contentManager.New("commentedItem"); + _contentManager.Create(commentedItem); + _contentManager.Create(commentedItem, VersionOptions.Published); + int commentId = commentedItem.As().Id; + _commentService.ApproveComment(commentId); + + Assert.That(_commentService.GetComment(commentId).Record.Status, Is.EqualTo(CommentStatus.Approved)); + + _commentService.UnapproveComment(commentId); + + Assert.That(_commentService.GetComment(commentId).Record.Status, Is.EqualTo(CommentStatus.Pending)); + } + + [Test] + public void DeleteShouldRemoveComments() { + var commentIds = new int[12]; + + for (int i = 0; i < 12; i++) { + var commentedItem = _contentManager.New("commentedItem"); + _contentManager.Create(commentedItem); + _contentManager.Create(commentedItem, VersionOptions.Published); + commentIds[i] = commentedItem.As().Id; + } + + Assert.That(_commentService.GetComments().Count(), Is.EqualTo(12)); + + for (int i = 0; i < 12; i++) { + _commentService.DeleteComment(commentIds[i]); + } + + Assert.That(_commentService.GetComments().Count(), Is.EqualTo(0)); + } + } + + [UsedImplicitly] + public class CommentedItemHandler : ContentHandler { + public CommentedItemHandler() { + Filters.Add(new ActivatingFilter("commentedItem")); + Filters.Add(new ActivatingFilter("commentedItem")); + Filters.Add(new ActivatingFilter("commentedItem")); + } + } + + public class CommentedItem : ContentPart { + } + + public class CommentedItemDriver : ContentPartDriver { + public static readonly string ContentTypeName = "commentedItem"; + } + + public class ProcessingEngineStub : IProcessingEngine { + + public string AddTask(ShellSettings shellSettings, ShellDescriptor shellDescriptor, string messageName, Dictionary parameters) { + return ""; + } + + public bool AreTasksPending() { + return false; + } + + public void ExecuteNextTask() { + } + } +} diff --git a/src/Orchard.Tests.Modules/DatabaseEnabledTestsBase.cs b/src/Orchard.Tests.Modules/DatabaseEnabledTestsBase.cs index 420d5a57064..c7d97375e4f 100644 --- a/src/Orchard.Tests.Modules/DatabaseEnabledTestsBase.cs +++ b/src/Orchard.Tests.Modules/DatabaseEnabledTestsBase.cs @@ -1,84 +1,84 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics; -using System.IO; -using System.Linq; -using Autofac; -using NHibernate; -using NUnit.Framework; -using Orchard.ContentManagement.FieldStorage.InfosetStorage; -using Orchard.ContentManagement.Handlers; -using Orchard.Data; -using Orchard.Environment.Configuration; -using Orchard.Services; -using Orchard.Tests.ContentManagement; -using Orchard.Tests.Data; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.Modules { - public abstract class DatabaseEnabledTestsBase { - - protected IContainer _container; - protected ITransaction _transaction; - - protected ISession _session; - protected string _databaseFilePath; - protected ISessionFactory _sessionFactory; - protected StubClock _clock; - - - [TestFixtureSetUp] - public void InitFixture() { - } - - [TestFixtureTearDown] - public void TearDownFixture() { - File.Delete(_databaseFilePath); - } - - [SetUp] - public virtual void Init() { - _databaseFilePath = Path.GetTempFileName(); - _sessionFactory = DataUtility.CreateSessionFactory(_databaseFilePath, DatabaseTypes.ToArray()); - _session = _sessionFactory.OpenSession(); - _transaction = _session.BeginTransaction(IsolationLevel.ReadCommitted); - - _clock = new StubClock(); - - var builder = new ContainerBuilder(); - //builder.RegisterModule(new ImplicitCollectionSupportModule()); - builder.RegisterType().As(); - builder.RegisterInstance(new StubLocator(_session)).As(); - builder.RegisterInstance(_clock).As(); - builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); - builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataProvider = "SqlCe" }); - builder.RegisterInstance(new TestTransactionManager(_session)).As(); - Register(builder); - _container = builder.Build(); - - } - - [TearDown] - public void Cleanup() { - if(_container != null) - _container.Dispose(); - } - - public abstract void Register(ContainerBuilder builder); - - protected virtual IEnumerable DatabaseTypes { - get { - return Enumerable.Empty(); - } - } - - protected void ClearSession() { - Trace.WriteLine("Flush and clear session"); - _transaction.Commit(); - _session.Clear(); - _transaction = _session.BeginTransaction(IsolationLevel.ReadCommitted); - Trace.WriteLine("Flushed and cleared session"); - } - } +using System; +using System.Collections.Generic; +using System.Data; +using System.Diagnostics; +using System.IO; +using System.Linq; +using Autofac; +using NHibernate; +using NUnit.Framework; +using Orchard.ContentManagement.FieldStorage.InfosetStorage; +using Orchard.ContentManagement.Handlers; +using Orchard.Data; +using Orchard.Environment.Configuration; +using Orchard.Services; +using Orchard.Tests.ContentManagement; +using Orchard.Tests.Data; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.Modules { + public abstract class DatabaseEnabledTestsBase { + + protected IContainer _container; + protected ITransaction _transaction; + + protected ISession _session; + protected string _databaseFilePath; + protected ISessionFactory _sessionFactory; + protected StubClock _clock; + + + [TestFixtureSetUp] + public void InitFixture() { + } + + [TestFixtureTearDown] + public void TearDownFixture() { + File.Delete(_databaseFilePath); + } + + [SetUp] + public virtual void Init() { + _databaseFilePath = Path.GetTempFileName(); + _sessionFactory = DataUtility.CreateSessionFactory(_databaseFilePath, DatabaseTypes.ToArray()); + _session = _sessionFactory.OpenSession(); + _transaction = _session.BeginTransaction(IsolationLevel.ReadCommitted); + + _clock = new StubClock(); + + var builder = new ContainerBuilder(); + //builder.RegisterModule(new ImplicitCollectionSupportModule()); + builder.RegisterType().As(); + builder.RegisterInstance(new StubLocator(_session)).As(); + builder.RegisterInstance(_clock).As(); + builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); + builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataProvider = "SqlCe" }); + builder.RegisterInstance(new TestTransactionManager(_session)).As(); + Register(builder); + _container = builder.Build(); + + } + + [TearDown] + public void Cleanup() { + if(_container != null) + _container.Dispose(); + } + + public abstract void Register(ContainerBuilder builder); + + protected virtual IEnumerable DatabaseTypes { + get { + return Enumerable.Empty(); + } + } + + protected void ClearSession() { + Trace.WriteLine("Flush and clear session"); + _transaction.Commit(); + _session.Clear(); + _transaction = _session.BeginTransaction(IsolationLevel.ReadCommitted); + Trace.WriteLine("Flushed and cleared session"); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests.Modules/Email/EmailChannelTests.cs b/src/Orchard.Tests.Modules/Email/EmailChannelTests.cs index 5c6be5cf7e8..c047b3072d6 100644 --- a/src/Orchard.Tests.Modules/Email/EmailChannelTests.cs +++ b/src/Orchard.Tests.Modules/Email/EmailChannelTests.cs @@ -1,48 +1,48 @@ -using System.Collections.Generic; -using Autofac; -using Moq; -using NUnit.Framework; -using Orchard.ContentManagement.Records; -using Orchard.DisplayManagement; -using Orchard.Email.Services; -using Orchard.Messaging.Events; -using Orchard.Messaging.Services; -using Orchard.Tests.Messaging; -using Orchard.Tests.Modules.Stubs; -using Orchard.Tests.Utility; - -namespace Orchard.Tests.Modules.Email { - [TestFixture] - public class EmailChannelTests { - private IMessageService _messageService; - private SmtpChannelStub _smtpChannel; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - _smtpChannel = new SmtpChannelStub(); - - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new MessageChannelSelectorStub(_smtpChannel)).As(); - - var container = builder.Build(); - _messageService = container.Resolve(); - } - - [Test] - public void CanSendEmailUsingAddresses() { - _messageService.Send("Email", new Dictionary() { {"", null} }); - Assert.That(_smtpChannel.Processed, Is.Not.Null); - } - - } - - public class SmtpChannelStub : IMessageChannel { - public IDictionary Processed; - public void Process(IDictionary parameters) { - Processed = parameters; - } - } +using System.Collections.Generic; +using Autofac; +using Moq; +using NUnit.Framework; +using Orchard.ContentManagement.Records; +using Orchard.DisplayManagement; +using Orchard.Email.Services; +using Orchard.Messaging.Events; +using Orchard.Messaging.Services; +using Orchard.Tests.Messaging; +using Orchard.Tests.Modules.Stubs; +using Orchard.Tests.Utility; + +namespace Orchard.Tests.Modules.Email { + [TestFixture] + public class EmailChannelTests { + private IMessageService _messageService; + private SmtpChannelStub _smtpChannel; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + _smtpChannel = new SmtpChannelStub(); + + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new MessageChannelSelectorStub(_smtpChannel)).As(); + + var container = builder.Build(); + _messageService = container.Resolve(); + } + + [Test] + public void CanSendEmailUsingAddresses() { + _messageService.Send("Email", new Dictionary() { {"", null} }); + Assert.That(_smtpChannel.Processed, Is.Not.Null); + } + + } + + public class SmtpChannelStub : IMessageChannel { + public IDictionary Processed; + public void Process(IDictionary parameters) { + Processed = parameters; + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests.Modules/ImportExport/Services/ImportExportServiceTests.cs b/src/Orchard.Tests.Modules/ImportExport/Services/ImportExportServiceTests.cs index b775ac6357a..2ed6213aacb 100644 --- a/src/Orchard.Tests.Modules/ImportExport/Services/ImportExportServiceTests.cs +++ b/src/Orchard.Tests.Modules/ImportExport/Services/ImportExportServiceTests.cs @@ -1,116 +1,116 @@ -using System; -using System.Collections.Generic; -using System.Xml.Linq; -using Autofac; -using Moq; -using NHibernate; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.ContentManagement; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.MetaData.Models; -using Orchard.ContentManagement.MetaData.Services; -using Orchard.ContentManagement.Records; -using Orchard.Core.Settings.Metadata; -using Orchard.Data; -using Orchard.Environment.Descriptor; -using Orchard.Environment.Descriptor.Models; -using Orchard.Environment.Extensions; -using Orchard.Environment.Extensions.Loaders; -using Orchard.FileSystems.AppData; -using Orchard.FileSystems.WebSite; -using Orchard.ImportExport.Services; -using Orchard.Recipes.Events; -using Orchard.Recipes.Services; -using Orchard.Services; -using Orchard.Tests.ContentManagement; -using Orchard.Tests.Environment.Extensions; -using Orchard.Tests.Modules.Recipes.Services; -using Orchard.Tests.Stubs; -using Orchard.Tests.UI.Navigation; - -namespace Orchard.Tests.Modules.ImportExport.Services { - [TestFixture] - public class ImportExportManagerTests { - private IContainer _container; - private IImportExportService _importExportService; - private ISessionFactory _sessionFactory; - private ISession _session; - - [TestFixtureSetUp] - public void InitFixture() { - var databaseFileName = System.IO.Path.GetTempFileName(); - _sessionFactory = DataUtility.CreateSessionFactory( - databaseFileName, - typeof(ContentTypeRecord), - typeof(ContentItemRecord), - typeof(ContentItemVersionRecord)); - } - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As().InstancePerLifetimeScope(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - _session = _sessionFactory.OpenSession(); - builder.RegisterInstance(new TestTransactionManager(_session)).As(); - - _container = builder.Build(); - _importExportService = _container.Resolve(); - } - - [Test] - public void ImportSucceedsWhenRecipeContainsImportSteps() { - Assert.DoesNotThrow(() => _importExportService.Import( - @" - - MyModuleInstaller - - - ")); - } - - [Test] - public void ImportDoesntFailsWhenRecipeContainsNonImportSteps() { - Assert.DoesNotThrow(() => _importExportService.Import( - @" - - MyModuleInstaller - - - ")); - } - } - - public class StubShellDescriptorManager : IShellDescriptorManager { - public ShellDescriptor GetShellDescriptor() { - return new ShellDescriptor(); - } - - public void UpdateShellDescriptor(int priorSerialNumber, IEnumerable enabledFeatures, IEnumerable parameters) { - } - } +using System; +using System.Collections.Generic; +using System.Xml.Linq; +using Autofac; +using Moq; +using NHibernate; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.ContentManagement; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.ContentManagement.MetaData.Services; +using Orchard.ContentManagement.Records; +using Orchard.Core.Settings.Metadata; +using Orchard.Data; +using Orchard.Environment.Descriptor; +using Orchard.Environment.Descriptor.Models; +using Orchard.Environment.Extensions; +using Orchard.Environment.Extensions.Loaders; +using Orchard.FileSystems.AppData; +using Orchard.FileSystems.WebSite; +using Orchard.ImportExport.Services; +using Orchard.Recipes.Events; +using Orchard.Recipes.Services; +using Orchard.Services; +using Orchard.Tests.ContentManagement; +using Orchard.Tests.Environment.Extensions; +using Orchard.Tests.Modules.Recipes.Services; +using Orchard.Tests.Stubs; +using Orchard.Tests.UI.Navigation; + +namespace Orchard.Tests.Modules.ImportExport.Services { + [TestFixture] + public class ImportExportManagerTests { + private IContainer _container; + private IImportExportService _importExportService; + private ISessionFactory _sessionFactory; + private ISession _session; + + [TestFixtureSetUp] + public void InitFixture() { + var databaseFileName = System.IO.Path.GetTempFileName(); + _sessionFactory = DataUtility.CreateSessionFactory( + databaseFileName, + typeof(ContentTypeRecord), + typeof(ContentItemRecord), + typeof(ContentItemVersionRecord)); + } + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As().InstancePerLifetimeScope(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + _session = _sessionFactory.OpenSession(); + builder.RegisterInstance(new TestTransactionManager(_session)).As(); + + _container = builder.Build(); + _importExportService = _container.Resolve(); + } + + [Test] + public void ImportSucceedsWhenRecipeContainsImportSteps() { + Assert.DoesNotThrow(() => _importExportService.Import( + @" + + MyModuleInstaller + + + ")); + } + + [Test] + public void ImportDoesntFailsWhenRecipeContainsNonImportSteps() { + Assert.DoesNotThrow(() => _importExportService.Import( + @" + + MyModuleInstaller + + + ")); + } + } + + public class StubShellDescriptorManager : IShellDescriptorManager { + public ShellDescriptor GetShellDescriptor() { + return new ShellDescriptor(); + } + + public void UpdateShellDescriptor(int priorSerialNumber, IEnumerable enabledFeatures, IEnumerable parameters) { + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests.Modules/Indexing/IndexingTaskExecutorTests.cs b/src/Orchard.Tests.Modules/Indexing/IndexingTaskExecutorTests.cs index 413918433b4..1e84ecfbf26 100644 --- a/src/Orchard.Tests.Modules/Indexing/IndexingTaskExecutorTests.cs +++ b/src/Orchard.Tests.Modules/Indexing/IndexingTaskExecutorTests.cs @@ -1,308 +1,308 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Autofac; -using Lucene.Services; -using Moq; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Drivers; -using Orchard.ContentManagement.Handlers; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.MetaData.Builders; -using Orchard.ContentManagement.Records; -using Orchard.Core.Common.Handlers; -using Orchard.Core.Common.Models; -using Orchard.Data; -using Orchard.Environment; -using Orchard.Environment.Configuration; -using Orchard.Environment.Extensions; -using Orchard.FileSystems.AppData; -using Orchard.FileSystems.LockFile; -using Orchard.Indexing; -using Orchard.Indexing.Handlers; -using Orchard.Indexing.Models; -using Orchard.Indexing.Services; -using Orchard.Logging; -using Orchard.Security; -using Orchard.Tasks.Indexing; -using Orchard.Tests.FileSystems.AppData; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.Modules.Indexing { - public class IndexingTaskExecutorTests : DatabaseEnabledTestsBase { - private IIndexProvider _provider; - private IAppDataFolder _appDataFolder; - private ShellSettings _shellSettings; - private IIndexingTaskExecutor _indexTaskExecutor; - private IContentManager _contentManager; - private Mock _contentDefinitionManager; - private StubLogger _logger; - private ILockFileManager _lockFileManager; - - private const string IndexName = "Search"; - private readonly string _basePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); - - [TestFixtureTearDown] - public void Clean() { - if (Directory.Exists(_basePath)) { - Directory.Delete(_basePath, true); - } - } - - public override void Register(ContainerBuilder builder) { - if (Directory.Exists(_basePath)) { - Directory.Delete(_basePath, true); - } - - Directory.CreateDirectory(_basePath); - _contentDefinitionManager = new Mock(); - _appDataFolder = AppDataFolderTests.CreateAppDataFolder(_basePath); - - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(_appDataFolder).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(_contentDefinitionManager.Object); - builder.RegisterInstance(new Mock().Object); - - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - - builder.RegisterType().As(); - builder.RegisterType().As(); - - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - builder.RegisterType().As(); - - // setting up a ShellSettings instance - _shellSettings = new ShellSettings { Name = "My Site" }; - builder.RegisterInstance(_shellSettings).As(); - } - - protected override IEnumerable DatabaseTypes { - get { - return new[] { typeof(IndexingTaskRecord), - typeof(ContentTypeRecord), - typeof(ContentItemRecord), - typeof(ContentItemVersionRecord), - typeof(BodyPartRecord), - typeof(CommonPartRecord), - typeof(CommonPartVersionRecord), - }; - } - } - - public override void Init() { - base.Init(); - _lockFileManager = _container.Resolve(); - _provider = _container.Resolve(); - _indexTaskExecutor = _container.Resolve(); - _contentManager = _container.Resolve(); - ((IndexingTaskExecutor)_indexTaskExecutor).Logger = _logger = new StubLogger(); - - var thingType = new ContentTypeDefinitionBuilder() - .Named(ThingDriver.ContentTypeName) - .WithSetting("TypeIndexing.Indexes", "Search") - .Build(); - - _contentDefinitionManager - .Setup(x => x.GetTypeDefinition(ThingDriver.ContentTypeName)) - .Returns(thingType); - } - - [Test] - public void IndexShouldBeEmptyWhenThereIsNoContent() { - while(_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} - Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(0)); - } - - [Test] - public void ShouldIgnoreNonIndexableContentWhenRebuildingTheIndex() { - var alphaType = new ContentTypeDefinitionBuilder() - .Named("alpha") - .Build(); - - _contentDefinitionManager - .Setup(x => x.GetTypeDefinition("alpha")) - .Returns(alphaType); - - _contentManager.Create("alpha"); - - while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} - Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(0)); - } - - [Test] - public void ShouldNotIndexContentIfIndexDocumentIsEmpty() { - var alphaType = new ContentTypeDefinitionBuilder() - .Named("alpha") - .WithSetting("TypeIndexing.Indexes", "Search") // the content types should be indexed, but there is no content at all - .Build(); - - _contentDefinitionManager - .Setup(x => x.GetTypeDefinition("alpha")) - .Returns(alphaType); - - _contentManager.Create("alpha"); - - while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} - Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(0)); - } - - [Test] - public void ShouldIndexContentIfSettingsIsSetAndHandlerIsProvided() { - var content = _contentManager.Create(ThingDriver.ContentTypeName); - content.Text = "Lorem ipsum"; - - while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} - Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(1)); - } - - [Test] - public void ShouldUpdateTheIndexWhenContentIsPublished() { - _contentManager.Create(ThingDriver.ContentTypeName).Text = "Lorem ipsum"; - while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} - Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(1)); - - // there should be nothing done - while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} - Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(1)); - - _contentManager.Create(ThingDriver.ContentTypeName).Text = "Lorem ipsum"; - while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} - Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(2)); - } - - [Test] - public void IndexingTaskExecutorShouldNotBeReEntrant() { - ILockFile lockFile = null; - _lockFileManager.TryAcquireLock("Sites/My Site/Search.settings.xml.lock", ref lockFile); - using (lockFile) { - while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} - Assert.That(_logger.LogEntries.Count, Is.EqualTo(1)); - Assert.That(_logger.LogEntries, Has.Some.Matches(entry => entry.LogFormat == "Index was requested but is already running")); - } - - _logger.LogEntries.Clear(); - while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} - Assert.That(_logger.LogEntries, Has.None.Matches(entry => entry.LogFormat == "Index was requested but is already running")); - } - - [Test] - public void ShouldUpdateTheIndexWhenContentIsUnPublished() { - _contentManager.Create(ThingDriver.ContentTypeName).Text = "Lorem ipsum"; - - while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} - Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(1)); - - var content = _contentManager.Create(ThingDriver.ContentTypeName); - content.Text = "Lorem ipsum"; - - while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} - Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(2)); - - _contentManager.Unpublish(content.ContentItem); - - while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} - Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(1)); - } - - [Test] - public void ShouldUpdateTheIndexWhenContentIsDeleted() { - _contentManager.Create(ThingDriver.ContentTypeName).Text = "Lorem ipsum"; - - while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) { } - Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(1)); - - var content = _contentManager.Create(ThingDriver.ContentTypeName); - content.Text = "Lorem ipsum"; - - while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) { } - Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(2)); - - _contentManager.Remove(content.ContentItem); - - while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) { } - Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(1)); - } - - [Test] - public void ShouldIndexAllContentOverTheLoopSize() { - for (int i = 0; i < 999; i++) { - var content = _contentManager.Create(ThingDriver.ContentTypeName); - content.Text = "Lorem ipsum " + i; - } - while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} - Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(999)); - } - - #region Stubs - - public class ThingHandler : ContentHandler { - public ThingHandler() { - Filters.Add(new ActivatingFilter(ThingDriver.ContentTypeName)); - Filters.Add(new ActivatingFilter>(ThingDriver.ContentTypeName)); - Filters.Add(new ActivatingFilter(ThingDriver.ContentTypeName)); - Filters.Add(new ActivatingFilter(ThingDriver.ContentTypeName)); - } - } - - public class Thing : ContentPart { - public string Text { - get { return this.As().Text; } - set { this.As().Text = value; } - } - } - - public class ThingDriver : ContentPartDriver { - public static readonly string ContentTypeName = "thing"; - } - - public class LogEntry { - public Exception LogException { get; set; } - public string LogFormat { get; set; } - public object[] LogArgs { get; set; } - public LogLevel LogLevel { get; set; } - } - - public class StubLogger : ILogger { - public List LogEntries { get; set; } - - public StubLogger() { - LogEntries = new List(); - } - - public void Clear() { - LogEntries.Clear(); - } - - public bool IsEnabled(LogLevel level) { - return true; - } - - public void Log(LogLevel level, Exception exception, string format, params object[] args) { - LogEntries.Add(new LogEntry { - LogArgs = args, - LogException = exception, - LogFormat = format, - LogLevel = level - }); - } - } - - #endregion - } -} +using System; +using System.Collections.Generic; +using System.IO; +using Autofac; +using Lucene.Services; +using Moq; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Drivers; +using Orchard.ContentManagement.Handlers; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Builders; +using Orchard.ContentManagement.Records; +using Orchard.Core.Common.Handlers; +using Orchard.Core.Common.Models; +using Orchard.Data; +using Orchard.Environment; +using Orchard.Environment.Configuration; +using Orchard.Environment.Extensions; +using Orchard.FileSystems.AppData; +using Orchard.FileSystems.LockFile; +using Orchard.Indexing; +using Orchard.Indexing.Handlers; +using Orchard.Indexing.Models; +using Orchard.Indexing.Services; +using Orchard.Logging; +using Orchard.Security; +using Orchard.Tasks.Indexing; +using Orchard.Tests.FileSystems.AppData; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.Modules.Indexing { + public class IndexingTaskExecutorTests : DatabaseEnabledTestsBase { + private IIndexProvider _provider; + private IAppDataFolder _appDataFolder; + private ShellSettings _shellSettings; + private IIndexingTaskExecutor _indexTaskExecutor; + private IContentManager _contentManager; + private Mock _contentDefinitionManager; + private StubLogger _logger; + private ILockFileManager _lockFileManager; + + private const string IndexName = "Search"; + private readonly string _basePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); + + [TestFixtureTearDown] + public void Clean() { + if (Directory.Exists(_basePath)) { + Directory.Delete(_basePath, true); + } + } + + public override void Register(ContainerBuilder builder) { + if (Directory.Exists(_basePath)) { + Directory.Delete(_basePath, true); + } + + Directory.CreateDirectory(_basePath); + _contentDefinitionManager = new Mock(); + _appDataFolder = AppDataFolderTests.CreateAppDataFolder(_basePath); + + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(_appDataFolder).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(_contentDefinitionManager.Object); + builder.RegisterInstance(new Mock().Object); + + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + + builder.RegisterType().As(); + builder.RegisterType().As(); + + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + builder.RegisterType().As(); + + // setting up a ShellSettings instance + _shellSettings = new ShellSettings { Name = "My Site" }; + builder.RegisterInstance(_shellSettings).As(); + } + + protected override IEnumerable DatabaseTypes { + get { + return new[] { typeof(IndexingTaskRecord), + typeof(ContentTypeRecord), + typeof(ContentItemRecord), + typeof(ContentItemVersionRecord), + typeof(BodyPartRecord), + typeof(CommonPartRecord), + typeof(CommonPartVersionRecord), + }; + } + } + + public override void Init() { + base.Init(); + _lockFileManager = _container.Resolve(); + _provider = _container.Resolve(); + _indexTaskExecutor = _container.Resolve(); + _contentManager = _container.Resolve(); + ((IndexingTaskExecutor)_indexTaskExecutor).Logger = _logger = new StubLogger(); + + var thingType = new ContentTypeDefinitionBuilder() + .Named(ThingDriver.ContentTypeName) + .WithSetting("TypeIndexing.Indexes", "Search") + .Build(); + + _contentDefinitionManager + .Setup(x => x.GetTypeDefinition(ThingDriver.ContentTypeName)) + .Returns(thingType); + } + + [Test] + public void IndexShouldBeEmptyWhenThereIsNoContent() { + while(_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} + Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(0)); + } + + [Test] + public void ShouldIgnoreNonIndexableContentWhenRebuildingTheIndex() { + var alphaType = new ContentTypeDefinitionBuilder() + .Named("alpha") + .Build(); + + _contentDefinitionManager + .Setup(x => x.GetTypeDefinition("alpha")) + .Returns(alphaType); + + _contentManager.Create("alpha"); + + while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} + Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(0)); + } + + [Test] + public void ShouldNotIndexContentIfIndexDocumentIsEmpty() { + var alphaType = new ContentTypeDefinitionBuilder() + .Named("alpha") + .WithSetting("TypeIndexing.Indexes", "Search") // the content types should be indexed, but there is no content at all + .Build(); + + _contentDefinitionManager + .Setup(x => x.GetTypeDefinition("alpha")) + .Returns(alphaType); + + _contentManager.Create("alpha"); + + while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} + Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(0)); + } + + [Test] + public void ShouldIndexContentIfSettingsIsSetAndHandlerIsProvided() { + var content = _contentManager.Create(ThingDriver.ContentTypeName); + content.Text = "Lorem ipsum"; + + while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} + Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(1)); + } + + [Test] + public void ShouldUpdateTheIndexWhenContentIsPublished() { + _contentManager.Create(ThingDriver.ContentTypeName).Text = "Lorem ipsum"; + while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} + Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(1)); + + // there should be nothing done + while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} + Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(1)); + + _contentManager.Create(ThingDriver.ContentTypeName).Text = "Lorem ipsum"; + while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} + Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(2)); + } + + [Test] + public void IndexingTaskExecutorShouldNotBeReEntrant() { + ILockFile lockFile = null; + _lockFileManager.TryAcquireLock("Sites/My Site/Search.settings.xml.lock", ref lockFile); + using (lockFile) { + while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} + Assert.That(_logger.LogEntries.Count, Is.EqualTo(1)); + Assert.That(_logger.LogEntries, Has.Some.Matches(entry => entry.LogFormat == "Index was requested but is already running")); + } + + _logger.LogEntries.Clear(); + while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} + Assert.That(_logger.LogEntries, Has.None.Matches(entry => entry.LogFormat == "Index was requested but is already running")); + } + + [Test] + public void ShouldUpdateTheIndexWhenContentIsUnPublished() { + _contentManager.Create(ThingDriver.ContentTypeName).Text = "Lorem ipsum"; + + while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} + Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(1)); + + var content = _contentManager.Create(ThingDriver.ContentTypeName); + content.Text = "Lorem ipsum"; + + while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} + Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(2)); + + _contentManager.Unpublish(content.ContentItem); + + while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} + Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(1)); + } + + [Test] + public void ShouldUpdateTheIndexWhenContentIsDeleted() { + _contentManager.Create(ThingDriver.ContentTypeName).Text = "Lorem ipsum"; + + while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) { } + Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(1)); + + var content = _contentManager.Create(ThingDriver.ContentTypeName); + content.Text = "Lorem ipsum"; + + while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) { } + Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(2)); + + _contentManager.Remove(content.ContentItem); + + while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) { } + Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(1)); + } + + [Test] + public void ShouldIndexAllContentOverTheLoopSize() { + for (int i = 0; i < 999; i++) { + var content = _contentManager.Create(ThingDriver.ContentTypeName); + content.Text = "Lorem ipsum " + i; + } + while (_indexTaskExecutor.UpdateIndexBatch(IndexName)) {} + Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(999)); + } + + #region Stubs + + public class ThingHandler : ContentHandler { + public ThingHandler() { + Filters.Add(new ActivatingFilter(ThingDriver.ContentTypeName)); + Filters.Add(new ActivatingFilter>(ThingDriver.ContentTypeName)); + Filters.Add(new ActivatingFilter(ThingDriver.ContentTypeName)); + Filters.Add(new ActivatingFilter(ThingDriver.ContentTypeName)); + } + } + + public class Thing : ContentPart { + public string Text { + get { return this.As().Text; } + set { this.As().Text = value; } + } + } + + public class ThingDriver : ContentPartDriver { + public static readonly string ContentTypeName = "thing"; + } + + public class LogEntry { + public Exception LogException { get; set; } + public string LogFormat { get; set; } + public object[] LogArgs { get; set; } + public LogLevel LogLevel { get; set; } + } + + public class StubLogger : ILogger { + public List LogEntries { get; set; } + + public StubLogger() { + LogEntries = new List(); + } + + public void Clear() { + LogEntries.Clear(); + } + + public bool IsEnabled(LogLevel level) { + return true; + } + + public void Log(LogLevel level, Exception exception, string format, params object[] args) { + LogEntries.Add(new LogEntry { + LogArgs = args, + LogException = exception, + LogFormat = format, + LogLevel = level + }); + } + } + + #endregion + } +} diff --git a/src/Orchard.Tests.Modules/Indexing/LuceneIndexProviderTests.cs b/src/Orchard.Tests.Modules/Indexing/LuceneIndexProviderTests.cs index d7008dd6a43..7ba30aa665a 100644 --- a/src/Orchard.Tests.Modules/Indexing/LuceneIndexProviderTests.cs +++ b/src/Orchard.Tests.Modules/Indexing/LuceneIndexProviderTests.cs @@ -1,326 +1,326 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Autofac; -using Lucene.Services; -using NUnit.Framework; -using Orchard.Environment.Configuration; -using Orchard.FileSystems.AppData; -using Orchard.Indexing; -using Orchard.Tests.FileSystems.AppData; - -namespace Orchard.Tests.Modules.Indexing { - public class LuceneIndexProviderTests { - private IContainer _container; - private IIndexProvider _provider; - private IAppDataFolder _appDataFolder; - private ShellSettings _shellSettings; - private readonly string _basePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); - - [TestFixtureTearDown] - public void Clean() { - if (Directory.Exists(_basePath)) { - Directory.Delete(_basePath, true); - } - } - - [SetUp] - public void Setup() { - if (Directory.Exists(_basePath)) { - Directory.Delete(_basePath, true); - } - Directory.CreateDirectory(_basePath); - - _appDataFolder = AppDataFolderTests.CreateAppDataFolder(_basePath); - - var builder = new ContainerBuilder(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(_appDataFolder).As(); - - // setting up a ShellSettings instance - _shellSettings = new ShellSettings { Name = "My Site" }; - builder.RegisterInstance(_shellSettings).As(); - - _container = builder.Build(); - _provider = _container.Resolve(); - } - - private IEnumerable Indexes() { - return _provider.List(); - } - - [Test] - public void IndexProviderShouldCreateNewIndex() { - Assert.That(Indexes().Count(), Is.EqualTo(0)); - - _provider.CreateIndex("default"); - Assert.That(Indexes().Count(), Is.EqualTo(1)); - } - - [Test] - public void IndexProviderShouldCreateMultipleIndexesAndListThem() { - Assert.That(Indexes().Count(), Is.EqualTo(0)); - - _provider.CreateIndex("default"); - _provider.CreateIndex("search"); - _provider.CreateIndex("admin"); - - Assert.That(Indexes().Count(), Is.EqualTo(3)); - Assert.That(Indexes().Contains("default")); - Assert.That(Indexes().Contains("search")); - Assert.That(Indexes().Contains("admin")); - } - - [Test] - public void IndexProviderShouldOverwriteAlreadyExistingIndex() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("body", null)); - Assert.That(_provider.IsEmpty("default"), Is.False); - - _provider.CreateIndex("default"); - Assert.That(_provider.IsEmpty("default"), Is.True); - } - - [Test] - public void IndexProviderShouldDeleteExistingIndex() { - Assert.That(Indexes().Count(), Is.EqualTo(0)); - - _provider.CreateIndex("default"); - Assert.That(Indexes().Count(), Is.EqualTo(1)); - - _provider.DeleteIndex("default"); - Assert.That(Indexes().Count(), Is.EqualTo(0)); - } - - [Test] - public void IndexProviderShouldListExistingIndexes() { - Assert.That(Indexes().Count(), Is.EqualTo(0)); - - _provider.CreateIndex("default"); - Assert.That(Indexes().Count(), Is.EqualTo(1)); - Assert.That(Indexes().ElementAt(0), Is.EqualTo("default")); - - _provider.CreateIndex("foo"); - Assert.That(Indexes().Count(), Is.EqualTo(2)); - } - - [Test] - public void ANewIndexShouldBeEmpty() { - _provider.CreateIndex("default"); - var searchBuilder = _provider.CreateSearchBuilder("default"); - var hits = searchBuilder.Search(); - - Assert.That(hits.Count(), Is.EqualTo(0)); - } - - [Test] - public void DocumentsShouldBeSearchableById() { - _provider.CreateIndex("default"); - - _provider.Store("default", _provider.New(42)); - - var searchBuilder = _provider.CreateSearchBuilder("default"); - - var hit = searchBuilder.Get(42); - Assert.IsNotNull(hit); - Assert.That(hit.ContentItemId, Is.EqualTo(42)); - - hit = searchBuilder.Get(1); - Assert.IsNull(hit); - } - - [Test] - public void PropertiesShouldNotBeLost() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(42) - .Add("prop1", "value1").Store() - .Add("prop2", 123).Store() - .Add("prop3", 123.456).Store() - .Add("prop4", new DateTime(2001,1,1,1,1,1,1)).Store() - .Add("prop5", true).Store() - ); - - var hit = _provider.CreateSearchBuilder("default").Get(42); - - Assert.IsNotNull(hit); - Assert.That(hit.ContentItemId, Is.EqualTo(42)); - Assert.That(hit.GetString("prop1"), Is.EqualTo("value1")); - Assert.That(hit.GetInt("prop2"), Is.EqualTo(123)); - Assert.That(hit.GetDouble("prop3"), Is.EqualTo(123.456)); - Assert.That(hit.GetDateTime("prop4"), Is.EqualTo(new DateTime(2001, 1, 1, 1, 1, 1, 1))); - Assert.That(hit.GetBoolean("prop5"), Is.EqualTo(true)); - } - - [Test] - public void ShouldHandleMultipleIndexes() { - _provider.CreateIndex("default1"); - _provider.Store("default1", _provider.New(1)); - - _provider.CreateIndex("default2"); - _provider.Store("default2", _provider.New(2)); - - _provider.CreateIndex("default3"); - _provider.Store("default3", _provider.New(3)); - - Assert.IsNotNull(_provider.CreateSearchBuilder("default1").Get(1)); - Assert.IsNotNull(_provider.CreateSearchBuilder("default2").Get(2)); - Assert.IsNotNull(_provider.CreateSearchBuilder("default3").Get(3)); - - Assert.IsNull(_provider.CreateSearchBuilder("default1").Get(2)); - Assert.IsNull(_provider.CreateSearchBuilder("default2").Get(3)); - Assert.IsNull(_provider.CreateSearchBuilder("default3").Get(1)); - - } - - [Test] - public void IdentifierShouldNotCollide() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("field", "value1")); - _provider.Store("default", _provider.New(11).Add("field", "value11")); - _provider.Store("default", _provider.New(111).Add("field", "value111")); - - var searchBuilder = _provider.CreateSearchBuilder("default"); - - Assert.That(searchBuilder.Get(1).ContentItemId, Is.EqualTo(1)); - Assert.That(searchBuilder.Get(11).ContentItemId, Is.EqualTo(11)); - Assert.That(searchBuilder.Get(111).ContentItemId, Is.EqualTo(111)); - } - - [Test] - public void TagsShouldBeRemoved() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("body", "
      some content").Analyze()); - _provider.Store("default", _provider.New(2).Add("body", "
      some content").RemoveTags().Analyze()); - - var searchBuilder = _provider.CreateSearchBuilder("default"); - - Assert.That(searchBuilder.WithField("body", "hr").Search().Count(), Is.EqualTo(1)); - Assert.That(searchBuilder.WithField("body", "hr").Search().First().ContentItemId, Is.EqualTo(1)); - } - - [Test] public void ShouldAllowNullOrEmptyStrings() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("body", null)); - _provider.Store("default", _provider.New(2).Add("body", "")); - _provider.Store("default", _provider.New(3).Add("body", "
      ").RemoveTags()); - - var searchBuilder = _provider.CreateSearchBuilder("default"); - - Assert.That(searchBuilder.Get(1).ContentItemId, Is.EqualTo(1)); - Assert.That(searchBuilder.Get(2).ContentItemId, Is.EqualTo(2)); - Assert.That(searchBuilder.Get(3).ContentItemId, Is.EqualTo(3)); - } - - [Test] - public void IsEmptyShouldBeTrueForNoneExistingIndexes() { - _provider.IsEmpty("dummy"); - Assert.That(_provider.IsEmpty("default"), Is.True); - } - - [Test] - public void IsEmptyShouldBeTrueForJustNewIndexes() { - _provider.CreateIndex("default"); - Assert.That(_provider.IsEmpty("default"), Is.True); - } - - [Test] - public void IsEmptyShouldBeFalseWhenThereIsADocument() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("body", null)); - Assert.That(_provider.IsEmpty("default"), Is.False); - } - - [Test] - public void IsDirtyShouldBeFalseForNewDocuments() { - IDocumentIndex doc = _provider.New(1); - Assert.That(doc.IsDirty, Is.False); - } - - - [Test] - public void IsDirtyShouldBeTrueWhenIndexIsModified() { - IDocumentIndex doc = _provider.New(1); - doc.Add("foo", "value"); - Assert.That(doc.IsDirty, Is.True); - - doc = _provider.New(1); - doc.Add("foo", false); - Assert.That(doc.IsDirty, Is.True); - - doc = _provider.New(1); - doc.Add("foo", (float)1.0); - Assert.That(doc.IsDirty, Is.True); - - doc = _provider.New(1); - doc.Add("foo", 1); - Assert.That(doc.IsDirty, Is.True); - - doc = _provider.New(1); - doc.Add("foo", DateTime.Now); - Assert.That(doc.IsDirty, Is.True); - - } - - [Test] - public void DocumentsShouldBeDeleted() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("field", "value1")); - _provider.Store("default", _provider.New(11).Add("field", "value11")); - _provider.Store("default", _provider.New(111).Add("field", "value111")); - - var searchBuilder = _provider.CreateSearchBuilder("default"); - - Assert.That(searchBuilder.Get(1).ContentItemId, Is.EqualTo(1)); - Assert.That(searchBuilder.Get(11).ContentItemId, Is.EqualTo(11)); - Assert.That(searchBuilder.Get(111).ContentItemId, Is.EqualTo(111)); - - _provider.Delete("default", 1); - - Assert.That(searchBuilder.Get(1), Is.Null); - Assert.That(searchBuilder.Get(11).ContentItemId, Is.EqualTo(11)); - Assert.That(searchBuilder.Get(111).ContentItemId, Is.EqualTo(111)); - - _provider.Delete("default", new [] {1, 11, 111 }); - - Assert.That(searchBuilder.Get(1), Is.Null); - Assert.That(searchBuilder.Get(11), Is.Null); - Assert.That(searchBuilder.Get(111), Is.Null); - - } - - [Test] - public void SameContentItemShouldNotBeIndexedTwice() { - _provider.CreateIndex("default"); - - var searchBuilder = _provider.CreateSearchBuilder("default"); - - _provider.Store("default", _provider.New(1).Add("field", "value1")); - Assert.That(searchBuilder.WithField("id", "1").Count(), Is.EqualTo(1)); - - _provider.Store("default", _provider.New(1).Add("field", "value2")); - Assert.That(searchBuilder.WithField("id", "1").Count(), Is.EqualTo(1)); - } - - [Test] - public void IndexProviderShouldDeleteMoreThanMaxTermsCount() { - _provider.CreateIndex("default"); - - var documents = Enumerable.Range(1, 1025).Select(i => _provider.New(i).Add("field", "value1")); - _provider.Store("default", documents); - - var searchBuilder = _provider.CreateSearchBuilder("default"); - - Assert.That(searchBuilder.Count(), Is.EqualTo(1025)); - Assert.That(searchBuilder.Get(1).ContentItemId, Is.EqualTo(1)); - Assert.That(searchBuilder.Get(1025).ContentItemId, Is.EqualTo(1025)); - - _provider.Delete("default", Enumerable.Range(1, 1025)); - - - Assert.That(searchBuilder.Count(), Is.EqualTo(0)); - } - } -} +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Autofac; +using Lucene.Services; +using NUnit.Framework; +using Orchard.Environment.Configuration; +using Orchard.FileSystems.AppData; +using Orchard.Indexing; +using Orchard.Tests.FileSystems.AppData; + +namespace Orchard.Tests.Modules.Indexing { + public class LuceneIndexProviderTests { + private IContainer _container; + private IIndexProvider _provider; + private IAppDataFolder _appDataFolder; + private ShellSettings _shellSettings; + private readonly string _basePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); + + [TestFixtureTearDown] + public void Clean() { + if (Directory.Exists(_basePath)) { + Directory.Delete(_basePath, true); + } + } + + [SetUp] + public void Setup() { + if (Directory.Exists(_basePath)) { + Directory.Delete(_basePath, true); + } + Directory.CreateDirectory(_basePath); + + _appDataFolder = AppDataFolderTests.CreateAppDataFolder(_basePath); + + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(_appDataFolder).As(); + + // setting up a ShellSettings instance + _shellSettings = new ShellSettings { Name = "My Site" }; + builder.RegisterInstance(_shellSettings).As(); + + _container = builder.Build(); + _provider = _container.Resolve(); + } + + private IEnumerable Indexes() { + return _provider.List(); + } + + [Test] + public void IndexProviderShouldCreateNewIndex() { + Assert.That(Indexes().Count(), Is.EqualTo(0)); + + _provider.CreateIndex("default"); + Assert.That(Indexes().Count(), Is.EqualTo(1)); + } + + [Test] + public void IndexProviderShouldCreateMultipleIndexesAndListThem() { + Assert.That(Indexes().Count(), Is.EqualTo(0)); + + _provider.CreateIndex("default"); + _provider.CreateIndex("search"); + _provider.CreateIndex("admin"); + + Assert.That(Indexes().Count(), Is.EqualTo(3)); + Assert.That(Indexes().Contains("default")); + Assert.That(Indexes().Contains("search")); + Assert.That(Indexes().Contains("admin")); + } + + [Test] + public void IndexProviderShouldOverwriteAlreadyExistingIndex() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("body", null)); + Assert.That(_provider.IsEmpty("default"), Is.False); + + _provider.CreateIndex("default"); + Assert.That(_provider.IsEmpty("default"), Is.True); + } + + [Test] + public void IndexProviderShouldDeleteExistingIndex() { + Assert.That(Indexes().Count(), Is.EqualTo(0)); + + _provider.CreateIndex("default"); + Assert.That(Indexes().Count(), Is.EqualTo(1)); + + _provider.DeleteIndex("default"); + Assert.That(Indexes().Count(), Is.EqualTo(0)); + } + + [Test] + public void IndexProviderShouldListExistingIndexes() { + Assert.That(Indexes().Count(), Is.EqualTo(0)); + + _provider.CreateIndex("default"); + Assert.That(Indexes().Count(), Is.EqualTo(1)); + Assert.That(Indexes().ElementAt(0), Is.EqualTo("default")); + + _provider.CreateIndex("foo"); + Assert.That(Indexes().Count(), Is.EqualTo(2)); + } + + [Test] + public void ANewIndexShouldBeEmpty() { + _provider.CreateIndex("default"); + var searchBuilder = _provider.CreateSearchBuilder("default"); + var hits = searchBuilder.Search(); + + Assert.That(hits.Count(), Is.EqualTo(0)); + } + + [Test] + public void DocumentsShouldBeSearchableById() { + _provider.CreateIndex("default"); + + _provider.Store("default", _provider.New(42)); + + var searchBuilder = _provider.CreateSearchBuilder("default"); + + var hit = searchBuilder.Get(42); + Assert.IsNotNull(hit); + Assert.That(hit.ContentItemId, Is.EqualTo(42)); + + hit = searchBuilder.Get(1); + Assert.IsNull(hit); + } + + [Test] + public void PropertiesShouldNotBeLost() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(42) + .Add("prop1", "value1").Store() + .Add("prop2", 123).Store() + .Add("prop3", 123.456).Store() + .Add("prop4", new DateTime(2001,1,1,1,1,1,1)).Store() + .Add("prop5", true).Store() + ); + + var hit = _provider.CreateSearchBuilder("default").Get(42); + + Assert.IsNotNull(hit); + Assert.That(hit.ContentItemId, Is.EqualTo(42)); + Assert.That(hit.GetString("prop1"), Is.EqualTo("value1")); + Assert.That(hit.GetInt("prop2"), Is.EqualTo(123)); + Assert.That(hit.GetDouble("prop3"), Is.EqualTo(123.456)); + Assert.That(hit.GetDateTime("prop4"), Is.EqualTo(new DateTime(2001, 1, 1, 1, 1, 1, 1))); + Assert.That(hit.GetBoolean("prop5"), Is.EqualTo(true)); + } + + [Test] + public void ShouldHandleMultipleIndexes() { + _provider.CreateIndex("default1"); + _provider.Store("default1", _provider.New(1)); + + _provider.CreateIndex("default2"); + _provider.Store("default2", _provider.New(2)); + + _provider.CreateIndex("default3"); + _provider.Store("default3", _provider.New(3)); + + Assert.IsNotNull(_provider.CreateSearchBuilder("default1").Get(1)); + Assert.IsNotNull(_provider.CreateSearchBuilder("default2").Get(2)); + Assert.IsNotNull(_provider.CreateSearchBuilder("default3").Get(3)); + + Assert.IsNull(_provider.CreateSearchBuilder("default1").Get(2)); + Assert.IsNull(_provider.CreateSearchBuilder("default2").Get(3)); + Assert.IsNull(_provider.CreateSearchBuilder("default3").Get(1)); + + } + + [Test] + public void IdentifierShouldNotCollide() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("field", "value1")); + _provider.Store("default", _provider.New(11).Add("field", "value11")); + _provider.Store("default", _provider.New(111).Add("field", "value111")); + + var searchBuilder = _provider.CreateSearchBuilder("default"); + + Assert.That(searchBuilder.Get(1).ContentItemId, Is.EqualTo(1)); + Assert.That(searchBuilder.Get(11).ContentItemId, Is.EqualTo(11)); + Assert.That(searchBuilder.Get(111).ContentItemId, Is.EqualTo(111)); + } + + [Test] + public void TagsShouldBeRemoved() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("body", "
      some content").Analyze()); + _provider.Store("default", _provider.New(2).Add("body", "
      some content").RemoveTags().Analyze()); + + var searchBuilder = _provider.CreateSearchBuilder("default"); + + Assert.That(searchBuilder.WithField("body", "hr").Search().Count(), Is.EqualTo(1)); + Assert.That(searchBuilder.WithField("body", "hr").Search().First().ContentItemId, Is.EqualTo(1)); + } + + [Test] public void ShouldAllowNullOrEmptyStrings() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("body", null)); + _provider.Store("default", _provider.New(2).Add("body", "")); + _provider.Store("default", _provider.New(3).Add("body", "
      ").RemoveTags()); + + var searchBuilder = _provider.CreateSearchBuilder("default"); + + Assert.That(searchBuilder.Get(1).ContentItemId, Is.EqualTo(1)); + Assert.That(searchBuilder.Get(2).ContentItemId, Is.EqualTo(2)); + Assert.That(searchBuilder.Get(3).ContentItemId, Is.EqualTo(3)); + } + + [Test] + public void IsEmptyShouldBeTrueForNoneExistingIndexes() { + _provider.IsEmpty("dummy"); + Assert.That(_provider.IsEmpty("default"), Is.True); + } + + [Test] + public void IsEmptyShouldBeTrueForJustNewIndexes() { + _provider.CreateIndex("default"); + Assert.That(_provider.IsEmpty("default"), Is.True); + } + + [Test] + public void IsEmptyShouldBeFalseWhenThereIsADocument() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("body", null)); + Assert.That(_provider.IsEmpty("default"), Is.False); + } + + [Test] + public void IsDirtyShouldBeFalseForNewDocuments() { + IDocumentIndex doc = _provider.New(1); + Assert.That(doc.IsDirty, Is.False); + } + + + [Test] + public void IsDirtyShouldBeTrueWhenIndexIsModified() { + IDocumentIndex doc = _provider.New(1); + doc.Add("foo", "value"); + Assert.That(doc.IsDirty, Is.True); + + doc = _provider.New(1); + doc.Add("foo", false); + Assert.That(doc.IsDirty, Is.True); + + doc = _provider.New(1); + doc.Add("foo", (float)1.0); + Assert.That(doc.IsDirty, Is.True); + + doc = _provider.New(1); + doc.Add("foo", 1); + Assert.That(doc.IsDirty, Is.True); + + doc = _provider.New(1); + doc.Add("foo", DateTime.Now); + Assert.That(doc.IsDirty, Is.True); + + } + + [Test] + public void DocumentsShouldBeDeleted() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("field", "value1")); + _provider.Store("default", _provider.New(11).Add("field", "value11")); + _provider.Store("default", _provider.New(111).Add("field", "value111")); + + var searchBuilder = _provider.CreateSearchBuilder("default"); + + Assert.That(searchBuilder.Get(1).ContentItemId, Is.EqualTo(1)); + Assert.That(searchBuilder.Get(11).ContentItemId, Is.EqualTo(11)); + Assert.That(searchBuilder.Get(111).ContentItemId, Is.EqualTo(111)); + + _provider.Delete("default", 1); + + Assert.That(searchBuilder.Get(1), Is.Null); + Assert.That(searchBuilder.Get(11).ContentItemId, Is.EqualTo(11)); + Assert.That(searchBuilder.Get(111).ContentItemId, Is.EqualTo(111)); + + _provider.Delete("default", new [] {1, 11, 111 }); + + Assert.That(searchBuilder.Get(1), Is.Null); + Assert.That(searchBuilder.Get(11), Is.Null); + Assert.That(searchBuilder.Get(111), Is.Null); + + } + + [Test] + public void SameContentItemShouldNotBeIndexedTwice() { + _provider.CreateIndex("default"); + + var searchBuilder = _provider.CreateSearchBuilder("default"); + + _provider.Store("default", _provider.New(1).Add("field", "value1")); + Assert.That(searchBuilder.WithField("id", "1").Count(), Is.EqualTo(1)); + + _provider.Store("default", _provider.New(1).Add("field", "value2")); + Assert.That(searchBuilder.WithField("id", "1").Count(), Is.EqualTo(1)); + } + + [Test] + public void IndexProviderShouldDeleteMoreThanMaxTermsCount() { + _provider.CreateIndex("default"); + + var documents = Enumerable.Range(1, 1025).Select(i => _provider.New(i).Add("field", "value1")); + _provider.Store("default", documents); + + var searchBuilder = _provider.CreateSearchBuilder("default"); + + Assert.That(searchBuilder.Count(), Is.EqualTo(1025)); + Assert.That(searchBuilder.Get(1).ContentItemId, Is.EqualTo(1)); + Assert.That(searchBuilder.Get(1025).ContentItemId, Is.EqualTo(1025)); + + _provider.Delete("default", Enumerable.Range(1, 1025)); + + + Assert.That(searchBuilder.Count(), Is.EqualTo(0)); + } + } +} diff --git a/src/Orchard.Tests.Modules/Indexing/LuceneSearchBuilderTests.cs b/src/Orchard.Tests.Modules/Indexing/LuceneSearchBuilderTests.cs index 94850100186..bf7504281d0 100644 --- a/src/Orchard.Tests.Modules/Indexing/LuceneSearchBuilderTests.cs +++ b/src/Orchard.Tests.Modules/Indexing/LuceneSearchBuilderTests.cs @@ -1,751 +1,751 @@ -using System; -using System.IO; -using System.Linq; -using Autofac; -using Lucene.Services; -using NUnit.Framework; -using Orchard.Environment.Configuration; -using Orchard.FileSystems.AppData; -using Orchard.Indexing; -using Orchard.Tests.FileSystems.AppData; - -namespace Orchard.Tests.Modules.Indexing { - public class LuceneSearchBuilderTests { - private IContainer _container; - private IIndexProvider _provider; - private IAppDataFolder _appDataFolder; - private ShellSettings _shellSettings; - private readonly string _basePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); - - [TestFixtureTearDown] - public void Clean() { - if (Directory.Exists(_basePath)) { - Directory.Delete(_basePath, true); - } - } - - [SetUp] - public void Setup() { - if (Directory.Exists(_basePath)) { - Directory.Delete(_basePath, true); - } - Directory.CreateDirectory(_basePath); - - _appDataFolder = AppDataFolderTests.CreateAppDataFolder(_basePath); - - var builder = new ContainerBuilder(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(_appDataFolder).As(); - - // setting up a ShellSettings instance - _shellSettings = new ShellSettings { Name = "My Site" }; - builder.RegisterInstance(_shellSettings).As(); - - _container = builder.Build(); - _provider = _container.Resolve(); - } - - private ISearchBuilder SearchBuilder { get { return _provider.CreateSearchBuilder("default"); } } - - [Test] - public void SearchTermsShouldBeFoundInMultipleFields() { - _provider.CreateIndex("default"); - _provider.Store("default", - _provider.New(42) - .Add("title", "title1 title2 title3").Analyze() - .Add("date", new DateTime(2010, 05, 28, 14, 13, 56, 123)) - ); - - Assert.IsNotNull(_provider.CreateSearchBuilder("default").Get(42)); - - Assert.IsNotNull(_provider.CreateSearchBuilder("default").WithField("title", "title1").Search().FirstOrDefault()); - Assert.IsNotNull(_provider.CreateSearchBuilder("default").WithField("title", "title2").Search().FirstOrDefault()); - Assert.IsNotNull(_provider.CreateSearchBuilder("default").WithField("title", "title3").Search().FirstOrDefault()); - Assert.IsNull(_provider.CreateSearchBuilder("default").WithField("title", "title4").Search().FirstOrDefault()); - - } - - [Test] - public void ShouldSearchById() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1)); - _provider.Store("default", _provider.New(2)); - _provider.Store("default", _provider.New(3)); - - - Assert.That(SearchBuilder.Get(1).ContentItemId, Is.EqualTo(1)); - Assert.That(SearchBuilder.Get(2).ContentItemId, Is.EqualTo(2)); - Assert.That(SearchBuilder.Get(3).ContentItemId, Is.EqualTo(3)); - } - - [Test] - public void ShouldSearchWithField() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("title", "cat")); - _provider.Store("default", _provider.New(2).Add("title", "dog")); - _provider.Store("default", _provider.New(3).Add("title", "cat")); - - - Assert.That(SearchBuilder.WithField("title", "cat").Search().Count(), Is.EqualTo(2)); - Assert.That(SearchBuilder.WithField("title", "cat").Search().Any(hit => new[] { 1, 3 }.Contains(hit.ContentItemId)), Is.True); - } - - [Test] - public void ShouldSearchByBooleanWhateverIndexingScheme() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("foo", true)); - _provider.Store("default", _provider.New(2).Add("foo", true).Store()); - _provider.Store("default", _provider.New(3).Add("foo", true).Analyze()); - _provider.Store("default", _provider.New(4).Add("foo", true).Store().Analyze()); - _provider.Store("default", _provider.New(5).Add("foo", false)); - _provider.Store("default", _provider.New(6).Add("foo", false).Store()); - _provider.Store("default", _provider.New(7).Add("foo", false).Analyze()); - _provider.Store("default", _provider.New(8).Add("foo", false).Store().Analyze()); - - Assert.That(SearchBuilder.WithField("foo", false).Search().Count(), Is.EqualTo(4)); - Assert.That(SearchBuilder.WithField("foo", true).Search().Count(), Is.EqualTo(4)); - } - - [Test] - public void ShouldSearchByStringWhateverIndexingScheme() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("foo", "abc")); - _provider.Store("default", _provider.New(2).Add("foo", "abc").Store()); - _provider.Store("default", _provider.New(3).Add("foo", "abc").Analyze()); - _provider.Store("default", _provider.New(4).Add("foo", "abc").Store().Analyze()); - _provider.Store("default", _provider.New(5).Add("foo", "def")); - _provider.Store("default", _provider.New(6).Add("foo", "def").Store()); - _provider.Store("default", _provider.New(7).Add("foo", "def").Analyze()); - _provider.Store("default", _provider.New(8).Add("foo", "def").Store().Analyze()); - - Assert.That(SearchBuilder.WithField("foo", "abc").Search().Count(), Is.EqualTo(4)); - Assert.That(SearchBuilder.WithField("foo", "def").Search().Count(), Is.EqualTo(4)); - } - - [Test] - public void ShouldSearchByIntegerWhateverIndexingScheme() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("foo", 1)); - _provider.Store("default", _provider.New(2).Add("foo", 1).Store()); - _provider.Store("default", _provider.New(3).Add("foo", 1).Analyze()); - _provider.Store("default", _provider.New(4).Add("foo", 1).Store().Analyze()); - _provider.Store("default", _provider.New(5).Add("foo", 2)); - _provider.Store("default", _provider.New(6).Add("foo", 2).Store()); - _provider.Store("default", _provider.New(7).Add("foo", 2).Analyze()); - _provider.Store("default", _provider.New(8).Add("foo", 2).Store().Analyze()); - - Assert.That(SearchBuilder.WithField("foo", 1).Search().Count(), Is.EqualTo(4)); - Assert.That(SearchBuilder.WithField("foo", 2).Search().Count(), Is.EqualTo(4)); - } - - [Test] - public void ShouldSearchByFloatWhateverIndexingScheme() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("foo", 1.1)); - _provider.Store("default", _provider.New(2).Add("foo", 1.1).Store()); - _provider.Store("default", _provider.New(3).Add("foo", 1.1).Analyze()); - _provider.Store("default", _provider.New(4).Add("foo", 1.1).Store().Analyze()); - _provider.Store("default", _provider.New(5).Add("foo", 2.1)); - _provider.Store("default", _provider.New(6).Add("foo", 2.1).Store()); - _provider.Store("default", _provider.New(7).Add("foo", 2.1).Analyze()); - _provider.Store("default", _provider.New(8).Add("foo", 2.1).Store().Analyze()); - - Assert.That(SearchBuilder.WithField("foo", 1.1).Search().Count(), Is.EqualTo(4)); - Assert.That(SearchBuilder.WithField("foo", 2.1).Search().Count(), Is.EqualTo(4)); - } - - [Test] - public void ShouldSearchByDateTimeWhateverIndexingScheme() { - var date1 = DateTime.Today; - var date2 = DateTime.Today.AddDays(1); - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("foo", date1)); - _provider.Store("default", _provider.New(2).Add("foo", date1).Store()); - _provider.Store("default", _provider.New(3).Add("foo", date1).Analyze()); - _provider.Store("default", _provider.New(4).Add("foo", date1).Store().Analyze()); - _provider.Store("default", _provider.New(5).Add("foo", date2)); - _provider.Store("default", _provider.New(6).Add("foo", date2).Store()); - _provider.Store("default", _provider.New(7).Add("foo", date2).Analyze()); - _provider.Store("default", _provider.New(8).Add("foo", date2).Store().Analyze()); - - Assert.That(SearchBuilder.WithField("foo", date1).Search().Count(), Is.EqualTo(4)); - Assert.That(SearchBuilder.WithField("foo", date2).Search().Count(), Is.EqualTo(4)); - } - - - [Test] - public void ShouldCountResultsOnly() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("title", "cat")); - _provider.Store("default", _provider.New(2).Add("title", "dog")); - _provider.Store("default", _provider.New(3).Add("title", "cat")); - - Assert.That(SearchBuilder.WithField("title", "dog").Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithField("title", "cat").Count(), Is.EqualTo(2)); - } - - [Test] - public void ShouldFilterByDate() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("date", new DateTime(2010, 05, 28, 12, 30, 15))); - _provider.Store("default", _provider.New(2).Add("date", new DateTime(2010, 05, 28, 12, 30, 30))); - _provider.Store("default", _provider.New(3).Add("date", new DateTime(2010, 05, 28, 12, 30, 45))); - - Assert.That(SearchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 15), DateTime.MaxValue).Count(), Is.EqualTo(3)); - Assert.That(SearchBuilder.WithinRange("date", DateTime.MinValue, new DateTime(2010, 05, 28, 12, 30, 45)).Count(), Is.EqualTo(3)); - Assert.That(SearchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 15), new DateTime(2010, 05, 28, 12, 30, 45)).Count(), Is.EqualTo(3)); - Assert.That(SearchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 16), new DateTime(2010, 05, 28, 12, 30, 44)).Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 46), DateTime.MaxValue).Count(), Is.EqualTo(0)); - Assert.That(SearchBuilder.WithinRange("date", DateTime.MinValue, new DateTime(2010, 05, 28, 12, 30, 1)).Count(), Is.EqualTo(0)); - } - - [Test] - public void ShouldSliceResults() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1)); - _provider.Store("default", _provider.New(22)); - _provider.Store("default", _provider.New(333)); - _provider.Store("default", _provider.New(4444)); - _provider.Store("default", _provider.New(55555)); - - - Assert.That(SearchBuilder.Count(), Is.EqualTo(5)); - Assert.That(SearchBuilder.Slice(0, 3).Count(), Is.EqualTo(3)); - Assert.That(SearchBuilder.Slice(1, 3).Count(), Is.EqualTo(3)); - Assert.That(SearchBuilder.Slice(3, 3).Count(), Is.EqualTo(2)); - - // Count() and Search() should return the same results - Assert.That(SearchBuilder.Search().Count(), Is.EqualTo(5)); - Assert.That(SearchBuilder.Slice(0, 3).Search().Count(), Is.EqualTo(3)); - Assert.That(SearchBuilder.Slice(1, 3).Search().Count(), Is.EqualTo(3)); - Assert.That(SearchBuilder.Slice(3, 3).Search().Count(), Is.EqualTo(2)); - } - - [Test] - public void ShouldSortByRelevance() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("body", "michael is in the kitchen").Analyze()); - _provider.Store("default", _provider.New(2).Add("body", "michael as a cousin named michel").Analyze()); - _provider.Store("default", _provider.New(3).Add("body", "speak inside the mic").Analyze()); - _provider.Store("default", _provider.New(4).Add("body", "a dog is pursuing a cat").Analyze()); - _provider.Store("default", _provider.New(5).Add("body", "the elephant can't catch up the dog").Analyze()); - - var michael = SearchBuilder.WithField("body", "michael").Search().ToList(); - Assert.That(michael.Count(), Is.EqualTo(2)); - Assert.That(michael[0].Score >= michael[1].Score, Is.True); - - // Sorting on score is always descending - michael = SearchBuilder.WithField("body", "michael").Ascending().Search().ToList(); - Assert.That(michael.Count(), Is.EqualTo(2)); - Assert.That(michael[0].Score >= michael[1].Score, Is.True); - } - - [Test] - public void ShouldSortByDate() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("date", new DateTime(2010, 05, 28, 12, 30, 30))); - _provider.Store("default", _provider.New(2).Add("date", DateTime.MinValue)); - _provider.Store("default", _provider.New(3).Add("date", DateTime.MaxValue)); - - var date = SearchBuilder.SortByDateTime("date").Search().ToList(); - Assert.That(date.Count(), Is.EqualTo(3)); - Assert.That(date[0].ContentItemId, Is.EqualTo(3)); - Assert.That(date[1].ContentItemId, Is.EqualTo(1)); - Assert.That(date[2].ContentItemId, Is.EqualTo(2)); - - date = SearchBuilder.SortByDateTime("date").Ascending().Search().ToList(); - Assert.That(date[0].ContentItemId, Is.EqualTo(2)); - Assert.That(date[1].ContentItemId, Is.EqualTo(1)); - Assert.That(date[2].ContentItemId, Is.EqualTo(3)); - } - - [Test] - public void ShouldSortByNumber() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("downloads", 111)); - _provider.Store("default", _provider.New(2).Add("downloads", int.MaxValue)); - _provider.Store("default", _provider.New(3).Add("downloads", int.MinValue)); - - var number = SearchBuilder.SortByInteger("downloads").Search().ToList(); - Assert.That(number.Count(), Is.EqualTo(3)); - Assert.That(number[0].ContentItemId, Is.EqualTo(2)); - Assert.That(number[1].ContentItemId, Is.EqualTo(1)); - Assert.That(number[2].ContentItemId, Is.EqualTo(3)); - - number = SearchBuilder.SortByInteger("downloads").Ascending().Search().ToList(); - Assert.That(number.Count(), Is.EqualTo(3)); - Assert.That(number[0].ContentItemId, Is.EqualTo(3)); - Assert.That(number[1].ContentItemId, Is.EqualTo(1)); - Assert.That(number[2].ContentItemId, Is.EqualTo(2)); - } - - [Test] - public void ShouldSortByBoolean() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("active", true)); - _provider.Store("default", _provider.New(2).Add("active", false)); - - var number = SearchBuilder.SortByBoolean("active").Search().ToList(); - Assert.That(number.Count(), Is.EqualTo(2)); - Assert.That(number[0].ContentItemId, Is.EqualTo(1)); - Assert.That(number[1].ContentItemId, Is.EqualTo(2)); - - number = SearchBuilder.SortByBoolean("active").Ascending().Search().ToList(); - Assert.That(number.Count(), Is.EqualTo(2)); - Assert.That(number[0].ContentItemId, Is.EqualTo(2)); - Assert.That(number[1].ContentItemId, Is.EqualTo(1)); - } - - [Test] - public void ShouldSortByDouble() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("rating", 111.111)); - _provider.Store("default", _provider.New(2).Add("rating", double.MaxValue)); - _provider.Store("default", _provider.New(3).Add("rating", double.MinValue)); - - var number = SearchBuilder.SortByDouble("rating").Search().ToList(); - Assert.That(number.Count(), Is.EqualTo(3)); - Assert.That(number[0].ContentItemId, Is.EqualTo(2)); - Assert.That(number[1].ContentItemId, Is.EqualTo(1)); - Assert.That(number[2].ContentItemId, Is.EqualTo(3)); - - number = SearchBuilder.SortByDouble("rating").Ascending().Search().ToList(); - Assert.That(number.Count(), Is.EqualTo(3)); - Assert.That(number[0].ContentItemId, Is.EqualTo(3)); - Assert.That(number[1].ContentItemId, Is.EqualTo(1)); - Assert.That(number[2].ContentItemId, Is.EqualTo(2)); - } - - [Test] - public void ShouldEscapeSpecialChars() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("body", "Orchard has been developped in C#").Analyze()); - _provider.Store("default", _provider.New(2).Add("body", "Windows has been developped in C++").Analyze()); - - var cs = SearchBuilder.Parse("body", "C#").Search().ToList(); - Assert.That(cs.Count(), Is.EqualTo(2)); - - var cpp = SearchBuilder.Parse("body", "C++").Search().ToList(); - Assert.That(cpp.Count(), Is.EqualTo(2)); - - } - - [Test] - public void ShouldHandleMandatoryFields() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("body", "Orchard has been developped in C#").Analyze()); - _provider.Store("default", _provider.New(2).Add("body", "Windows has been developped in C++").Analyze()); - - Assert.That(SearchBuilder.WithField("body", "develop").Search().ToList().Count(), Is.EqualTo(2)); - Assert.That(SearchBuilder.WithField("body", "develop").WithField("body", "Orchard").Search().ToList().Count(), Is.EqualTo(2)); - Assert.That(SearchBuilder.WithField("body", "develop").WithField("body", "Orchard").Mandatory().Search().ToList().Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithField("body", "develop").WithField("body", "Orchard").Mandatory().Search().First().ContentItemId, Is.EqualTo(1)); - } - - [Test] - public void ShouldHandleForbiddenFields() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("body", "Orchard has been developped in C#").Analyze()); - _provider.Store("default", _provider.New(2).Add("body", "Windows has been developped in C++").Analyze()); - - Assert.That(SearchBuilder.WithField("body", "developped").Search().ToList().Count(), Is.EqualTo(2)); - Assert.That(SearchBuilder.WithField("body", "developped").WithField("body", "Orchard").Search().ToList().Count(), Is.EqualTo(2)); - Assert.That(SearchBuilder.WithField("body", "developped").WithField("body", "Orchard").Forbidden().Search().ToList().Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithField("body", "developped").WithField("body", "Orchard").Forbidden().Search().First().ContentItemId, Is.EqualTo(2)); - } - - [Test] - public void ShouldHandleWeight() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("body", "Orchard has been developped in C#").Analyze()); - _provider.Store("default", _provider.New(2).Add("body", "Windows has been developped in C++").Analyze()); - - Assert.That(SearchBuilder.WithField("body", "developped").WithField("body", "Orchard").Weighted(2).Search().First().ContentItemId, Is.EqualTo(1)); - } - - [Test] - public void ShouldParseLuceneQueries() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("body", "Bradley is in the kitchen.").Analyze().Add("title", "Beer and takos").Analyze()); - _provider.Store("default", _provider.New(2).Add("body", "Renaud is also in the kitchen.").Analyze().Add("title", "A love affair").Analyze()); - _provider.Store("default", _provider.New(3).Add("body", "Bertrand is a little bit jealous.").Analyze().Add("title", "Soap opera").Analyze()); - - Assert.That(SearchBuilder.Parse(new[] {"body"}, "kitchen", false).Count(), Is.EqualTo(2)); - Assert.That(SearchBuilder.Parse(new[] {"body"}, "kitchen bertrand", false).Count(), Is.EqualTo(3)); - Assert.That(SearchBuilder.Parse(new[] {"body"}, "kitchen +bertrand", false).Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.Parse(new[] {"body"}, "+kitchen +bertrand", false).Count(), Is.EqualTo(0)); - Assert.That(SearchBuilder.Parse(new[] {"body"}, "kit*", false).Count(), Is.EqualTo(2)); - Assert.That(SearchBuilder.Parse(new[] {"body", "title"}, "bradley love^3 soap", false).Count(), Is.EqualTo(3)); - Assert.That(SearchBuilder.Parse(new[] {"body", "title"}, "bradley love^3 soap", false).Search().First().ContentItemId, Is.EqualTo(2)); - } - - [Test] - public void ParseQueriesArePrefixedByDefault() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("body", "Bradley is in the kitchen.").Analyze().Add("title", "Beer and takos").Analyze()); - _provider.Store("default", _provider.New(2).Add("body", "Renaud is also in the kitchen.").Analyze().Add("title", "A love affair").Analyze()); - _provider.Store("default", _provider.New(3).Add("body", "Bertrand is a little bit jealous.").Analyze().Add("title", "Soap opera").Analyze()); - - // a prefix is added to the clause - Assert.That(SearchBuilder.Parse(new[] { "body" }, "kit", false).Count(), Is.EqualTo(2)); - - // ExactMatch prevents a prefix to be added - Assert.That(SearchBuilder.Parse(new[] { "body" }, "kit", false).ExactMatch().Count(), Is.EqualTo(0)); - } - - [Test] - public void ShouldParseLuceneQueriesWithSpecificFields() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("body", "Bradley is in the kitchen.").Analyze().Add("title", "Beer and takos").Analyze()); - _provider.Store("default", _provider.New(2).Add("body", "Renaud is also in the kitchen.").Analyze().Add("title", "A love affair").Analyze()); - _provider.Store("default", _provider.New(3).Add("body", "Bertrand is a little bit jealous.").Analyze().Add("title", "Soap opera").Analyze()); - - // specifying a field to match - Assert.That(SearchBuilder.Parse(new[] { "body" }, "title:bradley", false).Search().Count(), Is.EqualTo(0)); - Assert.That(SearchBuilder.Parse(new[] { "body" }, "title:s*", false).Search().Count(), Is.EqualTo(1)); - - // checking terms fall back to the default fields - Assert.That(SearchBuilder.Parse(new[] { "body" }, "title:bradley bradley", false).Search().Count(), Is.EqualTo(1)); - } - - [Test] - public void ShouldFilterIntValues() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("field", 1)); - _provider.Store("default", _provider.New(2).Add("field", 22)); - _provider.Store("default", _provider.New(3).Add("field", 333)); - - Assert.That(SearchBuilder.WithField("field", 1).ExactMatch().Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithField("field", 22).ExactMatch().Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithField("field", 333).ExactMatch().Count(), Is.EqualTo(1)); - - Assert.That(SearchBuilder.WithField("field", 0).ExactMatch().Count(), Is.EqualTo(0)); - Assert.That(SearchBuilder.WithField("field", 2).ExactMatch().Count(), Is.EqualTo(0)); - Assert.That(SearchBuilder.WithField("field", 3).ExactMatch().Count(), Is.EqualTo(0)); - } - - [Test] - public void ShouldFilterStoredIntValues() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("field", 1).Store()); - _provider.Store("default", _provider.New(2).Add("field", 22).Store()); - _provider.Store("default", _provider.New(3).Add("field", 333).Store()); - - Assert.That(SearchBuilder.WithField("field", 1).ExactMatch().Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithField("field", 22).ExactMatch().Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithField("field", 333).ExactMatch().Count(), Is.EqualTo(1)); - - Assert.That(SearchBuilder.WithField("field", 0).ExactMatch().Count(), Is.EqualTo(0)); - Assert.That(SearchBuilder.WithField("field", 2).ExactMatch().Count(), Is.EqualTo(0)); - Assert.That(SearchBuilder.WithField("field", 3).ExactMatch().Count(), Is.EqualTo(0)); - } - - [Test] - public void ShouldProvideAvailableFields() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("a", "Home").Analyze()); - _provider.Store("default", _provider.New(2).Add("b", DateTime.Now).Store()); - _provider.Store("default", _provider.New(3).Add("c", 333)); - - Assert.That(_provider.GetFields("default").Count(), Is.EqualTo(4)); - Assert.That(_provider.GetFields("default").OrderBy(s => s).ToArray(), Is.EqualTo(new [] { "a", "b", "c", "id"})); - } - - [Test] - public void FiltersShouldNotAlterResults() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("body", "Orchard has been developped by Microsoft in C#").Analyze().Add("culture", 1033)); - _provider.Store("default", _provider.New(2).Add("body", "Windows a été développé par Microsoft en C++").Analyze().Add("culture", 1036)); - _provider.Store("default", _provider.New(3).Add("title", "Home").Analyze().Add("culture", 1033)); - - Assert.That(SearchBuilder.WithField("body", "Microsoft").Count(), Is.EqualTo(2)); - Assert.That(SearchBuilder.WithField("body", "Microsoft").WithField("culture", 1033).Count(), Is.EqualTo(3)); - Assert.That(SearchBuilder.WithField("body", "Microsoft").WithField("culture", 1033).AsFilter().Count(), Is.EqualTo(1)); - - Assert.That(SearchBuilder.WithField("body", "Orchard").WithField("culture", 1036).Count(), Is.EqualTo(2)); - Assert.That(SearchBuilder.WithField("body", "Orchard").WithField("culture", 1036).AsFilter().Count(), Is.EqualTo(0)); - - Assert.That(SearchBuilder.WithField("culture", 1033).Count(), Is.EqualTo(2)); - Assert.That(SearchBuilder.WithField("culture", 1033).AsFilter().Count(), Is.EqualTo(2)); - - Assert.That(SearchBuilder.WithField("body", "blabla").WithField("culture", 1033).Count(), Is.EqualTo(2)); - Assert.That(SearchBuilder.WithField("body", "blabla").WithField("culture", 1033).AsFilter().Count(), Is.EqualTo(0)); - - Assert.That(SearchBuilder.Parse("title", "home").Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.Parse("title", "home").WithField("culture", 1033).AsFilter().Count(), Is.EqualTo(1)); - } - - [Test] - public void ParsedTextShouldBeEscapedByDefault() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("body", "foo.bar").Analyze()); - - Assert.That(SearchBuilder.Parse("body", "*@!woo*@!").Count(), Is.EqualTo(0)); - } - - [Test] - public void ShouldSearchFolderStructure() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("media-path", "images").Store()); - _provider.Store("default", _provider.New(2).Add("media-path", "images/pets/puppies").Store()); - _provider.Store("default", _provider.New(3).Add("media-path", "images/pets/kitties").Store()); - - // Assert.That(SearchBuilder.WithField("media-path", "Pets").Mandatory().Count(), Is.EqualTo(0)); - Assert.That(SearchBuilder.WithField("media-path", "images").NotAnalyzed().Mandatory().Count(), Is.EqualTo(3)); - Assert.That(SearchBuilder.WithField("media-path", "images").NotAnalyzed().ExactMatch().Mandatory().Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithField("media-path", "images/pets").NotAnalyzed().Mandatory().Count(), Is.EqualTo(2)); - Assert.That(SearchBuilder.WithField("media-path", "images/pets").NotAnalyzed().ExactMatch().Mandatory().Count(), Is.EqualTo(0)); - Assert.That(SearchBuilder.WithField("media-path", "images/pets/puppies").NotAnalyzed().ExactMatch().Mandatory().Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithField("media-path", "images/pets/puppies").NotAnalyzed().Mandatory().Count(), Is.EqualTo(1)); - } - - [Test] - public void FieldsCanContainMultipleValue() { - _provider.CreateIndex("default"); - var documentIndex = _provider.New(1) - .Add("tag-id", 1) - .Add("tag-id", 2) - .Add("tag-id", 3) - .Add("tag-value", "tag1") - .Add("tag-value", "tag2") - .Add("tag-value", "tag3"); - - _provider.Store("default", documentIndex); - - Assert.That(SearchBuilder.WithField("tag-id", 0).Count(), Is.EqualTo(0)); - Assert.That(SearchBuilder.WithField("tag-id", 1).Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithField("tag-id", 2).Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithField("tag-id", 3).Count(), Is.EqualTo(1)); - - Assert.That(SearchBuilder.WithField("tag-value", "tag").ExactMatch().Count(), Is.EqualTo(0)); - Assert.That(SearchBuilder.WithField("tag-value", "tag1").ExactMatch().Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithField("tag-value", "tag2").ExactMatch().Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithField("tag-value", "tag3").ExactMatch().Count(), Is.EqualTo(1)); - - Assert.That(SearchBuilder.WithField("tag-value", "tag").Count(), Is.EqualTo(1)); - } - - [Test] - public void AnalyzedFieldsAreNotCaseSensitive() { - _provider.CreateIndex("default"); - var documentIndex = _provider.New(1) - .Add("tag-id", 1) - .Add("tag-value", "Tag1").Analyze(); - - _provider.Store("default", documentIndex); - - // trying in prefix mode - Assert.That(SearchBuilder.WithField("tag-value", "tag").Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithField("tag-value", "Tag").Count(), Is.EqualTo(1)); - - // trying in full word match mode - Assert.That(SearchBuilder.WithField("tag-value", "tag1").ExactMatch().Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithField("tag-value", "Tag1").ExactMatch().Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithField("tag-value", "Tag1").NotAnalyzed().ExactMatch().Count(), Is.EqualTo(0)); - } - - [Test] - public void NotAnalyzedFieldsAreSearchable() { - _provider.CreateIndex("default"); - var documentIndex = _provider.New(1) - .Add("tag-id", 1) - .Add("tag-valueL", "tag1") - .Add("tag-valueU", "Tag1"); - - _provider.Store("default", documentIndex); - - // a value which is not analyzed, is not lowered cased in the index - Assert.That(SearchBuilder.WithField("tag-valueL", "tag").Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithField("tag-valueU", "tag").Count(), Is.EqualTo(0)); - Assert.That(SearchBuilder.WithField("tag-valueL", "Tag").Count(), Is.EqualTo(1)); // queried term is lower cased - Assert.That(SearchBuilder.WithField("tag-valueU", "Tag").Count(), Is.EqualTo(0)); // queried term is lower cased - Assert.That(SearchBuilder.WithField("tag-valueL", "tag1").ExactMatch().Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithField("tag-valueU", "tag1").ExactMatch().Count(), Is.EqualTo(0)); - } - - [Test] - public void ShouldReturnAllDocuments() { - _provider.CreateIndex("default"); - for(var i = 1; i<100;i++) { - _provider.Store("default", _provider.New(i).Add("term-id", i).Store()); - } - - Assert.That(SearchBuilder.Count(), Is.EqualTo(99)); - } - - [Test] - public void NoClauseButAFilter() { - _provider.CreateIndex("default"); - for (var i = 1; i < 50; i++) { - _provider.Store("default", _provider.New(i).Add("term-id", i / 10).Store()); - } - - Assert.That(SearchBuilder.Count(), Is.EqualTo(49)); - Assert.That(SearchBuilder.WithField("term-id", 0).ExactMatch().AsFilter().Count(), Is.EqualTo(9)); - Assert.That(SearchBuilder.WithField("term-id", 1).ExactMatch().AsFilter().Count(), Is.EqualTo(10)); - Assert.That(SearchBuilder.WithField("term-id", 2).ExactMatch().AsFilter().Count(), Is.EqualTo(10)); - Assert.That(SearchBuilder.WithField("term-id", 3).ExactMatch().AsFilter().Count(), Is.EqualTo(10)); - Assert.That(SearchBuilder.WithField("term-id", 4).ExactMatch().AsFilter().Count(), Is.EqualTo(10)); - } - - [Test] - public void MandatoryCanBeUsedrMultipleTimes() { - _provider.CreateIndex("default"); - _provider.Store("default", - _provider.New(1) - .Add("field1", 1) - .Add("field2", 1) - .Add("field3", 1) - ); - - _provider.Store("default", - _provider.New(2) - .Add("field1", 1) - .Add("field2", 2) - .Add("field3", 2) - ); - - _provider.Store("default", - _provider.New(3) - .Add("field1", 1) - .Add("field2", 2) - .Add("field3", 3) - ); - - - Assert.That(SearchBuilder.WithField("field1", 0).Mandatory().Count(), Is.EqualTo(0)); - Assert.That(SearchBuilder.WithField("field1", 1).Mandatory().Count(), Is.EqualTo(3)); - Assert.That(SearchBuilder.WithField("field1", 1).Mandatory().WithField("field2", 2).Mandatory().Count(), Is.EqualTo(2)); - Assert.That(SearchBuilder.WithField("field1", 1).Mandatory().WithField("field2", 2).Mandatory().WithField("field3", 3).Mandatory().Count(), Is.EqualTo(1)); - } - - [Test] - public void SearchQueryCanContainMultipleFilters() { - _provider.CreateIndex("default"); - _provider.Store("default", - _provider.New(1) - .Add("field1", 1) - .Add("field2", 1) - .Add("field3", 1) - ); - - _provider.Store("default", - _provider.New(2) - .Add("field1", 1) - .Add("field2", 2) - .Add("field3", 2) - ); - - _provider.Store("default", - _provider.New(3) - .Add("field1", 1) - .Add("field2", 2) - .Add("field3", 3) - ); - - Assert.That(SearchBuilder.WithField("field1", 1).Count(), Is.EqualTo(3)); - - Assert.That(SearchBuilder - .WithField("field1", 1) - .WithField("field2", 2).AsFilter() - .Count(), Is.EqualTo(2)); - - Assert.That(SearchBuilder - .WithField("field1", 1) - .WithField("field2", 2).Mandatory().AsFilter() - .WithField("field3", 3).Mandatory().AsFilter() - .Count(), Is.EqualTo(1)); - } - - [Test] - public void ShouldReturnFacetedResults() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("body", "michael is in the kitchen").Analyze()); - _provider.Store("default", _provider.New(2).Add("body", "michael has a cousin named michel").Analyze()); - _provider.Store("default", _provider.New(3).Add("body", "speak inside the mic").Analyze()); - _provider.Store("default", _provider.New(4).Add("body", "a dog is pursuing a cat").Analyze()); - _provider.Store("default", _provider.New(5).Add("body", "michael speaks to elephants").Analyze()); - - var michael = SearchBuilder.WithField("body", "michael").GetBits(); - var speak = SearchBuilder.WithField("body", "speak").GetBits(); - Assert.That(michael.Count(), Is.EqualTo(3)); - Assert.That(speak.Count(), Is.EqualTo(2)); - - Assert.That(speak.And(michael).Count(), Is.EqualTo(1)); - Assert.That(speak.Or(michael).Count(), Is.EqualTo(4)); - Assert.That(speak.Xor(michael).Count(), Is.EqualTo(3)); - } - - [Test] - public void ShouldAcceptNoMin() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("string", "foo")); - _provider.Store("default", _provider.New(2).Add("date", new DateTime(2010, 05, 28, 12, 30, 30))); - _provider.Store("default", _provider.New(3).Add("number", 123.456)); - _provider.Store("default", _provider.New(4).Add("integer", 123)); - - Assert.That(SearchBuilder.WithinRange("string", null, "foobar").Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithinRange("date", null, new DateTime(2010, 05, 29, 12, 30, 30)).Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithinRange("number", null, 123.4567).Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithinRange("integer", null, 124).Count(), Is.EqualTo(1)); - } - - [Test] - public void ShouldAcceptNoMax() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("string", "foo")); - _provider.Store("default", _provider.New(2).Add("date", new DateTime(2010, 05, 28, 12, 30, 30))); - _provider.Store("default", _provider.New(3).Add("number", 123.456)); - _provider.Store("default", _provider.New(4).Add("integer", 123)); - - Assert.That(SearchBuilder.WithinRange("string", "fo", null).Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithinRange("date", new DateTime(2010, 05, 27, 12, 30, 30), null).Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithinRange("number", 123.45, null).Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithinRange("integer", 122, null).Count(), Is.EqualTo(1)); - } - - [Test] - public void ShouldIncludeBoudaries() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("string", "foo")); - _provider.Store("default", _provider.New(2).Add("date", new DateTime(2010, 05, 28, 12, 30, 30))); - _provider.Store("default", _provider.New(3).Add("number", 123.456)); - _provider.Store("default", _provider.New(4).Add("integer", 123)); - - Assert.That(SearchBuilder.WithinRange("string", "foo", null).Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 30), null).Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithinRange("number", 123.456, null).Count(), Is.EqualTo(1)); - Assert.That(SearchBuilder.WithinRange("integer", 123, null).Count(), Is.EqualTo(1)); - } - - [Test] - public void ShouldNotIncludeLowerBoudary() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("string", "foo")); - _provider.Store("default", _provider.New(2).Add("date", new DateTime(2010, 05, 28, 12, 30, 30))); - _provider.Store("default", _provider.New(3).Add("number", 123.456)); - _provider.Store("default", _provider.New(4).Add("integer", 123)); - - Assert.That(SearchBuilder.WithinRange("string", "foo", null, false).Count(), Is.EqualTo(0)); - Assert.That(SearchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 30), null, false).Count(), Is.EqualTo(0)); - Assert.That(SearchBuilder.WithinRange("number", 123.456, null, false).Count(), Is.EqualTo(0)); - Assert.That(SearchBuilder.WithinRange("integer", 123, null, false).Count(), Is.EqualTo(0)); - } - - [Test] - public void ShouldNotIncludeUpperBoudary() { - _provider.CreateIndex("default"); - _provider.Store("default", _provider.New(1).Add("string", "foo")); - _provider.Store("default", _provider.New(2).Add("date", new DateTime(2010, 05, 28, 12, 30, 30))); - _provider.Store("default", _provider.New(3).Add("number", 123.456)); - _provider.Store("default", _provider.New(4).Add("integer", 123)); - - Assert.That(SearchBuilder.WithinRange("string", null, "foo", true, false).Count(), Is.EqualTo(0)); - Assert.That(SearchBuilder.WithinRange("date", null, new DateTime(2010, 05, 28, 12, 30, 30), true, false).Count(), Is.EqualTo(0)); - Assert.That(SearchBuilder.WithinRange("number", null, 123.456, true, false).Count(), Is.EqualTo(0)); - Assert.That(SearchBuilder.WithinRange("integer", null, 123, true, false).Count(), Is.EqualTo(0)); - } - } -} +using System; +using System.IO; +using System.Linq; +using Autofac; +using Lucene.Services; +using NUnit.Framework; +using Orchard.Environment.Configuration; +using Orchard.FileSystems.AppData; +using Orchard.Indexing; +using Orchard.Tests.FileSystems.AppData; + +namespace Orchard.Tests.Modules.Indexing { + public class LuceneSearchBuilderTests { + private IContainer _container; + private IIndexProvider _provider; + private IAppDataFolder _appDataFolder; + private ShellSettings _shellSettings; + private readonly string _basePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); + + [TestFixtureTearDown] + public void Clean() { + if (Directory.Exists(_basePath)) { + Directory.Delete(_basePath, true); + } + } + + [SetUp] + public void Setup() { + if (Directory.Exists(_basePath)) { + Directory.Delete(_basePath, true); + } + Directory.CreateDirectory(_basePath); + + _appDataFolder = AppDataFolderTests.CreateAppDataFolder(_basePath); + + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(_appDataFolder).As(); + + // setting up a ShellSettings instance + _shellSettings = new ShellSettings { Name = "My Site" }; + builder.RegisterInstance(_shellSettings).As(); + + _container = builder.Build(); + _provider = _container.Resolve(); + } + + private ISearchBuilder SearchBuilder { get { return _provider.CreateSearchBuilder("default"); } } + + [Test] + public void SearchTermsShouldBeFoundInMultipleFields() { + _provider.CreateIndex("default"); + _provider.Store("default", + _provider.New(42) + .Add("title", "title1 title2 title3").Analyze() + .Add("date", new DateTime(2010, 05, 28, 14, 13, 56, 123)) + ); + + Assert.IsNotNull(_provider.CreateSearchBuilder("default").Get(42)); + + Assert.IsNotNull(_provider.CreateSearchBuilder("default").WithField("title", "title1").Search().FirstOrDefault()); + Assert.IsNotNull(_provider.CreateSearchBuilder("default").WithField("title", "title2").Search().FirstOrDefault()); + Assert.IsNotNull(_provider.CreateSearchBuilder("default").WithField("title", "title3").Search().FirstOrDefault()); + Assert.IsNull(_provider.CreateSearchBuilder("default").WithField("title", "title4").Search().FirstOrDefault()); + + } + + [Test] + public void ShouldSearchById() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1)); + _provider.Store("default", _provider.New(2)); + _provider.Store("default", _provider.New(3)); + + + Assert.That(SearchBuilder.Get(1).ContentItemId, Is.EqualTo(1)); + Assert.That(SearchBuilder.Get(2).ContentItemId, Is.EqualTo(2)); + Assert.That(SearchBuilder.Get(3).ContentItemId, Is.EqualTo(3)); + } + + [Test] + public void ShouldSearchWithField() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("title", "cat")); + _provider.Store("default", _provider.New(2).Add("title", "dog")); + _provider.Store("default", _provider.New(3).Add("title", "cat")); + + + Assert.That(SearchBuilder.WithField("title", "cat").Search().Count(), Is.EqualTo(2)); + Assert.That(SearchBuilder.WithField("title", "cat").Search().Any(hit => new[] { 1, 3 }.Contains(hit.ContentItemId)), Is.True); + } + + [Test] + public void ShouldSearchByBooleanWhateverIndexingScheme() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("foo", true)); + _provider.Store("default", _provider.New(2).Add("foo", true).Store()); + _provider.Store("default", _provider.New(3).Add("foo", true).Analyze()); + _provider.Store("default", _provider.New(4).Add("foo", true).Store().Analyze()); + _provider.Store("default", _provider.New(5).Add("foo", false)); + _provider.Store("default", _provider.New(6).Add("foo", false).Store()); + _provider.Store("default", _provider.New(7).Add("foo", false).Analyze()); + _provider.Store("default", _provider.New(8).Add("foo", false).Store().Analyze()); + + Assert.That(SearchBuilder.WithField("foo", false).Search().Count(), Is.EqualTo(4)); + Assert.That(SearchBuilder.WithField("foo", true).Search().Count(), Is.EqualTo(4)); + } + + [Test] + public void ShouldSearchByStringWhateverIndexingScheme() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("foo", "abc")); + _provider.Store("default", _provider.New(2).Add("foo", "abc").Store()); + _provider.Store("default", _provider.New(3).Add("foo", "abc").Analyze()); + _provider.Store("default", _provider.New(4).Add("foo", "abc").Store().Analyze()); + _provider.Store("default", _provider.New(5).Add("foo", "def")); + _provider.Store("default", _provider.New(6).Add("foo", "def").Store()); + _provider.Store("default", _provider.New(7).Add("foo", "def").Analyze()); + _provider.Store("default", _provider.New(8).Add("foo", "def").Store().Analyze()); + + Assert.That(SearchBuilder.WithField("foo", "abc").Search().Count(), Is.EqualTo(4)); + Assert.That(SearchBuilder.WithField("foo", "def").Search().Count(), Is.EqualTo(4)); + } + + [Test] + public void ShouldSearchByIntegerWhateverIndexingScheme() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("foo", 1)); + _provider.Store("default", _provider.New(2).Add("foo", 1).Store()); + _provider.Store("default", _provider.New(3).Add("foo", 1).Analyze()); + _provider.Store("default", _provider.New(4).Add("foo", 1).Store().Analyze()); + _provider.Store("default", _provider.New(5).Add("foo", 2)); + _provider.Store("default", _provider.New(6).Add("foo", 2).Store()); + _provider.Store("default", _provider.New(7).Add("foo", 2).Analyze()); + _provider.Store("default", _provider.New(8).Add("foo", 2).Store().Analyze()); + + Assert.That(SearchBuilder.WithField("foo", 1).Search().Count(), Is.EqualTo(4)); + Assert.That(SearchBuilder.WithField("foo", 2).Search().Count(), Is.EqualTo(4)); + } + + [Test] + public void ShouldSearchByFloatWhateverIndexingScheme() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("foo", 1.1)); + _provider.Store("default", _provider.New(2).Add("foo", 1.1).Store()); + _provider.Store("default", _provider.New(3).Add("foo", 1.1).Analyze()); + _provider.Store("default", _provider.New(4).Add("foo", 1.1).Store().Analyze()); + _provider.Store("default", _provider.New(5).Add("foo", 2.1)); + _provider.Store("default", _provider.New(6).Add("foo", 2.1).Store()); + _provider.Store("default", _provider.New(7).Add("foo", 2.1).Analyze()); + _provider.Store("default", _provider.New(8).Add("foo", 2.1).Store().Analyze()); + + Assert.That(SearchBuilder.WithField("foo", 1.1).Search().Count(), Is.EqualTo(4)); + Assert.That(SearchBuilder.WithField("foo", 2.1).Search().Count(), Is.EqualTo(4)); + } + + [Test] + public void ShouldSearchByDateTimeWhateverIndexingScheme() { + var date1 = DateTime.Today; + var date2 = DateTime.Today.AddDays(1); + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("foo", date1)); + _provider.Store("default", _provider.New(2).Add("foo", date1).Store()); + _provider.Store("default", _provider.New(3).Add("foo", date1).Analyze()); + _provider.Store("default", _provider.New(4).Add("foo", date1).Store().Analyze()); + _provider.Store("default", _provider.New(5).Add("foo", date2)); + _provider.Store("default", _provider.New(6).Add("foo", date2).Store()); + _provider.Store("default", _provider.New(7).Add("foo", date2).Analyze()); + _provider.Store("default", _provider.New(8).Add("foo", date2).Store().Analyze()); + + Assert.That(SearchBuilder.WithField("foo", date1).Search().Count(), Is.EqualTo(4)); + Assert.That(SearchBuilder.WithField("foo", date2).Search().Count(), Is.EqualTo(4)); + } + + + [Test] + public void ShouldCountResultsOnly() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("title", "cat")); + _provider.Store("default", _provider.New(2).Add("title", "dog")); + _provider.Store("default", _provider.New(3).Add("title", "cat")); + + Assert.That(SearchBuilder.WithField("title", "dog").Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithField("title", "cat").Count(), Is.EqualTo(2)); + } + + [Test] + public void ShouldFilterByDate() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("date", new DateTime(2010, 05, 28, 12, 30, 15))); + _provider.Store("default", _provider.New(2).Add("date", new DateTime(2010, 05, 28, 12, 30, 30))); + _provider.Store("default", _provider.New(3).Add("date", new DateTime(2010, 05, 28, 12, 30, 45))); + + Assert.That(SearchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 15), DateTime.MaxValue).Count(), Is.EqualTo(3)); + Assert.That(SearchBuilder.WithinRange("date", DateTime.MinValue, new DateTime(2010, 05, 28, 12, 30, 45)).Count(), Is.EqualTo(3)); + Assert.That(SearchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 15), new DateTime(2010, 05, 28, 12, 30, 45)).Count(), Is.EqualTo(3)); + Assert.That(SearchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 16), new DateTime(2010, 05, 28, 12, 30, 44)).Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 46), DateTime.MaxValue).Count(), Is.EqualTo(0)); + Assert.That(SearchBuilder.WithinRange("date", DateTime.MinValue, new DateTime(2010, 05, 28, 12, 30, 1)).Count(), Is.EqualTo(0)); + } + + [Test] + public void ShouldSliceResults() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1)); + _provider.Store("default", _provider.New(22)); + _provider.Store("default", _provider.New(333)); + _provider.Store("default", _provider.New(4444)); + _provider.Store("default", _provider.New(55555)); + + + Assert.That(SearchBuilder.Count(), Is.EqualTo(5)); + Assert.That(SearchBuilder.Slice(0, 3).Count(), Is.EqualTo(3)); + Assert.That(SearchBuilder.Slice(1, 3).Count(), Is.EqualTo(3)); + Assert.That(SearchBuilder.Slice(3, 3).Count(), Is.EqualTo(2)); + + // Count() and Search() should return the same results + Assert.That(SearchBuilder.Search().Count(), Is.EqualTo(5)); + Assert.That(SearchBuilder.Slice(0, 3).Search().Count(), Is.EqualTo(3)); + Assert.That(SearchBuilder.Slice(1, 3).Search().Count(), Is.EqualTo(3)); + Assert.That(SearchBuilder.Slice(3, 3).Search().Count(), Is.EqualTo(2)); + } + + [Test] + public void ShouldSortByRelevance() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("body", "michael is in the kitchen").Analyze()); + _provider.Store("default", _provider.New(2).Add("body", "michael as a cousin named michel").Analyze()); + _provider.Store("default", _provider.New(3).Add("body", "speak inside the mic").Analyze()); + _provider.Store("default", _provider.New(4).Add("body", "a dog is pursuing a cat").Analyze()); + _provider.Store("default", _provider.New(5).Add("body", "the elephant can't catch up the dog").Analyze()); + + var michael = SearchBuilder.WithField("body", "michael").Search().ToList(); + Assert.That(michael.Count(), Is.EqualTo(2)); + Assert.That(michael[0].Score >= michael[1].Score, Is.True); + + // Sorting on score is always descending + michael = SearchBuilder.WithField("body", "michael").Ascending().Search().ToList(); + Assert.That(michael.Count(), Is.EqualTo(2)); + Assert.That(michael[0].Score >= michael[1].Score, Is.True); + } + + [Test] + public void ShouldSortByDate() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("date", new DateTime(2010, 05, 28, 12, 30, 30))); + _provider.Store("default", _provider.New(2).Add("date", DateTime.MinValue)); + _provider.Store("default", _provider.New(3).Add("date", DateTime.MaxValue)); + + var date = SearchBuilder.SortByDateTime("date").Search().ToList(); + Assert.That(date.Count(), Is.EqualTo(3)); + Assert.That(date[0].ContentItemId, Is.EqualTo(3)); + Assert.That(date[1].ContentItemId, Is.EqualTo(1)); + Assert.That(date[2].ContentItemId, Is.EqualTo(2)); + + date = SearchBuilder.SortByDateTime("date").Ascending().Search().ToList(); + Assert.That(date[0].ContentItemId, Is.EqualTo(2)); + Assert.That(date[1].ContentItemId, Is.EqualTo(1)); + Assert.That(date[2].ContentItemId, Is.EqualTo(3)); + } + + [Test] + public void ShouldSortByNumber() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("downloads", 111)); + _provider.Store("default", _provider.New(2).Add("downloads", int.MaxValue)); + _provider.Store("default", _provider.New(3).Add("downloads", int.MinValue)); + + var number = SearchBuilder.SortByInteger("downloads").Search().ToList(); + Assert.That(number.Count(), Is.EqualTo(3)); + Assert.That(number[0].ContentItemId, Is.EqualTo(2)); + Assert.That(number[1].ContentItemId, Is.EqualTo(1)); + Assert.That(number[2].ContentItemId, Is.EqualTo(3)); + + number = SearchBuilder.SortByInteger("downloads").Ascending().Search().ToList(); + Assert.That(number.Count(), Is.EqualTo(3)); + Assert.That(number[0].ContentItemId, Is.EqualTo(3)); + Assert.That(number[1].ContentItemId, Is.EqualTo(1)); + Assert.That(number[2].ContentItemId, Is.EqualTo(2)); + } + + [Test] + public void ShouldSortByBoolean() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("active", true)); + _provider.Store("default", _provider.New(2).Add("active", false)); + + var number = SearchBuilder.SortByBoolean("active").Search().ToList(); + Assert.That(number.Count(), Is.EqualTo(2)); + Assert.That(number[0].ContentItemId, Is.EqualTo(1)); + Assert.That(number[1].ContentItemId, Is.EqualTo(2)); + + number = SearchBuilder.SortByBoolean("active").Ascending().Search().ToList(); + Assert.That(number.Count(), Is.EqualTo(2)); + Assert.That(number[0].ContentItemId, Is.EqualTo(2)); + Assert.That(number[1].ContentItemId, Is.EqualTo(1)); + } + + [Test] + public void ShouldSortByDouble() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("rating", 111.111)); + _provider.Store("default", _provider.New(2).Add("rating", double.MaxValue)); + _provider.Store("default", _provider.New(3).Add("rating", double.MinValue)); + + var number = SearchBuilder.SortByDouble("rating").Search().ToList(); + Assert.That(number.Count(), Is.EqualTo(3)); + Assert.That(number[0].ContentItemId, Is.EqualTo(2)); + Assert.That(number[1].ContentItemId, Is.EqualTo(1)); + Assert.That(number[2].ContentItemId, Is.EqualTo(3)); + + number = SearchBuilder.SortByDouble("rating").Ascending().Search().ToList(); + Assert.That(number.Count(), Is.EqualTo(3)); + Assert.That(number[0].ContentItemId, Is.EqualTo(3)); + Assert.That(number[1].ContentItemId, Is.EqualTo(1)); + Assert.That(number[2].ContentItemId, Is.EqualTo(2)); + } + + [Test] + public void ShouldEscapeSpecialChars() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("body", "Orchard has been developped in C#").Analyze()); + _provider.Store("default", _provider.New(2).Add("body", "Windows has been developped in C++").Analyze()); + + var cs = SearchBuilder.Parse("body", "C#").Search().ToList(); + Assert.That(cs.Count(), Is.EqualTo(2)); + + var cpp = SearchBuilder.Parse("body", "C++").Search().ToList(); + Assert.That(cpp.Count(), Is.EqualTo(2)); + + } + + [Test] + public void ShouldHandleMandatoryFields() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("body", "Orchard has been developped in C#").Analyze()); + _provider.Store("default", _provider.New(2).Add("body", "Windows has been developped in C++").Analyze()); + + Assert.That(SearchBuilder.WithField("body", "develop").Search().ToList().Count(), Is.EqualTo(2)); + Assert.That(SearchBuilder.WithField("body", "develop").WithField("body", "Orchard").Search().ToList().Count(), Is.EqualTo(2)); + Assert.That(SearchBuilder.WithField("body", "develop").WithField("body", "Orchard").Mandatory().Search().ToList().Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithField("body", "develop").WithField("body", "Orchard").Mandatory().Search().First().ContentItemId, Is.EqualTo(1)); + } + + [Test] + public void ShouldHandleForbiddenFields() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("body", "Orchard has been developped in C#").Analyze()); + _provider.Store("default", _provider.New(2).Add("body", "Windows has been developped in C++").Analyze()); + + Assert.That(SearchBuilder.WithField("body", "developped").Search().ToList().Count(), Is.EqualTo(2)); + Assert.That(SearchBuilder.WithField("body", "developped").WithField("body", "Orchard").Search().ToList().Count(), Is.EqualTo(2)); + Assert.That(SearchBuilder.WithField("body", "developped").WithField("body", "Orchard").Forbidden().Search().ToList().Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithField("body", "developped").WithField("body", "Orchard").Forbidden().Search().First().ContentItemId, Is.EqualTo(2)); + } + + [Test] + public void ShouldHandleWeight() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("body", "Orchard has been developped in C#").Analyze()); + _provider.Store("default", _provider.New(2).Add("body", "Windows has been developped in C++").Analyze()); + + Assert.That(SearchBuilder.WithField("body", "developped").WithField("body", "Orchard").Weighted(2).Search().First().ContentItemId, Is.EqualTo(1)); + } + + [Test] + public void ShouldParseLuceneQueries() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("body", "Bradley is in the kitchen.").Analyze().Add("title", "Beer and takos").Analyze()); + _provider.Store("default", _provider.New(2).Add("body", "Renaud is also in the kitchen.").Analyze().Add("title", "A love affair").Analyze()); + _provider.Store("default", _provider.New(3).Add("body", "Bertrand is a little bit jealous.").Analyze().Add("title", "Soap opera").Analyze()); + + Assert.That(SearchBuilder.Parse(new[] {"body"}, "kitchen", false).Count(), Is.EqualTo(2)); + Assert.That(SearchBuilder.Parse(new[] {"body"}, "kitchen bertrand", false).Count(), Is.EqualTo(3)); + Assert.That(SearchBuilder.Parse(new[] {"body"}, "kitchen +bertrand", false).Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.Parse(new[] {"body"}, "+kitchen +bertrand", false).Count(), Is.EqualTo(0)); + Assert.That(SearchBuilder.Parse(new[] {"body"}, "kit*", false).Count(), Is.EqualTo(2)); + Assert.That(SearchBuilder.Parse(new[] {"body", "title"}, "bradley love^3 soap", false).Count(), Is.EqualTo(3)); + Assert.That(SearchBuilder.Parse(new[] {"body", "title"}, "bradley love^3 soap", false).Search().First().ContentItemId, Is.EqualTo(2)); + } + + [Test] + public void ParseQueriesArePrefixedByDefault() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("body", "Bradley is in the kitchen.").Analyze().Add("title", "Beer and takos").Analyze()); + _provider.Store("default", _provider.New(2).Add("body", "Renaud is also in the kitchen.").Analyze().Add("title", "A love affair").Analyze()); + _provider.Store("default", _provider.New(3).Add("body", "Bertrand is a little bit jealous.").Analyze().Add("title", "Soap opera").Analyze()); + + // a prefix is added to the clause + Assert.That(SearchBuilder.Parse(new[] { "body" }, "kit", false).Count(), Is.EqualTo(2)); + + // ExactMatch prevents a prefix to be added + Assert.That(SearchBuilder.Parse(new[] { "body" }, "kit", false).ExactMatch().Count(), Is.EqualTo(0)); + } + + [Test] + public void ShouldParseLuceneQueriesWithSpecificFields() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("body", "Bradley is in the kitchen.").Analyze().Add("title", "Beer and takos").Analyze()); + _provider.Store("default", _provider.New(2).Add("body", "Renaud is also in the kitchen.").Analyze().Add("title", "A love affair").Analyze()); + _provider.Store("default", _provider.New(3).Add("body", "Bertrand is a little bit jealous.").Analyze().Add("title", "Soap opera").Analyze()); + + // specifying a field to match + Assert.That(SearchBuilder.Parse(new[] { "body" }, "title:bradley", false).Search().Count(), Is.EqualTo(0)); + Assert.That(SearchBuilder.Parse(new[] { "body" }, "title:s*", false).Search().Count(), Is.EqualTo(1)); + + // checking terms fall back to the default fields + Assert.That(SearchBuilder.Parse(new[] { "body" }, "title:bradley bradley", false).Search().Count(), Is.EqualTo(1)); + } + + [Test] + public void ShouldFilterIntValues() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("field", 1)); + _provider.Store("default", _provider.New(2).Add("field", 22)); + _provider.Store("default", _provider.New(3).Add("field", 333)); + + Assert.That(SearchBuilder.WithField("field", 1).ExactMatch().Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithField("field", 22).ExactMatch().Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithField("field", 333).ExactMatch().Count(), Is.EqualTo(1)); + + Assert.That(SearchBuilder.WithField("field", 0).ExactMatch().Count(), Is.EqualTo(0)); + Assert.That(SearchBuilder.WithField("field", 2).ExactMatch().Count(), Is.EqualTo(0)); + Assert.That(SearchBuilder.WithField("field", 3).ExactMatch().Count(), Is.EqualTo(0)); + } + + [Test] + public void ShouldFilterStoredIntValues() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("field", 1).Store()); + _provider.Store("default", _provider.New(2).Add("field", 22).Store()); + _provider.Store("default", _provider.New(3).Add("field", 333).Store()); + + Assert.That(SearchBuilder.WithField("field", 1).ExactMatch().Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithField("field", 22).ExactMatch().Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithField("field", 333).ExactMatch().Count(), Is.EqualTo(1)); + + Assert.That(SearchBuilder.WithField("field", 0).ExactMatch().Count(), Is.EqualTo(0)); + Assert.That(SearchBuilder.WithField("field", 2).ExactMatch().Count(), Is.EqualTo(0)); + Assert.That(SearchBuilder.WithField("field", 3).ExactMatch().Count(), Is.EqualTo(0)); + } + + [Test] + public void ShouldProvideAvailableFields() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("a", "Home").Analyze()); + _provider.Store("default", _provider.New(2).Add("b", DateTime.Now).Store()); + _provider.Store("default", _provider.New(3).Add("c", 333)); + + Assert.That(_provider.GetFields("default").Count(), Is.EqualTo(4)); + Assert.That(_provider.GetFields("default").OrderBy(s => s).ToArray(), Is.EqualTo(new [] { "a", "b", "c", "id"})); + } + + [Test] + public void FiltersShouldNotAlterResults() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("body", "Orchard has been developped by Microsoft in C#").Analyze().Add("culture", 1033)); + _provider.Store("default", _provider.New(2).Add("body", "Windows a été développé par Microsoft en C++").Analyze().Add("culture", 1036)); + _provider.Store("default", _provider.New(3).Add("title", "Home").Analyze().Add("culture", 1033)); + + Assert.That(SearchBuilder.WithField("body", "Microsoft").Count(), Is.EqualTo(2)); + Assert.That(SearchBuilder.WithField("body", "Microsoft").WithField("culture", 1033).Count(), Is.EqualTo(3)); + Assert.That(SearchBuilder.WithField("body", "Microsoft").WithField("culture", 1033).AsFilter().Count(), Is.EqualTo(1)); + + Assert.That(SearchBuilder.WithField("body", "Orchard").WithField("culture", 1036).Count(), Is.EqualTo(2)); + Assert.That(SearchBuilder.WithField("body", "Orchard").WithField("culture", 1036).AsFilter().Count(), Is.EqualTo(0)); + + Assert.That(SearchBuilder.WithField("culture", 1033).Count(), Is.EqualTo(2)); + Assert.That(SearchBuilder.WithField("culture", 1033).AsFilter().Count(), Is.EqualTo(2)); + + Assert.That(SearchBuilder.WithField("body", "blabla").WithField("culture", 1033).Count(), Is.EqualTo(2)); + Assert.That(SearchBuilder.WithField("body", "blabla").WithField("culture", 1033).AsFilter().Count(), Is.EqualTo(0)); + + Assert.That(SearchBuilder.Parse("title", "home").Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.Parse("title", "home").WithField("culture", 1033).AsFilter().Count(), Is.EqualTo(1)); + } + + [Test] + public void ParsedTextShouldBeEscapedByDefault() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("body", "foo.bar").Analyze()); + + Assert.That(SearchBuilder.Parse("body", "*@!woo*@!").Count(), Is.EqualTo(0)); + } + + [Test] + public void ShouldSearchFolderStructure() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("media-path", "images").Store()); + _provider.Store("default", _provider.New(2).Add("media-path", "images/pets/puppies").Store()); + _provider.Store("default", _provider.New(3).Add("media-path", "images/pets/kitties").Store()); + + // Assert.That(SearchBuilder.WithField("media-path", "Pets").Mandatory().Count(), Is.EqualTo(0)); + Assert.That(SearchBuilder.WithField("media-path", "images").NotAnalyzed().Mandatory().Count(), Is.EqualTo(3)); + Assert.That(SearchBuilder.WithField("media-path", "images").NotAnalyzed().ExactMatch().Mandatory().Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithField("media-path", "images/pets").NotAnalyzed().Mandatory().Count(), Is.EqualTo(2)); + Assert.That(SearchBuilder.WithField("media-path", "images/pets").NotAnalyzed().ExactMatch().Mandatory().Count(), Is.EqualTo(0)); + Assert.That(SearchBuilder.WithField("media-path", "images/pets/puppies").NotAnalyzed().ExactMatch().Mandatory().Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithField("media-path", "images/pets/puppies").NotAnalyzed().Mandatory().Count(), Is.EqualTo(1)); + } + + [Test] + public void FieldsCanContainMultipleValue() { + _provider.CreateIndex("default"); + var documentIndex = _provider.New(1) + .Add("tag-id", 1) + .Add("tag-id", 2) + .Add("tag-id", 3) + .Add("tag-value", "tag1") + .Add("tag-value", "tag2") + .Add("tag-value", "tag3"); + + _provider.Store("default", documentIndex); + + Assert.That(SearchBuilder.WithField("tag-id", 0).Count(), Is.EqualTo(0)); + Assert.That(SearchBuilder.WithField("tag-id", 1).Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithField("tag-id", 2).Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithField("tag-id", 3).Count(), Is.EqualTo(1)); + + Assert.That(SearchBuilder.WithField("tag-value", "tag").ExactMatch().Count(), Is.EqualTo(0)); + Assert.That(SearchBuilder.WithField("tag-value", "tag1").ExactMatch().Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithField("tag-value", "tag2").ExactMatch().Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithField("tag-value", "tag3").ExactMatch().Count(), Is.EqualTo(1)); + + Assert.That(SearchBuilder.WithField("tag-value", "tag").Count(), Is.EqualTo(1)); + } + + [Test] + public void AnalyzedFieldsAreNotCaseSensitive() { + _provider.CreateIndex("default"); + var documentIndex = _provider.New(1) + .Add("tag-id", 1) + .Add("tag-value", "Tag1").Analyze(); + + _provider.Store("default", documentIndex); + + // trying in prefix mode + Assert.That(SearchBuilder.WithField("tag-value", "tag").Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithField("tag-value", "Tag").Count(), Is.EqualTo(1)); + + // trying in full word match mode + Assert.That(SearchBuilder.WithField("tag-value", "tag1").ExactMatch().Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithField("tag-value", "Tag1").ExactMatch().Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithField("tag-value", "Tag1").NotAnalyzed().ExactMatch().Count(), Is.EqualTo(0)); + } + + [Test] + public void NotAnalyzedFieldsAreSearchable() { + _provider.CreateIndex("default"); + var documentIndex = _provider.New(1) + .Add("tag-id", 1) + .Add("tag-valueL", "tag1") + .Add("tag-valueU", "Tag1"); + + _provider.Store("default", documentIndex); + + // a value which is not analyzed, is not lowered cased in the index + Assert.That(SearchBuilder.WithField("tag-valueL", "tag").Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithField("tag-valueU", "tag").Count(), Is.EqualTo(0)); + Assert.That(SearchBuilder.WithField("tag-valueL", "Tag").Count(), Is.EqualTo(1)); // queried term is lower cased + Assert.That(SearchBuilder.WithField("tag-valueU", "Tag").Count(), Is.EqualTo(0)); // queried term is lower cased + Assert.That(SearchBuilder.WithField("tag-valueL", "tag1").ExactMatch().Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithField("tag-valueU", "tag1").ExactMatch().Count(), Is.EqualTo(0)); + } + + [Test] + public void ShouldReturnAllDocuments() { + _provider.CreateIndex("default"); + for(var i = 1; i<100;i++) { + _provider.Store("default", _provider.New(i).Add("term-id", i).Store()); + } + + Assert.That(SearchBuilder.Count(), Is.EqualTo(99)); + } + + [Test] + public void NoClauseButAFilter() { + _provider.CreateIndex("default"); + for (var i = 1; i < 50; i++) { + _provider.Store("default", _provider.New(i).Add("term-id", i / 10).Store()); + } + + Assert.That(SearchBuilder.Count(), Is.EqualTo(49)); + Assert.That(SearchBuilder.WithField("term-id", 0).ExactMatch().AsFilter().Count(), Is.EqualTo(9)); + Assert.That(SearchBuilder.WithField("term-id", 1).ExactMatch().AsFilter().Count(), Is.EqualTo(10)); + Assert.That(SearchBuilder.WithField("term-id", 2).ExactMatch().AsFilter().Count(), Is.EqualTo(10)); + Assert.That(SearchBuilder.WithField("term-id", 3).ExactMatch().AsFilter().Count(), Is.EqualTo(10)); + Assert.That(SearchBuilder.WithField("term-id", 4).ExactMatch().AsFilter().Count(), Is.EqualTo(10)); + } + + [Test] + public void MandatoryCanBeUsedrMultipleTimes() { + _provider.CreateIndex("default"); + _provider.Store("default", + _provider.New(1) + .Add("field1", 1) + .Add("field2", 1) + .Add("field3", 1) + ); + + _provider.Store("default", + _provider.New(2) + .Add("field1", 1) + .Add("field2", 2) + .Add("field3", 2) + ); + + _provider.Store("default", + _provider.New(3) + .Add("field1", 1) + .Add("field2", 2) + .Add("field3", 3) + ); + + + Assert.That(SearchBuilder.WithField("field1", 0).Mandatory().Count(), Is.EqualTo(0)); + Assert.That(SearchBuilder.WithField("field1", 1).Mandatory().Count(), Is.EqualTo(3)); + Assert.That(SearchBuilder.WithField("field1", 1).Mandatory().WithField("field2", 2).Mandatory().Count(), Is.EqualTo(2)); + Assert.That(SearchBuilder.WithField("field1", 1).Mandatory().WithField("field2", 2).Mandatory().WithField("field3", 3).Mandatory().Count(), Is.EqualTo(1)); + } + + [Test] + public void SearchQueryCanContainMultipleFilters() { + _provider.CreateIndex("default"); + _provider.Store("default", + _provider.New(1) + .Add("field1", 1) + .Add("field2", 1) + .Add("field3", 1) + ); + + _provider.Store("default", + _provider.New(2) + .Add("field1", 1) + .Add("field2", 2) + .Add("field3", 2) + ); + + _provider.Store("default", + _provider.New(3) + .Add("field1", 1) + .Add("field2", 2) + .Add("field3", 3) + ); + + Assert.That(SearchBuilder.WithField("field1", 1).Count(), Is.EqualTo(3)); + + Assert.That(SearchBuilder + .WithField("field1", 1) + .WithField("field2", 2).AsFilter() + .Count(), Is.EqualTo(2)); + + Assert.That(SearchBuilder + .WithField("field1", 1) + .WithField("field2", 2).Mandatory().AsFilter() + .WithField("field3", 3).Mandatory().AsFilter() + .Count(), Is.EqualTo(1)); + } + + [Test] + public void ShouldReturnFacetedResults() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("body", "michael is in the kitchen").Analyze()); + _provider.Store("default", _provider.New(2).Add("body", "michael has a cousin named michel").Analyze()); + _provider.Store("default", _provider.New(3).Add("body", "speak inside the mic").Analyze()); + _provider.Store("default", _provider.New(4).Add("body", "a dog is pursuing a cat").Analyze()); + _provider.Store("default", _provider.New(5).Add("body", "michael speaks to elephants").Analyze()); + + var michael = SearchBuilder.WithField("body", "michael").GetBits(); + var speak = SearchBuilder.WithField("body", "speak").GetBits(); + Assert.That(michael.Count(), Is.EqualTo(3)); + Assert.That(speak.Count(), Is.EqualTo(2)); + + Assert.That(speak.And(michael).Count(), Is.EqualTo(1)); + Assert.That(speak.Or(michael).Count(), Is.EqualTo(4)); + Assert.That(speak.Xor(michael).Count(), Is.EqualTo(3)); + } + + [Test] + public void ShouldAcceptNoMin() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("string", "foo")); + _provider.Store("default", _provider.New(2).Add("date", new DateTime(2010, 05, 28, 12, 30, 30))); + _provider.Store("default", _provider.New(3).Add("number", 123.456)); + _provider.Store("default", _provider.New(4).Add("integer", 123)); + + Assert.That(SearchBuilder.WithinRange("string", null, "foobar").Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithinRange("date", null, new DateTime(2010, 05, 29, 12, 30, 30)).Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithinRange("number", null, 123.4567).Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithinRange("integer", null, 124).Count(), Is.EqualTo(1)); + } + + [Test] + public void ShouldAcceptNoMax() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("string", "foo")); + _provider.Store("default", _provider.New(2).Add("date", new DateTime(2010, 05, 28, 12, 30, 30))); + _provider.Store("default", _provider.New(3).Add("number", 123.456)); + _provider.Store("default", _provider.New(4).Add("integer", 123)); + + Assert.That(SearchBuilder.WithinRange("string", "fo", null).Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithinRange("date", new DateTime(2010, 05, 27, 12, 30, 30), null).Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithinRange("number", 123.45, null).Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithinRange("integer", 122, null).Count(), Is.EqualTo(1)); + } + + [Test] + public void ShouldIncludeBoudaries() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("string", "foo")); + _provider.Store("default", _provider.New(2).Add("date", new DateTime(2010, 05, 28, 12, 30, 30))); + _provider.Store("default", _provider.New(3).Add("number", 123.456)); + _provider.Store("default", _provider.New(4).Add("integer", 123)); + + Assert.That(SearchBuilder.WithinRange("string", "foo", null).Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 30), null).Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithinRange("number", 123.456, null).Count(), Is.EqualTo(1)); + Assert.That(SearchBuilder.WithinRange("integer", 123, null).Count(), Is.EqualTo(1)); + } + + [Test] + public void ShouldNotIncludeLowerBoudary() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("string", "foo")); + _provider.Store("default", _provider.New(2).Add("date", new DateTime(2010, 05, 28, 12, 30, 30))); + _provider.Store("default", _provider.New(3).Add("number", 123.456)); + _provider.Store("default", _provider.New(4).Add("integer", 123)); + + Assert.That(SearchBuilder.WithinRange("string", "foo", null, false).Count(), Is.EqualTo(0)); + Assert.That(SearchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 30), null, false).Count(), Is.EqualTo(0)); + Assert.That(SearchBuilder.WithinRange("number", 123.456, null, false).Count(), Is.EqualTo(0)); + Assert.That(SearchBuilder.WithinRange("integer", 123, null, false).Count(), Is.EqualTo(0)); + } + + [Test] + public void ShouldNotIncludeUpperBoudary() { + _provider.CreateIndex("default"); + _provider.Store("default", _provider.New(1).Add("string", "foo")); + _provider.Store("default", _provider.New(2).Add("date", new DateTime(2010, 05, 28, 12, 30, 30))); + _provider.Store("default", _provider.New(3).Add("number", 123.456)); + _provider.Store("default", _provider.New(4).Add("integer", 123)); + + Assert.That(SearchBuilder.WithinRange("string", null, "foo", true, false).Count(), Is.EqualTo(0)); + Assert.That(SearchBuilder.WithinRange("date", null, new DateTime(2010, 05, 28, 12, 30, 30), true, false).Count(), Is.EqualTo(0)); + Assert.That(SearchBuilder.WithinRange("number", null, 123.456, true, false).Count(), Is.EqualTo(0)); + Assert.That(SearchBuilder.WithinRange("integer", null, 123, true, false).Count(), Is.EqualTo(0)); + } + } +} diff --git a/src/Orchard.Tests.Modules/Media/Extensions/LongExtensionsTests.cs b/src/Orchard.Tests.Modules/Media/Extensions/LongExtensionsTests.cs index f5590d023bd..e6f79804435 100644 --- a/src/Orchard.Tests.Modules/Media/Extensions/LongExtensionsTests.cs +++ b/src/Orchard.Tests.Modules/Media/Extensions/LongExtensionsTests.cs @@ -1,79 +1,79 @@ -using System.Globalization; -using NUnit.Framework; -using Orchard.Media.Extensions; - -namespace Orchard.Tests.Modules.Media.Extensions { - [TestFixture] - public class LongExtensionsTests { - [Test] - public void BytesAreFriendly() { - long size = 123; - string friendly = size.ToFriendlySizeString(); - Assert.That(friendly, Is.EqualTo("123 B")); - } - - [Test] - public void KilobytesAreFriendly() { - long size = 93845; - string friendly = size.ToFriendlySizeString(); - Assert.That(friendly, Is.EqualTo("92 KB")); - } - - [Test] - public void MegabytesAreFriendly() { - long size = 6593528; - string friendly = size.ToFriendlySizeString(); - - Assert.That(friendly, CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator == "." ? - Is.EqualTo("6.3 MB") : - Is.EqualTo("6,3 MB")); - } - - [Test] - public void GigabytesAreFriendly() { - long size = 46896534657; - string friendly = size.ToFriendlySizeString(); - - Assert.That(friendly, CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator == "." ? - Is.EqualTo("43.68 GB") : - Is.EqualTo("43,68 GB")); - } - - [Test] - public void TerabytesAreFriendly() { - long size = 386594723458690; - string friendly = size.ToFriendlySizeString(); - - Assert.That(friendly, CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator == "." ? - Is.EqualTo("351.606 TB") : - Is.EqualTo("351,606 TB")); - } - - [Test] - public void PetabytesAreSlightlyFriendlyAsTerabytes() { - long size = 56794738495678965; - string friendly = size.ToFriendlySizeString(); - - Assert.That(friendly, CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator == "." ? - Is.EqualTo("51654.514 TB") : - Is.EqualTo("51654,514 TB")); - } - - [Test] - public void VeryLargeSizeDoesNotCauseFailure() { - long size = 5679473849567896593; - string friendly = size.ToFriendlySizeString(); - - Assert.That(friendly, CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator == "." ? - Is.EqualTo("5165451.375 TB") : - Is.EqualTo("5165451,375 TB")); - } - - [Test] - public void NegativeSizeDoesNotCauseFailure(){ - long size = -2598; - string friendly = size.ToFriendlySizeString(); - Assert.That(friendly, Is.EqualTo("-2598 B")); - } - } +using System.Globalization; +using NUnit.Framework; +using Orchard.Media.Extensions; + +namespace Orchard.Tests.Modules.Media.Extensions { + [TestFixture] + public class LongExtensionsTests { + [Test] + public void BytesAreFriendly() { + long size = 123; + string friendly = size.ToFriendlySizeString(); + Assert.That(friendly, Is.EqualTo("123 B")); + } + + [Test] + public void KilobytesAreFriendly() { + long size = 93845; + string friendly = size.ToFriendlySizeString(); + Assert.That(friendly, Is.EqualTo("92 KB")); + } + + [Test] + public void MegabytesAreFriendly() { + long size = 6593528; + string friendly = size.ToFriendlySizeString(); + + Assert.That(friendly, CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator == "." ? + Is.EqualTo("6.3 MB") : + Is.EqualTo("6,3 MB")); + } + + [Test] + public void GigabytesAreFriendly() { + long size = 46896534657; + string friendly = size.ToFriendlySizeString(); + + Assert.That(friendly, CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator == "." ? + Is.EqualTo("43.68 GB") : + Is.EqualTo("43,68 GB")); + } + + [Test] + public void TerabytesAreFriendly() { + long size = 386594723458690; + string friendly = size.ToFriendlySizeString(); + + Assert.That(friendly, CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator == "." ? + Is.EqualTo("351.606 TB") : + Is.EqualTo("351,606 TB")); + } + + [Test] + public void PetabytesAreSlightlyFriendlyAsTerabytes() { + long size = 56794738495678965; + string friendly = size.ToFriendlySizeString(); + + Assert.That(friendly, CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator == "." ? + Is.EqualTo("51654.514 TB") : + Is.EqualTo("51654,514 TB")); + } + + [Test] + public void VeryLargeSizeDoesNotCauseFailure() { + long size = 5679473849567896593; + string friendly = size.ToFriendlySizeString(); + + Assert.That(friendly, CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator == "." ? + Is.EqualTo("5165451.375 TB") : + Is.EqualTo("5165451,375 TB")); + } + + [Test] + public void NegativeSizeDoesNotCauseFailure(){ + long size = -2598; + string friendly = size.ToFriendlySizeString(); + Assert.That(friendly, Is.EqualTo("-2598 B")); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests.Modules/Media/Extensions/MediaHelpersTests.cs b/src/Orchard.Tests.Modules/Media/Extensions/MediaHelpersTests.cs index 2f79419f47a..216e3a3cefe 100644 --- a/src/Orchard.Tests.Modules/Media/Extensions/MediaHelpersTests.cs +++ b/src/Orchard.Tests.Modules/Media/Extensions/MediaHelpersTests.cs @@ -1,22 +1,22 @@ -using NUnit.Framework; -using Orchard.Media.Helpers; - -namespace Orchard.Tests.Modules.Media.Extensions { - [TestFixture] - public class MediaHelpersTests { - [Test] - public void PicturesArePictures() { - Assert.That(MediaHelpers.IsPicture(null, "image.gif"), Is.True); - Assert.That(MediaHelpers.IsPicture(null, "image.jpg"), Is.True); - Assert.That(MediaHelpers.IsPicture(null, "image.jpeg"), Is.True); - Assert.That(MediaHelpers.IsPicture(null, "image.png"), Is.True); - Assert.That(MediaHelpers.IsPicture(null, "image.bmp"), Is.True); - Assert.That(MediaHelpers.IsPicture(null, "image.ico"), Is.True); - } - - [Test] - public void PdfIsNotAPicture() { - Assert.That(MediaHelpers.IsPicture(null, "notanimage.pdf"), Is.False); - } - } -} +using NUnit.Framework; +using Orchard.Media.Helpers; + +namespace Orchard.Tests.Modules.Media.Extensions { + [TestFixture] + public class MediaHelpersTests { + [Test] + public void PicturesArePictures() { + Assert.That(MediaHelpers.IsPicture(null, "image.gif"), Is.True); + Assert.That(MediaHelpers.IsPicture(null, "image.jpg"), Is.True); + Assert.That(MediaHelpers.IsPicture(null, "image.jpeg"), Is.True); + Assert.That(MediaHelpers.IsPicture(null, "image.png"), Is.True); + Assert.That(MediaHelpers.IsPicture(null, "image.bmp"), Is.True); + Assert.That(MediaHelpers.IsPicture(null, "image.ico"), Is.True); + } + + [Test] + public void PdfIsNotAPicture() { + Assert.That(MediaHelpers.IsPicture(null, "notanimage.pdf"), Is.False); + } + } +} diff --git a/src/Orchard.Tests.Modules/Media/Services/MediaServiceTests.cs b/src/Orchard.Tests.Modules/Media/Services/MediaServiceTests.cs index cf3e309a0c0..2a546061ff8 100644 --- a/src/Orchard.Tests.Modules/Media/Services/MediaServiceTests.cs +++ b/src/Orchard.Tests.Modules/Media/Services/MediaServiceTests.cs @@ -1,322 +1,322 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Ionic.Zip; -using NUnit.Framework; -using Orchard.Environment.Configuration; -using Orchard.FileSystems.Media; -using Orchard.Media.Models; -using Orchard.Media.Services; -using Orchard.Tests.Stubs; -using Orchard.Tests.UI.Navigation; - -namespace Orchard.Tests.Modules.Media.Services { - [TestFixture] - public class MediaServiceTests { - private const string FolderName1 = "Folder1"; - private const string FolderName2 = "Folder2"; - private const string FolderName3 = "Folder3"; - private const string FolderRecipeJournal = "RecipeJournal"; - - private const string InnerDirectory = "MyDir"; - - private const string TextFileName = "File1.txt"; - private const string PaddedTextFileName = " File2.txt"; - private const string FinalDottedTextFileName = "file2.txt."; - private const string WebconfigFileName = "web.config"; - private const string PaddedWebconfigFileName = " web.config"; - private const string FinalDottedWebconfigFileName = "web.config."; - private const string DllFileName = "test.dll"; - private const string ZipFileName = "test.zip"; - private const string NoExtensionFileName = "test"; - - private const string MediaFolder = "Media"; - - private StubOrchardServices OrchardServices { get; set; } - private StubStorageProvider StorageProvider { get; set; } - private MediaServiceAccessor MediaService { get; set; } - - [SetUp] - public void Setup() { - OrchardServices = new StubOrchardServices(); - StorageProvider = new StubStorageProvider(new ShellSettings { Name = ShellSettings.DefaultName }); - MediaService = new MediaServiceAccessor(StorageProvider, OrchardServices); - } - - [Test] - public void GetPublicUrlTests() { - Assert.That(() => MediaService.GetPublicUrl(null), Throws.InstanceOf(typeof(ArgumentException)), "null relative path is invalid"); - Assert.That(MediaService.GetPublicUrl(TextFileName), Is.EqualTo(string.Format("/{0}/{1}/{2}", MediaFolder, ShellSettings.DefaultName, TextFileName)), "base path file"); - Assert.That(MediaService.GetPublicUrl(string.Format("{0}/{1}", InnerDirectory, TextFileName)), Is.EqualTo(string.Format("/{0}/{1}/{2}/{3}", MediaFolder, ShellSettings.DefaultName, InnerDirectory, TextFileName)), "file within directory"); - } - - [Test] - public void GetMediaFoldersTest() { - StorageProvider.ListFoldersPredicate = path => { - return string.IsNullOrEmpty(path) - ? new[] {new StubStorageFolder(FolderName1)} - : string.Equals(path, FolderName1) - ? new[] {new StubStorageFolder(FolderName2), new StubStorageFolder(FolderName3)} - : string.Equals(path, FolderRecipeJournal) ? new[] { new StubStorageFolder(FolderRecipeJournal), new StubStorageFolder(FolderName1) } : new StubStorageFolder[] { }; - }; - - IEnumerable mediaFolders = MediaService.GetMediaFolders(null); - Assert.That(mediaFolders.Count(), Is.EqualTo(1), "Root path only has 1 sub directory"); - Assert.That(mediaFolders.FirstOrDefault(mediaFolder => mediaFolder.Name.Equals(FolderName1)), Is.Not.Null, "Correct sub directory in root path"); - - mediaFolders = MediaService.GetMediaFolders(FolderName3); - Assert.That(mediaFolders.Count(), Is.EqualTo(0), "Invalid folder path has 0 sub directories"); - - mediaFolders = MediaService.GetMediaFolders(FolderName1); - Assert.That(mediaFolders.Count(), Is.EqualTo(2), "Folder1 has 2 sub directories"); - Assert.That(mediaFolders.FirstOrDefault(mediaFolder => mediaFolder.Name.Equals(FolderName2)), Is.Not.Null, "Correct sub directory in root path"); - Assert.That(mediaFolders.FirstOrDefault(mediaFolder => mediaFolder.Name.Equals(FolderName3)), Is.Not.Null, "Correct sub directory in root path"); - - mediaFolders = MediaService.GetMediaFolders(FolderRecipeJournal); - Assert.That(mediaFolders.Count(), Is.EqualTo(1), "Folder that contains RecipeJournal hides the RecipeJournal directory."); - Assert.That(mediaFolders.FirstOrDefault(mediaFolder => mediaFolder.Name.Equals(FolderName1)), Is.Not.Null, "Correct sub directory in root path"); - } - - [Test] - public void UnzipMediaFileArchiveNotNullParametersTest() { - // Test basic parameter validation - Assert.That(() => MediaService.UnzipMediaFileArchiveAccessor(null, new MemoryStream()), Throws.InstanceOf(typeof(ArgumentException))); - Assert.That(() => MediaService.UnzipMediaFileArchiveAccessor(FolderName1, null), Throws.InstanceOf(typeof(ArgumentException))); - } - - [Test] - public void UnzipMediaFileArchiveAdministratorTest() { - // Test unzip some valid and invalid files as an administrator user - StorageProvider.SavedStreams.Clear(); - StubWorkContextAccessor.WorkContextImpl.StubSite.DefaultSuperUser = OrchardServices.WorkContext.CurrentUser.UserName; - - MediaService.UnzipMediaFileArchiveAccessor(FolderName1, CreateZipMemoryStream()); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, TextFileName)), Is.True, "text files are allowed for super users"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, PaddedTextFileName)), Is.True, "padded text files are allowed for super users"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, DllFileName)), Is.True, "dll files are allowed for super users"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, ZipFileName)), Is.False, "Recursive zip archive files are not allowed"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, WebconfigFileName)), Is.False, "web.config files are never allowed"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, NoExtensionFileName)), Is.False, "no extension files are never allowed"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, FinalDottedWebconfigFileName)), Is.False, "no extension files are never allowed"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, PaddedWebconfigFileName)), Is.False, "no extension files are never allowed"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, FinalDottedTextFileName)), Is.False, "no extension files are never allowed"); - - Assert.That(StorageProvider.SavedStreams.Count, Is.EqualTo(3)); - } - - [Test] - public void UnzipMediaFileArchiveNonAdministratorNoWhitelistTest() { - // Test unzip some files as a non administrator user and without a white list (everything should be rejected by default) - StorageProvider.SavedStreams.Clear(); - StubWorkContextAccessor.WorkContextImpl.StubSite.DefaultSuperUser = "myuser"; - - MediaService.UnzipMediaFileArchiveAccessor(FolderName1, CreateZipMemoryStream()); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, TextFileName)), Is.False, "text files are not allowed by default for non super users"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, DllFileName)), Is.False, "dll files are not allowed by default for non super users"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, ZipFileName)), Is.False, "Recursive zip archive files are not allowed"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, WebconfigFileName)), Is.False, "web.config files are never allowed"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, NoExtensionFileName)), Is.False, "no extension files are never allowed"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, FinalDottedWebconfigFileName)), Is.False, "no extension files are never allowed"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, PaddedWebconfigFileName)), Is.False, "no extension files are never allowed"); - Assert.That(StorageProvider.SavedStreams.Count, Is.EqualTo(0)); - } - - [Test] - public void UnzipMediaFileArchiveNonAdministratorWhitelistTest() { - // Test unzip some files as a non administrator user but with a white list - StorageProvider.SavedStreams.Clear(); - StubWorkContextAccessor.WorkContextImpl.StubSite.DefaultSuperUser = "myuser"; - - MediaSettingsPart mediaSettingsPart = new MediaSettingsPart { - Record = new MediaSettingsPartRecord { UploadAllowedFileTypeWhitelist = "txt dll config" } - }; - - StubWorkContextAccessor.WorkContextImpl._initMethod = workContext => { - workContext.CurrentSite.ContentItem.Weld(mediaSettingsPart); - }; - - MediaService.UnzipMediaFileArchiveAccessor(FolderName1, CreateZipMemoryStream()); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, TextFileName)), Is.True, "text files are allowed by the white list for non super users"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, PaddedTextFileName)), Is.True, "padded text files are allowed for super users"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, DllFileName)), Is.True, "dll files are allowed by the white list for non super users"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, ZipFileName)), Is.False, "Recursive zip archive files are not allowed"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, WebconfigFileName)), Is.False, "web.config files are never allowed even if config extensions are"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, NoExtensionFileName)), Is.False, "no extension files are never allowed"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, FinalDottedWebconfigFileName)), Is.False, "no extension files are never allowed"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, FinalDottedTextFileName)), Is.False, "no extension files are never allowed"); - Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, PaddedWebconfigFileName)), Is.False, "no extension files are never allowed"); - Assert.That(StorageProvider.SavedStreams.Count, Is.EqualTo(3)); - } - - [Test] - public void WebConfigIsBlackListed() { - StorageProvider.SavedStreams.Clear(); - StubWorkContextAccessor.WorkContextImpl.StubSite.DefaultSuperUser = "myuser"; - - MediaSettingsPart mediaSettingsPart = new MediaSettingsPart { - Record = new MediaSettingsPartRecord { UploadAllowedFileTypeWhitelist = "txt dll config" } - }; - - StubWorkContextAccessor.WorkContextImpl._initMethod = workContext => { - workContext.CurrentSite.ContentItem.Weld(mediaSettingsPart); - }; - - Assert.That(MediaService.FileAllowedAccessor("web.config", true), Is.False); - Assert.That(MediaService.FileAllowedAccessor("dummy/web.config", true), Is.False); - } - - private MemoryStream CreateZipMemoryStream() { - // Setup memory stream with zip archive for more complex scenarios - MemoryStream memoryStream = new MemoryStream(); - using (ZipFile zipOut = new ZipFile()) { - - zipOut.AddEntry(TextFileName, new byte[] { 0x01 }); - zipOut.AddEntry(WebconfigFileName, new byte[] { 0x02 }); - zipOut.AddEntry(DllFileName, new byte[] { 0x03 }); - zipOut.AddEntry(ZipFileName, new byte[] { 0x04 }); - zipOut.AddEntry(NoExtensionFileName, new byte[] { 0x05 }); - zipOut.AddEntry(PaddedWebconfigFileName, new byte[] { 0x06 }); - zipOut.AddEntry(FinalDottedWebconfigFileName, new byte[] { 0x07 }); - zipOut.AddEntry(PaddedTextFileName, new byte[] { 0x08 }); - zipOut.AddEntry(FinalDottedTextFileName, new byte[] { 0x09 }); - - zipOut.Save(memoryStream); - } - - return new MemoryStream(memoryStream.ToArray()); - } - - private class MediaServiceAccessor : MediaService { - public MediaServiceAccessor(IStorageProvider storageProvider, IOrchardServices orchardServices) - : base (storageProvider, orchardServices) {} - - public void UnzipMediaFileArchiveAccessor(string targetFolder, Stream zipStream) { - UnzipMediaFileArchive(targetFolder, zipStream); - } - - public bool FileAllowedAccessor(string fileName, bool allowZip) { - return FileAllowed(fileName, allowZip); - } - } - - private class StubStorageProvider : IStorageProvider { - private FileSystemStorageProvider FileSystemStorageProvider { get; set; } - public Func> ListFoldersPredicate { get; set; } - public List SavedStreams { get; set; } - - public StubStorageProvider(ShellSettings settings) { - FileSystemStorageProvider = new FileSystemStorageProvider(settings); - SavedStreams = new List(); - } - - public bool FileExists(string path) { - throw new NotImplementedException(); - } - - public string GetPublicUrl(string path) { - return FileSystemStorageProvider.GetPublicUrl(path); - } - - public string GetStoragePath(string url) { - throw new NotImplementedException(); - } - - public IStorageFile GetFile(string path) { - throw new NotImplementedException(); - } - - public IEnumerable ListFiles(string path) { - throw new NotImplementedException(); - } - - public bool FolderExists(string path) { - throw new NotImplementedException(); - } - - public IEnumerable ListFolders(string path) { - return ListFoldersPredicate(path); - } - - public bool TryCreateFolder(string path) { - return false; - } - - public void CreateFolder(string path) { - } - - public void DeleteFolder(string path) { - } - - public void RenameFolder(string path, string newPath) { - } - - public void DeleteFile(string path) { - } - - public void RenameFile(string path, string newPath) { - } - - public void CopyFile(string originalPath, string duplicatePath) { - } - - public IStorageFile CreateFile(string path) { - throw new NotImplementedException(); - } - - public string Combine(string path1, string path2) { - return FileSystemStorageProvider.Combine(path1, path2); - } - - public bool TrySaveStream(string path, Stream inputStream) { - try { SaveStream(path, inputStream); } - catch { return false; } - - return true; - } - - public void SaveStream(string path, Stream inputStream) { - SavedStreams.Add(path); - } - - - public string GetLocalPath(string url) { - throw new NotImplementedException(); - } - - - public string GetRelativePath(string path) { - throw new NotImplementedException(); - } - } - - private class StubStorageFolder : IStorageFolder { - public string Path { get; set; } - public string Name { get; set; } - - public StubStorageFolder(string name) { - Name = name; - } - - public string GetPath() { - return Path; - } - - public string GetName() { - return Name; - } - - public long GetSize() { - return 0; - } - - public DateTime GetLastUpdated() { - return DateTime.Now; - } - - public IStorageFolder GetParent() { - return new StubStorageFolder(""); - } - } - } -} +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Ionic.Zip; +using NUnit.Framework; +using Orchard.Environment.Configuration; +using Orchard.FileSystems.Media; +using Orchard.Media.Models; +using Orchard.Media.Services; +using Orchard.Tests.Stubs; +using Orchard.Tests.UI.Navigation; + +namespace Orchard.Tests.Modules.Media.Services { + [TestFixture] + public class MediaServiceTests { + private const string FolderName1 = "Folder1"; + private const string FolderName2 = "Folder2"; + private const string FolderName3 = "Folder3"; + private const string FolderRecipeJournal = "RecipeJournal"; + + private const string InnerDirectory = "MyDir"; + + private const string TextFileName = "File1.txt"; + private const string PaddedTextFileName = " File2.txt"; + private const string FinalDottedTextFileName = "file2.txt."; + private const string WebconfigFileName = "web.config"; + private const string PaddedWebconfigFileName = " web.config"; + private const string FinalDottedWebconfigFileName = "web.config."; + private const string DllFileName = "test.dll"; + private const string ZipFileName = "test.zip"; + private const string NoExtensionFileName = "test"; + + private const string MediaFolder = "Media"; + + private StubOrchardServices OrchardServices { get; set; } + private StubStorageProvider StorageProvider { get; set; } + private MediaServiceAccessor MediaService { get; set; } + + [SetUp] + public void Setup() { + OrchardServices = new StubOrchardServices(); + StorageProvider = new StubStorageProvider(new ShellSettings { Name = ShellSettings.DefaultName }); + MediaService = new MediaServiceAccessor(StorageProvider, OrchardServices); + } + + [Test] + public void GetPublicUrlTests() { + Assert.That(() => MediaService.GetPublicUrl(null), Throws.InstanceOf(typeof(ArgumentException)), "null relative path is invalid"); + Assert.That(MediaService.GetPublicUrl(TextFileName), Is.EqualTo(string.Format("/{0}/{1}/{2}", MediaFolder, ShellSettings.DefaultName, TextFileName)), "base path file"); + Assert.That(MediaService.GetPublicUrl(string.Format("{0}/{1}", InnerDirectory, TextFileName)), Is.EqualTo(string.Format("/{0}/{1}/{2}/{3}", MediaFolder, ShellSettings.DefaultName, InnerDirectory, TextFileName)), "file within directory"); + } + + [Test] + public void GetMediaFoldersTest() { + StorageProvider.ListFoldersPredicate = path => { + return string.IsNullOrEmpty(path) + ? new[] {new StubStorageFolder(FolderName1)} + : string.Equals(path, FolderName1) + ? new[] {new StubStorageFolder(FolderName2), new StubStorageFolder(FolderName3)} + : string.Equals(path, FolderRecipeJournal) ? new[] { new StubStorageFolder(FolderRecipeJournal), new StubStorageFolder(FolderName1) } : new StubStorageFolder[] { }; + }; + + IEnumerable mediaFolders = MediaService.GetMediaFolders(null); + Assert.That(mediaFolders.Count(), Is.EqualTo(1), "Root path only has 1 sub directory"); + Assert.That(mediaFolders.FirstOrDefault(mediaFolder => mediaFolder.Name.Equals(FolderName1)), Is.Not.Null, "Correct sub directory in root path"); + + mediaFolders = MediaService.GetMediaFolders(FolderName3); + Assert.That(mediaFolders.Count(), Is.EqualTo(0), "Invalid folder path has 0 sub directories"); + + mediaFolders = MediaService.GetMediaFolders(FolderName1); + Assert.That(mediaFolders.Count(), Is.EqualTo(2), "Folder1 has 2 sub directories"); + Assert.That(mediaFolders.FirstOrDefault(mediaFolder => mediaFolder.Name.Equals(FolderName2)), Is.Not.Null, "Correct sub directory in root path"); + Assert.That(mediaFolders.FirstOrDefault(mediaFolder => mediaFolder.Name.Equals(FolderName3)), Is.Not.Null, "Correct sub directory in root path"); + + mediaFolders = MediaService.GetMediaFolders(FolderRecipeJournal); + Assert.That(mediaFolders.Count(), Is.EqualTo(1), "Folder that contains RecipeJournal hides the RecipeJournal directory."); + Assert.That(mediaFolders.FirstOrDefault(mediaFolder => mediaFolder.Name.Equals(FolderName1)), Is.Not.Null, "Correct sub directory in root path"); + } + + [Test] + public void UnzipMediaFileArchiveNotNullParametersTest() { + // Test basic parameter validation + Assert.That(() => MediaService.UnzipMediaFileArchiveAccessor(null, new MemoryStream()), Throws.InstanceOf(typeof(ArgumentException))); + Assert.That(() => MediaService.UnzipMediaFileArchiveAccessor(FolderName1, null), Throws.InstanceOf(typeof(ArgumentException))); + } + + [Test] + public void UnzipMediaFileArchiveAdministratorTest() { + // Test unzip some valid and invalid files as an administrator user + StorageProvider.SavedStreams.Clear(); + StubWorkContextAccessor.WorkContextImpl.StubSite.DefaultSuperUser = OrchardServices.WorkContext.CurrentUser.UserName; + + MediaService.UnzipMediaFileArchiveAccessor(FolderName1, CreateZipMemoryStream()); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, TextFileName)), Is.True, "text files are allowed for super users"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, PaddedTextFileName)), Is.True, "padded text files are allowed for super users"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, DllFileName)), Is.True, "dll files are allowed for super users"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, ZipFileName)), Is.False, "Recursive zip archive files are not allowed"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, WebconfigFileName)), Is.False, "web.config files are never allowed"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, NoExtensionFileName)), Is.False, "no extension files are never allowed"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, FinalDottedWebconfigFileName)), Is.False, "no extension files are never allowed"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, PaddedWebconfigFileName)), Is.False, "no extension files are never allowed"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, FinalDottedTextFileName)), Is.False, "no extension files are never allowed"); + + Assert.That(StorageProvider.SavedStreams.Count, Is.EqualTo(3)); + } + + [Test] + public void UnzipMediaFileArchiveNonAdministratorNoWhitelistTest() { + // Test unzip some files as a non administrator user and without a white list (everything should be rejected by default) + StorageProvider.SavedStreams.Clear(); + StubWorkContextAccessor.WorkContextImpl.StubSite.DefaultSuperUser = "myuser"; + + MediaService.UnzipMediaFileArchiveAccessor(FolderName1, CreateZipMemoryStream()); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, TextFileName)), Is.False, "text files are not allowed by default for non super users"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, DllFileName)), Is.False, "dll files are not allowed by default for non super users"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, ZipFileName)), Is.False, "Recursive zip archive files are not allowed"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, WebconfigFileName)), Is.False, "web.config files are never allowed"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, NoExtensionFileName)), Is.False, "no extension files are never allowed"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, FinalDottedWebconfigFileName)), Is.False, "no extension files are never allowed"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, PaddedWebconfigFileName)), Is.False, "no extension files are never allowed"); + Assert.That(StorageProvider.SavedStreams.Count, Is.EqualTo(0)); + } + + [Test] + public void UnzipMediaFileArchiveNonAdministratorWhitelistTest() { + // Test unzip some files as a non administrator user but with a white list + StorageProvider.SavedStreams.Clear(); + StubWorkContextAccessor.WorkContextImpl.StubSite.DefaultSuperUser = "myuser"; + + MediaSettingsPart mediaSettingsPart = new MediaSettingsPart { + Record = new MediaSettingsPartRecord { UploadAllowedFileTypeWhitelist = "txt dll config" } + }; + + StubWorkContextAccessor.WorkContextImpl._initMethod = workContext => { + workContext.CurrentSite.ContentItem.Weld(mediaSettingsPart); + }; + + MediaService.UnzipMediaFileArchiveAccessor(FolderName1, CreateZipMemoryStream()); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, TextFileName)), Is.True, "text files are allowed by the white list for non super users"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, PaddedTextFileName)), Is.True, "padded text files are allowed for super users"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, DllFileName)), Is.True, "dll files are allowed by the white list for non super users"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, ZipFileName)), Is.False, "Recursive zip archive files are not allowed"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, WebconfigFileName)), Is.False, "web.config files are never allowed even if config extensions are"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, NoExtensionFileName)), Is.False, "no extension files are never allowed"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, FinalDottedWebconfigFileName)), Is.False, "no extension files are never allowed"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, FinalDottedTextFileName)), Is.False, "no extension files are never allowed"); + Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, PaddedWebconfigFileName)), Is.False, "no extension files are never allowed"); + Assert.That(StorageProvider.SavedStreams.Count, Is.EqualTo(3)); + } + + [Test] + public void WebConfigIsBlackListed() { + StorageProvider.SavedStreams.Clear(); + StubWorkContextAccessor.WorkContextImpl.StubSite.DefaultSuperUser = "myuser"; + + MediaSettingsPart mediaSettingsPart = new MediaSettingsPart { + Record = new MediaSettingsPartRecord { UploadAllowedFileTypeWhitelist = "txt dll config" } + }; + + StubWorkContextAccessor.WorkContextImpl._initMethod = workContext => { + workContext.CurrentSite.ContentItem.Weld(mediaSettingsPart); + }; + + Assert.That(MediaService.FileAllowedAccessor("web.config", true), Is.False); + Assert.That(MediaService.FileAllowedAccessor("dummy/web.config", true), Is.False); + } + + private MemoryStream CreateZipMemoryStream() { + // Setup memory stream with zip archive for more complex scenarios + MemoryStream memoryStream = new MemoryStream(); + using (ZipFile zipOut = new ZipFile()) { + + zipOut.AddEntry(TextFileName, new byte[] { 0x01 }); + zipOut.AddEntry(WebconfigFileName, new byte[] { 0x02 }); + zipOut.AddEntry(DllFileName, new byte[] { 0x03 }); + zipOut.AddEntry(ZipFileName, new byte[] { 0x04 }); + zipOut.AddEntry(NoExtensionFileName, new byte[] { 0x05 }); + zipOut.AddEntry(PaddedWebconfigFileName, new byte[] { 0x06 }); + zipOut.AddEntry(FinalDottedWebconfigFileName, new byte[] { 0x07 }); + zipOut.AddEntry(PaddedTextFileName, new byte[] { 0x08 }); + zipOut.AddEntry(FinalDottedTextFileName, new byte[] { 0x09 }); + + zipOut.Save(memoryStream); + } + + return new MemoryStream(memoryStream.ToArray()); + } + + private class MediaServiceAccessor : MediaService { + public MediaServiceAccessor(IStorageProvider storageProvider, IOrchardServices orchardServices) + : base (storageProvider, orchardServices) {} + + public void UnzipMediaFileArchiveAccessor(string targetFolder, Stream zipStream) { + UnzipMediaFileArchive(targetFolder, zipStream); + } + + public bool FileAllowedAccessor(string fileName, bool allowZip) { + return FileAllowed(fileName, allowZip); + } + } + + private class StubStorageProvider : IStorageProvider { + private FileSystemStorageProvider FileSystemStorageProvider { get; set; } + public Func> ListFoldersPredicate { get; set; } + public List SavedStreams { get; set; } + + public StubStorageProvider(ShellSettings settings) { + FileSystemStorageProvider = new FileSystemStorageProvider(settings); + SavedStreams = new List(); + } + + public bool FileExists(string path) { + throw new NotImplementedException(); + } + + public string GetPublicUrl(string path) { + return FileSystemStorageProvider.GetPublicUrl(path); + } + + public string GetStoragePath(string url) { + throw new NotImplementedException(); + } + + public IStorageFile GetFile(string path) { + throw new NotImplementedException(); + } + + public IEnumerable ListFiles(string path) { + throw new NotImplementedException(); + } + + public bool FolderExists(string path) { + throw new NotImplementedException(); + } + + public IEnumerable ListFolders(string path) { + return ListFoldersPredicate(path); + } + + public bool TryCreateFolder(string path) { + return false; + } + + public void CreateFolder(string path) { + } + + public void DeleteFolder(string path) { + } + + public void RenameFolder(string path, string newPath) { + } + + public void DeleteFile(string path) { + } + + public void RenameFile(string path, string newPath) { + } + + public void CopyFile(string originalPath, string duplicatePath) { + } + + public IStorageFile CreateFile(string path) { + throw new NotImplementedException(); + } + + public string Combine(string path1, string path2) { + return FileSystemStorageProvider.Combine(path1, path2); + } + + public bool TrySaveStream(string path, Stream inputStream) { + try { SaveStream(path, inputStream); } + catch { return false; } + + return true; + } + + public void SaveStream(string path, Stream inputStream) { + SavedStreams.Add(path); + } + + + public string GetLocalPath(string url) { + throw new NotImplementedException(); + } + + + public string GetRelativePath(string path) { + throw new NotImplementedException(); + } + } + + private class StubStorageFolder : IStorageFolder { + public string Path { get; set; } + public string Name { get; set; } + + public StubStorageFolder(string name) { + Name = name; + } + + public string GetPath() { + return Path; + } + + public string GetName() { + return Name; + } + + public long GetSize() { + return 0; + } + + public DateTime GetLastUpdated() { + return DateTime.Now; + } + + public IStorageFolder GetParent() { + return new StubStorageFolder(""); + } + } + } +} diff --git a/src/Orchard.Tests.Modules/Migrations/SchemaCommandGeneratorTests.cs b/src/Orchard.Tests.Modules/Migrations/SchemaCommandGeneratorTests.cs index a562c7fa68b..ef1bcfbe5c4 100644 --- a/src/Orchard.Tests.Modules/Migrations/SchemaCommandGeneratorTests.cs +++ b/src/Orchard.Tests.Modules/Migrations/SchemaCommandGeneratorTests.cs @@ -1,289 +1,289 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Data; -using System.IO; -using System.Linq; -using System.Reflection; -using Autofac; -using Autofac.Features.Metadata; -using NHibernate; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.CodeGeneration.Services; -using Orchard.ContentManagement.Records; -using Orchard.Data; -using Orchard.Data.Conventions; -using Orchard.Data.Migration.Generator; -using Orchard.Data.Migration.Interpreters; -using Orchard.Data.Migration.Schema; -using Orchard.Environment.Configuration; -using Orchard.Environment.Extensions; -using Orchard.Environment.Extensions.Folders; -using Orchard.Environment.Extensions.Loaders; -using Orchard.Environment.Extensions.Models; -using Orchard.Environment.ShellBuilders; -using Orchard.Environment.ShellBuilders.Models; -using Orchard.FileSystems.AppData; -using Orchard.FileSystems.Dependencies; -using Orchard.Tests.ContentManagement; -using Orchard.Data.Providers; -using Orchard.Tests.DataMigration.Utilities; -using Orchard.Tests.FileSystems.AppData; -using Orchard.Tests.Modules.Migrations.Orchard.Tests.DataMigration.Records; -using Path = Bleroy.FluentPath.Path; -using Orchard.Tests.Stubs; -using Orchard.Tests.Environment; -using Orchard.Environment; - -namespace Orchard.Tests.Modules.Migrations { - [TestFixture] - public class SchemaCommandGeneratorTests { - private IContainer _container; - private StubFolders _folders; - private ISchemaCommandGenerator _generator; - private ISessionFactory _sessionFactory; - private ISession _session; - private readonly Path _tempFixtureFolderName = Path.Get(System.IO.Path.GetTempPath()).Combine("Orchard.Tests.Modules.Migrations"); - private Path _tempFolderName; - - [TestFixtureSetUp] - public void CreateDb() { - var types = new[] { - typeof(BlogRecord), - typeof(BodyRecord), - typeof(BlogArchiveRecord), - typeof(ContentItemVersionRecord), - typeof(ContentItemRecord), - typeof(ContentTypeRecord)}; - - _tempFolderName = _tempFixtureFolderName.Combine(System.IO.Path.GetRandomFileName()); - try { - _tempFixtureFolderName.Delete(true); - } catch {} - _tempFixtureFolderName.CreateDirectory(); - _sessionFactory = DataUtility.CreateSessionFactory( - _tempFolderName, types); - - var builder = new ContainerBuilder(); - _folders = new StubFolders(); - - var manager = (IDataServicesProviderFactory)new DataServicesProviderFactory(new[] { - new Meta( - (dataFolder, connectionString) => new SqlCeDataServicesProvider(dataFolder, connectionString), - new Dictionary {{"ProviderName", "SqlCe"}}) - }); - - builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataTablePrefix = "TEST", DataProvider = "SqlCe" }); - builder.RegisterInstance(AppDataFolderTests.CreateAppDataFolder(_tempFixtureFolderName)).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(manager).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(_folders).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - _session = _sessionFactory.OpenSession(); - builder.RegisterInstance(new TestTransactionManager(_session)).As(); - - builder.RegisterInstance(new ShellBlueprint()); - - _container = builder.Build(); - _generator = _container.Resolve(); - - _folders.Manifests.Add("Feature1", @" -Name: Module1 -Version: 0.1 -OrchardVersion: 1 -Features: - Feature1: - Description: Feature -"); - } - - [TestFixtureTearDown] - public void Term() { - try { _tempFixtureFolderName.Delete(true); } - catch { } - } - - public class StubFolders : IExtensionFolders { - public StubFolders() { - Manifests = new Dictionary(); - } - - public IDictionary Manifests { get; set; } - - public IEnumerable AvailableExtensions() { - foreach (var e in Manifests) { - string name = e.Key; - yield return ExtensionHarvester.GetDescriptorForExtension("~/", name, DefaultExtensionTypes.Module, Manifests[name]); - } - } - } - - public class StubLoaders : IExtensionLoader { - #region Implementation of IExtensionLoader - - public int Order { - get { return 1; } - } - - public string Name { - get { return this.GetType().Name; } - } - - public Assembly LoadReference(DependencyReferenceDescriptor reference) { - throw new NotImplementedException(); - } - - public void ReferenceActivated(ExtensionLoadingContext context, ExtensionReferenceProbeEntry referenceEntry) { - throw new NotImplementedException(); - } - - public void ReferenceDeactivated(ExtensionLoadingContext context, ExtensionReferenceProbeEntry referenceEntry) { - throw new NotImplementedException(); - } - - public bool IsCompatibleWithModuleReferences(ExtensionDescriptor extension, IEnumerable references) { - throw new NotImplementedException(); - } - - public ExtensionProbeEntry Probe(ExtensionDescriptor descriptor) { - return new ExtensionProbeEntry { Descriptor = descriptor, Loader = this }; - } - - public IEnumerable ProbeReferences(ExtensionDescriptor extensionDescriptor) { - throw new NotImplementedException(); - } - - public ExtensionEntry Load(ExtensionDescriptor descriptor) { - return new ExtensionEntry { Descriptor = descriptor, ExportedTypes = new[] { typeof(BlogRecord), typeof(BodyRecord), typeof(BlogArchiveRecord) } }; - } - - public void ExtensionActivated(ExtensionLoadingContext ctx, ExtensionDescriptor extension) { - throw new NotImplementedException(); - } - - public void ExtensionDeactivated(ExtensionLoadingContext ctx, ExtensionDescriptor extension) { - throw new NotImplementedException(); - } - - public void ExtensionRemoved(ExtensionLoadingContext ctx, DependencyDescriptor dependency) { - throw new NotImplementedException(); - } - - public void Monitor(ExtensionDescriptor extension, Action monitor) { - } - - public IEnumerable GetCompilationReferences(DependencyDescriptor dependency) { - throw new NotImplementedException(); - } - - public IEnumerable GetVirtualPathDependencies(DependencyDescriptor dependency) { - throw new NotImplementedException(); - } - - #endregion - } - - [Test] - public void ShouldCreateCreateTableCommands() { - var commands = _generator.GetCreateFeatureCommands("Feature1", false).ToList(); - Assert.That(commands, Is.Not.Null); - Assert.That(commands.Count(), Is.EqualTo(3)); - - var blogRecord = commands.Where(c => c.Name == "TEST_Feature1_BlogRecord").First(); - - Assert.That(blogRecord.TableCommands.OfType().Any(c => c.ColumnName == "Id" && !c.IsIdentity && c.IsPrimaryKey && c.DbType == DbType.Int32)); - Assert.That(blogRecord.TableCommands.OfType().Any(c => c.ColumnName == "Description" && c.DbType == DbType.String)); - Assert.That(blogRecord.TableCommands.OfType().Any(c => c.ColumnName == "PostCount" && c.DbType == DbType.Int32)); - - var blogArchiveRecord = commands.Where(c => c.Name == "TEST_Feature1_BlogArchiveRecord").First(); - Assert.That(blogArchiveRecord.TableCommands.OfType().Any(c => c.ColumnName == "Id" && c.IsPrimaryKey && c.DbType == DbType.Int32)); - Assert.That(blogArchiveRecord.TableCommands.OfType().Any(c => c.ColumnName == "Year" && c.DbType == DbType.Int32)); - Assert.That(blogArchiveRecord.TableCommands.OfType().Any(c => c.ColumnName == "Month" && c.DbType == DbType.Int32)); - Assert.That(blogArchiveRecord.TableCommands.OfType().Any(c => c.ColumnName == "PostCount" && c.DbType == DbType.Int32)); - Assert.That(blogArchiveRecord.TableCommands.OfType().Any(c => c.ColumnName == "Blog_id" && c.DbType == DbType.Int32)); - - var bodyRecord = commands.Where(c => c.Name == "TEST_Feature1_BodyRecord").First(); - Assert.That(bodyRecord.TableCommands.OfType().Any(c => c.ColumnName == "Id" && c.IsPrimaryKey && c.DbType == DbType.Int32)); - Assert.That(bodyRecord.TableCommands.OfType().Any(c => c.ColumnName == "Text" && c.DbType == DbType.String && c.Length == 10000)); - Assert.That(bodyRecord.TableCommands.OfType().Any(c => c.ColumnName == "Format" && c.DbType == DbType.String && c.Length == 42)); - Assert.That(bodyRecord.TableCommands.OfType().Any(c => c.ColumnName == "ContentItemRecord_id" && c.DbType == DbType.Int32)); - } - - [Test] - public void ScaffoldingCommandInterpreterShouldDetectContentParts() { - - var commands = _generator.GetCreateFeatureCommands("Feature1", false).ToList(); - Assert.That(commands, Is.Not.Null); - Assert.That(commands.Count(), Is.EqualTo(3)); - - var sw = new StringWriter(); - var interpreter = new CodeGenerationCommandInterpreter(sw); - - var blogRecord = commands.Where(c => c.Name == "TEST_Feature1_BlogRecord").First(); - var blogArchiveRecord = commands.Where(c => c.Name == "TEST_Feature1_BlogArchiveRecord").First(); - var bodyRecord = commands.Where(c => c.Name == "TEST_Feature1_BodyRecord").First(); - - sw.GetStringBuilder().Clear(); - interpreter.Visit(blogRecord); - Assert.That(sw.ToString().Contains("SchemaBuilder.CreateTable(\"TEST_Feature1_BlogRecord")); - Assert.That(sw.ToString().Contains(".ContentPartRecord()")); - Assert.That(sw.ToString().Contains(".Column(\"Description\", DbType.String)")); - Assert.That(sw.ToString().Contains(".Column(\"PostCount\", DbType.Int32)")); - - sw.GetStringBuilder().Clear(); - interpreter.Visit(blogArchiveRecord); - Assert.That(sw.ToString().Contains("SchemaBuilder.CreateTable(\"TEST_Feature1_BlogArchiveRecord")); - Assert.That(sw.ToString().Contains(".Column(\"Id\", DbType.Int32, column => column.PrimaryKey().Identity())")); - Assert.That(sw.ToString().Contains(".Column(\"Year\", DbType.Int32)")); - Assert.That(sw.ToString().Contains(".Column(\"Month\", DbType.Int32)")); - Assert.That(sw.ToString().Contains(".Column(\"PostCount\", DbType.Int32)")); - Assert.That(sw.ToString().Contains(".Column(\"Blog_id\", DbType.Int32)")); - - sw.GetStringBuilder().Clear(); - interpreter.Visit(bodyRecord); - Assert.That(sw.ToString().Contains("SchemaBuilder.CreateTable(\"TEST_Feature1_BodyRecord")); - Assert.That(sw.ToString().Contains(".ContentPartVersionRecord()")); - Assert.That(sw.ToString().Contains(".Column(\"Text\", DbType.String, column => column.Unlimited())")); - Assert.That(sw.ToString().Contains(".Column(\"Format\", DbType.String, column => column.WithLength(42))")); - Assert.That(!sw.ToString().Contains("ContentItemRecord_id")); - } - } - - - // namespace is needed as the shell composition strategy will filter records using it also - namespace Orchard.Tests.DataMigration.Records { - public class BlogRecord : ContentPartRecord { - public virtual string Description { get; set; } - public virtual int PostCount { get; set; } - } - - public class BodyRecord : ContentPartVersionRecord { - [StringLengthMax] - public virtual string Text { get; set; } - [StringLength(42)] - public virtual string Format { get; set; } - } - - public class BlogArchiveRecord { - public virtual int Id { get; set; } - public virtual BlogRecord Blog { get; set; } - public virtual int Year { get; set; } - public virtual int Month { get; set; } - public virtual int PostCount { get; set; } - } - } -} +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Data; +using System.IO; +using System.Linq; +using System.Reflection; +using Autofac; +using Autofac.Features.Metadata; +using NHibernate; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.CodeGeneration.Services; +using Orchard.ContentManagement.Records; +using Orchard.Data; +using Orchard.Data.Conventions; +using Orchard.Data.Migration.Generator; +using Orchard.Data.Migration.Interpreters; +using Orchard.Data.Migration.Schema; +using Orchard.Environment.Configuration; +using Orchard.Environment.Extensions; +using Orchard.Environment.Extensions.Folders; +using Orchard.Environment.Extensions.Loaders; +using Orchard.Environment.Extensions.Models; +using Orchard.Environment.ShellBuilders; +using Orchard.Environment.ShellBuilders.Models; +using Orchard.FileSystems.AppData; +using Orchard.FileSystems.Dependencies; +using Orchard.Tests.ContentManagement; +using Orchard.Data.Providers; +using Orchard.Tests.DataMigration.Utilities; +using Orchard.Tests.FileSystems.AppData; +using Orchard.Tests.Modules.Migrations.Orchard.Tests.DataMigration.Records; +using Path = Bleroy.FluentPath.Path; +using Orchard.Tests.Stubs; +using Orchard.Tests.Environment; +using Orchard.Environment; + +namespace Orchard.Tests.Modules.Migrations { + [TestFixture] + public class SchemaCommandGeneratorTests { + private IContainer _container; + private StubFolders _folders; + private ISchemaCommandGenerator _generator; + private ISessionFactory _sessionFactory; + private ISession _session; + private readonly Path _tempFixtureFolderName = Path.Get(System.IO.Path.GetTempPath()).Combine("Orchard.Tests.Modules.Migrations"); + private Path _tempFolderName; + + [TestFixtureSetUp] + public void CreateDb() { + var types = new[] { + typeof(BlogRecord), + typeof(BodyRecord), + typeof(BlogArchiveRecord), + typeof(ContentItemVersionRecord), + typeof(ContentItemRecord), + typeof(ContentTypeRecord)}; + + _tempFolderName = _tempFixtureFolderName.Combine(System.IO.Path.GetRandomFileName()); + try { + _tempFixtureFolderName.Delete(true); + } catch {} + _tempFixtureFolderName.CreateDirectory(); + _sessionFactory = DataUtility.CreateSessionFactory( + _tempFolderName, types); + + var builder = new ContainerBuilder(); + _folders = new StubFolders(); + + var manager = (IDataServicesProviderFactory)new DataServicesProviderFactory(new[] { + new Meta( + (dataFolder, connectionString) => new SqlCeDataServicesProvider(dataFolder, connectionString), + new Dictionary {{"ProviderName", "SqlCe"}}) + }); + + builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataTablePrefix = "TEST", DataProvider = "SqlCe" }); + builder.RegisterInstance(AppDataFolderTests.CreateAppDataFolder(_tempFixtureFolderName)).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(manager).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(_folders).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + _session = _sessionFactory.OpenSession(); + builder.RegisterInstance(new TestTransactionManager(_session)).As(); + + builder.RegisterInstance(new ShellBlueprint()); + + _container = builder.Build(); + _generator = _container.Resolve(); + + _folders.Manifests.Add("Feature1", @" +Name: Module1 +Version: 0.1 +OrchardVersion: 1 +Features: + Feature1: + Description: Feature +"); + } + + [TestFixtureTearDown] + public void Term() { + try { _tempFixtureFolderName.Delete(true); } + catch { } + } + + public class StubFolders : IExtensionFolders { + public StubFolders() { + Manifests = new Dictionary(); + } + + public IDictionary Manifests { get; set; } + + public IEnumerable AvailableExtensions() { + foreach (var e in Manifests) { + string name = e.Key; + yield return ExtensionHarvester.GetDescriptorForExtension("~/", name, DefaultExtensionTypes.Module, Manifests[name]); + } + } + } + + public class StubLoaders : IExtensionLoader { + #region Implementation of IExtensionLoader + + public int Order { + get { return 1; } + } + + public string Name { + get { return this.GetType().Name; } + } + + public Assembly LoadReference(DependencyReferenceDescriptor reference) { + throw new NotImplementedException(); + } + + public void ReferenceActivated(ExtensionLoadingContext context, ExtensionReferenceProbeEntry referenceEntry) { + throw new NotImplementedException(); + } + + public void ReferenceDeactivated(ExtensionLoadingContext context, ExtensionReferenceProbeEntry referenceEntry) { + throw new NotImplementedException(); + } + + public bool IsCompatibleWithModuleReferences(ExtensionDescriptor extension, IEnumerable references) { + throw new NotImplementedException(); + } + + public ExtensionProbeEntry Probe(ExtensionDescriptor descriptor) { + return new ExtensionProbeEntry { Descriptor = descriptor, Loader = this }; + } + + public IEnumerable ProbeReferences(ExtensionDescriptor extensionDescriptor) { + throw new NotImplementedException(); + } + + public ExtensionEntry Load(ExtensionDescriptor descriptor) { + return new ExtensionEntry { Descriptor = descriptor, ExportedTypes = new[] { typeof(BlogRecord), typeof(BodyRecord), typeof(BlogArchiveRecord) } }; + } + + public void ExtensionActivated(ExtensionLoadingContext ctx, ExtensionDescriptor extension) { + throw new NotImplementedException(); + } + + public void ExtensionDeactivated(ExtensionLoadingContext ctx, ExtensionDescriptor extension) { + throw new NotImplementedException(); + } + + public void ExtensionRemoved(ExtensionLoadingContext ctx, DependencyDescriptor dependency) { + throw new NotImplementedException(); + } + + public void Monitor(ExtensionDescriptor extension, Action monitor) { + } + + public IEnumerable GetCompilationReferences(DependencyDescriptor dependency) { + throw new NotImplementedException(); + } + + public IEnumerable GetVirtualPathDependencies(DependencyDescriptor dependency) { + throw new NotImplementedException(); + } + + #endregion + } + + [Test] + public void ShouldCreateCreateTableCommands() { + var commands = _generator.GetCreateFeatureCommands("Feature1", false).ToList(); + Assert.That(commands, Is.Not.Null); + Assert.That(commands.Count(), Is.EqualTo(3)); + + var blogRecord = commands.Where(c => c.Name == "TEST_Feature1_BlogRecord").First(); + + Assert.That(blogRecord.TableCommands.OfType().Any(c => c.ColumnName == "Id" && !c.IsIdentity && c.IsPrimaryKey && c.DbType == DbType.Int32)); + Assert.That(blogRecord.TableCommands.OfType().Any(c => c.ColumnName == "Description" && c.DbType == DbType.String)); + Assert.That(blogRecord.TableCommands.OfType().Any(c => c.ColumnName == "PostCount" && c.DbType == DbType.Int32)); + + var blogArchiveRecord = commands.Where(c => c.Name == "TEST_Feature1_BlogArchiveRecord").First(); + Assert.That(blogArchiveRecord.TableCommands.OfType().Any(c => c.ColumnName == "Id" && c.IsPrimaryKey && c.DbType == DbType.Int32)); + Assert.That(blogArchiveRecord.TableCommands.OfType().Any(c => c.ColumnName == "Year" && c.DbType == DbType.Int32)); + Assert.That(blogArchiveRecord.TableCommands.OfType().Any(c => c.ColumnName == "Month" && c.DbType == DbType.Int32)); + Assert.That(blogArchiveRecord.TableCommands.OfType().Any(c => c.ColumnName == "PostCount" && c.DbType == DbType.Int32)); + Assert.That(blogArchiveRecord.TableCommands.OfType().Any(c => c.ColumnName == "Blog_id" && c.DbType == DbType.Int32)); + + var bodyRecord = commands.Where(c => c.Name == "TEST_Feature1_BodyRecord").First(); + Assert.That(bodyRecord.TableCommands.OfType().Any(c => c.ColumnName == "Id" && c.IsPrimaryKey && c.DbType == DbType.Int32)); + Assert.That(bodyRecord.TableCommands.OfType().Any(c => c.ColumnName == "Text" && c.DbType == DbType.String && c.Length == 10000)); + Assert.That(bodyRecord.TableCommands.OfType().Any(c => c.ColumnName == "Format" && c.DbType == DbType.String && c.Length == 42)); + Assert.That(bodyRecord.TableCommands.OfType().Any(c => c.ColumnName == "ContentItemRecord_id" && c.DbType == DbType.Int32)); + } + + [Test] + public void ScaffoldingCommandInterpreterShouldDetectContentParts() { + + var commands = _generator.GetCreateFeatureCommands("Feature1", false).ToList(); + Assert.That(commands, Is.Not.Null); + Assert.That(commands.Count(), Is.EqualTo(3)); + + var sw = new StringWriter(); + var interpreter = new CodeGenerationCommandInterpreter(sw); + + var blogRecord = commands.Where(c => c.Name == "TEST_Feature1_BlogRecord").First(); + var blogArchiveRecord = commands.Where(c => c.Name == "TEST_Feature1_BlogArchiveRecord").First(); + var bodyRecord = commands.Where(c => c.Name == "TEST_Feature1_BodyRecord").First(); + + sw.GetStringBuilder().Clear(); + interpreter.Visit(blogRecord); + Assert.That(sw.ToString().Contains("SchemaBuilder.CreateTable(\"TEST_Feature1_BlogRecord")); + Assert.That(sw.ToString().Contains(".ContentPartRecord()")); + Assert.That(sw.ToString().Contains(".Column(\"Description\", DbType.String)")); + Assert.That(sw.ToString().Contains(".Column(\"PostCount\", DbType.Int32)")); + + sw.GetStringBuilder().Clear(); + interpreter.Visit(blogArchiveRecord); + Assert.That(sw.ToString().Contains("SchemaBuilder.CreateTable(\"TEST_Feature1_BlogArchiveRecord")); + Assert.That(sw.ToString().Contains(".Column(\"Id\", DbType.Int32, column => column.PrimaryKey().Identity())")); + Assert.That(sw.ToString().Contains(".Column(\"Year\", DbType.Int32)")); + Assert.That(sw.ToString().Contains(".Column(\"Month\", DbType.Int32)")); + Assert.That(sw.ToString().Contains(".Column(\"PostCount\", DbType.Int32)")); + Assert.That(sw.ToString().Contains(".Column(\"Blog_id\", DbType.Int32)")); + + sw.GetStringBuilder().Clear(); + interpreter.Visit(bodyRecord); + Assert.That(sw.ToString().Contains("SchemaBuilder.CreateTable(\"TEST_Feature1_BodyRecord")); + Assert.That(sw.ToString().Contains(".ContentPartVersionRecord()")); + Assert.That(sw.ToString().Contains(".Column(\"Text\", DbType.String, column => column.Unlimited())")); + Assert.That(sw.ToString().Contains(".Column(\"Format\", DbType.String, column => column.WithLength(42))")); + Assert.That(!sw.ToString().Contains("ContentItemRecord_id")); + } + } + + + // namespace is needed as the shell composition strategy will filter records using it also + namespace Orchard.Tests.DataMigration.Records { + public class BlogRecord : ContentPartRecord { + public virtual string Description { get; set; } + public virtual int PostCount { get; set; } + } + + public class BodyRecord : ContentPartVersionRecord { + [StringLengthMax] + public virtual string Text { get; set; } + [StringLength(42)] + public virtual string Format { get; set; } + } + + public class BlogArchiveRecord { + public virtual int Id { get; set; } + public virtual BlogRecord Blog { get; set; } + public virtual int Year { get; set; } + public virtual int Month { get; set; } + public virtual int PostCount { get; set; } + } + } +} diff --git a/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj b/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj index 0dd74c332f1..78e90e345ad 100644 --- a/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj +++ b/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj @@ -1,353 +1,353 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6CB3EB30-F725-45C0-9742-42599BA8E8D2} - Library - Properties - Orchard.Tests.Modules - Orchard.Tests.Modules - v4.5.1 - 512 - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - ..\OrchardBasicCorrectness.ruleset - AnyCPU - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - AnyCPU - false - - - - False - ..\..\lib\autofac\Autofac.dll - - - False - ..\..\lib\castle\net45\Castle.Core.dll - - - False - ..\..\lib\nhibernate\FluentNHibernate.dll - - - ..\..\lib\fluentpath\FluentPath.dll - - - False - ..\..\lib\nhibernate\Iesi.Collections.dll - - - ..\..\lib\dotnetzip\Ionic.Zip.dll - - - False - ..\..\lib\dlr\IronRuby.dll - - - ..\..\lib\dlr\IronRuby.Libraries.dll - - - - False - ..\..\lib\dlr\Microsoft.Dynamic.dll - - - False - ..\..\lib\dlr\Microsoft.Scripting.dll - - - False - ..\..\lib\moq\Moq.dll - - - False - ..\..\lib\newtonsoft.json\Newtonsoft.Json.dll - - - False - ..\..\lib\nhibernate\NHibernate.dll - - - False - ..\..\lib\nuget\NuGet.Core.dll - - - False - ..\..\lib\nunit\nunit.framework.dll - - - - - 3.5 - - - ..\..\lib\sqlce\System.Data.SqlServerCe.dll - True - - - - 3.5 - - - - False - ..\..\lib\aspnetmvc\System.Web.Mvc.dll - - - 3.5 - - - 3.5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {ABC826D4-2FA1-4F2F-87DE-E6095F653810} - Orchard.Framework.Tests - - - {9916839C-39FC-4CEB-A5AF-89CA7E87119F} - Orchard.Core - - - {D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D} - Lucene - - - {66fccd76-2761-47e3-8d11-b45d0001ddaa} - Orchard.Autoroute - - - {C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962} - Orchard.CodeGeneration - - - {14C049FD-B35B-415A-A824-87F26B26E7FD} - Orchard.Comments - - - {4A4595EF-6C37-4F99-96ED-4AE0B9E438D3} - Orchard.DesignerTools - - - {05660f47-d649-48bd-9ded-df4e01e7cff9} - Orchard.Email - - - {FE5C5947-D2D5-42C5-992A-13D672946135} - Orchard.ImportExport - - - {EA2B9121-EF54-40A6-A53E-6593C86EE696} - Orchard.Indexing - - - {08191FCD-7258-4F19-95FB-AEC3DE77B2EB} - Orchard.MediaProcessing - - - {D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB} - Orchard.Media - - - {17F86780-9A1F-4AA1-86F1-875EEC2730C7} - Orchard.Modules - - - {DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059} - Orchard.Packaging - - - {FC1D74E8-7A4D-48F4-83DE-95C6173780C4} - Orchard.Recipes - - - {D10AD48F-407D-4DB5-A328-173EC7CB010F} - Orchard.Roles - - - {2AD6973D-C7BB-416E-89FE-EEE34664E05F} - Orchard.Scripting.Dlr - - - {99002B65-86F7-415E-BF4A-381AA8AB9CCC} - Orchard.Scripting - - - {8c7fcbc2-e6e1-405e-bfb5-d8d9e67a09c4} - Orchard.Setup - - - {5D0F00F0-26C9-4785-AD61-B85710C60EB0} - Orchard.Tags - - - {CDE24A24-01D3-403C-84B9-37722E18DFB7} - Orchard.Themes - - - {79aed36e-abd0-4747-93d3-8722b042454b} - Orchard.Users - - - {9CD5C81F-5828-4384-8474-2E2BE71D5EDD} - Orchard.Warmup - - - {194D3CCC-1153-474D-8176-FDE8D7D0D0BD} - Orchard.Widgets - - - {7059493C-8251-4764-9C1E-2368B8B485BC} - Orchard.Workflows - - - {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} - Orchard.Framework - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - - Designer - - - - - - - - - - - - - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {6CB3EB30-F725-45C0-9742-42599BA8E8D2} + Library + Properties + Orchard.Tests.Modules + Orchard.Tests.Modules + v4.5.1 + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + ..\OrchardBasicCorrectness.ruleset + AnyCPU + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + AnyCPU + false + + + + False + ..\..\lib\autofac\Autofac.dll + + + False + ..\..\lib\castle\net45\Castle.Core.dll + + + False + ..\..\lib\nhibernate\FluentNHibernate.dll + + + ..\..\lib\fluentpath\FluentPath.dll + + + False + ..\..\lib\nhibernate\Iesi.Collections.dll + + + ..\..\lib\dotnetzip\Ionic.Zip.dll + + + False + ..\..\lib\dlr\IronRuby.dll + + + ..\..\lib\dlr\IronRuby.Libraries.dll + + + + False + ..\..\lib\dlr\Microsoft.Dynamic.dll + + + False + ..\..\lib\dlr\Microsoft.Scripting.dll + + + False + ..\..\lib\moq\Moq.dll + + + False + ..\..\lib\newtonsoft.json\Newtonsoft.Json.dll + + + False + ..\..\lib\nhibernate\NHibernate.dll + + + False + ..\..\lib\nuget\NuGet.Core.dll + + + False + ..\..\lib\nunit\nunit.framework.dll + + + + + 3.5 + + + ..\..\lib\sqlce\System.Data.SqlServerCe.dll + True + + + + 3.5 + + + + False + ..\..\lib\aspnetmvc\System.Web.Mvc.dll + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {ABC826D4-2FA1-4F2F-87DE-E6095F653810} + Orchard.Framework.Tests + + + {9916839C-39FC-4CEB-A5AF-89CA7E87119F} + Orchard.Core + + + {D5D447D7-EF8E-43A6-B9A4-3B025DD9F45D} + Lucene + + + {66fccd76-2761-47e3-8d11-b45d0001ddaa} + Orchard.Autoroute + + + {C0C45321-B51D-4D8D-9B7B-AA4C2E0B2962} + Orchard.CodeGeneration + + + {14C049FD-B35B-415A-A824-87F26B26E7FD} + Orchard.Comments + + + {4A4595EF-6C37-4F99-96ED-4AE0B9E438D3} + Orchard.DesignerTools + + + {05660f47-d649-48bd-9ded-df4e01e7cff9} + Orchard.Email + + + {FE5C5947-D2D5-42C5-992A-13D672946135} + Orchard.ImportExport + + + {EA2B9121-EF54-40A6-A53E-6593C86EE696} + Orchard.Indexing + + + {08191FCD-7258-4F19-95FB-AEC3DE77B2EB} + Orchard.MediaProcessing + + + {D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB} + Orchard.Media + + + {17F86780-9A1F-4AA1-86F1-875EEC2730C7} + Orchard.Modules + + + {DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059} + Orchard.Packaging + + + {FC1D74E8-7A4D-48F4-83DE-95C6173780C4} + Orchard.Recipes + + + {D10AD48F-407D-4DB5-A328-173EC7CB010F} + Orchard.Roles + + + {2AD6973D-C7BB-416E-89FE-EEE34664E05F} + Orchard.Scripting.Dlr + + + {99002B65-86F7-415E-BF4A-381AA8AB9CCC} + Orchard.Scripting + + + {8c7fcbc2-e6e1-405e-bfb5-d8d9e67a09c4} + Orchard.Setup + + + {5D0F00F0-26C9-4785-AD61-B85710C60EB0} + Orchard.Tags + + + {CDE24A24-01D3-403C-84B9-37722E18DFB7} + Orchard.Themes + + + {79aed36e-abd0-4747-93d3-8722b042454b} + Orchard.Users + + + {9CD5C81F-5828-4384-8474-2E2BE71D5EDD} + Orchard.Warmup + + + {194D3CCC-1153-474D-8176-FDE8D7D0D0BD} + Orchard.Widgets + + + {7059493C-8251-4764-9C1E-2368B8B485BC} + Orchard.Workflows + + + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} + Orchard.Framework + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + + Designer + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Tests.Modules/Packaging/Migrations.cs.txt b/src/Orchard.Tests.Modules/Packaging/Migrations.cs.txt index 0c6c2a98b94..7dd9556c307 100644 --- a/src/Orchard.Tests.Modules/Packaging/Migrations.cs.txt +++ b/src/Orchard.Tests.Modules/Packaging/Migrations.cs.txt @@ -1,9 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Orchard.Tests.Modules.Packaging { - class Migrations { - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Orchard.Tests.Modules.Packaging { + class Migrations { + } +} diff --git a/src/Orchard.Tests.Modules/Packaging/Services/FileBasedProjectSystemTests.cs b/src/Orchard.Tests.Modules/Packaging/Services/FileBasedProjectSystemTests.cs index 85d28763db9..c6bbaf91e8c 100644 --- a/src/Orchard.Tests.Modules/Packaging/Services/FileBasedProjectSystemTests.cs +++ b/src/Orchard.Tests.Modules/Packaging/Services/FileBasedProjectSystemTests.cs @@ -1,107 +1,107 @@ -using System.IO; -using Autofac; -using Moq; -using NuGet; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.Environment; -using Orchard.Environment.Extensions; -using Orchard.Environment.Extensions.Models; -using Orchard.FileSystems.VirtualPath; -using Orchard.FileSystems.WebSite; -using Orchard.Packaging.Services; -using Orchard.Services; -using Orchard.Tests.Stubs; -using Orchard.UI.Notify; -using IPackageBuilder = Orchard.Packaging.Services.IPackageBuilder; -using PackageBuilder = Orchard.Packaging.Services.PackageBuilder; - -namespace Orchard.Tests.Modules.Packaging.Services { - [TestFixture] - public class FileBasedProjectSystemTests : ContainerTestBase { - private const string PackageIdentifier = "Hello.World"; - - private readonly string _basePath = Path.Combine(Path.GetTempPath(), "PackageInstallerTests"); - - private Mock _mockedVirtualPathProvider; - - protected override void Register(ContainerBuilder builder) { - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - _mockedVirtualPathProvider = new Mock(); - builder.RegisterInstance(_mockedVirtualPathProvider.Object).As(); - builder.RegisterType().As(); - builder.RegisterType().As() - .As().InstancePerLifetimeScope(); - builder.RegisterType().As(); - } - - [SetUp] - public override void Init() { - base.Init(); - - if (Directory.Exists(_basePath)) { - Directory.Delete(_basePath, true); - } - - Directory.CreateDirectory(_basePath); - } - - [TestFixtureTearDown] - public void Clean() { - if (Directory.Exists(_basePath)) { - Directory.Delete(_basePath, true); - } - } - - private Stream BuildHelloWorld(IPackageBuilder packageBuilder) { - // add some content because NuGet requires it - var folder = _container.Resolve(); - using (var sourceStream = GetType().Assembly.GetManifestResourceStream(GetType(), "Hello.World.csproj.txt")) { - folder.AddFile("~/Modules/Hello.World/Hello.World.csproj", new StreamReader(sourceStream).ReadToEnd()); - } - - return packageBuilder.BuildPackage(new ExtensionDescriptor { - ExtensionType = DefaultExtensionTypes.Module, - Id = PackageIdentifier, - Version = "1.0", - Description = "a", - Author = "b" - }); - } - - [Test] - public void ValidPathsTest() { - IPackageBuilder packageBuilder = _container.Resolve(); - Stream stream = BuildHelloWorld(packageBuilder); - - string filename = Path.Combine(_basePath, "package.nupkg"); - using (var fileStream = File.Create(filename)) { - stream.CopyTo(fileStream); - } - - ZipPackage zipPackage = new ZipPackage(filename); - IPackageInstaller packageInstaller = _container.Resolve(); - - _mockedVirtualPathProvider.Setup(v => v.MapPath(It.IsAny())) - .Returns(path => Path.Combine(_basePath, path.Replace("~\\", ""))); - - _mockedVirtualPathProvider.Setup(v => v.Combine(It.IsAny())) - .Returns(Path.Combine); - - PackageInfo packageInfo = packageInstaller.Install(zipPackage, _basePath, _basePath); - Assert.That(packageInfo, Is.Not.Null); - Assert.That(Directory.Exists(Path.Combine(_basePath, "Modules/Hello.World"))); - Assert.That(File.Exists(Path.Combine(_basePath, "Modules/Hello.World/Hello.World.csproj"))); - Assert.That(!File.Exists(Path.Combine(_basePath, "Modules/Hello.World/Service%References/SomeReference.cs"))); - Assert.That(File.Exists(Path.Combine(_basePath, "Modules/Hello.World/Service References/SomeReference.cs"))); - } - } -} +using System.IO; +using Autofac; +using Moq; +using NuGet; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.Environment; +using Orchard.Environment.Extensions; +using Orchard.Environment.Extensions.Models; +using Orchard.FileSystems.VirtualPath; +using Orchard.FileSystems.WebSite; +using Orchard.Packaging.Services; +using Orchard.Services; +using Orchard.Tests.Stubs; +using Orchard.UI.Notify; +using IPackageBuilder = Orchard.Packaging.Services.IPackageBuilder; +using PackageBuilder = Orchard.Packaging.Services.PackageBuilder; + +namespace Orchard.Tests.Modules.Packaging.Services { + [TestFixture] + public class FileBasedProjectSystemTests : ContainerTestBase { + private const string PackageIdentifier = "Hello.World"; + + private readonly string _basePath = Path.Combine(Path.GetTempPath(), "PackageInstallerTests"); + + private Mock _mockedVirtualPathProvider; + + protected override void Register(ContainerBuilder builder) { + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + _mockedVirtualPathProvider = new Mock(); + builder.RegisterInstance(_mockedVirtualPathProvider.Object).As(); + builder.RegisterType().As(); + builder.RegisterType().As() + .As().InstancePerLifetimeScope(); + builder.RegisterType().As(); + } + + [SetUp] + public override void Init() { + base.Init(); + + if (Directory.Exists(_basePath)) { + Directory.Delete(_basePath, true); + } + + Directory.CreateDirectory(_basePath); + } + + [TestFixtureTearDown] + public void Clean() { + if (Directory.Exists(_basePath)) { + Directory.Delete(_basePath, true); + } + } + + private Stream BuildHelloWorld(IPackageBuilder packageBuilder) { + // add some content because NuGet requires it + var folder = _container.Resolve(); + using (var sourceStream = GetType().Assembly.GetManifestResourceStream(GetType(), "Hello.World.csproj.txt")) { + folder.AddFile("~/Modules/Hello.World/Hello.World.csproj", new StreamReader(sourceStream).ReadToEnd()); + } + + return packageBuilder.BuildPackage(new ExtensionDescriptor { + ExtensionType = DefaultExtensionTypes.Module, + Id = PackageIdentifier, + Version = "1.0", + Description = "a", + Author = "b" + }); + } + + [Test] + public void ValidPathsTest() { + IPackageBuilder packageBuilder = _container.Resolve(); + Stream stream = BuildHelloWorld(packageBuilder); + + string filename = Path.Combine(_basePath, "package.nupkg"); + using (var fileStream = File.Create(filename)) { + stream.CopyTo(fileStream); + } + + ZipPackage zipPackage = new ZipPackage(filename); + IPackageInstaller packageInstaller = _container.Resolve(); + + _mockedVirtualPathProvider.Setup(v => v.MapPath(It.IsAny())) + .Returns(path => Path.Combine(_basePath, path.Replace("~\\", ""))); + + _mockedVirtualPathProvider.Setup(v => v.Combine(It.IsAny())) + .Returns(Path.Combine); + + PackageInfo packageInfo = packageInstaller.Install(zipPackage, _basePath, _basePath); + Assert.That(packageInfo, Is.Not.Null); + Assert.That(Directory.Exists(Path.Combine(_basePath, "Modules/Hello.World"))); + Assert.That(File.Exists(Path.Combine(_basePath, "Modules/Hello.World/Hello.World.csproj"))); + Assert.That(!File.Exists(Path.Combine(_basePath, "Modules/Hello.World/Service%References/SomeReference.cs"))); + Assert.That(File.Exists(Path.Combine(_basePath, "Modules/Hello.World/Service References/SomeReference.cs"))); + } + } +} diff --git a/src/Orchard.Tests.Modules/Packaging/Services/FolderUpdaterTests.cs b/src/Orchard.Tests.Modules/Packaging/Services/FolderUpdaterTests.cs index 632ad6df017..809f04f8c02 100644 --- a/src/Orchard.Tests.Modules/Packaging/Services/FolderUpdaterTests.cs +++ b/src/Orchard.Tests.Modules/Packaging/Services/FolderUpdaterTests.cs @@ -1,53 +1,53 @@ -using System.IO; -using Autofac; -using Moq; -using NUnit.Framework; -using Orchard.Packaging.Services; -using Orchard.UI.Notify; - -namespace Orchard.Tests.Modules.Packaging.Services { - [TestFixture] - public class FolderUpdaterTests { - protected IContainer _container; - - private readonly string _basePath = Path.Combine(Path.GetTempPath(), "FolderUpdaterTests"); - - [SetUp] - public virtual void Init() { - if (Directory.Exists(_basePath)) { - Directory.Delete(_basePath, true); - } - - Directory.CreateDirectory(_basePath); - - var builder = new ContainerBuilder(); - - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - - _container = builder.Build(); - } - - [TestFixtureTearDown] - public void Clean() { - if (Directory.Exists(_basePath)) { - Directory.Delete(_basePath, true); - } - } - - [Test] - public void BackupTest() { - DirectoryInfo sourceDirectoryInfo = Directory.CreateDirectory(Path.Combine(_basePath, "Source")); - File.CreateText(Path.Combine(sourceDirectoryInfo.FullName, "file1.txt")).Close(); - File.CreateText(Path.Combine(sourceDirectoryInfo.FullName, "file2.txt")).Close(); - - IFolderUpdater folderUpdater = _container.Resolve(); - - DirectoryInfo targetDirectoryInfo = new DirectoryInfo(Path.Combine(_basePath, "Target")); - folderUpdater.Backup(sourceDirectoryInfo, targetDirectoryInfo); - - Assert.That(File.Exists(Path.Combine(targetDirectoryInfo.FullName, "file1.txt")), Is.True); - Assert.That(File.Exists(Path.Combine(targetDirectoryInfo.FullName, "file2.txt")), Is.True); - } - } -} +using System.IO; +using Autofac; +using Moq; +using NUnit.Framework; +using Orchard.Packaging.Services; +using Orchard.UI.Notify; + +namespace Orchard.Tests.Modules.Packaging.Services { + [TestFixture] + public class FolderUpdaterTests { + protected IContainer _container; + + private readonly string _basePath = Path.Combine(Path.GetTempPath(), "FolderUpdaterTests"); + + [SetUp] + public virtual void Init() { + if (Directory.Exists(_basePath)) { + Directory.Delete(_basePath, true); + } + + Directory.CreateDirectory(_basePath); + + var builder = new ContainerBuilder(); + + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + + _container = builder.Build(); + } + + [TestFixtureTearDown] + public void Clean() { + if (Directory.Exists(_basePath)) { + Directory.Delete(_basePath, true); + } + } + + [Test] + public void BackupTest() { + DirectoryInfo sourceDirectoryInfo = Directory.CreateDirectory(Path.Combine(_basePath, "Source")); + File.CreateText(Path.Combine(sourceDirectoryInfo.FullName, "file1.txt")).Close(); + File.CreateText(Path.Combine(sourceDirectoryInfo.FullName, "file2.txt")).Close(); + + IFolderUpdater folderUpdater = _container.Resolve(); + + DirectoryInfo targetDirectoryInfo = new DirectoryInfo(Path.Combine(_basePath, "Target")); + folderUpdater.Backup(sourceDirectoryInfo, targetDirectoryInfo); + + Assert.That(File.Exists(Path.Combine(targetDirectoryInfo.FullName, "file1.txt")), Is.True); + Assert.That(File.Exists(Path.Combine(targetDirectoryInfo.FullName, "file2.txt")), Is.True); + } + } +} diff --git a/src/Orchard.Tests.Modules/Packaging/Services/Hello.World.csproj.txt b/src/Orchard.Tests.Modules/Packaging/Services/Hello.World.csproj.txt index c5f2e099c6e..4f5a0d6b17d 100644 --- a/src/Orchard.Tests.Modules/Packaging/Services/Hello.World.csproj.txt +++ b/src/Orchard.Tests.Modules/Packaging/Services/Hello.World.csproj.txt @@ -1,126 +1,126 @@ - - - - Debug - AnyCPU - - - 2.0 - {DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Hello.World - Hello.World - v4.0 - false - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - - - - - - - - - 3.5 - - - 3.5 - - - 3.5 - - - False - ..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll - - - 3.5 - - - - 3.5 - - - - - - - - - - - - - - - - - - - - - - - {F879F274-EFA0-4157-8404-33A19B4E6AEC} - NuPack.Core - - - {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} - Orchard.Framework - - - - - - - - - - - - - - - - - - - False - True - 40980 - / - - - False - True - http://orchard.codeplex.com - False - - - - - + + + + Debug + AnyCPU + + + 2.0 + {DFD137A2-DDB5-4D22-BE0D-FA9AD4C8B059} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Hello.World + Hello.World + v4.0 + false + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + + + + + + + + + 3.5 + + + 3.5 + + + 3.5 + + + False + ..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll + + + 3.5 + + + + 3.5 + + + + + + + + + + + + + + + + + + + + + + + {F879F274-EFA0-4157-8404-33A19B4E6AEC} + NuPack.Core + + + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} + Orchard.Framework + + + + + + + + + + + + + + + + + + + False + True + 40980 + / + + + False + True + http://orchard.codeplex.com + False + + + + + diff --git a/src/Orchard.Tests.Modules/Packaging/Services/PackageBuilderTests.cs b/src/Orchard.Tests.Modules/Packaging/Services/PackageBuilderTests.cs index f2b7fa7a661..9a82bd6984d 100644 --- a/src/Orchard.Tests.Modules/Packaging/Services/PackageBuilderTests.cs +++ b/src/Orchard.Tests.Modules/Packaging/Services/PackageBuilderTests.cs @@ -1,85 +1,85 @@ -using System; -using System.IO; -using System.IO.Packaging; -using Autofac; -using NUnit.Framework; -using Orchard.Environment; -using Orchard.Environment.Extensions.Models; -using Orchard.FileSystems.VirtualPath; -using Orchard.FileSystems.WebSite; -using Orchard.Packaging.Services; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.Modules.Packaging.Services { - [TestFixture] - public class PackageBuilderTests : ContainerTestBase { - private const string PackageIdentifier = "Hello.World"; - - protected override void Register(ContainerBuilder builder) { - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As() - .As().InstancePerLifetimeScope(); - } - - private Stream BuildHelloWorld(IPackageBuilder packageBuilder) { - - // add some content because NuGet requires it - var folder = _container.Resolve(); - using ( var sourceStream = GetType().Assembly.GetManifestResourceStream(GetType(), "Hello.World.csproj.txt") ) { - folder.AddFile("~/Modules/Hello.World/Hello.World.csproj", new StreamReader(sourceStream).ReadToEnd()); - } - - return packageBuilder.BuildPackage(new ExtensionDescriptor { - ExtensionType = DefaultExtensionTypes.Module, - Id = PackageIdentifier, - Version = "1.0", - Description = "a", - Author = "b" - }); - } - - [Test] - public void PackageForModuleIsOpcPackage() { - var packageBuilder = _container.Resolve(); - var stream = BuildHelloWorld(packageBuilder); - - var package = Package.Open(stream); - Assert.That(package, Is.Not.Null); - Assert.That(package.PackageProperties.Identifier, Is.EqualTo(PackageBuilder.BuildPackageId(PackageIdentifier, DefaultExtensionTypes.Module))); - } - - [Test] - public void PropertiesPassThroughAsExpected() { - var packageBuilder = _container.Resolve(); - var stream = BuildHelloWorld(packageBuilder); - - var package = Package.Open(stream); - - Assert.That(package.PackageProperties.Description, Is.EqualTo("a")); - Assert.That(package.PackageProperties.Creator, Is.EqualTo("b")); - Assert.That(package.PackageProperties.Version, Is.EqualTo("1.0")); - } - - [Test] - public void ProjectFileIsAdded() { - var packageBuilder = _container.Resolve(); - var stream = BuildHelloWorld(packageBuilder); - - string content; - using ( var sourceStream = GetType().Assembly.GetManifestResourceStream(GetType(), "Hello.World.csproj.txt") ) { - content = new StreamReader(sourceStream).ReadToEnd(); - } - - var package = Package.Open(stream); - var projectUri = PackUriHelper.CreatePartUri(new Uri("/Content/Modules/Hello.World/Hello.World.csproj", UriKind.Relative)); - var projectPart = package.GetPart(projectUri); - using (var projectStream = projectPart.GetStream()) { - var projectContent = new StreamReader(projectStream).ReadToEnd(); - Assert.That(projectContent, Is.EqualTo(content)); - } - } - - } -} +using System; +using System.IO; +using System.IO.Packaging; +using Autofac; +using NUnit.Framework; +using Orchard.Environment; +using Orchard.Environment.Extensions.Models; +using Orchard.FileSystems.VirtualPath; +using Orchard.FileSystems.WebSite; +using Orchard.Packaging.Services; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.Modules.Packaging.Services { + [TestFixture] + public class PackageBuilderTests : ContainerTestBase { + private const string PackageIdentifier = "Hello.World"; + + protected override void Register(ContainerBuilder builder) { + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As() + .As().InstancePerLifetimeScope(); + } + + private Stream BuildHelloWorld(IPackageBuilder packageBuilder) { + + // add some content because NuGet requires it + var folder = _container.Resolve(); + using ( var sourceStream = GetType().Assembly.GetManifestResourceStream(GetType(), "Hello.World.csproj.txt") ) { + folder.AddFile("~/Modules/Hello.World/Hello.World.csproj", new StreamReader(sourceStream).ReadToEnd()); + } + + return packageBuilder.BuildPackage(new ExtensionDescriptor { + ExtensionType = DefaultExtensionTypes.Module, + Id = PackageIdentifier, + Version = "1.0", + Description = "a", + Author = "b" + }); + } + + [Test] + public void PackageForModuleIsOpcPackage() { + var packageBuilder = _container.Resolve(); + var stream = BuildHelloWorld(packageBuilder); + + var package = Package.Open(stream); + Assert.That(package, Is.Not.Null); + Assert.That(package.PackageProperties.Identifier, Is.EqualTo(PackageBuilder.BuildPackageId(PackageIdentifier, DefaultExtensionTypes.Module))); + } + + [Test] + public void PropertiesPassThroughAsExpected() { + var packageBuilder = _container.Resolve(); + var stream = BuildHelloWorld(packageBuilder); + + var package = Package.Open(stream); + + Assert.That(package.PackageProperties.Description, Is.EqualTo("a")); + Assert.That(package.PackageProperties.Creator, Is.EqualTo("b")); + Assert.That(package.PackageProperties.Version, Is.EqualTo("1.0")); + } + + [Test] + public void ProjectFileIsAdded() { + var packageBuilder = _container.Resolve(); + var stream = BuildHelloWorld(packageBuilder); + + string content; + using ( var sourceStream = GetType().Assembly.GetManifestResourceStream(GetType(), "Hello.World.csproj.txt") ) { + content = new StreamReader(sourceStream).ReadToEnd(); + } + + var package = Package.Open(stream); + var projectUri = PackUriHelper.CreatePartUri(new Uri("/Content/Modules/Hello.World/Hello.World.csproj", UriKind.Relative)); + var projectPart = package.GetPart(projectUri); + using (var projectStream = projectPart.GetStream()) { + var projectContent = new StreamReader(projectStream).ReadToEnd(); + Assert.That(projectContent, Is.EqualTo(content)); + } + } + + } +} diff --git a/src/Orchard.Tests.Modules/Packaging/Services/PackageInstallerTests.cs b/src/Orchard.Tests.Modules/Packaging/Services/PackageInstallerTests.cs index 289badfbe1b..91d6bb04cc9 100644 --- a/src/Orchard.Tests.Modules/Packaging/Services/PackageInstallerTests.cs +++ b/src/Orchard.Tests.Modules/Packaging/Services/PackageInstallerTests.cs @@ -1,181 +1,181 @@ -using System.IO; -using Autofac; -using Moq; -using NuGet; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.Environment; -using Orchard.Environment.Extensions; -using Orchard.Environment.Extensions.Models; -using Orchard.FileSystems.VirtualPath; -using Orchard.FileSystems.WebSite; -using Orchard.Packaging.Services; -using Orchard.Services; -using Orchard.Tests.Stubs; -using Orchard.UI.Notify; -using IPackageBuilder = Orchard.Packaging.Services.IPackageBuilder; -using PackageBuilder = Orchard.Packaging.Services.PackageBuilder; - -namespace Orchard.Tests.Modules.Packaging.Services { - [TestFixture] - public class PackageInstallerTests : ContainerTestBase { - private const string PackageIdentifier = "Hello.World"; - - private readonly string _basePath = Path.Combine(Path.GetTempPath(), "PackageInstallerTests"); - - private Mock _mockedVirtualPathProvider; - - protected override void Register(ContainerBuilder builder) { - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - _mockedVirtualPathProvider = new Mock(); - builder.RegisterInstance(_mockedVirtualPathProvider.Object).As(); - builder.RegisterType().As(); - builder.RegisterType().As() - .As().InstancePerLifetimeScope(); - builder.RegisterType().As(); - } - - [SetUp] - public override void Init() { - base.Init(); - - if (Directory.Exists(_basePath)) { - Directory.Delete(_basePath, true); - } - - Directory.CreateDirectory(_basePath); - } - - [TestFixtureTearDown] - public void Clean() { - if (Directory.Exists(_basePath)) { - Directory.Delete(_basePath, true); - } - } - - private Stream BuildHelloWorld(IPackageBuilder packageBuilder) { - // add some content because NuGet requires it - var folder = _container.Resolve(); - using (var sourceStream = GetType().Assembly.GetManifestResourceStream(GetType(), "Hello.World.csproj.txt")) { - folder.AddFile("~/Modules/Hello.World/Hello.World.csproj", new StreamReader(sourceStream).ReadToEnd()); - } - - return packageBuilder.BuildPackage(new ExtensionDescriptor { - ExtensionType = DefaultExtensionTypes.Module, - Id = PackageIdentifier, - Version = "1.0", - Description = "a", - Author = "b" - }); - } - - [Test] - public void InstallTest() { - IPackageBuilder packageBuilder = _container.Resolve(); - Stream stream = BuildHelloWorld(packageBuilder); - - string filename = Path.Combine(_basePath, "package.nupkg"); - using (var fileStream = File.Create(filename)) { - stream.CopyTo(fileStream); - } - - ZipPackage zipPackage = new ZipPackage(filename); - IPackageInstaller packageInstaller = _container.Resolve(); - - _mockedVirtualPathProvider.Setup(v => v.MapPath(It.IsAny())) - .Returns(path => Path.Combine(_basePath, path.Replace("~\\", ""))); - - _mockedVirtualPathProvider.Setup(v => v.Combine(It.IsAny())) - .Returns(Path.Combine); - - PackageInfo packageInfo = packageInstaller.Install(zipPackage, _basePath, _basePath); - Assert.That(packageInfo, Is.Not.Null); - Assert.That(Directory.Exists(Path.Combine(_basePath, "Modules/Hello.World"))); - var fileOnePath = Path.Combine(_basePath, "Modules/Hello.World/Hello.World.csproj"); - var fileTwoPath = Path.Combine(_basePath, "Modules/Hello.World/Service References/SomeReference.cs"); - Assert.That(File.Exists(fileOnePath)); - Assert.That(File.Exists(fileTwoPath)); - Assert.That(File.GetLastWriteTime(fileOnePath), Is.EqualTo(File.GetLastWriteTime(fileTwoPath)), "Installed files should have the same last write time."); - } - - [Test] - public void InstallUpgradeTest() { - IPackageBuilder packageBuilder = _container.Resolve(); - Stream stream = BuildHelloWorld(packageBuilder); - - string filename = Path.Combine(_basePath, "package.nupkg"); - using (var fileStream = File.Create(filename)) { - stream.CopyTo(fileStream); - } - - ZipPackage zipPackage = new ZipPackage(filename); - IPackageInstaller packageInstaller = _container.Resolve(); - - _mockedVirtualPathProvider.Setup(v => v.MapPath(It.IsAny())) - .Returns(path => Path.Combine(_basePath, path.Replace("~\\", "").Replace("~/", ""))); - - _mockedVirtualPathProvider.Setup(v => v.Combine(It.IsAny())) - .Returns(Path.Combine); - - PackageInfo packageInfo = packageInstaller.Install(zipPackage, _basePath, _basePath); - Assert.That(packageInfo, Is.Not.Null); - Assert.That(Directory.Exists(Path.Combine(_basePath, "Modules/Hello.World"))); - Assert.That(File.Exists(Path.Combine(_basePath, "Modules/Hello.World/Hello.World.csproj"))); - - // Modify one of the files and install again and check that backup worked and file content is updated - string[] lines = File.ReadAllLines(Path.Combine(_basePath, "Modules/Hello.World/Hello.World.csproj")); - string originalLine = lines[lines.Length - 1]; - lines[lines.Length - 1] = "modified"; - File.WriteAllLines(Path.Combine(_basePath, "Modules/Hello.World/Hello.World.csproj"), lines); - - packageInfo = packageInstaller.Install(zipPackage, _basePath, _basePath); - Assert.That(packageInfo, Is.Not.Null); - Assert.That(Directory.Exists(Path.Combine(_basePath, "Modules/Hello.World"))); - Assert.That(File.Exists(Path.Combine(_basePath, "Modules/Hello.World/Hello.World.csproj"))); - lines = File.ReadAllLines(Path.Combine(_basePath, "Modules/Hello.World/Hello.World.csproj")); - Assert.That(lines[lines.Length - 1], Is.EqualTo(originalLine)); - - Assert.That(Directory.Exists(Path.Combine(_basePath, "Modules/_Backup/Hello.World"))); - Assert.That(File.Exists(Path.Combine(_basePath, "Modules/_Backup/Hello.World/Hello.World.csproj"))); - lines = File.ReadAllLines(Path.Combine(_basePath, "Modules/_Backup/Hello.World/Hello.World.csproj")); - Assert.That(lines[lines.Length - 1], Is.EqualTo("modified")); - } - - [Test] - public void UninstallTest() { - IPackageBuilder packageBuilder = _container.Resolve(); - Stream stream = BuildHelloWorld(packageBuilder); - - string filename = Path.Combine(_basePath, "package.nupkg"); - using (var fileStream = File.Create(filename)) { - stream.CopyTo(fileStream); - } - - ZipPackage zipPackage = new ZipPackage(filename); - IPackageInstaller packageInstaller = _container.Resolve(); - - _mockedVirtualPathProvider.Setup(v => v.MapPath(It.IsAny())) - .Returns(path => Path.Combine(_basePath, path.Replace("~\\", "").Replace("~/", ""))); - - _mockedVirtualPathProvider.Setup(v => v.Combine(It.IsAny())) - .Returns(Path.Combine); - - PackageInfo packageInfo = packageInstaller.Install(zipPackage, _basePath, _basePath); - Assert.That(packageInfo, Is.Not.Null); - Assert.That(Directory.Exists(Path.Combine(_basePath, "Modules/Hello.World"))); - Assert.That(File.Exists(Path.Combine(_basePath, "Modules/Hello.World/Hello.World.csproj"))); - - // Uninstall and check that the installation will be gone - packageInstaller.Uninstall(zipPackage.Id, _basePath); - Assert.That(Directory.Exists(Path.Combine(_basePath, "Modules/Hello.World")), Is.False); - } - } -} +using System.IO; +using Autofac; +using Moq; +using NuGet; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.Environment; +using Orchard.Environment.Extensions; +using Orchard.Environment.Extensions.Models; +using Orchard.FileSystems.VirtualPath; +using Orchard.FileSystems.WebSite; +using Orchard.Packaging.Services; +using Orchard.Services; +using Orchard.Tests.Stubs; +using Orchard.UI.Notify; +using IPackageBuilder = Orchard.Packaging.Services.IPackageBuilder; +using PackageBuilder = Orchard.Packaging.Services.PackageBuilder; + +namespace Orchard.Tests.Modules.Packaging.Services { + [TestFixture] + public class PackageInstallerTests : ContainerTestBase { + private const string PackageIdentifier = "Hello.World"; + + private readonly string _basePath = Path.Combine(Path.GetTempPath(), "PackageInstallerTests"); + + private Mock _mockedVirtualPathProvider; + + protected override void Register(ContainerBuilder builder) { + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + _mockedVirtualPathProvider = new Mock(); + builder.RegisterInstance(_mockedVirtualPathProvider.Object).As(); + builder.RegisterType().As(); + builder.RegisterType().As() + .As().InstancePerLifetimeScope(); + builder.RegisterType().As(); + } + + [SetUp] + public override void Init() { + base.Init(); + + if (Directory.Exists(_basePath)) { + Directory.Delete(_basePath, true); + } + + Directory.CreateDirectory(_basePath); + } + + [TestFixtureTearDown] + public void Clean() { + if (Directory.Exists(_basePath)) { + Directory.Delete(_basePath, true); + } + } + + private Stream BuildHelloWorld(IPackageBuilder packageBuilder) { + // add some content because NuGet requires it + var folder = _container.Resolve(); + using (var sourceStream = GetType().Assembly.GetManifestResourceStream(GetType(), "Hello.World.csproj.txt")) { + folder.AddFile("~/Modules/Hello.World/Hello.World.csproj", new StreamReader(sourceStream).ReadToEnd()); + } + + return packageBuilder.BuildPackage(new ExtensionDescriptor { + ExtensionType = DefaultExtensionTypes.Module, + Id = PackageIdentifier, + Version = "1.0", + Description = "a", + Author = "b" + }); + } + + [Test] + public void InstallTest() { + IPackageBuilder packageBuilder = _container.Resolve(); + Stream stream = BuildHelloWorld(packageBuilder); + + string filename = Path.Combine(_basePath, "package.nupkg"); + using (var fileStream = File.Create(filename)) { + stream.CopyTo(fileStream); + } + + ZipPackage zipPackage = new ZipPackage(filename); + IPackageInstaller packageInstaller = _container.Resolve(); + + _mockedVirtualPathProvider.Setup(v => v.MapPath(It.IsAny())) + .Returns(path => Path.Combine(_basePath, path.Replace("~\\", ""))); + + _mockedVirtualPathProvider.Setup(v => v.Combine(It.IsAny())) + .Returns(Path.Combine); + + PackageInfo packageInfo = packageInstaller.Install(zipPackage, _basePath, _basePath); + Assert.That(packageInfo, Is.Not.Null); + Assert.That(Directory.Exists(Path.Combine(_basePath, "Modules/Hello.World"))); + var fileOnePath = Path.Combine(_basePath, "Modules/Hello.World/Hello.World.csproj"); + var fileTwoPath = Path.Combine(_basePath, "Modules/Hello.World/Service References/SomeReference.cs"); + Assert.That(File.Exists(fileOnePath)); + Assert.That(File.Exists(fileTwoPath)); + Assert.That(File.GetLastWriteTime(fileOnePath), Is.EqualTo(File.GetLastWriteTime(fileTwoPath)), "Installed files should have the same last write time."); + } + + [Test] + public void InstallUpgradeTest() { + IPackageBuilder packageBuilder = _container.Resolve(); + Stream stream = BuildHelloWorld(packageBuilder); + + string filename = Path.Combine(_basePath, "package.nupkg"); + using (var fileStream = File.Create(filename)) { + stream.CopyTo(fileStream); + } + + ZipPackage zipPackage = new ZipPackage(filename); + IPackageInstaller packageInstaller = _container.Resolve(); + + _mockedVirtualPathProvider.Setup(v => v.MapPath(It.IsAny())) + .Returns(path => Path.Combine(_basePath, path.Replace("~\\", "").Replace("~/", ""))); + + _mockedVirtualPathProvider.Setup(v => v.Combine(It.IsAny())) + .Returns(Path.Combine); + + PackageInfo packageInfo = packageInstaller.Install(zipPackage, _basePath, _basePath); + Assert.That(packageInfo, Is.Not.Null); + Assert.That(Directory.Exists(Path.Combine(_basePath, "Modules/Hello.World"))); + Assert.That(File.Exists(Path.Combine(_basePath, "Modules/Hello.World/Hello.World.csproj"))); + + // Modify one of the files and install again and check that backup worked and file content is updated + string[] lines = File.ReadAllLines(Path.Combine(_basePath, "Modules/Hello.World/Hello.World.csproj")); + string originalLine = lines[lines.Length - 1]; + lines[lines.Length - 1] = "modified"; + File.WriteAllLines(Path.Combine(_basePath, "Modules/Hello.World/Hello.World.csproj"), lines); + + packageInfo = packageInstaller.Install(zipPackage, _basePath, _basePath); + Assert.That(packageInfo, Is.Not.Null); + Assert.That(Directory.Exists(Path.Combine(_basePath, "Modules/Hello.World"))); + Assert.That(File.Exists(Path.Combine(_basePath, "Modules/Hello.World/Hello.World.csproj"))); + lines = File.ReadAllLines(Path.Combine(_basePath, "Modules/Hello.World/Hello.World.csproj")); + Assert.That(lines[lines.Length - 1], Is.EqualTo(originalLine)); + + Assert.That(Directory.Exists(Path.Combine(_basePath, "Modules/_Backup/Hello.World"))); + Assert.That(File.Exists(Path.Combine(_basePath, "Modules/_Backup/Hello.World/Hello.World.csproj"))); + lines = File.ReadAllLines(Path.Combine(_basePath, "Modules/_Backup/Hello.World/Hello.World.csproj")); + Assert.That(lines[lines.Length - 1], Is.EqualTo("modified")); + } + + [Test] + public void UninstallTest() { + IPackageBuilder packageBuilder = _container.Resolve(); + Stream stream = BuildHelloWorld(packageBuilder); + + string filename = Path.Combine(_basePath, "package.nupkg"); + using (var fileStream = File.Create(filename)) { + stream.CopyTo(fileStream); + } + + ZipPackage zipPackage = new ZipPackage(filename); + IPackageInstaller packageInstaller = _container.Resolve(); + + _mockedVirtualPathProvider.Setup(v => v.MapPath(It.IsAny())) + .Returns(path => Path.Combine(_basePath, path.Replace("~\\", "").Replace("~/", ""))); + + _mockedVirtualPathProvider.Setup(v => v.Combine(It.IsAny())) + .Returns(Path.Combine); + + PackageInfo packageInfo = packageInstaller.Install(zipPackage, _basePath, _basePath); + Assert.That(packageInfo, Is.Not.Null); + Assert.That(Directory.Exists(Path.Combine(_basePath, "Modules/Hello.World"))); + Assert.That(File.Exists(Path.Combine(_basePath, "Modules/Hello.World/Hello.World.csproj"))); + + // Uninstall and check that the installation will be gone + packageInstaller.Uninstall(zipPackage.Id, _basePath); + Assert.That(Directory.Exists(Path.Combine(_basePath, "Modules/Hello.World")), Is.False); + } + } +} diff --git a/src/Orchard.Tests.Modules/Properties/AssemblyInfo.cs b/src/Orchard.Tests.Modules/Properties/AssemblyInfo.cs index 569ed6ab3d9..213c8cd62ee 100644 --- a/src/Orchard.Tests.Modules/Properties/AssemblyInfo.cs +++ b/src/Orchard.Tests.Modules/Properties/AssemblyInfo.cs @@ -1,34 +1,34 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Orchard.Tests.Modules")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyProduct("Orchard")] -[assembly: AssemblyCopyright("Copyright © .NET Foundation")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("48eebfb4-714d-4859-829a-15fbe7e1bc9f")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.9.2")] -[assembly: AssemblyFileVersion("1.9.2")] +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Orchard.Tests.Modules")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyProduct("Orchard")] +[assembly: AssemblyCopyright("Copyright © .NET Foundation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("48eebfb4-714d-4859-829a-15fbe7e1bc9f")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.9.2")] +[assembly: AssemblyFileVersion("1.9.2")] diff --git a/src/Orchard.Tests.Modules/Recipes/RecipeHandlers/ModuleRecipeHandlerTest.cs b/src/Orchard.Tests.Modules/Recipes/RecipeHandlers/ModuleRecipeHandlerTest.cs index b24f40c4386..76d00ff3211 100644 --- a/src/Orchard.Tests.Modules/Recipes/RecipeHandlers/ModuleRecipeHandlerTest.cs +++ b/src/Orchard.Tests.Modules/Recipes/RecipeHandlers/ModuleRecipeHandlerTest.cs @@ -1,253 +1,253 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Xml.Linq; -using Autofac; -using NuGet; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.Core.Settings.Descriptor; -using Orchard.Core.Settings.Descriptor.Records; -using Orchard.Core.Settings.State; -using Orchard.Data.Migration; -using Orchard.Environment.Configuration; -using Orchard.Environment.Descriptor; -using Orchard.Environment.Descriptor.Models; -using Orchard.Environment.Extensions; -using Orchard.Environment.Extensions.Folders; -using Orchard.Environment.Extensions.Models; -using Orchard.Environment.Features; -using Orchard.Environment.State; -using Orchard.Events; -using Orchard.Packaging.GalleryServer; -using Orchard.Packaging.Models; -using Orchard.Packaging.Services; -using Orchard.Recipes.Models; -using Orchard.Recipes.RecipeHandlers; -using Orchard.Recipes.Services; -using Orchard.Tests.Environment.Extensions; -using Orchard.Tests.Environment.Features; -using Orchard.Tests.Stubs; -using IPackageManager = Orchard.Packaging.Services.IPackageManager; -using Orchard.Tests.Modules.Recipes.Services; - -namespace Orchard.Tests.Modules.Recipes.RecipeHandlers { - [TestFixture] - public class ModuleRecipeHandlerTest : DatabaseEnabledTestsBase { - private ExtensionManagerTests.StubFolders _folders; - private StubPackagingSourceManager _packagesInRepository; - private StubPackageManager _packageManager; - - protected override IEnumerable DatabaseTypes { - get { - return new[] { - typeof (ShellDescriptorRecord), - typeof (ShellFeatureRecord), - typeof (ShellParameterRecord), - }; - } - } - - public override void Register(ContainerBuilder builder) { - builder.RegisterInstance(new ShellSettings { Name = "Default" }); - - _folders = new ExtensionManagerTests.StubFolders(); - _packagesInRepository = new StubPackagingSourceManager(); - _packageManager = new StubPackageManager(); - builder.RegisterInstance(_folders).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As().SingleInstance(); - builder.RegisterType().As(); - builder.RegisterInstance(_packagesInRepository).As(); - builder.RegisterInstance(_packageManager).As(); - builder.RegisterType().As().SingleInstance(); - builder.RegisterType().As().SingleInstance(); - builder.RegisterType(); - builder.RegisterType().As(); - builder.RegisterSource(new EventsRegistrationSource()); - } - - [Test] - public void ExecuteRecipeStepTest() { - _folders.Manifests.Add("SuperWiki", @" -Name: SuperWiki -Version: 1.0.3 -OrchardVersion: 1 -Features: - SuperWiki: - Description: My super wiki module for Orchard. -"); - _packagesInRepository.AddPublishedPackage(new PublishedPackage { - Id = "Orchard.Module.SuperWiki", - PackageType = DefaultExtensionTypes.Module, - Title = "SuperWiki", - Version = "1.0.3", - IsLatestVersion = true, - }); - - IShellDescriptorManager shellDescriptorManager = _container.Resolve(); - // No features enabled - shellDescriptorManager.UpdateShellDescriptor(0, - Enumerable.Empty(), - Enumerable.Empty()); - - ModuleRecipeHandler moduleRecipeHandler = _container.Resolve(); - - RecipeContext recipeContext = new RecipeContext { RecipeStep = new RecipeStep { Name = "Module", Step = new XElement("SuperWiki") } }; - recipeContext.RecipeStep.Step.Add(new XAttribute("packageId", "Orchard.Module.SuperWiki")); - recipeContext.RecipeStep.Step.Add(new XAttribute("repository", "test")); - - IFeatureManager featureManager = _container.Resolve(); - IEnumerable enabledFeatures = featureManager.GetEnabledFeatures(); - Assert.That(enabledFeatures.Count(), Is.EqualTo(0)); - moduleRecipeHandler.ExecuteRecipeStep(recipeContext); - - - var availableFeatures = featureManager.GetAvailableFeatures().Where(x => x.Id == "SuperWiki").FirstOrDefault(); - Assert.That(availableFeatures.Id, Is.EqualTo("SuperWiki")); - Assert.That(recipeContext.Executed, Is.True); - } - - [Test] - public void ExecuteRecipeStepNeedsNameTest() { - _folders.Manifests.Add("SuperWiki", @" -Name: SuperWiki -Version: 1.0.3 -OrchardVersion: 1 -Features: - SuperWiki: - Description: My super wiki module for Orchard. -"); - - ModuleRecipeHandler moduleRecipeHandler = _container.Resolve(); - - RecipeContext recipeContext = new RecipeContext { RecipeStep = new RecipeStep { Name = "Module", Step = new XElement("SuperWiki") } }; - recipeContext.RecipeStep.Step.Add(new XAttribute("repository", "test")); - - Assert.Throws(typeof (InvalidOperationException), () => moduleRecipeHandler.ExecuteRecipeStep(recipeContext)); - } - - [Test] - public void ExecuteRecipeStepWithRepositoryAndVersionNotLatestTest() { - _packagesInRepository.AddPublishedPackage(new PublishedPackage { - Id = "Orchard.Module.SuperWiki", - PackageType = DefaultExtensionTypes.Module, - Title = "SuperWiki", - Version = "1.0.3", - IsLatestVersion = true, - }); - _packagesInRepository.AddPublishedPackage(new PublishedPackage { - Id = "Orchard.Module.SuperWiki", - PackageType = DefaultExtensionTypes.Module, - Title = "SuperWiki", - Version = "1.0.2", - IsLatestVersion = false, - }); - - ModuleRecipeHandler moduleRecipeHandler = _container.Resolve(); - - RecipeContext recipeContext = new RecipeContext { RecipeStep = new RecipeStep { Name = "Module", Step = new XElement("SuperWiki") } }; - recipeContext.RecipeStep.Step.Add(new XAttribute("packageId", "Orchard.Module.SuperWiki")); - recipeContext.RecipeStep.Step.Add(new XAttribute("repository", "test")); - recipeContext.RecipeStep.Step.Add(new XAttribute("version", "1.0.2")); - - moduleRecipeHandler.ExecuteRecipeStep(recipeContext); - - var installedPackage = _packageManager.GetInstalledPackages().FirstOrDefault(info => info.ExtensionName == "Orchard.Module.SuperWiki"); - Assert.That(installedPackage, Is.Not.Null); - Assert.That(installedPackage.ExtensionVersion, Is.EqualTo("1.0.2")); - Assert.That(recipeContext.Executed, Is.True); - } - - internal class StubPackagingSourceManager : IPackagingSourceManager { - private List _publishedPackages = new List(); - - public IEnumerable GetSources() { - return Enumerable.Empty(); - } - - public int AddSource(string feedTitle, string feedUrl) { - throw new NotImplementedException(); - } - - public void RemoveSource(int id) { - throw new NotImplementedException(); - } - - public IEnumerable GetExtensionList(bool includeScreenshots, PackagingSource packagingSource = null, Func, IQueryable> query = null) { - return query(_publishedPackages.AsQueryable()).Select(package => CreatePackagingEntry(package)); - } - - public int GetExtensionCount(PackagingSource packagingSource = null, Func, IQueryable> query = null) { - throw new NotImplementedException(); - } - - public void AddPublishedPackage(PublishedPackage package) { - _publishedPackages.Add(package); - } - - private static PackagingEntry CreatePackagingEntry(PublishedPackage package) { - return new PackagingEntry { - PackageId = package.Id, - Title = package.Title, - Version = package.Version, - }; - } - } - - internal class StubPackageManager : IPackageManager { - private IList _installedPackages = new List(); - - public IEnumerable GetInstalledPackages() { - return _installedPackages; - } - - public PackageData Harvest(string extensionName) { - throw new NotImplementedException(); - } - - public PackageInfo Install(IPackage package, string location, string applicationPath) { - return null; - } - - public PackageInfo Install(string packageId, string version, string location, string applicationPath) { - var package = new PackageInfo { - ExtensionName = packageId, - ExtensionVersion = version, - }; - _installedPackages.Add(package); - return package; - } - - public void Uninstall(string packageId, string applicationPath) { - } - - public ExtensionDescriptor GetExtensionDescriptor(IPackage package, string extensionType) { - throw new NotImplementedException(); - } - } - - internal class StubDataMigrationManager : IDataMigrationManager { - public bool IsFeatureAlreadyInstalled(string feature) { - return true; - } - - public IEnumerable GetFeaturesThatNeedUpdate() { - return Enumerable.Empty(); - } - - public void Update(string feature) { - } - - public void Update(IEnumerable features) { - } - - public void Uninstall(string feature) { - } - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml.Linq; +using Autofac; +using NuGet; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.Core.Settings.Descriptor; +using Orchard.Core.Settings.Descriptor.Records; +using Orchard.Core.Settings.State; +using Orchard.Data.Migration; +using Orchard.Environment.Configuration; +using Orchard.Environment.Descriptor; +using Orchard.Environment.Descriptor.Models; +using Orchard.Environment.Extensions; +using Orchard.Environment.Extensions.Folders; +using Orchard.Environment.Extensions.Models; +using Orchard.Environment.Features; +using Orchard.Environment.State; +using Orchard.Events; +using Orchard.Packaging.GalleryServer; +using Orchard.Packaging.Models; +using Orchard.Packaging.Services; +using Orchard.Recipes.Models; +using Orchard.Recipes.RecipeHandlers; +using Orchard.Recipes.Services; +using Orchard.Tests.Environment.Extensions; +using Orchard.Tests.Environment.Features; +using Orchard.Tests.Stubs; +using IPackageManager = Orchard.Packaging.Services.IPackageManager; +using Orchard.Tests.Modules.Recipes.Services; + +namespace Orchard.Tests.Modules.Recipes.RecipeHandlers { + [TestFixture] + public class ModuleRecipeHandlerTest : DatabaseEnabledTestsBase { + private ExtensionManagerTests.StubFolders _folders; + private StubPackagingSourceManager _packagesInRepository; + private StubPackageManager _packageManager; + + protected override IEnumerable DatabaseTypes { + get { + return new[] { + typeof (ShellDescriptorRecord), + typeof (ShellFeatureRecord), + typeof (ShellParameterRecord), + }; + } + } + + public override void Register(ContainerBuilder builder) { + builder.RegisterInstance(new ShellSettings { Name = "Default" }); + + _folders = new ExtensionManagerTests.StubFolders(); + _packagesInRepository = new StubPackagingSourceManager(); + _packageManager = new StubPackageManager(); + builder.RegisterInstance(_folders).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As().SingleInstance(); + builder.RegisterType().As(); + builder.RegisterInstance(_packagesInRepository).As(); + builder.RegisterInstance(_packageManager).As(); + builder.RegisterType().As().SingleInstance(); + builder.RegisterType().As().SingleInstance(); + builder.RegisterType(); + builder.RegisterType().As(); + builder.RegisterSource(new EventsRegistrationSource()); + } + + [Test] + public void ExecuteRecipeStepTest() { + _folders.Manifests.Add("SuperWiki", @" +Name: SuperWiki +Version: 1.0.3 +OrchardVersion: 1 +Features: + SuperWiki: + Description: My super wiki module for Orchard. +"); + _packagesInRepository.AddPublishedPackage(new PublishedPackage { + Id = "Orchard.Module.SuperWiki", + PackageType = DefaultExtensionTypes.Module, + Title = "SuperWiki", + Version = "1.0.3", + IsLatestVersion = true, + }); + + IShellDescriptorManager shellDescriptorManager = _container.Resolve(); + // No features enabled + shellDescriptorManager.UpdateShellDescriptor(0, + Enumerable.Empty(), + Enumerable.Empty()); + + ModuleRecipeHandler moduleRecipeHandler = _container.Resolve(); + + RecipeContext recipeContext = new RecipeContext { RecipeStep = new RecipeStep { Name = "Module", Step = new XElement("SuperWiki") } }; + recipeContext.RecipeStep.Step.Add(new XAttribute("packageId", "Orchard.Module.SuperWiki")); + recipeContext.RecipeStep.Step.Add(new XAttribute("repository", "test")); + + IFeatureManager featureManager = _container.Resolve(); + IEnumerable enabledFeatures = featureManager.GetEnabledFeatures(); + Assert.That(enabledFeatures.Count(), Is.EqualTo(0)); + moduleRecipeHandler.ExecuteRecipeStep(recipeContext); + + + var availableFeatures = featureManager.GetAvailableFeatures().Where(x => x.Id == "SuperWiki").FirstOrDefault(); + Assert.That(availableFeatures.Id, Is.EqualTo("SuperWiki")); + Assert.That(recipeContext.Executed, Is.True); + } + + [Test] + public void ExecuteRecipeStepNeedsNameTest() { + _folders.Manifests.Add("SuperWiki", @" +Name: SuperWiki +Version: 1.0.3 +OrchardVersion: 1 +Features: + SuperWiki: + Description: My super wiki module for Orchard. +"); + + ModuleRecipeHandler moduleRecipeHandler = _container.Resolve(); + + RecipeContext recipeContext = new RecipeContext { RecipeStep = new RecipeStep { Name = "Module", Step = new XElement("SuperWiki") } }; + recipeContext.RecipeStep.Step.Add(new XAttribute("repository", "test")); + + Assert.Throws(typeof (InvalidOperationException), () => moduleRecipeHandler.ExecuteRecipeStep(recipeContext)); + } + + [Test] + public void ExecuteRecipeStepWithRepositoryAndVersionNotLatestTest() { + _packagesInRepository.AddPublishedPackage(new PublishedPackage { + Id = "Orchard.Module.SuperWiki", + PackageType = DefaultExtensionTypes.Module, + Title = "SuperWiki", + Version = "1.0.3", + IsLatestVersion = true, + }); + _packagesInRepository.AddPublishedPackage(new PublishedPackage { + Id = "Orchard.Module.SuperWiki", + PackageType = DefaultExtensionTypes.Module, + Title = "SuperWiki", + Version = "1.0.2", + IsLatestVersion = false, + }); + + ModuleRecipeHandler moduleRecipeHandler = _container.Resolve(); + + RecipeContext recipeContext = new RecipeContext { RecipeStep = new RecipeStep { Name = "Module", Step = new XElement("SuperWiki") } }; + recipeContext.RecipeStep.Step.Add(new XAttribute("packageId", "Orchard.Module.SuperWiki")); + recipeContext.RecipeStep.Step.Add(new XAttribute("repository", "test")); + recipeContext.RecipeStep.Step.Add(new XAttribute("version", "1.0.2")); + + moduleRecipeHandler.ExecuteRecipeStep(recipeContext); + + var installedPackage = _packageManager.GetInstalledPackages().FirstOrDefault(info => info.ExtensionName == "Orchard.Module.SuperWiki"); + Assert.That(installedPackage, Is.Not.Null); + Assert.That(installedPackage.ExtensionVersion, Is.EqualTo("1.0.2")); + Assert.That(recipeContext.Executed, Is.True); + } + + internal class StubPackagingSourceManager : IPackagingSourceManager { + private List _publishedPackages = new List(); + + public IEnumerable GetSources() { + return Enumerable.Empty(); + } + + public int AddSource(string feedTitle, string feedUrl) { + throw new NotImplementedException(); + } + + public void RemoveSource(int id) { + throw new NotImplementedException(); + } + + public IEnumerable GetExtensionList(bool includeScreenshots, PackagingSource packagingSource = null, Func, IQueryable> query = null) { + return query(_publishedPackages.AsQueryable()).Select(package => CreatePackagingEntry(package)); + } + + public int GetExtensionCount(PackagingSource packagingSource = null, Func, IQueryable> query = null) { + throw new NotImplementedException(); + } + + public void AddPublishedPackage(PublishedPackage package) { + _publishedPackages.Add(package); + } + + private static PackagingEntry CreatePackagingEntry(PublishedPackage package) { + return new PackagingEntry { + PackageId = package.Id, + Title = package.Title, + Version = package.Version, + }; + } + } + + internal class StubPackageManager : IPackageManager { + private IList _installedPackages = new List(); + + public IEnumerable GetInstalledPackages() { + return _installedPackages; + } + + public PackageData Harvest(string extensionName) { + throw new NotImplementedException(); + } + + public PackageInfo Install(IPackage package, string location, string applicationPath) { + return null; + } + + public PackageInfo Install(string packageId, string version, string location, string applicationPath) { + var package = new PackageInfo { + ExtensionName = packageId, + ExtensionVersion = version, + }; + _installedPackages.Add(package); + return package; + } + + public void Uninstall(string packageId, string applicationPath) { + } + + public ExtensionDescriptor GetExtensionDescriptor(IPackage package, string extensionType) { + throw new NotImplementedException(); + } + } + + internal class StubDataMigrationManager : IDataMigrationManager { + public bool IsFeatureAlreadyInstalled(string feature) { + return true; + } + + public IEnumerable GetFeaturesThatNeedUpdate() { + return Enumerable.Empty(); + } + + public void Update(string feature) { + } + + public void Update(IEnumerable features) { + } + + public void Uninstall(string feature) { + } + } + } +} diff --git a/src/Orchard.Tests.Modules/Recipes/RecipeHandlers/ThemeRecipeHandlerTest.cs b/src/Orchard.Tests.Modules/Recipes/RecipeHandlers/ThemeRecipeHandlerTest.cs index 115d320b328..43948bb11e8 100644 --- a/src/Orchard.Tests.Modules/Recipes/RecipeHandlers/ThemeRecipeHandlerTest.cs +++ b/src/Orchard.Tests.Modules/Recipes/RecipeHandlers/ThemeRecipeHandlerTest.cs @@ -1,194 +1,194 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web.Hosting; -using System.Xml.Linq; -using Autofac; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.Core.Settings.Descriptor; -using Orchard.Core.Settings.Descriptor.Records; -using Orchard.Core.Settings.State; -using Orchard.Data.Migration; -using Orchard.Environment.Configuration; -using Orchard.Environment.Descriptor; -using Orchard.Environment.Descriptor.Models; -using Orchard.Environment.Extensions; -using Orchard.Environment.Extensions.Folders; -using Orchard.Environment.Extensions.Models; -using Orchard.Environment.Features; -using Orchard.Environment.State; -using Orchard.Events; -using Orchard.FileSystems.VirtualPath; -using Orchard.Packaging.GalleryServer; -using Orchard.Packaging.Services; -using Orchard.Recipes.Models; -using Orchard.Recipes.RecipeHandlers; -using Orchard.Tests.DisplayManagement.Descriptors; -using Orchard.Tests.Environment.Extensions; -using Orchard.Tests.Environment.Features; -using Orchard.Tests.Stubs; -using Orchard.Tests.UI.Navigation; -using Orchard.Themes.Services; -using IPackageManager = Orchard.Packaging.Services.IPackageManager; - -namespace Orchard.Tests.Modules.Recipes.RecipeHandlers { - [TestFixture] - public class ThemeRecipeHandlerTest : DatabaseEnabledTestsBase { - private ExtensionManagerTests.StubFolders _folders; - private ModuleRecipeHandlerTest.StubPackagingSourceManager _packagesInRepository; - private ModuleRecipeHandlerTest.StubPackageManager _packageManager; - - protected override IEnumerable DatabaseTypes { - get { - return new[] { - typeof (ShellDescriptorRecord), - typeof (ShellFeatureRecord), - typeof (ShellParameterRecord), - }; - } - } - - public override void Register(ContainerBuilder builder) { - var _testVirtualPathProvider = new StylesheetBindingStrategyTests.TestVirtualPathProvider(); - - builder.RegisterInstance(new ShellSettings { Name = "Default" }); - - _folders = new ExtensionManagerTests.StubFolders(); - _packagesInRepository = new ModuleRecipeHandlerTest.StubPackagingSourceManager(); - _packageManager = new ModuleRecipeHandlerTest.StubPackageManager(); - builder.RegisterInstance(_folders).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As().SingleInstance(); - builder.RegisterType().As(); - builder.RegisterInstance(_packagesInRepository).As(); - builder.RegisterInstance(_packageManager).As(); - builder.RegisterType().As().SingleInstance(); - builder.RegisterInstance(_testVirtualPathProvider).As(); - builder.RegisterType().As().SingleInstance(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType(); - builder.RegisterSource(new EventsRegistrationSource()); - } - - [Test] - public void ExecuteRecipeStepTest() { - _folders.Manifests.Add("SuperWiki", @" -Name: SuperWiki -Version: 1.0.3 -OrchardVersion: 1 -Features: - SuperWiki: - Description: My super wiki theme for Orchard. -"); - _packagesInRepository.AddPublishedPackage(new PublishedPackage { - Id = "Orchard.Theme.SuperWiki", - PackageType = DefaultExtensionTypes.Theme, - Title = "SuperWiki", - Version = "1.0.3", - IsLatestVersion = true, - }); - - IShellDescriptorManager shellDescriptorManager = _container.Resolve(); - // No features enabled - shellDescriptorManager.UpdateShellDescriptor(0, - Enumerable.Empty(), - Enumerable.Empty()); - - ThemeRecipeHandler themeRecipeHandler = _container.Resolve(); - - RecipeContext recipeContext = new RecipeContext { RecipeStep = new RecipeStep { Name = "Theme", Step = new XElement("SuperWiki") } }; - recipeContext.RecipeStep.Step.Add(new XAttribute("packageId", "Orchard.Theme.SuperWiki")); - recipeContext.RecipeStep.Step.Add(new XAttribute("repository", "test")); - - IFeatureManager featureManager = _container.Resolve(); - IEnumerable enabledFeatures = featureManager.GetEnabledFeatures(); - Assert.That(enabledFeatures.Count(), Is.EqualTo(0)); - themeRecipeHandler.ExecuteRecipeStep(recipeContext); - - // without setting enable no feature should be activated... - featureManager.GetEnabledFeatures(); - Assert.That(enabledFeatures.Count(), Is.EqualTo(0)); - - // Adding enable the feature should get active - recipeContext.RecipeStep.Step.Add(new XAttribute("enable", true)); - themeRecipeHandler.ExecuteRecipeStep(recipeContext); - - enabledFeatures = featureManager.GetEnabledFeatures(); - Assert.That(enabledFeatures.FirstOrDefault(feature => feature.Id.Equals("SuperWiki")), Is.Not.Null); - Assert.That(enabledFeatures.Count(), Is.EqualTo(1)); - Assert.That(recipeContext.Executed, Is.True); - } - - [Test] - public void ExecuteRecipeStepNeedsNameTest() { - _folders.Manifests.Add("SuperWiki", @" -Name: SuperWiki -Version: 1.0.3 -OrchardVersion: 1 -Features: - SuperWiki: - Description: My super wiki module for Orchard. -"); - - ThemeRecipeHandler themeRecipeHandler = _container.Resolve(); - - RecipeContext recipeContext = new RecipeContext { RecipeStep = new RecipeStep { Name = "Theme", Step = new XElement("SuperWiki") } }; - recipeContext.RecipeStep.Step.Add(new XAttribute("repository", "test")); - - Assert.Throws(typeof (InvalidOperationException), () => themeRecipeHandler.ExecuteRecipeStep(recipeContext)); - } - - [Test] - public void ExecuteRecipeStepWithRepositoryAndVersionNotLatestTest() { - _packagesInRepository.AddPublishedPackage(new PublishedPackage { - Id = "Orchard.Theme.SuperWiki", - PackageType = DefaultExtensionTypes.Theme, - Title = "SuperWiki", - Version = "1.0.3", - IsLatestVersion = true, - }); - _packagesInRepository.AddPublishedPackage(new PublishedPackage { - Id = "Orchard.Theme.SuperWiki", - PackageType = DefaultExtensionTypes.Theme, - Title = "SuperWiki", - Version = "1.0.2", - IsLatestVersion = false, - }); - - ThemeRecipeHandler themeRecipeHandler = _container.Resolve(); - - RecipeContext recipeContext = new RecipeContext { RecipeStep = new RecipeStep { Name = "Theme", Step = new XElement("SuperWiki") } }; - recipeContext.RecipeStep.Step.Add(new XAttribute("packageId", "Orchard.Theme.SuperWiki")); - recipeContext.RecipeStep.Step.Add(new XAttribute("repository", "test")); - recipeContext.RecipeStep.Step.Add(new XAttribute("version", "1.0.2")); - - themeRecipeHandler.ExecuteRecipeStep(recipeContext); - - var installedPackage = _packageManager.GetInstalledPackages().FirstOrDefault(info => info.ExtensionName == "Orchard.Theme.SuperWiki"); - Assert.That(installedPackage, Is.Not.Null); - Assert.That(installedPackage.ExtensionVersion, Is.EqualTo("1.0.2")); - Assert.That(recipeContext.Executed, Is.True); - } - - internal class StubSiteThemeService : ISiteThemeService { - public ExtensionDescriptor GetSiteTheme() { - throw new NotImplementedException(); - } - - public void SetSiteTheme(string themeName) { - throw new NotImplementedException(); - } - - public string GetCurrentThemeName() { - throw new NotImplementedException(); - } - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web.Hosting; +using System.Xml.Linq; +using Autofac; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.Core.Settings.Descriptor; +using Orchard.Core.Settings.Descriptor.Records; +using Orchard.Core.Settings.State; +using Orchard.Data.Migration; +using Orchard.Environment.Configuration; +using Orchard.Environment.Descriptor; +using Orchard.Environment.Descriptor.Models; +using Orchard.Environment.Extensions; +using Orchard.Environment.Extensions.Folders; +using Orchard.Environment.Extensions.Models; +using Orchard.Environment.Features; +using Orchard.Environment.State; +using Orchard.Events; +using Orchard.FileSystems.VirtualPath; +using Orchard.Packaging.GalleryServer; +using Orchard.Packaging.Services; +using Orchard.Recipes.Models; +using Orchard.Recipes.RecipeHandlers; +using Orchard.Tests.DisplayManagement.Descriptors; +using Orchard.Tests.Environment.Extensions; +using Orchard.Tests.Environment.Features; +using Orchard.Tests.Stubs; +using Orchard.Tests.UI.Navigation; +using Orchard.Themes.Services; +using IPackageManager = Orchard.Packaging.Services.IPackageManager; + +namespace Orchard.Tests.Modules.Recipes.RecipeHandlers { + [TestFixture] + public class ThemeRecipeHandlerTest : DatabaseEnabledTestsBase { + private ExtensionManagerTests.StubFolders _folders; + private ModuleRecipeHandlerTest.StubPackagingSourceManager _packagesInRepository; + private ModuleRecipeHandlerTest.StubPackageManager _packageManager; + + protected override IEnumerable DatabaseTypes { + get { + return new[] { + typeof (ShellDescriptorRecord), + typeof (ShellFeatureRecord), + typeof (ShellParameterRecord), + }; + } + } + + public override void Register(ContainerBuilder builder) { + var _testVirtualPathProvider = new StylesheetBindingStrategyTests.TestVirtualPathProvider(); + + builder.RegisterInstance(new ShellSettings { Name = "Default" }); + + _folders = new ExtensionManagerTests.StubFolders(); + _packagesInRepository = new ModuleRecipeHandlerTest.StubPackagingSourceManager(); + _packageManager = new ModuleRecipeHandlerTest.StubPackageManager(); + builder.RegisterInstance(_folders).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As().SingleInstance(); + builder.RegisterType().As(); + builder.RegisterInstance(_packagesInRepository).As(); + builder.RegisterInstance(_packageManager).As(); + builder.RegisterType().As().SingleInstance(); + builder.RegisterInstance(_testVirtualPathProvider).As(); + builder.RegisterType().As().SingleInstance(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType(); + builder.RegisterSource(new EventsRegistrationSource()); + } + + [Test] + public void ExecuteRecipeStepTest() { + _folders.Manifests.Add("SuperWiki", @" +Name: SuperWiki +Version: 1.0.3 +OrchardVersion: 1 +Features: + SuperWiki: + Description: My super wiki theme for Orchard. +"); + _packagesInRepository.AddPublishedPackage(new PublishedPackage { + Id = "Orchard.Theme.SuperWiki", + PackageType = DefaultExtensionTypes.Theme, + Title = "SuperWiki", + Version = "1.0.3", + IsLatestVersion = true, + }); + + IShellDescriptorManager shellDescriptorManager = _container.Resolve(); + // No features enabled + shellDescriptorManager.UpdateShellDescriptor(0, + Enumerable.Empty(), + Enumerable.Empty()); + + ThemeRecipeHandler themeRecipeHandler = _container.Resolve(); + + RecipeContext recipeContext = new RecipeContext { RecipeStep = new RecipeStep { Name = "Theme", Step = new XElement("SuperWiki") } }; + recipeContext.RecipeStep.Step.Add(new XAttribute("packageId", "Orchard.Theme.SuperWiki")); + recipeContext.RecipeStep.Step.Add(new XAttribute("repository", "test")); + + IFeatureManager featureManager = _container.Resolve(); + IEnumerable enabledFeatures = featureManager.GetEnabledFeatures(); + Assert.That(enabledFeatures.Count(), Is.EqualTo(0)); + themeRecipeHandler.ExecuteRecipeStep(recipeContext); + + // without setting enable no feature should be activated... + featureManager.GetEnabledFeatures(); + Assert.That(enabledFeatures.Count(), Is.EqualTo(0)); + + // Adding enable the feature should get active + recipeContext.RecipeStep.Step.Add(new XAttribute("enable", true)); + themeRecipeHandler.ExecuteRecipeStep(recipeContext); + + enabledFeatures = featureManager.GetEnabledFeatures(); + Assert.That(enabledFeatures.FirstOrDefault(feature => feature.Id.Equals("SuperWiki")), Is.Not.Null); + Assert.That(enabledFeatures.Count(), Is.EqualTo(1)); + Assert.That(recipeContext.Executed, Is.True); + } + + [Test] + public void ExecuteRecipeStepNeedsNameTest() { + _folders.Manifests.Add("SuperWiki", @" +Name: SuperWiki +Version: 1.0.3 +OrchardVersion: 1 +Features: + SuperWiki: + Description: My super wiki module for Orchard. +"); + + ThemeRecipeHandler themeRecipeHandler = _container.Resolve(); + + RecipeContext recipeContext = new RecipeContext { RecipeStep = new RecipeStep { Name = "Theme", Step = new XElement("SuperWiki") } }; + recipeContext.RecipeStep.Step.Add(new XAttribute("repository", "test")); + + Assert.Throws(typeof (InvalidOperationException), () => themeRecipeHandler.ExecuteRecipeStep(recipeContext)); + } + + [Test] + public void ExecuteRecipeStepWithRepositoryAndVersionNotLatestTest() { + _packagesInRepository.AddPublishedPackage(new PublishedPackage { + Id = "Orchard.Theme.SuperWiki", + PackageType = DefaultExtensionTypes.Theme, + Title = "SuperWiki", + Version = "1.0.3", + IsLatestVersion = true, + }); + _packagesInRepository.AddPublishedPackage(new PublishedPackage { + Id = "Orchard.Theme.SuperWiki", + PackageType = DefaultExtensionTypes.Theme, + Title = "SuperWiki", + Version = "1.0.2", + IsLatestVersion = false, + }); + + ThemeRecipeHandler themeRecipeHandler = _container.Resolve(); + + RecipeContext recipeContext = new RecipeContext { RecipeStep = new RecipeStep { Name = "Theme", Step = new XElement("SuperWiki") } }; + recipeContext.RecipeStep.Step.Add(new XAttribute("packageId", "Orchard.Theme.SuperWiki")); + recipeContext.RecipeStep.Step.Add(new XAttribute("repository", "test")); + recipeContext.RecipeStep.Step.Add(new XAttribute("version", "1.0.2")); + + themeRecipeHandler.ExecuteRecipeStep(recipeContext); + + var installedPackage = _packageManager.GetInstalledPackages().FirstOrDefault(info => info.ExtensionName == "Orchard.Theme.SuperWiki"); + Assert.That(installedPackage, Is.Not.Null); + Assert.That(installedPackage.ExtensionVersion, Is.EqualTo("1.0.2")); + Assert.That(recipeContext.Executed, Is.True); + } + + internal class StubSiteThemeService : ISiteThemeService { + public ExtensionDescriptor GetSiteTheme() { + throw new NotImplementedException(); + } + + public void SetSiteTheme(string themeName) { + throw new NotImplementedException(); + } + + public string GetCurrentThemeName() { + throw new NotImplementedException(); + } + } + } +} diff --git a/src/Orchard.Tests.Modules/Recipes/Services/FoldersData/Sample1/Module.txt b/src/Orchard.Tests.Modules/Recipes/Services/FoldersData/Sample1/Module.txt index 5ae6bfdafdd..ac4d1725edc 100644 --- a/src/Orchard.Tests.Modules/Recipes/Services/FoldersData/Sample1/Module.txt +++ b/src/Orchard.Tests.Modules/Recipes/Services/FoldersData/Sample1/Module.txt @@ -1,8 +1,8 @@ -Name: Le plug-in français -Author: Bertrand Le Roy -Description: - This plug-in replaces - 'the' with 'le' -Version: 1.4.1 -Tags: plug-in, français, the, le -homepage: http://weblogs.asp.net/bleroy +Name: Le plug-in français +Author: Bertrand Le Roy +Description: + This plug-in replaces + 'the' with 'le' +Version: 1.4.1 +Tags: plug-in, français, the, le +homepage: http://weblogs.asp.net/bleroy diff --git a/src/Orchard.Tests.Modules/Recipes/Services/FoldersData/Sample1/Recipes/cms.recipe.xml b/src/Orchard.Tests.Modules/Recipes/Services/FoldersData/Sample1/Recipes/cms.recipe.xml index 49ab37bf8c8..accb6b3f13e 100644 --- a/src/Orchard.Tests.Modules/Recipes/Services/FoldersData/Sample1/Recipes/cms.recipe.xml +++ b/src/Orchard.Tests.Modules/Recipes/Services/FoldersData/Sample1/Recipes/cms.recipe.xml @@ -1,46 +1,46 @@ - - - - cms - a sample Orchard recipe describing a cms - orchard - http://orchardproject.net - tag1, tag2 - 1.1 - true - - - - - - - - - - - - - - - - - - - command1 - command2 - command3 - - - - - - - - - - - - - - - + + + + cms + a sample Orchard recipe describing a cms + orchard + http://orchardproject.net + tag1, tag2 + 1.1 + true + + + + + + + + + + + + + + + + + + + command1 + command2 + command3 + + + + + + + + + + + + + + + diff --git a/src/Orchard.Tests.Modules/Recipes/Services/RecipeManagerTests.cs b/src/Orchard.Tests.Modules/Recipes/Services/RecipeManagerTests.cs index 9d58c475d87..d8116789c68 100644 --- a/src/Orchard.Tests.Modules/Recipes/Services/RecipeManagerTests.cs +++ b/src/Orchard.Tests.Modules/Recipes/Services/RecipeManagerTests.cs @@ -1,217 +1,217 @@ -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Xml; -using Autofac; -using Moq; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.Environment.Extensions; -using Orchard.Environment.Extensions.Folders; -using Orchard.Environment.Extensions.Loaders; -using Orchard.FileSystems.AppData; -using Orchard.FileSystems.WebSite; -using Orchard.Recipes.Models; -using Orchard.Recipes.Services; -using Orchard.Services; -using Orchard.Tests.Stubs; -using Orchard.Recipes.Events; - -namespace Orchard.Tests.Modules.Recipes.Services { - [TestFixture] - public class RecipeManagerTests { - private IContainer _container; - private IRecipeManager _recipeManager; - private IRecipeHarvester _recipeHarvester; - private IRecipeParser _recipeParser; - private IExtensionFolders _folders; - - private const string DataPrefix = "Orchard.Tests.Modules.Recipes.Services.FoldersData."; - private string _tempFolderName; - - [SetUp] - public void Init() { - _tempFolderName = Path.GetTempFileName(); - File.Delete(_tempFolderName); - var assembly = GetType().Assembly; - foreach (var name in assembly.GetManifestResourceNames()) { - if (name.StartsWith(DataPrefix)) { - string text; - using (var stream = assembly.GetManifestResourceStream(name)) { - using (var reader = new StreamReader(stream)) - text = reader.ReadToEnd(); - - } - - // Pro filtering - var relativePath = name - .Substring(DataPrefix.Length) - .Replace(".txt", ":txt") - .Replace(".recipe.xml", ":recipe:xml") - .Replace('.', Path.DirectorySeparatorChar) - .Replace(":txt", ".txt") - .Replace(":recipe:xml", ".recipe.xml"); - - var targetPath = Path.Combine(_tempFolderName, relativePath); - - Directory.CreateDirectory(Path.GetDirectoryName(targetPath)); - using (var stream = new FileStream(targetPath, FileMode.Create)) { - using (var writer = new StreamWriter(stream)) { - writer.Write(text); - } - } - } - } - - var builder = new ContainerBuilder(); - var harvester = new ExtensionHarvester(new StubCacheManager(), new StubWebSiteFolder(), new Mock().Object); - _folders = new ModuleFolders(new[] { _tempFolderName }, harvester); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As().InstancePerLifetimeScope(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(_folders).As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - _container = builder.Build(); - _recipeManager = _container.Resolve(); - _recipeParser = _container.Resolve(); - _recipeHarvester = _container.Resolve(); - } - - [TearDown] - public void Term() { - Directory.Delete(_tempFolderName, true); - } - - [Test] - public void HarvestRecipesFailsToFindRecipesWhenCalledWithNotExistingExtension() { - var recipes = _recipeHarvester.HarvestRecipes("cantfindme"); - - Assert.That(recipes.Count(), Is.EqualTo(0)); - } - - [Test] - public void HarvestRecipesShouldHarvestRecipeXmlFiles() { - var recipes = _recipeHarvester.HarvestRecipes("Sample1"); - Assert.That(recipes.Count(), Is.EqualTo(1)); - } - - [Test] - public void ParseRecipeLoadsRecipeMetaDataIntoModel() { - var recipes = _recipeHarvester.HarvestRecipes("Sample1"); - Assert.That(recipes.Count(), Is.EqualTo(1)); - - var sampleRecipe = recipes.First(); - Assert.That(sampleRecipe.Name, Is.EqualTo("cms")); - Assert.That(sampleRecipe.Description, Is.EqualTo("a sample Orchard recipe describing a cms")); - Assert.That(sampleRecipe.Author, Is.EqualTo("orchard")); - Assert.That(sampleRecipe.Version, Is.EqualTo("1.1")); - Assert.That(sampleRecipe.IsSetupRecipe, Is.True); - Assert.That(sampleRecipe.WebSite, Is.EqualTo("http://orchardproject.net")); - Assert.That(sampleRecipe.Tags, Is.EqualTo("tag1, tag2")); - } - - [Test] - public void ParseRecipeLoadsRecipeStepsIntoModel() { - var recipes = (List)_recipeHarvester.HarvestRecipes("Sample1"); - Assert.That(recipes.Count, Is.EqualTo(1)); - - var sampleRecipe = recipes[0]; - var recipeSteps = (List) sampleRecipe.RecipeSteps; - - Assert.That(recipeSteps.Count, Is.EqualTo(9)); - } - - [Test] - public void ParseRecipeThrowsOnInvalidXml() { - Assert.Throws(typeof(XmlException), () => _recipeParser.ParseRecipe("")); - } - - [Test] - public void ExecuteInvokesHandlersWithSteps() { - var recipes = (List)_recipeHarvester.HarvestRecipes("Sample1"); - Assert.That(recipes.Count, Is.EqualTo(1)); - - var sampleRecipe = recipes[0]; - _recipeManager.Execute(sampleRecipe); - - Assert.That(CustomRecipeHandler.AttributeValue == "value1"); - } - } - - public class StubRecipeJournal : IRecipeJournal { - public void ExecutionStart(string executionId) { - } - - public void ExecutionComplete(string executionId) { - } - - public void ExecutionFailed(string executionId) { - } - - public void WriteJournalEntry(string executionId, string message) { - } - - public RecipeJournal GetRecipeJournal(string executionId) { - return new RecipeJournal(); - } - - public RecipeStatus GetRecipeStatus(string executionId) { - return RecipeStatus.Complete; - } - } - - public class StubStepQueue : IRecipeStepQueue { - readonly Queue _queue = new Queue(); - - public void Enqueue(string executionId, RecipeStep step) { - _queue.Enqueue(step); - } - - public RecipeStep Dequeue(string executionId) { - return _queue.Count == 0 ? null : _queue.Dequeue(); - } - } - - public class StubRecipeScheduler : IRecipeScheduler { - private readonly IRecipeStepExecutor _recipeStepExecutor; - - public StubRecipeScheduler(IRecipeStepExecutor recipeStepExecutor) { - _recipeStepExecutor = recipeStepExecutor; - } - - public void ScheduleWork(string executionId) { - while (_recipeStepExecutor.ExecuteNextStep(executionId)) ; - } - } - - public class CustomRecipeHandler : IRecipeHandler { - public static string AttributeValue; - public string[] _handles = {"Module", "Theme", "Migration", "Custom1", "Custom2", "Command", "Metadata", "Feature", "Settings"}; - - public void ExecuteRecipeStep(RecipeContext recipeContext) { - if (_handles.Contains(recipeContext.RecipeStep.Name)) { - recipeContext.Executed = true; - } - if (recipeContext.RecipeStep.Name == "Custom1") { - foreach (var attribute in recipeContext.RecipeStep.Step.Attributes().Where(attribute => attribute.Name == "attr1")) { - AttributeValue = attribute.Value; - recipeContext.Executed = true; - } - } - } - } +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Xml; +using Autofac; +using Moq; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.Environment.Extensions; +using Orchard.Environment.Extensions.Folders; +using Orchard.Environment.Extensions.Loaders; +using Orchard.FileSystems.AppData; +using Orchard.FileSystems.WebSite; +using Orchard.Recipes.Models; +using Orchard.Recipes.Services; +using Orchard.Services; +using Orchard.Tests.Stubs; +using Orchard.Recipes.Events; + +namespace Orchard.Tests.Modules.Recipes.Services { + [TestFixture] + public class RecipeManagerTests { + private IContainer _container; + private IRecipeManager _recipeManager; + private IRecipeHarvester _recipeHarvester; + private IRecipeParser _recipeParser; + private IExtensionFolders _folders; + + private const string DataPrefix = "Orchard.Tests.Modules.Recipes.Services.FoldersData."; + private string _tempFolderName; + + [SetUp] + public void Init() { + _tempFolderName = Path.GetTempFileName(); + File.Delete(_tempFolderName); + var assembly = GetType().Assembly; + foreach (var name in assembly.GetManifestResourceNames()) { + if (name.StartsWith(DataPrefix)) { + string text; + using (var stream = assembly.GetManifestResourceStream(name)) { + using (var reader = new StreamReader(stream)) + text = reader.ReadToEnd(); + + } + + // Pro filtering + var relativePath = name + .Substring(DataPrefix.Length) + .Replace(".txt", ":txt") + .Replace(".recipe.xml", ":recipe:xml") + .Replace('.', Path.DirectorySeparatorChar) + .Replace(":txt", ".txt") + .Replace(":recipe:xml", ".recipe.xml"); + + var targetPath = Path.Combine(_tempFolderName, relativePath); + + Directory.CreateDirectory(Path.GetDirectoryName(targetPath)); + using (var stream = new FileStream(targetPath, FileMode.Create)) { + using (var writer = new StreamWriter(stream)) { + writer.Write(text); + } + } + } + } + + var builder = new ContainerBuilder(); + var harvester = new ExtensionHarvester(new StubCacheManager(), new StubWebSiteFolder(), new Mock().Object); + _folders = new ModuleFolders(new[] { _tempFolderName }, harvester); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As().InstancePerLifetimeScope(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(_folders).As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + _container = builder.Build(); + _recipeManager = _container.Resolve(); + _recipeParser = _container.Resolve(); + _recipeHarvester = _container.Resolve(); + } + + [TearDown] + public void Term() { + Directory.Delete(_tempFolderName, true); + } + + [Test] + public void HarvestRecipesFailsToFindRecipesWhenCalledWithNotExistingExtension() { + var recipes = _recipeHarvester.HarvestRecipes("cantfindme"); + + Assert.That(recipes.Count(), Is.EqualTo(0)); + } + + [Test] + public void HarvestRecipesShouldHarvestRecipeXmlFiles() { + var recipes = _recipeHarvester.HarvestRecipes("Sample1"); + Assert.That(recipes.Count(), Is.EqualTo(1)); + } + + [Test] + public void ParseRecipeLoadsRecipeMetaDataIntoModel() { + var recipes = _recipeHarvester.HarvestRecipes("Sample1"); + Assert.That(recipes.Count(), Is.EqualTo(1)); + + var sampleRecipe = recipes.First(); + Assert.That(sampleRecipe.Name, Is.EqualTo("cms")); + Assert.That(sampleRecipe.Description, Is.EqualTo("a sample Orchard recipe describing a cms")); + Assert.That(sampleRecipe.Author, Is.EqualTo("orchard")); + Assert.That(sampleRecipe.Version, Is.EqualTo("1.1")); + Assert.That(sampleRecipe.IsSetupRecipe, Is.True); + Assert.That(sampleRecipe.WebSite, Is.EqualTo("http://orchardproject.net")); + Assert.That(sampleRecipe.Tags, Is.EqualTo("tag1, tag2")); + } + + [Test] + public void ParseRecipeLoadsRecipeStepsIntoModel() { + var recipes = (List)_recipeHarvester.HarvestRecipes("Sample1"); + Assert.That(recipes.Count, Is.EqualTo(1)); + + var sampleRecipe = recipes[0]; + var recipeSteps = (List) sampleRecipe.RecipeSteps; + + Assert.That(recipeSteps.Count, Is.EqualTo(9)); + } + + [Test] + public void ParseRecipeThrowsOnInvalidXml() { + Assert.Throws(typeof(XmlException), () => _recipeParser.ParseRecipe("")); + } + + [Test] + public void ExecuteInvokesHandlersWithSteps() { + var recipes = (List)_recipeHarvester.HarvestRecipes("Sample1"); + Assert.That(recipes.Count, Is.EqualTo(1)); + + var sampleRecipe = recipes[0]; + _recipeManager.Execute(sampleRecipe); + + Assert.That(CustomRecipeHandler.AttributeValue == "value1"); + } + } + + public class StubRecipeJournal : IRecipeJournal { + public void ExecutionStart(string executionId) { + } + + public void ExecutionComplete(string executionId) { + } + + public void ExecutionFailed(string executionId) { + } + + public void WriteJournalEntry(string executionId, string message) { + } + + public RecipeJournal GetRecipeJournal(string executionId) { + return new RecipeJournal(); + } + + public RecipeStatus GetRecipeStatus(string executionId) { + return RecipeStatus.Complete; + } + } + + public class StubStepQueue : IRecipeStepQueue { + readonly Queue _queue = new Queue(); + + public void Enqueue(string executionId, RecipeStep step) { + _queue.Enqueue(step); + } + + public RecipeStep Dequeue(string executionId) { + return _queue.Count == 0 ? null : _queue.Dequeue(); + } + } + + public class StubRecipeScheduler : IRecipeScheduler { + private readonly IRecipeStepExecutor _recipeStepExecutor; + + public StubRecipeScheduler(IRecipeStepExecutor recipeStepExecutor) { + _recipeStepExecutor = recipeStepExecutor; + } + + public void ScheduleWork(string executionId) { + while (_recipeStepExecutor.ExecuteNextStep(executionId)) ; + } + } + + public class CustomRecipeHandler : IRecipeHandler { + public static string AttributeValue; + public string[] _handles = {"Module", "Theme", "Migration", "Custom1", "Custom2", "Command", "Metadata", "Feature", "Settings"}; + + public void ExecuteRecipeStep(RecipeContext recipeContext) { + if (_handles.Contains(recipeContext.RecipeStep.Name)) { + recipeContext.Executed = true; + } + if (recipeContext.RecipeStep.Name == "Custom1") { + foreach (var attribute in recipeContext.RecipeStep.Step.Attributes().Where(attribute => attribute.Name == "attr1")) { + AttributeValue = attribute.Value; + recipeContext.Executed = true; + } + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests.Modules/Roles/Controllers/AdminControllerTests.cs b/src/Orchard.Tests.Modules/Roles/Controllers/AdminControllerTests.cs index 6c75ea3972b..645c719cdf6 100644 --- a/src/Orchard.Tests.Modules/Roles/Controllers/AdminControllerTests.cs +++ b/src/Orchard.Tests.Modules/Roles/Controllers/AdminControllerTests.cs @@ -1,4 +1,4 @@ -namespace Orchard.Tests.Modules.Roles.Controllers { - class AdminControllerTests { - } -} +namespace Orchard.Tests.Modules.Roles.Controllers { + class AdminControllerTests { + } +} diff --git a/src/Orchard.Tests.Modules/Roles/Services/RoleServiceTests.cs b/src/Orchard.Tests.Modules/Roles/Services/RoleServiceTests.cs index b0d82d142f8..667074bc3ae 100644 --- a/src/Orchard.Tests.Modules/Roles/Services/RoleServiceTests.cs +++ b/src/Orchard.Tests.Modules/Roles/Services/RoleServiceTests.cs @@ -1,108 +1,108 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Autofac; -using Moq; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.Environment.Extensions.Models; -using Orchard.Roles.Events; -using Orchard.Roles.Models; -using Orchard.Roles.Services; -using Orchard.Security.Permissions; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.Modules.Roles.Services { - [TestFixture] - public class RoleServiceTests : DatabaseEnabledTestsBase { - public override void Register(ContainerBuilder builder) { - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - } - - public class TestPermissionProvider : IPermissionProvider { - public Feature Feature { - get { return new Feature { Descriptor = new FeatureDescriptor { Id = "RoleServiceTests" } }; } - } - - public IEnumerable GetPermissions() { - return "alpha,beta,gamma,delta".Split(',').Select(name => new Permission { Name = name }); - } - - public IEnumerable GetDefaultStereotypes() { - return Enumerable.Empty(); - } - } - - protected override IEnumerable DatabaseTypes { - get { - return new[] { typeof(RoleRecord), typeof(PermissionRecord), typeof(RolesPermissionsRecord) }; - } - } - - [Test] - public void CreateRoleShouldAddToList() { - var service = _container.Resolve(); - service.CreateRole("one"); - service.CreateRole("two"); - service.CreateRole("three"); - - ClearSession(); - - var roles = service.GetRoles(); - Assert.That(roles.Count(), Is.EqualTo(3)); - Assert.That(roles, Has.Some.Property("Name").EqualTo("one")); - Assert.That(roles, Has.Some.Property("Name").EqualTo("two")); - Assert.That(roles, Has.Some.Property("Name").EqualTo("three")); - } - - [Test] - public void PermissionChangesShouldBeVisibleImmediately() { - - var service = _container.Resolve(); - - ClearSession(); - { - service.CreateRole("test"); - var roleId = service.GetRoleByName("test").Id; - service.UpdateRole(roleId, "test", new[] { "alpha", "beta", "gamma" }); - } - - ClearSession(); - { - var result = service.GetPermissionsForRoleByName("test"); - Assert.That(result.Count(), Is.EqualTo(3)); - } - - ClearSession(); - { - var roleId = service.GetRoleByName("test").Id; - service.UpdateRole(roleId, "test", new[] { "alpha", "beta", "gamma", "delta" }); - } - - ClearSession(); - { - var result = service.GetPermissionsForRoleByName("test"); - Assert.That(result.Count(), Is.EqualTo(4)); - } - } - - [Test] - public void ShouldNotCreateARoleTwice() { - var service = _container.Resolve(); - service.CreateRole("one"); - service.CreateRole("two"); - service.CreateRole("one"); - - ClearSession(); - - var roles = service.GetRoles(); - Assert.That(roles.Count(), Is.EqualTo(2)); - Assert.That(roles, Has.Some.Property("Name").EqualTo("one")); - Assert.That(roles, Has.Some.Property("Name").EqualTo("two")); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using Autofac; +using Moq; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.Environment.Extensions.Models; +using Orchard.Roles.Events; +using Orchard.Roles.Models; +using Orchard.Roles.Services; +using Orchard.Security.Permissions; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.Modules.Roles.Services { + [TestFixture] + public class RoleServiceTests : DatabaseEnabledTestsBase { + public override void Register(ContainerBuilder builder) { + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + } + + public class TestPermissionProvider : IPermissionProvider { + public Feature Feature { + get { return new Feature { Descriptor = new FeatureDescriptor { Id = "RoleServiceTests" } }; } + } + + public IEnumerable GetPermissions() { + return "alpha,beta,gamma,delta".Split(',').Select(name => new Permission { Name = name }); + } + + public IEnumerable GetDefaultStereotypes() { + return Enumerable.Empty(); + } + } + + protected override IEnumerable DatabaseTypes { + get { + return new[] { typeof(RoleRecord), typeof(PermissionRecord), typeof(RolesPermissionsRecord) }; + } + } + + [Test] + public void CreateRoleShouldAddToList() { + var service = _container.Resolve(); + service.CreateRole("one"); + service.CreateRole("two"); + service.CreateRole("three"); + + ClearSession(); + + var roles = service.GetRoles(); + Assert.That(roles.Count(), Is.EqualTo(3)); + Assert.That(roles, Has.Some.Property("Name").EqualTo("one")); + Assert.That(roles, Has.Some.Property("Name").EqualTo("two")); + Assert.That(roles, Has.Some.Property("Name").EqualTo("three")); + } + + [Test] + public void PermissionChangesShouldBeVisibleImmediately() { + + var service = _container.Resolve(); + + ClearSession(); + { + service.CreateRole("test"); + var roleId = service.GetRoleByName("test").Id; + service.UpdateRole(roleId, "test", new[] { "alpha", "beta", "gamma" }); + } + + ClearSession(); + { + var result = service.GetPermissionsForRoleByName("test"); + Assert.That(result.Count(), Is.EqualTo(3)); + } + + ClearSession(); + { + var roleId = service.GetRoleByName("test").Id; + service.UpdateRole(roleId, "test", new[] { "alpha", "beta", "gamma", "delta" }); + } + + ClearSession(); + { + var result = service.GetPermissionsForRoleByName("test"); + Assert.That(result.Count(), Is.EqualTo(4)); + } + } + + [Test] + public void ShouldNotCreateARoleTwice() { + var service = _container.Resolve(); + service.CreateRole("one"); + service.CreateRole("two"); + service.CreateRole("one"); + + ClearSession(); + + var roles = service.GetRoles(); + Assert.That(roles.Count(), Is.EqualTo(2)); + Assert.That(roles, Has.Some.Property("Name").EqualTo("one")); + Assert.That(roles, Has.Some.Property("Name").EqualTo("two")); + } + } +} diff --git a/src/Orchard.Tests.Modules/Scripting.Dlr/EvaluatorTests.cs b/src/Orchard.Tests.Modules/Scripting.Dlr/EvaluatorTests.cs index 5dd2b3acae9..ace8f33d950 100644 --- a/src/Orchard.Tests.Modules/Scripting.Dlr/EvaluatorTests.cs +++ b/src/Orchard.Tests.Modules/Scripting.Dlr/EvaluatorTests.cs @@ -1,50 +1,50 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using Autofac; -using NUnit.Framework; -using Orchard.Scripting; -using Orchard.Scripting.Compiler; -using Orchard.Scripting.Dlr.Services; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.Modules.Scripting.Dlr { - [TestFixture] - public class EvaluatorTests : EvaluatorTestsBase { - private IContainer _container; - private IScriptingManager _scriptingManager; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - builder.RegisterType().As(); - builder.RegisterType().As(); - _container = builder.Build(); - _scriptingManager = _container.Resolve(); - } - - protected override EvaluationResult EvaluateSimpleExpression(string expression, Func, object> methodInvocationCallback) { - var evaluator = new RubyScriptExpressionEvaluator(_scriptingManager, new StubCacheManager()); - try { - var value = evaluator.Evaluate(expression, new[] { new GlobalMethodProvider(methodInvocationCallback) }); - return new EvaluationResult(value); - } - catch (Exception e) { - Trace.WriteLine(string.Format("Error during evaluation of '{0}': {1}", expression, e.Message)); - return new EvaluationResult(new Error { Message = e.Message, Exception = e }); - } - } - - private class GlobalMethodProvider : IGlobalMethodProvider { - private readonly Func, object> _methodInvocationCallback; - - public GlobalMethodProvider(Func, object> methodInvocationCallback) { - _methodInvocationCallback = methodInvocationCallback; - } - - public void Process(GlobalMethodContext context) { - context.Result = _methodInvocationCallback(context.FunctionName, context.Arguments); - } - } - } -} +using System; +using System.Collections.Generic; +using System.Diagnostics; +using Autofac; +using NUnit.Framework; +using Orchard.Scripting; +using Orchard.Scripting.Compiler; +using Orchard.Scripting.Dlr.Services; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.Modules.Scripting.Dlr { + [TestFixture] + public class EvaluatorTests : EvaluatorTestsBase { + private IContainer _container; + private IScriptingManager _scriptingManager; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + builder.RegisterType().As(); + _container = builder.Build(); + _scriptingManager = _container.Resolve(); + } + + protected override EvaluationResult EvaluateSimpleExpression(string expression, Func, object> methodInvocationCallback) { + var evaluator = new RubyScriptExpressionEvaluator(_scriptingManager, new StubCacheManager()); + try { + var value = evaluator.Evaluate(expression, new[] { new GlobalMethodProvider(methodInvocationCallback) }); + return new EvaluationResult(value); + } + catch (Exception e) { + Trace.WriteLine(string.Format("Error during evaluation of '{0}': {1}", expression, e.Message)); + return new EvaluationResult(new Error { Message = e.Message, Exception = e }); + } + } + + private class GlobalMethodProvider : IGlobalMethodProvider { + private readonly Func, object> _methodInvocationCallback; + + public GlobalMethodProvider(Func, object> methodInvocationCallback) { + _methodInvocationCallback = methodInvocationCallback; + } + + public void Process(GlobalMethodContext context) { + context.Result = _methodInvocationCallback(context.FunctionName, context.Arguments); + } + } + } +} diff --git a/src/Orchard.Tests.Modules/Scripting.Dlr/ScriptingTests.cs b/src/Orchard.Tests.Modules/Scripting.Dlr/ScriptingTests.cs index dbf09e96109..01cbc5d13dd 100644 --- a/src/Orchard.Tests.Modules/Scripting.Dlr/ScriptingTests.cs +++ b/src/Orchard.Tests.Modules/Scripting.Dlr/ScriptingTests.cs @@ -1,103 +1,103 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using Autofac; -using NUnit.Framework; -using Orchard.Scripting.Dlr.Services; -using Path = Bleroy.FluentPath.Path; - -namespace Orchard.Tests.Modules.Scripting.Dlr { - [TestFixture] - public class ScriptingTests { - private IContainer _container; - private IScriptingRuntime _scriptingRuntime; - private IScriptingManager _scriptingManager; - private readonly Path _tempFixtureFolderName = Path.Get(System.IO.Path.GetTempPath()).Combine("Orchard.Tests.Modules.Scripting"); - private Path _tempFolderName; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - builder.RegisterType().As(); - builder.RegisterType().As(); - _container = builder.Build(); - _scriptingRuntime = _container.Resolve(); - _scriptingManager = _container.Resolve(); - _tempFolderName = _tempFixtureFolderName.Combine(System.IO.Path.GetRandomFileName()); - try { - _tempFolderName.Delete(); - } - catch { } - _tempFolderName.CreateDirectory(); - } - - [TearDown] - public void Term() { - try { _tempFixtureFolderName.Delete(true); } - catch { } - } - - [Test] - public void CreateScopeReturnsWorkingScope() { - var scope = _scriptingRuntime.CreateScope(); - - Assert.IsNotNull(scope); - scope.SetVariable("alpha", 42); - Assert.That(scope.GetVariable("alpha"), Is.EqualTo(42)); - } - - [Test] - public void ScriptingManagerCanGetAndSetRubyVariables() { - _scriptingManager.SetVariable("foo", 42); - Assert.That(_scriptingManager.GetVariable("foo"), Is.EqualTo(42)); - } - - [Test] - public void ScriptingManagerCanEvalExpression() { - _scriptingManager.SetVariable("foo", 21); - Assert.That(_scriptingManager.ExecuteExpression("foo + 21"), Is.EqualTo(42)); - } - - [Test] - public void ScriptCanBeExecutedAndScopeProvidesContextIsolation() { - var scriptManager1 = new ScriptingManager(_scriptingRuntime); - var scriptManager2 = new ScriptingManager(_scriptingRuntime); - - scriptManager1.SetVariable("foo", 1); - scriptManager2.SetVariable("foo", 2); - - var result1 = scriptManager1.ExecuteExpression("3 + foo"); - var result2 = scriptManager2.ExecuteExpression("3 + foo"); - - Assert.That(result1, Is.EqualTo(4)); - Assert.That(result2, Is.EqualTo(5)); - } - - [Test] - public void ScriptingManagerCanExecuteFile() { - var targetPath = _tempFolderName.Combine("SampleMethodDefinition.rb"); - File.WriteAllText(targetPath, "def f\r\nreturn 32\r\nend\r\n"); - _scriptingManager.ExecuteFile(targetPath); - Assert.That(_scriptingManager.ExecuteExpression("f / 4"), Is.EqualTo(8)); - } - - [Test] - public void CanDeclareCallbackOnInstanceEvalWithFile() { - var targetPath = _tempFolderName.Combine("CallbackOnInstanceEval.rb"); - File.WriteAllText(targetPath, "class ExecContext\r\ndef initialize(callbacks)\r\n@callbacks = callbacks;\r\nend\r\ndef execute(text)\r\ninstance_eval(text.to_s);\r\nend\r\ndef method_missing(name, *args, &block)\r\n@callbacks.send(name, args, &block);\r\nend\r\nend\r\ndef execute(&block)\r\nExecContext.new(callbacks).instance_eval(&block);\r\nend\r\n"); - _scriptingManager.ExecuteFile(targetPath); - _scriptingManager.SetVariable("callbacks", new CallbackApi()); - - Assert.That(_scriptingManager.ExecuteExpression("execute { 1 + hello + world('yep') }"), Is.EqualTo(11)); - } - - public class CallbackApi { - public object send(string name, IList args) { - Trace.WriteLine("Returning length of method " + name); - return name.Length; - } - } - } -} - +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using Autofac; +using NUnit.Framework; +using Orchard.Scripting.Dlr.Services; +using Path = Bleroy.FluentPath.Path; + +namespace Orchard.Tests.Modules.Scripting.Dlr { + [TestFixture] + public class ScriptingTests { + private IContainer _container; + private IScriptingRuntime _scriptingRuntime; + private IScriptingManager _scriptingManager; + private readonly Path _tempFixtureFolderName = Path.Get(System.IO.Path.GetTempPath()).Combine("Orchard.Tests.Modules.Scripting"); + private Path _tempFolderName; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + builder.RegisterType().As(); + _container = builder.Build(); + _scriptingRuntime = _container.Resolve(); + _scriptingManager = _container.Resolve(); + _tempFolderName = _tempFixtureFolderName.Combine(System.IO.Path.GetRandomFileName()); + try { + _tempFolderName.Delete(); + } + catch { } + _tempFolderName.CreateDirectory(); + } + + [TearDown] + public void Term() { + try { _tempFixtureFolderName.Delete(true); } + catch { } + } + + [Test] + public void CreateScopeReturnsWorkingScope() { + var scope = _scriptingRuntime.CreateScope(); + + Assert.IsNotNull(scope); + scope.SetVariable("alpha", 42); + Assert.That(scope.GetVariable("alpha"), Is.EqualTo(42)); + } + + [Test] + public void ScriptingManagerCanGetAndSetRubyVariables() { + _scriptingManager.SetVariable("foo", 42); + Assert.That(_scriptingManager.GetVariable("foo"), Is.EqualTo(42)); + } + + [Test] + public void ScriptingManagerCanEvalExpression() { + _scriptingManager.SetVariable("foo", 21); + Assert.That(_scriptingManager.ExecuteExpression("foo + 21"), Is.EqualTo(42)); + } + + [Test] + public void ScriptCanBeExecutedAndScopeProvidesContextIsolation() { + var scriptManager1 = new ScriptingManager(_scriptingRuntime); + var scriptManager2 = new ScriptingManager(_scriptingRuntime); + + scriptManager1.SetVariable("foo", 1); + scriptManager2.SetVariable("foo", 2); + + var result1 = scriptManager1.ExecuteExpression("3 + foo"); + var result2 = scriptManager2.ExecuteExpression("3 + foo"); + + Assert.That(result1, Is.EqualTo(4)); + Assert.That(result2, Is.EqualTo(5)); + } + + [Test] + public void ScriptingManagerCanExecuteFile() { + var targetPath = _tempFolderName.Combine("SampleMethodDefinition.rb"); + File.WriteAllText(targetPath, "def f\r\nreturn 32\r\nend\r\n"); + _scriptingManager.ExecuteFile(targetPath); + Assert.That(_scriptingManager.ExecuteExpression("f / 4"), Is.EqualTo(8)); + } + + [Test] + public void CanDeclareCallbackOnInstanceEvalWithFile() { + var targetPath = _tempFolderName.Combine("CallbackOnInstanceEval.rb"); + File.WriteAllText(targetPath, "class ExecContext\r\ndef initialize(callbacks)\r\n@callbacks = callbacks;\r\nend\r\ndef execute(text)\r\ninstance_eval(text.to_s);\r\nend\r\ndef method_missing(name, *args, &block)\r\n@callbacks.send(name, args, &block);\r\nend\r\nend\r\ndef execute(&block)\r\nExecContext.new(callbacks).instance_eval(&block);\r\nend\r\n"); + _scriptingManager.ExecuteFile(targetPath); + _scriptingManager.SetVariable("callbacks", new CallbackApi()); + + Assert.That(_scriptingManager.ExecuteExpression("execute { 1 + hello + world('yep') }"), Is.EqualTo(11)); + } + + public class CallbackApi { + public object send(string name, IList args) { + Trace.WriteLine("Returning length of method " + name); + return name.Length; + } + } + } +} + diff --git a/src/Orchard.Tests.Modules/Scripting/EvaluatorTests.cs b/src/Orchard.Tests.Modules/Scripting/EvaluatorTests.cs index f93c211e8e9..ea28ee5e437 100644 --- a/src/Orchard.Tests.Modules/Scripting/EvaluatorTests.cs +++ b/src/Orchard.Tests.Modules/Scripting/EvaluatorTests.cs @@ -1,29 +1,29 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using NUnit.Framework; -using Orchard.Scripting.Compiler; - -namespace Orchard.Tests.Modules.Scripting { - [TestFixture] - public class EvaluatorTests : EvaluatorTestsBase { - protected override EvaluationResult EvaluateSimpleExpression(string expression, Func, object> methodInvocationCallback) { - var ast = new Parser(expression).Parse(); - foreach (var error in ast.GetErrors()) { - Trace.WriteLine(string.Format("Error during parsing of '{0}': {1}", expression, error.Message)); - } - - if (ast.GetErrors().Any()) { - return new EvaluationResult(new Error { Message = ast.GetErrors().First().Message }); - } - - var result = new Interpreter().Evalutate(new EvaluationContext { - Tree = ast, - MethodInvocationCallback = methodInvocationCallback - }); - Trace.WriteLine(string.Format("Result of evaluation of '{0}': {1}", expression, result)); - return result; - } - } +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using NUnit.Framework; +using Orchard.Scripting.Compiler; + +namespace Orchard.Tests.Modules.Scripting { + [TestFixture] + public class EvaluatorTests : EvaluatorTestsBase { + protected override EvaluationResult EvaluateSimpleExpression(string expression, Func, object> methodInvocationCallback) { + var ast = new Parser(expression).Parse(); + foreach (var error in ast.GetErrors()) { + Trace.WriteLine(string.Format("Error during parsing of '{0}': {1}", expression, error.Message)); + } + + if (ast.GetErrors().Any()) { + return new EvaluationResult(new Error { Message = ast.GetErrors().First().Message }); + } + + var result = new Interpreter().Evalutate(new EvaluationContext { + Tree = ast, + MethodInvocationCallback = methodInvocationCallback + }); + Trace.WriteLine(string.Format("Result of evaluation of '{0}': {1}", expression, result)); + return result; + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests.Modules/Scripting/EvaluatorTestsBase.cs b/src/Orchard.Tests.Modules/Scripting/EvaluatorTestsBase.cs index 0605e801d5d..f9530cb4ca3 100644 --- a/src/Orchard.Tests.Modules/Scripting/EvaluatorTestsBase.cs +++ b/src/Orchard.Tests.Modules/Scripting/EvaluatorTestsBase.cs @@ -1,526 +1,526 @@ -using System; -using System.Collections.Generic; -using NUnit.Framework; -using Orchard.Scripting.Compiler; - -namespace Orchard.Tests.Modules.Scripting { - public abstract class EvaluatorTestsBase { - [Test] - public void EvaluateSimpleConstant() { - var result = EvaluateSimpleExpression("true and true"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateSimpleConstant0() { - var result = EvaluateSimpleExpression("true && true"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateConvertingBooleanExpression() { - var result = EvaluateSimpleExpression("true and 1"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(1)); - } - - [Test] - public void EvaluateConvertingBooleanExpression1() { - var result = EvaluateSimpleExpression("true && 1"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(1)); - } - - [Test] - public void EvaluateConvertingBooleanExpression2() { - var result = EvaluateSimpleExpression("true and 0"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(0)); - } - - [Test] - public void EvaluateConvertingBooleanExpression3() { - var result = EvaluateSimpleExpression("true && 0"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(0)); - } - - [Test] - public void EvaluateConvertingBooleanExpression4() { - var result = EvaluateSimpleExpression("1 and true"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateConvertingBooleanExpression5() { - var result = EvaluateSimpleExpression("0 and true"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateConvertingBooleanExpression6() { - var result = EvaluateSimpleExpression("1 && true"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateConvertingBooleanExpression7() { - var result = EvaluateSimpleExpression("true and 'boo'"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo("boo")); - } - - [Test] - public void EvaluateConvertingBooleanExpression8() { - var result = EvaluateSimpleExpression("true && 'boo'"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo("boo")); - } - - [Test] - public void EvaluateConvertingBooleanExpression9() { - var result = EvaluateSimpleExpression("'boo' and true"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateConvertingBooleanExpression10() { - var result = EvaluateSimpleExpression("'boo' && true"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateConvertingBooleanExpression11() { - var result = EvaluateSimpleExpression("true or 1"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateConvertingBooleanExpression12() { - var result = EvaluateSimpleExpression("true || 1"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateConvertingBooleanExpression13() { - var result = EvaluateSimpleExpression("1 or true"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(1)); - } - - [Test] - public void EvaluateConvertingBooleanExpression14() { - var result = EvaluateSimpleExpression("1 || true"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(1)); - } - - [Test] - public void EvaluateConvertingBooleanExpression15() { - var result = EvaluateSimpleExpression("true or 'boo'"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateConvertingBooleanExpression16() { - var result = EvaluateSimpleExpression("false or 'boo'"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo("boo")); - } - - [Test] - public void EvaluateConvertingBooleanExpression17() { - var result = EvaluateSimpleExpression("nil or 'boo'"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo("boo")); - } - - [Test] - public void EvaluateConvertingBooleanExpression18() { - var result = EvaluateSimpleExpression("'boo' or nil"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo("boo")); - } - - [Test] - public void EvaluateConvertingBooleanExpression19() { - var result = EvaluateSimpleExpression("true || 'boo'"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateConvertingBooleanExpression20() { - var result = EvaluateSimpleExpression("'boo' or true"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo("boo")); - } - - [Test] - public void EvaluateConvertingBooleanExpression21() { - var result = EvaluateSimpleExpression("'boo' || true"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo("boo")); - } - - [Test] - public void EvaluateConvertingBooleanExpression22() { - var result = EvaluateSimpleExpression("1 and 2"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(2)); - } - - [Test] - public void EvaluateConvertingBooleanExpression23() { - var result = EvaluateSimpleExpression("false and 2"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(false)); - } - - [Test] - public void EvaluateConvertingBooleanExpression24() { - var result = EvaluateSimpleExpression("nil and 2"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(null)); - } - - [Test] - public void EvaluateConvertingBooleanExpression25() { - var result = EvaluateSimpleExpression("nil and false"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(null)); - } - - [Test] - public void EvaluateConvertingBooleanExpression26() { - var result = EvaluateSimpleExpression("nil and true"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(null)); - } - - [Test] - public void EvaluateBooleanExpression() { - var result = EvaluateSimpleExpression("not true"); - Assert.That(result.IsError, Is.False); - Assert.That(result.BoolValue, Is.EqualTo(false)); - } - - [Test] - public void EvaluateBooleanExpression0() { - var result = EvaluateSimpleExpression("!true"); - Assert.That(result.IsError, Is.False); - Assert.That(result.BoolValue, Is.EqualTo(false)); - } - - [Test] - public void EvaluateSimpleArithmetic() { - var result = EvaluateSimpleExpression("1 + 2 * 3 - 6 / 2"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(4)); - } - - [Test] - public void EvaluateRelationalOperators() { - var result = EvaluateSimpleExpression("1 < 2"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateRelationalOperators2() { - var result = EvaluateSimpleExpression("2 <= 2"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateRelationalOperators3() { - var result = EvaluateSimpleExpression("1 < 2 or 2 > 3 and !false"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateRelationalOperators4() { - var result = EvaluateSimpleExpression("1 > 2 or 2 > 3 and !false"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(false)); - } - - [Test] - public void EvaluateRelationalOperators5() { - var result = EvaluateSimpleExpression("1 > 2 or 4 > 3 and !false"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateRelationalOperators6() { - var result = EvaluateSimpleExpression("!false"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateRelationalOperators7() { - var result = EvaluateSimpleExpression("5 || 10 && nil"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(5)); - } - - [Test] - public void EvaluateRelationalOperators8() { - var result = EvaluateSimpleExpression("true or false and nil"); - Assert.That(result.IsError, Is.False); - Assert.That(result.IsNull, Is.True); - } - - [Test] - public void EvaluateRelationalOperators9() { - var result = EvaluateSimpleExpression("true and nil"); - Assert.That(result.IsError, Is.False); - Assert.That(result.IsNull, Is.True); - } - - [Test] - public void EvaluateRelationalOperators10() { - var result = EvaluateSimpleExpression("5 and nil"); - Assert.That(result.IsError, Is.False); - Assert.That(result.IsNull, Is.True); - } - - [Test] - public void EvaluateEqualityOperators() { - var result = EvaluateSimpleExpression("1 == 2"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(false)); - } - - [Test] - public void EvaluateEqualityOperators2() { - var result = EvaluateSimpleExpression("1 != 2"); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateSimpleMethodCall() { - var result = EvaluateSimpleExpression("printtoto 1 + 2 * 3 - 6 / 2", - (m, args) => (m == "printtoto") ? (int)args[0] * 2 : 0); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(4 * 2)); - } - - [Test] - public void EvaluateSimpleMethodCall2() { - var result = EvaluateSimpleExpression("printtoto(1 + 2 * 3 - 6 / 2)", - (m, args) => (m == "printtoto") ? (int)args[0] * 2 : 0); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(4 * 2)); - } - - [Test] - public void EvaluateSimpleMethodCall3() { - var result = EvaluateSimpleExpression("foo 1 + bar 3", - (m, args) => - (m == "foo") ? (int)args[0] * 2 : - (m == "bar") ? (int)args[0] : 0); - Assert.That(result.IsError, Is.True); - } - - [Test] - public void EvaluateSimpleMethodCall4() { - var result = EvaluateSimpleExpression("foo(1 + bar 3)", - (m, args) => - (m == "foo") ? (int)args[0] * 2 : - (m == "bar") ? (int)args[0] : 0); - Assert.That(result.IsError, Is.True); - } - - [Test] - public void EvaluateSimpleMethodCall5() { - var result = EvaluateSimpleExpression("foo 1 + bar(3)", - (m, args) => - (m == "foo") ? (int)args[0] * 2 : - (m == "bar") ? (int)args[0] : 0); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(2 * (1 + 3))); - } - - [Test] - public void EvaluateSimpleMethodCall6() { - var result = EvaluateSimpleExpression("foo(1) + bar(3)", - (m, args) => - (m == "foo") ? (int)args[0] * 2 : - (m == "bar") ? (int)args[0] : 0); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(2 + 3)); - } - - [Test] - public void EvaluateSimpleMethodCall7() { - var result = EvaluateSimpleExpression("foo", - (m, args) => (m == "foo") ? true : false); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateSimpleMethodCall8() { - var result = EvaluateSimpleExpression("foo()", - (m, args) => (m == "foo") ? true : false); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateSimpleMethodCall9() { -#if false - var result = EvaluateSimpleExpression("1 + bar 3", - (m, args) => - (m == "bar") ? (int)args[0] : 0); - Assert.That(result.IsError, Is.True); -#endif - } - - [Test] - public void EvaluateSimpleMethodCall10() { -#if false - var result = EvaluateSimpleExpression("1 || bar 3", - (m, args) => - (m == "bar") ? (int)args[0] : 0); - Assert.That(result.IsError, Is.True); -#endif - } - - [Test] - public void EvaluateSimpleMethodCall11() { -#if false - var result = EvaluateSimpleExpression("1 * bar 3", - (m, args) => - (m == "bar") ? (int)args[0] : 0); - Assert.That(result.IsError, Is.True); -#endif - } - - [Test] - public void EvaluateSimpleMethodCall12() { -#if false - var result = EvaluateSimpleExpression("1 && bar 3", - (m, args) => - (m == "bar") ? (int)args[0] : 0); - Assert.That(result.IsError, Is.True); -#endif - } - - [Test] - public void EvaluateSimpleMethodCall13() { -#if false - var result = EvaluateSimpleExpression("(1 + bar 3)", - (m, args) => - (m == "bar") ? (int)args[0] : 0); - Assert.That(result.IsError, Is.True); -#endif - } - - [Test] - public void EvaluateSimpleMethodCall14() { - var result = EvaluateSimpleExpression("1 + bar(3)", - (m, args) => - (m == "bar") ? (int)args[0] : 0); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(1 + 3)); - } - - [Test] - public void EvaluateSimpleMethodCall15() { - var result = EvaluateSimpleExpression("1 + (bar 3)", - (m, args) => - (m == "bar") ? (int)args[0] : 0); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(1 + 3)); - } - - [Test] - public void EvaluateSimpleMethodCall16() { - var result = EvaluateSimpleExpression("1 and bar 3", - (m, args) => - (m == "bar") ? (int)args[0] : 0); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(3)); - } - - [Test] - public void EvaluateSimpleMethodCall17() { - var result = EvaluateSimpleExpression("1 or bar 3", - (m, args) => - (m == "bar") ? (int)args[0] : 0); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(1)); - } - - [Test] - public void EvaluateComplexMethodCall() { - var result = EvaluateSimpleExpression("authenticated and url \"~/boo*\"", - (m, args) => (m == "authenticated") ? true : (m == "url") ? (string)args[0] == "~/boo*" : false); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateComplexMethodCall2() { - var result = EvaluateSimpleExpression("(authenticated) and (url \"~/boo*\")", - (m, args) => (m == "authenticated") ? true : (m == "url") ? (string)args[0] == "~/boo*" : false); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateComplexMethodCall3() { - var result = EvaluateSimpleExpression("(authenticated and url \"~/boo*\")", - (m, args) => (m == "authenticated") ? true : (m == "url") ? (string)args[0] == "~/boo*" : false); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateComplexMethodCall4() { - var result = EvaluateSimpleExpression("(authenticated) and url \"~/boo*\"", - (m, args) => (m == "authenticated") ? true : (m == "url") ? (string)args[0] == "~/boo*" : false); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateComplexMethodCall5() { - var result = EvaluateSimpleExpression("(authenticated()) and (url \"~/boo*\")", - (m, args) => (m == "authenticated") ? true : (m == "url") ? (string)args[0] == "~/boo*" : false); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - [Test] - public void EvaluateComplexMethodCall6() { - var result = EvaluateSimpleExpression("authenticated() and url(\"~/boo*\")", - (m, args) => (m == "authenticated") ? true : (m == "url") ? (string)args[0] == "~/boo*" : false); - Assert.That(result.IsError, Is.False); - Assert.That(result.Value, Is.EqualTo(true)); - } - - private EvaluationResult EvaluateSimpleExpression(string expression) { - return EvaluateSimpleExpression(expression, (m, args) => null); - } - - protected abstract EvaluationResult EvaluateSimpleExpression(string expression, Func, object> methodInvocationCallback); - } +using System; +using System.Collections.Generic; +using NUnit.Framework; +using Orchard.Scripting.Compiler; + +namespace Orchard.Tests.Modules.Scripting { + public abstract class EvaluatorTestsBase { + [Test] + public void EvaluateSimpleConstant() { + var result = EvaluateSimpleExpression("true and true"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateSimpleConstant0() { + var result = EvaluateSimpleExpression("true && true"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateConvertingBooleanExpression() { + var result = EvaluateSimpleExpression("true and 1"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(1)); + } + + [Test] + public void EvaluateConvertingBooleanExpression1() { + var result = EvaluateSimpleExpression("true && 1"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(1)); + } + + [Test] + public void EvaluateConvertingBooleanExpression2() { + var result = EvaluateSimpleExpression("true and 0"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(0)); + } + + [Test] + public void EvaluateConvertingBooleanExpression3() { + var result = EvaluateSimpleExpression("true && 0"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(0)); + } + + [Test] + public void EvaluateConvertingBooleanExpression4() { + var result = EvaluateSimpleExpression("1 and true"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateConvertingBooleanExpression5() { + var result = EvaluateSimpleExpression("0 and true"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateConvertingBooleanExpression6() { + var result = EvaluateSimpleExpression("1 && true"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateConvertingBooleanExpression7() { + var result = EvaluateSimpleExpression("true and 'boo'"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo("boo")); + } + + [Test] + public void EvaluateConvertingBooleanExpression8() { + var result = EvaluateSimpleExpression("true && 'boo'"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo("boo")); + } + + [Test] + public void EvaluateConvertingBooleanExpression9() { + var result = EvaluateSimpleExpression("'boo' and true"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateConvertingBooleanExpression10() { + var result = EvaluateSimpleExpression("'boo' && true"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateConvertingBooleanExpression11() { + var result = EvaluateSimpleExpression("true or 1"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateConvertingBooleanExpression12() { + var result = EvaluateSimpleExpression("true || 1"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateConvertingBooleanExpression13() { + var result = EvaluateSimpleExpression("1 or true"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(1)); + } + + [Test] + public void EvaluateConvertingBooleanExpression14() { + var result = EvaluateSimpleExpression("1 || true"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(1)); + } + + [Test] + public void EvaluateConvertingBooleanExpression15() { + var result = EvaluateSimpleExpression("true or 'boo'"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateConvertingBooleanExpression16() { + var result = EvaluateSimpleExpression("false or 'boo'"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo("boo")); + } + + [Test] + public void EvaluateConvertingBooleanExpression17() { + var result = EvaluateSimpleExpression("nil or 'boo'"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo("boo")); + } + + [Test] + public void EvaluateConvertingBooleanExpression18() { + var result = EvaluateSimpleExpression("'boo' or nil"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo("boo")); + } + + [Test] + public void EvaluateConvertingBooleanExpression19() { + var result = EvaluateSimpleExpression("true || 'boo'"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateConvertingBooleanExpression20() { + var result = EvaluateSimpleExpression("'boo' or true"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo("boo")); + } + + [Test] + public void EvaluateConvertingBooleanExpression21() { + var result = EvaluateSimpleExpression("'boo' || true"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo("boo")); + } + + [Test] + public void EvaluateConvertingBooleanExpression22() { + var result = EvaluateSimpleExpression("1 and 2"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(2)); + } + + [Test] + public void EvaluateConvertingBooleanExpression23() { + var result = EvaluateSimpleExpression("false and 2"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(false)); + } + + [Test] + public void EvaluateConvertingBooleanExpression24() { + var result = EvaluateSimpleExpression("nil and 2"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(null)); + } + + [Test] + public void EvaluateConvertingBooleanExpression25() { + var result = EvaluateSimpleExpression("nil and false"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(null)); + } + + [Test] + public void EvaluateConvertingBooleanExpression26() { + var result = EvaluateSimpleExpression("nil and true"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(null)); + } + + [Test] + public void EvaluateBooleanExpression() { + var result = EvaluateSimpleExpression("not true"); + Assert.That(result.IsError, Is.False); + Assert.That(result.BoolValue, Is.EqualTo(false)); + } + + [Test] + public void EvaluateBooleanExpression0() { + var result = EvaluateSimpleExpression("!true"); + Assert.That(result.IsError, Is.False); + Assert.That(result.BoolValue, Is.EqualTo(false)); + } + + [Test] + public void EvaluateSimpleArithmetic() { + var result = EvaluateSimpleExpression("1 + 2 * 3 - 6 / 2"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(4)); + } + + [Test] + public void EvaluateRelationalOperators() { + var result = EvaluateSimpleExpression("1 < 2"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateRelationalOperators2() { + var result = EvaluateSimpleExpression("2 <= 2"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateRelationalOperators3() { + var result = EvaluateSimpleExpression("1 < 2 or 2 > 3 and !false"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateRelationalOperators4() { + var result = EvaluateSimpleExpression("1 > 2 or 2 > 3 and !false"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(false)); + } + + [Test] + public void EvaluateRelationalOperators5() { + var result = EvaluateSimpleExpression("1 > 2 or 4 > 3 and !false"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateRelationalOperators6() { + var result = EvaluateSimpleExpression("!false"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateRelationalOperators7() { + var result = EvaluateSimpleExpression("5 || 10 && nil"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(5)); + } + + [Test] + public void EvaluateRelationalOperators8() { + var result = EvaluateSimpleExpression("true or false and nil"); + Assert.That(result.IsError, Is.False); + Assert.That(result.IsNull, Is.True); + } + + [Test] + public void EvaluateRelationalOperators9() { + var result = EvaluateSimpleExpression("true and nil"); + Assert.That(result.IsError, Is.False); + Assert.That(result.IsNull, Is.True); + } + + [Test] + public void EvaluateRelationalOperators10() { + var result = EvaluateSimpleExpression("5 and nil"); + Assert.That(result.IsError, Is.False); + Assert.That(result.IsNull, Is.True); + } + + [Test] + public void EvaluateEqualityOperators() { + var result = EvaluateSimpleExpression("1 == 2"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(false)); + } + + [Test] + public void EvaluateEqualityOperators2() { + var result = EvaluateSimpleExpression("1 != 2"); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateSimpleMethodCall() { + var result = EvaluateSimpleExpression("printtoto 1 + 2 * 3 - 6 / 2", + (m, args) => (m == "printtoto") ? (int)args[0] * 2 : 0); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(4 * 2)); + } + + [Test] + public void EvaluateSimpleMethodCall2() { + var result = EvaluateSimpleExpression("printtoto(1 + 2 * 3 - 6 / 2)", + (m, args) => (m == "printtoto") ? (int)args[0] * 2 : 0); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(4 * 2)); + } + + [Test] + public void EvaluateSimpleMethodCall3() { + var result = EvaluateSimpleExpression("foo 1 + bar 3", + (m, args) => + (m == "foo") ? (int)args[0] * 2 : + (m == "bar") ? (int)args[0] : 0); + Assert.That(result.IsError, Is.True); + } + + [Test] + public void EvaluateSimpleMethodCall4() { + var result = EvaluateSimpleExpression("foo(1 + bar 3)", + (m, args) => + (m == "foo") ? (int)args[0] * 2 : + (m == "bar") ? (int)args[0] : 0); + Assert.That(result.IsError, Is.True); + } + + [Test] + public void EvaluateSimpleMethodCall5() { + var result = EvaluateSimpleExpression("foo 1 + bar(3)", + (m, args) => + (m == "foo") ? (int)args[0] * 2 : + (m == "bar") ? (int)args[0] : 0); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(2 * (1 + 3))); + } + + [Test] + public void EvaluateSimpleMethodCall6() { + var result = EvaluateSimpleExpression("foo(1) + bar(3)", + (m, args) => + (m == "foo") ? (int)args[0] * 2 : + (m == "bar") ? (int)args[0] : 0); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(2 + 3)); + } + + [Test] + public void EvaluateSimpleMethodCall7() { + var result = EvaluateSimpleExpression("foo", + (m, args) => (m == "foo") ? true : false); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateSimpleMethodCall8() { + var result = EvaluateSimpleExpression("foo()", + (m, args) => (m == "foo") ? true : false); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateSimpleMethodCall9() { +#if false + var result = EvaluateSimpleExpression("1 + bar 3", + (m, args) => + (m == "bar") ? (int)args[0] : 0); + Assert.That(result.IsError, Is.True); +#endif + } + + [Test] + public void EvaluateSimpleMethodCall10() { +#if false + var result = EvaluateSimpleExpression("1 || bar 3", + (m, args) => + (m == "bar") ? (int)args[0] : 0); + Assert.That(result.IsError, Is.True); +#endif + } + + [Test] + public void EvaluateSimpleMethodCall11() { +#if false + var result = EvaluateSimpleExpression("1 * bar 3", + (m, args) => + (m == "bar") ? (int)args[0] : 0); + Assert.That(result.IsError, Is.True); +#endif + } + + [Test] + public void EvaluateSimpleMethodCall12() { +#if false + var result = EvaluateSimpleExpression("1 && bar 3", + (m, args) => + (m == "bar") ? (int)args[0] : 0); + Assert.That(result.IsError, Is.True); +#endif + } + + [Test] + public void EvaluateSimpleMethodCall13() { +#if false + var result = EvaluateSimpleExpression("(1 + bar 3)", + (m, args) => + (m == "bar") ? (int)args[0] : 0); + Assert.That(result.IsError, Is.True); +#endif + } + + [Test] + public void EvaluateSimpleMethodCall14() { + var result = EvaluateSimpleExpression("1 + bar(3)", + (m, args) => + (m == "bar") ? (int)args[0] : 0); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(1 + 3)); + } + + [Test] + public void EvaluateSimpleMethodCall15() { + var result = EvaluateSimpleExpression("1 + (bar 3)", + (m, args) => + (m == "bar") ? (int)args[0] : 0); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(1 + 3)); + } + + [Test] + public void EvaluateSimpleMethodCall16() { + var result = EvaluateSimpleExpression("1 and bar 3", + (m, args) => + (m == "bar") ? (int)args[0] : 0); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(3)); + } + + [Test] + public void EvaluateSimpleMethodCall17() { + var result = EvaluateSimpleExpression("1 or bar 3", + (m, args) => + (m == "bar") ? (int)args[0] : 0); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(1)); + } + + [Test] + public void EvaluateComplexMethodCall() { + var result = EvaluateSimpleExpression("authenticated and url \"~/boo*\"", + (m, args) => (m == "authenticated") ? true : (m == "url") ? (string)args[0] == "~/boo*" : false); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateComplexMethodCall2() { + var result = EvaluateSimpleExpression("(authenticated) and (url \"~/boo*\")", + (m, args) => (m == "authenticated") ? true : (m == "url") ? (string)args[0] == "~/boo*" : false); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateComplexMethodCall3() { + var result = EvaluateSimpleExpression("(authenticated and url \"~/boo*\")", + (m, args) => (m == "authenticated") ? true : (m == "url") ? (string)args[0] == "~/boo*" : false); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateComplexMethodCall4() { + var result = EvaluateSimpleExpression("(authenticated) and url \"~/boo*\"", + (m, args) => (m == "authenticated") ? true : (m == "url") ? (string)args[0] == "~/boo*" : false); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateComplexMethodCall5() { + var result = EvaluateSimpleExpression("(authenticated()) and (url \"~/boo*\")", + (m, args) => (m == "authenticated") ? true : (m == "url") ? (string)args[0] == "~/boo*" : false); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + [Test] + public void EvaluateComplexMethodCall6() { + var result = EvaluateSimpleExpression("authenticated() and url(\"~/boo*\")", + (m, args) => (m == "authenticated") ? true : (m == "url") ? (string)args[0] == "~/boo*" : false); + Assert.That(result.IsError, Is.False); + Assert.That(result.Value, Is.EqualTo(true)); + } + + private EvaluationResult EvaluateSimpleExpression(string expression) { + return EvaluateSimpleExpression(expression, (m, args) => null); + } + + protected abstract EvaluationResult EvaluateSimpleExpression(string expression, Func, object> methodInvocationCallback); + } } \ No newline at end of file diff --git a/src/Orchard.Tests.Modules/Scripting/ParserTests.cs b/src/Orchard.Tests.Modules/Scripting/ParserTests.cs index 1f5afce59d2..d8d5eeb4006 100644 --- a/src/Orchard.Tests.Modules/Scripting/ParserTests.cs +++ b/src/Orchard.Tests.Modules/Scripting/ParserTests.cs @@ -1,343 +1,343 @@ -using System; -using System.Diagnostics; -using NUnit.Framework; -using Orchard.Scripting.Ast; -using Orchard.Scripting.Compiler; - -namespace Orchard.Tests.Modules.Scripting { - [TestFixture] - public class ParserTests { - [Test] - public void ParserShouldUnderstandConstantExpressions() { - var tree = new Parser("true").Parse(); - CheckTree(tree, new object[] { - "const", true, - }); - } - - [Test] - public void ParserShouldIgnoreWhitespaces() { - var tree = new Parser(" true \n ").Parse(); - CheckTree(tree, new object[] { - "const", true, - }); - } - - [Test] - public void ParserShouldUnderstandBinaryExpressions() { - var tree = new Parser("true+true").Parse(); - CheckTree(tree, new object[] { - "binop", TokenKind.Plus, - "const", true, - "const", true, - }); - } - - [Test] - public void ParserShouldUnderstandCommandExpressions() { - var tree = new Parser("print 'foo', 'bar'").Parse(); - CheckTree(tree, new object[] { - "call", TokenKind.Identifier, "print", - "const", "foo", - "const", "bar", - }); - } - - [Test] - public void ParserShouldUnderstandCallExpressions() { - var tree = new Parser("print('foo', 'bar')").Parse(); - CheckTree(tree, new object[] { - "call", TokenKind.Identifier, "print", - "const", "foo", - "const", "bar", - }); - } - - [Test] - public void ParserShouldUnderstandCallExpressions2() { - var tree = new Parser("print 1+2").Parse(); - CheckTree(tree, new object[] { - "call", TokenKind.Identifier, "print", - "binop", TokenKind.Plus, - "const", 1, - "const", 2, - }); - } - - [Test] - public void ParserShouldUnderstandOperatorPrecedence() { - var tree = new Parser("1+2*3").Parse(); - CheckTree(tree, new object[] { - "binop", TokenKind.Plus, - "const", 1, - "binop", TokenKind.Mul, - "const", 2, - "const", 3, - }); - } - - [Test] - public void ParserShouldUnderstandOperatorPrecedence2() { - var tree = new Parser("1*2+3").Parse(); - CheckTree(tree, new object[] { - "binop", TokenKind.Plus, - "binop", TokenKind.Mul, - "const", 1, - "const", 2, - "const", 3, - }); - } - - [Test] - public void ParserShouldUnderstandOperatorPrecedence3() { - var tree = new Parser("not true or true").Parse(); - CheckTree(tree, new object[] { - "binop", TokenKind.Or, - "unop", TokenKind.Not, - "const", true, - "const", true, - }); - } - - [Test] - public void ParserShouldUnderstandOperatorPrecedence4() { - var tree = new Parser("not (true or true)").Parse(); - CheckTree(tree, new object[] { - "unop", TokenKind.Not, - "binop", TokenKind.Or, - "const", true, - "const", true, - }); - } - - [Test] - public void ParserShouldUnderstandOperatorPrecedence5() { - var tree = new Parser("1+2+3").Parse(); - CheckTree(tree, new object[] { - "binop", TokenKind.Plus, - "binop", TokenKind.Plus, - "const", 1, - "const", 2, - "const", 3, - }); - } - - [Test] - public void ParserShouldUnderstandOperatorPrecedence6() { - var tree = new Parser("1+2-3").Parse(); - CheckTree(tree, new object[] { - "binop", TokenKind.Minus, - "binop", TokenKind.Plus, - "const", 1, - "const", 2, - "const", 3, - }); - } - - [Test] - public void ParserShouldUnderstandRelationalOperators() { - var tree = new Parser("true == true").Parse(); - CheckTree(tree, new object[] { - "binop", TokenKind.EqualEqual, - "const", true, - "const", true, - }); - } - - [Test] - public void ParserShouldUnderstandRelationalOperators2() { - var tree = new Parser("1 != 2").Parse(); - CheckTree(tree, new object[] { - "binop", TokenKind.NotEqual, - "const", 1, - "const", 2, - }); - } - - [Test] - public void ParserShouldUnderstandRelationalOperators3() { - var tree = new Parser("1 < 2").Parse(); - CheckTree(tree, new object[] { - "binop", TokenKind.LessThan, - "const", 1, - "const", 2, - }); - } - - [Test] - public void ParserShouldUnderstandRelationalOperators4() { - var tree = new Parser("1 <= 2").Parse(); - CheckTree(tree, new object[] { - "binop", TokenKind.LessThanEqual, - "const", 1, - "const", 2, - }); - } - - [Test] - public void ParserShouldUnderstandRelationalOperators5() { - var tree = new Parser("1 > 2").Parse(); - CheckTree(tree, new object[] { - "binop", TokenKind.GreaterThan, - "const", 1, - "const", 2, - }); - } - - [Test] - public void ParserShouldUnderstandRelationalOperators6() { - var tree = new Parser("1 >= 2").Parse(); - CheckTree(tree, new object[] { - "binop", TokenKind.GreaterThanEqual, - "const", 1, - "const", 2, - }); - } - - [Test] - public void ParserShouldUnderstandRelationalOperators7() { - var tree = new Parser("null == null").Parse(); - CheckTree(tree, new object[] { - "binop", TokenKind.EqualEqual, - "const", null, - "const", null, - }); - } - - [Test] - public void ParserShouldUnderstandRelationalOperatorPrecedence() { - var tree = new Parser("1 < 2 or 2 > 3 and !false").Parse(); - CheckTree(tree, new object[] { - "binop", TokenKind.And, - "binop", TokenKind.Or, - "binop", TokenKind.LessThan, - "const", 1, - "const", 2, - "binop", TokenKind.GreaterThan, - "const", 2, - "const", 3, - "unop", TokenKind.NotSign, - "const", false, - }); - } - - [Test] - public void ParserShouldUnderstandRelationalOperatorPrecedence2() { - var tree = new Parser("1 < 2 and 2 > 3 or !false").Parse(); - CheckTree(tree, new object[] { - "binop", TokenKind.Or, - "binop", TokenKind.And, - "binop", TokenKind.LessThan, - "const", 1, - "const", 2, - "binop", TokenKind.GreaterThan, - "const", 2, - "const", 3, - "unop", TokenKind.NotSign, - "const", false, - }); - } - - [Test] - public void ParserShouldUnderstandParenthesis() { - var tree = new Parser("1*(2+3)").Parse(); - CheckTree(tree, new object[] { - "binop", TokenKind.Mul, - "const", 1, - "binop", TokenKind.Plus, - "const", 2, - "const", 3, - }); - } - - [Test] - public void ParserShouldUnderstandComplexExpressions() { - var tree = new Parser("not 1 * (2 / 4 * 6 + (3))").Parse(); - CheckTree(tree, new object[] { - "unop", TokenKind.Not, - "binop", TokenKind.Mul, - "const", 1, - "binop", TokenKind.Plus, - "binop", TokenKind.Mul, - "binop", TokenKind.Div, - "const", 2, - "const", 4, - "const", 6, - "const", 3, - }); - } - - [Test] - public void ParserShouldContainErrorExpressions() { - var tree = new Parser("1 + not 3").Parse(); - CheckTree(tree, new object[] { - "error", - }); - } - - [Test] - public void ParserShouldContainErrorExpressions2() { - var tree = new Parser("1 +").Parse(); - CheckTree(tree, new object[] { - "binop", TokenKind.Plus, - "const", 1, - "error", - }); - } - - private void CheckTree(AbstractSyntaxTree tree, object[] objects) { - Assert.That(tree, Is.Not.Null); - Assert.That(tree.Root, Is.Not.Null); - - int index = 0; - CheckExpression(tree.Root, 0, objects, ref index); - Assert.That(index, Is.EqualTo(objects.Length)); - } - - private void CheckExpression(AstNode astNode, int indent, object[] objects, ref int index) { - var exprName = (string)objects[index++]; - Type type = null; - switch (exprName) { - case "const": - type = typeof(ConstantAstNode); - break; - case "binop": - type = typeof(BinaryAstNode); - break; - case "unop": - type = typeof(UnaryAstNode); - break; - case "call": - type = typeof(MethodCallAstNode); - break; - case "error": - type = typeof(ErrorAstNode); - break; - default: - throw new InvalidOperationException(string.Format("Test error: unrecognized expression type abbreviation '{0}'", exprName)); - } - - Trace.WriteLine(string.Format("{0}: {1}{2} (Current: {3})", indent, new string(' ', indent * 2), type.Name, astNode)); - - Assert.That(astNode.GetType(), Is.EqualTo(type)); - - if (exprName == "const") { - Assert.That((astNode as ConstantAstNode).Value, Is.EqualTo(objects[index++])); - } - else if (exprName == "binop") { - Assert.That((astNode as BinaryAstNode).Operator.Kind, Is.EqualTo(objects[index++])); - } - else if (exprName == "unop") { - Assert.That((astNode as UnaryAstNode).Operator.Kind, Is.EqualTo(objects[index++])); - } - else if (exprName == "call") { - Assert.That((astNode as MethodCallAstNode).Token.Kind, Is.EqualTo(objects[index++])); - Assert.That((astNode as MethodCallAstNode).Token.Value, Is.EqualTo(objects[index++])); - } - - foreach (var child in astNode.Children) { - CheckExpression(child, indent + 1, objects, ref index); - } - } - } -} +using System; +using System.Diagnostics; +using NUnit.Framework; +using Orchard.Scripting.Ast; +using Orchard.Scripting.Compiler; + +namespace Orchard.Tests.Modules.Scripting { + [TestFixture] + public class ParserTests { + [Test] + public void ParserShouldUnderstandConstantExpressions() { + var tree = new Parser("true").Parse(); + CheckTree(tree, new object[] { + "const", true, + }); + } + + [Test] + public void ParserShouldIgnoreWhitespaces() { + var tree = new Parser(" true \n ").Parse(); + CheckTree(tree, new object[] { + "const", true, + }); + } + + [Test] + public void ParserShouldUnderstandBinaryExpressions() { + var tree = new Parser("true+true").Parse(); + CheckTree(tree, new object[] { + "binop", TokenKind.Plus, + "const", true, + "const", true, + }); + } + + [Test] + public void ParserShouldUnderstandCommandExpressions() { + var tree = new Parser("print 'foo', 'bar'").Parse(); + CheckTree(tree, new object[] { + "call", TokenKind.Identifier, "print", + "const", "foo", + "const", "bar", + }); + } + + [Test] + public void ParserShouldUnderstandCallExpressions() { + var tree = new Parser("print('foo', 'bar')").Parse(); + CheckTree(tree, new object[] { + "call", TokenKind.Identifier, "print", + "const", "foo", + "const", "bar", + }); + } + + [Test] + public void ParserShouldUnderstandCallExpressions2() { + var tree = new Parser("print 1+2").Parse(); + CheckTree(tree, new object[] { + "call", TokenKind.Identifier, "print", + "binop", TokenKind.Plus, + "const", 1, + "const", 2, + }); + } + + [Test] + public void ParserShouldUnderstandOperatorPrecedence() { + var tree = new Parser("1+2*3").Parse(); + CheckTree(tree, new object[] { + "binop", TokenKind.Plus, + "const", 1, + "binop", TokenKind.Mul, + "const", 2, + "const", 3, + }); + } + + [Test] + public void ParserShouldUnderstandOperatorPrecedence2() { + var tree = new Parser("1*2+3").Parse(); + CheckTree(tree, new object[] { + "binop", TokenKind.Plus, + "binop", TokenKind.Mul, + "const", 1, + "const", 2, + "const", 3, + }); + } + + [Test] + public void ParserShouldUnderstandOperatorPrecedence3() { + var tree = new Parser("not true or true").Parse(); + CheckTree(tree, new object[] { + "binop", TokenKind.Or, + "unop", TokenKind.Not, + "const", true, + "const", true, + }); + } + + [Test] + public void ParserShouldUnderstandOperatorPrecedence4() { + var tree = new Parser("not (true or true)").Parse(); + CheckTree(tree, new object[] { + "unop", TokenKind.Not, + "binop", TokenKind.Or, + "const", true, + "const", true, + }); + } + + [Test] + public void ParserShouldUnderstandOperatorPrecedence5() { + var tree = new Parser("1+2+3").Parse(); + CheckTree(tree, new object[] { + "binop", TokenKind.Plus, + "binop", TokenKind.Plus, + "const", 1, + "const", 2, + "const", 3, + }); + } + + [Test] + public void ParserShouldUnderstandOperatorPrecedence6() { + var tree = new Parser("1+2-3").Parse(); + CheckTree(tree, new object[] { + "binop", TokenKind.Minus, + "binop", TokenKind.Plus, + "const", 1, + "const", 2, + "const", 3, + }); + } + + [Test] + public void ParserShouldUnderstandRelationalOperators() { + var tree = new Parser("true == true").Parse(); + CheckTree(tree, new object[] { + "binop", TokenKind.EqualEqual, + "const", true, + "const", true, + }); + } + + [Test] + public void ParserShouldUnderstandRelationalOperators2() { + var tree = new Parser("1 != 2").Parse(); + CheckTree(tree, new object[] { + "binop", TokenKind.NotEqual, + "const", 1, + "const", 2, + }); + } + + [Test] + public void ParserShouldUnderstandRelationalOperators3() { + var tree = new Parser("1 < 2").Parse(); + CheckTree(tree, new object[] { + "binop", TokenKind.LessThan, + "const", 1, + "const", 2, + }); + } + + [Test] + public void ParserShouldUnderstandRelationalOperators4() { + var tree = new Parser("1 <= 2").Parse(); + CheckTree(tree, new object[] { + "binop", TokenKind.LessThanEqual, + "const", 1, + "const", 2, + }); + } + + [Test] + public void ParserShouldUnderstandRelationalOperators5() { + var tree = new Parser("1 > 2").Parse(); + CheckTree(tree, new object[] { + "binop", TokenKind.GreaterThan, + "const", 1, + "const", 2, + }); + } + + [Test] + public void ParserShouldUnderstandRelationalOperators6() { + var tree = new Parser("1 >= 2").Parse(); + CheckTree(tree, new object[] { + "binop", TokenKind.GreaterThanEqual, + "const", 1, + "const", 2, + }); + } + + [Test] + public void ParserShouldUnderstandRelationalOperators7() { + var tree = new Parser("null == null").Parse(); + CheckTree(tree, new object[] { + "binop", TokenKind.EqualEqual, + "const", null, + "const", null, + }); + } + + [Test] + public void ParserShouldUnderstandRelationalOperatorPrecedence() { + var tree = new Parser("1 < 2 or 2 > 3 and !false").Parse(); + CheckTree(tree, new object[] { + "binop", TokenKind.And, + "binop", TokenKind.Or, + "binop", TokenKind.LessThan, + "const", 1, + "const", 2, + "binop", TokenKind.GreaterThan, + "const", 2, + "const", 3, + "unop", TokenKind.NotSign, + "const", false, + }); + } + + [Test] + public void ParserShouldUnderstandRelationalOperatorPrecedence2() { + var tree = new Parser("1 < 2 and 2 > 3 or !false").Parse(); + CheckTree(tree, new object[] { + "binop", TokenKind.Or, + "binop", TokenKind.And, + "binop", TokenKind.LessThan, + "const", 1, + "const", 2, + "binop", TokenKind.GreaterThan, + "const", 2, + "const", 3, + "unop", TokenKind.NotSign, + "const", false, + }); + } + + [Test] + public void ParserShouldUnderstandParenthesis() { + var tree = new Parser("1*(2+3)").Parse(); + CheckTree(tree, new object[] { + "binop", TokenKind.Mul, + "const", 1, + "binop", TokenKind.Plus, + "const", 2, + "const", 3, + }); + } + + [Test] + public void ParserShouldUnderstandComplexExpressions() { + var tree = new Parser("not 1 * (2 / 4 * 6 + (3))").Parse(); + CheckTree(tree, new object[] { + "unop", TokenKind.Not, + "binop", TokenKind.Mul, + "const", 1, + "binop", TokenKind.Plus, + "binop", TokenKind.Mul, + "binop", TokenKind.Div, + "const", 2, + "const", 4, + "const", 6, + "const", 3, + }); + } + + [Test] + public void ParserShouldContainErrorExpressions() { + var tree = new Parser("1 + not 3").Parse(); + CheckTree(tree, new object[] { + "error", + }); + } + + [Test] + public void ParserShouldContainErrorExpressions2() { + var tree = new Parser("1 +").Parse(); + CheckTree(tree, new object[] { + "binop", TokenKind.Plus, + "const", 1, + "error", + }); + } + + private void CheckTree(AbstractSyntaxTree tree, object[] objects) { + Assert.That(tree, Is.Not.Null); + Assert.That(tree.Root, Is.Not.Null); + + int index = 0; + CheckExpression(tree.Root, 0, objects, ref index); + Assert.That(index, Is.EqualTo(objects.Length)); + } + + private void CheckExpression(AstNode astNode, int indent, object[] objects, ref int index) { + var exprName = (string)objects[index++]; + Type type = null; + switch (exprName) { + case "const": + type = typeof(ConstantAstNode); + break; + case "binop": + type = typeof(BinaryAstNode); + break; + case "unop": + type = typeof(UnaryAstNode); + break; + case "call": + type = typeof(MethodCallAstNode); + break; + case "error": + type = typeof(ErrorAstNode); + break; + default: + throw new InvalidOperationException(string.Format("Test error: unrecognized expression type abbreviation '{0}'", exprName)); + } + + Trace.WriteLine(string.Format("{0}: {1}{2} (Current: {3})", indent, new string(' ', indent * 2), type.Name, astNode)); + + Assert.That(astNode.GetType(), Is.EqualTo(type)); + + if (exprName == "const") { + Assert.That((astNode as ConstantAstNode).Value, Is.EqualTo(objects[index++])); + } + else if (exprName == "binop") { + Assert.That((astNode as BinaryAstNode).Operator.Kind, Is.EqualTo(objects[index++])); + } + else if (exprName == "unop") { + Assert.That((astNode as UnaryAstNode).Operator.Kind, Is.EqualTo(objects[index++])); + } + else if (exprName == "call") { + Assert.That((astNode as MethodCallAstNode).Token.Kind, Is.EqualTo(objects[index++])); + Assert.That((astNode as MethodCallAstNode).Token.Value, Is.EqualTo(objects[index++])); + } + + foreach (var child in astNode.Children) { + CheckExpression(child, indent + 1, objects, ref index); + } + } + } +} diff --git a/src/Orchard.Tests.Modules/Scripting/SimpleScriptingTests.cs b/src/Orchard.Tests.Modules/Scripting/SimpleScriptingTests.cs index 0c5ea4cb062..afd8f89ab04 100644 --- a/src/Orchard.Tests.Modules/Scripting/SimpleScriptingTests.cs +++ b/src/Orchard.Tests.Modules/Scripting/SimpleScriptingTests.cs @@ -1,25 +1,25 @@ -using System.Linq; -using NUnit.Framework; -using Orchard.Scripting; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.Modules.Scripting { - [TestFixture] - public class SimpleScriptingTests { - [Test] - public void EngineThrowsSyntaxErrors() { - var engine = new ScriptExpressionEvaluator(new StubCacheManager()); - Assert.That(() => engine.Evaluate("true+", Enumerable.Empty()), Throws.Exception); - } - [Test] - public void EngineUnderstandsPrimitiveValues() { - var engine = new ScriptExpressionEvaluator(new StubCacheManager()); - Assert.That(engine.Evaluate("true", Enumerable.Empty()), Is.True); - } - [Test] - public void EngineUnderstandsPrimitiveValues2() { - var engine = new ScriptExpressionEvaluator(new StubCacheManager()); - Assert.That(engine.Evaluate("true and true", Enumerable.Empty()), Is.True); - } - } -} +using System.Linq; +using NUnit.Framework; +using Orchard.Scripting; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.Modules.Scripting { + [TestFixture] + public class SimpleScriptingTests { + [Test] + public void EngineThrowsSyntaxErrors() { + var engine = new ScriptExpressionEvaluator(new StubCacheManager()); + Assert.That(() => engine.Evaluate("true+", Enumerable.Empty()), Throws.Exception); + } + [Test] + public void EngineUnderstandsPrimitiveValues() { + var engine = new ScriptExpressionEvaluator(new StubCacheManager()); + Assert.That(engine.Evaluate("true", Enumerable.Empty()), Is.True); + } + [Test] + public void EngineUnderstandsPrimitiveValues2() { + var engine = new ScriptExpressionEvaluator(new StubCacheManager()); + Assert.That(engine.Evaluate("true and true", Enumerable.Empty()), Is.True); + } + } +} diff --git a/src/Orchard.Tests.Modules/Scripting/TokenizerTests.cs b/src/Orchard.Tests.Modules/Scripting/TokenizerTests.cs index ecde68e3865..bfc330c81cd 100644 --- a/src/Orchard.Tests.Modules/Scripting/TokenizerTests.cs +++ b/src/Orchard.Tests.Modules/Scripting/TokenizerTests.cs @@ -1,84 +1,84 @@ -using NUnit.Framework; -using Orchard.Scripting.Compiler; - -namespace Orchard.Tests.Modules.Scripting { - [TestFixture] - public class TokenizerTests { - - [Test] - public void LexerShouldProcessSingleQuotedStringLiteral() { - TestStringLiteral(@"'toto'", @"toto", TokenKind.SingleQuotedStringLiteral); - TestStringLiteral(@"'to\'to'", @"to'to", TokenKind.SingleQuotedStringLiteral); - TestStringLiteral(@"'to\\to'", @"to\to", TokenKind.SingleQuotedStringLiteral); - TestStringLiteral(@"'to\ato'", @"to\ato", TokenKind.SingleQuotedStringLiteral); - } - - [Test] - public void LexerShouldProcessStringLiteral() { - TestStringLiteral(@"""toto""", @"toto", TokenKind.StringLiteral); - TestStringLiteral(@"""to\'to""", @"to'to", TokenKind.StringLiteral); - TestStringLiteral(@"""to\\to""", @"to\to", TokenKind.StringLiteral); - TestStringLiteral(@"""to\ato""", @"toato", TokenKind.StringLiteral); - } - - private void TestStringLiteral(string value, string expected, TokenKind expectedTokenKind) { - var lexer = new Tokenizer(value); - var token1 = lexer.NextToken(); - Assert.That(token1.Kind, Is.EqualTo(expectedTokenKind)); - Assert.That(token1.Value, Is.EqualTo(expected)); - - var token2 = lexer.NextToken(); - Assert.That(token2.Kind, Is.EqualTo(TokenKind.Eof)); - } - - [Test] - public void LexerShouldProcessReservedWords() { - TestReservedWord("true", true, TokenKind.True); - TestReservedWord("false", false, TokenKind.False); - TestReservedWord("nil", null, TokenKind.NullLiteral); - TestReservedWord("null", null, TokenKind.NullLiteral); - TestReservedWord("not", null, TokenKind.Not); - TestReservedWord("and", null, TokenKind.And); - TestReservedWord("or", null, TokenKind.Or); - } - - private void TestReservedWord(string expression, object value, TokenKind expectedTokenKind) { - var lexer = new Tokenizer(expression); - var token1 = lexer.NextToken(); - Assert.That(token1.Kind, Is.EqualTo(expectedTokenKind)); - Assert.That(token1.Value, Is.EqualTo(value)); - - var token2 = lexer.NextToken(); - Assert.That(token2.Kind, Is.EqualTo(TokenKind.Eof)); - } - - [Test] - public void LexerShouldProcesSequenceOfTokens() { - CheckTokenSequence("true false", TokenKind.True, TokenKind.False); - CheckTokenSequence("true toto false", TokenKind.True, TokenKind.Identifier, TokenKind.False); - } - - [Test] - public void LexerShouldProcesSequenceOfTokens2() { - CheckTokenSequence("1+2*3", TokenKind.Integer, TokenKind.Plus, TokenKind.Integer, TokenKind.Mul, TokenKind.Integer); - } - - [Test] - public void LexerShouldProcesSequenceOfTokens3() { - CheckTokenSequence("= == < <= > >= ! !=", TokenKind.Equal, TokenKind.EqualEqual, - TokenKind.LessThan, TokenKind.LessThanEqual, - TokenKind.GreaterThan, TokenKind.GreaterThanEqual, TokenKind.NotSign, TokenKind.NotEqual); - } - - private void CheckTokenSequence(string expression, params TokenKind[] tokenKinds) { - var lexer = new Tokenizer(expression); - foreach (var kind in tokenKinds) { - var token = lexer.NextToken(); - Assert.That(token.Kind, Is.EqualTo(kind)); - } - - var token2 = lexer.NextToken(); - Assert.That(token2.Kind, Is.EqualTo(TokenKind.Eof)); - } - } -} +using NUnit.Framework; +using Orchard.Scripting.Compiler; + +namespace Orchard.Tests.Modules.Scripting { + [TestFixture] + public class TokenizerTests { + + [Test] + public void LexerShouldProcessSingleQuotedStringLiteral() { + TestStringLiteral(@"'toto'", @"toto", TokenKind.SingleQuotedStringLiteral); + TestStringLiteral(@"'to\'to'", @"to'to", TokenKind.SingleQuotedStringLiteral); + TestStringLiteral(@"'to\\to'", @"to\to", TokenKind.SingleQuotedStringLiteral); + TestStringLiteral(@"'to\ato'", @"to\ato", TokenKind.SingleQuotedStringLiteral); + } + + [Test] + public void LexerShouldProcessStringLiteral() { + TestStringLiteral(@"""toto""", @"toto", TokenKind.StringLiteral); + TestStringLiteral(@"""to\'to""", @"to'to", TokenKind.StringLiteral); + TestStringLiteral(@"""to\\to""", @"to\to", TokenKind.StringLiteral); + TestStringLiteral(@"""to\ato""", @"toato", TokenKind.StringLiteral); + } + + private void TestStringLiteral(string value, string expected, TokenKind expectedTokenKind) { + var lexer = new Tokenizer(value); + var token1 = lexer.NextToken(); + Assert.That(token1.Kind, Is.EqualTo(expectedTokenKind)); + Assert.That(token1.Value, Is.EqualTo(expected)); + + var token2 = lexer.NextToken(); + Assert.That(token2.Kind, Is.EqualTo(TokenKind.Eof)); + } + + [Test] + public void LexerShouldProcessReservedWords() { + TestReservedWord("true", true, TokenKind.True); + TestReservedWord("false", false, TokenKind.False); + TestReservedWord("nil", null, TokenKind.NullLiteral); + TestReservedWord("null", null, TokenKind.NullLiteral); + TestReservedWord("not", null, TokenKind.Not); + TestReservedWord("and", null, TokenKind.And); + TestReservedWord("or", null, TokenKind.Or); + } + + private void TestReservedWord(string expression, object value, TokenKind expectedTokenKind) { + var lexer = new Tokenizer(expression); + var token1 = lexer.NextToken(); + Assert.That(token1.Kind, Is.EqualTo(expectedTokenKind)); + Assert.That(token1.Value, Is.EqualTo(value)); + + var token2 = lexer.NextToken(); + Assert.That(token2.Kind, Is.EqualTo(TokenKind.Eof)); + } + + [Test] + public void LexerShouldProcesSequenceOfTokens() { + CheckTokenSequence("true false", TokenKind.True, TokenKind.False); + CheckTokenSequence("true toto false", TokenKind.True, TokenKind.Identifier, TokenKind.False); + } + + [Test] + public void LexerShouldProcesSequenceOfTokens2() { + CheckTokenSequence("1+2*3", TokenKind.Integer, TokenKind.Plus, TokenKind.Integer, TokenKind.Mul, TokenKind.Integer); + } + + [Test] + public void LexerShouldProcesSequenceOfTokens3() { + CheckTokenSequence("= == < <= > >= ! !=", TokenKind.Equal, TokenKind.EqualEqual, + TokenKind.LessThan, TokenKind.LessThanEqual, + TokenKind.GreaterThan, TokenKind.GreaterThanEqual, TokenKind.NotSign, TokenKind.NotEqual); + } + + private void CheckTokenSequence(string expression, params TokenKind[] tokenKinds) { + var lexer = new Tokenizer(expression); + foreach (var kind in tokenKinds) { + var token = lexer.NextToken(); + Assert.That(token.Kind, Is.EqualTo(kind)); + } + + var token2 = lexer.NextToken(); + Assert.That(token2.Kind, Is.EqualTo(TokenKind.Eof)); + } + } +} diff --git a/src/Orchard.Tests.Modules/Settings/Blueprint/ShellDescriptorManagerTests.cs b/src/Orchard.Tests.Modules/Settings/Blueprint/ShellDescriptorManagerTests.cs index 50818f073f6..8ce05f7694f 100644 --- a/src/Orchard.Tests.Modules/Settings/Blueprint/ShellDescriptorManagerTests.cs +++ b/src/Orchard.Tests.Modules/Settings/Blueprint/ShellDescriptorManagerTests.cs @@ -1,167 +1,167 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Autofac; -using NUnit.Framework; -using Orchard.Core.Settings.State; -using Orchard.Core.Settings.Descriptor; -using Orchard.Core.Settings.Descriptor.Records; -using Orchard.Environment.Configuration; -using Orchard.Environment.State; -using Orchard.Environment.Descriptor; -using Orchard.Environment.Descriptor.Models; -using Orchard.Events; - -namespace Orchard.Tests.Modules.Settings.Blueprint { - [TestFixture] - public class ShellDescriptorManagerTests : DatabaseEnabledTestsBase { - public override void Register(ContainerBuilder builder) { - builder.RegisterInstance(new ShellSettings { Name = "Default" }); - - builder.RegisterType().As().SingleInstance(); - builder.RegisterType().As().SingleInstance(); - builder.RegisterType().As().SingleInstance(); - builder.RegisterSource(new EventsRegistrationSource()); - } - - public class StubEventBus : IEventBus { - public string LastMessageName { get; set; } - public IDictionary LastEventData { get; set; } - - public IEnumerable Notify(string messageName, IDictionary eventData) { - LastMessageName = messageName; - LastEventData = eventData; - return new object[0]; - } - } - - protected override IEnumerable DatabaseTypes { - get { - return new[] { - typeof (ShellDescriptorRecord), - typeof (ShellFeatureRecord), - typeof (ShellParameterRecord), - }; - } - } - - [Test] - public void BlueprintShouldBeNullWhenItsNotInitialized() { - var manager = _container.Resolve(); - var descriptor = manager.GetShellDescriptor(); - Assert.That(descriptor, Is.Null); - } - - [Test] - public void PriorSerialNumberOfZeroIsAcceptableForInitialUpdateAndSerialNumberIsNonzeroAfterwards() { - var manager = _container.Resolve(); - manager.UpdateShellDescriptor( - 0, - Enumerable.Empty(), - Enumerable.Empty()); - - var descriptor = manager.GetShellDescriptor(); - Assert.That(descriptor, Is.Not.Null); - Assert.That(descriptor.SerialNumber, Is.Not.EqualTo(0)); - } - - [Test] - public void NonZeroInitialUpdateThrowsInvalidOperationException() { - var manager = _container.Resolve(); - Assert.Throws(() => manager.UpdateShellDescriptor( - 1, - Enumerable.Empty(), - Enumerable.Empty())); - } - - [Test] - public void OnlyCorrectSerialNumberOnLaterUpdatesDoesNotThrowException() { - var manager = _container.Resolve(); - manager.UpdateShellDescriptor( - 0, - Enumerable.Empty(), - Enumerable.Empty()); - - var descriptor = manager.GetShellDescriptor(); - Assert.That(descriptor.SerialNumber, Is.Not.EqualTo(0)); - - Assert.Throws(() => manager.UpdateShellDescriptor( - 0, - Enumerable.Empty(), - Enumerable.Empty())); - - Assert.Throws(() => manager.UpdateShellDescriptor( - descriptor.SerialNumber + 665321, - Enumerable.Empty(), - Enumerable.Empty())); - - manager.UpdateShellDescriptor( - descriptor.SerialNumber, - Enumerable.Empty(), - Enumerable.Empty()); - - var descriptor2 = manager.GetShellDescriptor(); - Assert.That(descriptor2.SerialNumber, Is.Not.EqualTo(0)); - Assert.That(descriptor2.SerialNumber, Is.Not.EqualTo(descriptor.SerialNumber)); - - Assert.Throws(() => manager.UpdateShellDescriptor( - 0, - Enumerable.Empty(), - Enumerable.Empty())); - - Assert.Throws(() => manager.UpdateShellDescriptor( - descriptor.SerialNumber, - Enumerable.Empty(), - Enumerable.Empty())); - - manager.UpdateShellDescriptor( - descriptor2.SerialNumber, - Enumerable.Empty(), - Enumerable.Empty()); - - Assert.Throws(() => manager.UpdateShellDescriptor( - descriptor2.SerialNumber, - Enumerable.Empty(), - Enumerable.Empty())); - } - - [Test] - public void SuccessfulUpdateRaisesAnEvent() { - var manager = _container.Resolve(); - var eventBus = _container.Resolve() as StubEventBus; - - Assert.That(eventBus.LastMessageName, Is.Null); - - Assert.Throws(() => manager.UpdateShellDescriptor( - 5, - Enumerable.Empty(), - Enumerable.Empty())); - - Assert.That(eventBus.LastMessageName, Is.Null); - - manager.UpdateShellDescriptor( - 0, - Enumerable.Empty(), - Enumerable.Empty()); - - Assert.That(eventBus.LastMessageName, Is.EqualTo("IShellDescriptorManagerEventHandler.Changed")); - } - - [Test] - public void ManagerReturnsStateForFeaturesInDescriptor() { - var descriptorManager = _container.Resolve(); - var stateManager = _container.Resolve(); - var state = stateManager.GetShellState(); - Assert.That(state.Features.Count(), Is.EqualTo(0)); - descriptorManager.UpdateShellDescriptor( - 0, - new[]{new ShellFeature{ Name="Foo"}}, - Enumerable.Empty()); - - var state2 = stateManager.GetShellState(); - Assert.That(state2.Features.Count(), Is.EqualTo(1)); - Assert.That(state2.Features, Has.Some.Property("Name").EqualTo("Foo")); - } - } -} +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using Autofac; +using NUnit.Framework; +using Orchard.Core.Settings.State; +using Orchard.Core.Settings.Descriptor; +using Orchard.Core.Settings.Descriptor.Records; +using Orchard.Environment.Configuration; +using Orchard.Environment.State; +using Orchard.Environment.Descriptor; +using Orchard.Environment.Descriptor.Models; +using Orchard.Events; + +namespace Orchard.Tests.Modules.Settings.Blueprint { + [TestFixture] + public class ShellDescriptorManagerTests : DatabaseEnabledTestsBase { + public override void Register(ContainerBuilder builder) { + builder.RegisterInstance(new ShellSettings { Name = "Default" }); + + builder.RegisterType().As().SingleInstance(); + builder.RegisterType().As().SingleInstance(); + builder.RegisterType().As().SingleInstance(); + builder.RegisterSource(new EventsRegistrationSource()); + } + + public class StubEventBus : IEventBus { + public string LastMessageName { get; set; } + public IDictionary LastEventData { get; set; } + + public IEnumerable Notify(string messageName, IDictionary eventData) { + LastMessageName = messageName; + LastEventData = eventData; + return new object[0]; + } + } + + protected override IEnumerable DatabaseTypes { + get { + return new[] { + typeof (ShellDescriptorRecord), + typeof (ShellFeatureRecord), + typeof (ShellParameterRecord), + }; + } + } + + [Test] + public void BlueprintShouldBeNullWhenItsNotInitialized() { + var manager = _container.Resolve(); + var descriptor = manager.GetShellDescriptor(); + Assert.That(descriptor, Is.Null); + } + + [Test] + public void PriorSerialNumberOfZeroIsAcceptableForInitialUpdateAndSerialNumberIsNonzeroAfterwards() { + var manager = _container.Resolve(); + manager.UpdateShellDescriptor( + 0, + Enumerable.Empty(), + Enumerable.Empty()); + + var descriptor = manager.GetShellDescriptor(); + Assert.That(descriptor, Is.Not.Null); + Assert.That(descriptor.SerialNumber, Is.Not.EqualTo(0)); + } + + [Test] + public void NonZeroInitialUpdateThrowsInvalidOperationException() { + var manager = _container.Resolve(); + Assert.Throws(() => manager.UpdateShellDescriptor( + 1, + Enumerable.Empty(), + Enumerable.Empty())); + } + + [Test] + public void OnlyCorrectSerialNumberOnLaterUpdatesDoesNotThrowException() { + var manager = _container.Resolve(); + manager.UpdateShellDescriptor( + 0, + Enumerable.Empty(), + Enumerable.Empty()); + + var descriptor = manager.GetShellDescriptor(); + Assert.That(descriptor.SerialNumber, Is.Not.EqualTo(0)); + + Assert.Throws(() => manager.UpdateShellDescriptor( + 0, + Enumerable.Empty(), + Enumerable.Empty())); + + Assert.Throws(() => manager.UpdateShellDescriptor( + descriptor.SerialNumber + 665321, + Enumerable.Empty(), + Enumerable.Empty())); + + manager.UpdateShellDescriptor( + descriptor.SerialNumber, + Enumerable.Empty(), + Enumerable.Empty()); + + var descriptor2 = manager.GetShellDescriptor(); + Assert.That(descriptor2.SerialNumber, Is.Not.EqualTo(0)); + Assert.That(descriptor2.SerialNumber, Is.Not.EqualTo(descriptor.SerialNumber)); + + Assert.Throws(() => manager.UpdateShellDescriptor( + 0, + Enumerable.Empty(), + Enumerable.Empty())); + + Assert.Throws(() => manager.UpdateShellDescriptor( + descriptor.SerialNumber, + Enumerable.Empty(), + Enumerable.Empty())); + + manager.UpdateShellDescriptor( + descriptor2.SerialNumber, + Enumerable.Empty(), + Enumerable.Empty()); + + Assert.Throws(() => manager.UpdateShellDescriptor( + descriptor2.SerialNumber, + Enumerable.Empty(), + Enumerable.Empty())); + } + + [Test] + public void SuccessfulUpdateRaisesAnEvent() { + var manager = _container.Resolve(); + var eventBus = _container.Resolve() as StubEventBus; + + Assert.That(eventBus.LastMessageName, Is.Null); + + Assert.Throws(() => manager.UpdateShellDescriptor( + 5, + Enumerable.Empty(), + Enumerable.Empty())); + + Assert.That(eventBus.LastMessageName, Is.Null); + + manager.UpdateShellDescriptor( + 0, + Enumerable.Empty(), + Enumerable.Empty()); + + Assert.That(eventBus.LastMessageName, Is.EqualTo("IShellDescriptorManagerEventHandler.Changed")); + } + + [Test] + public void ManagerReturnsStateForFeaturesInDescriptor() { + var descriptorManager = _container.Resolve(); + var stateManager = _container.Resolve(); + var state = stateManager.GetShellState(); + Assert.That(state.Features.Count(), Is.EqualTo(0)); + descriptorManager.UpdateShellDescriptor( + 0, + new[]{new ShellFeature{ Name="Foo"}}, + Enumerable.Empty()); + + var state2 = stateManager.GetShellState(); + Assert.That(state2.Features.Count(), Is.EqualTo(1)); + Assert.That(state2.Features, Has.Some.Property("Name").EqualTo("Foo")); + } + } +} diff --git a/src/Orchard.Tests.Modules/Tags/Services/TagsServiceTests.cs b/src/Orchard.Tests.Modules/Tags/Services/TagsServiceTests.cs index 2a6f098ff6f..79a3d935b02 100644 --- a/src/Orchard.Tests.Modules/Tags/Services/TagsServiceTests.cs +++ b/src/Orchard.Tests.Modules/Tags/Services/TagsServiceTests.cs @@ -1,285 +1,285 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using Autofac; -using Moq; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Handlers; -using Orchard.ContentManagement.Records; -using Orchard.Data; -using Orchard.Environment; -using Orchard.Security; -using Orchard.Tags.Handlers; -using Orchard.Tags.Models; -using Orchard.Tags.Services; -using Orchard.Tests.Stubs; -using Orchard.Tests.Utility; -using Orchard.UI.Notify; - -namespace Orchard.Tests.Modules.Tags.Services { - [TestFixture] - public class TagsServiceTests : DatabaseEnabledTestsBase { - private Mock _authz; - private ITagService _tagService; - private IContentManager _contentManager; - - public override void Register(ContainerBuilder builder) { - _authz = new Mock(); - - builder.RegisterAutoMocking(MockBehavior.Loose); - builder.RegisterInstance(_authz.Object).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); - } - - public override void Init() { - base.Init(); - - _tagService = _container.Resolve(); - _contentManager = _container.Resolve(); - } - - - protected override IEnumerable DatabaseTypes { - get { - return new[] { - typeof(ContentItemRecord), - typeof(ContentItemVersionRecord), - typeof(ContentTypeRecord), - typeof(TagsPartRecord), - typeof(TagRecord), - typeof(ContentTagRecord) - }; - } - } - - [Test] - public void TagServiceShouldResolve() { - } - - [Test] - public void CreateTagShouldBePersistent() { - for (int i = 0; i < 10; i++) { - _tagService.CreateTag("tag" + i); - } - - ClearSession(); - - var tag5 = _tagService.GetTagByName("tag5"); - Assert.That(tag5, Is.Not.Null); - Assert.That(tag5.TagName, Is.EqualTo("tag5")); - - var tag50 = _tagService.GetTagByName("tag50"); - Assert.That(tag50, Is.Null); - } - - - [Test] - public void TagsShouldBeAvailableWhenGettingContentItem() { - var thing = _contentManager.New("thing"); - _contentManager.Create(thing); - _tagService.UpdateTagsForContentItem(thing, new string[] { "tag1", "tag2", "tag3" }); - - ClearSession(); - - var thing2 = _contentManager.Get(thing.Id); - Assert.That(thing2.As().CurrentTags.Any(tag => tag == "tag1"), Is.True); - Assert.That(thing2.As().CurrentTags.Any(tag => tag == "tag2"), Is.True); - Assert.That(thing2.As().CurrentTags.Any(tag => tag == "tag3"), Is.True); - } - - [Test] - public void TagsShouldDeletedAferRemovingContentItem() { - var thing = _contentManager.New("thing"); - _contentManager.Create(thing, VersionOptions.Published); - _tagService.UpdateTagsForContentItem(thing, new string[] { "tag1", "tag2", "tag3" }); - - ClearSession(); - - Assert.That(_tagService.GetTagByName("tag1"), Is.Not.Null); - Assert.That(_tagService.GetTagByName("tag2"), Is.Not.Null); - Assert.That(_tagService.GetTagByName("tag3"), Is.Not.Null); - - _contentManager.Remove(_contentManager.Get(thing.Id)); - - ClearSession(); - - Assert.That(_tagService.GetTagByName("tag1"), Is.Null); - Assert.That(_tagService.GetTagByName("tag2"), Is.Null); - Assert.That(_tagService.GetTagByName("tag3"), Is.Null); - } - - [Test] - public void ContentItemsShouldBeReturnedFromTagService() { - var thing1 = _contentManager.New("thing"); - _contentManager.Create(thing1); - _tagService.UpdateTagsForContentItem(thing1, new string[] { "tag1", "tag2", "tag3" }); - - var thing2 = _contentManager.New("thing"); - _contentManager.Create(thing2); - _tagService.UpdateTagsForContentItem(thing2, new string[] { "tag4", "tag3" }); - - ClearSession(); - - Assert.That(_tagService.GetTaggedContentItems(25), Is.Empty); - - Assert.That(_tagService.GetTaggedContentItems(_tagService.GetTagByName("tag1").Id).Count(), Is.EqualTo(1)); - Assert.That(_tagService.GetTaggedContentItems(_tagService.GetTagByName("tag1").Id).Any(c => c.Id == thing1.Id), Is.True); - - Assert.That(_tagService.GetTaggedContentItems(_tagService.GetTagByName("tag2").Id).Count(), Is.EqualTo(1)); - Assert.That(_tagService.GetTaggedContentItems(_tagService.GetTagByName("tag2").Id).Any(c => c.Id == thing1.Id), Is.True); - - Assert.That(_tagService.GetTaggedContentItems(_tagService.GetTagByName("tag3").Id).Count(), Is.EqualTo(2)); - Assert.That(_tagService.GetTaggedContentItems(_tagService.GetTagByName("tag3").Id).Any(c => c.Id == thing1.Id), Is.True); - Assert.That(_tagService.GetTaggedContentItems(_tagService.GetTagByName("tag3").Id).Any(c => c.Id == thing2.Id), Is.True); - - Assert.That(_tagService.GetTaggedContentItems(_tagService.GetTagByName("tag4").Id).Count(), Is.EqualTo(1)); - Assert.That(_tagService.GetTaggedContentItems(_tagService.GetTagByName("tag4").Id).Any(c => c.Id == thing2.Id), Is.True); - } - - [Test] - public void TagsDeletionShouldDeleteTagsAndAssociations() { - var thing1 = _contentManager.New("thing"); - _contentManager.Create(thing1); - _tagService.UpdateTagsForContentItem(thing1, new string[] {"tag1", "tag2", "tag3"}); - - var thing2 = _contentManager.New("thing"); - _contentManager.Create(thing2); - _tagService.UpdateTagsForContentItem(thing2, new string[] {"tag2", "tag3", "tag4"}); - - ClearSession(); - - Trace.WriteLine(string.Format("Delete tag \"{0}\"", "tag1")); - _tagService.DeleteTag(_tagService.GetTagByName("tag1").Id); - ClearSession(); - - Assert.That(_tagService.GetTagByName("tag1"), Is.Null); - - var test = _contentManager.Get(thing1.Id); - Assert.That(test.As().Record.Tags.Count, Is.EqualTo(2)); - Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag2"), Is.True); - Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag3"), Is.True); - - - Trace.WriteLine(string.Format("Delete tag \"{0}\"", "tag2")); - _tagService.DeleteTag(_tagService.GetTagByName("tag2").Id); - ClearSession(); - - Assert.That(_tagService.GetTagByName("tag2"), Is.Null); - - test = _contentManager.Get(thing1.Id); - Assert.That(test.As().Record.Tags.Count, Is.EqualTo(1)); - Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag3"), Is.True); - - test = _contentManager.Get(thing2.Id); - Assert.That(test.As().Record.Tags.Count, Is.EqualTo(2)); - Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag3"), Is.True); - Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag4"), Is.True); - - Trace.WriteLine(string.Format("Delete tag \"{0}\"", "tag3")); - _tagService.DeleteTag(_tagService.GetTagByName("tag3").Id); - - Trace.WriteLine(string.Format("Delete tag \"{0}\"", "tag4")); - _tagService.DeleteTag(_tagService.GetTagByName("tag4").Id); - ClearSession(); - - Assert.That(_tagService.GetTags(), Is.Empty); - } - - - [Test] - public void TagsAssociationsShouldBeCreatedCorrectly() { - var thing1 = _contentManager.New("thing"); - _contentManager.Create(thing1); - _tagService.UpdateTagsForContentItem(thing1, new string[] { "tag1", "tag2", "tag3" }); - - var thing2 = _contentManager.New("thing"); - _contentManager.Create(thing2); - _tagService.UpdateTagsForContentItem(thing2, new string[] { "tag2", "tag3", "tag4" }); - - ClearSession(); - - var test = _contentManager.Get(thing1.Id); - Assert.That(test.As().Record.Tags.Count, Is.EqualTo(3)); - Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag1"), Is.True); - Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag2"), Is.True); - Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag3"), Is.True); - - test = _contentManager.Get(thing2.Id); - Assert.That(test.As().Record.Tags.Count, Is.EqualTo(3)); - Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag2"), Is.True); - Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag3"), Is.True); - Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag4"), Is.True); - - Assert.That(_tagService.GetTagByName("tag1").ContentTags.Count, Is.EqualTo(1)); - Assert.That(_tagService.GetTagByName("tag1").ContentTags.Any(t => t.TagsPartRecord.Id == thing1.Id), Is.True); - - Assert.That(_tagService.GetTagByName("tag2").ContentTags.Count, Is.EqualTo(2)); - Assert.That(_tagService.GetTagByName("tag2").ContentTags.Any(t => t.TagsPartRecord.Id == thing1.Id), Is.True); - Assert.That(_tagService.GetTagByName("tag2").ContentTags.Any(t => t.TagsPartRecord.Id == thing2.Id), Is.True); - - Assert.That(_tagService.GetTagByName("tag3").ContentTags.Count, Is.EqualTo(2)); - Assert.That(_tagService.GetTagByName("tag3").ContentTags.Any(t => t.TagsPartRecord.Id == thing1.Id), Is.True); - Assert.That(_tagService.GetTagByName("tag3").ContentTags.Any(t => t.TagsPartRecord.Id == thing2.Id), Is.True); - - Assert.That(_tagService.GetTagByName("tag4").ContentTags.Count, Is.EqualTo(1)); - Assert.That(_tagService.GetTagByName("tag4").ContentTags.Any(t => t.TagsPartRecord.Id == thing2.Id), Is.True); - } - - [Test] - public void RenamingATagShouldMergeTaggedItems() { - var thing1 = _contentManager.New("thing"); - _contentManager.Create(thing1); - _tagService.UpdateTagsForContentItem(thing1, new string[] { "tag1", "tag2", "tag3" }); - - var thing2 = _contentManager.New("thing"); - _contentManager.Create(thing2); - _tagService.UpdateTagsForContentItem(thing2, new string[] { "tag2" }); - - var thing3 = _contentManager.New("thing"); - _contentManager.Create(thing3); - _tagService.UpdateTagsForContentItem(thing3, new string[] { "tag3" }); - - // Renamed and merge "tag2" to "tag3" - var tag = _tagService.GetTagByName("tag2"); - _tagService.UpdateTag(tag.Id, "tag3"); - - ClearSession(); - - Assert.That(_tagService.GetTags().Count(), Is.EqualTo(2)); - Assert.That(_tagService.GetTags().Any(tagRecord => tagRecord.TagName == "tag1"), Is.True); - Assert.That(_tagService.GetTags().Any(tagRecord => tagRecord.TagName == "tag2"), Is.False); - Assert.That(_tagService.GetTags().Any(tagRecord => tagRecord.TagName == "tag3"), Is.True); - - Assert.That(_contentManager.Get(thing1.Id).As().CurrentTags.Any(t => t == "tag1"), Is.True); - Assert.That(_contentManager.Get(thing1.Id).As().CurrentTags.Any(t => t == "tag2"), Is.False); - Assert.That(_contentManager.Get(thing1.Id).As().CurrentTags.Any(t => t == "tag3"), Is.True); - - Assert.That(_contentManager.Get(thing2.Id).As().CurrentTags.Any(t => t == "tag2"), Is.False); - Assert.That(_contentManager.Get(thing2.Id).As().CurrentTags.Any(t => t == "tag3"), Is.True); - - Assert.That(_contentManager.Get(thing3.Id).As().CurrentTags.Any(t => t == "tag3"), Is.True); - } - - public class ThingHandler : ContentHandler { - public ThingHandler() { - Filters.Add(new ActivatingFilter("thing")); - Filters.Add(new ActivatingFilter("thing")); - } - } - - public class Thing : ContentPart { - } - } -} +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using Autofac; +using Moq; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Handlers; +using Orchard.ContentManagement.Records; +using Orchard.Data; +using Orchard.Environment; +using Orchard.Security; +using Orchard.Tags.Handlers; +using Orchard.Tags.Models; +using Orchard.Tags.Services; +using Orchard.Tests.Stubs; +using Orchard.Tests.Utility; +using Orchard.UI.Notify; + +namespace Orchard.Tests.Modules.Tags.Services { + [TestFixture] + public class TagsServiceTests : DatabaseEnabledTestsBase { + private Mock _authz; + private ITagService _tagService; + private IContentManager _contentManager; + + public override void Register(ContainerBuilder builder) { + _authz = new Mock(); + + builder.RegisterAutoMocking(MockBehavior.Loose); + builder.RegisterInstance(_authz.Object).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); + } + + public override void Init() { + base.Init(); + + _tagService = _container.Resolve(); + _contentManager = _container.Resolve(); + } + + + protected override IEnumerable DatabaseTypes { + get { + return new[] { + typeof(ContentItemRecord), + typeof(ContentItemVersionRecord), + typeof(ContentTypeRecord), + typeof(TagsPartRecord), + typeof(TagRecord), + typeof(ContentTagRecord) + }; + } + } + + [Test] + public void TagServiceShouldResolve() { + } + + [Test] + public void CreateTagShouldBePersistent() { + for (int i = 0; i < 10; i++) { + _tagService.CreateTag("tag" + i); + } + + ClearSession(); + + var tag5 = _tagService.GetTagByName("tag5"); + Assert.That(tag5, Is.Not.Null); + Assert.That(tag5.TagName, Is.EqualTo("tag5")); + + var tag50 = _tagService.GetTagByName("tag50"); + Assert.That(tag50, Is.Null); + } + + + [Test] + public void TagsShouldBeAvailableWhenGettingContentItem() { + var thing = _contentManager.New("thing"); + _contentManager.Create(thing); + _tagService.UpdateTagsForContentItem(thing, new string[] { "tag1", "tag2", "tag3" }); + + ClearSession(); + + var thing2 = _contentManager.Get(thing.Id); + Assert.That(thing2.As().CurrentTags.Any(tag => tag == "tag1"), Is.True); + Assert.That(thing2.As().CurrentTags.Any(tag => tag == "tag2"), Is.True); + Assert.That(thing2.As().CurrentTags.Any(tag => tag == "tag3"), Is.True); + } + + [Test] + public void TagsShouldDeletedAferRemovingContentItem() { + var thing = _contentManager.New("thing"); + _contentManager.Create(thing, VersionOptions.Published); + _tagService.UpdateTagsForContentItem(thing, new string[] { "tag1", "tag2", "tag3" }); + + ClearSession(); + + Assert.That(_tagService.GetTagByName("tag1"), Is.Not.Null); + Assert.That(_tagService.GetTagByName("tag2"), Is.Not.Null); + Assert.That(_tagService.GetTagByName("tag3"), Is.Not.Null); + + _contentManager.Remove(_contentManager.Get(thing.Id)); + + ClearSession(); + + Assert.That(_tagService.GetTagByName("tag1"), Is.Null); + Assert.That(_tagService.GetTagByName("tag2"), Is.Null); + Assert.That(_tagService.GetTagByName("tag3"), Is.Null); + } + + [Test] + public void ContentItemsShouldBeReturnedFromTagService() { + var thing1 = _contentManager.New("thing"); + _contentManager.Create(thing1); + _tagService.UpdateTagsForContentItem(thing1, new string[] { "tag1", "tag2", "tag3" }); + + var thing2 = _contentManager.New("thing"); + _contentManager.Create(thing2); + _tagService.UpdateTagsForContentItem(thing2, new string[] { "tag4", "tag3" }); + + ClearSession(); + + Assert.That(_tagService.GetTaggedContentItems(25), Is.Empty); + + Assert.That(_tagService.GetTaggedContentItems(_tagService.GetTagByName("tag1").Id).Count(), Is.EqualTo(1)); + Assert.That(_tagService.GetTaggedContentItems(_tagService.GetTagByName("tag1").Id).Any(c => c.Id == thing1.Id), Is.True); + + Assert.That(_tagService.GetTaggedContentItems(_tagService.GetTagByName("tag2").Id).Count(), Is.EqualTo(1)); + Assert.That(_tagService.GetTaggedContentItems(_tagService.GetTagByName("tag2").Id).Any(c => c.Id == thing1.Id), Is.True); + + Assert.That(_tagService.GetTaggedContentItems(_tagService.GetTagByName("tag3").Id).Count(), Is.EqualTo(2)); + Assert.That(_tagService.GetTaggedContentItems(_tagService.GetTagByName("tag3").Id).Any(c => c.Id == thing1.Id), Is.True); + Assert.That(_tagService.GetTaggedContentItems(_tagService.GetTagByName("tag3").Id).Any(c => c.Id == thing2.Id), Is.True); + + Assert.That(_tagService.GetTaggedContentItems(_tagService.GetTagByName("tag4").Id).Count(), Is.EqualTo(1)); + Assert.That(_tagService.GetTaggedContentItems(_tagService.GetTagByName("tag4").Id).Any(c => c.Id == thing2.Id), Is.True); + } + + [Test] + public void TagsDeletionShouldDeleteTagsAndAssociations() { + var thing1 = _contentManager.New("thing"); + _contentManager.Create(thing1); + _tagService.UpdateTagsForContentItem(thing1, new string[] {"tag1", "tag2", "tag3"}); + + var thing2 = _contentManager.New("thing"); + _contentManager.Create(thing2); + _tagService.UpdateTagsForContentItem(thing2, new string[] {"tag2", "tag3", "tag4"}); + + ClearSession(); + + Trace.WriteLine(string.Format("Delete tag \"{0}\"", "tag1")); + _tagService.DeleteTag(_tagService.GetTagByName("tag1").Id); + ClearSession(); + + Assert.That(_tagService.GetTagByName("tag1"), Is.Null); + + var test = _contentManager.Get(thing1.Id); + Assert.That(test.As().Record.Tags.Count, Is.EqualTo(2)); + Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag2"), Is.True); + Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag3"), Is.True); + + + Trace.WriteLine(string.Format("Delete tag \"{0}\"", "tag2")); + _tagService.DeleteTag(_tagService.GetTagByName("tag2").Id); + ClearSession(); + + Assert.That(_tagService.GetTagByName("tag2"), Is.Null); + + test = _contentManager.Get(thing1.Id); + Assert.That(test.As().Record.Tags.Count, Is.EqualTo(1)); + Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag3"), Is.True); + + test = _contentManager.Get(thing2.Id); + Assert.That(test.As().Record.Tags.Count, Is.EqualTo(2)); + Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag3"), Is.True); + Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag4"), Is.True); + + Trace.WriteLine(string.Format("Delete tag \"{0}\"", "tag3")); + _tagService.DeleteTag(_tagService.GetTagByName("tag3").Id); + + Trace.WriteLine(string.Format("Delete tag \"{0}\"", "tag4")); + _tagService.DeleteTag(_tagService.GetTagByName("tag4").Id); + ClearSession(); + + Assert.That(_tagService.GetTags(), Is.Empty); + } + + + [Test] + public void TagsAssociationsShouldBeCreatedCorrectly() { + var thing1 = _contentManager.New("thing"); + _contentManager.Create(thing1); + _tagService.UpdateTagsForContentItem(thing1, new string[] { "tag1", "tag2", "tag3" }); + + var thing2 = _contentManager.New("thing"); + _contentManager.Create(thing2); + _tagService.UpdateTagsForContentItem(thing2, new string[] { "tag2", "tag3", "tag4" }); + + ClearSession(); + + var test = _contentManager.Get(thing1.Id); + Assert.That(test.As().Record.Tags.Count, Is.EqualTo(3)); + Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag1"), Is.True); + Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag2"), Is.True); + Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag3"), Is.True); + + test = _contentManager.Get(thing2.Id); + Assert.That(test.As().Record.Tags.Count, Is.EqualTo(3)); + Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag2"), Is.True); + Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag3"), Is.True); + Assert.That(test.As().Record.Tags.Any(t => t.TagRecord.TagName == "tag4"), Is.True); + + Assert.That(_tagService.GetTagByName("tag1").ContentTags.Count, Is.EqualTo(1)); + Assert.That(_tagService.GetTagByName("tag1").ContentTags.Any(t => t.TagsPartRecord.Id == thing1.Id), Is.True); + + Assert.That(_tagService.GetTagByName("tag2").ContentTags.Count, Is.EqualTo(2)); + Assert.That(_tagService.GetTagByName("tag2").ContentTags.Any(t => t.TagsPartRecord.Id == thing1.Id), Is.True); + Assert.That(_tagService.GetTagByName("tag2").ContentTags.Any(t => t.TagsPartRecord.Id == thing2.Id), Is.True); + + Assert.That(_tagService.GetTagByName("tag3").ContentTags.Count, Is.EqualTo(2)); + Assert.That(_tagService.GetTagByName("tag3").ContentTags.Any(t => t.TagsPartRecord.Id == thing1.Id), Is.True); + Assert.That(_tagService.GetTagByName("tag3").ContentTags.Any(t => t.TagsPartRecord.Id == thing2.Id), Is.True); + + Assert.That(_tagService.GetTagByName("tag4").ContentTags.Count, Is.EqualTo(1)); + Assert.That(_tagService.GetTagByName("tag4").ContentTags.Any(t => t.TagsPartRecord.Id == thing2.Id), Is.True); + } + + [Test] + public void RenamingATagShouldMergeTaggedItems() { + var thing1 = _contentManager.New("thing"); + _contentManager.Create(thing1); + _tagService.UpdateTagsForContentItem(thing1, new string[] { "tag1", "tag2", "tag3" }); + + var thing2 = _contentManager.New("thing"); + _contentManager.Create(thing2); + _tagService.UpdateTagsForContentItem(thing2, new string[] { "tag2" }); + + var thing3 = _contentManager.New("thing"); + _contentManager.Create(thing3); + _tagService.UpdateTagsForContentItem(thing3, new string[] { "tag3" }); + + // Renamed and merge "tag2" to "tag3" + var tag = _tagService.GetTagByName("tag2"); + _tagService.UpdateTag(tag.Id, "tag3"); + + ClearSession(); + + Assert.That(_tagService.GetTags().Count(), Is.EqualTo(2)); + Assert.That(_tagService.GetTags().Any(tagRecord => tagRecord.TagName == "tag1"), Is.True); + Assert.That(_tagService.GetTags().Any(tagRecord => tagRecord.TagName == "tag2"), Is.False); + Assert.That(_tagService.GetTags().Any(tagRecord => tagRecord.TagName == "tag3"), Is.True); + + Assert.That(_contentManager.Get(thing1.Id).As().CurrentTags.Any(t => t == "tag1"), Is.True); + Assert.That(_contentManager.Get(thing1.Id).As().CurrentTags.Any(t => t == "tag2"), Is.False); + Assert.That(_contentManager.Get(thing1.Id).As().CurrentTags.Any(t => t == "tag3"), Is.True); + + Assert.That(_contentManager.Get(thing2.Id).As().CurrentTags.Any(t => t == "tag2"), Is.False); + Assert.That(_contentManager.Get(thing2.Id).As().CurrentTags.Any(t => t == "tag3"), Is.True); + + Assert.That(_contentManager.Get(thing3.Id).As().CurrentTags.Any(t => t == "tag3"), Is.True); + } + + public class ThingHandler : ContentHandler { + public ThingHandler() { + Filters.Add(new ActivatingFilter("thing")); + Filters.Add(new ActivatingFilter("thing")); + } + } + + public class Thing : ContentPart { + } + } +} diff --git a/src/Orchard.Tests.Modules/Themes/Services/ThemeServiceTests.cs b/src/Orchard.Tests.Modules/Themes/Services/ThemeServiceTests.cs index 2181f49d282..384558d6d8f 100644 --- a/src/Orchard.Tests.Modules/Themes/Services/ThemeServiceTests.cs +++ b/src/Orchard.Tests.Modules/Themes/Services/ThemeServiceTests.cs @@ -1,281 +1,281 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Xml.Linq; -using Autofac; -using Moq; -using NHibernate; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Handlers; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.MetaData.Models; -using Orchard.ContentManagement.MetaData.Services; -using Orchard.ContentManagement.Records; -using Orchard.Core.Settings.Descriptor.Records; -using Orchard.Core.Settings.Metadata; -using Orchard.Core.Settings.Models; -using Orchard.Core.Settings.Services; -using Orchard.Data; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.DisplayManagement.Implementation; -using Orchard.Environment; -using Orchard.Environment.AutofacUtil.DynamicProxy2; -using Orchard.Environment.Descriptor; -using Orchard.Environment.Descriptor.Models; -using Orchard.Environment.Extensions; -using Orchard.Environment.Extensions.Models; -using Orchard.Environment.Features; -using Orchard.Localization; -using Orchard.Modules; -using Orchard.Modules.Services; -using Orchard.Security; -using Orchard.Security.Permissions; -using Orchard.Settings; -using Orchard.Tests.Stubs; -using Orchard.Tests.Utility; -using Orchard.Themes; -using Orchard.Themes.Handlers; -using Orchard.Themes.Models; -using Orchard.Themes.Services; -using Orchard.UI.Notify; - -namespace Orchard.Tests.Modules.Themes.Services { -#if REFACTORING - [TestFixture, Ignore] - public class ThemeServiceTests { - private IThemeService _themeService; - private ISiteThemeService _siteThemeService; - private IContainer _container; - private ISessionFactory _sessionFactory; - private ISession _session; - private IFeatureManager _featureManager; - - [TestFixtureSetUp] - public void InitFixture() { - var databaseFileName = System.IO.Path.GetTempFileName(); - _sessionFactory = DataUtility.CreateSessionFactory(databaseFileName, - typeof(ThemeSiteSettingsPartRecord), - typeof(SiteSettingsPartRecord), - typeof(ContentItemVersionRecord), - typeof(ContentItemRecord), - typeof(ContentTypeRecord)); - } - - [TestFixtureTearDown] - public void TermFixture() { } - - [SetUp] - public void Init() { - var context = new DynamicProxyContext(); - var builder = new ContainerBuilder(); - builder.RegisterType().As(); - builder.RegisterType().EnableDynamicProxy(context).As(); - builder.RegisterType().As(); - builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - //builder.RegisterType().As(); - builder.RegisterType(); - builder.RegisterType().As(); - builder.RegisterType().As().InstancePerLifetimeScope(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType(typeof(SettingsFormatter)) - .As(typeof(IMapper)) - .As(typeof(IMapper)); - _session = _sessionFactory.OpenSession(); - builder.RegisterInstance(new TestSessionLocator(_session)).As(); - builder.RegisterAutoMocking(MockBehavior.Loose); - _container = builder.Build(); - _themeService = _container.Resolve(); - _siteThemeService = _container.Resolve(); - _featureManager = _container.Resolve(); - } - - //todo: test theme feature enablement - - [Test] - public void ThemeWithNoBaseThemeCanBeSetAsSiteTheme() { - _siteThemeService.SetSiteTheme("ThemeOne"); - var siteTheme = _siteThemeService.GetSiteTheme(); - Assert.That(siteTheme.Name, Is.EqualTo("ThemeOne")); - } - - [Test] - public void ThemeWithAvailableBaseThemeCanBeSetAsSiteTheme() { - _siteThemeService.SetSiteTheme("ThemeTwo"); - var siteTheme = _siteThemeService.GetSiteTheme(); - Assert.That(siteTheme.Name, Is.EqualTo("ThemeTwo")); - Assert.That(siteTheme.BaseTheme, Is.EqualTo("ThemeOne")); - } - - [Test] - public void ThemeWithUnavailableBaseThemeCanBeSetAsSiteTheme() { - _siteThemeService.SetSiteTheme("ThemeOne"); - _siteThemeService.SetSiteTheme("ThemeThree"); - var siteTheme = _siteThemeService.GetSiteTheme(); - Assert.That(siteTheme.Name, Is.EqualTo("ThemeOne")); - } - - [Test] - public void ThemeWithCircularBaseDepTrowsExceptionOnActivation() { - _siteThemeService.SetSiteTheme("ThemeOne"); - try { - _siteThemeService.SetSiteTheme("ThemeFourBasedOnFive"); - } catch (InvalidOperationException ex) { - Assert.That(ex.Message, Is.StringMatching("ThemeFiveBasedOnFour")); - } - var siteTheme = _siteThemeService.GetSiteTheme(); - Assert.That(siteTheme.Name, Is.EqualTo("ThemeOne")); - } - - [Test] - public void CanEnableAndDisableThemes() { - _featureManager.EnableFeature("ThemeOne"); - Assert.IsTrue(_themeService.GetThemeByName("ThemeOne").Enabled); - Assert.IsTrue(_container.Resolve().GetShellDescriptor().Features.Any(sf => sf.Name == "ThemeOne")); - _featureManager.DisableFeature("ThemeOne"); - Assert.IsFalse(_themeService.GetThemeByName("ThemeOne").Enabled); - Assert.IsFalse(_container.Resolve().GetShellDescriptor().Features.Any(sf => sf.Name == "ThemeOne")); - } - - [Test] - public void ActivatingThemeEnablesIt() { - _siteThemeService.SetSiteTheme("ThemeOne"); - Assert.IsTrue(_themeService.GetThemeByName("ThemeOne").Enabled); - Assert.IsTrue(_container.Resolve().GetShellDescriptor().Features.Any(sf => sf.Name == "ThemeOne")); - } - - [Test] - public void ActivatingThemeDoesNotDisableOldTheme() { - _siteThemeService.SetSiteTheme("ThemeOne"); - _siteThemeService.SetSiteTheme("ThemeTwo"); - Assert.IsTrue(_themeService.GetThemeByName("ThemeOne").Enabled); - Assert.IsTrue(_themeService.GetThemeByName("ThemeTwo").Enabled); - Assert.IsTrue(_container.Resolve().GetShellDescriptor().Features.Any(sf => sf.Name == "ThemeOne")); - Assert.IsTrue(_container.Resolve().GetShellDescriptor().Features.Any(sf => sf.Name == "ThemeTwo")); - } - - - #region Stubs - - public class TestSessionLocator : ISessionLocator { - private readonly ISession _session; - - public TestSessionLocator(ISession session) { - _session = session; - } - - public ISession For(Type entityType) { - return _session; - } - } - - public class StubAuthorizer : IAuthorizer { - public bool Authorize(Permission permission) { - return true; - } - public bool Authorize(Permission permission, LocalizedString message) { - return true; - } - public bool Authorize(Permission permission, IContent content, LocalizedString message) { - return true; - } - } - - public class StubExtensionManager : IExtensionManager { - public IEnumerable AvailableExtensions() { - var extensions = new[] { - new ExtensionDescriptor {Name = "ThemeOne", ExtensionType = "Theme"}, - new ExtensionDescriptor {Name = "ThemeTwo", BaseTheme = "ThemeOne", ExtensionType = "Theme"}, - new ExtensionDescriptor {Name = "ThemeThree", BaseTheme = "TheThemeThatIsntThere", ExtensionType = "Theme"}, - new ExtensionDescriptor {Name = "ThemeFourBasedOnFive", BaseTheme = "ThemeFiveBasedOnFour", ExtensionType = "Theme"}, - new ExtensionDescriptor {Name = "ThemeFiveBasedOnFour", BaseTheme = "ThemeFourBasedOnFive", ExtensionType = "Theme"}, - }; - - foreach (var extension in extensions) { - extension.Features = new[] { new FeatureDescriptor { Extension = extension, Name = extension.Name } }; - yield return extension; - } - } - - public IEnumerable AvailableFeatures() { - return AvailableExtensions().SelectMany(ed => ed.Features); - } - - public IEnumerable LoadFeatures(IEnumerable featureDescriptors) { - return featureDescriptors.Select(FrameworkFeature); - } - - private static Feature FrameworkFeature(FeatureDescriptor descriptor) { - return new Feature { - Descriptor = descriptor - }; - } - - public void InstallExtension(string extensionType, HttpPostedFileBase extensionBundle) { - throw new NotImplementedException(); - } - - public void UninstallExtension(string extensionType, string extensionName) { - throw new NotImplementedException(); - } - - public void Monitor(Action monitor) { - throw new NotImplementedException(); - } - } - - public class StubShellDescriptorManager : IShellDescriptorManager { - private readonly ShellDescriptorRecord _shellDescriptorRecord = new ShellDescriptorRecord(); - public ShellDescriptor GetShellDescriptor() { - return GetShellDescriptorFromRecord(_shellDescriptorRecord); - } - - public void UpdateShellDescriptor(int priorSerialNumber, IEnumerable enabledFeatures, IEnumerable parameters) { - _shellDescriptorRecord.Features.Clear(); - foreach (var feature in enabledFeatures) { - _shellDescriptorRecord.Features.Add(new ShellFeatureRecord { Name = feature.Name, ShellDescriptorRecord = null }); - } - - _shellDescriptorRecord.Parameters.Clear(); - foreach (var parameter in parameters) { - _shellDescriptorRecord.Parameters.Add(new ShellParameterRecord { - Component = parameter.Component, - Name = parameter.Name, - Value = parameter.Value, - ShellDescriptorRecord = null - }); - } - } - - private static ShellDescriptor GetShellDescriptorFromRecord(ShellDescriptorRecord shellDescriptorRecord) { - return new ShellDescriptor { - SerialNumber = shellDescriptorRecord.SerialNumber, - Features = shellDescriptorRecord.Features.Select(descriptorFeatureRecord => new ShellFeature {Name = descriptorFeatureRecord.Name}).ToList(), - Parameters = shellDescriptorRecord.Parameters.Select(descriptorParameterRecord => new ShellParameter { - Component = descriptorParameterRecord.Component, Name = descriptorParameterRecord.Name, Value = descriptorParameterRecord.Value - }).ToList() - }; - } - } - - #endregion - } -#endif -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Xml.Linq; +using Autofac; +using Moq; +using NHibernate; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Handlers; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.ContentManagement.MetaData.Services; +using Orchard.ContentManagement.Records; +using Orchard.Core.Settings.Descriptor.Records; +using Orchard.Core.Settings.Metadata; +using Orchard.Core.Settings.Models; +using Orchard.Core.Settings.Services; +using Orchard.Data; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.DisplayManagement.Implementation; +using Orchard.Environment; +using Orchard.Environment.AutofacUtil.DynamicProxy2; +using Orchard.Environment.Descriptor; +using Orchard.Environment.Descriptor.Models; +using Orchard.Environment.Extensions; +using Orchard.Environment.Extensions.Models; +using Orchard.Environment.Features; +using Orchard.Localization; +using Orchard.Modules; +using Orchard.Modules.Services; +using Orchard.Security; +using Orchard.Security.Permissions; +using Orchard.Settings; +using Orchard.Tests.Stubs; +using Orchard.Tests.Utility; +using Orchard.Themes; +using Orchard.Themes.Handlers; +using Orchard.Themes.Models; +using Orchard.Themes.Services; +using Orchard.UI.Notify; + +namespace Orchard.Tests.Modules.Themes.Services { +#if REFACTORING + [TestFixture, Ignore] + public class ThemeServiceTests { + private IThemeService _themeService; + private ISiteThemeService _siteThemeService; + private IContainer _container; + private ISessionFactory _sessionFactory; + private ISession _session; + private IFeatureManager _featureManager; + + [TestFixtureSetUp] + public void InitFixture() { + var databaseFileName = System.IO.Path.GetTempFileName(); + _sessionFactory = DataUtility.CreateSessionFactory(databaseFileName, + typeof(ThemeSiteSettingsPartRecord), + typeof(SiteSettingsPartRecord), + typeof(ContentItemVersionRecord), + typeof(ContentItemRecord), + typeof(ContentTypeRecord)); + } + + [TestFixtureTearDown] + public void TermFixture() { } + + [SetUp] + public void Init() { + var context = new DynamicProxyContext(); + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + builder.RegisterType().EnableDynamicProxy(context).As(); + builder.RegisterType().As(); + builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + //builder.RegisterType().As(); + builder.RegisterType(); + builder.RegisterType().As(); + builder.RegisterType().As().InstancePerLifetimeScope(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType(typeof(SettingsFormatter)) + .As(typeof(IMapper)) + .As(typeof(IMapper)); + _session = _sessionFactory.OpenSession(); + builder.RegisterInstance(new TestSessionLocator(_session)).As(); + builder.RegisterAutoMocking(MockBehavior.Loose); + _container = builder.Build(); + _themeService = _container.Resolve(); + _siteThemeService = _container.Resolve(); + _featureManager = _container.Resolve(); + } + + //todo: test theme feature enablement + + [Test] + public void ThemeWithNoBaseThemeCanBeSetAsSiteTheme() { + _siteThemeService.SetSiteTheme("ThemeOne"); + var siteTheme = _siteThemeService.GetSiteTheme(); + Assert.That(siteTheme.Name, Is.EqualTo("ThemeOne")); + } + + [Test] + public void ThemeWithAvailableBaseThemeCanBeSetAsSiteTheme() { + _siteThemeService.SetSiteTheme("ThemeTwo"); + var siteTheme = _siteThemeService.GetSiteTheme(); + Assert.That(siteTheme.Name, Is.EqualTo("ThemeTwo")); + Assert.That(siteTheme.BaseTheme, Is.EqualTo("ThemeOne")); + } + + [Test] + public void ThemeWithUnavailableBaseThemeCanBeSetAsSiteTheme() { + _siteThemeService.SetSiteTheme("ThemeOne"); + _siteThemeService.SetSiteTheme("ThemeThree"); + var siteTheme = _siteThemeService.GetSiteTheme(); + Assert.That(siteTheme.Name, Is.EqualTo("ThemeOne")); + } + + [Test] + public void ThemeWithCircularBaseDepTrowsExceptionOnActivation() { + _siteThemeService.SetSiteTheme("ThemeOne"); + try { + _siteThemeService.SetSiteTheme("ThemeFourBasedOnFive"); + } catch (InvalidOperationException ex) { + Assert.That(ex.Message, Is.StringMatching("ThemeFiveBasedOnFour")); + } + var siteTheme = _siteThemeService.GetSiteTheme(); + Assert.That(siteTheme.Name, Is.EqualTo("ThemeOne")); + } + + [Test] + public void CanEnableAndDisableThemes() { + _featureManager.EnableFeature("ThemeOne"); + Assert.IsTrue(_themeService.GetThemeByName("ThemeOne").Enabled); + Assert.IsTrue(_container.Resolve().GetShellDescriptor().Features.Any(sf => sf.Name == "ThemeOne")); + _featureManager.DisableFeature("ThemeOne"); + Assert.IsFalse(_themeService.GetThemeByName("ThemeOne").Enabled); + Assert.IsFalse(_container.Resolve().GetShellDescriptor().Features.Any(sf => sf.Name == "ThemeOne")); + } + + [Test] + public void ActivatingThemeEnablesIt() { + _siteThemeService.SetSiteTheme("ThemeOne"); + Assert.IsTrue(_themeService.GetThemeByName("ThemeOne").Enabled); + Assert.IsTrue(_container.Resolve().GetShellDescriptor().Features.Any(sf => sf.Name == "ThemeOne")); + } + + [Test] + public void ActivatingThemeDoesNotDisableOldTheme() { + _siteThemeService.SetSiteTheme("ThemeOne"); + _siteThemeService.SetSiteTheme("ThemeTwo"); + Assert.IsTrue(_themeService.GetThemeByName("ThemeOne").Enabled); + Assert.IsTrue(_themeService.GetThemeByName("ThemeTwo").Enabled); + Assert.IsTrue(_container.Resolve().GetShellDescriptor().Features.Any(sf => sf.Name == "ThemeOne")); + Assert.IsTrue(_container.Resolve().GetShellDescriptor().Features.Any(sf => sf.Name == "ThemeTwo")); + } + + + #region Stubs + + public class TestSessionLocator : ISessionLocator { + private readonly ISession _session; + + public TestSessionLocator(ISession session) { + _session = session; + } + + public ISession For(Type entityType) { + return _session; + } + } + + public class StubAuthorizer : IAuthorizer { + public bool Authorize(Permission permission) { + return true; + } + public bool Authorize(Permission permission, LocalizedString message) { + return true; + } + public bool Authorize(Permission permission, IContent content, LocalizedString message) { + return true; + } + } + + public class StubExtensionManager : IExtensionManager { + public IEnumerable AvailableExtensions() { + var extensions = new[] { + new ExtensionDescriptor {Name = "ThemeOne", ExtensionType = "Theme"}, + new ExtensionDescriptor {Name = "ThemeTwo", BaseTheme = "ThemeOne", ExtensionType = "Theme"}, + new ExtensionDescriptor {Name = "ThemeThree", BaseTheme = "TheThemeThatIsntThere", ExtensionType = "Theme"}, + new ExtensionDescriptor {Name = "ThemeFourBasedOnFive", BaseTheme = "ThemeFiveBasedOnFour", ExtensionType = "Theme"}, + new ExtensionDescriptor {Name = "ThemeFiveBasedOnFour", BaseTheme = "ThemeFourBasedOnFive", ExtensionType = "Theme"}, + }; + + foreach (var extension in extensions) { + extension.Features = new[] { new FeatureDescriptor { Extension = extension, Name = extension.Name } }; + yield return extension; + } + } + + public IEnumerable AvailableFeatures() { + return AvailableExtensions().SelectMany(ed => ed.Features); + } + + public IEnumerable LoadFeatures(IEnumerable featureDescriptors) { + return featureDescriptors.Select(FrameworkFeature); + } + + private static Feature FrameworkFeature(FeatureDescriptor descriptor) { + return new Feature { + Descriptor = descriptor + }; + } + + public void InstallExtension(string extensionType, HttpPostedFileBase extensionBundle) { + throw new NotImplementedException(); + } + + public void UninstallExtension(string extensionType, string extensionName) { + throw new NotImplementedException(); + } + + public void Monitor(Action monitor) { + throw new NotImplementedException(); + } + } + + public class StubShellDescriptorManager : IShellDescriptorManager { + private readonly ShellDescriptorRecord _shellDescriptorRecord = new ShellDescriptorRecord(); + public ShellDescriptor GetShellDescriptor() { + return GetShellDescriptorFromRecord(_shellDescriptorRecord); + } + + public void UpdateShellDescriptor(int priorSerialNumber, IEnumerable enabledFeatures, IEnumerable parameters) { + _shellDescriptorRecord.Features.Clear(); + foreach (var feature in enabledFeatures) { + _shellDescriptorRecord.Features.Add(new ShellFeatureRecord { Name = feature.Name, ShellDescriptorRecord = null }); + } + + _shellDescriptorRecord.Parameters.Clear(); + foreach (var parameter in parameters) { + _shellDescriptorRecord.Parameters.Add(new ShellParameterRecord { + Component = parameter.Component, + Name = parameter.Name, + Value = parameter.Value, + ShellDescriptorRecord = null + }); + } + } + + private static ShellDescriptor GetShellDescriptorFromRecord(ShellDescriptorRecord shellDescriptorRecord) { + return new ShellDescriptor { + SerialNumber = shellDescriptorRecord.SerialNumber, + Features = shellDescriptorRecord.Features.Select(descriptorFeatureRecord => new ShellFeature {Name = descriptorFeatureRecord.Name}).ToList(), + Parameters = shellDescriptorRecord.Parameters.Select(descriptorParameterRecord => new ShellParameter { + Component = descriptorParameterRecord.Component, Name = descriptorParameterRecord.Name, Value = descriptorParameterRecord.Value + }).ToList() + }; + } + } + + #endregion + } +#endif +} diff --git a/src/Orchard.Tests.Modules/Users/Controllers/AccountControllerTests.cs b/src/Orchard.Tests.Modules/Users/Controllers/AccountControllerTests.cs index 0671dbec3be..e4ee004b555 100644 --- a/src/Orchard.Tests.Modules/Users/Controllers/AccountControllerTests.cs +++ b/src/Orchard.Tests.Modules/Users/Controllers/AccountControllerTests.cs @@ -1,376 +1,376 @@ -using System; -using System.Collections.Generic; -using System.Web; -using System.Web.Mvc; -using System.Web.Routing; -using Autofac; -using Moq; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.MetaData.Services; -using Orchard.Core.Settings.Metadata; -using Orchard.Data; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.DisplayManagement.Implementation; -using Orchard.Environment; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Handlers; -using Orchard.ContentManagement.Records; -using Orchard.Environment.Extensions; -using Orchard.Localization; -using Orchard.Messaging.Events; -using Orchard.Messaging.Services; -using Orchard.Security; -using Orchard.Security.Permissions; -using Orchard.Security.Providers; -using Orchard.Tests.ContentManagement; -using Orchard.Tests.Stubs; -using Orchard.UI.Notify; -using Orchard.Users.Controllers; -using Orchard.Users.Events; -using Orchard.Users.Handlers; -using Orchard.Users.Models; -using Orchard.Users.Services; -using Orchard.Settings; -using Orchard.Core.Settings.Services; -using Orchard.Tests.Messaging; -using Orchard.Core.Settings.Models; -using Orchard.Core.Settings.Handlers; -using System.Collections.Specialized; -using Orchard.Mvc; -using Orchard.Tests.Modules.Stubs; -using Orchard.Environment.Configuration; - -namespace Orchard.Tests.Modules.Users.Controllers { - [TestFixture] - public class AccountControllerTests : DatabaseEnabledTestsBase { - private AccountController _controller; - private Mock _authorizer; - private Mock _workContext; - private MessagingChannelStub _channel; - - public override void Register(ContainerBuilder builder) { - _channel = new MessagingChannelStub(); - - builder.RegisterType().SingleInstance(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType(typeof(SettingsFormatter)).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As().InstancePerDependency(); - - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new MessageChannelSelectorStub(_channel)).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - builder.RegisterInstance(new Work>(resolve => _container.Resolve>())).AsSelf(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - builder.RegisterType().As(); - builder.RegisterInstance(ShellSettingsUtility.CreateEncryptionEnabled()); - - _authorizer = new Mock(); - builder.RegisterInstance(_authorizer.Object); - - _authorizer.Setup(x => x.Authorize(It.IsAny(), It.IsAny())).Returns(true); - - _workContext = new Mock(); - _workContext.Setup(w => w.GetState(It.Is(s => s == "CurrentSite"))).Returns(() => { return _container.Resolve().GetSiteSettings(); }); - - var _workContextAccessor = new Mock(); - _workContextAccessor.Setup(w => w.GetContext()).Returns(_workContext.Object); - builder.RegisterInstance(_workContextAccessor.Object).As(); - - } - - protected override IEnumerable DatabaseTypes { - get { - return new[] { typeof(UserPartRecord), - typeof(ContentTypeRecord), - typeof(ContentItemRecord), - typeof(ContentItemVersionRecord), - }; - } - } - - public override void Init() { - base.Init(); - - var manager = _container.Resolve(); - - var superUser = manager.New("User"); - superUser.Record = new UserPartRecord { UserName = "admin", NormalizedUserName = "admin", Email = "admin@orcharproject.com" }; - manager.Create(superUser.ContentItem); - - _controller = _container.Resolve(); - - var mockHttpContext = new Mock(); - mockHttpContext.SetupGet(x => x.Request.Url).Returns(new Uri("http://www.orchardproject.net")); - mockHttpContext.SetupGet(x => x.Request).Returns(new HttpRequestStub()); - - _controller.ControllerContext = new ControllerContext( - mockHttpContext.Object, - new RouteData( - new Route("foo", new MvcRouteHandler()), - new MvcRouteHandler()), - _controller); - } - - [Test] - public void UsersShouldNotBeAbleToRegisterIfNotAllowed() { - - // enable user registration - _container.Resolve().GetContext().CurrentSite.As().UsersCanRegister = false; - _session.Flush(); - - var result = _controller.Register(); - Assert.That(result, Is.TypeOf()); - - result = _controller.Register("bar", "bar@baz.com", "66554321", "66554321"); - Assert.That(result, Is.TypeOf()); - } - - [Test] - public void UsersShouldBeAbleToRegisterIfAllowed() { - - // disable user registration - _container.Resolve().GetContext().CurrentSite.As().UsersCanRegister = true; - _session.Flush(); - - var result = _controller.Register(); - Assert.That(result, Is.TypeOf()); - } - - [Test] - - public void UsersShouldNotBeAbleToRegisterIfInvalidEmail( - [Values( - @"NotAnEmail", - @"@NotAnEmail", - @"""test\blah""@example.com", - "\"test\rblah\"@example.com", - @"""test""blah""@example.com", - @".wooly@example.com", - @"wo..oly@example.com", - @"pootietang.@example.com", - @".@example.com", - @"@example.com", - @"Ima Fool@example.com")] - string email) { - - var registrationSettings = _container.Resolve().GetContext().CurrentSite.As(); - registrationSettings.UsersCanRegister = true; - registrationSettings.UsersAreModerated = false; - registrationSettings.UsersMustValidateEmail = false; - - _session.Flush(); - - _controller.ModelState.Clear(); - var result = _controller.Register("bar", email, "66554321", "66554321"); - - Assert.That(((ViewResult)result).ViewData.ModelState.Count == 1,"Invalid email address."); - } - - [Test] - public void UsersShouldBeAbleToRegisterIfValidEmail( - [Values( - @"""test\\blah""@example.com", - "\"test\\\rblah\"@example.com", - @"""test\""blah""@example.com", - @"customer/department@example.com", - @"$A12345@example.com", - @"!def!xyz%abc@example.com", - @"_Yosemite.Sam@example.com", - @"~@example.com", - @"""Austin@Powers""@example.com", - @"Ima.Fool@example.com", - @"""Ima.Fool""@example.com", - @"""Ima Fool""@example.com", - "2xxx1414@i.ua" - )] - string email) - { - - var registrationSettings = _container.Resolve().GetContext().CurrentSite.As(); - registrationSettings.UsersCanRegister = true; - registrationSettings.UsersAreModerated = false; - registrationSettings.UsersMustValidateEmail = false; - - _session.Flush(); - - _controller.ModelState.Clear(); - var result = _controller.Register("bar", email, "password", "password"); - - Assert.That(result, Is.TypeOf()); - Assert.That(((RedirectResult)result).Url, Is.EqualTo("~/")); - } - - [Test] - public void RegisteredUserShouldBeRedirectedToHomePage() { - - var registrationSettings = _container.Resolve().GetContext().CurrentSite.As(); - registrationSettings.UsersCanRegister = true; - registrationSettings.UsersAreModerated = false; - registrationSettings.UsersMustValidateEmail = false; - - _session.Flush(); - - var result = _controller.Register("bar", "bar@baz.com", "66554321", "66554321"); - - Assert.That(result, Is.TypeOf()); - Assert.That(((RedirectResult)result).Url, Is.EqualTo("~/")); - } - - - [Test] - public void RegisteredUserShouldBeModerated() { - - var registrationSettings = _container.Resolve().GetContext().CurrentSite.As(); - registrationSettings.UsersCanRegister = true; - registrationSettings.UsersAreModerated = true; - - _session.Flush(); - - var result = _controller.Register("bar", "bar@baz.com", "66554321", "66554321"); - - Assert.That(result, Is.TypeOf()); - Assert.That(((RedirectToRouteResult)result).RouteValues["action"], Is.EqualTo("RegistrationPending")); - Assert.That(_channel.Messages.Count, Is.EqualTo(0)); - } - - [Test] - public void SuperAdminShouldReceiveAMessageOnUserRegistration() { - - var registrationSettings = _container.Resolve().GetContext().CurrentSite.As(); - registrationSettings.UsersCanRegister = true; - registrationSettings.UsersAreModerated = true; - registrationSettings.NotifyModeration = true; - registrationSettings.NotificationsRecipients = "admin"; - - _container.Resolve().GetContext().CurrentSite.As().SuperUser = "admin"; - _session.Flush(); - - var result = _controller.Register("bar", "bar@baz.com", "66554321", "66554321"); - _session.Flush(); - - var user = _container.Resolve().GetUser("bar"); - - Assert.That(result, Is.TypeOf()); - Assert.That(((RedirectToRouteResult)result).RouteValues["action"], Is.EqualTo("RegistrationPending")); - Assert.That(_channel.Messages.Count, Is.EqualTo(1)); - Assert.That(user, Is.Not.Null); - Assert.That(user.UserName, Is.EqualTo("bar")); - Assert.That(user.As(), Is.Not.Null); - Assert.That(user.As().EmailStatus, Is.EqualTo(UserStatus.Approved)); - Assert.That(user.As().RegistrationStatus, Is.EqualTo(UserStatus.Pending)); - } - - [Test] - public void InvalidLostPasswordRequestShouldNotResultInAnError() { - var registrationSettings = _container.Resolve().GetContext().CurrentSite.As(); - registrationSettings.UsersCanRegister = true; - _session.Flush(); - - _controller.Register("bar", "bar@baz.com", "66554321", "66554321"); - - _controller.Url = new UrlHelper(new RequestContext(new HttpContextStub(), new RouteData())); - - var result = _controller.LostPassword("foo"); - - Assert.That(result, Is.TypeOf()); - Assert.That(((RedirectToRouteResult)result).RouteValues["action"], Is.EqualTo("LogOn")); - Assert.That(_channel.Messages.Count, Is.EqualTo(0)); - } - - [Test] - [Ignore("To be implemented")] - public void ResetPasswordLinkShouldBeSent() { - var registrationSettings = _container.Resolve().GetContext().CurrentSite.As(); - registrationSettings.UsersCanRegister = true; - registrationSettings.EnableLostPassword = true; - _session.Flush(); - - _controller.Register("bar", "bar@baz.com", "66554321", "66554321"); - _session.Flush(); - - _controller.Url = new UrlHelper(new RequestContext(new HttpContextStub(), new RouteData())); - var result = _controller.RequestLostPassword("bar"); - Assert.That(result, Is.TypeOf()); - - Assert.That(((RedirectToRouteResult)result).RouteValues["action"], Is.EqualTo("LogOn")); - Assert.That(_channel.Messages.Count, Is.EqualTo(1)); - } - - [Test] - [Ignore("To be implemented")] - public void ChallengeEmailShouldUnlockAccount() { - } - - [Test] - [Ignore("To be implemented")] - public void LostPasswordEmailShouldAuthenticateUser() { - } - - class HttpContextStub : HttpContextBase { - public override HttpRequestBase Request { - get { return new HttpRequestStub(); } - } - - public override IHttpHandler Handler { get; set; } - } - - class HttpRequestStub : HttpRequestBase { - public override bool IsAuthenticated { - get { return false; } - } - - public override NameValueCollection Form { - get { - return new NameValueCollection(); - } - } - - public override Uri Url { - get { - return new Uri("http://orchardproject.net"); - } - } - - public override NameValueCollection Headers { - get { - var nv = new NameValueCollection(); - nv["Host"] = "orchardproject.net"; - return nv; - } - } - - public override string ApplicationPath { - get { - return "/"; - } - } - } - } -} +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.Mvc; +using System.Web.Routing; +using Autofac; +using Moq; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Services; +using Orchard.Core.Settings.Metadata; +using Orchard.Data; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.DisplayManagement.Implementation; +using Orchard.Environment; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Handlers; +using Orchard.ContentManagement.Records; +using Orchard.Environment.Extensions; +using Orchard.Localization; +using Orchard.Messaging.Events; +using Orchard.Messaging.Services; +using Orchard.Security; +using Orchard.Security.Permissions; +using Orchard.Security.Providers; +using Orchard.Tests.ContentManagement; +using Orchard.Tests.Stubs; +using Orchard.UI.Notify; +using Orchard.Users.Controllers; +using Orchard.Users.Events; +using Orchard.Users.Handlers; +using Orchard.Users.Models; +using Orchard.Users.Services; +using Orchard.Settings; +using Orchard.Core.Settings.Services; +using Orchard.Tests.Messaging; +using Orchard.Core.Settings.Models; +using Orchard.Core.Settings.Handlers; +using System.Collections.Specialized; +using Orchard.Mvc; +using Orchard.Tests.Modules.Stubs; +using Orchard.Environment.Configuration; + +namespace Orchard.Tests.Modules.Users.Controllers { + [TestFixture] + public class AccountControllerTests : DatabaseEnabledTestsBase { + private AccountController _controller; + private Mock _authorizer; + private Mock _workContext; + private MessagingChannelStub _channel; + + public override void Register(ContainerBuilder builder) { + _channel = new MessagingChannelStub(); + + builder.RegisterType().SingleInstance(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType(typeof(SettingsFormatter)).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As().InstancePerDependency(); + + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new MessageChannelSelectorStub(_channel)).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + builder.RegisterInstance(new Work>(resolve => _container.Resolve>())).AsSelf(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + builder.RegisterType().As(); + builder.RegisterInstance(ShellSettingsUtility.CreateEncryptionEnabled()); + + _authorizer = new Mock(); + builder.RegisterInstance(_authorizer.Object); + + _authorizer.Setup(x => x.Authorize(It.IsAny(), It.IsAny())).Returns(true); + + _workContext = new Mock(); + _workContext.Setup(w => w.GetState(It.Is(s => s == "CurrentSite"))).Returns(() => { return _container.Resolve().GetSiteSettings(); }); + + var _workContextAccessor = new Mock(); + _workContextAccessor.Setup(w => w.GetContext()).Returns(_workContext.Object); + builder.RegisterInstance(_workContextAccessor.Object).As(); + + } + + protected override IEnumerable DatabaseTypes { + get { + return new[] { typeof(UserPartRecord), + typeof(ContentTypeRecord), + typeof(ContentItemRecord), + typeof(ContentItemVersionRecord), + }; + } + } + + public override void Init() { + base.Init(); + + var manager = _container.Resolve(); + + var superUser = manager.New("User"); + superUser.Record = new UserPartRecord { UserName = "admin", NormalizedUserName = "admin", Email = "admin@orcharproject.com" }; + manager.Create(superUser.ContentItem); + + _controller = _container.Resolve(); + + var mockHttpContext = new Mock(); + mockHttpContext.SetupGet(x => x.Request.Url).Returns(new Uri("http://www.orchardproject.net")); + mockHttpContext.SetupGet(x => x.Request).Returns(new HttpRequestStub()); + + _controller.ControllerContext = new ControllerContext( + mockHttpContext.Object, + new RouteData( + new Route("foo", new MvcRouteHandler()), + new MvcRouteHandler()), + _controller); + } + + [Test] + public void UsersShouldNotBeAbleToRegisterIfNotAllowed() { + + // enable user registration + _container.Resolve().GetContext().CurrentSite.As().UsersCanRegister = false; + _session.Flush(); + + var result = _controller.Register(); + Assert.That(result, Is.TypeOf()); + + result = _controller.Register("bar", "bar@baz.com", "66554321", "66554321"); + Assert.That(result, Is.TypeOf()); + } + + [Test] + public void UsersShouldBeAbleToRegisterIfAllowed() { + + // disable user registration + _container.Resolve().GetContext().CurrentSite.As().UsersCanRegister = true; + _session.Flush(); + + var result = _controller.Register(); + Assert.That(result, Is.TypeOf()); + } + + [Test] + + public void UsersShouldNotBeAbleToRegisterIfInvalidEmail( + [Values( + @"NotAnEmail", + @"@NotAnEmail", + @"""test\blah""@example.com", + "\"test\rblah\"@example.com", + @"""test""blah""@example.com", + @".wooly@example.com", + @"wo..oly@example.com", + @"pootietang.@example.com", + @".@example.com", + @"@example.com", + @"Ima Fool@example.com")] + string email) { + + var registrationSettings = _container.Resolve().GetContext().CurrentSite.As(); + registrationSettings.UsersCanRegister = true; + registrationSettings.UsersAreModerated = false; + registrationSettings.UsersMustValidateEmail = false; + + _session.Flush(); + + _controller.ModelState.Clear(); + var result = _controller.Register("bar", email, "66554321", "66554321"); + + Assert.That(((ViewResult)result).ViewData.ModelState.Count == 1,"Invalid email address."); + } + + [Test] + public void UsersShouldBeAbleToRegisterIfValidEmail( + [Values( + @"""test\\blah""@example.com", + "\"test\\\rblah\"@example.com", + @"""test\""blah""@example.com", + @"customer/department@example.com", + @"$A12345@example.com", + @"!def!xyz%abc@example.com", + @"_Yosemite.Sam@example.com", + @"~@example.com", + @"""Austin@Powers""@example.com", + @"Ima.Fool@example.com", + @"""Ima.Fool""@example.com", + @"""Ima Fool""@example.com", + "2xxx1414@i.ua" + )] + string email) + { + + var registrationSettings = _container.Resolve().GetContext().CurrentSite.As(); + registrationSettings.UsersCanRegister = true; + registrationSettings.UsersAreModerated = false; + registrationSettings.UsersMustValidateEmail = false; + + _session.Flush(); + + _controller.ModelState.Clear(); + var result = _controller.Register("bar", email, "password", "password"); + + Assert.That(result, Is.TypeOf()); + Assert.That(((RedirectResult)result).Url, Is.EqualTo("~/")); + } + + [Test] + public void RegisteredUserShouldBeRedirectedToHomePage() { + + var registrationSettings = _container.Resolve().GetContext().CurrentSite.As(); + registrationSettings.UsersCanRegister = true; + registrationSettings.UsersAreModerated = false; + registrationSettings.UsersMustValidateEmail = false; + + _session.Flush(); + + var result = _controller.Register("bar", "bar@baz.com", "66554321", "66554321"); + + Assert.That(result, Is.TypeOf()); + Assert.That(((RedirectResult)result).Url, Is.EqualTo("~/")); + } + + + [Test] + public void RegisteredUserShouldBeModerated() { + + var registrationSettings = _container.Resolve().GetContext().CurrentSite.As(); + registrationSettings.UsersCanRegister = true; + registrationSettings.UsersAreModerated = true; + + _session.Flush(); + + var result = _controller.Register("bar", "bar@baz.com", "66554321", "66554321"); + + Assert.That(result, Is.TypeOf()); + Assert.That(((RedirectToRouteResult)result).RouteValues["action"], Is.EqualTo("RegistrationPending")); + Assert.That(_channel.Messages.Count, Is.EqualTo(0)); + } + + [Test] + public void SuperAdminShouldReceiveAMessageOnUserRegistration() { + + var registrationSettings = _container.Resolve().GetContext().CurrentSite.As(); + registrationSettings.UsersCanRegister = true; + registrationSettings.UsersAreModerated = true; + registrationSettings.NotifyModeration = true; + registrationSettings.NotificationsRecipients = "admin"; + + _container.Resolve().GetContext().CurrentSite.As().SuperUser = "admin"; + _session.Flush(); + + var result = _controller.Register("bar", "bar@baz.com", "66554321", "66554321"); + _session.Flush(); + + var user = _container.Resolve().GetUser("bar"); + + Assert.That(result, Is.TypeOf()); + Assert.That(((RedirectToRouteResult)result).RouteValues["action"], Is.EqualTo("RegistrationPending")); + Assert.That(_channel.Messages.Count, Is.EqualTo(1)); + Assert.That(user, Is.Not.Null); + Assert.That(user.UserName, Is.EqualTo("bar")); + Assert.That(user.As(), Is.Not.Null); + Assert.That(user.As().EmailStatus, Is.EqualTo(UserStatus.Approved)); + Assert.That(user.As().RegistrationStatus, Is.EqualTo(UserStatus.Pending)); + } + + [Test] + public void InvalidLostPasswordRequestShouldNotResultInAnError() { + var registrationSettings = _container.Resolve().GetContext().CurrentSite.As(); + registrationSettings.UsersCanRegister = true; + _session.Flush(); + + _controller.Register("bar", "bar@baz.com", "66554321", "66554321"); + + _controller.Url = new UrlHelper(new RequestContext(new HttpContextStub(), new RouteData())); + + var result = _controller.LostPassword("foo"); + + Assert.That(result, Is.TypeOf()); + Assert.That(((RedirectToRouteResult)result).RouteValues["action"], Is.EqualTo("LogOn")); + Assert.That(_channel.Messages.Count, Is.EqualTo(0)); + } + + [Test] + [Ignore("To be implemented")] + public void ResetPasswordLinkShouldBeSent() { + var registrationSettings = _container.Resolve().GetContext().CurrentSite.As(); + registrationSettings.UsersCanRegister = true; + registrationSettings.EnableLostPassword = true; + _session.Flush(); + + _controller.Register("bar", "bar@baz.com", "66554321", "66554321"); + _session.Flush(); + + _controller.Url = new UrlHelper(new RequestContext(new HttpContextStub(), new RouteData())); + var result = _controller.RequestLostPassword("bar"); + Assert.That(result, Is.TypeOf()); + + Assert.That(((RedirectToRouteResult)result).RouteValues["action"], Is.EqualTo("LogOn")); + Assert.That(_channel.Messages.Count, Is.EqualTo(1)); + } + + [Test] + [Ignore("To be implemented")] + public void ChallengeEmailShouldUnlockAccount() { + } + + [Test] + [Ignore("To be implemented")] + public void LostPasswordEmailShouldAuthenticateUser() { + } + + class HttpContextStub : HttpContextBase { + public override HttpRequestBase Request { + get { return new HttpRequestStub(); } + } + + public override IHttpHandler Handler { get; set; } + } + + class HttpRequestStub : HttpRequestBase { + public override bool IsAuthenticated { + get { return false; } + } + + public override NameValueCollection Form { + get { + return new NameValueCollection(); + } + } + + public override Uri Url { + get { + return new Uri("http://orchardproject.net"); + } + } + + public override NameValueCollection Headers { + get { + var nv = new NameValueCollection(); + nv["Host"] = "orchardproject.net"; + return nv; + } + } + + public override string ApplicationPath { + get { + return "/"; + } + } + } + } +} diff --git a/src/Orchard.Tests.Modules/Users/Services/MembershipServiceTests.cs b/src/Orchard.Tests.Modules/Users/Services/MembershipServiceTests.cs index cf868475f7d..2c0edde1e8e 100644 --- a/src/Orchard.Tests.Modules/Users/Services/MembershipServiceTests.cs +++ b/src/Orchard.Tests.Modules/Users/Services/MembershipServiceTests.cs @@ -1,151 +1,151 @@ -using System; -using System.Web.Security; -using System.Xml.Linq; -using Autofac; -using Moq; -using NHibernate; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.ContentManagement.FieldStorage.InfosetStorage; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.MetaData.Models; -using Orchard.ContentManagement.MetaData.Services; -using Orchard.Core.Settings.Metadata; -using Orchard.Data; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Handlers; -using Orchard.ContentManagement.Records; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.DisplayManagement.Implementation; -using Orchard.Environment; -using Orchard.Environment.Configuration; -using Orchard.Environment.Extensions; -using Orchard.Messaging.Events; -using Orchard.Messaging.Services; -using Orchard.Security; -using Orchard.Tests.Stubs; -using Orchard.Tests.Utility; -using Orchard.UI.PageClass; -using Orchard.Users.Handlers; -using Orchard.Users.Models; -using Orchard.Users.Services; -using Orchard.Tests.ContentManagement; - -namespace Orchard.Tests.Modules.Users.Services { - [TestFixture] - public class MembershipServiceTests { - private IMembershipService _membershipService; - private ISessionFactory _sessionFactory; - private ISession _session; - private IContainer _container; - - [TestFixtureSetUp] - public void InitFixture() { - var databaseFileName = System.IO.Path.GetTempFileName(); - _sessionFactory = DataUtility.CreateSessionFactory( - databaseFileName, - typeof(UserPartRecord), - typeof(ContentItemVersionRecord), - typeof(ContentItemRecord), - typeof(ContentTypeRecord)); - } - - [TestFixtureTearDown] - public void TermFixture() { - - } - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - //builder.RegisterModule(new ImplicitCollectionSupportModule()); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType(typeof(SettingsFormatter)).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataProvider = "SqlCe" }); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterAutoMocking(MockBehavior.Loose); - builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - builder.RegisterType().As(); - - _session = _sessionFactory.OpenSession(); - builder.RegisterInstance(new TestTransactionManager(_session)).As(); - - _container = builder.Build(); - _membershipService = _container.Resolve(); - } - - [TearDown] - public void Cleanup() { - if (_container != null) - _container.Dispose(); - } - - [Test] - public void CreateUserShouldAllocateModelAndCreateRecords() { - var user = _membershipService.CreateUser(new CreateUserParams("a", "b", "c", null, null, true)); - Assert.That(user.UserName, Is.EqualTo("a")); - Assert.That(user.Email, Is.EqualTo("c")); - } - - [Test] - public void DefaultPasswordFormatShouldBeHashedAndHaveSalt() { - var user = _membershipService.CreateUser(new CreateUserParams("a", "b", "c", null, null, true)); - - var userRepository = _container.Resolve>(); - var userRecord = userRepository.Get(user.Id); - Assert.That(userRecord.PasswordFormat, Is.EqualTo(MembershipPasswordFormat.Hashed)); - Assert.That(userRecord.Password, Is.Not.EqualTo("b")); - Assert.That(userRecord.PasswordSalt, Is.Not.Null); - Assert.That(userRecord.PasswordSalt, Is.Not.Empty); - } - - [Test] - public void SaltAndPasswordShouldBeDifferentEvenWithSameSourcePassword() { - var user1 = _membershipService.CreateUser(new CreateUserParams("a", "b", "c", null, null, true)); - _session.Flush(); - _session.Clear(); - - var user2 = _membershipService.CreateUser(new CreateUserParams("d", "b", "e", null, null, true)); - _session.Flush(); - _session.Clear(); - - var userRepository = _container.Resolve>(); - var user1Record = userRepository.Get(user1.Id); - var user2Record = userRepository.Get(user2.Id); - Assert.That(user1Record.PasswordSalt, Is.Not.EqualTo(user2Record.PasswordSalt)); - Assert.That(user1Record.Password, Is.Not.EqualTo(user2Record.Password)); - - Assert.That(_membershipService.ValidateUser("a", "b"), Is.Not.Null); - Assert.That(_membershipService.ValidateUser("d", "b"), Is.Not.Null); - } - - [Test] - public void ValidateUserShouldReturnNullIfUserOrPasswordIsIncorrect() { - _membershipService.CreateUser(new CreateUserParams("test-user", "test-password", "c", null, null, true)); - _session.Flush(); - _session.Clear(); - - var validate1 = _membershipService.ValidateUser("test-user", "bad-password"); - var validate2 = _membershipService.ValidateUser("bad-user", "test-password"); - var validate3 = _membershipService.ValidateUser("test-user", "test-password"); - - Assert.That(validate1, Is.Null); - Assert.That(validate2, Is.Null); - Assert.That(validate3, Is.Not.Null); - } - } -} +using System; +using System.Web.Security; +using System.Xml.Linq; +using Autofac; +using Moq; +using NHibernate; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.ContentManagement.FieldStorage.InfosetStorage; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.ContentManagement.MetaData.Services; +using Orchard.Core.Settings.Metadata; +using Orchard.Data; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Handlers; +using Orchard.ContentManagement.Records; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.DisplayManagement.Implementation; +using Orchard.Environment; +using Orchard.Environment.Configuration; +using Orchard.Environment.Extensions; +using Orchard.Messaging.Events; +using Orchard.Messaging.Services; +using Orchard.Security; +using Orchard.Tests.Stubs; +using Orchard.Tests.Utility; +using Orchard.UI.PageClass; +using Orchard.Users.Handlers; +using Orchard.Users.Models; +using Orchard.Users.Services; +using Orchard.Tests.ContentManagement; + +namespace Orchard.Tests.Modules.Users.Services { + [TestFixture] + public class MembershipServiceTests { + private IMembershipService _membershipService; + private ISessionFactory _sessionFactory; + private ISession _session; + private IContainer _container; + + [TestFixtureSetUp] + public void InitFixture() { + var databaseFileName = System.IO.Path.GetTempFileName(); + _sessionFactory = DataUtility.CreateSessionFactory( + databaseFileName, + typeof(UserPartRecord), + typeof(ContentItemVersionRecord), + typeof(ContentItemRecord), + typeof(ContentTypeRecord)); + } + + [TestFixtureTearDown] + public void TermFixture() { + + } + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + //builder.RegisterModule(new ImplicitCollectionSupportModule()); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType(typeof(SettingsFormatter)).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataProvider = "SqlCe" }); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterAutoMocking(MockBehavior.Loose); + builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + builder.RegisterType().As(); + + _session = _sessionFactory.OpenSession(); + builder.RegisterInstance(new TestTransactionManager(_session)).As(); + + _container = builder.Build(); + _membershipService = _container.Resolve(); + } + + [TearDown] + public void Cleanup() { + if (_container != null) + _container.Dispose(); + } + + [Test] + public void CreateUserShouldAllocateModelAndCreateRecords() { + var user = _membershipService.CreateUser(new CreateUserParams("a", "b", "c", null, null, true)); + Assert.That(user.UserName, Is.EqualTo("a")); + Assert.That(user.Email, Is.EqualTo("c")); + } + + [Test] + public void DefaultPasswordFormatShouldBeHashedAndHaveSalt() { + var user = _membershipService.CreateUser(new CreateUserParams("a", "b", "c", null, null, true)); + + var userRepository = _container.Resolve>(); + var userRecord = userRepository.Get(user.Id); + Assert.That(userRecord.PasswordFormat, Is.EqualTo(MembershipPasswordFormat.Hashed)); + Assert.That(userRecord.Password, Is.Not.EqualTo("b")); + Assert.That(userRecord.PasswordSalt, Is.Not.Null); + Assert.That(userRecord.PasswordSalt, Is.Not.Empty); + } + + [Test] + public void SaltAndPasswordShouldBeDifferentEvenWithSameSourcePassword() { + var user1 = _membershipService.CreateUser(new CreateUserParams("a", "b", "c", null, null, true)); + _session.Flush(); + _session.Clear(); + + var user2 = _membershipService.CreateUser(new CreateUserParams("d", "b", "e", null, null, true)); + _session.Flush(); + _session.Clear(); + + var userRepository = _container.Resolve>(); + var user1Record = userRepository.Get(user1.Id); + var user2Record = userRepository.Get(user2.Id); + Assert.That(user1Record.PasswordSalt, Is.Not.EqualTo(user2Record.PasswordSalt)); + Assert.That(user1Record.Password, Is.Not.EqualTo(user2Record.Password)); + + Assert.That(_membershipService.ValidateUser("a", "b"), Is.Not.Null); + Assert.That(_membershipService.ValidateUser("d", "b"), Is.Not.Null); + } + + [Test] + public void ValidateUserShouldReturnNullIfUserOrPasswordIsIncorrect() { + _membershipService.CreateUser(new CreateUserParams("test-user", "test-password", "c", null, null, true)); + _session.Flush(); + _session.Clear(); + + var validate1 = _membershipService.ValidateUser("test-user", "bad-password"); + var validate2 = _membershipService.ValidateUser("bad-user", "test-password"); + var validate3 = _membershipService.ValidateUser("test-user", "test-password"); + + Assert.That(validate1, Is.Null); + Assert.That(validate2, Is.Null); + Assert.That(validate3, Is.Not.Null); + } + } +} diff --git a/src/Orchard.Tests.Modules/Users/Services/UserServiceTests.cs b/src/Orchard.Tests.Modules/Users/Services/UserServiceTests.cs index 2488d921df9..40ef79efd1c 100644 --- a/src/Orchard.Tests.Modules/Users/Services/UserServiceTests.cs +++ b/src/Orchard.Tests.Modules/Users/Services/UserServiceTests.cs @@ -1,142 +1,142 @@ -using System; -using System.Globalization; -using System.Threading; -using System.Xml.Linq; -using Autofac; -using Moq; -using NHibernate; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.ContentManagement.FieldStorage.InfosetStorage; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.MetaData.Models; -using Orchard.ContentManagement.MetaData.Services; -using Orchard.Core.Settings.Metadata; -using Orchard.Data; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Handlers; -using Orchard.ContentManagement.Records; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.DisplayManagement.Implementation; -using Orchard.Environment; -using Orchard.Environment.Extensions; -using Orchard.Messaging.Events; -using Orchard.Messaging.Services; -using Orchard.Security; -using Orchard.Security.Providers; -using Orchard.Tests.Stubs; -using Orchard.Tests.Utility; -using Orchard.UI.PageClass; -using Orchard.Users.Handlers; -using Orchard.Users.Models; -using Orchard.Users.Services; -using Orchard.Services; -using Orchard.Tests.Messaging; -using Orchard.Tests.Modules.Stubs; -using Orchard.Tests.ContentManagement; - -namespace Orchard.Tests.Modules.Users.Services { - [TestFixture] - public class UserServiceTests { - private IMembershipService _membershipService; - private IUserService _userService; - private IClock _clock; - private MessagingChannelStub _channel; - private ISessionFactory _sessionFactory; - private ISession _session; - private IContainer _container; - private CultureInfo _currentCulture; - - [TestFixtureSetUp] - public void InitFixture() { - _currentCulture = Thread.CurrentThread.CurrentCulture; - var databaseFileName = System.IO.Path.GetTempFileName(); - _sessionFactory = DataUtility.CreateSessionFactory( - databaseFileName, - typeof(UserPartRecord), - typeof(ContentItemVersionRecord), - typeof(ContentItemRecord), - typeof(ContentTypeRecord)); - } - - [TestFixtureTearDown] - public void TermFixture() { - Thread.CurrentThread.CurrentCulture = _currentCulture; - } - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - _channel = new MessagingChannelStub(); - - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(_clock = new StubClock()).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType(typeof(SettingsFormatter)).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterAutoMocking(MockBehavior.Loose); - builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); - builder.RegisterInstance(new MessageChannelSelectorStub(_channel)).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - builder.RegisterType().As(); - - builder.RegisterType().As(); - builder.RegisterInstance(ShellSettingsUtility.CreateEncryptionEnabled()); - - _session = _sessionFactory.OpenSession(); - builder.RegisterInstance(new TestTransactionManager(_session)).As(); - - _container = builder.Build(); - _membershipService = _container.Resolve(); - _userService = _container.Resolve(); - } - - [TearDown] - public void TearDown() { - if (_container != null) - _container.Dispose(); - } - - [Test] - public void NonceShouldBeDecryptable() { - var user = _membershipService.CreateUser(new CreateUserParams("foo", "66554321", "foo@bar.com", "", "", true)); - var nonce = _userService.CreateNonce(user, new TimeSpan(1, 0, 0)); - - Assert.That(nonce, Is.Not.Empty); - - string username; - DateTime validateByUtc; - - var result = _userService.DecryptNonce(nonce, out username, out validateByUtc); - - Assert.That(result, Is.True); - Assert.That(username, Is.EqualTo("foo")); - Assert.That(validateByUtc, Is.GreaterThan(_clock.UtcNow)); - } - - [Test] - public void VerifyUserUnicityTurkishTest() { - CultureInfo turkishCulture = new CultureInfo("tr-TR"); - Thread.CurrentThread.CurrentCulture = turkishCulture; - - // Create user lower case - _membershipService.CreateUser(new CreateUserParams("admin", "66554321", "foo@bar.com", "", "", true)); - - // Verify unicity with upper case which with turkish coallition would yeld admin with an i without the dot and therefore generate a different user name - Assert.That(_userService.VerifyUserUnicity("ADMIN", "differentfoo@bar.com"), Is.False); - } - } -} +using System; +using System.Globalization; +using System.Threading; +using System.Xml.Linq; +using Autofac; +using Moq; +using NHibernate; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.ContentManagement.FieldStorage.InfosetStorage; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.ContentManagement.MetaData.Services; +using Orchard.Core.Settings.Metadata; +using Orchard.Data; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Handlers; +using Orchard.ContentManagement.Records; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.DisplayManagement.Implementation; +using Orchard.Environment; +using Orchard.Environment.Extensions; +using Orchard.Messaging.Events; +using Orchard.Messaging.Services; +using Orchard.Security; +using Orchard.Security.Providers; +using Orchard.Tests.Stubs; +using Orchard.Tests.Utility; +using Orchard.UI.PageClass; +using Orchard.Users.Handlers; +using Orchard.Users.Models; +using Orchard.Users.Services; +using Orchard.Services; +using Orchard.Tests.Messaging; +using Orchard.Tests.Modules.Stubs; +using Orchard.Tests.ContentManagement; + +namespace Orchard.Tests.Modules.Users.Services { + [TestFixture] + public class UserServiceTests { + private IMembershipService _membershipService; + private IUserService _userService; + private IClock _clock; + private MessagingChannelStub _channel; + private ISessionFactory _sessionFactory; + private ISession _session; + private IContainer _container; + private CultureInfo _currentCulture; + + [TestFixtureSetUp] + public void InitFixture() { + _currentCulture = Thread.CurrentThread.CurrentCulture; + var databaseFileName = System.IO.Path.GetTempFileName(); + _sessionFactory = DataUtility.CreateSessionFactory( + databaseFileName, + typeof(UserPartRecord), + typeof(ContentItemVersionRecord), + typeof(ContentItemRecord), + typeof(ContentTypeRecord)); + } + + [TestFixtureTearDown] + public void TermFixture() { + Thread.CurrentThread.CurrentCulture = _currentCulture; + } + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + _channel = new MessagingChannelStub(); + + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(_clock = new StubClock()).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType(typeof(SettingsFormatter)).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterAutoMocking(MockBehavior.Loose); + builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); + builder.RegisterInstance(new MessageChannelSelectorStub(_channel)).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + builder.RegisterType().As(); + + builder.RegisterType().As(); + builder.RegisterInstance(ShellSettingsUtility.CreateEncryptionEnabled()); + + _session = _sessionFactory.OpenSession(); + builder.RegisterInstance(new TestTransactionManager(_session)).As(); + + _container = builder.Build(); + _membershipService = _container.Resolve(); + _userService = _container.Resolve(); + } + + [TearDown] + public void TearDown() { + if (_container != null) + _container.Dispose(); + } + + [Test] + public void NonceShouldBeDecryptable() { + var user = _membershipService.CreateUser(new CreateUserParams("foo", "66554321", "foo@bar.com", "", "", true)); + var nonce = _userService.CreateNonce(user, new TimeSpan(1, 0, 0)); + + Assert.That(nonce, Is.Not.Empty); + + string username; + DateTime validateByUtc; + + var result = _userService.DecryptNonce(nonce, out username, out validateByUtc); + + Assert.That(result, Is.True); + Assert.That(username, Is.EqualTo("foo")); + Assert.That(validateByUtc, Is.GreaterThan(_clock.UtcNow)); + } + + [Test] + public void VerifyUserUnicityTurkishTest() { + CultureInfo turkishCulture = new CultureInfo("tr-TR"); + Thread.CurrentThread.CurrentCulture = turkishCulture; + + // Create user lower case + _membershipService.CreateUser(new CreateUserParams("admin", "66554321", "foo@bar.com", "", "", true)); + + // Verify unicity with upper case which with turkish coallition would yeld admin with an i without the dot and therefore generate a different user name + Assert.That(_userService.VerifyUserUnicity("ADMIN", "differentfoo@bar.com"), Is.False); + } + } +} diff --git a/src/Orchard.Tests.Modules/Users/ShellSettingsUtility.cs b/src/Orchard.Tests.Modules/Users/ShellSettingsUtility.cs index 577f2c526b7..c41fa6b3740 100644 --- a/src/Orchard.Tests.Modules/Users/ShellSettingsUtility.cs +++ b/src/Orchard.Tests.Modules/Users/ShellSettingsUtility.cs @@ -1,24 +1,24 @@ -using System.Security.Cryptography; -using Orchard.Environment.Configuration; -using Orchard.Utility.Extensions; - -namespace Orchard.Tests.Modules.Users { - public class ShellSettingsUtility { - public static ShellSettings CreateEncryptionEnabled() { - - const string encryptionAlgorithm = "AES"; - const string hashAlgorithm = "HMACSHA256"; - - return new ShellSettings { - Name = "Alpha", - RequestUrlHost = "wiki.example.com", - RequestUrlPrefix = "~/foo", - EncryptionAlgorithm = encryptionAlgorithm, - EncryptionKey = SymmetricAlgorithm.Create(encryptionAlgorithm).Key.ToHexString(), - HashAlgorithm = hashAlgorithm, - HashKey = HMAC.Create(hashAlgorithm).Key.ToHexString() - }; - - } - } -} +using System.Security.Cryptography; +using Orchard.Environment.Configuration; +using Orchard.Utility.Extensions; + +namespace Orchard.Tests.Modules.Users { + public class ShellSettingsUtility { + public static ShellSettings CreateEncryptionEnabled() { + + const string encryptionAlgorithm = "AES"; + const string hashAlgorithm = "HMACSHA256"; + + return new ShellSettings { + Name = "Alpha", + RequestUrlHost = "wiki.example.com", + RequestUrlPrefix = "~/foo", + EncryptionAlgorithm = encryptionAlgorithm, + EncryptionKey = SymmetricAlgorithm.Create(encryptionAlgorithm).Key.ToHexString(), + HashAlgorithm = hashAlgorithm, + HashKey = HMAC.Create(hashAlgorithm).Key.ToHexString() + }; + + } + } +} diff --git a/src/Orchard.Tests.Modules/Values.cs b/src/Orchard.Tests.Modules/Values.cs index 5bce1f0b85b..b7983a1c7f0 100644 --- a/src/Orchard.Tests.Modules/Values.cs +++ b/src/Orchard.Tests.Modules/Values.cs @@ -1,40 +1,40 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Web.Mvc; - -namespace Orchard.Tests.Modules { - public static class Values { - public static IValueProvider From(T obj) { - if (obj is IDictionary) { - return new DictionaryValueProvider( - (IDictionary)obj, - CultureInfo.InvariantCulture); - } - return new ValueProvider(obj); - } - - class ValueProvider : IValueProvider { - private readonly T _obj; - - public ValueProvider(T obj) { - _obj = obj; - } - - public bool ContainsPrefix(string prefix) { - return typeof(T).GetProperties().Any(x => x.Name.StartsWith(prefix)); - } - - public ValueProviderResult GetValue(string key) { - var property = typeof(T).GetProperty(key); - if (property == null) - return null; - return new ValueProviderResult( - property.GetValue(_obj, null), - Convert.ToString(property.GetValue(_obj, null)), - null); - } - } - } -} +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Web.Mvc; + +namespace Orchard.Tests.Modules { + public static class Values { + public static IValueProvider From(T obj) { + if (obj is IDictionary) { + return new DictionaryValueProvider( + (IDictionary)obj, + CultureInfo.InvariantCulture); + } + return new ValueProvider(obj); + } + + class ValueProvider : IValueProvider { + private readonly T _obj; + + public ValueProvider(T obj) { + _obj = obj; + } + + public bool ContainsPrefix(string prefix) { + return typeof(T).GetProperties().Any(x => x.Name.StartsWith(prefix)); + } + + public ValueProviderResult GetValue(string key) { + var property = typeof(T).GetProperty(key); + if (property == null) + return null; + return new ValueProviderResult( + property.GetValue(_obj, null), + Convert.ToString(property.GetValue(_obj, null)), + null); + } + } + } +} diff --git a/src/Orchard.Tests.Modules/Warmup/WarmupUpdaterTests.cs b/src/Orchard.Tests.Modules/Warmup/WarmupUpdaterTests.cs index c6a9d4ea0a6..c6525a19856 100644 --- a/src/Orchard.Tests.Modules/Warmup/WarmupUpdaterTests.cs +++ b/src/Orchard.Tests.Modules/Warmup/WarmupUpdaterTests.cs @@ -1,377 +1,377 @@ -using System; -using System.IO; -using System.Linq; -using System.Net; -using System.Xml; -using Autofac; -using Moq; -using NUnit.Framework; -using Orchard.ContentManagement.FieldStorage.InfosetStorage; -using Orchard.ContentManagement.Handlers; -using Orchard.Environment.Configuration; -using Orchard.Environment.Warmup; -using Orchard.FileSystems.AppData; -using Orchard.FileSystems.LockFile; -using Orchard.Services; -using Orchard.Tests.FileSystems.AppData; -using Orchard.Tests.Stubs; -using Orchard.Tests.UI.Navigation; -using Orchard.Warmup.Models; -using Orchard.Warmup.Services; - -namespace Orchard.Tests.Modules.Warmup { - public class WarmupUpdaterTests { - protected IContainer _container; - private IWarmupUpdater _warmupUpdater; - private IAppDataFolder _appDataFolder; - private ILockFileManager _lockFileManager; - private StubClock _clock; - private Mock _webDownloader; - private IOrchardServices _orchardServices; - private WarmupSettingsPart _settings; - private IWarmupReportManager _reportManager; - - private readonly string _basePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); - - private string _warmupFilename, _lockFilename; - private const string WarmupFolder = "Warmup"; - private const string TenantFolder = "Sites/Default"; - - [TestFixtureTearDown] - public void Clean() { - if (Directory.Exists(_basePath)) { - Directory.Delete(_basePath, true); - } - } - - [SetUp] - public void Init() { - if (Directory.Exists(_basePath)) { - Directory.Delete(_basePath, true); - } - - Directory.CreateDirectory(_basePath); - _appDataFolder = AppDataFolderTests.CreateAppDataFolder(_basePath); - _webDownloader = new Mock(); - _orchardServices = new StubOrchardServices(); - ((StubWorkContextAccessor.WorkContextImpl.StubSite) _orchardServices.WorkContext.CurrentSite).BaseUrl = "http://orchardproject.net"; - - _settings = new WarmupSettingsPart(); - - _orchardServices.WorkContext.CurrentSite.ContentItem.Weld(_settings); - _orchardServices.WorkContext.CurrentSite.ContentItem.Weld(new InfosetPart()); - - var builder = new ContainerBuilder(); - builder.RegisterInstance(_appDataFolder).As(); - builder.RegisterInstance(_orchardServices).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new ShellSettings { Name = "Default" }).As(); - builder.RegisterInstance(_clock = new StubClock()).As(); - builder.RegisterInstance(_webDownloader.Object).As(); - _container = builder.Build(); - - _lockFileManager = _container.Resolve(); - _warmupUpdater = _container.Resolve(); - _reportManager = _container.Resolve(); - - _warmupFilename = _appDataFolder.Combine(TenantFolder, "warmup.txt"); - _lockFilename = _appDataFolder.Combine(TenantFolder, "warmup.txt.lock"); - } - - [Test] - public void ShouldDoNothingWhenNoUrlsAreSpecified() { - _warmupUpdater.EnsureGenerate(); - Assert.That(_appDataFolder.ListFiles(WarmupFolder).Count(), Is.EqualTo(0)); - } - - [Test] - public void StampFileShouldBeDeletedToForceAnUpdate() { - _appDataFolder.CreateFile(_warmupFilename, ""); - _warmupUpdater.Generate(); - Assert.That(_appDataFolder.ListFiles(WarmupFolder).Count(), Is.EqualTo(0)); - } - - [Test] - public void GenerateShouldNotRunIfLocked() { - _appDataFolder.CreateFile(_warmupFilename, ""); - ILockFile lockFile = null; - _lockFileManager.TryAcquireLock(_lockFilename, ref lockFile); - using(lockFile) { - _warmupUpdater.Generate(); - Assert.That(_appDataFolder.ListFiles(WarmupFolder).Count(), Is.EqualTo(0)); - } - - _warmupUpdater.Generate(); - Assert.That(_appDataFolder.ListFiles(WarmupFolder).Count(), Is.EqualTo(0)); - } - - [Test] - public void ShouldDownloadConfiguredUrls() { - _settings.Urls = @" / - /About"; - _webDownloader - .Setup(w => w.Download("http://orchardproject.net/")) - .Returns(new DownloadResult { Content = "Foo", StatusCode = HttpStatusCode.OK }); - - _webDownloader - .Setup(w => w.Download("http://orchardproject.net/About")) - .Returns(new DownloadResult { Content = "Bar", StatusCode = HttpStatusCode.OK }); - - _warmupUpdater.Generate(); - var files = _appDataFolder.ListFiles(WarmupFolder).ToList(); - - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net")))); - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net/About")))); - - files = _appDataFolder.ListFiles(TenantFolder).ToList(); - - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(TenantFolder, "warmup.txt"))); - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(TenantFolder, "warmup.xml"))); - - var homepageContent = _appDataFolder.ReadFile(_appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net"))); - var aboutcontent = _appDataFolder.ReadFile(_appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net/About"))); - - Assert.That(homepageContent, Is.EqualTo("Foo")); - Assert.That(aboutcontent, Is.EqualTo("Bar")); - } - - [Test] - public void ShouldCreateFilesForOkStatusOnly() { - _settings.Urls = @" / - /About"; - _webDownloader - .Setup(w => w.Download("http://orchardproject.net/")) - .Returns(new DownloadResult { Content = "Foo", StatusCode = HttpStatusCode.OK }); - - _webDownloader - .Setup(w => w.Download("http://orchardproject.net/About")) - .Returns(new DownloadResult { Content = "Bar", StatusCode = HttpStatusCode.NotFound }); - - _warmupUpdater.Generate(); - var files = _appDataFolder.ListFiles(WarmupFolder).ToList(); - - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net")))); - Assert.That(files, Has.None.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net/About")))); - } - - [Test] - public void ShouldProcessValidRequestsOnly() { - _settings.Urls = @" / - <>@\\"; - _webDownloader - .Setup(w => w.Download("http://orchardproject.net/")) - .Returns(new DownloadResult { Content = "Foo", StatusCode = HttpStatusCode.OK }); - - _warmupUpdater.Generate(); - var files = _appDataFolder.ListFiles(WarmupFolder).ToList(); - - Assert.That(files.Count, Is.EqualTo(1)); - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net")))); - } - - [Test] - public void WarmupFileShouldContainUtcNow() { - _settings.Urls = @"/"; - - _webDownloader - .Setup(w => w.Download("http://orchardproject.net/")) - .Returns(new DownloadResult { Content = "Foo", StatusCode = HttpStatusCode.OK }); - - _warmupUpdater.Generate(); - - var warmupContent = _appDataFolder.ReadFile(_warmupFilename); - Assert.That(warmupContent, Is.EqualTo(XmlConvert.ToString(_clock.UtcNow, XmlDateTimeSerializationMode.Utc))); - } - - [Test] - public void ShouldNotProcessIfDelayHasNotExpired() { - _settings.Urls = @"/"; - _settings.Delay = 90; - _settings.Scheduled = true; - - _webDownloader - .Setup(w => w.Download("http://orchardproject.net/")) - .Returns(new DownloadResult { Content = "Foo", StatusCode = HttpStatusCode.OK }); - - _webDownloader - .Setup(w => w.Download("http://orchardproject.net/About")) - .Returns(new DownloadResult { Content = "Bar", StatusCode = HttpStatusCode.OK }); - - _warmupUpdater.Generate(); - - var warmupContent = _appDataFolder.ReadFile(_warmupFilename); - Assert.That(warmupContent, Is.EqualTo(XmlConvert.ToString(_clock.UtcNow, XmlDateTimeSerializationMode.Utc))); - - _settings.Urls = @" / - /About"; - _clock.Advance(TimeSpan.FromMinutes(89)); - _warmupUpdater.EnsureGenerate(); - - var files = _appDataFolder.ListFiles(WarmupFolder).ToList(); - Assert.That(files, Has.None.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net/About")))); - - warmupContent = _appDataFolder.ReadFile(_warmupFilename); - Assert.That(warmupContent, Is.Not.EqualTo(XmlConvert.ToString(_clock.UtcNow, XmlDateTimeSerializationMode.Utc))); - } - - [Test] - public void ShouldProcessIfDelayHasExpired() { - _settings.Urls = @"/"; - _settings.Delay = 90; - _settings.Scheduled = true; - - _webDownloader - .Setup(w => w.Download("http://orchardproject.net/")) - .Returns(new DownloadResult { Content = "Foo", StatusCode = HttpStatusCode.OK }); - - _webDownloader - .Setup(w => w.Download("http://orchardproject.net/About")) - .Returns(new DownloadResult { Content = "Bar", StatusCode = HttpStatusCode.OK }); - - _warmupUpdater.Generate(); - - var warmupContent = _appDataFolder.ReadFile(_warmupFilename); - Assert.That(warmupContent, Is.EqualTo(XmlConvert.ToString(_clock.UtcNow, XmlDateTimeSerializationMode.Utc))); - - _settings.Urls = @" / - /About"; - _clock.Advance(TimeSpan.FromMinutes(91)); - _warmupUpdater.EnsureGenerate(); - - var files = _appDataFolder.ListFiles(WarmupFolder).ToList(); - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net/About")))); - - warmupContent = _appDataFolder.ReadFile(_warmupFilename); - Assert.That(warmupContent, Is.EqualTo(XmlConvert.ToString(_clock.UtcNow, XmlDateTimeSerializationMode.Utc))); - } - - [Test] - public void ShouldGenerateNonWwwVersions() { - _settings.Urls = @" / - /About"; - - ((StubWorkContextAccessor.WorkContextImpl.StubSite)_orchardServices.WorkContext.CurrentSite).BaseUrl = "http://www.orchardproject.net/"; - - _webDownloader - .Setup(w => w.Download("http://www.orchardproject.net/")) - .Returns(new DownloadResult { Content = "Foo", StatusCode = HttpStatusCode.OK }); - - _webDownloader - .Setup(w => w.Download("http://www.orchardproject.net/About")) - .Returns(new DownloadResult { Content = "Bar", StatusCode = HttpStatusCode.OK }); - - _warmupUpdater.Generate(); - var files = _appDataFolder.ListFiles(WarmupFolder).ToList(); - - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://www.orchardproject.net")))); - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://www.orchardproject.net/About")))); - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net")))); - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net/About")))); - - var homepageContent = _appDataFolder.ReadFile(_appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net"))); - var aboutcontent = _appDataFolder.ReadFile(_appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net/About"))); - - var wwwhomepageContent = _appDataFolder.ReadFile(_appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://www.orchardproject.net"))); - var wwwaboutcontent = _appDataFolder.ReadFile(_appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://www.orchardproject.net/About"))); - - Assert.That(homepageContent, Is.EqualTo("Foo")); - Assert.That(wwwhomepageContent, Is.EqualTo("Foo")); - Assert.That(aboutcontent, Is.EqualTo("Bar")); - Assert.That(wwwaboutcontent, Is.EqualTo("Bar")); - } - - [Test] - public void ReportIsCreated() { - _settings.Urls = @" / - /About"; - - ((StubWorkContextAccessor.WorkContextImpl.StubSite)_orchardServices.WorkContext.CurrentSite).BaseUrl = "http://www.orchardproject.net/"; - - _webDownloader - .Setup(w => w.Download("http://www.orchardproject.net/")) - .Returns(new DownloadResult { Content = "Foo", StatusCode = HttpStatusCode.OK }); - - _webDownloader - .Setup(w => w.Download("http://www.orchardproject.net/About")) - .Returns(new DownloadResult { Content = "Bar", StatusCode = HttpStatusCode.OK }); - - _warmupUpdater.Generate(); - var files = _appDataFolder.ListFiles(WarmupFolder).ToList(); - - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://www.orchardproject.net")))); - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://www.orchardproject.net/About")))); - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net")))); - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net/About")))); - - var report = _reportManager.Read().ToList(); - - Assert.That(report.Count(), Is.EqualTo(2)); - Assert.That(report, Has.Some.Matches(x => x.RelativeUrl == "/")); - Assert.That(report, Has.Some.Matches(x => x.RelativeUrl == "/About")); - } - - [Test] - public void ShouldNotDeleteOtherFiles() { - _settings.Urls = @" / - /About"; - - ((StubWorkContextAccessor.WorkContextImpl.StubSite)_orchardServices.WorkContext.CurrentSite).BaseUrl = "http://www.orchardproject.net/"; - - _webDownloader - .Setup(w => w.Download("http://www.orchardproject.net/")) - .Returns(new DownloadResult { Content = "Foo", StatusCode = HttpStatusCode.OK }); - - _webDownloader - .Setup(w => w.Download("http://www.orchardproject.net/About")) - .Returns(new DownloadResult { Content = "Bar", StatusCode = HttpStatusCode.OK }); - - // Create a static file in the warmup folder - _appDataFolder.CreateFile(_appDataFolder.Combine(WarmupFolder, "foo.txt"), "Foo"); - - _warmupUpdater.Generate(); - var files = _appDataFolder.ListFiles(WarmupFolder).ToList(); - - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, "foo.txt"))); - - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://www.orchardproject.net")))); - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://www.orchardproject.net/About")))); - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net")))); - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net/About")))); - } - - - [Test] - public void ClearingUrlsShouldDeleteContent() { - _settings.Urls = @" / - /About"; - - ((StubWorkContextAccessor.WorkContextImpl.StubSite)_orchardServices.WorkContext.CurrentSite).BaseUrl = "http://www.orchardproject.net/"; - - _webDownloader - .Setup(w => w.Download("http://www.orchardproject.net/")) - .Returns(new DownloadResult { Content = "Foo", StatusCode = HttpStatusCode.OK }); - - _webDownloader - .Setup(w => w.Download("http://www.orchardproject.net/About")) - .Returns(new DownloadResult { Content = "Bar", StatusCode = HttpStatusCode.OK }); - - _warmupUpdater.Generate(); - var files = _appDataFolder.ListFiles(WarmupFolder).ToList(); - - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://www.orchardproject.net")))); - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://www.orchardproject.net/About")))); - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net")))); - Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net/About")))); - - _settings.Urls = @""; - - _warmupUpdater.Generate(); - files = _appDataFolder.ListFiles(WarmupFolder).ToList(); - - Assert.That(files.Count, Is.EqualTo(0)); - } - } -} +using System; +using System.IO; +using System.Linq; +using System.Net; +using System.Xml; +using Autofac; +using Moq; +using NUnit.Framework; +using Orchard.ContentManagement.FieldStorage.InfosetStorage; +using Orchard.ContentManagement.Handlers; +using Orchard.Environment.Configuration; +using Orchard.Environment.Warmup; +using Orchard.FileSystems.AppData; +using Orchard.FileSystems.LockFile; +using Orchard.Services; +using Orchard.Tests.FileSystems.AppData; +using Orchard.Tests.Stubs; +using Orchard.Tests.UI.Navigation; +using Orchard.Warmup.Models; +using Orchard.Warmup.Services; + +namespace Orchard.Tests.Modules.Warmup { + public class WarmupUpdaterTests { + protected IContainer _container; + private IWarmupUpdater _warmupUpdater; + private IAppDataFolder _appDataFolder; + private ILockFileManager _lockFileManager; + private StubClock _clock; + private Mock _webDownloader; + private IOrchardServices _orchardServices; + private WarmupSettingsPart _settings; + private IWarmupReportManager _reportManager; + + private readonly string _basePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); + + private string _warmupFilename, _lockFilename; + private const string WarmupFolder = "Warmup"; + private const string TenantFolder = "Sites/Default"; + + [TestFixtureTearDown] + public void Clean() { + if (Directory.Exists(_basePath)) { + Directory.Delete(_basePath, true); + } + } + + [SetUp] + public void Init() { + if (Directory.Exists(_basePath)) { + Directory.Delete(_basePath, true); + } + + Directory.CreateDirectory(_basePath); + _appDataFolder = AppDataFolderTests.CreateAppDataFolder(_basePath); + _webDownloader = new Mock(); + _orchardServices = new StubOrchardServices(); + ((StubWorkContextAccessor.WorkContextImpl.StubSite) _orchardServices.WorkContext.CurrentSite).BaseUrl = "http://orchardproject.net"; + + _settings = new WarmupSettingsPart(); + + _orchardServices.WorkContext.CurrentSite.ContentItem.Weld(_settings); + _orchardServices.WorkContext.CurrentSite.ContentItem.Weld(new InfosetPart()); + + var builder = new ContainerBuilder(); + builder.RegisterInstance(_appDataFolder).As(); + builder.RegisterInstance(_orchardServices).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new ShellSettings { Name = "Default" }).As(); + builder.RegisterInstance(_clock = new StubClock()).As(); + builder.RegisterInstance(_webDownloader.Object).As(); + _container = builder.Build(); + + _lockFileManager = _container.Resolve(); + _warmupUpdater = _container.Resolve(); + _reportManager = _container.Resolve(); + + _warmupFilename = _appDataFolder.Combine(TenantFolder, "warmup.txt"); + _lockFilename = _appDataFolder.Combine(TenantFolder, "warmup.txt.lock"); + } + + [Test] + public void ShouldDoNothingWhenNoUrlsAreSpecified() { + _warmupUpdater.EnsureGenerate(); + Assert.That(_appDataFolder.ListFiles(WarmupFolder).Count(), Is.EqualTo(0)); + } + + [Test] + public void StampFileShouldBeDeletedToForceAnUpdate() { + _appDataFolder.CreateFile(_warmupFilename, ""); + _warmupUpdater.Generate(); + Assert.That(_appDataFolder.ListFiles(WarmupFolder).Count(), Is.EqualTo(0)); + } + + [Test] + public void GenerateShouldNotRunIfLocked() { + _appDataFolder.CreateFile(_warmupFilename, ""); + ILockFile lockFile = null; + _lockFileManager.TryAcquireLock(_lockFilename, ref lockFile); + using(lockFile) { + _warmupUpdater.Generate(); + Assert.That(_appDataFolder.ListFiles(WarmupFolder).Count(), Is.EqualTo(0)); + } + + _warmupUpdater.Generate(); + Assert.That(_appDataFolder.ListFiles(WarmupFolder).Count(), Is.EqualTo(0)); + } + + [Test] + public void ShouldDownloadConfiguredUrls() { + _settings.Urls = @" / + /About"; + _webDownloader + .Setup(w => w.Download("http://orchardproject.net/")) + .Returns(new DownloadResult { Content = "Foo", StatusCode = HttpStatusCode.OK }); + + _webDownloader + .Setup(w => w.Download("http://orchardproject.net/About")) + .Returns(new DownloadResult { Content = "Bar", StatusCode = HttpStatusCode.OK }); + + _warmupUpdater.Generate(); + var files = _appDataFolder.ListFiles(WarmupFolder).ToList(); + + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net")))); + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net/About")))); + + files = _appDataFolder.ListFiles(TenantFolder).ToList(); + + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(TenantFolder, "warmup.txt"))); + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(TenantFolder, "warmup.xml"))); + + var homepageContent = _appDataFolder.ReadFile(_appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net"))); + var aboutcontent = _appDataFolder.ReadFile(_appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net/About"))); + + Assert.That(homepageContent, Is.EqualTo("Foo")); + Assert.That(aboutcontent, Is.EqualTo("Bar")); + } + + [Test] + public void ShouldCreateFilesForOkStatusOnly() { + _settings.Urls = @" / + /About"; + _webDownloader + .Setup(w => w.Download("http://orchardproject.net/")) + .Returns(new DownloadResult { Content = "Foo", StatusCode = HttpStatusCode.OK }); + + _webDownloader + .Setup(w => w.Download("http://orchardproject.net/About")) + .Returns(new DownloadResult { Content = "Bar", StatusCode = HttpStatusCode.NotFound }); + + _warmupUpdater.Generate(); + var files = _appDataFolder.ListFiles(WarmupFolder).ToList(); + + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net")))); + Assert.That(files, Has.None.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net/About")))); + } + + [Test] + public void ShouldProcessValidRequestsOnly() { + _settings.Urls = @" / + <>@\\"; + _webDownloader + .Setup(w => w.Download("http://orchardproject.net/")) + .Returns(new DownloadResult { Content = "Foo", StatusCode = HttpStatusCode.OK }); + + _warmupUpdater.Generate(); + var files = _appDataFolder.ListFiles(WarmupFolder).ToList(); + + Assert.That(files.Count, Is.EqualTo(1)); + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net")))); + } + + [Test] + public void WarmupFileShouldContainUtcNow() { + _settings.Urls = @"/"; + + _webDownloader + .Setup(w => w.Download("http://orchardproject.net/")) + .Returns(new DownloadResult { Content = "Foo", StatusCode = HttpStatusCode.OK }); + + _warmupUpdater.Generate(); + + var warmupContent = _appDataFolder.ReadFile(_warmupFilename); + Assert.That(warmupContent, Is.EqualTo(XmlConvert.ToString(_clock.UtcNow, XmlDateTimeSerializationMode.Utc))); + } + + [Test] + public void ShouldNotProcessIfDelayHasNotExpired() { + _settings.Urls = @"/"; + _settings.Delay = 90; + _settings.Scheduled = true; + + _webDownloader + .Setup(w => w.Download("http://orchardproject.net/")) + .Returns(new DownloadResult { Content = "Foo", StatusCode = HttpStatusCode.OK }); + + _webDownloader + .Setup(w => w.Download("http://orchardproject.net/About")) + .Returns(new DownloadResult { Content = "Bar", StatusCode = HttpStatusCode.OK }); + + _warmupUpdater.Generate(); + + var warmupContent = _appDataFolder.ReadFile(_warmupFilename); + Assert.That(warmupContent, Is.EqualTo(XmlConvert.ToString(_clock.UtcNow, XmlDateTimeSerializationMode.Utc))); + + _settings.Urls = @" / + /About"; + _clock.Advance(TimeSpan.FromMinutes(89)); + _warmupUpdater.EnsureGenerate(); + + var files = _appDataFolder.ListFiles(WarmupFolder).ToList(); + Assert.That(files, Has.None.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net/About")))); + + warmupContent = _appDataFolder.ReadFile(_warmupFilename); + Assert.That(warmupContent, Is.Not.EqualTo(XmlConvert.ToString(_clock.UtcNow, XmlDateTimeSerializationMode.Utc))); + } + + [Test] + public void ShouldProcessIfDelayHasExpired() { + _settings.Urls = @"/"; + _settings.Delay = 90; + _settings.Scheduled = true; + + _webDownloader + .Setup(w => w.Download("http://orchardproject.net/")) + .Returns(new DownloadResult { Content = "Foo", StatusCode = HttpStatusCode.OK }); + + _webDownloader + .Setup(w => w.Download("http://orchardproject.net/About")) + .Returns(new DownloadResult { Content = "Bar", StatusCode = HttpStatusCode.OK }); + + _warmupUpdater.Generate(); + + var warmupContent = _appDataFolder.ReadFile(_warmupFilename); + Assert.That(warmupContent, Is.EqualTo(XmlConvert.ToString(_clock.UtcNow, XmlDateTimeSerializationMode.Utc))); + + _settings.Urls = @" / + /About"; + _clock.Advance(TimeSpan.FromMinutes(91)); + _warmupUpdater.EnsureGenerate(); + + var files = _appDataFolder.ListFiles(WarmupFolder).ToList(); + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net/About")))); + + warmupContent = _appDataFolder.ReadFile(_warmupFilename); + Assert.That(warmupContent, Is.EqualTo(XmlConvert.ToString(_clock.UtcNow, XmlDateTimeSerializationMode.Utc))); + } + + [Test] + public void ShouldGenerateNonWwwVersions() { + _settings.Urls = @" / + /About"; + + ((StubWorkContextAccessor.WorkContextImpl.StubSite)_orchardServices.WorkContext.CurrentSite).BaseUrl = "http://www.orchardproject.net/"; + + _webDownloader + .Setup(w => w.Download("http://www.orchardproject.net/")) + .Returns(new DownloadResult { Content = "Foo", StatusCode = HttpStatusCode.OK }); + + _webDownloader + .Setup(w => w.Download("http://www.orchardproject.net/About")) + .Returns(new DownloadResult { Content = "Bar", StatusCode = HttpStatusCode.OK }); + + _warmupUpdater.Generate(); + var files = _appDataFolder.ListFiles(WarmupFolder).ToList(); + + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://www.orchardproject.net")))); + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://www.orchardproject.net/About")))); + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net")))); + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net/About")))); + + var homepageContent = _appDataFolder.ReadFile(_appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net"))); + var aboutcontent = _appDataFolder.ReadFile(_appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net/About"))); + + var wwwhomepageContent = _appDataFolder.ReadFile(_appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://www.orchardproject.net"))); + var wwwaboutcontent = _appDataFolder.ReadFile(_appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://www.orchardproject.net/About"))); + + Assert.That(homepageContent, Is.EqualTo("Foo")); + Assert.That(wwwhomepageContent, Is.EqualTo("Foo")); + Assert.That(aboutcontent, Is.EqualTo("Bar")); + Assert.That(wwwaboutcontent, Is.EqualTo("Bar")); + } + + [Test] + public void ReportIsCreated() { + _settings.Urls = @" / + /About"; + + ((StubWorkContextAccessor.WorkContextImpl.StubSite)_orchardServices.WorkContext.CurrentSite).BaseUrl = "http://www.orchardproject.net/"; + + _webDownloader + .Setup(w => w.Download("http://www.orchardproject.net/")) + .Returns(new DownloadResult { Content = "Foo", StatusCode = HttpStatusCode.OK }); + + _webDownloader + .Setup(w => w.Download("http://www.orchardproject.net/About")) + .Returns(new DownloadResult { Content = "Bar", StatusCode = HttpStatusCode.OK }); + + _warmupUpdater.Generate(); + var files = _appDataFolder.ListFiles(WarmupFolder).ToList(); + + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://www.orchardproject.net")))); + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://www.orchardproject.net/About")))); + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net")))); + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net/About")))); + + var report = _reportManager.Read().ToList(); + + Assert.That(report.Count(), Is.EqualTo(2)); + Assert.That(report, Has.Some.Matches(x => x.RelativeUrl == "/")); + Assert.That(report, Has.Some.Matches(x => x.RelativeUrl == "/About")); + } + + [Test] + public void ShouldNotDeleteOtherFiles() { + _settings.Urls = @" / + /About"; + + ((StubWorkContextAccessor.WorkContextImpl.StubSite)_orchardServices.WorkContext.CurrentSite).BaseUrl = "http://www.orchardproject.net/"; + + _webDownloader + .Setup(w => w.Download("http://www.orchardproject.net/")) + .Returns(new DownloadResult { Content = "Foo", StatusCode = HttpStatusCode.OK }); + + _webDownloader + .Setup(w => w.Download("http://www.orchardproject.net/About")) + .Returns(new DownloadResult { Content = "Bar", StatusCode = HttpStatusCode.OK }); + + // Create a static file in the warmup folder + _appDataFolder.CreateFile(_appDataFolder.Combine(WarmupFolder, "foo.txt"), "Foo"); + + _warmupUpdater.Generate(); + var files = _appDataFolder.ListFiles(WarmupFolder).ToList(); + + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, "foo.txt"))); + + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://www.orchardproject.net")))); + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://www.orchardproject.net/About")))); + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net")))); + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net/About")))); + } + + + [Test] + public void ClearingUrlsShouldDeleteContent() { + _settings.Urls = @" / + /About"; + + ((StubWorkContextAccessor.WorkContextImpl.StubSite)_orchardServices.WorkContext.CurrentSite).BaseUrl = "http://www.orchardproject.net/"; + + _webDownloader + .Setup(w => w.Download("http://www.orchardproject.net/")) + .Returns(new DownloadResult { Content = "Foo", StatusCode = HttpStatusCode.OK }); + + _webDownloader + .Setup(w => w.Download("http://www.orchardproject.net/About")) + .Returns(new DownloadResult { Content = "Bar", StatusCode = HttpStatusCode.OK }); + + _warmupUpdater.Generate(); + var files = _appDataFolder.ListFiles(WarmupFolder).ToList(); + + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://www.orchardproject.net")))); + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://www.orchardproject.net/About")))); + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net")))); + Assert.That(files, Has.Some.Matches(x => x == _appDataFolder.Combine(WarmupFolder, WarmupUtility.EncodeUrl("http://orchardproject.net/About")))); + + _settings.Urls = @""; + + _warmupUpdater.Generate(); + files = _appDataFolder.ListFiles(WarmupFolder).ToList(); + + Assert.That(files.Count, Is.EqualTo(0)); + } + } +} diff --git a/src/Orchard.Tests.Modules/Warmup/WebDownloaderTests.cs b/src/Orchard.Tests.Modules/Warmup/WebDownloaderTests.cs index 2edd5a72a7c..013ede09820 100644 --- a/src/Orchard.Tests.Modules/Warmup/WebDownloaderTests.cs +++ b/src/Orchard.Tests.Modules/Warmup/WebDownloaderTests.cs @@ -1,37 +1,37 @@ -using System.Net; -using NUnit.Framework; -using Orchard.Warmup.Services; - -namespace Orchard.Tests.Modules.Warmup { - public class WebDownloaderTests { - private readonly IWebDownloader _webDownloader = new WebDownloader(); - - [Test] - public void ShouldReturnNullWhenUrlIsEmpty() { - Assert.That(_webDownloader.Download(null), Is.Null); - Assert.That(_webDownloader.Download(""), Is.Null); - Assert.That(_webDownloader.Download(" "), Is.Null); - } - - [Test] - public void ShouldReturnNullWhenUrlIsInvalid() { - Assert.That(_webDownloader.Download("froutfrout|yepyep"), Is.Null); - } - - [Test] - public void StatusCodeShouldBe404ForUnexistingResources() { - var download = _webDownloader.Download("http://orchardproject.net/yepyep"); - Assert.That(download, Is.Not.Null); - Assert.That(download.StatusCode, Is.EqualTo(HttpStatusCode.NotFound)); - Assert.That(download.Content, Is.Null); - } - - [Test] - public void StatusCodeShouldBe200ForValidRequests() { - var download = _webDownloader.Download("http://orchardproject.net/"); - Assert.That(download, Is.Not.Null); - Assert.That(download.StatusCode, Is.EqualTo(HttpStatusCode.OK)); - Assert.That(download.Content, Is.Not.Empty); - } - } -} +using System.Net; +using NUnit.Framework; +using Orchard.Warmup.Services; + +namespace Orchard.Tests.Modules.Warmup { + public class WebDownloaderTests { + private readonly IWebDownloader _webDownloader = new WebDownloader(); + + [Test] + public void ShouldReturnNullWhenUrlIsEmpty() { + Assert.That(_webDownloader.Download(null), Is.Null); + Assert.That(_webDownloader.Download(""), Is.Null); + Assert.That(_webDownloader.Download(" "), Is.Null); + } + + [Test] + public void ShouldReturnNullWhenUrlIsInvalid() { + Assert.That(_webDownloader.Download("froutfrout|yepyep"), Is.Null); + } + + [Test] + public void StatusCodeShouldBe404ForUnexistingResources() { + var download = _webDownloader.Download("http://orchardproject.net/yepyep"); + Assert.That(download, Is.Not.Null); + Assert.That(download.StatusCode, Is.EqualTo(HttpStatusCode.NotFound)); + Assert.That(download.Content, Is.Null); + } + + [Test] + public void StatusCodeShouldBe200ForValidRequests() { + var download = _webDownloader.Download("http://orchardproject.net/"); + Assert.That(download, Is.Not.Null); + Assert.That(download.StatusCode, Is.EqualTo(HttpStatusCode.OK)); + Assert.That(download.Content, Is.Not.Empty); + } + } +} diff --git a/src/Orchard.Tests.Modules/Widgets/RuleEngine/UrlRuleProviderTest.cs b/src/Orchard.Tests.Modules/Widgets/RuleEngine/UrlRuleProviderTest.cs index f70dd00b6ca..644bc812389 100644 --- a/src/Orchard.Tests.Modules/Widgets/RuleEngine/UrlRuleProviderTest.cs +++ b/src/Orchard.Tests.Modules/Widgets/RuleEngine/UrlRuleProviderTest.cs @@ -1,87 +1,87 @@ -using System; -using Autofac; -using NUnit.Framework; -using Orchard.Environment.Configuration; -using Orchard.Mvc; -using Orchard.Tests.Stubs; -using Orchard.Widgets.RuleEngine; -using Orchard.Widgets.Services; - -namespace Orchard.Tests.Modules.Widgets.RuleEngine { - [TestFixture] - public class UrlRuleProviderTest { - private IContainer _container; - private IRuleProvider _urlRuleProvider; - private StubHttpContextAccessor _stubContextAccessor; - private ShellSettings _shellSettings; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - _shellSettings = new ShellSettings { RequestUrlPrefix = String.Empty }; - builder.RegisterType().As(); - builder.RegisterInstance(_shellSettings); - _stubContextAccessor = new StubHttpContextAccessor(); - builder.RegisterInstance(_stubContextAccessor).As(); - _container = builder.Build(); - _urlRuleProvider = _container.Resolve(); - } - - [Test] - public void UrlForHomePageMatchesHomePagePath() { - _stubContextAccessor.Set(new StubHttpContext("~/")); - var context = new RuleContext { FunctionName = "url", Arguments = new[] { "~/" } }; - _urlRuleProvider.Process(context); - Assert.That(context.Result, Is.True); - } - - [Test] - public void UrlForAboutPageMatchesAboutPagePath() { - _stubContextAccessor.Set(new StubHttpContext("~/about")); - var context = new RuleContext { FunctionName = "url", Arguments = new[] { "~/about" } }; - _urlRuleProvider.Process(context); - Assert.That(context.Result, Is.True); - } - - [Test] - public void UrlForBlogWithEndingWildcardMatchesBlogPostPageInSaidBlog() { - _stubContextAccessor.Set(new StubHttpContext("~/my-blog/my-blog-post")); - var context = new RuleContext { FunctionName = "url", Arguments = new[] { "~/my-blog/*" } }; - _urlRuleProvider.Process(context); - Assert.That(context.Result, Is.True); - } - - [Test] - public void UrlForHomePageDoesNotMatchAboutPagePath() { - _stubContextAccessor.Set(new StubHttpContext("~/about")); - var context = new RuleContext { FunctionName = "url", Arguments = new[] { "~/" } }; - _urlRuleProvider.Process(context); - Assert.That(context.Result, Is.False); - } - - [Test] - public void UrlForAboutPageMatchesDifferentCasedAboutPagePath() { - _stubContextAccessor.Set(new StubHttpContext("~/About")); - var context = new RuleContext { FunctionName = "url", Arguments = new[] { "~/about" } }; - _urlRuleProvider.Process(context); - Assert.That(context.Result, Is.True); - } - - [Test] - public void UrlForAboutPageWithEndingSlashMatchesAboutPagePath() { - _stubContextAccessor.Set(new StubHttpContext("~/About/")); - var context = new RuleContext { FunctionName = "url", Arguments = new[] { "~/about" } }; - _urlRuleProvider.Process(context); - Assert.That(context.Result, Is.True); - } - - [Test] - public void UrlForHomePageMatchesHomePagePathWithUrlPrefix() { - _stubContextAccessor.Set(new StubHttpContext("~/site1")); - _shellSettings.RequestUrlPrefix = "site1"; - var context = new RuleContext { FunctionName = "url", Arguments = new[] { "~/" } }; - _urlRuleProvider.Process(context); - Assert.That(context.Result, Is.True); - } - } +using System; +using Autofac; +using NUnit.Framework; +using Orchard.Environment.Configuration; +using Orchard.Mvc; +using Orchard.Tests.Stubs; +using Orchard.Widgets.RuleEngine; +using Orchard.Widgets.Services; + +namespace Orchard.Tests.Modules.Widgets.RuleEngine { + [TestFixture] + public class UrlRuleProviderTest { + private IContainer _container; + private IRuleProvider _urlRuleProvider; + private StubHttpContextAccessor _stubContextAccessor; + private ShellSettings _shellSettings; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + _shellSettings = new ShellSettings { RequestUrlPrefix = String.Empty }; + builder.RegisterType().As(); + builder.RegisterInstance(_shellSettings); + _stubContextAccessor = new StubHttpContextAccessor(); + builder.RegisterInstance(_stubContextAccessor).As(); + _container = builder.Build(); + _urlRuleProvider = _container.Resolve(); + } + + [Test] + public void UrlForHomePageMatchesHomePagePath() { + _stubContextAccessor.Set(new StubHttpContext("~/")); + var context = new RuleContext { FunctionName = "url", Arguments = new[] { "~/" } }; + _urlRuleProvider.Process(context); + Assert.That(context.Result, Is.True); + } + + [Test] + public void UrlForAboutPageMatchesAboutPagePath() { + _stubContextAccessor.Set(new StubHttpContext("~/about")); + var context = new RuleContext { FunctionName = "url", Arguments = new[] { "~/about" } }; + _urlRuleProvider.Process(context); + Assert.That(context.Result, Is.True); + } + + [Test] + public void UrlForBlogWithEndingWildcardMatchesBlogPostPageInSaidBlog() { + _stubContextAccessor.Set(new StubHttpContext("~/my-blog/my-blog-post")); + var context = new RuleContext { FunctionName = "url", Arguments = new[] { "~/my-blog/*" } }; + _urlRuleProvider.Process(context); + Assert.That(context.Result, Is.True); + } + + [Test] + public void UrlForHomePageDoesNotMatchAboutPagePath() { + _stubContextAccessor.Set(new StubHttpContext("~/about")); + var context = new RuleContext { FunctionName = "url", Arguments = new[] { "~/" } }; + _urlRuleProvider.Process(context); + Assert.That(context.Result, Is.False); + } + + [Test] + public void UrlForAboutPageMatchesDifferentCasedAboutPagePath() { + _stubContextAccessor.Set(new StubHttpContext("~/About")); + var context = new RuleContext { FunctionName = "url", Arguments = new[] { "~/about" } }; + _urlRuleProvider.Process(context); + Assert.That(context.Result, Is.True); + } + + [Test] + public void UrlForAboutPageWithEndingSlashMatchesAboutPagePath() { + _stubContextAccessor.Set(new StubHttpContext("~/About/")); + var context = new RuleContext { FunctionName = "url", Arguments = new[] { "~/about" } }; + _urlRuleProvider.Process(context); + Assert.That(context.Result, Is.True); + } + + [Test] + public void UrlForHomePageMatchesHomePagePathWithUrlPrefix() { + _stubContextAccessor.Set(new StubHttpContext("~/site1")); + _shellSettings.RequestUrlPrefix = "site1"; + var context = new RuleContext { FunctionName = "url", Arguments = new[] { "~/" } }; + _urlRuleProvider.Process(context); + Assert.That(context.Result, Is.True); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests.Modules/Widgets/Services/WidgetsServiceTest.cs b/src/Orchard.Tests.Modules/Widgets/Services/WidgetsServiceTest.cs index 770967cd05b..71ce5b4b44c 100644 --- a/src/Orchard.Tests.Modules/Widgets/Services/WidgetsServiceTest.cs +++ b/src/Orchard.Tests.Modules/Widgets/Services/WidgetsServiceTest.cs @@ -1,279 +1,279 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Autofac; -using Moq; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Handlers; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.Records; -using Orchard.Core.Common.Models; -using Orchard.Core.Settings.Metadata.Records; -using Orchard.Data; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.DisplayManagement.Implementation; -using Orchard.Environment; -using Orchard.Environment.Extensions; -using Orchard.Environment.Extensions.Models; -using Orchard.Environment.Features; -using Orchard.Security; -using Orchard.Tests.Stubs; -using Orchard.UI.Notify; -using Orchard.UI.PageClass; -using Orchard.Widgets.Models; -using Orchard.Widgets.Services; - -namespace Orchard.Tests.Modules.Widgets.Services { - - [TestFixture] - public class WidgetsServiceTest : DatabaseEnabledTestsBase { - - private const string ThemeZoneName1 = "sidebar"; - private const string ThemeZoneName2 = "alternative"; - private const string DuplicateZoneNames = "sidebar,alternative, sidebar , alternative "; - - private const string LayerName1 = "Test layer 1"; - private const string LayerDescription1 = "Test layer 1"; - private const string LayerName2 = "Test layer 2"; - private const string LayerDescription2 = "Test layer 2"; - private const string WidgetTitle1 = "Test widget 1"; - private const string WidgetTitle2 = "Test widget 2"; - private const string WidgetTitle3 = "Test widget 3"; - private const string Zone1 = "Zone1"; - private const string Zone2 = "Zone2"; - private const string Position1 = "1"; - private const string Position2 = "3"; - private const string Position3 = "4"; - - private IWidgetsService _widgetService; - private IContentManager _contentManager; - - protected override IEnumerable DatabaseTypes { - get { - return new[] { - typeof(LayerPartRecord), - typeof(WidgetPartRecord), - typeof(CommonPartRecord), - typeof(BodyPartRecord), - typeof(ContentPartRecord), - typeof(ContentTypeRecord), - typeof(ContentItemRecord), - typeof(ContentItemVersionRecord), - typeof(ContentTypeDefinitionRecord), - typeof(ContentTypePartDefinitionRecord), - typeof(ContentPartDefinitionRecord), - typeof(ContentPartFieldDefinitionRecord), - typeof(ContentFieldDefinitionRecord) - }; - } - } - - public override void Init() { - base.Init(); - - _widgetService = _container.Resolve(); - _contentManager = _container.Resolve(); - } - - public override void Register(ContainerBuilder builder) { - var mockFeatureManager = new Mock(); - - var theme1 = new FeatureDescriptor {Extension = new ExtensionDescriptor { Zones = ThemeZoneName1, ExtensionType = "Theme" }}; - var theme2 = new FeatureDescriptor { Extension = new ExtensionDescriptor { Zones = ThemeZoneName2, ExtensionType = "Theme" } }; - var theme3 = new FeatureDescriptor { Extension = new ExtensionDescriptor { Zones = DuplicateZoneNames, ExtensionType = "Theme" } }; - var module1 = new FeatureDescriptor { Extension = new ExtensionDescriptor { Zones = "DontSeeMeBecauseIAmNotATheme", ExtensionType = "Module" } }; - mockFeatureManager.Setup(x => x.GetEnabledFeatures()) - .Returns(new[] { theme1, theme2, theme3, module1 }); - - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(mockFeatureManager.Object); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - - } - - [Test] - public void GetLayersTest() { - IEnumerable layers = _widgetService.GetLayers(); - Assert.That(layers.Count(), Is.EqualTo(0)); - - LayerPart layerPartFirst = _widgetService.CreateLayer(LayerName1, LayerDescription1, ""); - - layers = _widgetService.GetLayers(); - Assert.That(layers.Count(), Is.EqualTo(1)); - Assert.That(layers.First().Id, Is.EqualTo(layerPartFirst.Id)); - - _widgetService.CreateLayer(LayerName2, LayerDescription2, ""); - Assert.That(layers.Count(), Is.EqualTo(1)); - } - - [Test] - public void GetLayerTest() { - IEnumerable layers = _widgetService.GetLayers(); - Assert.That(layers.Count(), Is.EqualTo(0), "No layers yet"); - - _widgetService.CreateLayer("Test layer 1", "Test layer 1", ""); - - layers = _widgetService.GetLayers(); - Assert.That(layers.Count(), Is.EqualTo(1), "One layer was created"); - } - - [Test] - public void CreateLayerTest() { - IEnumerable layers = _widgetService.GetLayers(); - Assert.That(layers.Count(), Is.EqualTo(0), "No layers yet"); - - _widgetService.CreateLayer(LayerName1, LayerDescription1, ""); - - layers = _widgetService.GetLayers(); - LayerPart layer = layers.First(); - Assert.That(layer.Record.Name, Is.EqualTo(LayerName1)); - Assert.That(layer.Record.Description, Is.EqualTo(LayerDescription1)); - } - - [Test] - public void GetWidgetTest() { - LayerPart layerPart = _widgetService.CreateLayer(LayerName1, LayerDescription1, ""); - - WidgetPart widgetResult = _widgetService.GetWidget(0); - Assert.That(widgetResult, Is.Null); - - WidgetPart widgetPart = _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle1, "1", ""); - Assert.That(widgetPart, Is.Not.Null); - - widgetResult = _widgetService.GetWidget(0); - Assert.That(widgetResult, Is.Null, "Still yields null on an invalid identifier"); - - widgetResult = _widgetService.GetWidget(widgetPart.Id); - Assert.That(widgetResult.Id, Is.EqualTo(widgetPart.Id), "Returns correct widget"); - } - - [Test] - public void GetWidgetsTest() { - LayerPart layerPart = _widgetService.CreateLayer(LayerName1, LayerDescription1, ""); - - IEnumerable widgetResults = _widgetService.GetWidgets(); - Assert.That(widgetResults.Count(), Is.EqualTo(0)); - - WidgetPart widgetPart = _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle1, "1", ""); - Assert.That(widgetPart, Is.Not.Null); - - widgetResults = _widgetService.GetWidgets(); - Assert.That(widgetResults.Count(), Is.EqualTo(1)); - Assert.That(widgetResults.First().Id, Is.EqualTo(widgetPart.Id)); - - _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle2, "2", ""); - - widgetResults = _widgetService.GetWidgets(); - Assert.That(widgetResults.Count(), Is.EqualTo(2)); - } - - [Test] - public void CreateWidgetTest() { - LayerPart layerPart = _widgetService.CreateLayer(LayerName1, LayerDescription1, ""); - - WidgetPart widgetPart = _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle1, "1", ""); - Assert.That(widgetPart, Is.Not.Null); - Assert.That(widgetPart.LayerPart.Id, Is.EqualTo(layerPart.Id)); - } - - [Test] - //[Ignore("Needs fixing")] - public void GetZonesTest() { - IEnumerable zones = _widgetService.GetZones(); - Assert.That(zones.Count(), Is.EqualTo(2), "Two zones on the mock list"); - Assert.That(zones.FirstOrDefault(zone => zone == ThemeZoneName1), Is.Not.Null); - Assert.That(zones.FirstOrDefault(zone => zone == ThemeZoneName2), Is.Not.Null); - } - - [Test, Ignore("Fix when possible")] - public void MoveWidgetTest() { - LayerPart layerPart = _widgetService.CreateLayer(LayerName1, LayerDescription1, ""); - - // same zone widgets - WidgetPart widgetPart1 = _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle1, Position1, Zone1); - WidgetPart widgetPart2 = _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle2, Position2, Zone1); - - // different zone widget - WidgetPart widgetPart3 = _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle3, Position3, Zone2); - - // test 1 - moving first widget up will have no effect - Assert.That(_widgetService.MoveWidgetUp(widgetPart1), Is.False); - - // test 2 - moving first widget down will be successfull - Assert.That(_widgetService.MoveWidgetDown(widgetPart1), Is.True); - - widgetPart1 = _widgetService.GetWidget(widgetPart1.Id); - Assert.That(widgetPart1.Position, Is.EqualTo(Position2), "First widget moved to second widget position"); - - widgetPart2 = _widgetService.GetWidget(widgetPart2.Id); - Assert.That(widgetPart2.Position, Is.EqualTo(Position1), "Second widget moved to first widget position"); - - // test 3 - moving last widget down will have no effect even though there is a widget in another zone with a higher position - Assert.That(_widgetService.MoveWidgetDown(widgetPart1), Is.False); - - widgetPart1 = _widgetService.GetWidget(widgetPart1.Id); - Assert.That(widgetPart1.Position, Is.EqualTo(Position2), "Widget remained in the same position"); - - widgetPart2 = _widgetService.GetWidget(widgetPart2.Id); - Assert.That(widgetPart2.Position, Is.EqualTo(Position1), "Widget remained in the same position"); - - widgetPart3 = _widgetService.GetWidget(widgetPart3.Id); - Assert.That(widgetPart3.Position, Is.EqualTo(Position3), "Widget remained in the same position"); - } - - [Test, Ignore("Fix when possible")] - public void GetLayerWidgetsTest() { - LayerPart layerPart = _widgetService.CreateLayer(LayerName1, LayerDescription1, ""); - - // same zone widgets - WidgetPart widgetPart1 = _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle1, Position1, Zone1); - WidgetPart widgetPart2 = _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle2, Position2, Zone1); - - // different zone widget - _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle3, Position3, Zone2); - - // test 1 - moving first widget up will have no effect - IEnumerable layerWidgets = _widgetService.GetWidgets(layerPart.Id); - Assert.That(layerWidgets.Count(), Is.EqualTo(2)); - Assert.That(layerWidgets.Contains(widgetPart1)); - Assert.That(layerWidgets.Contains(widgetPart2)); - } - - public class StubLayerPartHandler : ContentHandler { - public StubLayerPartHandler(IRepository layersRepository) { - Filters.Add(new ActivatingFilter("Layer")); - Filters.Add(new ActivatingFilter("Layer")); - Filters.Add(StorageFilter.For(layersRepository)); - } - } - - public class StubWidgetPartHandler : ContentHandler { - public StubWidgetPartHandler(IRepository widgetsRepository) { - Filters.Add(new ActivatingFilter("HtmlWidget")); - Filters.Add(new ActivatingFilter("HtmlWidget")); - Filters.Add(new ActivatingFilter("HtmlWidget")); - Filters.Add(StorageFilter.For(widgetsRepository)); - } - } - } +using System; +using System.Collections.Generic; +using System.Linq; +using Autofac; +using Moq; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Handlers; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.Records; +using Orchard.Core.Common.Models; +using Orchard.Core.Settings.Metadata.Records; +using Orchard.Data; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.DisplayManagement.Implementation; +using Orchard.Environment; +using Orchard.Environment.Extensions; +using Orchard.Environment.Extensions.Models; +using Orchard.Environment.Features; +using Orchard.Security; +using Orchard.Tests.Stubs; +using Orchard.UI.Notify; +using Orchard.UI.PageClass; +using Orchard.Widgets.Models; +using Orchard.Widgets.Services; + +namespace Orchard.Tests.Modules.Widgets.Services { + + [TestFixture] + public class WidgetsServiceTest : DatabaseEnabledTestsBase { + + private const string ThemeZoneName1 = "sidebar"; + private const string ThemeZoneName2 = "alternative"; + private const string DuplicateZoneNames = "sidebar,alternative, sidebar , alternative "; + + private const string LayerName1 = "Test layer 1"; + private const string LayerDescription1 = "Test layer 1"; + private const string LayerName2 = "Test layer 2"; + private const string LayerDescription2 = "Test layer 2"; + private const string WidgetTitle1 = "Test widget 1"; + private const string WidgetTitle2 = "Test widget 2"; + private const string WidgetTitle3 = "Test widget 3"; + private const string Zone1 = "Zone1"; + private const string Zone2 = "Zone2"; + private const string Position1 = "1"; + private const string Position2 = "3"; + private const string Position3 = "4"; + + private IWidgetsService _widgetService; + private IContentManager _contentManager; + + protected override IEnumerable DatabaseTypes { + get { + return new[] { + typeof(LayerPartRecord), + typeof(WidgetPartRecord), + typeof(CommonPartRecord), + typeof(BodyPartRecord), + typeof(ContentPartRecord), + typeof(ContentTypeRecord), + typeof(ContentItemRecord), + typeof(ContentItemVersionRecord), + typeof(ContentTypeDefinitionRecord), + typeof(ContentTypePartDefinitionRecord), + typeof(ContentPartDefinitionRecord), + typeof(ContentPartFieldDefinitionRecord), + typeof(ContentFieldDefinitionRecord) + }; + } + } + + public override void Init() { + base.Init(); + + _widgetService = _container.Resolve(); + _contentManager = _container.Resolve(); + } + + public override void Register(ContainerBuilder builder) { + var mockFeatureManager = new Mock(); + + var theme1 = new FeatureDescriptor {Extension = new ExtensionDescriptor { Zones = ThemeZoneName1, ExtensionType = "Theme" }}; + var theme2 = new FeatureDescriptor { Extension = new ExtensionDescriptor { Zones = ThemeZoneName2, ExtensionType = "Theme" } }; + var theme3 = new FeatureDescriptor { Extension = new ExtensionDescriptor { Zones = DuplicateZoneNames, ExtensionType = "Theme" } }; + var module1 = new FeatureDescriptor { Extension = new ExtensionDescriptor { Zones = "DontSeeMeBecauseIAmNotATheme", ExtensionType = "Module" } }; + mockFeatureManager.Setup(x => x.GetEnabledFeatures()) + .Returns(new[] { theme1, theme2, theme3, module1 }); + + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(mockFeatureManager.Object); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + + } + + [Test] + public void GetLayersTest() { + IEnumerable layers = _widgetService.GetLayers(); + Assert.That(layers.Count(), Is.EqualTo(0)); + + LayerPart layerPartFirst = _widgetService.CreateLayer(LayerName1, LayerDescription1, ""); + + layers = _widgetService.GetLayers(); + Assert.That(layers.Count(), Is.EqualTo(1)); + Assert.That(layers.First().Id, Is.EqualTo(layerPartFirst.Id)); + + _widgetService.CreateLayer(LayerName2, LayerDescription2, ""); + Assert.That(layers.Count(), Is.EqualTo(1)); + } + + [Test] + public void GetLayerTest() { + IEnumerable layers = _widgetService.GetLayers(); + Assert.That(layers.Count(), Is.EqualTo(0), "No layers yet"); + + _widgetService.CreateLayer("Test layer 1", "Test layer 1", ""); + + layers = _widgetService.GetLayers(); + Assert.That(layers.Count(), Is.EqualTo(1), "One layer was created"); + } + + [Test] + public void CreateLayerTest() { + IEnumerable layers = _widgetService.GetLayers(); + Assert.That(layers.Count(), Is.EqualTo(0), "No layers yet"); + + _widgetService.CreateLayer(LayerName1, LayerDescription1, ""); + + layers = _widgetService.GetLayers(); + LayerPart layer = layers.First(); + Assert.That(layer.Record.Name, Is.EqualTo(LayerName1)); + Assert.That(layer.Record.Description, Is.EqualTo(LayerDescription1)); + } + + [Test] + public void GetWidgetTest() { + LayerPart layerPart = _widgetService.CreateLayer(LayerName1, LayerDescription1, ""); + + WidgetPart widgetResult = _widgetService.GetWidget(0); + Assert.That(widgetResult, Is.Null); + + WidgetPart widgetPart = _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle1, "1", ""); + Assert.That(widgetPart, Is.Not.Null); + + widgetResult = _widgetService.GetWidget(0); + Assert.That(widgetResult, Is.Null, "Still yields null on an invalid identifier"); + + widgetResult = _widgetService.GetWidget(widgetPart.Id); + Assert.That(widgetResult.Id, Is.EqualTo(widgetPart.Id), "Returns correct widget"); + } + + [Test] + public void GetWidgetsTest() { + LayerPart layerPart = _widgetService.CreateLayer(LayerName1, LayerDescription1, ""); + + IEnumerable widgetResults = _widgetService.GetWidgets(); + Assert.That(widgetResults.Count(), Is.EqualTo(0)); + + WidgetPart widgetPart = _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle1, "1", ""); + Assert.That(widgetPart, Is.Not.Null); + + widgetResults = _widgetService.GetWidgets(); + Assert.That(widgetResults.Count(), Is.EqualTo(1)); + Assert.That(widgetResults.First().Id, Is.EqualTo(widgetPart.Id)); + + _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle2, "2", ""); + + widgetResults = _widgetService.GetWidgets(); + Assert.That(widgetResults.Count(), Is.EqualTo(2)); + } + + [Test] + public void CreateWidgetTest() { + LayerPart layerPart = _widgetService.CreateLayer(LayerName1, LayerDescription1, ""); + + WidgetPart widgetPart = _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle1, "1", ""); + Assert.That(widgetPart, Is.Not.Null); + Assert.That(widgetPart.LayerPart.Id, Is.EqualTo(layerPart.Id)); + } + + [Test] + //[Ignore("Needs fixing")] + public void GetZonesTest() { + IEnumerable zones = _widgetService.GetZones(); + Assert.That(zones.Count(), Is.EqualTo(2), "Two zones on the mock list"); + Assert.That(zones.FirstOrDefault(zone => zone == ThemeZoneName1), Is.Not.Null); + Assert.That(zones.FirstOrDefault(zone => zone == ThemeZoneName2), Is.Not.Null); + } + + [Test, Ignore("Fix when possible")] + public void MoveWidgetTest() { + LayerPart layerPart = _widgetService.CreateLayer(LayerName1, LayerDescription1, ""); + + // same zone widgets + WidgetPart widgetPart1 = _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle1, Position1, Zone1); + WidgetPart widgetPart2 = _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle2, Position2, Zone1); + + // different zone widget + WidgetPart widgetPart3 = _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle3, Position3, Zone2); + + // test 1 - moving first widget up will have no effect + Assert.That(_widgetService.MoveWidgetUp(widgetPart1), Is.False); + + // test 2 - moving first widget down will be successfull + Assert.That(_widgetService.MoveWidgetDown(widgetPart1), Is.True); + + widgetPart1 = _widgetService.GetWidget(widgetPart1.Id); + Assert.That(widgetPart1.Position, Is.EqualTo(Position2), "First widget moved to second widget position"); + + widgetPart2 = _widgetService.GetWidget(widgetPart2.Id); + Assert.That(widgetPart2.Position, Is.EqualTo(Position1), "Second widget moved to first widget position"); + + // test 3 - moving last widget down will have no effect even though there is a widget in another zone with a higher position + Assert.That(_widgetService.MoveWidgetDown(widgetPart1), Is.False); + + widgetPart1 = _widgetService.GetWidget(widgetPart1.Id); + Assert.That(widgetPart1.Position, Is.EqualTo(Position2), "Widget remained in the same position"); + + widgetPart2 = _widgetService.GetWidget(widgetPart2.Id); + Assert.That(widgetPart2.Position, Is.EqualTo(Position1), "Widget remained in the same position"); + + widgetPart3 = _widgetService.GetWidget(widgetPart3.Id); + Assert.That(widgetPart3.Position, Is.EqualTo(Position3), "Widget remained in the same position"); + } + + [Test, Ignore("Fix when possible")] + public void GetLayerWidgetsTest() { + LayerPart layerPart = _widgetService.CreateLayer(LayerName1, LayerDescription1, ""); + + // same zone widgets + WidgetPart widgetPart1 = _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle1, Position1, Zone1); + WidgetPart widgetPart2 = _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle2, Position2, Zone1); + + // different zone widget + _widgetService.CreateWidget(layerPart.Id, "HtmlWidget", WidgetTitle3, Position3, Zone2); + + // test 1 - moving first widget up will have no effect + IEnumerable layerWidgets = _widgetService.GetWidgets(layerPart.Id); + Assert.That(layerWidgets.Count(), Is.EqualTo(2)); + Assert.That(layerWidgets.Contains(widgetPart1)); + Assert.That(layerWidgets.Contains(widgetPart2)); + } + + public class StubLayerPartHandler : ContentHandler { + public StubLayerPartHandler(IRepository layersRepository) { + Filters.Add(new ActivatingFilter("Layer")); + Filters.Add(new ActivatingFilter("Layer")); + Filters.Add(StorageFilter.For(layersRepository)); + } + } + + public class StubWidgetPartHandler : ContentHandler { + public StubWidgetPartHandler(IRepository widgetsRepository) { + Filters.Add(new ActivatingFilter("HtmlWidget")); + Filters.Add(new ActivatingFilter("HtmlWidget")); + Filters.Add(new ActivatingFilter("HtmlWidget")); + Filters.Add(StorageFilter.For(widgetsRepository)); + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests.Modules/Widgets/WidgetsTests.cs b/src/Orchard.Tests.Modules/Widgets/WidgetsTests.cs index 4b34a09df0c..c9f21071914 100644 --- a/src/Orchard.Tests.Modules/Widgets/WidgetsTests.cs +++ b/src/Orchard.Tests.Modules/Widgets/WidgetsTests.cs @@ -1,58 +1,58 @@ -using System; -using Autofac; -using NUnit.Framework; -using Orchard.Scripting; -using Orchard.Caching; -using Orchard.Tests.Stubs; -using Orchard.Widgets.RuleEngine; -using Orchard.Widgets.Services; - -namespace Orchard.Tests.Modules.Widgets { - [TestFixture] - public class WidgetsTests { - private IContainer _container; - private IRuleManager _ruleManager; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - _container = builder.Build(); - _ruleManager = _container.Resolve(); - } - - [Test] - public void ProviderGetsCalledForExpression() { - bool result = _ruleManager.Matches("hello"); - Assert.IsTrue(result); - } - - [Test] - public void RubyExpressionIsEvaluated() { - bool result = _ruleManager.Matches("not hello"); - Assert.IsFalse(result); - } - - [Test] - public void ArgumentsArePassedCorrectly() { - bool result = _ruleManager.Matches("add(2, 3) == 5"); - Assert.IsTrue(result); - } - } - - public class AlwaysTrueRuleProvider : IRuleProvider { - public void Process(RuleContext ruleContext) { - if (ruleContext.FunctionName == "add") { - ruleContext.Result = Convert.ToInt32(ruleContext.Arguments[0]) + Convert.ToInt32(ruleContext.Arguments[1]); - return; - } - - ruleContext.Result = true; - } - } -} - +using System; +using Autofac; +using NUnit.Framework; +using Orchard.Scripting; +using Orchard.Caching; +using Orchard.Tests.Stubs; +using Orchard.Widgets.RuleEngine; +using Orchard.Widgets.Services; + +namespace Orchard.Tests.Modules.Widgets { + [TestFixture] + public class WidgetsTests { + private IContainer _container; + private IRuleManager _ruleManager; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + _container = builder.Build(); + _ruleManager = _container.Resolve(); + } + + [Test] + public void ProviderGetsCalledForExpression() { + bool result = _ruleManager.Matches("hello"); + Assert.IsTrue(result); + } + + [Test] + public void RubyExpressionIsEvaluated() { + bool result = _ruleManager.Matches("not hello"); + Assert.IsFalse(result); + } + + [Test] + public void ArgumentsArePassedCorrectly() { + bool result = _ruleManager.Matches("add(2, 3) == 5"); + Assert.IsTrue(result); + } + } + + public class AlwaysTrueRuleProvider : IRuleProvider { + public void Process(RuleContext ruleContext) { + if (ruleContext.FunctionName == "add") { + ruleContext.Result = Convert.ToInt32(ruleContext.Arguments[0]) + Convert.ToInt32(ruleContext.Arguments[1]); + return; + } + + ruleContext.Result = true; + } + } +} + diff --git a/src/Orchard.Tests.Modules/XmlRpc/Controllers/HomeControllerTests.cs b/src/Orchard.Tests.Modules/XmlRpc/Controllers/HomeControllerTests.cs index 1600465e7e7..bc955fa00e5 100644 --- a/src/Orchard.Tests.Modules/XmlRpc/Controllers/HomeControllerTests.cs +++ b/src/Orchard.Tests.Modules/XmlRpc/Controllers/HomeControllerTests.cs @@ -1,50 +1,50 @@ -using System.Xml.Linq; -using Autofac; -using NUnit.Framework; -using Orchard.Core.XmlRpc; -using Orchard.Core.XmlRpc.Controllers; -using Orchard.Core.XmlRpc.Models; -using Orchard.Core.XmlRpc.Services; - -namespace Orchard.Tests.Modules.XmlRpc.Controllers { - [TestFixture] - public class HomeControllerTests { - [Test] - public void RequestShouldBeDispatchedToAllHandlers() { - var thing1 = new StubHandler(); - var thing2 = new StubHandler(); - - var builder = new ContainerBuilder(); - //builder.RegisterModule(new ImplicitCollectionSupportModule()); - builder.RegisterType(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(thing1).As(); - builder.RegisterInstance(thing2).As(); - - var container = builder.Build(); - - var controller = container.Resolve(); - - Assert.That(thing1.ProcessCalls, Is.EqualTo(0)); - Assert.That(thing2.ProcessCalls, Is.EqualTo(0)); - - var result = controller.ServiceEndpoint(new XRpcMethodCall()); - Assert.That(result, Is.Not.Null); - Assert.That(thing1.ProcessCalls, Is.EqualTo(1)); - Assert.That(thing2.ProcessCalls, Is.EqualTo(1)); - - } - - public class StubHandler : IXmlRpcHandler { - public void SetCapabilities(XElement element) {} - - public void Process(XmlRpcContext context) { - ProcessCalls++; - context.Response = new XRpcMethodResponse(); - } - - public int ProcessCalls { get; set; } - } - } +using System.Xml.Linq; +using Autofac; +using NUnit.Framework; +using Orchard.Core.XmlRpc; +using Orchard.Core.XmlRpc.Controllers; +using Orchard.Core.XmlRpc.Models; +using Orchard.Core.XmlRpc.Services; + +namespace Orchard.Tests.Modules.XmlRpc.Controllers { + [TestFixture] + public class HomeControllerTests { + [Test] + public void RequestShouldBeDispatchedToAllHandlers() { + var thing1 = new StubHandler(); + var thing2 = new StubHandler(); + + var builder = new ContainerBuilder(); + //builder.RegisterModule(new ImplicitCollectionSupportModule()); + builder.RegisterType(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(thing1).As(); + builder.RegisterInstance(thing2).As(); + + var container = builder.Build(); + + var controller = container.Resolve(); + + Assert.That(thing1.ProcessCalls, Is.EqualTo(0)); + Assert.That(thing2.ProcessCalls, Is.EqualTo(0)); + + var result = controller.ServiceEndpoint(new XRpcMethodCall()); + Assert.That(result, Is.Not.Null); + Assert.That(thing1.ProcessCalls, Is.EqualTo(1)); + Assert.That(thing2.ProcessCalls, Is.EqualTo(1)); + + } + + public class StubHandler : IXmlRpcHandler { + public void SetCapabilities(XElement element) {} + + public void Process(XmlRpcContext context) { + ProcessCalls++; + context.Response = new XRpcMethodResponse(); + } + + public int ProcessCalls { get; set; } + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests.Modules/XmlRpc/Controllers/LiveWriterControllerTests.cs b/src/Orchard.Tests.Modules/XmlRpc/Controllers/LiveWriterControllerTests.cs index 04cbc041be2..67f89bb4c4b 100644 --- a/src/Orchard.Tests.Modules/XmlRpc/Controllers/LiveWriterControllerTests.cs +++ b/src/Orchard.Tests.Modules/XmlRpc/Controllers/LiveWriterControllerTests.cs @@ -1,59 +1,59 @@ -using System.Web.Mvc; -using System.Xml.Linq; -using Autofac; -using NUnit.Framework; -using Orchard.Core.XmlRpc; -using Orchard.Core.XmlRpc.Controllers; -using Orchard.Core.XmlRpc.Models; -using Orchard.Core.XmlRpc.Services; - -namespace Orchard.Tests.Modules.XmlRpc.Controllers { - [TestFixture] - public class LiveWriterControllerTests { - [Test] - public void HandlersShouldSetCapabilitiesForManifest() { - var thing = new StubHandler(); - var thingToo = new StubTooHandler(); - - var builder = new ContainerBuilder(); - builder.RegisterType(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(thing).As(); - builder.RegisterInstance(thingToo).As(); - - var container = builder.Build(); - - var controller = container.Resolve(); - var result = controller.Manifest() as ContentResult; - Assert.That(result, Is.Not.Null); - Assert.That(result.Content, Is.StringContaining("No")); - Assert.That(result.Content, Is.StringContaining("Yes")); - Assert.That(result.Content, Is.StringContaining("Maybe")); - - } - - public class StubHandler : IXmlRpcHandler { - public void SetCapabilities(XElement options) { - const string manifestUri = "http://schemas.microsoft.com/wlw/manifest/weblog"; - options.SetElementValue(XName.Get("supportsGetTags", manifestUri), "No"); - options.SetElementValue(XName.Get("keywordsAsTags", manifestUri), "Yes"); - } - - public void Process(XmlRpcContext context) { } - - public int ProcessCalls { get; set; } - } - - public class StubTooHandler : IXmlRpcHandler { - public void SetCapabilities(XElement options) { - const string manifestUri = "http://schemas.microsoft.com/wlw/manifest/weblog"; - options.SetElementValue(XName.Get("supportsKeywords", manifestUri), "Maybe"); - } - - public void Process(XmlRpcContext context) { } - - public int ProcessCalls { get; set; } - } - } +using System.Web.Mvc; +using System.Xml.Linq; +using Autofac; +using NUnit.Framework; +using Orchard.Core.XmlRpc; +using Orchard.Core.XmlRpc.Controllers; +using Orchard.Core.XmlRpc.Models; +using Orchard.Core.XmlRpc.Services; + +namespace Orchard.Tests.Modules.XmlRpc.Controllers { + [TestFixture] + public class LiveWriterControllerTests { + [Test] + public void HandlersShouldSetCapabilitiesForManifest() { + var thing = new StubHandler(); + var thingToo = new StubTooHandler(); + + var builder = new ContainerBuilder(); + builder.RegisterType(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(thing).As(); + builder.RegisterInstance(thingToo).As(); + + var container = builder.Build(); + + var controller = container.Resolve(); + var result = controller.Manifest() as ContentResult; + Assert.That(result, Is.Not.Null); + Assert.That(result.Content, Is.StringContaining("No")); + Assert.That(result.Content, Is.StringContaining("Yes")); + Assert.That(result.Content, Is.StringContaining("Maybe")); + + } + + public class StubHandler : IXmlRpcHandler { + public void SetCapabilities(XElement options) { + const string manifestUri = "http://schemas.microsoft.com/wlw/manifest/weblog"; + options.SetElementValue(XName.Get("supportsGetTags", manifestUri), "No"); + options.SetElementValue(XName.Get("keywordsAsTags", manifestUri), "Yes"); + } + + public void Process(XmlRpcContext context) { } + + public int ProcessCalls { get; set; } + } + + public class StubTooHandler : IXmlRpcHandler { + public void SetCapabilities(XElement options) { + const string manifestUri = "http://schemas.microsoft.com/wlw/manifest/weblog"; + options.SetElementValue(XName.Get("supportsKeywords", manifestUri), "Maybe"); + } + + public void Process(XmlRpcContext context) { } + + public int ProcessCalls { get; set; } + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests.Modules/XmlRpc/Services/XmlRpcReaderTests.cs b/src/Orchard.Tests.Modules/XmlRpc/Services/XmlRpcReaderTests.cs index dd71f43a949..b24f5252eb8 100644 --- a/src/Orchard.Tests.Modules/XmlRpc/Services/XmlRpcReaderTests.cs +++ b/src/Orchard.Tests.Modules/XmlRpc/Services/XmlRpcReaderTests.cs @@ -1,117 +1,117 @@ -using System; -using System.Xml.Linq; -using NUnit.Framework; -using Orchard.Core.XmlRpc.Services; - -namespace Orchard.Tests.Modules.XmlRpc.Services { - [TestFixture] - public class XmlRpcReaderTests { - private IXmlRpcReader _xmlRpcReader; - - [SetUp] - public void Init() { - _xmlRpcReader = new XmlRpcReader(); - } - - [Test] - public void MethodCallShouldMapName() { - var source = XElement.Parse(@" - - hello world -"); - - var methodCall = _xmlRpcReader.MapToMethodCall(source); - Assert.That(methodCall, Is.Not.Null); - Assert.That(methodCall.MethodName, Is.EqualTo("hello world")); - } - - [Test] - public void CallWithParametersShouldMapValuesAccordingToSpec() { - var source = XElement.Parse(@" - - hello world - - -12 - 42 - 1 - 0 - hello world - -12.214 - 1998-07-17T14:08:55 - eW91IGNhbid0IHJlYWQgdGhpcyE= - -"); - - var methodCall = _xmlRpcReader.MapToMethodCall(source); - Assert.That(methodCall, Is.Not.Null); - Assert.That(methodCall.Params, Has.Count.EqualTo(8)); - Assert.That(methodCall.Params[0].Value, Is.EqualTo(-12)); - Assert.That(methodCall.Params[1].Value, Is.EqualTo(42)); - Assert.That(methodCall.Params[2].Value, Is.EqualTo(true)); - Assert.That(methodCall.Params[3].Value, Is.EqualTo(false)); - Assert.That(methodCall.Params[4].Value, Is.EqualTo("hello world")); - Assert.That(methodCall.Params[5].Value, Is.EqualTo(-12.214)); - Assert.That(methodCall.Params[6].Value, Is.EqualTo(new DateTime(1998, 7, 17, 14, 8, 55))); - Assert.That(methodCall.Params[7].Value, Is.EqualTo(Convert.FromBase64String("eW91IGNhbid0IHJlYWQgdGhpcyE="))); - } - - [Test] - public void StructShouldMapAllMembersByNameWithCorrectType() { - var source = XElement.Parse(@" - - one-12 - two42 - three1 - four0 - fivehello world - six-12.214 - seven1998-07-17T14:08:55 - eighteW91IGNhbid0IHJlYWQgdGhpcyE= -"); - - var xmlStruct = _xmlRpcReader.MapToStruct(source); - Assert.That(xmlStruct["one"], Is.EqualTo(-12)); - Assert.That(xmlStruct["two"], Is.EqualTo(42)); - Assert.That(xmlStruct["three"], Is.EqualTo(true)); - Assert.That(xmlStruct["four"], Is.EqualTo(false)); - Assert.That(xmlStruct["five"], Is.EqualTo("hello world")); - Assert.That(xmlStruct["six"], Is.EqualTo(-12.214)); - Assert.That(xmlStruct["seven"], Is.EqualTo(new DateTime(1998, 7, 17, 14, 8, 55))); - Assert.That(xmlStruct["eight"], Is.EqualTo(Convert.FromBase64String("eW91IGNhbid0IHJlYWQgdGhpcyE="))); - - } - - [Test] - public void StructShouldMapDefaultDateTimeWithBadFormat() { - var source = XElement.Parse(@" - - sevenFOO -"); - - var xmlStruct = _xmlRpcReader.MapToStruct(source); - Assert.That(xmlStruct["seven"], Is.GreaterThan(DateTime.Now.AddSeconds(-1))); - Assert.That(xmlStruct["seven"], Is.LessThan(DateTime.Now.AddSeconds(1))); - } - - [Test] - public void ArrayShouldBringDataItemsWithCorrectType() { - var source = XElement.Parse(@" - - - 12 - Egypt - 0 - -31 - - -"); - - var xmlArray = _xmlRpcReader.MapToArray(source); - Assert.That(xmlArray.Data, Has.Count.EqualTo(4)); - Assert.That(xmlArray[0], Is.EqualTo(12)); - Assert.That(xmlArray[1], Is.EqualTo("Egypt")); - Assert.That(xmlArray[2], Is.EqualTo(false)); - Assert.That(xmlArray[3], Is.EqualTo(-31)); - } - } +using System; +using System.Xml.Linq; +using NUnit.Framework; +using Orchard.Core.XmlRpc.Services; + +namespace Orchard.Tests.Modules.XmlRpc.Services { + [TestFixture] + public class XmlRpcReaderTests { + private IXmlRpcReader _xmlRpcReader; + + [SetUp] + public void Init() { + _xmlRpcReader = new XmlRpcReader(); + } + + [Test] + public void MethodCallShouldMapName() { + var source = XElement.Parse(@" + + hello world +"); + + var methodCall = _xmlRpcReader.MapToMethodCall(source); + Assert.That(methodCall, Is.Not.Null); + Assert.That(methodCall.MethodName, Is.EqualTo("hello world")); + } + + [Test] + public void CallWithParametersShouldMapValuesAccordingToSpec() { + var source = XElement.Parse(@" + + hello world + + -12 + 42 + 1 + 0 + hello world + -12.214 + 1998-07-17T14:08:55 + eW91IGNhbid0IHJlYWQgdGhpcyE= + +"); + + var methodCall = _xmlRpcReader.MapToMethodCall(source); + Assert.That(methodCall, Is.Not.Null); + Assert.That(methodCall.Params, Has.Count.EqualTo(8)); + Assert.That(methodCall.Params[0].Value, Is.EqualTo(-12)); + Assert.That(methodCall.Params[1].Value, Is.EqualTo(42)); + Assert.That(methodCall.Params[2].Value, Is.EqualTo(true)); + Assert.That(methodCall.Params[3].Value, Is.EqualTo(false)); + Assert.That(methodCall.Params[4].Value, Is.EqualTo("hello world")); + Assert.That(methodCall.Params[5].Value, Is.EqualTo(-12.214)); + Assert.That(methodCall.Params[6].Value, Is.EqualTo(new DateTime(1998, 7, 17, 14, 8, 55))); + Assert.That(methodCall.Params[7].Value, Is.EqualTo(Convert.FromBase64String("eW91IGNhbid0IHJlYWQgdGhpcyE="))); + } + + [Test] + public void StructShouldMapAllMembersByNameWithCorrectType() { + var source = XElement.Parse(@" + + one-12 + two42 + three1 + four0 + fivehello world + six-12.214 + seven1998-07-17T14:08:55 + eighteW91IGNhbid0IHJlYWQgdGhpcyE= +"); + + var xmlStruct = _xmlRpcReader.MapToStruct(source); + Assert.That(xmlStruct["one"], Is.EqualTo(-12)); + Assert.That(xmlStruct["two"], Is.EqualTo(42)); + Assert.That(xmlStruct["three"], Is.EqualTo(true)); + Assert.That(xmlStruct["four"], Is.EqualTo(false)); + Assert.That(xmlStruct["five"], Is.EqualTo("hello world")); + Assert.That(xmlStruct["six"], Is.EqualTo(-12.214)); + Assert.That(xmlStruct["seven"], Is.EqualTo(new DateTime(1998, 7, 17, 14, 8, 55))); + Assert.That(xmlStruct["eight"], Is.EqualTo(Convert.FromBase64String("eW91IGNhbid0IHJlYWQgdGhpcyE="))); + + } + + [Test] + public void StructShouldMapDefaultDateTimeWithBadFormat() { + var source = XElement.Parse(@" + + sevenFOO +"); + + var xmlStruct = _xmlRpcReader.MapToStruct(source); + Assert.That(xmlStruct["seven"], Is.GreaterThan(DateTime.Now.AddSeconds(-1))); + Assert.That(xmlStruct["seven"], Is.LessThan(DateTime.Now.AddSeconds(1))); + } + + [Test] + public void ArrayShouldBringDataItemsWithCorrectType() { + var source = XElement.Parse(@" + + + 12 + Egypt + 0 + -31 + + +"); + + var xmlArray = _xmlRpcReader.MapToArray(source); + Assert.That(xmlArray.Data, Has.Count.EqualTo(4)); + Assert.That(xmlArray[0], Is.EqualTo(12)); + Assert.That(xmlArray[1], Is.EqualTo("Egypt")); + Assert.That(xmlArray[2], Is.EqualTo(false)); + Assert.That(xmlArray[3], Is.EqualTo(-31)); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests.Modules/XmlRpc/Services/XmlRpcWriterTests.cs b/src/Orchard.Tests.Modules/XmlRpc/Services/XmlRpcWriterTests.cs index ca104c6e61f..be09eee1a08 100644 --- a/src/Orchard.Tests.Modules/XmlRpc/Services/XmlRpcWriterTests.cs +++ b/src/Orchard.Tests.Modules/XmlRpc/Services/XmlRpcWriterTests.cs @@ -1,67 +1,67 @@ -using System.Xml.Linq; -using NUnit.Framework; -using Orchard.Core.XmlRpc.Models; -using Orchard.Core.XmlRpc.Services; - -namespace Orchard.Tests.Modules.XmlRpc.Services { - [TestFixture] - public class XmlRpcWriterTests { - [Test] - public void MethodResponseWriterShouldSendParametersWithValues() { - var mapper = new XmlRpcWriter(); - - var response = new XRpcMethodResponse(); - response.Params.Add(new XRpcData { Value = 42 }); - var element = mapper.MapMethodResponse(response); - - Assert.That(NoSpace(element.ToString()), Is.EqualTo("42")); - } - - [Test] - public void ArrayAndStructShouldWorkAsExpected() { - var mapper = new XmlRpcWriter(); - - var arr = new XRpcArray(); - var structParam = XRpcData.For(new XRpcStruct()); - - arr.Data.Add(structParam); - arr.Data.Add(XRpcData.For(19)); - - structParam.Value.Members.Add("Hello", XRpcData.For("world")); - - var element = mapper.MapArray(arr); - - Assert.That(NoSpace(element.ToString()), Is.EqualTo(NoSpace(@" - - -Helloworld - -19 - -"))); - } - - [Test] - public void FaultShouldBeCorrectlyFormatted() { - var mapper = new XmlRpcWriter(); - var response = new XRpcMethodResponse { - Fault = new XRpcFault(10, "foo") - }; - - var element = mapper.MapMethodResponse(response); - - Assert.That(NoSpace(element.ToString()), Is.EqualTo(NoSpace(@" - - -faultCode10 -faultStringfoo - - -"))); - } - - private static string NoSpace(string text) { - return text.Replace(" ", "").Replace("\r", "").Replace("\n", "").Replace("\t", ""); - } - } +using System.Xml.Linq; +using NUnit.Framework; +using Orchard.Core.XmlRpc.Models; +using Orchard.Core.XmlRpc.Services; + +namespace Orchard.Tests.Modules.XmlRpc.Services { + [TestFixture] + public class XmlRpcWriterTests { + [Test] + public void MethodResponseWriterShouldSendParametersWithValues() { + var mapper = new XmlRpcWriter(); + + var response = new XRpcMethodResponse(); + response.Params.Add(new XRpcData { Value = 42 }); + var element = mapper.MapMethodResponse(response); + + Assert.That(NoSpace(element.ToString()), Is.EqualTo("42")); + } + + [Test] + public void ArrayAndStructShouldWorkAsExpected() { + var mapper = new XmlRpcWriter(); + + var arr = new XRpcArray(); + var structParam = XRpcData.For(new XRpcStruct()); + + arr.Data.Add(structParam); + arr.Data.Add(XRpcData.For(19)); + + structParam.Value.Members.Add("Hello", XRpcData.For("world")); + + var element = mapper.MapArray(arr); + + Assert.That(NoSpace(element.ToString()), Is.EqualTo(NoSpace(@" + + +Helloworld + +19 + +"))); + } + + [Test] + public void FaultShouldBeCorrectlyFormatted() { + var mapper = new XmlRpcWriter(); + var response = new XRpcMethodResponse { + Fault = new XRpcFault(10, "foo") + }; + + var element = mapper.MapMethodResponse(response); + + Assert.That(NoSpace(element.ToString()), Is.EqualTo(NoSpace(@" + + +faultCode10 +faultStringfoo + + +"))); + } + + private static string NoSpace(string text) { + return text.Replace(" ", "").Replace("\r", "").Replace("\n", "").Replace("\t", ""); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/App.config b/src/Orchard.Tests/App.config index c8a59d19cd6..a14743e2d5e 100644 --- a/src/Orchard.Tests/App.config +++ b/src/Orchard.Tests/App.config @@ -1,35 +1,35 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Tests/Caching/CacheScopeTests.cs b/src/Orchard.Tests/Caching/CacheScopeTests.cs index 54cc5619382..1f5c74016b0 100644 --- a/src/Orchard.Tests/Caching/CacheScopeTests.cs +++ b/src/Orchard.Tests/Caching/CacheScopeTests.cs @@ -1,44 +1,44 @@ -using NUnit.Framework; -using Orchard.Caching; -using Orchard.Environment; -using Autofac; -using Orchard.FileSystems.AppData; -using Orchard.FileSystems.WebSite; -using Orchard.Services; - -namespace Orchard.Tests.Caching { - [TestFixture] - public class CacheScopeTests { - private IContainer _hostContainer; - - [SetUp] - public void Init() { - _hostContainer = OrchardStarter.CreateHostContainer(builder => { - builder.RegisterType().InstancePerDependency(); - }); - - } - - public class Alpha { - public ICacheManager CacheManager { get; set; } - - public Alpha(ICacheManager cacheManager) { - CacheManager = cacheManager; - } - } - - [Test] - public void ComponentsAtHostLevelHaveAccessToCache() { - var alpha = _hostContainer.Resolve(); - Assert.That(alpha.CacheManager, Is.Not.Null); - } - - [Test] - public void HostLevelHasAccessToGlobalVolatileProviders() { - Assert.That(_hostContainer.Resolve(), Is.Not.Null); - Assert.That(_hostContainer.Resolve(), Is.Not.Null); - Assert.That(_hostContainer.Resolve(), Is.Not.Null); - } - - } -} +using NUnit.Framework; +using Orchard.Caching; +using Orchard.Environment; +using Autofac; +using Orchard.FileSystems.AppData; +using Orchard.FileSystems.WebSite; +using Orchard.Services; + +namespace Orchard.Tests.Caching { + [TestFixture] + public class CacheScopeTests { + private IContainer _hostContainer; + + [SetUp] + public void Init() { + _hostContainer = OrchardStarter.CreateHostContainer(builder => { + builder.RegisterType().InstancePerDependency(); + }); + + } + + public class Alpha { + public ICacheManager CacheManager { get; set; } + + public Alpha(ICacheManager cacheManager) { + CacheManager = cacheManager; + } + } + + [Test] + public void ComponentsAtHostLevelHaveAccessToCache() { + var alpha = _hostContainer.Resolve(); + Assert.That(alpha.CacheManager, Is.Not.Null); + } + + [Test] + public void HostLevelHasAccessToGlobalVolatileProviders() { + Assert.That(_hostContainer.Resolve(), Is.Not.Null); + Assert.That(_hostContainer.Resolve(), Is.Not.Null); + Assert.That(_hostContainer.Resolve(), Is.Not.Null); + } + + } +} diff --git a/src/Orchard.Tests/Caching/CacheTests.cs b/src/Orchard.Tests/Caching/CacheTests.cs index 0201d3b264e..5e1f9b87245 100644 --- a/src/Orchard.Tests/Caching/CacheTests.cs +++ b/src/Orchard.Tests/Caching/CacheTests.cs @@ -1,135 +1,135 @@ -using System; -using System.Linq; -using System.Threading; -using Autofac; -using NUnit.Framework; -using Orchard.Caching; - -namespace Orchard.Tests.Caching { - [TestFixture] - public class CacheTests { - private IContainer _container; - private ICacheManager _cacheManager; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - builder.RegisterModule(new CacheModule()); - builder.RegisterType().As(); - builder.RegisterType().As().SingleInstance(); - builder.RegisterType().As(); - _container = builder.Build(); - _cacheManager = _container.Resolve(new TypedParameter(typeof(Type), GetType())); - } - - [Test] - public void CacheManagerShouldReturnCacheItem() { - var result = _cacheManager.Get("testItem", ctx => "testResult"); - Assert.That(result, Is.EqualTo("testResult")); - } - - [Test] - public void CacheManagerShouldReturnExistingCacheItem() { - _cacheManager.Get("testItem", ctx => "testResult"); - var result = _cacheManager.Get("testItem", ctx => ""); - Assert.That(result, Is.EqualTo("testResult")); - } - - [Test] - public void CacheModuleProvidesTypeSpecificManager() { - var scope = _container.BeginLifetimeScope(builder => { - builder.RegisterModule(new CacheModule()); - builder.RegisterType(); - builder.RegisterType(); - }); - - var c1 = scope.Resolve(); - var c2 = scope.Resolve(); - var w1a = c1.CacheManager.Get("hello", ctx => "world1"); - var w1b = c1.CacheManager.Get("hello", ctx => "world2"); - var w2a = c2.CacheManager.Get("hello", ctx => "world3"); - var w2b = c2.CacheManager.Get("hello", ctx => "world4"); - - Assert.That(w1a, Is.EqualTo("world1")); - Assert.That(w1b, Is.EqualTo("world1")); - Assert.That(w2a, Is.EqualTo("world3")); - Assert.That(w2b, Is.EqualTo("world3")); - - var c3 = scope.Resolve(); - var c4 = scope.Resolve(); - var w3a = c3.CacheManager.Get("hello", ctx => "world5"); - var w3b = c3.CacheManager.Get("hello", ctx => "world6"); - var w4a = c4.CacheManager.Get("hello", ctx => "world7"); - var w4b = c4.CacheManager.Get("hello", ctx => "world8"); - - Assert.That(w3a, Is.EqualTo("world1")); - Assert.That(w3b, Is.EqualTo("world1")); - Assert.That(w4a, Is.EqualTo("world3")); - Assert.That(w4b, Is.EqualTo("world3")); - - Assert.That(c1.CacheManager, - Is.Not.SameAs(c3.CacheManager)); - - Assert.That(c1.CacheManager.GetCache(), - Is.SameAs(c3.CacheManager.GetCache())); - - Assert.That(c1.CacheManager, - Is.Not.SameAs(c2.CacheManager)); - - Assert.That(c1.CacheManager.GetCache(), - Is.Not.SameAs(c2.CacheManager.GetCache())); - } - - [Test] - public void CacheManagerIsNotBlocking() { - var hits = 0; - string result = ""; - - Enumerable.Range(0, 5).AsParallel().ForAll(x => - result = _cacheManager.Get("testItem", ctx => { - // by waiting for 100ms we expect all the calls to Get - // to enter this lambda - Thread.Sleep(100); - hits++; - return "testResult"; - }) - ); - - Assert.That(result, Is.EqualTo("testResult")); - Assert.That(hits, Is.GreaterThan(1)); - } - - [Test] - public void CacheManagerIsBlocking() { - var hits = 0; - string result = ""; - - Enumerable.Range(0, 5).AsParallel().ForAll(x => - result = _cacheManager.Get("testItem", true, ctx => { - Thread.Sleep(100); - hits++; - return "testResult"; - }) - ); - - Assert.That(result, Is.EqualTo("testResult")); - Assert.That(hits, Is.EqualTo(1)); - } - - class ComponentOne { - public ICacheManager CacheManager { get; set; } - - public ComponentOne(ICacheManager cacheManager) { - CacheManager = cacheManager; - } - } - - class ComponentTwo { - public ICacheManager CacheManager { get; set; } - - public ComponentTwo(ICacheManager cacheManager) { - CacheManager = cacheManager; - } - } - } +using System; +using System.Linq; +using System.Threading; +using Autofac; +using NUnit.Framework; +using Orchard.Caching; + +namespace Orchard.Tests.Caching { + [TestFixture] + public class CacheTests { + private IContainer _container; + private ICacheManager _cacheManager; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + builder.RegisterModule(new CacheModule()); + builder.RegisterType().As(); + builder.RegisterType().As().SingleInstance(); + builder.RegisterType().As(); + _container = builder.Build(); + _cacheManager = _container.Resolve(new TypedParameter(typeof(Type), GetType())); + } + + [Test] + public void CacheManagerShouldReturnCacheItem() { + var result = _cacheManager.Get("testItem", ctx => "testResult"); + Assert.That(result, Is.EqualTo("testResult")); + } + + [Test] + public void CacheManagerShouldReturnExistingCacheItem() { + _cacheManager.Get("testItem", ctx => "testResult"); + var result = _cacheManager.Get("testItem", ctx => ""); + Assert.That(result, Is.EqualTo("testResult")); + } + + [Test] + public void CacheModuleProvidesTypeSpecificManager() { + var scope = _container.BeginLifetimeScope(builder => { + builder.RegisterModule(new CacheModule()); + builder.RegisterType(); + builder.RegisterType(); + }); + + var c1 = scope.Resolve(); + var c2 = scope.Resolve(); + var w1a = c1.CacheManager.Get("hello", ctx => "world1"); + var w1b = c1.CacheManager.Get("hello", ctx => "world2"); + var w2a = c2.CacheManager.Get("hello", ctx => "world3"); + var w2b = c2.CacheManager.Get("hello", ctx => "world4"); + + Assert.That(w1a, Is.EqualTo("world1")); + Assert.That(w1b, Is.EqualTo("world1")); + Assert.That(w2a, Is.EqualTo("world3")); + Assert.That(w2b, Is.EqualTo("world3")); + + var c3 = scope.Resolve(); + var c4 = scope.Resolve(); + var w3a = c3.CacheManager.Get("hello", ctx => "world5"); + var w3b = c3.CacheManager.Get("hello", ctx => "world6"); + var w4a = c4.CacheManager.Get("hello", ctx => "world7"); + var w4b = c4.CacheManager.Get("hello", ctx => "world8"); + + Assert.That(w3a, Is.EqualTo("world1")); + Assert.That(w3b, Is.EqualTo("world1")); + Assert.That(w4a, Is.EqualTo("world3")); + Assert.That(w4b, Is.EqualTo("world3")); + + Assert.That(c1.CacheManager, + Is.Not.SameAs(c3.CacheManager)); + + Assert.That(c1.CacheManager.GetCache(), + Is.SameAs(c3.CacheManager.GetCache())); + + Assert.That(c1.CacheManager, + Is.Not.SameAs(c2.CacheManager)); + + Assert.That(c1.CacheManager.GetCache(), + Is.Not.SameAs(c2.CacheManager.GetCache())); + } + + [Test] + public void CacheManagerIsNotBlocking() { + var hits = 0; + string result = ""; + + Enumerable.Range(0, 5).AsParallel().ForAll(x => + result = _cacheManager.Get("testItem", ctx => { + // by waiting for 100ms we expect all the calls to Get + // to enter this lambda + Thread.Sleep(100); + hits++; + return "testResult"; + }) + ); + + Assert.That(result, Is.EqualTo("testResult")); + Assert.That(hits, Is.GreaterThan(1)); + } + + [Test] + public void CacheManagerIsBlocking() { + var hits = 0; + string result = ""; + + Enumerable.Range(0, 5).AsParallel().ForAll(x => + result = _cacheManager.Get("testItem", true, ctx => { + Thread.Sleep(100); + hits++; + return "testResult"; + }) + ); + + Assert.That(result, Is.EqualTo("testResult")); + Assert.That(hits, Is.EqualTo(1)); + } + + class ComponentOne { + public ICacheManager CacheManager { get; set; } + + public ComponentOne(ICacheManager cacheManager) { + CacheManager = cacheManager; + } + } + + class ComponentTwo { + public ICacheManager CacheManager { get; set; } + + public ComponentTwo(ICacheManager cacheManager) { + CacheManager = cacheManager; + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Caching/ClockCachingTests.cs b/src/Orchard.Tests/Caching/ClockCachingTests.cs index 8464182bf19..e7d4037454a 100644 --- a/src/Orchard.Tests/Caching/ClockCachingTests.cs +++ b/src/Orchard.Tests/Caching/ClockCachingTests.cs @@ -1,84 +1,84 @@ -using System; -using Autofac; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.Services; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.Caching { - [TestFixture] - public class ClockCachingTests { - private IContainer _container; - private ICacheManager _cacheManager; - private StubClock _clock; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - builder.RegisterModule(new CacheModule()); - builder.RegisterType().As(); - builder.RegisterType().As().SingleInstance(); - builder.RegisterType().As(); - builder.RegisterInstance(_clock = new StubClock()); - _container = builder.Build(); - _cacheManager = _container.Resolve(new TypedParameter(typeof(Type), GetType())); - } - - [Test] - public void WhenAbsoluteShouldHandleAbsoluteTime() { - var inOneSecond = _clock.UtcNow.AddSeconds(1); - var cached = 0; - - // each call after the specified datetime will be reevaluated - Func retrieve = () - => _cacheManager.Get("testItem", - ctx => { - ctx.Monitor(_clock.WhenUtc(inOneSecond)); - return ++cached; - }); - - Assert.That(retrieve(), Is.EqualTo(1)); - - for ( var i = 0; i < 10; i++ ) { - Assert.That(retrieve(), Is.EqualTo(1)); - } - - _clock.Advance(TimeSpan.FromSeconds(1)); - - Assert.That(retrieve(), Is.EqualTo(2)); - Assert.That(retrieve(), Is.EqualTo(3)); - Assert.That(retrieve(), Is.EqualTo(4)); - } - - [Test] - public void WhenAbsoluteShouldHandleAbsoluteTimeSpan() { - var cached = 0; - - // each cached value has a lifetime of the specified duration - Func retrieve = () - => _cacheManager.Get("testItem", - ctx => { - ctx.Monitor(_clock.When(TimeSpan.FromSeconds(1))); - return ++cached; - }); - - Assert.That(retrieve(), Is.EqualTo(1)); - - for ( var i = 0; i < 10; i++ ) { - Assert.That(retrieve(), Is.EqualTo(1)); - } - - _clock.Advance(TimeSpan.FromSeconds(1)); - - for ( var i = 0; i < 10; i++ ) { - Assert.That(retrieve(), Is.EqualTo(2)); - } - - _clock.Advance(TimeSpan.FromSeconds(1)); - - for ( var i = 0; i < 10; i++ ) { - Assert.That(retrieve(), Is.EqualTo(3)); - } - } - } +using System; +using Autofac; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.Services; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.Caching { + [TestFixture] + public class ClockCachingTests { + private IContainer _container; + private ICacheManager _cacheManager; + private StubClock _clock; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + builder.RegisterModule(new CacheModule()); + builder.RegisterType().As(); + builder.RegisterType().As().SingleInstance(); + builder.RegisterType().As(); + builder.RegisterInstance(_clock = new StubClock()); + _container = builder.Build(); + _cacheManager = _container.Resolve(new TypedParameter(typeof(Type), GetType())); + } + + [Test] + public void WhenAbsoluteShouldHandleAbsoluteTime() { + var inOneSecond = _clock.UtcNow.AddSeconds(1); + var cached = 0; + + // each call after the specified datetime will be reevaluated + Func retrieve = () + => _cacheManager.Get("testItem", + ctx => { + ctx.Monitor(_clock.WhenUtc(inOneSecond)); + return ++cached; + }); + + Assert.That(retrieve(), Is.EqualTo(1)); + + for ( var i = 0; i < 10; i++ ) { + Assert.That(retrieve(), Is.EqualTo(1)); + } + + _clock.Advance(TimeSpan.FromSeconds(1)); + + Assert.That(retrieve(), Is.EqualTo(2)); + Assert.That(retrieve(), Is.EqualTo(3)); + Assert.That(retrieve(), Is.EqualTo(4)); + } + + [Test] + public void WhenAbsoluteShouldHandleAbsoluteTimeSpan() { + var cached = 0; + + // each cached value has a lifetime of the specified duration + Func retrieve = () + => _cacheManager.Get("testItem", + ctx => { + ctx.Monitor(_clock.When(TimeSpan.FromSeconds(1))); + return ++cached; + }); + + Assert.That(retrieve(), Is.EqualTo(1)); + + for ( var i = 0; i < 10; i++ ) { + Assert.That(retrieve(), Is.EqualTo(1)); + } + + _clock.Advance(TimeSpan.FromSeconds(1)); + + for ( var i = 0; i < 10; i++ ) { + Assert.That(retrieve(), Is.EqualTo(2)); + } + + _clock.Advance(TimeSpan.FromSeconds(1)); + + for ( var i = 0; i < 10; i++ ) { + Assert.That(retrieve(), Is.EqualTo(3)); + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Commands/CommandHandlerDescriptorBuilderTests.cs b/src/Orchard.Tests/Commands/CommandHandlerDescriptorBuilderTests.cs index 0109c234382..1c439ae1bff 100644 --- a/src/Orchard.Tests/Commands/CommandHandlerDescriptorBuilderTests.cs +++ b/src/Orchard.Tests/Commands/CommandHandlerDescriptorBuilderTests.cs @@ -1,77 +1,77 @@ -using System.Linq; -using NUnit.Framework; -using Orchard.Commands; - -namespace Orchard.Tests.Commands { - [TestFixture] - public class CommandHandlerDescriptorBuilderTests { - [Test] - public void BuilderShouldCreateDescriptor() { - var builder = new CommandHandlerDescriptorBuilder(); - var descriptor = builder.Build(typeof(MyCommand)); - Assert.That(descriptor, Is.Not.Null); - Assert.That(descriptor.Commands.Count(), Is.EqualTo(4)); - Assert.That(descriptor.Commands.Single(d => d.Name == "FooBar"), Is.Not.Null); - Assert.That(descriptor.Commands.Single(d => d.Name == "FooBar").MethodInfo, Is.EqualTo(typeof(MyCommand).GetMethod("FooBar"))); - Assert.That(descriptor.Commands.Single(d => d.Name == "MyCommand"), Is.Not.Null); - Assert.That(descriptor.Commands.Single(d => d.Name == "MyCommand").MethodInfo, Is.EqualTo(typeof(MyCommand).GetMethod("FooBar2"))); - Assert.That(descriptor.Commands.Single(d => d.Name == "Foo Bar"), Is.Not.Null); - Assert.That(descriptor.Commands.Single(d => d.Name == "Foo Bar").MethodInfo, Is.EqualTo(typeof(MyCommand).GetMethod("Foo_Bar"))); - Assert.That(descriptor.Commands.Single(d => d.Name == "Foo_Bar"), Is.Not.Null); - Assert.That(descriptor.Commands.Single(d => d.Name == "Foo_Bar").MethodInfo, Is.EqualTo(typeof(MyCommand).GetMethod("Foo_Bar3"))); - } - - public class MyCommand : DefaultOrchardCommandHandler { - public void FooBar() { - } - - [CommandName("MyCommand")] - public void FooBar2() { - } - - public void Foo_Bar() { - } - - [CommandName("Foo_Bar")] - public void Foo_Bar3() { - } - } - - [Test] - public void BuilderShouldReturnPublicMethodsOnly() { - var builder = new CommandHandlerDescriptorBuilder(); - var descriptor = builder.Build(typeof(PublicMethodsOnly)); - Assert.That(descriptor, Is.Not.Null); - Assert.That(descriptor.Commands.Count(), Is.EqualTo(1)); - Assert.That(descriptor.Commands.Single(d => d.Name == "Method"), Is.Not.Null); - } - -#pragma warning disable 660,661 - public class PublicMethodsOnly { -#pragma warning restore 660,661 - public bool Bar { get; set; } // no accessors - public bool Field = true; // no field - - // no private method - private void Blah() { - } - - // no private method - public static void Foo() { - } - - // no operator - public static bool operator ==(PublicMethodsOnly a, PublicMethodsOnly b) { - return false; - } - - public static bool operator !=(PublicMethodsOnly a, PublicMethodsOnly b) { - return false; - } - - public void Method() { - } - } - - } -} +using System.Linq; +using NUnit.Framework; +using Orchard.Commands; + +namespace Orchard.Tests.Commands { + [TestFixture] + public class CommandHandlerDescriptorBuilderTests { + [Test] + public void BuilderShouldCreateDescriptor() { + var builder = new CommandHandlerDescriptorBuilder(); + var descriptor = builder.Build(typeof(MyCommand)); + Assert.That(descriptor, Is.Not.Null); + Assert.That(descriptor.Commands.Count(), Is.EqualTo(4)); + Assert.That(descriptor.Commands.Single(d => d.Name == "FooBar"), Is.Not.Null); + Assert.That(descriptor.Commands.Single(d => d.Name == "FooBar").MethodInfo, Is.EqualTo(typeof(MyCommand).GetMethod("FooBar"))); + Assert.That(descriptor.Commands.Single(d => d.Name == "MyCommand"), Is.Not.Null); + Assert.That(descriptor.Commands.Single(d => d.Name == "MyCommand").MethodInfo, Is.EqualTo(typeof(MyCommand).GetMethod("FooBar2"))); + Assert.That(descriptor.Commands.Single(d => d.Name == "Foo Bar"), Is.Not.Null); + Assert.That(descriptor.Commands.Single(d => d.Name == "Foo Bar").MethodInfo, Is.EqualTo(typeof(MyCommand).GetMethod("Foo_Bar"))); + Assert.That(descriptor.Commands.Single(d => d.Name == "Foo_Bar"), Is.Not.Null); + Assert.That(descriptor.Commands.Single(d => d.Name == "Foo_Bar").MethodInfo, Is.EqualTo(typeof(MyCommand).GetMethod("Foo_Bar3"))); + } + + public class MyCommand : DefaultOrchardCommandHandler { + public void FooBar() { + } + + [CommandName("MyCommand")] + public void FooBar2() { + } + + public void Foo_Bar() { + } + + [CommandName("Foo_Bar")] + public void Foo_Bar3() { + } + } + + [Test] + public void BuilderShouldReturnPublicMethodsOnly() { + var builder = new CommandHandlerDescriptorBuilder(); + var descriptor = builder.Build(typeof(PublicMethodsOnly)); + Assert.That(descriptor, Is.Not.Null); + Assert.That(descriptor.Commands.Count(), Is.EqualTo(1)); + Assert.That(descriptor.Commands.Single(d => d.Name == "Method"), Is.Not.Null); + } + +#pragma warning disable 660,661 + public class PublicMethodsOnly { +#pragma warning restore 660,661 + public bool Bar { get; set; } // no accessors + public bool Field = true; // no field + + // no private method + private void Blah() { + } + + // no private method + public static void Foo() { + } + + // no operator + public static bool operator ==(PublicMethodsOnly a, PublicMethodsOnly b) { + return false; + } + + public static bool operator !=(PublicMethodsOnly a, PublicMethodsOnly b) { + return false; + } + + public void Method() { + } + } + + } +} diff --git a/src/Orchard.Tests/Commands/CommandHandlerTests.cs b/src/Orchard.Tests/Commands/CommandHandlerTests.cs index 6b7782794f2..f52e00ecb91 100644 --- a/src/Orchard.Tests/Commands/CommandHandlerTests.cs +++ b/src/Orchard.Tests/Commands/CommandHandlerTests.cs @@ -1,239 +1,239 @@ -using System.Collections.Generic; -using System.IO; -using NUnit.Framework; -using Orchard.Commands; -using System; -using System.Linq; - -namespace Orchard.Tests.Commands { - [TestFixture] - public class CommandsTests { - private ICommandHandler _handler; - - [SetUp] - public void Init() { - _handler = new StubCommandHandler(); - } - - private CommandContext CreateCommandContext(string commandName) { - return CreateCommandContext(commandName, new Dictionary(), new string[]{}); - } - - private CommandContext CreateCommandContext(string commandName, IDictionary switches) { - return CreateCommandContext(commandName, switches, new string[]{}); - } - - private CommandContext CreateCommandContext(string commandName, IDictionary switches, string[] args) { - var builder = new CommandHandlerDescriptorBuilder(); - - var descriptor = builder.Build(typeof(StubCommandHandler)); - - var commandDescriptor = descriptor.Commands.Single(d => string.Equals(d.Name, commandName, StringComparison.OrdinalIgnoreCase)); - - return new CommandContext { - Command = commandName, - Switches = switches, - CommandDescriptor = commandDescriptor, - Arguments = args, - Input = new StringReader(string.Empty), - Output = new StringWriter() - }; - } - - [Test] - public void TestFooCommand() { - var commandContext = CreateCommandContext("Foo"); - _handler.Execute(commandContext); - Assert.That(commandContext.Output.ToString(), Is.EqualTo("Command Foo Executed")); - } - - [Test] - public void TestNotExistingCommand() { - Assert.Throws(() => { - var commandContext = CreateCommandContext("NoSuchCommand"); - _handler.Execute(commandContext); - }); - } - - [Test] - public void TestCommandWithCustomAlias() { - var commandContext = CreateCommandContext("Bar"); - _handler.Execute(commandContext); - Assert.That(commandContext.Output.ToString(), Is.EqualTo("Hello World!")); - } - - [Test] - public void TestHelpText() { - var commandContext = CreateCommandContext("Baz"); - Assert.That(commandContext.CommandDescriptor.HelpText, Is.EqualTo("Baz help")); - } - - [Test] - public void TestEmptyHelpText() { - var commandContext = CreateCommandContext("Foo"); - Assert.That(commandContext.CommandDescriptor.HelpText, Is.EqualTo(string.Empty)); - } - - [Test] - public void TestCaseInsensitiveForCommand() { - var commandContext = CreateCommandContext("BAZ", new Dictionary { { "VERBOSE", "true" } }); - _handler.Execute(commandContext); - Assert.That(commandContext.Output.ToString(), Is.EqualTo("Command Baz Called : This was a test")); - } - - - [Test] - public void TestBooleanSwitchForCommand() { - var commandContext = CreateCommandContext("Baz", new Dictionary {{"Verbose", "true"}}); - _handler.Execute(commandContext); - Assert.That(commandContext.Output.ToString(), Is.EqualTo("Command Baz Called : This was a test")); - } - - [Test] - public void TestIntSwitchForCommand() { - var commandContext = CreateCommandContext("Baz", new Dictionary {{"Level", "2"}}); - _handler.Execute(commandContext); - Assert.That(commandContext.Output.ToString(), Is.EqualTo("Command Baz Called : Entering Level 2")); - } - - [Test] - public void TestStringSwitchForCommand() { - var commandContext = CreateCommandContext("Baz", new Dictionary {{"User", "OrchardUser"}}); - _handler.Execute(commandContext); - Assert.That(commandContext.Output.ToString(), Is.EqualTo("Command Baz Called : current user is OrchardUser")); - } - - [Test] - public void TestSwitchForCommandWithoutSupportForIt() { - var switches = new Dictionary {{"User", "OrchardUser"}}; - var commandContext = CreateCommandContext("Foo", switches); - Assert.Throws(() => _handler.Execute(commandContext)); - } - - [Test] - public void TestCommandThatDoesNotReturnAValue() { - var commandContext = CreateCommandContext("Log"); - _handler.Execute(commandContext); - Assert.That(commandContext.Output.ToString(), Is.EqualTo("")); - } - - [Test] - public void TestNotExistingSwitch() { - var switches = new Dictionary {{"ThisSwitchDoesNotExist", "Insignificant"}}; - var commandContext = CreateCommandContext("Foo", switches); - Assert.Throws(() => _handler.Execute(commandContext)); - } - - [Test] - public void TestCommandArgumentsArePassedCorrectly() { - var commandContext = CreateCommandContext("Concat", new Dictionary(), new[] {"left to ", "right"}); - _handler.Execute(commandContext); - Assert.That(commandContext.Output.ToString(), Is.EqualTo("left to right")); - } - - [Test] - public void TestCommandArgumentsArePassedCorrectlyWithAParamsParameters() { - var commandContext = CreateCommandContext("ConcatParams", new Dictionary(), new[] {"left to ", "right"}); - _handler.Execute(commandContext); - Assert.That(commandContext.Output.ToString(), Is.EqualTo("left to right")); - } - - [Test] - public void TestCommandArgumentsArePassedCorrectlyWithAParamsParameterAndNoArguments() { - var commandContext = CreateCommandContext("ConcatParams", new Dictionary()); - _handler.Execute(commandContext); - Assert.That(commandContext.Output.ToString(), Is.EqualTo("")); - } - - [Test] - public void TestCommandArgumentsArePassedCorrectlyWithNormalParametersAndAParamsParameters() { - var commandContext = CreateCommandContext("ConcatAllParams", - new Dictionary(), - new[] { "left-", "center-", "right"}); - _handler.Execute(commandContext); - Assert.That(commandContext.Output.ToString(), Is.EqualTo("left-center-right")); - } - - [Test] - public void TestCommandParamsMismatchWithoutParamsNotEnoughArguments() { - var commandContext = CreateCommandContext("Concat", new Dictionary(), new[] { "left to " }); - Assert.Throws(() => _handler.Execute(commandContext)); - } - - [Test] - public void TestCommandParamsMismatchWithoutParamsTooManyArguments() { - var commandContext = CreateCommandContext("Foo", new Dictionary(), new[] { "left to " }); - Assert.Throws(() => _handler.Execute(commandContext)); - } - - [Test] - public void TestCommandParamsMismatchWithParamsButNotEnoughArguments() { - var commandContext = CreateCommandContext("ConcatAllParams", new Dictionary()); - Assert.Throws(() => _handler.Execute(commandContext)); - } - } - - public class StubCommandHandler : DefaultOrchardCommandHandler { - [OrchardSwitch] - public bool Verbose { get; set; } - - [OrchardSwitch] - public int Level { get; set; } - - [OrchardSwitch] - public string User { get; set; } - - public string Foo() { - return "Command Foo Executed"; - } - - [CommandName("Bar")] - public string Hello() { - return "Hello World!"; - } - - [OrchardSwitches("Verbose, Level, User")] - [CommandHelp("Baz help")] - public string Baz() { - string trace = "Command Baz Called"; - - if (Verbose) { - trace += " : This was a test"; - } - - if (Level == 2) { - trace += " : Entering Level 2"; - } - - if (!String.IsNullOrEmpty(User)) { - trace += " : current user is " + User; - } - - return trace; - } - - public string Concat(string left, string right) { - return left + right; - } - - public string ConcatParams(params string[] parameters) { - string concatenated = ""; - foreach (var s in parameters) { - concatenated += s; - } - return concatenated; - } - - public string ConcatAllParams(string leftmost, params string[] rest) { - string concatenated = leftmost; - foreach (var s in rest) { - concatenated += s; - } - return concatenated; - } - - public void Log() { - return; - } - } -} +using System.Collections.Generic; +using System.IO; +using NUnit.Framework; +using Orchard.Commands; +using System; +using System.Linq; + +namespace Orchard.Tests.Commands { + [TestFixture] + public class CommandsTests { + private ICommandHandler _handler; + + [SetUp] + public void Init() { + _handler = new StubCommandHandler(); + } + + private CommandContext CreateCommandContext(string commandName) { + return CreateCommandContext(commandName, new Dictionary(), new string[]{}); + } + + private CommandContext CreateCommandContext(string commandName, IDictionary switches) { + return CreateCommandContext(commandName, switches, new string[]{}); + } + + private CommandContext CreateCommandContext(string commandName, IDictionary switches, string[] args) { + var builder = new CommandHandlerDescriptorBuilder(); + + var descriptor = builder.Build(typeof(StubCommandHandler)); + + var commandDescriptor = descriptor.Commands.Single(d => string.Equals(d.Name, commandName, StringComparison.OrdinalIgnoreCase)); + + return new CommandContext { + Command = commandName, + Switches = switches, + CommandDescriptor = commandDescriptor, + Arguments = args, + Input = new StringReader(string.Empty), + Output = new StringWriter() + }; + } + + [Test] + public void TestFooCommand() { + var commandContext = CreateCommandContext("Foo"); + _handler.Execute(commandContext); + Assert.That(commandContext.Output.ToString(), Is.EqualTo("Command Foo Executed")); + } + + [Test] + public void TestNotExistingCommand() { + Assert.Throws(() => { + var commandContext = CreateCommandContext("NoSuchCommand"); + _handler.Execute(commandContext); + }); + } + + [Test] + public void TestCommandWithCustomAlias() { + var commandContext = CreateCommandContext("Bar"); + _handler.Execute(commandContext); + Assert.That(commandContext.Output.ToString(), Is.EqualTo("Hello World!")); + } + + [Test] + public void TestHelpText() { + var commandContext = CreateCommandContext("Baz"); + Assert.That(commandContext.CommandDescriptor.HelpText, Is.EqualTo("Baz help")); + } + + [Test] + public void TestEmptyHelpText() { + var commandContext = CreateCommandContext("Foo"); + Assert.That(commandContext.CommandDescriptor.HelpText, Is.EqualTo(string.Empty)); + } + + [Test] + public void TestCaseInsensitiveForCommand() { + var commandContext = CreateCommandContext("BAZ", new Dictionary { { "VERBOSE", "true" } }); + _handler.Execute(commandContext); + Assert.That(commandContext.Output.ToString(), Is.EqualTo("Command Baz Called : This was a test")); + } + + + [Test] + public void TestBooleanSwitchForCommand() { + var commandContext = CreateCommandContext("Baz", new Dictionary {{"Verbose", "true"}}); + _handler.Execute(commandContext); + Assert.That(commandContext.Output.ToString(), Is.EqualTo("Command Baz Called : This was a test")); + } + + [Test] + public void TestIntSwitchForCommand() { + var commandContext = CreateCommandContext("Baz", new Dictionary {{"Level", "2"}}); + _handler.Execute(commandContext); + Assert.That(commandContext.Output.ToString(), Is.EqualTo("Command Baz Called : Entering Level 2")); + } + + [Test] + public void TestStringSwitchForCommand() { + var commandContext = CreateCommandContext("Baz", new Dictionary {{"User", "OrchardUser"}}); + _handler.Execute(commandContext); + Assert.That(commandContext.Output.ToString(), Is.EqualTo("Command Baz Called : current user is OrchardUser")); + } + + [Test] + public void TestSwitchForCommandWithoutSupportForIt() { + var switches = new Dictionary {{"User", "OrchardUser"}}; + var commandContext = CreateCommandContext("Foo", switches); + Assert.Throws(() => _handler.Execute(commandContext)); + } + + [Test] + public void TestCommandThatDoesNotReturnAValue() { + var commandContext = CreateCommandContext("Log"); + _handler.Execute(commandContext); + Assert.That(commandContext.Output.ToString(), Is.EqualTo("")); + } + + [Test] + public void TestNotExistingSwitch() { + var switches = new Dictionary {{"ThisSwitchDoesNotExist", "Insignificant"}}; + var commandContext = CreateCommandContext("Foo", switches); + Assert.Throws(() => _handler.Execute(commandContext)); + } + + [Test] + public void TestCommandArgumentsArePassedCorrectly() { + var commandContext = CreateCommandContext("Concat", new Dictionary(), new[] {"left to ", "right"}); + _handler.Execute(commandContext); + Assert.That(commandContext.Output.ToString(), Is.EqualTo("left to right")); + } + + [Test] + public void TestCommandArgumentsArePassedCorrectlyWithAParamsParameters() { + var commandContext = CreateCommandContext("ConcatParams", new Dictionary(), new[] {"left to ", "right"}); + _handler.Execute(commandContext); + Assert.That(commandContext.Output.ToString(), Is.EqualTo("left to right")); + } + + [Test] + public void TestCommandArgumentsArePassedCorrectlyWithAParamsParameterAndNoArguments() { + var commandContext = CreateCommandContext("ConcatParams", new Dictionary()); + _handler.Execute(commandContext); + Assert.That(commandContext.Output.ToString(), Is.EqualTo("")); + } + + [Test] + public void TestCommandArgumentsArePassedCorrectlyWithNormalParametersAndAParamsParameters() { + var commandContext = CreateCommandContext("ConcatAllParams", + new Dictionary(), + new[] { "left-", "center-", "right"}); + _handler.Execute(commandContext); + Assert.That(commandContext.Output.ToString(), Is.EqualTo("left-center-right")); + } + + [Test] + public void TestCommandParamsMismatchWithoutParamsNotEnoughArguments() { + var commandContext = CreateCommandContext("Concat", new Dictionary(), new[] { "left to " }); + Assert.Throws(() => _handler.Execute(commandContext)); + } + + [Test] + public void TestCommandParamsMismatchWithoutParamsTooManyArguments() { + var commandContext = CreateCommandContext("Foo", new Dictionary(), new[] { "left to " }); + Assert.Throws(() => _handler.Execute(commandContext)); + } + + [Test] + public void TestCommandParamsMismatchWithParamsButNotEnoughArguments() { + var commandContext = CreateCommandContext("ConcatAllParams", new Dictionary()); + Assert.Throws(() => _handler.Execute(commandContext)); + } + } + + public class StubCommandHandler : DefaultOrchardCommandHandler { + [OrchardSwitch] + public bool Verbose { get; set; } + + [OrchardSwitch] + public int Level { get; set; } + + [OrchardSwitch] + public string User { get; set; } + + public string Foo() { + return "Command Foo Executed"; + } + + [CommandName("Bar")] + public string Hello() { + return "Hello World!"; + } + + [OrchardSwitches("Verbose, Level, User")] + [CommandHelp("Baz help")] + public string Baz() { + string trace = "Command Baz Called"; + + if (Verbose) { + trace += " : This was a test"; + } + + if (Level == 2) { + trace += " : Entering Level 2"; + } + + if (!String.IsNullOrEmpty(User)) { + trace += " : current user is " + User; + } + + return trace; + } + + public string Concat(string left, string right) { + return left + right; + } + + public string ConcatParams(params string[] parameters) { + string concatenated = ""; + foreach (var s in parameters) { + concatenated += s; + } + return concatenated; + } + + public string ConcatAllParams(string leftmost, params string[] rest) { + string concatenated = leftmost; + foreach (var s in rest) { + concatenated += s; + } + return concatenated; + } + + public void Log() { + return; + } + } +} diff --git a/src/Orchard.Tests/Commands/CommandManagerTests.cs b/src/Orchard.Tests/Commands/CommandManagerTests.cs index 286c92008e7..cd76eeb95a5 100644 --- a/src/Orchard.Tests/Commands/CommandManagerTests.cs +++ b/src/Orchard.Tests/Commands/CommandManagerTests.cs @@ -1,47 +1,47 @@ -using System.IO; -using Autofac; -using NUnit.Framework; -using Orchard.Commands; - -namespace Orchard.Tests.Commands { - [TestFixture] - public class CommandManagerTests { - private ICommandManager _manager; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterModule(new CommandModule()); - var container = builder.Build(); - - _manager = container.Resolve(); - } - - [Test] - public void ManagerCanRunACommand() { - var context = new CommandParameters { Arguments = new string[] { "FooBar" }, Output = new StringWriter()}; - _manager.Execute(context); - Assert.That(context.Output.ToString(), Is.EqualTo("success!")); - } - - [Test] - public void ManagerCanRunACompositeCommand() { - var context = new CommandParameters { Arguments = ("Foo Bar Bleah").Split(' '), Output = new StringWriter() }; - _manager.Execute(context); - Assert.That(context.Output.ToString(), Is.EqualTo("Bleah")); - } - - public class MyCommand : DefaultOrchardCommandHandler { - - public string FooBar() { - return "success!"; - } - - public string Foo_Bar(string bleah) { - return bleah; - } - } - } -} +using System.IO; +using Autofac; +using NUnit.Framework; +using Orchard.Commands; + +namespace Orchard.Tests.Commands { + [TestFixture] + public class CommandManagerTests { + private ICommandManager _manager; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterModule(new CommandModule()); + var container = builder.Build(); + + _manager = container.Resolve(); + } + + [Test] + public void ManagerCanRunACommand() { + var context = new CommandParameters { Arguments = new string[] { "FooBar" }, Output = new StringWriter()}; + _manager.Execute(context); + Assert.That(context.Output.ToString(), Is.EqualTo("success!")); + } + + [Test] + public void ManagerCanRunACompositeCommand() { + var context = new CommandParameters { Arguments = ("Foo Bar Bleah").Split(' '), Output = new StringWriter() }; + _manager.Execute(context); + Assert.That(context.Output.ToString(), Is.EqualTo("Bleah")); + } + + public class MyCommand : DefaultOrchardCommandHandler { + + public string FooBar() { + return "success!"; + } + + public string Foo_Bar(string bleah) { + return bleah; + } + } + } +} diff --git a/src/Orchard.Tests/ContainerTestBase.cs b/src/Orchard.Tests/ContainerTestBase.cs index 18625dbadc4..2b195ad2800 100644 --- a/src/Orchard.Tests/ContainerTestBase.cs +++ b/src/Orchard.Tests/ContainerTestBase.cs @@ -1,34 +1,34 @@ -using Autofac; -using NUnit.Framework; - -namespace Orchard.Tests { - public class ContainerTestBase { - - protected IContainer _container; - - [SetUp] - public virtual void Init() { - var builder = new ContainerBuilder(); - Register(builder); - _container = builder.Build(); - Resolve(_container); - } - -#if false - // technically more accurate, and doesn't work - [SetUp] - public virtual void Init() { - var hostBuilder = new ContainerBuilder(); - var hostContainer = hostBuilder.Build(); - var shellContainer = hostContainer.BeginLifetimeScope("shell", shellBuilder => Register(shellBuilder)); - var workContainer = shellContainer.BeginLifetimeScope("work"); - - _container = workContainer; - Resolve(_container); - } -#endif - - protected virtual void Register(ContainerBuilder builder) { } - protected virtual void Resolve(ILifetimeScope container) { } - } +using Autofac; +using NUnit.Framework; + +namespace Orchard.Tests { + public class ContainerTestBase { + + protected IContainer _container; + + [SetUp] + public virtual void Init() { + var builder = new ContainerBuilder(); + Register(builder); + _container = builder.Build(); + Resolve(_container); + } + +#if false + // technically more accurate, and doesn't work + [SetUp] + public virtual void Init() { + var hostBuilder = new ContainerBuilder(); + var hostContainer = hostBuilder.Build(); + var shellContainer = hostContainer.BeginLifetimeScope("shell", shellBuilder => Register(shellBuilder)); + var workContainer = shellContainer.BeginLifetimeScope("work"); + + _container = workContainer; + Resolve(_container); + } +#endif + + protected virtual void Register(ContainerBuilder builder) { } + protected virtual void Resolve(ILifetimeScope container) { } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/ContentManagement/ContentIdentityTests.cs b/src/Orchard.Tests/ContentManagement/ContentIdentityTests.cs index 669aad36670..4c321330283 100644 --- a/src/Orchard.Tests/ContentManagement/ContentIdentityTests.cs +++ b/src/Orchard.Tests/ContentManagement/ContentIdentityTests.cs @@ -1,70 +1,70 @@ -using System; -using NUnit.Framework; -using Orchard.ContentManagement; - -namespace Orchard.Tests.ContentManagement { - [TestFixture] - public class ContentIdentityTests { - [Test] - public void ContentIdentityParsesIdentities() { - var identity1 = new ContentIdentity("/foo=bar"); - Assert.That(identity1.Get("foo"), Is.EqualTo("bar")); - - var identity2 = new ContentIdentity("/foo="); - Assert.That(identity2.Get("foo"), Is.EqualTo(String.Empty)); - - var identity3 = new ContentIdentity("foo"); - Assert.That(identity3.Get("foo"), Is.Null); - } - - [Test] - public void ContentIdentitiesAreEncodedWhenOutput() { - var identity1 = new ContentIdentity("/foo=bar"); - Assert.That(identity1.ToString(), Is.EqualTo("/foo=bar")); - - var identity2 = new ContentIdentity(@"/foo=bar/abaz=quux\/fr\\ed=foo/yarg=yiu=foo"); - Assert.That(identity2.Get("foo"), Is.EqualTo("bar")); - Assert.That(identity2.Get("abaz"), Is.EqualTo(@"quux/fr\ed=foo")); - Assert.That(identity2.Get("yarg"), Is.EqualTo("yiu=foo")); - Assert.That(identity2.ToString(), Is.EqualTo(@"/abaz=quux\/fr\\ed=foo/foo=bar/yarg=yiu=foo")); - } - - [Test] - public void ContentIdentitiesWithKeysAddedInDifferentOrderAreEqual() { - var comparer = new ContentIdentity.ContentIdentityEqualityComparer(); - - var identity1 = new ContentIdentity("/foo=bar"); - Assert.That(comparer.Equals(identity1, new ContentIdentity(identity1.ToString()))); - - var identity2 = new ContentIdentity(@"/foo=bar/abaz=quux\/fr\\ed=foo/yarg=yiu=foo"); - Assert.That(comparer.Equals(identity2, new ContentIdentity(identity2.ToString()))); - } - - [Test] - public void ContentIdentityCanSeePartialMatchesAreEquivalent() { - var identity1 = new ContentIdentity("/bar=baz/a=b"); - var identity2 = new ContentIdentity(@"/foo=bar/bar=baz/glop=glop"); - Assert.That(ContentIdentity.ContentIdentityEqualityComparer.AreEquivalent(identity1, identity2)); - Assert.That(ContentIdentity.ContentIdentityEqualityComparer.AreEquivalent(identity2, identity1)); - } - - [Test] - public void ContentIdentityCanSeeFullMatchesAreEquivalent() { - var identity1 = new ContentIdentity(@"/foo=bar/bar=baz/glop=glop"); - var identity2 = new ContentIdentity(@"/foo=bar/bar=baz/glop=glop"); - Assert.That(ContentIdentity.ContentIdentityEqualityComparer.AreEquivalent(identity1, identity2)); - Assert.That(ContentIdentity.ContentIdentityEqualityComparer.AreEquivalent(identity2, identity1)); - } - - [Test] - public void ContentIdentityCanSeeNonMatchesAreNotEquivalent() { - var identity1 = new ContentIdentity(@"/a=b/foo=baz"); - var identity2 = new ContentIdentity(@"/foo=bar/bar=baz/glop=glop"); - Assert.IsFalse(ContentIdentity.ContentIdentityEqualityComparer.AreEquivalent(identity1, identity2)); - Assert.IsFalse(ContentIdentity.ContentIdentityEqualityComparer.AreEquivalent(identity2, identity1)); - } - } -} - - - +using System; +using NUnit.Framework; +using Orchard.ContentManagement; + +namespace Orchard.Tests.ContentManagement { + [TestFixture] + public class ContentIdentityTests { + [Test] + public void ContentIdentityParsesIdentities() { + var identity1 = new ContentIdentity("/foo=bar"); + Assert.That(identity1.Get("foo"), Is.EqualTo("bar")); + + var identity2 = new ContentIdentity("/foo="); + Assert.That(identity2.Get("foo"), Is.EqualTo(String.Empty)); + + var identity3 = new ContentIdentity("foo"); + Assert.That(identity3.Get("foo"), Is.Null); + } + + [Test] + public void ContentIdentitiesAreEncodedWhenOutput() { + var identity1 = new ContentIdentity("/foo=bar"); + Assert.That(identity1.ToString(), Is.EqualTo("/foo=bar")); + + var identity2 = new ContentIdentity(@"/foo=bar/abaz=quux\/fr\\ed=foo/yarg=yiu=foo"); + Assert.That(identity2.Get("foo"), Is.EqualTo("bar")); + Assert.That(identity2.Get("abaz"), Is.EqualTo(@"quux/fr\ed=foo")); + Assert.That(identity2.Get("yarg"), Is.EqualTo("yiu=foo")); + Assert.That(identity2.ToString(), Is.EqualTo(@"/abaz=quux\/fr\\ed=foo/foo=bar/yarg=yiu=foo")); + } + + [Test] + public void ContentIdentitiesWithKeysAddedInDifferentOrderAreEqual() { + var comparer = new ContentIdentity.ContentIdentityEqualityComparer(); + + var identity1 = new ContentIdentity("/foo=bar"); + Assert.That(comparer.Equals(identity1, new ContentIdentity(identity1.ToString()))); + + var identity2 = new ContentIdentity(@"/foo=bar/abaz=quux\/fr\\ed=foo/yarg=yiu=foo"); + Assert.That(comparer.Equals(identity2, new ContentIdentity(identity2.ToString()))); + } + + [Test] + public void ContentIdentityCanSeePartialMatchesAreEquivalent() { + var identity1 = new ContentIdentity("/bar=baz/a=b"); + var identity2 = new ContentIdentity(@"/foo=bar/bar=baz/glop=glop"); + Assert.That(ContentIdentity.ContentIdentityEqualityComparer.AreEquivalent(identity1, identity2)); + Assert.That(ContentIdentity.ContentIdentityEqualityComparer.AreEquivalent(identity2, identity1)); + } + + [Test] + public void ContentIdentityCanSeeFullMatchesAreEquivalent() { + var identity1 = new ContentIdentity(@"/foo=bar/bar=baz/glop=glop"); + var identity2 = new ContentIdentity(@"/foo=bar/bar=baz/glop=glop"); + Assert.That(ContentIdentity.ContentIdentityEqualityComparer.AreEquivalent(identity1, identity2)); + Assert.That(ContentIdentity.ContentIdentityEqualityComparer.AreEquivalent(identity2, identity1)); + } + + [Test] + public void ContentIdentityCanSeeNonMatchesAreNotEquivalent() { + var identity1 = new ContentIdentity(@"/a=b/foo=baz"); + var identity2 = new ContentIdentity(@"/foo=bar/bar=baz/glop=glop"); + Assert.IsFalse(ContentIdentity.ContentIdentityEqualityComparer.AreEquivalent(identity1, identity2)); + Assert.IsFalse(ContentIdentity.ContentIdentityEqualityComparer.AreEquivalent(identity2, identity1)); + } + } +} + + + diff --git a/src/Orchard.Tests/ContentManagement/ContentQueryTests.cs b/src/Orchard.Tests/ContentManagement/ContentQueryTests.cs index ee63f24b668..780a205f29a 100644 --- a/src/Orchard.Tests/ContentManagement/ContentQueryTests.cs +++ b/src/Orchard.Tests/ContentManagement/ContentQueryTests.cs @@ -1,615 +1,615 @@ -using System.Linq; -using Autofac; -using Moq; -using NHibernate; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.ContentManagement.MetaData; -using Orchard.Data; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Handlers; -using Orchard.ContentManagement.Records; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.Environment.Configuration; -using Orchard.Environment.Extensions; -using Orchard.Tests.ContentManagement.Handlers; -using Orchard.Tests.ContentManagement.Records; -using Orchard.Tests.ContentManagement.Models; -using Orchard.DisplayManagement.Implementation; -using Orchard.Tests.Stubs; -using NHibernate.Impl; -using Orchard.UI.PageClass; -using System.Collections.Generic; - -namespace Orchard.Tests.ContentManagement { - [TestFixture] - public class ContentQueryTests { - private IContainer _container; - private IContentManager _manager; - private ISessionFactory _sessionFactory; - private ISession _session; - private ITransactionManager _transactionManager; - - [TestFixtureSetUp] - public void InitFixture() { - var databaseFileName = System.IO.Path.GetTempFileName(); - _sessionFactory = DataUtility.CreateSessionFactory( - databaseFileName, - typeof(GammaRecord), - typeof(DeltaRecord), - typeof(EpsilonRecord), - typeof(ContentItemVersionRecord), - typeof(ContentItemRecord), - typeof(ContentTypeRecord)); - } - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - - builder.RegisterModule(new ContentModule()); - builder.RegisterType().As().SingleInstance(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataProvider = "SqlCe" }); - - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); - - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - - _session = _sessionFactory.OpenSession(); - builder.RegisterInstance(_transactionManager = new TestTransactionManager(_session)).As(); - - _session.Delete(string.Format("from {0}", typeof(GammaRecord).FullName)); - _session.Delete(string.Format("from {0}", typeof(DeltaRecord).FullName)); - _session.Delete(string.Format("from {0}", typeof(EpsilonRecord).FullName)); - _session.Delete(string.Format("from {0}", typeof(ContentItemVersionRecord).FullName)); - _session.Delete(string.Format("from {0}", typeof(ContentItemRecord).FullName)); - _session.Delete(string.Format("from {0}", typeof(ContentTypeRecord).FullName)); - _transactionManager.RequireNew(); - - _container = builder.Build(); - _manager = _container.Resolve(); - - } - - [TearDown] - public void Cleanup() { - if (_container != null) - _container.Dispose(); - } - - private List AddSampleData() { - var items = new List { - _manager.Create("alpha", init => { }), - _manager.Create("beta", init => { }), - _manager.Create("gamma", init => { init.Record.Frap = "the frap value"; }), - _manager.Create("delta", init => { init.Record.Quux = "the quux value"; }) - }; - - _transactionManager.RequireNew(); - - return items; - } - - [Test] - public void QueryInstanceIsDifferentEachTimeYouCreateOne() { - var contentManager1 = _container.Resolve(); - var query1a = contentManager1.Query(); - var query1b = contentManager1.Query(); - - var contentManager2 = _container.Resolve(); - var query2a = contentManager2.Query(); - var query2b = contentManager2.Query(); - - Assert.That(contentManager1, Is.SameAs(contentManager2)); - Assert.That(query1a, Is.SameAs(query1a)); - - Assert.That(query1a, Is.Not.SameAs(query1b)); - Assert.That(query1a, Is.Not.SameAs(query2a)); - Assert.That(query1a, Is.Not.SameAs(query2b)); - - Assert.That(query1b, Is.Not.SameAs(query2a)); - Assert.That(query1b, Is.Not.SameAs(query2b)); - - Assert.That(query2a, Is.Not.SameAs(query2b)); - } - - [Test] - public void ContentManagerPropertyIsSet() { - var contentManager = _container.Resolve(); - var query = contentManager.Query(); - Assert.That(query.ContentManager, Is.SameAs(contentManager)); - - var mockManager = new Moq.Mock().Object; - var anotherQuery = _container.Resolve(TypedParameter.From(mockManager)); - Assert.That(anotherQuery, Is.Not.SameAs(query)); - Assert.That(anotherQuery.ContentManager, Is.SameAs(mockManager)); - } - - [Test] - public void AllItemsAreReturnedByDefault() { - AddSampleData(); - - var allItems = _manager.Query().List(); - - Assert.That(allItems.Count(), Is.EqualTo(4)); - Assert.That(allItems.Count(x => x.Has()), Is.EqualTo(1)); - Assert.That(allItems.Count(x => x.Has()), Is.EqualTo(1)); - Assert.That(allItems.Count(x => x.Has()), Is.EqualTo(1)); - Assert.That(allItems.Count(x => x.Has()), Is.EqualTo(1)); - } - - [Test] - public void SpecificTypeIsReturnedWhenSpecified() { - AddSampleData(); - - var alphaBeta = _manager.Query().ForType("alpha", "beta").List(); - - Assert.That(alphaBeta.Count(), Is.EqualTo(2)); - Assert.That(alphaBeta.Count(x => x.Has()), Is.EqualTo(1)); - Assert.That(alphaBeta.Count(x => x.Has()), Is.EqualTo(1)); - Assert.That(alphaBeta.Count(x => x.Has()), Is.EqualTo(0)); - Assert.That(alphaBeta.Count(x => x.Has()), Is.EqualTo(0)); - - var gammaDelta = _manager.Query().ForType("gamma", "delta").List(); - - Assert.That(gammaDelta.Count(), Is.EqualTo(2)); - Assert.That(gammaDelta.Count(x => x.Has()), Is.EqualTo(0)); - Assert.That(gammaDelta.Count(x => x.Has()), Is.EqualTo(0)); - Assert.That(gammaDelta.Count(x => x.Has()), Is.EqualTo(1)); - Assert.That(gammaDelta.Count(x => x.Has()), Is.EqualTo(1)); - } - - [Test] - public void NoItemIsReturnedIfNoItemsSpecified() { - AddSampleData(); - - var items = _manager.Query().ForContentItems(new int[] { }).List(); - - Assert.That(items.Count(), Is.EqualTo(0)); - } - - [Test] - public void ItemsSpecifiedAreReturnedWhenSpecified() { - var samples = AddSampleData(); - - - var betaGamma = _manager.Query().ForContentItems(new int[] { samples[1].ContentItem.Id, samples[2].ContentItem.Id }).List(); - - Assert.That(betaGamma.Count(), Is.EqualTo(2)); - Assert.That(betaGamma.Count(x => x.Has()), Is.EqualTo(0)); - Assert.That(betaGamma.Count(x => x.Has()), Is.EqualTo(1)); - Assert.That(betaGamma.Count(x => x.Has()), Is.EqualTo(1)); - Assert.That(betaGamma.Count(x => x.Has()), Is.EqualTo(0)); - - var alphaDelta = _manager.Query() - .ForContentItems(new int[] { samples[0].ContentItem.Id, samples[3].ContentItem.Id }) - .List(); - - Assert.That(alphaDelta.Count(), Is.EqualTo(2)); - Assert.That(alphaDelta.Count(x => x.Has()), Is.EqualTo(1)); - Assert.That(alphaDelta.Count(x => x.Has()), Is.EqualTo(0)); - Assert.That(alphaDelta.Count(x => x.Has()), Is.EqualTo(0)); - Assert.That(alphaDelta.Count(x => x.Has()), Is.EqualTo(1)); - } - - [Test] - public void ItemsSpecifiedCanBeFiltered() { - AddSampleData(); - var oneId = _manager.Create("gamma", init => { init.Record.Frap = "one"; }).ContentItem.Id; - var twoId = _manager.Create("gamma", init => { init.Record.Frap = "two"; }).ContentItem.Id; - _manager.Create("gamma", init => { init.Record.Frap = "three"; }); - var fourId = _manager.Create("gamma", init => { init.Record.Frap = "four"; }).ContentItem.Id; - _transactionManager.RequireNew(); - - - var two = _manager.Query() - .ForContentItems(new int[] { oneId, twoId, fourId }) - .Where(x => x.Frap == "two") - .List(); - - Assert.That(two.Count(), Is.EqualTo(1)); - Assert.That(two.Count(x => x.Has()), Is.EqualTo(1)); - Assert.That(two.Count(x => x.Get().Record.Frap == "two"), Is.EqualTo(1)); - - var none = _manager.Query() - .ForContentItems(new int[] { oneId, twoId, fourId }) - .Where(x => x.Frap == "three") - .List(); - - Assert.That(none.Count(), Is.EqualTo(0)); - } - - [Test] - public void WherePredicateRestrictsResults() { - AddSampleData(); - _manager.Create("gamma", init => { init.Record.Frap = "one"; }); - _manager.Create("gamma", init => { init.Record.Frap = "two"; }); - _manager.Create("gamma", init => { init.Record.Frap = "three"; }); - _manager.Create("gamma", init => { init.Record.Frap = "four"; }); - _transactionManager.RequireNew(); - - var twoOrFour = _manager.Query() - .Where(x => x.Frap == "one" || x.Frap == "four") - .List(); - - Assert.That(twoOrFour.Count(), Is.EqualTo(2)); - Assert.That(twoOrFour.Count(x => x.Has()), Is.EqualTo(2)); - Assert.That(twoOrFour.Count(x => x.Get().Record.Frap == "one"), Is.EqualTo(1)); - Assert.That(twoOrFour.Count(x => x.Get().Record.Frap == "four"), Is.EqualTo(1)); - } - - - [Test] - public void EmptyWherePredicateRequiresRecord() { - AddSampleData(); - var gammas = _manager.Query().Join().List(); - var deltas = _manager.Query().Join().List(); - - Assert.That(gammas.Count(), Is.EqualTo(1)); - Assert.That(deltas.Count(), Is.EqualTo(1)); - Assert.That(gammas.AsPart().Single().Record.Frap, Is.EqualTo("the frap value")); - Assert.That(deltas.AsPart().Single().Record.Quux, Is.EqualTo("the quux value")); - } - - [Test] - public void OrderMaySortOnJoinedRecord() { - AddSampleData(); - _manager.Create("gamma", init => { init.Record.Frap = "one"; }); - _manager.Create("gamma", init => { init.Record.Frap = "two"; }); - _manager.Create("gamma", init => { init.Record.Frap = "three"; }); - _manager.Create("gamma", init => { init.Record.Frap = "four"; }); - _transactionManager.RequireNew(); - - var ascending = _manager.Query("gamma") - .OrderBy(x => x.Frap) - .List().ToList(); - - Assert.That(ascending.Count(), Is.EqualTo(5)); - Assert.That(ascending.First().Record.Frap, Is.EqualTo("four")); - Assert.That(ascending.Last().Record.Frap, Is.EqualTo("two")); - - _transactionManager.RequireNew(); - - var descending = _manager.Query() - .OrderByDescending(x => x.Frap) - .List().ToList(); - - Assert.That(descending.Count(), Is.EqualTo(5)); - Assert.That(descending.First().Record.Frap, Is.EqualTo("two")); - Assert.That(descending.Last().Record.Frap, Is.EqualTo("four")); - } - - [Test] - public void SkipAndTakeProvidePagination() { - AddSampleData(); - _manager.Create("gamma", init => { init.Record.Frap = "one"; }); - _manager.Create("gamma", init => { init.Record.Frap = "two"; }); - _manager.Create("gamma", init => { init.Record.Frap = "three"; }); - _manager.Create("gamma", init => { init.Record.Frap = "four"; }); - _transactionManager.RequireNew(); - - var reverseById = _manager.Query() - .OrderByDescending(x => x.Id) - .List(); - - var subset = _manager.Query() - .OrderByDescending(x => x.Id) - .Slice(2, 3); - - Assert.That(subset.Count(), Is.EqualTo(3)); - Assert.That(subset.First().Id, Is.EqualTo(reverseById.Skip(2).First().Id)); - Assert.That(subset.Skip(1).First().Id, Is.EqualTo(reverseById.Skip(3).First().Id)); - Assert.That(subset.Skip(2).First().Id, Is.EqualTo(reverseById.Skip(4).First().Id)); - - } - - [Test] - public void CountReturnsNumber() { - AddSampleData(); - - var count = _manager.Query() - .Count(); - - Assert.That(count, Is.EqualTo(4)); - } - - [Test] - public void QueryShouldJoinVersionedRecords() { - AddSampleData(); - _manager.Create("gamma", init => { - init.Record.Frap = "one"; - init.As().Record.Quad = "1"; - }); - _manager.Create("gamma", init => { - init.Record.Frap = "two"; - init.As().Record.Quad = "2"; - }); - _manager.Create("gamma", init => { - init.Record.Frap = "three"; - init.As().Record.Quad = "3"; - }); - _manager.Create("gamma", init => { - init.Record.Frap = "four"; - init.As().Record.Quad = "4"; - }); - _transactionManager.RequireNew(); - - var results = _manager.Query() - .Where(x => x.Quad == "2" || x.Quad == "3") - .OrderByDescending(x => x.Quad) - .List(); - - Assert.That(results.Count(), Is.EqualTo(2)); - Assert.That(results.First().Record, Has.Property("Quad").EqualTo("3")); - Assert.That(results.Last().Record, Has.Property("Quad").EqualTo("2")); - } - - - private void AddGammaVersions() { - var gamma1 = _manager.Create("gamma", init => { - init.As().Record.Frap = "one"; - init.As().Record.Quad = "v1"; - }); - _transactionManager.RequireNew(); - - var gamma2 = _manager.Get(gamma1.Id, VersionOptions.DraftRequired); - gamma2.As().Record.Frap = "two"; - gamma2.As().Record.Quad = "v2"; - _transactionManager.RequireNew(); - - var gamma3 = _manager.Create("gamma", init => { - init.As().Record.Frap = "three"; - init.As().Record.Quad = "v3"; - }); - _transactionManager.RequireNew(); - } - - [Test] - public void QueryShouldOnlyReturnPublishedByDefault() { - AddGammaVersions(); - - var list1 = _manager.Query() - .Where(x => x.Quad == "v1") - .List(); - - var list2 = _manager.Query() - .Where(x => x.Quad == "v2") - .List(); - - var list3 = _manager.Query() - .Where(x => x.Quad == "v3") - .List(); - - var listOne = _manager.Query() - .Where(x => x.Frap == "one") - .List(); - - var listTwo = _manager.Query() - .Where(x => x.Frap == "two") - .List(); - - var listThree = _manager.Query() - .Where(x => x.Frap == "three") - .List(); - - Assert.That(list1.Count(), Is.EqualTo(1)); - Assert.That(list2.Count(), Is.EqualTo(0)); - Assert.That(list3.Count(), Is.EqualTo(1)); - Assert.That(listOne.Count(), Is.EqualTo(0)); - Assert.That(listTwo.Count(), Is.EqualTo(1)); - Assert.That(listThree.Count(), Is.EqualTo(1)); - } - - [Test] - public void QueryForLatestShouldNotReturnEarlierVersions() { - AddGammaVersions(); - - var list1 = _manager.Query(VersionOptions.Latest) - .Where(x => x.Quad == "v1") - .List(); - - var count1 = _manager.Query(VersionOptions.Latest) - .Where(x => x.Quad == "v1") - .Count(); - - var list2 = _manager.Query(VersionOptions.Latest) - .Where(x => x.Quad == "v2") - .List(); - - var count2 = _manager.Query(VersionOptions.Latest) - .Where(x => x.Quad == "v2") - .Count(); - - var list3 = _manager.Query(VersionOptions.Latest) - .Where(x => x.Quad == "v3") - .List(); - - var count3 = _manager.Query(VersionOptions.Latest) - .Where(x => x.Quad == "v3") - .Count(); - - var listOne = _manager.Query(VersionOptions.Latest) - .Where(x => x.Frap == "one") - .List(); - - var countOne = _manager.Query(VersionOptions.Latest) - .Where(x => x.Frap == "one") - .Count(); - - var listTwo = _manager.Query(VersionOptions.Latest) - .Where(x => x.Frap == "two") - .List(); - - var countTwo = _manager.Query(VersionOptions.Latest) - .Where(x => x.Frap == "two") - .Count(); - - var listThree = _manager.Query(VersionOptions.Latest) - .Where(x => x.Frap == "three") - .List(); - - var countThree = _manager.Query(VersionOptions.Latest) - .Where(x => x.Frap == "three") - .Count(); - - Assert.That(list1.Count(), Is.EqualTo(0)); - Assert.That(count1, Is.EqualTo(0)); - Assert.That(list2.Count(), Is.EqualTo(1)); - Assert.That(count2, Is.EqualTo(1)); - Assert.That(list3.Count(), Is.EqualTo(1)); - Assert.That(count3, Is.EqualTo(1)); - Assert.That(listOne.Count(), Is.EqualTo(0)); - Assert.That(countOne, Is.EqualTo(0)); - Assert.That(listTwo.Count(), Is.EqualTo(1)); - Assert.That(countTwo, Is.EqualTo(1)); - Assert.That(listThree.Count(), Is.EqualTo(1)); - Assert.That(countThree, Is.EqualTo(1)); - } - - [Test] - public void QueryForDraftShouldOnlyReturnLatestThatIsNotPublished() { - AddGammaVersions(); - - var list1 = _manager.Query(VersionOptions.Draft) - .Where(x => x.Quad == "v1") - .List(); - - var list2 = _manager.Query(VersionOptions.Draft) - .Where(x => x.Quad == "v2") - .List(); - - var list3 = _manager.Query(VersionOptions.Draft) - .Where(x => x.Quad == "v3") - .List(); - - var listOne = _manager.Query(VersionOptions.Draft) - .Where(x => x.Frap == "one") - .List(); - - var listTwo = _manager.Query(VersionOptions.Draft) - .Where(x => x.Frap == "two") - .List(); - - var listThree = _manager.Query(VersionOptions.Draft) - .Where(x => x.Frap == "three") - .List(); - - Assert.That(list1.Count(), Is.EqualTo(0)); - Assert.That(list2.Count(), Is.EqualTo(1)); - Assert.That(list3.Count(), Is.EqualTo(0)); - Assert.That(listOne.Count(), Is.EqualTo(0)); - Assert.That(listTwo.Count(), Is.EqualTo(1)); - Assert.That(listThree.Count(), Is.EqualTo(0)); - } - - [Test] - public void QueryForAllShouldReturnMultipleQualifiedVersions() { - AddGammaVersions(); - - var list1 = _manager.Query(VersionOptions.AllVersions) - .Where(x => x.Quad == "v1") - .List(); - - var list2 = _manager.Query(VersionOptions.AllVersions) - .Where(x => x.Quad == "v2") - .List(); - - var list3 = _manager.Query(VersionOptions.AllVersions) - .Where(x => x.Quad == "v3") - .List(); - - var listOne = _manager.Query(VersionOptions.AllVersions) - .Where(x => x.Frap == "one") - .List(); - - var listTwo = _manager.Query(VersionOptions.AllVersions) - .Where(x => x.Frap == "two") - .List(); - - var listThree = _manager.Query(VersionOptions.AllVersions) - .Where(x => x.Frap == "three") - .List(); - - Assert.That(list1.Count(), Is.EqualTo(1)); - Assert.That(list2.Count(), Is.EqualTo(1)); - Assert.That(list3.Count(), Is.EqualTo(1)); - Assert.That(listOne.Count(), Is.EqualTo(0)); - Assert.That(listTwo.Count(), Is.EqualTo(2)); - Assert.That(listThree.Count(), Is.EqualTo(1)); - } - - [Test] - public void StartsWithExtensionShouldBeUsed() { - _manager.Create("gamma", init => { init.Record.Frap = "one"; }); - _manager.Create("gamma", init => { init.Record.Frap = "two"; }); - _manager.Create("gamma", init => { init.Record.Frap = "three"; }); - _manager.Create("gamma", init => { init.Record.Frap = "four"; }); - _transactionManager.RequireNew(); - - var result = _manager.Query() - .Where(x => x.Frap.StartsWith("t")) - .List(); - - Assert.That(result.Count(), Is.EqualTo(2)); - Assert.That(result.Count(x => x.Get().Record.Frap == "two"), Is.EqualTo(1)); - Assert.That(result.Count(x => x.Get().Record.Frap == "three"), Is.EqualTo(1)); - } - - [Test] - public void EndsWithExtensionShouldBeUsed() { - _manager.Create("gamma", init => { init.Record.Frap = "one"; }); - _manager.Create("gamma", init => { init.Record.Frap = "two"; }); - _manager.Create("gamma", init => { init.Record.Frap = "three"; }); - _manager.Create("gamma", init => { init.Record.Frap = "four"; }); - _transactionManager.RequireNew(); - - var result = _manager.Query() - .Where(x => x.Frap.EndsWith("e")) - .List(); - - Assert.That(result.Count(), Is.EqualTo(2)); - Assert.That(result.Count(x => x.Get().Record.Frap == "one"), Is.EqualTo(1)); - Assert.That(result.Count(x => x.Get().Record.Frap == "three"), Is.EqualTo(1)); - } - - [Test] - public void ContainsExtensionShouldBeUsed() { - _manager.Create("gamma", init => { init.Record.Frap = "one"; }); - _manager.Create("gamma", init => { init.Record.Frap = "two"; }); - _manager.Create("gamma", init => { init.Record.Frap = "three"; }); - _manager.Create("gamma", init => { init.Record.Frap = "four"; }); - _transactionManager.RequireNew(); - - var result = _manager.Query() - .Where(x => x.Frap.Contains("o")) - .List(); - - Assert.That(result.Count(), Is.EqualTo(3)); - Assert.That(result.Count(x => x.Get().Record.Frap == "one"), Is.EqualTo(1)); - Assert.That(result.Count(x => x.Get().Record.Frap == "two"), Is.EqualTo(1)); - Assert.That(result.Count(x => x.Get().Record.Frap == "four"), Is.EqualTo(1)); - } - } -} - - - +using System.Linq; +using Autofac; +using Moq; +using NHibernate; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.ContentManagement.MetaData; +using Orchard.Data; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Handlers; +using Orchard.ContentManagement.Records; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.Environment.Configuration; +using Orchard.Environment.Extensions; +using Orchard.Tests.ContentManagement.Handlers; +using Orchard.Tests.ContentManagement.Records; +using Orchard.Tests.ContentManagement.Models; +using Orchard.DisplayManagement.Implementation; +using Orchard.Tests.Stubs; +using NHibernate.Impl; +using Orchard.UI.PageClass; +using System.Collections.Generic; + +namespace Orchard.Tests.ContentManagement { + [TestFixture] + public class ContentQueryTests { + private IContainer _container; + private IContentManager _manager; + private ISessionFactory _sessionFactory; + private ISession _session; + private ITransactionManager _transactionManager; + + [TestFixtureSetUp] + public void InitFixture() { + var databaseFileName = System.IO.Path.GetTempFileName(); + _sessionFactory = DataUtility.CreateSessionFactory( + databaseFileName, + typeof(GammaRecord), + typeof(DeltaRecord), + typeof(EpsilonRecord), + typeof(ContentItemVersionRecord), + typeof(ContentItemRecord), + typeof(ContentTypeRecord)); + } + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + + builder.RegisterModule(new ContentModule()); + builder.RegisterType().As().SingleInstance(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataProvider = "SqlCe" }); + + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); + + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + + _session = _sessionFactory.OpenSession(); + builder.RegisterInstance(_transactionManager = new TestTransactionManager(_session)).As(); + + _session.Delete(string.Format("from {0}", typeof(GammaRecord).FullName)); + _session.Delete(string.Format("from {0}", typeof(DeltaRecord).FullName)); + _session.Delete(string.Format("from {0}", typeof(EpsilonRecord).FullName)); + _session.Delete(string.Format("from {0}", typeof(ContentItemVersionRecord).FullName)); + _session.Delete(string.Format("from {0}", typeof(ContentItemRecord).FullName)); + _session.Delete(string.Format("from {0}", typeof(ContentTypeRecord).FullName)); + _transactionManager.RequireNew(); + + _container = builder.Build(); + _manager = _container.Resolve(); + + } + + [TearDown] + public void Cleanup() { + if (_container != null) + _container.Dispose(); + } + + private List AddSampleData() { + var items = new List { + _manager.Create("alpha", init => { }), + _manager.Create("beta", init => { }), + _manager.Create("gamma", init => { init.Record.Frap = "the frap value"; }), + _manager.Create("delta", init => { init.Record.Quux = "the quux value"; }) + }; + + _transactionManager.RequireNew(); + + return items; + } + + [Test] + public void QueryInstanceIsDifferentEachTimeYouCreateOne() { + var contentManager1 = _container.Resolve(); + var query1a = contentManager1.Query(); + var query1b = contentManager1.Query(); + + var contentManager2 = _container.Resolve(); + var query2a = contentManager2.Query(); + var query2b = contentManager2.Query(); + + Assert.That(contentManager1, Is.SameAs(contentManager2)); + Assert.That(query1a, Is.SameAs(query1a)); + + Assert.That(query1a, Is.Not.SameAs(query1b)); + Assert.That(query1a, Is.Not.SameAs(query2a)); + Assert.That(query1a, Is.Not.SameAs(query2b)); + + Assert.That(query1b, Is.Not.SameAs(query2a)); + Assert.That(query1b, Is.Not.SameAs(query2b)); + + Assert.That(query2a, Is.Not.SameAs(query2b)); + } + + [Test] + public void ContentManagerPropertyIsSet() { + var contentManager = _container.Resolve(); + var query = contentManager.Query(); + Assert.That(query.ContentManager, Is.SameAs(contentManager)); + + var mockManager = new Moq.Mock().Object; + var anotherQuery = _container.Resolve(TypedParameter.From(mockManager)); + Assert.That(anotherQuery, Is.Not.SameAs(query)); + Assert.That(anotherQuery.ContentManager, Is.SameAs(mockManager)); + } + + [Test] + public void AllItemsAreReturnedByDefault() { + AddSampleData(); + + var allItems = _manager.Query().List(); + + Assert.That(allItems.Count(), Is.EqualTo(4)); + Assert.That(allItems.Count(x => x.Has()), Is.EqualTo(1)); + Assert.That(allItems.Count(x => x.Has()), Is.EqualTo(1)); + Assert.That(allItems.Count(x => x.Has()), Is.EqualTo(1)); + Assert.That(allItems.Count(x => x.Has()), Is.EqualTo(1)); + } + + [Test] + public void SpecificTypeIsReturnedWhenSpecified() { + AddSampleData(); + + var alphaBeta = _manager.Query().ForType("alpha", "beta").List(); + + Assert.That(alphaBeta.Count(), Is.EqualTo(2)); + Assert.That(alphaBeta.Count(x => x.Has()), Is.EqualTo(1)); + Assert.That(alphaBeta.Count(x => x.Has()), Is.EqualTo(1)); + Assert.That(alphaBeta.Count(x => x.Has()), Is.EqualTo(0)); + Assert.That(alphaBeta.Count(x => x.Has()), Is.EqualTo(0)); + + var gammaDelta = _manager.Query().ForType("gamma", "delta").List(); + + Assert.That(gammaDelta.Count(), Is.EqualTo(2)); + Assert.That(gammaDelta.Count(x => x.Has()), Is.EqualTo(0)); + Assert.That(gammaDelta.Count(x => x.Has()), Is.EqualTo(0)); + Assert.That(gammaDelta.Count(x => x.Has()), Is.EqualTo(1)); + Assert.That(gammaDelta.Count(x => x.Has()), Is.EqualTo(1)); + } + + [Test] + public void NoItemIsReturnedIfNoItemsSpecified() { + AddSampleData(); + + var items = _manager.Query().ForContentItems(new int[] { }).List(); + + Assert.That(items.Count(), Is.EqualTo(0)); + } + + [Test] + public void ItemsSpecifiedAreReturnedWhenSpecified() { + var samples = AddSampleData(); + + + var betaGamma = _manager.Query().ForContentItems(new int[] { samples[1].ContentItem.Id, samples[2].ContentItem.Id }).List(); + + Assert.That(betaGamma.Count(), Is.EqualTo(2)); + Assert.That(betaGamma.Count(x => x.Has()), Is.EqualTo(0)); + Assert.That(betaGamma.Count(x => x.Has()), Is.EqualTo(1)); + Assert.That(betaGamma.Count(x => x.Has()), Is.EqualTo(1)); + Assert.That(betaGamma.Count(x => x.Has()), Is.EqualTo(0)); + + var alphaDelta = _manager.Query() + .ForContentItems(new int[] { samples[0].ContentItem.Id, samples[3].ContentItem.Id }) + .List(); + + Assert.That(alphaDelta.Count(), Is.EqualTo(2)); + Assert.That(alphaDelta.Count(x => x.Has()), Is.EqualTo(1)); + Assert.That(alphaDelta.Count(x => x.Has()), Is.EqualTo(0)); + Assert.That(alphaDelta.Count(x => x.Has()), Is.EqualTo(0)); + Assert.That(alphaDelta.Count(x => x.Has()), Is.EqualTo(1)); + } + + [Test] + public void ItemsSpecifiedCanBeFiltered() { + AddSampleData(); + var oneId = _manager.Create("gamma", init => { init.Record.Frap = "one"; }).ContentItem.Id; + var twoId = _manager.Create("gamma", init => { init.Record.Frap = "two"; }).ContentItem.Id; + _manager.Create("gamma", init => { init.Record.Frap = "three"; }); + var fourId = _manager.Create("gamma", init => { init.Record.Frap = "four"; }).ContentItem.Id; + _transactionManager.RequireNew(); + + + var two = _manager.Query() + .ForContentItems(new int[] { oneId, twoId, fourId }) + .Where(x => x.Frap == "two") + .List(); + + Assert.That(two.Count(), Is.EqualTo(1)); + Assert.That(two.Count(x => x.Has()), Is.EqualTo(1)); + Assert.That(two.Count(x => x.Get().Record.Frap == "two"), Is.EqualTo(1)); + + var none = _manager.Query() + .ForContentItems(new int[] { oneId, twoId, fourId }) + .Where(x => x.Frap == "three") + .List(); + + Assert.That(none.Count(), Is.EqualTo(0)); + } + + [Test] + public void WherePredicateRestrictsResults() { + AddSampleData(); + _manager.Create("gamma", init => { init.Record.Frap = "one"; }); + _manager.Create("gamma", init => { init.Record.Frap = "two"; }); + _manager.Create("gamma", init => { init.Record.Frap = "three"; }); + _manager.Create("gamma", init => { init.Record.Frap = "four"; }); + _transactionManager.RequireNew(); + + var twoOrFour = _manager.Query() + .Where(x => x.Frap == "one" || x.Frap == "four") + .List(); + + Assert.That(twoOrFour.Count(), Is.EqualTo(2)); + Assert.That(twoOrFour.Count(x => x.Has()), Is.EqualTo(2)); + Assert.That(twoOrFour.Count(x => x.Get().Record.Frap == "one"), Is.EqualTo(1)); + Assert.That(twoOrFour.Count(x => x.Get().Record.Frap == "four"), Is.EqualTo(1)); + } + + + [Test] + public void EmptyWherePredicateRequiresRecord() { + AddSampleData(); + var gammas = _manager.Query().Join().List(); + var deltas = _manager.Query().Join().List(); + + Assert.That(gammas.Count(), Is.EqualTo(1)); + Assert.That(deltas.Count(), Is.EqualTo(1)); + Assert.That(gammas.AsPart().Single().Record.Frap, Is.EqualTo("the frap value")); + Assert.That(deltas.AsPart().Single().Record.Quux, Is.EqualTo("the quux value")); + } + + [Test] + public void OrderMaySortOnJoinedRecord() { + AddSampleData(); + _manager.Create("gamma", init => { init.Record.Frap = "one"; }); + _manager.Create("gamma", init => { init.Record.Frap = "two"; }); + _manager.Create("gamma", init => { init.Record.Frap = "three"; }); + _manager.Create("gamma", init => { init.Record.Frap = "four"; }); + _transactionManager.RequireNew(); + + var ascending = _manager.Query("gamma") + .OrderBy(x => x.Frap) + .List().ToList(); + + Assert.That(ascending.Count(), Is.EqualTo(5)); + Assert.That(ascending.First().Record.Frap, Is.EqualTo("four")); + Assert.That(ascending.Last().Record.Frap, Is.EqualTo("two")); + + _transactionManager.RequireNew(); + + var descending = _manager.Query() + .OrderByDescending(x => x.Frap) + .List().ToList(); + + Assert.That(descending.Count(), Is.EqualTo(5)); + Assert.That(descending.First().Record.Frap, Is.EqualTo("two")); + Assert.That(descending.Last().Record.Frap, Is.EqualTo("four")); + } + + [Test] + public void SkipAndTakeProvidePagination() { + AddSampleData(); + _manager.Create("gamma", init => { init.Record.Frap = "one"; }); + _manager.Create("gamma", init => { init.Record.Frap = "two"; }); + _manager.Create("gamma", init => { init.Record.Frap = "three"; }); + _manager.Create("gamma", init => { init.Record.Frap = "four"; }); + _transactionManager.RequireNew(); + + var reverseById = _manager.Query() + .OrderByDescending(x => x.Id) + .List(); + + var subset = _manager.Query() + .OrderByDescending(x => x.Id) + .Slice(2, 3); + + Assert.That(subset.Count(), Is.EqualTo(3)); + Assert.That(subset.First().Id, Is.EqualTo(reverseById.Skip(2).First().Id)); + Assert.That(subset.Skip(1).First().Id, Is.EqualTo(reverseById.Skip(3).First().Id)); + Assert.That(subset.Skip(2).First().Id, Is.EqualTo(reverseById.Skip(4).First().Id)); + + } + + [Test] + public void CountReturnsNumber() { + AddSampleData(); + + var count = _manager.Query() + .Count(); + + Assert.That(count, Is.EqualTo(4)); + } + + [Test] + public void QueryShouldJoinVersionedRecords() { + AddSampleData(); + _manager.Create("gamma", init => { + init.Record.Frap = "one"; + init.As().Record.Quad = "1"; + }); + _manager.Create("gamma", init => { + init.Record.Frap = "two"; + init.As().Record.Quad = "2"; + }); + _manager.Create("gamma", init => { + init.Record.Frap = "three"; + init.As().Record.Quad = "3"; + }); + _manager.Create("gamma", init => { + init.Record.Frap = "four"; + init.As().Record.Quad = "4"; + }); + _transactionManager.RequireNew(); + + var results = _manager.Query() + .Where(x => x.Quad == "2" || x.Quad == "3") + .OrderByDescending(x => x.Quad) + .List(); + + Assert.That(results.Count(), Is.EqualTo(2)); + Assert.That(results.First().Record, Has.Property("Quad").EqualTo("3")); + Assert.That(results.Last().Record, Has.Property("Quad").EqualTo("2")); + } + + + private void AddGammaVersions() { + var gamma1 = _manager.Create("gamma", init => { + init.As().Record.Frap = "one"; + init.As().Record.Quad = "v1"; + }); + _transactionManager.RequireNew(); + + var gamma2 = _manager.Get(gamma1.Id, VersionOptions.DraftRequired); + gamma2.As().Record.Frap = "two"; + gamma2.As().Record.Quad = "v2"; + _transactionManager.RequireNew(); + + var gamma3 = _manager.Create("gamma", init => { + init.As().Record.Frap = "three"; + init.As().Record.Quad = "v3"; + }); + _transactionManager.RequireNew(); + } + + [Test] + public void QueryShouldOnlyReturnPublishedByDefault() { + AddGammaVersions(); + + var list1 = _manager.Query() + .Where(x => x.Quad == "v1") + .List(); + + var list2 = _manager.Query() + .Where(x => x.Quad == "v2") + .List(); + + var list3 = _manager.Query() + .Where(x => x.Quad == "v3") + .List(); + + var listOne = _manager.Query() + .Where(x => x.Frap == "one") + .List(); + + var listTwo = _manager.Query() + .Where(x => x.Frap == "two") + .List(); + + var listThree = _manager.Query() + .Where(x => x.Frap == "three") + .List(); + + Assert.That(list1.Count(), Is.EqualTo(1)); + Assert.That(list2.Count(), Is.EqualTo(0)); + Assert.That(list3.Count(), Is.EqualTo(1)); + Assert.That(listOne.Count(), Is.EqualTo(0)); + Assert.That(listTwo.Count(), Is.EqualTo(1)); + Assert.That(listThree.Count(), Is.EqualTo(1)); + } + + [Test] + public void QueryForLatestShouldNotReturnEarlierVersions() { + AddGammaVersions(); + + var list1 = _manager.Query(VersionOptions.Latest) + .Where(x => x.Quad == "v1") + .List(); + + var count1 = _manager.Query(VersionOptions.Latest) + .Where(x => x.Quad == "v1") + .Count(); + + var list2 = _manager.Query(VersionOptions.Latest) + .Where(x => x.Quad == "v2") + .List(); + + var count2 = _manager.Query(VersionOptions.Latest) + .Where(x => x.Quad == "v2") + .Count(); + + var list3 = _manager.Query(VersionOptions.Latest) + .Where(x => x.Quad == "v3") + .List(); + + var count3 = _manager.Query(VersionOptions.Latest) + .Where(x => x.Quad == "v3") + .Count(); + + var listOne = _manager.Query(VersionOptions.Latest) + .Where(x => x.Frap == "one") + .List(); + + var countOne = _manager.Query(VersionOptions.Latest) + .Where(x => x.Frap == "one") + .Count(); + + var listTwo = _manager.Query(VersionOptions.Latest) + .Where(x => x.Frap == "two") + .List(); + + var countTwo = _manager.Query(VersionOptions.Latest) + .Where(x => x.Frap == "two") + .Count(); + + var listThree = _manager.Query(VersionOptions.Latest) + .Where(x => x.Frap == "three") + .List(); + + var countThree = _manager.Query(VersionOptions.Latest) + .Where(x => x.Frap == "three") + .Count(); + + Assert.That(list1.Count(), Is.EqualTo(0)); + Assert.That(count1, Is.EqualTo(0)); + Assert.That(list2.Count(), Is.EqualTo(1)); + Assert.That(count2, Is.EqualTo(1)); + Assert.That(list3.Count(), Is.EqualTo(1)); + Assert.That(count3, Is.EqualTo(1)); + Assert.That(listOne.Count(), Is.EqualTo(0)); + Assert.That(countOne, Is.EqualTo(0)); + Assert.That(listTwo.Count(), Is.EqualTo(1)); + Assert.That(countTwo, Is.EqualTo(1)); + Assert.That(listThree.Count(), Is.EqualTo(1)); + Assert.That(countThree, Is.EqualTo(1)); + } + + [Test] + public void QueryForDraftShouldOnlyReturnLatestThatIsNotPublished() { + AddGammaVersions(); + + var list1 = _manager.Query(VersionOptions.Draft) + .Where(x => x.Quad == "v1") + .List(); + + var list2 = _manager.Query(VersionOptions.Draft) + .Where(x => x.Quad == "v2") + .List(); + + var list3 = _manager.Query(VersionOptions.Draft) + .Where(x => x.Quad == "v3") + .List(); + + var listOne = _manager.Query(VersionOptions.Draft) + .Where(x => x.Frap == "one") + .List(); + + var listTwo = _manager.Query(VersionOptions.Draft) + .Where(x => x.Frap == "two") + .List(); + + var listThree = _manager.Query(VersionOptions.Draft) + .Where(x => x.Frap == "three") + .List(); + + Assert.That(list1.Count(), Is.EqualTo(0)); + Assert.That(list2.Count(), Is.EqualTo(1)); + Assert.That(list3.Count(), Is.EqualTo(0)); + Assert.That(listOne.Count(), Is.EqualTo(0)); + Assert.That(listTwo.Count(), Is.EqualTo(1)); + Assert.That(listThree.Count(), Is.EqualTo(0)); + } + + [Test] + public void QueryForAllShouldReturnMultipleQualifiedVersions() { + AddGammaVersions(); + + var list1 = _manager.Query(VersionOptions.AllVersions) + .Where(x => x.Quad == "v1") + .List(); + + var list2 = _manager.Query(VersionOptions.AllVersions) + .Where(x => x.Quad == "v2") + .List(); + + var list3 = _manager.Query(VersionOptions.AllVersions) + .Where(x => x.Quad == "v3") + .List(); + + var listOne = _manager.Query(VersionOptions.AllVersions) + .Where(x => x.Frap == "one") + .List(); + + var listTwo = _manager.Query(VersionOptions.AllVersions) + .Where(x => x.Frap == "two") + .List(); + + var listThree = _manager.Query(VersionOptions.AllVersions) + .Where(x => x.Frap == "three") + .List(); + + Assert.That(list1.Count(), Is.EqualTo(1)); + Assert.That(list2.Count(), Is.EqualTo(1)); + Assert.That(list3.Count(), Is.EqualTo(1)); + Assert.That(listOne.Count(), Is.EqualTo(0)); + Assert.That(listTwo.Count(), Is.EqualTo(2)); + Assert.That(listThree.Count(), Is.EqualTo(1)); + } + + [Test] + public void StartsWithExtensionShouldBeUsed() { + _manager.Create("gamma", init => { init.Record.Frap = "one"; }); + _manager.Create("gamma", init => { init.Record.Frap = "two"; }); + _manager.Create("gamma", init => { init.Record.Frap = "three"; }); + _manager.Create("gamma", init => { init.Record.Frap = "four"; }); + _transactionManager.RequireNew(); + + var result = _manager.Query() + .Where(x => x.Frap.StartsWith("t")) + .List(); + + Assert.That(result.Count(), Is.EqualTo(2)); + Assert.That(result.Count(x => x.Get().Record.Frap == "two"), Is.EqualTo(1)); + Assert.That(result.Count(x => x.Get().Record.Frap == "three"), Is.EqualTo(1)); + } + + [Test] + public void EndsWithExtensionShouldBeUsed() { + _manager.Create("gamma", init => { init.Record.Frap = "one"; }); + _manager.Create("gamma", init => { init.Record.Frap = "two"; }); + _manager.Create("gamma", init => { init.Record.Frap = "three"; }); + _manager.Create("gamma", init => { init.Record.Frap = "four"; }); + _transactionManager.RequireNew(); + + var result = _manager.Query() + .Where(x => x.Frap.EndsWith("e")) + .List(); + + Assert.That(result.Count(), Is.EqualTo(2)); + Assert.That(result.Count(x => x.Get().Record.Frap == "one"), Is.EqualTo(1)); + Assert.That(result.Count(x => x.Get().Record.Frap == "three"), Is.EqualTo(1)); + } + + [Test] + public void ContainsExtensionShouldBeUsed() { + _manager.Create("gamma", init => { init.Record.Frap = "one"; }); + _manager.Create("gamma", init => { init.Record.Frap = "two"; }); + _manager.Create("gamma", init => { init.Record.Frap = "three"; }); + _manager.Create("gamma", init => { init.Record.Frap = "four"; }); + _transactionManager.RequireNew(); + + var result = _manager.Query() + .Where(x => x.Frap.Contains("o")) + .List(); + + Assert.That(result.Count(), Is.EqualTo(3)); + Assert.That(result.Count(x => x.Get().Record.Frap == "one"), Is.EqualTo(1)); + Assert.That(result.Count(x => x.Get().Record.Frap == "two"), Is.EqualTo(1)); + Assert.That(result.Count(x => x.Get().Record.Frap == "four"), Is.EqualTo(1)); + } + } +} + + + diff --git a/src/Orchard.Tests/ContentManagement/DefaultContentManagerTests.cs b/src/Orchard.Tests/ContentManagement/DefaultContentManagerTests.cs index d199f4a9c65..5059f9cbd73 100644 --- a/src/Orchard.Tests/ContentManagement/DefaultContentManagerTests.cs +++ b/src/Orchard.Tests/ContentManagement/DefaultContentManagerTests.cs @@ -1,762 +1,762 @@ -using System; -using System.Data; -using System.Diagnostics; -using System.Linq; -using Autofac; -using Moq; -using NHibernate; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.MetaData.Builders; -using Orchard.ContentManagement.MetaData.Models; -using Orchard.Data; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Handlers; -using Orchard.ContentManagement.Records; -using Orchard.Environment.Configuration; -using Orchard.Environment.Extensions; -using Orchard.Tests.ContentManagement.Handlers; -using Orchard.Tests.ContentManagement.Records; -using Orchard.Tests.ContentManagement.Models; -using Orchard.DisplayManagement.Descriptors; -using Orchard.DisplayManagement.Implementation; -using Orchard.DisplayManagement; -using System.Collections.Generic; -using Orchard.Tests.Stubs; -using Orchard.UI.PageClass; - -namespace Orchard.Tests.ContentManagement { - [TestFixture] - public class DefaultContentManagerTests { - private const string DefaultAlphaName = "alpha"; - private const string DefaultBetaName = "beta"; - private const string DefaultGammaName = "gamma"; - private const string DefaultDeltaName = "delta"; - - private IContainer _container; - private IContentManager _manager; - private ISessionFactory _sessionFactory; - private ISession _session; - private Mock _contentDefinitionManager; - - [TestFixtureSetUp] - public void InitFixture() { - var databaseFileName = System.IO.Path.GetTempFileName(); - _sessionFactory = DataUtility.CreateSessionFactory( - databaseFileName, - typeof(ContentTypeRecord), - typeof(ContentItemRecord), - typeof(ContentItemVersionRecord), - typeof(GammaRecord), - typeof(DeltaRecord), - typeof(EpsilonRecord), - typeof(MegaRecord)); - } - - [SetUp] - public void Init() { - _contentDefinitionManager = new Mock(); - - var builder = new ContainerBuilder(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(_contentDefinitionManager.Object); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new ShellSettings {Name = ShellSettings.DefaultName, DataProvider = "SqlCe"}); - - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - - builder.RegisterType().As(); - - builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); - - _session = _sessionFactory.OpenSession(); - builder.RegisterInstance(new TestTransactionManager(_session)).As(); - - _container = builder.Build(); - _manager = _container.Resolve(); - } - - [TearDown] - public void Cleanup() { - if (_container != null) - _container.Dispose(); - } - - [Test] - public void AlphaDriverShouldWeldItsPart() { - var foo = _manager.New(DefaultAlphaName); - - Assert.That(foo.Is(), Is.True); - Assert.That(foo.As(), Is.Not.Null); - Assert.That(foo.Is(), Is.False); - Assert.That(foo.As(), Is.Null); - } - - [Test] - public void StronglyTypedNewShouldTypeCast() { - var foo = _manager.New(DefaultAlphaName); - Assert.That(foo, Is.Not.Null); - Assert.That(foo.GetType(), Is.EqualTo(typeof(AlphaPart))); - } - - [Test, ExpectedException(typeof(InvalidCastException))] - public void StronglyTypedNewShouldThrowCastExceptionIfNull() { - _manager.New(DefaultAlphaName); - } - - [Test] - public void AlphaIsFlavoredAndStyledAndBetaIsFlavoredOnly() { - var alpha = _manager.New(DefaultAlphaName); - var beta = _manager.New(DefaultBetaName); - - Assert.That(alpha.Is(), Is.True); - Assert.That(alpha.Is(), Is.True); - Assert.That(beta.Is(), Is.True); - Assert.That(beta.Is(), Is.False); - } - - [Test] - public void GetByIdShouldDetermineTypeAndLoadParts() { - var modelRecord = CreateModelRecord(DefaultAlphaName); - - var contentItem = _manager.Get(modelRecord.Id); - Assert.That(contentItem.ContentType, Is.EqualTo(DefaultAlphaName)); - Assert.That(contentItem.Id, Is.EqualTo(modelRecord.Id)); - } - - - [Test] - public void ModelPartWithRecordShouldCallRepositoryToPopulate() { - - CreateModelRecord(DefaultGammaName); - CreateModelRecord(DefaultGammaName); - var modelRecord = CreateModelRecord(DefaultGammaName); - - var model = _manager.Get(modelRecord.Id); - - //// create a gamma record - //var gamma = new GammaRecord { - // ContentItemRecord = _container.Resolve>().Get(model.Id), - // Frap = "foo" - //}; - - //_container.Resolve>().Create(gamma); - //_session.Flush(); - //_session.Clear(); - - // re-fetch from database - model = _manager.Get(modelRecord.Id); - - Assert.That(model.ContentType, Is.EqualTo(DefaultGammaName)); - Assert.That(model.Id, Is.EqualTo(modelRecord.Id)); - Assert.That(model.Is(), Is.True); - Assert.That(model.As().Record, Is.Not.Null); - Assert.That(model.As().Record.ContentItemRecord.Id, Is.EqualTo(model.Id)); - - } - - [Test] - public void CreateShouldMakeModelAndContentTypeRecords() { - var beta = _manager.New(DefaultBetaName); - _manager.Create(beta); - - var modelRecord = _container.Resolve>().Get(beta.Id); - Assert.That(modelRecord, Is.Not.Null); - Assert.That(modelRecord.ContentType.Name, Is.EqualTo(DefaultBetaName)); - } - - /// - /// Tests that the GetContentTypeDefinitions returns only the registered types. - /// - [Test] - public void GetContentTypesShouldReturnAllTypes() { - // Register the types and obtain them - ContentTypeDefinition alphaType = new ContentTypeDefinitionBuilder() - .Named(DefaultAlphaName) - .Build(); - - ContentTypeDefinition betaType = new ContentTypeDefinitionBuilder() - .Named(DefaultBetaName) - .Build(); - - ContentTypeDefinition gammaType = new ContentTypeDefinitionBuilder() - .Named(DefaultGammaName) - .Build(); - - ContentTypeDefinition deltaType = new ContentTypeDefinitionBuilder() - .Named(DefaultDeltaName) - .Build(); - - _contentDefinitionManager.Setup(contentDefinitionManager => contentDefinitionManager.ListTypeDefinitions()) - .Returns(new List { alphaType, betaType, gammaType, deltaType }); - - var types = _manager.GetContentTypeDefinitions(); - - // Validate that the expected types were obtained - Assert.That(types.Count(), Is.EqualTo(4)); - Assert.That(types, Has.Some.With.Property("Name").EqualTo(DefaultAlphaName)); - Assert.That(types, Has.Some.With.Property("Name").EqualTo(DefaultBetaName)); - Assert.That(types, Has.Some.With.Property("Name").EqualTo(DefaultGammaName)); - Assert.That(types, Has.Some.With.Property("Name").EqualTo(DefaultDeltaName)); - } - - [Test] - public void BigStringsShouldNotBeTruncated() { - var megaRepository = _container.Resolve>(); - var mega = new MegaRecord() { BigStuff = new string('x', 20000) }; - megaRepository.Create(mega); - _session.Flush(); - } - - [Test, ExpectedException] - public void StandardStringsShouldNotHaveAStandardSize() { - var megaRepository = _container.Resolve>(); - var mega = new MegaRecord() { SmallStuff = new string('x', 256) }; - megaRepository.Create(mega); - _session.Flush(); - } - - private ContentItemRecord CreateModelRecord(string contentType) { - var contentTypeRepository = _container.Resolve>(); - var contentItemRepository = _container.Resolve>(); - var contentItemVersionRepository = _container.Resolve>(); - - var modelRecord = new ContentItemRecord { ContentType = contentTypeRepository.Get(x => x.Name == contentType) }; - if (modelRecord.ContentType == null) { - modelRecord.ContentType = new ContentTypeRecord { Name = contentType }; - contentTypeRepository.Create(modelRecord.ContentType); - } - contentItemRepository.Create(modelRecord); - - contentItemVersionRepository.Create(new ContentItemVersionRecord { ContentItemRecord = modelRecord, Latest = true, Published = true, Number = 1 }); - - _session.Flush(); - _session.Clear(); - return modelRecord; - } - - [Test] - public void InitialVersionShouldBeOne() { - var gamma1 = _manager.Create(DefaultGammaName); - Assert.That(gamma1.ContentItem.Record, Is.Not.Null); - Assert.That(gamma1.ContentItem.VersionRecord, Is.Not.Null); - Assert.That(gamma1.ContentItem.Version, Is.EqualTo(1)); - Assert.That(gamma1.ContentItem.VersionRecord.Number, Is.EqualTo(1)); - - _session.Flush(); - _session.Clear(); - Trace.WriteLine("session flushed"); - - var gamma2 = _manager.Get(gamma1.ContentItem.Id); - Assert.That(gamma2.ContentItem.Record, Is.Not.Null); - Assert.That(gamma2.ContentItem.VersionRecord, Is.Not.Null); - Assert.That(gamma2.ContentItem.Version, Is.EqualTo(1)); - Assert.That(gamma2.ContentItem.VersionRecord.Number, Is.EqualTo(1)); - - // asserts results are re-acquired from db - Assert.That(gamma1, Is.Not.SameAs(gamma2)); - Assert.That(gamma1.Record, Is.Not.SameAs(gamma2.Record)); - Assert.That(gamma1.ContentItem, Is.Not.SameAs(gamma2.ContentItem)); - Assert.That(gamma1.ContentItem.Record, Is.Not.SameAs(gamma2.ContentItem.Record)); - Assert.That(gamma1.ContentItem.VersionRecord, Is.Not.SameAs(gamma2.ContentItem.VersionRecord)); - } - - [Test] - public void InitialVersionCanBeSpecifiedAndIsPublished() { - var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Number(4)); - - Assert.That(gamma1.ContentItem.Version, Is.EqualTo(4)); - Assert.That(gamma1.ContentItem.VersionRecord.Published, Is.True); - - _session.Flush(); - _session.Clear(); - } - - [Test] - public void PublishedShouldBeLatestButNotDraft() { - var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published); - - var gammaPublished = _manager.Get(gamma1.Id, VersionOptions.Published); - var gammaLatest = _manager.Get(gamma1.Id, VersionOptions.Latest); - var gammaDraft = _manager.Get(gamma1.Id, VersionOptions.Draft); - - Assert.That(gammaPublished.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id)); - Assert.That(gammaLatest.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id)); - Assert.That(gammaDraft, Is.Null); - } - - [Test] - public void DraftShouldBeLatestButNotPublished() { - var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Draft); - - var gammaPublished = _manager.Get(gamma1.Id, VersionOptions.Published); - var gammaLatest = _manager.Get(gamma1.Id, VersionOptions.Latest); - var gammaDraft = _manager.Get(gamma1.Id, VersionOptions.Draft); - - Assert.That(gammaDraft.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id)); - Assert.That(gammaLatest.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id)); - Assert.That(gammaPublished, Is.Null); - } - - - [Test] - public void CreateDraftShouldNotCreateExtraDraftCopies() { - var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Draft); - _session.Flush(); - _session.Clear(); - - var gammaDraft1 = _manager.Get(gamma1.Id, VersionOptions.Draft); - Assert.That(gammaDraft1.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id)); - Assert.That(gammaDraft1.Record.Versions, Has.Count.EqualTo(1)); - _session.Flush(); - _session.Clear(); - - var gammaDraft2 = _manager.Get(gamma1.Id, VersionOptions.DraftRequired); - Assert.That(gammaDraft2.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id)); - Assert.That(gammaDraft2.Record.Versions, Has.Count.EqualTo(1)); - _session.Flush(); - _session.Clear(); - - var gammaDraft3 = _manager.Get(gamma1.Id, VersionOptions.Draft); - Assert.That(gammaDraft3.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id)); - Assert.That(gammaDraft3.Record.Versions, Has.Count.EqualTo(1)); - _session.Flush(); - _session.Clear(); - - var gammaDraft4 = _manager.Get(gamma1.Id, VersionOptions.DraftRequired); - Assert.That(gammaDraft4.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id)); - Assert.That(gammaDraft4.Record.Versions, Has.Count.EqualTo(1)); - _session.Flush(); - _session.Clear(); - } - - [Test] - public void DraftRequiredShouldBuildNewVersionIfLatestIsAlreadyPublished() { - Trace.WriteLine("gamma1"); - var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published); - Trace.WriteLine("flush"); - _session.Flush(); - _session.Clear(); - - Trace.WriteLine("gammaDraft1"); - var gammaDraft1 = _manager.Get(gamma1.Id, VersionOptions.Draft); - Assert.That(gammaDraft1, Is.Null); - Trace.WriteLine("flush"); - _session.Flush(); - _session.Clear(); - - Trace.WriteLine("gammaDraft2"); - var gammaDraft2 = _manager.Get(gamma1.Id, VersionOptions.DraftRequired); - Assert.That(gammaDraft2.VersionRecord.Id, Is.Not.EqualTo(gamma1.VersionRecord.Id)); - Assert.That(gamma1.Version, Is.EqualTo(1)); - Assert.That(gammaDraft2.Version, Is.EqualTo(2)); - Trace.WriteLine("flush"); - _session.Flush(); - _session.Clear(); - - foreach (var x in _container.Resolve>().Fetch(x => x != null)) { - Trace.WriteLine(string.Format("{0}/{1} #{2} published:{3} latest:{4}", - x.ContentItemRecord.Id, - x.Id, - x.Number, - x.Published, - x.Latest)); - } - - Trace.WriteLine("gammaDraft3"); - var gammaDraft3 = _manager.Get(gamma1.Id, VersionOptions.Draft); - Assert.That(gammaDraft3.VersionRecord.Id, Is.EqualTo(gammaDraft2.VersionRecord.Id)); - Assert.That(gammaDraft3.Record, Is.Not.SameAs(gammaDraft2.Record)); - Assert.That(gammaDraft3.Record.Versions, Is.Not.SameAs(gammaDraft2.Record.Versions)); - - Assert.That(gammaDraft3.Record.Versions, Has.Count.EqualTo(2)); - Trace.WriteLine("flush"); - _session.Flush(); - _session.Clear(); - - Trace.WriteLine("gammaDraft4"); - var gammaDraft4 = _manager.Get(gamma1.Id, VersionOptions.DraftRequired); - Assert.That(gammaDraft4.VersionRecord.Id, Is.EqualTo(gammaDraft2.VersionRecord.Id)); - Assert.That(gammaDraft4.Record.Versions, Has.Count.EqualTo(2)); - Trace.WriteLine("flush"); - _session.Flush(); - _session.Clear(); - - Trace.WriteLine("gamma2"); - var gamma2 = _manager.Get(gamma1.Id); - Assert.That(gamma2.Record.Versions, Has.Count.EqualTo(2)); - } - - [Test] - public void UsingGetManyDraftRequiredShouldBuildNewVersionIfLatestIsAlreadyPublished() { - Trace.WriteLine("gamma1"); - var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published); - Trace.WriteLine("flush"); - _session.Flush(); - _session.Clear(); - - Trace.WriteLine("gammaDraft1"); - var gammaDraft1 = _manager.GetMany(new [] { gamma1.Id }, VersionOptions.Draft, QueryHints.Empty); - Assert.That(gammaDraft1.Count(), Is.EqualTo(0)); - Trace.WriteLine("flush"); - _session.Flush(); - _session.Clear(); - - Trace.WriteLine("gammaDraft2"); - var gammaDraft2 = _manager.GetMany(new[] { gamma1.Id }, VersionOptions.DraftRequired, QueryHints.Empty); - Assert.That(gammaDraft2.Count(), Is.EqualTo(1)); - Assert.That(gammaDraft2.First().VersionRecord.Id, Is.Not.EqualTo(gamma1.VersionRecord.Id)); - Assert.That(gamma1.Version, Is.EqualTo(1)); - Assert.That(gammaDraft2.First().Version, Is.EqualTo(2)); - Trace.WriteLine("flush"); - _session.Flush(); - _session.Clear(); - } - - - [Test] - public void UsingQueryDraftRequiredShouldBuildNewVersionIfLatestIsAlreadyPublished() { - Trace.WriteLine("gamma1"); - var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published); - gamma1.Record.Frap = "foo"; - Trace.WriteLine("flush"); - _session.Flush(); - _session.Clear(); - - Trace.WriteLine("gammaPublished"); - var gammaPublished = _manager.Query().Where(x => x.Frap == "foo").List(); - Assert.That(gammaPublished.Count(), Is.EqualTo(1)); - Trace.WriteLine("flush"); - _session.Flush(); - _session.Clear(); - - Trace.WriteLine("gammaDraft1"); - var gammaDraft1 = _manager.Query(VersionOptions.Draft).Where(x => x.Frap == "foo").List(); - Assert.That(gammaDraft1.Count(), Is.EqualTo(0)); - Trace.WriteLine("flush"); - _session.Flush(); - _session.Clear(); - - Trace.WriteLine("gammaDraft2"); - var gammaDraft2 = _manager.Query(VersionOptions.DraftRequired).Where(x => x.Frap == "foo").List(); - Assert.That(gammaDraft2.Count(), Is.EqualTo(1)); - Assert.That(gammaDraft2.First().ContentItem.VersionRecord.Id, Is.Not.EqualTo(gamma1.ContentItem.VersionRecord.Id)); - Assert.That(gamma1.ContentItem.Version, Is.EqualTo(1)); - Assert.That(gammaDraft2.First().ContentItem.Version, Is.EqualTo(2)); - Trace.WriteLine("flush"); - _session.Flush(); - _session.Clear(); - } - - [Test] - public void NonVersionedPartsAreBoundToSameRecord() { - Trace.WriteLine("gamma1"); - var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published, init => init.Record.Frap = "version one"); - Trace.WriteLine("gamma2"); - var gamma2 = _manager.Get(gamma1.ContentItem.Id, VersionOptions.DraftRequired); - Assert.That(gamma1.Record.Frap, Is.EqualTo("version one")); - Assert.That(gamma2.Record.Frap, Is.EqualTo("version one")); - gamma2.Record.Frap = "version two"; - Assert.That(gamma1.Record.Frap, Is.EqualTo("version two")); - Assert.That(gamma2.Record.Frap, Is.EqualTo("version two")); - - Trace.WriteLine("flush"); - _session.Flush(); - _session.Clear(); - - Trace.WriteLine("gamma1B"); - var gamma1B = _manager.Get(gamma1.ContentItem.Id, VersionOptions.Published); - Trace.WriteLine("gamma2B"); - var gamma2B = _manager.Get(gamma1.ContentItem.Id, VersionOptions.Draft); - Assert.That(gamma1B.Record, Is.SameAs(gamma2B.Record)); - Assert.That(gamma1B.Record.Frap, Is.EqualTo("version two")); - Assert.That(gamma2B.Record.Frap, Is.EqualTo("version two")); - Assert.That(gamma1B.ContentItem.VersionRecord.Id, Is.Not.EqualTo(gamma2B.ContentItem.VersionRecord.Id)); - - Assert.That(gamma1.ContentItem.Record, Is.Not.SameAs(gamma1B.ContentItem.Record)); - Assert.That(gamma2.ContentItem.Record, Is.Not.SameAs(gamma2B.ContentItem.Record)); - Assert.That(gamma1.ContentItem.Record, Is.SameAs(gamma2.ContentItem.Record)); - Assert.That(gamma1B.ContentItem.Record, Is.SameAs(gamma2B.ContentItem.Record)); - Assert.That(gamma1.ContentItem.VersionRecord, Is.Not.SameAs(gamma2.ContentItem.VersionRecord)); - Assert.That(gamma1B.ContentItem.VersionRecord, Is.Not.SameAs(gamma2B.ContentItem.VersionRecord)); - - Trace.WriteLine("flush"); - _session.Flush(); - } - - [Test] - public void VersionedPartsShouldBeDifferentRecordsWithClonedData() { - var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published, init => init.Record.Frap = "version one"); - var epsilon1 = gamma1.As(); - epsilon1.Record.Quad = "epsilon one"; - - var gamma2 = _manager.Get(gamma1.ContentItem.Id, VersionOptions.DraftRequired); - var epsilon2 = gamma2.As(); - - Assert.That(epsilon1.Record.Quad, Is.EqualTo("epsilon one")); - Assert.That(epsilon2.Record.Quad, Is.EqualTo("epsilon one")); - epsilon2.Record.Quad = "epsilon two"; - Assert.That(epsilon1.Record.Quad, Is.EqualTo("epsilon one")); - Assert.That(epsilon2.Record.Quad, Is.EqualTo("epsilon two")); - - - _session.Flush(); - _session.Clear(); - - var gamma1B = _manager.Get(gamma1.ContentItem.Id, VersionOptions.Published); - var epsilon1B = gamma1B.As(); - var gamma2B = _manager.Get(gamma1.ContentItem.Id, VersionOptions.Draft); - var epsilon2B = gamma2B.As(); - Assert.That(gamma1B.Record, Is.SameAs(gamma2B.Record)); - Assert.That(epsilon1B.Record, Is.Not.SameAs(epsilon2B.Record)); - Assert.That(epsilon1B.Record.Quad, Is.EqualTo("epsilon one")); - Assert.That(epsilon2B.Record.Quad, Is.EqualTo("epsilon two")); - Assert.That(epsilon1B.ContentItem.VersionRecord.Id, Is.Not.EqualTo(epsilon2B.ContentItem.VersionRecord.Id)); - - Assert.That(epsilon1.ContentItem.Record, Is.Not.SameAs(epsilon1B.ContentItem.Record)); - Assert.That(epsilon2.ContentItem.Record, Is.Not.SameAs(epsilon2B.ContentItem.Record)); - Assert.That(epsilon1.ContentItem.Record, Is.SameAs(epsilon2.ContentItem.Record)); - Assert.That(epsilon1B.ContentItem.Record, Is.SameAs(epsilon2B.ContentItem.Record)); - Assert.That(epsilon1.ContentItem.VersionRecord, Is.Not.SameAs(epsilon2.ContentItem.VersionRecord)); - Assert.That(epsilon1B.ContentItem.VersionRecord, Is.Not.SameAs(epsilon2B.ContentItem.VersionRecord)); - } - - private void Flush() { - Trace.WriteLine("flush"); - _session.Flush(); - - } - private void FlushAndClear() { - Trace.WriteLine("flush"); - _session.Flush(); - Trace.WriteLine("clear"); - _session.Clear(); - } - - [Test] - public void GetAllVersionsShouldReturnHistoryInOrder() { - Trace.WriteLine("gamma1"); - var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published); - Flush(); - - Trace.WriteLine("gamma2"); - var gamma2 = _manager.GetDraftRequired(gamma1.Id); - Trace.WriteLine("publish"); - _manager.Publish(gamma2); - Flush(); - - Trace.WriteLine("gamma3"); - var gamma3 = _manager.GetDraftRequired(gamma1.Id); - Trace.WriteLine("publish"); - _manager.Publish(gamma3); - Flush(); - - Trace.WriteLine("gamma4"); - var gamma4 = _manager.GetDraftRequired(gamma1.Id); - Trace.WriteLine("publish"); - _manager.Publish(gamma2); - FlushAndClear(); - - Assert.That(gamma1.Version, Is.EqualTo(1)); - Assert.That(gamma2.Version, Is.EqualTo(2)); - Assert.That(gamma3.Version, Is.EqualTo(3)); - Assert.That(gamma4.Version, Is.EqualTo(4)); - - var gammas = _manager.GetAllVersions(gamma1.Id).ToList(); - - Assert.That(gammas[0].Version, Is.EqualTo(1)); - Assert.That(gammas[1].Version, Is.EqualTo(2)); - Assert.That(gammas[2].Version, Is.EqualTo(3)); - Assert.That(gammas[3].Version, Is.EqualTo(4)); - } - - [Test] - public void GetWithAllVersionsOptionsReturnsLatestVersion() { - // Generate some versions - var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published); - Flush(); - - var gamma2 = _manager.GetDraftRequired(gamma1.Id); - _manager.Publish(gamma2); - Flush(); - - var gamma3 = _manager.GetDraftRequired(gamma1.Id); - _manager.Publish(gamma3); - Flush(); - - var gamma4 = _manager.GetDraftRequired(gamma1.Id); - _manager.Publish(gamma4); - FlushAndClear(); - - // Assert that the latest version is returned when using AllVersions - var gamma = _manager.Get(gamma1.Id, VersionOptions.AllVersions); - Assert.That(gamma.Version, Is.EqualTo(4)); - } - - [Test] - public void EmptyTypeDefinitionShouldBeCreatedIfNotAlreadyDefined() { - var contentItem = _manager.New("no-such-type"); - Assert.That(contentItem.ContentType, Is.EqualTo("no-such-type")); - Assert.That(contentItem.TypeDefinition, Is.Not.Null); - Assert.That(contentItem.TypeDefinition.Name, Is.EqualTo("no-such-type")); - Assert.That(contentItem.TypeDefinition.Settings.Count(), Is.EqualTo(0)); - Assert.That(contentItem.TypeDefinition.Parts.Count(), Is.EqualTo(0)); - } - - [Test] - public void RestoreCreatesNewVersionBasedOnLatestVersion() { - // Generate some versions - var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published); - Flush(); - - var gamma2 = _manager.GetDraftRequired(gamma1.Id); - _manager.Publish(gamma2); - Flush(); - - var gamma3 = _manager.GetDraftRequired(gamma1.Id); - _manager.Publish(gamma3); - Flush(); - - // Restore to version 1. - var gamma4 = _manager.Restore(gamma1, VersionOptions.Number(1)); - FlushAndClear(); - - // Assert that a new version was created and that it is the latest. - var gamma = _manager.Get(gamma1.Id, VersionOptions.Number(4)); - Assert.That(gamma.Version, Is.EqualTo(4)); - Assert.That(gamma.VersionRecord.Latest, Is.True); - } - - [Test] - public void RestoreUnsetsPreviousLatestVersion() { - // Generate some versions - var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published); - Flush(); - - var gamma2 = _manager.GetDraftRequired(gamma1.Id); - _manager.Publish(gamma2); - Flush(); - - var gamma3 = _manager.GetDraftRequired(gamma1.Id); - _manager.Publish(gamma3); - Flush(); - - // Restore to version 1. - var gamma4 = _manager.Restore(gamma1, VersionOptions.Number(1)); - FlushAndClear(); - - // Assert that version 3 is no longer the latest version. - var gamma = _manager.Get(gamma1.Id, VersionOptions.Number(3)); - Assert.That(gamma.VersionRecord.Latest, Is.False); - } - - [Test] - public void RestoreDoesNotUnpublishPreviousLatestVersion() { - // Generate some versions - var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published); - Flush(); - - var gamma2 = _manager.GetDraftRequired(gamma1.Id); - _manager.Publish(gamma2); - Flush(); - - var gamma3 = _manager.GetDraftRequired(gamma1.Id); - _manager.Publish(gamma3); - Flush(); - - // Restore to version 1. - var gamma4 = _manager.Restore(gamma1, VersionOptions.Number(1)); - FlushAndClear(); - - // Assert that version 3 is still published. - var gamma = _manager.Get(gamma1.Id, VersionOptions.Number(3)); - Assert.That(gamma.VersionRecord.Published, Is.True); - } - - [Test] - public void RestoreWithPublishUnpublishesPreviousLatestVersion() { - // Generate some versions - var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published); - Flush(); - - var gamma2 = _manager.GetDraftRequired(gamma1.Id); - _manager.Publish(gamma2); - Flush(); - - var gamma3 = _manager.GetDraftRequired(gamma1.Id); - _manager.Publish(gamma3); - Flush(); - - // Restore to version 1. - var gamma4 = _manager.Restore(gamma1, VersionOptions.Restore(1, publish: true)); - FlushAndClear(); - - // Assert that version 3 is no longer published and that version 4 is now published. - var gamma = _manager.Get(gamma1.Id, VersionOptions.Number(3)); - Assert.That(gamma.VersionRecord.Published, Is.False); - Assert.That(gamma4.VersionRecord.Published, Is.True); - } - - [Test] - public void ExistingTypeAndPartDefinitionShouldBeUsed() { - var alphaType = new ContentTypeDefinitionBuilder() - .Named(DefaultAlphaName) - .WithSetting("x", "1") - .WithPart("foo") - .WithPart("FlavoredPart", part => part.WithSetting("spin", "clockwise")) - .Build(); - - _contentDefinitionManager - .Setup(x => x.GetTypeDefinition(DefaultAlphaName)) - .Returns(alphaType); - - var contentItem = _manager.New(DefaultAlphaName); - Assert.That(contentItem.ContentType, Is.EqualTo(DefaultAlphaName)); - Assert.That(contentItem.TypeDefinition, Is.Not.Null); - Assert.That(contentItem.TypeDefinition, Is.SameAs(alphaType)); - - var flavored = contentItem.As(); - Assert.That(flavored, Is.Not.Null); - Assert.That(flavored.TypePartDefinition, Is.Not.Null); - Assert.That(flavored.TypePartDefinition.Settings["spin"], Is.EqualTo("clockwise")); - } - - [Test] - public void FieldsCanBeWeldIntoParts() { - var contentItem = _manager.New(DefaultAlphaName); - var part = contentItem.As(); - var field = new Phi(); - part.Weld(field); - Assert.That(part.Has(typeof(Phi), "Phi")); - } - - [Test] - public void PartGetReturnsFieldWithName() { - var contentItem = _manager.New(DefaultAlphaName); - var part = contentItem.As(); - var field = new Phi(); - part.Weld(field); - var phi = part.Get(typeof(Phi), "Phi"); - var phi2 = part.Get(typeof(Phi), "Phi2"); - Assert.That(phi.Name, Is.EqualTo("Phi")); - Assert.That(phi2, Is.Null); - } - } -} - +using System; +using System.Data; +using System.Diagnostics; +using System.Linq; +using Autofac; +using Moq; +using NHibernate; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Builders; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.Data; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Handlers; +using Orchard.ContentManagement.Records; +using Orchard.Environment.Configuration; +using Orchard.Environment.Extensions; +using Orchard.Tests.ContentManagement.Handlers; +using Orchard.Tests.ContentManagement.Records; +using Orchard.Tests.ContentManagement.Models; +using Orchard.DisplayManagement.Descriptors; +using Orchard.DisplayManagement.Implementation; +using Orchard.DisplayManagement; +using System.Collections.Generic; +using Orchard.Tests.Stubs; +using Orchard.UI.PageClass; + +namespace Orchard.Tests.ContentManagement { + [TestFixture] + public class DefaultContentManagerTests { + private const string DefaultAlphaName = "alpha"; + private const string DefaultBetaName = "beta"; + private const string DefaultGammaName = "gamma"; + private const string DefaultDeltaName = "delta"; + + private IContainer _container; + private IContentManager _manager; + private ISessionFactory _sessionFactory; + private ISession _session; + private Mock _contentDefinitionManager; + + [TestFixtureSetUp] + public void InitFixture() { + var databaseFileName = System.IO.Path.GetTempFileName(); + _sessionFactory = DataUtility.CreateSessionFactory( + databaseFileName, + typeof(ContentTypeRecord), + typeof(ContentItemRecord), + typeof(ContentItemVersionRecord), + typeof(GammaRecord), + typeof(DeltaRecord), + typeof(EpsilonRecord), + typeof(MegaRecord)); + } + + [SetUp] + public void Init() { + _contentDefinitionManager = new Mock(); + + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(_contentDefinitionManager.Object); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new ShellSettings {Name = ShellSettings.DefaultName, DataProvider = "SqlCe"}); + + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + + builder.RegisterType().As(); + + builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); + + _session = _sessionFactory.OpenSession(); + builder.RegisterInstance(new TestTransactionManager(_session)).As(); + + _container = builder.Build(); + _manager = _container.Resolve(); + } + + [TearDown] + public void Cleanup() { + if (_container != null) + _container.Dispose(); + } + + [Test] + public void AlphaDriverShouldWeldItsPart() { + var foo = _manager.New(DefaultAlphaName); + + Assert.That(foo.Is(), Is.True); + Assert.That(foo.As(), Is.Not.Null); + Assert.That(foo.Is(), Is.False); + Assert.That(foo.As(), Is.Null); + } + + [Test] + public void StronglyTypedNewShouldTypeCast() { + var foo = _manager.New(DefaultAlphaName); + Assert.That(foo, Is.Not.Null); + Assert.That(foo.GetType(), Is.EqualTo(typeof(AlphaPart))); + } + + [Test, ExpectedException(typeof(InvalidCastException))] + public void StronglyTypedNewShouldThrowCastExceptionIfNull() { + _manager.New(DefaultAlphaName); + } + + [Test] + public void AlphaIsFlavoredAndStyledAndBetaIsFlavoredOnly() { + var alpha = _manager.New(DefaultAlphaName); + var beta = _manager.New(DefaultBetaName); + + Assert.That(alpha.Is(), Is.True); + Assert.That(alpha.Is(), Is.True); + Assert.That(beta.Is(), Is.True); + Assert.That(beta.Is(), Is.False); + } + + [Test] + public void GetByIdShouldDetermineTypeAndLoadParts() { + var modelRecord = CreateModelRecord(DefaultAlphaName); + + var contentItem = _manager.Get(modelRecord.Id); + Assert.That(contentItem.ContentType, Is.EqualTo(DefaultAlphaName)); + Assert.That(contentItem.Id, Is.EqualTo(modelRecord.Id)); + } + + + [Test] + public void ModelPartWithRecordShouldCallRepositoryToPopulate() { + + CreateModelRecord(DefaultGammaName); + CreateModelRecord(DefaultGammaName); + var modelRecord = CreateModelRecord(DefaultGammaName); + + var model = _manager.Get(modelRecord.Id); + + //// create a gamma record + //var gamma = new GammaRecord { + // ContentItemRecord = _container.Resolve>().Get(model.Id), + // Frap = "foo" + //}; + + //_container.Resolve>().Create(gamma); + //_session.Flush(); + //_session.Clear(); + + // re-fetch from database + model = _manager.Get(modelRecord.Id); + + Assert.That(model.ContentType, Is.EqualTo(DefaultGammaName)); + Assert.That(model.Id, Is.EqualTo(modelRecord.Id)); + Assert.That(model.Is(), Is.True); + Assert.That(model.As().Record, Is.Not.Null); + Assert.That(model.As().Record.ContentItemRecord.Id, Is.EqualTo(model.Id)); + + } + + [Test] + public void CreateShouldMakeModelAndContentTypeRecords() { + var beta = _manager.New(DefaultBetaName); + _manager.Create(beta); + + var modelRecord = _container.Resolve>().Get(beta.Id); + Assert.That(modelRecord, Is.Not.Null); + Assert.That(modelRecord.ContentType.Name, Is.EqualTo(DefaultBetaName)); + } + + /// + /// Tests that the GetContentTypeDefinitions returns only the registered types. + /// + [Test] + public void GetContentTypesShouldReturnAllTypes() { + // Register the types and obtain them + ContentTypeDefinition alphaType = new ContentTypeDefinitionBuilder() + .Named(DefaultAlphaName) + .Build(); + + ContentTypeDefinition betaType = new ContentTypeDefinitionBuilder() + .Named(DefaultBetaName) + .Build(); + + ContentTypeDefinition gammaType = new ContentTypeDefinitionBuilder() + .Named(DefaultGammaName) + .Build(); + + ContentTypeDefinition deltaType = new ContentTypeDefinitionBuilder() + .Named(DefaultDeltaName) + .Build(); + + _contentDefinitionManager.Setup(contentDefinitionManager => contentDefinitionManager.ListTypeDefinitions()) + .Returns(new List { alphaType, betaType, gammaType, deltaType }); + + var types = _manager.GetContentTypeDefinitions(); + + // Validate that the expected types were obtained + Assert.That(types.Count(), Is.EqualTo(4)); + Assert.That(types, Has.Some.With.Property("Name").EqualTo(DefaultAlphaName)); + Assert.That(types, Has.Some.With.Property("Name").EqualTo(DefaultBetaName)); + Assert.That(types, Has.Some.With.Property("Name").EqualTo(DefaultGammaName)); + Assert.That(types, Has.Some.With.Property("Name").EqualTo(DefaultDeltaName)); + } + + [Test] + public void BigStringsShouldNotBeTruncated() { + var megaRepository = _container.Resolve>(); + var mega = new MegaRecord() { BigStuff = new string('x', 20000) }; + megaRepository.Create(mega); + _session.Flush(); + } + + [Test, ExpectedException] + public void StandardStringsShouldNotHaveAStandardSize() { + var megaRepository = _container.Resolve>(); + var mega = new MegaRecord() { SmallStuff = new string('x', 256) }; + megaRepository.Create(mega); + _session.Flush(); + } + + private ContentItemRecord CreateModelRecord(string contentType) { + var contentTypeRepository = _container.Resolve>(); + var contentItemRepository = _container.Resolve>(); + var contentItemVersionRepository = _container.Resolve>(); + + var modelRecord = new ContentItemRecord { ContentType = contentTypeRepository.Get(x => x.Name == contentType) }; + if (modelRecord.ContentType == null) { + modelRecord.ContentType = new ContentTypeRecord { Name = contentType }; + contentTypeRepository.Create(modelRecord.ContentType); + } + contentItemRepository.Create(modelRecord); + + contentItemVersionRepository.Create(new ContentItemVersionRecord { ContentItemRecord = modelRecord, Latest = true, Published = true, Number = 1 }); + + _session.Flush(); + _session.Clear(); + return modelRecord; + } + + [Test] + public void InitialVersionShouldBeOne() { + var gamma1 = _manager.Create(DefaultGammaName); + Assert.That(gamma1.ContentItem.Record, Is.Not.Null); + Assert.That(gamma1.ContentItem.VersionRecord, Is.Not.Null); + Assert.That(gamma1.ContentItem.Version, Is.EqualTo(1)); + Assert.That(gamma1.ContentItem.VersionRecord.Number, Is.EqualTo(1)); + + _session.Flush(); + _session.Clear(); + Trace.WriteLine("session flushed"); + + var gamma2 = _manager.Get(gamma1.ContentItem.Id); + Assert.That(gamma2.ContentItem.Record, Is.Not.Null); + Assert.That(gamma2.ContentItem.VersionRecord, Is.Not.Null); + Assert.That(gamma2.ContentItem.Version, Is.EqualTo(1)); + Assert.That(gamma2.ContentItem.VersionRecord.Number, Is.EqualTo(1)); + + // asserts results are re-acquired from db + Assert.That(gamma1, Is.Not.SameAs(gamma2)); + Assert.That(gamma1.Record, Is.Not.SameAs(gamma2.Record)); + Assert.That(gamma1.ContentItem, Is.Not.SameAs(gamma2.ContentItem)); + Assert.That(gamma1.ContentItem.Record, Is.Not.SameAs(gamma2.ContentItem.Record)); + Assert.That(gamma1.ContentItem.VersionRecord, Is.Not.SameAs(gamma2.ContentItem.VersionRecord)); + } + + [Test] + public void InitialVersionCanBeSpecifiedAndIsPublished() { + var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Number(4)); + + Assert.That(gamma1.ContentItem.Version, Is.EqualTo(4)); + Assert.That(gamma1.ContentItem.VersionRecord.Published, Is.True); + + _session.Flush(); + _session.Clear(); + } + + [Test] + public void PublishedShouldBeLatestButNotDraft() { + var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published); + + var gammaPublished = _manager.Get(gamma1.Id, VersionOptions.Published); + var gammaLatest = _manager.Get(gamma1.Id, VersionOptions.Latest); + var gammaDraft = _manager.Get(gamma1.Id, VersionOptions.Draft); + + Assert.That(gammaPublished.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id)); + Assert.That(gammaLatest.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id)); + Assert.That(gammaDraft, Is.Null); + } + + [Test] + public void DraftShouldBeLatestButNotPublished() { + var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Draft); + + var gammaPublished = _manager.Get(gamma1.Id, VersionOptions.Published); + var gammaLatest = _manager.Get(gamma1.Id, VersionOptions.Latest); + var gammaDraft = _manager.Get(gamma1.Id, VersionOptions.Draft); + + Assert.That(gammaDraft.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id)); + Assert.That(gammaLatest.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id)); + Assert.That(gammaPublished, Is.Null); + } + + + [Test] + public void CreateDraftShouldNotCreateExtraDraftCopies() { + var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Draft); + _session.Flush(); + _session.Clear(); + + var gammaDraft1 = _manager.Get(gamma1.Id, VersionOptions.Draft); + Assert.That(gammaDraft1.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id)); + Assert.That(gammaDraft1.Record.Versions, Has.Count.EqualTo(1)); + _session.Flush(); + _session.Clear(); + + var gammaDraft2 = _manager.Get(gamma1.Id, VersionOptions.DraftRequired); + Assert.That(gammaDraft2.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id)); + Assert.That(gammaDraft2.Record.Versions, Has.Count.EqualTo(1)); + _session.Flush(); + _session.Clear(); + + var gammaDraft3 = _manager.Get(gamma1.Id, VersionOptions.Draft); + Assert.That(gammaDraft3.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id)); + Assert.That(gammaDraft3.Record.Versions, Has.Count.EqualTo(1)); + _session.Flush(); + _session.Clear(); + + var gammaDraft4 = _manager.Get(gamma1.Id, VersionOptions.DraftRequired); + Assert.That(gammaDraft4.VersionRecord.Id, Is.EqualTo(gamma1.VersionRecord.Id)); + Assert.That(gammaDraft4.Record.Versions, Has.Count.EqualTo(1)); + _session.Flush(); + _session.Clear(); + } + + [Test] + public void DraftRequiredShouldBuildNewVersionIfLatestIsAlreadyPublished() { + Trace.WriteLine("gamma1"); + var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published); + Trace.WriteLine("flush"); + _session.Flush(); + _session.Clear(); + + Trace.WriteLine("gammaDraft1"); + var gammaDraft1 = _manager.Get(gamma1.Id, VersionOptions.Draft); + Assert.That(gammaDraft1, Is.Null); + Trace.WriteLine("flush"); + _session.Flush(); + _session.Clear(); + + Trace.WriteLine("gammaDraft2"); + var gammaDraft2 = _manager.Get(gamma1.Id, VersionOptions.DraftRequired); + Assert.That(gammaDraft2.VersionRecord.Id, Is.Not.EqualTo(gamma1.VersionRecord.Id)); + Assert.That(gamma1.Version, Is.EqualTo(1)); + Assert.That(gammaDraft2.Version, Is.EqualTo(2)); + Trace.WriteLine("flush"); + _session.Flush(); + _session.Clear(); + + foreach (var x in _container.Resolve>().Fetch(x => x != null)) { + Trace.WriteLine(string.Format("{0}/{1} #{2} published:{3} latest:{4}", + x.ContentItemRecord.Id, + x.Id, + x.Number, + x.Published, + x.Latest)); + } + + Trace.WriteLine("gammaDraft3"); + var gammaDraft3 = _manager.Get(gamma1.Id, VersionOptions.Draft); + Assert.That(gammaDraft3.VersionRecord.Id, Is.EqualTo(gammaDraft2.VersionRecord.Id)); + Assert.That(gammaDraft3.Record, Is.Not.SameAs(gammaDraft2.Record)); + Assert.That(gammaDraft3.Record.Versions, Is.Not.SameAs(gammaDraft2.Record.Versions)); + + Assert.That(gammaDraft3.Record.Versions, Has.Count.EqualTo(2)); + Trace.WriteLine("flush"); + _session.Flush(); + _session.Clear(); + + Trace.WriteLine("gammaDraft4"); + var gammaDraft4 = _manager.Get(gamma1.Id, VersionOptions.DraftRequired); + Assert.That(gammaDraft4.VersionRecord.Id, Is.EqualTo(gammaDraft2.VersionRecord.Id)); + Assert.That(gammaDraft4.Record.Versions, Has.Count.EqualTo(2)); + Trace.WriteLine("flush"); + _session.Flush(); + _session.Clear(); + + Trace.WriteLine("gamma2"); + var gamma2 = _manager.Get(gamma1.Id); + Assert.That(gamma2.Record.Versions, Has.Count.EqualTo(2)); + } + + [Test] + public void UsingGetManyDraftRequiredShouldBuildNewVersionIfLatestIsAlreadyPublished() { + Trace.WriteLine("gamma1"); + var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published); + Trace.WriteLine("flush"); + _session.Flush(); + _session.Clear(); + + Trace.WriteLine("gammaDraft1"); + var gammaDraft1 = _manager.GetMany(new [] { gamma1.Id }, VersionOptions.Draft, QueryHints.Empty); + Assert.That(gammaDraft1.Count(), Is.EqualTo(0)); + Trace.WriteLine("flush"); + _session.Flush(); + _session.Clear(); + + Trace.WriteLine("gammaDraft2"); + var gammaDraft2 = _manager.GetMany(new[] { gamma1.Id }, VersionOptions.DraftRequired, QueryHints.Empty); + Assert.That(gammaDraft2.Count(), Is.EqualTo(1)); + Assert.That(gammaDraft2.First().VersionRecord.Id, Is.Not.EqualTo(gamma1.VersionRecord.Id)); + Assert.That(gamma1.Version, Is.EqualTo(1)); + Assert.That(gammaDraft2.First().Version, Is.EqualTo(2)); + Trace.WriteLine("flush"); + _session.Flush(); + _session.Clear(); + } + + + [Test] + public void UsingQueryDraftRequiredShouldBuildNewVersionIfLatestIsAlreadyPublished() { + Trace.WriteLine("gamma1"); + var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published); + gamma1.Record.Frap = "foo"; + Trace.WriteLine("flush"); + _session.Flush(); + _session.Clear(); + + Trace.WriteLine("gammaPublished"); + var gammaPublished = _manager.Query().Where(x => x.Frap == "foo").List(); + Assert.That(gammaPublished.Count(), Is.EqualTo(1)); + Trace.WriteLine("flush"); + _session.Flush(); + _session.Clear(); + + Trace.WriteLine("gammaDraft1"); + var gammaDraft1 = _manager.Query(VersionOptions.Draft).Where(x => x.Frap == "foo").List(); + Assert.That(gammaDraft1.Count(), Is.EqualTo(0)); + Trace.WriteLine("flush"); + _session.Flush(); + _session.Clear(); + + Trace.WriteLine("gammaDraft2"); + var gammaDraft2 = _manager.Query(VersionOptions.DraftRequired).Where(x => x.Frap == "foo").List(); + Assert.That(gammaDraft2.Count(), Is.EqualTo(1)); + Assert.That(gammaDraft2.First().ContentItem.VersionRecord.Id, Is.Not.EqualTo(gamma1.ContentItem.VersionRecord.Id)); + Assert.That(gamma1.ContentItem.Version, Is.EqualTo(1)); + Assert.That(gammaDraft2.First().ContentItem.Version, Is.EqualTo(2)); + Trace.WriteLine("flush"); + _session.Flush(); + _session.Clear(); + } + + [Test] + public void NonVersionedPartsAreBoundToSameRecord() { + Trace.WriteLine("gamma1"); + var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published, init => init.Record.Frap = "version one"); + Trace.WriteLine("gamma2"); + var gamma2 = _manager.Get(gamma1.ContentItem.Id, VersionOptions.DraftRequired); + Assert.That(gamma1.Record.Frap, Is.EqualTo("version one")); + Assert.That(gamma2.Record.Frap, Is.EqualTo("version one")); + gamma2.Record.Frap = "version two"; + Assert.That(gamma1.Record.Frap, Is.EqualTo("version two")); + Assert.That(gamma2.Record.Frap, Is.EqualTo("version two")); + + Trace.WriteLine("flush"); + _session.Flush(); + _session.Clear(); + + Trace.WriteLine("gamma1B"); + var gamma1B = _manager.Get(gamma1.ContentItem.Id, VersionOptions.Published); + Trace.WriteLine("gamma2B"); + var gamma2B = _manager.Get(gamma1.ContentItem.Id, VersionOptions.Draft); + Assert.That(gamma1B.Record, Is.SameAs(gamma2B.Record)); + Assert.That(gamma1B.Record.Frap, Is.EqualTo("version two")); + Assert.That(gamma2B.Record.Frap, Is.EqualTo("version two")); + Assert.That(gamma1B.ContentItem.VersionRecord.Id, Is.Not.EqualTo(gamma2B.ContentItem.VersionRecord.Id)); + + Assert.That(gamma1.ContentItem.Record, Is.Not.SameAs(gamma1B.ContentItem.Record)); + Assert.That(gamma2.ContentItem.Record, Is.Not.SameAs(gamma2B.ContentItem.Record)); + Assert.That(gamma1.ContentItem.Record, Is.SameAs(gamma2.ContentItem.Record)); + Assert.That(gamma1B.ContentItem.Record, Is.SameAs(gamma2B.ContentItem.Record)); + Assert.That(gamma1.ContentItem.VersionRecord, Is.Not.SameAs(gamma2.ContentItem.VersionRecord)); + Assert.That(gamma1B.ContentItem.VersionRecord, Is.Not.SameAs(gamma2B.ContentItem.VersionRecord)); + + Trace.WriteLine("flush"); + _session.Flush(); + } + + [Test] + public void VersionedPartsShouldBeDifferentRecordsWithClonedData() { + var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published, init => init.Record.Frap = "version one"); + var epsilon1 = gamma1.As(); + epsilon1.Record.Quad = "epsilon one"; + + var gamma2 = _manager.Get(gamma1.ContentItem.Id, VersionOptions.DraftRequired); + var epsilon2 = gamma2.As(); + + Assert.That(epsilon1.Record.Quad, Is.EqualTo("epsilon one")); + Assert.That(epsilon2.Record.Quad, Is.EqualTo("epsilon one")); + epsilon2.Record.Quad = "epsilon two"; + Assert.That(epsilon1.Record.Quad, Is.EqualTo("epsilon one")); + Assert.That(epsilon2.Record.Quad, Is.EqualTo("epsilon two")); + + + _session.Flush(); + _session.Clear(); + + var gamma1B = _manager.Get(gamma1.ContentItem.Id, VersionOptions.Published); + var epsilon1B = gamma1B.As(); + var gamma2B = _manager.Get(gamma1.ContentItem.Id, VersionOptions.Draft); + var epsilon2B = gamma2B.As(); + Assert.That(gamma1B.Record, Is.SameAs(gamma2B.Record)); + Assert.That(epsilon1B.Record, Is.Not.SameAs(epsilon2B.Record)); + Assert.That(epsilon1B.Record.Quad, Is.EqualTo("epsilon one")); + Assert.That(epsilon2B.Record.Quad, Is.EqualTo("epsilon two")); + Assert.That(epsilon1B.ContentItem.VersionRecord.Id, Is.Not.EqualTo(epsilon2B.ContentItem.VersionRecord.Id)); + + Assert.That(epsilon1.ContentItem.Record, Is.Not.SameAs(epsilon1B.ContentItem.Record)); + Assert.That(epsilon2.ContentItem.Record, Is.Not.SameAs(epsilon2B.ContentItem.Record)); + Assert.That(epsilon1.ContentItem.Record, Is.SameAs(epsilon2.ContentItem.Record)); + Assert.That(epsilon1B.ContentItem.Record, Is.SameAs(epsilon2B.ContentItem.Record)); + Assert.That(epsilon1.ContentItem.VersionRecord, Is.Not.SameAs(epsilon2.ContentItem.VersionRecord)); + Assert.That(epsilon1B.ContentItem.VersionRecord, Is.Not.SameAs(epsilon2B.ContentItem.VersionRecord)); + } + + private void Flush() { + Trace.WriteLine("flush"); + _session.Flush(); + + } + private void FlushAndClear() { + Trace.WriteLine("flush"); + _session.Flush(); + Trace.WriteLine("clear"); + _session.Clear(); + } + + [Test] + public void GetAllVersionsShouldReturnHistoryInOrder() { + Trace.WriteLine("gamma1"); + var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published); + Flush(); + + Trace.WriteLine("gamma2"); + var gamma2 = _manager.GetDraftRequired(gamma1.Id); + Trace.WriteLine("publish"); + _manager.Publish(gamma2); + Flush(); + + Trace.WriteLine("gamma3"); + var gamma3 = _manager.GetDraftRequired(gamma1.Id); + Trace.WriteLine("publish"); + _manager.Publish(gamma3); + Flush(); + + Trace.WriteLine("gamma4"); + var gamma4 = _manager.GetDraftRequired(gamma1.Id); + Trace.WriteLine("publish"); + _manager.Publish(gamma2); + FlushAndClear(); + + Assert.That(gamma1.Version, Is.EqualTo(1)); + Assert.That(gamma2.Version, Is.EqualTo(2)); + Assert.That(gamma3.Version, Is.EqualTo(3)); + Assert.That(gamma4.Version, Is.EqualTo(4)); + + var gammas = _manager.GetAllVersions(gamma1.Id).ToList(); + + Assert.That(gammas[0].Version, Is.EqualTo(1)); + Assert.That(gammas[1].Version, Is.EqualTo(2)); + Assert.That(gammas[2].Version, Is.EqualTo(3)); + Assert.That(gammas[3].Version, Is.EqualTo(4)); + } + + [Test] + public void GetWithAllVersionsOptionsReturnsLatestVersion() { + // Generate some versions + var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published); + Flush(); + + var gamma2 = _manager.GetDraftRequired(gamma1.Id); + _manager.Publish(gamma2); + Flush(); + + var gamma3 = _manager.GetDraftRequired(gamma1.Id); + _manager.Publish(gamma3); + Flush(); + + var gamma4 = _manager.GetDraftRequired(gamma1.Id); + _manager.Publish(gamma4); + FlushAndClear(); + + // Assert that the latest version is returned when using AllVersions + var gamma = _manager.Get(gamma1.Id, VersionOptions.AllVersions); + Assert.That(gamma.Version, Is.EqualTo(4)); + } + + [Test] + public void EmptyTypeDefinitionShouldBeCreatedIfNotAlreadyDefined() { + var contentItem = _manager.New("no-such-type"); + Assert.That(contentItem.ContentType, Is.EqualTo("no-such-type")); + Assert.That(contentItem.TypeDefinition, Is.Not.Null); + Assert.That(contentItem.TypeDefinition.Name, Is.EqualTo("no-such-type")); + Assert.That(contentItem.TypeDefinition.Settings.Count(), Is.EqualTo(0)); + Assert.That(contentItem.TypeDefinition.Parts.Count(), Is.EqualTo(0)); + } + + [Test] + public void RestoreCreatesNewVersionBasedOnLatestVersion() { + // Generate some versions + var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published); + Flush(); + + var gamma2 = _manager.GetDraftRequired(gamma1.Id); + _manager.Publish(gamma2); + Flush(); + + var gamma3 = _manager.GetDraftRequired(gamma1.Id); + _manager.Publish(gamma3); + Flush(); + + // Restore to version 1. + var gamma4 = _manager.Restore(gamma1, VersionOptions.Number(1)); + FlushAndClear(); + + // Assert that a new version was created and that it is the latest. + var gamma = _manager.Get(gamma1.Id, VersionOptions.Number(4)); + Assert.That(gamma.Version, Is.EqualTo(4)); + Assert.That(gamma.VersionRecord.Latest, Is.True); + } + + [Test] + public void RestoreUnsetsPreviousLatestVersion() { + // Generate some versions + var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published); + Flush(); + + var gamma2 = _manager.GetDraftRequired(gamma1.Id); + _manager.Publish(gamma2); + Flush(); + + var gamma3 = _manager.GetDraftRequired(gamma1.Id); + _manager.Publish(gamma3); + Flush(); + + // Restore to version 1. + var gamma4 = _manager.Restore(gamma1, VersionOptions.Number(1)); + FlushAndClear(); + + // Assert that version 3 is no longer the latest version. + var gamma = _manager.Get(gamma1.Id, VersionOptions.Number(3)); + Assert.That(gamma.VersionRecord.Latest, Is.False); + } + + [Test] + public void RestoreDoesNotUnpublishPreviousLatestVersion() { + // Generate some versions + var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published); + Flush(); + + var gamma2 = _manager.GetDraftRequired(gamma1.Id); + _manager.Publish(gamma2); + Flush(); + + var gamma3 = _manager.GetDraftRequired(gamma1.Id); + _manager.Publish(gamma3); + Flush(); + + // Restore to version 1. + var gamma4 = _manager.Restore(gamma1, VersionOptions.Number(1)); + FlushAndClear(); + + // Assert that version 3 is still published. + var gamma = _manager.Get(gamma1.Id, VersionOptions.Number(3)); + Assert.That(gamma.VersionRecord.Published, Is.True); + } + + [Test] + public void RestoreWithPublishUnpublishesPreviousLatestVersion() { + // Generate some versions + var gamma1 = _manager.Create(DefaultGammaName, VersionOptions.Published); + Flush(); + + var gamma2 = _manager.GetDraftRequired(gamma1.Id); + _manager.Publish(gamma2); + Flush(); + + var gamma3 = _manager.GetDraftRequired(gamma1.Id); + _manager.Publish(gamma3); + Flush(); + + // Restore to version 1. + var gamma4 = _manager.Restore(gamma1, VersionOptions.Restore(1, publish: true)); + FlushAndClear(); + + // Assert that version 3 is no longer published and that version 4 is now published. + var gamma = _manager.Get(gamma1.Id, VersionOptions.Number(3)); + Assert.That(gamma.VersionRecord.Published, Is.False); + Assert.That(gamma4.VersionRecord.Published, Is.True); + } + + [Test] + public void ExistingTypeAndPartDefinitionShouldBeUsed() { + var alphaType = new ContentTypeDefinitionBuilder() + .Named(DefaultAlphaName) + .WithSetting("x", "1") + .WithPart("foo") + .WithPart("FlavoredPart", part => part.WithSetting("spin", "clockwise")) + .Build(); + + _contentDefinitionManager + .Setup(x => x.GetTypeDefinition(DefaultAlphaName)) + .Returns(alphaType); + + var contentItem = _manager.New(DefaultAlphaName); + Assert.That(contentItem.ContentType, Is.EqualTo(DefaultAlphaName)); + Assert.That(contentItem.TypeDefinition, Is.Not.Null); + Assert.That(contentItem.TypeDefinition, Is.SameAs(alphaType)); + + var flavored = contentItem.As(); + Assert.That(flavored, Is.Not.Null); + Assert.That(flavored.TypePartDefinition, Is.Not.Null); + Assert.That(flavored.TypePartDefinition.Settings["spin"], Is.EqualTo("clockwise")); + } + + [Test] + public void FieldsCanBeWeldIntoParts() { + var contentItem = _manager.New(DefaultAlphaName); + var part = contentItem.As(); + var field = new Phi(); + part.Weld(field); + Assert.That(part.Has(typeof(Phi), "Phi")); + } + + [Test] + public void PartGetReturnsFieldWithName() { + var contentItem = _manager.New(DefaultAlphaName); + var part = contentItem.As(); + var field = new Phi(); + part.Weld(field); + var phi = part.Get(typeof(Phi), "Phi"); + var phi2 = part.Get(typeof(Phi), "Phi2"); + Assert.That(phi.Name, Is.EqualTo("Phi")); + Assert.That(phi2, Is.Null); + } + } +} + diff --git a/src/Orchard.Tests/ContentManagement/Drivers/FieldStorage/FieldStorageProviderSelectorTests.cs b/src/Orchard.Tests/ContentManagement/Drivers/FieldStorage/FieldStorageProviderSelectorTests.cs index d7d1e027621..2cd4e554dd7 100644 --- a/src/Orchard.Tests/ContentManagement/Drivers/FieldStorage/FieldStorageProviderSelectorTests.cs +++ b/src/Orchard.Tests/ContentManagement/Drivers/FieldStorage/FieldStorageProviderSelectorTests.cs @@ -1,81 +1,81 @@ -using System; -using System.Linq; -using Autofac; -using NUnit.Framework; -using Orchard.ContentManagement; -using Orchard.ContentManagement.FieldStorage; -using Orchard.ContentManagement.FieldStorage.InfosetStorage; -using Orchard.ContentManagement.MetaData.Builders; -using Orchard.ContentManagement.MetaData.Models; - -namespace Orchard.Tests.ContentManagement.Drivers.FieldStorage { - [TestFixture] - public class FieldStorageProviderSelectorTests { - private IContainer _container; - private IFieldStorageProviderSelector _selector; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - _container = builder.Build(); - _selector = _container.Resolve(); - } - - class TestProvider : IFieldStorageProvider { - public string ProviderName { - get { return "TestProvName"; } - } - - public IFieldStorage BindStorage(ContentPart contentPart, ContentPartFieldDefinition partFieldDefinition) { - throw new NotImplementedException(); - } - - } - - [Test] - public void ShouldReturnProviderByName() { - var part1Definition = new ContentPartDefinitionBuilder() - .WithField("Hello", fb => fb.OfType("Text").WithSetting("Storage", "TestProvName")) - .Build(); - var part2Definition = new ContentPartDefinitionBuilder() - .WithField("World", fb => fb.OfType("Text").WithSetting("Storage", "Infoset")) - .Build(); - - var provider1 = _selector.GetProvider(part1Definition.Fields.Single()); - var provider2 = _selector.GetProvider(part2Definition.Fields.Single()); - - Assert.That(provider1.ProviderName, Is.EqualTo("TestProvName")); - Assert.That(provider2.ProviderName, Is.EqualTo("Infoset")); - } - - [Test] - public void ShouldReturnInfosetWhenNullEmptyMissingOrInvalid() { - var part1Definition = new ContentPartDefinitionBuilder() - .WithField("Hello", fb => fb.OfType("Text").WithSetting("Storage", null)) - .Build(); - var part2Definition = new ContentPartDefinitionBuilder() - .WithField("World", fb => fb.OfType("Text").WithSetting("Storage", "")) - .Build(); - var part3Definition = new ContentPartDefinitionBuilder() - .WithField("World", fb => fb.OfType("Text")) - .Build(); - var part4Definition = new ContentPartDefinitionBuilder() - .WithField("World", fb => fb.OfType("Text").WithSetting("Storage", "NoSuchName")) - .Build(); - - var provider1 = _selector.GetProvider(part1Definition.Fields.Single()); - var provider2 = _selector.GetProvider(part2Definition.Fields.Single()); - var provider3 = _selector.GetProvider(part3Definition.Fields.Single()); - var provider4 = _selector.GetProvider(part4Definition.Fields.Single()); - - Assert.That(provider1.ProviderName, Is.EqualTo("Infoset")); - Assert.That(provider2.ProviderName, Is.EqualTo("Infoset")); - Assert.That(provider3.ProviderName, Is.EqualTo("Infoset")); - Assert.That(provider4.ProviderName, Is.EqualTo("Infoset")); - } - } -} +using System; +using System.Linq; +using Autofac; +using NUnit.Framework; +using Orchard.ContentManagement; +using Orchard.ContentManagement.FieldStorage; +using Orchard.ContentManagement.FieldStorage.InfosetStorage; +using Orchard.ContentManagement.MetaData.Builders; +using Orchard.ContentManagement.MetaData.Models; + +namespace Orchard.Tests.ContentManagement.Drivers.FieldStorage { + [TestFixture] + public class FieldStorageProviderSelectorTests { + private IContainer _container; + private IFieldStorageProviderSelector _selector; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + _container = builder.Build(); + _selector = _container.Resolve(); + } + + class TestProvider : IFieldStorageProvider { + public string ProviderName { + get { return "TestProvName"; } + } + + public IFieldStorage BindStorage(ContentPart contentPart, ContentPartFieldDefinition partFieldDefinition) { + throw new NotImplementedException(); + } + + } + + [Test] + public void ShouldReturnProviderByName() { + var part1Definition = new ContentPartDefinitionBuilder() + .WithField("Hello", fb => fb.OfType("Text").WithSetting("Storage", "TestProvName")) + .Build(); + var part2Definition = new ContentPartDefinitionBuilder() + .WithField("World", fb => fb.OfType("Text").WithSetting("Storage", "Infoset")) + .Build(); + + var provider1 = _selector.GetProvider(part1Definition.Fields.Single()); + var provider2 = _selector.GetProvider(part2Definition.Fields.Single()); + + Assert.That(provider1.ProviderName, Is.EqualTo("TestProvName")); + Assert.That(provider2.ProviderName, Is.EqualTo("Infoset")); + } + + [Test] + public void ShouldReturnInfosetWhenNullEmptyMissingOrInvalid() { + var part1Definition = new ContentPartDefinitionBuilder() + .WithField("Hello", fb => fb.OfType("Text").WithSetting("Storage", null)) + .Build(); + var part2Definition = new ContentPartDefinitionBuilder() + .WithField("World", fb => fb.OfType("Text").WithSetting("Storage", "")) + .Build(); + var part3Definition = new ContentPartDefinitionBuilder() + .WithField("World", fb => fb.OfType("Text")) + .Build(); + var part4Definition = new ContentPartDefinitionBuilder() + .WithField("World", fb => fb.OfType("Text").WithSetting("Storage", "NoSuchName")) + .Build(); + + var provider1 = _selector.GetProvider(part1Definition.Fields.Single()); + var provider2 = _selector.GetProvider(part2Definition.Fields.Single()); + var provider3 = _selector.GetProvider(part3Definition.Fields.Single()); + var provider4 = _selector.GetProvider(part4Definition.Fields.Single()); + + Assert.That(provider1.ProviderName, Is.EqualTo("Infoset")); + Assert.That(provider2.ProviderName, Is.EqualTo("Infoset")); + Assert.That(provider3.ProviderName, Is.EqualTo("Infoset")); + Assert.That(provider4.ProviderName, Is.EqualTo("Infoset")); + } + } +} diff --git a/src/Orchard.Tests/ContentManagement/Drivers/FieldStorage/InfosetFieldStorageProviderTests.cs b/src/Orchard.Tests/ContentManagement/Drivers/FieldStorage/InfosetFieldStorageProviderTests.cs index f6b95d61741..b4f14bae08a 100644 --- a/src/Orchard.Tests/ContentManagement/Drivers/FieldStorage/InfosetFieldStorageProviderTests.cs +++ b/src/Orchard.Tests/ContentManagement/Drivers/FieldStorage/InfosetFieldStorageProviderTests.cs @@ -1,126 +1,126 @@ -using System.Linq; -using Autofac; -using NUnit.Framework; -using Orchard.ContentManagement; -using Orchard.ContentManagement.FieldStorage; -using Orchard.ContentManagement.FieldStorage.InfosetStorage; -using Orchard.ContentManagement.MetaData.Builders; -using Orchard.ContentManagement.MetaData.Models; -using Orchard.ContentManagement.Records; - -namespace Orchard.Tests.ContentManagement.Drivers.FieldStorage { - public class InfosetFieldStorageProviderTests { - private IContainer _container; - private IFieldStorageProvider _provider; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - builder.RegisterType().As(); - - _container = builder.Build(); - _provider = _container.Resolve(); - } - - private ContentPartDefinition FooPartDefinition() { - return new ContentPartDefinitionBuilder() - .Named("Foo") - .WithField("Bar") - .Build(); - } - - private ContentPart CreateContentItemPart() { - var partDefinition = FooPartDefinition(); - var typeDefinition = new ContentTypeDefinitionBuilder() - .WithPart(partDefinition, part => { }) - .Build(); - var contentItem = new ContentItem { - VersionRecord = new ContentItemVersionRecord { - ContentItemRecord = new ContentItemRecord() - } - }; - var contentPart = new ContentPart { - TypePartDefinition = typeDefinition.Parts.Single() - }; - contentItem.Weld(contentPart); - contentItem.Weld(new InfosetPart { - Infoset = contentItem.Record.Infoset, - VersionInfoset = contentItem.VersionRecord.Infoset - }); - return contentPart; - } - - [Test] - public void BoundStorageIsNotNull() { - var part = CreateContentItemPart(); - var storage = _provider.BindStorage(part, part.PartDefinition.Fields.Single()); - Assert.That(storage, Is.Not.Null); - } - - [Test] - public void GettingUnsetNamedAndUnnamedValueIsSafeAndNull() { - var part = CreateContentItemPart(); - var storage = _provider.BindStorage(part, part.PartDefinition.Fields.Single()); - Assert.That(storage.Get(null), Is.Null); - Assert.That(storage.Get("value"), Is.Null); - Assert.That(storage.Get("This is a test"), Is.Null); - } - - [Test] - public void ValueThatIsSetIsAlsoReturned() { - var part = CreateContentItemPart(); - var storage = _provider.BindStorage(part, part.PartDefinition.Fields.Single()); - - Assert.That(storage.Get("alpha"), Is.Null); - storage.Set("alpha", "one"); - Assert.That(storage.Get("alpha"), Is.Not.Null); - Assert.That(storage.Get("alpha"), Is.EqualTo("one")); - } - - [Test] - public void NullAndEmptyValueNamesAreTreatedTheSame() { - var part = CreateContentItemPart(); - var storage = _provider.BindStorage(part, part.PartDefinition.Fields.Single()); - - Assert.That(storage.Get(null), Is.Null); - Assert.That(storage.Get(""), Is.Null); - storage.Set(null, "one"); - Assert.That(storage.Get(null), Is.EqualTo("one")); - Assert.That(storage.Get(""), Is.EqualTo("one")); - storage.Set(null, "two"); - Assert.That(storage.Get(null), Is.EqualTo("two")); - Assert.That(storage.Get(""), Is.EqualTo("two")); - } - - [Test] - public void RecordDataPropertyReflectsChangesToFields() { - var part = CreateContentItemPart(); - var storage = _provider.BindStorage(part, part.PartDefinition.Fields.Single()); - - storage.Set(null, "one"); - storage.Set("alpha", "two"); - - Assert.That(part.ContentItem.VersionRecord.Data, Is.EqualTo("one")); - } - - [Test] - public void ChangingRecordDataHasImmediateEffectOnStorageAccessors() { - var part = CreateContentItemPart(); - var storage = _provider.BindStorage(part, part.PartDefinition.Fields.Single()); - - storage.Set(null, "one"); - storage.Set("alpha", "two"); - - Assert.That(part.ContentItem.VersionRecord.Data, Is.EqualTo("one")); - part.ContentItem.VersionRecord.Data = "three"; - - storage.Set(null, "three"); - storage.Set("alpha", "four"); - } - - [Test, Ignore("implementation pending")] - public void VersionedSettingOnInfosetField() { - Assert.Fail("todo"); - } - } -} +using System.Linq; +using Autofac; +using NUnit.Framework; +using Orchard.ContentManagement; +using Orchard.ContentManagement.FieldStorage; +using Orchard.ContentManagement.FieldStorage.InfosetStorage; +using Orchard.ContentManagement.MetaData.Builders; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.ContentManagement.Records; + +namespace Orchard.Tests.ContentManagement.Drivers.FieldStorage { + public class InfosetFieldStorageProviderTests { + private IContainer _container; + private IFieldStorageProvider _provider; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + + _container = builder.Build(); + _provider = _container.Resolve(); + } + + private ContentPartDefinition FooPartDefinition() { + return new ContentPartDefinitionBuilder() + .Named("Foo") + .WithField("Bar") + .Build(); + } + + private ContentPart CreateContentItemPart() { + var partDefinition = FooPartDefinition(); + var typeDefinition = new ContentTypeDefinitionBuilder() + .WithPart(partDefinition, part => { }) + .Build(); + var contentItem = new ContentItem { + VersionRecord = new ContentItemVersionRecord { + ContentItemRecord = new ContentItemRecord() + } + }; + var contentPart = new ContentPart { + TypePartDefinition = typeDefinition.Parts.Single() + }; + contentItem.Weld(contentPart); + contentItem.Weld(new InfosetPart { + Infoset = contentItem.Record.Infoset, + VersionInfoset = contentItem.VersionRecord.Infoset + }); + return contentPart; + } + + [Test] + public void BoundStorageIsNotNull() { + var part = CreateContentItemPart(); + var storage = _provider.BindStorage(part, part.PartDefinition.Fields.Single()); + Assert.That(storage, Is.Not.Null); + } + + [Test] + public void GettingUnsetNamedAndUnnamedValueIsSafeAndNull() { + var part = CreateContentItemPart(); + var storage = _provider.BindStorage(part, part.PartDefinition.Fields.Single()); + Assert.That(storage.Get(null), Is.Null); + Assert.That(storage.Get("value"), Is.Null); + Assert.That(storage.Get("This is a test"), Is.Null); + } + + [Test] + public void ValueThatIsSetIsAlsoReturned() { + var part = CreateContentItemPart(); + var storage = _provider.BindStorage(part, part.PartDefinition.Fields.Single()); + + Assert.That(storage.Get("alpha"), Is.Null); + storage.Set("alpha", "one"); + Assert.That(storage.Get("alpha"), Is.Not.Null); + Assert.That(storage.Get("alpha"), Is.EqualTo("one")); + } + + [Test] + public void NullAndEmptyValueNamesAreTreatedTheSame() { + var part = CreateContentItemPart(); + var storage = _provider.BindStorage(part, part.PartDefinition.Fields.Single()); + + Assert.That(storage.Get(null), Is.Null); + Assert.That(storage.Get(""), Is.Null); + storage.Set(null, "one"); + Assert.That(storage.Get(null), Is.EqualTo("one")); + Assert.That(storage.Get(""), Is.EqualTo("one")); + storage.Set(null, "two"); + Assert.That(storage.Get(null), Is.EqualTo("two")); + Assert.That(storage.Get(""), Is.EqualTo("two")); + } + + [Test] + public void RecordDataPropertyReflectsChangesToFields() { + var part = CreateContentItemPart(); + var storage = _provider.BindStorage(part, part.PartDefinition.Fields.Single()); + + storage.Set(null, "one"); + storage.Set("alpha", "two"); + + Assert.That(part.ContentItem.VersionRecord.Data, Is.EqualTo("one")); + } + + [Test] + public void ChangingRecordDataHasImmediateEffectOnStorageAccessors() { + var part = CreateContentItemPart(); + var storage = _provider.BindStorage(part, part.PartDefinition.Fields.Single()); + + storage.Set(null, "one"); + storage.Set("alpha", "two"); + + Assert.That(part.ContentItem.VersionRecord.Data, Is.EqualTo("one")); + part.ContentItem.VersionRecord.Data = "three"; + + storage.Set(null, "three"); + storage.Set("alpha", "four"); + } + + [Test, Ignore("implementation pending")] + public void VersionedSettingOnInfosetField() { + Assert.Fail("todo"); + } + } +} diff --git a/src/Orchard.Tests/ContentManagement/DynamicContentItemTests.cs b/src/Orchard.Tests/ContentManagement/DynamicContentItemTests.cs index 0c82d68e88d..84fdd67aa2e 100644 --- a/src/Orchard.Tests/ContentManagement/DynamicContentItemTests.cs +++ b/src/Orchard.Tests/ContentManagement/DynamicContentItemTests.cs @@ -1,114 +1,114 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using NUnit.Framework; -using Orchard.ContentManagement; -using Orchard.ContentManagement.MetaData.Models; - -namespace Orchard.Tests.ContentManagement { - [TestFixture] - public class DynamicContentItemTests { - - [Test] - public void ContentItemProjectsPartNamesAsProperties() { - var contentItem = new ContentItem(); - var testingPart = new ContentPart { TypePartDefinition = new ContentTypePartDefinition(new ContentPartDefinition("TestingPart"), new SettingsDictionary()) }; - contentItem.Weld(testingPart); - - dynamic contentItemDynamic = contentItem; - dynamic testingPartDynamic = contentItemDynamic.TestingPart; - - Assert.That((object)testingPartDynamic, Is.SameAs(testingPart)); - } - - - [Test] - public void ContentPartsAlsoProjectPartNamesAsProperties() { - var contentItem = new ContentItem(); - var testingPart = new ContentPart { TypePartDefinition = new ContentTypePartDefinition(new ContentPartDefinition("TestingPart"), new SettingsDictionary()) }; - var anotherPart = new ContentPart { TypePartDefinition = new ContentTypePartDefinition(new ContentPartDefinition("AnotherPart"), new SettingsDictionary()) }; - contentItem.Weld(testingPart); - contentItem.Weld(anotherPart); - - dynamic contentItemDynamic = contentItem; - dynamic testingPartDynamic = contentItemDynamic.TestingPart; - dynamic anotherPartDynamic = contentItemDynamic.AnotherPart; - dynamic testingPartDynamic2 = testingPartDynamic.TestingPart; - dynamic anotherPartDynamic2 = testingPartDynamic.AnotherPart; - - Assert.That((object)testingPartDynamic, Is.SameAs(testingPart)); - Assert.That((object)anotherPartDynamic, Is.SameAs(anotherPart)); - Assert.That((object)testingPartDynamic2, Is.SameAs(testingPart)); - Assert.That((object)anotherPartDynamic2, Is.SameAs(anotherPart)); - } - - - [Test] - public void ContentItemPropertyOnPartRootsYou() { - var contentItem = new ContentItem(); - var testingPart = new ContentPart { TypePartDefinition = new ContentTypePartDefinition(new ContentPartDefinition("TestingPart"), new SettingsDictionary()) }; - var anotherPart = new ContentPart { TypePartDefinition = new ContentTypePartDefinition(new ContentPartDefinition("AnotherPart"), new SettingsDictionary()) }; - contentItem.Weld(testingPart); - contentItem.Weld(anotherPart); - - dynamic contentItemDynamic = contentItem; - dynamic testingPartDynamic = contentItemDynamic.TestingPart; - dynamic anotherPartDynamic = contentItemDynamic.AnotherPart; - - dynamic contentItemDynamic1 = testingPartDynamic.ContentItem; - dynamic contentItemDynamic2 = anotherPartDynamic.ContentItem; - - Assert.That((object)contentItemDynamic1, Is.SameAs(contentItem)); - Assert.That((object)contentItemDynamic2, Is.SameAs(contentItem)); - } - - - [Test] - public void ActualPropertiesTakePriority() { - var contentItem = new ContentItem(); - var testingPart = new ContentPart { TypePartDefinition = new ContentTypePartDefinition(new ContentPartDefinition("Parts"), new SettingsDictionary()) }; - contentItem.Weld(testingPart); - - dynamic contentItemDynamic = contentItem; - dynamic testingPartDynamic = contentItemDynamic.Parts; - - - Assert.That((object)testingPartDynamic, Is.AssignableTo>()); - } - - - [Test] - public void NullCheckingCanBeDoneOnProperties() { - var contentItem = new ContentItem(); - var contentPart = new ContentPart { TypePartDefinition = new ContentTypePartDefinition(new ContentPartDefinition("FooPart"), new SettingsDictionary()) }; - var contentField = new ContentField { PartFieldDefinition = new ContentPartFieldDefinition(new ContentFieldDefinition("FooType"), "FooField", new SettingsDictionary()) }; - - dynamic item = contentItem; - dynamic part = contentPart; - - Assert.That(item.FooPart == null, Is.True); - Assert.That(item.FooPart != null, Is.False); - - contentItem.Weld(contentPart); - - Assert.That(item.FooPart == null, Is.False); - Assert.That(item.FooPart != null, Is.True); - Assert.That(item.FooPart, Is.SameAs(contentPart)); - - Assert.That(part.FooField == null, Is.True); - Assert.That(part.FooField != null, Is.False); - Assert.That(item.FooPart.FooField == null, Is.True); - Assert.That(item.FooPart.FooField != null, Is.False); - - contentPart.Weld(contentField); - - Assert.That(part.FooField == null, Is.False); - Assert.That(part.FooField != null, Is.True); - Assert.That(item.FooPart.FooField == null, Is.False); - Assert.That(item.FooPart.FooField != null, Is.True); - Assert.That(part.FooField, Is.SameAs(contentField)); - Assert.That(item.FooPart.FooField, Is.SameAs(contentField)); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using NUnit.Framework; +using Orchard.ContentManagement; +using Orchard.ContentManagement.MetaData.Models; + +namespace Orchard.Tests.ContentManagement { + [TestFixture] + public class DynamicContentItemTests { + + [Test] + public void ContentItemProjectsPartNamesAsProperties() { + var contentItem = new ContentItem(); + var testingPart = new ContentPart { TypePartDefinition = new ContentTypePartDefinition(new ContentPartDefinition("TestingPart"), new SettingsDictionary()) }; + contentItem.Weld(testingPart); + + dynamic contentItemDynamic = contentItem; + dynamic testingPartDynamic = contentItemDynamic.TestingPart; + + Assert.That((object)testingPartDynamic, Is.SameAs(testingPart)); + } + + + [Test] + public void ContentPartsAlsoProjectPartNamesAsProperties() { + var contentItem = new ContentItem(); + var testingPart = new ContentPart { TypePartDefinition = new ContentTypePartDefinition(new ContentPartDefinition("TestingPart"), new SettingsDictionary()) }; + var anotherPart = new ContentPart { TypePartDefinition = new ContentTypePartDefinition(new ContentPartDefinition("AnotherPart"), new SettingsDictionary()) }; + contentItem.Weld(testingPart); + contentItem.Weld(anotherPart); + + dynamic contentItemDynamic = contentItem; + dynamic testingPartDynamic = contentItemDynamic.TestingPart; + dynamic anotherPartDynamic = contentItemDynamic.AnotherPart; + dynamic testingPartDynamic2 = testingPartDynamic.TestingPart; + dynamic anotherPartDynamic2 = testingPartDynamic.AnotherPart; + + Assert.That((object)testingPartDynamic, Is.SameAs(testingPart)); + Assert.That((object)anotherPartDynamic, Is.SameAs(anotherPart)); + Assert.That((object)testingPartDynamic2, Is.SameAs(testingPart)); + Assert.That((object)anotherPartDynamic2, Is.SameAs(anotherPart)); + } + + + [Test] + public void ContentItemPropertyOnPartRootsYou() { + var contentItem = new ContentItem(); + var testingPart = new ContentPart { TypePartDefinition = new ContentTypePartDefinition(new ContentPartDefinition("TestingPart"), new SettingsDictionary()) }; + var anotherPart = new ContentPart { TypePartDefinition = new ContentTypePartDefinition(new ContentPartDefinition("AnotherPart"), new SettingsDictionary()) }; + contentItem.Weld(testingPart); + contentItem.Weld(anotherPart); + + dynamic contentItemDynamic = contentItem; + dynamic testingPartDynamic = contentItemDynamic.TestingPart; + dynamic anotherPartDynamic = contentItemDynamic.AnotherPart; + + dynamic contentItemDynamic1 = testingPartDynamic.ContentItem; + dynamic contentItemDynamic2 = anotherPartDynamic.ContentItem; + + Assert.That((object)contentItemDynamic1, Is.SameAs(contentItem)); + Assert.That((object)contentItemDynamic2, Is.SameAs(contentItem)); + } + + + [Test] + public void ActualPropertiesTakePriority() { + var contentItem = new ContentItem(); + var testingPart = new ContentPart { TypePartDefinition = new ContentTypePartDefinition(new ContentPartDefinition("Parts"), new SettingsDictionary()) }; + contentItem.Weld(testingPart); + + dynamic contentItemDynamic = contentItem; + dynamic testingPartDynamic = contentItemDynamic.Parts; + + + Assert.That((object)testingPartDynamic, Is.AssignableTo>()); + } + + + [Test] + public void NullCheckingCanBeDoneOnProperties() { + var contentItem = new ContentItem(); + var contentPart = new ContentPart { TypePartDefinition = new ContentTypePartDefinition(new ContentPartDefinition("FooPart"), new SettingsDictionary()) }; + var contentField = new ContentField { PartFieldDefinition = new ContentPartFieldDefinition(new ContentFieldDefinition("FooType"), "FooField", new SettingsDictionary()) }; + + dynamic item = contentItem; + dynamic part = contentPart; + + Assert.That(item.FooPart == null, Is.True); + Assert.That(item.FooPart != null, Is.False); + + contentItem.Weld(contentPart); + + Assert.That(item.FooPart == null, Is.False); + Assert.That(item.FooPart != null, Is.True); + Assert.That(item.FooPart, Is.SameAs(contentPart)); + + Assert.That(part.FooField == null, Is.True); + Assert.That(part.FooField != null, Is.False); + Assert.That(item.FooPart.FooField == null, Is.True); + Assert.That(item.FooPart.FooField != null, Is.False); + + contentPart.Weld(contentField); + + Assert.That(part.FooField == null, Is.False); + Assert.That(part.FooField != null, Is.True); + Assert.That(item.FooPart.FooField == null, Is.False); + Assert.That(item.FooPart.FooField != null, Is.True); + Assert.That(part.FooField, Is.SameAs(contentField)); + Assert.That(item.FooPart.FooField, Is.SameAs(contentField)); + } + } +} diff --git a/src/Orchard.Tests/ContentManagement/DynamicContentQueryTests.cs b/src/Orchard.Tests/ContentManagement/DynamicContentQueryTests.cs index 36ad2a52bd3..828707e1afb 100644 --- a/src/Orchard.Tests/ContentManagement/DynamicContentQueryTests.cs +++ b/src/Orchard.Tests/ContentManagement/DynamicContentQueryTests.cs @@ -1,254 +1,254 @@ -using System.Linq; -using Autofac; -using Moq; -using NHibernate; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.ContentManagement.MetaData; -using Orchard.Data; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Handlers; -using Orchard.ContentManagement.Records; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.Environment.Configuration; -using Orchard.Environment.Extensions; -using Orchard.Tests.ContentManagement.Handlers; -using Orchard.Tests.ContentManagement.Records; -using Orchard.Tests.ContentManagement.Models; -using Orchard.DisplayManagement.Implementation; -using Orchard.Tests.Stubs; -using Orchard.UI.PageClass; - -namespace Orchard.Tests.ContentManagement { - [TestFixture] - public class DynamicContentQueryTests { - private IContainer _container; - private IContentManager _manager; - private ISessionFactory _sessionFactory; - private ISession _session; - - [TestFixtureSetUp] - public void InitFixture() { - var databaseFileName = System.IO.Path.GetTempFileName(); - _sessionFactory = DataUtility.CreateSessionFactory( - databaseFileName, - typeof(GammaRecord), - typeof(DeltaRecord), - typeof(EpsilonRecord), - typeof(ContentItemVersionRecord), - typeof(ContentItemRecord), - typeof(ContentTypeRecord)); - } - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - - builder.RegisterModule(new ContentModule()); - builder.RegisterType().As().SingleInstance(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataProvider = "SqlCe" }); - - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); - - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - - _session = _sessionFactory.OpenSession(); - builder.RegisterInstance(new TestTransactionManager(_session)).As(); - - _session.Delete(string.Format("from {0}", typeof(GammaRecord).FullName)); - _session.Delete(string.Format("from {0}", typeof(DeltaRecord).FullName)); - _session.Delete(string.Format("from {0}", typeof(EpsilonRecord).FullName)); - _session.Delete(string.Format("from {0}", typeof(ContentItemVersionRecord).FullName)); - _session.Delete(string.Format("from {0}", typeof(ContentItemRecord).FullName)); - _session.Delete(string.Format("from {0}", typeof(ContentTypeRecord).FullName)); - _session.Flush(); - _session.Clear(); - - _container = builder.Build(); - _manager = _container.Resolve(); - - } - - [TearDown] - public void Cleanup() { - if (_container != null) - _container.Dispose(); - } - - private void AddSampleData() { - _manager.Create("alpha", init => { }); - _manager.Create("beta", init => { }); - _manager.Create("gamma", init => { init.Record.Frap = "the frap value"; }); - _manager.Create("delta", init => { init.Record.Quux = "the quux value"; }); - _session.Flush(); - } - - [Test] - public void SpecificTypeIsReturnedWhenSpecified() { - AddSampleData(); - - var alphaBeta = _manager.HqlQuery().ForType("alpha", "beta").List(); - - Assert.That(alphaBeta.Count(), Is.EqualTo(2)); - Assert.That(alphaBeta.Count(x => x.Has()), Is.EqualTo(1)); - Assert.That(alphaBeta.Count(x => x.Has()), Is.EqualTo(1)); - Assert.That(alphaBeta.Count(x => x.Has()), Is.EqualTo(0)); - Assert.That(alphaBeta.Count(x => x.Has()), Is.EqualTo(0)); - - var gammaDelta = _manager.HqlQuery().ForType("gamma", "delta").List(); - - Assert.That(gammaDelta.Count(), Is.EqualTo(2)); - Assert.That(gammaDelta.Count(x => x.Has()), Is.EqualTo(0)); - Assert.That(gammaDelta.Count(x => x.Has()), Is.EqualTo(0)); - Assert.That(gammaDelta.Count(x => x.Has()), Is.EqualTo(1)); - Assert.That(gammaDelta.Count(x => x.Has()), Is.EqualTo(1)); - } - - [Test] - public void WherePredicateRestrictsResults() { - AddSampleData(); - _manager.Create("gamma", init => { init.Record.Frap = "one"; }); - _manager.Create("gamma", init => { init.Record.Frap = "two"; }); - _manager.Create("gamma", init => { init.Record.Frap = "three"; }); - _manager.Create("gamma", init => { init.Record.Frap = "four"; }); - _session.Flush(); - - var twoOrFour = _manager - .HqlQuery() - .Where( - alias => alias.ContentPartRecord(), - x => x.Or(a => a.Eq("Frap", "one"), b => b.Eq("Frap", "four"))) - .List(); - - Assert.That(twoOrFour.Count(), Is.EqualTo(2)); - Assert.That(twoOrFour.Count(x => x.Has()), Is.EqualTo(2)); - Assert.That(twoOrFour.Count(x => x.Get().Record.Frap == "one"), Is.EqualTo(1)); - Assert.That(twoOrFour.Count(x => x.Get().Record.Frap == "four"), Is.EqualTo(1)); - } - - - [Test] - public void EmptyWherePredicateRequiresRecord() { - AddSampleData(); - var gammas = _manager.HqlQuery().Join(alias => alias.ContentPartRecord()).List(); - var deltas = _manager.HqlQuery().Join(alias => alias.ContentPartRecord()).List(); - - Assert.That(gammas.Count(), Is.EqualTo(1)); - Assert.That(deltas.Count(), Is.EqualTo(1)); - Assert.That(gammas.AsPart().Single().Record.Frap, Is.EqualTo("the frap value")); - Assert.That(deltas.AsPart().Single().Record.Quux, Is.EqualTo("the quux value")); - } - - [Test] - public void OrderMaySortOnJoinedRecord() { - AddSampleData(); - _manager.Create("gamma", init => { init.Record.Frap = "one"; }); - _manager.Create("gamma", init => { init.Record.Frap = "two"; }); - _manager.Create("gamma", init => { init.Record.Frap = "three"; }); - _manager.Create("gamma", init => { init.Record.Frap = "four"; }); - _session.Flush(); - _session.Clear(); - - var ascending = _manager.HqlQuery() - .ForType("gamma") - .OrderBy(alias => alias.ContentPartRecord(), x => x.Asc("Frap")) - .List().ToList(); - - Assert.That(ascending.Count(), Is.EqualTo(5)); - Assert.That(ascending.First().Record.Frap, Is.EqualTo("four")); - Assert.That(ascending.Last().Record.Frap, Is.EqualTo("two")); - - _session.Clear(); - - var descending = _manager.HqlQuery() - .ForType("gamma") - .OrderBy(alias => alias.ContentPartRecord(), x => x.Desc("Frap")) - .List().ToList(); - - Assert.That(descending.Count(), Is.EqualTo(5)); - Assert.That(descending.First().Record.Frap, Is.EqualTo("two")); - Assert.That(descending.Last().Record.Frap, Is.EqualTo("four")); - } - - [Test] - public void SkipAndTakeProvidePagination() { - AddSampleData(); - _manager.Create("gamma", init => { init.Record.Frap = "one"; }); - _manager.Create("gamma", init => { init.Record.Frap = "two"; }); - _manager.Create("gamma", init => { init.Record.Frap = "three"; }); - _manager.Create("gamma", init => { init.Record.Frap = "four"; }); - _session.Flush(); - - var reverseById = _manager.HqlQuery() - .OrderBy(alias => alias.ContentPartRecord(), x => x.Desc("Id")) - .List(); - - var subset = _manager.HqlQuery() - .OrderBy(alias => alias.ContentPartRecord(), x => x.Desc("Id")) - .Slice(2, 3); - - Assert.That(subset.Count(), Is.EqualTo(3)); - Assert.That(subset.First().Id, Is.EqualTo(reverseById.Skip(2).First().Id)); - Assert.That(subset.Skip(1).First().Id, Is.EqualTo(reverseById.Skip(3).First().Id)); - Assert.That(subset.Skip(2).First().Id, Is.EqualTo(reverseById.Skip(4).First().Id)); - } - - - [Test] - public void QueryShouldJoinVersionedRecords() { - AddSampleData(); - _manager.Create("gamma", init => { - init.Record.Frap = "one"; - init.As().Record.Quad = "1"; - }); - _manager.Create("gamma", init => { - init.Record.Frap = "two"; - init.As().Record.Quad = "2"; - }); - _manager.Create("gamma", init => { - init.Record.Frap = "three"; - init.As().Record.Quad = "3"; - }); - _manager.Create("gamma", init => { - init.Record.Frap = "four"; - init.As().Record.Quad = "4"; - }); - _session.Flush(); - _session.Clear(); - - var results = _manager.HqlQuery() - .Where(alias => alias.ContentPartRecord(), x => x.Or(a => a.Eq("Quad", "2"), b => b.Eq("Quad", "3"))) - .OrderBy(alias => alias.ContentPartRecord(), x => x.Desc("Quad")) - .ForType("gamma") - .List(); - - Assert.That(results.Count(), Is.EqualTo(2)); - Assert.That(results.First().Record, Has.Property("Quad").EqualTo("3")); - Assert.That(results.Last().Record, Has.Property("Quad").EqualTo("2")); - } - - - } -} - - - +using System.Linq; +using Autofac; +using Moq; +using NHibernate; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.ContentManagement.MetaData; +using Orchard.Data; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Handlers; +using Orchard.ContentManagement.Records; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.Environment.Configuration; +using Orchard.Environment.Extensions; +using Orchard.Tests.ContentManagement.Handlers; +using Orchard.Tests.ContentManagement.Records; +using Orchard.Tests.ContentManagement.Models; +using Orchard.DisplayManagement.Implementation; +using Orchard.Tests.Stubs; +using Orchard.UI.PageClass; + +namespace Orchard.Tests.ContentManagement { + [TestFixture] + public class DynamicContentQueryTests { + private IContainer _container; + private IContentManager _manager; + private ISessionFactory _sessionFactory; + private ISession _session; + + [TestFixtureSetUp] + public void InitFixture() { + var databaseFileName = System.IO.Path.GetTempFileName(); + _sessionFactory = DataUtility.CreateSessionFactory( + databaseFileName, + typeof(GammaRecord), + typeof(DeltaRecord), + typeof(EpsilonRecord), + typeof(ContentItemVersionRecord), + typeof(ContentItemRecord), + typeof(ContentTypeRecord)); + } + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + + builder.RegisterModule(new ContentModule()); + builder.RegisterType().As().SingleInstance(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataProvider = "SqlCe" }); + + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); + + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + + _session = _sessionFactory.OpenSession(); + builder.RegisterInstance(new TestTransactionManager(_session)).As(); + + _session.Delete(string.Format("from {0}", typeof(GammaRecord).FullName)); + _session.Delete(string.Format("from {0}", typeof(DeltaRecord).FullName)); + _session.Delete(string.Format("from {0}", typeof(EpsilonRecord).FullName)); + _session.Delete(string.Format("from {0}", typeof(ContentItemVersionRecord).FullName)); + _session.Delete(string.Format("from {0}", typeof(ContentItemRecord).FullName)); + _session.Delete(string.Format("from {0}", typeof(ContentTypeRecord).FullName)); + _session.Flush(); + _session.Clear(); + + _container = builder.Build(); + _manager = _container.Resolve(); + + } + + [TearDown] + public void Cleanup() { + if (_container != null) + _container.Dispose(); + } + + private void AddSampleData() { + _manager.Create("alpha", init => { }); + _manager.Create("beta", init => { }); + _manager.Create("gamma", init => { init.Record.Frap = "the frap value"; }); + _manager.Create("delta", init => { init.Record.Quux = "the quux value"; }); + _session.Flush(); + } + + [Test] + public void SpecificTypeIsReturnedWhenSpecified() { + AddSampleData(); + + var alphaBeta = _manager.HqlQuery().ForType("alpha", "beta").List(); + + Assert.That(alphaBeta.Count(), Is.EqualTo(2)); + Assert.That(alphaBeta.Count(x => x.Has()), Is.EqualTo(1)); + Assert.That(alphaBeta.Count(x => x.Has()), Is.EqualTo(1)); + Assert.That(alphaBeta.Count(x => x.Has()), Is.EqualTo(0)); + Assert.That(alphaBeta.Count(x => x.Has()), Is.EqualTo(0)); + + var gammaDelta = _manager.HqlQuery().ForType("gamma", "delta").List(); + + Assert.That(gammaDelta.Count(), Is.EqualTo(2)); + Assert.That(gammaDelta.Count(x => x.Has()), Is.EqualTo(0)); + Assert.That(gammaDelta.Count(x => x.Has()), Is.EqualTo(0)); + Assert.That(gammaDelta.Count(x => x.Has()), Is.EqualTo(1)); + Assert.That(gammaDelta.Count(x => x.Has()), Is.EqualTo(1)); + } + + [Test] + public void WherePredicateRestrictsResults() { + AddSampleData(); + _manager.Create("gamma", init => { init.Record.Frap = "one"; }); + _manager.Create("gamma", init => { init.Record.Frap = "two"; }); + _manager.Create("gamma", init => { init.Record.Frap = "three"; }); + _manager.Create("gamma", init => { init.Record.Frap = "four"; }); + _session.Flush(); + + var twoOrFour = _manager + .HqlQuery() + .Where( + alias => alias.ContentPartRecord(), + x => x.Or(a => a.Eq("Frap", "one"), b => b.Eq("Frap", "four"))) + .List(); + + Assert.That(twoOrFour.Count(), Is.EqualTo(2)); + Assert.That(twoOrFour.Count(x => x.Has()), Is.EqualTo(2)); + Assert.That(twoOrFour.Count(x => x.Get().Record.Frap == "one"), Is.EqualTo(1)); + Assert.That(twoOrFour.Count(x => x.Get().Record.Frap == "four"), Is.EqualTo(1)); + } + + + [Test] + public void EmptyWherePredicateRequiresRecord() { + AddSampleData(); + var gammas = _manager.HqlQuery().Join(alias => alias.ContentPartRecord()).List(); + var deltas = _manager.HqlQuery().Join(alias => alias.ContentPartRecord()).List(); + + Assert.That(gammas.Count(), Is.EqualTo(1)); + Assert.That(deltas.Count(), Is.EqualTo(1)); + Assert.That(gammas.AsPart().Single().Record.Frap, Is.EqualTo("the frap value")); + Assert.That(deltas.AsPart().Single().Record.Quux, Is.EqualTo("the quux value")); + } + + [Test] + public void OrderMaySortOnJoinedRecord() { + AddSampleData(); + _manager.Create("gamma", init => { init.Record.Frap = "one"; }); + _manager.Create("gamma", init => { init.Record.Frap = "two"; }); + _manager.Create("gamma", init => { init.Record.Frap = "three"; }); + _manager.Create("gamma", init => { init.Record.Frap = "four"; }); + _session.Flush(); + _session.Clear(); + + var ascending = _manager.HqlQuery() + .ForType("gamma") + .OrderBy(alias => alias.ContentPartRecord(), x => x.Asc("Frap")) + .List().ToList(); + + Assert.That(ascending.Count(), Is.EqualTo(5)); + Assert.That(ascending.First().Record.Frap, Is.EqualTo("four")); + Assert.That(ascending.Last().Record.Frap, Is.EqualTo("two")); + + _session.Clear(); + + var descending = _manager.HqlQuery() + .ForType("gamma") + .OrderBy(alias => alias.ContentPartRecord(), x => x.Desc("Frap")) + .List().ToList(); + + Assert.That(descending.Count(), Is.EqualTo(5)); + Assert.That(descending.First().Record.Frap, Is.EqualTo("two")); + Assert.That(descending.Last().Record.Frap, Is.EqualTo("four")); + } + + [Test] + public void SkipAndTakeProvidePagination() { + AddSampleData(); + _manager.Create("gamma", init => { init.Record.Frap = "one"; }); + _manager.Create("gamma", init => { init.Record.Frap = "two"; }); + _manager.Create("gamma", init => { init.Record.Frap = "three"; }); + _manager.Create("gamma", init => { init.Record.Frap = "four"; }); + _session.Flush(); + + var reverseById = _manager.HqlQuery() + .OrderBy(alias => alias.ContentPartRecord(), x => x.Desc("Id")) + .List(); + + var subset = _manager.HqlQuery() + .OrderBy(alias => alias.ContentPartRecord(), x => x.Desc("Id")) + .Slice(2, 3); + + Assert.That(subset.Count(), Is.EqualTo(3)); + Assert.That(subset.First().Id, Is.EqualTo(reverseById.Skip(2).First().Id)); + Assert.That(subset.Skip(1).First().Id, Is.EqualTo(reverseById.Skip(3).First().Id)); + Assert.That(subset.Skip(2).First().Id, Is.EqualTo(reverseById.Skip(4).First().Id)); + } + + + [Test] + public void QueryShouldJoinVersionedRecords() { + AddSampleData(); + _manager.Create("gamma", init => { + init.Record.Frap = "one"; + init.As().Record.Quad = "1"; + }); + _manager.Create("gamma", init => { + init.Record.Frap = "two"; + init.As().Record.Quad = "2"; + }); + _manager.Create("gamma", init => { + init.Record.Frap = "three"; + init.As().Record.Quad = "3"; + }); + _manager.Create("gamma", init => { + init.Record.Frap = "four"; + init.As().Record.Quad = "4"; + }); + _session.Flush(); + _session.Clear(); + + var results = _manager.HqlQuery() + .Where(alias => alias.ContentPartRecord(), x => x.Or(a => a.Eq("Quad", "2"), b => b.Eq("Quad", "3"))) + .OrderBy(alias => alias.ContentPartRecord(), x => x.Desc("Quad")) + .ForType("gamma") + .List(); + + Assert.That(results.Count(), Is.EqualTo(2)); + Assert.That(results.First().Record, Has.Property("Quad").EqualTo("3")); + Assert.That(results.Last().Record, Has.Property("Quad").EqualTo("2")); + } + + + } +} + + + diff --git a/src/Orchard.Tests/ContentManagement/Handlers/AlphaPartHandler.cs b/src/Orchard.Tests/ContentManagement/Handlers/AlphaPartHandler.cs index bea5ec8d2f1..cd5a57db34e 100644 --- a/src/Orchard.Tests/ContentManagement/Handlers/AlphaPartHandler.cs +++ b/src/Orchard.Tests/ContentManagement/Handlers/AlphaPartHandler.cs @@ -1,12 +1,12 @@ -using Orchard.ContentManagement.Handlers; -using Orchard.Tests.ContentManagement.Models; - -namespace Orchard.Tests.ContentManagement.Handlers { - public class AlphaPartHandler : ContentHandler { - public AlphaPartHandler() { - Filters.Add(new ActivatingFilter("alpha")); - - OnGetDisplayShape((ctx, part) => ctx.Shape.Zones["Main"].Add(part, "3")); - } - } -} +using Orchard.ContentManagement.Handlers; +using Orchard.Tests.ContentManagement.Models; + +namespace Orchard.Tests.ContentManagement.Handlers { + public class AlphaPartHandler : ContentHandler { + public AlphaPartHandler() { + Filters.Add(new ActivatingFilter("alpha")); + + OnGetDisplayShape((ctx, part) => ctx.Shape.Zones["Main"].Add(part, "3")); + } + } +} diff --git a/src/Orchard.Tests/ContentManagement/Handlers/BetaPartHandler.cs b/src/Orchard.Tests/ContentManagement/Handlers/BetaPartHandler.cs index 133944795fd..a8b9175087c 100644 --- a/src/Orchard.Tests/ContentManagement/Handlers/BetaPartHandler.cs +++ b/src/Orchard.Tests/ContentManagement/Handlers/BetaPartHandler.cs @@ -1,10 +1,10 @@ -using Orchard.ContentManagement.Handlers; -using Orchard.Tests.ContentManagement.Models; - -namespace Orchard.Tests.ContentManagement.Handlers { - public class BetaPartHandler : ContentHandler { - public BetaPartHandler() { - Filters.Add(new ActivatingFilter("beta")); - } - } -} +using Orchard.ContentManagement.Handlers; +using Orchard.Tests.ContentManagement.Models; + +namespace Orchard.Tests.ContentManagement.Handlers { + public class BetaPartHandler : ContentHandler { + public BetaPartHandler() { + Filters.Add(new ActivatingFilter("beta")); + } + } +} diff --git a/src/Orchard.Tests/ContentManagement/Handlers/ContentHandlerTests.cs b/src/Orchard.Tests/ContentManagement/Handlers/ContentHandlerTests.cs index 3f7b302e03b..a2e2fb7a272 100644 --- a/src/Orchard.Tests/ContentManagement/Handlers/ContentHandlerTests.cs +++ b/src/Orchard.Tests/ContentManagement/Handlers/ContentHandlerTests.cs @@ -1,52 +1,52 @@ -using NUnit.Framework; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Handlers; -using Orchard.ContentManagement.MetaData.Builders; - -namespace Orchard.Tests.ContentManagement.Handlers { - - [TestFixture] - public class ContentHandlerTests { - [Test] - public void ModelDriverShouldUsePersistenceFilterToDelegateCreateAndLoad() { - var modelDriver = new TestModelHandler(); - - var contentItem = new ContentItem(); - var part = new TestModelPart(); - contentItem.Weld(part); - - ((IContentHandler)modelDriver).Creating(new CreateContentContext(contentItem)); - Assert.That(part.CreatingCalled, Is.True); - } - - [Test] - public void PartShouldBeAddedBasedOnSimplePredicate() { - var modelDriver = new TestModelHandler(); - - var builder = new ContentItemBuilder(new ContentTypeDefinitionBuilder().Named("testing").Build()); - ((IContentHandler)modelDriver).Activating(new ActivatingContentContext { Builder = builder, ContentType = "testing" }); - var model = builder.Build(); - Assert.That(model.Is(), Is.True); - Assert.That(model.As(), Is.Not.Null); - } - - public class TestModelPart : ContentPart { - public bool CreatingCalled { get; set; } - } - - - public class TestModelHandler : ContentHandler { - public TestModelHandler() { - Filters.Add(new ActivatingFilter(x => x == "testing")); - Filters.Add(new TestModelStorageFilter()); - } - } - - public class TestModelStorageFilter : StorageFilterBase { - protected override void Creating(CreateContentContext context, TestModelPart instance) { - instance.CreatingCalled = true; - } - } - } -} - +using NUnit.Framework; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Handlers; +using Orchard.ContentManagement.MetaData.Builders; + +namespace Orchard.Tests.ContentManagement.Handlers { + + [TestFixture] + public class ContentHandlerTests { + [Test] + public void ModelDriverShouldUsePersistenceFilterToDelegateCreateAndLoad() { + var modelDriver = new TestModelHandler(); + + var contentItem = new ContentItem(); + var part = new TestModelPart(); + contentItem.Weld(part); + + ((IContentHandler)modelDriver).Creating(new CreateContentContext(contentItem)); + Assert.That(part.CreatingCalled, Is.True); + } + + [Test] + public void PartShouldBeAddedBasedOnSimplePredicate() { + var modelDriver = new TestModelHandler(); + + var builder = new ContentItemBuilder(new ContentTypeDefinitionBuilder().Named("testing").Build()); + ((IContentHandler)modelDriver).Activating(new ActivatingContentContext { Builder = builder, ContentType = "testing" }); + var model = builder.Build(); + Assert.That(model.Is(), Is.True); + Assert.That(model.As(), Is.Not.Null); + } + + public class TestModelPart : ContentPart { + public bool CreatingCalled { get; set; } + } + + + public class TestModelHandler : ContentHandler { + public TestModelHandler() { + Filters.Add(new ActivatingFilter(x => x == "testing")); + Filters.Add(new TestModelStorageFilter()); + } + } + + public class TestModelStorageFilter : StorageFilterBase { + protected override void Creating(CreateContentContext context, TestModelPart instance) { + instance.CreatingCalled = true; + } + } + } +} + diff --git a/src/Orchard.Tests/ContentManagement/Handlers/Coordinators/ContentPartDriverCoordinatorTests.cs b/src/Orchard.Tests/ContentManagement/Handlers/Coordinators/ContentPartDriverCoordinatorTests.cs index 86f45aad4f6..556a823bf1c 100644 --- a/src/Orchard.Tests/ContentManagement/Handlers/Coordinators/ContentPartDriverCoordinatorTests.cs +++ b/src/Orchard.Tests/ContentManagement/Handlers/Coordinators/ContentPartDriverCoordinatorTests.cs @@ -1,115 +1,115 @@ -using System.ComponentModel.DataAnnotations; -using System.Linq; -using Autofac; -using Moq; -using NUnit.Framework; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Drivers; -using Orchard.ContentManagement.Drivers.Coordinators; -using Orchard.ContentManagement.Handlers; -using Orchard.ContentManagement.MetaData; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Implementation; - -namespace Orchard.Tests.ContentManagement.Handlers.Coordinators { - [TestFixture] - public class ContentPartDriverCoordinatorTests { - private IContainer _container; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - //builder.RegisterModule(new ImplicitCollectionSupportModule()); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - _container = builder.Build(); - } - - [Test] - public void DriverHandlerShouldNotThrowException() { - var contentHandler = _container.Resolve(); - contentHandler.BuildDisplay(null); - } - - [Test] - public void AllDriversShouldBeCalled() { - var driver1 = new Mock(); - var driver2 = new Mock(); - var builder = new ContainerBuilder(); - builder.RegisterInstance(driver1.Object); - builder.RegisterInstance(driver2.Object); - builder.Update(_container); - var contentHandler = _container.Resolve(); - - var contentItem = new ContentItem(); - var context = new BuildDisplayContext(null, contentItem, "", "", new Mock().Object); - - driver1.Verify(x => x.BuildDisplay(context), Times.Never()); - driver2.Verify(x => x.BuildDisplay(context), Times.Never()); - contentHandler.BuildDisplay(context); - driver1.Verify(x => x.BuildDisplay(context)); - driver2.Verify(x => x.BuildDisplay(context)); - } - - [Test, Ignore("no implementation for IZoneCollection")] - public void TestDriverCanAddDisplay() { - var driver = new StubPartDriver(); - var builder = new ContainerBuilder(); - builder.RegisterInstance(driver).As(); - builder.Update(_container); - var contentHandler = _container.Resolve(); - dynamic shapeFactory = _container.Resolve(); - - var contentItem = new ContentItem(); - contentItem.Weld(new StubPart { Foo = new[] { "a", "b", "c" } }); - - var ctx = new BuildDisplayContext(null, null, "", "", null); - var context = shapeFactory.Context(ctx); - Assert.That(context.TopMeta, Is.Null); - contentHandler.BuildDisplay(ctx); - Assert.That(context.TopMeta, Is.Not.Null); - Assert.That(context.TopMeta.Count == 1); - } - - public class StubPartDriver : ContentPartDriver { - protected override string Prefix { - get { return "Stub"; } - } - - protected override DriverResult Display(StubPart part, string displayType, dynamic shapeHelper) { - var stub = shapeHelper.Stub(Foo: string.Join(",", part.Foo)); - if (!string.IsNullOrWhiteSpace(displayType)) - stub.Metadata.Type = string.Format("{0}.{1}", stub.Metadata.Type, displayType); - return ContentShape(stub).Location("TopMeta"); - - //var viewModel = new StubViewModel { Foo = string.Join(",", part.Foo) }; - //if (displayType.StartsWith("Summary")) - // return ContentPartTemplate(viewModel, "StubViewModelTerse").Location("TopMeta"); - - //return ContentPartTemplate(viewModel).Location("TopMeta"); - } - - protected override DriverResult Editor(StubPart part, dynamic shapeHelper) { - var viewModel = new StubViewModel { Foo = string.Join(",", part.Foo) }; - return new ContentTemplateResult(viewModel, null, Prefix).Location("last", "10"); - } - - protected override DriverResult Editor(StubPart part, IUpdateModel updater, dynamic shapeHelper) { - var viewModel = new StubViewModel { Foo = string.Join(",", part.Foo) }; - updater.TryUpdateModel(viewModel, Prefix, null, null); - part.Foo = viewModel.Foo.Split(new[] { ',' }).Select(x => x.Trim()).ToArray(); - return new ContentTemplateResult(viewModel, null, Prefix).Location("last", "10"); - } - } - - public class StubPart : ContentPart { - public string[] Foo { get; set; } - } - - public class StubViewModel { - [Required] - public string Foo { get; set; } - } - } -} +using System.ComponentModel.DataAnnotations; +using System.Linq; +using Autofac; +using Moq; +using NUnit.Framework; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Drivers; +using Orchard.ContentManagement.Drivers.Coordinators; +using Orchard.ContentManagement.Handlers; +using Orchard.ContentManagement.MetaData; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Implementation; + +namespace Orchard.Tests.ContentManagement.Handlers.Coordinators { + [TestFixture] + public class ContentPartDriverCoordinatorTests { + private IContainer _container; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + //builder.RegisterModule(new ImplicitCollectionSupportModule()); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + _container = builder.Build(); + } + + [Test] + public void DriverHandlerShouldNotThrowException() { + var contentHandler = _container.Resolve(); + contentHandler.BuildDisplay(null); + } + + [Test] + public void AllDriversShouldBeCalled() { + var driver1 = new Mock(); + var driver2 = new Mock(); + var builder = new ContainerBuilder(); + builder.RegisterInstance(driver1.Object); + builder.RegisterInstance(driver2.Object); + builder.Update(_container); + var contentHandler = _container.Resolve(); + + var contentItem = new ContentItem(); + var context = new BuildDisplayContext(null, contentItem, "", "", new Mock().Object); + + driver1.Verify(x => x.BuildDisplay(context), Times.Never()); + driver2.Verify(x => x.BuildDisplay(context), Times.Never()); + contentHandler.BuildDisplay(context); + driver1.Verify(x => x.BuildDisplay(context)); + driver2.Verify(x => x.BuildDisplay(context)); + } + + [Test, Ignore("no implementation for IZoneCollection")] + public void TestDriverCanAddDisplay() { + var driver = new StubPartDriver(); + var builder = new ContainerBuilder(); + builder.RegisterInstance(driver).As(); + builder.Update(_container); + var contentHandler = _container.Resolve(); + dynamic shapeFactory = _container.Resolve(); + + var contentItem = new ContentItem(); + contentItem.Weld(new StubPart { Foo = new[] { "a", "b", "c" } }); + + var ctx = new BuildDisplayContext(null, null, "", "", null); + var context = shapeFactory.Context(ctx); + Assert.That(context.TopMeta, Is.Null); + contentHandler.BuildDisplay(ctx); + Assert.That(context.TopMeta, Is.Not.Null); + Assert.That(context.TopMeta.Count == 1); + } + + public class StubPartDriver : ContentPartDriver { + protected override string Prefix { + get { return "Stub"; } + } + + protected override DriverResult Display(StubPart part, string displayType, dynamic shapeHelper) { + var stub = shapeHelper.Stub(Foo: string.Join(",", part.Foo)); + if (!string.IsNullOrWhiteSpace(displayType)) + stub.Metadata.Type = string.Format("{0}.{1}", stub.Metadata.Type, displayType); + return ContentShape(stub).Location("TopMeta"); + + //var viewModel = new StubViewModel { Foo = string.Join(",", part.Foo) }; + //if (displayType.StartsWith("Summary")) + // return ContentPartTemplate(viewModel, "StubViewModelTerse").Location("TopMeta"); + + //return ContentPartTemplate(viewModel).Location("TopMeta"); + } + + protected override DriverResult Editor(StubPart part, dynamic shapeHelper) { + var viewModel = new StubViewModel { Foo = string.Join(",", part.Foo) }; + return new ContentTemplateResult(viewModel, null, Prefix).Location("last", "10"); + } + + protected override DriverResult Editor(StubPart part, IUpdateModel updater, dynamic shapeHelper) { + var viewModel = new StubViewModel { Foo = string.Join(",", part.Foo) }; + updater.TryUpdateModel(viewModel, Prefix, null, null); + part.Foo = viewModel.Foo.Split(new[] { ',' }).Select(x => x.Trim()).ToArray(); + return new ContentTemplateResult(viewModel, null, Prefix).Location("last", "10"); + } + } + + public class StubPart : ContentPart { + public string[] Foo { get; set; } + } + + public class StubViewModel { + [Required] + public string Foo { get; set; } + } + } +} diff --git a/src/Orchard.Tests/ContentManagement/Handlers/DeltaPartHandler.cs b/src/Orchard.Tests/ContentManagement/Handlers/DeltaPartHandler.cs index 397e3601299..7866f220b16 100644 --- a/src/Orchard.Tests/ContentManagement/Handlers/DeltaPartHandler.cs +++ b/src/Orchard.Tests/ContentManagement/Handlers/DeltaPartHandler.cs @@ -1,13 +1,13 @@ -using Orchard.ContentManagement.Handlers; -using Orchard.Data; -using Orchard.Tests.ContentManagement.Models; -using Orchard.Tests.ContentManagement.Records; - -namespace Orchard.Tests.ContentManagement.Handlers { - public class DeltaPartHandler : ContentHandler { - public DeltaPartHandler(IRepository repository) { - Filters.Add(new ActivatingFilter("delta")); - Filters.Add(StorageFilter.For(repository)); - } - } -} +using Orchard.ContentManagement.Handlers; +using Orchard.Data; +using Orchard.Tests.ContentManagement.Models; +using Orchard.Tests.ContentManagement.Records; + +namespace Orchard.Tests.ContentManagement.Handlers { + public class DeltaPartHandler : ContentHandler { + public DeltaPartHandler(IRepository repository) { + Filters.Add(new ActivatingFilter("delta")); + Filters.Add(StorageFilter.For(repository)); + } + } +} diff --git a/src/Orchard.Tests/ContentManagement/Handlers/EpsilonPartHandler.cs b/src/Orchard.Tests/ContentManagement/Handlers/EpsilonPartHandler.cs index 914ce9ef3a1..c04ee501f0f 100644 --- a/src/Orchard.Tests/ContentManagement/Handlers/EpsilonPartHandler.cs +++ b/src/Orchard.Tests/ContentManagement/Handlers/EpsilonPartHandler.cs @@ -1,12 +1,12 @@ -using Orchard.ContentManagement.Handlers; -using Orchard.Data; -using Orchard.Tests.ContentManagement.Models; - -namespace Orchard.Tests.ContentManagement.Handlers { - public class EpsilonPartHandler : ContentHandler { - public EpsilonPartHandler(IRepository repository) { - Filters.Add(new ActivatingFilter("gamma")); - Filters.Add(StorageFilter.For(repository)); - } - } -} +using Orchard.ContentManagement.Handlers; +using Orchard.Data; +using Orchard.Tests.ContentManagement.Models; + +namespace Orchard.Tests.ContentManagement.Handlers { + public class EpsilonPartHandler : ContentHandler { + public EpsilonPartHandler(IRepository repository) { + Filters.Add(new ActivatingFilter("gamma")); + Filters.Add(StorageFilter.For(repository)); + } + } +} diff --git a/src/Orchard.Tests/ContentManagement/Handlers/FlavoredPartHandler.cs b/src/Orchard.Tests/ContentManagement/Handlers/FlavoredPartHandler.cs index c26ab9bb1bd..4e7c862c811 100644 --- a/src/Orchard.Tests/ContentManagement/Handlers/FlavoredPartHandler.cs +++ b/src/Orchard.Tests/ContentManagement/Handlers/FlavoredPartHandler.cs @@ -1,13 +1,13 @@ -using Orchard.ContentManagement.Handlers; -using Orchard.Tests.ContentManagement.Models; - -namespace Orchard.Tests.ContentManagement.Handlers { - public class FlavoredPartHandler : ContentHandler { - public FlavoredPartHandler() { - Filters.Add(new ActivatingFilter("alpha")); - Filters.Add(new ActivatingFilter("beta")); - - OnGetDisplayShape((ctx, part) => ctx.Shape.Zones["Main"].Add(part)); - } - } -} +using Orchard.ContentManagement.Handlers; +using Orchard.Tests.ContentManagement.Models; + +namespace Orchard.Tests.ContentManagement.Handlers { + public class FlavoredPartHandler : ContentHandler { + public FlavoredPartHandler() { + Filters.Add(new ActivatingFilter("alpha")); + Filters.Add(new ActivatingFilter("beta")); + + OnGetDisplayShape((ctx, part) => ctx.Shape.Zones["Main"].Add(part)); + } + } +} diff --git a/src/Orchard.Tests/ContentManagement/Handlers/GammaPartHandler.cs b/src/Orchard.Tests/ContentManagement/Handlers/GammaPartHandler.cs index 3840a97fb06..03ef9b04447 100644 --- a/src/Orchard.Tests/ContentManagement/Handlers/GammaPartHandler.cs +++ b/src/Orchard.Tests/ContentManagement/Handlers/GammaPartHandler.cs @@ -1,13 +1,13 @@ -using Orchard.ContentManagement.Handlers; -using Orchard.Data; -using Orchard.Tests.ContentManagement.Models; -using Orchard.Tests.ContentManagement.Records; - -namespace Orchard.Tests.ContentManagement.Handlers { - class GammaPartHandler : ContentHandler { - public GammaPartHandler(IRepository repository) { - Filters.Add(new ActivatingFilter("gamma")); - Filters.Add(StorageFilter.For(repository)); - } - } -} +using Orchard.ContentManagement.Handlers; +using Orchard.Data; +using Orchard.Tests.ContentManagement.Models; +using Orchard.Tests.ContentManagement.Records; + +namespace Orchard.Tests.ContentManagement.Handlers { + class GammaPartHandler : ContentHandler { + public GammaPartHandler(IRepository repository) { + Filters.Add(new ActivatingFilter("gamma")); + Filters.Add(StorageFilter.For(repository)); + } + } +} diff --git a/src/Orchard.Tests/ContentManagement/Handlers/LambdaPartHandler.cs b/src/Orchard.Tests/ContentManagement/Handlers/LambdaPartHandler.cs index 33cd2ae6f6d..348540642bd 100644 --- a/src/Orchard.Tests/ContentManagement/Handlers/LambdaPartHandler.cs +++ b/src/Orchard.Tests/ContentManagement/Handlers/LambdaPartHandler.cs @@ -1,14 +1,14 @@ -using Orchard.ContentManagement.Handlers; -using Orchard.Data; -using Orchard.Tests.ContentManagement.Models; -using Orchard.Tests.ContentManagement.Records; - -namespace Orchard.Tests.ContentManagement.Handlers { - public class LambdaPartHandler : ContentHandler { - public LambdaPartHandler(IRepository repository) { - Filters.Add(new ActivatingFilter("lambda")); - Filters.Add(StorageFilter.For(repository)); - - } - } -} +using Orchard.ContentManagement.Handlers; +using Orchard.Data; +using Orchard.Tests.ContentManagement.Models; +using Orchard.Tests.ContentManagement.Records; + +namespace Orchard.Tests.ContentManagement.Handlers { + public class LambdaPartHandler : ContentHandler { + public LambdaPartHandler(IRepository repository) { + Filters.Add(new ActivatingFilter("lambda")); + Filters.Add(StorageFilter.For(repository)); + + } + } +} diff --git a/src/Orchard.Tests/ContentManagement/Handlers/ModelBuilderTests.cs b/src/Orchard.Tests/ContentManagement/Handlers/ModelBuilderTests.cs index 28c3c21a289..69a19ec7ada 100644 --- a/src/Orchard.Tests/ContentManagement/Handlers/ModelBuilderTests.cs +++ b/src/Orchard.Tests/ContentManagement/Handlers/ModelBuilderTests.cs @@ -1,37 +1,37 @@ -using NUnit.Framework; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Handlers; -using Orchard.ContentManagement.MetaData.Builders; -using Orchard.Tests.ContentManagement.Models; - -namespace Orchard.Tests.ContentManagement.Handlers { - [TestFixture] - public class ModelBuilderTests { - [Test] - public void BuilderShouldReturnWorkingModelWithTypeAndId() { - var builder = new ContentItemBuilder(new ContentTypeDefinitionBuilder().Named("foo").Build()); - var model = builder.Build(); - Assert.That(model.ContentType, Is.EqualTo("foo")); - } - - [Test] - public void IdShouldDefaultToZero() { - var builder = new ContentItemBuilder(new ContentTypeDefinitionBuilder().Named("foo").Build()); - var model = builder.Build(); - Assert.That(model.Id, Is.EqualTo(0)); - } - - [Test] - public void WeldShouldAddPartToModel() { - var builder = new ContentItemBuilder(new ContentTypeDefinitionBuilder().Named("foo").Build()); - builder.Weld(); - var model = builder.Build(); - - Assert.That(model.Is(), Is.True); - Assert.That(model.As(), Is.Not.Null); - Assert.That(model.Is(), Is.False); - Assert.That(model.As(), Is.Null); - } - } -} - +using NUnit.Framework; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Handlers; +using Orchard.ContentManagement.MetaData.Builders; +using Orchard.Tests.ContentManagement.Models; + +namespace Orchard.Tests.ContentManagement.Handlers { + [TestFixture] + public class ModelBuilderTests { + [Test] + public void BuilderShouldReturnWorkingModelWithTypeAndId() { + var builder = new ContentItemBuilder(new ContentTypeDefinitionBuilder().Named("foo").Build()); + var model = builder.Build(); + Assert.That(model.ContentType, Is.EqualTo("foo")); + } + + [Test] + public void IdShouldDefaultToZero() { + var builder = new ContentItemBuilder(new ContentTypeDefinitionBuilder().Named("foo").Build()); + var model = builder.Build(); + Assert.That(model.Id, Is.EqualTo(0)); + } + + [Test] + public void WeldShouldAddPartToModel() { + var builder = new ContentItemBuilder(new ContentTypeDefinitionBuilder().Named("foo").Build()); + builder.Weld(); + var model = builder.Build(); + + Assert.That(model.Is(), Is.True); + Assert.That(model.As(), Is.Not.Null); + Assert.That(model.Is(), Is.False); + Assert.That(model.As(), Is.Null); + } + } +} + diff --git a/src/Orchard.Tests/ContentManagement/HqlExpressionTests.cs b/src/Orchard.Tests/ContentManagement/HqlExpressionTests.cs index a6ee9a15391..00136f4d0d3 100644 --- a/src/Orchard.Tests/ContentManagement/HqlExpressionTests.cs +++ b/src/Orchard.Tests/ContentManagement/HqlExpressionTests.cs @@ -1,1043 +1,1043 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Autofac; -using Moq; -using NHibernate; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.ContentManagement.MetaData; -using Orchard.Data; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Handlers; -using Orchard.ContentManagement.Records; -using Orchard.Data.Providers; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.Environment.Configuration; -using Orchard.Environment.Extensions; -using Orchard.Tests.ContentManagement.Handlers; -using Orchard.Tests.ContentManagement.Records; -using Orchard.Tests.ContentManagement.Models; -using Orchard.DisplayManagement.Implementation; -using Orchard.Tests.Stubs; -using Orchard.UI.PageClass; - -namespace Orchard.Tests.ContentManagement { - [TestFixture] - public class HqlExpressionTests { - private IContainer _container; - private IContentManager _manager; - private ISessionFactory _sessionFactory; - private ISession _session; - - [TestFixtureSetUp] - public void InitFixture() { - var databaseFileName = System.IO.Path.GetTempFileName(); - _sessionFactory = DataUtility.CreateSessionFactory( - databaseFileName, - typeof(GammaRecord), - typeof(DeltaRecord), - typeof(EpsilonRecord), - typeof(LambdaRecord), - typeof(ContentItemVersionRecord), - typeof(ContentItemRecord), - typeof(ContentTypeRecord)); - } - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - - builder.RegisterModule(new ContentModule()); - builder.RegisterType().As().SingleInstance(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataProvider = "SqlCe" }); - builder.RegisterType().As(); - builder.RegisterType().As(); - - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); - - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - - _session = _sessionFactory.OpenSession(); - builder.RegisterInstance(new TestTransactionManager(_session)).As(); - - _session.Delete(string.Format("from {0}", typeof(GammaRecord).FullName)); - _session.Delete(string.Format("from {0}", typeof(DeltaRecord).FullName)); - _session.Delete(string.Format("from {0}", typeof(EpsilonRecord).FullName)); - _session.Delete(string.Format("from {0}", typeof(LambdaRecord).FullName)); - - _session.Delete(string.Format("from {0}", typeof(ContentItemVersionRecord).FullName)); - _session.Delete(string.Format("from {0}", typeof(ContentItemRecord).FullName)); - _session.Delete(string.Format("from {0}", typeof(ContentTypeRecord).FullName)); - _session.Flush(); - _session.Clear(); - - _container = builder.Build(); - _manager = _container.Resolve(); - - } - - [TearDown] - public void Cleanup() { - if (_container != null) - _container.Dispose(); - } - - [Test] - public void AllDataTypesCanBeQueried() { - var dt = DateTime.Now; - - _manager.Create("lambda", init => { - init.Record.BooleanStuff = true; - init.Record.DecimalStuff = 0; - init.Record.DoubleStuff = 0; - init.Record.FloatStuff = 0; - init.Record.IntegerStuff = 0; - init.Record.LongStuff = 0; - init.Record.StringStuff = "0"; - init.Record.DateTimeStuff = dt; - }); - _session.Flush(); - - var lambda = _manager.HqlQuery().ForType("lambda").List(); - Assert.That(lambda.Count(), Is.EqualTo(1)); - - lambda = _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), x => x.Eq("BooleanStuff", true)).List(); - Assert.That(lambda.Count(), Is.EqualTo(1)); - - lambda = _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), x => x.Eq("DecimalStuff", (decimal)0.0)).List(); - Assert.That(lambda.Count(), Is.EqualTo(1)); - - lambda = _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), x => x.Eq("DoubleStuff", 0.0)).List(); - Assert.That(lambda.Count(), Is.EqualTo(1)); - - lambda = _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), x => x.Eq("FloatStuff", (float)0.0)).List(); - Assert.That(lambda.Count(), Is.EqualTo(1)); - - lambda = _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), x => x.Eq("IntegerStuff", 0)).List(); - Assert.That(lambda.Count(), Is.EqualTo(1)); - - lambda = _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), x => x.Eq("LongStuff", (long)0)).List(); - Assert.That(lambda.Count(), Is.EqualTo(1)); - - lambda = _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), x => x.Eq("StringStuff", "0")).List(); - Assert.That(lambda.Count(), Is.EqualTo(1)); - - lambda = _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), x => x.Eq("DateTimeStuff", dt)).List(); - Assert.That(lambda.Count(), Is.EqualTo(1)); - } - - [Test] - public void ShouldQueryUsingOperatorLike() { - _manager.Create("lambda", init => { - init.Record.StringStuff = "abcdef"; - }); - _session.Flush(); - - var result = _manager.HqlQuery().ForType("lambda").List(); - Assert.That(result.Count(), Is.EqualTo(1)); - - Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); - - result = queryWhere(x => x.Like("StringStuff", "bc", HqlMatchMode.Anywhere)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Like("StringStuff", "bc'", HqlMatchMode.Anywhere)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Like("StringStuff", "ab", HqlMatchMode.Anywhere)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Like("StringStuff", "ef", HqlMatchMode.Anywhere)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Like("StringStuff", "gh", HqlMatchMode.Anywhere)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Like("StringStuff", "ab", HqlMatchMode.Start)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Like("StringStuff", "ef", HqlMatchMode.End)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Like("StringStuff", "abcdef", HqlMatchMode.Exact)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Like("StringStuff", "abcde", HqlMatchMode.Exact)); - Assert.That(result.Count(), Is.EqualTo(0)); - - // default collation in SQL Ce/Server but can be changed during db creation - result = queryWhere(x => x.Like("StringStuff", "EF", HqlMatchMode.Anywhere)); - Assert.That(result.Count(), Is.EqualTo(1)); - } - - [Test] - public void ShouldQueryUsingOperatorInsensitiveLike() { - _manager.Create("lambda", init => { - init.Record.StringStuff = "abcdef"; - }); - _session.Flush(); - - var result = _manager.HqlQuery().ForType("lambda").List(); - Assert.That(result.Count(), Is.EqualTo(1)); - - Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); - - result = queryWhere(x => x.InsensitiveLike("StringStuff", "bc", HqlMatchMode.Anywhere)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.InsensitiveLike("StringStuff", "ab", HqlMatchMode.Anywhere)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.InsensitiveLike("StringStuff", "ef", HqlMatchMode.Anywhere)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.InsensitiveLike("StringStuff", "gh", HqlMatchMode.Anywhere)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.InsensitiveLike("StringStuff", "ab", HqlMatchMode.Start)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.InsensitiveLike("StringStuff", "ef", HqlMatchMode.End)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.InsensitiveLike("StringStuff", "abcdef", HqlMatchMode.Exact)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.InsensitiveLike("StringStuff", "abcde", HqlMatchMode.Exact)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.InsensitiveLike("StringStuff", "EF", HqlMatchMode.Anywhere)); - Assert.That(result.Count(), Is.EqualTo(1)); - } - - [Test] - public void ShouldQueryUsingOperatorGt() { - var dt = new DateTime(1980,1,1); - - _manager.Create("lambda", init => { - init.Record.BooleanStuff = true; - init.Record.DecimalStuff = 0; - init.Record.DoubleStuff = 0; - init.Record.FloatStuff = 0; - init.Record.IntegerStuff = 0; - init.Record.LongStuff = 0; - init.Record.StringStuff = "0"; - init.Record.DateTimeStuff = dt; - }); - _session.Flush(); - - var result = _manager.HqlQuery().ForType("lambda").List(); - Assert.That(result.Count(), Is.EqualTo(1)); - - Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); - - result = queryWhere(x => x.Gt("BooleanStuff", true)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Gt("DecimalStuff", 0)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Gt("DoubleStuff", 0)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Gt("FloatStuff", 0)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Gt("IntegerStuff", 0)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Gt("LongStuff", 0)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Gt("StringStuff", "0")); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Gt("DateTimeStuff", dt)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Gt("BooleanStuff", false)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Gt("DecimalStuff", -1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Gt("DoubleStuff", -1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Gt("FloatStuff", -1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Gt("IntegerStuff", -1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Gt("LongStuff", -1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Gt("StringStuff", "")); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Gt("DateTimeStuff", dt.AddDays(-1))); - Assert.That(result.Count(), Is.EqualTo(1)); - - } - - [Test] - public void ShouldQueryUsingOperatorLt() { - var dt = new DateTime(1980, 1, 1); - - _manager.Create("lambda", init => { - init.Record.BooleanStuff = false; - init.Record.DecimalStuff = 0; - init.Record.DoubleStuff = 0; - init.Record.FloatStuff = 0; - init.Record.IntegerStuff = 0; - init.Record.LongStuff = 0; - init.Record.StringStuff = "0"; - init.Record.DateTimeStuff = dt; - }); - _session.Flush(); - - var result = _manager.HqlQuery().ForType("lambda").List(); - Assert.That(result.Count(), Is.EqualTo(1)); - - Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); - - result = queryWhere(x => x.Lt("BooleanStuff", false)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Lt("DecimalStuff", 0)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Lt("DoubleStuff", 0)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Lt("FloatStuff", 0)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Lt("IntegerStuff", 0)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Lt("LongStuff", 0)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Lt("StringStuff", "0")); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Lt("DateTimeStuff", dt)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Lt("BooleanStuff", true)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Lt("DecimalStuff", 1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Lt("DoubleStuff", 1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Lt("FloatStuff", 1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Lt("IntegerStuff", 1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Lt("LongStuff", 1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Lt("StringStuff", "00")); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Lt("DateTimeStuff", dt.AddDays(1))); - Assert.That(result.Count(), Is.EqualTo(1)); - - } - - - [Test] - public void ShouldQueryUsingOperatorLe() { - var dt = new DateTime(1980, 1, 1); - - _manager.Create("lambda", init => { - init.Record.BooleanStuff = false; - init.Record.DecimalStuff = 0; - init.Record.DoubleStuff = 0; - init.Record.FloatStuff = 0; - init.Record.IntegerStuff = 0; - init.Record.LongStuff = 0; - init.Record.StringStuff = "0"; - init.Record.DateTimeStuff = dt; - }); - _session.Flush(); - - var result = _manager.HqlQuery().ForType("lambda").List(); - Assert.That(result.Count(), Is.EqualTo(1)); - - Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); - - // equal - result = queryWhere(x => x.Le("BooleanStuff", false)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Le("DecimalStuff", 0)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Le("DoubleStuff", 0)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Le("FloatStuff", 0)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Le("IntegerStuff", 0)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Le("LongStuff", 0)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Le("StringStuff", "0")); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Le("DateTimeStuff", dt)); - Assert.That(result.Count(), Is.EqualTo(1)); - - // greater values - result = queryWhere(x => x.Le("BooleanStuff", true)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Le("DecimalStuff", 1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Le("DoubleStuff", 1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Le("FloatStuff", 1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Le("IntegerStuff", 1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Le("LongStuff", 1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Le("StringStuff", "00")); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Le("DateTimeStuff", dt.AddDays(1))); - Assert.That(result.Count(), Is.EqualTo(1)); - - // lower values - result = queryWhere(x => x.Le("DecimalStuff", -1)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Le("DoubleStuff", -1)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Le("FloatStuff", -1)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Le("IntegerStuff", -1)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Le("LongStuff", -1)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Le("StringStuff", "")); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Le("DateTimeStuff", dt.AddDays(-1))); - Assert.That(result.Count(), Is.EqualTo(0)); - - } - - [Test] - public void ShouldQueryUsingOperatorGe() { - var dt = new DateTime(1980, 1, 1); - - _manager.Create("lambda", init => { - init.Record.BooleanStuff = false; - init.Record.DecimalStuff = 0; - init.Record.DoubleStuff = 0; - init.Record.FloatStuff = 0; - init.Record.IntegerStuff = 0; - init.Record.LongStuff = 0; - init.Record.StringStuff = "0"; - init.Record.DateTimeStuff = dt; - }); - _session.Flush(); - - var result = _manager.HqlQuery().ForType("lambda").List(); - Assert.That(result.Count(), Is.EqualTo(1)); - - Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); - - // equal - result = queryWhere(x => x.Ge("BooleanStuff", false)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Ge("DecimalStuff", 0)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Ge("DoubleStuff", 0)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Ge("FloatStuff", 0)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Ge("IntegerStuff", 0)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Ge("LongStuff", 0)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Ge("StringStuff", "0")); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Ge("DateTimeStuff", dt)); - Assert.That(result.Count(), Is.EqualTo(1)); - - // greater values - result = queryWhere(x => x.Ge("BooleanStuff", true)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Ge("DecimalStuff", 1)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Ge("DoubleStuff", 1)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Ge("FloatStuff", 1)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Ge("IntegerStuff", 1)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Ge("LongStuff", 1)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Ge("StringStuff", "00")); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Ge("DateTimeStuff", dt.AddDays(1))); - Assert.That(result.Count(), Is.EqualTo(0)); - - // lower values - result = queryWhere(x => x.Ge("DecimalStuff", -1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Ge("DoubleStuff", -1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Ge("FloatStuff", -1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Ge("IntegerStuff", -1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Ge("LongStuff", -1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Ge("StringStuff", "")); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Ge("DateTimeStuff", dt.AddDays(-1))); - Assert.That(result.Count(), Is.EqualTo(1)); - - } - - [Test] - public void ShouldQueryUsingOperatorBetween() { - var dt = new DateTime(1980, 1, 1); - - _manager.Create("lambda", init => { - init.Record.BooleanStuff = false; - init.Record.DecimalStuff = 0; - init.Record.DoubleStuff = 0; - init.Record.FloatStuff = 0; - init.Record.IntegerStuff = 0; - init.Record.LongStuff = 0; - init.Record.StringStuff = "0"; - init.Record.DateTimeStuff = dt; - }); - _session.Flush(); - - var result = _manager.HqlQuery().ForType("lambda").List(); - Assert.That(result.Count(), Is.EqualTo(1)); - - Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); - - // include - result = queryWhere(x => x.Between("DecimalStuff", 0, 1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Between("DoubleStuff", 0, 1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Between("FloatStuff", 0, 1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Between("IntegerStuff", 0, 1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Between("LongStuff", 0, 1)); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Between("StringStuff", "0", "1")); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.Between("DateTimeStuff", dt, dt.AddDays(1))); - Assert.That(result.Count(), Is.EqualTo(1)); - - // exclude - result = queryWhere(x => x.Between("DecimalStuff", 1, 2)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Between("DoubleStuff", 1, 2)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Between("FloatStuff", 1, 2)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Between("IntegerStuff", 1, 2)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Between("LongStuff", 1, 2)); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Between("StringStuff", "1", "2")); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.Between("DateTimeStuff", dt.AddDays(1), dt.AddDays(2))); - Assert.That(result.Count(), Is.EqualTo(0)); - - } - - [Test] - public void ShouldQueryUsingOperatorIn() { - var dt = new DateTime(1980, 1, 1); - - _manager.Create("lambda", init => { - init.Record.BooleanStuff = false; - init.Record.DecimalStuff = 0; - init.Record.DoubleStuff = 0; - init.Record.FloatStuff = 0; - init.Record.IntegerStuff = 0; - init.Record.LongStuff = 0; - init.Record.StringStuff = "0"; - init.Record.DateTimeStuff = dt; - }); - _session.Flush(); - - var result = _manager.HqlQuery().ForType("lambda").List(); - Assert.That(result.Count(), Is.EqualTo(1)); - - Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); - - // include - result = queryWhere(x => x.In("BooleanStuff", new[] { false })); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.In("DecimalStuff", new[] { 0, 1 })); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.In("DoubleStuff", new[] { 0, 1 })); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.In("FloatStuff", new[] { 0, 1 })); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.In("IntegerStuff", new[] { 0, 1 })); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.In("LongStuff", new[] { 0, 1 })); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.In("StringStuff", new[] { "0", "1" })); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.In("DateTimeStuff", new [] {dt, dt.AddDays(1)})); - Assert.That(result.Count(), Is.EqualTo(1)); - - // exclude - result = queryWhere(x => x.In("BooleanStuff", new[] { true })); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.In("DecimalStuff", new[] { 1, 2 })); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.In("DoubleStuff", new[] { 1, 2 })); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.In("FloatStuff", new[] { 1, 2 })); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.In("IntegerStuff", new[] { 1, 2 })); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.In("LongStuff", new[] { 1, 2 })); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.In("StringStuff", new[] { "1", "2" })); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.In("DateTimeStuff", new [] {dt.AddDays(1), dt.AddDays(2)})); - Assert.That(result.Count(), Is.EqualTo(0)); - - } - - [Test] - public void ShouldQueryUsingOperatorIsNull() { - _manager.Create("lambda", init => { - init.Record.BooleanStuff = false; - init.Record.StringStuff = null; - }); - _session.Flush(); - - var result = _manager.HqlQuery().ForType("lambda").List(); - Assert.That(result.Count(), Is.EqualTo(1)); - - Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); - - result = queryWhere(x => x.IsNull("BooleanStuff")); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.IsNull("StringStuff")); - Assert.That(result.Count(), Is.EqualTo(1)); - } - - [Test] - public void ShouldQueryUsingOperatorIsNotNull() { - _manager.Create("lambda", init => { - init.Record.BooleanStuff = false; - init.Record.StringStuff = null; - }); - _session.Flush(); - - var result = _manager.HqlQuery().ForType("lambda").List(); - Assert.That(result.Count(), Is.EqualTo(1)); - - Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); - - result = queryWhere(x => x.IsNotNull("BooleanStuff")); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.IsNotNull("StringStuff")); - Assert.That(result.Count(), Is.EqualTo(0)); - } - - [Test] - public void ShouldQueryUsingOperatorEqProperty() { - var dt = new DateTime(1980, 1, 1); - - _manager.Create("lambda", init => { - init.Record.BooleanStuff = false; - init.Record.DecimalStuff = 0; - init.Record.DoubleStuff = 0; - init.Record.FloatStuff = 0; - init.Record.IntegerStuff = 0; - init.Record.LongStuff = 0; - init.Record.StringStuff = "0"; - init.Record.DateTimeStuff = dt; - }); - _session.Flush(); - - var result = _manager.HqlQuery().ForType("lambda").List(); - Assert.That(result.Count(), Is.EqualTo(1)); - - Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); - - result = queryWhere(x => x.EqProperty("BooleanStuff", "LongStuff")); - Assert.That(result.Count(), Is.EqualTo(1)); - - result = queryWhere(x => x.EqProperty("DateTimeStuff", "LongStuff")); - Assert.That(result.Count(), Is.EqualTo(0)); - } - - [Test] - public void ShouldQueryUsingOperatorNotEqProperty() { - var dt = new DateTime(1980, 1, 1); - - _manager.Create("lambda", init => { - init.Record.BooleanStuff = false; - init.Record.DecimalStuff = 0; - init.Record.DoubleStuff = 0; - init.Record.FloatStuff = 0; - init.Record.IntegerStuff = 0; - init.Record.LongStuff = 0; - init.Record.StringStuff = "0"; - init.Record.DateTimeStuff = dt; - }); - _session.Flush(); - - var result = _manager.HqlQuery().ForType("lambda").List(); - Assert.That(result.Count(), Is.EqualTo(1)); - - Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); - - result = queryWhere(x => x.NotEqProperty("BooleanStuff", "LongStuff")); - Assert.That(result.Count(), Is.EqualTo(0)); - - result = queryWhere(x => x.NotEqProperty("DateTimeStuff", "LongStuff")); - Assert.That(result.Count(), Is.EqualTo(1)); - } - - [Test] - public void ShouldQueryUsingOperatorGtProperty() { - var dt = new DateTime(1980, 1, 1); - - _manager.Create("lambda", init => { - init.Record.BooleanStuff = false; - init.Record.DecimalStuff = 0; - init.Record.DoubleStuff = 0; - init.Record.FloatStuff = 0; - init.Record.IntegerStuff = 1; - init.Record.LongStuff = 2; - init.Record.StringStuff = "0"; - init.Record.DateTimeStuff = dt; - }); - _session.Flush(); - - var result = _manager.HqlQuery().ForType("lambda").List(); - Assert.That(result.Count(), Is.EqualTo(1)); - - Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); - - // equal - result = queryWhere(x => x.GtProperty("DoubleStuff", "FloatStuff")); - Assert.That(result.Count(), Is.EqualTo(0)); - - // lesser - result = queryWhere(x => x.GtProperty("FloatStuff", "IntegerStuff")); - Assert.That(result.Count(), Is.EqualTo(0)); - - // greater - result = queryWhere(x => x.GtProperty("IntegerStuff", "FloatStuff")); - Assert.That(result.Count(), Is.EqualTo(1)); - } - - - [Test] - public void ShouldQueryUsingOperatorGeProperty() { - var dt = new DateTime(1980, 1, 1); - - _manager.Create("lambda", init => { - init.Record.BooleanStuff = false; - init.Record.DecimalStuff = 0; - init.Record.DoubleStuff = 0; - init.Record.FloatStuff = 0; - init.Record.IntegerStuff = 1; - init.Record.LongStuff = 2; - init.Record.StringStuff = "0"; - init.Record.DateTimeStuff = dt; - }); - _session.Flush(); - - var result = _manager.HqlQuery().ForType("lambda").List(); - Assert.That(result.Count(), Is.EqualTo(1)); - - Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); - - // equal - result = queryWhere(x => x.GeProperty("DoubleStuff", "FloatStuff")); - Assert.That(result.Count(), Is.EqualTo(1)); - - // lesser - result = queryWhere(x => x.GeProperty("FloatStuff", "IntegerStuff")); - Assert.That(result.Count(), Is.EqualTo(0)); - - // greater - result = queryWhere(x => x.GeProperty("IntegerStuff", "FloatStuff")); - Assert.That(result.Count(), Is.EqualTo(1)); - } - - [Test] - public void ShouldQueryUsingOperatorLeProperty() { - var dt = new DateTime(1980, 1, 1); - - _manager.Create("lambda", init => { - init.Record.BooleanStuff = false; - init.Record.DecimalStuff = 0; - init.Record.DoubleStuff = 0; - init.Record.FloatStuff = 0; - init.Record.IntegerStuff = 1; - init.Record.LongStuff = 2; - init.Record.StringStuff = "0"; - init.Record.DateTimeStuff = dt; - }); - _session.Flush(); - - var result = _manager.HqlQuery().ForType("lambda").List(); - Assert.That(result.Count(), Is.EqualTo(1)); - - Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); - - // equal - result = queryWhere(x => x.LeProperty("DoubleStuff", "FloatStuff")); - Assert.That(result.Count(), Is.EqualTo(1)); - - // lesser - result = queryWhere(x => x.LeProperty("FloatStuff", "IntegerStuff")); - Assert.That(result.Count(), Is.EqualTo(1)); - - // greater - result = queryWhere(x => x.LeProperty("IntegerStuff", "FloatStuff")); - Assert.That(result.Count(), Is.EqualTo(0)); - } - - - [Test] - public void ShouldQueryUsingOperatorLtProperty() { - var dt = new DateTime(1980, 1, 1); - - _manager.Create("lambda", init => { - init.Record.BooleanStuff = false; - init.Record.DecimalStuff = 0; - init.Record.DoubleStuff = 0; - init.Record.FloatStuff = 0; - init.Record.IntegerStuff = 1; - init.Record.LongStuff = 2; - init.Record.StringStuff = "0"; - init.Record.DateTimeStuff = dt; - }); - _session.Flush(); - - var result = _manager.HqlQuery().ForType("lambda").List(); - Assert.That(result.Count(), Is.EqualTo(1)); - - Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); - - // equal - result = queryWhere(x => x.LtProperty("DoubleStuff", "FloatStuff")); - Assert.That(result.Count(), Is.EqualTo(0)); - - // lesser - result = queryWhere(x => x.LtProperty("FloatStuff", "IntegerStuff")); - Assert.That(result.Count(), Is.EqualTo(1)); - - // greater - result = queryWhere(x => x.LtProperty("IntegerStuff", "FloatStuff")); - Assert.That(result.Count(), Is.EqualTo(0)); - } - - [Test] - public void ShouldSortRandomly() { - _manager.Create("lambda", init => { - init.Record.IntegerStuff = 1; - }); - - _manager.Create("lambda", init => { - init.Record.IntegerStuff = 2; - }); - - _manager.Create("lambda", init => { - init.Record.IntegerStuff = 3; - }); - _session.Flush(); - - var result = _manager.HqlQuery().ForType("lambda").List(); - Assert.That(result.Count(), Is.EqualTo(3)); - - var firstResults = new List(); - - for (int i = 0; i < 10; i++) { - result = _manager.HqlQuery().Join(alias => alias.ContentPartRecord()).OrderBy(x => x.Named("civ"), order => order.Random()).List(); - firstResults.Add(result.First().As().Record.IntegerStuff); - } - - Assert.That(firstResults.Distinct().Count(), Is.GreaterThan(1)); - } - - [Test] - public void ShouldPageResults() { - _manager.Create("lambda", init => { - init.Record.IntegerStuff = 1; - }); - - _manager.Create("lambda", init => { - init.Record.IntegerStuff = 2; - }); - - _manager.Create("lambda", init => { - init.Record.IntegerStuff = 3; - }); - _session.Flush(); - - var results = _manager.HqlQuery().Join(alias => alias.ContentPartRecord()).OrderBy(x => x.ContentPartRecord(), order => order.Asc("IntegerStuff")).Slice(1,1); - Assert.That(results.Count(), Is.EqualTo(1)); - Assert.That(results.Single().As().Record.IntegerStuff, Is.EqualTo(2)); - } - - [Test] - public void ShouldSortByProperty() { - var dt = new DateTime(1980, 1, 1); - - _manager.Create("lambda", init => { - init.Record.IntegerStuff = 1; - }); - - _manager.Create("lambda", init => { - init.Record.IntegerStuff = 2; - }); - - _manager.Create("lambda", init => { - init.Record.IntegerStuff = 3; - }); - _session.Flush(); - - var results =_manager.HqlQuery().Join(alias => alias.ContentPartRecord()).OrderBy(x => x.ContentPartRecord(), order => order.Asc("IntegerStuff")).List(); - Assert.That(results.Count(), Is.EqualTo(3)); - - Assert.That(results.Skip(0).First().As().Record.IntegerStuff, Is.EqualTo(1)); - Assert.That(results.Skip(1).First().As().Record.IntegerStuff, Is.EqualTo(2)); - Assert.That(results.Skip(2).First().As().Record.IntegerStuff, Is.EqualTo(3)); - } - - [Test] - public void ShouldQueryUsingOperatorNot() { - var dt = new DateTime(1980, 1, 1); - - _manager.Create("lambda", init => { - init.Record.BooleanStuff = false; - init.Record.DecimalStuff = 0; - init.Record.DoubleStuff = 0; - init.Record.FloatStuff = 0; - init.Record.IntegerStuff = 1; - init.Record.LongStuff = 2; - init.Record.StringStuff = "0"; - init.Record.DateTimeStuff = dt; - }); - _session.Flush(); - - var result = _manager.HqlQuery().ForType("lambda").List(); - Assert.That(result.Count(), Is.EqualTo(1)); - - Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); - - // equal - result = queryWhere(x => x.Not(y => y.LtProperty("DoubleStuff", "FloatStuff"))); - Assert.That(result.Count(), Is.EqualTo(1)); - } - } -} - - - +using System; +using System.Collections.Generic; +using System.Linq; +using Autofac; +using Moq; +using NHibernate; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.ContentManagement.MetaData; +using Orchard.Data; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Handlers; +using Orchard.ContentManagement.Records; +using Orchard.Data.Providers; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.Environment.Configuration; +using Orchard.Environment.Extensions; +using Orchard.Tests.ContentManagement.Handlers; +using Orchard.Tests.ContentManagement.Records; +using Orchard.Tests.ContentManagement.Models; +using Orchard.DisplayManagement.Implementation; +using Orchard.Tests.Stubs; +using Orchard.UI.PageClass; + +namespace Orchard.Tests.ContentManagement { + [TestFixture] + public class HqlExpressionTests { + private IContainer _container; + private IContentManager _manager; + private ISessionFactory _sessionFactory; + private ISession _session; + + [TestFixtureSetUp] + public void InitFixture() { + var databaseFileName = System.IO.Path.GetTempFileName(); + _sessionFactory = DataUtility.CreateSessionFactory( + databaseFileName, + typeof(GammaRecord), + typeof(DeltaRecord), + typeof(EpsilonRecord), + typeof(LambdaRecord), + typeof(ContentItemVersionRecord), + typeof(ContentItemRecord), + typeof(ContentTypeRecord)); + } + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + + builder.RegisterModule(new ContentModule()); + builder.RegisterType().As().SingleInstance(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataProvider = "SqlCe" }); + builder.RegisterType().As(); + builder.RegisterType().As(); + + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); + + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + + _session = _sessionFactory.OpenSession(); + builder.RegisterInstance(new TestTransactionManager(_session)).As(); + + _session.Delete(string.Format("from {0}", typeof(GammaRecord).FullName)); + _session.Delete(string.Format("from {0}", typeof(DeltaRecord).FullName)); + _session.Delete(string.Format("from {0}", typeof(EpsilonRecord).FullName)); + _session.Delete(string.Format("from {0}", typeof(LambdaRecord).FullName)); + + _session.Delete(string.Format("from {0}", typeof(ContentItemVersionRecord).FullName)); + _session.Delete(string.Format("from {0}", typeof(ContentItemRecord).FullName)); + _session.Delete(string.Format("from {0}", typeof(ContentTypeRecord).FullName)); + _session.Flush(); + _session.Clear(); + + _container = builder.Build(); + _manager = _container.Resolve(); + + } + + [TearDown] + public void Cleanup() { + if (_container != null) + _container.Dispose(); + } + + [Test] + public void AllDataTypesCanBeQueried() { + var dt = DateTime.Now; + + _manager.Create("lambda", init => { + init.Record.BooleanStuff = true; + init.Record.DecimalStuff = 0; + init.Record.DoubleStuff = 0; + init.Record.FloatStuff = 0; + init.Record.IntegerStuff = 0; + init.Record.LongStuff = 0; + init.Record.StringStuff = "0"; + init.Record.DateTimeStuff = dt; + }); + _session.Flush(); + + var lambda = _manager.HqlQuery().ForType("lambda").List(); + Assert.That(lambda.Count(), Is.EqualTo(1)); + + lambda = _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), x => x.Eq("BooleanStuff", true)).List(); + Assert.That(lambda.Count(), Is.EqualTo(1)); + + lambda = _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), x => x.Eq("DecimalStuff", (decimal)0.0)).List(); + Assert.That(lambda.Count(), Is.EqualTo(1)); + + lambda = _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), x => x.Eq("DoubleStuff", 0.0)).List(); + Assert.That(lambda.Count(), Is.EqualTo(1)); + + lambda = _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), x => x.Eq("FloatStuff", (float)0.0)).List(); + Assert.That(lambda.Count(), Is.EqualTo(1)); + + lambda = _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), x => x.Eq("IntegerStuff", 0)).List(); + Assert.That(lambda.Count(), Is.EqualTo(1)); + + lambda = _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), x => x.Eq("LongStuff", (long)0)).List(); + Assert.That(lambda.Count(), Is.EqualTo(1)); + + lambda = _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), x => x.Eq("StringStuff", "0")).List(); + Assert.That(lambda.Count(), Is.EqualTo(1)); + + lambda = _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), x => x.Eq("DateTimeStuff", dt)).List(); + Assert.That(lambda.Count(), Is.EqualTo(1)); + } + + [Test] + public void ShouldQueryUsingOperatorLike() { + _manager.Create("lambda", init => { + init.Record.StringStuff = "abcdef"; + }); + _session.Flush(); + + var result = _manager.HqlQuery().ForType("lambda").List(); + Assert.That(result.Count(), Is.EqualTo(1)); + + Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); + + result = queryWhere(x => x.Like("StringStuff", "bc", HqlMatchMode.Anywhere)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Like("StringStuff", "bc'", HqlMatchMode.Anywhere)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Like("StringStuff", "ab", HqlMatchMode.Anywhere)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Like("StringStuff", "ef", HqlMatchMode.Anywhere)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Like("StringStuff", "gh", HqlMatchMode.Anywhere)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Like("StringStuff", "ab", HqlMatchMode.Start)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Like("StringStuff", "ef", HqlMatchMode.End)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Like("StringStuff", "abcdef", HqlMatchMode.Exact)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Like("StringStuff", "abcde", HqlMatchMode.Exact)); + Assert.That(result.Count(), Is.EqualTo(0)); + + // default collation in SQL Ce/Server but can be changed during db creation + result = queryWhere(x => x.Like("StringStuff", "EF", HqlMatchMode.Anywhere)); + Assert.That(result.Count(), Is.EqualTo(1)); + } + + [Test] + public void ShouldQueryUsingOperatorInsensitiveLike() { + _manager.Create("lambda", init => { + init.Record.StringStuff = "abcdef"; + }); + _session.Flush(); + + var result = _manager.HqlQuery().ForType("lambda").List(); + Assert.That(result.Count(), Is.EqualTo(1)); + + Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); + + result = queryWhere(x => x.InsensitiveLike("StringStuff", "bc", HqlMatchMode.Anywhere)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.InsensitiveLike("StringStuff", "ab", HqlMatchMode.Anywhere)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.InsensitiveLike("StringStuff", "ef", HqlMatchMode.Anywhere)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.InsensitiveLike("StringStuff", "gh", HqlMatchMode.Anywhere)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.InsensitiveLike("StringStuff", "ab", HqlMatchMode.Start)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.InsensitiveLike("StringStuff", "ef", HqlMatchMode.End)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.InsensitiveLike("StringStuff", "abcdef", HqlMatchMode.Exact)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.InsensitiveLike("StringStuff", "abcde", HqlMatchMode.Exact)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.InsensitiveLike("StringStuff", "EF", HqlMatchMode.Anywhere)); + Assert.That(result.Count(), Is.EqualTo(1)); + } + + [Test] + public void ShouldQueryUsingOperatorGt() { + var dt = new DateTime(1980,1,1); + + _manager.Create("lambda", init => { + init.Record.BooleanStuff = true; + init.Record.DecimalStuff = 0; + init.Record.DoubleStuff = 0; + init.Record.FloatStuff = 0; + init.Record.IntegerStuff = 0; + init.Record.LongStuff = 0; + init.Record.StringStuff = "0"; + init.Record.DateTimeStuff = dt; + }); + _session.Flush(); + + var result = _manager.HqlQuery().ForType("lambda").List(); + Assert.That(result.Count(), Is.EqualTo(1)); + + Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); + + result = queryWhere(x => x.Gt("BooleanStuff", true)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Gt("DecimalStuff", 0)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Gt("DoubleStuff", 0)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Gt("FloatStuff", 0)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Gt("IntegerStuff", 0)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Gt("LongStuff", 0)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Gt("StringStuff", "0")); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Gt("DateTimeStuff", dt)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Gt("BooleanStuff", false)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Gt("DecimalStuff", -1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Gt("DoubleStuff", -1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Gt("FloatStuff", -1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Gt("IntegerStuff", -1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Gt("LongStuff", -1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Gt("StringStuff", "")); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Gt("DateTimeStuff", dt.AddDays(-1))); + Assert.That(result.Count(), Is.EqualTo(1)); + + } + + [Test] + public void ShouldQueryUsingOperatorLt() { + var dt = new DateTime(1980, 1, 1); + + _manager.Create("lambda", init => { + init.Record.BooleanStuff = false; + init.Record.DecimalStuff = 0; + init.Record.DoubleStuff = 0; + init.Record.FloatStuff = 0; + init.Record.IntegerStuff = 0; + init.Record.LongStuff = 0; + init.Record.StringStuff = "0"; + init.Record.DateTimeStuff = dt; + }); + _session.Flush(); + + var result = _manager.HqlQuery().ForType("lambda").List(); + Assert.That(result.Count(), Is.EqualTo(1)); + + Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); + + result = queryWhere(x => x.Lt("BooleanStuff", false)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Lt("DecimalStuff", 0)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Lt("DoubleStuff", 0)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Lt("FloatStuff", 0)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Lt("IntegerStuff", 0)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Lt("LongStuff", 0)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Lt("StringStuff", "0")); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Lt("DateTimeStuff", dt)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Lt("BooleanStuff", true)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Lt("DecimalStuff", 1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Lt("DoubleStuff", 1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Lt("FloatStuff", 1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Lt("IntegerStuff", 1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Lt("LongStuff", 1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Lt("StringStuff", "00")); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Lt("DateTimeStuff", dt.AddDays(1))); + Assert.That(result.Count(), Is.EqualTo(1)); + + } + + + [Test] + public void ShouldQueryUsingOperatorLe() { + var dt = new DateTime(1980, 1, 1); + + _manager.Create("lambda", init => { + init.Record.BooleanStuff = false; + init.Record.DecimalStuff = 0; + init.Record.DoubleStuff = 0; + init.Record.FloatStuff = 0; + init.Record.IntegerStuff = 0; + init.Record.LongStuff = 0; + init.Record.StringStuff = "0"; + init.Record.DateTimeStuff = dt; + }); + _session.Flush(); + + var result = _manager.HqlQuery().ForType("lambda").List(); + Assert.That(result.Count(), Is.EqualTo(1)); + + Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); + + // equal + result = queryWhere(x => x.Le("BooleanStuff", false)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Le("DecimalStuff", 0)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Le("DoubleStuff", 0)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Le("FloatStuff", 0)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Le("IntegerStuff", 0)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Le("LongStuff", 0)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Le("StringStuff", "0")); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Le("DateTimeStuff", dt)); + Assert.That(result.Count(), Is.EqualTo(1)); + + // greater values + result = queryWhere(x => x.Le("BooleanStuff", true)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Le("DecimalStuff", 1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Le("DoubleStuff", 1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Le("FloatStuff", 1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Le("IntegerStuff", 1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Le("LongStuff", 1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Le("StringStuff", "00")); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Le("DateTimeStuff", dt.AddDays(1))); + Assert.That(result.Count(), Is.EqualTo(1)); + + // lower values + result = queryWhere(x => x.Le("DecimalStuff", -1)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Le("DoubleStuff", -1)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Le("FloatStuff", -1)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Le("IntegerStuff", -1)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Le("LongStuff", -1)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Le("StringStuff", "")); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Le("DateTimeStuff", dt.AddDays(-1))); + Assert.That(result.Count(), Is.EqualTo(0)); + + } + + [Test] + public void ShouldQueryUsingOperatorGe() { + var dt = new DateTime(1980, 1, 1); + + _manager.Create("lambda", init => { + init.Record.BooleanStuff = false; + init.Record.DecimalStuff = 0; + init.Record.DoubleStuff = 0; + init.Record.FloatStuff = 0; + init.Record.IntegerStuff = 0; + init.Record.LongStuff = 0; + init.Record.StringStuff = "0"; + init.Record.DateTimeStuff = dt; + }); + _session.Flush(); + + var result = _manager.HqlQuery().ForType("lambda").List(); + Assert.That(result.Count(), Is.EqualTo(1)); + + Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); + + // equal + result = queryWhere(x => x.Ge("BooleanStuff", false)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Ge("DecimalStuff", 0)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Ge("DoubleStuff", 0)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Ge("FloatStuff", 0)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Ge("IntegerStuff", 0)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Ge("LongStuff", 0)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Ge("StringStuff", "0")); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Ge("DateTimeStuff", dt)); + Assert.That(result.Count(), Is.EqualTo(1)); + + // greater values + result = queryWhere(x => x.Ge("BooleanStuff", true)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Ge("DecimalStuff", 1)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Ge("DoubleStuff", 1)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Ge("FloatStuff", 1)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Ge("IntegerStuff", 1)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Ge("LongStuff", 1)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Ge("StringStuff", "00")); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Ge("DateTimeStuff", dt.AddDays(1))); + Assert.That(result.Count(), Is.EqualTo(0)); + + // lower values + result = queryWhere(x => x.Ge("DecimalStuff", -1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Ge("DoubleStuff", -1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Ge("FloatStuff", -1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Ge("IntegerStuff", -1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Ge("LongStuff", -1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Ge("StringStuff", "")); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Ge("DateTimeStuff", dt.AddDays(-1))); + Assert.That(result.Count(), Is.EqualTo(1)); + + } + + [Test] + public void ShouldQueryUsingOperatorBetween() { + var dt = new DateTime(1980, 1, 1); + + _manager.Create("lambda", init => { + init.Record.BooleanStuff = false; + init.Record.DecimalStuff = 0; + init.Record.DoubleStuff = 0; + init.Record.FloatStuff = 0; + init.Record.IntegerStuff = 0; + init.Record.LongStuff = 0; + init.Record.StringStuff = "0"; + init.Record.DateTimeStuff = dt; + }); + _session.Flush(); + + var result = _manager.HqlQuery().ForType("lambda").List(); + Assert.That(result.Count(), Is.EqualTo(1)); + + Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); + + // include + result = queryWhere(x => x.Between("DecimalStuff", 0, 1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Between("DoubleStuff", 0, 1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Between("FloatStuff", 0, 1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Between("IntegerStuff", 0, 1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Between("LongStuff", 0, 1)); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Between("StringStuff", "0", "1")); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.Between("DateTimeStuff", dt, dt.AddDays(1))); + Assert.That(result.Count(), Is.EqualTo(1)); + + // exclude + result = queryWhere(x => x.Between("DecimalStuff", 1, 2)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Between("DoubleStuff", 1, 2)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Between("FloatStuff", 1, 2)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Between("IntegerStuff", 1, 2)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Between("LongStuff", 1, 2)); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Between("StringStuff", "1", "2")); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.Between("DateTimeStuff", dt.AddDays(1), dt.AddDays(2))); + Assert.That(result.Count(), Is.EqualTo(0)); + + } + + [Test] + public void ShouldQueryUsingOperatorIn() { + var dt = new DateTime(1980, 1, 1); + + _manager.Create("lambda", init => { + init.Record.BooleanStuff = false; + init.Record.DecimalStuff = 0; + init.Record.DoubleStuff = 0; + init.Record.FloatStuff = 0; + init.Record.IntegerStuff = 0; + init.Record.LongStuff = 0; + init.Record.StringStuff = "0"; + init.Record.DateTimeStuff = dt; + }); + _session.Flush(); + + var result = _manager.HqlQuery().ForType("lambda").List(); + Assert.That(result.Count(), Is.EqualTo(1)); + + Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); + + // include + result = queryWhere(x => x.In("BooleanStuff", new[] { false })); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.In("DecimalStuff", new[] { 0, 1 })); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.In("DoubleStuff", new[] { 0, 1 })); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.In("FloatStuff", new[] { 0, 1 })); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.In("IntegerStuff", new[] { 0, 1 })); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.In("LongStuff", new[] { 0, 1 })); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.In("StringStuff", new[] { "0", "1" })); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.In("DateTimeStuff", new [] {dt, dt.AddDays(1)})); + Assert.That(result.Count(), Is.EqualTo(1)); + + // exclude + result = queryWhere(x => x.In("BooleanStuff", new[] { true })); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.In("DecimalStuff", new[] { 1, 2 })); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.In("DoubleStuff", new[] { 1, 2 })); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.In("FloatStuff", new[] { 1, 2 })); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.In("IntegerStuff", new[] { 1, 2 })); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.In("LongStuff", new[] { 1, 2 })); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.In("StringStuff", new[] { "1", "2" })); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.In("DateTimeStuff", new [] {dt.AddDays(1), dt.AddDays(2)})); + Assert.That(result.Count(), Is.EqualTo(0)); + + } + + [Test] + public void ShouldQueryUsingOperatorIsNull() { + _manager.Create("lambda", init => { + init.Record.BooleanStuff = false; + init.Record.StringStuff = null; + }); + _session.Flush(); + + var result = _manager.HqlQuery().ForType("lambda").List(); + Assert.That(result.Count(), Is.EqualTo(1)); + + Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); + + result = queryWhere(x => x.IsNull("BooleanStuff")); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.IsNull("StringStuff")); + Assert.That(result.Count(), Is.EqualTo(1)); + } + + [Test] + public void ShouldQueryUsingOperatorIsNotNull() { + _manager.Create("lambda", init => { + init.Record.BooleanStuff = false; + init.Record.StringStuff = null; + }); + _session.Flush(); + + var result = _manager.HqlQuery().ForType("lambda").List(); + Assert.That(result.Count(), Is.EqualTo(1)); + + Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); + + result = queryWhere(x => x.IsNotNull("BooleanStuff")); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.IsNotNull("StringStuff")); + Assert.That(result.Count(), Is.EqualTo(0)); + } + + [Test] + public void ShouldQueryUsingOperatorEqProperty() { + var dt = new DateTime(1980, 1, 1); + + _manager.Create("lambda", init => { + init.Record.BooleanStuff = false; + init.Record.DecimalStuff = 0; + init.Record.DoubleStuff = 0; + init.Record.FloatStuff = 0; + init.Record.IntegerStuff = 0; + init.Record.LongStuff = 0; + init.Record.StringStuff = "0"; + init.Record.DateTimeStuff = dt; + }); + _session.Flush(); + + var result = _manager.HqlQuery().ForType("lambda").List(); + Assert.That(result.Count(), Is.EqualTo(1)); + + Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); + + result = queryWhere(x => x.EqProperty("BooleanStuff", "LongStuff")); + Assert.That(result.Count(), Is.EqualTo(1)); + + result = queryWhere(x => x.EqProperty("DateTimeStuff", "LongStuff")); + Assert.That(result.Count(), Is.EqualTo(0)); + } + + [Test] + public void ShouldQueryUsingOperatorNotEqProperty() { + var dt = new DateTime(1980, 1, 1); + + _manager.Create("lambda", init => { + init.Record.BooleanStuff = false; + init.Record.DecimalStuff = 0; + init.Record.DoubleStuff = 0; + init.Record.FloatStuff = 0; + init.Record.IntegerStuff = 0; + init.Record.LongStuff = 0; + init.Record.StringStuff = "0"; + init.Record.DateTimeStuff = dt; + }); + _session.Flush(); + + var result = _manager.HqlQuery().ForType("lambda").List(); + Assert.That(result.Count(), Is.EqualTo(1)); + + Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); + + result = queryWhere(x => x.NotEqProperty("BooleanStuff", "LongStuff")); + Assert.That(result.Count(), Is.EqualTo(0)); + + result = queryWhere(x => x.NotEqProperty("DateTimeStuff", "LongStuff")); + Assert.That(result.Count(), Is.EqualTo(1)); + } + + [Test] + public void ShouldQueryUsingOperatorGtProperty() { + var dt = new DateTime(1980, 1, 1); + + _manager.Create("lambda", init => { + init.Record.BooleanStuff = false; + init.Record.DecimalStuff = 0; + init.Record.DoubleStuff = 0; + init.Record.FloatStuff = 0; + init.Record.IntegerStuff = 1; + init.Record.LongStuff = 2; + init.Record.StringStuff = "0"; + init.Record.DateTimeStuff = dt; + }); + _session.Flush(); + + var result = _manager.HqlQuery().ForType("lambda").List(); + Assert.That(result.Count(), Is.EqualTo(1)); + + Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); + + // equal + result = queryWhere(x => x.GtProperty("DoubleStuff", "FloatStuff")); + Assert.That(result.Count(), Is.EqualTo(0)); + + // lesser + result = queryWhere(x => x.GtProperty("FloatStuff", "IntegerStuff")); + Assert.That(result.Count(), Is.EqualTo(0)); + + // greater + result = queryWhere(x => x.GtProperty("IntegerStuff", "FloatStuff")); + Assert.That(result.Count(), Is.EqualTo(1)); + } + + + [Test] + public void ShouldQueryUsingOperatorGeProperty() { + var dt = new DateTime(1980, 1, 1); + + _manager.Create("lambda", init => { + init.Record.BooleanStuff = false; + init.Record.DecimalStuff = 0; + init.Record.DoubleStuff = 0; + init.Record.FloatStuff = 0; + init.Record.IntegerStuff = 1; + init.Record.LongStuff = 2; + init.Record.StringStuff = "0"; + init.Record.DateTimeStuff = dt; + }); + _session.Flush(); + + var result = _manager.HqlQuery().ForType("lambda").List(); + Assert.That(result.Count(), Is.EqualTo(1)); + + Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); + + // equal + result = queryWhere(x => x.GeProperty("DoubleStuff", "FloatStuff")); + Assert.That(result.Count(), Is.EqualTo(1)); + + // lesser + result = queryWhere(x => x.GeProperty("FloatStuff", "IntegerStuff")); + Assert.That(result.Count(), Is.EqualTo(0)); + + // greater + result = queryWhere(x => x.GeProperty("IntegerStuff", "FloatStuff")); + Assert.That(result.Count(), Is.EqualTo(1)); + } + + [Test] + public void ShouldQueryUsingOperatorLeProperty() { + var dt = new DateTime(1980, 1, 1); + + _manager.Create("lambda", init => { + init.Record.BooleanStuff = false; + init.Record.DecimalStuff = 0; + init.Record.DoubleStuff = 0; + init.Record.FloatStuff = 0; + init.Record.IntegerStuff = 1; + init.Record.LongStuff = 2; + init.Record.StringStuff = "0"; + init.Record.DateTimeStuff = dt; + }); + _session.Flush(); + + var result = _manager.HqlQuery().ForType("lambda").List(); + Assert.That(result.Count(), Is.EqualTo(1)); + + Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); + + // equal + result = queryWhere(x => x.LeProperty("DoubleStuff", "FloatStuff")); + Assert.That(result.Count(), Is.EqualTo(1)); + + // lesser + result = queryWhere(x => x.LeProperty("FloatStuff", "IntegerStuff")); + Assert.That(result.Count(), Is.EqualTo(1)); + + // greater + result = queryWhere(x => x.LeProperty("IntegerStuff", "FloatStuff")); + Assert.That(result.Count(), Is.EqualTo(0)); + } + + + [Test] + public void ShouldQueryUsingOperatorLtProperty() { + var dt = new DateTime(1980, 1, 1); + + _manager.Create("lambda", init => { + init.Record.BooleanStuff = false; + init.Record.DecimalStuff = 0; + init.Record.DoubleStuff = 0; + init.Record.FloatStuff = 0; + init.Record.IntegerStuff = 1; + init.Record.LongStuff = 2; + init.Record.StringStuff = "0"; + init.Record.DateTimeStuff = dt; + }); + _session.Flush(); + + var result = _manager.HqlQuery().ForType("lambda").List(); + Assert.That(result.Count(), Is.EqualTo(1)); + + Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); + + // equal + result = queryWhere(x => x.LtProperty("DoubleStuff", "FloatStuff")); + Assert.That(result.Count(), Is.EqualTo(0)); + + // lesser + result = queryWhere(x => x.LtProperty("FloatStuff", "IntegerStuff")); + Assert.That(result.Count(), Is.EqualTo(1)); + + // greater + result = queryWhere(x => x.LtProperty("IntegerStuff", "FloatStuff")); + Assert.That(result.Count(), Is.EqualTo(0)); + } + + [Test] + public void ShouldSortRandomly() { + _manager.Create("lambda", init => { + init.Record.IntegerStuff = 1; + }); + + _manager.Create("lambda", init => { + init.Record.IntegerStuff = 2; + }); + + _manager.Create("lambda", init => { + init.Record.IntegerStuff = 3; + }); + _session.Flush(); + + var result = _manager.HqlQuery().ForType("lambda").List(); + Assert.That(result.Count(), Is.EqualTo(3)); + + var firstResults = new List(); + + for (int i = 0; i < 10; i++) { + result = _manager.HqlQuery().Join(alias => alias.ContentPartRecord()).OrderBy(x => x.Named("civ"), order => order.Random()).List(); + firstResults.Add(result.First().As().Record.IntegerStuff); + } + + Assert.That(firstResults.Distinct().Count(), Is.GreaterThan(1)); + } + + [Test] + public void ShouldPageResults() { + _manager.Create("lambda", init => { + init.Record.IntegerStuff = 1; + }); + + _manager.Create("lambda", init => { + init.Record.IntegerStuff = 2; + }); + + _manager.Create("lambda", init => { + init.Record.IntegerStuff = 3; + }); + _session.Flush(); + + var results = _manager.HqlQuery().Join(alias => alias.ContentPartRecord()).OrderBy(x => x.ContentPartRecord(), order => order.Asc("IntegerStuff")).Slice(1,1); + Assert.That(results.Count(), Is.EqualTo(1)); + Assert.That(results.Single().As().Record.IntegerStuff, Is.EqualTo(2)); + } + + [Test] + public void ShouldSortByProperty() { + var dt = new DateTime(1980, 1, 1); + + _manager.Create("lambda", init => { + init.Record.IntegerStuff = 1; + }); + + _manager.Create("lambda", init => { + init.Record.IntegerStuff = 2; + }); + + _manager.Create("lambda", init => { + init.Record.IntegerStuff = 3; + }); + _session.Flush(); + + var results =_manager.HqlQuery().Join(alias => alias.ContentPartRecord()).OrderBy(x => x.ContentPartRecord(), order => order.Asc("IntegerStuff")).List(); + Assert.That(results.Count(), Is.EqualTo(3)); + + Assert.That(results.Skip(0).First().As().Record.IntegerStuff, Is.EqualTo(1)); + Assert.That(results.Skip(1).First().As().Record.IntegerStuff, Is.EqualTo(2)); + Assert.That(results.Skip(2).First().As().Record.IntegerStuff, Is.EqualTo(3)); + } + + [Test] + public void ShouldQueryUsingOperatorNot() { + var dt = new DateTime(1980, 1, 1); + + _manager.Create("lambda", init => { + init.Record.BooleanStuff = false; + init.Record.DecimalStuff = 0; + init.Record.DoubleStuff = 0; + init.Record.FloatStuff = 0; + init.Record.IntegerStuff = 1; + init.Record.LongStuff = 2; + init.Record.StringStuff = "0"; + init.Record.DateTimeStuff = dt; + }); + _session.Flush(); + + var result = _manager.HqlQuery().ForType("lambda").List(); + Assert.That(result.Count(), Is.EqualTo(1)); + + Func, IEnumerable> queryWhere = predicate => _manager.HqlQuery().Where(alias => alias.ContentPartRecord(), predicate).List(); + + // equal + result = queryWhere(x => x.Not(y => y.LtProperty("DoubleStuff", "FloatStuff"))); + Assert.That(result.Count(), Is.EqualTo(1)); + } + } +} + + + diff --git a/src/Orchard.Tests/ContentManagement/ImportContentSessionTests.cs b/src/Orchard.Tests/ContentManagement/ImportContentSessionTests.cs index 81cbf010b06..7cbd593bdb5 100644 --- a/src/Orchard.Tests/ContentManagement/ImportContentSessionTests.cs +++ b/src/Orchard.Tests/ContentManagement/ImportContentSessionTests.cs @@ -1,185 +1,185 @@ -using Moq; -using NUnit.Framework; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Records; - -namespace Orchard.Tests.ContentManagement { - [TestFixture] - public class ImportContentSessionTests { - private ContentIdentity _testItemIdentity1; - private ContentIdentity _testItemIdentity2; - private ContentIdentity _testItemIdentity3; - private ContentIdentity _testItemIdentity4; - private ContentIdentity _testItemIdentity5; - private Mock _contentManager; - - #region Init - [TestFixtureSetUp] - public void TestInit() { - _testItemIdentity1 = new ContentIdentity("/ItemId=1"); - _testItemIdentity2 = new ContentIdentity("/ItemId=2"); - _testItemIdentity3 = new ContentIdentity("/ItemId=3"); - _testItemIdentity4 = new ContentIdentity("/ItemId=4"); - _testItemIdentity5 = new ContentIdentity("/ItemId=5"); - var draftItem = new ContentItem { VersionRecord = new ContentItemVersionRecord { Id = 1234, Published = false, Latest = true, ContentItemRecord = new ContentItemRecord { Id = 1 } } }; - var publishedItem = new ContentItem { VersionRecord = new ContentItemVersionRecord { Id = 1234, Published = true, Latest = true, ContentItemRecord = new ContentItemRecord { Id = 1 } } }; - - var draftItem5 = new ContentItem { VersionRecord = new ContentItemVersionRecord { Id = 1234, Published = false, Latest = true, ContentItemRecord = new ContentItemRecord { Id = 5 } } }; - var publishedItem5 = new ContentItem { VersionRecord = new ContentItemVersionRecord { Id = 1234, Published = true, Latest = true, ContentItemRecord = new ContentItemRecord { Id = 5 } } }; - - _contentManager = new Mock(); - _contentManager.Setup(m => m.Get(It.Is(v => v == 1), It.Is(v => v.IsDraftRequired))).Returns(draftItem); - _contentManager.Setup(m => m.Get(It.Is(v => v == 1), It.Is(v => !v.IsDraftRequired))).Returns(publishedItem); - - _contentManager.Setup(m => m.Get(It.Is(v => v == 5), It.Is(v => v.IsDraftRequired))).Returns(draftItem5); - _contentManager.Setup(m => m.Get(It.Is(v => v == 5), It.Is(v => !v.IsDraftRequired))).Returns(publishedItem5); - - _contentManager.Setup(m => m.GetItemMetadata(It.Is(c => c.Id == 1))).Returns(new ContentItemMetadata { Identity = _testItemIdentity1 }); - _contentManager.Setup(m => m.GetItemMetadata(It.Is(c => c.Id == 5))).Returns(new ContentItemMetadata { Identity = _testItemIdentity5 }); - - _contentManager.Setup(m => m.New(It.IsAny())).Returns(draftItem5); - - _contentManager.Setup(m => m.ResolveIdentity(It.Is(id => id.Get("ItemId") == "1"))).Returns(publishedItem); - } - #endregion - - [Test] - public void GetNextInBatchReturnsNullWhenNoItemsSet() { - var importContentSession = new ImportContentSession(_contentManager.Object); - - Assert.That(importContentSession.GetNextInBatch(), Is.Null); - } - - [Test] - public void GetNextInBatchReturnsNullWhenInitializedButNoItemsSet() { - var importContentSession = new ImportContentSession(_contentManager.Object); - importContentSession.InitializeBatch(0, 20); - Assert.That(importContentSession.GetNextInBatch(), Is.Null); - } - - [Test] - public void ItemsSetAndUninitializedReturnsAllItems() { - var importContentSession = new ImportContentSession(_contentManager.Object); - - importContentSession.Set("/Id=One", "TestType"); - importContentSession.Set("/Id=Two", "TestType"); - importContentSession.Set("/Id=Three", "TestType"); - - var comparer = new ContentIdentity.ContentIdentityEqualityComparer(); - Assert.That(comparer.Equals(importContentSession.GetNextInBatch(), new ContentIdentity("/Id=One"))); - Assert.That(comparer.Equals(importContentSession.GetNextInBatch(), new ContentIdentity("/Id=Two"))); - Assert.That(comparer.Equals(importContentSession.GetNextInBatch(), new ContentIdentity("/Id=Three"))); - Assert.That(importContentSession.GetNextInBatch(), Is.Null); - } - - [Test] - public void ItemsSetAndBatchInitialisedReturnsBatchedItems() { - var importContentSession = new ImportContentSession(_contentManager.Object); - - importContentSession.Set("/Id=One", "TestType"); - importContentSession.Set("/Id=Two", "TestType"); - importContentSession.Set("/Id=Three", "TestType"); - importContentSession.Set("/Id=Four", "TestType"); - importContentSession.Set("/Id=Five", "TestType"); - - importContentSession.InitializeBatch(1, 2); - - - var comparer = new ContentIdentity.ContentIdentityEqualityComparer(); - Assert.That(comparer.Equals(importContentSession.GetNextInBatch(), new ContentIdentity("/Id=Two"))); - Assert.That(comparer.Equals(importContentSession.GetNextInBatch(), new ContentIdentity("/Id=Three"))); - Assert.That(importContentSession.GetNextInBatch(), Is.Null); - - importContentSession.InitializeBatch(2, 5); - - //item with "/Id=Three" should not be returned twice in the same session - Assert.That(comparer.Equals(importContentSession.GetNextInBatch(), new ContentIdentity("/Id=Four"))); - Assert.That(comparer.Equals(importContentSession.GetNextInBatch(), new ContentIdentity("/Id=Five"))); - Assert.That(importContentSession.GetNextInBatch(), Is.Null); - } - - [Test] - public void GetItemExistsAndNoVersionOptionsReturnsPublishedItem() { - var session = new ImportContentSession(_contentManager.Object); - session.Set(_testItemIdentity1.ToString(), "TestContentType"); - var sessionItem = session.Get(_testItemIdentity1.ToString()); - Assert.IsNotNull(sessionItem); - Assert.AreEqual(1, sessionItem.Id); - Assert.IsTrue(sessionItem.IsPublished()); - } - - [Test] - public void GetItemExistsAndLatestVersionOptionReturnsPublishedItem() { - var session = new ImportContentSession(_contentManager.Object); - session.Set(_testItemIdentity1.ToString(), "TestContentType"); - var sessionItem = session.Get(_testItemIdentity1.ToString()); - Assert.IsNotNull(sessionItem); - Assert.AreEqual(1, sessionItem.Id); - Assert.IsTrue(sessionItem.IsPublished()); - } - - [Test] - public void GetItemExistsAndDraftRequiredVersionOptionReturnsDraft() { - var session = new ImportContentSession(_contentManager.Object); - session.Set(_testItemIdentity1.ToString(), "TestContentType"); - var sessionItem = session.Get(_testItemIdentity1.ToString(), VersionOptions.DraftRequired); - Assert.IsNotNull(sessionItem); - Assert.That(1, Is.EqualTo(sessionItem.Id)); - Assert.IsFalse(sessionItem.IsPublished()); - } - - [Test] - public void GetNextInBatchInitialisedWithOneItemReturnsOneItemThenNull() { - var session = new ImportContentSession(_contentManager.Object); - session.Set(_testItemIdentity1.ToString(), "TestContentType"); - session.InitializeBatch(0, 1); - var firstIdentity = session.GetNextInBatch(); - var secondIdentity = session.GetNextInBatch(); - - var comparer = new ContentIdentity.ContentIdentityEqualityComparer(); - Assert.That(comparer.Equals(_testItemIdentity1, firstIdentity)); - Assert.That(secondIdentity, Is.Null); - } - - - [Test] - public void GetNextInBatchInitialisedTwoBatchesReturnsItemsOnceEach() { - var session = new ImportContentSession(_contentManager.Object); - session.Set(_testItemIdentity1.ToString(), "TestContentType"); - session.Set(_testItemIdentity2.ToString(), "TestContentType"); - session.Set(_testItemIdentity3.ToString(), "TestContentType"); - session.Set(_testItemIdentity4.ToString(), "TestContentType"); - session.Set(_testItemIdentity5.ToString(), "TestContentType"); - - session.InitializeBatch(0, 2); - var firstIdentity = session.GetNextInBatch(); - //get later item as dependency - var dependencyItem = session.Get(_testItemIdentity5.ToString(), VersionOptions.Latest); - var dependencyIdentity = session.GetNextInBatch(); - var secondIdentity = session.GetNextInBatch(); - var afterBatch1 = session.GetNextInBatch(); - - session.InitializeBatch(2, 2); - var thirdIdentity = session.GetNextInBatch(); - var fourthdentity = session.GetNextInBatch(); - var afterBatch2 = session.GetNextInBatch(); - - session.InitializeBatch(4, 2); - var fifthIdentity = session.GetNextInBatch(); - var afterBatch3 = session.GetNextInBatch(); - - var comparer = new ContentIdentity.ContentIdentityEqualityComparer(); - Assert.That(comparer.Equals(_testItemIdentity1, firstIdentity)); - Assert.That(comparer.Equals(_testItemIdentity5, dependencyIdentity)); - Assert.That(comparer.Equals(_testItemIdentity2, secondIdentity)); - Assert.That(afterBatch1, Is.Null); - - Assert.That(comparer.Equals(_testItemIdentity3, thirdIdentity)); - Assert.That(comparer.Equals(_testItemIdentity4, fourthdentity)); - Assert.That(afterBatch2, Is.Null); - - Assert.That(fifthIdentity, Is.Null); //already processed as dependency - Assert.That(afterBatch3, Is.Null); - } - } +using Moq; +using NUnit.Framework; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Records; + +namespace Orchard.Tests.ContentManagement { + [TestFixture] + public class ImportContentSessionTests { + private ContentIdentity _testItemIdentity1; + private ContentIdentity _testItemIdentity2; + private ContentIdentity _testItemIdentity3; + private ContentIdentity _testItemIdentity4; + private ContentIdentity _testItemIdentity5; + private Mock _contentManager; + + #region Init + [TestFixtureSetUp] + public void TestInit() { + _testItemIdentity1 = new ContentIdentity("/ItemId=1"); + _testItemIdentity2 = new ContentIdentity("/ItemId=2"); + _testItemIdentity3 = new ContentIdentity("/ItemId=3"); + _testItemIdentity4 = new ContentIdentity("/ItemId=4"); + _testItemIdentity5 = new ContentIdentity("/ItemId=5"); + var draftItem = new ContentItem { VersionRecord = new ContentItemVersionRecord { Id = 1234, Published = false, Latest = true, ContentItemRecord = new ContentItemRecord { Id = 1 } } }; + var publishedItem = new ContentItem { VersionRecord = new ContentItemVersionRecord { Id = 1234, Published = true, Latest = true, ContentItemRecord = new ContentItemRecord { Id = 1 } } }; + + var draftItem5 = new ContentItem { VersionRecord = new ContentItemVersionRecord { Id = 1234, Published = false, Latest = true, ContentItemRecord = new ContentItemRecord { Id = 5 } } }; + var publishedItem5 = new ContentItem { VersionRecord = new ContentItemVersionRecord { Id = 1234, Published = true, Latest = true, ContentItemRecord = new ContentItemRecord { Id = 5 } } }; + + _contentManager = new Mock(); + _contentManager.Setup(m => m.Get(It.Is(v => v == 1), It.Is(v => v.IsDraftRequired))).Returns(draftItem); + _contentManager.Setup(m => m.Get(It.Is(v => v == 1), It.Is(v => !v.IsDraftRequired))).Returns(publishedItem); + + _contentManager.Setup(m => m.Get(It.Is(v => v == 5), It.Is(v => v.IsDraftRequired))).Returns(draftItem5); + _contentManager.Setup(m => m.Get(It.Is(v => v == 5), It.Is(v => !v.IsDraftRequired))).Returns(publishedItem5); + + _contentManager.Setup(m => m.GetItemMetadata(It.Is(c => c.Id == 1))).Returns(new ContentItemMetadata { Identity = _testItemIdentity1 }); + _contentManager.Setup(m => m.GetItemMetadata(It.Is(c => c.Id == 5))).Returns(new ContentItemMetadata { Identity = _testItemIdentity5 }); + + _contentManager.Setup(m => m.New(It.IsAny())).Returns(draftItem5); + + _contentManager.Setup(m => m.ResolveIdentity(It.Is(id => id.Get("ItemId") == "1"))).Returns(publishedItem); + } + #endregion + + [Test] + public void GetNextInBatchReturnsNullWhenNoItemsSet() { + var importContentSession = new ImportContentSession(_contentManager.Object); + + Assert.That(importContentSession.GetNextInBatch(), Is.Null); + } + + [Test] + public void GetNextInBatchReturnsNullWhenInitializedButNoItemsSet() { + var importContentSession = new ImportContentSession(_contentManager.Object); + importContentSession.InitializeBatch(0, 20); + Assert.That(importContentSession.GetNextInBatch(), Is.Null); + } + + [Test] + public void ItemsSetAndUninitializedReturnsAllItems() { + var importContentSession = new ImportContentSession(_contentManager.Object); + + importContentSession.Set("/Id=One", "TestType"); + importContentSession.Set("/Id=Two", "TestType"); + importContentSession.Set("/Id=Three", "TestType"); + + var comparer = new ContentIdentity.ContentIdentityEqualityComparer(); + Assert.That(comparer.Equals(importContentSession.GetNextInBatch(), new ContentIdentity("/Id=One"))); + Assert.That(comparer.Equals(importContentSession.GetNextInBatch(), new ContentIdentity("/Id=Two"))); + Assert.That(comparer.Equals(importContentSession.GetNextInBatch(), new ContentIdentity("/Id=Three"))); + Assert.That(importContentSession.GetNextInBatch(), Is.Null); + } + + [Test] + public void ItemsSetAndBatchInitialisedReturnsBatchedItems() { + var importContentSession = new ImportContentSession(_contentManager.Object); + + importContentSession.Set("/Id=One", "TestType"); + importContentSession.Set("/Id=Two", "TestType"); + importContentSession.Set("/Id=Three", "TestType"); + importContentSession.Set("/Id=Four", "TestType"); + importContentSession.Set("/Id=Five", "TestType"); + + importContentSession.InitializeBatch(1, 2); + + + var comparer = new ContentIdentity.ContentIdentityEqualityComparer(); + Assert.That(comparer.Equals(importContentSession.GetNextInBatch(), new ContentIdentity("/Id=Two"))); + Assert.That(comparer.Equals(importContentSession.GetNextInBatch(), new ContentIdentity("/Id=Three"))); + Assert.That(importContentSession.GetNextInBatch(), Is.Null); + + importContentSession.InitializeBatch(2, 5); + + //item with "/Id=Three" should not be returned twice in the same session + Assert.That(comparer.Equals(importContentSession.GetNextInBatch(), new ContentIdentity("/Id=Four"))); + Assert.That(comparer.Equals(importContentSession.GetNextInBatch(), new ContentIdentity("/Id=Five"))); + Assert.That(importContentSession.GetNextInBatch(), Is.Null); + } + + [Test] + public void GetItemExistsAndNoVersionOptionsReturnsPublishedItem() { + var session = new ImportContentSession(_contentManager.Object); + session.Set(_testItemIdentity1.ToString(), "TestContentType"); + var sessionItem = session.Get(_testItemIdentity1.ToString()); + Assert.IsNotNull(sessionItem); + Assert.AreEqual(1, sessionItem.Id); + Assert.IsTrue(sessionItem.IsPublished()); + } + + [Test] + public void GetItemExistsAndLatestVersionOptionReturnsPublishedItem() { + var session = new ImportContentSession(_contentManager.Object); + session.Set(_testItemIdentity1.ToString(), "TestContentType"); + var sessionItem = session.Get(_testItemIdentity1.ToString()); + Assert.IsNotNull(sessionItem); + Assert.AreEqual(1, sessionItem.Id); + Assert.IsTrue(sessionItem.IsPublished()); + } + + [Test] + public void GetItemExistsAndDraftRequiredVersionOptionReturnsDraft() { + var session = new ImportContentSession(_contentManager.Object); + session.Set(_testItemIdentity1.ToString(), "TestContentType"); + var sessionItem = session.Get(_testItemIdentity1.ToString(), VersionOptions.DraftRequired); + Assert.IsNotNull(sessionItem); + Assert.That(1, Is.EqualTo(sessionItem.Id)); + Assert.IsFalse(sessionItem.IsPublished()); + } + + [Test] + public void GetNextInBatchInitialisedWithOneItemReturnsOneItemThenNull() { + var session = new ImportContentSession(_contentManager.Object); + session.Set(_testItemIdentity1.ToString(), "TestContentType"); + session.InitializeBatch(0, 1); + var firstIdentity = session.GetNextInBatch(); + var secondIdentity = session.GetNextInBatch(); + + var comparer = new ContentIdentity.ContentIdentityEqualityComparer(); + Assert.That(comparer.Equals(_testItemIdentity1, firstIdentity)); + Assert.That(secondIdentity, Is.Null); + } + + + [Test] + public void GetNextInBatchInitialisedTwoBatchesReturnsItemsOnceEach() { + var session = new ImportContentSession(_contentManager.Object); + session.Set(_testItemIdentity1.ToString(), "TestContentType"); + session.Set(_testItemIdentity2.ToString(), "TestContentType"); + session.Set(_testItemIdentity3.ToString(), "TestContentType"); + session.Set(_testItemIdentity4.ToString(), "TestContentType"); + session.Set(_testItemIdentity5.ToString(), "TestContentType"); + + session.InitializeBatch(0, 2); + var firstIdentity = session.GetNextInBatch(); + //get later item as dependency + var dependencyItem = session.Get(_testItemIdentity5.ToString(), VersionOptions.Latest); + var dependencyIdentity = session.GetNextInBatch(); + var secondIdentity = session.GetNextInBatch(); + var afterBatch1 = session.GetNextInBatch(); + + session.InitializeBatch(2, 2); + var thirdIdentity = session.GetNextInBatch(); + var fourthdentity = session.GetNextInBatch(); + var afterBatch2 = session.GetNextInBatch(); + + session.InitializeBatch(4, 2); + var fifthIdentity = session.GetNextInBatch(); + var afterBatch3 = session.GetNextInBatch(); + + var comparer = new ContentIdentity.ContentIdentityEqualityComparer(); + Assert.That(comparer.Equals(_testItemIdentity1, firstIdentity)); + Assert.That(comparer.Equals(_testItemIdentity5, dependencyIdentity)); + Assert.That(comparer.Equals(_testItemIdentity2, secondIdentity)); + Assert.That(afterBatch1, Is.Null); + + Assert.That(comparer.Equals(_testItemIdentity3, thirdIdentity)); + Assert.That(comparer.Equals(_testItemIdentity4, fourthdentity)); + Assert.That(afterBatch2, Is.Null); + + Assert.That(fifthIdentity, Is.Null); //already processed as dependency + Assert.That(afterBatch3, Is.Null); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/ContentManagement/MetaData/Builders/ContentTypeDefinitionBuilderTests.cs b/src/Orchard.Tests/ContentManagement/MetaData/Builders/ContentTypeDefinitionBuilderTests.cs index f274da59ee8..ee0ba8eef77 100644 --- a/src/Orchard.Tests/ContentManagement/MetaData/Builders/ContentTypeDefinitionBuilderTests.cs +++ b/src/Orchard.Tests/ContentManagement/MetaData/Builders/ContentTypeDefinitionBuilderTests.cs @@ -1,127 +1,127 @@ -using System.Linq; -using NUnit.Framework; -using Orchard.ContentManagement.MetaData.Builders; - -namespace Orchard.Tests.ContentManagement.MetaData.Builders { - [TestFixture] - public class ContentTypeDefinitionBuilderTests { - [Test] - public void ContentTypeNameAndSettingsFromScratch() { - var contentTypeDefinition = new ContentTypeDefinitionBuilder() - .Named("alpha") - .WithSetting("a", "1") - .WithSetting("b", "2") - .Build(); - Assert.That(contentTypeDefinition.Name, Is.EqualTo("alpha")); - Assert.That(contentTypeDefinition.Settings.Count(), Is.EqualTo(2)); - Assert.That(contentTypeDefinition.Settings["a"], Is.EqualTo("1")); - Assert.That(contentTypeDefinition.Settings["b"], Is.EqualTo("2")); - } - - [Test] - public void ContentRebuildWithoutModification() { - var contentTypeDefinition1 = new ContentTypeDefinitionBuilder() - .Named("alpha") - .WithSetting("a", "1") - .WithSetting("b", "2") - .Build(); - var contentTypeDefinition2 = new ContentTypeDefinitionBuilder(contentTypeDefinition1) - .Build(); - Assert.That(contentTypeDefinition1, Is.Not.SameAs(contentTypeDefinition2)); - Assert.That(contentTypeDefinition2.Name, Is.EqualTo("alpha")); - Assert.That(contentTypeDefinition2.Settings.Count(), Is.EqualTo(2)); - Assert.That(contentTypeDefinition2.Settings["a"], Is.EqualTo("1")); - Assert.That(contentTypeDefinition2.Settings["b"], Is.EqualTo("2")); - } - - [Test] - public void ContentRebuildWithModification() { - var contentTypeDefinition1 = new ContentTypeDefinitionBuilder() - .Named("alpha") - .WithSetting("a", "1") - .WithSetting("b", "2") - .Build(); - var contentTypeDefinition2 = new ContentTypeDefinitionBuilder(contentTypeDefinition1) - .Named("beta") - .WithSetting("b", "22") - .WithSetting("c", "3") - .Build(); - Assert.That(contentTypeDefinition1, Is.Not.SameAs(contentTypeDefinition2)); - Assert.That(contentTypeDefinition1.Name, Is.EqualTo("alpha")); - Assert.That(contentTypeDefinition1.Settings.Count(), Is.EqualTo(2)); - Assert.That(contentTypeDefinition1.Settings["a"], Is.EqualTo("1")); - Assert.That(contentTypeDefinition1.Settings["b"], Is.EqualTo("2")); - Assert.That(contentTypeDefinition2.Name, Is.EqualTo("beta")); - Assert.That(contentTypeDefinition2.Settings.Count(), Is.EqualTo(3)); - Assert.That(contentTypeDefinition2.Settings["a"], Is.EqualTo("1")); - Assert.That(contentTypeDefinition2.Settings["b"], Is.EqualTo("22")); - Assert.That(contentTypeDefinition2.Settings["c"], Is.EqualTo("3")); - } - - [Test] - public void AddingPartWithSettings() { - var contentTypeDefinition = new ContentTypeDefinitionBuilder() - .Named("alpha") - .WithSetting("a", "1") - .WithSetting("b", "2") - .WithPart("foo", pb => pb.WithSetting("x", "10").WithSetting("y", "11")) - .Build(); - - Assert.That(contentTypeDefinition.Name, Is.EqualTo("alpha")); - Assert.That(contentTypeDefinition.Parts.Count(), Is.EqualTo(1)); - Assert.That(contentTypeDefinition.Parts.Single().PartDefinition.Name, Is.EqualTo("foo")); - Assert.That(contentTypeDefinition.Parts.Single().Settings.Count(), Is.EqualTo(2)); - Assert.That(contentTypeDefinition.Parts.Single().Settings["x"], Is.EqualTo("10")); - Assert.That(contentTypeDefinition.Parts.Single().Settings["y"], Is.EqualTo("11")); - } - - [Test] - public void CanAlterPartSettingsByNameDuringBuild() { - var contentTypeDefinition = new ContentTypeDefinitionBuilder() - .Named("alpha") - .WithSetting("a", "1") - .WithSetting("b", "2") - .WithPart("foo", pb => pb.WithSetting("x", "10")) - .WithPart("foo", pb => pb.WithSetting("y", "11")) - .Build(); - - Assert.That(contentTypeDefinition.Name, Is.EqualTo("alpha")); - Assert.That(contentTypeDefinition.Parts.Count(), Is.EqualTo(1)); - Assert.That(contentTypeDefinition.Parts.Single().PartDefinition.Name, Is.EqualTo("foo")); - Assert.That(contentTypeDefinition.Parts.Single().Settings.Count(), Is.EqualTo(2)); - Assert.That(contentTypeDefinition.Parts.Single().Settings["x"], Is.EqualTo("10")); - Assert.That(contentTypeDefinition.Parts.Single().Settings["y"], Is.EqualTo("11")); - } - - [Test] - public void CanAlterPartSettingsByNameDuringRebuild() { - var contentTypeDefinition1 = new ContentTypeDefinitionBuilder() - .Named("alpha") - .WithPart("foo", pb => pb.WithSetting("x", "10").WithSetting("y", "11")) - .Build(); - - var contentTypeDefinition2 = new ContentTypeDefinitionBuilder(contentTypeDefinition1) - .WithPart("foo", pb => pb.WithSetting("x", "12").WithSetting("z", "13")) - .Build(); - - Assert.That(contentTypeDefinition1.Name, Is.EqualTo("alpha")); - Assert.That(contentTypeDefinition1.Parts.Count(), Is.EqualTo(1)); - Assert.That(contentTypeDefinition1.Parts.Single().PartDefinition.Name, Is.EqualTo("foo")); - Assert.That(contentTypeDefinition1.Parts.Single().Settings.Count(), Is.EqualTo(2)); - Assert.That(contentTypeDefinition1.Parts.Single().Settings["x"], Is.EqualTo("10")); - Assert.That(contentTypeDefinition1.Parts.Single().Settings["y"], Is.EqualTo("11")); - Assert.That(contentTypeDefinition2.Name, Is.EqualTo("alpha")); - Assert.That(contentTypeDefinition2.Parts.Count(), Is.EqualTo(1)); - Assert.That(contentTypeDefinition2.Parts.Single().PartDefinition.Name, Is.EqualTo("foo")); - Assert.That(contentTypeDefinition2.Parts.Single().Settings.Count(), Is.EqualTo(3)); - Assert.That(contentTypeDefinition2.Parts.Single().Settings["x"], Is.EqualTo("12")); - Assert.That(contentTypeDefinition2.Parts.Single().Settings["y"], Is.EqualTo("11")); - Assert.That(contentTypeDefinition2.Parts.Single().Settings["z"], Is.EqualTo("13")); - } - - [Test, IgnoreAttribute("Merging not yet implemented")] - public void ContentMergeOverlaysSettings() { - Assert.Fail(); - } - } -} +using System.Linq; +using NUnit.Framework; +using Orchard.ContentManagement.MetaData.Builders; + +namespace Orchard.Tests.ContentManagement.MetaData.Builders { + [TestFixture] + public class ContentTypeDefinitionBuilderTests { + [Test] + public void ContentTypeNameAndSettingsFromScratch() { + var contentTypeDefinition = new ContentTypeDefinitionBuilder() + .Named("alpha") + .WithSetting("a", "1") + .WithSetting("b", "2") + .Build(); + Assert.That(contentTypeDefinition.Name, Is.EqualTo("alpha")); + Assert.That(contentTypeDefinition.Settings.Count(), Is.EqualTo(2)); + Assert.That(contentTypeDefinition.Settings["a"], Is.EqualTo("1")); + Assert.That(contentTypeDefinition.Settings["b"], Is.EqualTo("2")); + } + + [Test] + public void ContentRebuildWithoutModification() { + var contentTypeDefinition1 = new ContentTypeDefinitionBuilder() + .Named("alpha") + .WithSetting("a", "1") + .WithSetting("b", "2") + .Build(); + var contentTypeDefinition2 = new ContentTypeDefinitionBuilder(contentTypeDefinition1) + .Build(); + Assert.That(contentTypeDefinition1, Is.Not.SameAs(contentTypeDefinition2)); + Assert.That(contentTypeDefinition2.Name, Is.EqualTo("alpha")); + Assert.That(contentTypeDefinition2.Settings.Count(), Is.EqualTo(2)); + Assert.That(contentTypeDefinition2.Settings["a"], Is.EqualTo("1")); + Assert.That(contentTypeDefinition2.Settings["b"], Is.EqualTo("2")); + } + + [Test] + public void ContentRebuildWithModification() { + var contentTypeDefinition1 = new ContentTypeDefinitionBuilder() + .Named("alpha") + .WithSetting("a", "1") + .WithSetting("b", "2") + .Build(); + var contentTypeDefinition2 = new ContentTypeDefinitionBuilder(contentTypeDefinition1) + .Named("beta") + .WithSetting("b", "22") + .WithSetting("c", "3") + .Build(); + Assert.That(contentTypeDefinition1, Is.Not.SameAs(contentTypeDefinition2)); + Assert.That(contentTypeDefinition1.Name, Is.EqualTo("alpha")); + Assert.That(contentTypeDefinition1.Settings.Count(), Is.EqualTo(2)); + Assert.That(contentTypeDefinition1.Settings["a"], Is.EqualTo("1")); + Assert.That(contentTypeDefinition1.Settings["b"], Is.EqualTo("2")); + Assert.That(contentTypeDefinition2.Name, Is.EqualTo("beta")); + Assert.That(contentTypeDefinition2.Settings.Count(), Is.EqualTo(3)); + Assert.That(contentTypeDefinition2.Settings["a"], Is.EqualTo("1")); + Assert.That(contentTypeDefinition2.Settings["b"], Is.EqualTo("22")); + Assert.That(contentTypeDefinition2.Settings["c"], Is.EqualTo("3")); + } + + [Test] + public void AddingPartWithSettings() { + var contentTypeDefinition = new ContentTypeDefinitionBuilder() + .Named("alpha") + .WithSetting("a", "1") + .WithSetting("b", "2") + .WithPart("foo", pb => pb.WithSetting("x", "10").WithSetting("y", "11")) + .Build(); + + Assert.That(contentTypeDefinition.Name, Is.EqualTo("alpha")); + Assert.That(contentTypeDefinition.Parts.Count(), Is.EqualTo(1)); + Assert.That(contentTypeDefinition.Parts.Single().PartDefinition.Name, Is.EqualTo("foo")); + Assert.That(contentTypeDefinition.Parts.Single().Settings.Count(), Is.EqualTo(2)); + Assert.That(contentTypeDefinition.Parts.Single().Settings["x"], Is.EqualTo("10")); + Assert.That(contentTypeDefinition.Parts.Single().Settings["y"], Is.EqualTo("11")); + } + + [Test] + public void CanAlterPartSettingsByNameDuringBuild() { + var contentTypeDefinition = new ContentTypeDefinitionBuilder() + .Named("alpha") + .WithSetting("a", "1") + .WithSetting("b", "2") + .WithPart("foo", pb => pb.WithSetting("x", "10")) + .WithPart("foo", pb => pb.WithSetting("y", "11")) + .Build(); + + Assert.That(contentTypeDefinition.Name, Is.EqualTo("alpha")); + Assert.That(contentTypeDefinition.Parts.Count(), Is.EqualTo(1)); + Assert.That(contentTypeDefinition.Parts.Single().PartDefinition.Name, Is.EqualTo("foo")); + Assert.That(contentTypeDefinition.Parts.Single().Settings.Count(), Is.EqualTo(2)); + Assert.That(contentTypeDefinition.Parts.Single().Settings["x"], Is.EqualTo("10")); + Assert.That(contentTypeDefinition.Parts.Single().Settings["y"], Is.EqualTo("11")); + } + + [Test] + public void CanAlterPartSettingsByNameDuringRebuild() { + var contentTypeDefinition1 = new ContentTypeDefinitionBuilder() + .Named("alpha") + .WithPart("foo", pb => pb.WithSetting("x", "10").WithSetting("y", "11")) + .Build(); + + var contentTypeDefinition2 = new ContentTypeDefinitionBuilder(contentTypeDefinition1) + .WithPart("foo", pb => pb.WithSetting("x", "12").WithSetting("z", "13")) + .Build(); + + Assert.That(contentTypeDefinition1.Name, Is.EqualTo("alpha")); + Assert.That(contentTypeDefinition1.Parts.Count(), Is.EqualTo(1)); + Assert.That(contentTypeDefinition1.Parts.Single().PartDefinition.Name, Is.EqualTo("foo")); + Assert.That(contentTypeDefinition1.Parts.Single().Settings.Count(), Is.EqualTo(2)); + Assert.That(contentTypeDefinition1.Parts.Single().Settings["x"], Is.EqualTo("10")); + Assert.That(contentTypeDefinition1.Parts.Single().Settings["y"], Is.EqualTo("11")); + Assert.That(contentTypeDefinition2.Name, Is.EqualTo("alpha")); + Assert.That(contentTypeDefinition2.Parts.Count(), Is.EqualTo(1)); + Assert.That(contentTypeDefinition2.Parts.Single().PartDefinition.Name, Is.EqualTo("foo")); + Assert.That(contentTypeDefinition2.Parts.Single().Settings.Count(), Is.EqualTo(3)); + Assert.That(contentTypeDefinition2.Parts.Single().Settings["x"], Is.EqualTo("12")); + Assert.That(contentTypeDefinition2.Parts.Single().Settings["y"], Is.EqualTo("11")); + Assert.That(contentTypeDefinition2.Parts.Single().Settings["z"], Is.EqualTo("13")); + } + + [Test, IgnoreAttribute("Merging not yet implemented")] + public void ContentMergeOverlaysSettings() { + Assert.Fail(); + } + } +} diff --git a/src/Orchard.Tests/ContentManagement/MetaData/Services/ContentDefinitionReaderTests.cs b/src/Orchard.Tests/ContentManagement/MetaData/Services/ContentDefinitionReaderTests.cs index a2726777d6c..7fb4d3cf191 100644 --- a/src/Orchard.Tests/ContentManagement/MetaData/Services/ContentDefinitionReaderTests.cs +++ b/src/Orchard.Tests/ContentManagement/MetaData/Services/ContentDefinitionReaderTests.cs @@ -1,57 +1,57 @@ -using System.Linq; -using System.Xml.Linq; -using NUnit.Framework; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.MetaData.Builders; -using Orchard.ContentManagement.MetaData.Services; - -namespace Orchard.Tests.ContentManagement.MetaData.Services { - [TestFixture] - public class ContentDefinitionReaderTests { - private IContentDefinitionReader _reader; - - [SetUp] - public void Init() { - _reader = new ContentDefinitionReader(new SettingsFormatter()); - } - - [Test] - public void ReadingElementSetsName() { - var builder = new ContentTypeDefinitionBuilder(); - _reader.Merge(new XElement("foo"), builder); - var type = builder.Build(); - Assert.That(type.Name, Is.EqualTo("foo")); - } - - [Test] - public void AttributesAreAppliedAsSettings() { - var builder = new ContentTypeDefinitionBuilder(); - _reader.Merge(new XElement("foo", new XAttribute("x", "1")), builder); - var type = builder.Build(); - Assert.That(type.Settings["x"], Is.EqualTo("1")); - } - - [Test] - public void ChildElementsAreAddedAsPartsWithSettings() { - var builder = new ContentTypeDefinitionBuilder(); - _reader.Merge(new XElement("foo", new XElement("bar", new XAttribute("y", "2"))), builder); - var type = builder.Build(); - Assert.That(type.Parts.Single().PartDefinition.Name, Is.EqualTo("bar")); - Assert.That(type.Parts.Single().Settings["y"], Is.EqualTo("2")); - } - - [Test] - public void PartsCanBeRemovedByNameWhenImporting() { - const string partToBeRemoved = "alpha"; - - var builder = new ContentTypeDefinitionBuilder(); - _reader.Merge(new XElement("foo", - new XElement(partToBeRemoved), - new XElement("remove", new XAttribute("name", partToBeRemoved)) - ), builder); - var type = builder.Build(); - - Assert.That(type.Parts.FirstOrDefault(part => part.PartDefinition.Name == partToBeRemoved), Is.Null); - } - } -} +using System.Linq; +using System.Xml.Linq; +using NUnit.Framework; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Builders; +using Orchard.ContentManagement.MetaData.Services; + +namespace Orchard.Tests.ContentManagement.MetaData.Services { + [TestFixture] + public class ContentDefinitionReaderTests { + private IContentDefinitionReader _reader; + + [SetUp] + public void Init() { + _reader = new ContentDefinitionReader(new SettingsFormatter()); + } + + [Test] + public void ReadingElementSetsName() { + var builder = new ContentTypeDefinitionBuilder(); + _reader.Merge(new XElement("foo"), builder); + var type = builder.Build(); + Assert.That(type.Name, Is.EqualTo("foo")); + } + + [Test] + public void AttributesAreAppliedAsSettings() { + var builder = new ContentTypeDefinitionBuilder(); + _reader.Merge(new XElement("foo", new XAttribute("x", "1")), builder); + var type = builder.Build(); + Assert.That(type.Settings["x"], Is.EqualTo("1")); + } + + [Test] + public void ChildElementsAreAddedAsPartsWithSettings() { + var builder = new ContentTypeDefinitionBuilder(); + _reader.Merge(new XElement("foo", new XElement("bar", new XAttribute("y", "2"))), builder); + var type = builder.Build(); + Assert.That(type.Parts.Single().PartDefinition.Name, Is.EqualTo("bar")); + Assert.That(type.Parts.Single().Settings["y"], Is.EqualTo("2")); + } + + [Test] + public void PartsCanBeRemovedByNameWhenImporting() { + const string partToBeRemoved = "alpha"; + + var builder = new ContentTypeDefinitionBuilder(); + _reader.Merge(new XElement("foo", + new XElement(partToBeRemoved), + new XElement("remove", new XAttribute("name", partToBeRemoved)) + ), builder); + var type = builder.Build(); + + Assert.That(type.Parts.FirstOrDefault(part => part.PartDefinition.Name == partToBeRemoved), Is.Null); + } + } +} diff --git a/src/Orchard.Tests/ContentManagement/MetaData/Services/ContentDefinitionWriterTests.cs b/src/Orchard.Tests/ContentManagement/MetaData/Services/ContentDefinitionWriterTests.cs index 6182f7b2546..0f07dfc9692 100644 --- a/src/Orchard.Tests/ContentManagement/MetaData/Services/ContentDefinitionWriterTests.cs +++ b/src/Orchard.Tests/ContentManagement/MetaData/Services/ContentDefinitionWriterTests.cs @@ -1,55 +1,55 @@ -using System.Linq; -using System.Xml; -using System.Xml.Linq; -using NUnit.Framework; -using Orchard.ContentManagement.MetaData.Builders; -using Orchard.ContentManagement.MetaData.Services; - -namespace Orchard.Tests.ContentManagement.MetaData.Services { - [TestFixture] - public class ContentDefinitionWriterTests { - private ContentDefinitionWriter _writer; - - [SetUp] - public void Init() { - _writer = new ContentDefinitionWriter(new SettingsFormatter()); - } - - [Test] - public void CreatesElementWithEncodedContentTypeName() { - var alphaInfoset = _writer.Export(new ContentTypeDefinitionBuilder().Named("alpha").Build()); - var betaInfoset = _writer.Export(new ContentTypeDefinitionBuilder().Named(":beta").Build()); - var gammaInfoset = _writer.Export(new ContentTypeDefinitionBuilder().Named(" g a m m a ").Build()); - var deltaInfoset = _writer.Export(new ContentTypeDefinitionBuilder().Named("del\r\nta").Build()); - - Assert.That(XmlConvert.DecodeName(alphaInfoset.Name.LocalName), Is.EqualTo("alpha")); - Assert.That(XmlConvert.DecodeName(betaInfoset.Name.LocalName), Is.EqualTo(":beta")); - Assert.That(XmlConvert.DecodeName(gammaInfoset.Name.LocalName), Is.EqualTo(" g a m m a ")); - Assert.That(XmlConvert.DecodeName(deltaInfoset.Name.LocalName), Is.EqualTo("del\r\nta")); - } - - [Test] - public void ChildElementsArePartNames() { - var alphaInfoset = _writer.Export(new ContentTypeDefinitionBuilder().Named("alpha").WithPart(":beta").WithPart("del\r\nta").Build()); - - Assert.That(XmlConvert.DecodeName(alphaInfoset.Name.LocalName), Is.EqualTo("alpha")); - Assert.That(alphaInfoset.Elements().Count(), Is.EqualTo(2)); - Assert.That(alphaInfoset.Elements().Select(elt => elt.Name.LocalName), Has.Some.EqualTo(XmlConvert.EncodeLocalName(":beta"))); - Assert.That(alphaInfoset.Elements().Select(elt => elt.Name.LocalName), Has.Some.EqualTo(XmlConvert.EncodeLocalName("del\r\nta"))); - } - - [Test] - public void TypeAndTypePartSettingsAreAttributes() { - - var alpha = new ContentTypeDefinitionBuilder() - .Named("alpha") - .WithSetting("x", "1") - .WithPart("beta", part => part.WithSetting(" y ", "2")) - .Build(); - - var alphaInfoset = _writer.Export(alpha); - Assert.That(alphaInfoset.Attributes("x").Single().Value, Is.EqualTo("1")); - Assert.That(alphaInfoset.Elements("beta").Attributes(XmlConvert.EncodeLocalName(" y ")).Single().Value, Is.EqualTo("2")); - } - } -} +using System.Linq; +using System.Xml; +using System.Xml.Linq; +using NUnit.Framework; +using Orchard.ContentManagement.MetaData.Builders; +using Orchard.ContentManagement.MetaData.Services; + +namespace Orchard.Tests.ContentManagement.MetaData.Services { + [TestFixture] + public class ContentDefinitionWriterTests { + private ContentDefinitionWriter _writer; + + [SetUp] + public void Init() { + _writer = new ContentDefinitionWriter(new SettingsFormatter()); + } + + [Test] + public void CreatesElementWithEncodedContentTypeName() { + var alphaInfoset = _writer.Export(new ContentTypeDefinitionBuilder().Named("alpha").Build()); + var betaInfoset = _writer.Export(new ContentTypeDefinitionBuilder().Named(":beta").Build()); + var gammaInfoset = _writer.Export(new ContentTypeDefinitionBuilder().Named(" g a m m a ").Build()); + var deltaInfoset = _writer.Export(new ContentTypeDefinitionBuilder().Named("del\r\nta").Build()); + + Assert.That(XmlConvert.DecodeName(alphaInfoset.Name.LocalName), Is.EqualTo("alpha")); + Assert.That(XmlConvert.DecodeName(betaInfoset.Name.LocalName), Is.EqualTo(":beta")); + Assert.That(XmlConvert.DecodeName(gammaInfoset.Name.LocalName), Is.EqualTo(" g a m m a ")); + Assert.That(XmlConvert.DecodeName(deltaInfoset.Name.LocalName), Is.EqualTo("del\r\nta")); + } + + [Test] + public void ChildElementsArePartNames() { + var alphaInfoset = _writer.Export(new ContentTypeDefinitionBuilder().Named("alpha").WithPart(":beta").WithPart("del\r\nta").Build()); + + Assert.That(XmlConvert.DecodeName(alphaInfoset.Name.LocalName), Is.EqualTo("alpha")); + Assert.That(alphaInfoset.Elements().Count(), Is.EqualTo(2)); + Assert.That(alphaInfoset.Elements().Select(elt => elt.Name.LocalName), Has.Some.EqualTo(XmlConvert.EncodeLocalName(":beta"))); + Assert.That(alphaInfoset.Elements().Select(elt => elt.Name.LocalName), Has.Some.EqualTo(XmlConvert.EncodeLocalName("del\r\nta"))); + } + + [Test] + public void TypeAndTypePartSettingsAreAttributes() { + + var alpha = new ContentTypeDefinitionBuilder() + .Named("alpha") + .WithSetting("x", "1") + .WithPart("beta", part => part.WithSetting(" y ", "2")) + .Build(); + + var alphaInfoset = _writer.Export(alpha); + Assert.That(alphaInfoset.Attributes("x").Single().Value, Is.EqualTo("1")); + Assert.That(alphaInfoset.Elements("beta").Attributes(XmlConvert.EncodeLocalName(" y ")).Single().Value, Is.EqualTo("2")); + } + } +} diff --git a/src/Orchard.Tests/ContentManagement/Models/AlphaPart.cs b/src/Orchard.Tests/ContentManagement/Models/AlphaPart.cs index 8bd3694060f..d525dd2f379 100644 --- a/src/Orchard.Tests/ContentManagement/Models/AlphaPart.cs +++ b/src/Orchard.Tests/ContentManagement/Models/AlphaPart.cs @@ -1,6 +1,6 @@ -using Orchard.ContentManagement; - -namespace Orchard.Tests.ContentManagement.Models { - public class AlphaPart : ContentPart { - } +using Orchard.ContentManagement; + +namespace Orchard.Tests.ContentManagement.Models { + public class AlphaPart : ContentPart { + } } \ No newline at end of file diff --git a/src/Orchard.Tests/ContentManagement/Models/BetaPart.cs b/src/Orchard.Tests/ContentManagement/Models/BetaPart.cs index 84a1b7486dd..f74ae7b1c8d 100644 --- a/src/Orchard.Tests/ContentManagement/Models/BetaPart.cs +++ b/src/Orchard.Tests/ContentManagement/Models/BetaPart.cs @@ -1,6 +1,6 @@ -using Orchard.ContentManagement; - -namespace Orchard.Tests.ContentManagement.Models { - public class BetaPart : ContentPart { - } +using Orchard.ContentManagement; + +namespace Orchard.Tests.ContentManagement.Models { + public class BetaPart : ContentPart { + } } \ No newline at end of file diff --git a/src/Orchard.Tests/ContentManagement/Models/DeltaPart.cs b/src/Orchard.Tests/ContentManagement/Models/DeltaPart.cs index 5ed50c7a554..774e68b5294 100644 --- a/src/Orchard.Tests/ContentManagement/Models/DeltaPart.cs +++ b/src/Orchard.Tests/ContentManagement/Models/DeltaPart.cs @@ -1,7 +1,7 @@ -using Orchard.ContentManagement; -using Orchard.Tests.ContentManagement.Records; - -namespace Orchard.Tests.ContentManagement.Models { - public class DeltaPart : ContentPart { - } -} +using Orchard.ContentManagement; +using Orchard.Tests.ContentManagement.Records; + +namespace Orchard.Tests.ContentManagement.Models { + public class DeltaPart : ContentPart { + } +} diff --git a/src/Orchard.Tests/ContentManagement/Models/EpsilonPart.cs b/src/Orchard.Tests/ContentManagement/Models/EpsilonPart.cs index aaacc94a7f4..10225fd5285 100644 --- a/src/Orchard.Tests/ContentManagement/Models/EpsilonPart.cs +++ b/src/Orchard.Tests/ContentManagement/Models/EpsilonPart.cs @@ -1,6 +1,6 @@ -using Orchard.ContentManagement; - -namespace Orchard.Tests.ContentManagement.Models { - public class EpsilonPart : ContentPart { - } -} +using Orchard.ContentManagement; + +namespace Orchard.Tests.ContentManagement.Models { + public class EpsilonPart : ContentPart { + } +} diff --git a/src/Orchard.Tests/ContentManagement/Models/FlavoredPart.cs b/src/Orchard.Tests/ContentManagement/Models/FlavoredPart.cs index a4525bfc1c3..3f88217b346 100644 --- a/src/Orchard.Tests/ContentManagement/Models/FlavoredPart.cs +++ b/src/Orchard.Tests/ContentManagement/Models/FlavoredPart.cs @@ -1,6 +1,6 @@ -using Orchard.ContentManagement; - -namespace Orchard.Tests.ContentManagement.Models { - public class FlavoredPart : ContentPart { - } -} +using Orchard.ContentManagement; + +namespace Orchard.Tests.ContentManagement.Models { + public class FlavoredPart : ContentPart { + } +} diff --git a/src/Orchard.Tests/ContentManagement/Models/GammaPart.cs b/src/Orchard.Tests/ContentManagement/Models/GammaPart.cs index 36d86520d7c..9317d1c44cc 100644 --- a/src/Orchard.Tests/ContentManagement/Models/GammaPart.cs +++ b/src/Orchard.Tests/ContentManagement/Models/GammaPart.cs @@ -1,7 +1,7 @@ -using Orchard.ContentManagement; -using Orchard.Tests.ContentManagement.Records; - -namespace Orchard.Tests.ContentManagement.Models { - public class GammaPart : ContentPart { - } -} +using Orchard.ContentManagement; +using Orchard.Tests.ContentManagement.Records; + +namespace Orchard.Tests.ContentManagement.Models { + public class GammaPart : ContentPart { + } +} diff --git a/src/Orchard.Tests/ContentManagement/Models/LambdaPart.cs b/src/Orchard.Tests/ContentManagement/Models/LambdaPart.cs index bde3d84e1f5..b0f73de195d 100644 --- a/src/Orchard.Tests/ContentManagement/Models/LambdaPart.cs +++ b/src/Orchard.Tests/ContentManagement/Models/LambdaPart.cs @@ -1,7 +1,7 @@ -using Orchard.ContentManagement; -using Orchard.Tests.ContentManagement.Records; - -namespace Orchard.Tests.ContentManagement.Models { - public class LambdaPart : ContentPart { - } +using Orchard.ContentManagement; +using Orchard.Tests.ContentManagement.Records; + +namespace Orchard.Tests.ContentManagement.Models { + public class LambdaPart : ContentPart { + } } \ No newline at end of file diff --git a/src/Orchard.Tests/ContentManagement/Models/Phi.cs b/src/Orchard.Tests/ContentManagement/Models/Phi.cs index b4f2977b40d..b65bd1e0a5c 100644 --- a/src/Orchard.Tests/ContentManagement/Models/Phi.cs +++ b/src/Orchard.Tests/ContentManagement/Models/Phi.cs @@ -1,10 +1,10 @@ -using Orchard.ContentManagement; -using Orchard.ContentManagement.MetaData.Models; - -namespace Orchard.Tests.ContentManagement.Models { - public class Phi : ContentField { - public Phi() { - PartFieldDefinition = new ContentPartFieldDefinition(new ContentFieldDefinition("Phi"), "Phi", new SettingsDictionary()); - } - } -} +using Orchard.ContentManagement; +using Orchard.ContentManagement.MetaData.Models; + +namespace Orchard.Tests.ContentManagement.Models { + public class Phi : ContentField { + public Phi() { + PartFieldDefinition = new ContentPartFieldDefinition(new ContentFieldDefinition("Phi"), "Phi", new SettingsDictionary()); + } + } +} diff --git a/src/Orchard.Tests/ContentManagement/Models/StyledHandler.cs b/src/Orchard.Tests/ContentManagement/Models/StyledHandler.cs index f683eb6bbd5..939b20c2ab4 100644 --- a/src/Orchard.Tests/ContentManagement/Models/StyledHandler.cs +++ b/src/Orchard.Tests/ContentManagement/Models/StyledHandler.cs @@ -1,15 +1,15 @@ -using Orchard.ContentManagement.Handlers; - -namespace Orchard.Tests.ContentManagement.Models { - public class StyledHandler : ContentHandler { - public StyledHandler() { - OnGetDisplayShape((ctx, part) => ctx.Shape.Zones["Main"].Add(part, "10")); - } - - protected override void Activating(ActivatingContentContext context) { - if (context.ContentType == "alpha") { - context.Builder.Weld(); - } - } - } -} +using Orchard.ContentManagement.Handlers; + +namespace Orchard.Tests.ContentManagement.Models { + public class StyledHandler : ContentHandler { + public StyledHandler() { + OnGetDisplayShape((ctx, part) => ctx.Shape.Zones["Main"].Add(part, "10")); + } + + protected override void Activating(ActivatingContentContext context) { + if (context.ContentType == "alpha") { + context.Builder.Weld(); + } + } + } +} diff --git a/src/Orchard.Tests/ContentManagement/Models/StyledPart.cs b/src/Orchard.Tests/ContentManagement/Models/StyledPart.cs index 654080d2f89..62a42999755 100644 --- a/src/Orchard.Tests/ContentManagement/Models/StyledPart.cs +++ b/src/Orchard.Tests/ContentManagement/Models/StyledPart.cs @@ -1,6 +1,6 @@ -using Orchard.ContentManagement; - -namespace Orchard.Tests.ContentManagement.Models { - public class StyledPart : ContentPart { - } -} +using Orchard.ContentManagement; + +namespace Orchard.Tests.ContentManagement.Models { + public class StyledPart : ContentPart { + } +} diff --git a/src/Orchard.Tests/ContentManagement/Records/DeltaRecord.cs b/src/Orchard.Tests/ContentManagement/Records/DeltaRecord.cs index 77f3cc08e42..f4abce9b0ee 100644 --- a/src/Orchard.Tests/ContentManagement/Records/DeltaRecord.cs +++ b/src/Orchard.Tests/ContentManagement/Records/DeltaRecord.cs @@ -1,7 +1,7 @@ -using Orchard.ContentManagement.Records; - -namespace Orchard.Tests.ContentManagement.Records { - public class DeltaRecord : ContentPartRecord { - public virtual string Quux { get; set; } - } +using Orchard.ContentManagement.Records; + +namespace Orchard.Tests.ContentManagement.Records { + public class DeltaRecord : ContentPartRecord { + public virtual string Quux { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/ContentManagement/Records/EpsilonRecord.cs b/src/Orchard.Tests/ContentManagement/Records/EpsilonRecord.cs index bc680ac379f..95e2366ac28 100644 --- a/src/Orchard.Tests/ContentManagement/Records/EpsilonRecord.cs +++ b/src/Orchard.Tests/ContentManagement/Records/EpsilonRecord.cs @@ -1,7 +1,7 @@ -using Orchard.ContentManagement.Records; - -namespace Orchard.Tests.ContentManagement.Models { - public class EpsilonRecord : ContentPartVersionRecord { - public virtual string Quad { get; set; } - } +using Orchard.ContentManagement.Records; + +namespace Orchard.Tests.ContentManagement.Models { + public class EpsilonRecord : ContentPartVersionRecord { + public virtual string Quad { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/ContentManagement/Records/GammaRecord.cs b/src/Orchard.Tests/ContentManagement/Records/GammaRecord.cs index 8adf9f495c2..7d0c8603579 100644 --- a/src/Orchard.Tests/ContentManagement/Records/GammaRecord.cs +++ b/src/Orchard.Tests/ContentManagement/Records/GammaRecord.cs @@ -1,7 +1,7 @@ -using Orchard.ContentManagement.Records; - -namespace Orchard.Tests.ContentManagement.Records { - public class GammaRecord : ContentPartRecord { - public virtual string Frap { get; set; } - } +using Orchard.ContentManagement.Records; + +namespace Orchard.Tests.ContentManagement.Records { + public class GammaRecord : ContentPartRecord { + public virtual string Frap { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/ContentManagement/Records/LambdaRecord.cs b/src/Orchard.Tests/ContentManagement/Records/LambdaRecord.cs index 5234c1b2f5a..7b28ef53544 100644 --- a/src/Orchard.Tests/ContentManagement/Records/LambdaRecord.cs +++ b/src/Orchard.Tests/ContentManagement/Records/LambdaRecord.cs @@ -1,19 +1,19 @@ -using System; -using Orchard.ContentManagement.Records; - -namespace Orchard.Tests.ContentManagement.Records { - public class LambdaRecord : ContentPartRecord { - public LambdaRecord() { - DateTimeStuff = new DateTime(1980,1,1); - } - - public virtual int IntegerStuff { get; set; } - public virtual long LongStuff { get; set; } - public virtual bool BooleanStuff { get; set; } - public virtual float FloatStuff { get; set; } - public virtual double DoubleStuff { get; set; } - public virtual Decimal DecimalStuff { get; set; } - public virtual string StringStuff { get; set; } - public virtual DateTime DateTimeStuff { get; set; } - } +using System; +using Orchard.ContentManagement.Records; + +namespace Orchard.Tests.ContentManagement.Records { + public class LambdaRecord : ContentPartRecord { + public LambdaRecord() { + DateTimeStuff = new DateTime(1980,1,1); + } + + public virtual int IntegerStuff { get; set; } + public virtual long LongStuff { get; set; } + public virtual bool BooleanStuff { get; set; } + public virtual float FloatStuff { get; set; } + public virtual double DoubleStuff { get; set; } + public virtual Decimal DecimalStuff { get; set; } + public virtual string StringStuff { get; set; } + public virtual DateTime DateTimeStuff { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/ContentManagement/Records/MegaRecord.cs b/src/Orchard.Tests/ContentManagement/Records/MegaRecord.cs index da8eb766ade..b96118965f9 100644 --- a/src/Orchard.Tests/ContentManagement/Records/MegaRecord.cs +++ b/src/Orchard.Tests/ContentManagement/Records/MegaRecord.cs @@ -1,12 +1,12 @@ -using Orchard.Data.Conventions; - -namespace Orchard.Tests.ContentManagement.Records { - public class MegaRecord { - public virtual int Id { get; set; } - - [StringLengthMax] - public virtual string BigStuff { get; set; } - public virtual string SmallStuff { get; set; } - - } +using Orchard.Data.Conventions; + +namespace Orchard.Tests.ContentManagement.Records { + public class MegaRecord { + public virtual int Id { get; set; } + + [StringLengthMax] + public virtual string BigStuff { get; set; } + public virtual string SmallStuff { get; set; } + + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Data/Bags/SettingsTests.cs b/src/Orchard.Tests/Data/Bags/SettingsTests.cs index deac0f4c344..ec16acc0d70 100644 --- a/src/Orchard.Tests/Data/Bags/SettingsTests.cs +++ b/src/Orchard.Tests/Data/Bags/SettingsTests.cs @@ -1,162 +1,162 @@ -using NUnit.Framework; -using Orchard.Data.Bags; -using Orchard.Data.Bags.Serialization; -using System.Collections.Generic; -using System.IO; - -namespace Orchard.Tests.Data.Bags { - [TestFixture] - public class BagsTests { - [Test] - public void ShouldRemoveMember() { - dynamic e = new Bag(); - e.Foo = "Bar"; - Assert.That(e, Is.Not.Empty); - Assert.That(e.Foo, Is.EqualTo("Bar")); - - e.Foo = null; - Assert.That(e, Is.Empty); - } - - [Test] - public void ShouldSupportFactoryInvocation() { - var e = Bag.New(); - - e.Foo = "Bar"; - Assert.That(e["Foo"], Is.EqualTo("Bar")); - Assert.That(e.Foo, Is.EqualTo("Bar")); - } - - [Test] - public void ShouldAddDynamicProperties() { - dynamic e = new Bag(); - e.Foo = "Bar"; - Assert.That(e["Foo"], Is.EqualTo("Bar")); - Assert.That(e.Foo, Is.EqualTo("Bar")); - } - - [Test] - public void UnknownPropertiesShouldBeNull() { - dynamic e = new Bag(); - Assert.That((object)e["Foo"], Is.EqualTo(null)); - Assert.That((object)e.Foo, Is.EqualTo(null)); - } - - [Test] - public void ShouldAddDynamicObjects() { - dynamic e = new Bag(); - e.Address = new Bag(); - - e.Address.Street = "One Microsoft Way"; - Assert.That(e["Address"]["Street"], Is.EqualTo("One Microsoft Way")); - Assert.That(e.Address.Street, Is.EqualTo("One Microsoft Way")); - } - - public void ShouldAddArraysOfAnonymousObject() { - dynamic e = new Bag(); - - e.Foos = new[] { new { Foo1 = "Bar1", Foo2 = "Bar2" } }; - Assert.That(e.Foos[0].Foo1, Is.EqualTo("Bar1")); - Assert.That(e.Foos[0].Foo2, Is.EqualTo("Bar2")); - } - - public void ShouldAddAnonymousObject() { - dynamic e = new Bag(); - - e.Foos = new { Foo1 = "Bar1", Foo2 = "Bar2" }; - Assert.That(e.Foos.Foo1, Is.EqualTo("Bar1")); - Assert.That(e.Foos.Foo2, Is.EqualTo("Bar2")); - } - - [Test] - public void ShouldAddArrays() { - dynamic e = new Bag(); - e.Owners = new[] { "Steve", "Bill" }; - Assert.That(e.Owners[0], Is.EqualTo("Steve")); - Assert.That(e.Owners[1], Is.EqualTo("Bill")); - } - - [Test] - public void ShouldBeEnumerable() { - dynamic e = new Bag(); - e.Address = new Bag(); - - e.Address.Street = "One Microsoft Way"; - e.Foos = new[] { new { Foo1 = "Bar1", Foo2 = "Bar2" } }; - e.Owners = new[] { "Steve", "Bill" }; - - // IEnumerable - Assert.That(e, Has.Some.Matches>(x => x.Key == "Address")); - Assert.That(e, Has.Some.Matches>(x => x.Key == "Owners")); - Assert.That(e, Has.Some.Matches>(x => x.Key == "Foos")); - } - - [Test] - public void ShouldSerializeAndDeserialize() { - dynamic e = new Bag(); - - e.Foo = "Bar"; - - e.Address = new Bag(); - e.Address.Street = "One Microsoft Way"; - e.Owners = new[] { "Steve", "Bill" }; - e.Foos = new[] { new { Foo1 = "Bar1", Foo2 = "Bar2" } }; - - string xml1; - - var serializer = new XmlSettingsSerializer(); - using (var sw = new StringWriter()) { - serializer.Serialize(sw, e); - xml1 = sw.ToString(); - } - - dynamic clone; - - using (var sr = new StringReader(xml1)) { - clone = serializer.Deserialize(sr); - } - - string xml2; - - using (var sw = new StringWriter()) { - serializer.Serialize(sw, clone); - xml2 = sw.ToString(); - } - - Assert.That(xml1, Is.EqualTo(xml2)); - } - - [Test] - public void MergeShouldOverwriteExistingProperties() { - var o1 = Bag.New(); - o1.Foo = "Foo1"; - o1.Bar = "Bar1"; - - var o2 = Bag.New(); - o2.Foo = "Foo2"; - o2.Baz = "Baz2"; - - var o3 = o1 & o2; - - Assert.That(o3.Foo, Is.EqualTo("Foo2")); - Assert.That(o3.Bar, Is.EqualTo("Bar1")); - Assert.That(o3.Baz, Is.EqualTo("Baz2")); - } - - [Test] - public void MergeShouldConcatenateArrays() { - var o1 = Bag.New(); - o1.Foo = new[] { "a", "b" }; - - var o2 = Bag.New(); - o2.Foo = new[] { "c", "d" }; - - var o3 = o1 & o2; - - Assert.That(o3.Foo[0], Is.EqualTo("a")); - Assert.That(o3.Foo[1], Is.EqualTo("b")); - Assert.That(o3.Foo[2], Is.EqualTo("c")); - Assert.That(o3.Foo[3], Is.EqualTo("d")); - } - } -} +using NUnit.Framework; +using Orchard.Data.Bags; +using Orchard.Data.Bags.Serialization; +using System.Collections.Generic; +using System.IO; + +namespace Orchard.Tests.Data.Bags { + [TestFixture] + public class BagsTests { + [Test] + public void ShouldRemoveMember() { + dynamic e = new Bag(); + e.Foo = "Bar"; + Assert.That(e, Is.Not.Empty); + Assert.That(e.Foo, Is.EqualTo("Bar")); + + e.Foo = null; + Assert.That(e, Is.Empty); + } + + [Test] + public void ShouldSupportFactoryInvocation() { + var e = Bag.New(); + + e.Foo = "Bar"; + Assert.That(e["Foo"], Is.EqualTo("Bar")); + Assert.That(e.Foo, Is.EqualTo("Bar")); + } + + [Test] + public void ShouldAddDynamicProperties() { + dynamic e = new Bag(); + e.Foo = "Bar"; + Assert.That(e["Foo"], Is.EqualTo("Bar")); + Assert.That(e.Foo, Is.EqualTo("Bar")); + } + + [Test] + public void UnknownPropertiesShouldBeNull() { + dynamic e = new Bag(); + Assert.That((object)e["Foo"], Is.EqualTo(null)); + Assert.That((object)e.Foo, Is.EqualTo(null)); + } + + [Test] + public void ShouldAddDynamicObjects() { + dynamic e = new Bag(); + e.Address = new Bag(); + + e.Address.Street = "One Microsoft Way"; + Assert.That(e["Address"]["Street"], Is.EqualTo("One Microsoft Way")); + Assert.That(e.Address.Street, Is.EqualTo("One Microsoft Way")); + } + + public void ShouldAddArraysOfAnonymousObject() { + dynamic e = new Bag(); + + e.Foos = new[] { new { Foo1 = "Bar1", Foo2 = "Bar2" } }; + Assert.That(e.Foos[0].Foo1, Is.EqualTo("Bar1")); + Assert.That(e.Foos[0].Foo2, Is.EqualTo("Bar2")); + } + + public void ShouldAddAnonymousObject() { + dynamic e = new Bag(); + + e.Foos = new { Foo1 = "Bar1", Foo2 = "Bar2" }; + Assert.That(e.Foos.Foo1, Is.EqualTo("Bar1")); + Assert.That(e.Foos.Foo2, Is.EqualTo("Bar2")); + } + + [Test] + public void ShouldAddArrays() { + dynamic e = new Bag(); + e.Owners = new[] { "Steve", "Bill" }; + Assert.That(e.Owners[0], Is.EqualTo("Steve")); + Assert.That(e.Owners[1], Is.EqualTo("Bill")); + } + + [Test] + public void ShouldBeEnumerable() { + dynamic e = new Bag(); + e.Address = new Bag(); + + e.Address.Street = "One Microsoft Way"; + e.Foos = new[] { new { Foo1 = "Bar1", Foo2 = "Bar2" } }; + e.Owners = new[] { "Steve", "Bill" }; + + // IEnumerable + Assert.That(e, Has.Some.Matches>(x => x.Key == "Address")); + Assert.That(e, Has.Some.Matches>(x => x.Key == "Owners")); + Assert.That(e, Has.Some.Matches>(x => x.Key == "Foos")); + } + + [Test] + public void ShouldSerializeAndDeserialize() { + dynamic e = new Bag(); + + e.Foo = "Bar"; + + e.Address = new Bag(); + e.Address.Street = "One Microsoft Way"; + e.Owners = new[] { "Steve", "Bill" }; + e.Foos = new[] { new { Foo1 = "Bar1", Foo2 = "Bar2" } }; + + string xml1; + + var serializer = new XmlSettingsSerializer(); + using (var sw = new StringWriter()) { + serializer.Serialize(sw, e); + xml1 = sw.ToString(); + } + + dynamic clone; + + using (var sr = new StringReader(xml1)) { + clone = serializer.Deserialize(sr); + } + + string xml2; + + using (var sw = new StringWriter()) { + serializer.Serialize(sw, clone); + xml2 = sw.ToString(); + } + + Assert.That(xml1, Is.EqualTo(xml2)); + } + + [Test] + public void MergeShouldOverwriteExistingProperties() { + var o1 = Bag.New(); + o1.Foo = "Foo1"; + o1.Bar = "Bar1"; + + var o2 = Bag.New(); + o2.Foo = "Foo2"; + o2.Baz = "Baz2"; + + var o3 = o1 & o2; + + Assert.That(o3.Foo, Is.EqualTo("Foo2")); + Assert.That(o3.Bar, Is.EqualTo("Bar1")); + Assert.That(o3.Baz, Is.EqualTo("Baz2")); + } + + [Test] + public void MergeShouldConcatenateArrays() { + var o1 = Bag.New(); + o1.Foo = new[] { "a", "b" }; + + var o2 = Bag.New(); + o2.Foo = new[] { "c", "d" }; + + var o3 = o1 & o2; + + Assert.That(o3.Foo[0], Is.EqualTo("a")); + Assert.That(o3.Foo[1], Is.EqualTo("b")); + Assert.That(o3.Foo[2], Is.EqualTo("c")); + Assert.That(o3.Foo[3], Is.EqualTo("d")); + } + } +} diff --git a/src/Orchard.Tests/Data/Builders/SessionFactoryBuilderTests.cs b/src/Orchard.Tests/Data/Builders/SessionFactoryBuilderTests.cs index a1658b869bc..228957511d1 100644 --- a/src/Orchard.Tests/Data/Builders/SessionFactoryBuilderTests.cs +++ b/src/Orchard.Tests/Data/Builders/SessionFactoryBuilderTests.cs @@ -1,48 +1,48 @@ -using NUnit.Framework; -using Orchard.Environment.ShellBuilders.Models; -using Orchard.Tests.Records; - -namespace Orchard.Tests.Data.Builders { - [TestFixture] - public class SessionFactoryBuilderTests { - [Test] - public void SqlCeSchemaShouldBeGeneratedAndUsable() { - - var recordDescriptors = new[] { - new RecordBlueprint {TableName = "Hello", Type = typeof (FooRecord)} - }; - - ProviderUtilities.RunWithSqlCe(recordDescriptors, - sessionFactory => { - var session = sessionFactory.OpenSession(); - var foo = new FooRecord { Name = "hi there" }; - session.Save(foo); - session.Flush(); - session.Close(); - - Assert.That(foo, Is.Not.EqualTo(0)); - - }); - - } - - [Test] - public void SqlServerSchemaShouldBeGeneratedAndUsable() { - var recordDescriptors = new[] { - new RecordBlueprint {TableName = "Hello", Type = typeof (FooRecord)} - }; - - ProviderUtilities.RunWithSqlServer(recordDescriptors, - sessionFactory => { - var session = sessionFactory.OpenSession(); - var foo = new FooRecord { Name = "hi there" }; - session.Save(foo); - session.Flush(); - session.Close(); - - Assert.That(foo, Is.Not.EqualTo(0)); - - }); - } - } +using NUnit.Framework; +using Orchard.Environment.ShellBuilders.Models; +using Orchard.Tests.Records; + +namespace Orchard.Tests.Data.Builders { + [TestFixture] + public class SessionFactoryBuilderTests { + [Test] + public void SqlCeSchemaShouldBeGeneratedAndUsable() { + + var recordDescriptors = new[] { + new RecordBlueprint {TableName = "Hello", Type = typeof (FooRecord)} + }; + + ProviderUtilities.RunWithSqlCe(recordDescriptors, + sessionFactory => { + var session = sessionFactory.OpenSession(); + var foo = new FooRecord { Name = "hi there" }; + session.Save(foo); + session.Flush(); + session.Close(); + + Assert.That(foo, Is.Not.EqualTo(0)); + + }); + + } + + [Test] + public void SqlServerSchemaShouldBeGeneratedAndUsable() { + var recordDescriptors = new[] { + new RecordBlueprint {TableName = "Hello", Type = typeof (FooRecord)} + }; + + ProviderUtilities.RunWithSqlServer(recordDescriptors, + sessionFactory => { + var session = sessionFactory.OpenSession(); + var foo = new FooRecord { Name = "hi there" }; + session.Save(foo); + session.Flush(); + session.Close(); + + Assert.That(foo, Is.Not.EqualTo(0)); + + }); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Data/ProviderUtilities.cs b/src/Orchard.Tests/Data/ProviderUtilities.cs index 8f7f3a12e22..f3bcd3e2f67 100644 --- a/src/Orchard.Tests/Data/ProviderUtilities.cs +++ b/src/Orchard.Tests/Data/ProviderUtilities.cs @@ -1,131 +1,131 @@ -using System; -using System.Collections.Generic; -using System.Data.SqlClient; -using System.Diagnostics; -using System.IO; -using Autofac.Features.Metadata; -using NHibernate; -using NHibernate.Tool.hbm2ddl; -using Orchard.Data.Providers; -using Orchard.Environment.ShellBuilders.Models; - -namespace Orchard.Tests.Data { - public class ProviderUtilities { - - public static void RunWithSqlServer(IEnumerable recordDescriptors, Action action) { - var temporaryPath = Path.GetTempFileName(); - if (File.Exists(temporaryPath)) - File.Delete(temporaryPath); - Directory.CreateDirectory(temporaryPath); - var databasePath = Path.Combine(temporaryPath, "Orchard.mdf"); - var databaseName = Path.GetFileNameWithoutExtension(databasePath); - try { - // create database - if (!TryCreateSqlServerDatabase(databasePath, databaseName)) - return; - - var meta = new Meta((dataFolder, connectionString) => - new SqlServerDataServicesProvider(dataFolder, connectionString), - new Dictionary { { "ProviderName", "SqlServer" } }); - - var manager = (IDataServicesProviderFactory)new DataServicesProviderFactory(new[] { meta }); - - var parameters = new SessionFactoryParameters { - Provider = "SqlServer", - DataFolder = temporaryPath, - ConnectionString = "Data Source=.\\SQLEXPRESS;AttachDbFileName=" + databasePath + ";Integrated Security=True;User Instance=True;", - RecordDescriptors = recordDescriptors, - }; - - var configuration = manager - .CreateProvider(parameters) - .BuildConfiguration(parameters); - - new SchemaExport(configuration).Execute(false, true, false); - - using (var sessionFactory = configuration.BuildSessionFactory()) { - action(sessionFactory); - } - } - finally { - try { - Directory.Delete(temporaryPath, true); - } - catch (IOException) { } - } - } - - private static bool TryCreateSqlServerDatabase(string databasePath, string databaseName) { - var connection = TryOpenSqlServerConnection(); - if (connection == null) - return false; - - using (connection) { - using (var command = connection.CreateCommand()) { - command.CommandText = - "CREATE DATABASE " + databaseName + - " ON PRIMARY (NAME=" + databaseName + - ", FILENAME='" + databasePath.Replace("'", "''") + "')"; - command.ExecuteNonQuery(); - - command.CommandText = - "EXEC sp_detach_db '" + databaseName + "', 'true'"; - command.ExecuteNonQuery(); - } - } - return true; - } - - private static SqlConnection TryOpenSqlServerConnection() { - try { - var connection = new SqlConnection("Data Source=.\\SQLEXPRESS;Initial Catalog=tempdb;Integrated Security=true;User Instance=True;"); - connection.Open(); - return connection; - } - catch (SqlException e) { - Trace.WriteLine(string.Format("Error opening connection to Sql Server ('{0}'). Skipping test.", e.Message)); - return null; - } - } - - public static void RunWithSqlCe(IEnumerable recordDescriptors, Action action) { - var temporaryPath = Path.GetTempFileName(); - if (File.Exists(temporaryPath)) - File.Delete(temporaryPath); - Directory.CreateDirectory(temporaryPath); - var databasePath = Path.Combine(temporaryPath, "Orchard.mdf"); - var databaseName = Path.GetFileNameWithoutExtension(databasePath); - var parameters = new SessionFactoryParameters { - Provider = "SqlCe", - DataFolder = temporaryPath, - RecordDescriptors = recordDescriptors - }; - try { - var manager = (IDataServicesProviderFactory)new DataServicesProviderFactory(new[] { - new Meta( - (dataFolder, connectionString) => new SqlCeDataServicesProvider(dataFolder, connectionString), - new Dictionary {{"ProviderName", "SqlCe"}}) - }); - - var configuration = manager - .CreateProvider(parameters) - .BuildConfiguration(parameters); - - configuration.SetProperty("connection.release_mode", "on_close"); - - new SchemaExport(configuration).Execute(false, true, false); - - using (var sessionFactory = configuration.BuildSessionFactory()) { - action(sessionFactory); - } - - } - finally { - try { - Directory.Delete(temporaryPath, true); - } - catch (IOException) { } - } - } - } -} +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Diagnostics; +using System.IO; +using Autofac.Features.Metadata; +using NHibernate; +using NHibernate.Tool.hbm2ddl; +using Orchard.Data.Providers; +using Orchard.Environment.ShellBuilders.Models; + +namespace Orchard.Tests.Data { + public class ProviderUtilities { + + public static void RunWithSqlServer(IEnumerable recordDescriptors, Action action) { + var temporaryPath = Path.GetTempFileName(); + if (File.Exists(temporaryPath)) + File.Delete(temporaryPath); + Directory.CreateDirectory(temporaryPath); + var databasePath = Path.Combine(temporaryPath, "Orchard.mdf"); + var databaseName = Path.GetFileNameWithoutExtension(databasePath); + try { + // create database + if (!TryCreateSqlServerDatabase(databasePath, databaseName)) + return; + + var meta = new Meta((dataFolder, connectionString) => + new SqlServerDataServicesProvider(dataFolder, connectionString), + new Dictionary { { "ProviderName", "SqlServer" } }); + + var manager = (IDataServicesProviderFactory)new DataServicesProviderFactory(new[] { meta }); + + var parameters = new SessionFactoryParameters { + Provider = "SqlServer", + DataFolder = temporaryPath, + ConnectionString = "Data Source=.\\SQLEXPRESS;AttachDbFileName=" + databasePath + ";Integrated Security=True;User Instance=True;", + RecordDescriptors = recordDescriptors, + }; + + var configuration = manager + .CreateProvider(parameters) + .BuildConfiguration(parameters); + + new SchemaExport(configuration).Execute(false, true, false); + + using (var sessionFactory = configuration.BuildSessionFactory()) { + action(sessionFactory); + } + } + finally { + try { + Directory.Delete(temporaryPath, true); + } + catch (IOException) { } + } + } + + private static bool TryCreateSqlServerDatabase(string databasePath, string databaseName) { + var connection = TryOpenSqlServerConnection(); + if (connection == null) + return false; + + using (connection) { + using (var command = connection.CreateCommand()) { + command.CommandText = + "CREATE DATABASE " + databaseName + + " ON PRIMARY (NAME=" + databaseName + + ", FILENAME='" + databasePath.Replace("'", "''") + "')"; + command.ExecuteNonQuery(); + + command.CommandText = + "EXEC sp_detach_db '" + databaseName + "', 'true'"; + command.ExecuteNonQuery(); + } + } + return true; + } + + private static SqlConnection TryOpenSqlServerConnection() { + try { + var connection = new SqlConnection("Data Source=.\\SQLEXPRESS;Initial Catalog=tempdb;Integrated Security=true;User Instance=True;"); + connection.Open(); + return connection; + } + catch (SqlException e) { + Trace.WriteLine(string.Format("Error opening connection to Sql Server ('{0}'). Skipping test.", e.Message)); + return null; + } + } + + public static void RunWithSqlCe(IEnumerable recordDescriptors, Action action) { + var temporaryPath = Path.GetTempFileName(); + if (File.Exists(temporaryPath)) + File.Delete(temporaryPath); + Directory.CreateDirectory(temporaryPath); + var databasePath = Path.Combine(temporaryPath, "Orchard.mdf"); + var databaseName = Path.GetFileNameWithoutExtension(databasePath); + var parameters = new SessionFactoryParameters { + Provider = "SqlCe", + DataFolder = temporaryPath, + RecordDescriptors = recordDescriptors + }; + try { + var manager = (IDataServicesProviderFactory)new DataServicesProviderFactory(new[] { + new Meta( + (dataFolder, connectionString) => new SqlCeDataServicesProvider(dataFolder, connectionString), + new Dictionary {{"ProviderName", "SqlCe"}}) + }); + + var configuration = manager + .CreateProvider(parameters) + .BuildConfiguration(parameters); + + configuration.SetProperty("connection.release_mode", "on_close"); + + new SchemaExport(configuration).Execute(false, true, false); + + using (var sessionFactory = configuration.BuildSessionFactory()) { + action(sessionFactory); + } + + } + finally { + try { + Directory.Delete(temporaryPath, true); + } + catch (IOException) { } + } + } + } +} diff --git a/src/Orchard.Tests/Data/ProvidersTests.cs b/src/Orchard.Tests/Data/ProvidersTests.cs index cf7c7350352..ff0b554c576 100644 --- a/src/Orchard.Tests/Data/ProvidersTests.cs +++ b/src/Orchard.Tests/Data/ProvidersTests.cs @@ -1,62 +1,62 @@ -using System; -using NUnit.Framework; -using Orchard.Environment.ShellBuilders.Models; -using Orchard.Tests.Records; - -namespace Orchard.Tests.Data { - [TestFixture] - public class ProvidersTests { - - [Test] - public void SqlCeShouldHandleBigFields() { - - var recordDescriptors = new[] { - new RecordBlueprint {TableName = "Big", Type = typeof (BigRecord)} - }; - - ProviderUtilities.RunWithSqlCe(recordDescriptors, - sessionFactory => { - var session = sessionFactory.OpenSession(); - var foo = new BigRecord { Body = new String('x', 10000), Banner = new byte[10000]}; - session.Save(foo); - session.Flush(); - session.Close(); - - session = sessionFactory.OpenSession(); - foo = session.Get(foo.Id); - session.Close(); - - Assert.That(foo, Is.Not.Null); - Assert.That(foo.Body, Is.EqualTo(new String('x', 10000))); - Assert.That(foo.Banner.Length, Is.EqualTo(10000)); - }); - } - - - [Test] - public void SqlServerShouldHandleBigFields() { - - var recordDescriptors = new[] { - new RecordBlueprint {TableName = "Big", Type = typeof (BigRecord)} - }; - - ProviderUtilities.RunWithSqlServer(recordDescriptors, - sessionFactory => { - var session = sessionFactory.OpenSession(); - var foo = new BigRecord { Body = new String('x', 10000), Banner = new byte[10000] }; - session.Save(foo); - session.Flush(); - session.Close(); - - session = sessionFactory.OpenSession(); - foo = session.Get(foo.Id); - session.Close(); - - Assert.That(foo, Is.Not.Null); - Assert.That(foo.Body, Is.EqualTo(new String('x', 10000))); - Assert.That(foo.Banner.Length, Is.EqualTo(10000)); - - }); - } - } +using System; +using NUnit.Framework; +using Orchard.Environment.ShellBuilders.Models; +using Orchard.Tests.Records; + +namespace Orchard.Tests.Data { + [TestFixture] + public class ProvidersTests { + + [Test] + public void SqlCeShouldHandleBigFields() { + + var recordDescriptors = new[] { + new RecordBlueprint {TableName = "Big", Type = typeof (BigRecord)} + }; + + ProviderUtilities.RunWithSqlCe(recordDescriptors, + sessionFactory => { + var session = sessionFactory.OpenSession(); + var foo = new BigRecord { Body = new String('x', 10000), Banner = new byte[10000]}; + session.Save(foo); + session.Flush(); + session.Close(); + + session = sessionFactory.OpenSession(); + foo = session.Get(foo.Id); + session.Close(); + + Assert.That(foo, Is.Not.Null); + Assert.That(foo.Body, Is.EqualTo(new String('x', 10000))); + Assert.That(foo.Banner.Length, Is.EqualTo(10000)); + }); + } + + + [Test] + public void SqlServerShouldHandleBigFields() { + + var recordDescriptors = new[] { + new RecordBlueprint {TableName = "Big", Type = typeof (BigRecord)} + }; + + ProviderUtilities.RunWithSqlServer(recordDescriptors, + sessionFactory => { + var session = sessionFactory.OpenSession(); + var foo = new BigRecord { Body = new String('x', 10000), Banner = new byte[10000] }; + session.Save(foo); + session.Flush(); + session.Close(); + + session = sessionFactory.OpenSession(); + foo = session.Get(foo.Id); + session.Close(); + + Assert.That(foo, Is.Not.Null); + Assert.That(foo.Body, Is.EqualTo(new String('x', 10000))); + Assert.That(foo.Banner.Length, Is.EqualTo(10000)); + + }); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Data/RepositoryTests.cs b/src/Orchard.Tests/Data/RepositoryTests.cs index 32b539a84f3..b518cd4c946 100644 --- a/src/Orchard.Tests/Data/RepositoryTests.cs +++ b/src/Orchard.Tests/Data/RepositoryTests.cs @@ -1,207 +1,207 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using NHibernate; -using NUnit.Framework; -using Orchard.Data; -using Orchard.Tests.ContentManagement; -using Orchard.Tests.Records; - -namespace Orchard.Tests.Data { - [TestFixture] - public class RepositoryTests { - #region Setup/Teardown - - [TestFixtureSetUp] - public void InitFixture() { - } - - [SetUp] - public void Init() { - _databaseFilePath = Path.GetTempFileName(); - _sessionFactory = DataUtility.CreateSessionFactory(_databaseFilePath, typeof(FooRecord)); - _session = _sessionFactory.OpenSession(); - _fooRepos = new Repository(new TestTransactionManager(_session)); - } - - [TearDown] - public void Term() { - _session.Close(); - } - - [TestFixtureTearDown] - public void TermFixture() { - File.Delete(_databaseFilePath); - } - - #endregion - - private IRepository _fooRepos; - private ISession _session; - private string _databaseFilePath; - private ISessionFactory _sessionFactory; - - private void CreateThreeFoos() { - _fooRepos.Create(new FooRecord { Name = "one" }); - _fooRepos.Create(new FooRecord { Name = "two" }); - _fooRepos.Create(new FooRecord { Name = "three" }); - } - - [Test] - public void GetByIdShouldReturnNullIfValueNotFound() { - CreateThreeFoos(); - var nofoo = _fooRepos.Get(6655321); - Assert.That(nofoo, Is.Null); - } - - [Test] - public void GetCanSelectSingleBasedOnFields() { - CreateThreeFoos(); - - var two = _fooRepos.Get(f => f.Name == "two"); - Assert.That(two.Name, Is.EqualTo("two")); - } - - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void GetThatReturnsTwoOrMoreShouldThrowException() { - CreateThreeFoos(); - _fooRepos.Get(f => f.Name == "one" || f.Name == "three"); - } - - [Test] - public void GetWithZeroMatchesShouldReturnNull() { - CreateThreeFoos(); - var nofoo = _fooRepos.Get(f => f.Name == "four"); - Assert.That(nofoo, Is.Null); - } - - [Test] - public void LinqCanBeUsedToSelectObjects() { - CreateThreeFoos(); - - var foos = from f in _fooRepos.Table - where f.Name == "one" || f.Name == "two" - select f; - - Assert.That(foos.Count(), Is.EqualTo(2)); - Assert.That(foos, Has.Some.Property("Name").EqualTo("one")); - Assert.That(foos, Has.Some.Property("Name").EqualTo("two")); - } - - [Test] - public void LinqExtensionMethodsCanAlsoBeUsedToSelectObjects() { - CreateThreeFoos(); - - var foos = _fooRepos.Table - .Where(f => f.Name == "one" || f.Name == "two"); - - Assert.That(foos.Count(), Is.EqualTo(2)); - Assert.That(foos, Has.Some.Property("Name").EqualTo("one")); - Assert.That(foos, Has.Some.Property("Name").EqualTo("two")); - } - - [Test] - public void OrderShouldControlResults() { - CreateThreeFoos(); - - var foos = _fooRepos.Fetch( - f => f.Name == "two" || f.Name == "three", - o => o.Asc(f => f.Name, f => f.Id)); - - Assert.That(foos.Count(), Is.EqualTo(2)); - Assert.That(foos.First().Name, Is.EqualTo("three")); - Assert.That(foos.Skip(1).First().Name, Is.EqualTo("two")); - } - - [Test] - public void LinqOrderByCanBeUsedToControlResults() { - CreateThreeFoos(); - - IEnumerable foos = - from f in _fooRepos.Table - where f.Name == "two" || f.Name == "three" - orderby f.Name, f.Id ascending - select f; - - Assert.That(foos.Count(), Is.EqualTo(2)); - Assert.That(foos.First().Name, Is.EqualTo("three")); - Assert.That(foos.Skip(1).First().Name, Is.EqualTo("two")); - } - - [Test] - public void RangeShouldSliceResults() { - for (var x = 0; x != 40; ++x) { - _fooRepos.Create(new FooRecord { Name = x.ToString().PadLeft(8, '0') }); - } - - var foos = _fooRepos.Fetch( - f => f.Name.StartsWith("000"), - o => o.Asc(f => f.Name), - 10, 20); - - Assert.That(foos.Count(), Is.EqualTo(20)); - Assert.That(foos.First().Name, Is.EqualTo("00000010")); - Assert.That(foos.Last().Name, Is.EqualTo("00000029")); - } - - [Test] - public void RepositoryCanCreateFetchAndDelete() { - var foo1 = new FooRecord { Name = "yadda" }; - _fooRepos.Create(foo1); - - var foo2 = _fooRepos.Get(foo1.Id); - foo2.Name = "blah"; - - Assert.That(foo1, Is.SameAs(foo2)); - - _fooRepos.Delete(foo2); - } - - [Test] - public void RepositoryFetchTakesCompoundLambdaPredicate() { - CreateThreeFoos(); - - var foos = _fooRepos.Fetch(f => f.Name == "three" || f.Name == "two"); - - Assert.That(foos.Count(), Is.EqualTo(2)); - Assert.That(foos, Has.Some.Property("Name").EqualTo("two")); - Assert.That(foos, Has.Some.Property("Name").EqualTo("three")); - } - - [Test] - public void RepositoryFetchTakesSimpleLambdaPredicate() { - CreateThreeFoos(); - - var one = _fooRepos.Fetch(f => f.Name == "one").Single(); - var two = _fooRepos.Fetch(f => f.Name == "two").Single(); - - Assert.That(one.Name, Is.EqualTo("one")); - Assert.That(two.Name, Is.EqualTo("two")); - } - - [Test] - public void StoringDateTimeDoesntRemovePrecision() { - _fooRepos.Create(new FooRecord { Name = "one", Timespan = DateTime.Parse("2001-01-01 16:28:21.489", CultureInfo.InvariantCulture) }); - - var one = _fooRepos.Fetch(f => f.Name == "one").Single(); - - Assert.That(one.Name, Is.EqualTo("one")); - Assert.That(one.Timespan.Value.Millisecond, Is.EqualTo(489)); - } - - - [Test] - public void RepositoryFetchTakesExistsPredicate() { - CreateThreeFoos(); - - var array = new[] { "one", "two" }; - - var result = _fooRepos.Fetch(f => array.Contains(f.Name)).ToList(); - - Assert.That(result.Count(), Is.EqualTo(2)); - } - } +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using NHibernate; +using NUnit.Framework; +using Orchard.Data; +using Orchard.Tests.ContentManagement; +using Orchard.Tests.Records; + +namespace Orchard.Tests.Data { + [TestFixture] + public class RepositoryTests { + #region Setup/Teardown + + [TestFixtureSetUp] + public void InitFixture() { + } + + [SetUp] + public void Init() { + _databaseFilePath = Path.GetTempFileName(); + _sessionFactory = DataUtility.CreateSessionFactory(_databaseFilePath, typeof(FooRecord)); + _session = _sessionFactory.OpenSession(); + _fooRepos = new Repository(new TestTransactionManager(_session)); + } + + [TearDown] + public void Term() { + _session.Close(); + } + + [TestFixtureTearDown] + public void TermFixture() { + File.Delete(_databaseFilePath); + } + + #endregion + + private IRepository _fooRepos; + private ISession _session; + private string _databaseFilePath; + private ISessionFactory _sessionFactory; + + private void CreateThreeFoos() { + _fooRepos.Create(new FooRecord { Name = "one" }); + _fooRepos.Create(new FooRecord { Name = "two" }); + _fooRepos.Create(new FooRecord { Name = "three" }); + } + + [Test] + public void GetByIdShouldReturnNullIfValueNotFound() { + CreateThreeFoos(); + var nofoo = _fooRepos.Get(6655321); + Assert.That(nofoo, Is.Null); + } + + [Test] + public void GetCanSelectSingleBasedOnFields() { + CreateThreeFoos(); + + var two = _fooRepos.Get(f => f.Name == "two"); + Assert.That(two.Name, Is.EqualTo("two")); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void GetThatReturnsTwoOrMoreShouldThrowException() { + CreateThreeFoos(); + _fooRepos.Get(f => f.Name == "one" || f.Name == "three"); + } + + [Test] + public void GetWithZeroMatchesShouldReturnNull() { + CreateThreeFoos(); + var nofoo = _fooRepos.Get(f => f.Name == "four"); + Assert.That(nofoo, Is.Null); + } + + [Test] + public void LinqCanBeUsedToSelectObjects() { + CreateThreeFoos(); + + var foos = from f in _fooRepos.Table + where f.Name == "one" || f.Name == "two" + select f; + + Assert.That(foos.Count(), Is.EqualTo(2)); + Assert.That(foos, Has.Some.Property("Name").EqualTo("one")); + Assert.That(foos, Has.Some.Property("Name").EqualTo("two")); + } + + [Test] + public void LinqExtensionMethodsCanAlsoBeUsedToSelectObjects() { + CreateThreeFoos(); + + var foos = _fooRepos.Table + .Where(f => f.Name == "one" || f.Name == "two"); + + Assert.That(foos.Count(), Is.EqualTo(2)); + Assert.That(foos, Has.Some.Property("Name").EqualTo("one")); + Assert.That(foos, Has.Some.Property("Name").EqualTo("two")); + } + + [Test] + public void OrderShouldControlResults() { + CreateThreeFoos(); + + var foos = _fooRepos.Fetch( + f => f.Name == "two" || f.Name == "three", + o => o.Asc(f => f.Name, f => f.Id)); + + Assert.That(foos.Count(), Is.EqualTo(2)); + Assert.That(foos.First().Name, Is.EqualTo("three")); + Assert.That(foos.Skip(1).First().Name, Is.EqualTo("two")); + } + + [Test] + public void LinqOrderByCanBeUsedToControlResults() { + CreateThreeFoos(); + + IEnumerable foos = + from f in _fooRepos.Table + where f.Name == "two" || f.Name == "three" + orderby f.Name, f.Id ascending + select f; + + Assert.That(foos.Count(), Is.EqualTo(2)); + Assert.That(foos.First().Name, Is.EqualTo("three")); + Assert.That(foos.Skip(1).First().Name, Is.EqualTo("two")); + } + + [Test] + public void RangeShouldSliceResults() { + for (var x = 0; x != 40; ++x) { + _fooRepos.Create(new FooRecord { Name = x.ToString().PadLeft(8, '0') }); + } + + var foos = _fooRepos.Fetch( + f => f.Name.StartsWith("000"), + o => o.Asc(f => f.Name), + 10, 20); + + Assert.That(foos.Count(), Is.EqualTo(20)); + Assert.That(foos.First().Name, Is.EqualTo("00000010")); + Assert.That(foos.Last().Name, Is.EqualTo("00000029")); + } + + [Test] + public void RepositoryCanCreateFetchAndDelete() { + var foo1 = new FooRecord { Name = "yadda" }; + _fooRepos.Create(foo1); + + var foo2 = _fooRepos.Get(foo1.Id); + foo2.Name = "blah"; + + Assert.That(foo1, Is.SameAs(foo2)); + + _fooRepos.Delete(foo2); + } + + [Test] + public void RepositoryFetchTakesCompoundLambdaPredicate() { + CreateThreeFoos(); + + var foos = _fooRepos.Fetch(f => f.Name == "three" || f.Name == "two"); + + Assert.That(foos.Count(), Is.EqualTo(2)); + Assert.That(foos, Has.Some.Property("Name").EqualTo("two")); + Assert.That(foos, Has.Some.Property("Name").EqualTo("three")); + } + + [Test] + public void RepositoryFetchTakesSimpleLambdaPredicate() { + CreateThreeFoos(); + + var one = _fooRepos.Fetch(f => f.Name == "one").Single(); + var two = _fooRepos.Fetch(f => f.Name == "two").Single(); + + Assert.That(one.Name, Is.EqualTo("one")); + Assert.That(two.Name, Is.EqualTo("two")); + } + + [Test] + public void StoringDateTimeDoesntRemovePrecision() { + _fooRepos.Create(new FooRecord { Name = "one", Timespan = DateTime.Parse("2001-01-01 16:28:21.489", CultureInfo.InvariantCulture) }); + + var one = _fooRepos.Fetch(f => f.Name == "one").Single(); + + Assert.That(one.Name, Is.EqualTo("one")); + Assert.That(one.Timespan.Value.Millisecond, Is.EqualTo(489)); + } + + + [Test] + public void RepositoryFetchTakesExistsPredicate() { + CreateThreeFoos(); + + var array = new[] { "one", "two" }; + + var result = _fooRepos.Fetch(f => array.Contains(f.Name)).ToList(); + + Assert.That(result.Count(), Is.EqualTo(2)); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Data/StubLocator.cs b/src/Orchard.Tests/Data/StubLocator.cs index 240dc8e986b..894c483fac0 100644 --- a/src/Orchard.Tests/Data/StubLocator.cs +++ b/src/Orchard.Tests/Data/StubLocator.cs @@ -1,21 +1,21 @@ -using System; -using NHibernate; -using Orchard.Data; - -namespace Orchard.Tests.Data { - public class StubLocator : ISessionLocator { - private readonly ISession _session; - - public StubLocator(ISession session) { - _session = session; - } - - #region ISessionLocator Members - - public ISession For(Type entityType) { - return _session; - } - - #endregion - } +using System; +using NHibernate; +using Orchard.Data; + +namespace Orchard.Tests.Data { + public class StubLocator : ISessionLocator { + private readonly ISession _session; + + public StubLocator(ISession session) { + _session = session; + } + + #region ISessionLocator Members + + public ISession For(Type entityType) { + return _session; + } + + #endregion + } } \ No newline at end of file diff --git a/src/Orchard.Tests/DataMigration/DataMigrationTests.cs b/src/Orchard.Tests/DataMigration/DataMigrationTests.cs index 85b53d4e925..3b3d7eff3e1 100644 --- a/src/Orchard.Tests/DataMigration/DataMigrationTests.cs +++ b/src/Orchard.Tests/DataMigration/DataMigrationTests.cs @@ -1,522 +1,522 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Linq; -using Autofac; -using Moq; -using NHibernate; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.Records; -using Orchard.Data; -using Orchard.Data.Migration; -using Orchard.Data.Migration.Interpreters; -using Orchard.Data.Migration.Records; -using Orchard.Environment.Configuration; -using Orchard.Environment.Extensions; -using Orchard.Environment.Extensions.Folders; -using Orchard.Environment.Extensions.Models; -using Orchard.Tests.ContentManagement; -using Orchard.Data.Providers; -using Orchard.Tests.DataMigration.Utilities; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.DataMigration { - [TestFixture] - public class DataMigrationTests { - private IContainer _container; - private StubFolders _folders; - private IDataMigrationManager _dataMigrationManager; - private IRepository _repository; - - private ISessionFactory _sessionFactory; - private ISession _session; - private ITransactionManager _transactionManager; - - [SetUp] - public void CreateDb() { - var databaseFileName = System.IO.Path.GetTempFileName(); - _sessionFactory = DataUtility.CreateSessionFactory( - databaseFileName, - typeof(DataMigrationRecord), - typeof(ContentItemVersionRecord), - typeof(ContentItemRecord), - typeof(ContentTypeRecord)); - } - - public void InitDb() { - foreach ( var record in _repository.Fetch(m => m != null) ) { - _repository.Delete(record); - } - - _transactionManager.RequireNew(); - } - - [TearDown] - public void CleanUp() { - if (_container != null) - _container.Dispose(); - } - - public void Init(IEnumerable dataMigrations) { - - var builder = new ContainerBuilder(); - _folders = new StubFolders(); - var contentDefinitionManager = new Mock().Object; - - builder.RegisterInstance(new ShellSettings { DataTablePrefix = "TEST_"}); - - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(_folders).As(); - builder.RegisterInstance(contentDefinitionManager).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - _session = _sessionFactory.OpenSession(); - builder.RegisterInstance(new TestTransactionManager(_session)).As(); - foreach(var type in dataMigrations) { - builder.RegisterType(type).As(); - } - _container = builder.Build(); - _container.Resolve(); - _dataMigrationManager = _container.Resolve(); - _repository = _container.Resolve>(); - _transactionManager = _container.Resolve(); - InitDb(); - } - - public class StubFolders : IExtensionFolders { - public StubFolders() { - Manifests = new Dictionary(); - } - - public IDictionary Manifests { get; set; } - - public IEnumerable AvailableExtensions() { - foreach (var e in Manifests) { - string name = e.Key; - yield return ExtensionHarvester.GetDescriptorForExtension("~/", name, DefaultExtensionTypes.Module, Manifests[name]); - } - } - } - - public class DataMigrationEmpty : IDataMigration { - public Feature Feature { - get { return new Feature() {Descriptor = new FeatureDescriptor() {Id = "Feature1"}}; } - } - } - - public class DataMigration11 : IDataMigration { - public Feature Feature { - get { return new Feature() {Descriptor = new FeatureDescriptor() {Id = "Feature1"}}; } - } - } - - public class DataMigration11Create : IDataMigration { - public Feature Feature { - get { return new Feature() {Descriptor = new FeatureDescriptor() {Id = "Feature1"}}; } - } - - public int Create() { - return 999; - } - } - - public class DataMigrationCreateCanBeFollowedByUpdates : IDataMigration { - public Feature Feature { - get { return new Feature() { Descriptor = new FeatureDescriptor() { Id = "Feature1" } }; } - } - - public int Create() { - return 42; - } - - public int UpdateFrom42() { - return 666; - } - } - - public class DataMigrationSameMigrationClassCanEvolve : IDataMigration { - public Feature Feature { - get { return new Feature() { Descriptor = new FeatureDescriptor() { Id = "Feature1" } }; } - } - - public int Create() { - return 999; - } - - public int UpdateFrom42() { - return 666; - } - - public int UpdateFrom666() { - return 999; - } - } - - public class DataMigrationDependenciesModule1 : IDataMigration { - public Feature Feature { - get { return new Feature() {Descriptor = new FeatureDescriptor() {Id = "Feature1"}}; } - } - - public int Create() { - return 999; - } - } - - public class DataMigrationDependenciesModule2 : IDataMigration { - public Feature Feature { - get { return new Feature() { Descriptor = new FeatureDescriptor() { Id = "Feature2" } }; } - } - - public int Create() { - return 999; - } - } - - public class DataMigrationWithSchemaBuilder : DataMigrationImpl { - public override Feature Feature { - get { return new Feature { Descriptor = new FeatureDescriptor { Id = "Feature1", Extension = new ExtensionDescriptor { Id = "Module1" } } }; } - } - - public int Create() { - Assert.That(SchemaBuilder, Is.Not.Null); - return 1; - } - } - - public class DataMigrationFeatureNeedUpdate1 : IDataMigration { - public Feature Feature { - get { return new Feature() { Descriptor = new FeatureDescriptor { Id = "Feature1", Extension = new ExtensionDescriptor { Id = "Module1" } } }; } - } - } - - public class DataMigrationFeatureNeedUpdate2 : IDataMigration { - public Feature Feature { - get { return new Feature() { Descriptor = new FeatureDescriptor { Id = "Feature2", Extension = new ExtensionDescriptor { Id = "Module2" } } }; } - } - - public int Create() { - return 999; - } - } - - public class DataMigrationFeatureNeedUpdate3 : IDataMigration { - public Feature Feature { - get { return new Feature() { Descriptor = new FeatureDescriptor { Id = "Feature3", Extension = new ExtensionDescriptor { Id = "Module3" } } }; } - } - - public int Create() { - return 999; - } - - public int UpdateFrom42() { - return 999; - } - } - - - public class DataMigrationTransactional : DataMigrationImpl { - public override Feature Feature { - get { return new Feature() { Descriptor = new FeatureDescriptor { Id = "Feature1", Extension = new ExtensionDescriptor { Id = "Module1" } } }; } - } - - public int Create() { - SchemaBuilder.CreateTable("FOO", table => - table.Column("Id", DbType.Int32, column => - column.PrimaryKey().Identity())); - - return 1; - } - - public int UpdateFrom1() { - throw new Exception(); - } - - public int UpdateFrom2() { - return 3; - } - } - - public class FailingDataMigration : DataMigrationImpl { - public override Feature Feature { - get { return new Feature() { Descriptor = new FeatureDescriptor { Id = "Feature4", Extension = new ExtensionDescriptor { Id = "Module4" } } }; } - } - - public int Create() { - SchemaBuilder.CreateTable("FOO", table => - table.Column("Id", DbType.Int32, column => - column.PrimaryKey().Identity())); - - return 1; - } - - public int UpdateFrom1() { - throw new Exception(); - } - } - - public class DataMigrationSimpleBuilder : DataMigrationImpl { - public override Feature Feature { - get { return new Feature() { Descriptor = new FeatureDescriptor { Id = "Feature1", Extension = new ExtensionDescriptor { Id = "Module1" } } }; } - } - - public int Create() { - SchemaBuilder.CreateTable("UserPartRecord", table => - table.Column("Id", DbType.Int32, column => - column.PrimaryKey().Identity())); - - return 1; - } - } - - [Test] - public void DataMigrationShouldDoNothingIfNoDataMigrationIsProvidedForFeature() { - Init(new[] {typeof (DataMigrationEmpty)}); - - _folders.Manifests.Add("Module2", @" -Name: Module2 -Version: 0.1 -OrchardVersion: 1 -Features: - Feature1: - Description: Feature -"); - - _dataMigrationManager.Update("Feature1"); - Assert.That(_repository.Table.Count(), Is.EqualTo(0)); - } - - [Test] - public void DataMigrationShouldDoNothingIfNoUpgradeOrCreateMethodWasFound() { - Init(new[] { typeof(DataMigration11) }); - - _folders.Manifests.Add("Module1", @" -Name: Module1 -Version: 0.1 -OrchardVersion: 1 -Features: - Feature1: - Description: Feature -"); - - _dataMigrationManager.Update("Feature1"); - Assert.That(_repository.Table.Count(), Is.EqualTo(0)); - } - - [Test] - public void CreateShouldReturnVersionNumber() { - Init(new[] { typeof(DataMigration11Create) }); - - _folders.Manifests.Add("Module1", @" -Name: Module1 -Version: 0.1 -OrchardVersion: 1 -Features: - Feature1: - Description: Feature -"); - - _dataMigrationManager.Update("Feature1"); - Assert.That(_repository.Table.Count(), Is.EqualTo(1)); - Assert.That(_repository.Table.First().Version, Is.EqualTo(999)); - Assert.That(_repository.Table.First().DataMigrationClass, Is.EqualTo("Orchard.Tests.DataMigration.DataMigrationTests+DataMigration11Create")); - } - - [Test] - public void CreateCanBeFollowedByUpdates() { - Init(new[] {typeof (DataMigrationCreateCanBeFollowedByUpdates)}); - - _folders.Manifests.Add("Module1", @" -Name: Module1 -Version: 0.1 -OrchardVersion: 1 -Features: - Feature1: - Description: Feature -"); - - _dataMigrationManager.Update("Feature1"); - Assert.That(_repository.Table.Count(), Is.EqualTo(1)); - Assert.That(_repository.Table.First().Version, Is.EqualTo(666)); - } - - [Test] - public void SameMigrationClassCanEvolve() { - Init(new[] { typeof(DataMigrationSameMigrationClassCanEvolve) }); - - _folders.Manifests.Add("Module1", @" -Name: Module1 -Version: 0.1 -OrchardVersion: 1 -Features: - Feature1: - Description: Feature -"); - _repository.Create(new DataMigrationRecord { - Version = 42, - DataMigrationClass = "Orchard.Tests.DataMigration.DataMigrationTests+DataMigrationSameMigrationClassCanEvolve" - }); - - _dataMigrationManager.Update("Feature1"); - Assert.That(_repository.Table.Count(), Is.EqualTo(1)); - Assert.That(_repository.Table.First().Version, Is.EqualTo(999)); - } - - [Test] - public void DependenciesShouldBeUpgradedFirst() { - - Init(new[] { typeof(DataMigrationDependenciesModule1), typeof(DataMigrationDependenciesModule2) }); - - _folders.Manifests.Add("Module1", @" -Name: Module1 -Version: 0.1 -OrchardVersion: 1 -Features: - Feature1: - Description: Feature - Dependencies: Feature2 -"); - - _folders.Manifests.Add("Module2", @" -Name: Module2 -Version: 0.1 -OrchardVersion: 1 -Features: - Feature2: - Description: Feature -"); - _dataMigrationManager.Update("Feature1"); - Assert.That(_repository.Table.Count(), Is.EqualTo(2)); - Assert.That(_repository.Fetch(d => d.Version == 999).Count(), Is.EqualTo(2)); - Assert.That(_repository.Fetch(d => d.DataMigrationClass == "Orchard.Tests.DataMigration.DataMigrationTests+DataMigrationDependenciesModule1").Count(), Is.EqualTo(1)); - Assert.That(_repository.Fetch(d => d.DataMigrationClass == "Orchard.Tests.DataMigration.DataMigrationTests+DataMigrationDependenciesModule2").Count(), Is.EqualTo(1)); - } - - [Test] - public void DataMigrationImplShouldGetASchemaBuilder() { - Init(new[] { typeof(DataMigrationWithSchemaBuilder) }); - - _folders.Manifests.Add("Module1", @" -Name: Module1 -Version: 0.1 -OrchardVersion: 1 -Features: - Feature1: - Description: Feature -"); - - _dataMigrationManager.Update("Feature1"); - Assert.That(_repository.Table.Count(), Is.EqualTo(1)); - } - - [Test] - public void ShouldDetectFeaturesThatNeedUpdates() { - - Init(new[] { typeof(DataMigrationFeatureNeedUpdate1), typeof(DataMigrationFeatureNeedUpdate2), typeof(DataMigrationFeatureNeedUpdate3) }); - - _folders.Manifests.Add("Module1", @" -Name: Module1 -Version: 0.1 -OrchardVersion: 1 -Features: - Feature1: - Description: Feature - Feature2: - Description: Feature - Feature3: - Description: Feature - Feature4: - Description: Feature -"); - - // even if there is a data migration class, as it is empty there should me no migration to do - Assert.That(_dataMigrationManager.GetFeaturesThatNeedUpdate().Contains("Feature1"), Is.False); - - // there is no available class for this feature - Assert.That(_dataMigrationManager.GetFeaturesThatNeedUpdate().Contains("Feature4"), Is.False); - - // there is a create method and no record in db, so let's create it - Assert.That(_dataMigrationManager.GetFeaturesThatNeedUpdate().Contains("Feature2"), Is.True); - - // there is an UpdateFrom42 method, so it should be fired if Current == 42 - - _repository.Create(new DataMigrationRecord { - Version = 42, - DataMigrationClass = "Orchard.Tests.DataMigration.DataMigrationTests+DataMigrationFeatureNeedUpdate3" - }); - - Assert.That(_dataMigrationManager.GetFeaturesThatNeedUpdate().Contains("Feature3"), Is.True); - - _repository.Delete(_repository.Fetch(m => m.Version == 42).First()); - _repository.Flush(); - - _repository.Create(new DataMigrationRecord { - Version = 43, - DataMigrationClass = "Orchard.Tests.DataMigration.DataMigrationTests+DataMigrationFeatureNeedUpdate3" - }); - - Assert.That(_dataMigrationManager.GetFeaturesThatNeedUpdate().Contains("Feature3"), Is.False); - } - - - [Test] public void SchemaBuilderShouldCreateSql() { - - Init(new[] { typeof(DataMigrationSimpleBuilder) }); - - _folders.Manifests.Add("Module1", @" -Name: Module1 -Version: 0.1 -OrchardVersion: 1 -Features: - Feature1: - Description: Feature -"); - - _dataMigrationManager.Update("Feature1"); - } - - [Test] - public void DataMigrationShouldBeTransactional() { - Init(new[] { typeof(DataMigrationTransactional) }); - - _folders.Manifests.Add("Module1", @" -Name: Module1 -Version: 0.1 -OrchardVersion: 1 -Features: - Feature1: - Description: Feature -"); - - try {_dataMigrationManager.Update("Feature1"); } - catch (OrchardException) {} - - Assert.That(_repository.Table.Count(), Is.EqualTo(0)); - - _dataMigrationManager.Update("Feature1"); - } - - [Test] - public void FailingDataMigrationShouldThrowOrchardException() { - Init(new[] { typeof(FailingDataMigration) }); - - _folders.Manifests.Add("Module4", @" -Name: Module4 -Version: 0.1 -OrchardVersion: 1 -Features: - Feature4: - Description: Feature -"); - - Assert.Throws(() => _dataMigrationManager.Update("Feature4")); - } - } +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using Autofac; +using Moq; +using NHibernate; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.Records; +using Orchard.Data; +using Orchard.Data.Migration; +using Orchard.Data.Migration.Interpreters; +using Orchard.Data.Migration.Records; +using Orchard.Environment.Configuration; +using Orchard.Environment.Extensions; +using Orchard.Environment.Extensions.Folders; +using Orchard.Environment.Extensions.Models; +using Orchard.Tests.ContentManagement; +using Orchard.Data.Providers; +using Orchard.Tests.DataMigration.Utilities; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.DataMigration { + [TestFixture] + public class DataMigrationTests { + private IContainer _container; + private StubFolders _folders; + private IDataMigrationManager _dataMigrationManager; + private IRepository _repository; + + private ISessionFactory _sessionFactory; + private ISession _session; + private ITransactionManager _transactionManager; + + [SetUp] + public void CreateDb() { + var databaseFileName = System.IO.Path.GetTempFileName(); + _sessionFactory = DataUtility.CreateSessionFactory( + databaseFileName, + typeof(DataMigrationRecord), + typeof(ContentItemVersionRecord), + typeof(ContentItemRecord), + typeof(ContentTypeRecord)); + } + + public void InitDb() { + foreach ( var record in _repository.Fetch(m => m != null) ) { + _repository.Delete(record); + } + + _transactionManager.RequireNew(); + } + + [TearDown] + public void CleanUp() { + if (_container != null) + _container.Dispose(); + } + + public void Init(IEnumerable dataMigrations) { + + var builder = new ContainerBuilder(); + _folders = new StubFolders(); + var contentDefinitionManager = new Mock().Object; + + builder.RegisterInstance(new ShellSettings { DataTablePrefix = "TEST_"}); + + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(_folders).As(); + builder.RegisterInstance(contentDefinitionManager).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + _session = _sessionFactory.OpenSession(); + builder.RegisterInstance(new TestTransactionManager(_session)).As(); + foreach(var type in dataMigrations) { + builder.RegisterType(type).As(); + } + _container = builder.Build(); + _container.Resolve(); + _dataMigrationManager = _container.Resolve(); + _repository = _container.Resolve>(); + _transactionManager = _container.Resolve(); + InitDb(); + } + + public class StubFolders : IExtensionFolders { + public StubFolders() { + Manifests = new Dictionary(); + } + + public IDictionary Manifests { get; set; } + + public IEnumerable AvailableExtensions() { + foreach (var e in Manifests) { + string name = e.Key; + yield return ExtensionHarvester.GetDescriptorForExtension("~/", name, DefaultExtensionTypes.Module, Manifests[name]); + } + } + } + + public class DataMigrationEmpty : IDataMigration { + public Feature Feature { + get { return new Feature() {Descriptor = new FeatureDescriptor() {Id = "Feature1"}}; } + } + } + + public class DataMigration11 : IDataMigration { + public Feature Feature { + get { return new Feature() {Descriptor = new FeatureDescriptor() {Id = "Feature1"}}; } + } + } + + public class DataMigration11Create : IDataMigration { + public Feature Feature { + get { return new Feature() {Descriptor = new FeatureDescriptor() {Id = "Feature1"}}; } + } + + public int Create() { + return 999; + } + } + + public class DataMigrationCreateCanBeFollowedByUpdates : IDataMigration { + public Feature Feature { + get { return new Feature() { Descriptor = new FeatureDescriptor() { Id = "Feature1" } }; } + } + + public int Create() { + return 42; + } + + public int UpdateFrom42() { + return 666; + } + } + + public class DataMigrationSameMigrationClassCanEvolve : IDataMigration { + public Feature Feature { + get { return new Feature() { Descriptor = new FeatureDescriptor() { Id = "Feature1" } }; } + } + + public int Create() { + return 999; + } + + public int UpdateFrom42() { + return 666; + } + + public int UpdateFrom666() { + return 999; + } + } + + public class DataMigrationDependenciesModule1 : IDataMigration { + public Feature Feature { + get { return new Feature() {Descriptor = new FeatureDescriptor() {Id = "Feature1"}}; } + } + + public int Create() { + return 999; + } + } + + public class DataMigrationDependenciesModule2 : IDataMigration { + public Feature Feature { + get { return new Feature() { Descriptor = new FeatureDescriptor() { Id = "Feature2" } }; } + } + + public int Create() { + return 999; + } + } + + public class DataMigrationWithSchemaBuilder : DataMigrationImpl { + public override Feature Feature { + get { return new Feature { Descriptor = new FeatureDescriptor { Id = "Feature1", Extension = new ExtensionDescriptor { Id = "Module1" } } }; } + } + + public int Create() { + Assert.That(SchemaBuilder, Is.Not.Null); + return 1; + } + } + + public class DataMigrationFeatureNeedUpdate1 : IDataMigration { + public Feature Feature { + get { return new Feature() { Descriptor = new FeatureDescriptor { Id = "Feature1", Extension = new ExtensionDescriptor { Id = "Module1" } } }; } + } + } + + public class DataMigrationFeatureNeedUpdate2 : IDataMigration { + public Feature Feature { + get { return new Feature() { Descriptor = new FeatureDescriptor { Id = "Feature2", Extension = new ExtensionDescriptor { Id = "Module2" } } }; } + } + + public int Create() { + return 999; + } + } + + public class DataMigrationFeatureNeedUpdate3 : IDataMigration { + public Feature Feature { + get { return new Feature() { Descriptor = new FeatureDescriptor { Id = "Feature3", Extension = new ExtensionDescriptor { Id = "Module3" } } }; } + } + + public int Create() { + return 999; + } + + public int UpdateFrom42() { + return 999; + } + } + + + public class DataMigrationTransactional : DataMigrationImpl { + public override Feature Feature { + get { return new Feature() { Descriptor = new FeatureDescriptor { Id = "Feature1", Extension = new ExtensionDescriptor { Id = "Module1" } } }; } + } + + public int Create() { + SchemaBuilder.CreateTable("FOO", table => + table.Column("Id", DbType.Int32, column => + column.PrimaryKey().Identity())); + + return 1; + } + + public int UpdateFrom1() { + throw new Exception(); + } + + public int UpdateFrom2() { + return 3; + } + } + + public class FailingDataMigration : DataMigrationImpl { + public override Feature Feature { + get { return new Feature() { Descriptor = new FeatureDescriptor { Id = "Feature4", Extension = new ExtensionDescriptor { Id = "Module4" } } }; } + } + + public int Create() { + SchemaBuilder.CreateTable("FOO", table => + table.Column("Id", DbType.Int32, column => + column.PrimaryKey().Identity())); + + return 1; + } + + public int UpdateFrom1() { + throw new Exception(); + } + } + + public class DataMigrationSimpleBuilder : DataMigrationImpl { + public override Feature Feature { + get { return new Feature() { Descriptor = new FeatureDescriptor { Id = "Feature1", Extension = new ExtensionDescriptor { Id = "Module1" } } }; } + } + + public int Create() { + SchemaBuilder.CreateTable("UserPartRecord", table => + table.Column("Id", DbType.Int32, column => + column.PrimaryKey().Identity())); + + return 1; + } + } + + [Test] + public void DataMigrationShouldDoNothingIfNoDataMigrationIsProvidedForFeature() { + Init(new[] {typeof (DataMigrationEmpty)}); + + _folders.Manifests.Add("Module2", @" +Name: Module2 +Version: 0.1 +OrchardVersion: 1 +Features: + Feature1: + Description: Feature +"); + + _dataMigrationManager.Update("Feature1"); + Assert.That(_repository.Table.Count(), Is.EqualTo(0)); + } + + [Test] + public void DataMigrationShouldDoNothingIfNoUpgradeOrCreateMethodWasFound() { + Init(new[] { typeof(DataMigration11) }); + + _folders.Manifests.Add("Module1", @" +Name: Module1 +Version: 0.1 +OrchardVersion: 1 +Features: + Feature1: + Description: Feature +"); + + _dataMigrationManager.Update("Feature1"); + Assert.That(_repository.Table.Count(), Is.EqualTo(0)); + } + + [Test] + public void CreateShouldReturnVersionNumber() { + Init(new[] { typeof(DataMigration11Create) }); + + _folders.Manifests.Add("Module1", @" +Name: Module1 +Version: 0.1 +OrchardVersion: 1 +Features: + Feature1: + Description: Feature +"); + + _dataMigrationManager.Update("Feature1"); + Assert.That(_repository.Table.Count(), Is.EqualTo(1)); + Assert.That(_repository.Table.First().Version, Is.EqualTo(999)); + Assert.That(_repository.Table.First().DataMigrationClass, Is.EqualTo("Orchard.Tests.DataMigration.DataMigrationTests+DataMigration11Create")); + } + + [Test] + public void CreateCanBeFollowedByUpdates() { + Init(new[] {typeof (DataMigrationCreateCanBeFollowedByUpdates)}); + + _folders.Manifests.Add("Module1", @" +Name: Module1 +Version: 0.1 +OrchardVersion: 1 +Features: + Feature1: + Description: Feature +"); + + _dataMigrationManager.Update("Feature1"); + Assert.That(_repository.Table.Count(), Is.EqualTo(1)); + Assert.That(_repository.Table.First().Version, Is.EqualTo(666)); + } + + [Test] + public void SameMigrationClassCanEvolve() { + Init(new[] { typeof(DataMigrationSameMigrationClassCanEvolve) }); + + _folders.Manifests.Add("Module1", @" +Name: Module1 +Version: 0.1 +OrchardVersion: 1 +Features: + Feature1: + Description: Feature +"); + _repository.Create(new DataMigrationRecord { + Version = 42, + DataMigrationClass = "Orchard.Tests.DataMigration.DataMigrationTests+DataMigrationSameMigrationClassCanEvolve" + }); + + _dataMigrationManager.Update("Feature1"); + Assert.That(_repository.Table.Count(), Is.EqualTo(1)); + Assert.That(_repository.Table.First().Version, Is.EqualTo(999)); + } + + [Test] + public void DependenciesShouldBeUpgradedFirst() { + + Init(new[] { typeof(DataMigrationDependenciesModule1), typeof(DataMigrationDependenciesModule2) }); + + _folders.Manifests.Add("Module1", @" +Name: Module1 +Version: 0.1 +OrchardVersion: 1 +Features: + Feature1: + Description: Feature + Dependencies: Feature2 +"); + + _folders.Manifests.Add("Module2", @" +Name: Module2 +Version: 0.1 +OrchardVersion: 1 +Features: + Feature2: + Description: Feature +"); + _dataMigrationManager.Update("Feature1"); + Assert.That(_repository.Table.Count(), Is.EqualTo(2)); + Assert.That(_repository.Fetch(d => d.Version == 999).Count(), Is.EqualTo(2)); + Assert.That(_repository.Fetch(d => d.DataMigrationClass == "Orchard.Tests.DataMigration.DataMigrationTests+DataMigrationDependenciesModule1").Count(), Is.EqualTo(1)); + Assert.That(_repository.Fetch(d => d.DataMigrationClass == "Orchard.Tests.DataMigration.DataMigrationTests+DataMigrationDependenciesModule2").Count(), Is.EqualTo(1)); + } + + [Test] + public void DataMigrationImplShouldGetASchemaBuilder() { + Init(new[] { typeof(DataMigrationWithSchemaBuilder) }); + + _folders.Manifests.Add("Module1", @" +Name: Module1 +Version: 0.1 +OrchardVersion: 1 +Features: + Feature1: + Description: Feature +"); + + _dataMigrationManager.Update("Feature1"); + Assert.That(_repository.Table.Count(), Is.EqualTo(1)); + } + + [Test] + public void ShouldDetectFeaturesThatNeedUpdates() { + + Init(new[] { typeof(DataMigrationFeatureNeedUpdate1), typeof(DataMigrationFeatureNeedUpdate2), typeof(DataMigrationFeatureNeedUpdate3) }); + + _folders.Manifests.Add("Module1", @" +Name: Module1 +Version: 0.1 +OrchardVersion: 1 +Features: + Feature1: + Description: Feature + Feature2: + Description: Feature + Feature3: + Description: Feature + Feature4: + Description: Feature +"); + + // even if there is a data migration class, as it is empty there should me no migration to do + Assert.That(_dataMigrationManager.GetFeaturesThatNeedUpdate().Contains("Feature1"), Is.False); + + // there is no available class for this feature + Assert.That(_dataMigrationManager.GetFeaturesThatNeedUpdate().Contains("Feature4"), Is.False); + + // there is a create method and no record in db, so let's create it + Assert.That(_dataMigrationManager.GetFeaturesThatNeedUpdate().Contains("Feature2"), Is.True); + + // there is an UpdateFrom42 method, so it should be fired if Current == 42 + + _repository.Create(new DataMigrationRecord { + Version = 42, + DataMigrationClass = "Orchard.Tests.DataMigration.DataMigrationTests+DataMigrationFeatureNeedUpdate3" + }); + + Assert.That(_dataMigrationManager.GetFeaturesThatNeedUpdate().Contains("Feature3"), Is.True); + + _repository.Delete(_repository.Fetch(m => m.Version == 42).First()); + _repository.Flush(); + + _repository.Create(new DataMigrationRecord { + Version = 43, + DataMigrationClass = "Orchard.Tests.DataMigration.DataMigrationTests+DataMigrationFeatureNeedUpdate3" + }); + + Assert.That(_dataMigrationManager.GetFeaturesThatNeedUpdate().Contains("Feature3"), Is.False); + } + + + [Test] public void SchemaBuilderShouldCreateSql() { + + Init(new[] { typeof(DataMigrationSimpleBuilder) }); + + _folders.Manifests.Add("Module1", @" +Name: Module1 +Version: 0.1 +OrchardVersion: 1 +Features: + Feature1: + Description: Feature +"); + + _dataMigrationManager.Update("Feature1"); + } + + [Test] + public void DataMigrationShouldBeTransactional() { + Init(new[] { typeof(DataMigrationTransactional) }); + + _folders.Manifests.Add("Module1", @" +Name: Module1 +Version: 0.1 +OrchardVersion: 1 +Features: + Feature1: + Description: Feature +"); + + try {_dataMigrationManager.Update("Feature1"); } + catch (OrchardException) {} + + Assert.That(_repository.Table.Count(), Is.EqualTo(0)); + + _dataMigrationManager.Update("Feature1"); + } + + [Test] + public void FailingDataMigrationShouldThrowOrchardException() { + Init(new[] { typeof(FailingDataMigration) }); + + _folders.Manifests.Add("Module4", @" +Name: Module4 +Version: 0.1 +OrchardVersion: 1 +Features: + Feature4: + Description: Feature +"); + + Assert.Throws(() => _dataMigrationManager.Update("Feature4")); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/DataMigration/SchemaBuilderTests.cs b/src/Orchard.Tests/DataMigration/SchemaBuilderTests.cs index 8e3a72638a9..107e90780b1 100644 --- a/src/Orchard.Tests/DataMigration/SchemaBuilderTests.cs +++ b/src/Orchard.Tests/DataMigration/SchemaBuilderTests.cs @@ -1,243 +1,243 @@ -using System; -using System.Data; -using System.Linq; -using Autofac; -using NHibernate; -using NUnit.Framework; -using Orchard.Data; -using Orchard.Data.Migration.Interpreters; -using Orchard.Data.Migration.Schema; -using Orchard.Data.Providers; -using Orchard.Environment; -using Orchard.Environment.Configuration; -using Orchard.Environment.ShellBuilders.Models; -using Orchard.FileSystems.AppData; -using Orchard.Reports.Services; -using Orchard.Tests.ContentManagement; -using System.IO; -using Orchard.Tests.Environment; -using Orchard.Tests.FileSystems.AppData; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.DataMigration { - [TestFixture] - public class SchemaBuilderTestsBase { - private IContainer _container; - private ISessionFactory _sessionFactory; - private string _databaseFileName; - private string _tempFolder; - private SchemaBuilder _schemaBuilder; - private DefaultDataMigrationInterpreter _interpreter; - private ISession _session; - - [SetUp] - public void Setup() { - _databaseFileName = Path.GetTempFileName(); - _sessionFactory = DataUtility.CreateSessionFactory(_databaseFileName); - - _tempFolder = Path.GetTempFileName(); - File.Delete(_tempFolder); - var appDataFolder = AppDataFolderTests.CreateAppDataFolder(_tempFolder); - - var builder = new ContainerBuilder(); - - _session = _sessionFactory.OpenSession(); - builder.RegisterInstance(appDataFolder).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new TestTransactionManager(_session)).As(); - builder.RegisterInstance(new ShellBlueprint { Records = Enumerable.Empty() }).As(); - builder.RegisterInstance(new ShellSettings { Name = "temp", DataProvider = "SqlCe", DataTablePrefix = "TEST" }).As(); - builder.RegisterModule(new DataModule()); - _container = builder.Build(); - - _interpreter = _container.Resolve() as DefaultDataMigrationInterpreter; - _schemaBuilder = new SchemaBuilder(_interpreter); - } - - [Test] - public void AllMethodsShouldBeCalledSuccessfully() { - - _schemaBuilder - .CreateTable("User", table => table - .ContentPartRecord() - .Column("Firstname", DbType.String, column => column.WithLength(255)) - .Column("Lastname", DbType.String, column => column.WithPrecision(0).WithScale(1))) - .CreateTable("Address", table => table - .ContentPartVersionRecord() - .Column("City", DbType.String) - .Column("ZIP", DbType.Int32, column => column.Unique()) - .Column("UserId", DbType.Int32, column => column.NotNull())) - .CreateForeignKey("User_Address", "Address", new[] { "UserId" }, "User", new[] { "Id" }) - .AlterTable("User", table => table - .AddColumn("Age", DbType.Int32)) - .AlterTable("User", table => table - .DropColumn("Lastname")) - .AlterTable("User", table => table - .CreateIndex("IDX_XYZ", "Firstname")) - .AlterTable("User", table => table - .DropIndex("IDX_XYZ")) - .DropForeignKey("Address", "User_Address") - .DropTable("Address"); - } - - [Test] - public void CreateCommandShouldBeHandled() { - - _schemaBuilder - .CreateTable("User", table => table - .Column("Id", DbType.Int32, column => column.PrimaryKey().Identity()) - .Column("Firstname", DbType.String, column => column.WithLength(255)) - .Column("Lastname", DbType.String, column => column.WithLength(100).NotNull()) - .Column("SN", DbType.AnsiString, column => column.WithLength(40).Unique()) - .Column("Salary", DbType.Decimal, column => column.WithPrecision(9).WithScale(2)) - .Column("Gender", DbType.Decimal, column => column.WithDefault("")) - ); - } - - [Test] - public void DropTableCommandShouldBeHandled() { - _schemaBuilder - .CreateTable("User", table => table - .Column("Id", DbType.Int32, column => column.PrimaryKey().Identity()) - .Column("Firstname", DbType.String, column => column.WithLength(255)) - .Column("Lastname", DbType.String, column => column.WithLength(100).NotNull()) - .Column("SN", DbType.AnsiString, column => column.WithLength(40).Unique()) - .Column("Salary", DbType.Decimal, column => column.WithPrecision(9).WithScale(2)) - .Column("Gender", DbType.Decimal, column => column.WithDefault("")) - ); - - _schemaBuilder - .DropTable("User"); - } - - [Test] - public void CustomSqlStatementsShouldBeHandled() { - - _schemaBuilder - .ExecuteSql("select 1"); - } - - [Test] - public void AlterTableCommandShouldBeHandled() { - - _schemaBuilder - .CreateTable("User", table => table - .Column("Firstname", DbType.String, column => column.WithLength(255)) - .Column("Lastname", DbType.String, column => column.WithLength(100).NotNull())) - .AlterTable("User", table => table - .AddColumn("Age", DbType.Int32)) - .AlterTable("User", table => table - .AlterColumn("Lastname", column => column.WithDefault("Doe"))) - .AlterTable("User", table => table - .DropColumn("Firstname") - ); - - // creating a new row should assign a default value to Firstname and Age - _schemaBuilder.ExecuteSql("insert into TEST_User VALUES (DEFAULT, DEFAULT)"); - - // ensure we have one record with the default value - var query = _session.CreateSQLQuery("SELECT count(*) FROM TEST_User WHERE Lastname = 'Doe'"); - Assert.That(query.UniqueResult(), Is.EqualTo(1)); - - // ensure this is not a false positive - query = _session.CreateSQLQuery("SELECT count(*) FROM TEST_User WHERE Lastname = 'Foo'"); - Assert.That(query.UniqueResult(), Is.EqualTo(0)); - } - - [Test] - public void ForeignKeyShouldBeCreatedAndRemoved() { - - _schemaBuilder - .CreateTable("User", table => table - .Column("Id", DbType.Int32, column => column.PrimaryKey().Identity()) - .Column("Firstname", DbType.String, column => column.WithLength(255)) - .Column("Lastname", DbType.String, column => column.WithPrecision(0).WithScale(1))) - .CreateTable("Address", table => table - .Column("City", DbType.String) - .Column("ZIP", DbType.Int32, column => column.Unique()) - .Column("UserId", DbType.Int32, column => column.NotNull())) - .CreateForeignKey("FK_User", "Address", new[] { "UserId" }, "User", new[] { "Id" }) - .DropForeignKey("Address", "FK_User"); - } - - [Test, ExpectedException] - public void BiggerDataShouldNotFit() { - _schemaBuilder - .CreateTable("ContentItemRecord", table => table - .Column("Id", DbType.Int32, column => column.PrimaryKey().Identity()) - .Column("Data", DbType.String, column => column.WithLength(255))); - - // should write successfully less than 255 chars - _schemaBuilder - .ExecuteSql("insert into TEST_ContentItemRecord (Data) values('Hello World')"); - - // should throw an exception if trying to write more data - _schemaBuilder - .ExecuteSql(String.Format("insert into TEST_ContentItemRecord (Data) values('{0}')", new String('x', 256))); - - _schemaBuilder - .AlterTable("ContentItemRecord", table => table - .AlterColumn("Data", column => column.WithType(DbType.String).WithLength(257))); - - _schemaBuilder - .ExecuteSql(String.Format("insert into TEST_ContentItemRecord (Data) values('{0}')", new String('x', 256))); - } - - [Test] - public void ShouldAllowFieldSizeAlteration() { - _schemaBuilder - .CreateTable("ContentItemRecord", table => table - .Column("Id", DbType.Int32, column => column.PrimaryKey().Identity()) - .Column("Data", DbType.String, column => column.WithLength(255))); - - // should write successfully less than 255 chars - _schemaBuilder - .ExecuteSql("insert into TEST_ContentItemRecord (Data) values('Hello World')"); - - _schemaBuilder - .AlterTable("ContentItemRecord", table => table - .AlterColumn("Data", column => column.WithType(DbType.String).WithLength(2048))); - - // should write successfully a bigger value now - _schemaBuilder - .ExecuteSql(String.Format("insert into TEST_ContentItemRecord (Data) values('{0}')", new String('x', 2048))); - } - - [Test, ExpectedException(typeof(OrchardException))] - public void ChangingSizeWithoutTypeShouldNotBeAllowed() { - _schemaBuilder - .CreateTable("ContentItemRecord", table => table - .Column("Id", DbType.Int32, column => column.PrimaryKey().Identity()) - .Column("Data", DbType.String, column => column.WithLength(255))); - - _schemaBuilder - .AlterTable("ContentItemRecord", table => table - .AlterColumn("Data", column => column.WithLength(2048))); - - } - - [Test] - public void PrecisionAndScaleAreApplied() { - - _schemaBuilder - .CreateTable("Product", table => table - .Column("Price", DbType.Decimal, column => column.WithPrecision(19).WithScale(9)) - ); - - _schemaBuilder - .ExecuteSql(String.Format("INSERT INTO TEST_Product (Price) VALUES ({0})", "123456.123456789")); - - var query = _session.CreateSQLQuery("SELECT MAX(Price) FROM TEST_Product"); - Assert.That(query.UniqueResult(), Is.EqualTo(123456.123456789m)); - - } - } -} +using System; +using System.Data; +using System.Linq; +using Autofac; +using NHibernate; +using NUnit.Framework; +using Orchard.Data; +using Orchard.Data.Migration.Interpreters; +using Orchard.Data.Migration.Schema; +using Orchard.Data.Providers; +using Orchard.Environment; +using Orchard.Environment.Configuration; +using Orchard.Environment.ShellBuilders.Models; +using Orchard.FileSystems.AppData; +using Orchard.Reports.Services; +using Orchard.Tests.ContentManagement; +using System.IO; +using Orchard.Tests.Environment; +using Orchard.Tests.FileSystems.AppData; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.DataMigration { + [TestFixture] + public class SchemaBuilderTestsBase { + private IContainer _container; + private ISessionFactory _sessionFactory; + private string _databaseFileName; + private string _tempFolder; + private SchemaBuilder _schemaBuilder; + private DefaultDataMigrationInterpreter _interpreter; + private ISession _session; + + [SetUp] + public void Setup() { + _databaseFileName = Path.GetTempFileName(); + _sessionFactory = DataUtility.CreateSessionFactory(_databaseFileName); + + _tempFolder = Path.GetTempFileName(); + File.Delete(_tempFolder); + var appDataFolder = AppDataFolderTests.CreateAppDataFolder(_tempFolder); + + var builder = new ContainerBuilder(); + + _session = _sessionFactory.OpenSession(); + builder.RegisterInstance(appDataFolder).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new TestTransactionManager(_session)).As(); + builder.RegisterInstance(new ShellBlueprint { Records = Enumerable.Empty() }).As(); + builder.RegisterInstance(new ShellSettings { Name = "temp", DataProvider = "SqlCe", DataTablePrefix = "TEST" }).As(); + builder.RegisterModule(new DataModule()); + _container = builder.Build(); + + _interpreter = _container.Resolve() as DefaultDataMigrationInterpreter; + _schemaBuilder = new SchemaBuilder(_interpreter); + } + + [Test] + public void AllMethodsShouldBeCalledSuccessfully() { + + _schemaBuilder + .CreateTable("User", table => table + .ContentPartRecord() + .Column("Firstname", DbType.String, column => column.WithLength(255)) + .Column("Lastname", DbType.String, column => column.WithPrecision(0).WithScale(1))) + .CreateTable("Address", table => table + .ContentPartVersionRecord() + .Column("City", DbType.String) + .Column("ZIP", DbType.Int32, column => column.Unique()) + .Column("UserId", DbType.Int32, column => column.NotNull())) + .CreateForeignKey("User_Address", "Address", new[] { "UserId" }, "User", new[] { "Id" }) + .AlterTable("User", table => table + .AddColumn("Age", DbType.Int32)) + .AlterTable("User", table => table + .DropColumn("Lastname")) + .AlterTable("User", table => table + .CreateIndex("IDX_XYZ", "Firstname")) + .AlterTable("User", table => table + .DropIndex("IDX_XYZ")) + .DropForeignKey("Address", "User_Address") + .DropTable("Address"); + } + + [Test] + public void CreateCommandShouldBeHandled() { + + _schemaBuilder + .CreateTable("User", table => table + .Column("Id", DbType.Int32, column => column.PrimaryKey().Identity()) + .Column("Firstname", DbType.String, column => column.WithLength(255)) + .Column("Lastname", DbType.String, column => column.WithLength(100).NotNull()) + .Column("SN", DbType.AnsiString, column => column.WithLength(40).Unique()) + .Column("Salary", DbType.Decimal, column => column.WithPrecision(9).WithScale(2)) + .Column("Gender", DbType.Decimal, column => column.WithDefault("")) + ); + } + + [Test] + public void DropTableCommandShouldBeHandled() { + _schemaBuilder + .CreateTable("User", table => table + .Column("Id", DbType.Int32, column => column.PrimaryKey().Identity()) + .Column("Firstname", DbType.String, column => column.WithLength(255)) + .Column("Lastname", DbType.String, column => column.WithLength(100).NotNull()) + .Column("SN", DbType.AnsiString, column => column.WithLength(40).Unique()) + .Column("Salary", DbType.Decimal, column => column.WithPrecision(9).WithScale(2)) + .Column("Gender", DbType.Decimal, column => column.WithDefault("")) + ); + + _schemaBuilder + .DropTable("User"); + } + + [Test] + public void CustomSqlStatementsShouldBeHandled() { + + _schemaBuilder + .ExecuteSql("select 1"); + } + + [Test] + public void AlterTableCommandShouldBeHandled() { + + _schemaBuilder + .CreateTable("User", table => table + .Column("Firstname", DbType.String, column => column.WithLength(255)) + .Column("Lastname", DbType.String, column => column.WithLength(100).NotNull())) + .AlterTable("User", table => table + .AddColumn("Age", DbType.Int32)) + .AlterTable("User", table => table + .AlterColumn("Lastname", column => column.WithDefault("Doe"))) + .AlterTable("User", table => table + .DropColumn("Firstname") + ); + + // creating a new row should assign a default value to Firstname and Age + _schemaBuilder.ExecuteSql("insert into TEST_User VALUES (DEFAULT, DEFAULT)"); + + // ensure we have one record with the default value + var query = _session.CreateSQLQuery("SELECT count(*) FROM TEST_User WHERE Lastname = 'Doe'"); + Assert.That(query.UniqueResult(), Is.EqualTo(1)); + + // ensure this is not a false positive + query = _session.CreateSQLQuery("SELECT count(*) FROM TEST_User WHERE Lastname = 'Foo'"); + Assert.That(query.UniqueResult(), Is.EqualTo(0)); + } + + [Test] + public void ForeignKeyShouldBeCreatedAndRemoved() { + + _schemaBuilder + .CreateTable("User", table => table + .Column("Id", DbType.Int32, column => column.PrimaryKey().Identity()) + .Column("Firstname", DbType.String, column => column.WithLength(255)) + .Column("Lastname", DbType.String, column => column.WithPrecision(0).WithScale(1))) + .CreateTable("Address", table => table + .Column("City", DbType.String) + .Column("ZIP", DbType.Int32, column => column.Unique()) + .Column("UserId", DbType.Int32, column => column.NotNull())) + .CreateForeignKey("FK_User", "Address", new[] { "UserId" }, "User", new[] { "Id" }) + .DropForeignKey("Address", "FK_User"); + } + + [Test, ExpectedException] + public void BiggerDataShouldNotFit() { + _schemaBuilder + .CreateTable("ContentItemRecord", table => table + .Column("Id", DbType.Int32, column => column.PrimaryKey().Identity()) + .Column("Data", DbType.String, column => column.WithLength(255))); + + // should write successfully less than 255 chars + _schemaBuilder + .ExecuteSql("insert into TEST_ContentItemRecord (Data) values('Hello World')"); + + // should throw an exception if trying to write more data + _schemaBuilder + .ExecuteSql(String.Format("insert into TEST_ContentItemRecord (Data) values('{0}')", new String('x', 256))); + + _schemaBuilder + .AlterTable("ContentItemRecord", table => table + .AlterColumn("Data", column => column.WithType(DbType.String).WithLength(257))); + + _schemaBuilder + .ExecuteSql(String.Format("insert into TEST_ContentItemRecord (Data) values('{0}')", new String('x', 256))); + } + + [Test] + public void ShouldAllowFieldSizeAlteration() { + _schemaBuilder + .CreateTable("ContentItemRecord", table => table + .Column("Id", DbType.Int32, column => column.PrimaryKey().Identity()) + .Column("Data", DbType.String, column => column.WithLength(255))); + + // should write successfully less than 255 chars + _schemaBuilder + .ExecuteSql("insert into TEST_ContentItemRecord (Data) values('Hello World')"); + + _schemaBuilder + .AlterTable("ContentItemRecord", table => table + .AlterColumn("Data", column => column.WithType(DbType.String).WithLength(2048))); + + // should write successfully a bigger value now + _schemaBuilder + .ExecuteSql(String.Format("insert into TEST_ContentItemRecord (Data) values('{0}')", new String('x', 2048))); + } + + [Test, ExpectedException(typeof(OrchardException))] + public void ChangingSizeWithoutTypeShouldNotBeAllowed() { + _schemaBuilder + .CreateTable("ContentItemRecord", table => table + .Column("Id", DbType.Int32, column => column.PrimaryKey().Identity()) + .Column("Data", DbType.String, column => column.WithLength(255))); + + _schemaBuilder + .AlterTable("ContentItemRecord", table => table + .AlterColumn("Data", column => column.WithLength(2048))); + + } + + [Test] + public void PrecisionAndScaleAreApplied() { + + _schemaBuilder + .CreateTable("Product", table => table + .Column("Price", DbType.Decimal, column => column.WithPrecision(19).WithScale(9)) + ); + + _schemaBuilder + .ExecuteSql(String.Format("INSERT INTO TEST_Product (Price) VALUES ({0})", "123456.123456789")); + + var query = _session.CreateSQLQuery("SELECT MAX(Price) FROM TEST_Product"); + Assert.That(query.UniqueResult(), Is.EqualTo(123456.123456789m)); + + } + } +} diff --git a/src/Orchard.Tests/DataMigration/Utilities/NullInterpreter.cs b/src/Orchard.Tests/DataMigration/Utilities/NullInterpreter.cs index 025970a5522..4c1c9792e33 100644 --- a/src/Orchard.Tests/DataMigration/Utilities/NullInterpreter.cs +++ b/src/Orchard.Tests/DataMigration/Utilities/NullInterpreter.cs @@ -1,33 +1,33 @@ -using Orchard.Data.Migration.Interpreters; -using Orchard.Data.Migration.Schema; - -namespace Orchard.Tests.DataMigration.Utilities { - public class NullInterpreter : IDataMigrationInterpreter { - - public void Visit(ISchemaBuilderCommand command) { - } - - public void Visit(CreateTableCommand command) { - } - - public void Visit(DropTableCommand command) { - } - - public void Visit(AlterTableCommand command) { - } - - public void Visit(SqlStatementCommand command) { - } - - public void Visit(CreateForeignKeyCommand command) { - } - - public void Visit(DropForeignKeyCommand command) { - } - - public string PrefixTableName(string tableName) { - return tableName; - } - - } +using Orchard.Data.Migration.Interpreters; +using Orchard.Data.Migration.Schema; + +namespace Orchard.Tests.DataMigration.Utilities { + public class NullInterpreter : IDataMigrationInterpreter { + + public void Visit(ISchemaBuilderCommand command) { + } + + public void Visit(CreateTableCommand command) { + } + + public void Visit(DropTableCommand command) { + } + + public void Visit(AlterTableCommand command) { + } + + public void Visit(SqlStatementCommand command) { + } + + public void Visit(CreateForeignKeyCommand command) { + } + + public void Visit(DropForeignKeyCommand command) { + } + + public string PrefixTableName(string tableName) { + return tableName; + } + + } } \ No newline at end of file diff --git a/src/Orchard.Tests/DataUtility.cs b/src/Orchard.Tests/DataUtility.cs index b79b92afc09..20e12285c06 100644 --- a/src/Orchard.Tests/DataUtility.cs +++ b/src/Orchard.Tests/DataUtility.cs @@ -1,84 +1,84 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using FluentNHibernate; -using FluentNHibernate.Automapping; -using FluentNHibernate.Automapping.Alterations; -using FluentNHibernate.Cfg; -using FluentNHibernate.Cfg.Db; -using FluentNHibernate.Diagnostics; -using NHibernate; -using NHibernate.Tool.hbm2ddl; -using Orchard.Data; -using Orchard.Data.Providers; -using Orchard.Environment.ShellBuilders.Models; -using MsSqlCeConfiguration = Orchard.Data.Providers.MsSqlCeConfiguration; - -namespace Orchard.Tests { - public static class DataUtility { - public static ISessionFactory CreateSessionFactory(string fileName, params Type[] types) { - - //var persistenceModel = AutoMap.Source(new Types(types)) - // .Alterations(alt => AddAlterations(alt, types)) - // .Conventions.AddFromAssemblyOf(); - var persistenceModel = AbstractDataServicesProvider.CreatePersistenceModel(types.Select(t => new RecordBlueprint { TableName = "Test_" + t.Name, Type = t }).ToList()); - var persistenceConfigurer = new SqlCeDataServicesProvider(fileName).GetPersistenceConfigurer(true/*createDatabase*/); - ((MsSqlCeConfiguration)persistenceConfigurer).ShowSql(); - - return Fluently.Configure() - .Database(persistenceConfigurer) - .Mappings(m => m.AutoMappings.Add(persistenceModel)) - .ExposeConfiguration(c => { - // This is to work around what looks to be an issue in the NHibernate driver: - // When inserting a row with IDENTITY column, the "SELET @@IDENTITY" statement - // is issued as a separate command. By default, it is also issued in a separate - // connection, which is not supported (returns NULL). - c.SetProperty("connection.release_mode", "on_close"); - new SchemaExport(c).Create(false /*script*/, true /*export*/); - }) - .BuildSessionFactory(); - } - - private static void AddAlterations(AutoMappingAlterationCollection alterations, IEnumerable types) { - foreach (var assembly in types.Select(t => t.Assembly).Distinct()) { - alterations.Add(new AutoMappingOverrideAlteration(assembly)); - alterations.AddFromAssembly(assembly); - } - alterations.AddFromAssemblyOf(); - } - - public static ISessionFactory CreateSessionFactory(params Type[] types) { - return CreateSessionFactory( - string.Join(".", types.Reverse().Select(type => type.FullName)), - types); - } - - #region Nested type: Types - - private class Types : ITypeSource { - private readonly IEnumerable _types; - - public Types(params Type[] types) { - _types = types; - } - - #region ITypeSource Members - - public IEnumerable GetTypes() { - return _types; - } - - public void LogSource(IDiagnosticLogger logger) { - throw new NotImplementedException(); - } - - public string GetIdentifier() { - throw new NotImplementedException(); - } - - #endregion - } - - #endregion - } +using System; +using System.Collections.Generic; +using System.Linq; +using FluentNHibernate; +using FluentNHibernate.Automapping; +using FluentNHibernate.Automapping.Alterations; +using FluentNHibernate.Cfg; +using FluentNHibernate.Cfg.Db; +using FluentNHibernate.Diagnostics; +using NHibernate; +using NHibernate.Tool.hbm2ddl; +using Orchard.Data; +using Orchard.Data.Providers; +using Orchard.Environment.ShellBuilders.Models; +using MsSqlCeConfiguration = Orchard.Data.Providers.MsSqlCeConfiguration; + +namespace Orchard.Tests { + public static class DataUtility { + public static ISessionFactory CreateSessionFactory(string fileName, params Type[] types) { + + //var persistenceModel = AutoMap.Source(new Types(types)) + // .Alterations(alt => AddAlterations(alt, types)) + // .Conventions.AddFromAssemblyOf(); + var persistenceModel = AbstractDataServicesProvider.CreatePersistenceModel(types.Select(t => new RecordBlueprint { TableName = "Test_" + t.Name, Type = t }).ToList()); + var persistenceConfigurer = new SqlCeDataServicesProvider(fileName).GetPersistenceConfigurer(true/*createDatabase*/); + ((MsSqlCeConfiguration)persistenceConfigurer).ShowSql(); + + return Fluently.Configure() + .Database(persistenceConfigurer) + .Mappings(m => m.AutoMappings.Add(persistenceModel)) + .ExposeConfiguration(c => { + // This is to work around what looks to be an issue in the NHibernate driver: + // When inserting a row with IDENTITY column, the "SELET @@IDENTITY" statement + // is issued as a separate command. By default, it is also issued in a separate + // connection, which is not supported (returns NULL). + c.SetProperty("connection.release_mode", "on_close"); + new SchemaExport(c).Create(false /*script*/, true /*export*/); + }) + .BuildSessionFactory(); + } + + private static void AddAlterations(AutoMappingAlterationCollection alterations, IEnumerable types) { + foreach (var assembly in types.Select(t => t.Assembly).Distinct()) { + alterations.Add(new AutoMappingOverrideAlteration(assembly)); + alterations.AddFromAssembly(assembly); + } + alterations.AddFromAssemblyOf(); + } + + public static ISessionFactory CreateSessionFactory(params Type[] types) { + return CreateSessionFactory( + string.Join(".", types.Reverse().Select(type => type.FullName)), + types); + } + + #region Nested type: Types + + private class Types : ITypeSource { + private readonly IEnumerable _types; + + public Types(params Type[] types) { + _types = types; + } + + #region ITypeSource Members + + public IEnumerable GetTypes() { + return _types; + } + + public void LogSource(IDiagnosticLogger logger) { + throw new NotImplementedException(); + } + + public string GetIdentifier() { + throw new NotImplementedException(); + } + + #endregion + } + + #endregion + } } \ No newline at end of file diff --git a/src/Orchard.Tests/DatabaseEnabledTestsBase.cs b/src/Orchard.Tests/DatabaseEnabledTestsBase.cs index b1d782cc03b..f2f1b0be0ae 100644 --- a/src/Orchard.Tests/DatabaseEnabledTestsBase.cs +++ b/src/Orchard.Tests/DatabaseEnabledTestsBase.cs @@ -1,79 +1,79 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using Autofac; -using NHibernate; -using NUnit.Framework; -using Orchard.ContentManagement.FieldStorage.InfosetStorage; -using Orchard.ContentManagement.Handlers; -using Orchard.Data; -using Orchard.Environment.Configuration; -using Orchard.Services; -using Orchard.Tests.ContentManagement; -using Orchard.Tests.Data; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests { - public abstract class DatabaseEnabledTestsBase { - - protected IContainer _container; - - protected ISession _session; - protected string _databaseFilePath; - protected ISessionFactory _sessionFactory; - protected StubClock _clock; - - - [TestFixtureSetUp] - public void InitFixture() { - } - - [TestFixtureTearDown] - public void TearDownFixture() { - File.Delete(_databaseFilePath); - } - - [SetUp] - public virtual void Init() { - _databaseFilePath = Path.GetTempFileName(); - _sessionFactory = DataUtility.CreateSessionFactory(_databaseFilePath, DatabaseTypes.ToArray()); - _session = _sessionFactory.OpenSession(); - _clock = new StubClock(); - - var builder = new ContainerBuilder(); - //builder.RegisterModule(new ImplicitCollectionSupportModule()); - builder.RegisterType().As(); - builder.RegisterInstance(new StubLocator(_session)).As(); - builder.RegisterInstance(_clock).As(); - builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); - builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataProvider = "SqlCe" }); - builder.RegisterInstance(new TestTransactionManager(_session)).As(); - - Register(builder); - _container = builder.Build(); - } - - [TearDown] - public void Cleanup() { - if(_container != null) - _container.Dispose(); - } - - public abstract void Register(ContainerBuilder builder); - - protected virtual IEnumerable DatabaseTypes { - get { - return Enumerable.Empty(); - } - } - - protected void ClearSession() { - Trace.WriteLine("Flush and clear session"); - _session.Flush(); - _session.Clear(); - Trace.WriteLine("Flushed and cleared session"); - } - } +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using Autofac; +using NHibernate; +using NUnit.Framework; +using Orchard.ContentManagement.FieldStorage.InfosetStorage; +using Orchard.ContentManagement.Handlers; +using Orchard.Data; +using Orchard.Environment.Configuration; +using Orchard.Services; +using Orchard.Tests.ContentManagement; +using Orchard.Tests.Data; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests { + public abstract class DatabaseEnabledTestsBase { + + protected IContainer _container; + + protected ISession _session; + protected string _databaseFilePath; + protected ISessionFactory _sessionFactory; + protected StubClock _clock; + + + [TestFixtureSetUp] + public void InitFixture() { + } + + [TestFixtureTearDown] + public void TearDownFixture() { + File.Delete(_databaseFilePath); + } + + [SetUp] + public virtual void Init() { + _databaseFilePath = Path.GetTempFileName(); + _sessionFactory = DataUtility.CreateSessionFactory(_databaseFilePath, DatabaseTypes.ToArray()); + _session = _sessionFactory.OpenSession(); + _clock = new StubClock(); + + var builder = new ContainerBuilder(); + //builder.RegisterModule(new ImplicitCollectionSupportModule()); + builder.RegisterType().As(); + builder.RegisterInstance(new StubLocator(_session)).As(); + builder.RegisterInstance(_clock).As(); + builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); + builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataProvider = "SqlCe" }); + builder.RegisterInstance(new TestTransactionManager(_session)).As(); + + Register(builder); + _container = builder.Build(); + } + + [TearDown] + public void Cleanup() { + if(_container != null) + _container.Dispose(); + } + + public abstract void Register(ContainerBuilder builder); + + protected virtual IEnumerable DatabaseTypes { + get { + return Enumerable.Empty(); + } + } + + protected void ClearSession() { + Trace.WriteLine("Flush and clear session"); + _session.Flush(); + _session.Clear(); + Trace.WriteLine("Flushed and cleared session"); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/DisplayManagement/ArgsUtility.cs b/src/Orchard.Tests/DisplayManagement/ArgsUtility.cs index 25d1247170b..70db6eff473 100644 --- a/src/Orchard.Tests/DisplayManagement/ArgsUtility.cs +++ b/src/Orchard.Tests/DisplayManagement/ArgsUtility.cs @@ -1,30 +1,30 @@ -using System.Collections.Generic; -using System.Linq; -using System.Web.Routing; -using Orchard.DisplayManagement; - -namespace Orchard.Tests.DisplayManagement { - public static class ArgsUtility { - public static INamedEnumerable Named(IDictionary args) { - return FromDictionary(args); - } - - public static INamedEnumerable Named(object args) { - return FromDictionary(new RouteValueDictionary(args)); - } - public static INamedEnumerable Empty() { - return Arguments.FromT(Enumerable.Empty(), Enumerable.Empty()); - } - public static INamedEnumerable Empty() { - return Empty(); - } - - static INamedEnumerable FromDictionary(IDictionary args) { - return Arguments.FromT(args.Values, args.Keys); - } - - public static INamedEnumerable Positional(params object[] args) { - return Arguments.From(args, Enumerable.Empty()); - } - } -} +using System.Collections.Generic; +using System.Linq; +using System.Web.Routing; +using Orchard.DisplayManagement; + +namespace Orchard.Tests.DisplayManagement { + public static class ArgsUtility { + public static INamedEnumerable Named(IDictionary args) { + return FromDictionary(args); + } + + public static INamedEnumerable Named(object args) { + return FromDictionary(new RouteValueDictionary(args)); + } + public static INamedEnumerable Empty() { + return Arguments.FromT(Enumerable.Empty(), Enumerable.Empty()); + } + public static INamedEnumerable Empty() { + return Empty(); + } + + static INamedEnumerable FromDictionary(IDictionary args) { + return Arguments.FromT(args.Values, args.Keys); + } + + public static INamedEnumerable Positional(params object[] args) { + return Arguments.From(args, Enumerable.Empty()); + } + } +} diff --git a/src/Orchard.Tests/DisplayManagement/CompositeTests.cs b/src/Orchard.Tests/DisplayManagement/CompositeTests.cs index adcd4f58086..4a33e04e3bf 100644 --- a/src/Orchard.Tests/DisplayManagement/CompositeTests.cs +++ b/src/Orchard.Tests/DisplayManagement/CompositeTests.cs @@ -1,76 +1,76 @@ -using NUnit.Framework; -using Orchard.DisplayManagement.Shapes; - -namespace Orchard.Tests.DisplayManagement { - [TestFixture] - public class CompositeTests { - - [Test] - public void CompositesShouldNotOverrideExistingMembers() { - var composite = new Animal {Color = "Pink"}; - - Assert.That(composite.Color, Is.EqualTo("Pink")); - } - - [Test] - public void CompositesShouldNotOverrideExistingMembersWhenUsedAsDynamic() { - dynamic composite = new Animal(); - - composite.Color = "Pink"; - Assert.That(composite.Color, Is.EqualTo("Pink")); - } - - [Test] - public void CompositesShouldAccessUnknownProperties() { - dynamic composite = new Animal(); - - composite.Fake = 42; - Assert.That(composite.Fake, Is.EqualTo(42)); - } - - [Test] - public void CompositesShouldAccessUnknownPropertiesByIndex() { - dynamic composite = new Animal(); - - composite["Fake"] = 42; - Assert.That(composite["Fake"], Is.EqualTo(42)); - } - - [Test] - public void CompositesShouldAccessKnownPropertiesByIndex() { - dynamic composite = new Animal(); - - composite["Pink"] = "Pink"; - Assert.That(composite["Pink"], Is.EqualTo("Pink")); - } - - [Test] - public void ChainProperties() { - dynamic foo = new Animal(); - foo.Bar("bar"); - - Assert.That(foo.Bar, Is.EqualTo("bar")); - Assert.That(foo.Bar == null, Is.False); - } - - - [Test] - public void DuckTyping() { - dynamic foo = new Animal(); - foo.Size(42); - - ISized sized = foo; - - Assert.That(sized.Size, Is.EqualTo(42)); - } - } - - public class Animal : Composite { - public string Kind { get; set; } - public string Color { get; set; } - } - - public interface ISized { - int Size { get; set; } - } -} +using NUnit.Framework; +using Orchard.DisplayManagement.Shapes; + +namespace Orchard.Tests.DisplayManagement { + [TestFixture] + public class CompositeTests { + + [Test] + public void CompositesShouldNotOverrideExistingMembers() { + var composite = new Animal {Color = "Pink"}; + + Assert.That(composite.Color, Is.EqualTo("Pink")); + } + + [Test] + public void CompositesShouldNotOverrideExistingMembersWhenUsedAsDynamic() { + dynamic composite = new Animal(); + + composite.Color = "Pink"; + Assert.That(composite.Color, Is.EqualTo("Pink")); + } + + [Test] + public void CompositesShouldAccessUnknownProperties() { + dynamic composite = new Animal(); + + composite.Fake = 42; + Assert.That(composite.Fake, Is.EqualTo(42)); + } + + [Test] + public void CompositesShouldAccessUnknownPropertiesByIndex() { + dynamic composite = new Animal(); + + composite["Fake"] = 42; + Assert.That(composite["Fake"], Is.EqualTo(42)); + } + + [Test] + public void CompositesShouldAccessKnownPropertiesByIndex() { + dynamic composite = new Animal(); + + composite["Pink"] = "Pink"; + Assert.That(composite["Pink"], Is.EqualTo("Pink")); + } + + [Test] + public void ChainProperties() { + dynamic foo = new Animal(); + foo.Bar("bar"); + + Assert.That(foo.Bar, Is.EqualTo("bar")); + Assert.That(foo.Bar == null, Is.False); + } + + + [Test] + public void DuckTyping() { + dynamic foo = new Animal(); + foo.Size(42); + + ISized sized = foo; + + Assert.That(sized.Size, Is.EqualTo(42)); + } + } + + public class Animal : Composite { + public string Kind { get; set; } + public string Color { get; set; } + } + + public interface ISized { + int Size { get; set; } + } +} diff --git a/src/Orchard.Tests/DisplayManagement/DefaultDisplayManagerTests.cs b/src/Orchard.Tests/DisplayManagement/DefaultDisplayManagerTests.cs index 82fb2f86ce8..8c769ad35fc 100644 --- a/src/Orchard.Tests/DisplayManagement/DefaultDisplayManagerTests.cs +++ b/src/Orchard.Tests/DisplayManagement/DefaultDisplayManagerTests.cs @@ -1,372 +1,372 @@ -using System; -using System.Collections.Generic; -using System.Web; -using System.Web.Mvc; -using Autofac; -using Autofac.Integration.Web; -using NUnit.Framework; -using Orchard.DisplayManagement.Descriptors; -using Orchard.DisplayManagement.Implementation; -using Orchard.DisplayManagement.Shapes; -using Orchard.Environment.Extensions.Models; -using Orchard.Mvc; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.DisplayManagement { - [TestFixture] - public class DefaultDisplayManagerTests : ContainerTestBase { - ShapeTable _defaultShapeTable; - WorkContext _workContext; - - protected override void Register(Autofac.ContainerBuilder builder) { - _defaultShapeTable = new ShapeTable { - Descriptors = new Dictionary(StringComparer.OrdinalIgnoreCase), - Bindings = new Dictionary(StringComparer.OrdinalIgnoreCase) - }; - _workContext = new TestWorkContext { - CurrentTheme = new ExtensionDescriptor { Id = "Hello" } - }; - - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As() - .As() - .InstancePerLifetimeScope(); - - builder.Register(ctx => _defaultShapeTable); - builder.Register(ctx => _workContext); - } - - class TestDisplayEvents : IShapeDisplayEvents { - public Action Displaying = ctx => { }; - public Action Displayed = ctx => { }; - - void IShapeDisplayEvents.Displaying(ShapeDisplayingContext context) { Displaying(context); } - void IShapeDisplayEvents.Displayed(ShapeDisplayedContext context) { Displayed(context); } - } - - - - public class TestShapeTableManager : IShapeTableManager { - private readonly ShapeTable _defaultShapeTable; - - public TestShapeTableManager(ShapeTable defaultShapeTable) { - _defaultShapeTable = defaultShapeTable; - } - - public ShapeTable GetShapeTable(string themeName) { - return _defaultShapeTable; - } - } - - public class TestWorkContextAccessor : IWorkContextAccessor { - private readonly WorkContext _workContext; - public TestWorkContextAccessor(WorkContext workContext) { - _workContext = workContext; - } - - public WorkContext GetContext(HttpContextBase httpContext) { - return _workContext; - } - - public IWorkContextScope CreateWorkContextScope(HttpContextBase httpContext) { - throw new NotImplementedException(); - } - - public WorkContext GetContext() { - return _workContext; - } - - public IWorkContextScope CreateWorkContextScope() { - throw new NotImplementedException(); - } - } - - public class TestWorkContext : WorkContext { - readonly IDictionary _state = new Dictionary(); - public IContainerProvider ContainerProvider { get; set; } - - public override T Resolve() { - if (typeof(T) == typeof(ILifetimeScope)) { - return (T)ContainerProvider.RequestLifetime; - } - - throw new NotImplementedException(); - } - - public override bool TryResolve(out T service) { - throw new NotImplementedException(); - } - - public override T GetState(string name) { - object value; - return _state.TryGetValue(name, out value) ? (T)value : default(T); - } - - public override void SetState(string name, T value) { - _state[name] = value; - } - } - - void AddShapeDescriptor(ShapeDescriptor shapeDescriptor) { - _defaultShapeTable.Descriptors[shapeDescriptor.ShapeType] = shapeDescriptor; - foreach (var binding in shapeDescriptor.Bindings) { - binding.Value.ShapeDescriptor = shapeDescriptor; - _defaultShapeTable.Bindings[binding.Key] = binding.Value; - } - } - - static DisplayContext CreateDisplayContext(Shape shape) { - return new DisplayContext { - Value = shape, - ViewContext = new ViewContext() - }; - } - - [Test] - public void RenderSimpleShape() { - var displayManager = _container.Resolve(); - - var shape = new Shape { - Metadata = new ShapeMetadata { - Type = "Foo" - } - }; - - var descriptor = new ShapeDescriptor { - ShapeType = "Foo", - }; - descriptor.Bindings["Foo"] = new ShapeBinding { - BindingName = "Foo", - Binding = ctx => new HtmlString("Hi there!"), - }; - AddShapeDescriptor(descriptor); - - var result = displayManager.Execute(CreateDisplayContext(shape)); - Assert.That(result.ToString(), Is.EqualTo("Hi there!")); - } - - [Test] - public void RenderPreCalculatedShape() { - var displayManager = _container.Resolve(); - - var shape = new Shape { - Metadata = new ShapeMetadata { - Type = "Foo" - } - }; - - shape.Metadata.OnDisplaying( - context => { - context.ChildContent = new HtmlString("Bar"); - }); - - var descriptor = new ShapeDescriptor { - ShapeType = "Foo", - }; - descriptor.Bindings["Foo"] = new ShapeBinding { - BindingName = "Foo", - Binding = ctx => new HtmlString("Hi there!"), - }; - - AddShapeDescriptor(descriptor); - - var result = displayManager.Execute(CreateDisplayContext(shape)); - Assert.That(result.ToString(), Is.EqualTo("Bar")); - } - - [Test] - public void RenderFallbackShape() { - var displayManager = _container.Resolve(); - - var shape = new Shape { - Metadata = new ShapeMetadata { - Type = "Foo__2" - } - }; - - var descriptor = new ShapeDescriptor { - ShapeType = "Foo", - }; - descriptor.Bindings["Foo"] = new ShapeBinding { - BindingName = "Foo", - Binding = ctx => new HtmlString("Hi there!"), - }; - AddShapeDescriptor(descriptor); - - var result = displayManager.Execute(CreateDisplayContext(shape)); - Assert.That(result.ToString(), Is.EqualTo("Hi there!")); - } - - [Test] - public void RenderAlternateShapeExplicitly() { - var displayManager = _container.Resolve(); - - var shape = new Shape { - Metadata = new ShapeMetadata { - Type = "Foo__2" - } - }; - - var descriptor = new ShapeDescriptor { - ShapeType = "Foo", - }; - descriptor.Bindings["Foo"] = new ShapeBinding { - BindingName = "Foo", - Binding = ctx => new HtmlString("Hi there!"), - }; - descriptor.Bindings["Foo__2"] = new ShapeBinding { - BindingName = "Foo__2", - Binding = ctx => new HtmlString("Hello again!"), - }; - AddShapeDescriptor(descriptor); - - var result = displayManager.Execute(CreateDisplayContext(shape)); - Assert.That(result.ToString(), Is.EqualTo("Hello again!")); - } - - [Test] - public void RenderAlternateShapeByMostRecentlyAddedMatchingAlternate() { - var displayManager = _container.Resolve(); - - var shape = new Shape { - Metadata = new ShapeMetadata { - Type = "Foo" - } - }; - shape.Metadata.Alternates.Add("Foo__1"); - shape.Metadata.Alternates.Add("Foo__2"); - shape.Metadata.Alternates.Add("Foo__3"); - - var descriptor = new ShapeDescriptor { - ShapeType = "Foo", - }; - AddBinding(descriptor, "Foo", ctx => new HtmlString("Hi there!")); - AddBinding(descriptor, "Foo__1", ctx => new HtmlString("Hello (1)!")); - AddBinding(descriptor, "Foo__2", ctx => new HtmlString("Hello (2)!")); - AddShapeDescriptor(descriptor); - - var result = displayManager.Execute(CreateDisplayContext(shape)); - Assert.That(result.ToString(), Is.EqualTo("Hello (2)!")); - } - - private static void AddBinding(ShapeDescriptor descriptor, string bindingName, Func binding) { - descriptor.Bindings[bindingName] = new ShapeBinding { - BindingName = bindingName, - Binding = binding, - }; - } - - - [Test] - public void IShapeDisplayEventsIsCalled() { - var displayManager = _container.Resolve(); - - var shape = new Shape { - Metadata = new ShapeMetadata { - Type = "Foo" - } - }; - - var descriptor = new ShapeDescriptor { - ShapeType = "Foo", - }; - AddBinding(descriptor, "Foo", ctx => new HtmlString("yarg")); - AddShapeDescriptor(descriptor); - - var displayingEventCount = 0; - var displayedEventCount = 0; - _container.Resolve().Displaying = ctx => { ++displayingEventCount; }; - _container.Resolve().Displayed = ctx => { ++displayedEventCount; ctx.ChildContent = new HtmlString("[" + ctx.ChildContent.ToHtmlString() + "]"); }; - - var result = displayManager.Execute(CreateDisplayContext(shape)); - - Assert.That(displayingEventCount, Is.EqualTo(1)); - Assert.That(displayedEventCount, Is.EqualTo(1)); - Assert.That(result.ToString(), Is.EqualTo("[yarg]")); - } - - - [Test] - public void ShapeDescriptorDisplayingAndDisplayedAreCalled() { - var displayManager = _container.Resolve(); - - var shape = new Shape { - Metadata = new ShapeMetadata { - Type = "Foo" - } - }; - - var descriptor = new ShapeDescriptor { - ShapeType = "Foo", - }; - AddBinding(descriptor, "Foo", ctx => new HtmlString("yarg")); - AddShapeDescriptor(descriptor); - - var displayingEventCount = 0; - var displayedEventCount = 0; - descriptor.Displaying = new Action[] { ctx => { ++displayingEventCount; } }; - descriptor.Displayed = new Action[] { ctx => { ++displayedEventCount; ctx.ChildContent = new HtmlString("[" + ctx.ChildContent.ToHtmlString() + "]"); } }; - - var result = displayManager.Execute(CreateDisplayContext(shape)); - - Assert.That(displayingEventCount, Is.EqualTo(1)); - Assert.That(displayedEventCount, Is.EqualTo(1)); - Assert.That(result.ToString(), Is.EqualTo("[yarg]")); - } - - [Test] - public void DisplayingEventFiresEarlyEnoughToAddAlternateShapeBindingNames() { - var displayManager = _container.Resolve(); - - var shapeFoo = new Shape { - Metadata = new ShapeMetadata { - Type = "Foo" - } - }; - var descriptorFoo = new ShapeDescriptor { - ShapeType = "Foo", - }; - AddBinding(descriptorFoo, "Foo", ctx => new HtmlString("alpha")); - AddShapeDescriptor(descriptorFoo); - - var descriptorBar = new ShapeDescriptor { - ShapeType = "Bar", - }; - AddBinding(descriptorBar, "Bar", ctx => new HtmlString("beta")); - AddShapeDescriptor(descriptorBar); - - - var resultNormally = displayManager.Execute(CreateDisplayContext(shapeFoo)); - descriptorFoo.Displaying = new Action[] { ctx => ctx.ShapeMetadata.Alternates.Add("Bar") }; - var resultWithOverride = displayManager.Execute(CreateDisplayContext(shapeFoo)); - - Assert.That(resultNormally.ToString(), Is.EqualTo("alpha")); - Assert.That(resultWithOverride.ToString(), Is.EqualTo("beta")); - } - - - [Test] - public void ShapeTypeAndBindingNamesAreNotCaseSensitive() { - var displayManager = _container.Resolve(); - - var shapeFoo = new Shape { - Metadata = new ShapeMetadata { - Type = "foo" - } - }; - var descriptorFoo = new ShapeDescriptor { - ShapeType = "Foo", - }; - AddBinding(descriptorFoo, "Foo", ctx => new HtmlString("alpha")); - AddShapeDescriptor(descriptorFoo); - - var result = displayManager.Execute(CreateDisplayContext(shapeFoo)); - - Assert.That(result.ToString(), Is.EqualTo("alpha")); - } - } -} +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.Mvc; +using Autofac; +using Autofac.Integration.Web; +using NUnit.Framework; +using Orchard.DisplayManagement.Descriptors; +using Orchard.DisplayManagement.Implementation; +using Orchard.DisplayManagement.Shapes; +using Orchard.Environment.Extensions.Models; +using Orchard.Mvc; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.DisplayManagement { + [TestFixture] + public class DefaultDisplayManagerTests : ContainerTestBase { + ShapeTable _defaultShapeTable; + WorkContext _workContext; + + protected override void Register(Autofac.ContainerBuilder builder) { + _defaultShapeTable = new ShapeTable { + Descriptors = new Dictionary(StringComparer.OrdinalIgnoreCase), + Bindings = new Dictionary(StringComparer.OrdinalIgnoreCase) + }; + _workContext = new TestWorkContext { + CurrentTheme = new ExtensionDescriptor { Id = "Hello" } + }; + + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As() + .As() + .InstancePerLifetimeScope(); + + builder.Register(ctx => _defaultShapeTable); + builder.Register(ctx => _workContext); + } + + class TestDisplayEvents : IShapeDisplayEvents { + public Action Displaying = ctx => { }; + public Action Displayed = ctx => { }; + + void IShapeDisplayEvents.Displaying(ShapeDisplayingContext context) { Displaying(context); } + void IShapeDisplayEvents.Displayed(ShapeDisplayedContext context) { Displayed(context); } + } + + + + public class TestShapeTableManager : IShapeTableManager { + private readonly ShapeTable _defaultShapeTable; + + public TestShapeTableManager(ShapeTable defaultShapeTable) { + _defaultShapeTable = defaultShapeTable; + } + + public ShapeTable GetShapeTable(string themeName) { + return _defaultShapeTable; + } + } + + public class TestWorkContextAccessor : IWorkContextAccessor { + private readonly WorkContext _workContext; + public TestWorkContextAccessor(WorkContext workContext) { + _workContext = workContext; + } + + public WorkContext GetContext(HttpContextBase httpContext) { + return _workContext; + } + + public IWorkContextScope CreateWorkContextScope(HttpContextBase httpContext) { + throw new NotImplementedException(); + } + + public WorkContext GetContext() { + return _workContext; + } + + public IWorkContextScope CreateWorkContextScope() { + throw new NotImplementedException(); + } + } + + public class TestWorkContext : WorkContext { + readonly IDictionary _state = new Dictionary(); + public IContainerProvider ContainerProvider { get; set; } + + public override T Resolve() { + if (typeof(T) == typeof(ILifetimeScope)) { + return (T)ContainerProvider.RequestLifetime; + } + + throw new NotImplementedException(); + } + + public override bool TryResolve(out T service) { + throw new NotImplementedException(); + } + + public override T GetState(string name) { + object value; + return _state.TryGetValue(name, out value) ? (T)value : default(T); + } + + public override void SetState(string name, T value) { + _state[name] = value; + } + } + + void AddShapeDescriptor(ShapeDescriptor shapeDescriptor) { + _defaultShapeTable.Descriptors[shapeDescriptor.ShapeType] = shapeDescriptor; + foreach (var binding in shapeDescriptor.Bindings) { + binding.Value.ShapeDescriptor = shapeDescriptor; + _defaultShapeTable.Bindings[binding.Key] = binding.Value; + } + } + + static DisplayContext CreateDisplayContext(Shape shape) { + return new DisplayContext { + Value = shape, + ViewContext = new ViewContext() + }; + } + + [Test] + public void RenderSimpleShape() { + var displayManager = _container.Resolve(); + + var shape = new Shape { + Metadata = new ShapeMetadata { + Type = "Foo" + } + }; + + var descriptor = new ShapeDescriptor { + ShapeType = "Foo", + }; + descriptor.Bindings["Foo"] = new ShapeBinding { + BindingName = "Foo", + Binding = ctx => new HtmlString("Hi there!"), + }; + AddShapeDescriptor(descriptor); + + var result = displayManager.Execute(CreateDisplayContext(shape)); + Assert.That(result.ToString(), Is.EqualTo("Hi there!")); + } + + [Test] + public void RenderPreCalculatedShape() { + var displayManager = _container.Resolve(); + + var shape = new Shape { + Metadata = new ShapeMetadata { + Type = "Foo" + } + }; + + shape.Metadata.OnDisplaying( + context => { + context.ChildContent = new HtmlString("Bar"); + }); + + var descriptor = new ShapeDescriptor { + ShapeType = "Foo", + }; + descriptor.Bindings["Foo"] = new ShapeBinding { + BindingName = "Foo", + Binding = ctx => new HtmlString("Hi there!"), + }; + + AddShapeDescriptor(descriptor); + + var result = displayManager.Execute(CreateDisplayContext(shape)); + Assert.That(result.ToString(), Is.EqualTo("Bar")); + } + + [Test] + public void RenderFallbackShape() { + var displayManager = _container.Resolve(); + + var shape = new Shape { + Metadata = new ShapeMetadata { + Type = "Foo__2" + } + }; + + var descriptor = new ShapeDescriptor { + ShapeType = "Foo", + }; + descriptor.Bindings["Foo"] = new ShapeBinding { + BindingName = "Foo", + Binding = ctx => new HtmlString("Hi there!"), + }; + AddShapeDescriptor(descriptor); + + var result = displayManager.Execute(CreateDisplayContext(shape)); + Assert.That(result.ToString(), Is.EqualTo("Hi there!")); + } + + [Test] + public void RenderAlternateShapeExplicitly() { + var displayManager = _container.Resolve(); + + var shape = new Shape { + Metadata = new ShapeMetadata { + Type = "Foo__2" + } + }; + + var descriptor = new ShapeDescriptor { + ShapeType = "Foo", + }; + descriptor.Bindings["Foo"] = new ShapeBinding { + BindingName = "Foo", + Binding = ctx => new HtmlString("Hi there!"), + }; + descriptor.Bindings["Foo__2"] = new ShapeBinding { + BindingName = "Foo__2", + Binding = ctx => new HtmlString("Hello again!"), + }; + AddShapeDescriptor(descriptor); + + var result = displayManager.Execute(CreateDisplayContext(shape)); + Assert.That(result.ToString(), Is.EqualTo("Hello again!")); + } + + [Test] + public void RenderAlternateShapeByMostRecentlyAddedMatchingAlternate() { + var displayManager = _container.Resolve(); + + var shape = new Shape { + Metadata = new ShapeMetadata { + Type = "Foo" + } + }; + shape.Metadata.Alternates.Add("Foo__1"); + shape.Metadata.Alternates.Add("Foo__2"); + shape.Metadata.Alternates.Add("Foo__3"); + + var descriptor = new ShapeDescriptor { + ShapeType = "Foo", + }; + AddBinding(descriptor, "Foo", ctx => new HtmlString("Hi there!")); + AddBinding(descriptor, "Foo__1", ctx => new HtmlString("Hello (1)!")); + AddBinding(descriptor, "Foo__2", ctx => new HtmlString("Hello (2)!")); + AddShapeDescriptor(descriptor); + + var result = displayManager.Execute(CreateDisplayContext(shape)); + Assert.That(result.ToString(), Is.EqualTo("Hello (2)!")); + } + + private static void AddBinding(ShapeDescriptor descriptor, string bindingName, Func binding) { + descriptor.Bindings[bindingName] = new ShapeBinding { + BindingName = bindingName, + Binding = binding, + }; + } + + + [Test] + public void IShapeDisplayEventsIsCalled() { + var displayManager = _container.Resolve(); + + var shape = new Shape { + Metadata = new ShapeMetadata { + Type = "Foo" + } + }; + + var descriptor = new ShapeDescriptor { + ShapeType = "Foo", + }; + AddBinding(descriptor, "Foo", ctx => new HtmlString("yarg")); + AddShapeDescriptor(descriptor); + + var displayingEventCount = 0; + var displayedEventCount = 0; + _container.Resolve().Displaying = ctx => { ++displayingEventCount; }; + _container.Resolve().Displayed = ctx => { ++displayedEventCount; ctx.ChildContent = new HtmlString("[" + ctx.ChildContent.ToHtmlString() + "]"); }; + + var result = displayManager.Execute(CreateDisplayContext(shape)); + + Assert.That(displayingEventCount, Is.EqualTo(1)); + Assert.That(displayedEventCount, Is.EqualTo(1)); + Assert.That(result.ToString(), Is.EqualTo("[yarg]")); + } + + + [Test] + public void ShapeDescriptorDisplayingAndDisplayedAreCalled() { + var displayManager = _container.Resolve(); + + var shape = new Shape { + Metadata = new ShapeMetadata { + Type = "Foo" + } + }; + + var descriptor = new ShapeDescriptor { + ShapeType = "Foo", + }; + AddBinding(descriptor, "Foo", ctx => new HtmlString("yarg")); + AddShapeDescriptor(descriptor); + + var displayingEventCount = 0; + var displayedEventCount = 0; + descriptor.Displaying = new Action[] { ctx => { ++displayingEventCount; } }; + descriptor.Displayed = new Action[] { ctx => { ++displayedEventCount; ctx.ChildContent = new HtmlString("[" + ctx.ChildContent.ToHtmlString() + "]"); } }; + + var result = displayManager.Execute(CreateDisplayContext(shape)); + + Assert.That(displayingEventCount, Is.EqualTo(1)); + Assert.That(displayedEventCount, Is.EqualTo(1)); + Assert.That(result.ToString(), Is.EqualTo("[yarg]")); + } + + [Test] + public void DisplayingEventFiresEarlyEnoughToAddAlternateShapeBindingNames() { + var displayManager = _container.Resolve(); + + var shapeFoo = new Shape { + Metadata = new ShapeMetadata { + Type = "Foo" + } + }; + var descriptorFoo = new ShapeDescriptor { + ShapeType = "Foo", + }; + AddBinding(descriptorFoo, "Foo", ctx => new HtmlString("alpha")); + AddShapeDescriptor(descriptorFoo); + + var descriptorBar = new ShapeDescriptor { + ShapeType = "Bar", + }; + AddBinding(descriptorBar, "Bar", ctx => new HtmlString("beta")); + AddShapeDescriptor(descriptorBar); + + + var resultNormally = displayManager.Execute(CreateDisplayContext(shapeFoo)); + descriptorFoo.Displaying = new Action[] { ctx => ctx.ShapeMetadata.Alternates.Add("Bar") }; + var resultWithOverride = displayManager.Execute(CreateDisplayContext(shapeFoo)); + + Assert.That(resultNormally.ToString(), Is.EqualTo("alpha")); + Assert.That(resultWithOverride.ToString(), Is.EqualTo("beta")); + } + + + [Test] + public void ShapeTypeAndBindingNamesAreNotCaseSensitive() { + var displayManager = _container.Resolve(); + + var shapeFoo = new Shape { + Metadata = new ShapeMetadata { + Type = "foo" + } + }; + var descriptorFoo = new ShapeDescriptor { + ShapeType = "Foo", + }; + AddBinding(descriptorFoo, "Foo", ctx => new HtmlString("alpha")); + AddShapeDescriptor(descriptorFoo); + + var result = displayManager.Execute(CreateDisplayContext(shapeFoo)); + + Assert.That(result.ToString(), Is.EqualTo("alpha")); + } + } +} diff --git a/src/Orchard.Tests/DisplayManagement/Descriptors/BasicShapeTemplateHarvesterTests.cs b/src/Orchard.Tests/DisplayManagement/Descriptors/BasicShapeTemplateHarvesterTests.cs index 839cf835ea0..31b55f4fafa 100644 --- a/src/Orchard.Tests/DisplayManagement/Descriptors/BasicShapeTemplateHarvesterTests.cs +++ b/src/Orchard.Tests/DisplayManagement/Descriptors/BasicShapeTemplateHarvesterTests.cs @@ -1,121 +1,121 @@ -using System.Linq; -using NUnit.Framework; -using Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy; - -namespace Orchard.Tests.DisplayManagement.Descriptors { - [TestFixture] - public class BasicShapeTemplateHarvesterTests { - private static void VerifyShapeType(string givenSubPath, string givenFileName, string expectedShapeType) { - var harvester = new BasicShapeTemplateHarvester(); - var harvestShapeHits = harvester.HarvestShape(new HarvestShapeInfo { SubPath = givenSubPath, FileName = givenFileName }); - Assert.That(harvestShapeHits.Count(), Is.EqualTo(1)); - Assert.That(harvestShapeHits.Single().ShapeType, Is.EqualTo(expectedShapeType).IgnoreCase); - } - - [Test] - public void BasicFileNamesComeBackAsShapes() { - VerifyShapeType("Views", "Hello", "Hello"); - VerifyShapeType("Views", "World", "World"); - } - - [Test] - public void DashBecomesBreakingSeperator() { - VerifyShapeType("Views", "Hello-World", "Hello__World"); - } - - [Test] - public void DotBecomesNonBreakingSeperator() { - VerifyShapeType("Views", "Hello.World", "Hello_World"); - } - - - [Test] - public void DefaultItemsContentTemplate() { - VerifyShapeType("Views/Items", "Content", "Content"); - } - - [Test] - public void ImplicitSpecializationOfItemsContentTemplate() { - VerifyShapeType("Views/Items", "MyType", "MyType"); - } - - [Test] - public void ExplicitSpecializationOfItemsContentTemplate() { - VerifyShapeType("Views/Items", "Content-MyType", "Content__MyType"); - } - - [Test] - public void ContentItemDisplayTypes() { - VerifyShapeType("Views/Items", "Content", "Content"); - VerifyShapeType("Views/Items", "Content.Summary", "Content_Summary"); - VerifyShapeType("Views/Items", "Content.Edit", "Content_Edit"); - } - - [Test] - public void ExplicitSpecializationMixedWithDisplayTypes() { - VerifyShapeType("Views/Items", "Content-MyType", "Content__MyType"); - VerifyShapeType("Views/Items", "Content-MyType.Summary", "Content_Summary__MyType"); - VerifyShapeType("Views/Items", "Content-MyType.Edit", "Content_Edit__MyType"); - } - - [Test] - public void DefaultItemsContentTemplate2() { - VerifyShapeType("Views", "Content", "Content"); - } - - [Test] - public void ImplicitSpecializationOfItemsContentTemplate2() { - VerifyShapeType("Views", "MyType", "MyType"); - } - - [Test] - public void ExplicitSpecializationOfItemsContentTemplate2() { - VerifyShapeType("Views", "Content-MyType", "Content__MyType"); - } - - [Test] - public void ContentItemDisplayTypes2() { - VerifyShapeType("Views", "Content", "Content"); - VerifyShapeType("Views", "Content.Summary", "Content_Summary"); - VerifyShapeType("Views", "Content.Edit", "Content_Edit"); - } - - [Test] - public void ExplicitSpecializationMixedWithDisplayTypes2() { - VerifyShapeType("Views", "Content-MyType", "Content__MyType"); - VerifyShapeType("Views", "Content-MyType.Summary", "Content_Summary__MyType"); - VerifyShapeType("Views", "Content-MyType.Edit", "Content_Edit__MyType"); - } - - [Test] - public void MultipleDotsAreNormalizedToUnderscore() { - VerifyShapeType("Views/Parts", "Common.Body", "Parts_Common_Body"); - VerifyShapeType("Views/Parts", "Common.Body.Summary", "Parts_Common_Body_Summary"); - VerifyShapeType("Views/Parts", "Localization.ContentTranslations.Summary", "Parts_Localization_ContentTranslations_Summary"); - } - - [Test] - public void MultipleDotsAreNormalizedToUnderscore2() { - VerifyShapeType("Views", "Parts.Common.Body", "Parts_Common_Body"); - VerifyShapeType("Views", "Parts.Common.Body.Summary", "Parts_Common_Body_Summary"); - VerifyShapeType("Views", "Parts.Localization.ContentTranslations.Summary", "Parts_Localization_ContentTranslations_Summary"); - } - - [Test] - public void FieldNamesMayBeInSubfolderOrPrefixed() { - VerifyShapeType("Views/Fields", "Common.Text", "Fields_Common_Text"); - VerifyShapeType("Views", "Fields.Common.Text", "Fields_Common_Text"); - } - - [Test] - public void FieldNamesMayHaveLongOrShortAlternates() { - VerifyShapeType("Views/Fields", "Common.Text-FirstName", "Fields_Common_Text__FirstName"); - VerifyShapeType("Views/Fields", "Common.Text-FirstName.SpecialCase", "Fields_Common_Text_SpecialCase__FirstName"); - VerifyShapeType("Views/Fields", "Common.Text-FirstName-MyContentType", "Fields_Common_Text__FirstName__MyContentType"); - - VerifyShapeType("Views", "Fields.Common.Text-FirstName", "Fields_Common_Text__FirstName"); - VerifyShapeType("Views", "Fields.Common.Text-FirstName.SpecialCase", "Fields_Common_Text_SpecialCase__FirstName"); - VerifyShapeType("Views", "Fields.Common.Text-FirstName-MyContentType", "Fields_Common_Text__FirstName__MyContentType"); - } - } -} +using System.Linq; +using NUnit.Framework; +using Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy; + +namespace Orchard.Tests.DisplayManagement.Descriptors { + [TestFixture] + public class BasicShapeTemplateHarvesterTests { + private static void VerifyShapeType(string givenSubPath, string givenFileName, string expectedShapeType) { + var harvester = new BasicShapeTemplateHarvester(); + var harvestShapeHits = harvester.HarvestShape(new HarvestShapeInfo { SubPath = givenSubPath, FileName = givenFileName }); + Assert.That(harvestShapeHits.Count(), Is.EqualTo(1)); + Assert.That(harvestShapeHits.Single().ShapeType, Is.EqualTo(expectedShapeType).IgnoreCase); + } + + [Test] + public void BasicFileNamesComeBackAsShapes() { + VerifyShapeType("Views", "Hello", "Hello"); + VerifyShapeType("Views", "World", "World"); + } + + [Test] + public void DashBecomesBreakingSeperator() { + VerifyShapeType("Views", "Hello-World", "Hello__World"); + } + + [Test] + public void DotBecomesNonBreakingSeperator() { + VerifyShapeType("Views", "Hello.World", "Hello_World"); + } + + + [Test] + public void DefaultItemsContentTemplate() { + VerifyShapeType("Views/Items", "Content", "Content"); + } + + [Test] + public void ImplicitSpecializationOfItemsContentTemplate() { + VerifyShapeType("Views/Items", "MyType", "MyType"); + } + + [Test] + public void ExplicitSpecializationOfItemsContentTemplate() { + VerifyShapeType("Views/Items", "Content-MyType", "Content__MyType"); + } + + [Test] + public void ContentItemDisplayTypes() { + VerifyShapeType("Views/Items", "Content", "Content"); + VerifyShapeType("Views/Items", "Content.Summary", "Content_Summary"); + VerifyShapeType("Views/Items", "Content.Edit", "Content_Edit"); + } + + [Test] + public void ExplicitSpecializationMixedWithDisplayTypes() { + VerifyShapeType("Views/Items", "Content-MyType", "Content__MyType"); + VerifyShapeType("Views/Items", "Content-MyType.Summary", "Content_Summary__MyType"); + VerifyShapeType("Views/Items", "Content-MyType.Edit", "Content_Edit__MyType"); + } + + [Test] + public void DefaultItemsContentTemplate2() { + VerifyShapeType("Views", "Content", "Content"); + } + + [Test] + public void ImplicitSpecializationOfItemsContentTemplate2() { + VerifyShapeType("Views", "MyType", "MyType"); + } + + [Test] + public void ExplicitSpecializationOfItemsContentTemplate2() { + VerifyShapeType("Views", "Content-MyType", "Content__MyType"); + } + + [Test] + public void ContentItemDisplayTypes2() { + VerifyShapeType("Views", "Content", "Content"); + VerifyShapeType("Views", "Content.Summary", "Content_Summary"); + VerifyShapeType("Views", "Content.Edit", "Content_Edit"); + } + + [Test] + public void ExplicitSpecializationMixedWithDisplayTypes2() { + VerifyShapeType("Views", "Content-MyType", "Content__MyType"); + VerifyShapeType("Views", "Content-MyType.Summary", "Content_Summary__MyType"); + VerifyShapeType("Views", "Content-MyType.Edit", "Content_Edit__MyType"); + } + + [Test] + public void MultipleDotsAreNormalizedToUnderscore() { + VerifyShapeType("Views/Parts", "Common.Body", "Parts_Common_Body"); + VerifyShapeType("Views/Parts", "Common.Body.Summary", "Parts_Common_Body_Summary"); + VerifyShapeType("Views/Parts", "Localization.ContentTranslations.Summary", "Parts_Localization_ContentTranslations_Summary"); + } + + [Test] + public void MultipleDotsAreNormalizedToUnderscore2() { + VerifyShapeType("Views", "Parts.Common.Body", "Parts_Common_Body"); + VerifyShapeType("Views", "Parts.Common.Body.Summary", "Parts_Common_Body_Summary"); + VerifyShapeType("Views", "Parts.Localization.ContentTranslations.Summary", "Parts_Localization_ContentTranslations_Summary"); + } + + [Test] + public void FieldNamesMayBeInSubfolderOrPrefixed() { + VerifyShapeType("Views/Fields", "Common.Text", "Fields_Common_Text"); + VerifyShapeType("Views", "Fields.Common.Text", "Fields_Common_Text"); + } + + [Test] + public void FieldNamesMayHaveLongOrShortAlternates() { + VerifyShapeType("Views/Fields", "Common.Text-FirstName", "Fields_Common_Text__FirstName"); + VerifyShapeType("Views/Fields", "Common.Text-FirstName.SpecialCase", "Fields_Common_Text_SpecialCase__FirstName"); + VerifyShapeType("Views/Fields", "Common.Text-FirstName-MyContentType", "Fields_Common_Text__FirstName__MyContentType"); + + VerifyShapeType("Views", "Fields.Common.Text-FirstName", "Fields_Common_Text__FirstName"); + VerifyShapeType("Views", "Fields.Common.Text-FirstName.SpecialCase", "Fields_Common_Text_SpecialCase__FirstName"); + VerifyShapeType("Views", "Fields.Common.Text-FirstName-MyContentType", "Fields_Common_Text__FirstName__MyContentType"); + } + } +} diff --git a/src/Orchard.Tests/DisplayManagement/Descriptors/DefaultShapeTableManagerTests.cs b/src/Orchard.Tests/DisplayManagement/Descriptors/DefaultShapeTableManagerTests.cs index 0d30b6b8a96..5f2f210ba32 100644 --- a/src/Orchard.Tests/DisplayManagement/Descriptors/DefaultShapeTableManagerTests.cs +++ b/src/Orchard.Tests/DisplayManagement/Descriptors/DefaultShapeTableManagerTests.cs @@ -1,296 +1,296 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Autofac; -using Moq; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.ContentManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.DisplayManagement.Descriptors.ShapePlacementStrategy; -using Orchard.DisplayManagement.Implementation; -using Orchard.Environment.Extensions; -using Orchard.Environment.Extensions.Models; -using Orchard.Tests.Stubs; -using Orchard.UI.PageClass; - -namespace Orchard.Tests.DisplayManagement.Descriptors { - [TestFixture] - public class DefaultShapeTableManagerTests : ContainerTestBase { - protected override void Register(ContainerBuilder builder) { - builder.RegisterInstance(new Orchard.Environment.Work>(resolve => _container.Resolve>())).AsSelf(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - var features = new [] { - new FeatureDescriptor { - Id = "Theme1", - Extension = new ExtensionDescriptor { - Id = "Theme1", - ExtensionType = DefaultExtensionTypes.Theme - } - }, - new FeatureDescriptor { - Id = "DerivedTheme", - Extension = new ExtensionDescriptor { - Id = "DerivedTheme", - ExtensionType = DefaultExtensionTypes.Theme, - BaseTheme = "BaseTheme" - } - }, - new FeatureDescriptor { - Id = "BaseTheme", - Extension = new ExtensionDescriptor { - Id = "BaseTheme", - ExtensionType = DefaultExtensionTypes.Theme - } - } - }; - builder.RegisterInstance(new TestExtensionManager(features)); - - TestShapeProvider.FeatureShapes = new Dictionary> { - { TestFeature(), new [] {"Hello"} }, - { Feature(features[0]), new [] {"Theme1Shape"} }, - { Feature(features[1]), new [] {"DerivedShape", "OverriddenShape"} }, - { Feature(features[2]), new [] {"BaseShape", "OverriddenShape"} } - }; - - builder.RegisterType().As() - .As() - .InstancePerLifetimeScope(); - - builder.RegisterInstance(new Mock().Object); - builder.RegisterType().As(); - } - - static Feature Feature(FeatureDescriptor descriptor) { - return new Feature { - Descriptor = descriptor - }; - } - - static Feature TestFeature() { - return new Feature { - Descriptor = new FeatureDescriptor { - Id = "Testing", - Dependencies = Enumerable.Empty(), - Extension = new ExtensionDescriptor { - Id = "Testing", - ExtensionType = DefaultExtensionTypes.Module, - } - } - }; - } - - public class TestExtensionManager : IExtensionManager { - private readonly IEnumerable _availableFeautures; - - public TestExtensionManager(IEnumerable availableFeautures) { - _availableFeautures = availableFeautures; - } - - public ExtensionDescriptor GetExtension(string name) { - throw new NotImplementedException(); - } - - public IEnumerable AvailableExtensions() { - throw new NotSupportedException(); - } - - public IEnumerable AvailableFeatures() { - return _availableFeautures; - } - - public IEnumerable LoadFeatures(IEnumerable featureDescriptors) { - throw new NotSupportedException(); - } - } - - public class TestShapeProvider : IShapeTableProvider { - public static IDictionary> FeatureShapes; - - public Action Discover = x => { }; - - void IShapeTableProvider.Discover(ShapeTableBuilder builder) { - foreach (var pair in FeatureShapes) { - foreach (var shape in pair.Value) { - builder.Describe(shape).From(pair.Key).BoundAs(pair.Key.Descriptor.Id, null); - } - } - Discover(builder); - } - } - - [Test] - public void ManagerCanBeResolved() { - var manager = _container.Resolve(); - Assert.That(manager, Is.Not.Null); - } - - [Test] - public void DefaultShapeTableIsReturnedForNullOrEmpty() { - var manager = _container.Resolve(); - var shapeTable1 = manager.GetShapeTable(null); - var shapeTable2 = manager.GetShapeTable(string.Empty); - Assert.That(shapeTable1.Descriptors["Hello"], Is.Not.Null); - Assert.That(shapeTable2.Descriptors["Hello"], Is.Not.Null); - } - - [Test] - public void CallbackAlterationsContributeToDescriptor() { - Action cb1 = x => { }; - Action cb2 = x => { }; - Action cb3 = x => { }; - Action cb4 = x => { }; - - _container.Resolve().Discover = - builder => builder.Describe("Foo").From(TestFeature()) - .OnCreating(cb1) - .OnCreated(cb2) - .OnDisplaying(cb3) - .OnDisplayed(cb4); - - var manager = _container.Resolve(); - - var foo = manager.GetShapeTable(null).Descriptors["Foo"]; - - Assert.That(foo.Creating.Single(), Is.SameAs(cb1)); - Assert.That(foo.Created.Single(), Is.SameAs(cb2)); - Assert.That(foo.Displaying.Single(), Is.SameAs(cb3)); - Assert.That(foo.Displayed.Single(), Is.SameAs(cb4)); - } - [Test] - public void DefaultPlacementIsReturnedByDefault() { - var manager = _container.Resolve(); - - var hello = manager.GetShapeTable(null).Descriptors["Hello"]; - hello.DefaultPlacement = "Header:5"; - var result = hello.Placement(null); - Assert.That(result.Location, Is.EqualTo("Header:5")); - } - - [Test] - public void DescribedPlacementIsReturnedIfNotNull() { - - _container.Resolve().Discover = - builder => builder.Describe("Hello").From(TestFeature()) - .Placement(ctx => ctx.DisplayType == "Detail" ? new PlacementInfo { Location = "Main" } : null) - .Placement(ctx => ctx.DisplayType == "Summary" ? new PlacementInfo { Location = "" } : null); - - var manager = _container.Resolve(); - var hello = manager.GetShapeTable(null).Descriptors["Hello"]; - var result1 = hello.Placement(new ShapePlacementContext { DisplayType = "Detail" }); - var result2 = hello.Placement(new ShapePlacementContext { DisplayType = "Summary" }); - var result3 = hello.Placement(new ShapePlacementContext { DisplayType = "Tile" }); - hello.DefaultPlacement = "Header:5"; - var result4 = hello.Placement(new ShapePlacementContext { DisplayType = "Detail" }); - var result5 = hello.Placement(new ShapePlacementContext { DisplayType = "Summary" }); - var result6 = hello.Placement(new ShapePlacementContext { DisplayType = "Tile" }); - - Assert.That(result1.Location, Is.EqualTo("Main")); - Assert.That(result2.Location, Is.EqualTo("")); - Assert.That(result3.Location, Is.Null); - Assert.That(result4.Location, Is.EqualTo("Main")); - Assert.That(result5.Location, Is.EqualTo("")); - Assert.That(result6.Location, Is.EqualTo("Header:5")); - } - - [Test] - public void TwoArgumentVariationDoesSameThing() { - - _container.Resolve().Discover = - builder => builder.Describe("Hello").From(TestFeature()) - .Placement(ctx => ctx.DisplayType == "Detail", new PlacementInfo { Location = "Main" }) - .Placement(ctx => ctx.DisplayType == "Summary", new PlacementInfo { Location = "" }); - - var manager = _container.Resolve(); - var hello = manager.GetShapeTable(null).Descriptors["Hello"]; - var result1 = hello.Placement(new ShapePlacementContext { DisplayType = "Detail" }); - var result2 = hello.Placement(new ShapePlacementContext { DisplayType = "Summary" }); - var result3 = hello.Placement(new ShapePlacementContext { DisplayType = "Tile" }); - hello.DefaultPlacement = "Header:5"; - var result4 = hello.Placement(new ShapePlacementContext { DisplayType = "Detail" }); - var result5 = hello.Placement(new ShapePlacementContext { DisplayType = "Summary" }); - var result6 = hello.Placement(new ShapePlacementContext { DisplayType = "Tile" }); - - Assert.That(result1.Location, Is.EqualTo("Main")); - Assert.That(result2.Location, Is.EqualTo("")); - Assert.That(result3.Location, Is.Null); - Assert.That(result4.Location, Is.EqualTo("Main")); - Assert.That(result5.Location, Is.EqualTo("")); - Assert.That(result6.Location, Is.EqualTo("Header:5")); - } - - [Test] - public void PathConstraintShouldMatch() { - - // all path have a trailing / as per the current implementation - // todo: (sebros) find a way to 'use' the current implementation in DefaultContentDisplay.BindPlacement instead of emulating it - - var rules = new[] { - Tuple.Create("~/my-blog", "~/my-blog/", true), - Tuple.Create("~/my-blog/", "~/my-blog/", true), - - // star match - Tuple.Create("~/my-blog*", "~/my-blog/", true), - Tuple.Create("~/my-blog*", "~/my-blog/my-post/", true), - Tuple.Create("~/my-blog/*", "~/my-blog/", true), - Tuple.Create("~/my-blog/*", "~/my-blog123/", false), - Tuple.Create("~/my-blog*", "~/my-blog123/", true) - }; - - foreach (var rule in rules) { - var path = rule.Item1; - var context = rule.Item2; - var match = rule.Item3; - - _container.Resolve().Discover = - builder => builder.Describe("Hello").From(TestFeature()) - .Placement(ShapePlacementParsingStrategy.BuildPredicate(c => true, new KeyValuePair("Path", path)), new PlacementInfo { Location = "Match" }); - - var manager = _container.Resolve(); - var hello = manager.GetShapeTable(null).Descriptors["Hello"]; - var result = hello.Placement(new ShapePlacementContext {Path = context}); - - if (match) { - Assert.That(result.Location, Is.EqualTo("Match"), String.Format("{0}|{1}", path, context)); - } - else { - Assert.That(result.Location, Is.Null, String.Format("{0}|{1}", path, context)); - } - } - } - - [Test] - public void OnlyShapesFromTheGivenThemeAreProvided() { - _container.Resolve(); - var manager = _container.Resolve(); - var table = manager.GetShapeTable("Theme1"); - Assert.IsTrue(table.Descriptors.ContainsKey("Theme1Shape")); - Assert.IsFalse(table.Descriptors.ContainsKey("DerivedShape")); - Assert.IsFalse(table.Descriptors.ContainsKey("BaseShape")); - } - - [Test] - public void ShapesFromTheBaseThemeAreProvided() { - _container.Resolve(); - var manager = _container.Resolve(); - var table = manager.GetShapeTable("DerivedTheme"); - Assert.IsFalse(table.Descriptors.ContainsKey("Theme1Shape")); - Assert.IsTrue(table.Descriptors.ContainsKey("DerivedShape")); - Assert.IsTrue(table.Descriptors.ContainsKey("BaseShape")); - } - - [Test] - public void DerivedThemesCanOverrideBaseThemeShapeBindings() { - _container.Resolve(); - var manager = _container.Resolve(); - var table = manager.GetShapeTable("DerivedTheme"); - Assert.IsTrue(table.Bindings.ContainsKey("OverriddenShape")); - Assert.AreEqual("DerivedTheme", table.Descriptors["OverriddenShape"].BindingSource); - } - - - } +using System; +using System.Collections.Generic; +using System.Linq; +using Autofac; +using Moq; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.ContentManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.DisplayManagement.Descriptors.ShapePlacementStrategy; +using Orchard.DisplayManagement.Implementation; +using Orchard.Environment.Extensions; +using Orchard.Environment.Extensions.Models; +using Orchard.Tests.Stubs; +using Orchard.UI.PageClass; + +namespace Orchard.Tests.DisplayManagement.Descriptors { + [TestFixture] + public class DefaultShapeTableManagerTests : ContainerTestBase { + protected override void Register(ContainerBuilder builder) { + builder.RegisterInstance(new Orchard.Environment.Work>(resolve => _container.Resolve>())).AsSelf(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + var features = new [] { + new FeatureDescriptor { + Id = "Theme1", + Extension = new ExtensionDescriptor { + Id = "Theme1", + ExtensionType = DefaultExtensionTypes.Theme + } + }, + new FeatureDescriptor { + Id = "DerivedTheme", + Extension = new ExtensionDescriptor { + Id = "DerivedTheme", + ExtensionType = DefaultExtensionTypes.Theme, + BaseTheme = "BaseTheme" + } + }, + new FeatureDescriptor { + Id = "BaseTheme", + Extension = new ExtensionDescriptor { + Id = "BaseTheme", + ExtensionType = DefaultExtensionTypes.Theme + } + } + }; + builder.RegisterInstance(new TestExtensionManager(features)); + + TestShapeProvider.FeatureShapes = new Dictionary> { + { TestFeature(), new [] {"Hello"} }, + { Feature(features[0]), new [] {"Theme1Shape"} }, + { Feature(features[1]), new [] {"DerivedShape", "OverriddenShape"} }, + { Feature(features[2]), new [] {"BaseShape", "OverriddenShape"} } + }; + + builder.RegisterType().As() + .As() + .InstancePerLifetimeScope(); + + builder.RegisterInstance(new Mock().Object); + builder.RegisterType().As(); + } + + static Feature Feature(FeatureDescriptor descriptor) { + return new Feature { + Descriptor = descriptor + }; + } + + static Feature TestFeature() { + return new Feature { + Descriptor = new FeatureDescriptor { + Id = "Testing", + Dependencies = Enumerable.Empty(), + Extension = new ExtensionDescriptor { + Id = "Testing", + ExtensionType = DefaultExtensionTypes.Module, + } + } + }; + } + + public class TestExtensionManager : IExtensionManager { + private readonly IEnumerable _availableFeautures; + + public TestExtensionManager(IEnumerable availableFeautures) { + _availableFeautures = availableFeautures; + } + + public ExtensionDescriptor GetExtension(string name) { + throw new NotImplementedException(); + } + + public IEnumerable AvailableExtensions() { + throw new NotSupportedException(); + } + + public IEnumerable AvailableFeatures() { + return _availableFeautures; + } + + public IEnumerable LoadFeatures(IEnumerable featureDescriptors) { + throw new NotSupportedException(); + } + } + + public class TestShapeProvider : IShapeTableProvider { + public static IDictionary> FeatureShapes; + + public Action Discover = x => { }; + + void IShapeTableProvider.Discover(ShapeTableBuilder builder) { + foreach (var pair in FeatureShapes) { + foreach (var shape in pair.Value) { + builder.Describe(shape).From(pair.Key).BoundAs(pair.Key.Descriptor.Id, null); + } + } + Discover(builder); + } + } + + [Test] + public void ManagerCanBeResolved() { + var manager = _container.Resolve(); + Assert.That(manager, Is.Not.Null); + } + + [Test] + public void DefaultShapeTableIsReturnedForNullOrEmpty() { + var manager = _container.Resolve(); + var shapeTable1 = manager.GetShapeTable(null); + var shapeTable2 = manager.GetShapeTable(string.Empty); + Assert.That(shapeTable1.Descriptors["Hello"], Is.Not.Null); + Assert.That(shapeTable2.Descriptors["Hello"], Is.Not.Null); + } + + [Test] + public void CallbackAlterationsContributeToDescriptor() { + Action cb1 = x => { }; + Action cb2 = x => { }; + Action cb3 = x => { }; + Action cb4 = x => { }; + + _container.Resolve().Discover = + builder => builder.Describe("Foo").From(TestFeature()) + .OnCreating(cb1) + .OnCreated(cb2) + .OnDisplaying(cb3) + .OnDisplayed(cb4); + + var manager = _container.Resolve(); + + var foo = manager.GetShapeTable(null).Descriptors["Foo"]; + + Assert.That(foo.Creating.Single(), Is.SameAs(cb1)); + Assert.That(foo.Created.Single(), Is.SameAs(cb2)); + Assert.That(foo.Displaying.Single(), Is.SameAs(cb3)); + Assert.That(foo.Displayed.Single(), Is.SameAs(cb4)); + } + [Test] + public void DefaultPlacementIsReturnedByDefault() { + var manager = _container.Resolve(); + + var hello = manager.GetShapeTable(null).Descriptors["Hello"]; + hello.DefaultPlacement = "Header:5"; + var result = hello.Placement(null); + Assert.That(result.Location, Is.EqualTo("Header:5")); + } + + [Test] + public void DescribedPlacementIsReturnedIfNotNull() { + + _container.Resolve().Discover = + builder => builder.Describe("Hello").From(TestFeature()) + .Placement(ctx => ctx.DisplayType == "Detail" ? new PlacementInfo { Location = "Main" } : null) + .Placement(ctx => ctx.DisplayType == "Summary" ? new PlacementInfo { Location = "" } : null); + + var manager = _container.Resolve(); + var hello = manager.GetShapeTable(null).Descriptors["Hello"]; + var result1 = hello.Placement(new ShapePlacementContext { DisplayType = "Detail" }); + var result2 = hello.Placement(new ShapePlacementContext { DisplayType = "Summary" }); + var result3 = hello.Placement(new ShapePlacementContext { DisplayType = "Tile" }); + hello.DefaultPlacement = "Header:5"; + var result4 = hello.Placement(new ShapePlacementContext { DisplayType = "Detail" }); + var result5 = hello.Placement(new ShapePlacementContext { DisplayType = "Summary" }); + var result6 = hello.Placement(new ShapePlacementContext { DisplayType = "Tile" }); + + Assert.That(result1.Location, Is.EqualTo("Main")); + Assert.That(result2.Location, Is.EqualTo("")); + Assert.That(result3.Location, Is.Null); + Assert.That(result4.Location, Is.EqualTo("Main")); + Assert.That(result5.Location, Is.EqualTo("")); + Assert.That(result6.Location, Is.EqualTo("Header:5")); + } + + [Test] + public void TwoArgumentVariationDoesSameThing() { + + _container.Resolve().Discover = + builder => builder.Describe("Hello").From(TestFeature()) + .Placement(ctx => ctx.DisplayType == "Detail", new PlacementInfo { Location = "Main" }) + .Placement(ctx => ctx.DisplayType == "Summary", new PlacementInfo { Location = "" }); + + var manager = _container.Resolve(); + var hello = manager.GetShapeTable(null).Descriptors["Hello"]; + var result1 = hello.Placement(new ShapePlacementContext { DisplayType = "Detail" }); + var result2 = hello.Placement(new ShapePlacementContext { DisplayType = "Summary" }); + var result3 = hello.Placement(new ShapePlacementContext { DisplayType = "Tile" }); + hello.DefaultPlacement = "Header:5"; + var result4 = hello.Placement(new ShapePlacementContext { DisplayType = "Detail" }); + var result5 = hello.Placement(new ShapePlacementContext { DisplayType = "Summary" }); + var result6 = hello.Placement(new ShapePlacementContext { DisplayType = "Tile" }); + + Assert.That(result1.Location, Is.EqualTo("Main")); + Assert.That(result2.Location, Is.EqualTo("")); + Assert.That(result3.Location, Is.Null); + Assert.That(result4.Location, Is.EqualTo("Main")); + Assert.That(result5.Location, Is.EqualTo("")); + Assert.That(result6.Location, Is.EqualTo("Header:5")); + } + + [Test] + public void PathConstraintShouldMatch() { + + // all path have a trailing / as per the current implementation + // todo: (sebros) find a way to 'use' the current implementation in DefaultContentDisplay.BindPlacement instead of emulating it + + var rules = new[] { + Tuple.Create("~/my-blog", "~/my-blog/", true), + Tuple.Create("~/my-blog/", "~/my-blog/", true), + + // star match + Tuple.Create("~/my-blog*", "~/my-blog/", true), + Tuple.Create("~/my-blog*", "~/my-blog/my-post/", true), + Tuple.Create("~/my-blog/*", "~/my-blog/", true), + Tuple.Create("~/my-blog/*", "~/my-blog123/", false), + Tuple.Create("~/my-blog*", "~/my-blog123/", true) + }; + + foreach (var rule in rules) { + var path = rule.Item1; + var context = rule.Item2; + var match = rule.Item3; + + _container.Resolve().Discover = + builder => builder.Describe("Hello").From(TestFeature()) + .Placement(ShapePlacementParsingStrategy.BuildPredicate(c => true, new KeyValuePair("Path", path)), new PlacementInfo { Location = "Match" }); + + var manager = _container.Resolve(); + var hello = manager.GetShapeTable(null).Descriptors["Hello"]; + var result = hello.Placement(new ShapePlacementContext {Path = context}); + + if (match) { + Assert.That(result.Location, Is.EqualTo("Match"), String.Format("{0}|{1}", path, context)); + } + else { + Assert.That(result.Location, Is.Null, String.Format("{0}|{1}", path, context)); + } + } + } + + [Test] + public void OnlyShapesFromTheGivenThemeAreProvided() { + _container.Resolve(); + var manager = _container.Resolve(); + var table = manager.GetShapeTable("Theme1"); + Assert.IsTrue(table.Descriptors.ContainsKey("Theme1Shape")); + Assert.IsFalse(table.Descriptors.ContainsKey("DerivedShape")); + Assert.IsFalse(table.Descriptors.ContainsKey("BaseShape")); + } + + [Test] + public void ShapesFromTheBaseThemeAreProvided() { + _container.Resolve(); + var manager = _container.Resolve(); + var table = manager.GetShapeTable("DerivedTheme"); + Assert.IsFalse(table.Descriptors.ContainsKey("Theme1Shape")); + Assert.IsTrue(table.Descriptors.ContainsKey("DerivedShape")); + Assert.IsTrue(table.Descriptors.ContainsKey("BaseShape")); + } + + [Test] + public void DerivedThemesCanOverrideBaseThemeShapeBindings() { + _container.Resolve(); + var manager = _container.Resolve(); + var table = manager.GetShapeTable("DerivedTheme"); + Assert.IsTrue(table.Bindings.ContainsKey("OverriddenShape")); + Assert.AreEqual("DerivedTheme", table.Descriptors["OverriddenShape"].BindingSource); + } + + + } } \ No newline at end of file diff --git a/src/Orchard.Tests/DisplayManagement/Descriptors/InMemoryWebSiteFolder.cs b/src/Orchard.Tests/DisplayManagement/Descriptors/InMemoryWebSiteFolder.cs index 315ea32f568..30251f7b352 100644 --- a/src/Orchard.Tests/DisplayManagement/Descriptors/InMemoryWebSiteFolder.cs +++ b/src/Orchard.Tests/DisplayManagement/Descriptors/InMemoryWebSiteFolder.cs @@ -1,52 +1,52 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Orchard.Caching; -using Orchard.FileSystems.WebSite; - -namespace Orchard.Tests.DisplayManagement.Descriptors { - public class InMemoryWebSiteFolder : IWebSiteFolder { - public InMemoryWebSiteFolder() { - Contents = new Dictionary(StringComparer.OrdinalIgnoreCase); - } - - public IDictionary Contents { get; set; } - - public IEnumerable ListDirectories(string virtualPath) { - throw new NotImplementedException(); - } - - public IEnumerable ListFiles(string virtualPath, bool recursive) { - throw new NotImplementedException(); - } - - public bool FileExists(string virtualPath) { - throw new NotImplementedException(); - } - - public string ReadFile(string virtualPath) { - string result; - return Contents.TryGetValue(virtualPath, out result) ? result : null; - } - - public string ReadFile(string virtualPath, bool actualContent) { - throw new NotImplementedException(); - } - - public void CopyFileTo(string virtualPath, Stream destination) { - throw new NotImplementedException(); - } - - public void CopyFileTo(string virtualPath, Stream destination, bool actualContent) { - throw new NotImplementedException(); - } - - public IVolatileToken WhenPathChanges(string virtualPath) { - return new Token { IsCurrent = true }; - } - - public class Token : IVolatileToken { - public bool IsCurrent { get; set; } - } - } +using System; +using System.Collections.Generic; +using System.IO; +using Orchard.Caching; +using Orchard.FileSystems.WebSite; + +namespace Orchard.Tests.DisplayManagement.Descriptors { + public class InMemoryWebSiteFolder : IWebSiteFolder { + public InMemoryWebSiteFolder() { + Contents = new Dictionary(StringComparer.OrdinalIgnoreCase); + } + + public IDictionary Contents { get; set; } + + public IEnumerable ListDirectories(string virtualPath) { + throw new NotImplementedException(); + } + + public IEnumerable ListFiles(string virtualPath, bool recursive) { + throw new NotImplementedException(); + } + + public bool FileExists(string virtualPath) { + throw new NotImplementedException(); + } + + public string ReadFile(string virtualPath) { + string result; + return Contents.TryGetValue(virtualPath, out result) ? result : null; + } + + public string ReadFile(string virtualPath, bool actualContent) { + throw new NotImplementedException(); + } + + public void CopyFileTo(string virtualPath, Stream destination) { + throw new NotImplementedException(); + } + + public void CopyFileTo(string virtualPath, Stream destination, bool actualContent) { + throw new NotImplementedException(); + } + + public IVolatileToken WhenPathChanges(string virtualPath) { + return new Token { IsCurrent = true }; + } + + public class Token : IVolatileToken { + public bool IsCurrent { get; set; } + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/DisplayManagement/Descriptors/PlacementFileParserTests.cs b/src/Orchard.Tests/DisplayManagement/Descriptors/PlacementFileParserTests.cs index 187a355f548..ef806a42b74 100644 --- a/src/Orchard.Tests/DisplayManagement/Descriptors/PlacementFileParserTests.cs +++ b/src/Orchard.Tests/DisplayManagement/Descriptors/PlacementFileParserTests.cs @@ -1,92 +1,92 @@ -using System.Linq; -using Autofac; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.DisplayManagement.Descriptors.ShapePlacementStrategy; -using Orchard.FileSystems.WebSite; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.DisplayManagement.Descriptors { - [TestFixture] - public class PlacementFileParserTests : ContainerTestBase { - private IPlacementFileParser _parser; - private InMemoryWebSiteFolder _folder; - - protected override void Register(Autofac.ContainerBuilder builder) { - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As() - .As().InstancePerLifetimeScope(); - } - - - protected override void Resolve(ILifetimeScope container) { - _parser = container.Resolve(); - _folder = container.Resolve(); - } - - [Test] - public void ParsingMissingFileIsNull() { - var result = _parser.Parse("~/hello.xml"); - Assert.That(result, Is.Null); - } - - [Test] - public void ParsingEmptyFileAsNothing() { - _folder.Contents["~/hello.xml"] = ""; - var result = _parser.Parse("~/hello.xml"); - Assert.That(result, Is.Not.Null); - Assert.That(result.Nodes, Is.Not.Null); - Assert.That(result.Nodes.Count(), Is.EqualTo(0)); - } - - [Test] - public void ItemsComeBackAsPlacementNodes() { - _folder.Contents["~/hello.xml"] = @" - - - - -"; - var result = _parser.Parse("~/hello.xml"); - Assert.That(result, Is.Not.Null); - Assert.That(result.Nodes, Is.Not.Null); - Assert.That(result.Nodes.Count(), Is.EqualTo(2)); - } - - - [Test] - public void NestedItemsComeBackAsNestedNodes() { - _folder.Contents["~/hello.xml"] = @" - - - - - - -"; - var result = _parser.Parse("~/hello.xml"); - Assert.That(result, Is.Not.Null); - Assert.That(result.Nodes, Is.Not.Null); - Assert.That(result.Nodes.Count(), Is.EqualTo(2)); - Assert.That(result.Nodes.First().Nodes.Count(), Is.EqualTo(1)); - Assert.That(result.Nodes.Last().Nodes.Count(), Is.EqualTo(0)); - } - - [Test] - public void EachPlaceAttributeIsShapeLocation() { - _folder.Contents["~/hello.xml"] = @" - -"; - var result = _parser.Parse("~/hello.xml"); - Assert.That(result, Is.Not.Null); - Assert.That(result.Nodes, Is.Not.Null); - Assert.That(result.Nodes.Count(), Is.EqualTo(2)); - var foo = result.Nodes.OfType().Single(x=>x.ShapeType == "Foo"); - var bar = result.Nodes.OfType().Single(x=>x.ShapeType == "Bar"); - Assert.That(foo.Location, Is.EqualTo("Header")); - Assert.That(bar.Location, Is.EqualTo("Content:after")); - } - } -} +using System.Linq; +using Autofac; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.DisplayManagement.Descriptors.ShapePlacementStrategy; +using Orchard.FileSystems.WebSite; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.DisplayManagement.Descriptors { + [TestFixture] + public class PlacementFileParserTests : ContainerTestBase { + private IPlacementFileParser _parser; + private InMemoryWebSiteFolder _folder; + + protected override void Register(Autofac.ContainerBuilder builder) { + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As() + .As().InstancePerLifetimeScope(); + } + + + protected override void Resolve(ILifetimeScope container) { + _parser = container.Resolve(); + _folder = container.Resolve(); + } + + [Test] + public void ParsingMissingFileIsNull() { + var result = _parser.Parse("~/hello.xml"); + Assert.That(result, Is.Null); + } + + [Test] + public void ParsingEmptyFileAsNothing() { + _folder.Contents["~/hello.xml"] = ""; + var result = _parser.Parse("~/hello.xml"); + Assert.That(result, Is.Not.Null); + Assert.That(result.Nodes, Is.Not.Null); + Assert.That(result.Nodes.Count(), Is.EqualTo(0)); + } + + [Test] + public void ItemsComeBackAsPlacementNodes() { + _folder.Contents["~/hello.xml"] = @" + + + + +"; + var result = _parser.Parse("~/hello.xml"); + Assert.That(result, Is.Not.Null); + Assert.That(result.Nodes, Is.Not.Null); + Assert.That(result.Nodes.Count(), Is.EqualTo(2)); + } + + + [Test] + public void NestedItemsComeBackAsNestedNodes() { + _folder.Contents["~/hello.xml"] = @" + + + + + + +"; + var result = _parser.Parse("~/hello.xml"); + Assert.That(result, Is.Not.Null); + Assert.That(result.Nodes, Is.Not.Null); + Assert.That(result.Nodes.Count(), Is.EqualTo(2)); + Assert.That(result.Nodes.First().Nodes.Count(), Is.EqualTo(1)); + Assert.That(result.Nodes.Last().Nodes.Count(), Is.EqualTo(0)); + } + + [Test] + public void EachPlaceAttributeIsShapeLocation() { + _folder.Contents["~/hello.xml"] = @" + +"; + var result = _parser.Parse("~/hello.xml"); + Assert.That(result, Is.Not.Null); + Assert.That(result.Nodes, Is.Not.Null); + Assert.That(result.Nodes.Count(), Is.EqualTo(2)); + var foo = result.Nodes.OfType().Single(x=>x.ShapeType == "Foo"); + var bar = result.Nodes.OfType().Single(x=>x.ShapeType == "Bar"); + Assert.That(foo.Location, Is.EqualTo("Header")); + Assert.That(bar.Location, Is.EqualTo("Content:after")); + } + } +} diff --git a/src/Orchard.Tests/DisplayManagement/Descriptors/ShapeAttributeBindingStrategyTests.cs b/src/Orchard.Tests/DisplayManagement/Descriptors/ShapeAttributeBindingStrategyTests.cs index 2509200757f..ef434fd9760 100644 --- a/src/Orchard.Tests/DisplayManagement/Descriptors/ShapeAttributeBindingStrategyTests.cs +++ b/src/Orchard.Tests/DisplayManagement/Descriptors/ShapeAttributeBindingStrategyTests.cs @@ -1,119 +1,119 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web.Routing; -using Autofac; -using JetBrains.Annotations; -using Moq; -using NUnit.Framework; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.DisplayManagement.Descriptors.ShapeAttributeStrategy; -using Orchard.DisplayManagement.Implementation; -using Orchard.Environment; -using Orchard.Environment.Extensions.Models; -using Orchard.Tests.Utility; - -namespace Orchard.Tests.DisplayManagement.Descriptors { - [TestFixture] - public class ShapeAttributeBindingStrategyTests : ContainerTestBase { - private Feature _testFeature; - - protected override void Register([NotNull] ContainerBuilder builder) { - if (builder == null) { - throw new ArgumentNullException("builder"); - } - builder.RegisterAutoMocking(); - _testFeature = new Feature { - Descriptor = new FeatureDescriptor { - Id = "Testing", - Extension = new ExtensionDescriptor { - Id = "Testing", - ExtensionType = DefaultExtensionTypes.Module, - } - } - }; - builder.RegisterType().As(); - builder.RegisterInstance(new TestProvider()).WithMetadata("Feature", _testFeature); - builder.RegisterInstance(new RouteCollection()); - builder.RegisterModule(new ShapeAttributeBindingModule()); - } - - protected override void Resolve(ILifetimeScope container) { - // implementation resorts to orchard host to resolve "current scope" services - container.Resolve>() - .Setup(x => x.Resolve()) - .Returns(container); - } - - class TestProvider { - [Shape] - public string Simple() { - return "Simple"; - } - - [Shape("Renamed")] - public string RenamedMethod() { - return "Renamed"; - } - } - - static IEnumerable GetAlterationBuilders(IShapeTableProvider strategy) { - var builder = new ShapeTableBuilder(null); - strategy.Discover(builder); - return builder.BuildAlterations(); - } - - [Test] - public void ShapeAttributeOccurrencesAreDetected() { - var occurrences = _container.Resolve>(); - Assert.That(occurrences.Any(o => o.MethodInfo == typeof(TestProvider).GetMethod("Simple"))); - } - - [Test] - public void InitializersHaveExpectedShapeTypeNames() { - var strategy = _container.Resolve(); - var initializers = GetAlterationBuilders(strategy); - Assert.That(initializers.Any(i => i.ShapeType == "Simple")); - Assert.That(initializers.Any(i => i.ShapeType == "Renamed")); - Assert.That(initializers.Any(i => i.ShapeType == "RenamedMethod"), Is.False); - } - - [Test] - public void FeatureMetadataIsDetected() { - var strategy = _container.Resolve(); - var initializers = GetAlterationBuilders(strategy); - Assert.That(initializers.All(i => i.Feature == _testFeature)); - } - - [Test] - public void LifetimeScopeContainersHaveMetadata() { - var strategy = _container.Resolve(); - var initializers = GetAlterationBuilders(strategy); - Assert.That(initializers.Any(i => i.ShapeType == "Simple")); - - var childContainer = _container.BeginLifetimeScope(); - - var strategy2 = childContainer.Resolve(); - var initializers2 = GetAlterationBuilders(strategy2); - Assert.That(initializers2.Any(i => i.ShapeType == "Simple")); - - Assert.That(strategy, Is.Not.SameAs(strategy2)); - } - - [Test] - public void BindingProvidedByStrategyInvokesMethod() { - var initializers = GetAlterationBuilders(_container.Resolve()); - - var shapeDescriptor = initializers.Where(i => i.ShapeType == "Simple") - .Aggregate(new ShapeDescriptor { ShapeType = "Simple" }, (d, i) => { i.Alter(d); return d; }); - - var displayContext = new DisplayContext(); - var result = shapeDescriptor.Binding(displayContext); - var result2 = shapeDescriptor.Binding.Invoke(displayContext); - Assert.That(result.ToString(), Is.StringContaining("Simple")); - Assert.That(result2.ToString(), Is.StringContaining("Simple")); - } - - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web.Routing; +using Autofac; +using JetBrains.Annotations; +using Moq; +using NUnit.Framework; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.DisplayManagement.Descriptors.ShapeAttributeStrategy; +using Orchard.DisplayManagement.Implementation; +using Orchard.Environment; +using Orchard.Environment.Extensions.Models; +using Orchard.Tests.Utility; + +namespace Orchard.Tests.DisplayManagement.Descriptors { + [TestFixture] + public class ShapeAttributeBindingStrategyTests : ContainerTestBase { + private Feature _testFeature; + + protected override void Register([NotNull] ContainerBuilder builder) { + if (builder == null) { + throw new ArgumentNullException("builder"); + } + builder.RegisterAutoMocking(); + _testFeature = new Feature { + Descriptor = new FeatureDescriptor { + Id = "Testing", + Extension = new ExtensionDescriptor { + Id = "Testing", + ExtensionType = DefaultExtensionTypes.Module, + } + } + }; + builder.RegisterType().As(); + builder.RegisterInstance(new TestProvider()).WithMetadata("Feature", _testFeature); + builder.RegisterInstance(new RouteCollection()); + builder.RegisterModule(new ShapeAttributeBindingModule()); + } + + protected override void Resolve(ILifetimeScope container) { + // implementation resorts to orchard host to resolve "current scope" services + container.Resolve>() + .Setup(x => x.Resolve()) + .Returns(container); + } + + class TestProvider { + [Shape] + public string Simple() { + return "Simple"; + } + + [Shape("Renamed")] + public string RenamedMethod() { + return "Renamed"; + } + } + + static IEnumerable GetAlterationBuilders(IShapeTableProvider strategy) { + var builder = new ShapeTableBuilder(null); + strategy.Discover(builder); + return builder.BuildAlterations(); + } + + [Test] + public void ShapeAttributeOccurrencesAreDetected() { + var occurrences = _container.Resolve>(); + Assert.That(occurrences.Any(o => o.MethodInfo == typeof(TestProvider).GetMethod("Simple"))); + } + + [Test] + public void InitializersHaveExpectedShapeTypeNames() { + var strategy = _container.Resolve(); + var initializers = GetAlterationBuilders(strategy); + Assert.That(initializers.Any(i => i.ShapeType == "Simple")); + Assert.That(initializers.Any(i => i.ShapeType == "Renamed")); + Assert.That(initializers.Any(i => i.ShapeType == "RenamedMethod"), Is.False); + } + + [Test] + public void FeatureMetadataIsDetected() { + var strategy = _container.Resolve(); + var initializers = GetAlterationBuilders(strategy); + Assert.That(initializers.All(i => i.Feature == _testFeature)); + } + + [Test] + public void LifetimeScopeContainersHaveMetadata() { + var strategy = _container.Resolve(); + var initializers = GetAlterationBuilders(strategy); + Assert.That(initializers.Any(i => i.ShapeType == "Simple")); + + var childContainer = _container.BeginLifetimeScope(); + + var strategy2 = childContainer.Resolve(); + var initializers2 = GetAlterationBuilders(strategy2); + Assert.That(initializers2.Any(i => i.ShapeType == "Simple")); + + Assert.That(strategy, Is.Not.SameAs(strategy2)); + } + + [Test] + public void BindingProvidedByStrategyInvokesMethod() { + var initializers = GetAlterationBuilders(_container.Resolve()); + + var shapeDescriptor = initializers.Where(i => i.ShapeType == "Simple") + .Aggregate(new ShapeDescriptor { ShapeType = "Simple" }, (d, i) => { i.Alter(d); return d; }); + + var displayContext = new DisplayContext(); + var result = shapeDescriptor.Binding(displayContext); + var result2 = shapeDescriptor.Binding.Invoke(displayContext); + Assert.That(result.ToString(), Is.StringContaining("Simple")); + Assert.That(result2.ToString(), Is.StringContaining("Simple")); + } + + } +} diff --git a/src/Orchard.Tests/DisplayManagement/Descriptors/StylesheetBindingStrategyTests.cs b/src/Orchard.Tests/DisplayManagement/Descriptors/StylesheetBindingStrategyTests.cs index d66d7868b3e..2ff3a87a9a8 100644 --- a/src/Orchard.Tests/DisplayManagement/Descriptors/StylesheetBindingStrategyTests.cs +++ b/src/Orchard.Tests/DisplayManagement/Descriptors/StylesheetBindingStrategyTests.cs @@ -1,174 +1,174 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Autofac; -using Moq; -using NUnit.Framework; -using Orchard.DisplayManagement.Descriptors; -using Orchard.DisplayManagement.Descriptors.ResourceBindingStrategy; -using Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy; -using Orchard.Environment.Descriptor.Models; -using Orchard.Environment.Extensions; -using Orchard.Environment.Extensions.Models; -using Orchard.FileSystems.VirtualPath; - -namespace Orchard.Tests.DisplayManagement.Descriptors { - [TestFixture] - public class StylesheetBindingStrategyTests : ContainerTestBase { - private ShellDescriptor _descriptor; - private IList _features; - private TestViewEngine _testViewEngine; - private TestVirtualPathProvider _testVirtualPathProvider; - - - protected override void Register(Autofac.ContainerBuilder builder) { - _descriptor = new ShellDescriptor { }; - _testViewEngine = new TestViewEngine(); - _testVirtualPathProvider = new TestVirtualPathProvider { TestViewEngine = _testViewEngine }; - - builder.Register(ctx => _descriptor); - builder.RegisterType().As(); - builder.RegisterInstance(_testViewEngine).As(); - builder.RegisterInstance(_testVirtualPathProvider).As(); - - var extensionManager = new Mock(); - builder.Register(ctx => extensionManager); - builder.Register(ctx => extensionManager.Object); - } - - public class TestViewEngine : Dictionary, IShapeTemplateViewEngine { - public IEnumerable DetectTemplateFileNames(IEnumerable fileNames) { - return fileNames; - } - } - - public class TestVirtualPathProvider : IVirtualPathProvider { - public TestViewEngine TestViewEngine { get; set; } - - public string Combine(params string[] paths) { - throw new NotImplementedException(); - } - - public string ToAppRelative(string virtualPath) { - throw new NotImplementedException(); - } - - public string MapPath(string virtualPath) { - throw new NotImplementedException(); - } - - public bool FileExists(string virtualPath) { - throw new NotImplementedException(); - } - - public Stream OpenFile(string virtualPath) { - throw new NotImplementedException(); - } - - public StreamWriter CreateText(string virtualPath) { - throw new NotImplementedException(); - } - - public Stream CreateFile(string virtualPath) { - throw new NotImplementedException(); - } - - public DateTime GetFileLastWriteTimeUtc(string virtualPath) { - throw new NotImplementedException(); - } - - public string GetFileHash(string virtualPath) { - throw new NotImplementedException(); - } - - public string GetFileHash(string virtualPath, IEnumerable dependencies) { - throw new NotImplementedException(); - } - - public void DeleteFile(string virtualPath) { - throw new NotImplementedException(); - } - - public bool DirectoryExists(string virtualPath) { - throw new NotImplementedException(); - } - - public void CreateDirectory(string virtualPath) { - throw new NotImplementedException(); - } - - public string GetDirectoryName(string virtualPath) { - throw new NotImplementedException(); - } - - public void DeleteDirectory(string virtualPath) { - throw new NotImplementedException(); - } - - public IEnumerable ListFiles(string path) { - return TestViewEngine.Keys.Select(o => o.ToString()); - } - - public IEnumerable ListDirectories(string path) { - throw new NotImplementedException(); - } - - public bool TryFileExists(string virtualPath) { - throw new NotImplementedException(); - } - } - - protected override void Resolve(ILifetimeScope container) { - _features = new List(); - - container.Resolve>() - .Setup(em => em.AvailableFeatures()) - .Returns(_features); - } - - void AddFeature(string name, params string[] dependencies) { - var featureDescriptor = new FeatureDescriptor { - Id = name, - Dependencies = dependencies, - Extension = new ExtensionDescriptor { - Id = name, - Location = "~/Modules" - } - }; - featureDescriptor.Extension.Features = new[] { featureDescriptor }; - - _features.Add(featureDescriptor); - } - - void AddEnabledFeature(string name, params string[] dependencies) { - AddFeature(name, dependencies); - _descriptor.Features = _descriptor.Features.Concat(new[] { new ShellFeature { Name = name } }); - } - - [Test] - public void TemplateResolutionWorks() { - AddEnabledFeature("Alpha"); - - _testViewEngine.Add("~/Modules/Alpha/Styles/AlphaShape.css", null); - _testViewEngine.Add("~/Modules/Alpha/Styles/alpha-shape.css", null); - var strategy = _container.Resolve(); - - var builder = new ShapeTableBuilder(null); - strategy.Discover(builder); - var alterations = builder.BuildAlterations(); - - Assert.That(alterations.Any(alteration => alteration.ShapeType == "Style")); - - var descriptor = new ShapeDescriptor { ShapeType = "Style" }; - alterations.Aggregate(descriptor, (d, alteration) => { - alteration.Alter(d); - return d; - }); - - var keys = descriptor.Bindings.Select(b => b.Key); - Assert.That(keys.Count() == keys.Select(k => k.ToLowerInvariant()).Distinct().Count(), "Descriptors should never vary by case only."); - } - - } -} +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Autofac; +using Moq; +using NUnit.Framework; +using Orchard.DisplayManagement.Descriptors; +using Orchard.DisplayManagement.Descriptors.ResourceBindingStrategy; +using Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy; +using Orchard.Environment.Descriptor.Models; +using Orchard.Environment.Extensions; +using Orchard.Environment.Extensions.Models; +using Orchard.FileSystems.VirtualPath; + +namespace Orchard.Tests.DisplayManagement.Descriptors { + [TestFixture] + public class StylesheetBindingStrategyTests : ContainerTestBase { + private ShellDescriptor _descriptor; + private IList _features; + private TestViewEngine _testViewEngine; + private TestVirtualPathProvider _testVirtualPathProvider; + + + protected override void Register(Autofac.ContainerBuilder builder) { + _descriptor = new ShellDescriptor { }; + _testViewEngine = new TestViewEngine(); + _testVirtualPathProvider = new TestVirtualPathProvider { TestViewEngine = _testViewEngine }; + + builder.Register(ctx => _descriptor); + builder.RegisterType().As(); + builder.RegisterInstance(_testViewEngine).As(); + builder.RegisterInstance(_testVirtualPathProvider).As(); + + var extensionManager = new Mock(); + builder.Register(ctx => extensionManager); + builder.Register(ctx => extensionManager.Object); + } + + public class TestViewEngine : Dictionary, IShapeTemplateViewEngine { + public IEnumerable DetectTemplateFileNames(IEnumerable fileNames) { + return fileNames; + } + } + + public class TestVirtualPathProvider : IVirtualPathProvider { + public TestViewEngine TestViewEngine { get; set; } + + public string Combine(params string[] paths) { + throw new NotImplementedException(); + } + + public string ToAppRelative(string virtualPath) { + throw new NotImplementedException(); + } + + public string MapPath(string virtualPath) { + throw new NotImplementedException(); + } + + public bool FileExists(string virtualPath) { + throw new NotImplementedException(); + } + + public Stream OpenFile(string virtualPath) { + throw new NotImplementedException(); + } + + public StreamWriter CreateText(string virtualPath) { + throw new NotImplementedException(); + } + + public Stream CreateFile(string virtualPath) { + throw new NotImplementedException(); + } + + public DateTime GetFileLastWriteTimeUtc(string virtualPath) { + throw new NotImplementedException(); + } + + public string GetFileHash(string virtualPath) { + throw new NotImplementedException(); + } + + public string GetFileHash(string virtualPath, IEnumerable dependencies) { + throw new NotImplementedException(); + } + + public void DeleteFile(string virtualPath) { + throw new NotImplementedException(); + } + + public bool DirectoryExists(string virtualPath) { + throw new NotImplementedException(); + } + + public void CreateDirectory(string virtualPath) { + throw new NotImplementedException(); + } + + public string GetDirectoryName(string virtualPath) { + throw new NotImplementedException(); + } + + public void DeleteDirectory(string virtualPath) { + throw new NotImplementedException(); + } + + public IEnumerable ListFiles(string path) { + return TestViewEngine.Keys.Select(o => o.ToString()); + } + + public IEnumerable ListDirectories(string path) { + throw new NotImplementedException(); + } + + public bool TryFileExists(string virtualPath) { + throw new NotImplementedException(); + } + } + + protected override void Resolve(ILifetimeScope container) { + _features = new List(); + + container.Resolve>() + .Setup(em => em.AvailableFeatures()) + .Returns(_features); + } + + void AddFeature(string name, params string[] dependencies) { + var featureDescriptor = new FeatureDescriptor { + Id = name, + Dependencies = dependencies, + Extension = new ExtensionDescriptor { + Id = name, + Location = "~/Modules" + } + }; + featureDescriptor.Extension.Features = new[] { featureDescriptor }; + + _features.Add(featureDescriptor); + } + + void AddEnabledFeature(string name, params string[] dependencies) { + AddFeature(name, dependencies); + _descriptor.Features = _descriptor.Features.Concat(new[] { new ShellFeature { Name = name } }); + } + + [Test] + public void TemplateResolutionWorks() { + AddEnabledFeature("Alpha"); + + _testViewEngine.Add("~/Modules/Alpha/Styles/AlphaShape.css", null); + _testViewEngine.Add("~/Modules/Alpha/Styles/alpha-shape.css", null); + var strategy = _container.Resolve(); + + var builder = new ShapeTableBuilder(null); + strategy.Discover(builder); + var alterations = builder.BuildAlterations(); + + Assert.That(alterations.Any(alteration => alteration.ShapeType == "Style")); + + var descriptor = new ShapeDescriptor { ShapeType = "Style" }; + alterations.Aggregate(descriptor, (d, alteration) => { + alteration.Alter(d); + return d; + }); + + var keys = descriptor.Bindings.Select(b => b.Key); + Assert.That(keys.Count() == keys.Select(k => k.ToLowerInvariant()).Distinct().Count(), "Descriptors should never vary by case only."); + } + + } +} diff --git a/src/Orchard.Tests/DisplayManagement/NilTests.cs b/src/Orchard.Tests/DisplayManagement/NilTests.cs index 47a1cd24c14..1f87ed7cb36 100644 --- a/src/Orchard.Tests/DisplayManagement/NilTests.cs +++ b/src/Orchard.Tests/DisplayManagement/NilTests.cs @@ -1,47 +1,47 @@ -using NUnit.Framework; -using Orchard.DisplayManagement.Shapes; - -namespace Orchard.Tests.DisplayManagement { - [TestFixture] - public class NilTests { - - [Test] - public void NilShouldEqualToNull() { - var nil = Nil.Instance; - - Assert.That(nil == null, Is.True); - Assert.That(nil != null, Is.False); - - Assert.That(nil == Nil.Instance, Is.True); - Assert.That(nil != Nil.Instance, Is.False); - } - - [Test] - public void NilShouldBeRecursive() { - dynamic nil = Nil.Instance; - - Assert.That(nil == null, Is.True); - Assert.That(nil.Foo == null, Is.True); - Assert.That(nil.Foo.Bar == null, Is.True); - } - - - [Test] - public void CallingToStringOnNilShouldReturnEmpty() { - var nil = Nil.Instance; - Assert.That(nil.ToString(), Is.EqualTo("")); - } - - [Test] - public void CallingToStringOnDynamicNilShouldReturnEmpty() { - dynamic nil = Nil.Instance; - Assert.That(nil.Foo.Bar.ToString(), Is.EqualTo("")); - } - - [Test] - public void ConvertingToStringShouldReturnNullString() { - dynamic nil = Nil.Instance; - Assert.That((string)nil == null, Is.True); - } - } -} +using NUnit.Framework; +using Orchard.DisplayManagement.Shapes; + +namespace Orchard.Tests.DisplayManagement { + [TestFixture] + public class NilTests { + + [Test] + public void NilShouldEqualToNull() { + var nil = Nil.Instance; + + Assert.That(nil == null, Is.True); + Assert.That(nil != null, Is.False); + + Assert.That(nil == Nil.Instance, Is.True); + Assert.That(nil != Nil.Instance, Is.False); + } + + [Test] + public void NilShouldBeRecursive() { + dynamic nil = Nil.Instance; + + Assert.That(nil == null, Is.True); + Assert.That(nil.Foo == null, Is.True); + Assert.That(nil.Foo.Bar == null, Is.True); + } + + + [Test] + public void CallingToStringOnNilShouldReturnEmpty() { + var nil = Nil.Instance; + Assert.That(nil.ToString(), Is.EqualTo("")); + } + + [Test] + public void CallingToStringOnDynamicNilShouldReturnEmpty() { + dynamic nil = Nil.Instance; + Assert.That(nil.Foo.Bar.ToString(), Is.EqualTo("")); + } + + [Test] + public void ConvertingToStringShouldReturnNullString() { + dynamic nil = Nil.Instance; + Assert.That((string)nil == null, Is.True); + } + } +} diff --git a/src/Orchard.Tests/DisplayManagement/ShapeFactoryTests.cs b/src/Orchard.Tests/DisplayManagement/ShapeFactoryTests.cs index 2ab0049f9a6..155026b34b2 100644 --- a/src/Orchard.Tests/DisplayManagement/ShapeFactoryTests.cs +++ b/src/Orchard.Tests/DisplayManagement/ShapeFactoryTests.cs @@ -1,81 +1,81 @@ -using System.Collections.Generic; -using Autofac; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.DisplayManagement.Implementation; -using Orchard.DisplayManagement.Shapes; -using Orchard.Environment.Extensions; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.DisplayManagement { - [TestFixture] - public class ShapeFactoryTests { - private IContainer _container; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - builder.RegisterType().As(); - builder.RegisterInstance(new Orchard.Environment.Work>(resolve => _container.Resolve>())).AsSelf(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - _container = builder.Build(); - } - - - [Test] - public void ShapeHasAttributesType() { - var factory = _container.Resolve(); - dynamic foo = factory.Create("Foo", ArgsUtility.Empty()); - ShapeMetadata metadata = foo.Metadata; - Assert.That(metadata.Type, Is.EqualTo("Foo")); - } - - [Test] - public void CreateShapeWithNamedArguments() { - var factory = _container.Resolve(); - dynamic foo = factory.Create("Foo", ArgsUtility.Named(new { one = 1, two = "dos" })); - Assert.That(foo.one, Is.EqualTo(1)); - Assert.That(foo.two, Is.EqualTo("dos")); - } - - [Test] - public void CallSyntax() { - dynamic factory = _container.Resolve(); - var foo = factory.Foo(); - ShapeMetadata metadata = foo.Metadata; - Assert.That(metadata.Type, Is.EqualTo("Foo")); - } - - [Test] - public void CallInitializer() { - dynamic factory = _container.Resolve(); - var bar = new {One = 1, Two = "two"}; - var foo = factory.Foo(bar); - - Assert.That(foo.One, Is.EqualTo(1)); - Assert.That(foo.Two, Is.EqualTo("two")); - } - - [Test] - public void CallInitializerWithBaseType() { - dynamic factory = _container.Resolve(); - var bar = new { One = 1, Two = "two" }; - var foo = factory.Foo(typeof(MyShape), bar); - - Assert.That(foo, Is.InstanceOf()); - Assert.That(foo.One, Is.EqualTo(1)); - Assert.That(foo.Two, Is.EqualTo("two")); - } - - public class MyShape : Shape { - public string Kind { get; set; } - } - - } -} +using System.Collections.Generic; +using Autofac; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.DisplayManagement.Implementation; +using Orchard.DisplayManagement.Shapes; +using Orchard.Environment.Extensions; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.DisplayManagement { + [TestFixture] + public class ShapeFactoryTests { + private IContainer _container; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + builder.RegisterInstance(new Orchard.Environment.Work>(resolve => _container.Resolve>())).AsSelf(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + _container = builder.Build(); + } + + + [Test] + public void ShapeHasAttributesType() { + var factory = _container.Resolve(); + dynamic foo = factory.Create("Foo", ArgsUtility.Empty()); + ShapeMetadata metadata = foo.Metadata; + Assert.That(metadata.Type, Is.EqualTo("Foo")); + } + + [Test] + public void CreateShapeWithNamedArguments() { + var factory = _container.Resolve(); + dynamic foo = factory.Create("Foo", ArgsUtility.Named(new { one = 1, two = "dos" })); + Assert.That(foo.one, Is.EqualTo(1)); + Assert.That(foo.two, Is.EqualTo("dos")); + } + + [Test] + public void CallSyntax() { + dynamic factory = _container.Resolve(); + var foo = factory.Foo(); + ShapeMetadata metadata = foo.Metadata; + Assert.That(metadata.Type, Is.EqualTo("Foo")); + } + + [Test] + public void CallInitializer() { + dynamic factory = _container.Resolve(); + var bar = new {One = 1, Two = "two"}; + var foo = factory.Foo(bar); + + Assert.That(foo.One, Is.EqualTo(1)); + Assert.That(foo.Two, Is.EqualTo("two")); + } + + [Test] + public void CallInitializerWithBaseType() { + dynamic factory = _container.Resolve(); + var bar = new { One = 1, Two = "two" }; + var foo = factory.Foo(typeof(MyShape), bar); + + Assert.That(foo, Is.InstanceOf()); + Assert.That(foo.One, Is.EqualTo(1)); + Assert.That(foo.Two, Is.EqualTo("two")); + } + + public class MyShape : Shape { + public string Kind { get; set; } + } + + } +} diff --git a/src/Orchard.Tests/DisplayManagement/ShapeHelperTests.cs b/src/Orchard.Tests/DisplayManagement/ShapeHelperTests.cs index 149016c0dfd..8b978e06edf 100644 --- a/src/Orchard.Tests/DisplayManagement/ShapeHelperTests.cs +++ b/src/Orchard.Tests/DisplayManagement/ShapeHelperTests.cs @@ -1,61 +1,61 @@ -using System.Collections.Generic; -using Autofac; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.DisplayManagement.Implementation; -using Orchard.Environment.Extensions; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.DisplayManagement { - [TestFixture] - public class ShapeHelperTests { - private IContainer _container; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - builder.RegisterType().As(); - builder.RegisterInstance(new Orchard.Environment.Work>(resolve => _container.Resolve>())).AsSelf(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - _container = builder.Build(); - - } - - [Test] - public void CreatingNewShapeTypeByName() { - dynamic shape = _container.Resolve(); - - var alpha = shape.Alpha(); - - Assert.That(alpha.Metadata.Type, Is.EqualTo("Alpha")); - } - - [Test] - public void CreatingShapeWithAdditionalNamedParameters() { - dynamic shape = _container.Resolve(); - - var alpha = shape.Alpha(one: 1, two: "dos"); - - Assert.That(alpha.Metadata.Type, Is.EqualTo("Alpha")); - Assert.That(alpha.one, Is.EqualTo(1)); - Assert.That(alpha.two, Is.EqualTo("dos")); - } - - [Test] - public void WithPropertyBearingObjectInsteadOfNamedParameters() { - dynamic shape = _container.Resolve(); - - var alpha = shape.Alpha(new { one = 1, two = "dos" }); - - Assert.That(alpha.Metadata.Type, Is.EqualTo("Alpha")); - Assert.That(alpha.one, Is.EqualTo(1)); - Assert.That(alpha.two, Is.EqualTo("dos")); - } - } -} +using System.Collections.Generic; +using Autofac; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.DisplayManagement.Implementation; +using Orchard.Environment.Extensions; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.DisplayManagement { + [TestFixture] + public class ShapeHelperTests { + private IContainer _container; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + builder.RegisterInstance(new Orchard.Environment.Work>(resolve => _container.Resolve>())).AsSelf(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + _container = builder.Build(); + + } + + [Test] + public void CreatingNewShapeTypeByName() { + dynamic shape = _container.Resolve(); + + var alpha = shape.Alpha(); + + Assert.That(alpha.Metadata.Type, Is.EqualTo("Alpha")); + } + + [Test] + public void CreatingShapeWithAdditionalNamedParameters() { + dynamic shape = _container.Resolve(); + + var alpha = shape.Alpha(one: 1, two: "dos"); + + Assert.That(alpha.Metadata.Type, Is.EqualTo("Alpha")); + Assert.That(alpha.one, Is.EqualTo(1)); + Assert.That(alpha.two, Is.EqualTo("dos")); + } + + [Test] + public void WithPropertyBearingObjectInsteadOfNamedParameters() { + dynamic shape = _container.Resolve(); + + var alpha = shape.Alpha(new { one = 1, two = "dos" }); + + Assert.That(alpha.Metadata.Type, Is.EqualTo("Alpha")); + Assert.That(alpha.one, Is.EqualTo(1)); + Assert.That(alpha.two, Is.EqualTo("dos")); + } + } +} diff --git a/src/Orchard.Tests/DisplayManagement/SubsystemTests.cs b/src/Orchard.Tests/DisplayManagement/SubsystemTests.cs index 2597738a50a..470f03c6809 100644 --- a/src/Orchard.Tests/DisplayManagement/SubsystemTests.cs +++ b/src/Orchard.Tests/DisplayManagement/SubsystemTests.cs @@ -1,94 +1,94 @@ -using System.Collections.Generic; -using System.Web; -using System.Web.Mvc; -using System.Web.Routing; -using Autofac; -using Moq; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.DisplayManagement.Descriptors.ShapeAttributeStrategy; -using Orchard.DisplayManagement.Implementation; -using Orchard.DisplayManagement.Shapes; -using Orchard.Environment; -using Orchard.Environment.Extensions.Models; -using Orchard.Tests.Stubs; -using Orchard.Tests.Utility; - -namespace Orchard.Tests.DisplayManagement { - [TestFixture] - public class SubsystemTests { - private IContainer _container; - - [SetUp] - public void Init() { - var testFeature = new Feature - { - Descriptor = new FeatureDescriptor - { - Id = "Testing", - Extension = new ExtensionDescriptor - { - Id = "Testing", - ExtensionType = DefaultExtensionTypes.Module, - } - } - }; - - var workContext = new DefaultDisplayManagerTests.TestWorkContext - { - CurrentTheme = new ExtensionDescriptor { Id = "Hello" } - }; - - var builder = new ContainerBuilder(); - builder.RegisterModule(new ShapeAttributeBindingModule()); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new Work>(resolve => _container.Resolve>())).AsSelf(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new DefaultDisplayManagerTests.TestWorkContextAccessor(workContext)).As(); - builder.RegisterInstance(new SimpleShapes()).WithMetadata("Feature", testFeature); - builder.RegisterInstance(new RouteCollection()); - builder.RegisterAutoMocking(MockBehavior.Loose); - - _container = builder.Build(); - _container.Resolve>() - .Setup(x => x.Resolve()) - .Returns(_container); - } - - public class SimpleShapes { - [Shape] - public IHtmlString Something() { - return new HtmlString("
      "); - } - - [Shape] - public IHtmlString Pager() { - return new HtmlString("
      hello
      "); - } - } - - [Test] - public void RenderingSomething() { - dynamic displayHelperFactory = _container.Resolve().CreateHelper(new ViewContext(), null); - dynamic shapeHelperFactory = _container.Resolve(); - - var result1 = displayHelperFactory.Something(); - var result2 = ((DisplayHelper)displayHelperFactory).ShapeExecute(shapeHelperFactory.Pager()); - var result3 = ((DisplayHelper)displayHelperFactory).ShapeExecute((Shape)shapeHelperFactory.Pager()); - - displayHelperFactory(shapeHelperFactory.Pager()); - - Assert.That(result1.ToString(), Is.EqualTo("
      ")); - Assert.That(result2.ToString(), Is.EqualTo("
      hello
      ")); - Assert.That(result3.ToString(), Is.EqualTo("
      hello
      ")); - } - } +using System.Collections.Generic; +using System.Web; +using System.Web.Mvc; +using System.Web.Routing; +using Autofac; +using Moq; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.DisplayManagement.Descriptors.ShapeAttributeStrategy; +using Orchard.DisplayManagement.Implementation; +using Orchard.DisplayManagement.Shapes; +using Orchard.Environment; +using Orchard.Environment.Extensions.Models; +using Orchard.Tests.Stubs; +using Orchard.Tests.Utility; + +namespace Orchard.Tests.DisplayManagement { + [TestFixture] + public class SubsystemTests { + private IContainer _container; + + [SetUp] + public void Init() { + var testFeature = new Feature + { + Descriptor = new FeatureDescriptor + { + Id = "Testing", + Extension = new ExtensionDescriptor + { + Id = "Testing", + ExtensionType = DefaultExtensionTypes.Module, + } + } + }; + + var workContext = new DefaultDisplayManagerTests.TestWorkContext + { + CurrentTheme = new ExtensionDescriptor { Id = "Hello" } + }; + + var builder = new ContainerBuilder(); + builder.RegisterModule(new ShapeAttributeBindingModule()); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new Work>(resolve => _container.Resolve>())).AsSelf(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new DefaultDisplayManagerTests.TestWorkContextAccessor(workContext)).As(); + builder.RegisterInstance(new SimpleShapes()).WithMetadata("Feature", testFeature); + builder.RegisterInstance(new RouteCollection()); + builder.RegisterAutoMocking(MockBehavior.Loose); + + _container = builder.Build(); + _container.Resolve>() + .Setup(x => x.Resolve()) + .Returns(_container); + } + + public class SimpleShapes { + [Shape] + public IHtmlString Something() { + return new HtmlString("
      "); + } + + [Shape] + public IHtmlString Pager() { + return new HtmlString("
      hello
      "); + } + } + + [Test] + public void RenderingSomething() { + dynamic displayHelperFactory = _container.Resolve().CreateHelper(new ViewContext(), null); + dynamic shapeHelperFactory = _container.Resolve(); + + var result1 = displayHelperFactory.Something(); + var result2 = ((DisplayHelper)displayHelperFactory).ShapeExecute(shapeHelperFactory.Pager()); + var result3 = ((DisplayHelper)displayHelperFactory).ShapeExecute((Shape)shapeHelperFactory.Pager()); + + displayHelperFactory(shapeHelperFactory.Pager()); + + Assert.That(result1.ToString(), Is.EqualTo("
      ")); + Assert.That(result2.ToString(), Is.EqualTo("
      hello
      ")); + Assert.That(result3.ToString(), Is.EqualTo("
      hello
      ")); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/DisplayManagement/ZoneHoldingTests.cs b/src/Orchard.Tests/DisplayManagement/ZoneHoldingTests.cs index a2796992010..68765fa06ea 100644 --- a/src/Orchard.Tests/DisplayManagement/ZoneHoldingTests.cs +++ b/src/Orchard.Tests/DisplayManagement/ZoneHoldingTests.cs @@ -1,92 +1,92 @@ -using System; -using NUnit.Framework; -using Orchard.DisplayManagement.Shapes; -using Orchard.UI.Zones; - -namespace Orchard.Tests.DisplayManagement { - [TestFixture] - public class ZoneHoldingTests { - - [Test] - public void ZonesShouldReturn() { - Func factory = () => new Shape(); - - var foo = new ZoneHolding(factory); - Assert.That(foo.Zones, Is.InstanceOf()); - } - - [Test] - public void MemberShouldCreateAZone() { - Func factory = () => new Shape(); - - dynamic foo = new ZoneHolding(factory); - Assert.That(foo.Header, Is.InstanceOf()); - } - - [Test] - public void IndexShouldCreateAZone() { - Func factory = () => new Shape(); - - dynamic foo = new ZoneHolding(factory); - Assert.That(foo.Zones["Header"], Is.InstanceOf()); - } - - [Test] - public void ZonesMemberShouldCreateAZone() { - Func factory = () => new Shape(); - - dynamic foo = new ZoneHolding(factory); - Assert.That(foo.Zones.Header, Is.InstanceOf()); - } - - [Test] - public void ZonesShouldBeUnique() { - Func factory = () => new Shape(); - - dynamic foo = new ZoneHolding(factory); - var header = foo.Header; - - Assert.That(foo.Zones.Header, Is.EqualTo(header)); - Assert.That(foo.Zones["Header"], Is.EqualTo(header)); - Assert.That(foo.Header, Is.EqualTo(header)); - } - - - [Test] - public void EmptyZonesShouldBeNull() { - Func factory = () => new Shape(); - - dynamic foo = new ZoneHolding(factory); - - Assert.That(foo.Header == 1, Is.False); - Assert.That(foo.Header != 1, Is.True); - - dynamic header = foo.Header; - - Assert.That(header == null, Is.True); - Assert.That(header != null, Is.False); - - Assert.That(header == Nil.Instance, Is.True); - Assert.That(header != Nil.Instance, Is.False); - } - - [Test] - public void NoneEmptyZonesShouldNotBeNull() { - Func factory = () => new Shape(); - - dynamic foo = new ZoneHolding(factory); - - Assert.That(foo.Header == null, Is.True); - Assert.That(foo.Header != null, Is.False); - - foo.Header.Add("blah"); - - Assert.That(foo.Header == null, Is.False); - Assert.That(foo.Header != null, Is.True); - - Assert.That(foo.Header == Nil.Instance, Is.False); - Assert.That(foo.Header != Nil.Instance, Is.True); - } - - } -} +using System; +using NUnit.Framework; +using Orchard.DisplayManagement.Shapes; +using Orchard.UI.Zones; + +namespace Orchard.Tests.DisplayManagement { + [TestFixture] + public class ZoneHoldingTests { + + [Test] + public void ZonesShouldReturn() { + Func factory = () => new Shape(); + + var foo = new ZoneHolding(factory); + Assert.That(foo.Zones, Is.InstanceOf()); + } + + [Test] + public void MemberShouldCreateAZone() { + Func factory = () => new Shape(); + + dynamic foo = new ZoneHolding(factory); + Assert.That(foo.Header, Is.InstanceOf()); + } + + [Test] + public void IndexShouldCreateAZone() { + Func factory = () => new Shape(); + + dynamic foo = new ZoneHolding(factory); + Assert.That(foo.Zones["Header"], Is.InstanceOf()); + } + + [Test] + public void ZonesMemberShouldCreateAZone() { + Func factory = () => new Shape(); + + dynamic foo = new ZoneHolding(factory); + Assert.That(foo.Zones.Header, Is.InstanceOf()); + } + + [Test] + public void ZonesShouldBeUnique() { + Func factory = () => new Shape(); + + dynamic foo = new ZoneHolding(factory); + var header = foo.Header; + + Assert.That(foo.Zones.Header, Is.EqualTo(header)); + Assert.That(foo.Zones["Header"], Is.EqualTo(header)); + Assert.That(foo.Header, Is.EqualTo(header)); + } + + + [Test] + public void EmptyZonesShouldBeNull() { + Func factory = () => new Shape(); + + dynamic foo = new ZoneHolding(factory); + + Assert.That(foo.Header == 1, Is.False); + Assert.That(foo.Header != 1, Is.True); + + dynamic header = foo.Header; + + Assert.That(header == null, Is.True); + Assert.That(header != null, Is.False); + + Assert.That(header == Nil.Instance, Is.True); + Assert.That(header != Nil.Instance, Is.False); + } + + [Test] + public void NoneEmptyZonesShouldNotBeNull() { + Func factory = () => new Shape(); + + dynamic foo = new ZoneHolding(factory); + + Assert.That(foo.Header == null, Is.True); + Assert.That(foo.Header != null, Is.False); + + foo.Header.Add("blah"); + + Assert.That(foo.Header == null, Is.False); + Assert.That(foo.Header != null, Is.True); + + Assert.That(foo.Header == Nil.Instance, Is.False); + Assert.That(foo.Header != Nil.Instance, Is.True); + } + + } +} diff --git a/src/Orchard.Tests/Environment/AutofacUtil/AutofacTests.cs b/src/Orchard.Tests/Environment/AutofacUtil/AutofacTests.cs index a5677229036..3c5b0f7e7cb 100644 --- a/src/Orchard.Tests/Environment/AutofacUtil/AutofacTests.cs +++ b/src/Orchard.Tests/Environment/AutofacUtil/AutofacTests.cs @@ -1,37 +1,37 @@ -using System.Collections.Generic; -using System.Linq; -using Autofac; -using NUnit.Framework; - -namespace Orchard.Tests.Environment.AutofacUtil { - [TestFixture] - public class AutofacTests { - public interface IFoo { } - public class Foo1 : IFoo { } - public class Foo2 : IFoo { } - public class Foo3 : IFoo { } - - [Test(Description = "Exercises a problem in a previous version, to make sure older Autofac.dll isn't picked up")] - public void EnumerablesFromDifferentLifetimeScopesShouldReturnDifferentCollections() { - var rootBuilder = new ContainerBuilder(); - rootBuilder.RegisterType().As(); - var rootContainer = rootBuilder.Build(); - - var scopeA = rootContainer.BeginLifetimeScope( - scopeBuilder => scopeBuilder.RegisterType().As()); - var arrayA = scopeA.Resolve>().ToArray(); - - var scopeB = rootContainer.BeginLifetimeScope( - scopeBuilder => scopeBuilder.RegisterType().As()); - var arrayB = scopeB.Resolve>().ToArray(); - - Assert.That(arrayA.Count(), Is.EqualTo(2)); - Assert.That(arrayA, Has.Some.TypeOf()); - Assert.That(arrayA, Has.Some.TypeOf()); - - Assert.That(arrayB.Count(), Is.EqualTo(2)); - Assert.That(arrayB, Has.Some.TypeOf()); - Assert.That(arrayB, Has.Some.TypeOf()); - } - } -} +using System.Collections.Generic; +using System.Linq; +using Autofac; +using NUnit.Framework; + +namespace Orchard.Tests.Environment.AutofacUtil { + [TestFixture] + public class AutofacTests { + public interface IFoo { } + public class Foo1 : IFoo { } + public class Foo2 : IFoo { } + public class Foo3 : IFoo { } + + [Test(Description = "Exercises a problem in a previous version, to make sure older Autofac.dll isn't picked up")] + public void EnumerablesFromDifferentLifetimeScopesShouldReturnDifferentCollections() { + var rootBuilder = new ContainerBuilder(); + rootBuilder.RegisterType().As(); + var rootContainer = rootBuilder.Build(); + + var scopeA = rootContainer.BeginLifetimeScope( + scopeBuilder => scopeBuilder.RegisterType().As()); + var arrayA = scopeA.Resolve>().ToArray(); + + var scopeB = rootContainer.BeginLifetimeScope( + scopeBuilder => scopeBuilder.RegisterType().As()); + var arrayB = scopeB.Resolve>().ToArray(); + + Assert.That(arrayA.Count(), Is.EqualTo(2)); + Assert.That(arrayA, Has.Some.TypeOf()); + Assert.That(arrayA, Has.Some.TypeOf()); + + Assert.That(arrayB.Count(), Is.EqualTo(2)); + Assert.That(arrayB, Has.Some.TypeOf()); + Assert.That(arrayB, Has.Some.TypeOf()); + } + } +} diff --git a/src/Orchard.Tests/Environment/AutofacUtil/DynamicProxy2/DynamicProxyTests.cs b/src/Orchard.Tests/Environment/AutofacUtil/DynamicProxy2/DynamicProxyTests.cs index 151f0810dc5..5c53580807e 100644 --- a/src/Orchard.Tests/Environment/AutofacUtil/DynamicProxy2/DynamicProxyTests.cs +++ b/src/Orchard.Tests/Environment/AutofacUtil/DynamicProxy2/DynamicProxyTests.cs @@ -1,141 +1,141 @@ -using System; -using Autofac; -using Autofac.Core; -using Autofac.Features.Metadata; -using Castle.DynamicProxy; -using NUnit.Framework; -using Orchard.Environment.AutofacUtil.DynamicProxy2; - -namespace Orchard.Tests.Environment.AutofacUtil.DynamicProxy2 { - [TestFixture] - public class DynamicProxyTests { - [Test] - public void ContextAddedToMetadataWhenRegistered() { - var context = new DynamicProxyContext(); - - var builder = new ContainerBuilder(); - builder.RegisterType().EnableDynamicProxy(context); - - var container = builder.Build(); - - var meta = container.Resolve>(); - Assert.That(meta.Metadata, Has.Some.Property("Key").EqualTo("Orchard.Environment.AutofacUtil.DynamicProxy2.DynamicProxyContext.ProxyContextKey")); - Assert.That(meta.Metadata["Orchard.Environment.AutofacUtil.DynamicProxy2.DynamicProxyContext.ProxyContextKey"], Is.SameAs(context)); - } - - [Test] - public void ProxyContextReturnsTrueIfTypeHasBeenProxied() { - var context = new DynamicProxyContext(); - - Type proxyType; - Assert.That(context.TryGetProxy(typeof(SimpleComponent), out proxyType), Is.False); - Assert.That(context.TryGetProxy(typeof(SimpleComponent), out proxyType), Is.False); - Assert.That(proxyType, Is.Null); - - context.AddProxy(typeof(SimpleComponent)); - Assert.That(context.TryGetProxy(typeof(SimpleComponent), out proxyType), Is.True); - Assert.That(context.TryGetProxy(typeof(SimpleComponent), out proxyType), Is.True); - Assert.That(proxyType, Is.Not.Null); - } - - [Test] - public void AddProxyCanBeCalledMoreThanOnce() { - var context = new DynamicProxyContext(); - context.AddProxy(typeof(SimpleComponent)); - - Type proxyType; - Assert.That(context.TryGetProxy(typeof(SimpleComponent), out proxyType), Is.True); - Assert.That(proxyType, Is.Not.Null); - - Type proxyType2; - context.AddProxy(typeof(SimpleComponent)); - Assert.That(context.TryGetProxy(typeof(SimpleComponent), out proxyType2), Is.True); - - Assert.That(proxyType2, Is.SameAs(proxyType)); - } - - [Test] - public void InterceptorAddedToContextFromModules() { - var context = new DynamicProxyContext(); - - var builder = new ContainerBuilder(); - builder.RegisterType().EnableDynamicProxy(context); - builder.RegisterModule(new SimpleInterceptorModule()); - - builder.Build(); - - Type proxyType; - Assert.That(context.TryGetProxy(typeof(SimpleComponent), out proxyType), Is.True); - Assert.That(proxyType, Is.Not.Null); - } - - [Test] - public void ResolvedObjectIsSubclass() { - var context = new DynamicProxyContext(); - - var builder = new ContainerBuilder(); - builder.RegisterType().EnableDynamicProxy(context); - builder.RegisterModule(new SimpleInterceptorModule()); - - var container = builder.Build(); - - var simpleComponent = container.Resolve(); - Assert.That(simpleComponent, Is.InstanceOf()); - Assert.That(simpleComponent, Is.Not.TypeOf()); - } - - [Test] - public void InterceptorCatchesMethodCallOnlyFromContainerWithInterceptor() { - var context = new DynamicProxyContext(); - - var builder1 = new ContainerBuilder(); - builder1.RegisterType().EnableDynamicProxy(context); - builder1.RegisterModule(new SimpleInterceptorModule()); - var container1 = builder1.Build(); - - var simple1 = container1.Resolve(); - - var builder2 = new ContainerBuilder(); - builder2.RegisterType().EnableDynamicProxy(context); - var container2 = builder2.Build(); - - var simple2 = container2.Resolve(); - - Assert.That(simple2.SimpleMethod(), Is.EqualTo("default return value")); - Assert.That(simple1.SimpleMethod(), Is.EqualTo("different return value")); - } - } - - public class SimpleComponent { - public virtual string SimpleMethod() { - return "default return value"; - } - } - - public class SimpleInterceptorModule : Module { - protected override void Load(ContainerBuilder builder) { - builder.RegisterType(); - - base.Load(builder); - } - - protected override void AttachToComponentRegistration( - IComponentRegistry componentRegistry, - IComponentRegistration registration) { - - if (DynamicProxyContext.From(registration) != null) - registration.InterceptedBy(); - } - } - - public class SimpleInterceptor : IInterceptor { - public void Intercept(IInvocation invocation) { - if (invocation.Method.Name == "SimpleMethod") { - invocation.ReturnValue = "different return value"; - } - else { - invocation.Proceed(); - } - } - } -} +using System; +using Autofac; +using Autofac.Core; +using Autofac.Features.Metadata; +using Castle.DynamicProxy; +using NUnit.Framework; +using Orchard.Environment.AutofacUtil.DynamicProxy2; + +namespace Orchard.Tests.Environment.AutofacUtil.DynamicProxy2 { + [TestFixture] + public class DynamicProxyTests { + [Test] + public void ContextAddedToMetadataWhenRegistered() { + var context = new DynamicProxyContext(); + + var builder = new ContainerBuilder(); + builder.RegisterType().EnableDynamicProxy(context); + + var container = builder.Build(); + + var meta = container.Resolve>(); + Assert.That(meta.Metadata, Has.Some.Property("Key").EqualTo("Orchard.Environment.AutofacUtil.DynamicProxy2.DynamicProxyContext.ProxyContextKey")); + Assert.That(meta.Metadata["Orchard.Environment.AutofacUtil.DynamicProxy2.DynamicProxyContext.ProxyContextKey"], Is.SameAs(context)); + } + + [Test] + public void ProxyContextReturnsTrueIfTypeHasBeenProxied() { + var context = new DynamicProxyContext(); + + Type proxyType; + Assert.That(context.TryGetProxy(typeof(SimpleComponent), out proxyType), Is.False); + Assert.That(context.TryGetProxy(typeof(SimpleComponent), out proxyType), Is.False); + Assert.That(proxyType, Is.Null); + + context.AddProxy(typeof(SimpleComponent)); + Assert.That(context.TryGetProxy(typeof(SimpleComponent), out proxyType), Is.True); + Assert.That(context.TryGetProxy(typeof(SimpleComponent), out proxyType), Is.True); + Assert.That(proxyType, Is.Not.Null); + } + + [Test] + public void AddProxyCanBeCalledMoreThanOnce() { + var context = new DynamicProxyContext(); + context.AddProxy(typeof(SimpleComponent)); + + Type proxyType; + Assert.That(context.TryGetProxy(typeof(SimpleComponent), out proxyType), Is.True); + Assert.That(proxyType, Is.Not.Null); + + Type proxyType2; + context.AddProxy(typeof(SimpleComponent)); + Assert.That(context.TryGetProxy(typeof(SimpleComponent), out proxyType2), Is.True); + + Assert.That(proxyType2, Is.SameAs(proxyType)); + } + + [Test] + public void InterceptorAddedToContextFromModules() { + var context = new DynamicProxyContext(); + + var builder = new ContainerBuilder(); + builder.RegisterType().EnableDynamicProxy(context); + builder.RegisterModule(new SimpleInterceptorModule()); + + builder.Build(); + + Type proxyType; + Assert.That(context.TryGetProxy(typeof(SimpleComponent), out proxyType), Is.True); + Assert.That(proxyType, Is.Not.Null); + } + + [Test] + public void ResolvedObjectIsSubclass() { + var context = new DynamicProxyContext(); + + var builder = new ContainerBuilder(); + builder.RegisterType().EnableDynamicProxy(context); + builder.RegisterModule(new SimpleInterceptorModule()); + + var container = builder.Build(); + + var simpleComponent = container.Resolve(); + Assert.That(simpleComponent, Is.InstanceOf()); + Assert.That(simpleComponent, Is.Not.TypeOf()); + } + + [Test] + public void InterceptorCatchesMethodCallOnlyFromContainerWithInterceptor() { + var context = new DynamicProxyContext(); + + var builder1 = new ContainerBuilder(); + builder1.RegisterType().EnableDynamicProxy(context); + builder1.RegisterModule(new SimpleInterceptorModule()); + var container1 = builder1.Build(); + + var simple1 = container1.Resolve(); + + var builder2 = new ContainerBuilder(); + builder2.RegisterType().EnableDynamicProxy(context); + var container2 = builder2.Build(); + + var simple2 = container2.Resolve(); + + Assert.That(simple2.SimpleMethod(), Is.EqualTo("default return value")); + Assert.That(simple1.SimpleMethod(), Is.EqualTo("different return value")); + } + } + + public class SimpleComponent { + public virtual string SimpleMethod() { + return "default return value"; + } + } + + public class SimpleInterceptorModule : Module { + protected override void Load(ContainerBuilder builder) { + builder.RegisterType(); + + base.Load(builder); + } + + protected override void AttachToComponentRegistration( + IComponentRegistry componentRegistry, + IComponentRegistration registration) { + + if (DynamicProxyContext.From(registration) != null) + registration.InterceptedBy(); + } + } + + public class SimpleInterceptor : IInterceptor { + public void Intercept(IInvocation invocation) { + if (invocation.Method.Name == "SimpleMethod") { + invocation.ReturnValue = "different return value"; + } + else { + invocation.Proceed(); + } + } + } +} diff --git a/src/Orchard.Tests/Environment/Blueprint/DefaultShellDescriptorCacheTests.cs b/src/Orchard.Tests/Environment/Blueprint/DefaultShellDescriptorCacheTests.cs index a260052a20e..372bdd21169 100644 --- a/src/Orchard.Tests/Environment/Blueprint/DefaultShellDescriptorCacheTests.cs +++ b/src/Orchard.Tests/Environment/Blueprint/DefaultShellDescriptorCacheTests.cs @@ -1,98 +1,98 @@ -using System.IO; -using System.Runtime.Serialization; -using System.Xml; -using Autofac; -using NUnit.Framework; -using Orchard.Environment.Descriptor; -using Orchard.Environment.Descriptor.Models; -using Orchard.FileSystems.AppData; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.Environment.Blueprint { - [TestFixture] - public class DefaultShellDescriptorCacheTests { - private IContainer _container; - private IAppDataFolder _appDataFolder; - - [SetUp] - public void Init() { - var clock = new StubClock(); - _appDataFolder = new StubAppDataFolder(clock); - - var builder = new ContainerBuilder(); - builder.RegisterInstance(_appDataFolder).As(); - builder.RegisterType().As(); - _container = builder.Build(); - } - - [Test] - public void FetchReturnsNullForCacheMiss() { - var service = _container.Resolve(); - var descriptor = service.Fetch("No such shell"); - Assert.That(descriptor, Is.Null); - } - - [Test] - public void StoreCanBeCalledMoreThanOnceOnTheSameName() { - var service = _container.Resolve(); - var descriptor = new ShellDescriptor { SerialNumber = 6655321 }; - service.Store("Hello", descriptor); - service.Store("Hello", descriptor); - var result = service.Fetch("Hello"); - Assert.That(result, Is.Not.Null); - Assert.That(result.SerialNumber, Is.EqualTo(6655321)); - } - - [Test] - public void SecondCallUpdatesData() { - var service = _container.Resolve(); - var descriptor1 = new ShellDescriptor { SerialNumber = 6655321 }; - service.Store("Hello", descriptor1); - var descriptor2 = new ShellDescriptor { SerialNumber = 42 }; - service.Store("Hello", descriptor2); - var result = service.Fetch("Hello"); - Assert.That(result, Is.Not.Null); - Assert.That(result.SerialNumber, Is.EqualTo(42)); - } - - [Test] - public void AllDataWillRoundTrip() { - var service = _container.Resolve(); - - var descriptor = new ShellDescriptor { - SerialNumber = 6655321, - Features = new[] { - new ShellFeature { Name = "f2"}, - new ShellFeature { Name = "f4"}, - }, - Parameters = new[] { - new ShellParameter {Component = "p1", Name = "p2",Value = "p3"}, - new ShellParameter {Component = "p4",Name = "p5", Value = "p6"}, - }, - }; - var descriptorInfo = descriptor.ToDataString(); - - service.Store("Hello", descriptor); - var result = service.Fetch("Hello"); - var resultInfo = result.ToDataString(); - - Assert.That(descriptorInfo, Is.StringContaining("6655321")); - Assert.That(resultInfo, Is.StringContaining("6655321")); - Assert.That(descriptorInfo, Is.EqualTo(resultInfo)); - - } - } - - static class DataContractExtensions { - public static string ToDataString(this T obj) { - var serializer = new DataContractSerializer(typeof(ShellDescriptor)); - var writer = new StringWriter(); - using (var xmlWriter = XmlWriter.Create(writer)) { - serializer.WriteObject(xmlWriter, obj); - } - return writer.ToString(); - } - } -} - - +using System.IO; +using System.Runtime.Serialization; +using System.Xml; +using Autofac; +using NUnit.Framework; +using Orchard.Environment.Descriptor; +using Orchard.Environment.Descriptor.Models; +using Orchard.FileSystems.AppData; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.Environment.Blueprint { + [TestFixture] + public class DefaultShellDescriptorCacheTests { + private IContainer _container; + private IAppDataFolder _appDataFolder; + + [SetUp] + public void Init() { + var clock = new StubClock(); + _appDataFolder = new StubAppDataFolder(clock); + + var builder = new ContainerBuilder(); + builder.RegisterInstance(_appDataFolder).As(); + builder.RegisterType().As(); + _container = builder.Build(); + } + + [Test] + public void FetchReturnsNullForCacheMiss() { + var service = _container.Resolve(); + var descriptor = service.Fetch("No such shell"); + Assert.That(descriptor, Is.Null); + } + + [Test] + public void StoreCanBeCalledMoreThanOnceOnTheSameName() { + var service = _container.Resolve(); + var descriptor = new ShellDescriptor { SerialNumber = 6655321 }; + service.Store("Hello", descriptor); + service.Store("Hello", descriptor); + var result = service.Fetch("Hello"); + Assert.That(result, Is.Not.Null); + Assert.That(result.SerialNumber, Is.EqualTo(6655321)); + } + + [Test] + public void SecondCallUpdatesData() { + var service = _container.Resolve(); + var descriptor1 = new ShellDescriptor { SerialNumber = 6655321 }; + service.Store("Hello", descriptor1); + var descriptor2 = new ShellDescriptor { SerialNumber = 42 }; + service.Store("Hello", descriptor2); + var result = service.Fetch("Hello"); + Assert.That(result, Is.Not.Null); + Assert.That(result.SerialNumber, Is.EqualTo(42)); + } + + [Test] + public void AllDataWillRoundTrip() { + var service = _container.Resolve(); + + var descriptor = new ShellDescriptor { + SerialNumber = 6655321, + Features = new[] { + new ShellFeature { Name = "f2"}, + new ShellFeature { Name = "f4"}, + }, + Parameters = new[] { + new ShellParameter {Component = "p1", Name = "p2",Value = "p3"}, + new ShellParameter {Component = "p4",Name = "p5", Value = "p6"}, + }, + }; + var descriptorInfo = descriptor.ToDataString(); + + service.Store("Hello", descriptor); + var result = service.Fetch("Hello"); + var resultInfo = result.ToDataString(); + + Assert.That(descriptorInfo, Is.StringContaining("6655321")); + Assert.That(resultInfo, Is.StringContaining("6655321")); + Assert.That(descriptorInfo, Is.EqualTo(resultInfo)); + + } + } + + static class DataContractExtensions { + public static string ToDataString(this T obj) { + var serializer = new DataContractSerializer(typeof(ShellDescriptor)); + var writer = new StringWriter(); + using (var xmlWriter = XmlWriter.Create(writer)) { + serializer.WriteObject(xmlWriter, obj); + } + return writer.ToString(); + } + } +} + + diff --git a/src/Orchard.Tests/Environment/Configuration/DefaultTenantManagerTests.cs b/src/Orchard.Tests/Environment/Configuration/DefaultTenantManagerTests.cs index b5052ee14a7..7f8fca9d073 100644 --- a/src/Orchard.Tests/Environment/Configuration/DefaultTenantManagerTests.cs +++ b/src/Orchard.Tests/Environment/Configuration/DefaultTenantManagerTests.cs @@ -1,130 +1,130 @@ -using System.Linq; -using Moq; -using NUnit.Framework; -using Orchard.Environment; -using Orchard.Environment.Configuration; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.Environment.Configuration { - [TestFixture] - public class DefaultTenantManagerTests { - private StubAppDataFolder _appDataFolder; - - [SetUp] - public void Init() { - var clock = new StubClock(); - _appDataFolder = new StubAppDataFolder(clock); - } - - [Test] - public void SingleSettingsFileShouldComeBackAsExpected() { - - _appDataFolder.CreateFile("Sites\\Default\\Settings.txt", "Name: Default\r\nDataProvider: SqlCe\r\nDataConnectionString: something else"); - - IShellSettingsManager loader = new ShellSettingsManager(_appDataFolder, new Mock().Object); - var settings = loader.LoadSettings().Single(); - Assert.That(settings, Is.Not.Null); - Assert.That(settings.Name, Is.EqualTo(ShellSettings.DefaultName)); - Assert.That(settings.DataProvider, Is.EqualTo("SqlCe")); - Assert.That(settings.DataConnectionString, Is.EqualTo("something else")); - } - - - [Test] - public void MultipleFilesCanBeDetected() { - - _appDataFolder.CreateFile("Sites\\Default\\Settings.txt", "Name: Default\r\nDataProvider: SqlCe\r\nDataConnectionString: something else"); - _appDataFolder.CreateFile("Sites\\Another\\Settings.txt", "Name: Another\r\nDataProvider: SqlCe2\r\nDataConnectionString: something else2"); - - IShellSettingsManager loader = new ShellSettingsManager(_appDataFolder, new Mock().Object); - var settings = loader.LoadSettings(); - Assert.That(settings.Count(), Is.EqualTo(2)); - - var def = settings.Single(x => x.Name == ShellSettings.DefaultName); - Assert.That(def.Name, Is.EqualTo(ShellSettings.DefaultName)); - Assert.That(def.DataProvider, Is.EqualTo("SqlCe")); - Assert.That(def.DataConnectionString, Is.EqualTo("something else")); - - var alt = settings.Single(x => x.Name == "Another"); - Assert.That(alt.Name, Is.EqualTo("Another")); - Assert.That(alt.DataProvider, Is.EqualTo("SqlCe2")); - Assert.That(alt.DataConnectionString, Is.EqualTo("something else2")); - } - - [Test] - public void NewSettingsCanBeStored() { - _appDataFolder.CreateFile("Sites\\Default\\Settings.txt", "Name: Default\r\nDataProvider: SqlCe\r\nDataConnectionString: something else"); - - IShellSettingsManager loader = new ShellSettingsManager(_appDataFolder, new Mock().Object); - var foo = new ShellSettings {Name = "Foo", DataProvider = "Bar", DataConnectionString = "Quux"}; - - Assert.That(loader.LoadSettings().Count(), Is.EqualTo(1)); - loader.SaveSettings(foo); - Assert.That(loader.LoadSettings().Count(), Is.EqualTo(2)); - - var text = _appDataFolder.ReadFile("Sites\\Foo\\Settings.txt"); - Assert.That(text, Is.StringContaining("Foo")); - Assert.That(text, Is.StringContaining("Bar")); - Assert.That(text, Is.StringContaining("Quux")); - } - - [Test] - public void CustomSettingsCanBeRetrieved() { - _appDataFolder.CreateFile("Sites\\Default\\Settings.txt", "Name: Default\r\nProperty1: Foo\r\nProperty2: Bar"); - - IShellSettingsManager loader = new ShellSettingsManager(_appDataFolder, new Mock().Object); - Assert.That(loader.LoadSettings().Count(), Is.EqualTo(1)); - - var settings = loader.LoadSettings().First(); - - Assert.That(settings.Name, Is.EqualTo("Default")); - Assert.That(settings["Property1"], Is.EqualTo("Foo")); - Assert.That(settings["Property2"], Is.EqualTo("Bar")); - } - - [Test] - public void CustomSettingsCanBeStoredAndRetrieved() { - IShellSettingsManager loader = new ShellSettingsManager(_appDataFolder, new Mock().Object); - var foo = new ShellSettings { Name = "Default" }; - foo["Property1"] = "Foo"; - foo["Property2"] = "Bar"; - - loader.SaveSettings(foo); - Assert.That(loader.LoadSettings().Count(), Is.EqualTo(1)); - var settings = loader.LoadSettings().First(); - - Assert.That(settings.Name, Is.EqualTo("Default")); - Assert.That(settings["Property1"], Is.EqualTo("Foo")); - Assert.That(settings["Property2"], Is.EqualTo("Bar")); - } - - [Test] - public void EncryptionSettingsAreStoredAndReadable() { - IShellSettingsManager loader = new ShellSettingsManager(_appDataFolder, new Mock().Object); - var foo = new ShellSettings { Name = "Foo", DataProvider = "Bar", DataConnectionString = "Quux", EncryptionAlgorithm = "AES", EncryptionKey = "ABCDEFG", HashAlgorithm = "HMACSHA256", HashKey = "HIJKLMN" }; - loader.SaveSettings(foo); - Assert.That(loader.LoadSettings().Count(), Is.EqualTo(1)); - - var settings = loader.LoadSettings().First(); - - Assert.That(settings.EncryptionAlgorithm, Is.EqualTo("AES")); - Assert.That(settings.EncryptionKey, Is.EqualTo("ABCDEFG")); - Assert.That(settings.HashAlgorithm, Is.EqualTo("HMACSHA256")); - Assert.That(settings.HashKey, Is.EqualTo("HIJKLMN")); - } - - - [Test] - public void SettingsDontLoseTenantState() { - IShellSettingsManager loader = new ShellSettingsManager(_appDataFolder, new Mock().Object); - var foo = new ShellSettings { Name = "Default" }; - foo.State = TenantState.Disabled; - - loader.SaveSettings(foo); - var settings = loader.LoadSettings().First(); - - Assert.That(settings.Name, Is.EqualTo("Default")); - Assert.That(settings.State, Is.EqualTo(TenantState.Disabled)); - } - } -} +using System.Linq; +using Moq; +using NUnit.Framework; +using Orchard.Environment; +using Orchard.Environment.Configuration; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.Environment.Configuration { + [TestFixture] + public class DefaultTenantManagerTests { + private StubAppDataFolder _appDataFolder; + + [SetUp] + public void Init() { + var clock = new StubClock(); + _appDataFolder = new StubAppDataFolder(clock); + } + + [Test] + public void SingleSettingsFileShouldComeBackAsExpected() { + + _appDataFolder.CreateFile("Sites\\Default\\Settings.txt", "Name: Default\r\nDataProvider: SqlCe\r\nDataConnectionString: something else"); + + IShellSettingsManager loader = new ShellSettingsManager(_appDataFolder, new Mock().Object); + var settings = loader.LoadSettings().Single(); + Assert.That(settings, Is.Not.Null); + Assert.That(settings.Name, Is.EqualTo(ShellSettings.DefaultName)); + Assert.That(settings.DataProvider, Is.EqualTo("SqlCe")); + Assert.That(settings.DataConnectionString, Is.EqualTo("something else")); + } + + + [Test] + public void MultipleFilesCanBeDetected() { + + _appDataFolder.CreateFile("Sites\\Default\\Settings.txt", "Name: Default\r\nDataProvider: SqlCe\r\nDataConnectionString: something else"); + _appDataFolder.CreateFile("Sites\\Another\\Settings.txt", "Name: Another\r\nDataProvider: SqlCe2\r\nDataConnectionString: something else2"); + + IShellSettingsManager loader = new ShellSettingsManager(_appDataFolder, new Mock().Object); + var settings = loader.LoadSettings(); + Assert.That(settings.Count(), Is.EqualTo(2)); + + var def = settings.Single(x => x.Name == ShellSettings.DefaultName); + Assert.That(def.Name, Is.EqualTo(ShellSettings.DefaultName)); + Assert.That(def.DataProvider, Is.EqualTo("SqlCe")); + Assert.That(def.DataConnectionString, Is.EqualTo("something else")); + + var alt = settings.Single(x => x.Name == "Another"); + Assert.That(alt.Name, Is.EqualTo("Another")); + Assert.That(alt.DataProvider, Is.EqualTo("SqlCe2")); + Assert.That(alt.DataConnectionString, Is.EqualTo("something else2")); + } + + [Test] + public void NewSettingsCanBeStored() { + _appDataFolder.CreateFile("Sites\\Default\\Settings.txt", "Name: Default\r\nDataProvider: SqlCe\r\nDataConnectionString: something else"); + + IShellSettingsManager loader = new ShellSettingsManager(_appDataFolder, new Mock().Object); + var foo = new ShellSettings {Name = "Foo", DataProvider = "Bar", DataConnectionString = "Quux"}; + + Assert.That(loader.LoadSettings().Count(), Is.EqualTo(1)); + loader.SaveSettings(foo); + Assert.That(loader.LoadSettings().Count(), Is.EqualTo(2)); + + var text = _appDataFolder.ReadFile("Sites\\Foo\\Settings.txt"); + Assert.That(text, Is.StringContaining("Foo")); + Assert.That(text, Is.StringContaining("Bar")); + Assert.That(text, Is.StringContaining("Quux")); + } + + [Test] + public void CustomSettingsCanBeRetrieved() { + _appDataFolder.CreateFile("Sites\\Default\\Settings.txt", "Name: Default\r\nProperty1: Foo\r\nProperty2: Bar"); + + IShellSettingsManager loader = new ShellSettingsManager(_appDataFolder, new Mock().Object); + Assert.That(loader.LoadSettings().Count(), Is.EqualTo(1)); + + var settings = loader.LoadSettings().First(); + + Assert.That(settings.Name, Is.EqualTo("Default")); + Assert.That(settings["Property1"], Is.EqualTo("Foo")); + Assert.That(settings["Property2"], Is.EqualTo("Bar")); + } + + [Test] + public void CustomSettingsCanBeStoredAndRetrieved() { + IShellSettingsManager loader = new ShellSettingsManager(_appDataFolder, new Mock().Object); + var foo = new ShellSettings { Name = "Default" }; + foo["Property1"] = "Foo"; + foo["Property2"] = "Bar"; + + loader.SaveSettings(foo); + Assert.That(loader.LoadSettings().Count(), Is.EqualTo(1)); + var settings = loader.LoadSettings().First(); + + Assert.That(settings.Name, Is.EqualTo("Default")); + Assert.That(settings["Property1"], Is.EqualTo("Foo")); + Assert.That(settings["Property2"], Is.EqualTo("Bar")); + } + + [Test] + public void EncryptionSettingsAreStoredAndReadable() { + IShellSettingsManager loader = new ShellSettingsManager(_appDataFolder, new Mock().Object); + var foo = new ShellSettings { Name = "Foo", DataProvider = "Bar", DataConnectionString = "Quux", EncryptionAlgorithm = "AES", EncryptionKey = "ABCDEFG", HashAlgorithm = "HMACSHA256", HashKey = "HIJKLMN" }; + loader.SaveSettings(foo); + Assert.That(loader.LoadSettings().Count(), Is.EqualTo(1)); + + var settings = loader.LoadSettings().First(); + + Assert.That(settings.EncryptionAlgorithm, Is.EqualTo("AES")); + Assert.That(settings.EncryptionKey, Is.EqualTo("ABCDEFG")); + Assert.That(settings.HashAlgorithm, Is.EqualTo("HMACSHA256")); + Assert.That(settings.HashKey, Is.EqualTo("HIJKLMN")); + } + + + [Test] + public void SettingsDontLoseTenantState() { + IShellSettingsManager loader = new ShellSettingsManager(_appDataFolder, new Mock().Object); + var foo = new ShellSettings { Name = "Default" }; + foo.State = TenantState.Disabled; + + loader.SaveSettings(foo); + var settings = loader.LoadSettings().First(); + + Assert.That(settings.Name, Is.EqualTo("Default")); + Assert.That(settings.State, Is.EqualTo(TenantState.Disabled)); + } + } +} diff --git a/src/Orchard.Tests/Environment/DefaultCompositionStrategyTests.cs b/src/Orchard.Tests/Environment/DefaultCompositionStrategyTests.cs index 822de39e91b..545db124e2f 100644 --- a/src/Orchard.Tests/Environment/DefaultCompositionStrategyTests.cs +++ b/src/Orchard.Tests/Environment/DefaultCompositionStrategyTests.cs @@ -1,323 +1,323 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web.Mvc; -using System.Web.Routing; -using Autofac; -using Autofac.Core; -using Moq; -using NUnit.Framework; -using Orchard.ContentManagement.Records; -using Orchard.Environment.Configuration; -using Orchard.Environment.Extensions; -using Orchard.Environment.Extensions.Models; -using Orchard.Environment.ShellBuilders; -using Orchard.Tests.Environment.Utility; -using Orchard.Tests.Records; -using Orchard.Tests.Utility; - -namespace Orchard.Tests.Environment { - [TestFixture] - public class DefaultCompositionStrategyTests { - - private IContainer _container; - - private IEnumerable _extensionDescriptors; - private IDictionary> _featureTypes; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - builder.RegisterType().As(); - builder.RegisterAutoMocking(MockBehavior.Strict); - _container = builder.Build(); - - _extensionDescriptors = Enumerable.Empty(); - _featureTypes = new Dictionary>(); - - _container.Mock() - .Setup(x => x.AvailableExtensions()) - .Returns(() => _extensionDescriptors); - - _container.Mock() - .Setup(x => x.AvailableFeatures()) - .Returns(() => _extensionDescriptors.SelectMany(ext => ext.Features)); - - _container.Mock() - .Setup(x => x.LoadFeatures(It.IsAny>())) - .Returns((IEnumerable x) => StubLoadFeatures(x)); - } - - private IEnumerable StubLoadFeatures(IEnumerable featureDescriptors) { - return featureDescriptors.Select(featureDescriptor => new Feature { - Descriptor = featureDescriptor, - ExportedTypes = _featureTypes[featureDescriptor.Id] - }); - } - - private static ShellSettings BuildDefaultSettings() { - return new ShellSettings { Name = ShellSettings.DefaultName }; - } - - [Test] - public void BlueprintIsNotNull() { - var descriptor = Build.ShellDescriptor(); - - var compositionStrategy = _container.Resolve(); - var blueprint = compositionStrategy.Compose(BuildDefaultSettings(), descriptor); - - Assert.That(blueprint, Is.Not.Null); - } - - - [Test] - public void DependenciesFromFeatureArePutIntoBlueprint() { - var descriptor = Build.ShellDescriptor().WithFeatures("Foo", "Bar"); - - _extensionDescriptors = new[] { - Build.ExtensionDescriptor("Foo").WithFeatures("Foo"), - Build.ExtensionDescriptor("Bar").WithFeatures("Bar"), - }; - - _featureTypes["Foo"] = new[] { typeof(FooService1) }; - _featureTypes["Bar"] = new[] { typeof(BarService1) }; - - var compositionStrategy = _container.Resolve(); - var blueprint = compositionStrategy.Compose(BuildDefaultSettings(), descriptor); - - Assert.That(blueprint, Is.Not.Null); - Assert.That(blueprint.Dependencies.Count(), Is.EqualTo(2)); - - var foo = blueprint.Dependencies.SingleOrDefault(t => t.Type == typeof(FooService1)); - Assert.That(foo, Is.Not.Null); - Assert.That(foo.Feature.Descriptor.Id, Is.EqualTo("Foo")); - - var bar = blueprint.Dependencies.SingleOrDefault(t => t.Type == typeof(BarService1)); - Assert.That(bar, Is.Not.Null); - Assert.That(bar.Feature.Descriptor.Id, Is.EqualTo("Bar")); - } - - public interface IFooService : IDependency { - } - - public class FooService1 : IFooService { - } - - public interface IBarService : IDependency { - } - - public class BarService1 : IBarService { - } - - - [Test] - public void DependenciesAreGivenParameters() { - var descriptor = Build.ShellDescriptor() - .WithFeatures("Foo") - .WithParameter("one", "two") - .WithParameter("three", "four"); - - _extensionDescriptors = new[] { - Build.ExtensionDescriptor("Foo").WithFeatures("Foo"), - }; - - _featureTypes["Foo"] = new[] { typeof(FooService1) }; - - var compositionStrategy = _container.Resolve(); - var blueprint = compositionStrategy.Compose(BuildDefaultSettings(), descriptor); - - var foo = blueprint.Dependencies.SingleOrDefault(t => t.Type == typeof(FooService1)); - Assert.That(foo, Is.Not.Null); - Assert.That(foo.Parameters.Count(), Is.EqualTo(2)); - Assert.That(foo.Parameters.Single(x => x.Name == "one").Value, Is.EqualTo("two")); - Assert.That(foo.Parameters.Single(x => x.Name == "three").Value, Is.EqualTo("four")); - } - - [Test] - public void ModulesArePutIntoBlueprint() { - var descriptor = Build.ShellDescriptor().WithFeatures("Foo", "Bar"); - - _extensionDescriptors = new[] { - Build.ExtensionDescriptor("Foo").WithFeatures("Foo"), - Build.ExtensionDescriptor("Bar").WithFeatures("Bar"), - }; - - _featureTypes["Foo"] = new[] { typeof(AlphaModule) }; - _featureTypes["Bar"] = new[] { typeof(BetaModule) }; - - var compositionStrategy = _container.Resolve(); - var blueprint = compositionStrategy.Compose(BuildDefaultSettings(), descriptor); - - var alpha = blueprint.Dependencies.Single(x => x.Type == typeof(AlphaModule)); - var beta = blueprint.Dependencies.Single(x => x.Type == typeof(BetaModule)); - - Assert.That(alpha.Feature.Descriptor.Id, Is.EqualTo("Foo")); - Assert.That(beta.Feature.Descriptor.Id, Is.EqualTo("Bar")); - } - - public class AlphaModule : Module { - } - - public class BetaModule : IModule { - public void Configure(IComponentRegistry componentRegistry) { - throw new NotImplementedException(); - } - } - - [Test] - public void ControllersArePutIntoBlueprintWithAreaAndControllerName() { - var descriptor = Build.ShellDescriptor().WithFeatures("Foo Plus", "Bar Minus"); - - _extensionDescriptors = new[] { - Build.ExtensionDescriptor("MyCompany.Foo", "Foo").WithFeatures("Foo", "Foo Plus"), - Build.ExtensionDescriptor("Bar").WithFeatures("Bar", "Bar Minus"), - }; - - _featureTypes["Foo"] = Enumerable.Empty(); - _featureTypes["Foo Plus"] = new[] { typeof(GammaController) }; - _featureTypes["Bar"] = Enumerable.Empty(); - _featureTypes["Bar Minus"] = new[] { typeof(DeltaController), typeof(EpsilonController) }; - - var compositionStrategy = _container.Resolve(); - var blueprint = compositionStrategy.Compose(BuildDefaultSettings(), descriptor); - - var gamma = blueprint.Controllers.Single(x => x.Type == typeof(GammaController)); - var delta = blueprint.Controllers.Single(x => x.Type == typeof(DeltaController)); - var epsilon = blueprint.Controllers.Single(x => x.Type == typeof(EpsilonController)); - - Assert.That(gamma.Feature.Descriptor.Id, Is.EqualTo("Foo Plus")); - Assert.That(gamma.AreaName, Is.EqualTo("MyCompany.Foo")); - Assert.That(gamma.ControllerName, Is.EqualTo("Gamma")); - - Assert.That(delta.Feature.Descriptor.Id, Is.EqualTo("Bar Minus")); - Assert.That(delta.AreaName, Is.EqualTo("Bar")); - Assert.That(delta.ControllerName, Is.EqualTo("Delta")); - - Assert.That(epsilon.Feature.Descriptor.Id, Is.EqualTo("Bar Minus")); - Assert.That(epsilon.AreaName, Is.EqualTo("Bar")); - Assert.That(epsilon.ControllerName, Is.EqualTo("Epsilon")); - } - - - public class GammaController : Controller { - } - - public class DeltaController : ControllerBase { - protected override void ExecuteCore() { - throw new NotImplementedException(); - } - } - - public class EpsilonController : IController { - public void Execute(RequestContext requestContext) { - throw new NotImplementedException(); - } - } - - - [Test] - public void RecordsArePutIntoBlueprintWithTableName() { - var descriptor = Build.ShellDescriptor().WithFeatures("Foo Plus", "Bar", "Bar Minus"); - - _extensionDescriptors = new[] { - Build.ExtensionDescriptor("MyCompany.Foo", "Foo").WithFeatures("Foo", "Foo Plus"), - Build.ExtensionDescriptor("Bar").WithFeatures("Bar", "Bar Minus"), - }; - - _featureTypes["Foo"] = Enumerable.Empty(); - _featureTypes["Foo Plus"] = new[] { typeof(FooRecord) }; - _featureTypes["Bar"] = new[] { typeof(BarRecord) }; - _featureTypes["Bar Minus"] = Enumerable.Empty(); - - var compositionStrategy = _container.Resolve(); - var blueprint = compositionStrategy.Compose(BuildDefaultSettings(), descriptor); - - var foo = blueprint.Records.Single(x => x.Type == typeof(FooRecord)); - var bar = blueprint.Records.Single(x => x.Type == typeof(BarRecord)); - - Assert.That(foo.Feature.Descriptor.Id, Is.EqualTo("Foo Plus")); - Assert.That(foo.TableName, Is.EqualTo("MyCompany_Foo_FooRecord")); - - Assert.That(bar.Feature.Descriptor.Id, Is.EqualTo("Bar")); - Assert.That(bar.TableName, Is.EqualTo("Bar_BarRecord")); - } - - [Test] - public void CoreRecordsAreAddedAutomatically() { - var descriptor = Build.ShellDescriptor().WithFeatures("Orchard.Framework"); - - var compositionStrategy = _container.Resolve(); - var blueprint = compositionStrategy.Compose(BuildDefaultSettings(), descriptor); - - var ct = blueprint.Records.Single(x => x.Type == typeof(ContentTypeRecord)); - var ci = blueprint.Records.Single(x => x.Type == typeof(ContentItemRecord)); - var civ = blueprint.Records.Single(x => x.Type == typeof(ContentItemVersionRecord)); - - Assert.That(ct.Feature.Descriptor.Id, Is.EqualTo("Orchard.Framework")); - Assert.That(ct.TableName, Is.EqualTo("Orchard_Framework_ContentTypeRecord")); - - Assert.That(ci.Feature.Descriptor.Id, Is.EqualTo("Orchard.Framework")); - Assert.That(ci.TableName, Is.EqualTo("Orchard_Framework_ContentItemRecord")); - - Assert.That(civ.Feature.Descriptor.Id, Is.EqualTo("Orchard.Framework")); - Assert.That(civ.TableName, Is.EqualTo("Orchard_Framework_ContentItemVersionRecord")); - } - - [Test] - public void DataPrefixChangesTableName() { - var settings = BuildDefaultSettings(); - settings.DataTablePrefix = "Yadda"; - var descriptor = Build.ShellDescriptor().WithFeatures("Foo Plus", "Bar", "Bar Minus"); - - _extensionDescriptors = new[] { - Build.ExtensionDescriptor("MyCompany.Foo", "Foo").WithFeatures("Foo", "Foo Plus"), - Build.ExtensionDescriptor("Bar").WithFeatures("Bar", "Bar Minus"), - }; - - _featureTypes["Foo"] = Enumerable.Empty(); - _featureTypes["Foo Plus"] = new[] { typeof(FooRecord) }; - _featureTypes["Bar"] = new[] { typeof(BarRecord) }; - _featureTypes["Bar Minus"] = Enumerable.Empty(); - - var compositionStrategy = _container.Resolve(); - var blueprint = compositionStrategy.Compose(settings, descriptor); - - var foo = blueprint.Records.Single(x => x.Type == typeof(FooRecord)); - var bar = blueprint.Records.Single(x => x.Type == typeof(BarRecord)); - - Assert.That(foo.Feature.Descriptor.Id, Is.EqualTo("Foo Plus")); - Assert.That(foo.TableName, Is.EqualTo("Yadda_MyCompany_Foo_FooRecord")); - - Assert.That(bar.Feature.Descriptor.Id, Is.EqualTo("Bar")); - Assert.That(bar.TableName, Is.EqualTo("Yadda_Bar_BarRecord")); - } - - [Test] - public void FeatureReplacement() { - var descriptor = Build.ShellDescriptor().WithFeatures("Bar"); - - _extensionDescriptors = new[] { - Build.ExtensionDescriptor("Foo").WithFeatures("Bar"), - }; - - _featureTypes["Bar"] = new[] { typeof(ReplacedStubType), typeof(StubType), typeof(ReplacedStubNestedType), typeof(StubNestedType) }; - - var compositionStrategy = _container.Resolve(); - var blueprint = compositionStrategy.Compose(BuildDefaultSettings(), descriptor); - - Assert.That(blueprint.Dependencies.Count(), Is.EqualTo(2)); - Assert.That(blueprint.Dependencies.FirstOrDefault(dependency => dependency.Type.Equals(typeof(StubType))), Is.Not.Null); - Assert.That(blueprint.Dependencies.FirstOrDefault(dependency => dependency.Type.Equals(typeof(StubNestedType))), Is.Not.Null); - } - - [OrchardSuppressDependency("Orchard.Tests.Environment.DefaultCompositionStrategyTests+ReplacedStubNestedType")] - internal class StubNestedType : IDependency {} - - internal class ReplacedStubNestedType : IDependency {} - } - - [OrchardSuppressDependency("Orchard.Tests.Environment.ReplacedStubType")] - internal class StubType : IDependency { } - - internal class ReplacedStubType : IDependency { } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web.Mvc; +using System.Web.Routing; +using Autofac; +using Autofac.Core; +using Moq; +using NUnit.Framework; +using Orchard.ContentManagement.Records; +using Orchard.Environment.Configuration; +using Orchard.Environment.Extensions; +using Orchard.Environment.Extensions.Models; +using Orchard.Environment.ShellBuilders; +using Orchard.Tests.Environment.Utility; +using Orchard.Tests.Records; +using Orchard.Tests.Utility; + +namespace Orchard.Tests.Environment { + [TestFixture] + public class DefaultCompositionStrategyTests { + + private IContainer _container; + + private IEnumerable _extensionDescriptors; + private IDictionary> _featureTypes; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + builder.RegisterAutoMocking(MockBehavior.Strict); + _container = builder.Build(); + + _extensionDescriptors = Enumerable.Empty(); + _featureTypes = new Dictionary>(); + + _container.Mock() + .Setup(x => x.AvailableExtensions()) + .Returns(() => _extensionDescriptors); + + _container.Mock() + .Setup(x => x.AvailableFeatures()) + .Returns(() => _extensionDescriptors.SelectMany(ext => ext.Features)); + + _container.Mock() + .Setup(x => x.LoadFeatures(It.IsAny>())) + .Returns((IEnumerable x) => StubLoadFeatures(x)); + } + + private IEnumerable StubLoadFeatures(IEnumerable featureDescriptors) { + return featureDescriptors.Select(featureDescriptor => new Feature { + Descriptor = featureDescriptor, + ExportedTypes = _featureTypes[featureDescriptor.Id] + }); + } + + private static ShellSettings BuildDefaultSettings() { + return new ShellSettings { Name = ShellSettings.DefaultName }; + } + + [Test] + public void BlueprintIsNotNull() { + var descriptor = Build.ShellDescriptor(); + + var compositionStrategy = _container.Resolve(); + var blueprint = compositionStrategy.Compose(BuildDefaultSettings(), descriptor); + + Assert.That(blueprint, Is.Not.Null); + } + + + [Test] + public void DependenciesFromFeatureArePutIntoBlueprint() { + var descriptor = Build.ShellDescriptor().WithFeatures("Foo", "Bar"); + + _extensionDescriptors = new[] { + Build.ExtensionDescriptor("Foo").WithFeatures("Foo"), + Build.ExtensionDescriptor("Bar").WithFeatures("Bar"), + }; + + _featureTypes["Foo"] = new[] { typeof(FooService1) }; + _featureTypes["Bar"] = new[] { typeof(BarService1) }; + + var compositionStrategy = _container.Resolve(); + var blueprint = compositionStrategy.Compose(BuildDefaultSettings(), descriptor); + + Assert.That(blueprint, Is.Not.Null); + Assert.That(blueprint.Dependencies.Count(), Is.EqualTo(2)); + + var foo = blueprint.Dependencies.SingleOrDefault(t => t.Type == typeof(FooService1)); + Assert.That(foo, Is.Not.Null); + Assert.That(foo.Feature.Descriptor.Id, Is.EqualTo("Foo")); + + var bar = blueprint.Dependencies.SingleOrDefault(t => t.Type == typeof(BarService1)); + Assert.That(bar, Is.Not.Null); + Assert.That(bar.Feature.Descriptor.Id, Is.EqualTo("Bar")); + } + + public interface IFooService : IDependency { + } + + public class FooService1 : IFooService { + } + + public interface IBarService : IDependency { + } + + public class BarService1 : IBarService { + } + + + [Test] + public void DependenciesAreGivenParameters() { + var descriptor = Build.ShellDescriptor() + .WithFeatures("Foo") + .WithParameter("one", "two") + .WithParameter("three", "four"); + + _extensionDescriptors = new[] { + Build.ExtensionDescriptor("Foo").WithFeatures("Foo"), + }; + + _featureTypes["Foo"] = new[] { typeof(FooService1) }; + + var compositionStrategy = _container.Resolve(); + var blueprint = compositionStrategy.Compose(BuildDefaultSettings(), descriptor); + + var foo = blueprint.Dependencies.SingleOrDefault(t => t.Type == typeof(FooService1)); + Assert.That(foo, Is.Not.Null); + Assert.That(foo.Parameters.Count(), Is.EqualTo(2)); + Assert.That(foo.Parameters.Single(x => x.Name == "one").Value, Is.EqualTo("two")); + Assert.That(foo.Parameters.Single(x => x.Name == "three").Value, Is.EqualTo("four")); + } + + [Test] + public void ModulesArePutIntoBlueprint() { + var descriptor = Build.ShellDescriptor().WithFeatures("Foo", "Bar"); + + _extensionDescriptors = new[] { + Build.ExtensionDescriptor("Foo").WithFeatures("Foo"), + Build.ExtensionDescriptor("Bar").WithFeatures("Bar"), + }; + + _featureTypes["Foo"] = new[] { typeof(AlphaModule) }; + _featureTypes["Bar"] = new[] { typeof(BetaModule) }; + + var compositionStrategy = _container.Resolve(); + var blueprint = compositionStrategy.Compose(BuildDefaultSettings(), descriptor); + + var alpha = blueprint.Dependencies.Single(x => x.Type == typeof(AlphaModule)); + var beta = blueprint.Dependencies.Single(x => x.Type == typeof(BetaModule)); + + Assert.That(alpha.Feature.Descriptor.Id, Is.EqualTo("Foo")); + Assert.That(beta.Feature.Descriptor.Id, Is.EqualTo("Bar")); + } + + public class AlphaModule : Module { + } + + public class BetaModule : IModule { + public void Configure(IComponentRegistry componentRegistry) { + throw new NotImplementedException(); + } + } + + [Test] + public void ControllersArePutIntoBlueprintWithAreaAndControllerName() { + var descriptor = Build.ShellDescriptor().WithFeatures("Foo Plus", "Bar Minus"); + + _extensionDescriptors = new[] { + Build.ExtensionDescriptor("MyCompany.Foo", "Foo").WithFeatures("Foo", "Foo Plus"), + Build.ExtensionDescriptor("Bar").WithFeatures("Bar", "Bar Minus"), + }; + + _featureTypes["Foo"] = Enumerable.Empty(); + _featureTypes["Foo Plus"] = new[] { typeof(GammaController) }; + _featureTypes["Bar"] = Enumerable.Empty(); + _featureTypes["Bar Minus"] = new[] { typeof(DeltaController), typeof(EpsilonController) }; + + var compositionStrategy = _container.Resolve(); + var blueprint = compositionStrategy.Compose(BuildDefaultSettings(), descriptor); + + var gamma = blueprint.Controllers.Single(x => x.Type == typeof(GammaController)); + var delta = blueprint.Controllers.Single(x => x.Type == typeof(DeltaController)); + var epsilon = blueprint.Controllers.Single(x => x.Type == typeof(EpsilonController)); + + Assert.That(gamma.Feature.Descriptor.Id, Is.EqualTo("Foo Plus")); + Assert.That(gamma.AreaName, Is.EqualTo("MyCompany.Foo")); + Assert.That(gamma.ControllerName, Is.EqualTo("Gamma")); + + Assert.That(delta.Feature.Descriptor.Id, Is.EqualTo("Bar Minus")); + Assert.That(delta.AreaName, Is.EqualTo("Bar")); + Assert.That(delta.ControllerName, Is.EqualTo("Delta")); + + Assert.That(epsilon.Feature.Descriptor.Id, Is.EqualTo("Bar Minus")); + Assert.That(epsilon.AreaName, Is.EqualTo("Bar")); + Assert.That(epsilon.ControllerName, Is.EqualTo("Epsilon")); + } + + + public class GammaController : Controller { + } + + public class DeltaController : ControllerBase { + protected override void ExecuteCore() { + throw new NotImplementedException(); + } + } + + public class EpsilonController : IController { + public void Execute(RequestContext requestContext) { + throw new NotImplementedException(); + } + } + + + [Test] + public void RecordsArePutIntoBlueprintWithTableName() { + var descriptor = Build.ShellDescriptor().WithFeatures("Foo Plus", "Bar", "Bar Minus"); + + _extensionDescriptors = new[] { + Build.ExtensionDescriptor("MyCompany.Foo", "Foo").WithFeatures("Foo", "Foo Plus"), + Build.ExtensionDescriptor("Bar").WithFeatures("Bar", "Bar Minus"), + }; + + _featureTypes["Foo"] = Enumerable.Empty(); + _featureTypes["Foo Plus"] = new[] { typeof(FooRecord) }; + _featureTypes["Bar"] = new[] { typeof(BarRecord) }; + _featureTypes["Bar Minus"] = Enumerable.Empty(); + + var compositionStrategy = _container.Resolve(); + var blueprint = compositionStrategy.Compose(BuildDefaultSettings(), descriptor); + + var foo = blueprint.Records.Single(x => x.Type == typeof(FooRecord)); + var bar = blueprint.Records.Single(x => x.Type == typeof(BarRecord)); + + Assert.That(foo.Feature.Descriptor.Id, Is.EqualTo("Foo Plus")); + Assert.That(foo.TableName, Is.EqualTo("MyCompany_Foo_FooRecord")); + + Assert.That(bar.Feature.Descriptor.Id, Is.EqualTo("Bar")); + Assert.That(bar.TableName, Is.EqualTo("Bar_BarRecord")); + } + + [Test] + public void CoreRecordsAreAddedAutomatically() { + var descriptor = Build.ShellDescriptor().WithFeatures("Orchard.Framework"); + + var compositionStrategy = _container.Resolve(); + var blueprint = compositionStrategy.Compose(BuildDefaultSettings(), descriptor); + + var ct = blueprint.Records.Single(x => x.Type == typeof(ContentTypeRecord)); + var ci = blueprint.Records.Single(x => x.Type == typeof(ContentItemRecord)); + var civ = blueprint.Records.Single(x => x.Type == typeof(ContentItemVersionRecord)); + + Assert.That(ct.Feature.Descriptor.Id, Is.EqualTo("Orchard.Framework")); + Assert.That(ct.TableName, Is.EqualTo("Orchard_Framework_ContentTypeRecord")); + + Assert.That(ci.Feature.Descriptor.Id, Is.EqualTo("Orchard.Framework")); + Assert.That(ci.TableName, Is.EqualTo("Orchard_Framework_ContentItemRecord")); + + Assert.That(civ.Feature.Descriptor.Id, Is.EqualTo("Orchard.Framework")); + Assert.That(civ.TableName, Is.EqualTo("Orchard_Framework_ContentItemVersionRecord")); + } + + [Test] + public void DataPrefixChangesTableName() { + var settings = BuildDefaultSettings(); + settings.DataTablePrefix = "Yadda"; + var descriptor = Build.ShellDescriptor().WithFeatures("Foo Plus", "Bar", "Bar Minus"); + + _extensionDescriptors = new[] { + Build.ExtensionDescriptor("MyCompany.Foo", "Foo").WithFeatures("Foo", "Foo Plus"), + Build.ExtensionDescriptor("Bar").WithFeatures("Bar", "Bar Minus"), + }; + + _featureTypes["Foo"] = Enumerable.Empty(); + _featureTypes["Foo Plus"] = new[] { typeof(FooRecord) }; + _featureTypes["Bar"] = new[] { typeof(BarRecord) }; + _featureTypes["Bar Minus"] = Enumerable.Empty(); + + var compositionStrategy = _container.Resolve(); + var blueprint = compositionStrategy.Compose(settings, descriptor); + + var foo = blueprint.Records.Single(x => x.Type == typeof(FooRecord)); + var bar = blueprint.Records.Single(x => x.Type == typeof(BarRecord)); + + Assert.That(foo.Feature.Descriptor.Id, Is.EqualTo("Foo Plus")); + Assert.That(foo.TableName, Is.EqualTo("Yadda_MyCompany_Foo_FooRecord")); + + Assert.That(bar.Feature.Descriptor.Id, Is.EqualTo("Bar")); + Assert.That(bar.TableName, Is.EqualTo("Yadda_Bar_BarRecord")); + } + + [Test] + public void FeatureReplacement() { + var descriptor = Build.ShellDescriptor().WithFeatures("Bar"); + + _extensionDescriptors = new[] { + Build.ExtensionDescriptor("Foo").WithFeatures("Bar"), + }; + + _featureTypes["Bar"] = new[] { typeof(ReplacedStubType), typeof(StubType), typeof(ReplacedStubNestedType), typeof(StubNestedType) }; + + var compositionStrategy = _container.Resolve(); + var blueprint = compositionStrategy.Compose(BuildDefaultSettings(), descriptor); + + Assert.That(blueprint.Dependencies.Count(), Is.EqualTo(2)); + Assert.That(blueprint.Dependencies.FirstOrDefault(dependency => dependency.Type.Equals(typeof(StubType))), Is.Not.Null); + Assert.That(blueprint.Dependencies.FirstOrDefault(dependency => dependency.Type.Equals(typeof(StubNestedType))), Is.Not.Null); + } + + [OrchardSuppressDependency("Orchard.Tests.Environment.DefaultCompositionStrategyTests+ReplacedStubNestedType")] + internal class StubNestedType : IDependency {} + + internal class ReplacedStubNestedType : IDependency {} + } + + [OrchardSuppressDependency("Orchard.Tests.Environment.ReplacedStubType")] + internal class StubType : IDependency { } + + internal class ReplacedStubType : IDependency { } } \ No newline at end of file diff --git a/src/Orchard.Tests/Environment/DefaultOrchardHostTests.cs b/src/Orchard.Tests/Environment/DefaultOrchardHostTests.cs index 301a1e70329..2699f484134 100644 --- a/src/Orchard.Tests/Environment/DefaultOrchardHostTests.cs +++ b/src/Orchard.Tests/Environment/DefaultOrchardHostTests.cs @@ -1,258 +1,258 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web.Mvc; -using System.Web.Routing; -using Autofac; -using Autofac.Integration.Web; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.Environment; -using Orchard.Environment.Configuration; -using Orchard.Environment.Extensions; -using Orchard.Environment.Extensions.Folders; -using Orchard.Environment.Extensions.Models; -using Orchard.Environment.ShellBuilders; -using Orchard.Environment.Descriptor; -using Orchard.Environment.Descriptor.Models; -using Orchard.FileSystems.AppData; -using Orchard.FileSystems.VirtualPath; -using Orchard.Mvc.ModelBinders; -using Orchard.Mvc.Routes; -using Orchard.Owin; -using Orchard.Tests.Environment.TestDependencies; -using Orchard.Tests.Stubs; -using Orchard.Tests.Utility; -using Orchard.WebApi.Routes; -using IModelBinderProvider = Orchard.Mvc.ModelBinders.IModelBinderProvider; -using Orchard.Tasks; - -namespace Orchard.Tests.Environment { - [TestFixture] - public class DefaultOrchardHostTests { - private IContainer _container; - private ILifetimeScope _lifetime; - private RouteCollection _routeCollection; - private ModelBinderDictionary _modelBinderDictionary; - private ControllerBuilder _controllerBuilder; - private ViewEngineCollection _viewEngineCollection; - - [SetUp] - public void Init() { - var clock = new StubClock(); - var appDataFolder = new StubAppDataFolder(clock); - - _controllerBuilder = new ControllerBuilder(); - _routeCollection = new RouteCollection(); - _modelBinderDictionary = new ModelBinderDictionary(); - _viewEngineCollection = new ViewEngineCollection { new WebFormViewEngine() }; - - _container = OrchardStarter.CreateHostContainer( - builder => { - builder.RegisterInstance(new StubShellSettingsLoader()).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(appDataFolder).As(); - builder.RegisterInstance(_controllerBuilder); - builder.RegisterInstance(_routeCollection); - builder.RegisterInstance(_modelBinderDictionary); - builder.RegisterInstance(_viewEngineCollection); - builder.RegisterAutoMocking() - .Ignore() - .Ignore() - .Ignore() - .Ignore() - .Ignore() - .Ignore(); - }); - _lifetime = _container.BeginLifetimeScope(); - - _container.Mock() - .SetupGet(cp => cp.ApplicationContainer).Returns(_container); - _container.Mock() - .SetupGet(cp => cp.RequestLifetime).Returns(_lifetime); - _container.Mock() - .Setup(cp => cp.EndRequestLifetime()).Callback(() => _lifetime.Dispose()); - - _container.Mock() - .Setup(cp => cp.GetShellDescriptor()).Returns(default(ShellDescriptor)); - - _container.Mock() - .Setup(e => e.Activated()); - - _container.Mock() - .Setup(e => e.Terminating()).Callback(() => new object()); - } - - public class StubExtensionManager : IExtensionManager { - public ExtensionDescriptor GetExtension(string name) { - throw new NotImplementedException(); - } - - public IEnumerable AvailableExtensions() { - var ext = new ExtensionDescriptor { Id = "Orchard.Framework" }; - ext.Features = new[] { new FeatureDescriptor { Extension = ext, Id = ext.Id } }; - yield return ext; - } - - public IEnumerable AvailableFeatures() { - // note - doesn't order properly - return AvailableExtensions().SelectMany(ed => ed.Features); - } - - public IEnumerable LoadFeatures(IEnumerable featureDescriptors) { - foreach (var descriptor in featureDescriptors) { - if (descriptor.Id == "Orchard.Framework") { - yield return FrameworkFeature(descriptor); - } - } - } - - private Feature FrameworkFeature(FeatureDescriptor descriptor) { - return new Feature { - Descriptor = descriptor, - ExportedTypes = new[] { - typeof (TestDependency), - typeof (TestSingletonDependency), - typeof (TestTransientDependency), - } - }; - } - - public void Monitor(Action monitor) { - throw new NotImplementedException(); - } - } - - public class StubShellSettingsLoader : IShellSettingsManager { - private readonly List _shellSettings = new List { new ShellSettings { Name = ShellSettings.DefaultName, State = TenantState.Running } }; - - public IEnumerable LoadSettings() { - return _shellSettings.AsEnumerable(); - } - - public void SaveSettings(ShellSettings settings) { - _shellSettings.Add(settings); - } - } - - - - [Test, Ignore("containers are disposed when calling BeginRequest, maybe by the StubVirtualPathMonitor")] - public void NormalDependenciesShouldBeUniquePerRequestContainer() { - var host = _lifetime.Resolve(); - var container1 = host.CreateShellContainer_Obsolete(); - ((IShellDescriptorManagerEventHandler)host).Changed(null, ShellSettings.DefaultName); - host.BeginRequest(); // force reloading the shell - var container2 = host.CreateShellContainer_Obsolete(); - var requestContainer1a = container1.BeginLifetimeScope(); - var requestContainer1b = container1.BeginLifetimeScope(); - var requestContainer2a = container2.BeginLifetimeScope(); - var requestContainer2b = container2.BeginLifetimeScope(); - - var dep1 = container1.Resolve(); - var dep1a = requestContainer1a.Resolve(); - var dep1b = requestContainer1b.Resolve(); - var dep2 = container2.Resolve(); - var dep2a = requestContainer2a.Resolve(); - var dep2b = requestContainer2b.Resolve(); - - Assert.That(dep1, Is.Not.SameAs(dep2)); - Assert.That(dep1, Is.Not.SameAs(dep1a)); - Assert.That(dep1, Is.Not.SameAs(dep1b)); - Assert.That(dep2, Is.Not.SameAs(dep2a)); - Assert.That(dep2, Is.Not.SameAs(dep2b)); - - var again1 = container1.Resolve(); - var again1a = requestContainer1a.Resolve(); - var again1b = requestContainer1b.Resolve(); - var again2 = container2.Resolve(); - var again2a = requestContainer2a.Resolve(); - var again2b = requestContainer2b.Resolve(); - - Assert.That(again1, Is.SameAs(dep1)); - Assert.That(again1a, Is.SameAs(dep1a)); - Assert.That(again1b, Is.SameAs(dep1b)); - Assert.That(again2, Is.SameAs(dep2)); - Assert.That(again2a, Is.SameAs(dep2a)); - Assert.That(again2b, Is.SameAs(dep2b)); - } - [Test] - public void SingletonDependenciesShouldBeUniquePerShell() { - var host = _lifetime.Resolve(); - var container1 = host.CreateShellContainer_Obsolete(); - var container2 = host.CreateShellContainer_Obsolete(); - var requestContainer1a = container1.BeginLifetimeScope(); - var requestContainer1b = container1.BeginLifetimeScope(); - var requestContainer2a = container2.BeginLifetimeScope(); - var requestContainer2b = container2.BeginLifetimeScope(); - - var dep1 = container1.Resolve(); - var dep1a = requestContainer1a.Resolve(); - var dep1b = requestContainer1b.Resolve(); - var dep2 = container2.Resolve(); - var dep2a = requestContainer2a.Resolve(); - var dep2b = requestContainer2b.Resolve(); - - //Assert.That(dep1, Is.Not.SameAs(dep2)); - Assert.That(dep1, Is.SameAs(dep1a)); - Assert.That(dep1, Is.SameAs(dep1b)); - Assert.That(dep2, Is.SameAs(dep2a)); - Assert.That(dep2, Is.SameAs(dep2b)); - } - [Test] - public void TransientDependenciesShouldBeUniquePerResolve() { - var host = _lifetime.Resolve(); - var container1 = host.CreateShellContainer_Obsolete(); - var container2 = host.CreateShellContainer_Obsolete(); - var requestContainer1a = container1.BeginLifetimeScope(); - var requestContainer1b = container1.BeginLifetimeScope(); - var requestContainer2a = container2.BeginLifetimeScope(); - var requestContainer2b = container2.BeginLifetimeScope(); - - var dep1 = container1.Resolve(); - var dep1a = requestContainer1a.Resolve(); - var dep1b = requestContainer1b.Resolve(); - var dep2 = container2.Resolve(); - var dep2a = requestContainer2a.Resolve(); - var dep2b = requestContainer2b.Resolve(); - - Assert.That(dep1, Is.Not.SameAs(dep2)); - Assert.That(dep1, Is.Not.SameAs(dep1a)); - Assert.That(dep1, Is.Not.SameAs(dep1b)); - Assert.That(dep2, Is.Not.SameAs(dep2a)); - Assert.That(dep2, Is.Not.SameAs(dep2b)); - - var again1 = container1.Resolve(); - var again1a = requestContainer1a.Resolve(); - var again1b = requestContainer1b.Resolve(); - var again2 = container2.Resolve(); - var again2a = requestContainer2a.Resolve(); - var again2b = requestContainer2b.Resolve(); - - Assert.That(again1, Is.Not.SameAs(dep1)); - Assert.That(again1a, Is.Not.SameAs(dep1a)); - Assert.That(again1b, Is.Not.SameAs(dep1b)); - Assert.That(again2, Is.Not.SameAs(dep2)); - Assert.That(again2a, Is.Not.SameAs(dep2a)); - Assert.That(again2b, Is.Not.SameAs(dep2b)); - - } - } - - public static class TextExtensions { - public static ILifetimeScope CreateShellContainer_Obsolete(this IOrchardHost host) { - return ((DefaultOrchardHost)host) - .Current - .Single(x => x.Settings.Name == ShellSettings.DefaultName) - .LifetimeScope; - } - - public static IOrchardShell CreateShell_Obsolete(this IOrchardHost host) { - return host.CreateShellContainer_Obsolete().Resolve(); - } - } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web.Mvc; +using System.Web.Routing; +using Autofac; +using Autofac.Integration.Web; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.Environment; +using Orchard.Environment.Configuration; +using Orchard.Environment.Extensions; +using Orchard.Environment.Extensions.Folders; +using Orchard.Environment.Extensions.Models; +using Orchard.Environment.ShellBuilders; +using Orchard.Environment.Descriptor; +using Orchard.Environment.Descriptor.Models; +using Orchard.FileSystems.AppData; +using Orchard.FileSystems.VirtualPath; +using Orchard.Mvc.ModelBinders; +using Orchard.Mvc.Routes; +using Orchard.Owin; +using Orchard.Tests.Environment.TestDependencies; +using Orchard.Tests.Stubs; +using Orchard.Tests.Utility; +using Orchard.WebApi.Routes; +using IModelBinderProvider = Orchard.Mvc.ModelBinders.IModelBinderProvider; +using Orchard.Tasks; + +namespace Orchard.Tests.Environment { + [TestFixture] + public class DefaultOrchardHostTests { + private IContainer _container; + private ILifetimeScope _lifetime; + private RouteCollection _routeCollection; + private ModelBinderDictionary _modelBinderDictionary; + private ControllerBuilder _controllerBuilder; + private ViewEngineCollection _viewEngineCollection; + + [SetUp] + public void Init() { + var clock = new StubClock(); + var appDataFolder = new StubAppDataFolder(clock); + + _controllerBuilder = new ControllerBuilder(); + _routeCollection = new RouteCollection(); + _modelBinderDictionary = new ModelBinderDictionary(); + _viewEngineCollection = new ViewEngineCollection { new WebFormViewEngine() }; + + _container = OrchardStarter.CreateHostContainer( + builder => { + builder.RegisterInstance(new StubShellSettingsLoader()).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(appDataFolder).As(); + builder.RegisterInstance(_controllerBuilder); + builder.RegisterInstance(_routeCollection); + builder.RegisterInstance(_modelBinderDictionary); + builder.RegisterInstance(_viewEngineCollection); + builder.RegisterAutoMocking() + .Ignore() + .Ignore() + .Ignore() + .Ignore() + .Ignore() + .Ignore(); + }); + _lifetime = _container.BeginLifetimeScope(); + + _container.Mock() + .SetupGet(cp => cp.ApplicationContainer).Returns(_container); + _container.Mock() + .SetupGet(cp => cp.RequestLifetime).Returns(_lifetime); + _container.Mock() + .Setup(cp => cp.EndRequestLifetime()).Callback(() => _lifetime.Dispose()); + + _container.Mock() + .Setup(cp => cp.GetShellDescriptor()).Returns(default(ShellDescriptor)); + + _container.Mock() + .Setup(e => e.Activated()); + + _container.Mock() + .Setup(e => e.Terminating()).Callback(() => new object()); + } + + public class StubExtensionManager : IExtensionManager { + public ExtensionDescriptor GetExtension(string name) { + throw new NotImplementedException(); + } + + public IEnumerable AvailableExtensions() { + var ext = new ExtensionDescriptor { Id = "Orchard.Framework" }; + ext.Features = new[] { new FeatureDescriptor { Extension = ext, Id = ext.Id } }; + yield return ext; + } + + public IEnumerable AvailableFeatures() { + // note - doesn't order properly + return AvailableExtensions().SelectMany(ed => ed.Features); + } + + public IEnumerable LoadFeatures(IEnumerable featureDescriptors) { + foreach (var descriptor in featureDescriptors) { + if (descriptor.Id == "Orchard.Framework") { + yield return FrameworkFeature(descriptor); + } + } + } + + private Feature FrameworkFeature(FeatureDescriptor descriptor) { + return new Feature { + Descriptor = descriptor, + ExportedTypes = new[] { + typeof (TestDependency), + typeof (TestSingletonDependency), + typeof (TestTransientDependency), + } + }; + } + + public void Monitor(Action monitor) { + throw new NotImplementedException(); + } + } + + public class StubShellSettingsLoader : IShellSettingsManager { + private readonly List _shellSettings = new List { new ShellSettings { Name = ShellSettings.DefaultName, State = TenantState.Running } }; + + public IEnumerable LoadSettings() { + return _shellSettings.AsEnumerable(); + } + + public void SaveSettings(ShellSettings settings) { + _shellSettings.Add(settings); + } + } + + + + [Test, Ignore("containers are disposed when calling BeginRequest, maybe by the StubVirtualPathMonitor")] + public void NormalDependenciesShouldBeUniquePerRequestContainer() { + var host = _lifetime.Resolve(); + var container1 = host.CreateShellContainer_Obsolete(); + ((IShellDescriptorManagerEventHandler)host).Changed(null, ShellSettings.DefaultName); + host.BeginRequest(); // force reloading the shell + var container2 = host.CreateShellContainer_Obsolete(); + var requestContainer1a = container1.BeginLifetimeScope(); + var requestContainer1b = container1.BeginLifetimeScope(); + var requestContainer2a = container2.BeginLifetimeScope(); + var requestContainer2b = container2.BeginLifetimeScope(); + + var dep1 = container1.Resolve(); + var dep1a = requestContainer1a.Resolve(); + var dep1b = requestContainer1b.Resolve(); + var dep2 = container2.Resolve(); + var dep2a = requestContainer2a.Resolve(); + var dep2b = requestContainer2b.Resolve(); + + Assert.That(dep1, Is.Not.SameAs(dep2)); + Assert.That(dep1, Is.Not.SameAs(dep1a)); + Assert.That(dep1, Is.Not.SameAs(dep1b)); + Assert.That(dep2, Is.Not.SameAs(dep2a)); + Assert.That(dep2, Is.Not.SameAs(dep2b)); + + var again1 = container1.Resolve(); + var again1a = requestContainer1a.Resolve(); + var again1b = requestContainer1b.Resolve(); + var again2 = container2.Resolve(); + var again2a = requestContainer2a.Resolve(); + var again2b = requestContainer2b.Resolve(); + + Assert.That(again1, Is.SameAs(dep1)); + Assert.That(again1a, Is.SameAs(dep1a)); + Assert.That(again1b, Is.SameAs(dep1b)); + Assert.That(again2, Is.SameAs(dep2)); + Assert.That(again2a, Is.SameAs(dep2a)); + Assert.That(again2b, Is.SameAs(dep2b)); + } + [Test] + public void SingletonDependenciesShouldBeUniquePerShell() { + var host = _lifetime.Resolve(); + var container1 = host.CreateShellContainer_Obsolete(); + var container2 = host.CreateShellContainer_Obsolete(); + var requestContainer1a = container1.BeginLifetimeScope(); + var requestContainer1b = container1.BeginLifetimeScope(); + var requestContainer2a = container2.BeginLifetimeScope(); + var requestContainer2b = container2.BeginLifetimeScope(); + + var dep1 = container1.Resolve(); + var dep1a = requestContainer1a.Resolve(); + var dep1b = requestContainer1b.Resolve(); + var dep2 = container2.Resolve(); + var dep2a = requestContainer2a.Resolve(); + var dep2b = requestContainer2b.Resolve(); + + //Assert.That(dep1, Is.Not.SameAs(dep2)); + Assert.That(dep1, Is.SameAs(dep1a)); + Assert.That(dep1, Is.SameAs(dep1b)); + Assert.That(dep2, Is.SameAs(dep2a)); + Assert.That(dep2, Is.SameAs(dep2b)); + } + [Test] + public void TransientDependenciesShouldBeUniquePerResolve() { + var host = _lifetime.Resolve(); + var container1 = host.CreateShellContainer_Obsolete(); + var container2 = host.CreateShellContainer_Obsolete(); + var requestContainer1a = container1.BeginLifetimeScope(); + var requestContainer1b = container1.BeginLifetimeScope(); + var requestContainer2a = container2.BeginLifetimeScope(); + var requestContainer2b = container2.BeginLifetimeScope(); + + var dep1 = container1.Resolve(); + var dep1a = requestContainer1a.Resolve(); + var dep1b = requestContainer1b.Resolve(); + var dep2 = container2.Resolve(); + var dep2a = requestContainer2a.Resolve(); + var dep2b = requestContainer2b.Resolve(); + + Assert.That(dep1, Is.Not.SameAs(dep2)); + Assert.That(dep1, Is.Not.SameAs(dep1a)); + Assert.That(dep1, Is.Not.SameAs(dep1b)); + Assert.That(dep2, Is.Not.SameAs(dep2a)); + Assert.That(dep2, Is.Not.SameAs(dep2b)); + + var again1 = container1.Resolve(); + var again1a = requestContainer1a.Resolve(); + var again1b = requestContainer1b.Resolve(); + var again2 = container2.Resolve(); + var again2a = requestContainer2a.Resolve(); + var again2b = requestContainer2b.Resolve(); + + Assert.That(again1, Is.Not.SameAs(dep1)); + Assert.That(again1a, Is.Not.SameAs(dep1a)); + Assert.That(again1b, Is.Not.SameAs(dep1b)); + Assert.That(again2, Is.Not.SameAs(dep2)); + Assert.That(again2a, Is.Not.SameAs(dep2a)); + Assert.That(again2b, Is.Not.SameAs(dep2b)); + + } + } + + public static class TextExtensions { + public static ILifetimeScope CreateShellContainer_Obsolete(this IOrchardHost host) { + return ((DefaultOrchardHost)host) + .Current + .Single(x => x.Settings.Name == ShellSettings.DefaultName) + .LifetimeScope; + } + + public static IOrchardShell CreateShell_Obsolete(this IOrchardHost host) { + return host.CreateShellContainer_Obsolete().Resolve(); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Environment/DefaultOrchardShellTests.cs b/src/Orchard.Tests/Environment/DefaultOrchardShellTests.cs index d180cb70adc..ac9aad7b469 100644 --- a/src/Orchard.Tests/Environment/DefaultOrchardShellTests.cs +++ b/src/Orchard.Tests/Environment/DefaultOrchardShellTests.cs @@ -1,92 +1,92 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using System.Web.Mvc; -using System.Web.Routing; -using NUnit.Framework; -using Orchard.Mvc.ModelBinders; -using Orchard.Mvc.Routes; -using IModelBinderProvider = Orchard.Mvc.ModelBinders.IModelBinderProvider; - -namespace Orchard.Tests.Environment { - [TestFixture] - public class DefaultOrchardShellTests { - static RouteDescriptor Desc(string name, string url) { - return new RouteDescriptor { Name = name, Route = new Route(url, new MvcRouteHandler()) }; - } - - static ModelBinderDescriptor BinderDesc(Type type, IModelBinder modelBinder) { - return new ModelBinderDescriptor { Type = type, ModelBinder = modelBinder }; - } - - //[Test] - //public void ActivatingRuntimeCausesRoutesAndModelBindersToBePublished() { - - // var provider1 = new StubRouteProvider(new[] { Desc("foo1", "foo1"), Desc("foo2", "foo2") }); - // var provider2 = new StubRouteProvider(new[] { Desc("foo1", "foo1"), Desc("foo2", "foo2") }); - // var publisher = new StubRoutePublisher(); - - // var modelBinderProvider1 = new StubModelBinderProvider(new[] { BinderDesc(typeof(object), null), BinderDesc(typeof(string), null) }); - // var modelBinderProvider2 = new StubModelBinderProvider(new[] { BinderDesc(typeof(int), null), BinderDesc(typeof(long), null) }); - // var modelBinderPublisher = new StubModelBinderPublisher(); - - // var runtime = new DefaultOrchardShell( - // new[] { provider1, provider2 }, - // publisher, - // new[] { modelBinderProvider1, modelBinderProvider2 }, - // modelBinderPublisher, - // new ViewEngineCollection { new WebFormViewEngine() }, - // new Mock().Object); - - // runtime.Activate(); - - // Assert.That(publisher.Routes.Count(), Is.EqualTo(4)); - // Assert.That(modelBinderPublisher.ModelBinders.Count(), Is.EqualTo(4)); - //} - - public class StubRouteProvider : IRouteProvider { - private readonly IEnumerable _routes; - - public StubRouteProvider(IEnumerable routes) { - _routes = routes; - } - - public IEnumerable GetRoutes() { - return _routes; - } - - public void GetRoutes(ICollection routes) { - foreach (var routeDescriptor in GetRoutes()) - routes.Add(routeDescriptor); - } - } - - public class StubRoutePublisher : IRoutePublisher { - public void Publish(IEnumerable routes) { - Routes = routes; - } - public IEnumerable Routes { get; set; } - public void Publish(IEnumerable routes, Func, Task> pipeline) { - } - } - - public class StubModelBinderProvider : IModelBinderProvider { - private readonly IEnumerable _binders; - - public StubModelBinderProvider(IEnumerable routes) { - _binders = routes; - } - - public IEnumerable GetModelBinders() { - return _binders; - } - } - - public class StubModelBinderPublisher : IModelBinderPublisher { - public void Publish(IEnumerable modelBinders) { - ModelBinders = modelBinders; - } - public IEnumerable ModelBinders { get; set; } - } - } -} +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using System.Web.Mvc; +using System.Web.Routing; +using NUnit.Framework; +using Orchard.Mvc.ModelBinders; +using Orchard.Mvc.Routes; +using IModelBinderProvider = Orchard.Mvc.ModelBinders.IModelBinderProvider; + +namespace Orchard.Tests.Environment { + [TestFixture] + public class DefaultOrchardShellTests { + static RouteDescriptor Desc(string name, string url) { + return new RouteDescriptor { Name = name, Route = new Route(url, new MvcRouteHandler()) }; + } + + static ModelBinderDescriptor BinderDesc(Type type, IModelBinder modelBinder) { + return new ModelBinderDescriptor { Type = type, ModelBinder = modelBinder }; + } + + //[Test] + //public void ActivatingRuntimeCausesRoutesAndModelBindersToBePublished() { + + // var provider1 = new StubRouteProvider(new[] { Desc("foo1", "foo1"), Desc("foo2", "foo2") }); + // var provider2 = new StubRouteProvider(new[] { Desc("foo1", "foo1"), Desc("foo2", "foo2") }); + // var publisher = new StubRoutePublisher(); + + // var modelBinderProvider1 = new StubModelBinderProvider(new[] { BinderDesc(typeof(object), null), BinderDesc(typeof(string), null) }); + // var modelBinderProvider2 = new StubModelBinderProvider(new[] { BinderDesc(typeof(int), null), BinderDesc(typeof(long), null) }); + // var modelBinderPublisher = new StubModelBinderPublisher(); + + // var runtime = new DefaultOrchardShell( + // new[] { provider1, provider2 }, + // publisher, + // new[] { modelBinderProvider1, modelBinderProvider2 }, + // modelBinderPublisher, + // new ViewEngineCollection { new WebFormViewEngine() }, + // new Mock().Object); + + // runtime.Activate(); + + // Assert.That(publisher.Routes.Count(), Is.EqualTo(4)); + // Assert.That(modelBinderPublisher.ModelBinders.Count(), Is.EqualTo(4)); + //} + + public class StubRouteProvider : IRouteProvider { + private readonly IEnumerable _routes; + + public StubRouteProvider(IEnumerable routes) { + _routes = routes; + } + + public IEnumerable GetRoutes() { + return _routes; + } + + public void GetRoutes(ICollection routes) { + foreach (var routeDescriptor in GetRoutes()) + routes.Add(routeDescriptor); + } + } + + public class StubRoutePublisher : IRoutePublisher { + public void Publish(IEnumerable routes) { + Routes = routes; + } + public IEnumerable Routes { get; set; } + public void Publish(IEnumerable routes, Func, Task> pipeline) { + } + } + + public class StubModelBinderProvider : IModelBinderProvider { + private readonly IEnumerable _binders; + + public StubModelBinderProvider(IEnumerable routes) { + _binders = routes; + } + + public IEnumerable GetModelBinders() { + return _binders; + } + } + + public class StubModelBinderPublisher : IModelBinderPublisher { + public void Publish(IEnumerable modelBinders) { + ModelBinders = modelBinders; + } + public IEnumerable ModelBinders { get; set; } + } + } +} diff --git a/src/Orchard.Tests/Environment/DefaultWorkContextAccessorTests.cs b/src/Orchard.Tests/Environment/DefaultWorkContextAccessorTests.cs index 27ab4873bb0..b1ad6593941 100644 --- a/src/Orchard.Tests/Environment/DefaultWorkContextAccessorTests.cs +++ b/src/Orchard.Tests/Environment/DefaultWorkContextAccessorTests.cs @@ -1,180 +1,180 @@ -using System.Web; -using Autofac; -using Moq; -using NUnit.Framework; -using Orchard.Environment; -using Orchard.Mvc; -using Orchard.Tests.Stubs; -using Orchard.Tests.Utility; - -namespace Orchard.Tests.Environment { - [TestFixture] - public class DefaultWorkContextAccessorTests : ContainerTestBase { - - HttpContextBase _httpContextCurrent; - - public override void Init() { - _httpContextCurrent = null; - base.Init(); - } - - protected override void Register(ContainerBuilder builder) { - builder.RegisterModule(new WorkContextModule()); - builder.RegisterType().As(); - builder.RegisterAutoMocking(); - } - - protected override void Resolve(ILifetimeScope container) { - container.Mock() - .Setup(x => x.Current()) - .Returns(() => _httpContextCurrent); - } - - [Test] - public void ScopeIsCreatedAndCanBeRetrievedFromHttpContextBase() { - var accessor = _container.Resolve(); - var httpContext = new StubHttpContext(); - - var workContextScope = accessor.CreateWorkContextScope(httpContext); - Assert.That(workContextScope.WorkContext, Is.Not.Null); - - var workContext = accessor.GetContext(httpContext); - Assert.That(workContext, Is.SameAs(workContextScope.WorkContext)); - } - - [Test] - public void DifferentHttpContextWillHoldDifferentWorkContext() { - var accessor = _container.Resolve(); - var httpContext1 = new StubHttpContext(); - var workContextScope1 = accessor.CreateWorkContextScope(httpContext1); - var workContext1 = accessor.GetContext(httpContext1); - - var httpContext2 = new StubHttpContext(); - var workContextScope2 = accessor.CreateWorkContextScope(httpContext2); - var workContext2 = accessor.GetContext(httpContext2); - - Assert.That(workContext1, Is.Not.Null); - Assert.That(workContext1, Is.SameAs(workContextScope1.WorkContext)); - Assert.That(workContext2, Is.Not.Null); - Assert.That(workContext2, Is.SameAs(workContextScope2.WorkContext)); - Assert.That(workContext1, Is.Not.SameAs(workContext2)); - } - - [Test] - public void ContextIsNullAfterDisposingScope() { - var accessor = _container.Resolve(); - var httpContext = new StubHttpContext(); - - Assert.That(accessor.GetContext(httpContext), Is.Null); - - var scope = accessor.CreateWorkContextScope(httpContext); - Assert.That(accessor.GetContext(httpContext), Is.Not.Null); - - scope.Dispose(); - Assert.That(accessor.GetContext(httpContext), Is.Null); - } - - [Test] - public void DifferentChildScopesWillNotCollideInTheSameHttpContext() { - var shell1 = _container.BeginLifetimeScope(); - var accessor1 = shell1.Resolve(); - - var shell2 = _container.BeginLifetimeScope(); - var accessor2 = shell2.Resolve(); - - var httpContext = new StubHttpContext(); - - Assert.That(accessor1.GetContext(httpContext), Is.Null); - Assert.That(accessor2.GetContext(httpContext), Is.Null); - - var scope1 = accessor1.CreateWorkContextScope(httpContext); - Assert.That(accessor1.GetContext(httpContext), Is.Not.Null); - Assert.That(accessor2.GetContext(httpContext), Is.Null); - - var scope2 = accessor2.CreateWorkContextScope(httpContext); - Assert.That(accessor1.GetContext(httpContext), Is.Not.Null); - Assert.That(accessor2.GetContext(httpContext), Is.Not.Null); - - scope1.Dispose(); - Assert.That(accessor1.GetContext(httpContext), Is.Null); - Assert.That(accessor2.GetContext(httpContext), Is.Not.Null); - - scope2.Dispose(); - Assert.That(accessor1.GetContext(httpContext), Is.Null); - Assert.That(accessor2.GetContext(httpContext), Is.Null); - } - - - [Test] - public void FunctionsByDefaultAgainstAmbientHttpContext() { - var accessor = _container.Resolve(); - - var explicitHttpContext = new StubHttpContext(); - var ambientHttpContext = new StubHttpContext(); - - _httpContextCurrent = ambientHttpContext; - - Assert.That(accessor.GetContext(), Is.Null); - Assert.That(accessor.GetContext(ambientHttpContext), Is.Null); - Assert.That(accessor.GetContext(explicitHttpContext), Is.Null); - - var scope = accessor.CreateWorkContextScope(); - Assert.That(accessor.GetContext(), Is.Not.Null); - Assert.That(accessor.GetContext(ambientHttpContext), Is.Not.Null); - Assert.That(accessor.GetContext(explicitHttpContext), Is.Null); - Assert.That(accessor.GetContext(), Is.SameAs(accessor.GetContext(ambientHttpContext))); - - _httpContextCurrent = explicitHttpContext; - Assert.That(accessor.GetContext(), Is.Null); - - _httpContextCurrent = ambientHttpContext; - Assert.That(accessor.GetContext(), Is.Not.Null); - - scope.Dispose(); - Assert.That(accessor.GetContext(), Is.Null); - } - - - [Test] - public void StillFunctionsWithoutAmbientHttpContext() { - var accessor = _container.Resolve(); - - Assert.That(accessor.GetContext(), Is.Null); - - var scope = accessor.CreateWorkContextScope(); - Assert.That(accessor.GetContext(), Is.Not.Null); - - scope.Dispose(); - Assert.That(accessor.GetContext(), Is.Null); - } - - [Test] - public void DifferentChildScopesWillNotCollideWithoutAmbientHttpContext() { - var shell1 = _container.BeginLifetimeScope(); - var accessor1 = shell1.Resolve(); - - var shell2 = _container.BeginLifetimeScope(); - var accessor2 = shell2.Resolve(); - - Assert.That(accessor1.GetContext(), Is.Null); - Assert.That(accessor2.GetContext(), Is.Null); - - var scope1 = accessor1.CreateWorkContextScope(); - Assert.That(accessor1.GetContext(), Is.Not.Null); - Assert.That(accessor2.GetContext(), Is.Null); - - var scope2 = accessor2.CreateWorkContextScope(); - Assert.That(accessor1.GetContext(), Is.Not.Null); - Assert.That(accessor2.GetContext(), Is.Not.Null); - - scope1.Dispose(); - Assert.That(accessor1.GetContext(), Is.Null); - Assert.That(accessor2.GetContext(), Is.Not.Null); - - scope2.Dispose(); - Assert.That(accessor1.GetContext(), Is.Null); - Assert.That(accessor2.GetContext(), Is.Null); - } - - } -} +using System.Web; +using Autofac; +using Moq; +using NUnit.Framework; +using Orchard.Environment; +using Orchard.Mvc; +using Orchard.Tests.Stubs; +using Orchard.Tests.Utility; + +namespace Orchard.Tests.Environment { + [TestFixture] + public class DefaultWorkContextAccessorTests : ContainerTestBase { + + HttpContextBase _httpContextCurrent; + + public override void Init() { + _httpContextCurrent = null; + base.Init(); + } + + protected override void Register(ContainerBuilder builder) { + builder.RegisterModule(new WorkContextModule()); + builder.RegisterType().As(); + builder.RegisterAutoMocking(); + } + + protected override void Resolve(ILifetimeScope container) { + container.Mock() + .Setup(x => x.Current()) + .Returns(() => _httpContextCurrent); + } + + [Test] + public void ScopeIsCreatedAndCanBeRetrievedFromHttpContextBase() { + var accessor = _container.Resolve(); + var httpContext = new StubHttpContext(); + + var workContextScope = accessor.CreateWorkContextScope(httpContext); + Assert.That(workContextScope.WorkContext, Is.Not.Null); + + var workContext = accessor.GetContext(httpContext); + Assert.That(workContext, Is.SameAs(workContextScope.WorkContext)); + } + + [Test] + public void DifferentHttpContextWillHoldDifferentWorkContext() { + var accessor = _container.Resolve(); + var httpContext1 = new StubHttpContext(); + var workContextScope1 = accessor.CreateWorkContextScope(httpContext1); + var workContext1 = accessor.GetContext(httpContext1); + + var httpContext2 = new StubHttpContext(); + var workContextScope2 = accessor.CreateWorkContextScope(httpContext2); + var workContext2 = accessor.GetContext(httpContext2); + + Assert.That(workContext1, Is.Not.Null); + Assert.That(workContext1, Is.SameAs(workContextScope1.WorkContext)); + Assert.That(workContext2, Is.Not.Null); + Assert.That(workContext2, Is.SameAs(workContextScope2.WorkContext)); + Assert.That(workContext1, Is.Not.SameAs(workContext2)); + } + + [Test] + public void ContextIsNullAfterDisposingScope() { + var accessor = _container.Resolve(); + var httpContext = new StubHttpContext(); + + Assert.That(accessor.GetContext(httpContext), Is.Null); + + var scope = accessor.CreateWorkContextScope(httpContext); + Assert.That(accessor.GetContext(httpContext), Is.Not.Null); + + scope.Dispose(); + Assert.That(accessor.GetContext(httpContext), Is.Null); + } + + [Test] + public void DifferentChildScopesWillNotCollideInTheSameHttpContext() { + var shell1 = _container.BeginLifetimeScope(); + var accessor1 = shell1.Resolve(); + + var shell2 = _container.BeginLifetimeScope(); + var accessor2 = shell2.Resolve(); + + var httpContext = new StubHttpContext(); + + Assert.That(accessor1.GetContext(httpContext), Is.Null); + Assert.That(accessor2.GetContext(httpContext), Is.Null); + + var scope1 = accessor1.CreateWorkContextScope(httpContext); + Assert.That(accessor1.GetContext(httpContext), Is.Not.Null); + Assert.That(accessor2.GetContext(httpContext), Is.Null); + + var scope2 = accessor2.CreateWorkContextScope(httpContext); + Assert.That(accessor1.GetContext(httpContext), Is.Not.Null); + Assert.That(accessor2.GetContext(httpContext), Is.Not.Null); + + scope1.Dispose(); + Assert.That(accessor1.GetContext(httpContext), Is.Null); + Assert.That(accessor2.GetContext(httpContext), Is.Not.Null); + + scope2.Dispose(); + Assert.That(accessor1.GetContext(httpContext), Is.Null); + Assert.That(accessor2.GetContext(httpContext), Is.Null); + } + + + [Test] + public void FunctionsByDefaultAgainstAmbientHttpContext() { + var accessor = _container.Resolve(); + + var explicitHttpContext = new StubHttpContext(); + var ambientHttpContext = new StubHttpContext(); + + _httpContextCurrent = ambientHttpContext; + + Assert.That(accessor.GetContext(), Is.Null); + Assert.That(accessor.GetContext(ambientHttpContext), Is.Null); + Assert.That(accessor.GetContext(explicitHttpContext), Is.Null); + + var scope = accessor.CreateWorkContextScope(); + Assert.That(accessor.GetContext(), Is.Not.Null); + Assert.That(accessor.GetContext(ambientHttpContext), Is.Not.Null); + Assert.That(accessor.GetContext(explicitHttpContext), Is.Null); + Assert.That(accessor.GetContext(), Is.SameAs(accessor.GetContext(ambientHttpContext))); + + _httpContextCurrent = explicitHttpContext; + Assert.That(accessor.GetContext(), Is.Null); + + _httpContextCurrent = ambientHttpContext; + Assert.That(accessor.GetContext(), Is.Not.Null); + + scope.Dispose(); + Assert.That(accessor.GetContext(), Is.Null); + } + + + [Test] + public void StillFunctionsWithoutAmbientHttpContext() { + var accessor = _container.Resolve(); + + Assert.That(accessor.GetContext(), Is.Null); + + var scope = accessor.CreateWorkContextScope(); + Assert.That(accessor.GetContext(), Is.Not.Null); + + scope.Dispose(); + Assert.That(accessor.GetContext(), Is.Null); + } + + [Test] + public void DifferentChildScopesWillNotCollideWithoutAmbientHttpContext() { + var shell1 = _container.BeginLifetimeScope(); + var accessor1 = shell1.Resolve(); + + var shell2 = _container.BeginLifetimeScope(); + var accessor2 = shell2.Resolve(); + + Assert.That(accessor1.GetContext(), Is.Null); + Assert.That(accessor2.GetContext(), Is.Null); + + var scope1 = accessor1.CreateWorkContextScope(); + Assert.That(accessor1.GetContext(), Is.Not.Null); + Assert.That(accessor2.GetContext(), Is.Null); + + var scope2 = accessor2.CreateWorkContextScope(); + Assert.That(accessor1.GetContext(), Is.Not.Null); + Assert.That(accessor2.GetContext(), Is.Not.Null); + + scope1.Dispose(); + Assert.That(accessor1.GetContext(), Is.Null); + Assert.That(accessor2.GetContext(), Is.Not.Null); + + scope2.Dispose(); + Assert.That(accessor1.GetContext(), Is.Null); + Assert.That(accessor2.GetContext(), Is.Null); + } + + } +} diff --git a/src/Orchard.Tests/Environment/Extensions/ExtensionFoldersTests.cs b/src/Orchard.Tests/Environment/Extensions/ExtensionFoldersTests.cs index 99b4fa82c6f..8aa8d6cb804 100644 --- a/src/Orchard.Tests/Environment/Extensions/ExtensionFoldersTests.cs +++ b/src/Orchard.Tests/Environment/Extensions/ExtensionFoldersTests.cs @@ -1,100 +1,100 @@ -using System.IO; -using System.Linq; -using Moq; -using NUnit.Framework; -using Orchard.Environment.Extensions; -using Orchard.Environment.Extensions.Folders; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.Environment.Extensions { - [TestFixture] - public class ExtensionFoldersTests { - private const string DataPrefix = "Orchard.Tests.Environment.Extensions.FoldersData."; - private string _tempFolderName; - - [SetUp] - public void Init() { - _tempFolderName = Path.GetTempFileName(); - File.Delete(_tempFolderName); - var assembly = GetType().Assembly; - foreach (var name in assembly.GetManifestResourceNames()) { - if (name.StartsWith(DataPrefix)) { - var text = ""; - using (var stream = assembly.GetManifestResourceStream(name)) { - using (var reader = new StreamReader(stream)) - text = reader.ReadToEnd(); - - } - - var relativePath = name - .Substring(DataPrefix.Length) - .Replace(".txt", ":txt") - .Replace('.', Path.DirectorySeparatorChar) - .Replace(":txt", ".txt"); - - var targetPath = Path.Combine(_tempFolderName, relativePath); - - Directory.CreateDirectory(Path.GetDirectoryName(targetPath)); - using (var stream = new FileStream(targetPath, FileMode.Create)) { - using (var writer = new StreamWriter(stream)) { - writer.Write(text); - } - } - } - } - } - - [TearDown] - public void Term() { - Directory.Delete(_tempFolderName, true); - } - - [Test] - public void IdsFromFoldersWithModuleTxtShouldBeListed() { - var harvester = new ExtensionHarvester(new StubCacheManager(), new StubWebSiteFolder(), new Mock().Object); - IExtensionFolders folders = new ModuleFolders(new[] { _tempFolderName }, harvester); - var ids = folders.AvailableExtensions().Select(d => d.Id); - Assert.That(ids.Count(), Is.EqualTo(5)); - Assert.That(ids, Has.Some.EqualTo("Sample1")); // Sample1 - obviously - Assert.That(ids, Has.Some.EqualTo("Sample3")); // Sample3 - Assert.That(ids, Has.Some.EqualTo("Sample4")); // Sample4 - Assert.That(ids, Has.Some.EqualTo("Sample6")); // Sample6 - Assert.That(ids, Has.Some.EqualTo("Sample7")); // Sample7 - } - - [Test] - public void ModuleTxtShouldBeParsedAndReturnedAsYamlDocument() { - var harvester = new ExtensionHarvester(new StubCacheManager(), new StubWebSiteFolder(), new Mock().Object); - IExtensionFolders folders = new ModuleFolders(new[] { _tempFolderName }, harvester); - var sample1 = folders.AvailableExtensions().Single(d => d.Id == "Sample1"); - Assert.That(sample1.Id, Is.Not.Empty); - Assert.That(sample1.Author, Is.EqualTo("Bertrand Le Roy")); // Sample1 - } - - [Test] - public void NamesFromFoldersWithModuleTxtShouldFallBackToIdIfNotGiven() { - var harvester = new ExtensionHarvester(new StubCacheManager(), new StubWebSiteFolder(), new Mock().Object); - IExtensionFolders folders = new ModuleFolders(new[] { _tempFolderName }, harvester); - var names = folders.AvailableExtensions().Select(d => d.Name); - Assert.That(names.Count(), Is.EqualTo(5)); - Assert.That(names, Has.Some.EqualTo("Le plug-in français")); // Sample1 - Assert.That(names, Has.Some.EqualTo("This is another test.txt")); // Sample3 - Assert.That(names, Has.Some.EqualTo("Sample4")); // Sample4 - Assert.That(names, Has.Some.EqualTo("SampleSix")); // Sample6 - Assert.That(names, Has.Some.EqualTo("Sample7")); // Sample7 - } - - [Test] - public void PathsFromFoldersWithModuleTxtShouldFallBackAppropriatelyIfNotGiven() { - var harvester = new ExtensionHarvester(new StubCacheManager(), new StubWebSiteFolder(), new Mock().Object); - IExtensionFolders folders = new ModuleFolders(new[] { _tempFolderName }, harvester); - var paths = folders.AvailableExtensions().Select(d => d.Path); - Assert.That(paths.Count(), Is.EqualTo(5)); - Assert.That(paths, Has.Some.EqualTo("Sample1")); // Sample1 - Id, Name invalid URL segment - Assert.That(paths, Has.Some.EqualTo("Sample3")); // Sample3 - Id, Name invalid URL segment - Assert.That(paths, Has.Some.EqualTo("ThisIs.Sample4")); // Sample4 - Path - Assert.That(paths, Has.Some.EqualTo("SampleSix")); // Sample6 - Name, no Path - Assert.That(paths, Has.Some.EqualTo("Sample7")); // Sample7 - Id, no Name or Path - } - } +using System.IO; +using System.Linq; +using Moq; +using NUnit.Framework; +using Orchard.Environment.Extensions; +using Orchard.Environment.Extensions.Folders; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.Environment.Extensions { + [TestFixture] + public class ExtensionFoldersTests { + private const string DataPrefix = "Orchard.Tests.Environment.Extensions.FoldersData."; + private string _tempFolderName; + + [SetUp] + public void Init() { + _tempFolderName = Path.GetTempFileName(); + File.Delete(_tempFolderName); + var assembly = GetType().Assembly; + foreach (var name in assembly.GetManifestResourceNames()) { + if (name.StartsWith(DataPrefix)) { + var text = ""; + using (var stream = assembly.GetManifestResourceStream(name)) { + using (var reader = new StreamReader(stream)) + text = reader.ReadToEnd(); + + } + + var relativePath = name + .Substring(DataPrefix.Length) + .Replace(".txt", ":txt") + .Replace('.', Path.DirectorySeparatorChar) + .Replace(":txt", ".txt"); + + var targetPath = Path.Combine(_tempFolderName, relativePath); + + Directory.CreateDirectory(Path.GetDirectoryName(targetPath)); + using (var stream = new FileStream(targetPath, FileMode.Create)) { + using (var writer = new StreamWriter(stream)) { + writer.Write(text); + } + } + } + } + } + + [TearDown] + public void Term() { + Directory.Delete(_tempFolderName, true); + } + + [Test] + public void IdsFromFoldersWithModuleTxtShouldBeListed() { + var harvester = new ExtensionHarvester(new StubCacheManager(), new StubWebSiteFolder(), new Mock().Object); + IExtensionFolders folders = new ModuleFolders(new[] { _tempFolderName }, harvester); + var ids = folders.AvailableExtensions().Select(d => d.Id); + Assert.That(ids.Count(), Is.EqualTo(5)); + Assert.That(ids, Has.Some.EqualTo("Sample1")); // Sample1 - obviously + Assert.That(ids, Has.Some.EqualTo("Sample3")); // Sample3 + Assert.That(ids, Has.Some.EqualTo("Sample4")); // Sample4 + Assert.That(ids, Has.Some.EqualTo("Sample6")); // Sample6 + Assert.That(ids, Has.Some.EqualTo("Sample7")); // Sample7 + } + + [Test] + public void ModuleTxtShouldBeParsedAndReturnedAsYamlDocument() { + var harvester = new ExtensionHarvester(new StubCacheManager(), new StubWebSiteFolder(), new Mock().Object); + IExtensionFolders folders = new ModuleFolders(new[] { _tempFolderName }, harvester); + var sample1 = folders.AvailableExtensions().Single(d => d.Id == "Sample1"); + Assert.That(sample1.Id, Is.Not.Empty); + Assert.That(sample1.Author, Is.EqualTo("Bertrand Le Roy")); // Sample1 + } + + [Test] + public void NamesFromFoldersWithModuleTxtShouldFallBackToIdIfNotGiven() { + var harvester = new ExtensionHarvester(new StubCacheManager(), new StubWebSiteFolder(), new Mock().Object); + IExtensionFolders folders = new ModuleFolders(new[] { _tempFolderName }, harvester); + var names = folders.AvailableExtensions().Select(d => d.Name); + Assert.That(names.Count(), Is.EqualTo(5)); + Assert.That(names, Has.Some.EqualTo("Le plug-in français")); // Sample1 + Assert.That(names, Has.Some.EqualTo("This is another test.txt")); // Sample3 + Assert.That(names, Has.Some.EqualTo("Sample4")); // Sample4 + Assert.That(names, Has.Some.EqualTo("SampleSix")); // Sample6 + Assert.That(names, Has.Some.EqualTo("Sample7")); // Sample7 + } + + [Test] + public void PathsFromFoldersWithModuleTxtShouldFallBackAppropriatelyIfNotGiven() { + var harvester = new ExtensionHarvester(new StubCacheManager(), new StubWebSiteFolder(), new Mock().Object); + IExtensionFolders folders = new ModuleFolders(new[] { _tempFolderName }, harvester); + var paths = folders.AvailableExtensions().Select(d => d.Path); + Assert.That(paths.Count(), Is.EqualTo(5)); + Assert.That(paths, Has.Some.EqualTo("Sample1")); // Sample1 - Id, Name invalid URL segment + Assert.That(paths, Has.Some.EqualTo("Sample3")); // Sample3 - Id, Name invalid URL segment + Assert.That(paths, Has.Some.EqualTo("ThisIs.Sample4")); // Sample4 - Path + Assert.That(paths, Has.Some.EqualTo("SampleSix")); // Sample6 - Name, no Path + Assert.That(paths, Has.Some.EqualTo("Sample7")); // Sample7 - Id, no Name or Path + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Environment/Extensions/ExtensionLoaderCoordinatorTests.cs b/src/Orchard.Tests/Environment/Extensions/ExtensionLoaderCoordinatorTests.cs index 94f07fb6d91..b4bbbb1c171 100644 --- a/src/Orchard.Tests/Environment/Extensions/ExtensionLoaderCoordinatorTests.cs +++ b/src/Orchard.Tests/Environment/Extensions/ExtensionLoaderCoordinatorTests.cs @@ -1,531 +1,531 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using Autofac; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.Environment.Extensions; -using Orchard.Environment.Extensions.Folders; -using Orchard.Environment.Extensions.Loaders; -using Orchard.Environment.Extensions.Models; -using Orchard.FileSystems.Dependencies; -using Orchard.Tests.Extensions.ExtensionTypes; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.Environment.Extensions { - [TestFixture] - public class ExtensionLoaderCoordinatorTests { - private IContainer _container; - private IExtensionManager _manager; - private StubFolders _folders; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - _folders = new StubFolders(DefaultExtensionTypes.Module); - builder.RegisterInstance(_folders).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - _container = builder.Build(); - _manager = _container.Resolve(); - } - - public class StubFolders : IExtensionFolders { - private readonly string _extensionType; - - public StubFolders(string extensionType) { - _extensionType = extensionType; - Manifests = new Dictionary(); - } - - public IDictionary Manifests { get; set; } - - public IEnumerable AvailableExtensions() { - foreach (var e in Manifests) { - string name = e.Key; - yield return ExtensionHarvester.GetDescriptorForExtension("~/", name, _extensionType, Manifests[name]); - } - } - } - - public class StubLoaders : IExtensionLoader { - #region Implementation of IExtensionLoader - - public int Order { - get { return 1; } - } - - public string Name { - get { return this.GetType().Name; } - } - - public Assembly LoadReference(DependencyReferenceDescriptor reference) { - throw new NotImplementedException(); - } - - public void ReferenceActivated(ExtensionLoadingContext context, ExtensionReferenceProbeEntry referenceEntry) { - throw new NotImplementedException(); - } - - public void ReferenceDeactivated(ExtensionLoadingContext context, ExtensionReferenceProbeEntry referenceEntry) { - throw new NotImplementedException(); - } - - public bool IsCompatibleWithModuleReferences(ExtensionDescriptor extension, IEnumerable references) { - throw new NotImplementedException(); - } - - public ExtensionProbeEntry Probe(ExtensionDescriptor descriptor) { - return new ExtensionProbeEntry { Descriptor = descriptor, Loader = this }; - } - - public IEnumerable ProbeReferences(ExtensionDescriptor extensionDescriptor) { - throw new NotImplementedException(); - } - - public ExtensionEntry Load(ExtensionDescriptor descriptor) { - return new ExtensionEntry { Descriptor = descriptor, ExportedTypes = new[] { typeof(Alpha), typeof(Beta), typeof(Phi) } }; - } - - public void ExtensionActivated(ExtensionLoadingContext ctx, ExtensionDescriptor extension) { - throw new NotImplementedException(); - } - - public void ExtensionDeactivated(ExtensionLoadingContext ctx, ExtensionDescriptor extension) { - throw new NotImplementedException(); - } - - public void ExtensionRemoved(ExtensionLoadingContext ctx, DependencyDescriptor dependency) { - throw new NotImplementedException(); - } - - public void Monitor(ExtensionDescriptor extension, Action monitor) { - } - - public IEnumerable GetCompilationReferences(DependencyDescriptor dependency) { - throw new NotImplementedException(); - } - - public IEnumerable GetVirtualPathDependencies(DependencyDescriptor dependency) { - throw new NotImplementedException(); - } - - #endregion - } - - private ExtensionManager CreateExtensionManager(StubFolders extensionFolder, StubLoaders extensionLoader) { - return new ExtensionManager(new[] { extensionFolder }, new[] { extensionLoader }, new StubCacheManager(), new StubParallelCacheContext(), new StubAsyncTokenProvider()); - } - - [Test] - public void AvailableExtensionsShouldFollowCatalogLocations() { - _folders.Manifests.Add("foo", "Name: Foo"); - _folders.Manifests.Add("bar", "Name: Bar"); - _folders.Manifests.Add("frap", "Name: Frap"); - _folders.Manifests.Add("quad", "Name: Quad"); - - var available = _manager.AvailableExtensions(); - - Assert.That(available.Count(), Is.EqualTo(4)); - Assert.That(available, Has.Some.Property("Id").EqualTo("foo")); - } - - [Test] - public void ExtensionDescriptorsShouldHaveNameAndVersion() { - - _folders.Manifests.Add("Sample", @" -Name: Sample Extension -Version: 2.x -"); - - var descriptor = _manager.AvailableExtensions().Single(); - Assert.That(descriptor.Id, Is.EqualTo("Sample")); - Assert.That(descriptor.Name, Is.EqualTo("Sample Extension")); - Assert.That(descriptor.Version, Is.EqualTo("2.x")); - } - - [Test] - public void ExtensionDescriptorsShouldBeParsedForMinimalModuleTxt() { - - _folders.Manifests.Add("SuperWiki", @" -Name: SuperWiki -Version: 1.0.3 -OrchardVersion: 1 -Features: - SuperWiki: - Description: My super wiki module for Orchard. -"); - - var descriptor = _manager.AvailableExtensions().Single(); - Assert.That(descriptor.Id, Is.EqualTo("SuperWiki")); - Assert.That(descriptor.Version, Is.EqualTo("1.0.3")); - Assert.That(descriptor.OrchardVersion, Is.EqualTo("1")); - Assert.That(descriptor.Features.Count(), Is.EqualTo(1)); - Assert.That(descriptor.Features.First().Id, Is.EqualTo("SuperWiki")); - Assert.That(descriptor.Features.First().Extension.Id, Is.EqualTo("SuperWiki")); - Assert.That(descriptor.Features.First().Description, Is.EqualTo("My super wiki module for Orchard.")); - } - - [Test] - public void ExtensionDescriptorsShouldBeParsedForMinimalModuleTxtWithSimpleFormat() { - - _folders.Manifests.Add("SuperWiki", @" -Name: SuperWiki -Version: 1.0.3 -OrchardVersion: 1 -Description: My super wiki module for Orchard. -"); - - var descriptor = _manager.AvailableExtensions().Single(); - Assert.That(descriptor.Id, Is.EqualTo("SuperWiki")); - Assert.That(descriptor.Version, Is.EqualTo("1.0.3")); - Assert.That(descriptor.OrchardVersion, Is.EqualTo("1")); - Assert.That(descriptor.Features.Count(), Is.EqualTo(1)); - Assert.That(descriptor.Features.First().Id, Is.EqualTo("SuperWiki")); - Assert.That(descriptor.Features.First().Extension.Id, Is.EqualTo("SuperWiki")); - Assert.That(descriptor.Features.First().Description, Is.EqualTo("My super wiki module for Orchard.")); - } - - [Test] - public void ExtensionDescriptorsShouldBeParsedForCompleteModuleTxt() { - - _folders.Manifests.Add("MyCompany.AnotherWiki", @" -Name: AnotherWiki -Author: Coder Notaprogrammer -Website: http://anotherwiki.codeplex.com -Version: 1.2.3 -OrchardVersion: 1 -Features: - AnotherWiki: - Description: My super wiki module for Orchard. - Dependencies: Versioning, Search - Category: Content types - AnotherWiki Editor: - Description: A rich editor for wiki contents. - Dependencies: TinyMCE, AnotherWiki - Category: Input methods - AnotherWiki DistributionList: - Description: Sends e-mail alerts when wiki contents gets published. - Dependencies: AnotherWiki, Email Subscriptions - Category: Email - AnotherWiki Captcha: - Description: Kills spam. Or makes it zombie-like. - Dependencies: AnotherWiki, reCaptcha - Category: Spam -"); - - var descriptor = _manager.AvailableExtensions().Single(); - Assert.That(descriptor.Id, Is.EqualTo("MyCompany.AnotherWiki")); - Assert.That(descriptor.Name, Is.EqualTo("AnotherWiki")); - Assert.That(descriptor.Author, Is.EqualTo("Coder Notaprogrammer")); - Assert.That(descriptor.WebSite, Is.EqualTo("http://anotherwiki.codeplex.com")); - Assert.That(descriptor.Version, Is.EqualTo("1.2.3")); - Assert.That(descriptor.OrchardVersion, Is.EqualTo("1")); - Assert.That(descriptor.Features.Count(), Is.EqualTo(5)); - foreach (var featureDescriptor in descriptor.Features) { - switch (featureDescriptor.Id) { - case "AnotherWiki": - Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); - Assert.That(featureDescriptor.Description, Is.EqualTo("My super wiki module for Orchard.")); - Assert.That(featureDescriptor.Category, Is.EqualTo("Content types")); - Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); - Assert.That(featureDescriptor.Dependencies.Contains("Versioning")); - Assert.That(featureDescriptor.Dependencies.Contains("Search")); - break; - case "AnotherWiki Editor": - Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); - Assert.That(featureDescriptor.Description, Is.EqualTo("A rich editor for wiki contents.")); - Assert.That(featureDescriptor.Category, Is.EqualTo("Input methods")); - Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); - Assert.That(featureDescriptor.Dependencies.Contains("TinyMCE")); - Assert.That(featureDescriptor.Dependencies.Contains("AnotherWiki")); - break; - case "AnotherWiki DistributionList": - Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); - Assert.That(featureDescriptor.Description, Is.EqualTo("Sends e-mail alerts when wiki contents gets published.")); - Assert.That(featureDescriptor.Category, Is.EqualTo("Email")); - Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); - Assert.That(featureDescriptor.Dependencies.Contains("AnotherWiki")); - Assert.That(featureDescriptor.Dependencies.Contains("Email Subscriptions")); - break; - case "AnotherWiki Captcha": - Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); - Assert.That(featureDescriptor.Description, Is.EqualTo("Kills spam. Or makes it zombie-like.")); - Assert.That(featureDescriptor.Category, Is.EqualTo("Spam")); - Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); - Assert.That(featureDescriptor.Dependencies.Contains("AnotherWiki")); - Assert.That(featureDescriptor.Dependencies.Contains("reCaptcha")); - break; - // default feature. - case "MyCompany.AnotherWiki": - Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); - break; - default: - Assert.Fail("Features not parsed correctly"); - break; - } - } - } - - [Test] - public void ExtensionDescriptorsShouldBeParsedForCompleteModuleTxtWithSimpleFormat() { - - _folders.Manifests.Add("AnotherWiki", @" -Name: AnotherWiki -Author: Coder Notaprogrammer -Website: http://anotherwiki.codeplex.com -Version: 1.2.3 -OrchardVersion: 1 -Description: Module Description -FeatureDescription: My super wiki module for Orchard. -Dependencies: Versioning, Search -Category: Content types -Features: - AnotherWiki Editor: - Description: A rich editor for wiki contents. - Dependencies: TinyMCE, AnotherWiki - Category: Input methods - AnotherWiki DistributionList: - Description: Sends e-mail alerts when wiki contents gets published. - Dependencies: AnotherWiki, Email Subscriptions - Category: Email - AnotherWiki Captcha: - Description: Kills spam. Or makes it zombie-like. - Dependencies: AnotherWiki, reCaptcha - Category: Spam -"); - - var descriptor = _manager.AvailableExtensions().Single(); - Assert.That(descriptor.Id, Is.EqualTo("AnotherWiki")); - Assert.That(descriptor.Name, Is.EqualTo("AnotherWiki")); - Assert.That(descriptor.Author, Is.EqualTo("Coder Notaprogrammer")); - Assert.That(descriptor.WebSite, Is.EqualTo("http://anotherwiki.codeplex.com")); - Assert.That(descriptor.Version, Is.EqualTo("1.2.3")); - Assert.That(descriptor.OrchardVersion, Is.EqualTo("1")); - Assert.That(descriptor.Description, Is.EqualTo("Module Description")); - Assert.That(descriptor.Features.Count(), Is.EqualTo(4)); - foreach (var featureDescriptor in descriptor.Features) { - switch (featureDescriptor.Id) { - case "AnotherWiki": - Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); - Assert.That(featureDescriptor.Description, Is.EqualTo("My super wiki module for Orchard.")); - Assert.That(featureDescriptor.Category, Is.EqualTo("Content types")); - Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); - Assert.That(featureDescriptor.Dependencies.Contains("Versioning")); - Assert.That(featureDescriptor.Dependencies.Contains("Search")); - break; - case "AnotherWiki Editor": - Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); - Assert.That(featureDescriptor.Description, Is.EqualTo("A rich editor for wiki contents.")); - Assert.That(featureDescriptor.Category, Is.EqualTo("Input methods")); - Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); - Assert.That(featureDescriptor.Dependencies.Contains("TinyMCE")); - Assert.That(featureDescriptor.Dependencies.Contains("AnotherWiki")); - break; - case "AnotherWiki DistributionList": - Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); - Assert.That(featureDescriptor.Description, Is.EqualTo("Sends e-mail alerts when wiki contents gets published.")); - Assert.That(featureDescriptor.Category, Is.EqualTo("Email")); - Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); - Assert.That(featureDescriptor.Dependencies.Contains("AnotherWiki")); - Assert.That(featureDescriptor.Dependencies.Contains("Email Subscriptions")); - break; - case "AnotherWiki Captcha": - Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); - Assert.That(featureDescriptor.Description, Is.EqualTo("Kills spam. Or makes it zombie-like.")); - Assert.That(featureDescriptor.Category, Is.EqualTo("Spam")); - Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); - Assert.That(featureDescriptor.Dependencies.Contains("AnotherWiki")); - Assert.That(featureDescriptor.Dependencies.Contains("reCaptcha")); - break; - default: - Assert.Fail("Features not parsed correctly"); - break; - } - } - } - - [Test] - public void ExtensionManagerShouldLoadFeatures() { - var extensionLoader = new StubLoaders(); - var extensionFolder = new StubFolders(DefaultExtensionTypes.Module); - - extensionFolder.Manifests.Add("TestModule", @" -Name: TestModule -Version: 1.0.3 -OrchardVersion: 1 -Features: - TestModule: - Description: My test module for Orchard. - TestFeature: - Description: Contains the Phi type. -"); - - IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); - var testFeature = extensionManager.AvailableExtensions() - .SelectMany(x => x.Features); - - var features = extensionManager.LoadFeatures(testFeature); - var types = features.SelectMany(x => x.ExportedTypes); - - Assert.That(types.Count(), Is.Not.EqualTo(0)); - } - - [Test] - public void ExtensionManagerFeaturesContainNonAbstractClasses() { - var extensionLoader = new StubLoaders(); - var extensionFolder = new StubFolders(DefaultExtensionTypes.Module); - - extensionFolder.Manifests.Add("TestModule", @" -Name: TestModule -Version: 1.0.3 -OrchardVersion: 1 -Features: - TestModule: - Description: My test module for Orchard. - TestFeature: - Description: Contains the Phi type. -"); - - IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); - var testFeature = extensionManager.AvailableExtensions() - .SelectMany(x => x.Features); - - var features = extensionManager.LoadFeatures(testFeature); - var types = features.SelectMany(x => x.ExportedTypes); - - foreach (var type in types) { - Assert.That(type.IsClass); - Assert.That(!type.IsAbstract); - } - } - - [Test] - public void ExtensionManagerTestFeatureAttribute() { - var extensionLoader = new StubLoaders(); - var extensionFolder = new StubFolders(DefaultExtensionTypes.Module); - - extensionFolder.Manifests.Add("TestModule", @" -Name: TestModule -Version: 1.0.3 -OrchardVersion: 1 -Features: - TestModule: - Description: My test module for Orchard. - TestFeature: - Description: Contains the Phi type. -"); - - IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); - var testFeature = extensionManager.AvailableExtensions() - .SelectMany(x => x.Features) - .Single(x => x.Id == "TestFeature"); - - foreach (var feature in extensionManager.LoadFeatures(new[] { testFeature })) { - foreach (var type in feature.ExportedTypes) { - foreach (OrchardFeatureAttribute featureAttribute in type.GetCustomAttributes(typeof(OrchardFeatureAttribute), false)) { - Assert.That(featureAttribute.FeatureName, Is.EqualTo("TestFeature")); - } - } - } - } - - [Test] - public void ExtensionManagerLoadFeatureReturnsTypesFromSpecificFeaturesWithFeatureAttribute() { - var extensionLoader = new StubLoaders(); - var extensionFolder = new StubFolders(DefaultExtensionTypes.Module); - - extensionFolder.Manifests.Add("TestModule", @" -Name: TestModule -Version: 1.0.3 -OrchardVersion: 1 -Features: - TestModule: - Description: My test module for Orchard. - TestFeature: - Description: Contains the Phi type. -"); - - IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); - var testFeature = extensionManager.AvailableExtensions() - .SelectMany(x => x.Features) - .Single(x => x.Id == "TestFeature"); - - foreach (var feature in extensionManager.LoadFeatures(new[] { testFeature })) { - foreach (var type in feature.ExportedTypes) { - Assert.That(type == typeof(Phi)); - } - } - } - - [Test] - public void ExtensionManagerLoadFeatureDoesNotReturnTypesFromNonMatchingFeatures() { - var extensionLoader = new StubLoaders(); - var extensionFolder = new StubFolders(DefaultExtensionTypes.Module); - - extensionFolder.Manifests.Add("TestModule", @" -Name: TestModule -Version: 1.0.3 -OrchardVersion: 1 -Features: - TestModule: - Description: My test module for Orchard. - TestFeature: - Description: Contains the Phi type. -"); - - IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); - var testModule = extensionManager.AvailableExtensions() - .SelectMany(x => x.Features) - .Single(x => x.Id == "TestModule"); - - foreach (var feature in extensionManager.LoadFeatures(new[] { testModule })) { - foreach (var type in feature.ExportedTypes) { - Assert.That(type != typeof(Phi)); - Assert.That((type == typeof(Alpha) || (type == typeof(Beta)))); - } - } - } - - [Test] - public void ModuleNameIsIntroducedAsFeatureImplicitly() { - var extensionLoader = new StubLoaders(); - var extensionFolder = new StubFolders(DefaultExtensionTypes.Module); - - extensionFolder.Manifests.Add("Minimalistic", @" -Name: Minimalistic -Version: 1.0.3 -OrchardVersion: 1 -"); - - IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); - var minimalisticModule = extensionManager.AvailableExtensions().Single(x => x.Id == "Minimalistic"); - - Assert.That(minimalisticModule.Features.Count(), Is.EqualTo(1)); - Assert.That(minimalisticModule.Features.Single().Id, Is.EqualTo("Minimalistic")); - } - - - [Test] - public void ThemeNameIsIntroducedAsFeatureImplicitly() { - var extensionLoader = new StubLoaders(); - var extensionFolder = new StubFolders(DefaultExtensionTypes.Theme); - - extensionFolder.Manifests.Add("Minimalistic", @" -Name: Minimalistic -Version: 1.0.3 -OrchardVersion: 1 -"); - - IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); - var minimalisticModule = extensionManager.AvailableExtensions().Single(x => x.Id == "Minimalistic"); - - Assert.That(minimalisticModule.Features.Count(), Is.EqualTo(1)); - Assert.That(minimalisticModule.Features.Single().Id, Is.EqualTo("Minimalistic")); - } - } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using Autofac; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.Environment.Extensions; +using Orchard.Environment.Extensions.Folders; +using Orchard.Environment.Extensions.Loaders; +using Orchard.Environment.Extensions.Models; +using Orchard.FileSystems.Dependencies; +using Orchard.Tests.Extensions.ExtensionTypes; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.Environment.Extensions { + [TestFixture] + public class ExtensionLoaderCoordinatorTests { + private IContainer _container; + private IExtensionManager _manager; + private StubFolders _folders; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + _folders = new StubFolders(DefaultExtensionTypes.Module); + builder.RegisterInstance(_folders).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + _container = builder.Build(); + _manager = _container.Resolve(); + } + + public class StubFolders : IExtensionFolders { + private readonly string _extensionType; + + public StubFolders(string extensionType) { + _extensionType = extensionType; + Manifests = new Dictionary(); + } + + public IDictionary Manifests { get; set; } + + public IEnumerable AvailableExtensions() { + foreach (var e in Manifests) { + string name = e.Key; + yield return ExtensionHarvester.GetDescriptorForExtension("~/", name, _extensionType, Manifests[name]); + } + } + } + + public class StubLoaders : IExtensionLoader { + #region Implementation of IExtensionLoader + + public int Order { + get { return 1; } + } + + public string Name { + get { return this.GetType().Name; } + } + + public Assembly LoadReference(DependencyReferenceDescriptor reference) { + throw new NotImplementedException(); + } + + public void ReferenceActivated(ExtensionLoadingContext context, ExtensionReferenceProbeEntry referenceEntry) { + throw new NotImplementedException(); + } + + public void ReferenceDeactivated(ExtensionLoadingContext context, ExtensionReferenceProbeEntry referenceEntry) { + throw new NotImplementedException(); + } + + public bool IsCompatibleWithModuleReferences(ExtensionDescriptor extension, IEnumerable references) { + throw new NotImplementedException(); + } + + public ExtensionProbeEntry Probe(ExtensionDescriptor descriptor) { + return new ExtensionProbeEntry { Descriptor = descriptor, Loader = this }; + } + + public IEnumerable ProbeReferences(ExtensionDescriptor extensionDescriptor) { + throw new NotImplementedException(); + } + + public ExtensionEntry Load(ExtensionDescriptor descriptor) { + return new ExtensionEntry { Descriptor = descriptor, ExportedTypes = new[] { typeof(Alpha), typeof(Beta), typeof(Phi) } }; + } + + public void ExtensionActivated(ExtensionLoadingContext ctx, ExtensionDescriptor extension) { + throw new NotImplementedException(); + } + + public void ExtensionDeactivated(ExtensionLoadingContext ctx, ExtensionDescriptor extension) { + throw new NotImplementedException(); + } + + public void ExtensionRemoved(ExtensionLoadingContext ctx, DependencyDescriptor dependency) { + throw new NotImplementedException(); + } + + public void Monitor(ExtensionDescriptor extension, Action monitor) { + } + + public IEnumerable GetCompilationReferences(DependencyDescriptor dependency) { + throw new NotImplementedException(); + } + + public IEnumerable GetVirtualPathDependencies(DependencyDescriptor dependency) { + throw new NotImplementedException(); + } + + #endregion + } + + private ExtensionManager CreateExtensionManager(StubFolders extensionFolder, StubLoaders extensionLoader) { + return new ExtensionManager(new[] { extensionFolder }, new[] { extensionLoader }, new StubCacheManager(), new StubParallelCacheContext(), new StubAsyncTokenProvider()); + } + + [Test] + public void AvailableExtensionsShouldFollowCatalogLocations() { + _folders.Manifests.Add("foo", "Name: Foo"); + _folders.Manifests.Add("bar", "Name: Bar"); + _folders.Manifests.Add("frap", "Name: Frap"); + _folders.Manifests.Add("quad", "Name: Quad"); + + var available = _manager.AvailableExtensions(); + + Assert.That(available.Count(), Is.EqualTo(4)); + Assert.That(available, Has.Some.Property("Id").EqualTo("foo")); + } + + [Test] + public void ExtensionDescriptorsShouldHaveNameAndVersion() { + + _folders.Manifests.Add("Sample", @" +Name: Sample Extension +Version: 2.x +"); + + var descriptor = _manager.AvailableExtensions().Single(); + Assert.That(descriptor.Id, Is.EqualTo("Sample")); + Assert.That(descriptor.Name, Is.EqualTo("Sample Extension")); + Assert.That(descriptor.Version, Is.EqualTo("2.x")); + } + + [Test] + public void ExtensionDescriptorsShouldBeParsedForMinimalModuleTxt() { + + _folders.Manifests.Add("SuperWiki", @" +Name: SuperWiki +Version: 1.0.3 +OrchardVersion: 1 +Features: + SuperWiki: + Description: My super wiki module for Orchard. +"); + + var descriptor = _manager.AvailableExtensions().Single(); + Assert.That(descriptor.Id, Is.EqualTo("SuperWiki")); + Assert.That(descriptor.Version, Is.EqualTo("1.0.3")); + Assert.That(descriptor.OrchardVersion, Is.EqualTo("1")); + Assert.That(descriptor.Features.Count(), Is.EqualTo(1)); + Assert.That(descriptor.Features.First().Id, Is.EqualTo("SuperWiki")); + Assert.That(descriptor.Features.First().Extension.Id, Is.EqualTo("SuperWiki")); + Assert.That(descriptor.Features.First().Description, Is.EqualTo("My super wiki module for Orchard.")); + } + + [Test] + public void ExtensionDescriptorsShouldBeParsedForMinimalModuleTxtWithSimpleFormat() { + + _folders.Manifests.Add("SuperWiki", @" +Name: SuperWiki +Version: 1.0.3 +OrchardVersion: 1 +Description: My super wiki module for Orchard. +"); + + var descriptor = _manager.AvailableExtensions().Single(); + Assert.That(descriptor.Id, Is.EqualTo("SuperWiki")); + Assert.That(descriptor.Version, Is.EqualTo("1.0.3")); + Assert.That(descriptor.OrchardVersion, Is.EqualTo("1")); + Assert.That(descriptor.Features.Count(), Is.EqualTo(1)); + Assert.That(descriptor.Features.First().Id, Is.EqualTo("SuperWiki")); + Assert.That(descriptor.Features.First().Extension.Id, Is.EqualTo("SuperWiki")); + Assert.That(descriptor.Features.First().Description, Is.EqualTo("My super wiki module for Orchard.")); + } + + [Test] + public void ExtensionDescriptorsShouldBeParsedForCompleteModuleTxt() { + + _folders.Manifests.Add("MyCompany.AnotherWiki", @" +Name: AnotherWiki +Author: Coder Notaprogrammer +Website: http://anotherwiki.codeplex.com +Version: 1.2.3 +OrchardVersion: 1 +Features: + AnotherWiki: + Description: My super wiki module for Orchard. + Dependencies: Versioning, Search + Category: Content types + AnotherWiki Editor: + Description: A rich editor for wiki contents. + Dependencies: TinyMCE, AnotherWiki + Category: Input methods + AnotherWiki DistributionList: + Description: Sends e-mail alerts when wiki contents gets published. + Dependencies: AnotherWiki, Email Subscriptions + Category: Email + AnotherWiki Captcha: + Description: Kills spam. Or makes it zombie-like. + Dependencies: AnotherWiki, reCaptcha + Category: Spam +"); + + var descriptor = _manager.AvailableExtensions().Single(); + Assert.That(descriptor.Id, Is.EqualTo("MyCompany.AnotherWiki")); + Assert.That(descriptor.Name, Is.EqualTo("AnotherWiki")); + Assert.That(descriptor.Author, Is.EqualTo("Coder Notaprogrammer")); + Assert.That(descriptor.WebSite, Is.EqualTo("http://anotherwiki.codeplex.com")); + Assert.That(descriptor.Version, Is.EqualTo("1.2.3")); + Assert.That(descriptor.OrchardVersion, Is.EqualTo("1")); + Assert.That(descriptor.Features.Count(), Is.EqualTo(5)); + foreach (var featureDescriptor in descriptor.Features) { + switch (featureDescriptor.Id) { + case "AnotherWiki": + Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); + Assert.That(featureDescriptor.Description, Is.EqualTo("My super wiki module for Orchard.")); + Assert.That(featureDescriptor.Category, Is.EqualTo("Content types")); + Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); + Assert.That(featureDescriptor.Dependencies.Contains("Versioning")); + Assert.That(featureDescriptor.Dependencies.Contains("Search")); + break; + case "AnotherWiki Editor": + Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); + Assert.That(featureDescriptor.Description, Is.EqualTo("A rich editor for wiki contents.")); + Assert.That(featureDescriptor.Category, Is.EqualTo("Input methods")); + Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); + Assert.That(featureDescriptor.Dependencies.Contains("TinyMCE")); + Assert.That(featureDescriptor.Dependencies.Contains("AnotherWiki")); + break; + case "AnotherWiki DistributionList": + Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); + Assert.That(featureDescriptor.Description, Is.EqualTo("Sends e-mail alerts when wiki contents gets published.")); + Assert.That(featureDescriptor.Category, Is.EqualTo("Email")); + Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); + Assert.That(featureDescriptor.Dependencies.Contains("AnotherWiki")); + Assert.That(featureDescriptor.Dependencies.Contains("Email Subscriptions")); + break; + case "AnotherWiki Captcha": + Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); + Assert.That(featureDescriptor.Description, Is.EqualTo("Kills spam. Or makes it zombie-like.")); + Assert.That(featureDescriptor.Category, Is.EqualTo("Spam")); + Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); + Assert.That(featureDescriptor.Dependencies.Contains("AnotherWiki")); + Assert.That(featureDescriptor.Dependencies.Contains("reCaptcha")); + break; + // default feature. + case "MyCompany.AnotherWiki": + Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); + break; + default: + Assert.Fail("Features not parsed correctly"); + break; + } + } + } + + [Test] + public void ExtensionDescriptorsShouldBeParsedForCompleteModuleTxtWithSimpleFormat() { + + _folders.Manifests.Add("AnotherWiki", @" +Name: AnotherWiki +Author: Coder Notaprogrammer +Website: http://anotherwiki.codeplex.com +Version: 1.2.3 +OrchardVersion: 1 +Description: Module Description +FeatureDescription: My super wiki module for Orchard. +Dependencies: Versioning, Search +Category: Content types +Features: + AnotherWiki Editor: + Description: A rich editor for wiki contents. + Dependencies: TinyMCE, AnotherWiki + Category: Input methods + AnotherWiki DistributionList: + Description: Sends e-mail alerts when wiki contents gets published. + Dependencies: AnotherWiki, Email Subscriptions + Category: Email + AnotherWiki Captcha: + Description: Kills spam. Or makes it zombie-like. + Dependencies: AnotherWiki, reCaptcha + Category: Spam +"); + + var descriptor = _manager.AvailableExtensions().Single(); + Assert.That(descriptor.Id, Is.EqualTo("AnotherWiki")); + Assert.That(descriptor.Name, Is.EqualTo("AnotherWiki")); + Assert.That(descriptor.Author, Is.EqualTo("Coder Notaprogrammer")); + Assert.That(descriptor.WebSite, Is.EqualTo("http://anotherwiki.codeplex.com")); + Assert.That(descriptor.Version, Is.EqualTo("1.2.3")); + Assert.That(descriptor.OrchardVersion, Is.EqualTo("1")); + Assert.That(descriptor.Description, Is.EqualTo("Module Description")); + Assert.That(descriptor.Features.Count(), Is.EqualTo(4)); + foreach (var featureDescriptor in descriptor.Features) { + switch (featureDescriptor.Id) { + case "AnotherWiki": + Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); + Assert.That(featureDescriptor.Description, Is.EqualTo("My super wiki module for Orchard.")); + Assert.That(featureDescriptor.Category, Is.EqualTo("Content types")); + Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); + Assert.That(featureDescriptor.Dependencies.Contains("Versioning")); + Assert.That(featureDescriptor.Dependencies.Contains("Search")); + break; + case "AnotherWiki Editor": + Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); + Assert.That(featureDescriptor.Description, Is.EqualTo("A rich editor for wiki contents.")); + Assert.That(featureDescriptor.Category, Is.EqualTo("Input methods")); + Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); + Assert.That(featureDescriptor.Dependencies.Contains("TinyMCE")); + Assert.That(featureDescriptor.Dependencies.Contains("AnotherWiki")); + break; + case "AnotherWiki DistributionList": + Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); + Assert.That(featureDescriptor.Description, Is.EqualTo("Sends e-mail alerts when wiki contents gets published.")); + Assert.That(featureDescriptor.Category, Is.EqualTo("Email")); + Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); + Assert.That(featureDescriptor.Dependencies.Contains("AnotherWiki")); + Assert.That(featureDescriptor.Dependencies.Contains("Email Subscriptions")); + break; + case "AnotherWiki Captcha": + Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); + Assert.That(featureDescriptor.Description, Is.EqualTo("Kills spam. Or makes it zombie-like.")); + Assert.That(featureDescriptor.Category, Is.EqualTo("Spam")); + Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); + Assert.That(featureDescriptor.Dependencies.Contains("AnotherWiki")); + Assert.That(featureDescriptor.Dependencies.Contains("reCaptcha")); + break; + default: + Assert.Fail("Features not parsed correctly"); + break; + } + } + } + + [Test] + public void ExtensionManagerShouldLoadFeatures() { + var extensionLoader = new StubLoaders(); + var extensionFolder = new StubFolders(DefaultExtensionTypes.Module); + + extensionFolder.Manifests.Add("TestModule", @" +Name: TestModule +Version: 1.0.3 +OrchardVersion: 1 +Features: + TestModule: + Description: My test module for Orchard. + TestFeature: + Description: Contains the Phi type. +"); + + IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); + var testFeature = extensionManager.AvailableExtensions() + .SelectMany(x => x.Features); + + var features = extensionManager.LoadFeatures(testFeature); + var types = features.SelectMany(x => x.ExportedTypes); + + Assert.That(types.Count(), Is.Not.EqualTo(0)); + } + + [Test] + public void ExtensionManagerFeaturesContainNonAbstractClasses() { + var extensionLoader = new StubLoaders(); + var extensionFolder = new StubFolders(DefaultExtensionTypes.Module); + + extensionFolder.Manifests.Add("TestModule", @" +Name: TestModule +Version: 1.0.3 +OrchardVersion: 1 +Features: + TestModule: + Description: My test module for Orchard. + TestFeature: + Description: Contains the Phi type. +"); + + IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); + var testFeature = extensionManager.AvailableExtensions() + .SelectMany(x => x.Features); + + var features = extensionManager.LoadFeatures(testFeature); + var types = features.SelectMany(x => x.ExportedTypes); + + foreach (var type in types) { + Assert.That(type.IsClass); + Assert.That(!type.IsAbstract); + } + } + + [Test] + public void ExtensionManagerTestFeatureAttribute() { + var extensionLoader = new StubLoaders(); + var extensionFolder = new StubFolders(DefaultExtensionTypes.Module); + + extensionFolder.Manifests.Add("TestModule", @" +Name: TestModule +Version: 1.0.3 +OrchardVersion: 1 +Features: + TestModule: + Description: My test module for Orchard. + TestFeature: + Description: Contains the Phi type. +"); + + IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); + var testFeature = extensionManager.AvailableExtensions() + .SelectMany(x => x.Features) + .Single(x => x.Id == "TestFeature"); + + foreach (var feature in extensionManager.LoadFeatures(new[] { testFeature })) { + foreach (var type in feature.ExportedTypes) { + foreach (OrchardFeatureAttribute featureAttribute in type.GetCustomAttributes(typeof(OrchardFeatureAttribute), false)) { + Assert.That(featureAttribute.FeatureName, Is.EqualTo("TestFeature")); + } + } + } + } + + [Test] + public void ExtensionManagerLoadFeatureReturnsTypesFromSpecificFeaturesWithFeatureAttribute() { + var extensionLoader = new StubLoaders(); + var extensionFolder = new StubFolders(DefaultExtensionTypes.Module); + + extensionFolder.Manifests.Add("TestModule", @" +Name: TestModule +Version: 1.0.3 +OrchardVersion: 1 +Features: + TestModule: + Description: My test module for Orchard. + TestFeature: + Description: Contains the Phi type. +"); + + IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); + var testFeature = extensionManager.AvailableExtensions() + .SelectMany(x => x.Features) + .Single(x => x.Id == "TestFeature"); + + foreach (var feature in extensionManager.LoadFeatures(new[] { testFeature })) { + foreach (var type in feature.ExportedTypes) { + Assert.That(type == typeof(Phi)); + } + } + } + + [Test] + public void ExtensionManagerLoadFeatureDoesNotReturnTypesFromNonMatchingFeatures() { + var extensionLoader = new StubLoaders(); + var extensionFolder = new StubFolders(DefaultExtensionTypes.Module); + + extensionFolder.Manifests.Add("TestModule", @" +Name: TestModule +Version: 1.0.3 +OrchardVersion: 1 +Features: + TestModule: + Description: My test module for Orchard. + TestFeature: + Description: Contains the Phi type. +"); + + IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); + var testModule = extensionManager.AvailableExtensions() + .SelectMany(x => x.Features) + .Single(x => x.Id == "TestModule"); + + foreach (var feature in extensionManager.LoadFeatures(new[] { testModule })) { + foreach (var type in feature.ExportedTypes) { + Assert.That(type != typeof(Phi)); + Assert.That((type == typeof(Alpha) || (type == typeof(Beta)))); + } + } + } + + [Test] + public void ModuleNameIsIntroducedAsFeatureImplicitly() { + var extensionLoader = new StubLoaders(); + var extensionFolder = new StubFolders(DefaultExtensionTypes.Module); + + extensionFolder.Manifests.Add("Minimalistic", @" +Name: Minimalistic +Version: 1.0.3 +OrchardVersion: 1 +"); + + IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); + var minimalisticModule = extensionManager.AvailableExtensions().Single(x => x.Id == "Minimalistic"); + + Assert.That(minimalisticModule.Features.Count(), Is.EqualTo(1)); + Assert.That(minimalisticModule.Features.Single().Id, Is.EqualTo("Minimalistic")); + } + + + [Test] + public void ThemeNameIsIntroducedAsFeatureImplicitly() { + var extensionLoader = new StubLoaders(); + var extensionFolder = new StubFolders(DefaultExtensionTypes.Theme); + + extensionFolder.Manifests.Add("Minimalistic", @" +Name: Minimalistic +Version: 1.0.3 +OrchardVersion: 1 +"); + + IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); + var minimalisticModule = extensionManager.AvailableExtensions().Single(x => x.Id == "Minimalistic"); + + Assert.That(minimalisticModule.Features.Count(), Is.EqualTo(1)); + Assert.That(minimalisticModule.Features.Single().Id, Is.EqualTo("Minimalistic")); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Environment/Extensions/ExtensionManagerTests.cs b/src/Orchard.Tests/Environment/Extensions/ExtensionManagerTests.cs index 389cab03a0d..b186b2d5a9e 100644 --- a/src/Orchard.Tests/Environment/Extensions/ExtensionManagerTests.cs +++ b/src/Orchard.Tests/Environment/Extensions/ExtensionManagerTests.cs @@ -1,620 +1,620 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Reflection; -using Autofac; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.Environment.Extensions; -using Orchard.Environment.Extensions.Folders; -using Orchard.Environment.Extensions.Loaders; -using Orchard.Environment.Extensions.Models; -using Orchard.FileSystems.Dependencies; -using Orchard.Tests.Extensions.ExtensionTypes; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.Environment.Extensions { - [TestFixture] - public class ExtensionManagerTests { - private IContainer _container; - private IExtensionManager _manager; - private StubFolders _folders; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - _folders = new StubFolders(); - builder.RegisterInstance(_folders).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - _container = builder.Build(); - _manager = _container.Resolve(); - } - - public class StubFolders : IExtensionFolders { - private readonly string _extensionType; - - public StubFolders(string extensionType) { - Manifests = new Dictionary(); - _extensionType = extensionType; - } - - public StubFolders() - : this(DefaultExtensionTypes.Module) { - } - - public IDictionary Manifests { get; set; } - - public IEnumerable AvailableExtensions() { - foreach (var e in Manifests) { - string name = e.Key; - yield return ExtensionHarvester.GetDescriptorForExtension("~/", name, _extensionType, Manifests[name]); - } - } - } - - public class StubLoaders : IExtensionLoader { - #region Implementation of IExtensionLoader - - public int Order { - get { return 1; } - } - - public string Name { - get { throw new NotImplementedException(); } - } - - public Assembly LoadReference(DependencyReferenceDescriptor reference) { - throw new NotImplementedException(); - } - - public void ReferenceActivated(ExtensionLoadingContext context, ExtensionReferenceProbeEntry referenceEntry) { - throw new NotImplementedException(); - } - - public void ReferenceDeactivated(ExtensionLoadingContext context, ExtensionReferenceProbeEntry referenceEntry) { - throw new NotImplementedException(); - } - - public bool IsCompatibleWithModuleReferences(ExtensionDescriptor extension, IEnumerable references) { - throw new NotImplementedException(); - } - - public ExtensionProbeEntry Probe(ExtensionDescriptor descriptor) { - return new ExtensionProbeEntry { Descriptor = descriptor, Loader = this }; - } - - public IEnumerable ProbeReferences(ExtensionDescriptor extensionDescriptor) { - throw new NotImplementedException(); - } - - public ExtensionEntry Load(ExtensionDescriptor descriptor) { - return new ExtensionEntry { Descriptor = descriptor, ExportedTypes = new[] { typeof(Alpha), typeof(Beta), typeof(Phi) } }; - } - - public void ExtensionActivated(ExtensionLoadingContext ctx, ExtensionDescriptor extension) { - throw new NotImplementedException(); - } - - public void ExtensionDeactivated(ExtensionLoadingContext ctx, ExtensionDescriptor extension) { - throw new NotImplementedException(); - } - - public void ExtensionRemoved(ExtensionLoadingContext ctx, DependencyDescriptor dependency) { - throw new NotImplementedException(); - } - - public void Monitor(ExtensionDescriptor extension, Action monitor) { - } - - public IEnumerable GetCompilationReferences(DependencyDescriptor dependency) { - throw new NotImplementedException(); - } - - public IEnumerable GetVirtualPathDependencies(DependencyDescriptor dependency) { - throw new NotImplementedException(); - } - - #endregion - } - - - [Test] - public void AvailableExtensionsShouldFollowCatalogLocations() { - _folders.Manifests.Add("foo", "Name: Foo"); - _folders.Manifests.Add("bar", "Name: Bar"); - _folders.Manifests.Add("frap", "Name: Frap"); - _folders.Manifests.Add("quad", "Name: Quad"); - - var available = _manager.AvailableExtensions(); - - Assert.That(available.Count(), Is.EqualTo(4)); - Assert.That(available, Has.Some.Property("Id").EqualTo("foo")); - } - - [Test] - public void ExtensionDescriptorKeywordsAreCaseInsensitive() { - - _folders.Manifests.Add("Sample", @" -NaMe: Sample Extension -SESSIONSTATE: disabled -version: 2.x -DESCRIPTION: HELLO -"); - - var descriptor = _manager.AvailableExtensions().Single(); - Assert.That(descriptor.Id, Is.EqualTo("Sample")); - Assert.That(descriptor.Name, Is.EqualTo("Sample Extension")); - Assert.That(descriptor.Version, Is.EqualTo("2.x")); - Assert.That(descriptor.Description, Is.EqualTo("HELLO")); - Assert.That(descriptor.SessionState, Is.EqualTo("disabled")); - } - - [Test] - public void ExtensionDescriptorsShouldHaveNameAndVersion() { - - _folders.Manifests.Add("Sample", @" -Name: Sample Extension -Version: 2.x -"); - - var descriptor = _manager.AvailableExtensions().Single(); - Assert.That(descriptor.Id, Is.EqualTo("Sample")); - Assert.That(descriptor.Name, Is.EqualTo("Sample Extension")); - Assert.That(descriptor.Version, Is.EqualTo("2.x")); - } - - [Test] - public void ExtensionDescriptorsShouldBeParsedForMinimalModuleTxt() { - - _folders.Manifests.Add("SuperWiki", @" -Name: SuperWiki -Version: 1.0.3 -OrchardVersion: 1 -Features: - SuperWiki: - Description: My super wiki module for Orchard. -"); - - var descriptor = _manager.AvailableExtensions().Single(); - Assert.That(descriptor.Id, Is.EqualTo("SuperWiki")); - Assert.That(descriptor.Version, Is.EqualTo("1.0.3")); - Assert.That(descriptor.OrchardVersion, Is.EqualTo("1")); - Assert.That(descriptor.Features.Count(), Is.EqualTo(1)); - Assert.That(descriptor.Features.First().Id, Is.EqualTo("SuperWiki")); - Assert.That(descriptor.Features.First().Extension.Id, Is.EqualTo("SuperWiki")); - Assert.That(descriptor.Features.First().Description, Is.EqualTo("My super wiki module for Orchard.")); - } - - [Test] - public void ExtensionDescriptorsShouldBeParsedForCompleteModuleTxt() { - - _folders.Manifests.Add("MyCompany.AnotherWiki", @" -Name: AnotherWiki -SessionState: required -Author: Coder Notaprogrammer -Website: http://anotherwiki.codeplex.com -Version: 1.2.3 -OrchardVersion: 1 -Features: - AnotherWiki: - Description: My super wiki module for Orchard. - Dependencies: Versioning, Search - Category: Content types - AnotherWiki Editor: - Description: A rich editor for wiki contents. - Dependencies: TinyMCE, AnotherWiki - Category: Input methods - AnotherWiki DistributionList: - Description: Sends e-mail alerts when wiki contents gets published. - Dependencies: AnotherWiki, Email Subscriptions - Category: Email - AnotherWiki Captcha: - Description: Kills spam. Or makes it zombie-like. - Dependencies: AnotherWiki, reCaptcha - Category: Spam -"); - - var descriptor = _manager.AvailableExtensions().Single(); - Assert.That(descriptor.Id, Is.EqualTo("MyCompany.AnotherWiki")); - Assert.That(descriptor.Name, Is.EqualTo("AnotherWiki")); - Assert.That(descriptor.Author, Is.EqualTo("Coder Notaprogrammer")); - Assert.That(descriptor.WebSite, Is.EqualTo("http://anotherwiki.codeplex.com")); - Assert.That(descriptor.Version, Is.EqualTo("1.2.3")); - Assert.That(descriptor.OrchardVersion, Is.EqualTo("1")); - Assert.That(descriptor.Features.Count(), Is.EqualTo(5)); - Assert.That(descriptor.SessionState, Is.EqualTo("required")); - foreach (var featureDescriptor in descriptor.Features) { - switch (featureDescriptor.Id) { - case "AnotherWiki": - Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); - Assert.That(featureDescriptor.Description, Is.EqualTo("My super wiki module for Orchard.")); - Assert.That(featureDescriptor.Category, Is.EqualTo("Content types")); - Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); - Assert.That(featureDescriptor.Dependencies.Contains("Versioning")); - Assert.That(featureDescriptor.Dependencies.Contains("Search")); - break; - case "AnotherWiki Editor": - Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); - Assert.That(featureDescriptor.Description, Is.EqualTo("A rich editor for wiki contents.")); - Assert.That(featureDescriptor.Category, Is.EqualTo("Input methods")); - Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); - Assert.That(featureDescriptor.Dependencies.Contains("TinyMCE")); - Assert.That(featureDescriptor.Dependencies.Contains("AnotherWiki")); - break; - case "AnotherWiki DistributionList": - Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); - Assert.That(featureDescriptor.Description, Is.EqualTo("Sends e-mail alerts when wiki contents gets published.")); - Assert.That(featureDescriptor.Category, Is.EqualTo("Email")); - Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); - Assert.That(featureDescriptor.Dependencies.Contains("AnotherWiki")); - Assert.That(featureDescriptor.Dependencies.Contains("Email Subscriptions")); - break; - case "AnotherWiki Captcha": - Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); - Assert.That(featureDescriptor.Description, Is.EqualTo("Kills spam. Or makes it zombie-like.")); - Assert.That(featureDescriptor.Category, Is.EqualTo("Spam")); - Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); - Assert.That(featureDescriptor.Dependencies.Contains("AnotherWiki")); - Assert.That(featureDescriptor.Dependencies.Contains("reCaptcha")); - break; - // default feature. - case "MyCompany.AnotherWiki": - Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); - break; - default: - Assert.Fail("Features not parsed correctly"); - break; - } - } - } - - [Test] - public void ExtensionManagerShouldLoadFeatures() { - var extensionLoader = new StubLoaders(); - var extensionFolder = new StubFolders(); - - extensionFolder.Manifests.Add("TestModule", @" -Name: TestModule -Version: 1.0.3 -OrchardVersion: 1 -Features: - TestModule: - Description: My test module for Orchard. - TestFeature: - Description: Contains the Phi type. -"); - - IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); - var testFeature = extensionManager.AvailableExtensions() - .SelectMany(x => x.Features); - - var features = extensionManager.LoadFeatures(testFeature); - var types = features.SelectMany(x => x.ExportedTypes); - - Assert.That(types.Count(), Is.Not.EqualTo(0)); - } - - [Test] - public void ExtensionManagerFeaturesContainNonAbstractClasses() { - var extensionLoader = new StubLoaders(); - var extensionFolder = new StubFolders(); - - extensionFolder.Manifests.Add("TestModule", @" -Name: TestModule -Version: 1.0.3 -OrchardVersion: 1 -Features: - TestModule: - Description: My test module for Orchard. - TestFeature: - Description: Contains the Phi type. -"); - - IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); - var testFeature = extensionManager.AvailableExtensions() - .SelectMany(x => x.Features); - - var features = extensionManager.LoadFeatures(testFeature); - var types = features.SelectMany(x => x.ExportedTypes); - - foreach (var type in types) { - Assert.That(type.IsClass); - Assert.That(!type.IsAbstract); - } - } - - private static ExtensionManager CreateExtensionManager(StubFolders extensionFolder, StubLoaders extensionLoader) { - return CreateExtensionManager(new[] { extensionFolder }, new[] { extensionLoader }); - } - - private static ExtensionManager CreateExtensionManager(IEnumerable extensionFolder, IEnumerable extensionLoader) { - return new ExtensionManager(extensionFolder, extensionLoader, new StubCacheManager(), new StubParallelCacheContext(), new StubAsyncTokenProvider()); - } - - [Test] - public void ExtensionManagerShouldReturnEmptyFeatureIfFeatureDoesNotExist() { - var featureDescriptor = new FeatureDescriptor { Id = "NoSuchFeature", Extension = new ExtensionDescriptor { Id = "NoSuchFeature" } }; - Feature feature = _manager.LoadFeatures(new[] { featureDescriptor }).First(); - Assert.AreEqual(featureDescriptor, feature.Descriptor); - Assert.AreEqual(0, feature.ExportedTypes.Count()); - } - - [Test] - public void ExtensionManagerTestFeatureAttribute() { - var extensionLoader = new StubLoaders(); - var extensionFolder = new StubFolders(); - - extensionFolder.Manifests.Add("TestModule", @" -Name: TestModule -Version: 1.0.3 -OrchardVersion: 1 -Features: - TestModule: - Description: My test module for Orchard. - TestFeature: - Description: Contains the Phi type. -"); - - IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); - var testFeature = extensionManager.AvailableExtensions() - .SelectMany(x => x.Features) - .Single(x => x.Id == "TestFeature"); - - foreach (var feature in extensionManager.LoadFeatures(new[] { testFeature })) { - foreach (var type in feature.ExportedTypes) { - foreach (OrchardFeatureAttribute featureAttribute in type.GetCustomAttributes(typeof(OrchardFeatureAttribute), false)) { - Assert.That(featureAttribute.FeatureName, Is.EqualTo("TestFeature")); - } - } - } - } - - [Test] - public void ExtensionManagerLoadFeatureReturnsTypesFromSpecificFeaturesWithFeatureAttribute() { - var extensionLoader = new StubLoaders(); - var extensionFolder = new StubFolders(); - - extensionFolder.Manifests.Add("TestModule", @" -Name: TestModule -Version: 1.0.3 -OrchardVersion: 1 -Features: - TestModule: - Description: My test module for Orchard. - TestFeature: - Description: Contains the Phi type. -"); - - IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); - var testFeature = extensionManager.AvailableExtensions() - .SelectMany(x => x.Features) - .Single(x => x.Id == "TestFeature"); - - foreach (var feature in extensionManager.LoadFeatures(new[] { testFeature })) { - foreach (var type in feature.ExportedTypes) { - Assert.That(type == typeof(Phi)); - } - } - } - - [Test] - public void ExtensionManagerLoadFeatureDoesNotReturnTypesFromNonMatchingFeatures() { - var extensionLoader = new StubLoaders(); - var extensionFolder = new StubFolders(); - - extensionFolder.Manifests.Add("TestModule", @" -Name: TestModule -Version: 1.0.3 -OrchardVersion: 1 -Features: - TestModule: - Description: My test module for Orchard. - TestFeature: - Description: Contains the Phi type. -"); - - IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); - var testModule = extensionManager.AvailableExtensions() - .SelectMany(x => x.Features) - .Single(x => x.Id == "TestModule"); - - foreach (var feature in extensionManager.LoadFeatures(new[] { testModule })) { - foreach (var type in feature.ExportedTypes) { - Assert.That(type != typeof(Phi)); - Assert.That((type == typeof(Alpha) || (type == typeof(Beta)))); - } - } - } - - [Test] - public void ModuleNameIsIntroducedAsFeatureImplicitly() { - var extensionLoader = new StubLoaders(); - var extensionFolder = new StubFolders(); - - extensionFolder.Manifests.Add("Minimalistic", @" -Name: Minimalistic -Version: 1.0.3 -OrchardVersion: 1 -"); - - IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); - var minimalisticModule = extensionManager.AvailableExtensions().Single(x => x.Id == "Minimalistic"); - - Assert.That(minimalisticModule.Features.Count(), Is.EqualTo(1)); - Assert.That(minimalisticModule.Features.Single().Id, Is.EqualTo("Minimalistic")); - } - - - [Test] - public void FeatureDescriptorsAreInDependencyOrder() { - var extensionLoader = new StubLoaders(); - var extensionFolder = new StubFolders(); - - extensionFolder.Manifests.Add("Alpha", @" -Name: Alpha -Version: 1.0.3 -OrchardVersion: 1 -Features: - Alpha: - Dependencies: Gamma -"); - - extensionFolder.Manifests.Add("Beta", @" -Name: Beta -Version: 1.0.3 -OrchardVersion: 1 -"); - extensionFolder.Manifests.Add("Gamma", @" -Name: Gamma -Version: 1.0.3 -OrchardVersion: 1 -Features: - Gamma: - Dependencies: Beta -"); - - IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); - var features = extensionManager.AvailableFeatures(); - Assert.That(features.Aggregate("<", (a, b) => a + b.Id + "<"), Is.EqualTo(" folders, StubLoaders loader, string expectedOrder) { - var extensionManager = CreateExtensionManager(folders, new[] { loader }); - var features = extensionManager.AvailableFeatures(); - Assert.That(features.Aggregate("<", (a, b) => a + b.Id + "<"), Is.EqualTo(expectedOrder)); - } - - [Test] - public void FeatureDescriptorsAreInDependencyAndPriorityOrder() { - var extensionLoader = new StubLoaders(); - var extensionFolder = new StubFolders(); - - // Check that priorities apply correctly on items on the same level of dependencies and are overwritten by dependencies - extensionFolder.Manifests.Add("Alpha", CreateManifest("Alpha", "2", "Gamma")); // More important than Gamma but will get overwritten by the dependency - extensionFolder.Manifests.Add("Beta", CreateManifest("Beta", "2")); - extensionFolder.Manifests.Add("Foo", CreateManifest("Foo", "1")); - extensionFolder.Manifests.Add("Gamma", CreateManifest("Gamma", "3", "Beta, Foo")); - AssertFeaturesAreInOrder(extensionFolder, extensionLoader, "(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + _container = builder.Build(); + _manager = _container.Resolve(); + } + + public class StubFolders : IExtensionFolders { + private readonly string _extensionType; + + public StubFolders(string extensionType) { + Manifests = new Dictionary(); + _extensionType = extensionType; + } + + public StubFolders() + : this(DefaultExtensionTypes.Module) { + } + + public IDictionary Manifests { get; set; } + + public IEnumerable AvailableExtensions() { + foreach (var e in Manifests) { + string name = e.Key; + yield return ExtensionHarvester.GetDescriptorForExtension("~/", name, _extensionType, Manifests[name]); + } + } + } + + public class StubLoaders : IExtensionLoader { + #region Implementation of IExtensionLoader + + public int Order { + get { return 1; } + } + + public string Name { + get { throw new NotImplementedException(); } + } + + public Assembly LoadReference(DependencyReferenceDescriptor reference) { + throw new NotImplementedException(); + } + + public void ReferenceActivated(ExtensionLoadingContext context, ExtensionReferenceProbeEntry referenceEntry) { + throw new NotImplementedException(); + } + + public void ReferenceDeactivated(ExtensionLoadingContext context, ExtensionReferenceProbeEntry referenceEntry) { + throw new NotImplementedException(); + } + + public bool IsCompatibleWithModuleReferences(ExtensionDescriptor extension, IEnumerable references) { + throw new NotImplementedException(); + } + + public ExtensionProbeEntry Probe(ExtensionDescriptor descriptor) { + return new ExtensionProbeEntry { Descriptor = descriptor, Loader = this }; + } + + public IEnumerable ProbeReferences(ExtensionDescriptor extensionDescriptor) { + throw new NotImplementedException(); + } + + public ExtensionEntry Load(ExtensionDescriptor descriptor) { + return new ExtensionEntry { Descriptor = descriptor, ExportedTypes = new[] { typeof(Alpha), typeof(Beta), typeof(Phi) } }; + } + + public void ExtensionActivated(ExtensionLoadingContext ctx, ExtensionDescriptor extension) { + throw new NotImplementedException(); + } + + public void ExtensionDeactivated(ExtensionLoadingContext ctx, ExtensionDescriptor extension) { + throw new NotImplementedException(); + } + + public void ExtensionRemoved(ExtensionLoadingContext ctx, DependencyDescriptor dependency) { + throw new NotImplementedException(); + } + + public void Monitor(ExtensionDescriptor extension, Action monitor) { + } + + public IEnumerable GetCompilationReferences(DependencyDescriptor dependency) { + throw new NotImplementedException(); + } + + public IEnumerable GetVirtualPathDependencies(DependencyDescriptor dependency) { + throw new NotImplementedException(); + } + + #endregion + } + + + [Test] + public void AvailableExtensionsShouldFollowCatalogLocations() { + _folders.Manifests.Add("foo", "Name: Foo"); + _folders.Manifests.Add("bar", "Name: Bar"); + _folders.Manifests.Add("frap", "Name: Frap"); + _folders.Manifests.Add("quad", "Name: Quad"); + + var available = _manager.AvailableExtensions(); + + Assert.That(available.Count(), Is.EqualTo(4)); + Assert.That(available, Has.Some.Property("Id").EqualTo("foo")); + } + + [Test] + public void ExtensionDescriptorKeywordsAreCaseInsensitive() { + + _folders.Manifests.Add("Sample", @" +NaMe: Sample Extension +SESSIONSTATE: disabled +version: 2.x +DESCRIPTION: HELLO +"); + + var descriptor = _manager.AvailableExtensions().Single(); + Assert.That(descriptor.Id, Is.EqualTo("Sample")); + Assert.That(descriptor.Name, Is.EqualTo("Sample Extension")); + Assert.That(descriptor.Version, Is.EqualTo("2.x")); + Assert.That(descriptor.Description, Is.EqualTo("HELLO")); + Assert.That(descriptor.SessionState, Is.EqualTo("disabled")); + } + + [Test] + public void ExtensionDescriptorsShouldHaveNameAndVersion() { + + _folders.Manifests.Add("Sample", @" +Name: Sample Extension +Version: 2.x +"); + + var descriptor = _manager.AvailableExtensions().Single(); + Assert.That(descriptor.Id, Is.EqualTo("Sample")); + Assert.That(descriptor.Name, Is.EqualTo("Sample Extension")); + Assert.That(descriptor.Version, Is.EqualTo("2.x")); + } + + [Test] + public void ExtensionDescriptorsShouldBeParsedForMinimalModuleTxt() { + + _folders.Manifests.Add("SuperWiki", @" +Name: SuperWiki +Version: 1.0.3 +OrchardVersion: 1 +Features: + SuperWiki: + Description: My super wiki module for Orchard. +"); + + var descriptor = _manager.AvailableExtensions().Single(); + Assert.That(descriptor.Id, Is.EqualTo("SuperWiki")); + Assert.That(descriptor.Version, Is.EqualTo("1.0.3")); + Assert.That(descriptor.OrchardVersion, Is.EqualTo("1")); + Assert.That(descriptor.Features.Count(), Is.EqualTo(1)); + Assert.That(descriptor.Features.First().Id, Is.EqualTo("SuperWiki")); + Assert.That(descriptor.Features.First().Extension.Id, Is.EqualTo("SuperWiki")); + Assert.That(descriptor.Features.First().Description, Is.EqualTo("My super wiki module for Orchard.")); + } + + [Test] + public void ExtensionDescriptorsShouldBeParsedForCompleteModuleTxt() { + + _folders.Manifests.Add("MyCompany.AnotherWiki", @" +Name: AnotherWiki +SessionState: required +Author: Coder Notaprogrammer +Website: http://anotherwiki.codeplex.com +Version: 1.2.3 +OrchardVersion: 1 +Features: + AnotherWiki: + Description: My super wiki module for Orchard. + Dependencies: Versioning, Search + Category: Content types + AnotherWiki Editor: + Description: A rich editor for wiki contents. + Dependencies: TinyMCE, AnotherWiki + Category: Input methods + AnotherWiki DistributionList: + Description: Sends e-mail alerts when wiki contents gets published. + Dependencies: AnotherWiki, Email Subscriptions + Category: Email + AnotherWiki Captcha: + Description: Kills spam. Or makes it zombie-like. + Dependencies: AnotherWiki, reCaptcha + Category: Spam +"); + + var descriptor = _manager.AvailableExtensions().Single(); + Assert.That(descriptor.Id, Is.EqualTo("MyCompany.AnotherWiki")); + Assert.That(descriptor.Name, Is.EqualTo("AnotherWiki")); + Assert.That(descriptor.Author, Is.EqualTo("Coder Notaprogrammer")); + Assert.That(descriptor.WebSite, Is.EqualTo("http://anotherwiki.codeplex.com")); + Assert.That(descriptor.Version, Is.EqualTo("1.2.3")); + Assert.That(descriptor.OrchardVersion, Is.EqualTo("1")); + Assert.That(descriptor.Features.Count(), Is.EqualTo(5)); + Assert.That(descriptor.SessionState, Is.EqualTo("required")); + foreach (var featureDescriptor in descriptor.Features) { + switch (featureDescriptor.Id) { + case "AnotherWiki": + Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); + Assert.That(featureDescriptor.Description, Is.EqualTo("My super wiki module for Orchard.")); + Assert.That(featureDescriptor.Category, Is.EqualTo("Content types")); + Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); + Assert.That(featureDescriptor.Dependencies.Contains("Versioning")); + Assert.That(featureDescriptor.Dependencies.Contains("Search")); + break; + case "AnotherWiki Editor": + Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); + Assert.That(featureDescriptor.Description, Is.EqualTo("A rich editor for wiki contents.")); + Assert.That(featureDescriptor.Category, Is.EqualTo("Input methods")); + Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); + Assert.That(featureDescriptor.Dependencies.Contains("TinyMCE")); + Assert.That(featureDescriptor.Dependencies.Contains("AnotherWiki")); + break; + case "AnotherWiki DistributionList": + Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); + Assert.That(featureDescriptor.Description, Is.EqualTo("Sends e-mail alerts when wiki contents gets published.")); + Assert.That(featureDescriptor.Category, Is.EqualTo("Email")); + Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); + Assert.That(featureDescriptor.Dependencies.Contains("AnotherWiki")); + Assert.That(featureDescriptor.Dependencies.Contains("Email Subscriptions")); + break; + case "AnotherWiki Captcha": + Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); + Assert.That(featureDescriptor.Description, Is.EqualTo("Kills spam. Or makes it zombie-like.")); + Assert.That(featureDescriptor.Category, Is.EqualTo("Spam")); + Assert.That(featureDescriptor.Dependencies.Count(), Is.EqualTo(2)); + Assert.That(featureDescriptor.Dependencies.Contains("AnotherWiki")); + Assert.That(featureDescriptor.Dependencies.Contains("reCaptcha")); + break; + // default feature. + case "MyCompany.AnotherWiki": + Assert.That(featureDescriptor.Extension, Is.SameAs(descriptor)); + break; + default: + Assert.Fail("Features not parsed correctly"); + break; + } + } + } + + [Test] + public void ExtensionManagerShouldLoadFeatures() { + var extensionLoader = new StubLoaders(); + var extensionFolder = new StubFolders(); + + extensionFolder.Manifests.Add("TestModule", @" +Name: TestModule +Version: 1.0.3 +OrchardVersion: 1 +Features: + TestModule: + Description: My test module for Orchard. + TestFeature: + Description: Contains the Phi type. +"); + + IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); + var testFeature = extensionManager.AvailableExtensions() + .SelectMany(x => x.Features); + + var features = extensionManager.LoadFeatures(testFeature); + var types = features.SelectMany(x => x.ExportedTypes); + + Assert.That(types.Count(), Is.Not.EqualTo(0)); + } + + [Test] + public void ExtensionManagerFeaturesContainNonAbstractClasses() { + var extensionLoader = new StubLoaders(); + var extensionFolder = new StubFolders(); + + extensionFolder.Manifests.Add("TestModule", @" +Name: TestModule +Version: 1.0.3 +OrchardVersion: 1 +Features: + TestModule: + Description: My test module for Orchard. + TestFeature: + Description: Contains the Phi type. +"); + + IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); + var testFeature = extensionManager.AvailableExtensions() + .SelectMany(x => x.Features); + + var features = extensionManager.LoadFeatures(testFeature); + var types = features.SelectMany(x => x.ExportedTypes); + + foreach (var type in types) { + Assert.That(type.IsClass); + Assert.That(!type.IsAbstract); + } + } + + private static ExtensionManager CreateExtensionManager(StubFolders extensionFolder, StubLoaders extensionLoader) { + return CreateExtensionManager(new[] { extensionFolder }, new[] { extensionLoader }); + } + + private static ExtensionManager CreateExtensionManager(IEnumerable extensionFolder, IEnumerable extensionLoader) { + return new ExtensionManager(extensionFolder, extensionLoader, new StubCacheManager(), new StubParallelCacheContext(), new StubAsyncTokenProvider()); + } + + [Test] + public void ExtensionManagerShouldReturnEmptyFeatureIfFeatureDoesNotExist() { + var featureDescriptor = new FeatureDescriptor { Id = "NoSuchFeature", Extension = new ExtensionDescriptor { Id = "NoSuchFeature" } }; + Feature feature = _manager.LoadFeatures(new[] { featureDescriptor }).First(); + Assert.AreEqual(featureDescriptor, feature.Descriptor); + Assert.AreEqual(0, feature.ExportedTypes.Count()); + } + + [Test] + public void ExtensionManagerTestFeatureAttribute() { + var extensionLoader = new StubLoaders(); + var extensionFolder = new StubFolders(); + + extensionFolder.Manifests.Add("TestModule", @" +Name: TestModule +Version: 1.0.3 +OrchardVersion: 1 +Features: + TestModule: + Description: My test module for Orchard. + TestFeature: + Description: Contains the Phi type. +"); + + IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); + var testFeature = extensionManager.AvailableExtensions() + .SelectMany(x => x.Features) + .Single(x => x.Id == "TestFeature"); + + foreach (var feature in extensionManager.LoadFeatures(new[] { testFeature })) { + foreach (var type in feature.ExportedTypes) { + foreach (OrchardFeatureAttribute featureAttribute in type.GetCustomAttributes(typeof(OrchardFeatureAttribute), false)) { + Assert.That(featureAttribute.FeatureName, Is.EqualTo("TestFeature")); + } + } + } + } + + [Test] + public void ExtensionManagerLoadFeatureReturnsTypesFromSpecificFeaturesWithFeatureAttribute() { + var extensionLoader = new StubLoaders(); + var extensionFolder = new StubFolders(); + + extensionFolder.Manifests.Add("TestModule", @" +Name: TestModule +Version: 1.0.3 +OrchardVersion: 1 +Features: + TestModule: + Description: My test module for Orchard. + TestFeature: + Description: Contains the Phi type. +"); + + IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); + var testFeature = extensionManager.AvailableExtensions() + .SelectMany(x => x.Features) + .Single(x => x.Id == "TestFeature"); + + foreach (var feature in extensionManager.LoadFeatures(new[] { testFeature })) { + foreach (var type in feature.ExportedTypes) { + Assert.That(type == typeof(Phi)); + } + } + } + + [Test] + public void ExtensionManagerLoadFeatureDoesNotReturnTypesFromNonMatchingFeatures() { + var extensionLoader = new StubLoaders(); + var extensionFolder = new StubFolders(); + + extensionFolder.Manifests.Add("TestModule", @" +Name: TestModule +Version: 1.0.3 +OrchardVersion: 1 +Features: + TestModule: + Description: My test module for Orchard. + TestFeature: + Description: Contains the Phi type. +"); + + IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); + var testModule = extensionManager.AvailableExtensions() + .SelectMany(x => x.Features) + .Single(x => x.Id == "TestModule"); + + foreach (var feature in extensionManager.LoadFeatures(new[] { testModule })) { + foreach (var type in feature.ExportedTypes) { + Assert.That(type != typeof(Phi)); + Assert.That((type == typeof(Alpha) || (type == typeof(Beta)))); + } + } + } + + [Test] + public void ModuleNameIsIntroducedAsFeatureImplicitly() { + var extensionLoader = new StubLoaders(); + var extensionFolder = new StubFolders(); + + extensionFolder.Manifests.Add("Minimalistic", @" +Name: Minimalistic +Version: 1.0.3 +OrchardVersion: 1 +"); + + IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); + var minimalisticModule = extensionManager.AvailableExtensions().Single(x => x.Id == "Minimalistic"); + + Assert.That(minimalisticModule.Features.Count(), Is.EqualTo(1)); + Assert.That(minimalisticModule.Features.Single().Id, Is.EqualTo("Minimalistic")); + } + + + [Test] + public void FeatureDescriptorsAreInDependencyOrder() { + var extensionLoader = new StubLoaders(); + var extensionFolder = new StubFolders(); + + extensionFolder.Manifests.Add("Alpha", @" +Name: Alpha +Version: 1.0.3 +OrchardVersion: 1 +Features: + Alpha: + Dependencies: Gamma +"); + + extensionFolder.Manifests.Add("Beta", @" +Name: Beta +Version: 1.0.3 +OrchardVersion: 1 +"); + extensionFolder.Manifests.Add("Gamma", @" +Name: Gamma +Version: 1.0.3 +OrchardVersion: 1 +Features: + Gamma: + Dependencies: Beta +"); + + IExtensionManager extensionManager = CreateExtensionManager(extensionFolder, extensionLoader); + var features = extensionManager.AvailableFeatures(); + Assert.That(features.Aggregate("<", (a, b) => a + b.Id + "<"), Is.EqualTo(" folders, StubLoaders loader, string expectedOrder) { + var extensionManager = CreateExtensionManager(folders, new[] { loader }); + var features = extensionManager.AvailableFeatures(); + Assert.That(features.Aggregate("<", (a, b) => a + b.Id + "<"), Is.EqualTo(expectedOrder)); + } + + [Test] + public void FeatureDescriptorsAreInDependencyAndPriorityOrder() { + var extensionLoader = new StubLoaders(); + var extensionFolder = new StubFolders(); + + // Check that priorities apply correctly on items on the same level of dependencies and are overwritten by dependencies + extensionFolder.Manifests.Add("Alpha", CreateManifest("Alpha", "2", "Gamma")); // More important than Gamma but will get overwritten by the dependency + extensionFolder.Manifests.Add("Beta", CreateManifest("Beta", "2")); + extensionFolder.Manifests.Add("Foo", CreateManifest("Foo", "1")); + extensionFolder.Manifests.Add("Gamma", CreateManifest("Gamma", "3", "Beta, Foo")); + AssertFeaturesAreInOrder(extensionFolder, extensionLoader, " DatabaseTypes { - get { - return new[] { - typeof (ShellDescriptorRecord), - typeof (ShellFeatureRecord), - typeof (ShellParameterRecord), - }; - } - } - - public override void Register(ContainerBuilder builder) { - _folders = new ExtensionManagerTests.StubFolders(); - builder.RegisterInstance(_folders).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As().SingleInstance(); - builder.RegisterType().As().SingleInstance(); - builder.RegisterType().As().SingleInstance(); - builder.RegisterSource(new EventsRegistrationSource()); - - builder.RegisterInstance(new ShellSettings { Name = "Default" }); - } - - [Test] - public void EnableFeaturesTest() { - _folders.Manifests.Add("SuperWiki", @" -Name: SuperWiki -Version: 1.0.3 -OrchardVersion: 1 -Features: - SuperWiki: - Description: My super wiki module for Orchard. -"); - - // Initialize the shell descriptor with 0 features - IShellDescriptorManager shellDescriptorManager = _container.Resolve(); - IFeatureManager featureManager = _container.Resolve(); - - shellDescriptorManager.UpdateShellDescriptor(0, - Enumerable.Empty(), - Enumerable.Empty()); - - IEnumerable featuresToEnable = new [] { "SuperWiki" }; - - // Enable all features - IEnumerable enabledFeatures = featureManager.EnableFeatures(featuresToEnable); - - Assert.That(enabledFeatures, Is.EqualTo(featuresToEnable)); - Assert.That(featureManager.GetEnabledFeatures().Count(), Is.EqualTo(1)); - } - - [Test] - public void EnableFeaturesWithDependenciesTest() { - _folders.Manifests.Add("SuperWiki", @" -Name: SuperWiki -Version: 1.0.3 -OrchardVersion: 1 -Features: - SuperWiki: - Description: My super wiki module for Orchard. - Dependencies: SuperWikiDep - SuperWikiDep: - Description: My super wiki module for Orchard dependency. -"); - - // Initialize the shell descriptor with 0 features - IShellDescriptorManager shellDescriptorManager = _container.Resolve(); - IFeatureManager featureManager = _container.Resolve(); - - shellDescriptorManager.UpdateShellDescriptor(0, - Enumerable.Empty(), - Enumerable.Empty()); - - IEnumerable featuresToEnable = new[] { "SuperWiki" }; - - // Try to enable without forcing dependencies should fail - IEnumerable enabledFeatures = featureManager.EnableFeatures(featuresToEnable, false); - Assert.That(enabledFeatures.Count(), Is.EqualTo(0)); - Assert.That(featureManager.GetEnabledFeatures().Count(), Is.EqualTo(0)); - - // Enabling while forcing dependencies should succeed. - enabledFeatures = featureManager.EnableFeatures(featuresToEnable, true); - Assert.That(enabledFeatures.Contains("SuperWiki"), Is.True); - Assert.That(enabledFeatures.Contains("SuperWikiDep"), Is.True); - Assert.That(featureManager.GetEnabledFeatures().Count(), Is.EqualTo(2)); - } - - [Test] - public void DisableFeaturesTest() { - _folders.Manifests.Add("SuperWiki", @" -Name: SuperWiki -Version: 1.0.3 -OrchardVersion: 1 -Features: - SuperWiki: - Description: My super wiki module for Orchard. -"); - - // Initialize the shell descriptor with 0 features - IShellDescriptorManager shellDescriptorManager = _container.Resolve(); - IFeatureManager featureManager = _container.Resolve(); - - shellDescriptorManager.UpdateShellDescriptor(0, - new [] { new ShellFeature { Name = "SuperWiki" } }, - Enumerable.Empty()); - - IEnumerable featuresToDisable = new [] { "SuperWiki" }; - - // Disable the feature - featureManager.DisableFeatures(featuresToDisable); - Assert.That(featureManager.GetEnabledFeatures().Count(), Is.EqualTo(0)); - } - - [Test] - public void DisableFeaturesWithDependenciesTest() { - _folders.Manifests.Add("SuperWiki", @" -Name: SuperWiki -Version: 1.0.3 -OrchardVersion: 1 -Features: - SuperWiki: - Description: My super wiki module for Orchard. - Dependencies: SuperWikiDep - SuperWikiDep: - Description: My super wiki module for Orchard dependency. -"); - - // Initialize the shell descriptor with 0 features - IShellDescriptorManager shellDescriptorManager = _container.Resolve(); - IFeatureManager featureManager = _container.Resolve(); - - shellDescriptorManager.UpdateShellDescriptor(0, - Enumerable.Empty(), - Enumerable.Empty()); - - // Enable both features by relying on the dependency - Assert.That(featureManager.EnableFeatures(new [] { "SuperWiki"}, true).Count(), Is.EqualTo(2)); - - IEnumerable featuresToDisable = new[] { "SuperWikiDep" }; - - // Try to enable without forcing dependencies should fail - IEnumerable disabledFeatures = featureManager.DisableFeatures(featuresToDisable, false); - Assert.That(disabledFeatures.Count(), Is.EqualTo(0)); - Assert.That(featureManager.GetEnabledFeatures().Count(), Is.EqualTo(2)); - - // Enabling while forcing dependencies should succeed. - disabledFeatures = featureManager.DisableFeatures(featuresToDisable, true); - Assert.That(disabledFeatures.Contains("SuperWiki"), Is.True); - Assert.That(disabledFeatures.Contains("SuperWikiDep"), Is.True); - Assert.That(featureManager.GetEnabledFeatures().Count(), Is.EqualTo(0)); - } - } - - public class StubEventBus : IEventBus { - public string LastMessageName { get; set; } - public IDictionary LastEventData { get; set; } - - public IEnumerable Notify(string messageName, IDictionary eventData) { - LastMessageName = messageName; - LastEventData = eventData; - return new object[0]; - } - } -} +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using Autofac; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.Core.Settings.Descriptor; +using Orchard.Core.Settings.Descriptor.Records; +using Orchard.Core.Settings.State; +using Orchard.Environment.Configuration; +using Orchard.Environment.Descriptor; +using Orchard.Environment.Descriptor.Models; +using Orchard.Environment.Extensions; +using Orchard.Environment.Extensions.Folders; +using Orchard.Environment.Features; +using Orchard.Environment.State; +using Orchard.Events; +using Orchard.Tests.Environment.Extensions; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.Environment.Features { + [TestFixture] + public class FeatureManagerTests : DatabaseEnabledTestsBase { + private ExtensionManagerTests.StubFolders _folders; + + protected override IEnumerable DatabaseTypes { + get { + return new[] { + typeof (ShellDescriptorRecord), + typeof (ShellFeatureRecord), + typeof (ShellParameterRecord), + }; + } + } + + public override void Register(ContainerBuilder builder) { + _folders = new ExtensionManagerTests.StubFolders(); + builder.RegisterInstance(_folders).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As().SingleInstance(); + builder.RegisterType().As().SingleInstance(); + builder.RegisterType().As().SingleInstance(); + builder.RegisterSource(new EventsRegistrationSource()); + + builder.RegisterInstance(new ShellSettings { Name = "Default" }); + } + + [Test] + public void EnableFeaturesTest() { + _folders.Manifests.Add("SuperWiki", @" +Name: SuperWiki +Version: 1.0.3 +OrchardVersion: 1 +Features: + SuperWiki: + Description: My super wiki module for Orchard. +"); + + // Initialize the shell descriptor with 0 features + IShellDescriptorManager shellDescriptorManager = _container.Resolve(); + IFeatureManager featureManager = _container.Resolve(); + + shellDescriptorManager.UpdateShellDescriptor(0, + Enumerable.Empty(), + Enumerable.Empty()); + + IEnumerable featuresToEnable = new [] { "SuperWiki" }; + + // Enable all features + IEnumerable enabledFeatures = featureManager.EnableFeatures(featuresToEnable); + + Assert.That(enabledFeatures, Is.EqualTo(featuresToEnable)); + Assert.That(featureManager.GetEnabledFeatures().Count(), Is.EqualTo(1)); + } + + [Test] + public void EnableFeaturesWithDependenciesTest() { + _folders.Manifests.Add("SuperWiki", @" +Name: SuperWiki +Version: 1.0.3 +OrchardVersion: 1 +Features: + SuperWiki: + Description: My super wiki module for Orchard. + Dependencies: SuperWikiDep + SuperWikiDep: + Description: My super wiki module for Orchard dependency. +"); + + // Initialize the shell descriptor with 0 features + IShellDescriptorManager shellDescriptorManager = _container.Resolve(); + IFeatureManager featureManager = _container.Resolve(); + + shellDescriptorManager.UpdateShellDescriptor(0, + Enumerable.Empty(), + Enumerable.Empty()); + + IEnumerable featuresToEnable = new[] { "SuperWiki" }; + + // Try to enable without forcing dependencies should fail + IEnumerable enabledFeatures = featureManager.EnableFeatures(featuresToEnable, false); + Assert.That(enabledFeatures.Count(), Is.EqualTo(0)); + Assert.That(featureManager.GetEnabledFeatures().Count(), Is.EqualTo(0)); + + // Enabling while forcing dependencies should succeed. + enabledFeatures = featureManager.EnableFeatures(featuresToEnable, true); + Assert.That(enabledFeatures.Contains("SuperWiki"), Is.True); + Assert.That(enabledFeatures.Contains("SuperWikiDep"), Is.True); + Assert.That(featureManager.GetEnabledFeatures().Count(), Is.EqualTo(2)); + } + + [Test] + public void DisableFeaturesTest() { + _folders.Manifests.Add("SuperWiki", @" +Name: SuperWiki +Version: 1.0.3 +OrchardVersion: 1 +Features: + SuperWiki: + Description: My super wiki module for Orchard. +"); + + // Initialize the shell descriptor with 0 features + IShellDescriptorManager shellDescriptorManager = _container.Resolve(); + IFeatureManager featureManager = _container.Resolve(); + + shellDescriptorManager.UpdateShellDescriptor(0, + new [] { new ShellFeature { Name = "SuperWiki" } }, + Enumerable.Empty()); + + IEnumerable featuresToDisable = new [] { "SuperWiki" }; + + // Disable the feature + featureManager.DisableFeatures(featuresToDisable); + Assert.That(featureManager.GetEnabledFeatures().Count(), Is.EqualTo(0)); + } + + [Test] + public void DisableFeaturesWithDependenciesTest() { + _folders.Manifests.Add("SuperWiki", @" +Name: SuperWiki +Version: 1.0.3 +OrchardVersion: 1 +Features: + SuperWiki: + Description: My super wiki module for Orchard. + Dependencies: SuperWikiDep + SuperWikiDep: + Description: My super wiki module for Orchard dependency. +"); + + // Initialize the shell descriptor with 0 features + IShellDescriptorManager shellDescriptorManager = _container.Resolve(); + IFeatureManager featureManager = _container.Resolve(); + + shellDescriptorManager.UpdateShellDescriptor(0, + Enumerable.Empty(), + Enumerable.Empty()); + + // Enable both features by relying on the dependency + Assert.That(featureManager.EnableFeatures(new [] { "SuperWiki"}, true).Count(), Is.EqualTo(2)); + + IEnumerable featuresToDisable = new[] { "SuperWikiDep" }; + + // Try to enable without forcing dependencies should fail + IEnumerable disabledFeatures = featureManager.DisableFeatures(featuresToDisable, false); + Assert.That(disabledFeatures.Count(), Is.EqualTo(0)); + Assert.That(featureManager.GetEnabledFeatures().Count(), Is.EqualTo(2)); + + // Enabling while forcing dependencies should succeed. + disabledFeatures = featureManager.DisableFeatures(featuresToDisable, true); + Assert.That(disabledFeatures.Contains("SuperWiki"), Is.True); + Assert.That(disabledFeatures.Contains("SuperWikiDep"), Is.True); + Assert.That(featureManager.GetEnabledFeatures().Count(), Is.EqualTo(0)); + } + } + + public class StubEventBus : IEventBus { + public string LastMessageName { get; set; } + public IDictionary LastEventData { get; set; } + + public IEnumerable Notify(string messageName, IDictionary eventData) { + LastMessageName = messageName; + LastEventData = eventData; + return new object[0]; + } + } +} diff --git a/src/Orchard.Tests/Environment/Loaders/DynamicExtensionLoaderTests.cs b/src/Orchard.Tests/Environment/Loaders/DynamicExtensionLoaderTests.cs index caa3a831b34..a63ba150ee9 100644 --- a/src/Orchard.Tests/Environment/Loaders/DynamicExtensionLoaderTests.cs +++ b/src/Orchard.Tests/Environment/Loaders/DynamicExtensionLoaderTests.cs @@ -1,162 +1,162 @@ -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Autofac; -using Moq; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.Environment; -using Orchard.Environment.Extensions.Compilers; -using Orchard.Environment.Extensions.Loaders; -using Orchard.FileSystems.AppData; -using Orchard.FileSystems.Dependencies; -using Orchard.FileSystems.VirtualPath; -using Orchard.Services; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.Environment.Loaders { - [TestFixture] - public class DynamicExtensionLoaderTests { - private IContainer _container; - private Mock _mockedStubProjectFileParser; - private Mock _mockedDependenciesFolder; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - builder.RegisterType().As(); - - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - _mockedStubProjectFileParser = new Mock(); - builder.RegisterInstance(_mockedStubProjectFileParser.Object).As(); - builder.RegisterInstance(new StubFileSystem(new StubClock())).As(); - - _mockedDependenciesFolder = new Mock(); - builder.RegisterInstance(_mockedDependenciesFolder.Object).As(); - - _container = builder.Build(); - } - - [Test] - public void GetDependenciesContainsNoDuplicatesTest() { - const string pathPrefix = "~/modules/foo"; - const string projectName = "orchard.a.csproj"; - const string fileName1 = "a.cs"; - const string fileName2 = "b.cs"; - - var vpp = _container.Resolve(); - var projectPath = vpp.Combine(pathPrefix, projectName); - using (vpp.CreateText(projectPath)) { } - - // Create duplicate source files (invalid situation in reality but easy enough to test) - _mockedStubProjectFileParser.Setup(stubProjectFileParser => stubProjectFileParser.Parse(It.IsAny())).Returns( - new ProjectFileDescriptor { SourceFilenames = new[] { fileName1, fileName2, fileName1 } }); // duplicate file - - var extensionLoader = _container.Resolve(); - var dependencies = extensionLoader.GetDependenciesAccessor(projectPath); - - Assert.That(dependencies.Count(), Is.EqualTo(3), "3 results should mean no duplicates"); - Assert.That(dependencies.FirstOrDefault(dep => dep.Equals(projectPath)), Is.Not.Null); - Assert.That(dependencies.FirstOrDefault(dep => dep.Equals(vpp.Combine(pathPrefix, fileName1))), Is.Not.Null); - Assert.That(dependencies.FirstOrDefault(dep => dep.Equals(vpp.Combine(pathPrefix, fileName2))), Is.Not.Null); - } - - [Test] - public void GetDependenciesContainsNoDuplicatesEvenIfMultipleProjectsTest() { - const string path1Prefix = "~/modules/foo"; - const string path2Prefix = "~/modules/bar"; - const string path3Prefix = "~/modules/blah"; - const string project1Name = "orchard.a.csproj"; - const string project2Name = "orchard.b.csproj"; - const string project3Name = "orchard.c.csproj"; - const string fileName1 = "a.cs"; - const string fileName2 = "b.cs"; - const string commonFileName = "c.cs"; - - var vpp = _container.Resolve(); - - var project1Path = vpp.Combine(path1Prefix, project1Name); - using (vpp.CreateText(project1Path)) { } - - var project2Path = vpp.Combine(path2Prefix, project2Name); - using (vpp.CreateText(project2Path)) { } - - var project3Path = vpp.Combine(path3Prefix, project3Name); - using (vpp.CreateText(project3Path)) { } - - - // Project a reference b and c which share a file in common - - // Result for project a - _mockedStubProjectFileParser - .Setup(stubProjectFileParser => stubProjectFileParser.Parse(It.Is(virtualPath => virtualPath == project1Path))) - .Returns( - new ProjectFileDescriptor { - SourceFilenames = new[] {fileName1, fileName2}, - References = new[] { - new ReferenceDescriptor { - ReferenceType = ReferenceType.Project, - SimpleName = project2Path, - FullName = project2Path, - Path = "..\\bar\\" + project2Name - }, - new ReferenceDescriptor { - ReferenceType = ReferenceType.Project, - SimpleName = project3Path, - FullName = project3Path, - Path = "..\\blah\\" + project3Name - } - } - }); - - // Result for project b and c - _mockedStubProjectFileParser - .Setup(stubProjectFileParser => stubProjectFileParser.Parse(It.Is(virtualPath => (virtualPath == project2Path || virtualPath == project3Path)))) - .Returns( - new ProjectFileDescriptor { - SourceFilenames = new[] { commonFileName } - }); - - var extensionLoader = _container.Resolve(); - var dependencies = extensionLoader.GetDependenciesAccessor(project1Path); - - Assert.That(dependencies.Count(), Is.EqualTo(7), "7 results should mean no duplicates"); - - // Project files - Assert.That(dependencies.FirstOrDefault(dep => dep.Contains(project1Path)), Is.Not.Null); - Assert.That(dependencies.FirstOrDefault(dep => dep.Contains(project2Path)), Is.Not.Null); - Assert.That(dependencies.FirstOrDefault(dep => dep.Contains(project3Path)), Is.Not.Null); - - // Individual source files - Assert.That(dependencies.FirstOrDefault(dep => dep.Contains(vpp.Combine(path1Prefix, fileName1))), Is.Not.Null); - Assert.That(dependencies.FirstOrDefault(dep => dep.Contains(vpp.Combine(path1Prefix, fileName2))), Is.Not.Null); - Assert.That(dependencies.FirstOrDefault(dep => dep.Contains(vpp.Combine(path2Prefix, commonFileName))), Is.Not.Null); - Assert.That(dependencies.FirstOrDefault(dep => dep.Contains(vpp.Combine(path3Prefix, commonFileName))), Is.Not.Null); - } - - internal class DynamicExtensionLoaderAccessor : DynamicExtensionLoader { - public DynamicExtensionLoaderAccessor( - IBuildManager buildManager, - IVirtualPathProvider virtualPathProvider, - IVirtualPathMonitor virtualPathMonitor, - IHostEnvironment hostEnvironment, - IAssemblyProbingFolder assemblyProbingFolder, - IDependenciesFolder dependenciesFolder, - IProjectFileParser projectFileParser) - : base(buildManager, virtualPathProvider, virtualPathMonitor, hostEnvironment, assemblyProbingFolder, dependenciesFolder, projectFileParser) {} - - public IEnumerable GetDependenciesAccessor(string projectPath) { - return GetDependencies(projectPath); - } - } - } -} +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Autofac; +using Moq; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.Environment; +using Orchard.Environment.Extensions.Compilers; +using Orchard.Environment.Extensions.Loaders; +using Orchard.FileSystems.AppData; +using Orchard.FileSystems.Dependencies; +using Orchard.FileSystems.VirtualPath; +using Orchard.Services; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.Environment.Loaders { + [TestFixture] + public class DynamicExtensionLoaderTests { + private IContainer _container; + private Mock _mockedStubProjectFileParser; + private Mock _mockedDependenciesFolder; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + _mockedStubProjectFileParser = new Mock(); + builder.RegisterInstance(_mockedStubProjectFileParser.Object).As(); + builder.RegisterInstance(new StubFileSystem(new StubClock())).As(); + + _mockedDependenciesFolder = new Mock(); + builder.RegisterInstance(_mockedDependenciesFolder.Object).As(); + + _container = builder.Build(); + } + + [Test] + public void GetDependenciesContainsNoDuplicatesTest() { + const string pathPrefix = "~/modules/foo"; + const string projectName = "orchard.a.csproj"; + const string fileName1 = "a.cs"; + const string fileName2 = "b.cs"; + + var vpp = _container.Resolve(); + var projectPath = vpp.Combine(pathPrefix, projectName); + using (vpp.CreateText(projectPath)) { } + + // Create duplicate source files (invalid situation in reality but easy enough to test) + _mockedStubProjectFileParser.Setup(stubProjectFileParser => stubProjectFileParser.Parse(It.IsAny())).Returns( + new ProjectFileDescriptor { SourceFilenames = new[] { fileName1, fileName2, fileName1 } }); // duplicate file + + var extensionLoader = _container.Resolve(); + var dependencies = extensionLoader.GetDependenciesAccessor(projectPath); + + Assert.That(dependencies.Count(), Is.EqualTo(3), "3 results should mean no duplicates"); + Assert.That(dependencies.FirstOrDefault(dep => dep.Equals(projectPath)), Is.Not.Null); + Assert.That(dependencies.FirstOrDefault(dep => dep.Equals(vpp.Combine(pathPrefix, fileName1))), Is.Not.Null); + Assert.That(dependencies.FirstOrDefault(dep => dep.Equals(vpp.Combine(pathPrefix, fileName2))), Is.Not.Null); + } + + [Test] + public void GetDependenciesContainsNoDuplicatesEvenIfMultipleProjectsTest() { + const string path1Prefix = "~/modules/foo"; + const string path2Prefix = "~/modules/bar"; + const string path3Prefix = "~/modules/blah"; + const string project1Name = "orchard.a.csproj"; + const string project2Name = "orchard.b.csproj"; + const string project3Name = "orchard.c.csproj"; + const string fileName1 = "a.cs"; + const string fileName2 = "b.cs"; + const string commonFileName = "c.cs"; + + var vpp = _container.Resolve(); + + var project1Path = vpp.Combine(path1Prefix, project1Name); + using (vpp.CreateText(project1Path)) { } + + var project2Path = vpp.Combine(path2Prefix, project2Name); + using (vpp.CreateText(project2Path)) { } + + var project3Path = vpp.Combine(path3Prefix, project3Name); + using (vpp.CreateText(project3Path)) { } + + + // Project a reference b and c which share a file in common + + // Result for project a + _mockedStubProjectFileParser + .Setup(stubProjectFileParser => stubProjectFileParser.Parse(It.Is(virtualPath => virtualPath == project1Path))) + .Returns( + new ProjectFileDescriptor { + SourceFilenames = new[] {fileName1, fileName2}, + References = new[] { + new ReferenceDescriptor { + ReferenceType = ReferenceType.Project, + SimpleName = project2Path, + FullName = project2Path, + Path = "..\\bar\\" + project2Name + }, + new ReferenceDescriptor { + ReferenceType = ReferenceType.Project, + SimpleName = project3Path, + FullName = project3Path, + Path = "..\\blah\\" + project3Name + } + } + }); + + // Result for project b and c + _mockedStubProjectFileParser + .Setup(stubProjectFileParser => stubProjectFileParser.Parse(It.Is(virtualPath => (virtualPath == project2Path || virtualPath == project3Path)))) + .Returns( + new ProjectFileDescriptor { + SourceFilenames = new[] { commonFileName } + }); + + var extensionLoader = _container.Resolve(); + var dependencies = extensionLoader.GetDependenciesAccessor(project1Path); + + Assert.That(dependencies.Count(), Is.EqualTo(7), "7 results should mean no duplicates"); + + // Project files + Assert.That(dependencies.FirstOrDefault(dep => dep.Contains(project1Path)), Is.Not.Null); + Assert.That(dependencies.FirstOrDefault(dep => dep.Contains(project2Path)), Is.Not.Null); + Assert.That(dependencies.FirstOrDefault(dep => dep.Contains(project3Path)), Is.Not.Null); + + // Individual source files + Assert.That(dependencies.FirstOrDefault(dep => dep.Contains(vpp.Combine(path1Prefix, fileName1))), Is.Not.Null); + Assert.That(dependencies.FirstOrDefault(dep => dep.Contains(vpp.Combine(path1Prefix, fileName2))), Is.Not.Null); + Assert.That(dependencies.FirstOrDefault(dep => dep.Contains(vpp.Combine(path2Prefix, commonFileName))), Is.Not.Null); + Assert.That(dependencies.FirstOrDefault(dep => dep.Contains(vpp.Combine(path3Prefix, commonFileName))), Is.Not.Null); + } + + internal class DynamicExtensionLoaderAccessor : DynamicExtensionLoader { + public DynamicExtensionLoaderAccessor( + IBuildManager buildManager, + IVirtualPathProvider virtualPathProvider, + IVirtualPathMonitor virtualPathMonitor, + IHostEnvironment hostEnvironment, + IAssemblyProbingFolder assemblyProbingFolder, + IDependenciesFolder dependenciesFolder, + IProjectFileParser projectFileParser) + : base(buildManager, virtualPathProvider, virtualPathMonitor, hostEnvironment, assemblyProbingFolder, dependenciesFolder, projectFileParser) {} + + public IEnumerable GetDependenciesAccessor(string projectPath) { + return GetDependencies(projectPath); + } + } + } +} diff --git a/src/Orchard.Tests/Environment/OrchardStarterTests.cs b/src/Orchard.Tests/Environment/OrchardStarterTests.cs index 7d22ca68c6d..492cd343b91 100644 --- a/src/Orchard.Tests/Environment/OrchardStarterTests.cs +++ b/src/Orchard.Tests/Environment/OrchardStarterTests.cs @@ -1,46 +1,46 @@ -using System.Collections.Generic; -using System.Linq; -using System.Web.Mvc; -using Autofac; -using NUnit.Framework; -using Orchard.Environment; - -namespace Orchard.Tests.Environment { - [TestFixture] - public class OrchardStarterTests { - [Test] - public void DefaultOrchardHostInstanceReturnedByCreateHost() { - var host = OrchardStarter.CreateHost(b => b.RegisterInstance(new ControllerBuilder())); - Assert.That(host, Is.TypeOf()); - } - - [Test] - public void ContainerResolvesServicesInSameOrderTheyAreRegistered() { - var container = OrchardStarter.CreateHostContainer(builder => { - builder.RegisterType().As(); - builder.RegisterType().As(); - }); - var services = container.Resolve>(); - Assert.That(services.Count(), Is.EqualTo(2)); - Assert.That(services.First(), Is.TypeOf()); - Assert.That(services.Last(), Is.TypeOf()); - } - - [Test] - public void MostRecentlyRegisteredServiceReturnsFromSingularResolve() { - var container = OrchardStarter.CreateHostContainer(builder => { - builder.RegisterType().As(); - builder.RegisterType().As(); - }); - var service = container.Resolve(); - Assert.That(service, Is.Not.Null); - Assert.That(service, Is.TypeOf()); - } - - public interface IServiceA {} - - public class Component1 : IServiceA {} - - public class Component2 : IServiceA {} - } +using System.Collections.Generic; +using System.Linq; +using System.Web.Mvc; +using Autofac; +using NUnit.Framework; +using Orchard.Environment; + +namespace Orchard.Tests.Environment { + [TestFixture] + public class OrchardStarterTests { + [Test] + public void DefaultOrchardHostInstanceReturnedByCreateHost() { + var host = OrchardStarter.CreateHost(b => b.RegisterInstance(new ControllerBuilder())); + Assert.That(host, Is.TypeOf()); + } + + [Test] + public void ContainerResolvesServicesInSameOrderTheyAreRegistered() { + var container = OrchardStarter.CreateHostContainer(builder => { + builder.RegisterType().As(); + builder.RegisterType().As(); + }); + var services = container.Resolve>(); + Assert.That(services.Count(), Is.EqualTo(2)); + Assert.That(services.First(), Is.TypeOf()); + Assert.That(services.Last(), Is.TypeOf()); + } + + [Test] + public void MostRecentlyRegisteredServiceReturnsFromSingularResolve() { + var container = OrchardStarter.CreateHostContainer(builder => { + builder.RegisterType().As(); + builder.RegisterType().As(); + }); + var service = container.Resolve(); + Assert.That(service, Is.Not.Null); + Assert.That(service, Is.TypeOf()); + } + + public interface IServiceA {} + + public class Component1 : IServiceA {} + + public class Component2 : IServiceA {} + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Environment/RunningShellTableTests.cs b/src/Orchard.Tests/Environment/RunningShellTableTests.cs index 3f49713d497..0d5097128de 100644 --- a/src/Orchard.Tests/Environment/RunningShellTableTests.cs +++ b/src/Orchard.Tests/Environment/RunningShellTableTests.cs @@ -1,290 +1,290 @@ -using System.Collections.Generic; -using NUnit.Framework; -using Orchard.Environment; -using Orchard.Environment.Configuration; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.Environment { - [TestFixture] - public class RunningShellTableTests { - [Test] - public void NoShellsGiveNoMatch() { - var table = new RunningShellTable(); - var match = table.Match(new StubHttpContext()); - Assert.That(match, Is.Null); - } - - [Test] - public void DefaultShellMatchesByDefault() { - var table = (IRunningShellTable)new RunningShellTable(); - var settings = new ShellSettings { Name = ShellSettings.DefaultName }; - table.Add(settings); - var match = table.Match(new StubHttpContext()); - Assert.That(match, Is.EqualTo(settings).Using(new ShellComparer())); - } - - [Test] - public void AnotherShellMatchesByHostHeader() { - var table = (IRunningShellTable)new RunningShellTable(); - var settings = new ShellSettings { Name = ShellSettings.DefaultName }; - var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "a.example.com" }; - table.Add(settings); - table.Add(settingsA); - var match = table.Match(new StubHttpContext("~/foo/bar", "a.example.com")); - Assert.That(match, Is.EqualTo(settingsA).Using(new ShellComparer())); - } - - [Test] - public void DefaultStillCatchesWhenOtherShellsMiss() { - var table = (IRunningShellTable)new RunningShellTable(); - var settings = new ShellSettings { Name = ShellSettings.DefaultName }; - var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "a.example.com" }; - table.Add(settings); - table.Add(settingsA); - var match = table.Match(new StubHttpContext("~/foo/bar", "b.example.com")); - Assert.That(match, Is.EqualTo(settings).Using(new ShellComparer())); - } - - [Test] - public void DefaultWontFallbackIfItHasCriteria() { - var table = (IRunningShellTable)new RunningShellTable(); - var settings = new ShellSettings { Name = ShellSettings.DefaultName, RequestUrlHost = "www.example.com" }; - var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "a.example.com" }; - table.Add(settings); - table.Add(settingsA); - var match = table.Match(new StubHttpContext("~/foo/bar", "b.example.com")); - Assert.That(match, Is.Null); - } - - [Test] - public void DefaultWillCatchRequestsIfItMatchesCriteria() { - var table = (IRunningShellTable)new RunningShellTable(); - var settings = new ShellSettings { Name = ShellSettings.DefaultName, RequestUrlHost = "www.example.com" }; - var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "a.example.com" }; - table.Add(settings); - table.Add(settingsA); - var match = table.Match(new StubHttpContext("~/foo/bar", "www.example.com")); - Assert.That(match, Is.EqualTo(settings).Using(new ShellComparer())); - } - - [Test] - public void NonDefaultCatchallWillFallbackIfNothingElseMatches() { - var table = (IRunningShellTable)new RunningShellTable(); - var settings = new ShellSettings { Name = ShellSettings.DefaultName, RequestUrlHost = "www.example.com" }; - var settingsA = new ShellSettings { Name = "Alpha" }; - table.Add(settings); - table.Add(settingsA); - var match = table.Match(new StubHttpContext("~/foo/bar", "b.example.com")); - Assert.That(match, Is.EqualTo(settingsA).Using(new ShellComparer())); - } - - [Test] - public void DefaultCatchallIsFallbackEvenWhenOthersAreUnqualified() { - var table = (IRunningShellTable)new RunningShellTable(); - var settings = new ShellSettings { Name = ShellSettings.DefaultName }; - var settingsA = new ShellSettings { Name = "Alpha" }; - var settingsB = new ShellSettings { Name = "Beta", RequestUrlHost = "b.example.com" }; - var settingsG = new ShellSettings { Name = "Gamma" }; - table.Add(settings); - table.Add(settingsA); - table.Add(settingsB); - table.Add(settingsG); - var match = table.Match(new StubHttpContext("~/foo/bar", "a.example.com")); - Assert.That(match, Is.EqualTo(settings).Using(new ShellComparer())); - } - - [Test] - public void ThereIsNoFallbackIfMultipleSitesAreUnqualifiedButDefaultIsNotOneOfThem() { - var table = (IRunningShellTable)new RunningShellTable(); - var settings = new ShellSettings { Name = ShellSettings.DefaultName, RequestUrlHost = "www.example.com" }; - var settingsA = new ShellSettings { Name = "Alpha" }; - var settingsB = new ShellSettings { Name = "Beta", RequestUrlHost = "b.example.com" }; - var settingsG = new ShellSettings { Name = "Gamma" }; - table.Add(settings); - table.Add(settingsA); - table.Add(settingsB); - table.Add(settingsG); - var match = table.Match(new StubHttpContext("~/foo/bar", "a.example.com")); - Assert.That(match, Is.Null); - } - - [Test] - public void PathAlsoCausesMatch() { - var table = (IRunningShellTable)new RunningShellTable(); - var settings = new ShellSettings { Name = ShellSettings.DefaultName }; - var settingsA = new ShellSettings { Name = "Alpha", RequestUrlPrefix = "foo" }; - table.Add(settings); - table.Add(settingsA); - var match = table.Match(new StubHttpContext("~/foo/bar", "a.example.com")); - Assert.That(match, Is.EqualTo(settingsA).Using(new ShellComparer())); - } - - [Test] - public void PathAndHostMustBothMatch() { - var table = (IRunningShellTable)new RunningShellTable(); - var settings = new ShellSettings { Name = ShellSettings.DefaultName, RequestUrlHost = "www.example.com", }; - var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "wiki.example.com", RequestUrlPrefix = "foo" }; - var settingsB = new ShellSettings { Name = "Beta", RequestUrlHost = "wiki.example.com", RequestUrlPrefix = "bar" }; - var settingsG = new ShellSettings { Name = "Gamma", RequestUrlHost = "wiki.example.com" }; - var settingsD = new ShellSettings { Name = "Delta", RequestUrlPrefix = "Quux" }; - table.Add(settings); - table.Add(settingsA); - table.Add(settingsB); - table.Add(settingsG); - table.Add(settingsD); - - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "wiki.example.com")), Is.EqualTo(settingsA).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/bar/foo", "wiki.example.com")), Is.EqualTo(settingsB).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/", "wiki.example.com")), Is.EqualTo(settingsG).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/baaz", "wiki.example.com")), Is.EqualTo(settingsG).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "www.example.com")), Is.EqualTo(settings).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/bar/foo", "www.example.com")), Is.EqualTo(settings).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/baaz", "www.example.com")), Is.EqualTo(settings).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "a.example.com")), Is.Null); - - Assert.That(table.Match(new StubHttpContext("~/quux/quad", "wiki.example.com")), Is.EqualTo(settingsG).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/quux/quad", "www.example.com")), Is.EqualTo(settings).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/quux/quad", "a.example.com")), Is.EqualTo(settingsD).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/yarg", "wiki.example.com")), Is.EqualTo(settingsG).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/yarg", "www.example.com")), Is.EqualTo(settings).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/yarg", "a.example.com")), Is.Null); - } - - [Test] - public void PathAndHostMustMatchOnFullUrl() { - var table = (IRunningShellTable)new RunningShellTable(); - var settings = new ShellSettings { Name = ShellSettings.DefaultName, RequestUrlHost = "www.example.com", }; - var settingsB = new ShellSettings { Name = "Beta", RequestUrlHost = "wiki.example.com", RequestUrlPrefix = "bar" }; - var settingsG = new ShellSettings { Name = "Gamma", RequestUrlHost = "wiki.example.com" }; - table.Add(settings); - table.Add(settingsB); - table.Add(settingsG); - - Assert.That(table.Match(new StubHttpContext("~/bar/foo", "wiki.example.com")), Is.EqualTo(settingsB).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/", "wiki.example.com")), Is.EqualTo(settingsG).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/baaz", "wiki.example.com")), Is.EqualTo(settingsG).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/barbaz", "wiki.example.com")), Is.EqualTo(settingsG).Using(new ShellComparer())); - } - [Test] - public void PathAloneWillMatch() { - var table = (IRunningShellTable)new RunningShellTable(); - var settingsA = new ShellSettings { Name = "Alpha", RequestUrlPrefix = "foo" }; - table.Add(settingsA); - - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "wiki.example.com")), Is.EqualTo(settingsA).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/bar/foo", "wiki.example.com")), Is.Null); - } - - [Test] - public void HostNameMatchesRightmostIfRequestIsLonger() { - var table = (IRunningShellTable) new RunningShellTable(); - var settings = new ShellSettings { Name = ShellSettings.DefaultName }; - var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "example.com" }; - table.Add(settings); - table.Add(settingsA); - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "www.example.com")), Is.EqualTo(settings).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "wiki.example.com")), Is.EqualTo(settings).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "example.com")), Is.EqualTo(settingsA).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "localhost")), Is.EqualTo(settings).Using(new ShellComparer())); - } - - [Test] - public void HostNameMatchesRightmostIfStar() { - var table = (IRunningShellTable)new RunningShellTable(); - var settings = new ShellSettings { Name = ShellSettings.DefaultName }; - var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "*.example.com" }; - table.Add(settings); - table.Add(settingsA); - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "www.example.com")), Is.EqualTo(settingsA).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "wiki.example.com")), Is.EqualTo(settingsA).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "example.com")), Is.EqualTo(settingsA).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "localhost")), Is.EqualTo(settings).Using(new ShellComparer())); - } - - [Test] - public void LongestMatchingHostHasPriority() { - var table = (IRunningShellTable) new RunningShellTable(); - var settings = new ShellSettings { Name = ShellSettings.DefaultName }; - var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "www.example.com" }; - var settingsB = new ShellSettings { Name = "Beta", RequestUrlHost = "*.example.com" }; - var settingsG = new ShellSettings { Name = "Gamma", RequestUrlHost = "wiki.example.com" }; - table.Add(settings); - table.Add(settingsA); - table.Add(settingsB); - table.Add(settingsG); - - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "www.example.com")), Is.EqualTo(settingsA).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "wiki.example.com")), Is.EqualTo(settingsG).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "username.example.com")), Is.EqualTo(settingsB).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "localhost")), Is.EqualTo(settings).Using(new ShellComparer())); - } - - [Test] - public void ShellNameUsedToDistinctThingsAsTheyAreAdded() { - var table = (IRunningShellTable)new RunningShellTable(); - var settings = new ShellSettings { Name = ShellSettings.DefaultName }; - var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "removed.example.com" }; - var settingsB = new ShellSettings { Name = "Alpha", RequestUrlHost = "added.example.com" }; - table.Add(settings); - table.Add(settingsA); - table.Add(settingsB); - - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "removed.example.com")), Is.EqualTo(settings).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "added.example.com")), Is.EqualTo(settingsB).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "localhost")), Is.EqualTo(settings).Using(new ShellComparer())); - } - - [Test] - public void MultipleHostsOnShellAreAdded() { - var table = (IRunningShellTable)new RunningShellTable(); - var settingsAlpha = new ShellSettings { Name = "Alpha", RequestUrlHost = "a.example.com,b.example.com" }; - var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "a.example.com" }; - var settingsB = new ShellSettings { Name = "Alpha", RequestUrlHost = "b.example.com" }; - var settingsBeta = new ShellSettings { Name = "Beta", RequestUrlHost = "c.example.com,d.example.com,e.example.com" }; - var settingsC = new ShellSettings { Name = "Beta", RequestUrlHost = "c.example.com" }; - var settingsD = new ShellSettings { Name = "Beta", RequestUrlHost = "d.example.com" }; - var settingsE = new ShellSettings { Name = "Beta", RequestUrlHost = "e.example.com" }; - table.Add(settingsAlpha); - table.Add(settingsBeta); - - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "a.example.com")), Is.EqualTo(settingsA).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "b.example.com")), Is.EqualTo(settingsB).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "c.example.com")), Is.EqualTo(settingsC).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "d.example.com")), Is.EqualTo(settingsD).Using(new ShellComparer())); - Assert.That(table.Match(new StubHttpContext("~/foo/bar", "e.example.com")), Is.EqualTo(settingsE).Using(new ShellComparer())); - } - - public class ShellComparer : IEqualityComparer { - public bool Equals(ShellSettings x, ShellSettings y) { - return x == y || ( - x != null && y != null && - x.DataConnectionString == y.DataConnectionString && - x.DataProvider == y.DataProvider && - x.DataTablePrefix == y.DataTablePrefix && - x.EncryptionAlgorithm == y.EncryptionAlgorithm && - x.EncryptionKey == y.EncryptionKey && - x.HashAlgorithm == y.HashAlgorithm && - x.HashKey == y.HashKey && - x.Name == y.Name && - x.RequestUrlHost == y.RequestUrlHost && - x.RequestUrlPrefix == y.RequestUrlPrefix && - x.State == y.State - ); - } - - public int GetHashCode(ShellSettings obj) { - return obj.DataConnectionString.GetHashCode() ^ - obj.DataProvider.GetHashCode() ^ - obj.DataTablePrefix.GetHashCode() ^ - obj.EncryptionAlgorithm.GetHashCode() ^ - obj.EncryptionKey.GetHashCode() ^ - obj.HashAlgorithm.GetHashCode() ^ - obj.HashKey.GetHashCode() ^ - obj.Name.GetHashCode() ^ - obj.RequestUrlHost.GetHashCode() ^ - obj.RequestUrlPrefix.GetHashCode() ^ - obj.State.GetHashCode(); - } - } - } +using System.Collections.Generic; +using NUnit.Framework; +using Orchard.Environment; +using Orchard.Environment.Configuration; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.Environment { + [TestFixture] + public class RunningShellTableTests { + [Test] + public void NoShellsGiveNoMatch() { + var table = new RunningShellTable(); + var match = table.Match(new StubHttpContext()); + Assert.That(match, Is.Null); + } + + [Test] + public void DefaultShellMatchesByDefault() { + var table = (IRunningShellTable)new RunningShellTable(); + var settings = new ShellSettings { Name = ShellSettings.DefaultName }; + table.Add(settings); + var match = table.Match(new StubHttpContext()); + Assert.That(match, Is.EqualTo(settings).Using(new ShellComparer())); + } + + [Test] + public void AnotherShellMatchesByHostHeader() { + var table = (IRunningShellTable)new RunningShellTable(); + var settings = new ShellSettings { Name = ShellSettings.DefaultName }; + var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "a.example.com" }; + table.Add(settings); + table.Add(settingsA); + var match = table.Match(new StubHttpContext("~/foo/bar", "a.example.com")); + Assert.That(match, Is.EqualTo(settingsA).Using(new ShellComparer())); + } + + [Test] + public void DefaultStillCatchesWhenOtherShellsMiss() { + var table = (IRunningShellTable)new RunningShellTable(); + var settings = new ShellSettings { Name = ShellSettings.DefaultName }; + var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "a.example.com" }; + table.Add(settings); + table.Add(settingsA); + var match = table.Match(new StubHttpContext("~/foo/bar", "b.example.com")); + Assert.That(match, Is.EqualTo(settings).Using(new ShellComparer())); + } + + [Test] + public void DefaultWontFallbackIfItHasCriteria() { + var table = (IRunningShellTable)new RunningShellTable(); + var settings = new ShellSettings { Name = ShellSettings.DefaultName, RequestUrlHost = "www.example.com" }; + var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "a.example.com" }; + table.Add(settings); + table.Add(settingsA); + var match = table.Match(new StubHttpContext("~/foo/bar", "b.example.com")); + Assert.That(match, Is.Null); + } + + [Test] + public void DefaultWillCatchRequestsIfItMatchesCriteria() { + var table = (IRunningShellTable)new RunningShellTable(); + var settings = new ShellSettings { Name = ShellSettings.DefaultName, RequestUrlHost = "www.example.com" }; + var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "a.example.com" }; + table.Add(settings); + table.Add(settingsA); + var match = table.Match(new StubHttpContext("~/foo/bar", "www.example.com")); + Assert.That(match, Is.EqualTo(settings).Using(new ShellComparer())); + } + + [Test] + public void NonDefaultCatchallWillFallbackIfNothingElseMatches() { + var table = (IRunningShellTable)new RunningShellTable(); + var settings = new ShellSettings { Name = ShellSettings.DefaultName, RequestUrlHost = "www.example.com" }; + var settingsA = new ShellSettings { Name = "Alpha" }; + table.Add(settings); + table.Add(settingsA); + var match = table.Match(new StubHttpContext("~/foo/bar", "b.example.com")); + Assert.That(match, Is.EqualTo(settingsA).Using(new ShellComparer())); + } + + [Test] + public void DefaultCatchallIsFallbackEvenWhenOthersAreUnqualified() { + var table = (IRunningShellTable)new RunningShellTable(); + var settings = new ShellSettings { Name = ShellSettings.DefaultName }; + var settingsA = new ShellSettings { Name = "Alpha" }; + var settingsB = new ShellSettings { Name = "Beta", RequestUrlHost = "b.example.com" }; + var settingsG = new ShellSettings { Name = "Gamma" }; + table.Add(settings); + table.Add(settingsA); + table.Add(settingsB); + table.Add(settingsG); + var match = table.Match(new StubHttpContext("~/foo/bar", "a.example.com")); + Assert.That(match, Is.EqualTo(settings).Using(new ShellComparer())); + } + + [Test] + public void ThereIsNoFallbackIfMultipleSitesAreUnqualifiedButDefaultIsNotOneOfThem() { + var table = (IRunningShellTable)new RunningShellTable(); + var settings = new ShellSettings { Name = ShellSettings.DefaultName, RequestUrlHost = "www.example.com" }; + var settingsA = new ShellSettings { Name = "Alpha" }; + var settingsB = new ShellSettings { Name = "Beta", RequestUrlHost = "b.example.com" }; + var settingsG = new ShellSettings { Name = "Gamma" }; + table.Add(settings); + table.Add(settingsA); + table.Add(settingsB); + table.Add(settingsG); + var match = table.Match(new StubHttpContext("~/foo/bar", "a.example.com")); + Assert.That(match, Is.Null); + } + + [Test] + public void PathAlsoCausesMatch() { + var table = (IRunningShellTable)new RunningShellTable(); + var settings = new ShellSettings { Name = ShellSettings.DefaultName }; + var settingsA = new ShellSettings { Name = "Alpha", RequestUrlPrefix = "foo" }; + table.Add(settings); + table.Add(settingsA); + var match = table.Match(new StubHttpContext("~/foo/bar", "a.example.com")); + Assert.That(match, Is.EqualTo(settingsA).Using(new ShellComparer())); + } + + [Test] + public void PathAndHostMustBothMatch() { + var table = (IRunningShellTable)new RunningShellTable(); + var settings = new ShellSettings { Name = ShellSettings.DefaultName, RequestUrlHost = "www.example.com", }; + var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "wiki.example.com", RequestUrlPrefix = "foo" }; + var settingsB = new ShellSettings { Name = "Beta", RequestUrlHost = "wiki.example.com", RequestUrlPrefix = "bar" }; + var settingsG = new ShellSettings { Name = "Gamma", RequestUrlHost = "wiki.example.com" }; + var settingsD = new ShellSettings { Name = "Delta", RequestUrlPrefix = "Quux" }; + table.Add(settings); + table.Add(settingsA); + table.Add(settingsB); + table.Add(settingsG); + table.Add(settingsD); + + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "wiki.example.com")), Is.EqualTo(settingsA).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/bar/foo", "wiki.example.com")), Is.EqualTo(settingsB).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/", "wiki.example.com")), Is.EqualTo(settingsG).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/baaz", "wiki.example.com")), Is.EqualTo(settingsG).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "www.example.com")), Is.EqualTo(settings).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/bar/foo", "www.example.com")), Is.EqualTo(settings).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/baaz", "www.example.com")), Is.EqualTo(settings).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "a.example.com")), Is.Null); + + Assert.That(table.Match(new StubHttpContext("~/quux/quad", "wiki.example.com")), Is.EqualTo(settingsG).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/quux/quad", "www.example.com")), Is.EqualTo(settings).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/quux/quad", "a.example.com")), Is.EqualTo(settingsD).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/yarg", "wiki.example.com")), Is.EqualTo(settingsG).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/yarg", "www.example.com")), Is.EqualTo(settings).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/yarg", "a.example.com")), Is.Null); + } + + [Test] + public void PathAndHostMustMatchOnFullUrl() { + var table = (IRunningShellTable)new RunningShellTable(); + var settings = new ShellSettings { Name = ShellSettings.DefaultName, RequestUrlHost = "www.example.com", }; + var settingsB = new ShellSettings { Name = "Beta", RequestUrlHost = "wiki.example.com", RequestUrlPrefix = "bar" }; + var settingsG = new ShellSettings { Name = "Gamma", RequestUrlHost = "wiki.example.com" }; + table.Add(settings); + table.Add(settingsB); + table.Add(settingsG); + + Assert.That(table.Match(new StubHttpContext("~/bar/foo", "wiki.example.com")), Is.EqualTo(settingsB).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/", "wiki.example.com")), Is.EqualTo(settingsG).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/baaz", "wiki.example.com")), Is.EqualTo(settingsG).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/barbaz", "wiki.example.com")), Is.EqualTo(settingsG).Using(new ShellComparer())); + } + [Test] + public void PathAloneWillMatch() { + var table = (IRunningShellTable)new RunningShellTable(); + var settingsA = new ShellSettings { Name = "Alpha", RequestUrlPrefix = "foo" }; + table.Add(settingsA); + + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "wiki.example.com")), Is.EqualTo(settingsA).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/bar/foo", "wiki.example.com")), Is.Null); + } + + [Test] + public void HostNameMatchesRightmostIfRequestIsLonger() { + var table = (IRunningShellTable) new RunningShellTable(); + var settings = new ShellSettings { Name = ShellSettings.DefaultName }; + var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "example.com" }; + table.Add(settings); + table.Add(settingsA); + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "www.example.com")), Is.EqualTo(settings).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "wiki.example.com")), Is.EqualTo(settings).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "example.com")), Is.EqualTo(settingsA).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "localhost")), Is.EqualTo(settings).Using(new ShellComparer())); + } + + [Test] + public void HostNameMatchesRightmostIfStar() { + var table = (IRunningShellTable)new RunningShellTable(); + var settings = new ShellSettings { Name = ShellSettings.DefaultName }; + var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "*.example.com" }; + table.Add(settings); + table.Add(settingsA); + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "www.example.com")), Is.EqualTo(settingsA).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "wiki.example.com")), Is.EqualTo(settingsA).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "example.com")), Is.EqualTo(settingsA).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "localhost")), Is.EqualTo(settings).Using(new ShellComparer())); + } + + [Test] + public void LongestMatchingHostHasPriority() { + var table = (IRunningShellTable) new RunningShellTable(); + var settings = new ShellSettings { Name = ShellSettings.DefaultName }; + var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "www.example.com" }; + var settingsB = new ShellSettings { Name = "Beta", RequestUrlHost = "*.example.com" }; + var settingsG = new ShellSettings { Name = "Gamma", RequestUrlHost = "wiki.example.com" }; + table.Add(settings); + table.Add(settingsA); + table.Add(settingsB); + table.Add(settingsG); + + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "www.example.com")), Is.EqualTo(settingsA).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "wiki.example.com")), Is.EqualTo(settingsG).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "username.example.com")), Is.EqualTo(settingsB).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "localhost")), Is.EqualTo(settings).Using(new ShellComparer())); + } + + [Test] + public void ShellNameUsedToDistinctThingsAsTheyAreAdded() { + var table = (IRunningShellTable)new RunningShellTable(); + var settings = new ShellSettings { Name = ShellSettings.DefaultName }; + var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "removed.example.com" }; + var settingsB = new ShellSettings { Name = "Alpha", RequestUrlHost = "added.example.com" }; + table.Add(settings); + table.Add(settingsA); + table.Add(settingsB); + + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "removed.example.com")), Is.EqualTo(settings).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "added.example.com")), Is.EqualTo(settingsB).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "localhost")), Is.EqualTo(settings).Using(new ShellComparer())); + } + + [Test] + public void MultipleHostsOnShellAreAdded() { + var table = (IRunningShellTable)new RunningShellTable(); + var settingsAlpha = new ShellSettings { Name = "Alpha", RequestUrlHost = "a.example.com,b.example.com" }; + var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "a.example.com" }; + var settingsB = new ShellSettings { Name = "Alpha", RequestUrlHost = "b.example.com" }; + var settingsBeta = new ShellSettings { Name = "Beta", RequestUrlHost = "c.example.com,d.example.com,e.example.com" }; + var settingsC = new ShellSettings { Name = "Beta", RequestUrlHost = "c.example.com" }; + var settingsD = new ShellSettings { Name = "Beta", RequestUrlHost = "d.example.com" }; + var settingsE = new ShellSettings { Name = "Beta", RequestUrlHost = "e.example.com" }; + table.Add(settingsAlpha); + table.Add(settingsBeta); + + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "a.example.com")), Is.EqualTo(settingsA).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "b.example.com")), Is.EqualTo(settingsB).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "c.example.com")), Is.EqualTo(settingsC).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "d.example.com")), Is.EqualTo(settingsD).Using(new ShellComparer())); + Assert.That(table.Match(new StubHttpContext("~/foo/bar", "e.example.com")), Is.EqualTo(settingsE).Using(new ShellComparer())); + } + + public class ShellComparer : IEqualityComparer { + public bool Equals(ShellSettings x, ShellSettings y) { + return x == y || ( + x != null && y != null && + x.DataConnectionString == y.DataConnectionString && + x.DataProvider == y.DataProvider && + x.DataTablePrefix == y.DataTablePrefix && + x.EncryptionAlgorithm == y.EncryptionAlgorithm && + x.EncryptionKey == y.EncryptionKey && + x.HashAlgorithm == y.HashAlgorithm && + x.HashKey == y.HashKey && + x.Name == y.Name && + x.RequestUrlHost == y.RequestUrlHost && + x.RequestUrlPrefix == y.RequestUrlPrefix && + x.State == y.State + ); + } + + public int GetHashCode(ShellSettings obj) { + return obj.DataConnectionString.GetHashCode() ^ + obj.DataProvider.GetHashCode() ^ + obj.DataTablePrefix.GetHashCode() ^ + obj.EncryptionAlgorithm.GetHashCode() ^ + obj.EncryptionKey.GetHashCode() ^ + obj.HashAlgorithm.GetHashCode() ^ + obj.HashKey.GetHashCode() ^ + obj.Name.GetHashCode() ^ + obj.RequestUrlHost.GetHashCode() ^ + obj.RequestUrlPrefix.GetHashCode() ^ + obj.State.GetHashCode(); + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Environment/ShellBuilders/DefaultShellContainerFactoryTests.cs b/src/Orchard.Tests/Environment/ShellBuilders/DefaultShellContainerFactoryTests.cs index 00c9dbe44aa..dc75360f26a 100644 --- a/src/Orchard.Tests/Environment/ShellBuilders/DefaultShellContainerFactoryTests.cs +++ b/src/Orchard.Tests/Environment/ShellBuilders/DefaultShellContainerFactoryTests.cs @@ -1,351 +1,351 @@ -using System.Linq; -using System.Web.Http.Controllers; -using System.Web.Mvc; -using Autofac; -using Autofac.Core; -using Autofac.Core.Lifetime; -using Autofac.Features.Indexed; -using Autofac.Features.Metadata; -using Castle.DynamicProxy; -using NUnit.Framework; -using Orchard.Environment; -using Orchard.Environment.AutofacUtil.DynamicProxy2; -using Orchard.Environment.Configuration; -using Orchard.Environment.Extensions.Models; -using Orchard.Environment.ShellBuilders; -using Orchard.Environment.Descriptor.Models; -using Orchard.Environment.ShellBuilders.Models; - -namespace Orchard.Tests.Environment.ShellBuilders { - [TestFixture] - public class DefaultShellContainerFactoryTests { - private IContainer _container; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType(); - builder.RegisterType().As(); - _container = builder.Build(); - } - - ShellSettings CreateSettings() { - return new ShellSettings { Name = ShellSettings.DefaultName }; - } - ShellBlueprint CreateBlueprint(params ShellBlueprintItem[] items) { - return new ShellBlueprint { - Dependencies = items.OfType(), - Controllers = items.OfType().Where(bp => typeof(IController).IsAssignableFrom(bp.Type)), - HttpControllers = items.OfType().Where(bp => typeof(IHttpController).IsAssignableFrom(bp.Type)), - Records = items.OfType(), - }; - } - - DependencyBlueprint WithModule() { - return new DependencyBlueprint { Type = typeof(T), Parameters = Enumerable.Empty() }; - } - - ControllerBlueprint WithController(string areaName, string controllerName) { - return new ControllerBlueprint { Type = typeof(T), AreaName = areaName, ControllerName = controllerName }; - } - - DependencyBlueprint WithDependency() { - return new DependencyBlueprint { Type = typeof(T), Parameters = Enumerable.Empty() }; - } - - [Test] - public void ShouldReturnChildLifetimeScopeNamedShell() { - var settings = CreateSettings(); - var blueprint = CreateBlueprint(); - var factory = _container.Resolve(); - var shellContainer = factory.CreateContainer(settings, blueprint); - - Assert.That(shellContainer.Tag, Is.EqualTo("shell")); - - var scope = (LifetimeScope)shellContainer; - Assert.That(scope.RootLifetimeScope, Is.SameAs(_container.Resolve())); - Assert.That(scope.RootLifetimeScope, Is.Not.SameAs(shellContainer.Resolve())); - } - - - - [Test] - public void ControllersAreRegisteredAsKeyedServices() { - var settings = CreateSettings(); - var blueprint = CreateBlueprint( - WithModule(), - WithController("foo", "bar")); - - var factory = _container.Resolve(); - var shellContainer = factory.CreateContainer(settings, blueprint); - var controllers = shellContainer.Resolve>(); - var controller = controllers["foo/bar"]; - Assert.That(controller, Is.Not.Null); - Assert.That(controller, Is.InstanceOf()); - } - - public class TestController : Controller { - } - - - [Test] - public void ModulesAreResolvedAndRegistered() { - var settings = CreateSettings(); - var blueprint = CreateBlueprint( - WithModule(), - WithController("foo", "bar")); - - var factory = _container.Resolve(); - var shellContainer = factory.CreateContainer(settings, blueprint); - - var controllerMetas = shellContainer.Resolve>>(); - var metadata = controllerMetas["foo/bar"].Metadata; - - Assert.That(metadata["Hello"], Is.EqualTo("World")); - } - - - public class TestModule : Module { - protected override void AttachToComponentRegistration(IComponentRegistry componentRegistry, IComponentRegistration registration) { - registration.Metadata["Hello"] = "World"; - } - } - - [Test] - public void ModulesMayResolveHostServices() { - var settings = CreateSettings(); - var blueprint = CreateBlueprint( - WithModule()); - - var factory = _container.Resolve(); - var shellContainer = factory.CreateContainer(settings, blueprint); - Assert.That(shellContainer.Resolve(), Is.EqualTo("Module was loaded")); - } - - public class ComponentForHostContainer { - - } - - public class ModuleUsingThatComponent : Module { - private readonly ComponentForHostContainer _di; - - public ModuleUsingThatComponent(ComponentForHostContainer di) { - _di = di; - } - - protected override void Load(ContainerBuilder builder) { - builder.RegisterInstance("Module was loaded"); - } - } - - [Test] - public void DependenciesAreResolvable() { - var settings = CreateSettings(); - var blueprint = CreateBlueprint( - WithDependency()); - - var factory = _container.Resolve(); - var shellContainer = factory.CreateContainer(settings, blueprint); - - var testDependency = shellContainer.Resolve(); - Assert.That(testDependency, Is.Not.Null); - Assert.That(testDependency, Is.InstanceOf()); - } - - public interface ITestDependency : IDependency { - - } - public class TestDependency : ITestDependency { - } - - [Test] - public void ComponentsImplementingMultipleContractsAreResolvableOnce() { - var settings = CreateSettings(); - var blueprint = CreateBlueprint( - WithDependency() - ); - - var factory = _container.Resolve(); - var shellContainer = factory.CreateContainer(settings, blueprint); - - var multipleDependency1 = shellContainer.Resolve(); - var multipleDependency2 = shellContainer.Resolve(); - - Assert.That(multipleDependency1, Is.Not.Null); - Assert.That(multipleDependency2, Is.Not.Null); - - Assert.That(multipleDependency1, Is.InstanceOf()); - Assert.That(multipleDependency2, Is.InstanceOf()); - - Assert.True(multipleDependency1 == multipleDependency2); - } - - public interface IMultipleDependency1 : IDependency { - - } - public interface IMultipleDependency2 : IDependency { - - } - public class MultipleDependency : IMultipleDependency1, IMultipleDependency2 { - - } - - [Test] - public void ExtraInformationCanDropIntoProperties() { - var settings = CreateSettings(); - var blueprint = CreateBlueprint( - WithDependency()); - - blueprint.Dependencies.Single().Feature = - new Feature { Descriptor = new FeatureDescriptor { Id = "Hello" } }; - - var factory = _container.Resolve(); - var shellContainer = factory.CreateContainer(settings, blueprint); - - var testDependency = shellContainer.Resolve(); - Assert.That(testDependency, Is.Not.Null); - Assert.That(testDependency, Is.InstanceOf()); - - var testDependency2 = (TestDependency2)testDependency; - - Assert.That(testDependency2.Feature.Descriptor, Is.Not.Null); - Assert.That(testDependency2.Feature.Descriptor.Id, Is.EqualTo("Hello")); - } - - public class TestDependency2 : ITestDependency { - public Feature Feature { get; set; } - } - - [Test] - public void ParametersMayOrMayNotBeUsedAsPropertiesAndConstructorParameters() { - var settings = CreateSettings(); - var blueprint = CreateBlueprint( - WithDependency()); - - blueprint.Dependencies.Single().Parameters = - new[] { - new ShellParameter {Name = "alpha", Value = "-a-"}, - new ShellParameter {Name = "Beta", Value = "-b-"}, - new ShellParameter {Name = "Gamma", Value = "-g-"}, - }; - - var factory = _container.Resolve(); - var shellContainer = factory.CreateContainer(settings, blueprint); - - var testDependency = shellContainer.Resolve(); - Assert.That(testDependency, Is.Not.Null); - Assert.That(testDependency, Is.InstanceOf()); - - var testDependency3 = (TestDependency3)testDependency; - Assert.That(testDependency3.GetAlpha(), Is.EqualTo("-a-")); - Assert.That(testDependency3.Beta, Is.EqualTo("-b-")); - Assert.That(testDependency3.Delta, Is.EqualTo("y")); - } - - public class TestDependency3 : ITestDependency { - private readonly string _alpha; - - public TestDependency3(string alpha) { - _alpha = alpha; - Beta = "x"; - Delta = "y"; - } - - public string Beta { get; set; } - public string Delta { get; set; } - - public string GetAlpha() { - return _alpha; - } - } - - - [Test] - public void DynamicProxyIsInEffect() { - var settings = CreateSettings(); - var blueprint = CreateBlueprint( - WithModule(), - WithDependency()); - - var factory = _container.Resolve(); - var shellContainer = factory.CreateContainer(settings, blueprint); - - var testDependency = shellContainer.Resolve(); - Assert.That(testDependency.Hello(), Is.EqualTo("Foo")); - - var blueprint2 = CreateBlueprint( - WithDependency()); - - var shellContainer2 = factory.CreateContainer(settings, blueprint2); - - var testDependency2 = shellContainer2.Resolve(); - Assert.That(testDependency2.Hello(), Is.EqualTo("World")); - } - - public interface IProxDependency : IDependency { - string Hello(); - } - - public class ProxDependency : IProxDependency { - public virtual string Hello() { - return "World"; - } - } - - public class ProxIntercept : IInterceptor { - public void Intercept(IInvocation invocation) { - invocation.ReturnValue = "Foo"; - } - } - - public class ProxModule : Module { - protected override void Load(ContainerBuilder builder) { - builder.RegisterType(); - } - - protected override void AttachToComponentRegistration(IComponentRegistry componentRegistry, IComponentRegistration registration) { - if (registration.Activator.LimitType == typeof(ProxDependency)) { - registration.InterceptedBy(); - } - } - } - - [Test] - public void DynamicProxyAndShellSettingsAreResolvableToSameInstances() { - var settings = CreateSettings(); - var blueprint = CreateBlueprint(); - - var factory = _container.Resolve(); - var shellContainer = factory.CreateContainer(settings, blueprint); - - var proxa = shellContainer.Resolve(); - var proxb = shellContainer.Resolve(); - var setta = shellContainer.Resolve(); - var settb = shellContainer.Resolve(); - - Assert.That(proxa, Is.Not.Null); - Assert.That(proxa, Is.SameAs(proxb)); - Assert.That(setta, Is.Not.Null); - Assert.That(setta, Is.SameAs(settb)); - - var settings2 = CreateSettings(); - var blueprint2 = CreateBlueprint(); - var shellContainer2 = factory.CreateContainer(settings2, blueprint2); - - var proxa2 = shellContainer2.Resolve(); - var proxb2 = shellContainer2.Resolve(); - var setta2 = shellContainer2.Resolve(); - var settb2 = shellContainer2.Resolve(); - - Assert.That(proxa2, Is.Not.Null); - Assert.That(proxa2, Is.SameAs(proxb2)); - Assert.That(setta2, Is.Not.Null); - Assert.That(setta2, Is.SameAs(settb2)); - - Assert.That(proxa, Is.Not.SameAs(proxa2)); - Assert.That(setta, Is.Not.SameAs(setta2)); - } - } -} +using System.Linq; +using System.Web.Http.Controllers; +using System.Web.Mvc; +using Autofac; +using Autofac.Core; +using Autofac.Core.Lifetime; +using Autofac.Features.Indexed; +using Autofac.Features.Metadata; +using Castle.DynamicProxy; +using NUnit.Framework; +using Orchard.Environment; +using Orchard.Environment.AutofacUtil.DynamicProxy2; +using Orchard.Environment.Configuration; +using Orchard.Environment.Extensions.Models; +using Orchard.Environment.ShellBuilders; +using Orchard.Environment.Descriptor.Models; +using Orchard.Environment.ShellBuilders.Models; + +namespace Orchard.Tests.Environment.ShellBuilders { + [TestFixture] + public class DefaultShellContainerFactoryTests { + private IContainer _container; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType(); + builder.RegisterType().As(); + _container = builder.Build(); + } + + ShellSettings CreateSettings() { + return new ShellSettings { Name = ShellSettings.DefaultName }; + } + ShellBlueprint CreateBlueprint(params ShellBlueprintItem[] items) { + return new ShellBlueprint { + Dependencies = items.OfType(), + Controllers = items.OfType().Where(bp => typeof(IController).IsAssignableFrom(bp.Type)), + HttpControllers = items.OfType().Where(bp => typeof(IHttpController).IsAssignableFrom(bp.Type)), + Records = items.OfType(), + }; + } + + DependencyBlueprint WithModule() { + return new DependencyBlueprint { Type = typeof(T), Parameters = Enumerable.Empty() }; + } + + ControllerBlueprint WithController(string areaName, string controllerName) { + return new ControllerBlueprint { Type = typeof(T), AreaName = areaName, ControllerName = controllerName }; + } + + DependencyBlueprint WithDependency() { + return new DependencyBlueprint { Type = typeof(T), Parameters = Enumerable.Empty() }; + } + + [Test] + public void ShouldReturnChildLifetimeScopeNamedShell() { + var settings = CreateSettings(); + var blueprint = CreateBlueprint(); + var factory = _container.Resolve(); + var shellContainer = factory.CreateContainer(settings, blueprint); + + Assert.That(shellContainer.Tag, Is.EqualTo("shell")); + + var scope = (LifetimeScope)shellContainer; + Assert.That(scope.RootLifetimeScope, Is.SameAs(_container.Resolve())); + Assert.That(scope.RootLifetimeScope, Is.Not.SameAs(shellContainer.Resolve())); + } + + + + [Test] + public void ControllersAreRegisteredAsKeyedServices() { + var settings = CreateSettings(); + var blueprint = CreateBlueprint( + WithModule(), + WithController("foo", "bar")); + + var factory = _container.Resolve(); + var shellContainer = factory.CreateContainer(settings, blueprint); + var controllers = shellContainer.Resolve>(); + var controller = controllers["foo/bar"]; + Assert.That(controller, Is.Not.Null); + Assert.That(controller, Is.InstanceOf()); + } + + public class TestController : Controller { + } + + + [Test] + public void ModulesAreResolvedAndRegistered() { + var settings = CreateSettings(); + var blueprint = CreateBlueprint( + WithModule(), + WithController("foo", "bar")); + + var factory = _container.Resolve(); + var shellContainer = factory.CreateContainer(settings, blueprint); + + var controllerMetas = shellContainer.Resolve>>(); + var metadata = controllerMetas["foo/bar"].Metadata; + + Assert.That(metadata["Hello"], Is.EqualTo("World")); + } + + + public class TestModule : Module { + protected override void AttachToComponentRegistration(IComponentRegistry componentRegistry, IComponentRegistration registration) { + registration.Metadata["Hello"] = "World"; + } + } + + [Test] + public void ModulesMayResolveHostServices() { + var settings = CreateSettings(); + var blueprint = CreateBlueprint( + WithModule()); + + var factory = _container.Resolve(); + var shellContainer = factory.CreateContainer(settings, blueprint); + Assert.That(shellContainer.Resolve(), Is.EqualTo("Module was loaded")); + } + + public class ComponentForHostContainer { + + } + + public class ModuleUsingThatComponent : Module { + private readonly ComponentForHostContainer _di; + + public ModuleUsingThatComponent(ComponentForHostContainer di) { + _di = di; + } + + protected override void Load(ContainerBuilder builder) { + builder.RegisterInstance("Module was loaded"); + } + } + + [Test] + public void DependenciesAreResolvable() { + var settings = CreateSettings(); + var blueprint = CreateBlueprint( + WithDependency()); + + var factory = _container.Resolve(); + var shellContainer = factory.CreateContainer(settings, blueprint); + + var testDependency = shellContainer.Resolve(); + Assert.That(testDependency, Is.Not.Null); + Assert.That(testDependency, Is.InstanceOf()); + } + + public interface ITestDependency : IDependency { + + } + public class TestDependency : ITestDependency { + } + + [Test] + public void ComponentsImplementingMultipleContractsAreResolvableOnce() { + var settings = CreateSettings(); + var blueprint = CreateBlueprint( + WithDependency() + ); + + var factory = _container.Resolve(); + var shellContainer = factory.CreateContainer(settings, blueprint); + + var multipleDependency1 = shellContainer.Resolve(); + var multipleDependency2 = shellContainer.Resolve(); + + Assert.That(multipleDependency1, Is.Not.Null); + Assert.That(multipleDependency2, Is.Not.Null); + + Assert.That(multipleDependency1, Is.InstanceOf()); + Assert.That(multipleDependency2, Is.InstanceOf()); + + Assert.True(multipleDependency1 == multipleDependency2); + } + + public interface IMultipleDependency1 : IDependency { + + } + public interface IMultipleDependency2 : IDependency { + + } + public class MultipleDependency : IMultipleDependency1, IMultipleDependency2 { + + } + + [Test] + public void ExtraInformationCanDropIntoProperties() { + var settings = CreateSettings(); + var blueprint = CreateBlueprint( + WithDependency()); + + blueprint.Dependencies.Single().Feature = + new Feature { Descriptor = new FeatureDescriptor { Id = "Hello" } }; + + var factory = _container.Resolve(); + var shellContainer = factory.CreateContainer(settings, blueprint); + + var testDependency = shellContainer.Resolve(); + Assert.That(testDependency, Is.Not.Null); + Assert.That(testDependency, Is.InstanceOf()); + + var testDependency2 = (TestDependency2)testDependency; + + Assert.That(testDependency2.Feature.Descriptor, Is.Not.Null); + Assert.That(testDependency2.Feature.Descriptor.Id, Is.EqualTo("Hello")); + } + + public class TestDependency2 : ITestDependency { + public Feature Feature { get; set; } + } + + [Test] + public void ParametersMayOrMayNotBeUsedAsPropertiesAndConstructorParameters() { + var settings = CreateSettings(); + var blueprint = CreateBlueprint( + WithDependency()); + + blueprint.Dependencies.Single().Parameters = + new[] { + new ShellParameter {Name = "alpha", Value = "-a-"}, + new ShellParameter {Name = "Beta", Value = "-b-"}, + new ShellParameter {Name = "Gamma", Value = "-g-"}, + }; + + var factory = _container.Resolve(); + var shellContainer = factory.CreateContainer(settings, blueprint); + + var testDependency = shellContainer.Resolve(); + Assert.That(testDependency, Is.Not.Null); + Assert.That(testDependency, Is.InstanceOf()); + + var testDependency3 = (TestDependency3)testDependency; + Assert.That(testDependency3.GetAlpha(), Is.EqualTo("-a-")); + Assert.That(testDependency3.Beta, Is.EqualTo("-b-")); + Assert.That(testDependency3.Delta, Is.EqualTo("y")); + } + + public class TestDependency3 : ITestDependency { + private readonly string _alpha; + + public TestDependency3(string alpha) { + _alpha = alpha; + Beta = "x"; + Delta = "y"; + } + + public string Beta { get; set; } + public string Delta { get; set; } + + public string GetAlpha() { + return _alpha; + } + } + + + [Test] + public void DynamicProxyIsInEffect() { + var settings = CreateSettings(); + var blueprint = CreateBlueprint( + WithModule(), + WithDependency()); + + var factory = _container.Resolve(); + var shellContainer = factory.CreateContainer(settings, blueprint); + + var testDependency = shellContainer.Resolve(); + Assert.That(testDependency.Hello(), Is.EqualTo("Foo")); + + var blueprint2 = CreateBlueprint( + WithDependency()); + + var shellContainer2 = factory.CreateContainer(settings, blueprint2); + + var testDependency2 = shellContainer2.Resolve(); + Assert.That(testDependency2.Hello(), Is.EqualTo("World")); + } + + public interface IProxDependency : IDependency { + string Hello(); + } + + public class ProxDependency : IProxDependency { + public virtual string Hello() { + return "World"; + } + } + + public class ProxIntercept : IInterceptor { + public void Intercept(IInvocation invocation) { + invocation.ReturnValue = "Foo"; + } + } + + public class ProxModule : Module { + protected override void Load(ContainerBuilder builder) { + builder.RegisterType(); + } + + protected override void AttachToComponentRegistration(IComponentRegistry componentRegistry, IComponentRegistration registration) { + if (registration.Activator.LimitType == typeof(ProxDependency)) { + registration.InterceptedBy(); + } + } + } + + [Test] + public void DynamicProxyAndShellSettingsAreResolvableToSameInstances() { + var settings = CreateSettings(); + var blueprint = CreateBlueprint(); + + var factory = _container.Resolve(); + var shellContainer = factory.CreateContainer(settings, blueprint); + + var proxa = shellContainer.Resolve(); + var proxb = shellContainer.Resolve(); + var setta = shellContainer.Resolve(); + var settb = shellContainer.Resolve(); + + Assert.That(proxa, Is.Not.Null); + Assert.That(proxa, Is.SameAs(proxb)); + Assert.That(setta, Is.Not.Null); + Assert.That(setta, Is.SameAs(settb)); + + var settings2 = CreateSettings(); + var blueprint2 = CreateBlueprint(); + var shellContainer2 = factory.CreateContainer(settings2, blueprint2); + + var proxa2 = shellContainer2.Resolve(); + var proxb2 = shellContainer2.Resolve(); + var setta2 = shellContainer2.Resolve(); + var settb2 = shellContainer2.Resolve(); + + Assert.That(proxa2, Is.Not.Null); + Assert.That(proxa2, Is.SameAs(proxb2)); + Assert.That(setta2, Is.Not.Null); + Assert.That(setta2, Is.SameAs(settb2)); + + Assert.That(proxa, Is.Not.SameAs(proxa2)); + Assert.That(setta, Is.Not.SameAs(setta2)); + } + } +} diff --git a/src/Orchard.Tests/Environment/ShellBuilders/DefaultShellContextFactoryTests.cs b/src/Orchard.Tests/Environment/ShellBuilders/DefaultShellContextFactoryTests.cs index dc0b13a2609..06e12f4ecdf 100644 --- a/src/Orchard.Tests/Environment/ShellBuilders/DefaultShellContextFactoryTests.cs +++ b/src/Orchard.Tests/Environment/ShellBuilders/DefaultShellContextFactoryTests.cs @@ -1,96 +1,96 @@ -using System.Web; -using Autofac; -using Moq; -using NUnit.Framework; -using Orchard.Environment; -using Orchard.Environment.Configuration; -using Orchard.Environment.ShellBuilders; -using Orchard.Environment.Descriptor; -using Orchard.Environment.Descriptor.Models; -using Orchard.Environment.ShellBuilders.Models; -using Orchard.Mvc; -using Orchard.Tests.Stubs; -using Orchard.Tests.Utility; - -namespace Orchard.Tests.Environment.ShellBuilders { - [TestFixture] - public class DefaultShellContextFactoryTests { - private IContainer _container; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - builder.RegisterType().As(); - builder.RegisterModule(new WorkContextModule()); - builder.RegisterType().As(); - builder.RegisterAutoMocking(Moq.MockBehavior.Strict); - _container = builder.Build(); - } - - [Test] - public void NormalExecutionReturnsExpectedObjects() { - var settings = new ShellSettings { Name = ShellSettings.DefaultName }; - var descriptor = new ShellDescriptor { SerialNumber = 6655321 }; - var blueprint = new ShellBlueprint(); - var shellLifetimeScope = _container.BeginLifetimeScope("shell"); - var httpContext = new StubHttpContext(); - - _container.Mock() - .Setup(x => x.Fetch(ShellSettings.DefaultName)) - .Returns(descriptor); - - _container.Mock() - .Setup(x => x.Compose(settings, descriptor)) - .Returns(blueprint); - - _container.Mock() - .Setup(x => x.CreateContainer(settings, blueprint)) - .Returns(shellLifetimeScope); - - _container.Mock() - .Setup(x => x.GetShellDescriptor()) - .Returns(descriptor); - - _container.Mock() - .Setup(x => x.Started()); - - _container.Mock() - .Setup(x => x.Current()) - .Returns(default(HttpContextBase)); - - var factory = _container.Resolve(); - - var context = factory.CreateShellContext(settings); - - Assert.That(context.Settings, Is.SameAs(settings)); - Assert.That(context.Descriptor, Is.SameAs(descriptor)); - Assert.That(context.Blueprint, Is.SameAs(blueprint)); - Assert.That(context.LifetimeScope, Is.SameAs(shellLifetimeScope)); - Assert.That(context.Shell, Is.SameAs(shellLifetimeScope.Resolve())); - } - - [Test] - public void CreatingSetupContextUsesOrchardSetupFeature() { - var settings = default(ShellSettings); - var descriptor = default(ShellDescriptor); - var blueprint = new ShellBlueprint(); - - _container.Mock() - .Setup(x => x.Compose(It.IsAny(), It.IsAny())) - .Callback((ShellSettings s, ShellDescriptor d) => { - settings = s; - descriptor = d; - }) - .Returns(blueprint); - - _container.Mock() - .Setup(x => x.CreateContainer(It.IsAny(), blueprint)) - .Returns(_container.BeginLifetimeScope("shell")); - - var factory = _container.Resolve(); - var context = factory.CreateSetupContext(new ShellSettings { Name = ShellSettings.DefaultName }); - - Assert.That(context.Descriptor.Features, Has.Some.With.Property("Name").EqualTo("Orchard.Setup")); - } - } +using System.Web; +using Autofac; +using Moq; +using NUnit.Framework; +using Orchard.Environment; +using Orchard.Environment.Configuration; +using Orchard.Environment.ShellBuilders; +using Orchard.Environment.Descriptor; +using Orchard.Environment.Descriptor.Models; +using Orchard.Environment.ShellBuilders.Models; +using Orchard.Mvc; +using Orchard.Tests.Stubs; +using Orchard.Tests.Utility; + +namespace Orchard.Tests.Environment.ShellBuilders { + [TestFixture] + public class DefaultShellContextFactoryTests { + private IContainer _container; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + builder.RegisterModule(new WorkContextModule()); + builder.RegisterType().As(); + builder.RegisterAutoMocking(Moq.MockBehavior.Strict); + _container = builder.Build(); + } + + [Test] + public void NormalExecutionReturnsExpectedObjects() { + var settings = new ShellSettings { Name = ShellSettings.DefaultName }; + var descriptor = new ShellDescriptor { SerialNumber = 6655321 }; + var blueprint = new ShellBlueprint(); + var shellLifetimeScope = _container.BeginLifetimeScope("shell"); + var httpContext = new StubHttpContext(); + + _container.Mock() + .Setup(x => x.Fetch(ShellSettings.DefaultName)) + .Returns(descriptor); + + _container.Mock() + .Setup(x => x.Compose(settings, descriptor)) + .Returns(blueprint); + + _container.Mock() + .Setup(x => x.CreateContainer(settings, blueprint)) + .Returns(shellLifetimeScope); + + _container.Mock() + .Setup(x => x.GetShellDescriptor()) + .Returns(descriptor); + + _container.Mock() + .Setup(x => x.Started()); + + _container.Mock() + .Setup(x => x.Current()) + .Returns(default(HttpContextBase)); + + var factory = _container.Resolve(); + + var context = factory.CreateShellContext(settings); + + Assert.That(context.Settings, Is.SameAs(settings)); + Assert.That(context.Descriptor, Is.SameAs(descriptor)); + Assert.That(context.Blueprint, Is.SameAs(blueprint)); + Assert.That(context.LifetimeScope, Is.SameAs(shellLifetimeScope)); + Assert.That(context.Shell, Is.SameAs(shellLifetimeScope.Resolve())); + } + + [Test] + public void CreatingSetupContextUsesOrchardSetupFeature() { + var settings = default(ShellSettings); + var descriptor = default(ShellDescriptor); + var blueprint = new ShellBlueprint(); + + _container.Mock() + .Setup(x => x.Compose(It.IsAny(), It.IsAny())) + .Callback((ShellSettings s, ShellDescriptor d) => { + settings = s; + descriptor = d; + }) + .Returns(blueprint); + + _container.Mock() + .Setup(x => x.CreateContainer(It.IsAny(), blueprint)) + .Returns(_container.BeginLifetimeScope("shell")); + + var factory = _container.Resolve(); + var context = factory.CreateSetupContext(new ShellSettings { Name = ShellSettings.DefaultName }); + + Assert.That(context.Descriptor.Features, Has.Some.With.Property("Name").EqualTo("Orchard.Setup")); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Environment/State/DefaultProcessingEngineTests.cs b/src/Orchard.Tests/Environment/State/DefaultProcessingEngineTests.cs index fb50ba29028..5949377ced4 100644 --- a/src/Orchard.Tests/Environment/State/DefaultProcessingEngineTests.cs +++ b/src/Orchard.Tests/Environment/State/DefaultProcessingEngineTests.cs @@ -1,112 +1,112 @@ -using System.Collections.Generic; -using System.Linq; -using System.Web; -using Autofac; -using Moq; -using NUnit.Framework; -using Orchard.Environment; -using Orchard.Environment.Configuration; -using Orchard.Environment.ShellBuilders; -using Orchard.Environment.State; -using Orchard.Environment.Descriptor.Models; -using Orchard.Events; -using Orchard.Mvc; -using Orchard.Tests.Stubs; -using Orchard.Tests.Utility; - -namespace Orchard.Tests.Environment.State { - [TestFixture] - public class DefaultProcessingEngineTests { - private IContainer _container; - private ShellContext _shellContext; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - builder.RegisterType().As(); - builder.RegisterModule(new WorkContextModule()); - builder.RegisterType().As(); - builder.RegisterAutoMocking(MockBehavior.Loose); - _container = builder.Build(); - - _shellContext = new ShellContext { - Descriptor = new ShellDescriptor(), - Settings = new ShellSettings(), - LifetimeScope = _container.BeginLifetimeScope(), - }; - - var httpContext = new StubHttpContext(); - - _container.Mock() - .Setup(x => x.CreateDescribedContext(_shellContext.Settings, _shellContext.Descriptor)) - .Returns(_shellContext); - _container.Mock() - .Setup(x=>x.Current()) - .Returns(httpContext); - } - - [TearDown] - public void CleanTasks() { - // clear the previous values - try { - var engine = _container.Resolve(); - if (engine != null) - while (engine.AreTasksPending()) engine.ExecuteNextTask(); - } - catch { - - } - } - - [Test] - public void NoTasksPendingByDefault() { - var engine = _container.Resolve(); - var pending = engine.AreTasksPending(); - Assert.That(pending, Is.False); - } - - [Test] - public void ExecuteTaskIsSafeToCallWhenItDoesNothing() { - var engine = _container.Resolve(); - var pending1 = engine.AreTasksPending(); - engine.ExecuteNextTask(); - var pending2 = engine.AreTasksPending(); - Assert.That(pending1, Is.False); - Assert.That(pending2, Is.False); - } - - [Test] - public void CallingAddTaskReturnsResultIdentifierAndCausesPendingToBeTrue() { - var engine = _container.Resolve(); - var pending1 = engine.AreTasksPending(); - var resultId = engine.AddTask(new ShellSettings { Name = ShellSettings.DefaultName }, null, null, null); - var pending2 = engine.AreTasksPending(); - Assert.That(pending1, Is.False); - Assert.That(resultId, Is.Not.Null); - Assert.That(resultId, Is.Not.Empty); - Assert.That(pending2, Is.True); - } - - [Test] - public void CallingExecuteCausesEventToFireAndPendingFlagToBeCleared() { - _container.Mock() - .Setup(x => x.Notify(It.IsAny(), It.IsAny>())) - .Returns(Enumerable.Empty()); - - var engine = _container.Resolve(); - var pending1 = engine.AreTasksPending(); - engine.AddTask(_shellContext.Settings, _shellContext.Descriptor, "foo", null); - var pending2 = engine.AreTasksPending(); - engine.ExecuteNextTask(); - var pending3 = engine.AreTasksPending(); - Assert.That(pending1, Is.False); - Assert.That(pending2, Is.True); - Assert.That(pending3, Is.False); - - _container.Mock() - .Verify(x => x.Notify("foo", null)); - } - - - } -} +using System.Collections.Generic; +using System.Linq; +using System.Web; +using Autofac; +using Moq; +using NUnit.Framework; +using Orchard.Environment; +using Orchard.Environment.Configuration; +using Orchard.Environment.ShellBuilders; +using Orchard.Environment.State; +using Orchard.Environment.Descriptor.Models; +using Orchard.Events; +using Orchard.Mvc; +using Orchard.Tests.Stubs; +using Orchard.Tests.Utility; + +namespace Orchard.Tests.Environment.State { + [TestFixture] + public class DefaultProcessingEngineTests { + private IContainer _container; + private ShellContext _shellContext; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + builder.RegisterModule(new WorkContextModule()); + builder.RegisterType().As(); + builder.RegisterAutoMocking(MockBehavior.Loose); + _container = builder.Build(); + + _shellContext = new ShellContext { + Descriptor = new ShellDescriptor(), + Settings = new ShellSettings(), + LifetimeScope = _container.BeginLifetimeScope(), + }; + + var httpContext = new StubHttpContext(); + + _container.Mock() + .Setup(x => x.CreateDescribedContext(_shellContext.Settings, _shellContext.Descriptor)) + .Returns(_shellContext); + _container.Mock() + .Setup(x=>x.Current()) + .Returns(httpContext); + } + + [TearDown] + public void CleanTasks() { + // clear the previous values + try { + var engine = _container.Resolve(); + if (engine != null) + while (engine.AreTasksPending()) engine.ExecuteNextTask(); + } + catch { + + } + } + + [Test] + public void NoTasksPendingByDefault() { + var engine = _container.Resolve(); + var pending = engine.AreTasksPending(); + Assert.That(pending, Is.False); + } + + [Test] + public void ExecuteTaskIsSafeToCallWhenItDoesNothing() { + var engine = _container.Resolve(); + var pending1 = engine.AreTasksPending(); + engine.ExecuteNextTask(); + var pending2 = engine.AreTasksPending(); + Assert.That(pending1, Is.False); + Assert.That(pending2, Is.False); + } + + [Test] + public void CallingAddTaskReturnsResultIdentifierAndCausesPendingToBeTrue() { + var engine = _container.Resolve(); + var pending1 = engine.AreTasksPending(); + var resultId = engine.AddTask(new ShellSettings { Name = ShellSettings.DefaultName }, null, null, null); + var pending2 = engine.AreTasksPending(); + Assert.That(pending1, Is.False); + Assert.That(resultId, Is.Not.Null); + Assert.That(resultId, Is.Not.Empty); + Assert.That(pending2, Is.True); + } + + [Test] + public void CallingExecuteCausesEventToFireAndPendingFlagToBeCleared() { + _container.Mock() + .Setup(x => x.Notify(It.IsAny(), It.IsAny>())) + .Returns(Enumerable.Empty()); + + var engine = _container.Resolve(); + var pending1 = engine.AreTasksPending(); + engine.AddTask(_shellContext.Settings, _shellContext.Descriptor, "foo", null); + var pending2 = engine.AreTasksPending(); + engine.ExecuteNextTask(); + var pending3 = engine.AreTasksPending(); + Assert.That(pending1, Is.False); + Assert.That(pending2, Is.True); + Assert.That(pending3, Is.False); + + _container.Mock() + .Verify(x => x.Notify("foo", null)); + } + + + } +} diff --git a/src/Orchard.Tests/Environment/StubHostEnvironment.cs b/src/Orchard.Tests/Environment/StubHostEnvironment.cs index b5f5305186a..bf45c6147f4 100644 --- a/src/Orchard.Tests/Environment/StubHostEnvironment.cs +++ b/src/Orchard.Tests/Environment/StubHostEnvironment.cs @@ -1,8 +1,8 @@ -using Orchard.Environment; - -namespace Orchard.Tests.Environment { - public class StubHostEnvironment : HostEnvironment { - public override void RestartAppDomain() { - } - } -} +using Orchard.Environment; + +namespace Orchard.Tests.Environment { + public class StubHostEnvironment : HostEnvironment { + public override void RestartAppDomain() { + } + } +} diff --git a/src/Orchard.Tests/Environment/TestDependencies/TestDependency.cs b/src/Orchard.Tests/Environment/TestDependencies/TestDependency.cs index 5ff3b0e5222..87d15dcf9a4 100644 --- a/src/Orchard.Tests/Environment/TestDependencies/TestDependency.cs +++ b/src/Orchard.Tests/Environment/TestDependencies/TestDependency.cs @@ -1,24 +1,24 @@ -namespace Orchard.Tests.Environment.TestDependencies { - - public interface ITestDependency : IDependency { - - } - - public class TestDependency : ITestDependency{ - } - - public interface ITestSingletonDependency : ISingletonDependency { - - } - - public class TestSingletonDependency : ITestSingletonDependency { - } - - - public interface ITestTransientDependency : ITransientDependency { - - } - - public class TestTransientDependency : ITestTransientDependency { - } -} +namespace Orchard.Tests.Environment.TestDependencies { + + public interface ITestDependency : IDependency { + + } + + public class TestDependency : ITestDependency{ + } + + public interface ITestSingletonDependency : ISingletonDependency { + + } + + public class TestSingletonDependency : ITestSingletonDependency { + } + + + public interface ITestTransientDependency : ITransientDependency { + + } + + public class TestTransientDependency : ITestTransientDependency { + } +} diff --git a/src/Orchard.Tests/Environment/Utility/Build.cs b/src/Orchard.Tests/Environment/Utility/Build.cs index baeb8144d30..bad2651793e 100644 --- a/src/Orchard.Tests/Environment/Utility/Build.cs +++ b/src/Orchard.Tests/Environment/Utility/Build.cs @@ -1,50 +1,50 @@ -using System.Linq; -using Orchard.Environment.Extensions.Models; -using Orchard.Environment.Descriptor.Models; - -namespace Orchard.Tests.Environment.Utility { - static class Build { - - public static ShellDescriptor ShellDescriptor() { - var descriptor = new ShellDescriptor { - Features = Enumerable.Empty(), - Parameters = Enumerable.Empty(), - }; - return descriptor; - } - - public static ShellDescriptor WithFeatures(this ShellDescriptor descriptor, params string[] names) { - descriptor.Features = descriptor.Features.Concat( - names.Select(name => new ShellFeature { Name = name })); - - return descriptor; - } - - public static ShellDescriptor WithParameter(this ShellDescriptor descriptor, string name, string value) { - descriptor.Parameters = descriptor.Parameters.Concat( - new[] { new ShellParameter { Component = typeof(TComponent).FullName, Name = name, Value = value } }); - - return descriptor; - } - - public static ExtensionDescriptor ExtensionDescriptor(string name, string displayName) { - var descriptor = new ExtensionDescriptor { - Id = name, - Name = displayName, - Features = Enumerable.Empty(), - }; - return descriptor; - } - - public static ExtensionDescriptor ExtensionDescriptor(string name) { - return ExtensionDescriptor(name, name); - } - - public static ExtensionDescriptor WithFeatures(this ExtensionDescriptor descriptor, params string[] names) { - descriptor.Features = descriptor.Features.Concat( - names.Select(name => new FeatureDescriptor { Extension=descriptor , Id = name, })); - - return descriptor; - } - } +using System.Linq; +using Orchard.Environment.Extensions.Models; +using Orchard.Environment.Descriptor.Models; + +namespace Orchard.Tests.Environment.Utility { + static class Build { + + public static ShellDescriptor ShellDescriptor() { + var descriptor = new ShellDescriptor { + Features = Enumerable.Empty(), + Parameters = Enumerable.Empty(), + }; + return descriptor; + } + + public static ShellDescriptor WithFeatures(this ShellDescriptor descriptor, params string[] names) { + descriptor.Features = descriptor.Features.Concat( + names.Select(name => new ShellFeature { Name = name })); + + return descriptor; + } + + public static ShellDescriptor WithParameter(this ShellDescriptor descriptor, string name, string value) { + descriptor.Parameters = descriptor.Parameters.Concat( + new[] { new ShellParameter { Component = typeof(TComponent).FullName, Name = name, Value = value } }); + + return descriptor; + } + + public static ExtensionDescriptor ExtensionDescriptor(string name, string displayName) { + var descriptor = new ExtensionDescriptor { + Id = name, + Name = displayName, + Features = Enumerable.Empty(), + }; + return descriptor; + } + + public static ExtensionDescriptor ExtensionDescriptor(string name) { + return ExtensionDescriptor(name, name); + } + + public static ExtensionDescriptor WithFeatures(this ExtensionDescriptor descriptor, params string[] names) { + descriptor.Features = descriptor.Features.Concat( + names.Select(name => new FeatureDescriptor { Extension=descriptor , Id = name, })); + + return descriptor; + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Environment/WarmUp/WarmUpUtilityTests.cs b/src/Orchard.Tests/Environment/WarmUp/WarmUpUtilityTests.cs index 963f6efde2a..171bcd4ce31 100644 --- a/src/Orchard.Tests/Environment/WarmUp/WarmUpUtilityTests.cs +++ b/src/Orchard.Tests/Environment/WarmUp/WarmUpUtilityTests.cs @@ -1,28 +1,28 @@ -using System; -using NUnit.Framework; -using Orchard.Environment.Warmup; - -namespace Orchard.Tests.Environment.Warmup { - [TestFixture] - public class WarmupUtilityTests { - - [Test] - public void EmptyStringsAreNotAllowed() { - Assert.Throws(() => WarmupUtility.EncodeUrl("")); - Assert.Throws(() => WarmupUtility.EncodeUrl(null)); - } - - [Test] - public void EncodedUrlsShouldBeValidFilenames() { - Assert.That(WarmupUtility.EncodeUrl("http://www.microsoft.com"), Is.EqualTo("http_3A_2F_2Fwww_2Emicrosoft_2Ecom")); - Assert.That(WarmupUtility.EncodeUrl("http://www.microsoft.com/foo?bar=baz"), Is.EqualTo("http_3A_2F_2Fwww_2Emicrosoft_2Ecom_2Ffoo_3Fbar_3Dbaz")); - } - - [Test] - public void EncodedUrlsShouldPreserveQueryStrings() { - Assert.That(WarmupUtility.EncodeUrl("http://www.microsoft.com/foo?bar=baz"), Is.StringContaining("bar")); - Assert.That(WarmupUtility.EncodeUrl("http://www.microsoft.com/foo?bar=baz"), Is.StringContaining("baz")); - Assert.That(WarmupUtility.EncodeUrl("http://www.microsoft.com/foo?bar=baz"), Is.StringContaining("foo")); - } - } -} +using System; +using NUnit.Framework; +using Orchard.Environment.Warmup; + +namespace Orchard.Tests.Environment.Warmup { + [TestFixture] + public class WarmupUtilityTests { + + [Test] + public void EmptyStringsAreNotAllowed() { + Assert.Throws(() => WarmupUtility.EncodeUrl("")); + Assert.Throws(() => WarmupUtility.EncodeUrl(null)); + } + + [Test] + public void EncodedUrlsShouldBeValidFilenames() { + Assert.That(WarmupUtility.EncodeUrl("http://www.microsoft.com"), Is.EqualTo("http_3A_2F_2Fwww_2Emicrosoft_2Ecom")); + Assert.That(WarmupUtility.EncodeUrl("http://www.microsoft.com/foo?bar=baz"), Is.EqualTo("http_3A_2F_2Fwww_2Emicrosoft_2Ecom_2Ffoo_3Fbar_3Dbaz")); + } + + [Test] + public void EncodedUrlsShouldPreserveQueryStrings() { + Assert.That(WarmupUtility.EncodeUrl("http://www.microsoft.com/foo?bar=baz"), Is.StringContaining("bar")); + Assert.That(WarmupUtility.EncodeUrl("http://www.microsoft.com/foo?bar=baz"), Is.StringContaining("baz")); + Assert.That(WarmupUtility.EncodeUrl("http://www.microsoft.com/foo?bar=baz"), Is.StringContaining("foo")); + } + } +} diff --git a/src/Orchard.Tests/Events/EventTests.cs b/src/Orchard.Tests/Events/EventTests.cs index c0b191c95a7..342945cf335 100644 --- a/src/Orchard.Tests/Events/EventTests.cs +++ b/src/Orchard.Tests/Events/EventTests.cs @@ -1,281 +1,281 @@ -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using Autofac; -using NUnit.Framework; -using Orchard.Events; -using System; -using Orchard.Exceptions; - -namespace Orchard.Tests.Events { - [TestFixture] - public class EventTests { - private IContainer _container; - private IEventBus _eventBus; - private StubEventHandler _eventHandler; - - [SetUp] - public void Init() { - _eventHandler = new StubEventHandler(); - - var builder = new ContainerBuilder(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - builder.RegisterType() - .Named(typeof(ITestEventHandler).Name, typeof(IEventHandler)) - .Named(typeof(IEventHandler).Name, typeof(IEventHandler)) - .WithMetadata("Interfaces", typeof(StubEventHandler2).GetInterfaces().ToDictionary(i => i.Name)); - builder.RegisterInstance(_eventHandler) - .Named(typeof(ITestEventHandler).Name, typeof(IEventHandler)) - .Named(typeof(IEventHandler).Name, typeof(IEventHandler)) - .WithMetadata("Interfaces", typeof(StubEventHandler).GetInterfaces().ToDictionary(i => i.Name)); - - _container = builder.Build(); - _eventBus = _container.Resolve(); - } - - [Test] - public void EventsAreCorrectlyDispatchedToEventHandlers() { - Assert.That(_eventHandler.Count, Is.EqualTo(0)); - _eventBus.Notify("ITestEventHandler.Increment", new Dictionary()); - Assert.That(_eventHandler.Count, Is.EqualTo(1)); - } - - [Test] - public void EventParametersAreCorrectlyPassedToEventHandlers() { - Assert.That(_eventHandler.Result, Is.EqualTo(0)); - Dictionary arguments = new Dictionary(); - arguments["a"] = 5200; - arguments["b"] = 2600; - _eventBus.Notify("ITestEventHandler.Substract", arguments); - Assert.That(_eventHandler.Result, Is.EqualTo(2600)); - } - - [Test] - public void EventParametersArePassedInCorrectOrderToEventHandlers() { - Assert.That(_eventHandler.Result, Is.EqualTo(0)); - Dictionary arguments = new Dictionary(); - arguments["a"] = 2600; - arguments["b"] = 5200; - _eventBus.Notify("ITestEventHandler.Substract", arguments); - Assert.That(_eventHandler.Result, Is.EqualTo(-2600)); - } - - [Test] - public void EventParametersAreCorrectlyPassedToMatchingMethod() { - Assert.That(_eventHandler.Summary, Is.Null); - Dictionary arguments = new Dictionary(); - arguments["a"] = "a"; - arguments["b"] = "b"; - arguments["c"] = "c"; - _eventBus.Notify("ITestEventHandler.Concat", arguments); - Assert.That(_eventHandler.Summary, Is.EqualTo("abc")); - } - - [Test] - public void EventParametersAreCorrectlyPassedToExactlyMatchingMethod() { - Assert.That(_eventHandler.Result, Is.EqualTo(0)); - Dictionary arguments = new Dictionary(); - arguments["a"] = 1000; - arguments["b"] = 100; - arguments["c"] = 10; - _eventBus.Notify("ITestEventHandler.Sum", arguments); - Assert.That(_eventHandler.Result, Is.EqualTo(1110)); - } - - [Test] - public void EventParametersAreCorrectlyPassedToBestMatchingMethodAndExtraParametersAreIgnored() { - Assert.That(_eventHandler.Result, Is.EqualTo(0)); - Dictionary arguments = new Dictionary(); - arguments["a"] = 1000; - arguments["b"] = 100; - arguments["c"] = 10; - arguments["e"] = 1; - _eventBus.Notify("ITestEventHandler.Sum", arguments); - Assert.That(_eventHandler.Result, Is.EqualTo(1110)); - } - - [Test] - public void EventParametersAreCorrectlyPassedToBestMatchingMethodAndExtraParametersAreIgnored2() { - Assert.That(_eventHandler.Result, Is.EqualTo(0)); - Dictionary arguments = new Dictionary(); - arguments["a"] = 1000; - arguments["e"] = 1; - _eventBus.Notify("ITestEventHandler.Sum", arguments); - Assert.That(_eventHandler.Result, Is.EqualTo(3000)); - } - - [Test] - public void EventParametersAreCorrectlyPassedToExactlyMatchingMethodWhenThereIsOne() { - Assert.That(_eventHandler.Result, Is.EqualTo(0)); - Dictionary arguments = new Dictionary(); - arguments["a"] = 1000; - arguments["b"] = 100; - _eventBus.Notify("ITestEventHandler.Sum", arguments); - Assert.That(_eventHandler.Result, Is.EqualTo(2200)); - } - - [Test] - public void EventParametersAreCorrectlyPassedToExactlyMatchingMethodWhenThereIsOne2() { - Assert.That(_eventHandler.Result, Is.EqualTo(0)); - Dictionary arguments = new Dictionary(); - arguments["a"] = 1000; - _eventBus.Notify("ITestEventHandler.Sum", arguments); - Assert.That(_eventHandler.Result, Is.EqualTo(3000)); - } - - [Test] - public void EventHandlerWontBeCalledWhenNoParameterMatchExists() { - Assert.That(_eventHandler.Result, Is.EqualTo(0)); - Dictionary arguments = new Dictionary(); - arguments["e"] = 1; - _eventBus.Notify("ITestEventHandler.Sum", arguments); - Assert.That(_eventHandler.Result, Is.EqualTo(0)); - } - - [Test] - public void EventHandlerWontBeCalledWhenNoParameterMatchExists2() { - Assert.That(_eventHandler.Result, Is.EqualTo(0)); - Dictionary arguments = new Dictionary(); - _eventBus.Notify("ITestEventHandler.Sum", arguments); - Assert.That(_eventHandler.Result, Is.EqualTo(0)); - } - - [Test] - public void EventHandlerWontThrowIfMethodDoesNotExists() { - Dictionary arguments = new Dictionary(); - Assert.DoesNotThrow(() => _eventBus.Notify("ITestEventHandler.NotExisting", arguments)); - } - - [Test] - public void EventBusThrowsIfMessageNameIsNotCorrectlyFormatted() { - Assert.Throws(() => _eventBus.Notify("StubEventHandlerIncrement", new Dictionary())); - } - - [Test] - public void InterceptorCanCoerceResultingCollection() { - var data = new object[]{"5","18","2"}; - var adjusted = EventsInterceptor.Adjust(data, typeof(IEnumerable)); - Assert.That(data, Is.InstanceOf>()); - Assert.That(data, Is.Not.InstanceOf>()); - Assert.That(adjusted, Is.InstanceOf>()); - } - - [Test] - public void EnumerableResultsAreTreatedLikeSelectMany() { - var results = _eventBus.Notify("ITestEventHandler.Gather", new Dictionary { { "a", 42 }, { "b", "alpha" } }).Cast(); - Assert.That(results.Count(), Is.EqualTo(3)); - Assert.That(results, Has.Some.EqualTo("42")); - Assert.That(results, Has.Some.EqualTo("alpha")); - Assert.That(results, Has.Some.EqualTo("[42,alpha]")); - } - - [Test] - public void StringResultsAreTreatedLikeSelect() { - var results = _eventBus.Notify("ITestEventHandler.GetString", new Dictionary()).Cast(); - Assert.That(results.Count(), Is.EqualTo(2)); - Assert.That(results, Has.Some.EqualTo("Foo")); - Assert.That(results, Has.Some.EqualTo("Bar")); - } - - [Test] - public void NonStringNonEnumerableResultsAreTreatedLikeSelect() { - var results = _eventBus.Notify("ITestEventHandler.GetInt", new Dictionary()).Cast(); - Assert.That(results.Count(), Is.EqualTo(2)); - Assert.That(results, Has.Some.EqualTo(1)); - Assert.That(results, Has.Some.EqualTo(2)); - } - - public interface ITestEventHandler : IEventHandler { - void Increment(); - void Sum(int a); - void Sum(int a, int b); - void Sum(int a, int b, int c); - void Substract(int a, int b); - void Concat(string a, string b, string c); - IEnumerable Gather(int a, string b); - string GetString(); - int GetInt(); - } - - public class StubEventHandler : ITestEventHandler { - public int Count { get; set; } - public int Result { get; set; } - public string Summary { get; set; } - - public void Increment() { - Count++; - } - - public void Sum(int a) { - Result = 3 * a; - } - - public void Sum(int a, int b) { - Result = 2 * (a + b); - } - - public void Sum(int a, int b, int c) { - Result = a + b + c; - } - - public void Substract(int a, int b) { - Result = a - b; - } - - public void Concat(string a, string b, string c) { - Summary = a + b + c; - } - - public IEnumerable Gather(int a, string b) { - yield return String.Format("[{0},{1}]", a, b); - } - - public string GetString() { - return "Foo"; - } - - public int GetInt() { - return 1; - } - } - public class StubEventHandler2 : ITestEventHandler { - public void Increment() { - } - - public void Sum(int a) { - } - - public void Sum(int a, int b) { - } - - public void Sum(int a, int b, int c) { - } - - public void Substract(int a, int b) { - } - - public void Concat(string a, string b, string c) { - } - - public IEnumerable Gather(int a, string b) { - return new[] { a.ToString(), b }; - } - - public string GetString() { - return "Bar"; - } - - public int GetInt() { - return 2; - } - } - } - - class StubExceptionPolicy : IExceptionPolicy { - public bool HandleException(object sender, Exception exception) { - return true; - } - } -} +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using Autofac; +using NUnit.Framework; +using Orchard.Events; +using System; +using Orchard.Exceptions; + +namespace Orchard.Tests.Events { + [TestFixture] + public class EventTests { + private IContainer _container; + private IEventBus _eventBus; + private StubEventHandler _eventHandler; + + [SetUp] + public void Init() { + _eventHandler = new StubEventHandler(); + + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + builder.RegisterType() + .Named(typeof(ITestEventHandler).Name, typeof(IEventHandler)) + .Named(typeof(IEventHandler).Name, typeof(IEventHandler)) + .WithMetadata("Interfaces", typeof(StubEventHandler2).GetInterfaces().ToDictionary(i => i.Name)); + builder.RegisterInstance(_eventHandler) + .Named(typeof(ITestEventHandler).Name, typeof(IEventHandler)) + .Named(typeof(IEventHandler).Name, typeof(IEventHandler)) + .WithMetadata("Interfaces", typeof(StubEventHandler).GetInterfaces().ToDictionary(i => i.Name)); + + _container = builder.Build(); + _eventBus = _container.Resolve(); + } + + [Test] + public void EventsAreCorrectlyDispatchedToEventHandlers() { + Assert.That(_eventHandler.Count, Is.EqualTo(0)); + _eventBus.Notify("ITestEventHandler.Increment", new Dictionary()); + Assert.That(_eventHandler.Count, Is.EqualTo(1)); + } + + [Test] + public void EventParametersAreCorrectlyPassedToEventHandlers() { + Assert.That(_eventHandler.Result, Is.EqualTo(0)); + Dictionary arguments = new Dictionary(); + arguments["a"] = 5200; + arguments["b"] = 2600; + _eventBus.Notify("ITestEventHandler.Substract", arguments); + Assert.That(_eventHandler.Result, Is.EqualTo(2600)); + } + + [Test] + public void EventParametersArePassedInCorrectOrderToEventHandlers() { + Assert.That(_eventHandler.Result, Is.EqualTo(0)); + Dictionary arguments = new Dictionary(); + arguments["a"] = 2600; + arguments["b"] = 5200; + _eventBus.Notify("ITestEventHandler.Substract", arguments); + Assert.That(_eventHandler.Result, Is.EqualTo(-2600)); + } + + [Test] + public void EventParametersAreCorrectlyPassedToMatchingMethod() { + Assert.That(_eventHandler.Summary, Is.Null); + Dictionary arguments = new Dictionary(); + arguments["a"] = "a"; + arguments["b"] = "b"; + arguments["c"] = "c"; + _eventBus.Notify("ITestEventHandler.Concat", arguments); + Assert.That(_eventHandler.Summary, Is.EqualTo("abc")); + } + + [Test] + public void EventParametersAreCorrectlyPassedToExactlyMatchingMethod() { + Assert.That(_eventHandler.Result, Is.EqualTo(0)); + Dictionary arguments = new Dictionary(); + arguments["a"] = 1000; + arguments["b"] = 100; + arguments["c"] = 10; + _eventBus.Notify("ITestEventHandler.Sum", arguments); + Assert.That(_eventHandler.Result, Is.EqualTo(1110)); + } + + [Test] + public void EventParametersAreCorrectlyPassedToBestMatchingMethodAndExtraParametersAreIgnored() { + Assert.That(_eventHandler.Result, Is.EqualTo(0)); + Dictionary arguments = new Dictionary(); + arguments["a"] = 1000; + arguments["b"] = 100; + arguments["c"] = 10; + arguments["e"] = 1; + _eventBus.Notify("ITestEventHandler.Sum", arguments); + Assert.That(_eventHandler.Result, Is.EqualTo(1110)); + } + + [Test] + public void EventParametersAreCorrectlyPassedToBestMatchingMethodAndExtraParametersAreIgnored2() { + Assert.That(_eventHandler.Result, Is.EqualTo(0)); + Dictionary arguments = new Dictionary(); + arguments["a"] = 1000; + arguments["e"] = 1; + _eventBus.Notify("ITestEventHandler.Sum", arguments); + Assert.That(_eventHandler.Result, Is.EqualTo(3000)); + } + + [Test] + public void EventParametersAreCorrectlyPassedToExactlyMatchingMethodWhenThereIsOne() { + Assert.That(_eventHandler.Result, Is.EqualTo(0)); + Dictionary arguments = new Dictionary(); + arguments["a"] = 1000; + arguments["b"] = 100; + _eventBus.Notify("ITestEventHandler.Sum", arguments); + Assert.That(_eventHandler.Result, Is.EqualTo(2200)); + } + + [Test] + public void EventParametersAreCorrectlyPassedToExactlyMatchingMethodWhenThereIsOne2() { + Assert.That(_eventHandler.Result, Is.EqualTo(0)); + Dictionary arguments = new Dictionary(); + arguments["a"] = 1000; + _eventBus.Notify("ITestEventHandler.Sum", arguments); + Assert.That(_eventHandler.Result, Is.EqualTo(3000)); + } + + [Test] + public void EventHandlerWontBeCalledWhenNoParameterMatchExists() { + Assert.That(_eventHandler.Result, Is.EqualTo(0)); + Dictionary arguments = new Dictionary(); + arguments["e"] = 1; + _eventBus.Notify("ITestEventHandler.Sum", arguments); + Assert.That(_eventHandler.Result, Is.EqualTo(0)); + } + + [Test] + public void EventHandlerWontBeCalledWhenNoParameterMatchExists2() { + Assert.That(_eventHandler.Result, Is.EqualTo(0)); + Dictionary arguments = new Dictionary(); + _eventBus.Notify("ITestEventHandler.Sum", arguments); + Assert.That(_eventHandler.Result, Is.EqualTo(0)); + } + + [Test] + public void EventHandlerWontThrowIfMethodDoesNotExists() { + Dictionary arguments = new Dictionary(); + Assert.DoesNotThrow(() => _eventBus.Notify("ITestEventHandler.NotExisting", arguments)); + } + + [Test] + public void EventBusThrowsIfMessageNameIsNotCorrectlyFormatted() { + Assert.Throws(() => _eventBus.Notify("StubEventHandlerIncrement", new Dictionary())); + } + + [Test] + public void InterceptorCanCoerceResultingCollection() { + var data = new object[]{"5","18","2"}; + var adjusted = EventsInterceptor.Adjust(data, typeof(IEnumerable)); + Assert.That(data, Is.InstanceOf>()); + Assert.That(data, Is.Not.InstanceOf>()); + Assert.That(adjusted, Is.InstanceOf>()); + } + + [Test] + public void EnumerableResultsAreTreatedLikeSelectMany() { + var results = _eventBus.Notify("ITestEventHandler.Gather", new Dictionary { { "a", 42 }, { "b", "alpha" } }).Cast(); + Assert.That(results.Count(), Is.EqualTo(3)); + Assert.That(results, Has.Some.EqualTo("42")); + Assert.That(results, Has.Some.EqualTo("alpha")); + Assert.That(results, Has.Some.EqualTo("[42,alpha]")); + } + + [Test] + public void StringResultsAreTreatedLikeSelect() { + var results = _eventBus.Notify("ITestEventHandler.GetString", new Dictionary()).Cast(); + Assert.That(results.Count(), Is.EqualTo(2)); + Assert.That(results, Has.Some.EqualTo("Foo")); + Assert.That(results, Has.Some.EqualTo("Bar")); + } + + [Test] + public void NonStringNonEnumerableResultsAreTreatedLikeSelect() { + var results = _eventBus.Notify("ITestEventHandler.GetInt", new Dictionary()).Cast(); + Assert.That(results.Count(), Is.EqualTo(2)); + Assert.That(results, Has.Some.EqualTo(1)); + Assert.That(results, Has.Some.EqualTo(2)); + } + + public interface ITestEventHandler : IEventHandler { + void Increment(); + void Sum(int a); + void Sum(int a, int b); + void Sum(int a, int b, int c); + void Substract(int a, int b); + void Concat(string a, string b, string c); + IEnumerable Gather(int a, string b); + string GetString(); + int GetInt(); + } + + public class StubEventHandler : ITestEventHandler { + public int Count { get; set; } + public int Result { get; set; } + public string Summary { get; set; } + + public void Increment() { + Count++; + } + + public void Sum(int a) { + Result = 3 * a; + } + + public void Sum(int a, int b) { + Result = 2 * (a + b); + } + + public void Sum(int a, int b, int c) { + Result = a + b + c; + } + + public void Substract(int a, int b) { + Result = a - b; + } + + public void Concat(string a, string b, string c) { + Summary = a + b + c; + } + + public IEnumerable Gather(int a, string b) { + yield return String.Format("[{0},{1}]", a, b); + } + + public string GetString() { + return "Foo"; + } + + public int GetInt() { + return 1; + } + } + public class StubEventHandler2 : ITestEventHandler { + public void Increment() { + } + + public void Sum(int a) { + } + + public void Sum(int a, int b) { + } + + public void Sum(int a, int b, int c) { + } + + public void Substract(int a, int b) { + } + + public void Concat(string a, string b, string c) { + } + + public IEnumerable Gather(int a, string b) { + return new[] { a.ToString(), b }; + } + + public string GetString() { + return "Bar"; + } + + public int GetInt() { + return 2; + } + } + } + + class StubExceptionPolicy : IExceptionPolicy { + public bool HandleException(object sender, Exception exception) { + return true; + } + } +} diff --git a/src/Orchard.Tests/EventsTests.cs b/src/Orchard.Tests/EventsTests.cs index 49a7136adae..b0093934c31 100644 --- a/src/Orchard.Tests/EventsTests.cs +++ b/src/Orchard.Tests/EventsTests.cs @@ -1,75 +1,75 @@ -using System; -using System.Linq; -using NUnit.Framework; -using Orchard.Logging; - -namespace Orchard.Tests { - [TestFixture] - public class EventsTests { - [Test] - public void AllEventsAreCalled() { - var events = new ITestEvents[] { new FooSink(), new BarSink() }; - - events.Invoke(x => x.Hello("world"), NullLogger.Instance); - - Assert.That(events.OfType().Single().Name, Is.EqualTo("world")); - Assert.That(events.OfType().Single().Name, Is.EqualTo("world")); - } - - [Test] - public void AnExceptionShouldBeLoggedAndOtherEventsWillBeFired() { - var events = new ITestEvents[] { new FooSink(), new CrashSink(), new BarSink() }; - - var logger = new TestLogger(); - - events.Invoke(x => x.Hello("world"), logger); - - Assert.That(events.OfType().Single().Name, Is.EqualTo("world")); - Assert.That(events.OfType().Single().Name, Is.EqualTo("world")); - Assert.That(logger.LogException, Is.TypeOf()); - Assert.That(logger.LogException, Has.Property("Message").EqualTo("Illegal name 'world'")); - } - - private class TestLogger : ILogger { - public bool IsEnabled(LogLevel level) { - return true; - } - - public void Log(LogLevel level, Exception exception, string format, params object[] args) { - LogException = exception; - LogFormat = format; - LogArgs = args; - } - - public Exception LogException { get; set; } - public string LogFormat { get; set; } - public object[] LogArgs { get; set; } - } - - private interface ITestEvents : IDependency { - void Hello(string name); - } - - private class FooSink : ITestEvents { - void ITestEvents.Hello(string name) { - Name = name; - } - - public string Name { get; set; } - } - - private class BarSink : ITestEvents { - void ITestEvents.Hello(string name) { - Name = name; - } - public string Name { get; set; } - } - - - private class CrashSink : ITestEvents { - void ITestEvents.Hello(string name) { - throw new ApplicationException("Illegal name '" + name + "'"); - } - } - } -} +using System; +using System.Linq; +using NUnit.Framework; +using Orchard.Logging; + +namespace Orchard.Tests { + [TestFixture] + public class EventsTests { + [Test] + public void AllEventsAreCalled() { + var events = new ITestEvents[] { new FooSink(), new BarSink() }; + + events.Invoke(x => x.Hello("world"), NullLogger.Instance); + + Assert.That(events.OfType().Single().Name, Is.EqualTo("world")); + Assert.That(events.OfType().Single().Name, Is.EqualTo("world")); + } + + [Test] + public void AnExceptionShouldBeLoggedAndOtherEventsWillBeFired() { + var events = new ITestEvents[] { new FooSink(), new CrashSink(), new BarSink() }; + + var logger = new TestLogger(); + + events.Invoke(x => x.Hello("world"), logger); + + Assert.That(events.OfType().Single().Name, Is.EqualTo("world")); + Assert.That(events.OfType().Single().Name, Is.EqualTo("world")); + Assert.That(logger.LogException, Is.TypeOf()); + Assert.That(logger.LogException, Has.Property("Message").EqualTo("Illegal name 'world'")); + } + + private class TestLogger : ILogger { + public bool IsEnabled(LogLevel level) { + return true; + } + + public void Log(LogLevel level, Exception exception, string format, params object[] args) { + LogException = exception; + LogFormat = format; + LogArgs = args; + } + + public Exception LogException { get; set; } + public string LogFormat { get; set; } + public object[] LogArgs { get; set; } + } + + private interface ITestEvents : IDependency { + void Hello(string name); + } + + private class FooSink : ITestEvents { + void ITestEvents.Hello(string name) { + Name = name; + } + + public string Name { get; set; } + } + + private class BarSink : ITestEvents { + void ITestEvents.Hello(string name) { + Name = name; + } + public string Name { get; set; } + } + + + private class CrashSink : ITestEvents { + void ITestEvents.Hello(string name) { + throw new ApplicationException("Illegal name '" + name + "'"); + } + } + } +} diff --git a/src/Orchard.Tests/FakeTests.cs b/src/Orchard.Tests/FakeTests.cs index 78f0a59971e..a846239fe55 100644 --- a/src/Orchard.Tests/FakeTests.cs +++ b/src/Orchard.Tests/FakeTests.cs @@ -1,29 +1,29 @@ -using System; -using NUnit.Framework; - -namespace Orchard.Tests { - [TestFixture] - public class FakeTests { - #region Setup/Teardown - - [SetUp] - public void Init() { - _x = 5; - } - - #endregion - - private int _x; - - [Test] - [ExpectedException(typeof (ApplicationException), ExpectedMessage = "Boom")] - public void ExceptionsCanBeVerified() { - throw new ApplicationException("Boom"); - } - - [Test] - public void TestShouldRunFromResharper() { - Assert.That(_x, Is.EqualTo(5)); - } - } +using System; +using NUnit.Framework; + +namespace Orchard.Tests { + [TestFixture] + public class FakeTests { + #region Setup/Teardown + + [SetUp] + public void Init() { + _x = 5; + } + + #endregion + + private int _x; + + [Test] + [ExpectedException(typeof (ApplicationException), ExpectedMessage = "Boom")] + public void ExceptionsCanBeVerified() { + throw new ApplicationException("Boom"); + } + + [Test] + public void TestShouldRunFromResharper() { + Assert.That(_x, Is.EqualTo(5)); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/FileSystems/AppData/AppDataFolderTests.cs b/src/Orchard.Tests/FileSystems/AppData/AppDataFolderTests.cs index 62f24377f0c..a8cfefe3dea 100644 --- a/src/Orchard.Tests/FileSystems/AppData/AppDataFolderTests.cs +++ b/src/Orchard.Tests/FileSystems/AppData/AppDataFolderTests.cs @@ -1,114 +1,114 @@ -using System.IO; -using System.Linq; -using NUnit.Framework; -using Orchard.FileSystems.AppData; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.FileSystems.AppData { - [TestFixture] - public class AppDataFolderTests { - private string _tempFolder; - private IAppDataFolder _appDataFolder; - - public class StubAppDataFolderRoot : IAppDataFolderRoot { - public string RootPath { get; set; } - public string RootFolder { get; set; } - } - - public static IAppDataFolder CreateAppDataFolder(string tempFolder) { - var folderRoot = new StubAppDataFolderRoot {RootPath = "~/App_Data", RootFolder = tempFolder}; - var monitor = new StubVirtualPathMonitor(); - return new AppDataFolder(folderRoot, monitor); - } - - [SetUp] - public void Init() { - _tempFolder = Path.GetTempFileName(); - File.Delete(_tempFolder); - Directory.CreateDirectory(Path.Combine(_tempFolder, "alpha")); - File.WriteAllText(Path.Combine(_tempFolder, "alpha\\beta.txt"), "beta-content"); - File.WriteAllText(Path.Combine(_tempFolder, "alpha\\gamma.txt"), "gamma-content"); - Directory.CreateDirectory(Path.Combine(_tempFolder, "alpha\\omega")); - - _appDataFolder = CreateAppDataFolder(_tempFolder); - } - - [TearDown] - public void Term() { - Directory.Delete(_tempFolder, true); - } - - [Test] - public void ListFilesShouldContainSubPathAndFileName() { - var files = _appDataFolder.ListFiles("alpha"); - Assert.That(files.Count(), Is.EqualTo(2)); - Assert.That(files, Has.Some.EqualTo("alpha/beta.txt")); - Assert.That(files, Has.Some.EqualTo("alpha/gamma.txt")); - } - - [Test] - public void NonExistantFolderShouldListAsEmptyCollection() { - var files = _appDataFolder.ListFiles("delta"); - Assert.That(files.Count(), Is.EqualTo(0)); - } - - [Test] - public void PhysicalPathAddsToBasePathAndDoesNotNeedToExist() { - var physicalPath = _appDataFolder.MapPath("delta\\epsilon.txt"); - Assert.That(physicalPath, Is.EqualTo(Path.Combine(_tempFolder, "delta\\epsilon.txt"))); - } - - [Test] - public void ListSubdirectoriesShouldContainFullSubpath() { - var files = _appDataFolder.ListDirectories("alpha"); - Assert.That(files.Count(), Is.EqualTo(1)); - Assert.That(files, Has.Some.EqualTo("alpha/omega")); - } - - [Test] - public void ListSubdirectoriesShouldWorkInRoot() { - var files = _appDataFolder.ListDirectories(""); - Assert.That(files.Count(), Is.EqualTo(1)); - Assert.That(files, Has.Some.EqualTo("alpha")); - } - - - [Test] - public void NonExistantFolderShouldListDirectoriesAsEmptyCollection() { - var files = _appDataFolder.ListDirectories("delta"); - Assert.That(files.Count(), Is.EqualTo(0)); - } - - [Test] - public void CreateFileWillCauseDirectoryToBeCreated() { - Assert.That(Directory.Exists(Path.Combine(_tempFolder, "alpha\\omega\\foo")), Is.False); - _appDataFolder.CreateFile("alpha\\omega\\foo\\bar.txt", "quux"); - Assert.That(Directory.Exists(Path.Combine(_tempFolder, "alpha\\omega\\foo")), Is.True); - } - - - [Test] - public void FilesCanBeReadBack() { - _appDataFolder.CreateFile("alpha\\gamma\\foo\\bar.txt", @" -this is -a -test"); - var text = _appDataFolder.ReadFile("alpha\\gamma\\foo\\bar.txt"); - Assert.That(text, Is.EqualTo(@" -this is -a -test")); - } - - [Test] - public void FileExistsReturnsFalseForNonExistingFile() { - Assert.That(_appDataFolder.FileExists("notexisting"), Is.False); - } - - [Test] - public void FileExistsReturnsTrueForExistingFile() { - _appDataFolder.CreateFile("alpha\\foo\\bar.txt", ""); - Assert.That(_appDataFolder.FileExists("alpha\\foo\\bar.txt"), Is.True); - } - } -} +using System.IO; +using System.Linq; +using NUnit.Framework; +using Orchard.FileSystems.AppData; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.FileSystems.AppData { + [TestFixture] + public class AppDataFolderTests { + private string _tempFolder; + private IAppDataFolder _appDataFolder; + + public class StubAppDataFolderRoot : IAppDataFolderRoot { + public string RootPath { get; set; } + public string RootFolder { get; set; } + } + + public static IAppDataFolder CreateAppDataFolder(string tempFolder) { + var folderRoot = new StubAppDataFolderRoot {RootPath = "~/App_Data", RootFolder = tempFolder}; + var monitor = new StubVirtualPathMonitor(); + return new AppDataFolder(folderRoot, monitor); + } + + [SetUp] + public void Init() { + _tempFolder = Path.GetTempFileName(); + File.Delete(_tempFolder); + Directory.CreateDirectory(Path.Combine(_tempFolder, "alpha")); + File.WriteAllText(Path.Combine(_tempFolder, "alpha\\beta.txt"), "beta-content"); + File.WriteAllText(Path.Combine(_tempFolder, "alpha\\gamma.txt"), "gamma-content"); + Directory.CreateDirectory(Path.Combine(_tempFolder, "alpha\\omega")); + + _appDataFolder = CreateAppDataFolder(_tempFolder); + } + + [TearDown] + public void Term() { + Directory.Delete(_tempFolder, true); + } + + [Test] + public void ListFilesShouldContainSubPathAndFileName() { + var files = _appDataFolder.ListFiles("alpha"); + Assert.That(files.Count(), Is.EqualTo(2)); + Assert.That(files, Has.Some.EqualTo("alpha/beta.txt")); + Assert.That(files, Has.Some.EqualTo("alpha/gamma.txt")); + } + + [Test] + public void NonExistantFolderShouldListAsEmptyCollection() { + var files = _appDataFolder.ListFiles("delta"); + Assert.That(files.Count(), Is.EqualTo(0)); + } + + [Test] + public void PhysicalPathAddsToBasePathAndDoesNotNeedToExist() { + var physicalPath = _appDataFolder.MapPath("delta\\epsilon.txt"); + Assert.That(physicalPath, Is.EqualTo(Path.Combine(_tempFolder, "delta\\epsilon.txt"))); + } + + [Test] + public void ListSubdirectoriesShouldContainFullSubpath() { + var files = _appDataFolder.ListDirectories("alpha"); + Assert.That(files.Count(), Is.EqualTo(1)); + Assert.That(files, Has.Some.EqualTo("alpha/omega")); + } + + [Test] + public void ListSubdirectoriesShouldWorkInRoot() { + var files = _appDataFolder.ListDirectories(""); + Assert.That(files.Count(), Is.EqualTo(1)); + Assert.That(files, Has.Some.EqualTo("alpha")); + } + + + [Test] + public void NonExistantFolderShouldListDirectoriesAsEmptyCollection() { + var files = _appDataFolder.ListDirectories("delta"); + Assert.That(files.Count(), Is.EqualTo(0)); + } + + [Test] + public void CreateFileWillCauseDirectoryToBeCreated() { + Assert.That(Directory.Exists(Path.Combine(_tempFolder, "alpha\\omega\\foo")), Is.False); + _appDataFolder.CreateFile("alpha\\omega\\foo\\bar.txt", "quux"); + Assert.That(Directory.Exists(Path.Combine(_tempFolder, "alpha\\omega\\foo")), Is.True); + } + + + [Test] + public void FilesCanBeReadBack() { + _appDataFolder.CreateFile("alpha\\gamma\\foo\\bar.txt", @" +this is +a +test"); + var text = _appDataFolder.ReadFile("alpha\\gamma\\foo\\bar.txt"); + Assert.That(text, Is.EqualTo(@" +this is +a +test")); + } + + [Test] + public void FileExistsReturnsFalseForNonExistingFile() { + Assert.That(_appDataFolder.FileExists("notexisting"), Is.False); + } + + [Test] + public void FileExistsReturnsTrueForExistingFile() { + _appDataFolder.CreateFile("alpha\\foo\\bar.txt", ""); + Assert.That(_appDataFolder.FileExists("alpha\\foo\\bar.txt"), Is.True); + } + } +} diff --git a/src/Orchard.Tests/FileSystems/Dependencies/AssemblyProbingFolderTests.cs b/src/Orchard.Tests/FileSystems/Dependencies/AssemblyProbingFolderTests.cs index ac166f7deed..ad5a9765e5d 100644 --- a/src/Orchard.Tests/FileSystems/Dependencies/AssemblyProbingFolderTests.cs +++ b/src/Orchard.Tests/FileSystems/Dependencies/AssemblyProbingFolderTests.cs @@ -1,69 +1,69 @@ -using System.Linq; -using NUnit.Framework; -using Orchard.Environment; -using Orchard.FileSystems.Dependencies; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.FileSystems.Dependencies { - [TestFixture] - public class AssemblyProbingFolderTests { - - [Test] - public void FolderShouldBeEmptyByDefault() { - var clock = new StubClock(); - var appDataFolder = new StubAppDataFolder(clock); - var dependenciesFolder = new DefaultAssemblyProbingFolder(appDataFolder, new DefaultAssemblyLoader(Enumerable.Empty())); - - Assert.That(dependenciesFolder.AssemblyExists("foo"), Is.False); - } - - [Test] - public void LoadAssemblyShouldNotThrowIfAssemblyNotFound() { - var clock = new StubClock(); - var appDataFolder = new StubAppDataFolder(clock); - var dependenciesFolder = new DefaultAssemblyProbingFolder(appDataFolder, new DefaultAssemblyLoader(Enumerable.Empty())); - - Assert.That(dependenciesFolder.LoadAssembly("foo"), Is.Null); - } - - [Test] - public void GetAssemblyDateTimeUtcShouldThrowIfAssemblyNotFound() { - var clock = new StubClock(); - var appDataFolder = new StubAppDataFolder(clock); - var dependenciesFolder = new DefaultAssemblyProbingFolder(appDataFolder, new DefaultAssemblyLoader(Enumerable.Empty())); - - Assert.That(() => dependenciesFolder.GetAssemblyDateTimeUtc("foo"), Throws.Exception); - } - - [Test] - public void DeleteAssemblyShouldNotThrowIfAssemblyNotFound() { - var clock = new StubClock(); - var appDataFolder = new StubAppDataFolder(clock); - var dependenciesFolder = new DefaultAssemblyProbingFolder(appDataFolder, new DefaultAssemblyLoader(Enumerable.Empty())); - - Assert.DoesNotThrow(() => dependenciesFolder.DeleteAssembly("foo")); - } - - [Test] - public void StoreAssemblyShouldCopyFile() { - var clock = new StubClock(); - var appDataFolder = new StubAppDataFolder(clock); - - var assembly = GetType().Assembly; - var name = assembly.GetName().Name; - - { - var dependenciesFolder = new DefaultAssemblyProbingFolder(appDataFolder, new DefaultAssemblyLoader(Enumerable.Empty())); - dependenciesFolder.StoreAssembly(name, assembly.Location); - } - - { - var dependenciesFolder = new DefaultAssemblyProbingFolder(appDataFolder, new DefaultAssemblyLoader(Enumerable.Empty())); - Assert.That(dependenciesFolder.AssemblyExists(name), Is.True); - Assert.That(dependenciesFolder.LoadAssembly(name), Is.SameAs(GetType().Assembly)); - Assert.DoesNotThrow(() => dependenciesFolder.DeleteAssembly(name)); - Assert.That(dependenciesFolder.LoadAssembly(name), Is.Null); - } - } - } -} +using System.Linq; +using NUnit.Framework; +using Orchard.Environment; +using Orchard.FileSystems.Dependencies; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.FileSystems.Dependencies { + [TestFixture] + public class AssemblyProbingFolderTests { + + [Test] + public void FolderShouldBeEmptyByDefault() { + var clock = new StubClock(); + var appDataFolder = new StubAppDataFolder(clock); + var dependenciesFolder = new DefaultAssemblyProbingFolder(appDataFolder, new DefaultAssemblyLoader(Enumerable.Empty())); + + Assert.That(dependenciesFolder.AssemblyExists("foo"), Is.False); + } + + [Test] + public void LoadAssemblyShouldNotThrowIfAssemblyNotFound() { + var clock = new StubClock(); + var appDataFolder = new StubAppDataFolder(clock); + var dependenciesFolder = new DefaultAssemblyProbingFolder(appDataFolder, new DefaultAssemblyLoader(Enumerable.Empty())); + + Assert.That(dependenciesFolder.LoadAssembly("foo"), Is.Null); + } + + [Test] + public void GetAssemblyDateTimeUtcShouldThrowIfAssemblyNotFound() { + var clock = new StubClock(); + var appDataFolder = new StubAppDataFolder(clock); + var dependenciesFolder = new DefaultAssemblyProbingFolder(appDataFolder, new DefaultAssemblyLoader(Enumerable.Empty())); + + Assert.That(() => dependenciesFolder.GetAssemblyDateTimeUtc("foo"), Throws.Exception); + } + + [Test] + public void DeleteAssemblyShouldNotThrowIfAssemblyNotFound() { + var clock = new StubClock(); + var appDataFolder = new StubAppDataFolder(clock); + var dependenciesFolder = new DefaultAssemblyProbingFolder(appDataFolder, new DefaultAssemblyLoader(Enumerable.Empty())); + + Assert.DoesNotThrow(() => dependenciesFolder.DeleteAssembly("foo")); + } + + [Test] + public void StoreAssemblyShouldCopyFile() { + var clock = new StubClock(); + var appDataFolder = new StubAppDataFolder(clock); + + var assembly = GetType().Assembly; + var name = assembly.GetName().Name; + + { + var dependenciesFolder = new DefaultAssemblyProbingFolder(appDataFolder, new DefaultAssemblyLoader(Enumerable.Empty())); + dependenciesFolder.StoreAssembly(name, assembly.Location); + } + + { + var dependenciesFolder = new DefaultAssemblyProbingFolder(appDataFolder, new DefaultAssemblyLoader(Enumerable.Empty())); + Assert.That(dependenciesFolder.AssemblyExists(name), Is.True); + Assert.That(dependenciesFolder.LoadAssembly(name), Is.SameAs(GetType().Assembly)); + Assert.DoesNotThrow(() => dependenciesFolder.DeleteAssembly(name)); + Assert.That(dependenciesFolder.LoadAssembly(name), Is.Null); + } + } + } +} diff --git a/src/Orchard.Tests/FileSystems/Dependencies/DependenciesFolderTests.cs b/src/Orchard.Tests/FileSystems/Dependencies/DependenciesFolderTests.cs index 5d2749c7438..847b70a88c6 100644 --- a/src/Orchard.Tests/FileSystems/Dependencies/DependenciesFolderTests.cs +++ b/src/Orchard.Tests/FileSystems/Dependencies/DependenciesFolderTests.cs @@ -1,141 +1,141 @@ -using System; -using System.IO; -using System.Linq; -using Autofac; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.FileSystems.AppData; -using Orchard.FileSystems.Dependencies; -using Orchard.Services; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.FileSystems.Dependencies { - [TestFixture] - public class DependenciesFolderTests { - public IContainer BuildContainer() { - var builder = new ContainerBuilder(); - builder.RegisterType().As().SingleInstance(); - builder.RegisterType().As().SingleInstance(); - builder.RegisterType().As().SingleInstance(); - builder.RegisterType().As(); - builder.RegisterType().As(); - return builder.Build(); - } - - [Test] - public void LoadDescriptorsShouldReturnEmptyList() { - var dependenciesFolder = BuildContainer().Resolve(); - - var e = dependenciesFolder.LoadDescriptors(); - Assert.That(e, Is.Empty); - } - - [Test] - public void StoreDescriptorsShouldWork() { - var dependenciesFolder = BuildContainer().Resolve(); - - var d = new DependencyDescriptor { - Name = "name", - LoaderName = "test", - VirtualPath = "~/bin" - }; - - dependenciesFolder.StoreDescriptors(new[] { d }); - var e = dependenciesFolder.LoadDescriptors(); - Assert.That(e, Has.Count.EqualTo(1)); - Assert.That(e.First().Name, Is.EqualTo("name")); - Assert.That(e.First().LoaderName, Is.EqualTo("test")); - Assert.That(e.First().VirtualPath, Is.EqualTo("~/bin")); - } - - [Test] - public void StoreDescriptorsShouldNoOpIfNoChanges() { - var container = BuildContainer(); - var clock = (StubClock)container.Resolve(); - var appDataFolder = (StubAppDataFolder)container.Resolve(); - var dependenciesFolder = container.Resolve(); - - var d1 = new DependencyDescriptor { - Name = "name1", - LoaderName = "test1", - VirtualPath = "~/bin1" - }; - - var d2 = new DependencyDescriptor { - Name = "name2", - LoaderName = "test2", - VirtualPath = "~/bin2" - }; - - dependenciesFolder.StoreDescriptors(new[] { d1, d2 }); - var dateTime1 = appDataFolder.GetLastWriteTimeUtc(Path.Combine("Dependencies", "Dependencies.xml")); - clock.Advance(TimeSpan.FromMinutes(1)); - - dependenciesFolder.StoreDescriptors(new[] { d2, d1 }); - var dateTime2 = appDataFolder.GetLastWriteTimeUtc(Path.Combine("Dependencies", "Dependencies.xml")); - Assert.That(dateTime1, Is.EqualTo(dateTime2)); - } - - [Test] - public void StoreDescriptorsShouldStoreIfChanges() { - var container = BuildContainer(); - var clock = (StubClock)container.Resolve(); - var appDataFolder = (StubAppDataFolder)container.Resolve(); - var dependenciesFolder = container.Resolve(); - - var d1 = new DependencyDescriptor { - Name = "name1", - LoaderName = "test1", - VirtualPath = "~/bin1" - }; - - var d2 = new DependencyDescriptor { - Name = "name2", - LoaderName = "test2", - VirtualPath = "~/bin2" - }; - - dependenciesFolder.StoreDescriptors(new[] { d1, d2 }); - var dateTime1 = appDataFolder.GetLastWriteTimeUtc(Path.Combine("Dependencies", "Dependencies.xml")); - clock.Advance(TimeSpan.FromMinutes(1)); - - d1.LoaderName = "bar"; - - dependenciesFolder.StoreDescriptors(new[] { d2, d1 }); - var dateTime2 = appDataFolder.GetLastWriteTimeUtc(Path.Combine("Dependencies", "Dependencies.xml")); - Assert.That(dateTime1 + TimeSpan.FromMinutes(1), Is.EqualTo(dateTime2)); - } - - [Test] - public void LoadDescriptorsShouldWorkAcrossInstances() { - var container = BuildContainer(); - var clock = (StubClock)container.Resolve(); - var appDataFolder = (StubAppDataFolder)container.Resolve(); - var dependenciesFolder = container.Resolve(); - - var d1 = new DependencyDescriptor { - Name = "name1", - LoaderName = "test1", - VirtualPath = "~/bin1" - }; - - var d2 = new DependencyDescriptor { - Name = "name2", - LoaderName = "test2", - VirtualPath = "~/bin2" - }; - - dependenciesFolder.StoreDescriptors(new[] { d1, d2 }); - - // Create a new instance over the same appDataFolder - var dependenciesFolder2 = container.Resolve(); - Assert.That(dependenciesFolder2, Is.Not.SameAs(dependenciesFolder)); - - // Ensure descriptors were persisted properly - var result = dependenciesFolder2.LoadDescriptors(); - Assert.That(result, Has.Count.EqualTo(2)); - Assert.That(result.Select(p => p.Name), Has.Some.EqualTo("name1")); - Assert.That(result.Select(p => p.Name), Has.Some.EqualTo("name2")); - } - } -} +using System; +using System.IO; +using System.Linq; +using Autofac; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.FileSystems.AppData; +using Orchard.FileSystems.Dependencies; +using Orchard.Services; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.FileSystems.Dependencies { + [TestFixture] + public class DependenciesFolderTests { + public IContainer BuildContainer() { + var builder = new ContainerBuilder(); + builder.RegisterType().As().SingleInstance(); + builder.RegisterType().As().SingleInstance(); + builder.RegisterType().As().SingleInstance(); + builder.RegisterType().As(); + builder.RegisterType().As(); + return builder.Build(); + } + + [Test] + public void LoadDescriptorsShouldReturnEmptyList() { + var dependenciesFolder = BuildContainer().Resolve(); + + var e = dependenciesFolder.LoadDescriptors(); + Assert.That(e, Is.Empty); + } + + [Test] + public void StoreDescriptorsShouldWork() { + var dependenciesFolder = BuildContainer().Resolve(); + + var d = new DependencyDescriptor { + Name = "name", + LoaderName = "test", + VirtualPath = "~/bin" + }; + + dependenciesFolder.StoreDescriptors(new[] { d }); + var e = dependenciesFolder.LoadDescriptors(); + Assert.That(e, Has.Count.EqualTo(1)); + Assert.That(e.First().Name, Is.EqualTo("name")); + Assert.That(e.First().LoaderName, Is.EqualTo("test")); + Assert.That(e.First().VirtualPath, Is.EqualTo("~/bin")); + } + + [Test] + public void StoreDescriptorsShouldNoOpIfNoChanges() { + var container = BuildContainer(); + var clock = (StubClock)container.Resolve(); + var appDataFolder = (StubAppDataFolder)container.Resolve(); + var dependenciesFolder = container.Resolve(); + + var d1 = new DependencyDescriptor { + Name = "name1", + LoaderName = "test1", + VirtualPath = "~/bin1" + }; + + var d2 = new DependencyDescriptor { + Name = "name2", + LoaderName = "test2", + VirtualPath = "~/bin2" + }; + + dependenciesFolder.StoreDescriptors(new[] { d1, d2 }); + var dateTime1 = appDataFolder.GetLastWriteTimeUtc(Path.Combine("Dependencies", "Dependencies.xml")); + clock.Advance(TimeSpan.FromMinutes(1)); + + dependenciesFolder.StoreDescriptors(new[] { d2, d1 }); + var dateTime2 = appDataFolder.GetLastWriteTimeUtc(Path.Combine("Dependencies", "Dependencies.xml")); + Assert.That(dateTime1, Is.EqualTo(dateTime2)); + } + + [Test] + public void StoreDescriptorsShouldStoreIfChanges() { + var container = BuildContainer(); + var clock = (StubClock)container.Resolve(); + var appDataFolder = (StubAppDataFolder)container.Resolve(); + var dependenciesFolder = container.Resolve(); + + var d1 = new DependencyDescriptor { + Name = "name1", + LoaderName = "test1", + VirtualPath = "~/bin1" + }; + + var d2 = new DependencyDescriptor { + Name = "name2", + LoaderName = "test2", + VirtualPath = "~/bin2" + }; + + dependenciesFolder.StoreDescriptors(new[] { d1, d2 }); + var dateTime1 = appDataFolder.GetLastWriteTimeUtc(Path.Combine("Dependencies", "Dependencies.xml")); + clock.Advance(TimeSpan.FromMinutes(1)); + + d1.LoaderName = "bar"; + + dependenciesFolder.StoreDescriptors(new[] { d2, d1 }); + var dateTime2 = appDataFolder.GetLastWriteTimeUtc(Path.Combine("Dependencies", "Dependencies.xml")); + Assert.That(dateTime1 + TimeSpan.FromMinutes(1), Is.EqualTo(dateTime2)); + } + + [Test] + public void LoadDescriptorsShouldWorkAcrossInstances() { + var container = BuildContainer(); + var clock = (StubClock)container.Resolve(); + var appDataFolder = (StubAppDataFolder)container.Resolve(); + var dependenciesFolder = container.Resolve(); + + var d1 = new DependencyDescriptor { + Name = "name1", + LoaderName = "test1", + VirtualPath = "~/bin1" + }; + + var d2 = new DependencyDescriptor { + Name = "name2", + LoaderName = "test2", + VirtualPath = "~/bin2" + }; + + dependenciesFolder.StoreDescriptors(new[] { d1, d2 }); + + // Create a new instance over the same appDataFolder + var dependenciesFolder2 = container.Resolve(); + Assert.That(dependenciesFolder2, Is.Not.SameAs(dependenciesFolder)); + + // Ensure descriptors were persisted properly + var result = dependenciesFolder2.LoadDescriptors(); + Assert.That(result, Has.Count.EqualTo(2)); + Assert.That(result.Select(p => p.Name), Has.Some.EqualTo("name1")); + Assert.That(result.Select(p => p.Name), Has.Some.EqualTo("name2")); + } + } +} diff --git a/src/Orchard.Tests/FileSystems/LockFile/LockFileManagerTests.cs b/src/Orchard.Tests/FileSystems/LockFile/LockFileManagerTests.cs index 1c6a4189401..9ba4ee7a7fc 100644 --- a/src/Orchard.Tests/FileSystems/LockFile/LockFileManagerTests.cs +++ b/src/Orchard.Tests/FileSystems/LockFile/LockFileManagerTests.cs @@ -1,223 +1,223 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading; -using NUnit.Framework; -using Orchard.FileSystems.AppData; -using Orchard.FileSystems.LockFile; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.FileSystems.LockFile { - [TestFixture] - public class LockFileManagerTests { - private string _tempFolder; - private IAppDataFolder _appDataFolder; - private ILockFileManager _lockFileManager; - private StubClock _clock; - - public class StubAppDataFolderRoot : IAppDataFolderRoot { - public string RootPath { get; set; } - public string RootFolder { get; set; } - } - - public static IAppDataFolder CreateAppDataFolder(string tempFolder) { - var folderRoot = new StubAppDataFolderRoot {RootPath = "~/App_Data", RootFolder = tempFolder}; - var monitor = new StubVirtualPathMonitor(); - return new AppDataFolder(folderRoot, monitor); - } - - [SetUp] - public void Init() { - _tempFolder = Path.GetTempFileName(); - File.Delete(_tempFolder); - _appDataFolder = CreateAppDataFolder(_tempFolder); - - _clock = new StubClock(); - _lockFileManager = new DefaultLockFileManager(_appDataFolder, _clock); - } - - [TearDown] - public void Term() { - Directory.Delete(_tempFolder, true); - } - - [Test] - public void LockShouldBeGrantedWhenDoesNotExist() { - ILockFile lockFile = null; - var granted = _lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile); - - Assert.That(granted, Is.True); - Assert.That(lockFile, Is.Not.Null); - Assert.That(_lockFileManager.IsLocked("foo.txt.lock"), Is.True); - Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(1)); - } - - [Test] - public void ExistingLockFileShouldPreventGrants() { - ILockFile lockFile = null; - _lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile); - - Assert.That(_lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile), Is.False); - Assert.That(_lockFileManager.IsLocked("foo.txt.lock"), Is.True); - Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(1)); - } - - [Test] - public void ReleasingALockShouldAllowGranting() { - ILockFile lockFile = null; - _lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile); - - using (lockFile) { - Assert.That(_lockFileManager.IsLocked("foo.txt.lock"), Is.True); - Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(1)); - } - - Assert.That(_lockFileManager.IsLocked("foo.txt.lock"), Is.False); - Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(0)); - } - - [Test] - public void ReleasingAReleasedLockShouldWork() { - ILockFile lockFile = null; - _lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile); - - Assert.That(_lockFileManager.IsLocked("foo.txt.lock"), Is.True); - Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(1)); - - lockFile.Release(); - Assert.That(_lockFileManager.IsLocked("foo.txt.lock"), Is.False); - Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(0)); - - lockFile.Release(); - Assert.That(_lockFileManager.IsLocked("foo.txt.lock"), Is.False); - Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(0)); - } - - [Test] - public void DisposingLockShouldReleaseIt() { - ILockFile lockFile = null; - _lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile); - - using (lockFile) { - Assert.That(_lockFileManager.IsLocked("foo.txt.lock"), Is.True); - Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(1)); - } - - Assert.That(_lockFileManager.IsLocked("foo.txt.lock"), Is.False); - Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(0)); - } - - [Test] - public void ExpiredLockShouldBeAvailable() { - ILockFile lockFile = null; - _lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile); - - _clock.Advance(DefaultLockFileManager.Expiration); - Assert.That(_lockFileManager.IsLocked("foo.txt.lock"), Is.False); - Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(1)); - } - - [Test] - public void ShouldGrantExpiredLock() { - ILockFile lockFile = null; - _lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile); - - _clock.Advance(DefaultLockFileManager.Expiration); - var granted = _lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile); - - Assert.That(granted, Is.True); - Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(1)); - } - - private static int _lockCount; - private static readonly object _synLock = new object(); - - [Test] - public void AcquiringLockShouldBeThreadSafe() { - var threads = new List(); - for(var i=0; i<10; i++) { - var t = new Thread(PlayWithAcquire); - t.Start(); - threads.Add(t); - } - - threads.ForEach(t => t.Join()); - Assert.That(_lockCount, Is.EqualTo(0)); - } - - [Test] - public void IsLockedShouldBeThreadSafe() { - var threads = new List(); - for (var i = 0; i < 10; i++) - { - var t = new Thread(PlayWithIsLocked); - t.Start(); - threads.Add(t); - } - - threads.ForEach(t => t.Join()); - Assert.That(_lockCount, Is.EqualTo(0)); - } - - private void PlayWithAcquire() { - var r = new Random(DateTime.Now.Millisecond); - ILockFile lockFile = null; - - // loop until the lock has been acquired - for (;;) { - if (!_lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile)) { - continue; - } - - lock (_synLock) { - _lockCount++; - Assert.That(_lockCount, Is.EqualTo(1)); - } - - // keep the lock for a certain time - Thread.Sleep(r.Next(200)); - lock (_synLock) { - _lockCount--; - Assert.That(_lockCount, Is.EqualTo(0)); - } - - lockFile.Release(); - return; - } - } - - private void PlayWithIsLocked() { - var r = new Random(DateTime.Now.Millisecond); - ILockFile lockFile = null; - const string path = "foo.txt.lock"; - - // loop until the lock has been acquired - for (;;) { - if(_lockFileManager.IsLocked(path)) { - continue; - } - - if (!_lockFileManager.TryAcquireLock(path, ref lockFile)) { - continue; - } - - lock (_synLock) { - _lockCount++; - Assert.That(_lockCount, Is.EqualTo(1)); - } - - // keep the lock for a certain time - Thread.Sleep(r.Next(200)); - lock (_synLock) { - _lockCount--; - Assert.That(_lockCount, Is.EqualTo(0)); - } - - lockFile.Release(); - return; - } - } - - } -} +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading; +using NUnit.Framework; +using Orchard.FileSystems.AppData; +using Orchard.FileSystems.LockFile; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.FileSystems.LockFile { + [TestFixture] + public class LockFileManagerTests { + private string _tempFolder; + private IAppDataFolder _appDataFolder; + private ILockFileManager _lockFileManager; + private StubClock _clock; + + public class StubAppDataFolderRoot : IAppDataFolderRoot { + public string RootPath { get; set; } + public string RootFolder { get; set; } + } + + public static IAppDataFolder CreateAppDataFolder(string tempFolder) { + var folderRoot = new StubAppDataFolderRoot {RootPath = "~/App_Data", RootFolder = tempFolder}; + var monitor = new StubVirtualPathMonitor(); + return new AppDataFolder(folderRoot, monitor); + } + + [SetUp] + public void Init() { + _tempFolder = Path.GetTempFileName(); + File.Delete(_tempFolder); + _appDataFolder = CreateAppDataFolder(_tempFolder); + + _clock = new StubClock(); + _lockFileManager = new DefaultLockFileManager(_appDataFolder, _clock); + } + + [TearDown] + public void Term() { + Directory.Delete(_tempFolder, true); + } + + [Test] + public void LockShouldBeGrantedWhenDoesNotExist() { + ILockFile lockFile = null; + var granted = _lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile); + + Assert.That(granted, Is.True); + Assert.That(lockFile, Is.Not.Null); + Assert.That(_lockFileManager.IsLocked("foo.txt.lock"), Is.True); + Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(1)); + } + + [Test] + public void ExistingLockFileShouldPreventGrants() { + ILockFile lockFile = null; + _lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile); + + Assert.That(_lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile), Is.False); + Assert.That(_lockFileManager.IsLocked("foo.txt.lock"), Is.True); + Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(1)); + } + + [Test] + public void ReleasingALockShouldAllowGranting() { + ILockFile lockFile = null; + _lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile); + + using (lockFile) { + Assert.That(_lockFileManager.IsLocked("foo.txt.lock"), Is.True); + Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(1)); + } + + Assert.That(_lockFileManager.IsLocked("foo.txt.lock"), Is.False); + Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(0)); + } + + [Test] + public void ReleasingAReleasedLockShouldWork() { + ILockFile lockFile = null; + _lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile); + + Assert.That(_lockFileManager.IsLocked("foo.txt.lock"), Is.True); + Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(1)); + + lockFile.Release(); + Assert.That(_lockFileManager.IsLocked("foo.txt.lock"), Is.False); + Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(0)); + + lockFile.Release(); + Assert.That(_lockFileManager.IsLocked("foo.txt.lock"), Is.False); + Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(0)); + } + + [Test] + public void DisposingLockShouldReleaseIt() { + ILockFile lockFile = null; + _lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile); + + using (lockFile) { + Assert.That(_lockFileManager.IsLocked("foo.txt.lock"), Is.True); + Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(1)); + } + + Assert.That(_lockFileManager.IsLocked("foo.txt.lock"), Is.False); + Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(0)); + } + + [Test] + public void ExpiredLockShouldBeAvailable() { + ILockFile lockFile = null; + _lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile); + + _clock.Advance(DefaultLockFileManager.Expiration); + Assert.That(_lockFileManager.IsLocked("foo.txt.lock"), Is.False); + Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(1)); + } + + [Test] + public void ShouldGrantExpiredLock() { + ILockFile lockFile = null; + _lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile); + + _clock.Advance(DefaultLockFileManager.Expiration); + var granted = _lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile); + + Assert.That(granted, Is.True); + Assert.That(_appDataFolder.ListFiles("").Count(), Is.EqualTo(1)); + } + + private static int _lockCount; + private static readonly object _synLock = new object(); + + [Test] + public void AcquiringLockShouldBeThreadSafe() { + var threads = new List(); + for(var i=0; i<10; i++) { + var t = new Thread(PlayWithAcquire); + t.Start(); + threads.Add(t); + } + + threads.ForEach(t => t.Join()); + Assert.That(_lockCount, Is.EqualTo(0)); + } + + [Test] + public void IsLockedShouldBeThreadSafe() { + var threads = new List(); + for (var i = 0; i < 10; i++) + { + var t = new Thread(PlayWithIsLocked); + t.Start(); + threads.Add(t); + } + + threads.ForEach(t => t.Join()); + Assert.That(_lockCount, Is.EqualTo(0)); + } + + private void PlayWithAcquire() { + var r = new Random(DateTime.Now.Millisecond); + ILockFile lockFile = null; + + // loop until the lock has been acquired + for (;;) { + if (!_lockFileManager.TryAcquireLock("foo.txt.lock", ref lockFile)) { + continue; + } + + lock (_synLock) { + _lockCount++; + Assert.That(_lockCount, Is.EqualTo(1)); + } + + // keep the lock for a certain time + Thread.Sleep(r.Next(200)); + lock (_synLock) { + _lockCount--; + Assert.That(_lockCount, Is.EqualTo(0)); + } + + lockFile.Release(); + return; + } + } + + private void PlayWithIsLocked() { + var r = new Random(DateTime.Now.Millisecond); + ILockFile lockFile = null; + const string path = "foo.txt.lock"; + + // loop until the lock has been acquired + for (;;) { + if(_lockFileManager.IsLocked(path)) { + continue; + } + + if (!_lockFileManager.TryAcquireLock(path, ref lockFile)) { + continue; + } + + lock (_synLock) { + _lockCount++; + Assert.That(_lockCount, Is.EqualTo(1)); + } + + // keep the lock for a certain time + Thread.Sleep(r.Next(200)); + lock (_synLock) { + _lockCount--; + Assert.That(_lockCount, Is.EqualTo(0)); + } + + lockFile.Release(); + return; + } + } + + } +} diff --git a/src/Orchard.Tests/FileSystems/VirtualPath/DefaultVirtualPathProviderTests.cs b/src/Orchard.Tests/FileSystems/VirtualPath/DefaultVirtualPathProviderTests.cs index 735a8ea6e3b..dd797704a80 100644 --- a/src/Orchard.Tests/FileSystems/VirtualPath/DefaultVirtualPathProviderTests.cs +++ b/src/Orchard.Tests/FileSystems/VirtualPath/DefaultVirtualPathProviderTests.cs @@ -1,53 +1,53 @@ -using Moq; -using NUnit.Framework; -using Orchard.FileSystems.VirtualPath; - -namespace Orchard.Tests.FileSystems.VirtualPath { - [TestFixture] - public class DefaultVirtualPathProviderTests { - [Test] - public void TryFileExistsTest() { - StubDefaultVirtualPathProvider defaultVirtualPathProvider = new StubDefaultVirtualPathProvider(); - - Assert.That(defaultVirtualPathProvider.TryFileExists("~/a.txt"), Is.True); - Assert.That(defaultVirtualPathProvider.TryFileExists("~/../a.txt"), Is.False); - Assert.That(defaultVirtualPathProvider.TryFileExists("~/a/../a.txt"), Is.True); - Assert.That(defaultVirtualPathProvider.TryFileExists("~/a/b/../a.txt"), Is.True); - Assert.That(defaultVirtualPathProvider.TryFileExists("~/a/b/../../a.txt"), Is.True); - Assert.That(defaultVirtualPathProvider.TryFileExists("~/a/b/../../../a.txt"), Is.False); - Assert.That(defaultVirtualPathProvider.TryFileExists("~/a/../../b/c.txt"), Is.False); - } - - [Test] - public void RejectMalformedVirtualPathTests() { - StubDefaultVirtualPathProvider defaultVirtualPathProvider = new StubDefaultVirtualPathProvider(); - - Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("~/a.txt"), Is.False); - Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("/a.txt"), Is.False); - - Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("~/../a.txt"), Is.True); - Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("/../a.txt"), Is.True); - - Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("~/a/../a.txt"), Is.False); - Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("/a/../a.txt"), Is.False); - - Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("~/a/b/../a.txt"), Is.False); - Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("/a/b/../a.txt"), Is.False); - - Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("~/a/b/../../a.txt"), Is.False); - Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("/a/b/../../a.txt"), Is.False); - - Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("~/a/b/../../../a.txt"), Is.True); - Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("/a/b/../../../a.txt"), Is.True); - - Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("~/a/../../b//.txt"), Is.True); - Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("/a/../../b//.txt"), Is.True); - } - } - - internal class StubDefaultVirtualPathProvider : DefaultVirtualPathProvider { - public override bool FileExists(string path) { - return true; - } - } -} +using Moq; +using NUnit.Framework; +using Orchard.FileSystems.VirtualPath; + +namespace Orchard.Tests.FileSystems.VirtualPath { + [TestFixture] + public class DefaultVirtualPathProviderTests { + [Test] + public void TryFileExistsTest() { + StubDefaultVirtualPathProvider defaultVirtualPathProvider = new StubDefaultVirtualPathProvider(); + + Assert.That(defaultVirtualPathProvider.TryFileExists("~/a.txt"), Is.True); + Assert.That(defaultVirtualPathProvider.TryFileExists("~/../a.txt"), Is.False); + Assert.That(defaultVirtualPathProvider.TryFileExists("~/a/../a.txt"), Is.True); + Assert.That(defaultVirtualPathProvider.TryFileExists("~/a/b/../a.txt"), Is.True); + Assert.That(defaultVirtualPathProvider.TryFileExists("~/a/b/../../a.txt"), Is.True); + Assert.That(defaultVirtualPathProvider.TryFileExists("~/a/b/../../../a.txt"), Is.False); + Assert.That(defaultVirtualPathProvider.TryFileExists("~/a/../../b/c.txt"), Is.False); + } + + [Test] + public void RejectMalformedVirtualPathTests() { + StubDefaultVirtualPathProvider defaultVirtualPathProvider = new StubDefaultVirtualPathProvider(); + + Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("~/a.txt"), Is.False); + Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("/a.txt"), Is.False); + + Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("~/../a.txt"), Is.True); + Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("/../a.txt"), Is.True); + + Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("~/a/../a.txt"), Is.False); + Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("/a/../a.txt"), Is.False); + + Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("~/a/b/../a.txt"), Is.False); + Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("/a/b/../a.txt"), Is.False); + + Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("~/a/b/../../a.txt"), Is.False); + Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("/a/b/../../a.txt"), Is.False); + + Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("~/a/b/../../../a.txt"), Is.True); + Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("/a/b/../../../a.txt"), Is.True); + + Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("~/a/../../b//.txt"), Is.True); + Assert.That(defaultVirtualPathProvider.IsMalformedVirtualPath("/a/../../b//.txt"), Is.True); + } + } + + internal class StubDefaultVirtualPathProvider : DefaultVirtualPathProvider { + public override bool FileExists(string path) { + return true; + } + } +} diff --git a/src/Orchard.Tests/FluentDbTests.cs b/src/Orchard.Tests/FluentDbTests.cs index 4a516b8f981..39a038cd44d 100644 --- a/src/Orchard.Tests/FluentDbTests.cs +++ b/src/Orchard.Tests/FluentDbTests.cs @@ -1,96 +1,96 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using FluentNHibernate; -using FluentNHibernate.Automapping; -using FluentNHibernate.Cfg; -using FluentNHibernate.Cfg.Db; -using FluentNHibernate.Diagnostics; -using NHibernate.Criterion; -using NHibernate.Tool.hbm2ddl; -using NUnit.Framework; -using Orchard.Data.Providers; -using Orchard.Tests.Records; -using MsSqlCeConfiguration = Orchard.Data.Providers.MsSqlCeConfiguration; - -namespace Orchard.Tests { - [TestFixture] - public class FluentDbTests { - public class Types : ITypeSource { - private readonly IEnumerable _types; - - public Types(params Type[] types) { - _types = types; - } - - #region ITypeSource Members - - public IEnumerable GetTypes() { - return _types; - } - - public void LogSource(IDiagnosticLogger logger) { - throw new NotImplementedException(); - } - - public string GetIdentifier() { - throw new NotImplementedException(); - } - - #endregion - } - - [Test] - public void CreatingSchemaForStatedClassesInTempFile() { - var types = new Types(typeof(FooRecord), typeof(BarRecord)); - - var fileName = "temp.sdf"; - var persistenceConfigurer = new SqlCeDataServicesProvider(fileName).GetPersistenceConfigurer(true/*createDatabase*/); - ((MsSqlCeConfiguration)persistenceConfigurer).ShowSql(); - - var sessionFactory = Fluently.Configure() - .Database(persistenceConfigurer) - .Mappings(m => m.AutoMappings.Add(AutoMap.Source(types))) - .ExposeConfiguration(c => { - // This is to work around what looks to be an issue in the NHibernate driver: - // When inserting a row with IDENTITY column, the "SELET @@IDENTITY" statement - // is issued as a separate command. By default, it is also issued in a separate - // connection, which is not supported (returns NULL). - c.SetProperty("connection.release_mode", "on_close"); - new SchemaExport(c).Create(false, true); - }) - .BuildSessionFactory(); - - var session = sessionFactory.OpenSession(); - session.Save(new FooRecord { Name = "Hello" }); - session.Save(new BarRecord { Height = 3, Width = 4.5m }); - session.Close(); - - session = sessionFactory.OpenSession(); - var foos = session.CreateCriteria().List(); - Assert.That(foos.Count, Is.EqualTo(1)); - Assert.That(foos, Has.All.Property("Name").EqualTo("Hello")); - session.Close(); - } - - - [Test] - public void UsingDataUtilityToBuildSessionFactory() { - var factory = DataUtility.CreateSessionFactory(typeof(FooRecord), typeof(BarRecord)); - - var session = factory.OpenSession(); - var foo1 = new FooRecord { Name = "world" }; - session.Save(foo1); - session.Close(); - - session = factory.OpenSession(); - var foo2 = session.CreateCriteria() - .Add(Restrictions.Eq("Name", "world")) - .List().Single(); - session.Close(); - - Assert.That(foo1, Is.Not.SameAs(foo2)); - Assert.That(foo1.Id, Is.EqualTo(foo2.Id)); - } - } +using System; +using System.Collections.Generic; +using System.Linq; +using FluentNHibernate; +using FluentNHibernate.Automapping; +using FluentNHibernate.Cfg; +using FluentNHibernate.Cfg.Db; +using FluentNHibernate.Diagnostics; +using NHibernate.Criterion; +using NHibernate.Tool.hbm2ddl; +using NUnit.Framework; +using Orchard.Data.Providers; +using Orchard.Tests.Records; +using MsSqlCeConfiguration = Orchard.Data.Providers.MsSqlCeConfiguration; + +namespace Orchard.Tests { + [TestFixture] + public class FluentDbTests { + public class Types : ITypeSource { + private readonly IEnumerable _types; + + public Types(params Type[] types) { + _types = types; + } + + #region ITypeSource Members + + public IEnumerable GetTypes() { + return _types; + } + + public void LogSource(IDiagnosticLogger logger) { + throw new NotImplementedException(); + } + + public string GetIdentifier() { + throw new NotImplementedException(); + } + + #endregion + } + + [Test] + public void CreatingSchemaForStatedClassesInTempFile() { + var types = new Types(typeof(FooRecord), typeof(BarRecord)); + + var fileName = "temp.sdf"; + var persistenceConfigurer = new SqlCeDataServicesProvider(fileName).GetPersistenceConfigurer(true/*createDatabase*/); + ((MsSqlCeConfiguration)persistenceConfigurer).ShowSql(); + + var sessionFactory = Fluently.Configure() + .Database(persistenceConfigurer) + .Mappings(m => m.AutoMappings.Add(AutoMap.Source(types))) + .ExposeConfiguration(c => { + // This is to work around what looks to be an issue in the NHibernate driver: + // When inserting a row with IDENTITY column, the "SELET @@IDENTITY" statement + // is issued as a separate command. By default, it is also issued in a separate + // connection, which is not supported (returns NULL). + c.SetProperty("connection.release_mode", "on_close"); + new SchemaExport(c).Create(false, true); + }) + .BuildSessionFactory(); + + var session = sessionFactory.OpenSession(); + session.Save(new FooRecord { Name = "Hello" }); + session.Save(new BarRecord { Height = 3, Width = 4.5m }); + session.Close(); + + session = sessionFactory.OpenSession(); + var foos = session.CreateCriteria().List(); + Assert.That(foos.Count, Is.EqualTo(1)); + Assert.That(foos, Has.All.Property("Name").EqualTo("Hello")); + session.Close(); + } + + + [Test] + public void UsingDataUtilityToBuildSessionFactory() { + var factory = DataUtility.CreateSessionFactory(typeof(FooRecord), typeof(BarRecord)); + + var session = factory.OpenSession(); + var foo1 = new FooRecord { Name = "world" }; + session.Save(foo1); + session.Close(); + + session = factory.OpenSession(); + var foo2 = session.CreateCriteria() + .Add(Restrictions.Eq("Name", "world")) + .List().Single(); + session.Close(); + + Assert.That(foo1, Is.Not.SameAs(foo2)); + Assert.That(foo1.Id, Is.EqualTo(foo2.Id)); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/LinqToNHibernateTests.cs b/src/Orchard.Tests/LinqToNHibernateTests.cs index ce92a55ead8..77b27abd266 100644 --- a/src/Orchard.Tests/LinqToNHibernateTests.cs +++ b/src/Orchard.Tests/LinqToNHibernateTests.cs @@ -1,42 +1,42 @@ -using System.Linq; -using NHibernate; -using NHibernate.Linq; -using NUnit.Framework; -using Orchard.Tests.Records; - -namespace Orchard.Tests { - [TestFixture] - public class LinqToNHibernateTests { - #region Setup/Teardown - - [SetUp] - public void Init() { - var sessionFactory = DataUtility.CreateSessionFactory(typeof (FooRecord)); - using (var session = sessionFactory.OpenSession()) { - session.Save(new FooRecord {Name = "one"}); - session.Save(new FooRecord {Name = "two"}); - session.Save(new FooRecord {Name = "three"}); - } - _session = sessionFactory.OpenSession(); - } - - [TearDown] - public void Term() { - _session.Close(); - } - - #endregion - - private ISession _session; - - [Test] - public void WhereClauseShouldLimitResults() { - var foos = from f in _session.Query() where f.Name == "two" || f.Name == "one" select f; - - Assert.That(foos.Count(), Is.EqualTo(2)); - Assert.That(foos, Has.Some.Property("Name").EqualTo("one")); - Assert.That(foos, Has.Some.Property("Name").EqualTo("two")); - Assert.That(foos, Has.None.Property("Name").EqualTo("three")); - } - } +using System.Linq; +using NHibernate; +using NHibernate.Linq; +using NUnit.Framework; +using Orchard.Tests.Records; + +namespace Orchard.Tests { + [TestFixture] + public class LinqToNHibernateTests { + #region Setup/Teardown + + [SetUp] + public void Init() { + var sessionFactory = DataUtility.CreateSessionFactory(typeof (FooRecord)); + using (var session = sessionFactory.OpenSession()) { + session.Save(new FooRecord {Name = "one"}); + session.Save(new FooRecord {Name = "two"}); + session.Save(new FooRecord {Name = "three"}); + } + _session = sessionFactory.OpenSession(); + } + + [TearDown] + public void Term() { + _session.Close(); + } + + #endregion + + private ISession _session; + + [Test] + public void WhereClauseShouldLimitResults() { + var foos = from f in _session.Query() where f.Name == "two" || f.Name == "one" select f; + + Assert.That(foos.Count(), Is.EqualTo(2)); + Assert.That(foos, Has.Some.Property("Name").EqualTo("one")); + Assert.That(foos, Has.Some.Property("Name").EqualTo("two")); + Assert.That(foos, Has.None.Property("Name").EqualTo("three")); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Localization/CultureManagerTests.cs b/src/Orchard.Tests/Localization/CultureManagerTests.cs index 8da08842dc7..6f79460b64a 100644 --- a/src/Orchard.Tests/Localization/CultureManagerTests.cs +++ b/src/Orchard.Tests/Localization/CultureManagerTests.cs @@ -1,112 +1,112 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using Autofac; -using Moq; -using NHibernate; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.ContentManagement; -using Orchard.ContentManagement.MetaData; -using Orchard.Data; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.DisplayManagement.Implementation; -using Orchard.Environment; -using Orchard.Localization.Records; -using Orchard.Localization.Services; -using Orchard.Security; -using Orchard.Tests.ContentManagement; -using Orchard.Tests.Stubs; -using Orchard.UI.Notify; - -namespace Orchard.Tests.Localization { - [TestFixture] - public class CultureManagerTests { - private IContainer _container; - private ICultureManager _cultureManager; - private ISessionFactory _sessionFactory; - private ISession _session; - private string _databaseFileName; - private StubWorkContext _stubWorkContext; - - [TestFixtureSetUp] - public void InitFixture() { - _databaseFileName = Path.GetTempFileName(); - _sessionFactory = DataUtility.CreateSessionFactory( - _databaseFileName, - typeof(CultureRecord)); - } - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - _stubWorkContext = new StubWorkContext(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(new Mock().Object); - builder.RegisterInstance(_stubWorkContext); - builder.RegisterInstance(new StubWorkContextAccessor(_stubWorkContext)).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); - _session = _sessionFactory.OpenSession(); - builder.RegisterInstance(new TestTransactionManager(_session)).As(); - _container = builder.Build(); - _cultureManager = _container.Resolve(); - } - - [TearDown] - public void Term() { - _session.Close(); - } - - [TestFixtureTearDown] - public void TermFixture() { - File.Delete(_databaseFileName); - } - - [Test] - public void CultureManagerCanAddAndListValidCultures() { - _cultureManager.AddCulture("tr-TR"); - _cultureManager.AddCulture("fr-FR"); - _cultureManager.AddCulture("bs-Latn-BA"); - List cultures = new List(_cultureManager.ListCultures()); - Assert.That(cultures.Count, Is.Not.EqualTo(0)); - } - - [Test] - public void CultureManagerRejectsInvalidCultureNames() { - Assert.Throws(() => _cultureManager.AddCulture("a-b-c")); - } - - [Test] - public void CultureManagerAcceptsValidDotNetCultureNames() { - foreach (var cultureInfo in CultureInfo.GetCultures(CultureTypes.NeutralCultures)) { - if (!String.IsNullOrEmpty(cultureInfo.Name)) { - Assert.DoesNotThrow(() => _cultureManager.AddCulture(cultureInfo.Name)); - } - } - - foreach (var cultureInfo in CultureInfo.GetCultures(CultureTypes.SpecificCultures)) { - if (!String.IsNullOrEmpty(cultureInfo.Name)) { - Assert.DoesNotThrow(() => _cultureManager.AddCulture(cultureInfo.Name)); - } - } - } - - [Test] - public void CultureManagerReturnsCultureFromWorkContext() { - _stubWorkContext.CultureName = "nl-NL"; - Assert.That(_cultureManager.GetCurrentCulture(null), Is.EqualTo("nl-NL")); - } - } +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using Autofac; +using Moq; +using NHibernate; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.ContentManagement; +using Orchard.ContentManagement.MetaData; +using Orchard.Data; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.DisplayManagement.Implementation; +using Orchard.Environment; +using Orchard.Localization.Records; +using Orchard.Localization.Services; +using Orchard.Security; +using Orchard.Tests.ContentManagement; +using Orchard.Tests.Stubs; +using Orchard.UI.Notify; + +namespace Orchard.Tests.Localization { + [TestFixture] + public class CultureManagerTests { + private IContainer _container; + private ICultureManager _cultureManager; + private ISessionFactory _sessionFactory; + private ISession _session; + private string _databaseFileName; + private StubWorkContext _stubWorkContext; + + [TestFixtureSetUp] + public void InitFixture() { + _databaseFileName = Path.GetTempFileName(); + _sessionFactory = DataUtility.CreateSessionFactory( + _databaseFileName, + typeof(CultureRecord)); + } + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + _stubWorkContext = new StubWorkContext(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(new Mock().Object); + builder.RegisterInstance(_stubWorkContext); + builder.RegisterInstance(new StubWorkContextAccessor(_stubWorkContext)).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); + _session = _sessionFactory.OpenSession(); + builder.RegisterInstance(new TestTransactionManager(_session)).As(); + _container = builder.Build(); + _cultureManager = _container.Resolve(); + } + + [TearDown] + public void Term() { + _session.Close(); + } + + [TestFixtureTearDown] + public void TermFixture() { + File.Delete(_databaseFileName); + } + + [Test] + public void CultureManagerCanAddAndListValidCultures() { + _cultureManager.AddCulture("tr-TR"); + _cultureManager.AddCulture("fr-FR"); + _cultureManager.AddCulture("bs-Latn-BA"); + List cultures = new List(_cultureManager.ListCultures()); + Assert.That(cultures.Count, Is.Not.EqualTo(0)); + } + + [Test] + public void CultureManagerRejectsInvalidCultureNames() { + Assert.Throws(() => _cultureManager.AddCulture("a-b-c")); + } + + [Test] + public void CultureManagerAcceptsValidDotNetCultureNames() { + foreach (var cultureInfo in CultureInfo.GetCultures(CultureTypes.NeutralCultures)) { + if (!String.IsNullOrEmpty(cultureInfo.Name)) { + Assert.DoesNotThrow(() => _cultureManager.AddCulture(cultureInfo.Name)); + } + } + + foreach (var cultureInfo in CultureInfo.GetCultures(CultureTypes.SpecificCultures)) { + if (!String.IsNullOrEmpty(cultureInfo.Name)) { + Assert.DoesNotThrow(() => _cultureManager.AddCulture(cultureInfo.Name)); + } + } + } + + [Test] + public void CultureManagerReturnsCultureFromWorkContext() { + _stubWorkContext.CultureName = "nl-NL"; + Assert.That(_cultureManager.GetCurrentCulture(null), Is.EqualTo("nl-NL")); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Localization/NullLocalizerTests.cs b/src/Orchard.Tests/Localization/NullLocalizerTests.cs index 8b9d04eeb20..f414d538fbe 100644 --- a/src/Orchard.Tests/Localization/NullLocalizerTests.cs +++ b/src/Orchard.Tests/Localization/NullLocalizerTests.cs @@ -1,25 +1,25 @@ -using NUnit.Framework; -using Orchard.Localization; - -namespace Orchard.Tests.Localization { - [TestFixture] - public class NullLocalizerTests { - [Test] - public void StringsShouldPassThrough() { - var result = NullLocalizer.Instance("hello world"); - Assert.That(result.ToString(), Is.EqualTo("hello world")); - } - - [Test] - public void StringsShouldFormatIfArgumentsArePassedIn() { - var result = NullLocalizer.Instance("hello {0} world", "!"); - Assert.That(result.ToString(), Is.EqualTo("hello ! world")); - } - - [Test] - public void StringsShouldNotFormatWithoutAnyArguments() { - var result = NullLocalizer.Instance("hello {0} world"); - Assert.That(result.ToString(), Is.EqualTo("hello {0} world")); - } - } -} +using NUnit.Framework; +using Orchard.Localization; + +namespace Orchard.Tests.Localization { + [TestFixture] + public class NullLocalizerTests { + [Test] + public void StringsShouldPassThrough() { + var result = NullLocalizer.Instance("hello world"); + Assert.That(result.ToString(), Is.EqualTo("hello world")); + } + + [Test] + public void StringsShouldFormatIfArgumentsArePassedIn() { + var result = NullLocalizer.Instance("hello {0} world", "!"); + Assert.That(result.ToString(), Is.EqualTo("hello ! world")); + } + + [Test] + public void StringsShouldNotFormatWithoutAnyArguments() { + var result = NullLocalizer.Instance("hello {0} world"); + Assert.That(result.ToString(), Is.EqualTo("hello {0} world")); + } + } +} diff --git a/src/Orchard.Tests/Logging/LoggingModuleTests.cs b/src/Orchard.Tests/Logging/LoggingModuleTests.cs index a4da0d9aab6..6320fc63379 100644 --- a/src/Orchard.Tests/Logging/LoggingModuleTests.cs +++ b/src/Orchard.Tests/Logging/LoggingModuleTests.cs @@ -1,99 +1,99 @@ -using System; -using System.Collections.Generic; -using Autofac; -using log4net.Appender; -using log4net.Core; -using NUnit.Framework; -using Orchard.Environment; -using Orchard.Logging; -using Orchard.Tests.Environment; -using ILogger = Orchard.Logging.ILogger; -using ILoggerFactory = Orchard.Logging.ILoggerFactory; -using NullLogger = Orchard.Logging.NullLogger; - -namespace Orchard.Tests.Logging { - [TestFixture] - public class LoggingModuleTests { - [Test] - public void LoggingModuleWillSetLoggerProperty() { - var builder = new ContainerBuilder(); - builder.RegisterModule(new LoggingModule()); - builder.RegisterType(); - builder.RegisterType().As(); - var container = builder.Build(); - var thing = container.Resolve(); - Assert.That(thing.Logger, Is.Not.Null); - } - - [Test] - public void LoggerFactoryIsPassedTheTypeOfTheContainingInstance() { - var builder = new ContainerBuilder(); - builder.RegisterModule(new LoggingModule()); - builder.RegisterType(); - var stubFactory = new StubFactory(); - builder.RegisterInstance(stubFactory).As(); - - var container = builder.Build(); - var thing = container.Resolve(); - Assert.That(thing.Logger, Is.Not.Null); - Assert.That(stubFactory.CalledType, Is.EqualTo(typeof(Thing))); - } - - public class StubFactory : ILoggerFactory { - public ILogger CreateLogger(Type type) { - CalledType = type; - return NullLogger.Instance; - } - - public Type CalledType { get; set; } - } - - [Test] - public void DefaultLoggerConfigurationUsesCastleLoggerFactoryOverTraceSource() { - var builder = new ContainerBuilder(); - builder.RegisterModule(new LoggingModule()); - builder.RegisterType(); - builder.RegisterType().As(); - var container = builder.Build(); - - log4net.Config.BasicConfigurator.Configure(new MemoryAppender()); - - var thing = container.Resolve(); - Assert.That(thing.Logger, Is.Not.Null); - - MemoryAppender.Messages.Clear(); - thing.Logger.Error("-boom{0}-", 42); - Assert.That(MemoryAppender.Messages, Has.Some.StringContaining("-boom42-")); - - MemoryAppender.Messages.Clear(); - thing.Logger.Warning(new ApplicationException("problem"), "crash"); - Assert.That(MemoryAppender.Messages, Has.Some.StringContaining("problem")); - Assert.That(MemoryAppender.Messages, Has.Some.StringContaining("crash")); - Assert.That(MemoryAppender.Messages, Has.Some.StringContaining("ApplicationException")); - } - } - - public class Thing { - public ILogger Logger { get; set; } - } - - public class MemoryAppender : IAppender { - static MemoryAppender() { - Messages = new List(); - } - - public static List Messages { get; set; } - - public void DoAppend(LoggingEvent loggingEvent) { - if (loggingEvent.ExceptionObject != null) { - lock (Messages) Messages.Add(string.Format("{0} {1} {2}", - loggingEvent.ExceptionObject.GetType().Name, - loggingEvent.ExceptionObject.Message, - loggingEvent.RenderedMessage)); - } else lock (Messages) Messages.Add(loggingEvent.RenderedMessage); - } - - public void Close() { } - public string Name { get; set; } - } -} +using System; +using System.Collections.Generic; +using Autofac; +using log4net.Appender; +using log4net.Core; +using NUnit.Framework; +using Orchard.Environment; +using Orchard.Logging; +using Orchard.Tests.Environment; +using ILogger = Orchard.Logging.ILogger; +using ILoggerFactory = Orchard.Logging.ILoggerFactory; +using NullLogger = Orchard.Logging.NullLogger; + +namespace Orchard.Tests.Logging { + [TestFixture] + public class LoggingModuleTests { + [Test] + public void LoggingModuleWillSetLoggerProperty() { + var builder = new ContainerBuilder(); + builder.RegisterModule(new LoggingModule()); + builder.RegisterType(); + builder.RegisterType().As(); + var container = builder.Build(); + var thing = container.Resolve(); + Assert.That(thing.Logger, Is.Not.Null); + } + + [Test] + public void LoggerFactoryIsPassedTheTypeOfTheContainingInstance() { + var builder = new ContainerBuilder(); + builder.RegisterModule(new LoggingModule()); + builder.RegisterType(); + var stubFactory = new StubFactory(); + builder.RegisterInstance(stubFactory).As(); + + var container = builder.Build(); + var thing = container.Resolve(); + Assert.That(thing.Logger, Is.Not.Null); + Assert.That(stubFactory.CalledType, Is.EqualTo(typeof(Thing))); + } + + public class StubFactory : ILoggerFactory { + public ILogger CreateLogger(Type type) { + CalledType = type; + return NullLogger.Instance; + } + + public Type CalledType { get; set; } + } + + [Test] + public void DefaultLoggerConfigurationUsesCastleLoggerFactoryOverTraceSource() { + var builder = new ContainerBuilder(); + builder.RegisterModule(new LoggingModule()); + builder.RegisterType(); + builder.RegisterType().As(); + var container = builder.Build(); + + log4net.Config.BasicConfigurator.Configure(new MemoryAppender()); + + var thing = container.Resolve(); + Assert.That(thing.Logger, Is.Not.Null); + + MemoryAppender.Messages.Clear(); + thing.Logger.Error("-boom{0}-", 42); + Assert.That(MemoryAppender.Messages, Has.Some.StringContaining("-boom42-")); + + MemoryAppender.Messages.Clear(); + thing.Logger.Warning(new ApplicationException("problem"), "crash"); + Assert.That(MemoryAppender.Messages, Has.Some.StringContaining("problem")); + Assert.That(MemoryAppender.Messages, Has.Some.StringContaining("crash")); + Assert.That(MemoryAppender.Messages, Has.Some.StringContaining("ApplicationException")); + } + } + + public class Thing { + public ILogger Logger { get; set; } + } + + public class MemoryAppender : IAppender { + static MemoryAppender() { + Messages = new List(); + } + + public static List Messages { get; set; } + + public void DoAppend(LoggingEvent loggingEvent) { + if (loggingEvent.ExceptionObject != null) { + lock (Messages) Messages.Add(string.Format("{0} {1} {2}", + loggingEvent.ExceptionObject.GetType().Name, + loggingEvent.ExceptionObject.Message, + loggingEvent.RenderedMessage)); + } else lock (Messages) Messages.Add(loggingEvent.RenderedMessage); + } + + public void Close() { } + public string Name { get; set; } + } +} diff --git a/src/Orchard.Tests/Logging/OrchardFileAppenderTests.cs b/src/Orchard.Tests/Logging/OrchardFileAppenderTests.cs index ad389db47de..87303309a90 100644 --- a/src/Orchard.Tests/Logging/OrchardFileAppenderTests.cs +++ b/src/Orchard.Tests/Logging/OrchardFileAppenderTests.cs @@ -1,59 +1,59 @@ -using System; -using log4net.Util; -using Moq; -using Moq.Protected; -using NUnit.Framework; -using Orchard.Logging; - -namespace Orchard.Tests.Logging { - [TestFixture] - public class OrchardFileAppenderTests { - [Test] - public void AddSuffixTest() { - const string filename = "Orchard-debug"; - const string filenameAlternative1 = "Orchard-debug-1"; - const string filenameAlternative2 = "Orchard-debug-2"; - - string filenameUsed = string.Empty; - - // Set logging to quiet mode - LogLog.QuietMode = true; - - Mock firstOrchardFileAppenderMock = new Mock(); - StubOrchardFileAppender firstOrchardFileAppender = firstOrchardFileAppenderMock.Object; - - // Regular filename should be used if nothing is locked - firstOrchardFileAppenderMock.Protected().Setup("BaseOpenFile", ItExpr.Is(file => file.Equals(filename)), ItExpr.IsAny()).Callback( - (file, append) => filenameUsed = file); - - firstOrchardFileAppender.OpenFileStub(filename, true); - - Assert.That(filenameUsed, Is.EqualTo(filename)); - - // Alternative 1 should be used if regular filename is locked - - firstOrchardFileAppenderMock.Protected().Setup("BaseOpenFile", ItExpr.Is(file => file.Equals(filename)), ItExpr.IsAny()).Throws(new Exception()); - firstOrchardFileAppenderMock.Protected().Setup("BaseOpenFile", ItExpr.Is(file => file.Equals(filenameAlternative1)), ItExpr.IsAny()).Callback( - (file, append) => filenameUsed = file); - - firstOrchardFileAppender.OpenFileStub(filename, true); - - Assert.That(filenameUsed, Is.EqualTo(filenameAlternative1)); - - // make alternative 1 also throw exception to make sure alternative 2 is used. - firstOrchardFileAppenderMock.Protected().Setup("BaseOpenFile", ItExpr.Is(file => file.Equals(filenameAlternative1)), ItExpr.IsAny()).Throws(new Exception()); - firstOrchardFileAppenderMock.Protected().Setup("BaseOpenFile", ItExpr.Is(file => file.Equals(filenameAlternative2)), ItExpr.IsAny()).Callback( - (file, append) => filenameUsed = file); - - firstOrchardFileAppender.OpenFileStub(filename, true); - - Assert.That(filenameUsed, Is.EqualTo(filenameAlternative2)); - } - - public class StubOrchardFileAppender : OrchardFileAppender { - public void OpenFileStub(string fileName, bool append) { - base.OpenFile(fileName, append); - } - } - } -} +using System; +using log4net.Util; +using Moq; +using Moq.Protected; +using NUnit.Framework; +using Orchard.Logging; + +namespace Orchard.Tests.Logging { + [TestFixture] + public class OrchardFileAppenderTests { + [Test] + public void AddSuffixTest() { + const string filename = "Orchard-debug"; + const string filenameAlternative1 = "Orchard-debug-1"; + const string filenameAlternative2 = "Orchard-debug-2"; + + string filenameUsed = string.Empty; + + // Set logging to quiet mode + LogLog.QuietMode = true; + + Mock firstOrchardFileAppenderMock = new Mock(); + StubOrchardFileAppender firstOrchardFileAppender = firstOrchardFileAppenderMock.Object; + + // Regular filename should be used if nothing is locked + firstOrchardFileAppenderMock.Protected().Setup("BaseOpenFile", ItExpr.Is(file => file.Equals(filename)), ItExpr.IsAny()).Callback( + (file, append) => filenameUsed = file); + + firstOrchardFileAppender.OpenFileStub(filename, true); + + Assert.That(filenameUsed, Is.EqualTo(filename)); + + // Alternative 1 should be used if regular filename is locked + + firstOrchardFileAppenderMock.Protected().Setup("BaseOpenFile", ItExpr.Is(file => file.Equals(filename)), ItExpr.IsAny()).Throws(new Exception()); + firstOrchardFileAppenderMock.Protected().Setup("BaseOpenFile", ItExpr.Is(file => file.Equals(filenameAlternative1)), ItExpr.IsAny()).Callback( + (file, append) => filenameUsed = file); + + firstOrchardFileAppender.OpenFileStub(filename, true); + + Assert.That(filenameUsed, Is.EqualTo(filenameAlternative1)); + + // make alternative 1 also throw exception to make sure alternative 2 is used. + firstOrchardFileAppenderMock.Protected().Setup("BaseOpenFile", ItExpr.Is(file => file.Equals(filenameAlternative1)), ItExpr.IsAny()).Throws(new Exception()); + firstOrchardFileAppenderMock.Protected().Setup("BaseOpenFile", ItExpr.Is(file => file.Equals(filenameAlternative2)), ItExpr.IsAny()).Callback( + (file, append) => filenameUsed = file); + + firstOrchardFileAppender.OpenFileStub(filename, true); + + Assert.That(filenameUsed, Is.EqualTo(filenameAlternative2)); + } + + public class StubOrchardFileAppender : OrchardFileAppender { + public void OpenFileStub(string fileName, bool append) { + base.OpenFile(fileName, append); + } + } + } +} diff --git a/src/Orchard.Tests/Messaging/MessagingChannelStub.cs b/src/Orchard.Tests/Messaging/MessagingChannelStub.cs index 0052315f91d..380e28dcdf2 100644 --- a/src/Orchard.Tests/Messaging/MessagingChannelStub.cs +++ b/src/Orchard.Tests/Messaging/MessagingChannelStub.cs @@ -1,17 +1,17 @@ -using System.Collections.Generic; -using Orchard.Messaging.Services; -using Orchard.Messaging.Models; - -namespace Orchard.Tests.Messaging { - public class MessagingChannelStub : IMessageChannel { - public List> Messages { get; private set; } - - public MessagingChannelStub() { - Messages = new List>(); - } - - public void Process(IDictionary parameters) { - Messages.Add(parameters); - } - } -} +using System.Collections.Generic; +using Orchard.Messaging.Services; +using Orchard.Messaging.Models; + +namespace Orchard.Tests.Messaging { + public class MessagingChannelStub : IMessageChannel { + public List> Messages { get; private set; } + + public MessagingChannelStub() { + Messages = new List>(); + } + + public void Process(IDictionary parameters) { + Messages.Add(parameters); + } + } +} diff --git a/src/Orchard.Tests/Mvc/Html/HtmlHelperExtensionsTests.cs b/src/Orchard.Tests/Mvc/Html/HtmlHelperExtensionsTests.cs index 31f55cd3cc4..312068ebd13 100644 --- a/src/Orchard.Tests/Mvc/Html/HtmlHelperExtensionsTests.cs +++ b/src/Orchard.Tests/Mvc/Html/HtmlHelperExtensionsTests.cs @@ -1,227 +1,227 @@ -using System.IO; -using System.Web; -using System.Web.Mvc; -using System.Web.Mvc.Html; -using Moq; -using NUnit.Framework; -using Orchard.Mvc.Html; -using System.Collections.Generic; - -namespace Orchard.Tests.Mvc.Html { - [TestFixture] - public class HtmlHelperExtensionsTests { - [Test] - public void LinkReturnsIHtmlString() { - //arrange - var viewContext = new ViewContext(); - var viewDataContainer = new Mock(); - var html = new HtmlHelper(viewContext, viewDataContainer.Object); - - //act - var result = html.Link("test", "http://example.com") as IHtmlString; - - //assert - Assert.IsNotNull(result); - } - - [Test] - public void LinkHtmlEncodesLinkText() { - //arrange - var viewContext = new ViewContext(); - var viewDataContainer = new Mock(); - var html = new HtmlHelper(viewContext, viewDataContainer.Object); - - //act - var result = html.Link("
      ", "http://example.com"); - - //assert - Assert.AreEqual(@"<br />", result.ToString()); - } - - [Test] - public void LinkHtmlAttributeEncodesHref() { - //arrange - var viewContext = new ViewContext(); - var viewDataContainer = new Mock(); - var html = new HtmlHelper(viewContext, viewDataContainer.Object); - - //act - var result = html.Link("test", "
      "); - - //assert - Assert.AreEqual(@""">test", result.ToString()); - } - - [Test] - public void LinkHtmlAttributeEncodesAttributes() { - //arrange - var viewContext = new ViewContext(); - var viewDataContainer = new Mock(); - var html = new HtmlHelper(viewContext, viewDataContainer.Object); - - //act - var result = html.Link("linkText", "http://example.com", new { title = "
      " }); - - //assert - Assert.AreEqual(@""">linkText", result.ToString()); - } - - [Test] - public void LinkOrDefaultReturnsIHtmlString() { - //arrange - var viewContext = new ViewContext(); - var viewDataContainer = new Mock(); - var html = new HtmlHelper(viewContext, viewDataContainer.Object); - - //act - var result = html.LinkOrDefault("test", "http://example.com") as IHtmlString; - - //assert - Assert.IsNotNull(result); - } - - [Test] - public void LinkOrDefaultHtmlEncodesLinkText() { - //arrange - var viewContext = new ViewContext(); - var viewDataContainer = new Mock(); - var html = new HtmlHelper(viewContext, viewDataContainer.Object); - - //act - var result = html.LinkOrDefault("
      ", "http://example.com"); - - //assert - Assert.AreEqual(@"<br />", result.ToString()); - } - - [Test] - public void LinkOrDefaultWithoutHrefHtmlEncodesLinkText() { - //arrange - var viewContext = new ViewContext(); - var viewDataContainer = new Mock(); - var html = new HtmlHelper(viewContext, viewDataContainer.Object); - - //act - var result = html.LinkOrDefault("
      ", null); - - //assert - Assert.AreEqual(@"<br />", result.ToString()); - } - - [Test] - public void LinkOrDefaultWithHrefHtmlAttributeEncodesHref() { - //arrange - var viewContext = new ViewContext(); - var viewDataContainer = new Mock(); - var html = new HtmlHelper(viewContext, viewDataContainer.Object); - - //act - var result = html.LinkOrDefault("test", "
      "); - - //assert - Assert.AreEqual(@""">test", result.ToString()); - } - - [Test] - public void SelectOptionHtmlEncodesText() { - //arrange - var viewContext = new ViewContext(); - var viewDataContainer = new Mock(); - var html = new HtmlHelper(viewContext, viewDataContainer.Object); - - //act - var result = html.SelectOption("value", false, "
      "); - - //assert - Assert.AreEqual(@"", result.ToString()); - } - - [Test] - public void UnorderedListWithNullItemsReturnsEmptyHtmlString() { - //arrange - var viewContext = new ViewContext(); - var viewDataContainer = new Mock(); - var html = new HtmlHelper(viewContext, viewDataContainer.Object); - - //act - var result = html.UnorderedList((IEnumerable)null, (a, b) => MvcHtmlString.Create(""), "test"); - - //assert - Assert.AreEqual(string.Empty, result.ToString()); - } - - [Test] - public void UnorderedListWithEmptyItemsReturnsEmptyHtmlString() { - //arrange - var viewContext = new ViewContext(); - var viewDataContainer = new Mock(); - var html = new HtmlHelper(viewContext, viewDataContainer.Object); - - //act - var result = html.UnorderedList(new string[] { }, (a, b) => MvcHtmlString.Create(""), "test"); - - //assert - Assert.AreEqual(string.Empty, result.ToString()); - } - - [Test] - public void HtmlHelperForEnablesLocalHelperMethods() { - //arrange - var controller = new FooController { - ControllerContext = new ControllerContext() - }; - var viewContext = new ViewContext { - ViewData = new ViewDataDictionary { - TemplateInfo = new TemplateInfo { - HtmlFieldPrefix = "topprefix" - } - }, - Controller = controller, - View = new Mock().Object, - TempData = new TempDataDictionary(), - Writer = TextWriter.Null - }; - var viewDataContainer = new Mock(); - viewDataContainer.SetupGet(o => o.ViewData).Returns(() => new ViewDataDictionary()); - var html = new HtmlHelper(viewContext, viewDataContainer.Object); - var localHelper = html.HtmlHelperFor(new {SomeString = "foo"}, "prefix"); - - //act - var result = localHelper.LabelFor(p => p.SomeString, "bar", null); - - //assert - Assert.AreEqual(@"", result.ToString()); - } - private class FooController : Controller { } - - [Test] - public void Ellipsize_DontCutHtmlEncodedChars() { - //arrange - var viewContext = new ViewContext(); - var viewDataContainer = new Mock(); - var html = new HtmlHelper(viewContext, viewDataContainer.Object); - - //act - var result = html.Ellipsize("foo & bar", 5); - - //assert - Assert.AreEqual("foo & \u2026", result.ToString()); - - } - - [Test] - public void Excerpt_DontCutHtmlEncodedChars() { - //arrange - var viewContext = new ViewContext(); - var viewDataContainer = new Mock(); - var html = new HtmlHelper(viewContext, viewDataContainer.Object); - - //act - var result = html.Excerpt("

      foo & bar

      ", 7); - - //assert - Assert.AreEqual("foo & \u2026", result.ToString()); - - } - } -} +using System.IO; +using System.Web; +using System.Web.Mvc; +using System.Web.Mvc.Html; +using Moq; +using NUnit.Framework; +using Orchard.Mvc.Html; +using System.Collections.Generic; + +namespace Orchard.Tests.Mvc.Html { + [TestFixture] + public class HtmlHelperExtensionsTests { + [Test] + public void LinkReturnsIHtmlString() { + //arrange + var viewContext = new ViewContext(); + var viewDataContainer = new Mock(); + var html = new HtmlHelper(viewContext, viewDataContainer.Object); + + //act + var result = html.Link("test", "http://example.com") as IHtmlString; + + //assert + Assert.IsNotNull(result); + } + + [Test] + public void LinkHtmlEncodesLinkText() { + //arrange + var viewContext = new ViewContext(); + var viewDataContainer = new Mock(); + var html = new HtmlHelper(viewContext, viewDataContainer.Object); + + //act + var result = html.Link("
      ", "http://example.com"); + + //assert + Assert.AreEqual(@"<br />", result.ToString()); + } + + [Test] + public void LinkHtmlAttributeEncodesHref() { + //arrange + var viewContext = new ViewContext(); + var viewDataContainer = new Mock(); + var html = new HtmlHelper(viewContext, viewDataContainer.Object); + + //act + var result = html.Link("test", "
      "); + + //assert + Assert.AreEqual(@""">test", result.ToString()); + } + + [Test] + public void LinkHtmlAttributeEncodesAttributes() { + //arrange + var viewContext = new ViewContext(); + var viewDataContainer = new Mock(); + var html = new HtmlHelper(viewContext, viewDataContainer.Object); + + //act + var result = html.Link("linkText", "http://example.com", new { title = "
      " }); + + //assert + Assert.AreEqual(@""">linkText", result.ToString()); + } + + [Test] + public void LinkOrDefaultReturnsIHtmlString() { + //arrange + var viewContext = new ViewContext(); + var viewDataContainer = new Mock(); + var html = new HtmlHelper(viewContext, viewDataContainer.Object); + + //act + var result = html.LinkOrDefault("test", "http://example.com") as IHtmlString; + + //assert + Assert.IsNotNull(result); + } + + [Test] + public void LinkOrDefaultHtmlEncodesLinkText() { + //arrange + var viewContext = new ViewContext(); + var viewDataContainer = new Mock(); + var html = new HtmlHelper(viewContext, viewDataContainer.Object); + + //act + var result = html.LinkOrDefault("
      ", "http://example.com"); + + //assert + Assert.AreEqual(@"<br />", result.ToString()); + } + + [Test] + public void LinkOrDefaultWithoutHrefHtmlEncodesLinkText() { + //arrange + var viewContext = new ViewContext(); + var viewDataContainer = new Mock(); + var html = new HtmlHelper(viewContext, viewDataContainer.Object); + + //act + var result = html.LinkOrDefault("
      ", null); + + //assert + Assert.AreEqual(@"<br />", result.ToString()); + } + + [Test] + public void LinkOrDefaultWithHrefHtmlAttributeEncodesHref() { + //arrange + var viewContext = new ViewContext(); + var viewDataContainer = new Mock(); + var html = new HtmlHelper(viewContext, viewDataContainer.Object); + + //act + var result = html.LinkOrDefault("test", "
      "); + + //assert + Assert.AreEqual(@""">test", result.ToString()); + } + + [Test] + public void SelectOptionHtmlEncodesText() { + //arrange + var viewContext = new ViewContext(); + var viewDataContainer = new Mock(); + var html = new HtmlHelper(viewContext, viewDataContainer.Object); + + //act + var result = html.SelectOption("value", false, "
      "); + + //assert + Assert.AreEqual(@"", result.ToString()); + } + + [Test] + public void UnorderedListWithNullItemsReturnsEmptyHtmlString() { + //arrange + var viewContext = new ViewContext(); + var viewDataContainer = new Mock(); + var html = new HtmlHelper(viewContext, viewDataContainer.Object); + + //act + var result = html.UnorderedList((IEnumerable)null, (a, b) => MvcHtmlString.Create(""), "test"); + + //assert + Assert.AreEqual(string.Empty, result.ToString()); + } + + [Test] + public void UnorderedListWithEmptyItemsReturnsEmptyHtmlString() { + //arrange + var viewContext = new ViewContext(); + var viewDataContainer = new Mock(); + var html = new HtmlHelper(viewContext, viewDataContainer.Object); + + //act + var result = html.UnorderedList(new string[] { }, (a, b) => MvcHtmlString.Create(""), "test"); + + //assert + Assert.AreEqual(string.Empty, result.ToString()); + } + + [Test] + public void HtmlHelperForEnablesLocalHelperMethods() { + //arrange + var controller = new FooController { + ControllerContext = new ControllerContext() + }; + var viewContext = new ViewContext { + ViewData = new ViewDataDictionary { + TemplateInfo = new TemplateInfo { + HtmlFieldPrefix = "topprefix" + } + }, + Controller = controller, + View = new Mock().Object, + TempData = new TempDataDictionary(), + Writer = TextWriter.Null + }; + var viewDataContainer = new Mock(); + viewDataContainer.SetupGet(o => o.ViewData).Returns(() => new ViewDataDictionary()); + var html = new HtmlHelper(viewContext, viewDataContainer.Object); + var localHelper = html.HtmlHelperFor(new {SomeString = "foo"}, "prefix"); + + //act + var result = localHelper.LabelFor(p => p.SomeString, "bar", null); + + //assert + Assert.AreEqual(@"", result.ToString()); + } + private class FooController : Controller { } + + [Test] + public void Ellipsize_DontCutHtmlEncodedChars() { + //arrange + var viewContext = new ViewContext(); + var viewDataContainer = new Mock(); + var html = new HtmlHelper(viewContext, viewDataContainer.Object); + + //act + var result = html.Ellipsize("foo & bar", 5); + + //assert + Assert.AreEqual("foo & \u2026", result.ToString()); + + } + + [Test] + public void Excerpt_DontCutHtmlEncodedChars() { + //arrange + var viewContext = new ViewContext(); + var viewDataContainer = new Mock(); + var html = new HtmlHelper(viewContext, viewDataContainer.Object); + + //act + var result = html.Excerpt("

      foo & bar

      ", 7); + + //assert + Assert.AreEqual("foo & \u2026", result.ToString()); + + } + } +} diff --git a/src/Orchard.Tests/Mvc/OrchardControllerFactoryTests.cs b/src/Orchard.Tests/Mvc/OrchardControllerFactoryTests.cs index 8951bd60a77..9867d42347b 100644 --- a/src/Orchard.Tests/Mvc/OrchardControllerFactoryTests.cs +++ b/src/Orchard.Tests/Mvc/OrchardControllerFactoryTests.cs @@ -1,162 +1,162 @@ -using System; -using System.Linq; -using System.Reflection; -using System.Web.Mvc; -using System.Web.Routing; -using NUnit.Framework; -using Orchard.Environment.Extensions.Models; -using Orchard.Mvc; -using Orchard.Tests.DisplayManagement; -using Orchard.Tests.Stubs; -using Autofac; - -namespace Orchard.Tests.Mvc { - [TestFixture] - public class OrchardControllerFactoryTests { - private OrchardControllerFactory _controllerFactory; - private IWorkContextAccessor _workContextAccessor; - private StubContainerProvider _containerProvider; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - builder.RegisterType() - .Keyed("/foo") - .Keyed(typeof(FooController)) - .WithMetadata("ControllerType", typeof(FooController)) - .InstancePerDependency(); - - builder.RegisterType() - .Keyed("/bar") - .Keyed(typeof(BarController)) - .WithMetadata("ControllerType", typeof(BarController)) - .InstancePerDependency(); - - builder.RegisterType() - .Keyed("/foo") - .Keyed(typeof(ReplacementFooController)) - .WithMetadata("ControllerType", typeof(ReplacementFooController)) - .InstancePerDependency(); - - var container = builder.Build(); - _containerProvider = new StubContainerProvider(container, container.BeginLifetimeScope()); - - var workContext = new DefaultDisplayManagerTests.TestWorkContext - { - CurrentTheme = new ExtensionDescriptor { Id = "Hello" }, - ContainerProvider = _containerProvider - }; - _workContextAccessor = new DefaultDisplayManagerTests.TestWorkContextAccessor(workContext); - - _controllerFactory = new OrchardControllerFactory(); - InjectKnownControllerTypes(_controllerFactory, typeof(ReplacementFooController), typeof (FooController), typeof (BarController)); - } - - [Test] - public void IContainerProvidersRequestContainerFromRouteDataShouldUseTokenWhenPresent() { - var requestContext = GetRequestContext(_workContextAccessor); - var controller = _controllerFactory.CreateController(requestContext, "foo"); - - Assert.That(controller, Is.TypeOf()); - } - - [Test, Ignore("OrchardControllerFactory depends on metadata, calling base when no context is causing errors.")] - public void WhenNullOrMissingContainerNormalControllerFactoryRulesShouldBeUsedAsFallback() { - var requestContext = GetRequestContext(null); - var controller = _controllerFactory.CreateController(requestContext, "foo"); - - Assert.That(controller, Is.TypeOf()); - } - - [Test] - public void WhenContainerIsPresentButNamedControllerIsNotResolvedNormalControllerFactoryRulesShouldBeUsedAsFallback() { - var requestContext = GetRequestContext(_workContextAccessor); - var controller = _controllerFactory.CreateController(requestContext, "bar"); - - Assert.That(controller, Is.TypeOf()); - } - - [Test] - public void DisposingControllerThatCameFromContainerShouldNotCauseProblemWhenContainerIsDisposed() { - var requestContext = GetRequestContext(_workContextAccessor); - var controller = _controllerFactory.CreateController(requestContext, "foo"); - - Assert.That(controller, Is.TypeOf()); - - _controllerFactory.ReleaseController(controller); - _containerProvider.EndRequestLifetime(); - - // explicitly dispose a few more, just to make sure it's getting hit from all different directions - ((IDisposable) controller).Dispose(); - ((ReplacementFooController) controller).Dispose(); - - Assert.That(((ReplacementFooController) controller).Disposals, Is.EqualTo(4)); - } - - [Test] - public void NullServiceKeyReturnsDefault() { - OrchardControllerFactoryAccessor orchardControllerFactory = new OrchardControllerFactoryAccessor(); - ReplacementFooController fooController; - - Assert.That(orchardControllerFactory.TryResolveAccessor(_workContextAccessor.GetContext(), null, out fooController), Is.False); - Assert.That(fooController, Is.Null); - } - - private static RequestContext GetRequestContext(IWorkContextAccessor workContextAccessor) - { - var handler = new MvcRouteHandler(); - var route = new Route("yadda", handler) { - DataTokens = - new RouteValueDictionary { { "IWorkContextAccessor", workContextAccessor } } - }; - - var httpContext = new StubHttpContext(); - var routeData = route.GetRouteData(httpContext); - return new RequestContext(httpContext, routeData); - } - - public class FooController : Controller { } - - public class BarController : Controller { } - - public class ReplacementFooController : Controller { - protected override void Dispose(bool disposing) { - ++Disposals; - - base.Dispose(disposing); - } - - public int Disposals { get; set; } - } - - internal class OrchardControllerFactoryAccessor : OrchardControllerFactory { - public bool TryResolveAccessor(WorkContext workContext, object serviceKey, out T instance) { - return TryResolve(workContext, serviceKey, out instance); - } - } - - private static void InjectKnownControllerTypes(DefaultControllerFactory controllerFactory, - params Type[] controllerTypes) { - // D'oh!!! Hey MVC people, how is this testable? ;) - - // locate the appropriate reflection member info - var controllerTypeCacheProperty = controllerFactory.GetType() - .GetProperty("ControllerTypeCache", BindingFlags.Instance | BindingFlags.NonPublic); - var cacheField = controllerTypeCacheProperty.PropertyType.GetField("_cache", - BindingFlags.NonPublic | - BindingFlags.Instance); - - // turn the array into the correct collection - var cache = controllerTypes - .GroupBy(t => t.Name.Substring(0, t.Name.Length - "Controller".Length), StringComparer.OrdinalIgnoreCase) - .ToDictionary(g => g.Key, - g => g.ToLookup(t => t.Namespace ?? string.Empty, StringComparer.OrdinalIgnoreCase), - StringComparer.OrdinalIgnoreCase); - - // execute: controllerFactory.ControllerTypeCache._cache = cache; - cacheField.SetValue( - controllerTypeCacheProperty.GetValue(controllerFactory, null), - cache); - } - } +using System; +using System.Linq; +using System.Reflection; +using System.Web.Mvc; +using System.Web.Routing; +using NUnit.Framework; +using Orchard.Environment.Extensions.Models; +using Orchard.Mvc; +using Orchard.Tests.DisplayManagement; +using Orchard.Tests.Stubs; +using Autofac; + +namespace Orchard.Tests.Mvc { + [TestFixture] + public class OrchardControllerFactoryTests { + private OrchardControllerFactory _controllerFactory; + private IWorkContextAccessor _workContextAccessor; + private StubContainerProvider _containerProvider; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + builder.RegisterType() + .Keyed("/foo") + .Keyed(typeof(FooController)) + .WithMetadata("ControllerType", typeof(FooController)) + .InstancePerDependency(); + + builder.RegisterType() + .Keyed("/bar") + .Keyed(typeof(BarController)) + .WithMetadata("ControllerType", typeof(BarController)) + .InstancePerDependency(); + + builder.RegisterType() + .Keyed("/foo") + .Keyed(typeof(ReplacementFooController)) + .WithMetadata("ControllerType", typeof(ReplacementFooController)) + .InstancePerDependency(); + + var container = builder.Build(); + _containerProvider = new StubContainerProvider(container, container.BeginLifetimeScope()); + + var workContext = new DefaultDisplayManagerTests.TestWorkContext + { + CurrentTheme = new ExtensionDescriptor { Id = "Hello" }, + ContainerProvider = _containerProvider + }; + _workContextAccessor = new DefaultDisplayManagerTests.TestWorkContextAccessor(workContext); + + _controllerFactory = new OrchardControllerFactory(); + InjectKnownControllerTypes(_controllerFactory, typeof(ReplacementFooController), typeof (FooController), typeof (BarController)); + } + + [Test] + public void IContainerProvidersRequestContainerFromRouteDataShouldUseTokenWhenPresent() { + var requestContext = GetRequestContext(_workContextAccessor); + var controller = _controllerFactory.CreateController(requestContext, "foo"); + + Assert.That(controller, Is.TypeOf()); + } + + [Test, Ignore("OrchardControllerFactory depends on metadata, calling base when no context is causing errors.")] + public void WhenNullOrMissingContainerNormalControllerFactoryRulesShouldBeUsedAsFallback() { + var requestContext = GetRequestContext(null); + var controller = _controllerFactory.CreateController(requestContext, "foo"); + + Assert.That(controller, Is.TypeOf()); + } + + [Test] + public void WhenContainerIsPresentButNamedControllerIsNotResolvedNormalControllerFactoryRulesShouldBeUsedAsFallback() { + var requestContext = GetRequestContext(_workContextAccessor); + var controller = _controllerFactory.CreateController(requestContext, "bar"); + + Assert.That(controller, Is.TypeOf()); + } + + [Test] + public void DisposingControllerThatCameFromContainerShouldNotCauseProblemWhenContainerIsDisposed() { + var requestContext = GetRequestContext(_workContextAccessor); + var controller = _controllerFactory.CreateController(requestContext, "foo"); + + Assert.That(controller, Is.TypeOf()); + + _controllerFactory.ReleaseController(controller); + _containerProvider.EndRequestLifetime(); + + // explicitly dispose a few more, just to make sure it's getting hit from all different directions + ((IDisposable) controller).Dispose(); + ((ReplacementFooController) controller).Dispose(); + + Assert.That(((ReplacementFooController) controller).Disposals, Is.EqualTo(4)); + } + + [Test] + public void NullServiceKeyReturnsDefault() { + OrchardControllerFactoryAccessor orchardControllerFactory = new OrchardControllerFactoryAccessor(); + ReplacementFooController fooController; + + Assert.That(orchardControllerFactory.TryResolveAccessor(_workContextAccessor.GetContext(), null, out fooController), Is.False); + Assert.That(fooController, Is.Null); + } + + private static RequestContext GetRequestContext(IWorkContextAccessor workContextAccessor) + { + var handler = new MvcRouteHandler(); + var route = new Route("yadda", handler) { + DataTokens = + new RouteValueDictionary { { "IWorkContextAccessor", workContextAccessor } } + }; + + var httpContext = new StubHttpContext(); + var routeData = route.GetRouteData(httpContext); + return new RequestContext(httpContext, routeData); + } + + public class FooController : Controller { } + + public class BarController : Controller { } + + public class ReplacementFooController : Controller { + protected override void Dispose(bool disposing) { + ++Disposals; + + base.Dispose(disposing); + } + + public int Disposals { get; set; } + } + + internal class OrchardControllerFactoryAccessor : OrchardControllerFactory { + public bool TryResolveAccessor(WorkContext workContext, object serviceKey, out T instance) { + return TryResolve(workContext, serviceKey, out instance); + } + } + + private static void InjectKnownControllerTypes(DefaultControllerFactory controllerFactory, + params Type[] controllerTypes) { + // D'oh!!! Hey MVC people, how is this testable? ;) + + // locate the appropriate reflection member info + var controllerTypeCacheProperty = controllerFactory.GetType() + .GetProperty("ControllerTypeCache", BindingFlags.Instance | BindingFlags.NonPublic); + var cacheField = controllerTypeCacheProperty.PropertyType.GetField("_cache", + BindingFlags.NonPublic | + BindingFlags.Instance); + + // turn the array into the correct collection + var cache = controllerTypes + .GroupBy(t => t.Name.Substring(0, t.Name.Length - "Controller".Length), StringComparer.OrdinalIgnoreCase) + .ToDictionary(g => g.Key, + g => g.ToLookup(t => t.Namespace ?? string.Empty, StringComparer.OrdinalIgnoreCase), + StringComparer.OrdinalIgnoreCase); + + // execute: controllerFactory.ControllerTypeCache._cache = cache; + cacheField.SetValue( + controllerTypeCacheProperty.GetValue(controllerFactory, null), + cache); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Mvc/RouteCollectionPublisherTests.cs b/src/Orchard.Tests/Mvc/RouteCollectionPublisherTests.cs index e6529452f2f..2bfadcc03a2 100644 --- a/src/Orchard.Tests/Mvc/RouteCollectionPublisherTests.cs +++ b/src/Orchard.Tests/Mvc/RouteCollectionPublisherTests.cs @@ -1,109 +1,109 @@ -using System; -using System.Linq; -using System.Threading; -using System.Web.Mvc; -using System.Web.Routing; -using Autofac; -using NUnit.Framework; -using Orchard.Environment; -using Orchard.Environment.Configuration; -using Orchard.Mvc.Routes; -using Orchard.Tests.Utility; - -namespace Orchard.Tests.Mvc { - [TestFixture] - public class RouteCollectionPublisherTests { - private IContainer _container; - private RouteCollection _routes; - - static RouteDescriptor Desc(string name, string url) { - return new RouteDescriptor { Name = name, Route = new Route(url, new MvcRouteHandler()) }; - } - - [SetUp] - public void Init() { - _routes = new RouteCollection(); - - var builder = new ContainerBuilder(); - builder.RegisterType().As(); - builder.RegisterType().InstancePerDependency(); - builder.Register(ctx => _routes); - builder.Register(ctx => new ShellSettings { Name = ShellSettings.DefaultName }); - builder.RegisterAutoMocking(); - _container = builder.Build(); - } - - [Test] - public void RoutesCanHaveNullOrEmptyNames() { - _routes.MapRoute("foo", "{controller}"); - - var publisher = _container.Resolve(); - publisher.Publish(new[] { Desc(null, "bar"), Desc(string.Empty, "quux") }); - - Assert.That(_routes.Count(), Is.EqualTo(3)); - } - - [Test] - [ExpectedException(typeof(ArgumentException))] - public void SameNameTwiceCausesExplosion() { - _routes.MapRoute("foo", "{controller}"); - - var publisher = _container.Resolve(); - publisher.Publish(new[] { Desc("yarg", "bar"), Desc("yarg", "quux") }); - - Assert.That(_routes.Count(), Is.EqualTo(2)); - } - - - [Test] - public void ExplosionLeavesOriginalRoutesIntact() { - _routes.MapRoute("foo", "{controller}"); - - var publisher = _container.Resolve(); - try { - publisher.Publish(new[] { Desc("yarg", "bar"), Desc("yarg", "quux") }); - } - catch (ArgumentException) { - Assert.That(_routes.Count(), Is.EqualTo(1)); - Assert.That(_routes.OfType().Single().Url, Is.EqualTo("{controller}")); - } - } - - [Test] - public void WriteBlocksWhileReadIsInEffect() { - _routes.MapRoute("foo", "{controller}"); - - var publisher = _container.Resolve(); - - var readLock = _routes.GetReadLock(); - - string where = "init"; - var action = new Action(() => { - where = "before"; - publisher.Publish(new[] { Desc("barname", "bar"), Desc("quuxname", "quux") }); - where = "after"; - }); - - Assert.That(where, Is.EqualTo("init")); - var asyncResult = action.BeginInvoke(null, null); - Thread.Sleep(75); - Assert.That(where, Is.EqualTo("before")); - readLock.Dispose(); - Thread.Sleep(75); - Assert.That(where, Is.EqualTo("after")); - action.EndInvoke(asyncResult); - } - - [Test] - public void RouteDescriptorWithNameCreatesNamedRouteInCollection() { - _routes.MapRoute("foo", "{controller}"); - - var publisher = _container.Resolve(); - var routeDescriptor = Desc("yarg", "bar"); - publisher.Publish(new[] { routeDescriptor }); - - Assert.That(_routes["yarg"], Is.Not.Null); - } - } -} - +using System; +using System.Linq; +using System.Threading; +using System.Web.Mvc; +using System.Web.Routing; +using Autofac; +using NUnit.Framework; +using Orchard.Environment; +using Orchard.Environment.Configuration; +using Orchard.Mvc.Routes; +using Orchard.Tests.Utility; + +namespace Orchard.Tests.Mvc { + [TestFixture] + public class RouteCollectionPublisherTests { + private IContainer _container; + private RouteCollection _routes; + + static RouteDescriptor Desc(string name, string url) { + return new RouteDescriptor { Name = name, Route = new Route(url, new MvcRouteHandler()) }; + } + + [SetUp] + public void Init() { + _routes = new RouteCollection(); + + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + builder.RegisterType().InstancePerDependency(); + builder.Register(ctx => _routes); + builder.Register(ctx => new ShellSettings { Name = ShellSettings.DefaultName }); + builder.RegisterAutoMocking(); + _container = builder.Build(); + } + + [Test] + public void RoutesCanHaveNullOrEmptyNames() { + _routes.MapRoute("foo", "{controller}"); + + var publisher = _container.Resolve(); + publisher.Publish(new[] { Desc(null, "bar"), Desc(string.Empty, "quux") }); + + Assert.That(_routes.Count(), Is.EqualTo(3)); + } + + [Test] + [ExpectedException(typeof(ArgumentException))] + public void SameNameTwiceCausesExplosion() { + _routes.MapRoute("foo", "{controller}"); + + var publisher = _container.Resolve(); + publisher.Publish(new[] { Desc("yarg", "bar"), Desc("yarg", "quux") }); + + Assert.That(_routes.Count(), Is.EqualTo(2)); + } + + + [Test] + public void ExplosionLeavesOriginalRoutesIntact() { + _routes.MapRoute("foo", "{controller}"); + + var publisher = _container.Resolve(); + try { + publisher.Publish(new[] { Desc("yarg", "bar"), Desc("yarg", "quux") }); + } + catch (ArgumentException) { + Assert.That(_routes.Count(), Is.EqualTo(1)); + Assert.That(_routes.OfType().Single().Url, Is.EqualTo("{controller}")); + } + } + + [Test] + public void WriteBlocksWhileReadIsInEffect() { + _routes.MapRoute("foo", "{controller}"); + + var publisher = _container.Resolve(); + + var readLock = _routes.GetReadLock(); + + string where = "init"; + var action = new Action(() => { + where = "before"; + publisher.Publish(new[] { Desc("barname", "bar"), Desc("quuxname", "quux") }); + where = "after"; + }); + + Assert.That(where, Is.EqualTo("init")); + var asyncResult = action.BeginInvoke(null, null); + Thread.Sleep(75); + Assert.That(where, Is.EqualTo("before")); + readLock.Dispose(); + Thread.Sleep(75); + Assert.That(where, Is.EqualTo("after")); + action.EndInvoke(asyncResult); + } + + [Test] + public void RouteDescriptorWithNameCreatesNamedRouteInCollection() { + _routes.MapRoute("foo", "{controller}"); + + var publisher = _container.Resolve(); + var routeDescriptor = Desc("yarg", "bar"); + publisher.Publish(new[] { routeDescriptor }); + + Assert.That(_routes["yarg"], Is.Not.Null); + } + } +} + diff --git a/src/Orchard.Tests/Mvc/Routes/ShellRouteTests.cs b/src/Orchard.Tests/Mvc/Routes/ShellRouteTests.cs index 0f2444a2e7c..87c57e206ad 100644 --- a/src/Orchard.Tests/Mvc/Routes/ShellRouteTests.cs +++ b/src/Orchard.Tests/Mvc/Routes/ShellRouteTests.cs @@ -1,288 +1,288 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.Remoting.Messaging; -using System.Threading.Tasks; -using System.Web; -using System.Web.Mvc; -using System.Web.Routing; -using Autofac; -using Moq; -using NUnit.Framework; -using Orchard.Caching; -using Orchard.Environment; -using Orchard.Environment.Configuration; -using Orchard.Environment.Extensions; -using Orchard.Mvc; -using Orchard.Mvc.Routes; -using Orchard.Tests.Stubs; -using Orchard.Tests.Utility; - -namespace Orchard.Tests.Mvc.Routes { - [TestFixture] - public class ShellRouteTests { - private RouteCollection _routes; - private ILifetimeScope _containerA; - private ILifetimeScope _containerB; - private ShellSettings _settingsA; - private ShellSettings _settingsB; - private IContainer _rootContainer; - - [SetUp] - public void Init() { - _settingsA = new ShellSettings { Name = "Alpha" }; - _settingsB = new ShellSettings { Name = "Beta", }; - _routes = new RouteCollection(); - - var rootBuilder = new ContainerBuilder(); - rootBuilder.Register(ctx => _routes); - rootBuilder.RegisterType().InstancePerDependency(); - rootBuilder.RegisterType().As().SingleInstance(); - rootBuilder.RegisterModule(new WorkContextModule()); - rootBuilder.RegisterType().As().InstancePerMatchingLifetimeScope("shell"); - rootBuilder.RegisterType().As(); - rootBuilder.RegisterType().As(); - rootBuilder.RegisterType().As(); - rootBuilder.RegisterType().As(); - rootBuilder.RegisterType().As(); - - rootBuilder.Register>(c => { - var context = c.Resolve(); - return new Func(routeBase => - new ShellRoute( - routeBase, - _settingsA, - context.Resolve(), - context.Resolve(), objects => { return null; })); - }); - - _rootContainer = rootBuilder.Build(); - - _containerA = _rootContainer.BeginLifetimeScope( - "shell", - builder => { - builder.Register(ctx => _settingsA); - builder.RegisterType().As().InstancePerMatchingLifetimeScope("shell"); - }); - - _containerB = _rootContainer.BeginLifetimeScope( - "shell", - builder => { - builder.Register(ctx => _settingsB); - builder.RegisterType().As().InstancePerMatchingLifetimeScope("shell"); - }); - } - - [Test] - public void FactoryMethodWillCreateShellRoutes() { - var builder = new ContainerBuilder(); - builder.RegisterType().InstancePerDependency(); - builder.RegisterAutoMocking(); - - var container = builder.Build(); - var buildShellRoute = new Func(routeBase => - new ShellRoute( - routeBase, - _settingsA, - container.Resolve(), - container.Resolve(), - objects => { return null; })); - - var routeA = new Route("foo", new MvcRouteHandler()); - var route1 = buildShellRoute(routeA); - - var routeB = new Route("bar", new MvcRouteHandler()) { - DataTokens = new RouteValueDictionary { { "area", _settingsB.Name } } - }; - var route2 = buildShellRoute(routeB); - - Assert.That(route1, Is.Not.SameAs(route2)); - - Assert.That(route1.ShellSettingsName, Is.EqualTo(_settingsA.Name)); - Assert.That(route1.Area, Is.Null); - - Assert.That(route2.ShellSettingsName, Is.EqualTo(_settingsA.Name)); - Assert.That(route2.Area, Is.EqualTo(_settingsB.Name)); - } - - - [Test] - public void RoutePublisherReplacesOnlyNamedShellsRoutes() { - - var routeA = new Route("foo", new MvcRouteHandler()); - var routeB = new Route("bar", new MvcRouteHandler()); - var routeC = new Route("quux", new MvcRouteHandler()); - - _containerA.Resolve().Publish( - new[] { new RouteDescriptor { Priority = 0, Route = routeA } }); - - _containerB.Resolve().Publish( - new[] { new RouteDescriptor { Priority = 0, Route = routeB } }); - - // routes are grouped by name/priority/area - Assert.That(_routes.Count(), Is.EqualTo(1)); - - _containerA.Resolve().Publish( - new[] { new RouteDescriptor { Priority = 0, Route = routeC } }); - - Assert.That(_routes.Count(), Is.EqualTo(1)); - - _containerB.Resolve().Publish( - new[] { - new RouteDescriptor {Priority = 0, Route = routeA}, - new RouteDescriptor {Priority = 0, Route = routeB}, - }); - - Assert.That(_routes.Count(), Is.EqualTo(1)); - } - - [Test] - public void RoutePublisherGroupsShellRoutesByName() { - - var routeA = new Route("foo", new MvcRouteHandler()); - var routeB = new Route("bar", new MvcRouteHandler()); - var routeC = new Route("quux", new MvcRouteHandler()); - - _containerA.Resolve().Publish( - new[] { new RouteDescriptor { Name = "1", Priority = 0, Route = routeA } }); - - _containerA.Resolve().Publish( - new[] { new RouteDescriptor { Name = "2", Priority = 0, Route = routeB } }); - - Assert.That(_routes.Count(), Is.EqualTo(2)); - - _containerB.Resolve().Publish( - new[] { new RouteDescriptor { Name = "2", Priority = 0, Route = routeC } }); - - Assert.That(_routes.Count(), Is.EqualTo(2)); - } - - [Test] - public void MatchingRouteToActiveShellTableWillLimitTheAbilityToMatchRoutes() { - - var routeFoo = new Route("foo", new MvcRouteHandler()); - - _settingsA.RequestUrlHost = "a.example.com"; - _containerA.Resolve().Publish( - new[] { new RouteDescriptor { Priority = 0, Route = routeFoo } }); - _rootContainer.Resolve().Add(_settingsA); - - _settingsB.RequestUrlHost = "b.example.com"; - _containerB.Resolve().Publish( - new[] { new RouteDescriptor { Priority = 0, Route = routeFoo } }); - _rootContainer.Resolve().Add(_settingsB); - - var httpContext = new StubHttpContext("~/foo"); - var routeData = _routes.GetRouteData(httpContext); - Assert.That(routeData, Is.Null); - - var httpContextA = new StubHttpContext("~/foo", "a.example.com"); - var routeDataA = _routes.GetRouteData(httpContextA); - Assert.That(routeDataA, Is.Not.Null); - Assert.That(routeDataA.DataTokens.ContainsKey("IWorkContextAccessor"), Is.True); - var workContextAccessorA = (IWorkContextAccessor)routeDataA.DataTokens["IWorkContextAccessor"]; - var workContextScopeA = workContextAccessorA.CreateWorkContextScope(httpContextA); - - Assert.That(workContextScopeA.Resolve(), Is.SameAs(_containerA.Resolve())); - Assert.That(workContextScopeA.Resolve(), Is.Not.SameAs(_containerB.Resolve())); - - var httpContextB = new StubHttpContext("~/foo", "b.example.com"); - var routeDataB = _routes.GetRouteData(httpContextB); - Assert.That(routeDataB, Is.Not.Null); - Assert.That(routeDataB.DataTokens.ContainsKey("IWorkContextAccessor"), Is.True); - var workContextAccessorB = (IWorkContextAccessor)routeDataB.DataTokens["IWorkContextAccessor"]; - var workContextScopeB = workContextAccessorB.CreateWorkContextScope(httpContextB); - - Assert.That(workContextScopeB.Resolve(), Is.SameAs(_containerB.Resolve())); - Assert.That(workContextScopeB.Resolve(), Is.Not.SameAs(_containerA.Resolve())); - - } - - [Test] - public void RequestUrlPrefixAdjustsMatchingAndPathGeneration() { - var settings = new ShellSettings { RequestUrlPrefix = "~/foo" }; - - var builder = new ContainerBuilder(); - builder.RegisterType().InstancePerDependency(); - builder.RegisterAutoMocking(); - builder.Register(ctx => settings); - - var container = builder.Build(); - container.Mock() - .Setup(x => x.Match(It.IsAny())) - .Returns(settings); - - - var shellRouteFactory = new Func(routeBase => - new ShellRoute( - routeBase, - settings, - container.Resolve(), - container.Resolve(), - objects => { return null; })); - - var helloRoute = shellRouteFactory(new Route( - "hello", - new RouteValueDictionary { { "controller", "foo" }, { "action", "bar" } }, - new MvcRouteHandler())); - - var tagsRoute = shellRouteFactory(new Route( - "tags/{tagName}", - new RouteValueDictionary { { "controller", "tags" }, { "action", "show" } }, - new MvcRouteHandler())); - - var defaultRoute = shellRouteFactory(new Route( - "{controller}/{action}", - new RouteValueDictionary { { "controller", "home" }, { "action", "index" } }, - new MvcRouteHandler())); - - var routes = new RouteCollection { helloRoute, tagsRoute, defaultRoute }; - - var helloRouteData = routes.GetRouteData(new StubHttpContext("~/Foo/Hello")); - Assert.That(helloRouteData, Is.Not.Null); - Assert.That(helloRouteData.Values.Count(), Is.EqualTo(2)); - Assert.That(helloRouteData.GetRequiredString("controller"), Is.EqualTo("foo")); - Assert.That(helloRouteData.GetRequiredString("action"), Is.EqualTo("bar")); - - var tagsRouteData = routes.GetRouteData(new StubHttpContext("~/Foo/Tags/my-tag-name")); - Assert.That(tagsRouteData, Is.Not.Null); - Assert.That(tagsRouteData.Values.Count(), Is.EqualTo(3)); - Assert.That(tagsRouteData.GetRequiredString("controller"), Is.EqualTo("tags")); - Assert.That(tagsRouteData.GetRequiredString("action"), Is.EqualTo("show")); - Assert.That(tagsRouteData.GetRequiredString("tagName"), Is.EqualTo("my-tag-name")); - - var defaultRouteData = routes.GetRouteData(new StubHttpContext("~/Foo/Alpha/Beta")); - Assert.That(defaultRouteData, Is.Not.Null); - Assert.That(defaultRouteData.Values.Count(), Is.EqualTo(2)); - Assert.That(defaultRouteData.GetRequiredString("controller"), Is.EqualTo("Alpha")); - Assert.That(defaultRouteData.GetRequiredString("action"), Is.EqualTo("Beta")); - - var defaultRouteData2 = routes.GetRouteData(new StubHttpContext("~/Foo/Alpha")); - Assert.That(defaultRouteData2, Is.Not.Null); - Assert.That(defaultRouteData2.Values.Count(), Is.EqualTo(2)); - Assert.That(defaultRouteData2.GetRequiredString("controller"), Is.EqualTo("Alpha")); - Assert.That(defaultRouteData2.GetRequiredString("action"), Is.EqualTo("index")); - - var defaultRouteData3 = routes.GetRouteData(new StubHttpContext("~/Foo/")); - Assert.That(defaultRouteData3, Is.Not.Null); - Assert.That(defaultRouteData3.Values.Count(), Is.EqualTo(2)); - Assert.That(defaultRouteData3.GetRequiredString("controller"), Is.EqualTo("home")); - Assert.That(defaultRouteData3.GetRequiredString("action"), Is.EqualTo("index")); - - var defaultRouteData4 = routes.GetRouteData(new StubHttpContext("~/Foo")); - Assert.That(defaultRouteData4, Is.Not.Null); - Assert.That(defaultRouteData4.Values.Count(), Is.EqualTo(2)); - Assert.That(defaultRouteData4.GetRequiredString("controller"), Is.EqualTo("home")); - Assert.That(defaultRouteData4.GetRequiredString("action"), Is.EqualTo("index")); - - var requestContext = new RequestContext(new StubHttpContext("~/Foo/Alpha/Beta"), defaultRouteData); - var helloVirtualPath = routes.GetVirtualPath(requestContext, helloRouteData.Values); - Assert.That(helloVirtualPath, Is.Not.Null); - Assert.That(helloVirtualPath.VirtualPath, Is.EqualTo("~/foo/hello")); - - var defaultVirtualPath4 = routes.GetVirtualPath(requestContext, defaultRouteData4.Values); - Assert.That(defaultVirtualPath4, Is.Not.Null); - Assert.That(defaultVirtualPath4.VirtualPath, Is.EqualTo("~/foo/")); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Remoting.Messaging; +using System.Threading.Tasks; +using System.Web; +using System.Web.Mvc; +using System.Web.Routing; +using Autofac; +using Moq; +using NUnit.Framework; +using Orchard.Caching; +using Orchard.Environment; +using Orchard.Environment.Configuration; +using Orchard.Environment.Extensions; +using Orchard.Mvc; +using Orchard.Mvc.Routes; +using Orchard.Tests.Stubs; +using Orchard.Tests.Utility; + +namespace Orchard.Tests.Mvc.Routes { + [TestFixture] + public class ShellRouteTests { + private RouteCollection _routes; + private ILifetimeScope _containerA; + private ILifetimeScope _containerB; + private ShellSettings _settingsA; + private ShellSettings _settingsB; + private IContainer _rootContainer; + + [SetUp] + public void Init() { + _settingsA = new ShellSettings { Name = "Alpha" }; + _settingsB = new ShellSettings { Name = "Beta", }; + _routes = new RouteCollection(); + + var rootBuilder = new ContainerBuilder(); + rootBuilder.Register(ctx => _routes); + rootBuilder.RegisterType().InstancePerDependency(); + rootBuilder.RegisterType().As().SingleInstance(); + rootBuilder.RegisterModule(new WorkContextModule()); + rootBuilder.RegisterType().As().InstancePerMatchingLifetimeScope("shell"); + rootBuilder.RegisterType().As(); + rootBuilder.RegisterType().As(); + rootBuilder.RegisterType().As(); + rootBuilder.RegisterType().As(); + rootBuilder.RegisterType().As(); + + rootBuilder.Register>(c => { + var context = c.Resolve(); + return new Func(routeBase => + new ShellRoute( + routeBase, + _settingsA, + context.Resolve(), + context.Resolve(), objects => { return null; })); + }); + + _rootContainer = rootBuilder.Build(); + + _containerA = _rootContainer.BeginLifetimeScope( + "shell", + builder => { + builder.Register(ctx => _settingsA); + builder.RegisterType().As().InstancePerMatchingLifetimeScope("shell"); + }); + + _containerB = _rootContainer.BeginLifetimeScope( + "shell", + builder => { + builder.Register(ctx => _settingsB); + builder.RegisterType().As().InstancePerMatchingLifetimeScope("shell"); + }); + } + + [Test] + public void FactoryMethodWillCreateShellRoutes() { + var builder = new ContainerBuilder(); + builder.RegisterType().InstancePerDependency(); + builder.RegisterAutoMocking(); + + var container = builder.Build(); + var buildShellRoute = new Func(routeBase => + new ShellRoute( + routeBase, + _settingsA, + container.Resolve(), + container.Resolve(), + objects => { return null; })); + + var routeA = new Route("foo", new MvcRouteHandler()); + var route1 = buildShellRoute(routeA); + + var routeB = new Route("bar", new MvcRouteHandler()) { + DataTokens = new RouteValueDictionary { { "area", _settingsB.Name } } + }; + var route2 = buildShellRoute(routeB); + + Assert.That(route1, Is.Not.SameAs(route2)); + + Assert.That(route1.ShellSettingsName, Is.EqualTo(_settingsA.Name)); + Assert.That(route1.Area, Is.Null); + + Assert.That(route2.ShellSettingsName, Is.EqualTo(_settingsA.Name)); + Assert.That(route2.Area, Is.EqualTo(_settingsB.Name)); + } + + + [Test] + public void RoutePublisherReplacesOnlyNamedShellsRoutes() { + + var routeA = new Route("foo", new MvcRouteHandler()); + var routeB = new Route("bar", new MvcRouteHandler()); + var routeC = new Route("quux", new MvcRouteHandler()); + + _containerA.Resolve().Publish( + new[] { new RouteDescriptor { Priority = 0, Route = routeA } }); + + _containerB.Resolve().Publish( + new[] { new RouteDescriptor { Priority = 0, Route = routeB } }); + + // routes are grouped by name/priority/area + Assert.That(_routes.Count(), Is.EqualTo(1)); + + _containerA.Resolve().Publish( + new[] { new RouteDescriptor { Priority = 0, Route = routeC } }); + + Assert.That(_routes.Count(), Is.EqualTo(1)); + + _containerB.Resolve().Publish( + new[] { + new RouteDescriptor {Priority = 0, Route = routeA}, + new RouteDescriptor {Priority = 0, Route = routeB}, + }); + + Assert.That(_routes.Count(), Is.EqualTo(1)); + } + + [Test] + public void RoutePublisherGroupsShellRoutesByName() { + + var routeA = new Route("foo", new MvcRouteHandler()); + var routeB = new Route("bar", new MvcRouteHandler()); + var routeC = new Route("quux", new MvcRouteHandler()); + + _containerA.Resolve().Publish( + new[] { new RouteDescriptor { Name = "1", Priority = 0, Route = routeA } }); + + _containerA.Resolve().Publish( + new[] { new RouteDescriptor { Name = "2", Priority = 0, Route = routeB } }); + + Assert.That(_routes.Count(), Is.EqualTo(2)); + + _containerB.Resolve().Publish( + new[] { new RouteDescriptor { Name = "2", Priority = 0, Route = routeC } }); + + Assert.That(_routes.Count(), Is.EqualTo(2)); + } + + [Test] + public void MatchingRouteToActiveShellTableWillLimitTheAbilityToMatchRoutes() { + + var routeFoo = new Route("foo", new MvcRouteHandler()); + + _settingsA.RequestUrlHost = "a.example.com"; + _containerA.Resolve().Publish( + new[] { new RouteDescriptor { Priority = 0, Route = routeFoo } }); + _rootContainer.Resolve().Add(_settingsA); + + _settingsB.RequestUrlHost = "b.example.com"; + _containerB.Resolve().Publish( + new[] { new RouteDescriptor { Priority = 0, Route = routeFoo } }); + _rootContainer.Resolve().Add(_settingsB); + + var httpContext = new StubHttpContext("~/foo"); + var routeData = _routes.GetRouteData(httpContext); + Assert.That(routeData, Is.Null); + + var httpContextA = new StubHttpContext("~/foo", "a.example.com"); + var routeDataA = _routes.GetRouteData(httpContextA); + Assert.That(routeDataA, Is.Not.Null); + Assert.That(routeDataA.DataTokens.ContainsKey("IWorkContextAccessor"), Is.True); + var workContextAccessorA = (IWorkContextAccessor)routeDataA.DataTokens["IWorkContextAccessor"]; + var workContextScopeA = workContextAccessorA.CreateWorkContextScope(httpContextA); + + Assert.That(workContextScopeA.Resolve(), Is.SameAs(_containerA.Resolve())); + Assert.That(workContextScopeA.Resolve(), Is.Not.SameAs(_containerB.Resolve())); + + var httpContextB = new StubHttpContext("~/foo", "b.example.com"); + var routeDataB = _routes.GetRouteData(httpContextB); + Assert.That(routeDataB, Is.Not.Null); + Assert.That(routeDataB.DataTokens.ContainsKey("IWorkContextAccessor"), Is.True); + var workContextAccessorB = (IWorkContextAccessor)routeDataB.DataTokens["IWorkContextAccessor"]; + var workContextScopeB = workContextAccessorB.CreateWorkContextScope(httpContextB); + + Assert.That(workContextScopeB.Resolve(), Is.SameAs(_containerB.Resolve())); + Assert.That(workContextScopeB.Resolve(), Is.Not.SameAs(_containerA.Resolve())); + + } + + [Test] + public void RequestUrlPrefixAdjustsMatchingAndPathGeneration() { + var settings = new ShellSettings { RequestUrlPrefix = "~/foo" }; + + var builder = new ContainerBuilder(); + builder.RegisterType().InstancePerDependency(); + builder.RegisterAutoMocking(); + builder.Register(ctx => settings); + + var container = builder.Build(); + container.Mock() + .Setup(x => x.Match(It.IsAny())) + .Returns(settings); + + + var shellRouteFactory = new Func(routeBase => + new ShellRoute( + routeBase, + settings, + container.Resolve(), + container.Resolve(), + objects => { return null; })); + + var helloRoute = shellRouteFactory(new Route( + "hello", + new RouteValueDictionary { { "controller", "foo" }, { "action", "bar" } }, + new MvcRouteHandler())); + + var tagsRoute = shellRouteFactory(new Route( + "tags/{tagName}", + new RouteValueDictionary { { "controller", "tags" }, { "action", "show" } }, + new MvcRouteHandler())); + + var defaultRoute = shellRouteFactory(new Route( + "{controller}/{action}", + new RouteValueDictionary { { "controller", "home" }, { "action", "index" } }, + new MvcRouteHandler())); + + var routes = new RouteCollection { helloRoute, tagsRoute, defaultRoute }; + + var helloRouteData = routes.GetRouteData(new StubHttpContext("~/Foo/Hello")); + Assert.That(helloRouteData, Is.Not.Null); + Assert.That(helloRouteData.Values.Count(), Is.EqualTo(2)); + Assert.That(helloRouteData.GetRequiredString("controller"), Is.EqualTo("foo")); + Assert.That(helloRouteData.GetRequiredString("action"), Is.EqualTo("bar")); + + var tagsRouteData = routes.GetRouteData(new StubHttpContext("~/Foo/Tags/my-tag-name")); + Assert.That(tagsRouteData, Is.Not.Null); + Assert.That(tagsRouteData.Values.Count(), Is.EqualTo(3)); + Assert.That(tagsRouteData.GetRequiredString("controller"), Is.EqualTo("tags")); + Assert.That(tagsRouteData.GetRequiredString("action"), Is.EqualTo("show")); + Assert.That(tagsRouteData.GetRequiredString("tagName"), Is.EqualTo("my-tag-name")); + + var defaultRouteData = routes.GetRouteData(new StubHttpContext("~/Foo/Alpha/Beta")); + Assert.That(defaultRouteData, Is.Not.Null); + Assert.That(defaultRouteData.Values.Count(), Is.EqualTo(2)); + Assert.That(defaultRouteData.GetRequiredString("controller"), Is.EqualTo("Alpha")); + Assert.That(defaultRouteData.GetRequiredString("action"), Is.EqualTo("Beta")); + + var defaultRouteData2 = routes.GetRouteData(new StubHttpContext("~/Foo/Alpha")); + Assert.That(defaultRouteData2, Is.Not.Null); + Assert.That(defaultRouteData2.Values.Count(), Is.EqualTo(2)); + Assert.That(defaultRouteData2.GetRequiredString("controller"), Is.EqualTo("Alpha")); + Assert.That(defaultRouteData2.GetRequiredString("action"), Is.EqualTo("index")); + + var defaultRouteData3 = routes.GetRouteData(new StubHttpContext("~/Foo/")); + Assert.That(defaultRouteData3, Is.Not.Null); + Assert.That(defaultRouteData3.Values.Count(), Is.EqualTo(2)); + Assert.That(defaultRouteData3.GetRequiredString("controller"), Is.EqualTo("home")); + Assert.That(defaultRouteData3.GetRequiredString("action"), Is.EqualTo("index")); + + var defaultRouteData4 = routes.GetRouteData(new StubHttpContext("~/Foo")); + Assert.That(defaultRouteData4, Is.Not.Null); + Assert.That(defaultRouteData4.Values.Count(), Is.EqualTo(2)); + Assert.That(defaultRouteData4.GetRequiredString("controller"), Is.EqualTo("home")); + Assert.That(defaultRouteData4.GetRequiredString("action"), Is.EqualTo("index")); + + var requestContext = new RequestContext(new StubHttpContext("~/Foo/Alpha/Beta"), defaultRouteData); + var helloVirtualPath = routes.GetVirtualPath(requestContext, helloRouteData.Values); + Assert.That(helloVirtualPath, Is.Not.Null); + Assert.That(helloVirtualPath.VirtualPath, Is.EqualTo("~/foo/hello")); + + var defaultVirtualPath4 = routes.GetVirtualPath(requestContext, defaultRouteData4.Values); + Assert.That(defaultVirtualPath4, Is.Not.Null); + Assert.That(defaultVirtualPath4.VirtualPath, Is.EqualTo("~/foo/")); + } + } +} diff --git a/src/Orchard.Tests/Mvc/Routes/StandardExtensionRouteProviderTests.cs b/src/Orchard.Tests/Mvc/Routes/StandardExtensionRouteProviderTests.cs index bdfc8eb4c1b..9c4aa21ec63 100644 --- a/src/Orchard.Tests/Mvc/Routes/StandardExtensionRouteProviderTests.cs +++ b/src/Orchard.Tests/Mvc/Routes/StandardExtensionRouteProviderTests.cs @@ -1,63 +1,63 @@ -using System.Collections.Generic; -using System.Linq; -using System.Web.Routing; -using NUnit.Framework; -using Orchard.Environment.Extensions.Models; -using Orchard.Environment.ShellBuilders.Models; -using Orchard.Mvc.Routes; - -namespace Orchard.Tests.Mvc.Routes { - [TestFixture] - public class StandardExtensionRouteProviderTests { - [Test] - public void ExtensionDisplayNameShouldBeUsedInBothStandardRoutes() { - var blueprint = new ShellBlueprint { - Controllers = new[] { - new ControllerBlueprint { - AreaName ="Long.Name.Foo", - Feature =new Feature { - Descriptor=new FeatureDescriptor { - Extension=new ExtensionDescriptor { - Id="Foo", - Name="A Foo Module", - Path="Foo" - } - } - } - }, - new ControllerBlueprint { - AreaName ="Long.Name.Bar", - Feature =new Feature { - Descriptor=new FeatureDescriptor { - Extension=new ExtensionDescriptor { - Id="Bar", - Name="Bar", - Path="BarBar" - } - } - } - } - } - }; - var routeProvider = new StandardExtensionRouteProvider(blueprint); - - var routes = new List(); - routeProvider.GetRoutes(routes); - - Assert.That(routes, Has.Count.EqualTo(4)); - var fooAdmin = routes.Select(x => x.Route).OfType() - .Single(x => x.Url == "Admin/Foo/{action}/{id}"); - var fooRoute = routes.Select(x => x.Route).OfType() - .Single(x => x.Url == "Foo/{controller}/{action}/{id}"); - var barAdmin = routes.Select(x => x.Route).OfType() - .Single(x => x.Url == "Admin/BarBar/{action}/{id}"); - var barRoute = routes.Select(x => x.Route).OfType() - .Single(x => x.Url == "BarBar/{controller}/{action}/{id}"); - - Assert.That(fooAdmin.DataTokens["area"], Is.EqualTo("Long.Name.Foo")); - Assert.That(fooRoute.DataTokens["area"], Is.EqualTo("Long.Name.Foo")); - Assert.That(barAdmin.DataTokens["area"], Is.EqualTo("Long.Name.Bar")); - Assert.That(barRoute.DataTokens["area"], Is.EqualTo("Long.Name.Bar")); - } - } -} +using System.Collections.Generic; +using System.Linq; +using System.Web.Routing; +using NUnit.Framework; +using Orchard.Environment.Extensions.Models; +using Orchard.Environment.ShellBuilders.Models; +using Orchard.Mvc.Routes; + +namespace Orchard.Tests.Mvc.Routes { + [TestFixture] + public class StandardExtensionRouteProviderTests { + [Test] + public void ExtensionDisplayNameShouldBeUsedInBothStandardRoutes() { + var blueprint = new ShellBlueprint { + Controllers = new[] { + new ControllerBlueprint { + AreaName ="Long.Name.Foo", + Feature =new Feature { + Descriptor=new FeatureDescriptor { + Extension=new ExtensionDescriptor { + Id="Foo", + Name="A Foo Module", + Path="Foo" + } + } + } + }, + new ControllerBlueprint { + AreaName ="Long.Name.Bar", + Feature =new Feature { + Descriptor=new FeatureDescriptor { + Extension=new ExtensionDescriptor { + Id="Bar", + Name="Bar", + Path="BarBar" + } + } + } + } + } + }; + var routeProvider = new StandardExtensionRouteProvider(blueprint); + + var routes = new List(); + routeProvider.GetRoutes(routes); + + Assert.That(routes, Has.Count.EqualTo(4)); + var fooAdmin = routes.Select(x => x.Route).OfType() + .Single(x => x.Url == "Admin/Foo/{action}/{id}"); + var fooRoute = routes.Select(x => x.Route).OfType() + .Single(x => x.Url == "Foo/{controller}/{action}/{id}"); + var barAdmin = routes.Select(x => x.Route).OfType() + .Single(x => x.Url == "Admin/BarBar/{action}/{id}"); + var barRoute = routes.Select(x => x.Route).OfType() + .Single(x => x.Url == "BarBar/{controller}/{action}/{id}"); + + Assert.That(fooAdmin.DataTokens["area"], Is.EqualTo("Long.Name.Foo")); + Assert.That(fooRoute.DataTokens["area"], Is.EqualTo("Long.Name.Foo")); + Assert.That(barAdmin.DataTokens["area"], Is.EqualTo("Long.Name.Bar")); + Assert.That(barRoute.DataTokens["area"], Is.EqualTo("Long.Name.Bar")); + } + } +} diff --git a/src/Orchard.Tests/Mvc/Routes/UrlPrefixTests.cs b/src/Orchard.Tests/Mvc/Routes/UrlPrefixTests.cs index 37255f34537..88097b55735 100644 --- a/src/Orchard.Tests/Mvc/Routes/UrlPrefixTests.cs +++ b/src/Orchard.Tests/Mvc/Routes/UrlPrefixTests.cs @@ -1,71 +1,71 @@ -using NUnit.Framework; -using Orchard.Mvc.Routes; - -namespace Orchard.Tests.Mvc.Routes { - [TestFixture] - public class UrlPrefixTests { - [Test] - public void RemoveLeadingSegmentsOnlyMatchesFullSegment() { - var prefix = new UrlPrefix("foo"); - Assert.That(prefix.RemoveLeadingSegments("~/foo/bar"), Is.EqualTo("~/bar")); - Assert.That(prefix.RemoveLeadingSegments("~/fooo/bar"), Is.EqualTo("~/fooo/bar")); - Assert.That(prefix.RemoveLeadingSegments("~/fo/bar"), Is.EqualTo("~/fo/bar")); - } - - [Test] - public void RemoveLeadingSegmentsMayContainSlash() { - var prefix = new UrlPrefix("foo/quux"); - Assert.That(prefix.RemoveLeadingSegments("~/foo/quux/bar"), Is.EqualTo("~/bar")); - Assert.That(prefix.RemoveLeadingSegments("~/foo/bar"), Is.EqualTo("~/foo/bar")); - Assert.That(prefix.RemoveLeadingSegments("~/quux/bar"), Is.EqualTo("~/quux/bar")); - } - - [Test] - public void RemoveLeadingSegmentsCanMatchEntireUrl() { - var prefix = new UrlPrefix("foo"); - Assert.That(prefix.RemoveLeadingSegments("~/foo/"), Is.EqualTo("~/")); - Assert.That(prefix.RemoveLeadingSegments("~/foo"), Is.EqualTo("~/")); - } - - [Test] - public void RemoveLeadingSegmentsIsCaseInsensitive() { - var prefix = new UrlPrefix("Foo"); - Assert.That(prefix.RemoveLeadingSegments("~/foo/bar"), Is.EqualTo("~/bar")); - Assert.That(prefix.RemoveLeadingSegments("~/FOO/BAR"), Is.EqualTo("~/BAR")); - } - - [Test] - public void RemoveLeadingSegmentsIgnoreLeadingAndTrailingCharactersOnInput() { - var prefix = new UrlPrefix("foo"); - Assert.That(prefix.RemoveLeadingSegments("~/foo/bar"), Is.EqualTo("~/bar")); - var prefix2 = new UrlPrefix("~/foo"); - Assert.That(prefix2.RemoveLeadingSegments("~/foo/bar"), Is.EqualTo("~/bar")); - var prefix3 = new UrlPrefix("foo/"); - Assert.That(prefix3.RemoveLeadingSegments("~/foo/bar"), Is.EqualTo("~/bar")); - } - - [Test] - public void PrependLeadingSegmentsInsertsBeforeNormalVirtualPath() { - var prefix = new UrlPrefix("foo"); - Assert.That(prefix.PrependLeadingSegments("~/bar"), Is.EqualTo("~/foo/bar")); - } - - [Test] - public void PrependLeadingSegmentsPreservesNatureOfIncomingPath() { - var prefix = new UrlPrefix("foo"); - Assert.That(prefix.PrependLeadingSegments("~/bar"), Is.EqualTo("~/foo/bar")); - Assert.That(prefix.PrependLeadingSegments("/bar"), Is.EqualTo("/foo/bar")); - Assert.That(prefix.PrependLeadingSegments("bar"), Is.EqualTo("foo/bar")); - } - - [Test] - public void PrependLeadingSegmentsHandlesShortUrlConditionsAppropriately() { - var prefix = new UrlPrefix("foo"); - Assert.That(prefix.PrependLeadingSegments("~/"), Is.EqualTo("~/foo/")); - Assert.That(prefix.PrependLeadingSegments("/"), Is.EqualTo("/foo/")); - Assert.That(prefix.PrependLeadingSegments("~"), Is.EqualTo("~/foo/")); - Assert.That(prefix.PrependLeadingSegments(""), Is.EqualTo("foo/")); - } - - } -} +using NUnit.Framework; +using Orchard.Mvc.Routes; + +namespace Orchard.Tests.Mvc.Routes { + [TestFixture] + public class UrlPrefixTests { + [Test] + public void RemoveLeadingSegmentsOnlyMatchesFullSegment() { + var prefix = new UrlPrefix("foo"); + Assert.That(prefix.RemoveLeadingSegments("~/foo/bar"), Is.EqualTo("~/bar")); + Assert.That(prefix.RemoveLeadingSegments("~/fooo/bar"), Is.EqualTo("~/fooo/bar")); + Assert.That(prefix.RemoveLeadingSegments("~/fo/bar"), Is.EqualTo("~/fo/bar")); + } + + [Test] + public void RemoveLeadingSegmentsMayContainSlash() { + var prefix = new UrlPrefix("foo/quux"); + Assert.That(prefix.RemoveLeadingSegments("~/foo/quux/bar"), Is.EqualTo("~/bar")); + Assert.That(prefix.RemoveLeadingSegments("~/foo/bar"), Is.EqualTo("~/foo/bar")); + Assert.That(prefix.RemoveLeadingSegments("~/quux/bar"), Is.EqualTo("~/quux/bar")); + } + + [Test] + public void RemoveLeadingSegmentsCanMatchEntireUrl() { + var prefix = new UrlPrefix("foo"); + Assert.That(prefix.RemoveLeadingSegments("~/foo/"), Is.EqualTo("~/")); + Assert.That(prefix.RemoveLeadingSegments("~/foo"), Is.EqualTo("~/")); + } + + [Test] + public void RemoveLeadingSegmentsIsCaseInsensitive() { + var prefix = new UrlPrefix("Foo"); + Assert.That(prefix.RemoveLeadingSegments("~/foo/bar"), Is.EqualTo("~/bar")); + Assert.That(prefix.RemoveLeadingSegments("~/FOO/BAR"), Is.EqualTo("~/BAR")); + } + + [Test] + public void RemoveLeadingSegmentsIgnoreLeadingAndTrailingCharactersOnInput() { + var prefix = new UrlPrefix("foo"); + Assert.That(prefix.RemoveLeadingSegments("~/foo/bar"), Is.EqualTo("~/bar")); + var prefix2 = new UrlPrefix("~/foo"); + Assert.That(prefix2.RemoveLeadingSegments("~/foo/bar"), Is.EqualTo("~/bar")); + var prefix3 = new UrlPrefix("foo/"); + Assert.That(prefix3.RemoveLeadingSegments("~/foo/bar"), Is.EqualTo("~/bar")); + } + + [Test] + public void PrependLeadingSegmentsInsertsBeforeNormalVirtualPath() { + var prefix = new UrlPrefix("foo"); + Assert.That(prefix.PrependLeadingSegments("~/bar"), Is.EqualTo("~/foo/bar")); + } + + [Test] + public void PrependLeadingSegmentsPreservesNatureOfIncomingPath() { + var prefix = new UrlPrefix("foo"); + Assert.That(prefix.PrependLeadingSegments("~/bar"), Is.EqualTo("~/foo/bar")); + Assert.That(prefix.PrependLeadingSegments("/bar"), Is.EqualTo("/foo/bar")); + Assert.That(prefix.PrependLeadingSegments("bar"), Is.EqualTo("foo/bar")); + } + + [Test] + public void PrependLeadingSegmentsHandlesShortUrlConditionsAppropriately() { + var prefix = new UrlPrefix("foo"); + Assert.That(prefix.PrependLeadingSegments("~/"), Is.EqualTo("~/foo/")); + Assert.That(prefix.PrependLeadingSegments("/"), Is.EqualTo("/foo/")); + Assert.That(prefix.PrependLeadingSegments("~"), Is.EqualTo("~/foo/")); + Assert.That(prefix.PrependLeadingSegments(""), Is.EqualTo("foo/")); + } + + } +} diff --git a/src/Orchard.Tests/Orchard.Framework.Tests.csproj b/src/Orchard.Tests/Orchard.Framework.Tests.csproj index d677ff37d0b..f02694b3a08 100644 --- a/src/Orchard.Tests/Orchard.Framework.Tests.csproj +++ b/src/Orchard.Tests/Orchard.Framework.Tests.csproj @@ -1,402 +1,402 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {ABC826D4-2FA1-4F2F-87DE-E6095F653810} - Library - Properties - Orchard.Tests - Orchard.Framework.Tests - v4.5.1 - 512 - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - ..\OrchardBasicCorrectness.ruleset - AnyCPU - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - AnyCPU - false - - - - False - ..\..\lib\autofac\Autofac.dll - - - False - ..\..\lib\autofac\Autofac.Integration.Web.dll - - - False - ..\..\lib\castle\net45\Castle.Core.dll - - - False - ..\..\lib\nhibernate\FluentNHibernate.dll - - - False - ..\..\lib\nhibernate\Iesi.Collections.dll - - - False - ..\..\lib\dlr\IronRuby.dll - - - ..\..\lib\dlr\IronRuby.Libraries.dll - - - False - ..\..\lib\log4net\log4net.dll - - - - False - ..\..\lib\dlr\Microsoft.Dynamic.dll - - - ..\..\lib\dlr\Microsoft.Scripting.dll - - - False - ..\..\lib\moq\Moq.dll - - - ..\..\lib\newtonsoft.json\Newtonsoft.Json.dll - - - False - ..\..\lib\nhibernate\NHibernate.dll - - - False - ..\..\lib\nunit\nunit.framework.dll - - - - 3.5 - - - - 3.5 - - - - ..\..\lib\sqlce\System.Data.SqlServerCe.dll - True - - - 3.0 - - - - 3.5 - - - False - ..\..\lib\aspnetwebapi\System.Web.Http.dll - - - False - ..\..\lib\aspnetmvc\System.Web.Mvc.dll - - - 3.5 - - - - 3.5 - - - 3.5 - - - - - - - - - - - - Code - - - - - - - Code - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Code - - - - - Code - - - Code - - - Code - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {9916839C-39FC-4CEB-A5AF-89CA7E87119F} - Orchard.Core - - - {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} - Orchard.Framework - - - - - Designer - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {ABC826D4-2FA1-4F2F-87DE-E6095F653810} + Library + Properties + Orchard.Tests + Orchard.Framework.Tests + v4.5.1 + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + ..\OrchardBasicCorrectness.ruleset + AnyCPU + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + AnyCPU + false + + + + False + ..\..\lib\autofac\Autofac.dll + + + False + ..\..\lib\autofac\Autofac.Integration.Web.dll + + + False + ..\..\lib\castle\net45\Castle.Core.dll + + + False + ..\..\lib\nhibernate\FluentNHibernate.dll + + + False + ..\..\lib\nhibernate\Iesi.Collections.dll + + + False + ..\..\lib\dlr\IronRuby.dll + + + ..\..\lib\dlr\IronRuby.Libraries.dll + + + False + ..\..\lib\log4net\log4net.dll + + + + False + ..\..\lib\dlr\Microsoft.Dynamic.dll + + + ..\..\lib\dlr\Microsoft.Scripting.dll + + + False + ..\..\lib\moq\Moq.dll + + + ..\..\lib\newtonsoft.json\Newtonsoft.Json.dll + + + False + ..\..\lib\nhibernate\NHibernate.dll + + + False + ..\..\lib\nunit\nunit.framework.dll + + + + 3.5 + + + + 3.5 + + + + ..\..\lib\sqlce\System.Data.SqlServerCe.dll + True + + + 3.0 + + + + 3.5 + + + False + ..\..\lib\aspnetwebapi\System.Web.Http.dll + + + False + ..\..\lib\aspnetmvc\System.Web.Mvc.dll + + + 3.5 + + + + 3.5 + + + 3.5 + + + + + + + + + + + + Code + + + + + + + Code + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Code + + + + + Code + + + Code + + + Code + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {9916839C-39FC-4CEB-A5AF-89CA7E87119F} + Orchard.Core + + + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} + Orchard.Framework + + + + + Designer + + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Tests/Properties/AssemblyInfo.cs b/src/Orchard.Tests/Properties/AssemblyInfo.cs index c3bb0f4b382..705b615857f 100644 --- a/src/Orchard.Tests/Properties/AssemblyInfo.cs +++ b/src/Orchard.Tests/Properties/AssemblyInfo.cs @@ -1,37 +1,37 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. - -[assembly: AssemblyTitle("Orchard.Framework.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyProduct("Orchard")] -[assembly: AssemblyCopyright("Copyright © .NET Foundation")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. - -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM - -[assembly: Guid("2a721221-b81c-47fa-8a29-4673cd0182b7")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.9.2")] -[assembly: AssemblyFileVersion("1.9.2")] +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. + +[assembly: AssemblyTitle("Orchard.Framework.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyProduct("Orchard")] +[assembly: AssemblyCopyright("Copyright © .NET Foundation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. + +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM + +[assembly: Guid("2a721221-b81c-47fa-8a29-4673cd0182b7")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.9.2")] +[assembly: AssemblyFileVersion("1.9.2")] diff --git a/src/Orchard.Tests/Records/BarRecord.cs b/src/Orchard.Tests/Records/BarRecord.cs index 1d460eb58bb..1e4b14d66b3 100644 --- a/src/Orchard.Tests/Records/BarRecord.cs +++ b/src/Orchard.Tests/Records/BarRecord.cs @@ -1,7 +1,7 @@ -namespace Orchard.Tests.Records { - public class BarRecord { - public virtual int Id { get; set; } - public virtual decimal Height { get; set; } - public virtual decimal Width { get; set; } - } +namespace Orchard.Tests.Records { + public class BarRecord { + public virtual int Id { get; set; } + public virtual decimal Height { get; set; } + public virtual decimal Width { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Records/BigRecord.cs b/src/Orchard.Tests/Records/BigRecord.cs index 3b643926bad..6b81c519337 100644 --- a/src/Orchard.Tests/Records/BigRecord.cs +++ b/src/Orchard.Tests/Records/BigRecord.cs @@ -1,12 +1,12 @@ -using Orchard.Data.Conventions; - -namespace Orchard.Tests.Records { - public class BigRecord { - public virtual int Id { get; set; } - [StringLengthMax] - public virtual string Body { get; set; } - - [StringLengthMax] - public virtual byte[] Banner { get; set; } - } +using Orchard.Data.Conventions; + +namespace Orchard.Tests.Records { + public class BigRecord { + public virtual int Id { get; set; } + [StringLengthMax] + public virtual string Body { get; set; } + + [StringLengthMax] + public virtual byte[] Banner { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Records/FooRecord.cs b/src/Orchard.Tests/Records/FooRecord.cs index c2d8e55154f..3885f55da5f 100644 --- a/src/Orchard.Tests/Records/FooRecord.cs +++ b/src/Orchard.Tests/Records/FooRecord.cs @@ -1,9 +1,9 @@ -using System; - -namespace Orchard.Tests.Records { - public class FooRecord { - public virtual int Id { get; set; } - public virtual string Name { get; set; } - public virtual DateTime? Timespan { get; set; } - } +using System; + +namespace Orchard.Tests.Records { + public class FooRecord { + public virtual int Id { get; set; } + public virtual string Name { get; set; } + public virtual DateTime? Timespan { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Security/DefaultEncryptionServiceTests.cs b/src/Orchard.Tests/Security/DefaultEncryptionServiceTests.cs index 835ef031f40..e35ae74494b 100644 --- a/src/Orchard.Tests/Security/DefaultEncryptionServiceTests.cs +++ b/src/Orchard.Tests/Security/DefaultEncryptionServiceTests.cs @@ -1,88 +1,88 @@ -using System; -using System.Security.Cryptography; -using System.Text; -using Autofac; -using NUnit.Framework; -using Orchard.Environment.Configuration; -using Orchard.Security; -using Orchard.Security.Providers; -using Orchard.Utility.Extensions; - -namespace Orchard.Tests.Security { - [TestFixture] - public class DefaultEncryptionServiceTests { - private IContainer _container; - - [SetUp] - public void Init() { - - const string encryptionAlgorithm = "AES"; - const string hashAlgorithm = "HMACSHA256"; - - var shellSettings = new ShellSettings { - Name = "Foo", - DataProvider = "Bar", - DataConnectionString = "Quux", - EncryptionAlgorithm = encryptionAlgorithm, - EncryptionKey = SymmetricAlgorithm.Create(encryptionAlgorithm).Key.ToHexString(), - HashAlgorithm = hashAlgorithm, - HashKey = HMAC.Create(hashAlgorithm).Key.ToHexString() - }; - - var builder = new ContainerBuilder(); - builder.RegisterInstance(shellSettings); - builder.RegisterType().As(); - _container = builder.Build(); - } - - [Test] - public void CanEncodeAndDecodeData() { - var encryptionService = _container.Resolve(); - - var secretData = Encoding.Unicode.GetBytes("this is secret data"); - var encrypted = encryptionService.Encode(secretData); - var decrypted = encryptionService.Decode(encrypted); - - Assert.That(encrypted, Is.Not.EqualTo(decrypted)); - Assert.That(decrypted, Is.EqualTo(secretData)); - } - - [Test] - public void ShouldDetectTamperedData() { - var encryptionService = _container.Resolve(); - - var secretData = Encoding.Unicode.GetBytes("this is secret data"); - var encrypted = encryptionService.Encode(secretData); - - try { - // tamper the data - encrypted[encrypted.Length - 1] ^= 66; - var decrypted = encryptionService.Decode(encrypted); - } - catch { - return; - } - Assert.Fail(); - } - - [Test] - public void SuccessiveEncodeCallsShouldNotReturnTheSameData() { - var encryptionService = _container.Resolve(); - - var secretData = Encoding.Unicode.GetBytes("this is secret data"); - byte[] previousEncrypted = null; - for (int i = 0; i < 10; i++) { - var encrypted = encryptionService.Encode(secretData); - var decrypted = encryptionService.Decode(encrypted); - - Assert.That(encrypted, Is.Not.EqualTo(decrypted)); - Assert.That(decrypted, Is.EqualTo(secretData)); - - if(previousEncrypted != null) { - Assert.That(encrypted, Is.Not.EqualTo(previousEncrypted)); - } - previousEncrypted = encrypted; - } - } - } +using System; +using System.Security.Cryptography; +using System.Text; +using Autofac; +using NUnit.Framework; +using Orchard.Environment.Configuration; +using Orchard.Security; +using Orchard.Security.Providers; +using Orchard.Utility.Extensions; + +namespace Orchard.Tests.Security { + [TestFixture] + public class DefaultEncryptionServiceTests { + private IContainer _container; + + [SetUp] + public void Init() { + + const string encryptionAlgorithm = "AES"; + const string hashAlgorithm = "HMACSHA256"; + + var shellSettings = new ShellSettings { + Name = "Foo", + DataProvider = "Bar", + DataConnectionString = "Quux", + EncryptionAlgorithm = encryptionAlgorithm, + EncryptionKey = SymmetricAlgorithm.Create(encryptionAlgorithm).Key.ToHexString(), + HashAlgorithm = hashAlgorithm, + HashKey = HMAC.Create(hashAlgorithm).Key.ToHexString() + }; + + var builder = new ContainerBuilder(); + builder.RegisterInstance(shellSettings); + builder.RegisterType().As(); + _container = builder.Build(); + } + + [Test] + public void CanEncodeAndDecodeData() { + var encryptionService = _container.Resolve(); + + var secretData = Encoding.Unicode.GetBytes("this is secret data"); + var encrypted = encryptionService.Encode(secretData); + var decrypted = encryptionService.Decode(encrypted); + + Assert.That(encrypted, Is.Not.EqualTo(decrypted)); + Assert.That(decrypted, Is.EqualTo(secretData)); + } + + [Test] + public void ShouldDetectTamperedData() { + var encryptionService = _container.Resolve(); + + var secretData = Encoding.Unicode.GetBytes("this is secret data"); + var encrypted = encryptionService.Encode(secretData); + + try { + // tamper the data + encrypted[encrypted.Length - 1] ^= 66; + var decrypted = encryptionService.Decode(encrypted); + } + catch { + return; + } + Assert.Fail(); + } + + [Test] + public void SuccessiveEncodeCallsShouldNotReturnTheSameData() { + var encryptionService = _container.Resolve(); + + var secretData = Encoding.Unicode.GetBytes("this is secret data"); + byte[] previousEncrypted = null; + for (int i = 0; i < 10; i++) { + var encrypted = encryptionService.Encode(secretData); + var decrypted = encryptionService.Decode(encrypted); + + Assert.That(encrypted, Is.Not.EqualTo(decrypted)); + Assert.That(decrypted, Is.EqualTo(secretData)); + + if(previousEncrypted != null) { + Assert.That(encrypted, Is.Not.EqualTo(previousEncrypted)); + } + previousEncrypted = encrypted; + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Services/ClockTests.cs b/src/Orchard.Tests/Services/ClockTests.cs index f97b1a98140..9f97b2b8248 100644 --- a/src/Orchard.Tests/Services/ClockTests.cs +++ b/src/Orchard.Tests/Services/ClockTests.cs @@ -1,38 +1,38 @@ -using System; -using System.Threading; -using NUnit.Framework; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.Services { - - [TestFixture] - public class ClockTests { - [Test] - public void StubClockShouldComeFromSystemUtcAndDoesNotComeFromSystemTime() { - var clock = new StubClock(); - var before = DateTime.UtcNow; - Thread.Sleep(2); - var mark = clock.UtcNow; - Thread.Sleep(2); - var after = DateTime.UtcNow; - - Assert.That(mark.Kind, Is.EqualTo(DateTimeKind.Utc)); - Assert.That(mark, Is.Not.InRange(before, after)); - } - - [Test] - public void StubClockCanBeManuallyAdvanced() { - var clock = new StubClock(); - var before = clock.UtcNow; - clock.Advance(TimeSpan.FromMilliseconds(2)); - var mark = clock.UtcNow; - clock.Advance(TimeSpan.FromMilliseconds(2)); - var after = clock.UtcNow; - - Assert.That(mark.Kind, Is.EqualTo(DateTimeKind.Utc)); - Assert.That(mark, Is.InRange(before, after)); - Assert.That(after.Subtract(before), Is.EqualTo(TimeSpan.FromMilliseconds(4))); - } - } -} - +using System; +using System.Threading; +using NUnit.Framework; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.Services { + + [TestFixture] + public class ClockTests { + [Test] + public void StubClockShouldComeFromSystemUtcAndDoesNotComeFromSystemTime() { + var clock = new StubClock(); + var before = DateTime.UtcNow; + Thread.Sleep(2); + var mark = clock.UtcNow; + Thread.Sleep(2); + var after = DateTime.UtcNow; + + Assert.That(mark.Kind, Is.EqualTo(DateTimeKind.Utc)); + Assert.That(mark, Is.Not.InRange(before, after)); + } + + [Test] + public void StubClockCanBeManuallyAdvanced() { + var clock = new StubClock(); + var before = clock.UtcNow; + clock.Advance(TimeSpan.FromMilliseconds(2)); + var mark = clock.UtcNow; + clock.Advance(TimeSpan.FromMilliseconds(2)); + var after = clock.UtcNow; + + Assert.That(mark.Kind, Is.EqualTo(DateTimeKind.Utc)); + Assert.That(mark, Is.InRange(before, after)); + Assert.That(after.Subtract(before), Is.EqualTo(TimeSpan.FromMilliseconds(4))); + } + } +} + diff --git a/src/Orchard.Tests/Services/JsonConverterTests.cs b/src/Orchard.Tests/Services/JsonConverterTests.cs index 4463bf6c075..83cefc8de17 100644 --- a/src/Orchard.Tests/Services/JsonConverterTests.cs +++ b/src/Orchard.Tests/Services/JsonConverterTests.cs @@ -1,47 +1,47 @@ -using System; -using NUnit.Framework; -using Newtonsoft.Json.Linq; -using Orchard.Services; - -namespace Orchard.Tests.Services { - - [TestFixture] - public class JsonConverterTests { - [Test] - public void ShouldConvertPrimitiveTypesToJSon() { - var converter = new DefaultJsonConverter(); - - Assert.That(converter.Serialize(12), Is.EqualTo("12")); - Assert.That(converter.Serialize(true), Is.EqualTo("true")); - Assert.That(converter.Serialize(12.345), Is.EqualTo("12.345")); - Assert.That(converter.Serialize("string"), Is.EqualTo("\"string\"")); - Assert.That(converter.Serialize(new DateTime(2013, 1, 31, 0, 0, 0, DateTimeKind.Utc)), Is.EqualTo("\"2013-01-31T00:00:00Z\"")); - } - - [Test] - public void ShouldConvertAnonymousTypeToJSon() { - dynamic d = JObject.Parse("{number:1000, str:'string', array: [1,2,3,4,5,6]}"); - - Assert.That((int)d.number, Is.EqualTo(1000)); - Assert.That((int)d["number"], Is.EqualTo(1000)); - Assert.That((int)d.array.Count, Is.EqualTo(6)); - } - - [Test] - public void ShouldConvertWellKnownTypeToJSon() { - var converter = new DefaultJsonConverter(); - string result = converter.Serialize(new Animal { Age = 12, Name = "Milou" }); - var o = converter.Deserialize(result); - - Assert.That(o.Age, Is.EqualTo(12)); - Assert.That(o.Name, Is.EqualTo("Milou")); - } - - - public class Animal { - public int Age { get; set; } - public string Name { get; set; } - } - } -} - +using System; +using NUnit.Framework; +using Newtonsoft.Json.Linq; +using Orchard.Services; + +namespace Orchard.Tests.Services { + + [TestFixture] + public class JsonConverterTests { + [Test] + public void ShouldConvertPrimitiveTypesToJSon() { + var converter = new DefaultJsonConverter(); + + Assert.That(converter.Serialize(12), Is.EqualTo("12")); + Assert.That(converter.Serialize(true), Is.EqualTo("true")); + Assert.That(converter.Serialize(12.345), Is.EqualTo("12.345")); + Assert.That(converter.Serialize("string"), Is.EqualTo("\"string\"")); + Assert.That(converter.Serialize(new DateTime(2013, 1, 31, 0, 0, 0, DateTimeKind.Utc)), Is.EqualTo("\"2013-01-31T00:00:00Z\"")); + } + + [Test] + public void ShouldConvertAnonymousTypeToJSon() { + dynamic d = JObject.Parse("{number:1000, str:'string', array: [1,2,3,4,5,6]}"); + + Assert.That((int)d.number, Is.EqualTo(1000)); + Assert.That((int)d["number"], Is.EqualTo(1000)); + Assert.That((int)d.array.Count, Is.EqualTo(6)); + } + + [Test] + public void ShouldConvertWellKnownTypeToJSon() { + var converter = new DefaultJsonConverter(); + string result = converter.Serialize(new Animal { Age = 12, Name = "Milou" }); + var o = converter.Deserialize(result); + + Assert.That(o.Age, Is.EqualTo(12)); + Assert.That(o.Name, Is.EqualTo("Milou")); + } + + + public class Animal { + public int Age { get; set; } + public string Name { get; set; } + } + } +} + diff --git a/src/Orchard.Tests/Storage/FileSystemStorageProviderTests.cs b/src/Orchard.Tests/Storage/FileSystemStorageProviderTests.cs index 227322733cd..80885263e4e 100644 --- a/src/Orchard.Tests/Storage/FileSystemStorageProviderTests.cs +++ b/src/Orchard.Tests/Storage/FileSystemStorageProviderTests.cs @@ -1,360 +1,360 @@ -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading; -using NUnit.Framework; -using System; -using Orchard.Environment; -using Orchard.Environment.Configuration; -using Orchard.FileSystems.Media; - -namespace Orchard.Tests.Storage { - [TestFixture] - public class FileSystemStorageProviderTests { - - [SetUp] - public void Init() { - _folderPath = Path.Combine(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Media"), ShellSettings.DefaultName); - _filePath = _folderPath + "\\testfile.txt"; - - if (Directory.Exists(_folderPath)) { - try { - Directory.Delete(_folderPath, true); - } - catch { - // happens sometimes - } - } - - Directory.CreateDirectory(_folderPath); - File.WriteAllText(_filePath, "testfile contents"); - - var subfolder1 = Path.Combine(_folderPath, "Subfolder1"); - Directory.CreateDirectory(subfolder1); - File.WriteAllText(Path.Combine(subfolder1, "one.txt"), "one contents"); - File.WriteAllText(Path.Combine(subfolder1, "two.txt"), "two contents"); - - var subsubfolder1 = Path.Combine(subfolder1, "SubSubfolder1"); - Directory.CreateDirectory(subsubfolder1); - - _storageProvider = new FileSystemStorageProvider(new ShellSettings { Name = ShellSettings.DefaultName }); - } - - [TearDown] - public void Term() { - try { - Directory.Delete(_folderPath, true); - } - catch (IOException) { - // if a system handle is still active give some time to release it - Thread.Sleep(0); - Directory.Delete(_folderPath, true); - } - } - - - private string _filePath; - private string _folderPath; - private IStorageProvider _storageProvider; - - [Test] - public void ExistsShouldBeTrueForExtistingFile() { - Assert.That(_storageProvider.FileExists("testfile.txt"), Is.True); - } - - [Test] - public void ExistsShouldBeFalseForNonExtistingFile() { - Assert.That(_storageProvider.FileExists("notexisting"), Is.False); - } - - [Test] - [ExpectedException(typeof(ArgumentException))] - public void GetFileThatDoesNotExistShouldThrow() { - _storageProvider.GetFile("notexisting"); - } - - [Test] - public void ListFilesShouldReturnFilesFromFilesystem() { - IEnumerable files = _storageProvider.ListFiles(_folderPath); - Assert.That(files.Count(), Is.EqualTo(1)); - } - - [Test] - public void ExistingFileIsReturnedWithShortPath() { - var file = _storageProvider.GetFile("testfile.txt"); - Assert.That(file, Is.Not.Null); - Assert.That(file.GetPath(), Is.EqualTo("testfile.txt")); - Assert.That(file.GetName(), Is.EqualTo("testfile.txt")); - } - - - [Test] - public void ListFilesReturnsItemsWithShortPathAndEnvironmentSlashes() { - var files = _storageProvider.ListFiles("Subfolder1"); - Assert.That(files, Is.Not.Null); - Assert.That(files.Count(), Is.EqualTo(2)); - var one = files.Single(x => x.GetName() == "one.txt"); - var two = files.Single(x => x.GetName() == "two.txt"); - - Assert.That(one.GetPath(), Is.EqualTo("Subfolder1" + Path.DirectorySeparatorChar + "one.txt")); - Assert.That(two.GetPath(), Is.EqualTo("Subfolder1" + Path.DirectorySeparatorChar + "two.txt")); - } - - - [Test] - public void AnySlashInGetFileBecomesEnvironmentAppropriate() { - var file1 = _storageProvider.GetFile(@"Subfolder1/one.txt"); - var file2 = _storageProvider.GetFile(@"Subfolder1\one.txt"); - Assert.That(file1.GetPath(), Is.EqualTo("Subfolder1" + Path.DirectorySeparatorChar + "one.txt")); - Assert.That(file2.GetPath(), Is.EqualTo("Subfolder1" + Path.DirectorySeparatorChar + "one.txt")); - } - - [Test] - public void ExistsShouldBeTrueForExtistingFolder() { - Assert.That(_storageProvider.FolderExists("Subfolder1"), Is.True); - } - - [Test] - public void ExistsShouldBeFalseForNonExtistingFolder() { - Assert.That(_storageProvider.FolderExists("notexisting"), Is.False); - } - - [Test] - public void ListFoldersReturnsItemsWithShortPathAndEnvironmentSlashes() { - var folders = _storageProvider.ListFolders(@"Subfolder1"); - Assert.That(folders, Is.Not.Null); - Assert.That(folders.Count(), Is.EqualTo(1)); - Assert.That(folders.Single().GetName(), Is.EqualTo("SubSubfolder1")); - Assert.That(folders.Single().GetPath(), Is.EqualTo(Path.Combine("Subfolder1", "SubSubfolder1"))); - } - - [Test] - public void ParentFolderPathIsStillShort() { - var subsubfolder = _storageProvider.ListFolders(@"Subfolder1").Single(); - var subfolder = subsubfolder.GetParent(); - Assert.That(subsubfolder.GetName(), Is.EqualTo("SubSubfolder1")); - Assert.That(subsubfolder.GetPath(), Is.EqualTo(Path.Combine("Subfolder1", "SubSubfolder1"))); - Assert.That(subfolder.GetName(), Is.EqualTo("Subfolder1")); - Assert.That(subfolder.GetPath(), Is.EqualTo("Subfolder1")); - } - - [Test] - public void CreateFolderAndDeleteFolderTakesAnySlash() { - Assert.That(_storageProvider.ListFolders(@"Subfolder1").Count(), Is.EqualTo(1)); - _storageProvider.CreateFolder(@"SubFolder1/SubSubFolder2"); - _storageProvider.CreateFolder(@"SubFolder1\SubSubFolder3"); - Assert.That(_storageProvider.ListFolders(@"Subfolder1").Count(), Is.EqualTo(3)); - _storageProvider.DeleteFolder(@"SubFolder1/SubSubFolder2"); - _storageProvider.DeleteFolder(@"SubFolder1\SubSubFolder3"); - Assert.That(_storageProvider.ListFolders(@"Subfolder1").Count(), Is.EqualTo(1)); - } - - private IStorageFolder GetFolder(string path) { - return _storageProvider.ListFolders(Path.GetDirectoryName(path)) - .SingleOrDefault(x => string.Equals(x.GetName(), Path.GetFileName(path), StringComparison.OrdinalIgnoreCase)); - } - private IStorageFile GetFile(string path) { - try { - return _storageProvider.GetFile(path); - } - catch (ArgumentException) { - return null; - } - } - - [Test] - public void ShouldCreateFolders() { - Directory.Delete(_folderPath, true); - _storageProvider.CreateFolder("foo/bar/baz"); - Assert.That(_storageProvider.ListFolders("").Count(), Is.EqualTo(1)); - Assert.That(_storageProvider.ListFolders("foo").Count(), Is.EqualTo(1)); - Assert.That(_storageProvider.ListFolders("foo/bar").Count(), Is.EqualTo(1)); - } - - [Test] - public void RenameFolderTakesShortPathWithAnyKindOfSlash() { - Assert.That(GetFolder(@"SubFolder1/SubSubFolder1"), Is.Not.Null); - _storageProvider.RenameFolder(@"SubFolder1\SubSubFolder1", @"SubFolder1/SubSubFolder2"); - _storageProvider.RenameFolder(@"SubFolder1\SubSubFolder2", @"SubFolder1\SubSubFolder3"); - _storageProvider.RenameFolder(@"SubFolder1/SubSubFolder3", @"SubFolder1\SubSubFolder4"); - _storageProvider.RenameFolder(@"SubFolder1/SubSubFolder4", @"SubFolder1/SubSubFolder5"); - Assert.That(GetFolder(Path.Combine("SubFolder1", "SubSubFolder1")), Is.Null); - Assert.That(GetFolder(Path.Combine("SubFolder1", "SubSubFolder2")), Is.Null); - Assert.That(GetFolder(Path.Combine("SubFolder1", "SubSubFolder3")), Is.Null); - Assert.That(GetFolder(Path.Combine("SubFolder1", "SubSubFolder4")), Is.Null); - Assert.That(GetFolder(Path.Combine("SubFolder1", "SubSubFolder5")), Is.Not.Null); - } - - - [Test] - public void CreateFileAndDeleteFileTakesAnySlash() { - Assert.That(_storageProvider.ListFiles(@"Subfolder1").Count(), Is.EqualTo(2)); - var alpha = _storageProvider.CreateFile(@"SubFolder1/alpha.txt"); - var beta = _storageProvider.CreateFile(@"SubFolder1\beta.txt"); - Assert.That(_storageProvider.ListFiles(@"Subfolder1").Count(), Is.EqualTo(4)); - Assert.That(alpha.GetPath(), Is.EqualTo(Path.Combine("SubFolder1", "alpha.txt"))); - Assert.That(beta.GetPath(), Is.EqualTo(Path.Combine("SubFolder1", "beta.txt"))); - _storageProvider.DeleteFile(@"SubFolder1\alpha.txt"); - _storageProvider.DeleteFile(@"SubFolder1/beta.txt"); - Assert.That(_storageProvider.ListFiles(@"Subfolder1").Count(), Is.EqualTo(2)); - } - - [Test] - public void RenameFileTakesShortPathWithAnyKindOfSlash() { - Assert.That(GetFile(@"Subfolder1/one.txt"), Is.Not.Null); - _storageProvider.RenameFile(@"SubFolder1\one.txt", @"SubFolder1/testfile2.txt"); - _storageProvider.RenameFile(@"SubFolder1\testfile2.txt", @"SubFolder1\testfile3.txt"); - _storageProvider.RenameFile(@"SubFolder1/testfile3.txt", @"SubFolder1\testfile4.txt"); - _storageProvider.RenameFile(@"SubFolder1/testfile4.txt", @"SubFolder1/testfile5.txt"); - Assert.That(GetFile(Path.Combine("SubFolder1", "one.txt")), Is.Null); - Assert.That(GetFile(Path.Combine("SubFolder1", "testfile2.txt")), Is.Null); - Assert.That(GetFile(Path.Combine("SubFolder1", "testfile3.txt")), Is.Null); - Assert.That(GetFile(Path.Combine("SubFolder1", "testfile4.txt")), Is.Null); - Assert.That(GetFile(Path.Combine("SubFolder1", "testfile5.txt")), Is.Not.Null); - } - - [Test] - public void GetFileFailsInInvalidPath() { - Assert.That(() => _storageProvider.GetFile(@"../InvalidFile.txt"), Throws.InstanceOf(typeof(ArgumentException))); - Assert.That(() => _storageProvider.GetFile(@"../../InvalidFile.txt"), Throws.InstanceOf(typeof(ArgumentException))); - - // Valid get one level up within the storage provider domain - _storageProvider.CreateFile(@"test.txt"); - Assert.That(_storageProvider.GetFile(@"test.txt"), Is.Not.Null); - Assert.That(_storageProvider.GetFile(@"SubFolder1\..\test.txt"), Is.Not.Null); - } - - [Test] - public void ListFilesFailsInInvalidPath() { - Assert.That(() => _storageProvider.ListFiles(@"../InvalidFolder"), Throws.InstanceOf(typeof(ArgumentException))); - Assert.That(() => _storageProvider.ListFiles(@"../../InvalidFolder"), Throws.InstanceOf(typeof(ArgumentException))); - - // Valid get one level up within the storage provider domain - Assert.That(_storageProvider.ListFiles(@"SubFolder1"), Is.Not.Null); - Assert.That(_storageProvider.ListFiles(@"SubFolder1\.."), Is.Not.Null); - } - - [Test] - public void ListFoldersFailsInInvalidPath() { - Assert.That(() => _storageProvider.ListFolders(@"../InvalidFolder"), Throws.InstanceOf(typeof(ArgumentException))); - Assert.That(() => _storageProvider.ListFolders(@"../../InvalidFolder"), Throws.InstanceOf(typeof(ArgumentException))); - - // Valid get one level up within the storage provider domain - Assert.That(_storageProvider.ListFolders(@"SubFolder1"), Is.Not.Null); - Assert.That(_storageProvider.ListFolders(@"SubFolder1\.."), Is.Not.Null); - } - - [Test] - public void TryCreateFolderFailsInInvalidPath() { - Assert.That(_storageProvider.TryCreateFolder(@"../InvalidFolder1"), Is.False); - Assert.That(_storageProvider.TryCreateFolder(@"../../InvalidFolder1"), Is.False); - - // Valid create one level up within the storage provider domain - Assert.That(_storageProvider.TryCreateFolder(@"SubFolder1\..\ValidFolder1"), Is.True); - } - - [Test] - public void CreateFolderFailsInInvalidPath() { - Assert.That(() => _storageProvider.CreateFolder(@"../InvalidFolder1"), Throws.InstanceOf(typeof(ArgumentException))); - Assert.That(() => _storageProvider.CreateFolder(@"../../InvalidFolder1"), Throws.InstanceOf(typeof(ArgumentException))); - - // Valid create one level up within the storage provider domain - _storageProvider.CreateFolder(@"SubFolder1\..\ValidFolder1"); - Assert.That(GetFolder("ValidFolder1"), Is.Not.Null); - } - - [Test] - public void DeleteFolderFailsInInvalidPath() { - Assert.That(() => _storageProvider.DeleteFolder(@"../InvalidFolder1"), Throws.InstanceOf(typeof(ArgumentException))); - Assert.That(() => _storageProvider.DeleteFolder(@"../../InvalidFolder1"), Throws.InstanceOf(typeof(ArgumentException))); - - // Valid create one level up within the storage provider domain - Assert.That(GetFolder("SubFolder1"), Is.Not.Null); - _storageProvider.DeleteFolder(@"SubFolder1\..\SubFolder1"); - Assert.That(GetFolder("SubFolder1"), Is.Null); - } - - [Test] - public void RenameFolderFailsInInvalidPath() { - Assert.That(GetFolder(@"SubFolder1/SubSubFolder1"), Is.Not.Null); - Assert.That(() => _storageProvider.RenameFolder(@"SubFolder1", @"../SubSubFolder1"), Throws.InstanceOf(typeof(ArgumentException))); - Assert.That(() => _storageProvider.RenameFolder(@"SubFolder1", @"../../SubSubFolder1"), Throws.InstanceOf(typeof(ArgumentException))); - - // Valid move one level up within the storage provider domain - _storageProvider.RenameFolder(@"SubFolder1\SubSubFolder1", @"SubFolder1\..\SubSubFolder1"); - Assert.That(GetFolder("SubSubFolder1"), Is.Not.Null); - - _storageProvider.CreateFolder(@"SubFolder1\SubSubFolder1\SubSubSubFolder1"); - _storageProvider.RenameFolder(@"SubFolder1\SubSubFolder1\SubSubSubFolder1", @"SubFolder1\SubSubFolder1\..\SubSubSubFolder1"); - Assert.That(GetFolder(@"SubFolder1\SubSubSubFolder1"), Is.Not.Null); - } - - [Test] - public void DeleteFileFailsInInvalidPath() { - Assert.That(() => _storageProvider.DeleteFile(@"../test.txt"), Throws.InstanceOf(typeof(ArgumentException))); - Assert.That(() => _storageProvider.DeleteFile(@"../test.txt"), Throws.InstanceOf(typeof(ArgumentException))); - - // Valid move one level up within the storage provider domain - _storageProvider.CreateFile(@"test.txt"); - Assert.That(GetFile("test.txt"), Is.Not.Null); - _storageProvider.DeleteFile(@"test.txt"); - Assert.That(GetFile("test.txt"), Is.Null); - - _storageProvider.CreateFile(@"test.txt"); - Assert.That(GetFile("test.txt"), Is.Not.Null); - _storageProvider.DeleteFile(@"SubFolder1\..\test.txt"); - Assert.That(GetFile("test.txt"), Is.Null); - } - - [Test] - public void RenameFileFailsInInvalidPath() { - Assert.That(() => _storageProvider.RenameFile(@"../test.txt", "invalid.txt"), Throws.InstanceOf(typeof(ArgumentException))); - Assert.That(() => _storageProvider.RenameFile(@"../test.txt", "invalid.txt"), Throws.InstanceOf(typeof(ArgumentException))); - - // Valid move one level up within the storage provider domain - _storageProvider.CreateFile(@"test.txt"); - Assert.That(GetFile("test.txt"), Is.Not.Null); - _storageProvider.RenameFile(@"test.txt", "newName.txt"); - Assert.That(GetFile("newName.txt"), Is.Not.Null); - _storageProvider.RenameFile(@"SubFolder1\..\newName.txt", "newNewName.txt"); - Assert.That(GetFile("newNewName.txt"), Is.Not.Null); - } - - [Test] - public void CreateFileFailsInInvalidPath() { - Assert.That(() => _storageProvider.CreateFile(@"../InvalidFolder1.txt"), Throws.InstanceOf(typeof(ArgumentException))); - Assert.That(() => _storageProvider.CreateFile(@"../../InvalidFolder1.txt"), Throws.InstanceOf(typeof(ArgumentException))); - - // Valid create one level up within the storage provider domain - _storageProvider.CreateFile(@"SubFolder1\..\ValidFolder1.txt"); - Assert.That(GetFile("ValidFolder1.txt"), Is.Not.Null); - } - - [Test] - public void SaveStreamFailsInInvalidPath() { - _storageProvider.CreateFile(@"test.txt"); - - using (Stream stream = GetFile("test.txt").OpenRead()) { - Assert.That(() => _storageProvider.SaveStream(@"../newTest.txt", stream), Throws.InstanceOf(typeof(ArgumentException))); - Assert.That(() => _storageProvider.SaveStream(@"../../newTest.txt", stream), Throws.InstanceOf(typeof(ArgumentException))); - - // Valid create one level up within the storage provider domain - _storageProvider.SaveStream(@"SubFolder1\..\newTest.txt", stream); - Assert.That(GetFile("newTest.txt"), Is.Not.Null); - } - } - - [Test] - public void TrySaveStreamFailsInInvalidPath() { - _storageProvider.CreateFile(@"test.txt"); - - using (Stream stream = GetFile("test.txt").OpenRead()) { - Assert.That(_storageProvider.TrySaveStream(@"../newTest.txt", stream), Is.False); - Assert.That(_storageProvider.TrySaveStream(@"../../newTest.txt", stream), Is.False); - - // Valid create one level up within the storage provider domain - Assert.That(_storageProvider.TrySaveStream(@"SubFolder1\..\newTest.txt", stream), Is.True); - } - } - } -} +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading; +using NUnit.Framework; +using System; +using Orchard.Environment; +using Orchard.Environment.Configuration; +using Orchard.FileSystems.Media; + +namespace Orchard.Tests.Storage { + [TestFixture] + public class FileSystemStorageProviderTests { + + [SetUp] + public void Init() { + _folderPath = Path.Combine(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Media"), ShellSettings.DefaultName); + _filePath = _folderPath + "\\testfile.txt"; + + if (Directory.Exists(_folderPath)) { + try { + Directory.Delete(_folderPath, true); + } + catch { + // happens sometimes + } + } + + Directory.CreateDirectory(_folderPath); + File.WriteAllText(_filePath, "testfile contents"); + + var subfolder1 = Path.Combine(_folderPath, "Subfolder1"); + Directory.CreateDirectory(subfolder1); + File.WriteAllText(Path.Combine(subfolder1, "one.txt"), "one contents"); + File.WriteAllText(Path.Combine(subfolder1, "two.txt"), "two contents"); + + var subsubfolder1 = Path.Combine(subfolder1, "SubSubfolder1"); + Directory.CreateDirectory(subsubfolder1); + + _storageProvider = new FileSystemStorageProvider(new ShellSettings { Name = ShellSettings.DefaultName }); + } + + [TearDown] + public void Term() { + try { + Directory.Delete(_folderPath, true); + } + catch (IOException) { + // if a system handle is still active give some time to release it + Thread.Sleep(0); + Directory.Delete(_folderPath, true); + } + } + + + private string _filePath; + private string _folderPath; + private IStorageProvider _storageProvider; + + [Test] + public void ExistsShouldBeTrueForExtistingFile() { + Assert.That(_storageProvider.FileExists("testfile.txt"), Is.True); + } + + [Test] + public void ExistsShouldBeFalseForNonExtistingFile() { + Assert.That(_storageProvider.FileExists("notexisting"), Is.False); + } + + [Test] + [ExpectedException(typeof(ArgumentException))] + public void GetFileThatDoesNotExistShouldThrow() { + _storageProvider.GetFile("notexisting"); + } + + [Test] + public void ListFilesShouldReturnFilesFromFilesystem() { + IEnumerable files = _storageProvider.ListFiles(_folderPath); + Assert.That(files.Count(), Is.EqualTo(1)); + } + + [Test] + public void ExistingFileIsReturnedWithShortPath() { + var file = _storageProvider.GetFile("testfile.txt"); + Assert.That(file, Is.Not.Null); + Assert.That(file.GetPath(), Is.EqualTo("testfile.txt")); + Assert.That(file.GetName(), Is.EqualTo("testfile.txt")); + } + + + [Test] + public void ListFilesReturnsItemsWithShortPathAndEnvironmentSlashes() { + var files = _storageProvider.ListFiles("Subfolder1"); + Assert.That(files, Is.Not.Null); + Assert.That(files.Count(), Is.EqualTo(2)); + var one = files.Single(x => x.GetName() == "one.txt"); + var two = files.Single(x => x.GetName() == "two.txt"); + + Assert.That(one.GetPath(), Is.EqualTo("Subfolder1" + Path.DirectorySeparatorChar + "one.txt")); + Assert.That(two.GetPath(), Is.EqualTo("Subfolder1" + Path.DirectorySeparatorChar + "two.txt")); + } + + + [Test] + public void AnySlashInGetFileBecomesEnvironmentAppropriate() { + var file1 = _storageProvider.GetFile(@"Subfolder1/one.txt"); + var file2 = _storageProvider.GetFile(@"Subfolder1\one.txt"); + Assert.That(file1.GetPath(), Is.EqualTo("Subfolder1" + Path.DirectorySeparatorChar + "one.txt")); + Assert.That(file2.GetPath(), Is.EqualTo("Subfolder1" + Path.DirectorySeparatorChar + "one.txt")); + } + + [Test] + public void ExistsShouldBeTrueForExtistingFolder() { + Assert.That(_storageProvider.FolderExists("Subfolder1"), Is.True); + } + + [Test] + public void ExistsShouldBeFalseForNonExtistingFolder() { + Assert.That(_storageProvider.FolderExists("notexisting"), Is.False); + } + + [Test] + public void ListFoldersReturnsItemsWithShortPathAndEnvironmentSlashes() { + var folders = _storageProvider.ListFolders(@"Subfolder1"); + Assert.That(folders, Is.Not.Null); + Assert.That(folders.Count(), Is.EqualTo(1)); + Assert.That(folders.Single().GetName(), Is.EqualTo("SubSubfolder1")); + Assert.That(folders.Single().GetPath(), Is.EqualTo(Path.Combine("Subfolder1", "SubSubfolder1"))); + } + + [Test] + public void ParentFolderPathIsStillShort() { + var subsubfolder = _storageProvider.ListFolders(@"Subfolder1").Single(); + var subfolder = subsubfolder.GetParent(); + Assert.That(subsubfolder.GetName(), Is.EqualTo("SubSubfolder1")); + Assert.That(subsubfolder.GetPath(), Is.EqualTo(Path.Combine("Subfolder1", "SubSubfolder1"))); + Assert.That(subfolder.GetName(), Is.EqualTo("Subfolder1")); + Assert.That(subfolder.GetPath(), Is.EqualTo("Subfolder1")); + } + + [Test] + public void CreateFolderAndDeleteFolderTakesAnySlash() { + Assert.That(_storageProvider.ListFolders(@"Subfolder1").Count(), Is.EqualTo(1)); + _storageProvider.CreateFolder(@"SubFolder1/SubSubFolder2"); + _storageProvider.CreateFolder(@"SubFolder1\SubSubFolder3"); + Assert.That(_storageProvider.ListFolders(@"Subfolder1").Count(), Is.EqualTo(3)); + _storageProvider.DeleteFolder(@"SubFolder1/SubSubFolder2"); + _storageProvider.DeleteFolder(@"SubFolder1\SubSubFolder3"); + Assert.That(_storageProvider.ListFolders(@"Subfolder1").Count(), Is.EqualTo(1)); + } + + private IStorageFolder GetFolder(string path) { + return _storageProvider.ListFolders(Path.GetDirectoryName(path)) + .SingleOrDefault(x => string.Equals(x.GetName(), Path.GetFileName(path), StringComparison.OrdinalIgnoreCase)); + } + private IStorageFile GetFile(string path) { + try { + return _storageProvider.GetFile(path); + } + catch (ArgumentException) { + return null; + } + } + + [Test] + public void ShouldCreateFolders() { + Directory.Delete(_folderPath, true); + _storageProvider.CreateFolder("foo/bar/baz"); + Assert.That(_storageProvider.ListFolders("").Count(), Is.EqualTo(1)); + Assert.That(_storageProvider.ListFolders("foo").Count(), Is.EqualTo(1)); + Assert.That(_storageProvider.ListFolders("foo/bar").Count(), Is.EqualTo(1)); + } + + [Test] + public void RenameFolderTakesShortPathWithAnyKindOfSlash() { + Assert.That(GetFolder(@"SubFolder1/SubSubFolder1"), Is.Not.Null); + _storageProvider.RenameFolder(@"SubFolder1\SubSubFolder1", @"SubFolder1/SubSubFolder2"); + _storageProvider.RenameFolder(@"SubFolder1\SubSubFolder2", @"SubFolder1\SubSubFolder3"); + _storageProvider.RenameFolder(@"SubFolder1/SubSubFolder3", @"SubFolder1\SubSubFolder4"); + _storageProvider.RenameFolder(@"SubFolder1/SubSubFolder4", @"SubFolder1/SubSubFolder5"); + Assert.That(GetFolder(Path.Combine("SubFolder1", "SubSubFolder1")), Is.Null); + Assert.That(GetFolder(Path.Combine("SubFolder1", "SubSubFolder2")), Is.Null); + Assert.That(GetFolder(Path.Combine("SubFolder1", "SubSubFolder3")), Is.Null); + Assert.That(GetFolder(Path.Combine("SubFolder1", "SubSubFolder4")), Is.Null); + Assert.That(GetFolder(Path.Combine("SubFolder1", "SubSubFolder5")), Is.Not.Null); + } + + + [Test] + public void CreateFileAndDeleteFileTakesAnySlash() { + Assert.That(_storageProvider.ListFiles(@"Subfolder1").Count(), Is.EqualTo(2)); + var alpha = _storageProvider.CreateFile(@"SubFolder1/alpha.txt"); + var beta = _storageProvider.CreateFile(@"SubFolder1\beta.txt"); + Assert.That(_storageProvider.ListFiles(@"Subfolder1").Count(), Is.EqualTo(4)); + Assert.That(alpha.GetPath(), Is.EqualTo(Path.Combine("SubFolder1", "alpha.txt"))); + Assert.That(beta.GetPath(), Is.EqualTo(Path.Combine("SubFolder1", "beta.txt"))); + _storageProvider.DeleteFile(@"SubFolder1\alpha.txt"); + _storageProvider.DeleteFile(@"SubFolder1/beta.txt"); + Assert.That(_storageProvider.ListFiles(@"Subfolder1").Count(), Is.EqualTo(2)); + } + + [Test] + public void RenameFileTakesShortPathWithAnyKindOfSlash() { + Assert.That(GetFile(@"Subfolder1/one.txt"), Is.Not.Null); + _storageProvider.RenameFile(@"SubFolder1\one.txt", @"SubFolder1/testfile2.txt"); + _storageProvider.RenameFile(@"SubFolder1\testfile2.txt", @"SubFolder1\testfile3.txt"); + _storageProvider.RenameFile(@"SubFolder1/testfile3.txt", @"SubFolder1\testfile4.txt"); + _storageProvider.RenameFile(@"SubFolder1/testfile4.txt", @"SubFolder1/testfile5.txt"); + Assert.That(GetFile(Path.Combine("SubFolder1", "one.txt")), Is.Null); + Assert.That(GetFile(Path.Combine("SubFolder1", "testfile2.txt")), Is.Null); + Assert.That(GetFile(Path.Combine("SubFolder1", "testfile3.txt")), Is.Null); + Assert.That(GetFile(Path.Combine("SubFolder1", "testfile4.txt")), Is.Null); + Assert.That(GetFile(Path.Combine("SubFolder1", "testfile5.txt")), Is.Not.Null); + } + + [Test] + public void GetFileFailsInInvalidPath() { + Assert.That(() => _storageProvider.GetFile(@"../InvalidFile.txt"), Throws.InstanceOf(typeof(ArgumentException))); + Assert.That(() => _storageProvider.GetFile(@"../../InvalidFile.txt"), Throws.InstanceOf(typeof(ArgumentException))); + + // Valid get one level up within the storage provider domain + _storageProvider.CreateFile(@"test.txt"); + Assert.That(_storageProvider.GetFile(@"test.txt"), Is.Not.Null); + Assert.That(_storageProvider.GetFile(@"SubFolder1\..\test.txt"), Is.Not.Null); + } + + [Test] + public void ListFilesFailsInInvalidPath() { + Assert.That(() => _storageProvider.ListFiles(@"../InvalidFolder"), Throws.InstanceOf(typeof(ArgumentException))); + Assert.That(() => _storageProvider.ListFiles(@"../../InvalidFolder"), Throws.InstanceOf(typeof(ArgumentException))); + + // Valid get one level up within the storage provider domain + Assert.That(_storageProvider.ListFiles(@"SubFolder1"), Is.Not.Null); + Assert.That(_storageProvider.ListFiles(@"SubFolder1\.."), Is.Not.Null); + } + + [Test] + public void ListFoldersFailsInInvalidPath() { + Assert.That(() => _storageProvider.ListFolders(@"../InvalidFolder"), Throws.InstanceOf(typeof(ArgumentException))); + Assert.That(() => _storageProvider.ListFolders(@"../../InvalidFolder"), Throws.InstanceOf(typeof(ArgumentException))); + + // Valid get one level up within the storage provider domain + Assert.That(_storageProvider.ListFolders(@"SubFolder1"), Is.Not.Null); + Assert.That(_storageProvider.ListFolders(@"SubFolder1\.."), Is.Not.Null); + } + + [Test] + public void TryCreateFolderFailsInInvalidPath() { + Assert.That(_storageProvider.TryCreateFolder(@"../InvalidFolder1"), Is.False); + Assert.That(_storageProvider.TryCreateFolder(@"../../InvalidFolder1"), Is.False); + + // Valid create one level up within the storage provider domain + Assert.That(_storageProvider.TryCreateFolder(@"SubFolder1\..\ValidFolder1"), Is.True); + } + + [Test] + public void CreateFolderFailsInInvalidPath() { + Assert.That(() => _storageProvider.CreateFolder(@"../InvalidFolder1"), Throws.InstanceOf(typeof(ArgumentException))); + Assert.That(() => _storageProvider.CreateFolder(@"../../InvalidFolder1"), Throws.InstanceOf(typeof(ArgumentException))); + + // Valid create one level up within the storage provider domain + _storageProvider.CreateFolder(@"SubFolder1\..\ValidFolder1"); + Assert.That(GetFolder("ValidFolder1"), Is.Not.Null); + } + + [Test] + public void DeleteFolderFailsInInvalidPath() { + Assert.That(() => _storageProvider.DeleteFolder(@"../InvalidFolder1"), Throws.InstanceOf(typeof(ArgumentException))); + Assert.That(() => _storageProvider.DeleteFolder(@"../../InvalidFolder1"), Throws.InstanceOf(typeof(ArgumentException))); + + // Valid create one level up within the storage provider domain + Assert.That(GetFolder("SubFolder1"), Is.Not.Null); + _storageProvider.DeleteFolder(@"SubFolder1\..\SubFolder1"); + Assert.That(GetFolder("SubFolder1"), Is.Null); + } + + [Test] + public void RenameFolderFailsInInvalidPath() { + Assert.That(GetFolder(@"SubFolder1/SubSubFolder1"), Is.Not.Null); + Assert.That(() => _storageProvider.RenameFolder(@"SubFolder1", @"../SubSubFolder1"), Throws.InstanceOf(typeof(ArgumentException))); + Assert.That(() => _storageProvider.RenameFolder(@"SubFolder1", @"../../SubSubFolder1"), Throws.InstanceOf(typeof(ArgumentException))); + + // Valid move one level up within the storage provider domain + _storageProvider.RenameFolder(@"SubFolder1\SubSubFolder1", @"SubFolder1\..\SubSubFolder1"); + Assert.That(GetFolder("SubSubFolder1"), Is.Not.Null); + + _storageProvider.CreateFolder(@"SubFolder1\SubSubFolder1\SubSubSubFolder1"); + _storageProvider.RenameFolder(@"SubFolder1\SubSubFolder1\SubSubSubFolder1", @"SubFolder1\SubSubFolder1\..\SubSubSubFolder1"); + Assert.That(GetFolder(@"SubFolder1\SubSubSubFolder1"), Is.Not.Null); + } + + [Test] + public void DeleteFileFailsInInvalidPath() { + Assert.That(() => _storageProvider.DeleteFile(@"../test.txt"), Throws.InstanceOf(typeof(ArgumentException))); + Assert.That(() => _storageProvider.DeleteFile(@"../test.txt"), Throws.InstanceOf(typeof(ArgumentException))); + + // Valid move one level up within the storage provider domain + _storageProvider.CreateFile(@"test.txt"); + Assert.That(GetFile("test.txt"), Is.Not.Null); + _storageProvider.DeleteFile(@"test.txt"); + Assert.That(GetFile("test.txt"), Is.Null); + + _storageProvider.CreateFile(@"test.txt"); + Assert.That(GetFile("test.txt"), Is.Not.Null); + _storageProvider.DeleteFile(@"SubFolder1\..\test.txt"); + Assert.That(GetFile("test.txt"), Is.Null); + } + + [Test] + public void RenameFileFailsInInvalidPath() { + Assert.That(() => _storageProvider.RenameFile(@"../test.txt", "invalid.txt"), Throws.InstanceOf(typeof(ArgumentException))); + Assert.That(() => _storageProvider.RenameFile(@"../test.txt", "invalid.txt"), Throws.InstanceOf(typeof(ArgumentException))); + + // Valid move one level up within the storage provider domain + _storageProvider.CreateFile(@"test.txt"); + Assert.That(GetFile("test.txt"), Is.Not.Null); + _storageProvider.RenameFile(@"test.txt", "newName.txt"); + Assert.That(GetFile("newName.txt"), Is.Not.Null); + _storageProvider.RenameFile(@"SubFolder1\..\newName.txt", "newNewName.txt"); + Assert.That(GetFile("newNewName.txt"), Is.Not.Null); + } + + [Test] + public void CreateFileFailsInInvalidPath() { + Assert.That(() => _storageProvider.CreateFile(@"../InvalidFolder1.txt"), Throws.InstanceOf(typeof(ArgumentException))); + Assert.That(() => _storageProvider.CreateFile(@"../../InvalidFolder1.txt"), Throws.InstanceOf(typeof(ArgumentException))); + + // Valid create one level up within the storage provider domain + _storageProvider.CreateFile(@"SubFolder1\..\ValidFolder1.txt"); + Assert.That(GetFile("ValidFolder1.txt"), Is.Not.Null); + } + + [Test] + public void SaveStreamFailsInInvalidPath() { + _storageProvider.CreateFile(@"test.txt"); + + using (Stream stream = GetFile("test.txt").OpenRead()) { + Assert.That(() => _storageProvider.SaveStream(@"../newTest.txt", stream), Throws.InstanceOf(typeof(ArgumentException))); + Assert.That(() => _storageProvider.SaveStream(@"../../newTest.txt", stream), Throws.InstanceOf(typeof(ArgumentException))); + + // Valid create one level up within the storage provider domain + _storageProvider.SaveStream(@"SubFolder1\..\newTest.txt", stream); + Assert.That(GetFile("newTest.txt"), Is.Not.Null); + } + } + + [Test] + public void TrySaveStreamFailsInInvalidPath() { + _storageProvider.CreateFile(@"test.txt"); + + using (Stream stream = GetFile("test.txt").OpenRead()) { + Assert.That(_storageProvider.TrySaveStream(@"../newTest.txt", stream), Is.False); + Assert.That(_storageProvider.TrySaveStream(@"../../newTest.txt", stream), Is.False); + + // Valid create one level up within the storage provider domain + Assert.That(_storageProvider.TrySaveStream(@"SubFolder1\..\newTest.txt", stream), Is.True); + } + } + } +} diff --git a/src/Orchard.Tests/Stubs/InMemoryWebSiteFolder.cs b/src/Orchard.Tests/Stubs/InMemoryWebSiteFolder.cs index 2a5fa7d79e7..af77fc7abfe 100644 --- a/src/Orchard.Tests/Stubs/InMemoryWebSiteFolder.cs +++ b/src/Orchard.Tests/Stubs/InMemoryWebSiteFolder.cs @@ -1,57 +1,57 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Orchard.Caching; -using Orchard.FileSystems.WebSite; - -namespace Orchard.Tests.Stubs { - public class InMemoryWebSiteFolder : IWebSiteFolder { - Dictionary _contents = new Dictionary(StringComparer.OrdinalIgnoreCase); - - public void AddFile(string virtualPath, string contents) { - _contents[Canonical(virtualPath)] = contents; - } - - private string Canonical(string virtualPath) { - return virtualPath.Replace("\\", "/"); - } - - public IEnumerable ListDirectories(string virtualPath) { - throw new NotImplementedException(); - } - - public IEnumerable ListFiles(string virtualPath, bool recursive) { - throw new NotImplementedException(); - } - - public bool FileExists(string virtualPath) { - return _contents.ContainsKey(virtualPath); - } - - public string ReadFile(string virtualPath) { - string value; - return _contents.TryGetValue(Canonical(virtualPath), out value) ? value : null; - } - - public string ReadFile(string virtualPath, bool actualContent) { - throw new NotImplementedException(); - } - - public void CopyFileTo(string virtualPath, Stream destination) { - string value; - if (_contents.TryGetValue(Canonical(virtualPath), out value)) { - var bytes = Encoding.Default.GetBytes(value); - destination.Write(bytes, 0, bytes.Length); - } - } - - public void CopyFileTo(string virtualPath, Stream destination, bool actualContent) { - throw new NotImplementedException(); - } - - public IVolatileToken WhenPathChanges(string virtualPath) { - throw new NotImplementedException(); - } - } +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using Orchard.Caching; +using Orchard.FileSystems.WebSite; + +namespace Orchard.Tests.Stubs { + public class InMemoryWebSiteFolder : IWebSiteFolder { + Dictionary _contents = new Dictionary(StringComparer.OrdinalIgnoreCase); + + public void AddFile(string virtualPath, string contents) { + _contents[Canonical(virtualPath)] = contents; + } + + private string Canonical(string virtualPath) { + return virtualPath.Replace("\\", "/"); + } + + public IEnumerable ListDirectories(string virtualPath) { + throw new NotImplementedException(); + } + + public IEnumerable ListFiles(string virtualPath, bool recursive) { + throw new NotImplementedException(); + } + + public bool FileExists(string virtualPath) { + return _contents.ContainsKey(virtualPath); + } + + public string ReadFile(string virtualPath) { + string value; + return _contents.TryGetValue(Canonical(virtualPath), out value) ? value : null; + } + + public string ReadFile(string virtualPath, bool actualContent) { + throw new NotImplementedException(); + } + + public void CopyFileTo(string virtualPath, Stream destination) { + string value; + if (_contents.TryGetValue(Canonical(virtualPath), out value)) { + var bytes = Encoding.Default.GetBytes(value); + destination.Write(bytes, 0, bytes.Length); + } + } + + public void CopyFileTo(string virtualPath, Stream destination, bool actualContent) { + throw new NotImplementedException(); + } + + public IVolatileToken WhenPathChanges(string virtualPath) { + throw new NotImplementedException(); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Stubs/StubAppDataFolder.cs b/src/Orchard.Tests/Stubs/StubAppDataFolder.cs index e6844170172..263eed21aec 100644 --- a/src/Orchard.Tests/Stubs/StubAppDataFolder.cs +++ b/src/Orchard.Tests/Stubs/StubAppDataFolder.cs @@ -1,123 +1,123 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Orchard.Caching; -using Orchard.FileSystems.AppData; -using Orchard.Services; - -namespace Orchard.Tests.Stubs { - public class StubAppDataFolder : IAppDataFolder { - private readonly IClock _clock; - private readonly StubFileSystem _fileSystem; - - public StubAppDataFolder(IClock clock) { - _clock = clock; - _fileSystem = new StubFileSystem(_clock); - } - - public StubFileSystem FileSystem { - get { return _fileSystem; } - } - - public IEnumerable ListFiles(string path) { - var entry = _fileSystem.GetDirectoryEntry(path); - if (entry == null) - throw new ArgumentException(); - - return entry.Entries.Where(e => e is StubFileSystem.FileEntry).Select(e => Combine(path, e.Name)); - } - - public IEnumerable ListDirectories(string path) { - var entry = _fileSystem.GetDirectoryEntry(path); - if (entry == null) - throw new ArgumentException(); - - return entry.Entries.Where(e => e is StubFileSystem.DirectoryEntry).Select(e => Combine(path, e.Name)); - } - - public bool FileExists(string path) { - return _fileSystem.GetFileEntry(path) != null; - } - - public string Combine(params string[] paths) { - return Path.Combine(paths).Replace(Path.DirectorySeparatorChar, '/'); - } - - public void CreateFile(string path, string content) { - using (var stream = CreateFile(path)) { - using (var writer = new StreamWriter(stream)) { - writer.Write(content); - } - } - } - - public Stream CreateFile(string path) { - return _fileSystem.CreateFile(path); - } - - public string ReadFile(string path) { - using (var stream = OpenFile(path)) { - using (var reader = new StreamReader(stream)) { - return reader.ReadToEnd(); - } - } - } - - public Stream OpenFile(string path) { - return _fileSystem.OpenFile(path); - } - - public void StoreFile(string sourceFileName, string destinationPath) { - using (var inputStream = File.OpenRead(sourceFileName)) { - using (var outputStream = _fileSystem.CreateFile(destinationPath)) { - byte[] buffer = new byte[1024]; - for (; ; ) { - var count = inputStream.Read(buffer, 0, buffer.Length); - if (count == 0) - break; - outputStream.Write(buffer, 0, count); - } - } - } - } - - public void DeleteFile(string path) { - _fileSystem.DeleteFile(path); - } - - public DateTime GetFileLastWriteTimeUtc(string path) { - var entry = _fileSystem.GetFileEntry(path); - if (entry == null) - throw new ArgumentException(); - return entry.LastWriteTimeUtc; - } - - public void CreateDirectory(string path) { - _fileSystem.CreateDirectoryEntry(path); - } - - public bool DirectoryExists(string path) { - return _fileSystem.GetDirectoryEntry(path) != null; - } - - public IVolatileToken WhenPathChanges(string path) { - return _fileSystem.WhenPathChanges(path); - } - - public string MapPath(string path) { - throw new NotImplementedException(); - } - - public string GetVirtualPath(string path) { - throw new NotImplementedException(); - } - - public DateTime GetLastWriteTimeUtc(string path) { - var entry = _fileSystem.GetFileEntry(path); - if (entry == null) - throw new InvalidOperationException(); - return entry.LastWriteTimeUtc; - } - } +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Orchard.Caching; +using Orchard.FileSystems.AppData; +using Orchard.Services; + +namespace Orchard.Tests.Stubs { + public class StubAppDataFolder : IAppDataFolder { + private readonly IClock _clock; + private readonly StubFileSystem _fileSystem; + + public StubAppDataFolder(IClock clock) { + _clock = clock; + _fileSystem = new StubFileSystem(_clock); + } + + public StubFileSystem FileSystem { + get { return _fileSystem; } + } + + public IEnumerable ListFiles(string path) { + var entry = _fileSystem.GetDirectoryEntry(path); + if (entry == null) + throw new ArgumentException(); + + return entry.Entries.Where(e => e is StubFileSystem.FileEntry).Select(e => Combine(path, e.Name)); + } + + public IEnumerable ListDirectories(string path) { + var entry = _fileSystem.GetDirectoryEntry(path); + if (entry == null) + throw new ArgumentException(); + + return entry.Entries.Where(e => e is StubFileSystem.DirectoryEntry).Select(e => Combine(path, e.Name)); + } + + public bool FileExists(string path) { + return _fileSystem.GetFileEntry(path) != null; + } + + public string Combine(params string[] paths) { + return Path.Combine(paths).Replace(Path.DirectorySeparatorChar, '/'); + } + + public void CreateFile(string path, string content) { + using (var stream = CreateFile(path)) { + using (var writer = new StreamWriter(stream)) { + writer.Write(content); + } + } + } + + public Stream CreateFile(string path) { + return _fileSystem.CreateFile(path); + } + + public string ReadFile(string path) { + using (var stream = OpenFile(path)) { + using (var reader = new StreamReader(stream)) { + return reader.ReadToEnd(); + } + } + } + + public Stream OpenFile(string path) { + return _fileSystem.OpenFile(path); + } + + public void StoreFile(string sourceFileName, string destinationPath) { + using (var inputStream = File.OpenRead(sourceFileName)) { + using (var outputStream = _fileSystem.CreateFile(destinationPath)) { + byte[] buffer = new byte[1024]; + for (; ; ) { + var count = inputStream.Read(buffer, 0, buffer.Length); + if (count == 0) + break; + outputStream.Write(buffer, 0, count); + } + } + } + } + + public void DeleteFile(string path) { + _fileSystem.DeleteFile(path); + } + + public DateTime GetFileLastWriteTimeUtc(string path) { + var entry = _fileSystem.GetFileEntry(path); + if (entry == null) + throw new ArgumentException(); + return entry.LastWriteTimeUtc; + } + + public void CreateDirectory(string path) { + _fileSystem.CreateDirectoryEntry(path); + } + + public bool DirectoryExists(string path) { + return _fileSystem.GetDirectoryEntry(path) != null; + } + + public IVolatileToken WhenPathChanges(string path) { + return _fileSystem.WhenPathChanges(path); + } + + public string MapPath(string path) { + throw new NotImplementedException(); + } + + public string GetVirtualPath(string path) { + throw new NotImplementedException(); + } + + public DateTime GetLastWriteTimeUtc(string path) { + var entry = _fileSystem.GetFileEntry(path); + if (entry == null) + throw new InvalidOperationException(); + return entry.LastWriteTimeUtc; + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Stubs/StubCacheManager.cs b/src/Orchard.Tests/Stubs/StubCacheManager.cs index 308e48da1e5..58236d1d350 100644 --- a/src/Orchard.Tests/Stubs/StubCacheManager.cs +++ b/src/Orchard.Tests/Stubs/StubCacheManager.cs @@ -1,49 +1,49 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Orchard.Caching; - -namespace Orchard.Tests.Stubs { - public class StubCacheManager : ICacheManager { - private readonly ICacheManager _defaultCacheManager; - - public StubCacheManager() { - _defaultCacheManager = new DefaultCacheManager(this.GetType(), new DefaultCacheHolder(new DefaultCacheContextAccessor())); - } - public TResult Get(TKey key, Func, TResult> acquire) { - return _defaultCacheManager.Get(key, acquire); - } - - public ICache GetCache() { - return _defaultCacheManager.GetCache(); - } - } - - public class StubParallelCacheContext : IParallelCacheContext { - public ITask CreateContextAwareTask(Func function) { - throw new NotImplementedException(); - } - - public IEnumerable RunInParallel(IEnumerable source, Func selector) { - return source.Select(selector); - } - } - - - public class StubAsyncTokenProvider : IAsyncTokenProvider { - public IVolatileToken GetToken(Action> task) { - var tokens = new List(); - task(tokens.Add); - return new Token(tokens); - } - public class Token : IVolatileToken { - private readonly List _tokens; - - public Token(List tokens) { - _tokens = tokens; - } - - public bool IsCurrent { get { return _tokens.All(t => t.IsCurrent); } } - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using Orchard.Caching; + +namespace Orchard.Tests.Stubs { + public class StubCacheManager : ICacheManager { + private readonly ICacheManager _defaultCacheManager; + + public StubCacheManager() { + _defaultCacheManager = new DefaultCacheManager(this.GetType(), new DefaultCacheHolder(new DefaultCacheContextAccessor())); + } + public TResult Get(TKey key, Func, TResult> acquire) { + return _defaultCacheManager.Get(key, acquire); + } + + public ICache GetCache() { + return _defaultCacheManager.GetCache(); + } + } + + public class StubParallelCacheContext : IParallelCacheContext { + public ITask CreateContextAwareTask(Func function) { + throw new NotImplementedException(); + } + + public IEnumerable RunInParallel(IEnumerable source, Func selector) { + return source.Select(selector); + } + } + + + public class StubAsyncTokenProvider : IAsyncTokenProvider { + public IVolatileToken GetToken(Action> task) { + var tokens = new List(); + task(tokens.Add); + return new Token(tokens); + } + public class Token : IVolatileToken { + private readonly List _tokens; + + public Token(List tokens) { + _tokens = tokens; + } + + public bool IsCurrent { get { return _tokens.All(t => t.IsCurrent); } } + } + } +} diff --git a/src/Orchard.Tests/Stubs/StubClock.cs b/src/Orchard.Tests/Stubs/StubClock.cs index cc0b4f9df09..c6169f72859 100644 --- a/src/Orchard.Tests/Stubs/StubClock.cs +++ b/src/Orchard.Tests/Stubs/StubClock.cs @@ -1,30 +1,30 @@ -using System; -using Orchard.Caching; -using Orchard.Services; - -namespace Orchard.Tests.Stubs { - public class StubClock : IClock { - public StubClock() { - UtcNow = new DateTime(2009, 10, 14, 12, 34, 56, DateTimeKind.Utc); - } - - public DateTime UtcNow { get; private set; } - - public void Advance(TimeSpan span) { - UtcNow = UtcNow.Add(span); - } - - public DateTime FutureMoment(TimeSpan span) { - return UtcNow.Add(span); - } - - - public IVolatileToken When(TimeSpan duration) { - return new Clock.AbsoluteExpirationToken(this, duration); - } - - public IVolatileToken WhenUtc(DateTime absoluteUtc) { - return new Clock.AbsoluteExpirationToken(this, absoluteUtc); - } - } -} +using System; +using Orchard.Caching; +using Orchard.Services; + +namespace Orchard.Tests.Stubs { + public class StubClock : IClock { + public StubClock() { + UtcNow = new DateTime(2009, 10, 14, 12, 34, 56, DateTimeKind.Utc); + } + + public DateTime UtcNow { get; private set; } + + public void Advance(TimeSpan span) { + UtcNow = UtcNow.Add(span); + } + + public DateTime FutureMoment(TimeSpan span) { + return UtcNow.Add(span); + } + + + public IVolatileToken When(TimeSpan duration) { + return new Clock.AbsoluteExpirationToken(this, duration); + } + + public IVolatileToken WhenUtc(DateTime absoluteUtc) { + return new Clock.AbsoluteExpirationToken(this, absoluteUtc); + } + } +} diff --git a/src/Orchard.Tests/Stubs/StubContainerProvider.cs b/src/Orchard.Tests/Stubs/StubContainerProvider.cs index 69c255a1e05..975f75bbfad 100644 --- a/src/Orchard.Tests/Stubs/StubContainerProvider.cs +++ b/src/Orchard.Tests/Stubs/StubContainerProvider.cs @@ -1,19 +1,19 @@ -using Autofac; -using Autofac.Integration.Web; - -namespace Orchard.Tests.Stubs { - public class StubContainerProvider : IContainerProvider { - public StubContainerProvider(IContainer applicationContainer, ILifetimeScope requestContainer) { - ApplicationContainer = applicationContainer; - RequestLifetime = requestContainer; - } - - public void EndRequestLifetime() { - RequestLifetime.Dispose(); - } - - public ILifetimeScope ApplicationContainer { get; set; } - - public ILifetimeScope RequestLifetime { get; set; } - } +using Autofac; +using Autofac.Integration.Web; + +namespace Orchard.Tests.Stubs { + public class StubContainerProvider : IContainerProvider { + public StubContainerProvider(IContainer applicationContainer, ILifetimeScope requestContainer) { + ApplicationContainer = applicationContainer; + RequestLifetime = requestContainer; + } + + public void EndRequestLifetime() { + RequestLifetime.Dispose(); + } + + public ILifetimeScope ApplicationContainer { get; set; } + + public ILifetimeScope RequestLifetime { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Stubs/StubExtensionManager.cs b/src/Orchard.Tests/Stubs/StubExtensionManager.cs index e431c9ebe13..0e283333dff 100644 --- a/src/Orchard.Tests/Stubs/StubExtensionManager.cs +++ b/src/Orchard.Tests/Stubs/StubExtensionManager.cs @@ -1,24 +1,24 @@ -using System; -using System.Collections.Generic; -using Orchard.Environment.Extensions; -using Orchard.Environment.Extensions.Models; - -namespace Orchard.Tests.Stubs { - public class StubExtensionManager : IExtensionManager { - public ExtensionDescriptor GetExtension(string name) { - throw new NotImplementedException(); - } - - public IEnumerable AvailableExtensions() { - throw new NotSupportedException(); - } - - public IEnumerable AvailableFeatures() { - throw new NotSupportedException(); - } - - public IEnumerable LoadFeatures(IEnumerable featureDescriptors) { - throw new NotSupportedException(); - } - } -} +using System; +using System.Collections.Generic; +using Orchard.Environment.Extensions; +using Orchard.Environment.Extensions.Models; + +namespace Orchard.Tests.Stubs { + public class StubExtensionManager : IExtensionManager { + public ExtensionDescriptor GetExtension(string name) { + throw new NotImplementedException(); + } + + public IEnumerable AvailableExtensions() { + throw new NotSupportedException(); + } + + public IEnumerable AvailableFeatures() { + throw new NotSupportedException(); + } + + public IEnumerable LoadFeatures(IEnumerable featureDescriptors) { + throw new NotSupportedException(); + } + } +} diff --git a/src/Orchard.Tests/Stubs/StubFileSystem.cs b/src/Orchard.Tests/Stubs/StubFileSystem.cs index b6bda00f886..3026e5e04d5 100644 --- a/src/Orchard.Tests/Stubs/StubFileSystem.cs +++ b/src/Orchard.Tests/Stubs/StubFileSystem.cs @@ -1,401 +1,401 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Orchard.Caching; -using Orchard.Services; - -namespace Orchard.Tests.Stubs { - public class StubFileSystem { - public class Entry { - public string Name { get; set; } - } - - public class DirectoryEntry : Entry { - private readonly IClock _clock; - - public DirectoryEntry(IClock clock) { - _clock = clock; - Entries = new List(); - } - - public IList Entries { get; private set; } - - public IEnumerable Files { - get { - return Entries.OfType(); - } - } - - public IEnumerable Directories { - get { - return Entries.OfType(); - } - } - - public Entry GetEntry(string name) { - if (string.IsNullOrEmpty(name)) - throw new ArgumentException(); - - if (name.Contains(Path.DirectorySeparatorChar) || name.Contains(Path.AltDirectorySeparatorChar)) - throw new ArgumentException(); - - return Entries.FirstOrDefault(e => StringComparer.OrdinalIgnoreCase.Equals(e.Name, name)); - } - - public DirectoryEntry CreateDirectory(string name) { - var entry = GetEntry(name); - - if (entry == null) { - entry = new DirectoryEntry(_clock) { Name = name }; - this.Entries.Add(entry); - } - - if (!(entry is DirectoryEntry)) { - throw new InvalidOperationException(string.Format("Can't create directory \"{0}\": not a directory.", name)); - } - - return (DirectoryEntry)entry; - } - - public FileEntry CreateFile(string name) { - var entry = GetEntry(name); - - if (entry == null) { - entry = new FileEntry (_clock) { Name = name }; - this.Entries.Add(entry); - } - - if (!(entry is FileEntry)) { - throw new InvalidOperationException(string.Format("Can't create file \"{0}\": not a file.", name)); - } - - return (FileEntry)entry; - } - } - - public class FileEntry : Entry { - private readonly IClock _clock; - - public FileEntry(IClock clock) { - _clock = clock; - LastWriteTimeUtc = _clock.UtcNow; - Content = new List(); - } - - public List Content { get; private set; } - public DateTime LastWriteTimeUtc { get; set; } - } - - public class Token : IVolatileToken { - private readonly StubFileSystem _stubFileSystem; - private readonly string _path; - private bool _isCurrent; - - public Token(StubFileSystem stubFileSystem, string path) { - _stubFileSystem = stubFileSystem; - _path = path; - _isCurrent = true; - } - - public bool IsCurrent { get { return _isCurrent; } } - - public void OnChange() { - _isCurrent = false; - _stubFileSystem.DetachToken(_path); - } - } - - public class FileEntryWriteStream : Stream { - private readonly Token _token; - private readonly FileEntry _entry; - private readonly IClock _clock; - private long _position; - - public FileEntryWriteStream(Token token, StubFileSystem.FileEntry entry, IClock clock) { - _token = token; - _entry = entry; - _clock = clock; - } - - public override void Flush() { - } - - public override long Seek(long offset, SeekOrigin origin) { - throw new NotImplementedException(); - } - - public override void SetLength(long value) { - throw new NotImplementedException(); - } - - public override int Read(byte[] buffer, int offset, int count) { - throw new NotImplementedException(); - } - - public class ArrayWrapper : ICollection { - private readonly T[] _buffer; - private readonly int _offset; - private readonly int _count; - - public ArrayWrapper(T[] buffer, int offset, int count) { - _buffer = buffer; - _offset = offset; - _count = count; - } - - public IEnumerator GetEnumerator() { - for (int i = _offset; i < _count; i++) - yield return _buffer[i]; - } - - IEnumerator IEnumerable.GetEnumerator() { - return GetEnumerator(); - } - - public void Add(T item) { - throw new NotImplementedException(); - } - - public void Clear() { - throw new NotImplementedException(); - } - - public bool Contains(T item) { - throw new NotImplementedException(); - } - - public void CopyTo(T[] array, int arrayIndex) { - Array.Copy(_buffer, _offset, array, arrayIndex, _count); - } - - public bool Remove(T item) { - throw new NotImplementedException(); - } - - public int Count { - get { return _count; } - } - - public bool IsReadOnly { - get { return true; } - } - } - - public override void Write(byte[] buffer, int offset, int count) { - if (count == 0) - return; - - var wrapper = new ArrayWrapper(buffer, offset, count); - _entry.Content.AddRange(wrapper); - - _entry.LastWriteTimeUtc = _clock.UtcNow; - if (_token != null) - _token.OnChange(); - _position += count; - } - - public override bool CanRead { - get { return false; } - } - - public override bool CanSeek { - get { return false; } - } - - public override bool CanWrite { - get { return true; } - } - - public override long Length { - get { return _entry.Content.Count; } - } - - public override long Position { - get { return _position; } - set { throw new NotImplementedException(); } - } - } - - public class FileEntryReadStream : Stream { - private readonly FileEntry _entry; - private readonly IClock _clock; - private int _position; - - public FileEntryReadStream(FileEntry entry, IClock clock) { - _entry = entry; - _clock = clock; - } - - public FileEntry FileEntry { get { return _entry; } } - - public override void Flush() { - throw new NotImplementedException(); - } - - public override long Seek(long offset, SeekOrigin origin) { - switch (origin) { - case SeekOrigin.Begin: - _position = (int)offset; - break; - case SeekOrigin.Current: - _position += (int) offset; - break; - case SeekOrigin.End: - _position = _entry.Content.Count - (int) offset; - break; - default: - throw new ArgumentOutOfRangeException("origin"); - } - return _position; - } - - public override void SetLength(long value) { - throw new NotImplementedException(); - } - - public override int Read(byte[] buffer, int offset, int count) { - int remaingCount = _entry.Content.Count - _position; - count = Math.Min(count, remaingCount); - - _entry.Content.CopyTo(_position, buffer, offset, count); - - _position += count; - return count; - } - - public override void Write(byte[] buffer, int offset, int count) { - throw new NotImplementedException(); - } - - public override bool CanRead { - get { return true; } - } - - public override bool CanSeek { - get { return true; } - } - - public override bool CanWrite { - get { return false; } - } - - public override long Length { - get { return _entry.Content.Count; } - } - - public override long Position { - get { return _position; } - set { _position = (int) value; } - } - } - - private readonly IClock _clock; - private readonly DirectoryEntry _root; - private readonly Dictionary> _tokens; - - public StubFileSystem(IClock clock) { - _clock = clock; - _root = new DirectoryEntry(_clock); - _tokens = new Dictionary>(StringComparer.OrdinalIgnoreCase); - } - - public DirectoryEntry GetDirectoryEntry(string path) { - // Root is a special case: it has no name. - if (string.IsNullOrEmpty(path)) - return _root; - - path = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); - var current = _root; - foreach (var name in path.Split(Path.DirectorySeparatorChar)) { - current = current.GetEntry(name) as DirectoryEntry; - if (current == null) - break; - } - return current; - } - - public DirectoryEntry CreateDirectoryEntry(string path) { - // Root is a special case: it has no name. - if (string.IsNullOrEmpty(path)) - return _root; - - path = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); - var current = _root; - foreach (var name in path.Split(Path.DirectorySeparatorChar)) { - current = current.CreateDirectory(name); - } - return current; - } - - public FileEntry GetFileEntry(string path) { - var directoryName = Path.GetDirectoryName(path); - var fileName = Path.GetFileName(path); - - var directory = GetDirectoryEntry(directoryName); - if (directory == null) - return null; - - return directory.GetEntry(fileName) as StubFileSystem.FileEntry; - } - - public FileEntry CreateFileEntry(string path) { - var directoryName = Path.GetDirectoryName(path); - var fileName = Path.GetFileName(path); - - return CreateDirectoryEntry(directoryName).CreateFile(fileName); - } - - public IVolatileToken WhenPathChanges(string path) { - Token token = GetToken(path); - - if (token == null) { - token = new Token(this, path); - _tokens.Add(path, new Weak(token)); - } - return token; - } - - private Token GetToken(string path) { - Token token = null; - Weak weakRef; - if (_tokens.TryGetValue(path, out weakRef)) - token = weakRef.Target; - return token; - } - - private void DetachToken(string path) { - _tokens.Remove(path); - } - - public Stream CreateFile(string path) { - var entry = CreateFileEntry(path); - entry.Content.Clear(); - return new FileEntryWriteStream(GetToken(path), entry, _clock); - } - - public Stream OpenFile(string path) { - var entry = GetFileEntry(path); - if (entry == null) - throw new InvalidOperationException(); - - return new FileEntryReadStream(entry, _clock); - } - - public void DeleteFile(string path) { - var directoryName = Path.GetDirectoryName(path); - var fileName = Path.GetFileName(path); - - var directory = GetDirectoryEntry(directoryName); - if (directory == null) - return; - - var entry = directory.GetEntry(fileName); - if (entry == null) - return; - - directory.Entries.Remove(entry); - } - } +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Orchard.Caching; +using Orchard.Services; + +namespace Orchard.Tests.Stubs { + public class StubFileSystem { + public class Entry { + public string Name { get; set; } + } + + public class DirectoryEntry : Entry { + private readonly IClock _clock; + + public DirectoryEntry(IClock clock) { + _clock = clock; + Entries = new List(); + } + + public IList Entries { get; private set; } + + public IEnumerable Files { + get { + return Entries.OfType(); + } + } + + public IEnumerable Directories { + get { + return Entries.OfType(); + } + } + + public Entry GetEntry(string name) { + if (string.IsNullOrEmpty(name)) + throw new ArgumentException(); + + if (name.Contains(Path.DirectorySeparatorChar) || name.Contains(Path.AltDirectorySeparatorChar)) + throw new ArgumentException(); + + return Entries.FirstOrDefault(e => StringComparer.OrdinalIgnoreCase.Equals(e.Name, name)); + } + + public DirectoryEntry CreateDirectory(string name) { + var entry = GetEntry(name); + + if (entry == null) { + entry = new DirectoryEntry(_clock) { Name = name }; + this.Entries.Add(entry); + } + + if (!(entry is DirectoryEntry)) { + throw new InvalidOperationException(string.Format("Can't create directory \"{0}\": not a directory.", name)); + } + + return (DirectoryEntry)entry; + } + + public FileEntry CreateFile(string name) { + var entry = GetEntry(name); + + if (entry == null) { + entry = new FileEntry (_clock) { Name = name }; + this.Entries.Add(entry); + } + + if (!(entry is FileEntry)) { + throw new InvalidOperationException(string.Format("Can't create file \"{0}\": not a file.", name)); + } + + return (FileEntry)entry; + } + } + + public class FileEntry : Entry { + private readonly IClock _clock; + + public FileEntry(IClock clock) { + _clock = clock; + LastWriteTimeUtc = _clock.UtcNow; + Content = new List(); + } + + public List Content { get; private set; } + public DateTime LastWriteTimeUtc { get; set; } + } + + public class Token : IVolatileToken { + private readonly StubFileSystem _stubFileSystem; + private readonly string _path; + private bool _isCurrent; + + public Token(StubFileSystem stubFileSystem, string path) { + _stubFileSystem = stubFileSystem; + _path = path; + _isCurrent = true; + } + + public bool IsCurrent { get { return _isCurrent; } } + + public void OnChange() { + _isCurrent = false; + _stubFileSystem.DetachToken(_path); + } + } + + public class FileEntryWriteStream : Stream { + private readonly Token _token; + private readonly FileEntry _entry; + private readonly IClock _clock; + private long _position; + + public FileEntryWriteStream(Token token, StubFileSystem.FileEntry entry, IClock clock) { + _token = token; + _entry = entry; + _clock = clock; + } + + public override void Flush() { + } + + public override long Seek(long offset, SeekOrigin origin) { + throw new NotImplementedException(); + } + + public override void SetLength(long value) { + throw new NotImplementedException(); + } + + public override int Read(byte[] buffer, int offset, int count) { + throw new NotImplementedException(); + } + + public class ArrayWrapper : ICollection { + private readonly T[] _buffer; + private readonly int _offset; + private readonly int _count; + + public ArrayWrapper(T[] buffer, int offset, int count) { + _buffer = buffer; + _offset = offset; + _count = count; + } + + public IEnumerator GetEnumerator() { + for (int i = _offset; i < _count; i++) + yield return _buffer[i]; + } + + IEnumerator IEnumerable.GetEnumerator() { + return GetEnumerator(); + } + + public void Add(T item) { + throw new NotImplementedException(); + } + + public void Clear() { + throw new NotImplementedException(); + } + + public bool Contains(T item) { + throw new NotImplementedException(); + } + + public void CopyTo(T[] array, int arrayIndex) { + Array.Copy(_buffer, _offset, array, arrayIndex, _count); + } + + public bool Remove(T item) { + throw new NotImplementedException(); + } + + public int Count { + get { return _count; } + } + + public bool IsReadOnly { + get { return true; } + } + } + + public override void Write(byte[] buffer, int offset, int count) { + if (count == 0) + return; + + var wrapper = new ArrayWrapper(buffer, offset, count); + _entry.Content.AddRange(wrapper); + + _entry.LastWriteTimeUtc = _clock.UtcNow; + if (_token != null) + _token.OnChange(); + _position += count; + } + + public override bool CanRead { + get { return false; } + } + + public override bool CanSeek { + get { return false; } + } + + public override bool CanWrite { + get { return true; } + } + + public override long Length { + get { return _entry.Content.Count; } + } + + public override long Position { + get { return _position; } + set { throw new NotImplementedException(); } + } + } + + public class FileEntryReadStream : Stream { + private readonly FileEntry _entry; + private readonly IClock _clock; + private int _position; + + public FileEntryReadStream(FileEntry entry, IClock clock) { + _entry = entry; + _clock = clock; + } + + public FileEntry FileEntry { get { return _entry; } } + + public override void Flush() { + throw new NotImplementedException(); + } + + public override long Seek(long offset, SeekOrigin origin) { + switch (origin) { + case SeekOrigin.Begin: + _position = (int)offset; + break; + case SeekOrigin.Current: + _position += (int) offset; + break; + case SeekOrigin.End: + _position = _entry.Content.Count - (int) offset; + break; + default: + throw new ArgumentOutOfRangeException("origin"); + } + return _position; + } + + public override void SetLength(long value) { + throw new NotImplementedException(); + } + + public override int Read(byte[] buffer, int offset, int count) { + int remaingCount = _entry.Content.Count - _position; + count = Math.Min(count, remaingCount); + + _entry.Content.CopyTo(_position, buffer, offset, count); + + _position += count; + return count; + } + + public override void Write(byte[] buffer, int offset, int count) { + throw new NotImplementedException(); + } + + public override bool CanRead { + get { return true; } + } + + public override bool CanSeek { + get { return true; } + } + + public override bool CanWrite { + get { return false; } + } + + public override long Length { + get { return _entry.Content.Count; } + } + + public override long Position { + get { return _position; } + set { _position = (int) value; } + } + } + + private readonly IClock _clock; + private readonly DirectoryEntry _root; + private readonly Dictionary> _tokens; + + public StubFileSystem(IClock clock) { + _clock = clock; + _root = new DirectoryEntry(_clock); + _tokens = new Dictionary>(StringComparer.OrdinalIgnoreCase); + } + + public DirectoryEntry GetDirectoryEntry(string path) { + // Root is a special case: it has no name. + if (string.IsNullOrEmpty(path)) + return _root; + + path = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); + var current = _root; + foreach (var name in path.Split(Path.DirectorySeparatorChar)) { + current = current.GetEntry(name) as DirectoryEntry; + if (current == null) + break; + } + return current; + } + + public DirectoryEntry CreateDirectoryEntry(string path) { + // Root is a special case: it has no name. + if (string.IsNullOrEmpty(path)) + return _root; + + path = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); + var current = _root; + foreach (var name in path.Split(Path.DirectorySeparatorChar)) { + current = current.CreateDirectory(name); + } + return current; + } + + public FileEntry GetFileEntry(string path) { + var directoryName = Path.GetDirectoryName(path); + var fileName = Path.GetFileName(path); + + var directory = GetDirectoryEntry(directoryName); + if (directory == null) + return null; + + return directory.GetEntry(fileName) as StubFileSystem.FileEntry; + } + + public FileEntry CreateFileEntry(string path) { + var directoryName = Path.GetDirectoryName(path); + var fileName = Path.GetFileName(path); + + return CreateDirectoryEntry(directoryName).CreateFile(fileName); + } + + public IVolatileToken WhenPathChanges(string path) { + Token token = GetToken(path); + + if (token == null) { + token = new Token(this, path); + _tokens.Add(path, new Weak(token)); + } + return token; + } + + private Token GetToken(string path) { + Token token = null; + Weak weakRef; + if (_tokens.TryGetValue(path, out weakRef)) + token = weakRef.Target; + return token; + } + + private void DetachToken(string path) { + _tokens.Remove(path); + } + + public Stream CreateFile(string path) { + var entry = CreateFileEntry(path); + entry.Content.Clear(); + return new FileEntryWriteStream(GetToken(path), entry, _clock); + } + + public Stream OpenFile(string path) { + var entry = GetFileEntry(path); + if (entry == null) + throw new InvalidOperationException(); + + return new FileEntryReadStream(entry, _clock); + } + + public void DeleteFile(string path) { + var directoryName = Path.GetDirectoryName(path); + var fileName = Path.GetFileName(path); + + var directory = GetDirectoryEntry(directoryName); + if (directory == null) + return; + + var entry = directory.GetEntry(fileName); + if (entry == null) + return; + + directory.Entries.Remove(entry); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Stubs/StubHttpContext.cs b/src/Orchard.Tests/Stubs/StubHttpContext.cs index 14b122c9091..93f87e49502 100644 --- a/src/Orchard.Tests/Stubs/StubHttpContext.cs +++ b/src/Orchard.Tests/Stubs/StubHttpContext.cs @@ -1,103 +1,103 @@ -using System.Collections; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Web; -using System.Web.SessionState; - -namespace Orchard.Tests.Stubs { - public class StubHttpContext : HttpContextBase { - private readonly string _appRelativeCurrentExecutionFilePath; - private readonly string _hostHeader; - private readonly IDictionary _items = new Dictionary(); - - public StubHttpContext() { - _appRelativeCurrentExecutionFilePath = "~/yadda"; - _hostHeader = "localhost"; - } - - public StubHttpContext(string appRelativeCurrentExecutionFilePath) { - _appRelativeCurrentExecutionFilePath = appRelativeCurrentExecutionFilePath; - _hostHeader = "localhost"; - } - - public StubHttpContext(string appRelativeCurrentExecutionFilePath, string hostHeader) { - _appRelativeCurrentExecutionFilePath = appRelativeCurrentExecutionFilePath; - _hostHeader = hostHeader; - } - - public override void SetSessionStateBehavior(SessionStateBehavior sessionStateBehavior) { - } - - public override HttpRequestBase Request { - get { return new StubHttpRequest(this); } - } - - public override HttpResponseBase Response { - get { return new StubHttpResponse(this); } - } - - public override IDictionary Items { - get { return _items; } - } - - #region Nested type: StubHttpRequest - - private class StubHttpRequest : HttpRequestBase { - private readonly StubHttpContext _httpContext; - private NameValueCollection _headers; - private NameValueCollection _serverVariables; - - public StubHttpRequest(StubHttpContext httpContext) { - _httpContext = httpContext; - } - - public override string AppRelativeCurrentExecutionFilePath { - get { return _httpContext._appRelativeCurrentExecutionFilePath; } - } - - public override string ApplicationPath { - get { return "/"; } - } - - public override string Path { - get { return _httpContext._appRelativeCurrentExecutionFilePath.TrimStart('~'); } - } - - public override string PathInfo { - get { return ""; } - } - - public override NameValueCollection Headers { - get { - return _headers = _headers - ?? new NameValueCollection {{"Host", _httpContext._hostHeader}}; - } - } - - public override NameValueCollection ServerVariables { - get { - return _serverVariables = _serverVariables - ?? new NameValueCollection {{"HTTP_HOST", _httpContext._hostHeader}}; - } - } - } - - #endregion - - #region Nested type: StubHttpResponse - - private class StubHttpResponse : HttpResponseBase { - private readonly StubHttpContext _httpContext; - - public StubHttpResponse(StubHttpContext httpContext) { - _httpContext = httpContext; - } - - public override string ApplyAppPathModifier(string virtualPath) { - return "~/" + virtualPath.TrimStart('/'); - } - } - - #endregion - } +using System.Collections; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Web; +using System.Web.SessionState; + +namespace Orchard.Tests.Stubs { + public class StubHttpContext : HttpContextBase { + private readonly string _appRelativeCurrentExecutionFilePath; + private readonly string _hostHeader; + private readonly IDictionary _items = new Dictionary(); + + public StubHttpContext() { + _appRelativeCurrentExecutionFilePath = "~/yadda"; + _hostHeader = "localhost"; + } + + public StubHttpContext(string appRelativeCurrentExecutionFilePath) { + _appRelativeCurrentExecutionFilePath = appRelativeCurrentExecutionFilePath; + _hostHeader = "localhost"; + } + + public StubHttpContext(string appRelativeCurrentExecutionFilePath, string hostHeader) { + _appRelativeCurrentExecutionFilePath = appRelativeCurrentExecutionFilePath; + _hostHeader = hostHeader; + } + + public override void SetSessionStateBehavior(SessionStateBehavior sessionStateBehavior) { + } + + public override HttpRequestBase Request { + get { return new StubHttpRequest(this); } + } + + public override HttpResponseBase Response { + get { return new StubHttpResponse(this); } + } + + public override IDictionary Items { + get { return _items; } + } + + #region Nested type: StubHttpRequest + + private class StubHttpRequest : HttpRequestBase { + private readonly StubHttpContext _httpContext; + private NameValueCollection _headers; + private NameValueCollection _serverVariables; + + public StubHttpRequest(StubHttpContext httpContext) { + _httpContext = httpContext; + } + + public override string AppRelativeCurrentExecutionFilePath { + get { return _httpContext._appRelativeCurrentExecutionFilePath; } + } + + public override string ApplicationPath { + get { return "/"; } + } + + public override string Path { + get { return _httpContext._appRelativeCurrentExecutionFilePath.TrimStart('~'); } + } + + public override string PathInfo { + get { return ""; } + } + + public override NameValueCollection Headers { + get { + return _headers = _headers + ?? new NameValueCollection {{"Host", _httpContext._hostHeader}}; + } + } + + public override NameValueCollection ServerVariables { + get { + return _serverVariables = _serverVariables + ?? new NameValueCollection {{"HTTP_HOST", _httpContext._hostHeader}}; + } + } + } + + #endregion + + #region Nested type: StubHttpResponse + + private class StubHttpResponse : HttpResponseBase { + private readonly StubHttpContext _httpContext; + + public StubHttpResponse(StubHttpContext httpContext) { + _httpContext = httpContext; + } + + public override string ApplyAppPathModifier(string virtualPath) { + return "~/" + virtualPath.TrimStart('/'); + } + } + + #endregion + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Stubs/StubHttpContextAccessor.cs b/src/Orchard.Tests/Stubs/StubHttpContextAccessor.cs index 892707b2fda..55fc9800310 100644 --- a/src/Orchard.Tests/Stubs/StubHttpContextAccessor.cs +++ b/src/Orchard.Tests/Stubs/StubHttpContextAccessor.cs @@ -1,23 +1,23 @@ -using System.Web; -using Orchard.Mvc; - -namespace Orchard.Tests.Stubs { - public class StubHttpContextAccessor : IHttpContextAccessor { - private HttpContextBase _httpContext; - - public StubHttpContextAccessor() { - } - - public StubHttpContextAccessor(HttpContextBase httpContext) { - _httpContext = httpContext; - } - - public HttpContextBase Current() { - return _httpContext; - } - - public void Set(HttpContextBase httpContext) { - _httpContext = httpContext; - } - } +using System.Web; +using Orchard.Mvc; + +namespace Orchard.Tests.Stubs { + public class StubHttpContextAccessor : IHttpContextAccessor { + private HttpContextBase _httpContext; + + public StubHttpContextAccessor() { + } + + public StubHttpContextAccessor(HttpContextBase httpContext) { + _httpContext = httpContext; + } + + public HttpContextBase Current() { + return _httpContext; + } + + public void Set(HttpContextBase httpContext) { + _httpContext = httpContext; + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Stubs/StubReportsCoordinator.cs b/src/Orchard.Tests/Stubs/StubReportsCoordinator.cs index 0621a0c5d0f..fe3a9cd7603 100644 --- a/src/Orchard.Tests/Stubs/StubReportsCoordinator.cs +++ b/src/Orchard.Tests/Stubs/StubReportsCoordinator.cs @@ -1,14 +1,14 @@ -using Orchard.Reports; -using Orchard.Reports.Services; - -namespace Orchard.Tests.Stubs { - public class StubReportsCoordinator : IReportsCoordinator { - public void Add(string reportKey, ReportEntryType type, string message) { - - } - - public int Register(string reportKey, string activityName, string title) { - return 0; - } - } +using Orchard.Reports; +using Orchard.Reports.Services; + +namespace Orchard.Tests.Stubs { + public class StubReportsCoordinator : IReportsCoordinator { + public void Add(string reportKey, ReportEntryType type, string message) { + + } + + public int Register(string reportKey, string activityName, string title) { + return 0; + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Stubs/StubVirtualPathMonitor.cs b/src/Orchard.Tests/Stubs/StubVirtualPathMonitor.cs index fb253eba291..99119d63e97 100644 --- a/src/Orchard.Tests/Stubs/StubVirtualPathMonitor.cs +++ b/src/Orchard.Tests/Stubs/StubVirtualPathMonitor.cs @@ -1,13 +1,13 @@ -using Orchard.Caching; -using Orchard.FileSystems.VirtualPath; - -namespace Orchard.Tests.Stubs { - public class StubVirtualPathMonitor : IVirtualPathMonitor { - public class Token : IVolatileToken { - public bool IsCurrent { get; set; } - } - public IVolatileToken WhenPathChanges(string virtualPath) { - return new Token(); - } - } -} +using Orchard.Caching; +using Orchard.FileSystems.VirtualPath; + +namespace Orchard.Tests.Stubs { + public class StubVirtualPathMonitor : IVirtualPathMonitor { + public class Token : IVolatileToken { + public bool IsCurrent { get; set; } + } + public IVolatileToken WhenPathChanges(string virtualPath) { + return new Token(); + } + } +} diff --git a/src/Orchard.Tests/Stubs/StubVirtualPathProvider.cs b/src/Orchard.Tests/Stubs/StubVirtualPathProvider.cs index f1f16613162..9e302e26922 100644 --- a/src/Orchard.Tests/Stubs/StubVirtualPathProvider.cs +++ b/src/Orchard.Tests/Stubs/StubVirtualPathProvider.cs @@ -1,122 +1,122 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Orchard.FileSystems.VirtualPath; - -namespace Orchard.Tests.Stubs { - public class StubVirtualPathProvider : IVirtualPathProvider { - private readonly StubFileSystem _fileSystem; - - public StubVirtualPathProvider(StubFileSystem fileSystem) { - _fileSystem = fileSystem; - } - - public StubFileSystem FileSystem { - get { return _fileSystem; } - } - - private string ToFileSystemPath(string path) { - if (path.StartsWith("~/")) - path = path.Substring(2); - else if (path.StartsWith("/")) - path = path.Substring(1); - - if (path.Contains("..")) { - string[] terms = path.Replace(Path.DirectorySeparatorChar, '/').Split('/'); - var names = new List(); - foreach(var term in terms) { - if (term == "..") - names.RemoveAt(0); - else - names.Insert(0, term); - } - names.Reverse(); - path = string.Join("/", names); - } - - return path; - } - - public string Combine(params string[] paths) { - return Path.Combine(paths).Replace(Path.DirectorySeparatorChar, '/'); - } - - public string ToAppRelative(string virtualPath) { - return "~/" + ToFileSystemPath(virtualPath); - } - - public string MapPath(string virtualPath) { - throw new NotImplementedException("Mapping to a physical file is not supported in Unit Test with this stub."); - } - - public bool FileExists(string virtualPath) { - return _fileSystem.GetFileEntry(ToFileSystemPath(virtualPath)) != null; - } - - public Stream OpenFile(string virtualPath) { - return _fileSystem.OpenFile(ToFileSystemPath(virtualPath)); - } - - public StreamWriter CreateText(string virtualPath) { - return new StreamWriter(_fileSystem.CreateFile(ToFileSystemPath(virtualPath))); - } - - public Stream CreateFile(string virtualPath) { - return _fileSystem.CreateFile(ToFileSystemPath(virtualPath)); - } - - public DateTime GetFileLastWriteTimeUtc(string virtualPath) { - return _fileSystem.GetFileEntry(ToFileSystemPath(virtualPath)).LastWriteTimeUtc; - } - - public string GetFileHash(string virtualPath) { - throw new NotImplementedException(); - } - - public string GetFileHash(string virtualPath, IEnumerable dependencies) { - throw new NotImplementedException(); - } - - public void DeleteFile(string virtualPath) { - _fileSystem.DeleteFile(ToFileSystemPath(virtualPath)); - } - - public bool DirectoryExists(string virtualPath) { - return _fileSystem.GetDirectoryEntry(ToFileSystemPath(virtualPath)) != null; - } - - public void CreateDirectory(string virtualPath) { - _fileSystem.CreateDirectoryEntry(ToFileSystemPath(virtualPath)); - } - - public void DeleteDirectory(string virtualPath) { - throw new NotImplementedException(); - } - - public string GetDirectoryName(string virtualPath) { - return Path.GetDirectoryName(virtualPath); - } - - public IEnumerable ListFiles(string path) { - return _fileSystem.GetDirectoryEntry(ToFileSystemPath(path)) - .Files - .Select(f => Combine(path, f.Name)); - } - - public IEnumerable ListDirectories(string path) { - return _fileSystem.GetDirectoryEntry(ToFileSystemPath(path)) - .Directories - .Select(f => Combine(path, f.Name)); - } - - public bool TryFileExists(string virtualPath) { - try { - return FileExists(virtualPath); - } - catch { - return false; - } - } - } +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Orchard.FileSystems.VirtualPath; + +namespace Orchard.Tests.Stubs { + public class StubVirtualPathProvider : IVirtualPathProvider { + private readonly StubFileSystem _fileSystem; + + public StubVirtualPathProvider(StubFileSystem fileSystem) { + _fileSystem = fileSystem; + } + + public StubFileSystem FileSystem { + get { return _fileSystem; } + } + + private string ToFileSystemPath(string path) { + if (path.StartsWith("~/")) + path = path.Substring(2); + else if (path.StartsWith("/")) + path = path.Substring(1); + + if (path.Contains("..")) { + string[] terms = path.Replace(Path.DirectorySeparatorChar, '/').Split('/'); + var names = new List(); + foreach(var term in terms) { + if (term == "..") + names.RemoveAt(0); + else + names.Insert(0, term); + } + names.Reverse(); + path = string.Join("/", names); + } + + return path; + } + + public string Combine(params string[] paths) { + return Path.Combine(paths).Replace(Path.DirectorySeparatorChar, '/'); + } + + public string ToAppRelative(string virtualPath) { + return "~/" + ToFileSystemPath(virtualPath); + } + + public string MapPath(string virtualPath) { + throw new NotImplementedException("Mapping to a physical file is not supported in Unit Test with this stub."); + } + + public bool FileExists(string virtualPath) { + return _fileSystem.GetFileEntry(ToFileSystemPath(virtualPath)) != null; + } + + public Stream OpenFile(string virtualPath) { + return _fileSystem.OpenFile(ToFileSystemPath(virtualPath)); + } + + public StreamWriter CreateText(string virtualPath) { + return new StreamWriter(_fileSystem.CreateFile(ToFileSystemPath(virtualPath))); + } + + public Stream CreateFile(string virtualPath) { + return _fileSystem.CreateFile(ToFileSystemPath(virtualPath)); + } + + public DateTime GetFileLastWriteTimeUtc(string virtualPath) { + return _fileSystem.GetFileEntry(ToFileSystemPath(virtualPath)).LastWriteTimeUtc; + } + + public string GetFileHash(string virtualPath) { + throw new NotImplementedException(); + } + + public string GetFileHash(string virtualPath, IEnumerable dependencies) { + throw new NotImplementedException(); + } + + public void DeleteFile(string virtualPath) { + _fileSystem.DeleteFile(ToFileSystemPath(virtualPath)); + } + + public bool DirectoryExists(string virtualPath) { + return _fileSystem.GetDirectoryEntry(ToFileSystemPath(virtualPath)) != null; + } + + public void CreateDirectory(string virtualPath) { + _fileSystem.CreateDirectoryEntry(ToFileSystemPath(virtualPath)); + } + + public void DeleteDirectory(string virtualPath) { + throw new NotImplementedException(); + } + + public string GetDirectoryName(string virtualPath) { + return Path.GetDirectoryName(virtualPath); + } + + public IEnumerable ListFiles(string path) { + return _fileSystem.GetDirectoryEntry(ToFileSystemPath(path)) + .Files + .Select(f => Combine(path, f.Name)); + } + + public IEnumerable ListDirectories(string path) { + return _fileSystem.GetDirectoryEntry(ToFileSystemPath(path)) + .Directories + .Select(f => Combine(path, f.Name)); + } + + public bool TryFileExists(string virtualPath) { + try { + return FileExists(virtualPath); + } + catch { + return false; + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Stubs/StubWebSiteFolder.cs b/src/Orchard.Tests/Stubs/StubWebSiteFolder.cs index d6c349e62f6..459a39880ce 100644 --- a/src/Orchard.Tests/Stubs/StubWebSiteFolder.cs +++ b/src/Orchard.Tests/Stubs/StubWebSiteFolder.cs @@ -1,55 +1,55 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Orchard.Caching; -using Orchard.FileSystems.WebSite; - -namespace Orchard.Tests.Stubs { - public class StubWebSiteFolder : IWebSiteFolder { - public IEnumerable ListDirectories(string path) { - if (!Directory.Exists(path)) - return Enumerable.Empty(); - - return Directory.GetDirectories(path); - } - - public IEnumerable ListFiles(string path, bool recursive) { - if (!Directory.Exists(path)) - return Enumerable.Empty(); - - return Directory.GetFiles(path); - } - - public bool FileExists(string virtualPath) { - throw new NotImplementedException(); - } - - public string ReadFile(string path) { - return ReadFile(path, false); - } - - public string ReadFile(string path, bool actualContent) { - if (!File.Exists(path)) - return null; - - return File.ReadAllText(path); - } - - public void CopyFileTo(string virtualPath, Stream destination) { - throw new NotImplementedException(); - } - - public void CopyFileTo(string virtualPath, Stream destination, bool actualContent) { - throw new NotImplementedException(); - } - - public IVolatileToken WhenPathChanges(string path) { - return new Token {IsCurrent = true}; - } - - public class Token : IVolatileToken { - public bool IsCurrent { get; set; } - } - } +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Orchard.Caching; +using Orchard.FileSystems.WebSite; + +namespace Orchard.Tests.Stubs { + public class StubWebSiteFolder : IWebSiteFolder { + public IEnumerable ListDirectories(string path) { + if (!Directory.Exists(path)) + return Enumerable.Empty(); + + return Directory.GetDirectories(path); + } + + public IEnumerable ListFiles(string path, bool recursive) { + if (!Directory.Exists(path)) + return Enumerable.Empty(); + + return Directory.GetFiles(path); + } + + public bool FileExists(string virtualPath) { + throw new NotImplementedException(); + } + + public string ReadFile(string path) { + return ReadFile(path, false); + } + + public string ReadFile(string path, bool actualContent) { + if (!File.Exists(path)) + return null; + + return File.ReadAllText(path); + } + + public void CopyFileTo(string virtualPath, Stream destination) { + throw new NotImplementedException(); + } + + public void CopyFileTo(string virtualPath, Stream destination, bool actualContent) { + throw new NotImplementedException(); + } + + public IVolatileToken WhenPathChanges(string path) { + return new Token {IsCurrent = true}; + } + + public class Token : IVolatileToken { + public bool IsCurrent { get; set; } + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Stubs/StubWorkContextAccessor.cs b/src/Orchard.Tests/Stubs/StubWorkContextAccessor.cs index b5fcdeeb692..98cc4c942c4 100644 --- a/src/Orchard.Tests/Stubs/StubWorkContextAccessor.cs +++ b/src/Orchard.Tests/Stubs/StubWorkContextAccessor.cs @@ -1,155 +1,155 @@ -using System; -using System.Collections.Generic; -using System.Web; -using Autofac; -using Orchard.ContentManagement; -using Orchard.Security; -using Orchard.Settings; - -namespace Orchard.Tests.Stubs { - public class StubWorkContextAccessor : IWorkContextAccessor { - private readonly ILifetimeScope _lifetimeScope; - private readonly WorkContext _workContext; - - public StubWorkContextAccessor(ILifetimeScope lifetimeScope) { - _lifetimeScope = lifetimeScope; - _workContext = new WorkContextImpl(_lifetimeScope); - } - - public class WorkContextImpl : WorkContext { - private readonly ILifetimeScope _lifetimeScope; - private readonly Dictionary _contextDictonary; - - public delegate void MyInitMethod(WorkContextImpl workContextImpl); - - public static MyInitMethod _initMethod; - - public WorkContextImpl(ILifetimeScope lifetimeScope) { - _contextDictonary = new Dictionary(); - CurrentUser = new StubUser(); - var ci = new ContentItem(); - ci.Weld(new StubSite()); - CurrentSite = ci.As(); - _lifetimeScope = lifetimeScope; - - if (_initMethod != null) { - _initMethod(this); - } - } - - public class StubSite : ContentPart, ISite { - public static string DefaultSuperUser; - - public string PageTitleSeparator { - get { throw new NotImplementedException(); } - } - - public string SiteName { - get { throw new NotImplementedException(); } - } - - public string SiteSalt { - get { throw new NotImplementedException(); } - } - - public string SuperUser { - get { return DefaultSuperUser; } - } - - public string HomePage { - get { throw new NotImplementedException(); } - set { throw new NotImplementedException(); } - } - - public string SiteCulture { - get { throw new NotImplementedException(); } - set { throw new NotImplementedException(); } - } - - public string SiteCalendar { - get { throw new NotImplementedException(); } - set { throw new NotImplementedException(); } - } - - public ResourceDebugMode ResourceDebugMode { - get { throw new NotImplementedException(); } - set { throw new NotImplementedException(); } - } - - public bool UseCdn { - get { throw new NotImplementedException(); } - set { throw new NotImplementedException(); } - } - - public int PageSize { - get { throw new NotImplementedException(); } - set { throw new NotImplementedException(); } - } - - public int MaxPageSize { - get { throw new NotImplementedException(); } - set { throw new NotImplementedException(); } - } - - public int MaxPagedCount { - get { throw new NotImplementedException(); } - set { throw new NotImplementedException(); } - } - - public string BaseUrl { get; set;} - - public string SiteTimeZone { get; set; } - } - - public class StubUser : IUser { - public ContentItem ContentItem { - get { throw new NotImplementedException(); } - } - - public int Id { - get { return 5; } - } - - public string UserName { - get { return "Fake"; } - } - - public string Email { - get { return "Fake@fake.com"; } - } - } - - public override T Resolve() { - return _lifetimeScope.Resolve(); - } - - public override bool TryResolve(out T service) { - return _lifetimeScope.TryResolve(out service); - } - - public override T GetState(string name) { - return (T) _contextDictonary[name]; - } - - public override void SetState(string name, T value) { - _contextDictonary[name] = value; - } - } - - public WorkContext GetContext(HttpContextBase httpContext) { - return _workContext; - } - - public IWorkContextScope CreateWorkContextScope(HttpContextBase httpContext) { - throw new NotSupportedException(); - } - - public WorkContext GetContext() { - return _workContext; - } - - public IWorkContextScope CreateWorkContextScope() { - throw new NotSupportedException(); - } - } -} +using System; +using System.Collections.Generic; +using System.Web; +using Autofac; +using Orchard.ContentManagement; +using Orchard.Security; +using Orchard.Settings; + +namespace Orchard.Tests.Stubs { + public class StubWorkContextAccessor : IWorkContextAccessor { + private readonly ILifetimeScope _lifetimeScope; + private readonly WorkContext _workContext; + + public StubWorkContextAccessor(ILifetimeScope lifetimeScope) { + _lifetimeScope = lifetimeScope; + _workContext = new WorkContextImpl(_lifetimeScope); + } + + public class WorkContextImpl : WorkContext { + private readonly ILifetimeScope _lifetimeScope; + private readonly Dictionary _contextDictonary; + + public delegate void MyInitMethod(WorkContextImpl workContextImpl); + + public static MyInitMethod _initMethod; + + public WorkContextImpl(ILifetimeScope lifetimeScope) { + _contextDictonary = new Dictionary(); + CurrentUser = new StubUser(); + var ci = new ContentItem(); + ci.Weld(new StubSite()); + CurrentSite = ci.As(); + _lifetimeScope = lifetimeScope; + + if (_initMethod != null) { + _initMethod(this); + } + } + + public class StubSite : ContentPart, ISite { + public static string DefaultSuperUser; + + public string PageTitleSeparator { + get { throw new NotImplementedException(); } + } + + public string SiteName { + get { throw new NotImplementedException(); } + } + + public string SiteSalt { + get { throw new NotImplementedException(); } + } + + public string SuperUser { + get { return DefaultSuperUser; } + } + + public string HomePage { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public string SiteCulture { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public string SiteCalendar { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public ResourceDebugMode ResourceDebugMode { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public bool UseCdn { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public int PageSize { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public int MaxPageSize { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public int MaxPagedCount { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public string BaseUrl { get; set;} + + public string SiteTimeZone { get; set; } + } + + public class StubUser : IUser { + public ContentItem ContentItem { + get { throw new NotImplementedException(); } + } + + public int Id { + get { return 5; } + } + + public string UserName { + get { return "Fake"; } + } + + public string Email { + get { return "Fake@fake.com"; } + } + } + + public override T Resolve() { + return _lifetimeScope.Resolve(); + } + + public override bool TryResolve(out T service) { + return _lifetimeScope.TryResolve(out service); + } + + public override T GetState(string name) { + return (T) _contextDictonary[name]; + } + + public override void SetState(string name, T value) { + _contextDictonary[name] = value; + } + } + + public WorkContext GetContext(HttpContextBase httpContext) { + return _workContext; + } + + public IWorkContextScope CreateWorkContextScope(HttpContextBase httpContext) { + throw new NotSupportedException(); + } + + public WorkContext GetContext() { + return _workContext; + } + + public IWorkContextScope CreateWorkContextScope() { + throw new NotSupportedException(); + } + } +} diff --git a/src/Orchard.Tests/Tasks/SweepGeneratorTests.cs b/src/Orchard.Tests/Tasks/SweepGeneratorTests.cs index 8e468800ab4..97d91e63f5e 100644 --- a/src/Orchard.Tests/Tasks/SweepGeneratorTests.cs +++ b/src/Orchard.Tests/Tasks/SweepGeneratorTests.cs @@ -1,55 +1,55 @@ -using System; -using Autofac; -using Moq; -using NUnit.Framework; -using Orchard.Environment; -using Orchard.Mvc; -using Orchard.Tasks; -using Orchard.Tests.Stubs; -using Orchard.Tests.Utility; - -namespace Orchard.Tests.Tasks { - [TestFixture] - public class SweepGeneratorTests : ContainerTestBase { - protected override void Register(ContainerBuilder builder) { - builder.RegisterAutoMocking(MockBehavior.Loose); - builder.RegisterModule(new WorkContextModule()); - builder.RegisterType().As(); - builder.RegisterType(); - } - - protected override void Resolve(ILifetimeScope container) { - container.Mock() - .Setup(x => x.Current()) - .Returns(() => null); - - container.Mock() - .Setup(x => x.Started()); - } - - [Test] - public void DoWorkShouldSendHeartbeatToTaskManager() { - var heartbeatSource = _container.Resolve(); - heartbeatSource.DoWork(); - _container.Resolve>() - .Verify(x => x.Sweep(), Times.Once()); - } - - [Test] - public void ActivatedEventShouldStartTimer() { - - var heartbeatSource = _container.Resolve(); - heartbeatSource.Interval = TimeSpan.FromMilliseconds(25); - - _container.Resolve>() - .Verify(x => x.Sweep(), Times.Never()); - - heartbeatSource.Activate(); - System.Threading.Thread.Sleep(TimeSpan.FromMilliseconds(80)); - heartbeatSource.Terminate(); - - _container.Resolve>() - .Verify(x => x.Sweep(), Times.AtLeastOnce()); - } - } -} +using System; +using Autofac; +using Moq; +using NUnit.Framework; +using Orchard.Environment; +using Orchard.Mvc; +using Orchard.Tasks; +using Orchard.Tests.Stubs; +using Orchard.Tests.Utility; + +namespace Orchard.Tests.Tasks { + [TestFixture] + public class SweepGeneratorTests : ContainerTestBase { + protected override void Register(ContainerBuilder builder) { + builder.RegisterAutoMocking(MockBehavior.Loose); + builder.RegisterModule(new WorkContextModule()); + builder.RegisterType().As(); + builder.RegisterType(); + } + + protected override void Resolve(ILifetimeScope container) { + container.Mock() + .Setup(x => x.Current()) + .Returns(() => null); + + container.Mock() + .Setup(x => x.Started()); + } + + [Test] + public void DoWorkShouldSendHeartbeatToTaskManager() { + var heartbeatSource = _container.Resolve(); + heartbeatSource.DoWork(); + _container.Resolve>() + .Verify(x => x.Sweep(), Times.Once()); + } + + [Test] + public void ActivatedEventShouldStartTimer() { + + var heartbeatSource = _container.Resolve(); + heartbeatSource.Interval = TimeSpan.FromMilliseconds(25); + + _container.Resolve>() + .Verify(x => x.Sweep(), Times.Never()); + + heartbeatSource.Activate(); + System.Threading.Thread.Sleep(TimeSpan.FromMilliseconds(80)); + heartbeatSource.Terminate(); + + _container.Resolve>() + .Verify(x => x.Sweep(), Times.AtLeastOnce()); + } + } +} diff --git a/src/Orchard.Tests/Time/TimeZoneSelectorTests.cs b/src/Orchard.Tests/Time/TimeZoneSelectorTests.cs index b0cee916b39..65c6e47b1fb 100644 --- a/src/Orchard.Tests/Time/TimeZoneSelectorTests.cs +++ b/src/Orchard.Tests/Time/TimeZoneSelectorTests.cs @@ -1,85 +1,85 @@ -using System; -using System.Web; -using Autofac; -using NUnit.Framework; -using Orchard.Tests.Stubs; -using Orchard.Time; - -namespace Orchard.Tests.Time { - [TestFixture] - public class TimeZoneProviderTests { - private IContainer _container; - private IWorkContextStateProvider _workContextStateProvider; - private TestTimeZoneSelector _timeZoneSelector; - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - builder.RegisterInstance(_timeZoneSelector = new TestTimeZoneSelector()).As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - - _container = builder.Build(); - _workContextStateProvider = _container.Resolve(); - } - - [Test] - public void ShouldProvideCurrentTimeZoneOnly() { - _timeZoneSelector.TimeZone = null; - var timeZone = _workContextStateProvider.Get("Foo"); - - Assert.That(timeZone, Is.Null); - } - - [Test] - public void DefaultTimeZoneIsLocal() { - _timeZoneSelector.Priority = -200; - var timeZone = _workContextStateProvider.Get("CurrentTimeZone"); - - Assert.That(timeZone(new StubWorkContext()), Is.EqualTo(TimeZoneInfo.Local)); - } - - [Test] - public void TimeZoneProviderReturnsTimeZoneFromSelector() { - _timeZoneSelector.Priority = 999; - _timeZoneSelector.TimeZone = TimeZoneInfo.Utc; - var timeZone = _workContextStateProvider.Get("CurrentTimeZone"); - - Assert.That(timeZone(new StubWorkContext()), Is.EqualTo(TimeZoneInfo.Utc)); - } - - } - - public class TestTimeZoneSelector : ITimeZoneSelector { - public TimeZoneInfo TimeZone { get; set; } - public int Priority { get; set; } - - public TimeZoneSelectorResult GetTimeZone(HttpContextBase context) { - return new TimeZoneSelectorResult { - Priority = Priority, - TimeZone= TimeZone - }; - } - } - - public class StubWorkContext : WorkContext { - public override T Resolve() { - throw new NotImplementedException(); - } - - public override bool TryResolve(out T service) { - throw new NotImplementedException(); - } - - public override T GetState(string name) { - return default(T); - } - - public override void SetState(string name, T value) { - - } - } -} - +using System; +using System.Web; +using Autofac; +using NUnit.Framework; +using Orchard.Tests.Stubs; +using Orchard.Time; + +namespace Orchard.Tests.Time { + [TestFixture] + public class TimeZoneProviderTests { + private IContainer _container; + private IWorkContextStateProvider _workContextStateProvider; + private TestTimeZoneSelector _timeZoneSelector; + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + builder.RegisterInstance(_timeZoneSelector = new TestTimeZoneSelector()).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + + _container = builder.Build(); + _workContextStateProvider = _container.Resolve(); + } + + [Test] + public void ShouldProvideCurrentTimeZoneOnly() { + _timeZoneSelector.TimeZone = null; + var timeZone = _workContextStateProvider.Get("Foo"); + + Assert.That(timeZone, Is.Null); + } + + [Test] + public void DefaultTimeZoneIsLocal() { + _timeZoneSelector.Priority = -200; + var timeZone = _workContextStateProvider.Get("CurrentTimeZone"); + + Assert.That(timeZone(new StubWorkContext()), Is.EqualTo(TimeZoneInfo.Local)); + } + + [Test] + public void TimeZoneProviderReturnsTimeZoneFromSelector() { + _timeZoneSelector.Priority = 999; + _timeZoneSelector.TimeZone = TimeZoneInfo.Utc; + var timeZone = _workContextStateProvider.Get("CurrentTimeZone"); + + Assert.That(timeZone(new StubWorkContext()), Is.EqualTo(TimeZoneInfo.Utc)); + } + + } + + public class TestTimeZoneSelector : ITimeZoneSelector { + public TimeZoneInfo TimeZone { get; set; } + public int Priority { get; set; } + + public TimeZoneSelectorResult GetTimeZone(HttpContextBase context) { + return new TimeZoneSelectorResult { + Priority = Priority, + TimeZone= TimeZone + }; + } + } + + public class StubWorkContext : WorkContext { + public override T Resolve() { + throw new NotImplementedException(); + } + + public override bool TryResolve(out T service) { + throw new NotImplementedException(); + } + + public override T GetState(string name) { + return default(T); + } + + public override void SetState(string name, T value) { + + } + } +} + diff --git a/src/Orchard.Tests/UI/Admin/AdminAuthorizationFilterTests.cs b/src/Orchard.Tests/UI/Admin/AdminAuthorizationFilterTests.cs index aaff08f22a3..3ab04cc8250 100644 --- a/src/Orchard.Tests/UI/Admin/AdminAuthorizationFilterTests.cs +++ b/src/Orchard.Tests/UI/Admin/AdminAuthorizationFilterTests.cs @@ -1,114 +1,114 @@ -using System.Web.Mvc; -using System.Web.Routing; -using Moq; -using NUnit.Framework; -using Orchard.Localization; -using Orchard.Security; -using Orchard.Tests.Stubs; -using Orchard.UI.Admin; - -namespace Orchard.Tests.UI.Admin { - [TestFixture] - public class AdminAuthorizationFilterTests { - - private static AuthorizationContext GetAuthorizationContext() where TController : ControllerBase, new() { - var controllerDescriptor = new ReflectedControllerDescriptor(typeof(TController)); - var controllerContext = new ControllerContext(new StubHttpContext(), new RouteData(), new TController()); - return new AuthorizationContext( - controllerContext, - controllerDescriptor.FindAction(controllerContext, "Index")); - } - - private static IAuthorizer GetAuthorizer(bool result) { - var authorizer = new Mock(); - authorizer - .Setup(x => x.Authorize(StandardPermissions.AccessAdminPanel, It.IsAny())). - Returns(result); - return authorizer.Object; - } - - [Test] - public void NormalRequestShouldNotBeAffected() { - var authorizationContext = GetAuthorizationContext(); - - var filter = new AdminFilter(GetAuthorizer(false)); - filter.OnAuthorization(authorizationContext); - - Assert.That(authorizationContext.Result, Is.Null); - } - - private static void TestActionThatShouldRequirePermission() where TController : ControllerBase, new() { - var authorizationContext = GetAuthorizationContext(); - var filter = new AdminFilter(GetAuthorizer(false)); - filter.OnAuthorization(authorizationContext); - Assert.That(authorizationContext.Result, Is.InstanceOf()); - Assert.That(AdminFilter.IsApplied(authorizationContext.RequestContext), Is.True); - - var authorizationContext2 = GetAuthorizationContext(); - var filter2 = new AdminFilter(GetAuthorizer(true)); - filter2.OnAuthorization(authorizationContext2); - Assert.That(authorizationContext2.Result, Is.Null); - Assert.That(AdminFilter.IsApplied(authorizationContext2.RequestContext), Is.True); - } - - - [Test] - public void AdminRequestShouldRequirePermission() { - TestActionThatShouldRequirePermission(); - } - - [Test] - public void NormalWithAttribRequestShouldRequirePermission() { - TestActionThatShouldRequirePermission(); - } - - [Test] - public void NormalWithActionAttribRequestShouldRequirePermission() { - TestActionThatShouldRequirePermission(); - } - - [Test] - public void InheritedAttribRequestShouldRequirePermission() { - TestActionThatShouldRequirePermission(); - } - } - - public class NormalController : Controller { - public ActionResult Index() { - return View(); - } - } - - public class AdminController : Controller { - public ActionResult Index() { - return View(); - } - } - - [Admin] - public class NormalWithAttribController : Controller { - public ActionResult Index() { - return View(); - } - } - - public class NormalWithActionAttribController : Controller { - [Admin] - public ActionResult Index() { - return View(); - } - } - - [Admin] - public class BaseWithAttribController : Controller { - public ActionResult Something() { - return View(); - } - } - - public class InheritedAttribController : BaseWithAttribController { - public ActionResult Index() { - return View(); - } - } -} +using System.Web.Mvc; +using System.Web.Routing; +using Moq; +using NUnit.Framework; +using Orchard.Localization; +using Orchard.Security; +using Orchard.Tests.Stubs; +using Orchard.UI.Admin; + +namespace Orchard.Tests.UI.Admin { + [TestFixture] + public class AdminAuthorizationFilterTests { + + private static AuthorizationContext GetAuthorizationContext() where TController : ControllerBase, new() { + var controllerDescriptor = new ReflectedControllerDescriptor(typeof(TController)); + var controllerContext = new ControllerContext(new StubHttpContext(), new RouteData(), new TController()); + return new AuthorizationContext( + controllerContext, + controllerDescriptor.FindAction(controllerContext, "Index")); + } + + private static IAuthorizer GetAuthorizer(bool result) { + var authorizer = new Mock(); + authorizer + .Setup(x => x.Authorize(StandardPermissions.AccessAdminPanel, It.IsAny())). + Returns(result); + return authorizer.Object; + } + + [Test] + public void NormalRequestShouldNotBeAffected() { + var authorizationContext = GetAuthorizationContext(); + + var filter = new AdminFilter(GetAuthorizer(false)); + filter.OnAuthorization(authorizationContext); + + Assert.That(authorizationContext.Result, Is.Null); + } + + private static void TestActionThatShouldRequirePermission() where TController : ControllerBase, new() { + var authorizationContext = GetAuthorizationContext(); + var filter = new AdminFilter(GetAuthorizer(false)); + filter.OnAuthorization(authorizationContext); + Assert.That(authorizationContext.Result, Is.InstanceOf()); + Assert.That(AdminFilter.IsApplied(authorizationContext.RequestContext), Is.True); + + var authorizationContext2 = GetAuthorizationContext(); + var filter2 = new AdminFilter(GetAuthorizer(true)); + filter2.OnAuthorization(authorizationContext2); + Assert.That(authorizationContext2.Result, Is.Null); + Assert.That(AdminFilter.IsApplied(authorizationContext2.RequestContext), Is.True); + } + + + [Test] + public void AdminRequestShouldRequirePermission() { + TestActionThatShouldRequirePermission(); + } + + [Test] + public void NormalWithAttribRequestShouldRequirePermission() { + TestActionThatShouldRequirePermission(); + } + + [Test] + public void NormalWithActionAttribRequestShouldRequirePermission() { + TestActionThatShouldRequirePermission(); + } + + [Test] + public void InheritedAttribRequestShouldRequirePermission() { + TestActionThatShouldRequirePermission(); + } + } + + public class NormalController : Controller { + public ActionResult Index() { + return View(); + } + } + + public class AdminController : Controller { + public ActionResult Index() { + return View(); + } + } + + [Admin] + public class NormalWithAttribController : Controller { + public ActionResult Index() { + return View(); + } + } + + public class NormalWithActionAttribController : Controller { + [Admin] + public ActionResult Index() { + return View(); + } + } + + [Admin] + public class BaseWithAttribController : Controller { + public ActionResult Something() { + return View(); + } + } + + public class InheritedAttribController : BaseWithAttribController { + public ActionResult Index() { + return View(); + } + } +} diff --git a/src/Orchard.Tests/UI/Admin/AdminThemeSelectorTests.cs b/src/Orchard.Tests/UI/Admin/AdminThemeSelectorTests.cs index 04b21d51147..b08777c3165 100644 --- a/src/Orchard.Tests/UI/Admin/AdminThemeSelectorTests.cs +++ b/src/Orchard.Tests/UI/Admin/AdminThemeSelectorTests.cs @@ -1,58 +1,58 @@ -using System.Web.Routing; -using NUnit.Framework; -using Orchard.Tests.Stubs; -using Orchard.UI.Admin; - -namespace Orchard.Tests.UI.Admin { - [TestFixture] - public class AdminThemeSelectorTests { - [Test] - public void IsAppliedShouldBeFalseByDefault() { - var context = new RequestContext(new StubHttpContext(), new RouteData()); - var isApplied = AdminFilter.IsApplied(context); - Assert.That(isApplied, Is.False); - } - - [Test] - public void IsAppliedShouldBeTrueAfterBeingApplied() { - var context = new RequestContext(new StubHttpContext(), new RouteData()); - Assert.That(AdminFilter.IsApplied(context), Is.False); - AdminFilter.Apply(context); - Assert.That(AdminFilter.IsApplied(context), Is.True); - } - - - [Test] - public void IsAppliedIsFalseOnNewContext() { - var context = new RequestContext(new StubHttpContext(), new RouteData()); - Assert.That(AdminFilter.IsApplied(context), Is.False); - AdminFilter.Apply(context); - Assert.That(AdminFilter.IsApplied(context), Is.True); - context = new RequestContext(new StubHttpContext(), new RouteData()); - Assert.That(AdminFilter.IsApplied(context), Is.False); - } - - [Test] - public void ThemeResultShouldBeNullNormally() { - var context = new RequestContext(new StubHttpContext(), new RouteData()); - - var selector = new AdminThemeSelector(); - var result = selector.GetTheme(context); - Assert.That(result, Is.Null); - } - - - [Test] - public void ThemeResultShouldBeTheAdminAt100AfterBeingSet() { - var context = new RequestContext(new StubHttpContext(), new RouteData()); - - AdminFilter.Apply(context); - - var selector = new AdminThemeSelector(); - var result = selector.GetTheme(context); - Assert.That(result, Is.Not.Null); - Assert.That(result.ThemeName, Is.EqualTo("TheAdmin")); - Assert.That(result.Priority, Is.EqualTo(100)); - } - } -} +using System.Web.Routing; +using NUnit.Framework; +using Orchard.Tests.Stubs; +using Orchard.UI.Admin; + +namespace Orchard.Tests.UI.Admin { + [TestFixture] + public class AdminThemeSelectorTests { + [Test] + public void IsAppliedShouldBeFalseByDefault() { + var context = new RequestContext(new StubHttpContext(), new RouteData()); + var isApplied = AdminFilter.IsApplied(context); + Assert.That(isApplied, Is.False); + } + + [Test] + public void IsAppliedShouldBeTrueAfterBeingApplied() { + var context = new RequestContext(new StubHttpContext(), new RouteData()); + Assert.That(AdminFilter.IsApplied(context), Is.False); + AdminFilter.Apply(context); + Assert.That(AdminFilter.IsApplied(context), Is.True); + } + + + [Test] + public void IsAppliedIsFalseOnNewContext() { + var context = new RequestContext(new StubHttpContext(), new RouteData()); + Assert.That(AdminFilter.IsApplied(context), Is.False); + AdminFilter.Apply(context); + Assert.That(AdminFilter.IsApplied(context), Is.True); + context = new RequestContext(new StubHttpContext(), new RouteData()); + Assert.That(AdminFilter.IsApplied(context), Is.False); + } + + [Test] + public void ThemeResultShouldBeNullNormally() { + var context = new RequestContext(new StubHttpContext(), new RouteData()); + + var selector = new AdminThemeSelector(); + var result = selector.GetTheme(context); + Assert.That(result, Is.Null); + } + + + [Test] + public void ThemeResultShouldBeTheAdminAt100AfterBeingSet() { + var context = new RequestContext(new StubHttpContext(), new RouteData()); + + AdminFilter.Apply(context); + + var selector = new AdminThemeSelector(); + var result = selector.GetTheme(context); + Assert.That(result, Is.Not.Null); + Assert.That(result.ThemeName, Is.EqualTo("TheAdmin")); + Assert.That(result.Priority, Is.EqualTo(100)); + } + } +} diff --git a/src/Orchard.Tests/UI/Navigation/MenuFilterTests.cs b/src/Orchard.Tests/UI/Navigation/MenuFilterTests.cs index e4dbf330c8e..e2ed480a3c3 100644 --- a/src/Orchard.Tests/UI/Navigation/MenuFilterTests.cs +++ b/src/Orchard.Tests/UI/Navigation/MenuFilterTests.cs @@ -1,146 +1,146 @@ -using System.Collections.Generic; -using System.Linq; -using System.Web.Routing; -using Castle.Core.Internal; -using Moq; -using NUnit.Framework; -using Orchard.DisplayManagement; -using Orchard.Localization; -using Orchard.UI.Navigation; - -namespace Orchard.Tests.UI.Navigation { - [TestFixture] - public class MenuFilterTests { - private const string FirstLevel1Action = "FirstLevel1"; - private const string SecondLevel1Action = "SecondLevel1"; - private const string SecondLevel2Action = "SecondLevel2"; - private const string ThirdLevel1Action = "ThirdLevel1"; - private const string ThirdLevel2Action = "ThirdLevel2"; - private const string ThirdLevel3Action = "ThirdLevel3"; - private const string ThirdLevel4Action = "ThirdLevel4"; - private const string FourthLevel1Action = "FourthLevel1"; - private const string FourthLevel2Action = "FourthLevel2"; - private const string FourthLevel3Action = "FourthLevel3"; - private const string FourthLevel4Action = "FourthLevel4"; - - [Test] - public void MockNavManagerWorks() { - var main = GetNavigationManager().Object.BuildMenu("main"); - Assert.That(main.Count(), Is.EqualTo(1)); - } - - [Test] - public void FindSelectedPathScenario2() { - NavigationBuilder navigationBuilder = BuildMenuScenario2(); - IEnumerable menuItems = navigationBuilder.Build(); - - MenuItem firstLevel1 = FindMenuItem(menuItems, "X"); - MenuItem secondLevel2 = FindMenuItem(menuItems, "B"); - MenuItem thirdLevel2 = FindMenuItem(menuItems, "D"); - MenuItem fourthLevel3 = FindMenuItem(menuItems, "G"); - RouteData fourthLevel3RouteData = GetRouteData(fourthLevel3); - - Stack selectionStack = MenuFilterAccessor.FindSelectedPathAccessor(menuItems, fourthLevel3RouteData); - Assert.That(selectionStack.Pop(), Is.EqualTo(firstLevel1)); - Assert.That(selectionStack.Pop(), Is.EqualTo(secondLevel2)); - Assert.That(selectionStack.Pop(), Is.EqualTo(thirdLevel2)); - Assert.That(selectionStack.Pop(), Is.EqualTo(fourthLevel3)); - Assert.That(selectionStack.Count, Is.EqualTo(0)); - } - - [Test] - public void FindParentLocalTaskScenario2() { - NavigationBuilder navigationBuilder = BuildMenuScenario2(); - IEnumerable menuItems = navigationBuilder.Build(); - - MenuItem fourthLevel3 = FindMenuItem(menuItems, "G"); - RouteData fourthLevel3RouteData = GetRouteData(fourthLevel3); - Stack selectedPath = MenuFilterAccessor.FindSelectedPathAccessor(menuItems, fourthLevel3RouteData); - - MenuItem parentNode = MenuFilterAccessor.FindParentLocalTaskAccessor(selectedPath); - - Assert.That(parentNode, Is.EqualTo(FindMenuItem(menuItems, "B"))); - } - - private static Mock GetNavigationManager() { - var mainMenu = new[] { new MenuItem { Text = new LocalizedString("The Main Menu") } }; - var adminMenu = new[] { new MenuItem { Text = new LocalizedString("The Admin Menu") } }; - var navigationManager = new Mock(); - navigationManager.Setup(x => x.BuildMenu("main")).Returns(mainMenu); - navigationManager.Setup(x => x.BuildMenu("admin")).Returns(adminMenu); - return navigationManager; - } - - private static NavigationBuilder BuildMenuScenario1() { - NavigationBuilder navigationBuilder = new NavigationBuilder(); - navigationBuilder.Add(new LocalizedString("X"), "0", - menu => menu - .Add(new LocalizedString("A"), "0", subMenu => subMenu.Action("Index", "Admin", new { area = "Area" }) - .Add(new LocalizedString("B"), "0", item => item.Action("Index", "Admin", new { area = "Area" })) - .Add(new LocalizedString("C"), "1", item => item.Action("Index", "Admin", new { area = "Area" }).LocalNav()))) - .Add(new LocalizedString("D"), "1", subMenu => subMenu.Action("Index", "Admin", new { area = "Area" }).LocalNav() - .Add(new LocalizedString("E"), "0", item => item.Action("Index", "Admin", new { area = "Area" })) - .Add(new LocalizedString("F"), "1", item => item.Action("Index", "Admin", new { area = "Area" }).LocalNav())); - - return navigationBuilder; - } - - private static NavigationBuilder BuildMenuScenario2() { - NavigationBuilder navigationBuilder = new NavigationBuilder(); - navigationBuilder.Add(new LocalizedString("X"), "0", - menu => menu - .Add(new LocalizedString("A"), "0", item => item.Action(SecondLevel1Action, "Admin", new { area = "Area" })) - .Add(new LocalizedString("B"), "1", - subMenu => subMenu - .Add(new LocalizedString("C"), "0", item => item.Action(ThirdLevel1Action, "Admin", new { area = "Area" }).LocalNav()) - .Add(new LocalizedString("D"), "1", - subSubMenu => subSubMenu.LocalNav() - .Add(new LocalizedString("E"), "0", item => item.Action(FourthLevel1Action, "Admin", new { area = "Area" }).LocalNav()) - .Add(new LocalizedString("F"), "1", item => item.Action(FourthLevel2Action, "Admin", new { area = "Area" }).LocalNav()) - .Add(new LocalizedString("G"), "2", item => item.Action(FourthLevel3Action, "Admin", new { area = "Area" })) - .Add(new LocalizedString("W"), "3", item => item.Action(FourthLevel4Action, "Admin", new { area = "Area" }))))); - - return navigationBuilder; - } - - protected static MenuItem FindMenuItem(IEnumerable menuItems, string text) { - Queue remainingItems = new Queue(menuItems); - - while (remainingItems.Count > 0) { - MenuItem currentMenuItem = remainingItems.Dequeue(); - - if (currentMenuItem.Text.TextHint.Equals(text)) { - return currentMenuItem; - } - - currentMenuItem.Items.ForEach(remainingItems.Enqueue); - } - - return null; - } - - private static RouteData GetRouteData(MenuItem menuItem) { - RouteData routeData = new RouteData(); - routeData.Values["area"] = menuItem.RouteValues["area"]; - routeData.Values["controller"] = menuItem.RouteValues["controller"]; - routeData.Values["action"] = menuItem.RouteValues["action"]; - - return routeData; - } - - private class MenuFilterAccessor : MenuFilter { - public MenuFilterAccessor(INavigationManager navigationManager, - IWorkContextAccessor workContextAccessor, - IShapeFactory shapeFactory) : - base(navigationManager, workContextAccessor, shapeFactory) {} - - public static Stack FindSelectedPathAccessor(IEnumerable menuItems, RouteData currentRouteData) { - return NavigationHelper.SetSelectedPath(menuItems, null, currentRouteData); - } - - public static MenuItem FindParentLocalTaskAccessor(Stack selectedPath) { - return NavigationHelper.FindParentLocalTask(selectedPath); - } - } - } -} +using System.Collections.Generic; +using System.Linq; +using System.Web.Routing; +using Castle.Core.Internal; +using Moq; +using NUnit.Framework; +using Orchard.DisplayManagement; +using Orchard.Localization; +using Orchard.UI.Navigation; + +namespace Orchard.Tests.UI.Navigation { + [TestFixture] + public class MenuFilterTests { + private const string FirstLevel1Action = "FirstLevel1"; + private const string SecondLevel1Action = "SecondLevel1"; + private const string SecondLevel2Action = "SecondLevel2"; + private const string ThirdLevel1Action = "ThirdLevel1"; + private const string ThirdLevel2Action = "ThirdLevel2"; + private const string ThirdLevel3Action = "ThirdLevel3"; + private const string ThirdLevel4Action = "ThirdLevel4"; + private const string FourthLevel1Action = "FourthLevel1"; + private const string FourthLevel2Action = "FourthLevel2"; + private const string FourthLevel3Action = "FourthLevel3"; + private const string FourthLevel4Action = "FourthLevel4"; + + [Test] + public void MockNavManagerWorks() { + var main = GetNavigationManager().Object.BuildMenu("main"); + Assert.That(main.Count(), Is.EqualTo(1)); + } + + [Test] + public void FindSelectedPathScenario2() { + NavigationBuilder navigationBuilder = BuildMenuScenario2(); + IEnumerable menuItems = navigationBuilder.Build(); + + MenuItem firstLevel1 = FindMenuItem(menuItems, "X"); + MenuItem secondLevel2 = FindMenuItem(menuItems, "B"); + MenuItem thirdLevel2 = FindMenuItem(menuItems, "D"); + MenuItem fourthLevel3 = FindMenuItem(menuItems, "G"); + RouteData fourthLevel3RouteData = GetRouteData(fourthLevel3); + + Stack selectionStack = MenuFilterAccessor.FindSelectedPathAccessor(menuItems, fourthLevel3RouteData); + Assert.That(selectionStack.Pop(), Is.EqualTo(firstLevel1)); + Assert.That(selectionStack.Pop(), Is.EqualTo(secondLevel2)); + Assert.That(selectionStack.Pop(), Is.EqualTo(thirdLevel2)); + Assert.That(selectionStack.Pop(), Is.EqualTo(fourthLevel3)); + Assert.That(selectionStack.Count, Is.EqualTo(0)); + } + + [Test] + public void FindParentLocalTaskScenario2() { + NavigationBuilder navigationBuilder = BuildMenuScenario2(); + IEnumerable menuItems = navigationBuilder.Build(); + + MenuItem fourthLevel3 = FindMenuItem(menuItems, "G"); + RouteData fourthLevel3RouteData = GetRouteData(fourthLevel3); + Stack selectedPath = MenuFilterAccessor.FindSelectedPathAccessor(menuItems, fourthLevel3RouteData); + + MenuItem parentNode = MenuFilterAccessor.FindParentLocalTaskAccessor(selectedPath); + + Assert.That(parentNode, Is.EqualTo(FindMenuItem(menuItems, "B"))); + } + + private static Mock GetNavigationManager() { + var mainMenu = new[] { new MenuItem { Text = new LocalizedString("The Main Menu") } }; + var adminMenu = new[] { new MenuItem { Text = new LocalizedString("The Admin Menu") } }; + var navigationManager = new Mock(); + navigationManager.Setup(x => x.BuildMenu("main")).Returns(mainMenu); + navigationManager.Setup(x => x.BuildMenu("admin")).Returns(adminMenu); + return navigationManager; + } + + private static NavigationBuilder BuildMenuScenario1() { + NavigationBuilder navigationBuilder = new NavigationBuilder(); + navigationBuilder.Add(new LocalizedString("X"), "0", + menu => menu + .Add(new LocalizedString("A"), "0", subMenu => subMenu.Action("Index", "Admin", new { area = "Area" }) + .Add(new LocalizedString("B"), "0", item => item.Action("Index", "Admin", new { area = "Area" })) + .Add(new LocalizedString("C"), "1", item => item.Action("Index", "Admin", new { area = "Area" }).LocalNav()))) + .Add(new LocalizedString("D"), "1", subMenu => subMenu.Action("Index", "Admin", new { area = "Area" }).LocalNav() + .Add(new LocalizedString("E"), "0", item => item.Action("Index", "Admin", new { area = "Area" })) + .Add(new LocalizedString("F"), "1", item => item.Action("Index", "Admin", new { area = "Area" }).LocalNav())); + + return navigationBuilder; + } + + private static NavigationBuilder BuildMenuScenario2() { + NavigationBuilder navigationBuilder = new NavigationBuilder(); + navigationBuilder.Add(new LocalizedString("X"), "0", + menu => menu + .Add(new LocalizedString("A"), "0", item => item.Action(SecondLevel1Action, "Admin", new { area = "Area" })) + .Add(new LocalizedString("B"), "1", + subMenu => subMenu + .Add(new LocalizedString("C"), "0", item => item.Action(ThirdLevel1Action, "Admin", new { area = "Area" }).LocalNav()) + .Add(new LocalizedString("D"), "1", + subSubMenu => subSubMenu.LocalNav() + .Add(new LocalizedString("E"), "0", item => item.Action(FourthLevel1Action, "Admin", new { area = "Area" }).LocalNav()) + .Add(new LocalizedString("F"), "1", item => item.Action(FourthLevel2Action, "Admin", new { area = "Area" }).LocalNav()) + .Add(new LocalizedString("G"), "2", item => item.Action(FourthLevel3Action, "Admin", new { area = "Area" })) + .Add(new LocalizedString("W"), "3", item => item.Action(FourthLevel4Action, "Admin", new { area = "Area" }))))); + + return navigationBuilder; + } + + protected static MenuItem FindMenuItem(IEnumerable menuItems, string text) { + Queue remainingItems = new Queue(menuItems); + + while (remainingItems.Count > 0) { + MenuItem currentMenuItem = remainingItems.Dequeue(); + + if (currentMenuItem.Text.TextHint.Equals(text)) { + return currentMenuItem; + } + + currentMenuItem.Items.ForEach(remainingItems.Enqueue); + } + + return null; + } + + private static RouteData GetRouteData(MenuItem menuItem) { + RouteData routeData = new RouteData(); + routeData.Values["area"] = menuItem.RouteValues["area"]; + routeData.Values["controller"] = menuItem.RouteValues["controller"]; + routeData.Values["action"] = menuItem.RouteValues["action"]; + + return routeData; + } + + private class MenuFilterAccessor : MenuFilter { + public MenuFilterAccessor(INavigationManager navigationManager, + IWorkContextAccessor workContextAccessor, + IShapeFactory shapeFactory) : + base(navigationManager, workContextAccessor, shapeFactory) {} + + public static Stack FindSelectedPathAccessor(IEnumerable menuItems, RouteData currentRouteData) { + return NavigationHelper.SetSelectedPath(menuItems, null, currentRouteData); + } + + public static MenuItem FindParentLocalTaskAccessor(Stack selectedPath) { + return NavigationHelper.FindParentLocalTask(selectedPath); + } + } + } +} diff --git a/src/Orchard.Tests/UI/Navigation/MenuItemComparerTests.cs b/src/Orchard.Tests/UI/Navigation/MenuItemComparerTests.cs index 4f24b2d7d1a..97579aff54c 100644 --- a/src/Orchard.Tests/UI/Navigation/MenuItemComparerTests.cs +++ b/src/Orchard.Tests/UI/Navigation/MenuItemComparerTests.cs @@ -1,84 +1,84 @@ -using System.Web.Routing; -using NUnit.Framework; -using Orchard.Localization; -using Orchard.UI.Navigation; - -namespace Orchard.Tests.UI.Navigation { - [TestFixture] - public class MenuItemComparerTests { - [Test] - public void TextShouldCauseDifferenceAndNullRouteValuesAreEqual() { - var item1 = new MenuItem { Text = new LocalizedString("hello") }; - var item2 = new MenuItem { Text = new LocalizedString("hello") }; - var item3 = new MenuItem { Text = new LocalizedString("hello3") }; - AssertSameSameDifferent(item1, item2, item3); - } - - [Test] - public void NullRouteValuesShouldEqualEmptyRouteValues() { - var item1 = new MenuItem { Text = new LocalizedString("hello") }; - var item2 = new MenuItem { Text = new LocalizedString("hello") }; - var item3 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary() }; - var item4 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary() }; - AssertSameSameSame(item1, item2, item3); - AssertSameSameSame(item3, item4, item1); - } - [Test] - public void AdditionalPropertiesShouldMismatch() { - var item1 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = 1 }) }; - var item2 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = 1 }) }; - var item3 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = 1, two = 2 }) }; - AssertSameSameDifferent(item1, item2, item3); - } - - [Test] - public void ValueTypeShouldMismatch() { - var item1 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = 1 }) }; - var item2 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = 1 }) }; - var item3 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = "1" }) }; - AssertSameSameDifferent(item1, item2, item3); - } - - [Test] - public void ValuesShouldMismatch() { - var item1 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = "1", two = "2" }) }; - var item2 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = "1", two = "2" }) }; - var item3 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = "1", two = "3" }) }; - AssertSameSameDifferent(item1, item2, item3); - } - - [Test] - public void PositionAndChildrenDontMatter() { - var item1 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = "1", two = "2" }) }; - var item2 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = "1", two = "2" }), Position = "4.0" }; - var item3 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = "1", two = "2" }), Items = new[] { new MenuItem() } }; - AssertSameSameSame(item1, item2, item3); - } - - private static void AssertSameSameDifferent(MenuItem item1, MenuItem item2, MenuItem item3) { - var comparer = new MenuItemComparer(); - - Assert.That(comparer.Equals(item1, item2), Is.True); - Assert.That(comparer.Equals(item1, item3), Is.False); - Assert.That(comparer.Equals(item2, item3), Is.False); - - Assert.That(comparer.GetHashCode(item1), Is.EqualTo(comparer.GetHashCode(item2))); - // - hash inequality isn't really guaranteed, now that you mention it - //Assert.That(comparer.GetHashCode(item1), Is.Not.EqualTo(comparer.GetHashCode(item3))); - //Assert.That(comparer.GetHashCode(item2), Is.Not.EqualTo(comparer.GetHashCode(item3))); - } - - private static void AssertSameSameSame(MenuItem item1, MenuItem item2, MenuItem item3) { - var comparer = new MenuItemComparer(); - - Assert.That(comparer.Equals(item1, item2), Is.True); - Assert.That(comparer.Equals(item1, item3), Is.True); - Assert.That(comparer.Equals(item2, item3), Is.True); - - Assert.That(comparer.GetHashCode(item1), Is.EqualTo(comparer.GetHashCode(item2))); - Assert.That(comparer.GetHashCode(item1), Is.EqualTo(comparer.GetHashCode(item3))); - Assert.That(comparer.GetHashCode(item2), Is.EqualTo(comparer.GetHashCode(item3))); - } - } -} - +using System.Web.Routing; +using NUnit.Framework; +using Orchard.Localization; +using Orchard.UI.Navigation; + +namespace Orchard.Tests.UI.Navigation { + [TestFixture] + public class MenuItemComparerTests { + [Test] + public void TextShouldCauseDifferenceAndNullRouteValuesAreEqual() { + var item1 = new MenuItem { Text = new LocalizedString("hello") }; + var item2 = new MenuItem { Text = new LocalizedString("hello") }; + var item3 = new MenuItem { Text = new LocalizedString("hello3") }; + AssertSameSameDifferent(item1, item2, item3); + } + + [Test] + public void NullRouteValuesShouldEqualEmptyRouteValues() { + var item1 = new MenuItem { Text = new LocalizedString("hello") }; + var item2 = new MenuItem { Text = new LocalizedString("hello") }; + var item3 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary() }; + var item4 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary() }; + AssertSameSameSame(item1, item2, item3); + AssertSameSameSame(item3, item4, item1); + } + [Test] + public void AdditionalPropertiesShouldMismatch() { + var item1 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = 1 }) }; + var item2 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = 1 }) }; + var item3 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = 1, two = 2 }) }; + AssertSameSameDifferent(item1, item2, item3); + } + + [Test] + public void ValueTypeShouldMismatch() { + var item1 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = 1 }) }; + var item2 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = 1 }) }; + var item3 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = "1" }) }; + AssertSameSameDifferent(item1, item2, item3); + } + + [Test] + public void ValuesShouldMismatch() { + var item1 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = "1", two = "2" }) }; + var item2 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = "1", two = "2" }) }; + var item3 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = "1", two = "3" }) }; + AssertSameSameDifferent(item1, item2, item3); + } + + [Test] + public void PositionAndChildrenDontMatter() { + var item1 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = "1", two = "2" }) }; + var item2 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = "1", two = "2" }), Position = "4.0" }; + var item3 = new MenuItem { Text = new LocalizedString("hello"), RouteValues = new RouteValueDictionary(new { one = "1", two = "2" }), Items = new[] { new MenuItem() } }; + AssertSameSameSame(item1, item2, item3); + } + + private static void AssertSameSameDifferent(MenuItem item1, MenuItem item2, MenuItem item3) { + var comparer = new MenuItemComparer(); + + Assert.That(comparer.Equals(item1, item2), Is.True); + Assert.That(comparer.Equals(item1, item3), Is.False); + Assert.That(comparer.Equals(item2, item3), Is.False); + + Assert.That(comparer.GetHashCode(item1), Is.EqualTo(comparer.GetHashCode(item2))); + // - hash inequality isn't really guaranteed, now that you mention it + //Assert.That(comparer.GetHashCode(item1), Is.Not.EqualTo(comparer.GetHashCode(item3))); + //Assert.That(comparer.GetHashCode(item2), Is.Not.EqualTo(comparer.GetHashCode(item3))); + } + + private static void AssertSameSameSame(MenuItem item1, MenuItem item2, MenuItem item3) { + var comparer = new MenuItemComparer(); + + Assert.That(comparer.Equals(item1, item2), Is.True); + Assert.That(comparer.Equals(item1, item3), Is.True); + Assert.That(comparer.Equals(item2, item3), Is.True); + + Assert.That(comparer.GetHashCode(item1), Is.EqualTo(comparer.GetHashCode(item2))); + Assert.That(comparer.GetHashCode(item1), Is.EqualTo(comparer.GetHashCode(item3))); + Assert.That(comparer.GetHashCode(item2), Is.EqualTo(comparer.GetHashCode(item3))); + } + } +} + diff --git a/src/Orchard.Tests/UI/Navigation/NavigationManagerTests.cs b/src/Orchard.Tests/UI/Navigation/NavigationManagerTests.cs index 7c5aa398b57..945e1bedaf1 100644 --- a/src/Orchard.Tests/UI/Navigation/NavigationManagerTests.cs +++ b/src/Orchard.Tests/UI/Navigation/NavigationManagerTests.cs @@ -1,156 +1,156 @@ -using System; -using System.Linq; -using System.Web.Mvc; -using System.Web.Routing; -using Autofac; -using NUnit.Framework; -using Orchard.ContentManagement; -using Orchard.Core.Navigation.Services; -using Orchard.Data; -using Orchard.Environment.Configuration; -using Orchard.Localization; -using Orchard.Security; -using Orchard.Security.Permissions; -using Orchard.Tests.Stubs; -using Orchard.UI.Navigation; -using Orchard.UI.Notify; - -namespace Orchard.Tests.UI.Navigation { - [TestFixture] - public class NavigationManagerTests { - [Test] - public void EmptyMenuIfNameDoesntMatch() { - var manager = new NavigationManager(new[] { new StubProvider() }, new IMenuProvider[] { }, new StubAuth(), new INavigationFilter[0], new UrlHelper(new RequestContext(new StubHttpContext("~/"), new RouteData())), new StubOrchardServices(), new ShellSettings()); - - var menuItems = manager.BuildMenu("primary"); - Assert.That(menuItems.Count(), Is.EqualTo(0)); - } - - public class StubAuth : IAuthorizationService { - public void CheckAccess(Permission permission, IUser user, IContent content) { - } - - public bool TryCheckAccess(Permission permission, IUser user, IContent content) { - return true; - } - } - - [Test] - public void NavigationManagerShouldUseProvidersToBuildNamedMenu() { - var manager = new NavigationManager(new[] { new StubProvider() }, new IMenuProvider[] { }, new StubAuth(), new INavigationFilter[0], new UrlHelper(new RequestContext(new StubHttpContext("~/"), new RouteData())), new StubOrchardServices(), new ShellSettings()); - - var menuItems = manager.BuildMenu("admin"); - Assert.That(menuItems.Count(), Is.EqualTo(2)); - Assert.That(menuItems.First(), Has.Property("Text").Property("TextHint").EqualTo("Foo")); - Assert.That(menuItems.Last(), Has.Property("Text").Property("TextHint").EqualTo("Bar")); - Assert.That(menuItems.Last().Items.Count(), Is.EqualTo(1)); - Assert.That(menuItems.Last().Items.Single().Text.TextHint, Is.EqualTo("Frap")); - } - - [Test] - public void NavigationManagerShouldCatchProviderErrors() { - var manager = new NavigationManager(new[] { new BrokenProvider() }, new IMenuProvider[] { }, new StubAuth(), new INavigationFilter[0], new UrlHelper(new RequestContext(new StubHttpContext("~/"), new RouteData())), new StubOrchardServices(), new ShellSettings()); - - var menuItems = manager.BuildMenu("admin"); - Assert.That(menuItems.Count(), Is.EqualTo(0)); - } - - [Test] - public void NavigationManagerShouldMergeAndOrderNavigation() { - var manager = new NavigationManager(new INavigationProvider[] { new StubProvider(), new Stub2Provider() }, new IMenuProvider[] { }, new StubAuth(), new INavigationFilter[0], new UrlHelper(new RequestContext(new StubHttpContext("~/"), new RouteData())), new StubOrchardServices(), new ShellSettings()); - - var menuItems = manager.BuildMenu("admin"); - Assert.That(menuItems.Count(), Is.EqualTo(3)); - - var item1 = menuItems.First(); - var item2 = menuItems.Skip(1).First(); - var item3 = menuItems.Skip(2).First(); - - Assert.That(item1.Text.TextHint, Is.EqualTo("Foo")); - Assert.That(item1.Position, Is.EqualTo("1.0")); - Assert.That(item2.Text.TextHint, Is.EqualTo("Bar")); - Assert.That(item2.Position, Is.EqualTo("2.0")); - Assert.That(item3.Text.TextHint, Is.EqualTo("Frap")); - Assert.That(item3.Position, Is.EqualTo("3.0")); - - Assert.That(item2.Items.Count(), Is.EqualTo(2)); - var subitem1 = item2.Items.First(); - var subitem2 = item2.Items.Last(); - Assert.That(subitem1.Text.TextHint, Is.EqualTo("Quad")); - Assert.That(subitem1.Position, Is.EqualTo("1.a")); - Assert.That(subitem2.Text.TextHint, Is.EqualTo("Frap")); - Assert.That(subitem2.Position, Is.EqualTo("1.b")); - } - - public class StubProvider : INavigationProvider { - public string MenuName { get { return "admin"; } } - - public void GetNavigation(NavigationBuilder builder) { - var T = NullLocalizer.Instance; - builder - .Add(new LocalizedString("Foo", "", "Foo", null), "1.0", x => x.Action("foo")) - .Add(new LocalizedString("Bar", "", "Bar", null), "2.0", x => x.Add(new LocalizedString("Frap", "", "Frap", null), "1.b")); - } - } - - public class BrokenProvider : INavigationProvider { - public string MenuName { get { return "admin"; } } - - public void GetNavigation(NavigationBuilder builder) { - throw new NullReferenceException(); - } - } - - public class Stub2Provider : INavigationProvider { - public string MenuName { get { return "admin"; } } - - public void GetNavigation(NavigationBuilder builder) { - var T = NullLocalizer.Instance; - builder - .Add(new LocalizedString("Frap", "", "Frap", null), "3.0", x => x.Action("foo")) - .Add(new LocalizedString("Bar", "", "Bar", null), "4.0", x => x.Add(new LocalizedString("Quad", "", "Quad", null), "1.a")); - } - } - } - - public class StubOrchardServices : IOrchardServices { - private readonly ILifetimeScope _lifetimeScope; - - public StubOrchardServices() {} - - public StubOrchardServices(ILifetimeScope lifetimeScope) { - _lifetimeScope = lifetimeScope; - } - - public IContentManager ContentManager { - get { throw new NotImplementedException(); } - } - - public ITransactionManager TransactionManager { - get { throw new NotImplementedException(); } - } - - public IAuthorizer Authorizer { - get { throw new NotImplementedException(); } - } - - public INotifier Notifier { - get { throw new NotImplementedException(); } - } - - public dynamic New { - get { throw new NotImplementedException(); } - } - - private WorkContext _workContext; - public WorkContext WorkContext { - get { - if(_workContext == null) { - _workContext = new StubWorkContextAccessor(_lifetimeScope).GetContext(); - } - - return _workContext; - } - } - } -} +using System; +using System.Linq; +using System.Web.Mvc; +using System.Web.Routing; +using Autofac; +using NUnit.Framework; +using Orchard.ContentManagement; +using Orchard.Core.Navigation.Services; +using Orchard.Data; +using Orchard.Environment.Configuration; +using Orchard.Localization; +using Orchard.Security; +using Orchard.Security.Permissions; +using Orchard.Tests.Stubs; +using Orchard.UI.Navigation; +using Orchard.UI.Notify; + +namespace Orchard.Tests.UI.Navigation { + [TestFixture] + public class NavigationManagerTests { + [Test] + public void EmptyMenuIfNameDoesntMatch() { + var manager = new NavigationManager(new[] { new StubProvider() }, new IMenuProvider[] { }, new StubAuth(), new INavigationFilter[0], new UrlHelper(new RequestContext(new StubHttpContext("~/"), new RouteData())), new StubOrchardServices(), new ShellSettings()); + + var menuItems = manager.BuildMenu("primary"); + Assert.That(menuItems.Count(), Is.EqualTo(0)); + } + + public class StubAuth : IAuthorizationService { + public void CheckAccess(Permission permission, IUser user, IContent content) { + } + + public bool TryCheckAccess(Permission permission, IUser user, IContent content) { + return true; + } + } + + [Test] + public void NavigationManagerShouldUseProvidersToBuildNamedMenu() { + var manager = new NavigationManager(new[] { new StubProvider() }, new IMenuProvider[] { }, new StubAuth(), new INavigationFilter[0], new UrlHelper(new RequestContext(new StubHttpContext("~/"), new RouteData())), new StubOrchardServices(), new ShellSettings()); + + var menuItems = manager.BuildMenu("admin"); + Assert.That(menuItems.Count(), Is.EqualTo(2)); + Assert.That(menuItems.First(), Has.Property("Text").Property("TextHint").EqualTo("Foo")); + Assert.That(menuItems.Last(), Has.Property("Text").Property("TextHint").EqualTo("Bar")); + Assert.That(menuItems.Last().Items.Count(), Is.EqualTo(1)); + Assert.That(menuItems.Last().Items.Single().Text.TextHint, Is.EqualTo("Frap")); + } + + [Test] + public void NavigationManagerShouldCatchProviderErrors() { + var manager = new NavigationManager(new[] { new BrokenProvider() }, new IMenuProvider[] { }, new StubAuth(), new INavigationFilter[0], new UrlHelper(new RequestContext(new StubHttpContext("~/"), new RouteData())), new StubOrchardServices(), new ShellSettings()); + + var menuItems = manager.BuildMenu("admin"); + Assert.That(menuItems.Count(), Is.EqualTo(0)); + } + + [Test] + public void NavigationManagerShouldMergeAndOrderNavigation() { + var manager = new NavigationManager(new INavigationProvider[] { new StubProvider(), new Stub2Provider() }, new IMenuProvider[] { }, new StubAuth(), new INavigationFilter[0], new UrlHelper(new RequestContext(new StubHttpContext("~/"), new RouteData())), new StubOrchardServices(), new ShellSettings()); + + var menuItems = manager.BuildMenu("admin"); + Assert.That(menuItems.Count(), Is.EqualTo(3)); + + var item1 = menuItems.First(); + var item2 = menuItems.Skip(1).First(); + var item3 = menuItems.Skip(2).First(); + + Assert.That(item1.Text.TextHint, Is.EqualTo("Foo")); + Assert.That(item1.Position, Is.EqualTo("1.0")); + Assert.That(item2.Text.TextHint, Is.EqualTo("Bar")); + Assert.That(item2.Position, Is.EqualTo("2.0")); + Assert.That(item3.Text.TextHint, Is.EqualTo("Frap")); + Assert.That(item3.Position, Is.EqualTo("3.0")); + + Assert.That(item2.Items.Count(), Is.EqualTo(2)); + var subitem1 = item2.Items.First(); + var subitem2 = item2.Items.Last(); + Assert.That(subitem1.Text.TextHint, Is.EqualTo("Quad")); + Assert.That(subitem1.Position, Is.EqualTo("1.a")); + Assert.That(subitem2.Text.TextHint, Is.EqualTo("Frap")); + Assert.That(subitem2.Position, Is.EqualTo("1.b")); + } + + public class StubProvider : INavigationProvider { + public string MenuName { get { return "admin"; } } + + public void GetNavigation(NavigationBuilder builder) { + var T = NullLocalizer.Instance; + builder + .Add(new LocalizedString("Foo", "", "Foo", null), "1.0", x => x.Action("foo")) + .Add(new LocalizedString("Bar", "", "Bar", null), "2.0", x => x.Add(new LocalizedString("Frap", "", "Frap", null), "1.b")); + } + } + + public class BrokenProvider : INavigationProvider { + public string MenuName { get { return "admin"; } } + + public void GetNavigation(NavigationBuilder builder) { + throw new NullReferenceException(); + } + } + + public class Stub2Provider : INavigationProvider { + public string MenuName { get { return "admin"; } } + + public void GetNavigation(NavigationBuilder builder) { + var T = NullLocalizer.Instance; + builder + .Add(new LocalizedString("Frap", "", "Frap", null), "3.0", x => x.Action("foo")) + .Add(new LocalizedString("Bar", "", "Bar", null), "4.0", x => x.Add(new LocalizedString("Quad", "", "Quad", null), "1.a")); + } + } + } + + public class StubOrchardServices : IOrchardServices { + private readonly ILifetimeScope _lifetimeScope; + + public StubOrchardServices() {} + + public StubOrchardServices(ILifetimeScope lifetimeScope) { + _lifetimeScope = lifetimeScope; + } + + public IContentManager ContentManager { + get { throw new NotImplementedException(); } + } + + public ITransactionManager TransactionManager { + get { throw new NotImplementedException(); } + } + + public IAuthorizer Authorizer { + get { throw new NotImplementedException(); } + } + + public INotifier Notifier { + get { throw new NotImplementedException(); } + } + + public dynamic New { + get { throw new NotImplementedException(); } + } + + private WorkContext _workContext; + public WorkContext WorkContext { + get { + if(_workContext == null) { + _workContext = new StubWorkContextAccessor(_lifetimeScope).GetContext(); + } + + return _workContext; + } + } + } +} diff --git a/src/Orchard.Tests/UI/Navigation/PositionComparerTests.cs b/src/Orchard.Tests/UI/Navigation/PositionComparerTests.cs index 2226bea8893..08634048ccf 100644 --- a/src/Orchard.Tests/UI/Navigation/PositionComparerTests.cs +++ b/src/Orchard.Tests/UI/Navigation/PositionComparerTests.cs @@ -1,155 +1,155 @@ -using System; -using System.Collections.Generic; -using NUnit.Framework; -using Orchard.UI; - -namespace Orchard.Tests.UI.Navigation { - [TestFixture] - public class PositionComparerTests { - private IComparer _comparer; - - [SetUp] - public void Init() { - _comparer = new FlatPositionComparer(); - } - - - [Test] - public void LessThanAndGreaterThanShouldBeBelowAndAboveZero() { - var lessThan = StringComparer.InvariantCultureIgnoreCase.Compare("alpha", "beta"); - var greaterThan = StringComparer.InvariantCultureIgnoreCase.Compare("gamma", "delta"); - - Assert.That(lessThan, Is.LessThan(0)); - Assert.That(greaterThan, Is.GreaterThan(0)); - } - - - [Test] - public void NullIsLessThanEmptyAndEmptyIsLessThanNonEmpty() { - Assert.That(_comparer.Compare(null, ""), Is.LessThan(0)); - Assert.That(_comparer.Compare("", "5"), Is.LessThan(0)); - Assert.That(_comparer.Compare(null, "5"), Is.LessThan(0)); - - Assert.That(_comparer.Compare("", null), Is.GreaterThan(0)); - Assert.That(_comparer.Compare("5", ""), Is.GreaterThan(0)); - Assert.That(_comparer.Compare("5", null), Is.GreaterThan(0)); - - Assert.That(_comparer.Compare(null, null), Is.EqualTo(0)); - Assert.That(_comparer.Compare("", ""), Is.EqualTo(0)); - } - - [Test] - public void NumericValuesShouldCompareNumerically() { - AssertLess("3", "5"); - AssertMore("8", "5"); - AssertSame("5", "5"); - AssertMore("100", "5"); - AssertSame("007", "7"); - } - - [Test] - public void NegativeNumericValuesAreLessThanPositive() { - AssertLess("-5", "5"); - AssertSame("-5", "-5"); - AssertMore("42", "-42"); - } - - [Test] - public void NegativeNumericValuesShouldCompareNumerically() { - AssertMore("-3", "-5"); - AssertLess("-8", "-5"); - AssertSame("-5", "-5"); - AssertLess("-100", "-5"); - AssertSame("-007", "-7"); - } - - [Test] - public void DotsSplitParts() { - AssertLess("0500.3", "0500.5"); - AssertMore("0500.8", "0500.5"); - AssertSame("0500.5", "0500.5"); - AssertMore("0500.100", "0500.5"); - AssertSame("0500.007", "0500.7"); - - AssertLess("0500.3.0300", "0500.5.0300"); - AssertMore("0500.8.0300", "0500.5.0300"); - AssertSame("0500.5.0300", "0500.5.0300"); - AssertMore("0500.100.0300", "0500.5.0300"); - AssertSame("0500.007.0300", "0500.7.0300"); - } - - [Test] - public void NumericValuesShouldComeBeforeNonNumeric() { - AssertLess("5", "x"); - AssertLess("50", "50a"); - AssertLess("1.50", "1.50a"); - } - - [Test] - public void NonNumericValuesCompareOrdinallyAndIgnoreCase() { - AssertSame("x", "X"); - AssertLess("rt675x", "rt685x"); - AssertMore("ru675x", "rt675x"); - AssertLess("rt675x", "rt675y"); - - AssertSame("1.x.5", "1.X.5"); - AssertLess("1.rt675x.5", "1.rt685x.5"); - AssertMore("1.ru675x.5", "1.rt675x.5"); - AssertLess("1.rt675x.5", "1.rt675y.5"); - - AssertSame("x.5", "X.5"); - AssertLess("rt675x.5", "rt685x.5"); - AssertMore("ru675x.5", "rt675x.5"); - AssertLess("rt675x.5", "rt675y.5"); - - AssertSame("1.x", "1.X"); - AssertLess("1.rt675x", "1.rt685x"); - AssertMore("1.ru675x", "1.rt675x"); - AssertLess("1.rt675x", "1.rt675y"); - } - - [Test] - public void LongerNonNumericShouldComeLater() { - AssertLess("rt675x", "rt675xx"); - } - - - [Test] - public void EmptyBitsAreSafeAndShouldComeFirst() { - AssertSame("1.2.3", "1.2.3"); - AssertSame(".1.2.3.", ".1.2.3."); - AssertSame(".1..3.", ".1..3."); - AssertLess("1..3", "1.2.3"); - AssertLess(".1..3.", ".1.2.3."); - - AssertSame("a.b.c", "a.b.c"); - AssertSame(".a.b.c.", ".a.b.c."); - AssertSame(".a..c.", ".a..c."); - AssertLess("a..c", "a.b.c"); - AssertLess(".a..c.", ".a.b.c."); - } - - [Test] - public void AdditionalNonEmptySegmentsShouldComeLater() { - AssertLess("1.2", "1.2.3"); - AssertSame("1.2", "1.2."); - - AssertLess("a.b", "a.b.c"); - AssertSame("a.b", "a.b."); - - } - - void AssertLess(string x, string y) { - Assert.That(_comparer.Compare(x, y), Is.LessThan(0)); - Assert.That(_comparer.Compare(y, x), Is.GreaterThan(0)); - } - void AssertMore(string x, string y) { - Assert.That(_comparer.Compare(x, y), Is.GreaterThan(0)); - Assert.That(_comparer.Compare(y, x), Is.LessThan(0)); - } - void AssertSame(string x, string y) { - Assert.That(_comparer.Compare(x, y), Is.EqualTo(0)); - Assert.That(_comparer.Compare(y, x), Is.EqualTo(0)); - } - } -} +using System; +using System.Collections.Generic; +using NUnit.Framework; +using Orchard.UI; + +namespace Orchard.Tests.UI.Navigation { + [TestFixture] + public class PositionComparerTests { + private IComparer _comparer; + + [SetUp] + public void Init() { + _comparer = new FlatPositionComparer(); + } + + + [Test] + public void LessThanAndGreaterThanShouldBeBelowAndAboveZero() { + var lessThan = StringComparer.InvariantCultureIgnoreCase.Compare("alpha", "beta"); + var greaterThan = StringComparer.InvariantCultureIgnoreCase.Compare("gamma", "delta"); + + Assert.That(lessThan, Is.LessThan(0)); + Assert.That(greaterThan, Is.GreaterThan(0)); + } + + + [Test] + public void NullIsLessThanEmptyAndEmptyIsLessThanNonEmpty() { + Assert.That(_comparer.Compare(null, ""), Is.LessThan(0)); + Assert.That(_comparer.Compare("", "5"), Is.LessThan(0)); + Assert.That(_comparer.Compare(null, "5"), Is.LessThan(0)); + + Assert.That(_comparer.Compare("", null), Is.GreaterThan(0)); + Assert.That(_comparer.Compare("5", ""), Is.GreaterThan(0)); + Assert.That(_comparer.Compare("5", null), Is.GreaterThan(0)); + + Assert.That(_comparer.Compare(null, null), Is.EqualTo(0)); + Assert.That(_comparer.Compare("", ""), Is.EqualTo(0)); + } + + [Test] + public void NumericValuesShouldCompareNumerically() { + AssertLess("3", "5"); + AssertMore("8", "5"); + AssertSame("5", "5"); + AssertMore("100", "5"); + AssertSame("007", "7"); + } + + [Test] + public void NegativeNumericValuesAreLessThanPositive() { + AssertLess("-5", "5"); + AssertSame("-5", "-5"); + AssertMore("42", "-42"); + } + + [Test] + public void NegativeNumericValuesShouldCompareNumerically() { + AssertMore("-3", "-5"); + AssertLess("-8", "-5"); + AssertSame("-5", "-5"); + AssertLess("-100", "-5"); + AssertSame("-007", "-7"); + } + + [Test] + public void DotsSplitParts() { + AssertLess("0500.3", "0500.5"); + AssertMore("0500.8", "0500.5"); + AssertSame("0500.5", "0500.5"); + AssertMore("0500.100", "0500.5"); + AssertSame("0500.007", "0500.7"); + + AssertLess("0500.3.0300", "0500.5.0300"); + AssertMore("0500.8.0300", "0500.5.0300"); + AssertSame("0500.5.0300", "0500.5.0300"); + AssertMore("0500.100.0300", "0500.5.0300"); + AssertSame("0500.007.0300", "0500.7.0300"); + } + + [Test] + public void NumericValuesShouldComeBeforeNonNumeric() { + AssertLess("5", "x"); + AssertLess("50", "50a"); + AssertLess("1.50", "1.50a"); + } + + [Test] + public void NonNumericValuesCompareOrdinallyAndIgnoreCase() { + AssertSame("x", "X"); + AssertLess("rt675x", "rt685x"); + AssertMore("ru675x", "rt675x"); + AssertLess("rt675x", "rt675y"); + + AssertSame("1.x.5", "1.X.5"); + AssertLess("1.rt675x.5", "1.rt685x.5"); + AssertMore("1.ru675x.5", "1.rt675x.5"); + AssertLess("1.rt675x.5", "1.rt675y.5"); + + AssertSame("x.5", "X.5"); + AssertLess("rt675x.5", "rt685x.5"); + AssertMore("ru675x.5", "rt675x.5"); + AssertLess("rt675x.5", "rt675y.5"); + + AssertSame("1.x", "1.X"); + AssertLess("1.rt675x", "1.rt685x"); + AssertMore("1.ru675x", "1.rt675x"); + AssertLess("1.rt675x", "1.rt675y"); + } + + [Test] + public void LongerNonNumericShouldComeLater() { + AssertLess("rt675x", "rt675xx"); + } + + + [Test] + public void EmptyBitsAreSafeAndShouldComeFirst() { + AssertSame("1.2.3", "1.2.3"); + AssertSame(".1.2.3.", ".1.2.3."); + AssertSame(".1..3.", ".1..3."); + AssertLess("1..3", "1.2.3"); + AssertLess(".1..3.", ".1.2.3."); + + AssertSame("a.b.c", "a.b.c"); + AssertSame(".a.b.c.", ".a.b.c."); + AssertSame(".a..c.", ".a..c."); + AssertLess("a..c", "a.b.c"); + AssertLess(".a..c.", ".a.b.c."); + } + + [Test] + public void AdditionalNonEmptySegmentsShouldComeLater() { + AssertLess("1.2", "1.2.3"); + AssertSame("1.2", "1.2."); + + AssertLess("a.b", "a.b.c"); + AssertSame("a.b", "a.b."); + + } + + void AssertLess(string x, string y) { + Assert.That(_comparer.Compare(x, y), Is.LessThan(0)); + Assert.That(_comparer.Compare(y, x), Is.GreaterThan(0)); + } + void AssertMore(string x, string y) { + Assert.That(_comparer.Compare(x, y), Is.GreaterThan(0)); + Assert.That(_comparer.Compare(y, x), Is.LessThan(0)); + } + void AssertSame(string x, string y) { + Assert.That(_comparer.Compare(x, y), Is.EqualTo(0)); + Assert.That(_comparer.Compare(y, x), Is.EqualTo(0)); + } + } +} diff --git a/src/Orchard.Tests/UI/Notify/NotifierTests.cs b/src/Orchard.Tests/UI/Notify/NotifierTests.cs index 55746fce623..a439b065355 100644 --- a/src/Orchard.Tests/UI/Notify/NotifierTests.cs +++ b/src/Orchard.Tests/UI/Notify/NotifierTests.cs @@ -1,24 +1,24 @@ -using NUnit.Framework; -using Orchard.Localization; -using Orchard.UI.Notify; - -namespace Orchard.Tests.UI.Notify { - [TestFixture] - public class NotifierTests { - - [Test] - public void MessageServiceCanAccumulateWarningsAndErrorsToReturn() { - INotifier notifier = new Notifier(); - Localizer T = NullLocalizer.Instance; - - notifier.Warning(T("Hello world")); - notifier.Information(T("More Info")); - notifier.Error(T("Boom")); - - Assert.That(notifier.List(), Has.Count.EqualTo(3)); - Assert.That(notifier.List(), Has.Some.Property("Message").EqualTo(T("Hello world"))); - Assert.That(notifier.List(), Has.Some.Property("Message").EqualTo(T("More Info"))); - Assert.That(notifier.List(), Has.Some.Property("Message").EqualTo(T("Boom"))); - } - } +using NUnit.Framework; +using Orchard.Localization; +using Orchard.UI.Notify; + +namespace Orchard.Tests.UI.Notify { + [TestFixture] + public class NotifierTests { + + [Test] + public void MessageServiceCanAccumulateWarningsAndErrorsToReturn() { + INotifier notifier = new Notifier(); + Localizer T = NullLocalizer.Instance; + + notifier.Warning(T("Hello world")); + notifier.Information(T("More Info")); + notifier.Error(T("Boom")); + + Assert.That(notifier.List(), Has.Count.EqualTo(3)); + Assert.That(notifier.List(), Has.Some.Property("Message").EqualTo(T("Hello world"))); + Assert.That(notifier.List(), Has.Some.Property("Message").EqualTo(T("More Info"))); + Assert.That(notifier.List(), Has.Some.Property("Message").EqualTo(T("Boom"))); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/UI/Notify/NotifyFilterTests.cs b/src/Orchard.Tests/UI/Notify/NotifyFilterTests.cs index a96e74fbe60..32349ee79b1 100644 --- a/src/Orchard.Tests/UI/Notify/NotifyFilterTests.cs +++ b/src/Orchard.Tests/UI/Notify/NotifyFilterTests.cs @@ -1,19 +1,19 @@ -using System.Web.Mvc; -using System.Web.Routing; -using Moq; -using NUnit.Framework; -using Orchard.Tests.Stubs; - -namespace Orchard.Tests.UI.Notify { - [TestFixture] - public class NotifyFilterTests { - private static ActionExecutedContext BuildContext() { - var httpContext = new StubHttpContext(); - var routeData = new RouteData(); - - var controllerContext = new ControllerContext(httpContext, routeData, new Mock().Object); - var actionDescriptor = new Mock().Object; - return new ActionExecutedContext(controllerContext, actionDescriptor, false/*cancelled*/, null/*exception*/); - } - } +using System.Web.Mvc; +using System.Web.Routing; +using Moq; +using NUnit.Framework; +using Orchard.Tests.Stubs; + +namespace Orchard.Tests.UI.Notify { + [TestFixture] + public class NotifyFilterTests { + private static ActionExecutedContext BuildContext() { + var httpContext = new StubHttpContext(); + var routeData = new RouteData(); + + var controllerContext = new ControllerContext(httpContext, routeData, new Mock().Object); + var actionDescriptor = new Mock().Object; + return new ActionExecutedContext(controllerContext, actionDescriptor, false/*cancelled*/, null/*exception*/); + } + } } \ No newline at end of file diff --git a/src/Orchard.Tests/UI/Resources/ResourceManagerTests.cs b/src/Orchard.Tests/UI/Resources/ResourceManagerTests.cs index e8f3e73a3c5..a9f3e88a436 100644 --- a/src/Orchard.Tests/UI/Resources/ResourceManagerTests.cs +++ b/src/Orchard.Tests/UI/Resources/ResourceManagerTests.cs @@ -1,133 +1,133 @@ -using System; -using System.Linq; -using System.Collections.Generic; -using Autofac; -using NUnit.Framework; -using Orchard.DisplayManagement.Implementation; -using Orchard.Tests.Stubs; -using Orchard.UI.Admin; -using Orchard.UI.Resources; - -namespace Orchard.Tests.UI.Resources { - [TestFixture] - public class ResourceManagerTests { - private IContainer _container; - private IResourceManager _resourceManager; - private TestManifestProvider _testManifest; - private string _appPath = "/AppPath/"; - - private class TestManifestProvider : IResourceManifestProvider { - public Action DefineManifest { get; set; } - - public TestManifestProvider() { - - } - public void BuildManifests(ResourceManifestBuilder builder) { - var manifest = builder.Add(); - if (DefineManifest != null) { - DefineManifest(manifest); - } - } - } - - private void VerifyPaths(string resourceType, RequireSettings defaultSettings, string expectedPaths) { - defaultSettings = defaultSettings ?? new RequireSettings(); - var requiredResources = _resourceManager.BuildRequiredResources(resourceType); - var renderedResources = string.Join(",", requiredResources.Select(context => context.GetResourceUrl(defaultSettings, _appPath)).ToArray()); - Assert.That(renderedResources, Is.EqualTo(expectedPaths)); - } - - [SetUp] - public void Init() { - var builder = new ContainerBuilder(); - builder.RegisterType().As(); - builder.RegisterType().As().SingleInstance(); - _container = builder.Build(); - _resourceManager = _container.Resolve(); - _testManifest = _container.Resolve() as TestManifestProvider; - } - - [Test] - public void ReleasePathIsTheDefaultPath() { - _testManifest.DefineManifest = m => { - m.DefineResource("script", "Script1").SetUrl("script1.min.js", "script1.js"); - }; - _resourceManager.Require("script", "Script1"); - VerifyPaths("script", null, "script1.min.js"); - } - - [Test] - public void DebugPathIsUsedWithDebugMode() { - _testManifest.DefineManifest = m => { - m.DefineResource("script", "Script1").SetUrl("script1.min.js", "script1.js"); - }; - _resourceManager.Require("script", "Script1"); - VerifyPaths("script", new RequireSettings { DebugMode = true }, "script1.js"); - } - - [Test] - public void ReleasePathIsUsedWhenNoDebugPath() { - _testManifest.DefineManifest = m => { - m.DefineResource("script", "Script1").SetUrl("script1.min.js"); - }; - _resourceManager.Require("script", "Script1"); - VerifyPaths("script", new RequireSettings { DebugMode = true }, "script1.min.js"); - } - - [Test] - public void DefaultSettingsAreOverriddenByUseDebugMode() { - _testManifest.DefineManifest = m => { - m.DefineResource("script", "Script1").SetUrl("script1.min.js", "script1.js"); - }; - _resourceManager.Require("script", "Script1").UseDebugMode(); - VerifyPaths("script", new RequireSettings { DebugMode = false }, "script1.js"); - } - - [Test] - public void CdnPathIsUsedInCdnMode() { - _testManifest.DefineManifest = m => { - m.DefineResource("script", "Script1").SetUrl("script1.js").SetCdn("http://cdn/script1.min.js"); - }; - _resourceManager.Require("script", "Script1"); - VerifyPaths("script", new RequireSettings { CdnMode = true }, "http://cdn/script1.min.js"); - } - - [Test] - public void CdnDebugPathIsUsedInCdnModeAndDebugMode() { - _testManifest.DefineManifest = m => { - m.DefineResource("script", "Script1").SetUrl("script1.js").SetCdn("http://cdn/script1.min.js", "http://cdn/script1.js"); - }; - _resourceManager.Require("script", "Script1"); - VerifyPaths("script", new RequireSettings { CdnMode = true, DebugMode = true }, "http://cdn/script1.js"); - } - - [Test] - public void DebugPathIsUsedInCdnModeAndDebugModeAndThereIsNoCdnDebugPath() { - _testManifest.DefineManifest = m => { - m.DefineResource("script", "Script1").SetUrl("script1.min.js", "script1.js").SetCdn("http://cdn/script1.min.js"); - }; - _resourceManager.Require("script", "Script1"); - VerifyPaths("script", new RequireSettings { CdnMode = true, DebugMode = true }, "script1.js"); - } - - [Test] - public void DependenciesAreAutoIncluded() { - _testManifest.DefineManifest = m => { - m.DefineResource("script", "Script1").SetUrl("script1.min.js"); - m.DefineResource("script", "Script2").SetUrl("script2.min.js").SetDependencies("Script1"); - }; - _resourceManager.Require("script", "Script2"); - VerifyPaths("script", null, "script1.min.js,script2.min.js"); - } - - [Test] - public void DependenciesAssumeTheirParentUseDebugModeSetting() { - _testManifest.DefineManifest = m => { - m.DefineResource("script", "Script1").SetUrl("script1.min.js", "script1.js"); - m.DefineResource("script", "Script2").SetUrl("script2.min.js", "script2.js").SetDependencies("Script1"); - }; - _resourceManager.Require("script", "Script2").UseDebugMode(); - VerifyPaths("script", new RequireSettings { DebugMode = false }, "script1.js,script2.js"); - } - } -} +using System; +using System.Linq; +using System.Collections.Generic; +using Autofac; +using NUnit.Framework; +using Orchard.DisplayManagement.Implementation; +using Orchard.Tests.Stubs; +using Orchard.UI.Admin; +using Orchard.UI.Resources; + +namespace Orchard.Tests.UI.Resources { + [TestFixture] + public class ResourceManagerTests { + private IContainer _container; + private IResourceManager _resourceManager; + private TestManifestProvider _testManifest; + private string _appPath = "/AppPath/"; + + private class TestManifestProvider : IResourceManifestProvider { + public Action DefineManifest { get; set; } + + public TestManifestProvider() { + + } + public void BuildManifests(ResourceManifestBuilder builder) { + var manifest = builder.Add(); + if (DefineManifest != null) { + DefineManifest(manifest); + } + } + } + + private void VerifyPaths(string resourceType, RequireSettings defaultSettings, string expectedPaths) { + defaultSettings = defaultSettings ?? new RequireSettings(); + var requiredResources = _resourceManager.BuildRequiredResources(resourceType); + var renderedResources = string.Join(",", requiredResources.Select(context => context.GetResourceUrl(defaultSettings, _appPath)).ToArray()); + Assert.That(renderedResources, Is.EqualTo(expectedPaths)); + } + + [SetUp] + public void Init() { + var builder = new ContainerBuilder(); + builder.RegisterType().As(); + builder.RegisterType().As().SingleInstance(); + _container = builder.Build(); + _resourceManager = _container.Resolve(); + _testManifest = _container.Resolve() as TestManifestProvider; + } + + [Test] + public void ReleasePathIsTheDefaultPath() { + _testManifest.DefineManifest = m => { + m.DefineResource("script", "Script1").SetUrl("script1.min.js", "script1.js"); + }; + _resourceManager.Require("script", "Script1"); + VerifyPaths("script", null, "script1.min.js"); + } + + [Test] + public void DebugPathIsUsedWithDebugMode() { + _testManifest.DefineManifest = m => { + m.DefineResource("script", "Script1").SetUrl("script1.min.js", "script1.js"); + }; + _resourceManager.Require("script", "Script1"); + VerifyPaths("script", new RequireSettings { DebugMode = true }, "script1.js"); + } + + [Test] + public void ReleasePathIsUsedWhenNoDebugPath() { + _testManifest.DefineManifest = m => { + m.DefineResource("script", "Script1").SetUrl("script1.min.js"); + }; + _resourceManager.Require("script", "Script1"); + VerifyPaths("script", new RequireSettings { DebugMode = true }, "script1.min.js"); + } + + [Test] + public void DefaultSettingsAreOverriddenByUseDebugMode() { + _testManifest.DefineManifest = m => { + m.DefineResource("script", "Script1").SetUrl("script1.min.js", "script1.js"); + }; + _resourceManager.Require("script", "Script1").UseDebugMode(); + VerifyPaths("script", new RequireSettings { DebugMode = false }, "script1.js"); + } + + [Test] + public void CdnPathIsUsedInCdnMode() { + _testManifest.DefineManifest = m => { + m.DefineResource("script", "Script1").SetUrl("script1.js").SetCdn("http://cdn/script1.min.js"); + }; + _resourceManager.Require("script", "Script1"); + VerifyPaths("script", new RequireSettings { CdnMode = true }, "http://cdn/script1.min.js"); + } + + [Test] + public void CdnDebugPathIsUsedInCdnModeAndDebugMode() { + _testManifest.DefineManifest = m => { + m.DefineResource("script", "Script1").SetUrl("script1.js").SetCdn("http://cdn/script1.min.js", "http://cdn/script1.js"); + }; + _resourceManager.Require("script", "Script1"); + VerifyPaths("script", new RequireSettings { CdnMode = true, DebugMode = true }, "http://cdn/script1.js"); + } + + [Test] + public void DebugPathIsUsedInCdnModeAndDebugModeAndThereIsNoCdnDebugPath() { + _testManifest.DefineManifest = m => { + m.DefineResource("script", "Script1").SetUrl("script1.min.js", "script1.js").SetCdn("http://cdn/script1.min.js"); + }; + _resourceManager.Require("script", "Script1"); + VerifyPaths("script", new RequireSettings { CdnMode = true, DebugMode = true }, "script1.js"); + } + + [Test] + public void DependenciesAreAutoIncluded() { + _testManifest.DefineManifest = m => { + m.DefineResource("script", "Script1").SetUrl("script1.min.js"); + m.DefineResource("script", "Script2").SetUrl("script2.min.js").SetDependencies("Script1"); + }; + _resourceManager.Require("script", "Script2"); + VerifyPaths("script", null, "script1.min.js,script2.min.js"); + } + + [Test] + public void DependenciesAssumeTheirParentUseDebugModeSetting() { + _testManifest.DefineManifest = m => { + m.DefineResource("script", "Script1").SetUrl("script1.min.js", "script1.js"); + m.DefineResource("script", "Script2").SetUrl("script2.min.js", "script2.js").SetDependencies("Script1"); + }; + _resourceManager.Require("script", "Script2").UseDebugMode(); + VerifyPaths("script", new RequireSettings { DebugMode = false }, "script1.js,script2.js"); + } + } +} diff --git a/src/Orchard.Tests/UI/ShapeTests.cs b/src/Orchard.Tests/UI/ShapeTests.cs index 3e5ef2e7dad..e2aa3290c22 100644 --- a/src/Orchard.Tests/UI/ShapeTests.cs +++ b/src/Orchard.Tests/UI/ShapeTests.cs @@ -1,139 +1,139 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Autofac; -using NUnit.Framework; -using Orchard.Core.Shapes; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.DisplayManagement.Implementation; -using Orchard.Tests.DisplayManagement; -using Orchard.UI.Zones; - -namespace Orchard.Tests.UI { - [TestFixture] - public class ShapeTests : ContainerTestBase { - dynamic _layout; - - protected override void Register(ContainerBuilder builder) { - var defaultShapeTable = new ShapeTable { - Descriptors = new Dictionary(StringComparer.OrdinalIgnoreCase), - Bindings = new Dictionary(StringComparer.OrdinalIgnoreCase) - }; - builder.Register(ctx => defaultShapeTable); - - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - builder.RegisterType().As(); - } - - protected override void Resolve(ILifetimeScope container) { - var shapeFactory = _container.Resolve(); - _layout = new ZoneHolding(() => shapeFactory.Create("Zone")); - } - - [Test] - public void PagePropertiesAreNil() { - - var pageFoo = _layout.Foo; - Assert.That(pageFoo == null); - } - - [Test] - public void PageZonesPropertyIsNotNil() { - var pageZones = _layout.Zones; - Assert.That(pageZones != null); - Assert.That(pageZones.Foo == null); - } - - [Test] - public void AddingToZonePropertyMakesItExist() { - Assert.That(_layout.Zones.Foo == null); - - var pageZonesFoo = _layout.Zones.Foo; - pageZonesFoo.Add("hello"); - - Assert.That(_layout.Zones.Foo != null); - Assert.That(_layout.Foo != null); - Assert.That(_layout.Foo.Metadata.Type, Is.EqualTo("Zone")); - } - - [Test] - public void AddingToZoneIndexedMakesItExist() { - Assert.That(_layout.Zones["Foo"] == null); - - var pageZonesFoo = _layout.Zones["Foo"]; - pageZonesFoo.Add("hello"); - - Assert.That(_layout.Zones["Foo"] != null); - Assert.That(_layout["Foo"] != null); - Assert.That(_layout["Foo"].Metadata.Type, Is.EqualTo("Zone")); - } - - [Test] - public void CallingAddOnNilPropertyMakesItBecomeZone() { - Assert.That(_layout.Foo == null); - - _layout.Foo.Add("hello"); - - Assert.That(_layout.Foo != null); - Assert.That(_layout.Foo.Metadata.Type, Is.EqualTo("Zone")); - } - - [Test] - public void ZoneContentsAreEnumerable() { - Assert.That(_layout.Foo == null); - - _layout.Foo.Add("hello"); - _layout.Foo.Add("world"); - - var list = new List(); - foreach (var item in _layout.Foo) { - list.Add(item); - } - - Assert.That(list.Count(), Is.EqualTo(2)); - Assert.That(list.First(), Is.EqualTo("hello")); - Assert.That(list.Last(), Is.EqualTo("world")); - } - - [Test] - public void ZoneContentsCastBeConvertedToEnunerableOfObject() { - Assert.That(_layout.Foo == null); - - _layout.Foo.Add("hello"); - _layout.Foo.Add("world"); - - IEnumerable list = _layout.Foo; - - Assert.That(list.Count(), Is.EqualTo(2)); - Assert.That(list.First(), Is.EqualTo("hello")); - Assert.That(list.Last(), Is.EqualTo("world")); - - var first = ((IEnumerable)_layout.Foo).FirstOrDefault(); - Assert.That(first, Is.EqualTo("hello")); - } - - [Test] - public void ZoneContentsCastBeConvertedToEnunerableOfDynamics() { - Assert.That(_layout.Foo == null); - - _layout.Foo.Add("hello"); - _layout.Foo.Add("world"); - - IEnumerable list = _layout.Foo; - - Assert.That(list.Count(), Is.EqualTo(2)); - Assert.That(list.First(), Is.EqualTo("hello")); - Assert.That(list.Last(), Is.EqualTo("world")); - - var first = ((IEnumerable) _layout.Foo).FirstOrDefault(); - Assert.That(first, Is.EqualTo("hello")); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using Autofac; +using NUnit.Framework; +using Orchard.Core.Shapes; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.DisplayManagement.Implementation; +using Orchard.Tests.DisplayManagement; +using Orchard.UI.Zones; + +namespace Orchard.Tests.UI { + [TestFixture] + public class ShapeTests : ContainerTestBase { + dynamic _layout; + + protected override void Register(ContainerBuilder builder) { + var defaultShapeTable = new ShapeTable { + Descriptors = new Dictionary(StringComparer.OrdinalIgnoreCase), + Bindings = new Dictionary(StringComparer.OrdinalIgnoreCase) + }; + builder.Register(ctx => defaultShapeTable); + + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + } + + protected override void Resolve(ILifetimeScope container) { + var shapeFactory = _container.Resolve(); + _layout = new ZoneHolding(() => shapeFactory.Create("Zone")); + } + + [Test] + public void PagePropertiesAreNil() { + + var pageFoo = _layout.Foo; + Assert.That(pageFoo == null); + } + + [Test] + public void PageZonesPropertyIsNotNil() { + var pageZones = _layout.Zones; + Assert.That(pageZones != null); + Assert.That(pageZones.Foo == null); + } + + [Test] + public void AddingToZonePropertyMakesItExist() { + Assert.That(_layout.Zones.Foo == null); + + var pageZonesFoo = _layout.Zones.Foo; + pageZonesFoo.Add("hello"); + + Assert.That(_layout.Zones.Foo != null); + Assert.That(_layout.Foo != null); + Assert.That(_layout.Foo.Metadata.Type, Is.EqualTo("Zone")); + } + + [Test] + public void AddingToZoneIndexedMakesItExist() { + Assert.That(_layout.Zones["Foo"] == null); + + var pageZonesFoo = _layout.Zones["Foo"]; + pageZonesFoo.Add("hello"); + + Assert.That(_layout.Zones["Foo"] != null); + Assert.That(_layout["Foo"] != null); + Assert.That(_layout["Foo"].Metadata.Type, Is.EqualTo("Zone")); + } + + [Test] + public void CallingAddOnNilPropertyMakesItBecomeZone() { + Assert.That(_layout.Foo == null); + + _layout.Foo.Add("hello"); + + Assert.That(_layout.Foo != null); + Assert.That(_layout.Foo.Metadata.Type, Is.EqualTo("Zone")); + } + + [Test] + public void ZoneContentsAreEnumerable() { + Assert.That(_layout.Foo == null); + + _layout.Foo.Add("hello"); + _layout.Foo.Add("world"); + + var list = new List(); + foreach (var item in _layout.Foo) { + list.Add(item); + } + + Assert.That(list.Count(), Is.EqualTo(2)); + Assert.That(list.First(), Is.EqualTo("hello")); + Assert.That(list.Last(), Is.EqualTo("world")); + } + + [Test] + public void ZoneContentsCastBeConvertedToEnunerableOfObject() { + Assert.That(_layout.Foo == null); + + _layout.Foo.Add("hello"); + _layout.Foo.Add("world"); + + IEnumerable list = _layout.Foo; + + Assert.That(list.Count(), Is.EqualTo(2)); + Assert.That(list.First(), Is.EqualTo("hello")); + Assert.That(list.Last(), Is.EqualTo("world")); + + var first = ((IEnumerable)_layout.Foo).FirstOrDefault(); + Assert.That(first, Is.EqualTo("hello")); + } + + [Test] + public void ZoneContentsCastBeConvertedToEnunerableOfDynamics() { + Assert.That(_layout.Foo == null); + + _layout.Foo.Add("hello"); + _layout.Foo.Add("world"); + + IEnumerable list = _layout.Foo; + + Assert.That(list.Count(), Is.EqualTo(2)); + Assert.That(list.First(), Is.EqualTo("hello")); + Assert.That(list.Last(), Is.EqualTo("world")); + + var first = ((IEnumerable) _layout.Foo).FirstOrDefault(); + Assert.That(first, Is.EqualTo("hello")); + } + } +} diff --git a/src/Orchard.Tests/Utility/ContainerExtensions.cs b/src/Orchard.Tests/Utility/ContainerExtensions.cs index edde41a6406..c8100b415ed 100644 --- a/src/Orchard.Tests/Utility/ContainerExtensions.cs +++ b/src/Orchard.Tests/Utility/ContainerExtensions.cs @@ -1,82 +1,82 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using Autofac; -using Autofac.Builder; -using Autofac.Core; -using Moq; - -namespace Orchard.Tests.Utility { - public static class ContainerExtensions { - public static Mock Mock(this IComponentContext container) where T : class { - return container.Resolve>(); - } - - public static AutoMockSource RegisterAutoMocking(this ContainerBuilder builder) { - var source = new AutoMockSource(MockBehavior.Strict); - builder.RegisterSource(source); - return source; - } - - public static void RegisterAutoMocking(this ContainerBuilder builder, MockBehavior behavior) { - builder.RegisterSource(new AutoMockSource(behavior)); - } - - public class AutoMockSource : IRegistrationSource { - private readonly MockBehavior _behavior; - private IEnumerable _ignore = Enumerable.Empty(); - - public AutoMockSource(MockBehavior behavior) { - _behavior = behavior; - Ignore(); - } - - public bool IsAdapterForIndividualComponents { - get { return false; } - } - - IEnumerable IRegistrationSource.RegistrationsFor( - Service service, - Func> registrationAccessor) { - - var swt = service as IServiceWithType; - if (swt == null) - yield break; - var st = swt.ServiceType; - - if (st.IsGenericType && st.GetGenericTypeDefinition() == typeof(Mock<>)) { - yield return RegistrationBuilder.ForType(st) - .SingleInstance() - .WithParameter("behavior", _behavior) - .CreateRegistration(); - } - else if (st.IsInterface) { - if (st.IsGenericType && st.GetGenericTypeDefinition() == typeof(IEnumerable<>)) { - yield break; - } - if (_ignore.Contains(st)) { - yield break; - } - - yield return RegistrationBuilder.ForDelegate( - (ctx, p) => { - Trace.WriteLine(string.Format("Mocking {0}", st)); - var mt = typeof(Mock<>).MakeGenericType(st); - var m = (Mock)ctx.Resolve(mt); - return m.Object; - }) - .As(service) - .SingleInstance() - .CreateRegistration(); - } - } - - public AutoMockSource Ignore() { - _ignore = _ignore.Concat(new[]{typeof (T)}); - return this; - } - } - - } +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using Autofac; +using Autofac.Builder; +using Autofac.Core; +using Moq; + +namespace Orchard.Tests.Utility { + public static class ContainerExtensions { + public static Mock Mock(this IComponentContext container) where T : class { + return container.Resolve>(); + } + + public static AutoMockSource RegisterAutoMocking(this ContainerBuilder builder) { + var source = new AutoMockSource(MockBehavior.Strict); + builder.RegisterSource(source); + return source; + } + + public static void RegisterAutoMocking(this ContainerBuilder builder, MockBehavior behavior) { + builder.RegisterSource(new AutoMockSource(behavior)); + } + + public class AutoMockSource : IRegistrationSource { + private readonly MockBehavior _behavior; + private IEnumerable _ignore = Enumerable.Empty(); + + public AutoMockSource(MockBehavior behavior) { + _behavior = behavior; + Ignore(); + } + + public bool IsAdapterForIndividualComponents { + get { return false; } + } + + IEnumerable IRegistrationSource.RegistrationsFor( + Service service, + Func> registrationAccessor) { + + var swt = service as IServiceWithType; + if (swt == null) + yield break; + var st = swt.ServiceType; + + if (st.IsGenericType && st.GetGenericTypeDefinition() == typeof(Mock<>)) { + yield return RegistrationBuilder.ForType(st) + .SingleInstance() + .WithParameter("behavior", _behavior) + .CreateRegistration(); + } + else if (st.IsInterface) { + if (st.IsGenericType && st.GetGenericTypeDefinition() == typeof(IEnumerable<>)) { + yield break; + } + if (_ignore.Contains(st)) { + yield break; + } + + yield return RegistrationBuilder.ForDelegate( + (ctx, p) => { + Trace.WriteLine(string.Format("Mocking {0}", st)); + var mt = typeof(Mock<>).MakeGenericType(st); + var m = (Mock)ctx.Resolve(mt); + return m.Object; + }) + .As(service) + .SingleInstance() + .CreateRegistration(); + } + } + + public AutoMockSource Ignore() { + _ignore = _ignore.Concat(new[]{typeof (T)}); + return this; + } + } + + } } \ No newline at end of file diff --git a/src/Orchard.Tests/Utility/Extensions/HttpRequestExtensionsTests.cs b/src/Orchard.Tests/Utility/Extensions/HttpRequestExtensionsTests.cs index 0e1a4dc1bed..e3fc3934a83 100644 --- a/src/Orchard.Tests/Utility/Extensions/HttpRequestExtensionsTests.cs +++ b/src/Orchard.Tests/Utility/Extensions/HttpRequestExtensionsTests.cs @@ -1,78 +1,78 @@ -using System.Collections.Specialized; -using System.Web; -using NUnit.Framework; -using Orchard.Utility.Extensions; - -namespace Orchard.Tests.Utility.Extensions { - [TestFixture] - public class HttpRequestExtensionsTests { - - [Test] - public void IsLocalUrlShouldReturnFalseWhenUrlIsNullOrEmpty() { - var request = new StubHttpRequest(); - - Assert.That(request.IsLocalUrl(null), Is.False); - Assert.That(request.IsLocalUrl(" "), Is.False); - Assert.That(request.IsLocalUrl(""), Is.False); - } - - [Test] - public void IsLocalUrlShouldReturnFalseWhenUrlStartsWithDoubleSlash() { - var request = new StubHttpRequest(); - - Assert.That(request.IsLocalUrl("//"), Is.False); - } - - [Test] - public void IsLocalUrlShouldReturnFalseWhenUrlStartsWithForwardBackwardSlash() { - var request = new StubHttpRequest(); - - Assert.That(request.IsLocalUrl("/\\"), Is.False); - } - - [Test] - public void IsLocalUrlShouldReturnTrueWhenUrlStartsWithSlashAndAnythingElse() { - var request = new StubHttpRequest(); - - Assert.That(request.IsLocalUrl("/"), Is.True); - Assert.That(request.IsLocalUrl("/контакты"), Is.True); - Assert.That(request.IsLocalUrl("/ "), Is.True); - Assert.That(request.IsLocalUrl("/abc-def"), Is.True); - } - - [Test] - public void IsLocalUrlShouldReturnTrueWhenAuthoritiesMatch() { - var request = new StubHttpRequest(); - request.Headers.Add("Host", "localhost"); - - Assert.That(request.IsLocalUrl("http://localhost"), Is.True); - } - - [Test] - public void IsLocalUrlShouldReturnFalseWhenAuthoritiesDiffer() { - var request = new StubHttpRequest(); - request.Headers.Add("Host", "localhost"); - - Assert.That(request.IsLocalUrl("http://somedomain"), Is.False); - Assert.That(request.IsLocalUrl("http://localhost:8080"), Is.False); - } - - [Test] - public void IsLocalUrlShouldReturnFalseForEverythingElse() { - var request = new StubHttpRequest(); - request.Headers.Add("Host", "localhost"); - - Assert.That(request.IsLocalUrl("abc"), Is.False); - } - } - - class StubHttpRequest : HttpRequestBase { - private readonly NameValueCollection _headers = new NameValueCollection(); - - public override NameValueCollection Headers { - get { - return _headers; - } - } - } -} +using System.Collections.Specialized; +using System.Web; +using NUnit.Framework; +using Orchard.Utility.Extensions; + +namespace Orchard.Tests.Utility.Extensions { + [TestFixture] + public class HttpRequestExtensionsTests { + + [Test] + public void IsLocalUrlShouldReturnFalseWhenUrlIsNullOrEmpty() { + var request = new StubHttpRequest(); + + Assert.That(request.IsLocalUrl(null), Is.False); + Assert.That(request.IsLocalUrl(" "), Is.False); + Assert.That(request.IsLocalUrl(""), Is.False); + } + + [Test] + public void IsLocalUrlShouldReturnFalseWhenUrlStartsWithDoubleSlash() { + var request = new StubHttpRequest(); + + Assert.That(request.IsLocalUrl("//"), Is.False); + } + + [Test] + public void IsLocalUrlShouldReturnFalseWhenUrlStartsWithForwardBackwardSlash() { + var request = new StubHttpRequest(); + + Assert.That(request.IsLocalUrl("/\\"), Is.False); + } + + [Test] + public void IsLocalUrlShouldReturnTrueWhenUrlStartsWithSlashAndAnythingElse() { + var request = new StubHttpRequest(); + + Assert.That(request.IsLocalUrl("/"), Is.True); + Assert.That(request.IsLocalUrl("/контакты"), Is.True); + Assert.That(request.IsLocalUrl("/ "), Is.True); + Assert.That(request.IsLocalUrl("/abc-def"), Is.True); + } + + [Test] + public void IsLocalUrlShouldReturnTrueWhenAuthoritiesMatch() { + var request = new StubHttpRequest(); + request.Headers.Add("Host", "localhost"); + + Assert.That(request.IsLocalUrl("http://localhost"), Is.True); + } + + [Test] + public void IsLocalUrlShouldReturnFalseWhenAuthoritiesDiffer() { + var request = new StubHttpRequest(); + request.Headers.Add("Host", "localhost"); + + Assert.That(request.IsLocalUrl("http://somedomain"), Is.False); + Assert.That(request.IsLocalUrl("http://localhost:8080"), Is.False); + } + + [Test] + public void IsLocalUrlShouldReturnFalseForEverythingElse() { + var request = new StubHttpRequest(); + request.Headers.Add("Host", "localhost"); + + Assert.That(request.IsLocalUrl("abc"), Is.False); + } + } + + class StubHttpRequest : HttpRequestBase { + private readonly NameValueCollection _headers = new NameValueCollection(); + + public override NameValueCollection Headers { + get { + return _headers; + } + } + } +} diff --git a/src/Orchard.Tests/Utility/Extensions/RouteValueDictionaryExtensionsTests.cs b/src/Orchard.Tests/Utility/Extensions/RouteValueDictionaryExtensionsTests.cs index 47e7d19cbd0..f1cac3ca92a 100644 --- a/src/Orchard.Tests/Utility/Extensions/RouteValueDictionaryExtensionsTests.cs +++ b/src/Orchard.Tests/Utility/Extensions/RouteValueDictionaryExtensionsTests.cs @@ -1,34 +1,34 @@ -using System.Web.Routing; -using NUnit.Framework; -using Orchard.Utility.Extensions; - -namespace Orchard.Tests.Utility.Extensions { - [TestFixture] - class RouteValueDictionaryExtensionsTests { - [Test] - public void IdenticalRouteValueDictionariesShouldMatch() { - Assert.IsTrue(new RouteValueDictionary { { "controller", "foo" }, { "action", "bar" } } - .Match(new RouteValueDictionary { { "controller", "foo" }, { "action", "bar" } })); - } - - [Test] - public void CasedRouteValueDictionariesShouldMatch() { - Assert.IsTrue(new RouteValueDictionary { { "controller", "foo" }, { "action", "BAR" } } - .Match(new RouteValueDictionary { { "controller", "foo" }, { "action", "bar" } })); - } - - [Test] - public void RouteValueDictionariesWithDifferentNumbersOfValuesShouldNotMatch() { - Assert.IsFalse(new RouteValueDictionary { { "controller", "foo" }, { "action", "bar" } } - .Match(new RouteValueDictionary { { "controller", "foo" }, { "action", "bar" }, { "area", "baz" } })); - - } - - [Test] - public void RouteValueDictionariesWithDifferentValuesShouldMatch() { - Assert.IsFalse(new RouteValueDictionary { { "controller", "foo" }, { "action", "bar" } } - .Match(new RouteValueDictionary { { "controller", "foo" }, { "action", "baz" } })); - - } - } -} +using System.Web.Routing; +using NUnit.Framework; +using Orchard.Utility.Extensions; + +namespace Orchard.Tests.Utility.Extensions { + [TestFixture] + class RouteValueDictionaryExtensionsTests { + [Test] + public void IdenticalRouteValueDictionariesShouldMatch() { + Assert.IsTrue(new RouteValueDictionary { { "controller", "foo" }, { "action", "bar" } } + .Match(new RouteValueDictionary { { "controller", "foo" }, { "action", "bar" } })); + } + + [Test] + public void CasedRouteValueDictionariesShouldMatch() { + Assert.IsTrue(new RouteValueDictionary { { "controller", "foo" }, { "action", "BAR" } } + .Match(new RouteValueDictionary { { "controller", "foo" }, { "action", "bar" } })); + } + + [Test] + public void RouteValueDictionariesWithDifferentNumbersOfValuesShouldNotMatch() { + Assert.IsFalse(new RouteValueDictionary { { "controller", "foo" }, { "action", "bar" } } + .Match(new RouteValueDictionary { { "controller", "foo" }, { "action", "bar" }, { "area", "baz" } })); + + } + + [Test] + public void RouteValueDictionariesWithDifferentValuesShouldMatch() { + Assert.IsFalse(new RouteValueDictionary { { "controller", "foo" }, { "action", "bar" } } + .Match(new RouteValueDictionary { { "controller", "foo" }, { "action", "baz" } })); + + } + } +} diff --git a/src/Orchard.Tests/Utility/Extensions/StringExtensionsTests.cs b/src/Orchard.Tests/Utility/Extensions/StringExtensionsTests.cs index 58fed7978ec..8eb84900518 100644 --- a/src/Orchard.Tests/Utility/Extensions/StringExtensionsTests.cs +++ b/src/Orchard.Tests/Utility/Extensions/StringExtensionsTests.cs @@ -1,302 +1,302 @@ -using System; -using NUnit.Framework; -using Orchard.Localization; -using Orchard.Utility.Extensions; - -namespace Orchard.Tests.Utility.Extensions { - [TestFixture] - public class StringExtensionsTests { - [Test] - public void CamelFriendly_CamelCasedStringMadeFriendly() { - const string aCamel = "aCamel"; - Assert.That(aCamel.CamelFriendly(), Is.StringMatching("a Camel")); - } - [Test] - public void CamelFriendly_PascalCasedStringMadeFriendly() { - const string aCamel = "ACamel"; - Assert.That(aCamel.CamelFriendly(), Is.StringMatching("A Camel")); - } - [Test] - public void CamelFriendly_LowerCasedStringMadeFriendly() { - const string aCamel = "acamel"; - Assert.That(aCamel.CamelFriendly(), Is.StringMatching("acamel")); - } - [Test] - public void CamelFriendly_EmptyStringReturnsEmptyString() { - const string aCamel = ""; - Assert.That(aCamel.CamelFriendly(), Is.StringMatching("")); - } - [Test] - public void CamelFriendly_NullValueReturnsEmptyString() { - const string aCamel = null; - Assert.That(aCamel.CamelFriendly(), Is.StringMatching("")); - } - - [Test] - public void Ellipsize_ShouldTuncateToTheExactNumber() { - const string toEllipsize = "Lorem ipsum"; - Assert.That(toEllipsize.Ellipsize(2, ""), Is.EqualTo("Lo")); - Assert.That(toEllipsize.Ellipsize(1, ""), Is.EqualTo("L")); - Assert.That(toEllipsize.Ellipsize(0, ""), Is.EqualTo("")); - } - - [Test] - public void Ellipsize_TruncatedToWordBoundary() { - const string toEllipsize = "Lorem ipsum"; - Assert.That(toEllipsize.Ellipsize(8, ""), Is.EqualTo("Lorem")); - Assert.That(toEllipsize.Ellipsize(6, ""), Is.EqualTo("Lorem")); - Assert.That(toEllipsize.Ellipsize(5, ""), Is.EqualTo("Lorem")); - Assert.That(toEllipsize.Ellipsize(4, ""), Is.EqualTo("Lore")); - } - - [Test] - public void Ellipsize_LongStringTruncatedToNearestWord() { - const string toEllipsize = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sed purus quis purus orci aliquam."; - Assert.That(toEllipsize.Ellipsize(46), Is.StringMatching("Lorem ipsum dolor sit amet, consectetur\u00A0\u2026")); - } - - [Test] - public void Ellipsize_ShortStringReturnedAsSame() { - const string toEllipsize = "Lorem ipsum"; - Assert.That(toEllipsize.Ellipsize(45), Is.StringMatching("Lorem ipsum")); - } - [Test] - public void Ellipsize_EmptyStringReturnsEmptyString() { - const string toEllipsize = ""; - Assert.That(toEllipsize.Ellipsize(45), Is.StringMatching("")); - } - [Test] - public void Ellipsize_NullValueReturnsEmptyString() { - const string toEllipsize = null; - Assert.That(toEllipsize.Ellipsize(45), Is.StringMatching("")); - } - [Test] - public void Ellipsize_CustomEllipsisStringIsUsed() { - const string toEllipsize = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sed purus quis purus orci aliquam."; - Assert.That(toEllipsize.Ellipsize(45, "........"), Is.StringMatching("Lorem ipsum dolor sit amet, consectetur........")); - } - [Test] - public void Ellipsize_WordBoundary() { - const string toEllipsize = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sed purus quis purus orci aliquam."; - Assert.That(toEllipsize.Ellipsize(43, "..."), Is.StringMatching("Lorem ipsum dolor sit amet, consectet...")); - Assert.That(toEllipsize.Ellipsize(43, "...", true), Is.StringMatching("Lorem ipsum dolor sit amet, ...")); - } - - [Test] - public void HtmlClassify_ValidReallySimpleClassNameReturnsSame() { - const string toClassify = "someclass"; - Assert.That(toClassify.HtmlClassify(), Is.StringMatching(toClassify)); - } - [Test] - public void HtmlClassify_NumbersAreMaintainedIfNotAtStart() { - const string toClassify = "some4class5"; - Assert.That(toClassify.HtmlClassify(), Is.StringMatching(toClassify)); - } - [Test] - public void HtmlClassify_NumbersAreStrippedAtStart() { - const string toClassify = "5someClass"; - Assert.That(toClassify.HtmlClassify(), Is.StringMatching("some-class")); - } - [Test] - public void HtmlClassify_ValidSimpleClassNameReturnsSame() { - const string toClassify = "some-class"; - Assert.That(toClassify.HtmlClassify(), Is.StringMatching(toClassify)); - } - [Test] - public void HtmlClassify_SimpleStringReturnsSimpleClassName() { - const string toClassify = "this is something"; - Assert.That(toClassify.HtmlClassify(), Is.StringMatching("this-is-something")); - } - [Test] - public void HtmlClassify_ValidComplexClassNameReturnsSimpleClassName() { - const string toClassify = @"some-class\&some.other.class"; - Assert.That(toClassify.HtmlClassify(), Is.StringMatching("some-class-some-other-class")); - } - [Test] - public void HtmlClassify_CompletelyInvalidClassNameReturnsEmptyString() { - const string toClassify = @"0_1234_12"; - Assert.That(toClassify.HtmlClassify(), Is.StringMatching("")); - } - [Test] - public void HtmlClassify_LowerCamelCasedStringReturnsLowerHyphenatedClassName() { - const string toClassify = "camelCased"; - Assert.That(toClassify.HtmlClassify(), Is.StringMatching("camel-cased")); - } - [Test] - public void HtmlClassify_PascalCasedStringReturnsLowerHyphenatedClassName() { - const string toClassify = "PascalCased"; - Assert.That(toClassify.HtmlClassify(), Is.StringMatching("pascal-cased")); - } - [Test] - public void HtmlClassify_EmptyStringReturnsEmptyString() { - const string toClassify = ""; - Assert.That(toClassify.HtmlClassify(), Is.StringMatching("")); - } - [Test] - public void HtmlClassify_NullValueReturnsEmptyString() { - const string toClassify = null; - Assert.That(toClassify.HtmlClassify(), Is.StringMatching("")); - } - - [Test] - public void OrDefault_ReturnsDefaultForNull() { - const string s = null; - var def = new LocalizedString("test"); - Assert.That(s.OrDefault(def).Text, Is.SameAs("test")); - } - [Test] - public void OrDefault_ReturnsDefaultIfEmpty() { - var def = new LocalizedString("test"); - Assert.That("".OrDefault(def).Text, Is.SameAs("test")); - } - [Test] - public void OrDefault_ReturnsDefaultIfNull() { - var def = new LocalizedString("test"); - Assert.That(((string)null).OrDefault(def).Text, Is.SameAs("test")); - } - [Test] - public void OrDefault_ReturnsString() { - var def = new LocalizedString("test"); - Assert.That("bar".OrDefault(def).Text, Is.SameAs("bar")); - } - - [Test] - public void RemoveTags_StringWithNoTagsReturnsSame() { - const string fullOfTags = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sed purus quis purus orci aliquam."; - Assert.That(fullOfTags.RemoveTags(), Is.StringMatching("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sed purus quis purus orci aliquam.")); - } - [Test] - public void RemoveTags_SimpleWellFormedTagsAreRemoved() { - const string fullOfTags = @"

      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sed purus quis purus orci aliquam.

      "; - Assert.That(fullOfTags.RemoveTags(), Is.StringMatching("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sed purus quis purus orci aliquam.")); - } - [Test] - public void RemoveTags_EmptyStringReturnsEmptyString() { - const string fullOfTags = ""; - Assert.That(fullOfTags.RemoveTags(), Is.StringMatching("")); - } - [Test] - public void RemoveTags_NullValueReturnsEmptyString() { - const string fullOfTags = null; - Assert.That(fullOfTags.RemoveTags(), Is.StringMatching("")); - } - - [Test] - public void ReplaceNewLinesWith_ReplaceCRLFWithHtmlBR() { - const string lotsOfLineFeeds = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.\r\nMaecenas sed purus quis purus orci aliquam."; - Assert.That(lotsOfLineFeeds.ReplaceNewLinesWith("
      "), Is.StringMatching("Lorem ipsum dolor sit amet, consectetur adipiscing elit.
      Maecenas sed purus quis purus orci aliquam.")); - } - [Test] - public void ReplaceNewLinesWith_ReplaceCRLFWithHtmlPsAndCRLF() { - const string lotsOfLineFeeds = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.\r\nMaecenas sed purus quis purus orci aliquam."; - Assert.That(lotsOfLineFeeds.ReplaceNewLinesWith(@"

      {0}

      "), Is.StringMatching("Lorem ipsum dolor sit amet, consectetur adipiscing elit.

      \r\n

      Maecenas sed purus quis purus orci aliquam.")); - } - [Test] - public void ReplaceNewLinesWith_EmptyStringReturnsEmptyString() { - const string lotsOfLineFeeds = ""; - Assert.That(lotsOfLineFeeds.ReplaceNewLinesWith("
      "), Is.StringMatching("")); - } - [Test] - public void ReplaceNewLinesWith_NullValueReturnsEmptyString() { - const string lotsOfLineFeeds = null; - Assert.That(lotsOfLineFeeds.ReplaceNewLinesWith("
      "), Is.StringMatching("")); - } - - [Test] - public void StripShouldRemoveStart() { - Assert.That("abc".Strip('a'), Is.StringMatching("bc")); - Assert.That("abc".Strip("ab".ToCharArray()), Is.StringMatching("c")); - } - - [Test] - public void StripShouldRemoveInside() { - Assert.That("abc".Strip('b'), Is.StringMatching("ac")); - Assert.That("abc".Strip("abc".ToCharArray()), Is.StringMatching("")); - } - - [Test] - public void StripShouldRemoveEnd() { - Assert.That("abc".Strip('c'), Is.StringMatching("ab")); - Assert.That("abc".Strip("bc".ToCharArray()), Is.StringMatching("a")); - } - - [Test] - public void StripShouldReturnIfEmpty() { - Assert.That("".Strip('a'), Is.StringMatching("")); - Assert.That("a".Strip("".ToCharArray()), Is.StringMatching("a")); - } - - [Test] - public void AnyShouldReturnTrueAtStart() { - Assert.That("abc".Any('a'), Is.True); - Assert.That("abc".Any("ab".ToCharArray()), Is.True); - } - - [Test] - public void AnyShouldReturnTrueAtEnd() { - Assert.That("abc".Any('c'), Is.True); - Assert.That("abc".Any("bc".ToCharArray()), Is.True); - } - - [Test] - public void AnyShouldReturnTrueAtMiddle() { - Assert.That("abc".Any('b'), Is.True); - Assert.That("abc".Any("abc".ToCharArray()), Is.True); - } - - [Test] - public void AnyShouldReturnFalseIfNotPresent() { - Assert.That("abc".Any("".ToCharArray()), Is.False); - Assert.That("abc".Any("d".ToCharArray()), Is.False); - } - - [Test] - public void AllShouldReturnTrueIfAllArePresent() { - Assert.That("abc".All("abc".ToCharArray()), Is.True); - Assert.That("abc".All("abcd".ToCharArray()), Is.True); - Assert.That("".All("a".ToCharArray()), Is.True); - Assert.That("abc".All("abcd".ToCharArray()), Is.True); - } - - [Test] - public void AllShouldReturnFalseIfAnyIsNotPresent() { - Assert.That("abc".All("".ToCharArray()), Is.False); - Assert.That("abc".All("a".ToCharArray()), Is.False); - } - - [Test] - public void TranslateShouldThrowException() { - Assert.Throws(() => "a".Translate("".ToCharArray(), "a".ToCharArray())); - Assert.Throws(() => "a".Translate("a".ToCharArray(), "".ToCharArray())); - } - - [Test] - public void TranslateShouldReturnSource() { - Assert.That("a".Translate("".ToCharArray(), "".ToCharArray()), Is.StringMatching("")); - Assert.That("".Translate("abc".ToCharArray(), "abc".ToCharArray()), Is.StringMatching("")); - } - - [Test] - public void TranslateShouldReplaceChars() { - Assert.That("abc".Translate("a".ToCharArray(), "d".ToCharArray()), Is.StringMatching("dbc")); - Assert.That("abc".Translate("d".ToCharArray(), "d".ToCharArray()), Is.StringMatching("abc")); - Assert.That("abc".Translate("abc".ToCharArray(), "def".ToCharArray()), Is.StringMatching("def")); - } - - [Test] - public void ShouldEncodeToBase64() { - Assert.That("abc".ToBase64(), Is.EqualTo("YWJj")); - } - - [Test] - public void ShouldDecodeFromBase64() { - Assert.That("YWJj".FromBase64(), Is.EqualTo("abc")); - } - - [Test] - public void ShouldRoundtripBase64() { - Assert.That("abc".ToBase64().FromBase64(), Is.EqualTo("abc")); - Assert.That("YWJj".FromBase64().ToBase64(), Is.EqualTo("YWJj")); - } - } -} +using System; +using NUnit.Framework; +using Orchard.Localization; +using Orchard.Utility.Extensions; + +namespace Orchard.Tests.Utility.Extensions { + [TestFixture] + public class StringExtensionsTests { + [Test] + public void CamelFriendly_CamelCasedStringMadeFriendly() { + const string aCamel = "aCamel"; + Assert.That(aCamel.CamelFriendly(), Is.StringMatching("a Camel")); + } + [Test] + public void CamelFriendly_PascalCasedStringMadeFriendly() { + const string aCamel = "ACamel"; + Assert.That(aCamel.CamelFriendly(), Is.StringMatching("A Camel")); + } + [Test] + public void CamelFriendly_LowerCasedStringMadeFriendly() { + const string aCamel = "acamel"; + Assert.That(aCamel.CamelFriendly(), Is.StringMatching("acamel")); + } + [Test] + public void CamelFriendly_EmptyStringReturnsEmptyString() { + const string aCamel = ""; + Assert.That(aCamel.CamelFriendly(), Is.StringMatching("")); + } + [Test] + public void CamelFriendly_NullValueReturnsEmptyString() { + const string aCamel = null; + Assert.That(aCamel.CamelFriendly(), Is.StringMatching("")); + } + + [Test] + public void Ellipsize_ShouldTuncateToTheExactNumber() { + const string toEllipsize = "Lorem ipsum"; + Assert.That(toEllipsize.Ellipsize(2, ""), Is.EqualTo("Lo")); + Assert.That(toEllipsize.Ellipsize(1, ""), Is.EqualTo("L")); + Assert.That(toEllipsize.Ellipsize(0, ""), Is.EqualTo("")); + } + + [Test] + public void Ellipsize_TruncatedToWordBoundary() { + const string toEllipsize = "Lorem ipsum"; + Assert.That(toEllipsize.Ellipsize(8, ""), Is.EqualTo("Lorem")); + Assert.That(toEllipsize.Ellipsize(6, ""), Is.EqualTo("Lorem")); + Assert.That(toEllipsize.Ellipsize(5, ""), Is.EqualTo("Lorem")); + Assert.That(toEllipsize.Ellipsize(4, ""), Is.EqualTo("Lore")); + } + + [Test] + public void Ellipsize_LongStringTruncatedToNearestWord() { + const string toEllipsize = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sed purus quis purus orci aliquam."; + Assert.That(toEllipsize.Ellipsize(46), Is.StringMatching("Lorem ipsum dolor sit amet, consectetur\u00A0\u2026")); + } + + [Test] + public void Ellipsize_ShortStringReturnedAsSame() { + const string toEllipsize = "Lorem ipsum"; + Assert.That(toEllipsize.Ellipsize(45), Is.StringMatching("Lorem ipsum")); + } + [Test] + public void Ellipsize_EmptyStringReturnsEmptyString() { + const string toEllipsize = ""; + Assert.That(toEllipsize.Ellipsize(45), Is.StringMatching("")); + } + [Test] + public void Ellipsize_NullValueReturnsEmptyString() { + const string toEllipsize = null; + Assert.That(toEllipsize.Ellipsize(45), Is.StringMatching("")); + } + [Test] + public void Ellipsize_CustomEllipsisStringIsUsed() { + const string toEllipsize = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sed purus quis purus orci aliquam."; + Assert.That(toEllipsize.Ellipsize(45, "........"), Is.StringMatching("Lorem ipsum dolor sit amet, consectetur........")); + } + [Test] + public void Ellipsize_WordBoundary() { + const string toEllipsize = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sed purus quis purus orci aliquam."; + Assert.That(toEllipsize.Ellipsize(43, "..."), Is.StringMatching("Lorem ipsum dolor sit amet, consectet...")); + Assert.That(toEllipsize.Ellipsize(43, "...", true), Is.StringMatching("Lorem ipsum dolor sit amet, ...")); + } + + [Test] + public void HtmlClassify_ValidReallySimpleClassNameReturnsSame() { + const string toClassify = "someclass"; + Assert.That(toClassify.HtmlClassify(), Is.StringMatching(toClassify)); + } + [Test] + public void HtmlClassify_NumbersAreMaintainedIfNotAtStart() { + const string toClassify = "some4class5"; + Assert.That(toClassify.HtmlClassify(), Is.StringMatching(toClassify)); + } + [Test] + public void HtmlClassify_NumbersAreStrippedAtStart() { + const string toClassify = "5someClass"; + Assert.That(toClassify.HtmlClassify(), Is.StringMatching("some-class")); + } + [Test] + public void HtmlClassify_ValidSimpleClassNameReturnsSame() { + const string toClassify = "some-class"; + Assert.That(toClassify.HtmlClassify(), Is.StringMatching(toClassify)); + } + [Test] + public void HtmlClassify_SimpleStringReturnsSimpleClassName() { + const string toClassify = "this is something"; + Assert.That(toClassify.HtmlClassify(), Is.StringMatching("this-is-something")); + } + [Test] + public void HtmlClassify_ValidComplexClassNameReturnsSimpleClassName() { + const string toClassify = @"some-class\&some.other.class"; + Assert.That(toClassify.HtmlClassify(), Is.StringMatching("some-class-some-other-class")); + } + [Test] + public void HtmlClassify_CompletelyInvalidClassNameReturnsEmptyString() { + const string toClassify = @"0_1234_12"; + Assert.That(toClassify.HtmlClassify(), Is.StringMatching("")); + } + [Test] + public void HtmlClassify_LowerCamelCasedStringReturnsLowerHyphenatedClassName() { + const string toClassify = "camelCased"; + Assert.That(toClassify.HtmlClassify(), Is.StringMatching("camel-cased")); + } + [Test] + public void HtmlClassify_PascalCasedStringReturnsLowerHyphenatedClassName() { + const string toClassify = "PascalCased"; + Assert.That(toClassify.HtmlClassify(), Is.StringMatching("pascal-cased")); + } + [Test] + public void HtmlClassify_EmptyStringReturnsEmptyString() { + const string toClassify = ""; + Assert.That(toClassify.HtmlClassify(), Is.StringMatching("")); + } + [Test] + public void HtmlClassify_NullValueReturnsEmptyString() { + const string toClassify = null; + Assert.That(toClassify.HtmlClassify(), Is.StringMatching("")); + } + + [Test] + public void OrDefault_ReturnsDefaultForNull() { + const string s = null; + var def = new LocalizedString("test"); + Assert.That(s.OrDefault(def).Text, Is.SameAs("test")); + } + [Test] + public void OrDefault_ReturnsDefaultIfEmpty() { + var def = new LocalizedString("test"); + Assert.That("".OrDefault(def).Text, Is.SameAs("test")); + } + [Test] + public void OrDefault_ReturnsDefaultIfNull() { + var def = new LocalizedString("test"); + Assert.That(((string)null).OrDefault(def).Text, Is.SameAs("test")); + } + [Test] + public void OrDefault_ReturnsString() { + var def = new LocalizedString("test"); + Assert.That("bar".OrDefault(def).Text, Is.SameAs("bar")); + } + + [Test] + public void RemoveTags_StringWithNoTagsReturnsSame() { + const string fullOfTags = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sed purus quis purus orci aliquam."; + Assert.That(fullOfTags.RemoveTags(), Is.StringMatching("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sed purus quis purus orci aliquam.")); + } + [Test] + public void RemoveTags_SimpleWellFormedTagsAreRemoved() { + const string fullOfTags = @"

      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sed purus quis purus orci aliquam.

      "; + Assert.That(fullOfTags.RemoveTags(), Is.StringMatching("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sed purus quis purus orci aliquam.")); + } + [Test] + public void RemoveTags_EmptyStringReturnsEmptyString() { + const string fullOfTags = ""; + Assert.That(fullOfTags.RemoveTags(), Is.StringMatching("")); + } + [Test] + public void RemoveTags_NullValueReturnsEmptyString() { + const string fullOfTags = null; + Assert.That(fullOfTags.RemoveTags(), Is.StringMatching("")); + } + + [Test] + public void ReplaceNewLinesWith_ReplaceCRLFWithHtmlBR() { + const string lotsOfLineFeeds = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.\r\nMaecenas sed purus quis purus orci aliquam."; + Assert.That(lotsOfLineFeeds.ReplaceNewLinesWith("
      "), Is.StringMatching("Lorem ipsum dolor sit amet, consectetur adipiscing elit.
      Maecenas sed purus quis purus orci aliquam.")); + } + [Test] + public void ReplaceNewLinesWith_ReplaceCRLFWithHtmlPsAndCRLF() { + const string lotsOfLineFeeds = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.\r\nMaecenas sed purus quis purus orci aliquam."; + Assert.That(lotsOfLineFeeds.ReplaceNewLinesWith(@"

      {0}

      "), Is.StringMatching("Lorem ipsum dolor sit amet, consectetur adipiscing elit.

      \r\n

      Maecenas sed purus quis purus orci aliquam.")); + } + [Test] + public void ReplaceNewLinesWith_EmptyStringReturnsEmptyString() { + const string lotsOfLineFeeds = ""; + Assert.That(lotsOfLineFeeds.ReplaceNewLinesWith("
      "), Is.StringMatching("")); + } + [Test] + public void ReplaceNewLinesWith_NullValueReturnsEmptyString() { + const string lotsOfLineFeeds = null; + Assert.That(lotsOfLineFeeds.ReplaceNewLinesWith("
      "), Is.StringMatching("")); + } + + [Test] + public void StripShouldRemoveStart() { + Assert.That("abc".Strip('a'), Is.StringMatching("bc")); + Assert.That("abc".Strip("ab".ToCharArray()), Is.StringMatching("c")); + } + + [Test] + public void StripShouldRemoveInside() { + Assert.That("abc".Strip('b'), Is.StringMatching("ac")); + Assert.That("abc".Strip("abc".ToCharArray()), Is.StringMatching("")); + } + + [Test] + public void StripShouldRemoveEnd() { + Assert.That("abc".Strip('c'), Is.StringMatching("ab")); + Assert.That("abc".Strip("bc".ToCharArray()), Is.StringMatching("a")); + } + + [Test] + public void StripShouldReturnIfEmpty() { + Assert.That("".Strip('a'), Is.StringMatching("")); + Assert.That("a".Strip("".ToCharArray()), Is.StringMatching("a")); + } + + [Test] + public void AnyShouldReturnTrueAtStart() { + Assert.That("abc".Any('a'), Is.True); + Assert.That("abc".Any("ab".ToCharArray()), Is.True); + } + + [Test] + public void AnyShouldReturnTrueAtEnd() { + Assert.That("abc".Any('c'), Is.True); + Assert.That("abc".Any("bc".ToCharArray()), Is.True); + } + + [Test] + public void AnyShouldReturnTrueAtMiddle() { + Assert.That("abc".Any('b'), Is.True); + Assert.That("abc".Any("abc".ToCharArray()), Is.True); + } + + [Test] + public void AnyShouldReturnFalseIfNotPresent() { + Assert.That("abc".Any("".ToCharArray()), Is.False); + Assert.That("abc".Any("d".ToCharArray()), Is.False); + } + + [Test] + public void AllShouldReturnTrueIfAllArePresent() { + Assert.That("abc".All("abc".ToCharArray()), Is.True); + Assert.That("abc".All("abcd".ToCharArray()), Is.True); + Assert.That("".All("a".ToCharArray()), Is.True); + Assert.That("abc".All("abcd".ToCharArray()), Is.True); + } + + [Test] + public void AllShouldReturnFalseIfAnyIsNotPresent() { + Assert.That("abc".All("".ToCharArray()), Is.False); + Assert.That("abc".All("a".ToCharArray()), Is.False); + } + + [Test] + public void TranslateShouldThrowException() { + Assert.Throws(() => "a".Translate("".ToCharArray(), "a".ToCharArray())); + Assert.Throws(() => "a".Translate("a".ToCharArray(), "".ToCharArray())); + } + + [Test] + public void TranslateShouldReturnSource() { + Assert.That("a".Translate("".ToCharArray(), "".ToCharArray()), Is.StringMatching("")); + Assert.That("".Translate("abc".ToCharArray(), "abc".ToCharArray()), Is.StringMatching("")); + } + + [Test] + public void TranslateShouldReplaceChars() { + Assert.That("abc".Translate("a".ToCharArray(), "d".ToCharArray()), Is.StringMatching("dbc")); + Assert.That("abc".Translate("d".ToCharArray(), "d".ToCharArray()), Is.StringMatching("abc")); + Assert.That("abc".Translate("abc".ToCharArray(), "def".ToCharArray()), Is.StringMatching("def")); + } + + [Test] + public void ShouldEncodeToBase64() { + Assert.That("abc".ToBase64(), Is.EqualTo("YWJj")); + } + + [Test] + public void ShouldDecodeFromBase64() { + Assert.That("YWJj".FromBase64(), Is.EqualTo("abc")); + } + + [Test] + public void ShouldRoundtripBase64() { + Assert.That("abc".ToBase64().FromBase64(), Is.EqualTo("abc")); + Assert.That("YWJj".FromBase64().ToBase64(), Is.EqualTo("YWJj")); + } + } +} diff --git a/src/Orchard.Tests/Utility/ReflectOnTests.cs b/src/Orchard.Tests/Utility/ReflectOnTests.cs index 33dcb80fd55..1fc767b4a26 100644 --- a/src/Orchard.Tests/Utility/ReflectOnTests.cs +++ b/src/Orchard.Tests/Utility/ReflectOnTests.cs @@ -1,62 +1,62 @@ -using NUnit.Framework; -using Orchard.Utility; - -namespace Orchard.Tests.Utility { - [TestFixture] - public class ReflectOnTests { - private class TestClass { - public int MyField; - public int MyField2; - public int MyProperty { get { MyField = 5; return MyField; } } - public int MyProperty2 { get { MyField2 = 5; return MyField2; } } - public void MyMethod(int i) { } - public int MyMethod(string s) { return 5; } - public void MyMethod2(int i) { } - public int MyMethod2(string s) { return 5; } - public TestClass MyTestClass { get { return null; } } - public TestClass this[int i] { get { return null; } } - } - - [Test] - public void ReflectOnGetMemberShouldReturnCorrectMemberInfo() { - Assert.That(ReflectOn.GetMember(p => p.MyField).Name, Is.EqualTo("MyField")); - Assert.That(ReflectOn.GetMember(p => p.MyMethod(5)).Name, Is.EqualTo("MyMethod")); - } - - [Test] - public void ReflectOnShouldWorkOnFields() { - Assert.That(ReflectOn.GetField(p => p.MyField).Name, Is.EqualTo("MyField")); - Assert.That(ReflectOn.GetField(p => p.MyField2).Name, Is.EqualTo("MyField2")); - } - - [Test] - public void ReflectOnShouldWorkOnProperties() { - Assert.That(ReflectOn.GetProperty(p => p.MyProperty).Name, Is.EqualTo("MyProperty")); - Assert.That(ReflectOn.GetProperty(p => p.MyProperty2).Name, Is.EqualTo("MyProperty2")); - } - - [Test] - public void ReflectOnShouldWorkOnMethods() { - Assert.That(ReflectOn.GetMethod(p => p.MyMethod(5)).Name, Is.EqualTo("MyMethod")); - Assert.That(ReflectOn.GetMethod(p => p.MyMethod("")).Name, Is.EqualTo("MyMethod")); - Assert.That(ReflectOn.GetMethod(p => p.MyMethod("")).ReturnType, Is.EqualTo(typeof(int))); - - Assert.That(ReflectOn.GetMethod(p => p.MyMethod2(5)).Name, Is.EqualTo("MyMethod2")); - Assert.That(ReflectOn.GetMethod(p => p.MyMethod2("")).Name, Is.EqualTo("MyMethod2")); - Assert.That(ReflectOn.GetMethod(p => p.MyMethod2("")).ReturnType, Is.EqualTo(typeof(int))); - } - - [Test] - public void ReflectOnShouldWorkOnDottedProperties() { - Assert.That(ReflectOn.NameOf(p => p.MyTestClass.MyTestClass.MyProperty), Is.EqualTo("MyTestClass.MyTestClass.MyProperty")); - } - - [Test] - public void ReflectOnShouldWorkOnIndexers() { - Assert.That(ReflectOn.NameOf(p => p[0].MyTestClass[1].MyProperty), Is.EqualTo("[0].MyTestClass[1].MyProperty")); - int j = 5; - int index = j; - Assert.That(ReflectOn.NameOf(p => p.MyTestClass[index].MyProperty), Is.EqualTo("MyTestClass[5].MyProperty")); - } - } -} +using NUnit.Framework; +using Orchard.Utility; + +namespace Orchard.Tests.Utility { + [TestFixture] + public class ReflectOnTests { + private class TestClass { + public int MyField; + public int MyField2; + public int MyProperty { get { MyField = 5; return MyField; } } + public int MyProperty2 { get { MyField2 = 5; return MyField2; } } + public void MyMethod(int i) { } + public int MyMethod(string s) { return 5; } + public void MyMethod2(int i) { } + public int MyMethod2(string s) { return 5; } + public TestClass MyTestClass { get { return null; } } + public TestClass this[int i] { get { return null; } } + } + + [Test] + public void ReflectOnGetMemberShouldReturnCorrectMemberInfo() { + Assert.That(ReflectOn.GetMember(p => p.MyField).Name, Is.EqualTo("MyField")); + Assert.That(ReflectOn.GetMember(p => p.MyMethod(5)).Name, Is.EqualTo("MyMethod")); + } + + [Test] + public void ReflectOnShouldWorkOnFields() { + Assert.That(ReflectOn.GetField(p => p.MyField).Name, Is.EqualTo("MyField")); + Assert.That(ReflectOn.GetField(p => p.MyField2).Name, Is.EqualTo("MyField2")); + } + + [Test] + public void ReflectOnShouldWorkOnProperties() { + Assert.That(ReflectOn.GetProperty(p => p.MyProperty).Name, Is.EqualTo("MyProperty")); + Assert.That(ReflectOn.GetProperty(p => p.MyProperty2).Name, Is.EqualTo("MyProperty2")); + } + + [Test] + public void ReflectOnShouldWorkOnMethods() { + Assert.That(ReflectOn.GetMethod(p => p.MyMethod(5)).Name, Is.EqualTo("MyMethod")); + Assert.That(ReflectOn.GetMethod(p => p.MyMethod("")).Name, Is.EqualTo("MyMethod")); + Assert.That(ReflectOn.GetMethod(p => p.MyMethod("")).ReturnType, Is.EqualTo(typeof(int))); + + Assert.That(ReflectOn.GetMethod(p => p.MyMethod2(5)).Name, Is.EqualTo("MyMethod2")); + Assert.That(ReflectOn.GetMethod(p => p.MyMethod2("")).Name, Is.EqualTo("MyMethod2")); + Assert.That(ReflectOn.GetMethod(p => p.MyMethod2("")).ReturnType, Is.EqualTo(typeof(int))); + } + + [Test] + public void ReflectOnShouldWorkOnDottedProperties() { + Assert.That(ReflectOn.NameOf(p => p.MyTestClass.MyTestClass.MyProperty), Is.EqualTo("MyTestClass.MyTestClass.MyProperty")); + } + + [Test] + public void ReflectOnShouldWorkOnIndexers() { + Assert.That(ReflectOn.NameOf(p => p[0].MyTestClass[1].MyProperty), Is.EqualTo("[0].MyTestClass[1].MyProperty")); + int j = 5; + int index = j; + Assert.That(ReflectOn.NameOf(p => p.MyTestClass[index].MyProperty), Is.EqualTo("MyTestClass[5].MyProperty")); + } + } +} diff --git a/src/Orchard.Tests/Utility/ReflectTests.cs b/src/Orchard.Tests/Utility/ReflectTests.cs index 4c2402f9995..0765f82bba7 100644 --- a/src/Orchard.Tests/Utility/ReflectTests.cs +++ b/src/Orchard.Tests/Utility/ReflectTests.cs @@ -1,47 +1,47 @@ -using NUnit.Framework; -using Orchard.Utility; - -namespace Orchard.Tests.Utility { - [TestFixture] - public class ReflectTests { - private class TestClass { - public static int MyField; - public static int MyField2; - public static int MyProperty { get { MyField = 5; return MyField; } } - public static int MyProperty2 { get { MyField2 = 5; return MyField2; } } - public static void MyMethod(int i) { } - public static int MyMethod(string s) { return 5; } - public static void MyMethod2(int i) { } - public static int MyMethod2(string s) { return 5; } - } - - [Test] - public void ReflectGetMemberShouldReturnCorrectMemberInfo() { - Assert.That(Reflect.GetMember(() => TestClass.MyField).Name, Is.EqualTo("MyField")); - Assert.That(Reflect.GetMember(() => TestClass.MyMethod(5)).Name, Is.EqualTo("MyMethod")); - } - - [Test] - public void ReflectShouldWorkOnFields() { - Assert.That(Reflect.GetField(() => TestClass.MyField).Name, Is.EqualTo("MyField")); - Assert.That(Reflect.GetField(() => TestClass.MyField2).Name, Is.EqualTo("MyField2")); - } - - [Test] - public void ReflectShouldWorkOnProperties() { - Assert.That(Reflect.GetProperty(() => TestClass.MyProperty).Name, Is.EqualTo("MyProperty")); - Assert.That(Reflect.GetProperty(() => TestClass.MyProperty2).Name, Is.EqualTo("MyProperty2")); - } - - [Test] - public void ReflectShouldWorkOnMethods() { - Assert.That(Reflect.GetMethod(() => TestClass.MyMethod(5)).Name, Is.EqualTo("MyMethod")); - Assert.That(Reflect.GetMethod(() => TestClass.MyMethod("")).Name, Is.EqualTo("MyMethod")); - Assert.That(Reflect.GetMethod(() => TestClass.MyMethod("")).ReturnType, Is.EqualTo(typeof(int))); - - Assert.That(Reflect.GetMethod(() => TestClass.MyMethod2(5)).Name, Is.EqualTo("MyMethod2")); - Assert.That(Reflect.GetMethod(() => TestClass.MyMethod2("")).Name, Is.EqualTo("MyMethod2")); - Assert.That(Reflect.GetMethod(() => TestClass.MyMethod2("")).ReturnType, Is.EqualTo(typeof(int))); - } - } +using NUnit.Framework; +using Orchard.Utility; + +namespace Orchard.Tests.Utility { + [TestFixture] + public class ReflectTests { + private class TestClass { + public static int MyField; + public static int MyField2; + public static int MyProperty { get { MyField = 5; return MyField; } } + public static int MyProperty2 { get { MyField2 = 5; return MyField2; } } + public static void MyMethod(int i) { } + public static int MyMethod(string s) { return 5; } + public static void MyMethod2(int i) { } + public static int MyMethod2(string s) { return 5; } + } + + [Test] + public void ReflectGetMemberShouldReturnCorrectMemberInfo() { + Assert.That(Reflect.GetMember(() => TestClass.MyField).Name, Is.EqualTo("MyField")); + Assert.That(Reflect.GetMember(() => TestClass.MyMethod(5)).Name, Is.EqualTo("MyMethod")); + } + + [Test] + public void ReflectShouldWorkOnFields() { + Assert.That(Reflect.GetField(() => TestClass.MyField).Name, Is.EqualTo("MyField")); + Assert.That(Reflect.GetField(() => TestClass.MyField2).Name, Is.EqualTo("MyField2")); + } + + [Test] + public void ReflectShouldWorkOnProperties() { + Assert.That(Reflect.GetProperty(() => TestClass.MyProperty).Name, Is.EqualTo("MyProperty")); + Assert.That(Reflect.GetProperty(() => TestClass.MyProperty2).Name, Is.EqualTo("MyProperty2")); + } + + [Test] + public void ReflectShouldWorkOnMethods() { + Assert.That(Reflect.GetMethod(() => TestClass.MyMethod(5)).Name, Is.EqualTo("MyMethod")); + Assert.That(Reflect.GetMethod(() => TestClass.MyMethod("")).Name, Is.EqualTo("MyMethod")); + Assert.That(Reflect.GetMethod(() => TestClass.MyMethod("")).ReturnType, Is.EqualTo(typeof(int))); + + Assert.That(Reflect.GetMethod(() => TestClass.MyMethod2(5)).Name, Is.EqualTo("MyMethod2")); + Assert.That(Reflect.GetMethod(() => TestClass.MyMethod2("")).Name, Is.EqualTo("MyMethod2")); + Assert.That(Reflect.GetMethod(() => TestClass.MyMethod2("")).ReturnType, Is.EqualTo(typeof(int))); + } + } } \ No newline at end of file diff --git a/src/Orchard.WarmupStarter/Orchard.WarmupStarter.csproj b/src/Orchard.WarmupStarter/Orchard.WarmupStarter.csproj index cf25d4ca180..54c903788f3 100644 --- a/src/Orchard.WarmupStarter/Orchard.WarmupStarter.csproj +++ b/src/Orchard.WarmupStarter/Orchard.WarmupStarter.csproj @@ -1,56 +1,56 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {5C0D5249-AEF5-4BB6-8F5F-057B91AC2D7A} - Library - Properties - Orchard.WarmupStarter - Orchard.WarmupStarter - v4.5.1 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - false - ..\OrchardBasicCorrectness.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - - - - - - - - - - - + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {5C0D5249-AEF5-4BB6-8F5F-057B91AC2D7A} + Library + Properties + Orchard.WarmupStarter + Orchard.WarmupStarter + v4.5.1 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + false + ..\OrchardBasicCorrectness.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Orchard.WarmupStarter/Properties/AssemblyInfo.cs b/src/Orchard.WarmupStarter/Properties/AssemblyInfo.cs index 3bf0779c8e4..3c4089b0f1e 100644 --- a/src/Orchard.WarmupStarter/Properties/AssemblyInfo.cs +++ b/src/Orchard.WarmupStarter/Properties/AssemblyInfo.cs @@ -1,39 +1,39 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Security; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Orchard.WarmupStarter")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyProduct("Orchard")] -[assembly: AssemblyCopyright("Copyright © .NET Foundation")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("02319f2f-22ec-448d-b4f2-568fb8502242")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.9.2")] -[assembly: AssemblyFileVersion("1.9.2")] - -// Enable web application to call this assembly in Full Trust -[assembly: AllowPartiallyTrustedCallers] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Orchard.WarmupStarter")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyProduct("Orchard")] +[assembly: AssemblyCopyright("Copyright © .NET Foundation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("02319f2f-22ec-448d-b4f2-568fb8502242")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.9.2")] +[assembly: AssemblyFileVersion("1.9.2")] + +// Enable web application to call this assembly in Full Trust +[assembly: AllowPartiallyTrustedCallers] diff --git a/src/Orchard.WarmupStarter/Starter.cs b/src/Orchard.WarmupStarter/Starter.cs index b0b328da45c..cb360c8bd3c 100644 --- a/src/Orchard.WarmupStarter/Starter.cs +++ b/src/Orchard.WarmupStarter/Starter.cs @@ -1,105 +1,105 @@ -using System; -using System.Threading; -using System.Web; - -namespace Orchard.WarmupStarter { - public class Starter where T : class { - private readonly Func _initialization; - private readonly Action _beginRequest; - private readonly Action _endRequest; - private readonly object _synLock = new object(); - ///

      - /// The result of the initialization queued work item. - /// Set only when initialization has completed without errors. - /// - private volatile T _initializationResult; - /// - /// The (potential) error raised by the initialization thread. This is a "one-time" - /// error signal, so that we can restart the initialization once another request - /// comes in. - /// - private volatile Exception _error; - /// - /// The (potential) error from the previous initiazalition. We need to - /// keep this error active until the next initialization is finished, - /// so that we can keep reporting the error for all incoming requests. - /// - private volatile Exception _previousError; - - public Starter(Func initialization, Action beginRequest, Action endRequest) { - _initialization = initialization; - _beginRequest = beginRequest; - _endRequest = endRequest; - } - - public void OnApplicationStart(HttpApplication application) { - LaunchStartupThread(application); - } - - public void OnBeginRequest(HttpApplication application) { - // Initialization resulted in an error - if (_error != null) { - // Save error for next requests and restart async initialization. - // Note: The reason we have to retry the initialization is that the - // application environment may change between requests, - // e.g. App_Data is made read-write for the AppPool. - bool restartInitialization = false; - - lock (_synLock) { - if (_error != null) { - _previousError = _error; - _error = null; - restartInitialization = true; - } - } - - if (restartInitialization) { - LaunchStartupThread(application); - } - } - - // Previous initialization resulted in an error (and another initialization is running) - if (_previousError != null) { - throw new ApplicationException("Error during application initialization", _previousError); - } - - // Only notify if the initialization has successfully completed - if (_initializationResult != null) { - _beginRequest(application, _initializationResult); - } - } - - public void OnEndRequest(HttpApplication application) { - // Only notify if the initialization has successfully completed - if (_initializationResult != null) { - _endRequest(application, _initializationResult); - } - } - - /// - /// Run the initialization delegate asynchronously in a queued work item - /// - public void LaunchStartupThread(HttpApplication application) { - // Make sure incoming requests are queued - WarmupHttpModule.SignalWarmupStart(); - - ThreadPool.QueueUserWorkItem( - state => { - try { - var result = _initialization(application); - _initializationResult = result; - } - catch (Exception ex) { - lock (_synLock) { - _error = ex; - _previousError = null; - } - } - finally { - // Execute pending requests as the initialization is over - WarmupHttpModule.SignalWarmupDone(); - } - }); - } - } -} +using System; +using System.Threading; +using System.Web; + +namespace Orchard.WarmupStarter { + public class Starter where T : class { + private readonly Func _initialization; + private readonly Action _beginRequest; + private readonly Action _endRequest; + private readonly object _synLock = new object(); + /// + /// The result of the initialization queued work item. + /// Set only when initialization has completed without errors. + /// + private volatile T _initializationResult; + /// + /// The (potential) error raised by the initialization thread. This is a "one-time" + /// error signal, so that we can restart the initialization once another request + /// comes in. + /// + private volatile Exception _error; + /// + /// The (potential) error from the previous initiazalition. We need to + /// keep this error active until the next initialization is finished, + /// so that we can keep reporting the error for all incoming requests. + /// + private volatile Exception _previousError; + + public Starter(Func initialization, Action beginRequest, Action endRequest) { + _initialization = initialization; + _beginRequest = beginRequest; + _endRequest = endRequest; + } + + public void OnApplicationStart(HttpApplication application) { + LaunchStartupThread(application); + } + + public void OnBeginRequest(HttpApplication application) { + // Initialization resulted in an error + if (_error != null) { + // Save error for next requests and restart async initialization. + // Note: The reason we have to retry the initialization is that the + // application environment may change between requests, + // e.g. App_Data is made read-write for the AppPool. + bool restartInitialization = false; + + lock (_synLock) { + if (_error != null) { + _previousError = _error; + _error = null; + restartInitialization = true; + } + } + + if (restartInitialization) { + LaunchStartupThread(application); + } + } + + // Previous initialization resulted in an error (and another initialization is running) + if (_previousError != null) { + throw new ApplicationException("Error during application initialization", _previousError); + } + + // Only notify if the initialization has successfully completed + if (_initializationResult != null) { + _beginRequest(application, _initializationResult); + } + } + + public void OnEndRequest(HttpApplication application) { + // Only notify if the initialization has successfully completed + if (_initializationResult != null) { + _endRequest(application, _initializationResult); + } + } + + /// + /// Run the initialization delegate asynchronously in a queued work item + /// + public void LaunchStartupThread(HttpApplication application) { + // Make sure incoming requests are queued + WarmupHttpModule.SignalWarmupStart(); + + ThreadPool.QueueUserWorkItem( + state => { + try { + var result = _initialization(application); + _initializationResult = result; + } + catch (Exception ex) { + lock (_synLock) { + _error = ex; + _previousError = null; + } + } + finally { + // Execute pending requests as the initialization is over + WarmupHttpModule.SignalWarmupDone(); + } + }); + } + } +} diff --git a/src/Orchard.WarmupStarter/WarmupHttpModule.cs b/src/Orchard.WarmupStarter/WarmupHttpModule.cs index 5e1bd64722f..040369e1a36 100644 --- a/src/Orchard.WarmupStarter/WarmupHttpModule.cs +++ b/src/Orchard.WarmupStarter/WarmupHttpModule.cs @@ -1,159 +1,159 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Web; - -namespace Orchard.WarmupStarter { - public class WarmupHttpModule : IHttpModule { - private HttpApplication _context; - private static object _synLock = new object(); - private static IList _awaiting = new List(); - - public void Init(HttpApplication context) { - _context = context; - context.AddOnBeginRequestAsync(BeginBeginRequest, EndBeginRequest, null); - } - - public void Dispose() { - } - - private static bool InWarmup() { - lock (_synLock) { - return _awaiting != null; - } - } - - /// - /// Warmup code is about to start: Any new incoming request is queued - /// until "SignalWarmupDone" is called. - /// - public static void SignalWarmupStart() { - lock (_synLock) { - if (_awaiting == null) { - _awaiting = new List(); - } - } - } - - /// - /// Warmup code just completed: All pending requests in the "_await" queue are processed, - /// and any new incoming request is now processed immediately. - /// - public static void SignalWarmupDone() { - IList temp; - - lock (_synLock) { - temp = _awaiting; - _awaiting = null; - } - - if (temp != null) { - foreach (var action in temp) { - action(); - } - } - } - - /// - /// Enqueue or directly process action depending on current mode. - /// - private void Await(Action action) { - Action temp = action; - - lock (_synLock) { - if (_awaiting != null) { - temp = null; - _awaiting.Add(action); - } - } - - if (temp != null) { - temp(); - } - } - - private IAsyncResult BeginBeginRequest(object sender, EventArgs e, AsyncCallback cb, object extradata) { - // host is available, process every requests, or file is processed - if (!InWarmup() || WarmupUtility.DoBeginRequest(_context)) { - var asyncResult = new DoneAsyncResult(extradata); - cb(asyncResult); - return asyncResult; - } - else { - // this is the "on hold" execution path - var asyncResult = new WarmupAsyncResult(cb, extradata); - Await(asyncResult.Completed); - return asyncResult; - } - } - - private static void EndBeginRequest(IAsyncResult ar) { - } - - /// - /// AsyncResult for "on hold" request (resumes when "Completed()" is called) - /// - private class WarmupAsyncResult : IAsyncResult { - private readonly EventWaitHandle _eventWaitHandle = new AutoResetEvent(false/*initialState*/); - private readonly AsyncCallback _cb; - private readonly object _asyncState; - private bool _isCompleted; - - public WarmupAsyncResult(AsyncCallback cb, object asyncState) { - _cb = cb; - _asyncState = asyncState; - _isCompleted = false; - } - - public void Completed() { - _isCompleted = true; - _eventWaitHandle.Set(); - _cb(this); - } - - bool IAsyncResult.CompletedSynchronously { - get { return false; } - } - - bool IAsyncResult.IsCompleted { - get { return _isCompleted; } - } - - object IAsyncResult.AsyncState { - get { return _asyncState; } - } - - WaitHandle IAsyncResult.AsyncWaitHandle { - get { return _eventWaitHandle; } - } - } - - /// - /// Async result for "ok to process now" requests - /// - private class DoneAsyncResult : IAsyncResult { - private readonly object _asyncState; - private static readonly WaitHandle _waitHandle = new ManualResetEvent(true/*initialState*/); - - public DoneAsyncResult(object asyncState) { - _asyncState = asyncState; - } - - bool IAsyncResult.CompletedSynchronously { - get { return true; } - } - - bool IAsyncResult.IsCompleted { - get { return true; } - } - - WaitHandle IAsyncResult.AsyncWaitHandle { - get { return _waitHandle; } - } - - object IAsyncResult.AsyncState { - get { return _asyncState; } - } - } - } +using System; +using System.Collections.Generic; +using System.Threading; +using System.Web; + +namespace Orchard.WarmupStarter { + public class WarmupHttpModule : IHttpModule { + private HttpApplication _context; + private static object _synLock = new object(); + private static IList _awaiting = new List(); + + public void Init(HttpApplication context) { + _context = context; + context.AddOnBeginRequestAsync(BeginBeginRequest, EndBeginRequest, null); + } + + public void Dispose() { + } + + private static bool InWarmup() { + lock (_synLock) { + return _awaiting != null; + } + } + + /// + /// Warmup code is about to start: Any new incoming request is queued + /// until "SignalWarmupDone" is called. + /// + public static void SignalWarmupStart() { + lock (_synLock) { + if (_awaiting == null) { + _awaiting = new List(); + } + } + } + + /// + /// Warmup code just completed: All pending requests in the "_await" queue are processed, + /// and any new incoming request is now processed immediately. + /// + public static void SignalWarmupDone() { + IList temp; + + lock (_synLock) { + temp = _awaiting; + _awaiting = null; + } + + if (temp != null) { + foreach (var action in temp) { + action(); + } + } + } + + /// + /// Enqueue or directly process action depending on current mode. + /// + private void Await(Action action) { + Action temp = action; + + lock (_synLock) { + if (_awaiting != null) { + temp = null; + _awaiting.Add(action); + } + } + + if (temp != null) { + temp(); + } + } + + private IAsyncResult BeginBeginRequest(object sender, EventArgs e, AsyncCallback cb, object extradata) { + // host is available, process every requests, or file is processed + if (!InWarmup() || WarmupUtility.DoBeginRequest(_context)) { + var asyncResult = new DoneAsyncResult(extradata); + cb(asyncResult); + return asyncResult; + } + else { + // this is the "on hold" execution path + var asyncResult = new WarmupAsyncResult(cb, extradata); + Await(asyncResult.Completed); + return asyncResult; + } + } + + private static void EndBeginRequest(IAsyncResult ar) { + } + + /// + /// AsyncResult for "on hold" request (resumes when "Completed()" is called) + /// + private class WarmupAsyncResult : IAsyncResult { + private readonly EventWaitHandle _eventWaitHandle = new AutoResetEvent(false/*initialState*/); + private readonly AsyncCallback _cb; + private readonly object _asyncState; + private bool _isCompleted; + + public WarmupAsyncResult(AsyncCallback cb, object asyncState) { + _cb = cb; + _asyncState = asyncState; + _isCompleted = false; + } + + public void Completed() { + _isCompleted = true; + _eventWaitHandle.Set(); + _cb(this); + } + + bool IAsyncResult.CompletedSynchronously { + get { return false; } + } + + bool IAsyncResult.IsCompleted { + get { return _isCompleted; } + } + + object IAsyncResult.AsyncState { + get { return _asyncState; } + } + + WaitHandle IAsyncResult.AsyncWaitHandle { + get { return _eventWaitHandle; } + } + } + + /// + /// Async result for "ok to process now" requests + /// + private class DoneAsyncResult : IAsyncResult { + private readonly object _asyncState; + private static readonly WaitHandle _waitHandle = new ManualResetEvent(true/*initialState*/); + + public DoneAsyncResult(object asyncState) { + _asyncState = asyncState; + } + + bool IAsyncResult.CompletedSynchronously { + get { return true; } + } + + bool IAsyncResult.IsCompleted { + get { return true; } + } + + WaitHandle IAsyncResult.AsyncWaitHandle { + get { return _waitHandle; } + } + + object IAsyncResult.AsyncState { + get { return _asyncState; } + } + } + } } \ No newline at end of file diff --git a/src/Orchard.WarmupStarter/WarmupUtility.cs b/src/Orchard.WarmupStarter/WarmupUtility.cs index 4abb789f3b6..096e43180cc 100644 --- a/src/Orchard.WarmupStarter/WarmupUtility.cs +++ b/src/Orchard.WarmupStarter/WarmupUtility.cs @@ -1,71 +1,71 @@ -using System; -using System.IO; -using System.Text; -using System.Web; -using System.Web.Hosting; - -namespace Orchard.WarmupStarter { - public static class WarmupUtility { - public static readonly string WarmupFilesPath = "~/App_Data/Warmup/"; - /// - /// return true to put request on hold (until call to Signal()) - return false to allow pipeline to execute immediately - /// - /// - /// - public static bool DoBeginRequest(HttpApplication httpApplication) { - // use the url as it was requested by the client - // the real url might be different if it has been translated (proxy, load balancing, ...) - var url = ToUrlString(httpApplication.Request); - var virtualFileCopy = WarmupUtility.EncodeUrl(url.Trim('/')); - var localCopy = Path.Combine(HostingEnvironment.MapPath(WarmupFilesPath), virtualFileCopy); - - if (File.Exists(localCopy)) { - // result should not be cached, even on proxies - httpApplication.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1)); - httpApplication.Response.Cache.SetValidUntilExpires(false); - httpApplication.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches); - httpApplication.Response.Cache.SetCacheability(HttpCacheability.NoCache); - httpApplication.Response.Cache.SetNoStore(); - - httpApplication.Response.WriteFile(localCopy); - httpApplication.Response.End(); - return true; - } - - // there is no local copy and the file exists - // serve the static file - if (File.Exists(httpApplication.Request.PhysicalPath)) { - return true; - } - - return false; - } - - public static string ToUrlString(HttpRequest request) { - return string.Format("{0}://{1}{2}", request.Url.Scheme, request.Headers["Host"], request.RawUrl); - } - - public static string EncodeUrl(string url) { - if (String.IsNullOrWhiteSpace(url)) { - throw new ArgumentException("url can't be empty"); - } - - var sb = new StringBuilder(); - foreach (var c in url.ToLowerInvariant()) { - // only accept alphanumeric chars - if ((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9')) { - sb.Append(c); - } - // otherwise encode them in UTF8 - else { - sb.Append("_"); - foreach (var b in Encoding.UTF8.GetBytes(new[] { c })) { - sb.Append(b.ToString("X")); - } - } - } - - return sb.ToString(); - } - } +using System; +using System.IO; +using System.Text; +using System.Web; +using System.Web.Hosting; + +namespace Orchard.WarmupStarter { + public static class WarmupUtility { + public static readonly string WarmupFilesPath = "~/App_Data/Warmup/"; + /// + /// return true to put request on hold (until call to Signal()) - return false to allow pipeline to execute immediately + /// + /// + /// + public static bool DoBeginRequest(HttpApplication httpApplication) { + // use the url as it was requested by the client + // the real url might be different if it has been translated (proxy, load balancing, ...) + var url = ToUrlString(httpApplication.Request); + var virtualFileCopy = WarmupUtility.EncodeUrl(url.Trim('/')); + var localCopy = Path.Combine(HostingEnvironment.MapPath(WarmupFilesPath), virtualFileCopy); + + if (File.Exists(localCopy)) { + // result should not be cached, even on proxies + httpApplication.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1)); + httpApplication.Response.Cache.SetValidUntilExpires(false); + httpApplication.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches); + httpApplication.Response.Cache.SetCacheability(HttpCacheability.NoCache); + httpApplication.Response.Cache.SetNoStore(); + + httpApplication.Response.WriteFile(localCopy); + httpApplication.Response.End(); + return true; + } + + // there is no local copy and the file exists + // serve the static file + if (File.Exists(httpApplication.Request.PhysicalPath)) { + return true; + } + + return false; + } + + public static string ToUrlString(HttpRequest request) { + return string.Format("{0}://{1}{2}", request.Url.Scheme, request.Headers["Host"], request.RawUrl); + } + + public static string EncodeUrl(string url) { + if (String.IsNullOrWhiteSpace(url)) { + throw new ArgumentException("url can't be empty"); + } + + var sb = new StringBuilder(); + foreach (var c in url.ToLowerInvariant()) { + // only accept alphanumeric chars + if ((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9')) { + sb.Append(c); + } + // otherwise encode them in UTF8 + else { + sb.Append("_"); + foreach (var b in Encoding.UTF8.GetBytes(new[] { c })) { + sb.Append(b.ToString("X")); + } + } + } + + return sb.ToString(); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web.Tests/Orchard.Web.Tests.csproj b/src/Orchard.Web.Tests/Orchard.Web.Tests.csproj index 84a3d14fa68..0203e18a002 100644 --- a/src/Orchard.Web.Tests/Orchard.Web.Tests.csproj +++ b/src/Orchard.Web.Tests/Orchard.Web.Tests.csproj @@ -1,129 +1,129 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F112851D-B023-4746-B6B1-8D2E5AD8F7AA} - Library - Properties - Orchard.Web.Tests - Orchard.Web.Tests - v4.5.1 - 512 - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - ..\OrchardBasicCorrectness.ruleset - AnyCPU - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - false - - - - False - ..\..\lib\autofac\Autofac.dll - - - False - ..\..\lib\autofac\Autofac.Integration.Web.dll - - - False - ..\..\lib\nunit\nunit.framework.dll - - - - - 3.5 - - - - - False - ..\..\lib\aspnetmvc\System.Web.Mvc.dll - - - - - - - - - - - - - {50B779EA-EC00-4699-84C0-03B395C365D2} - Orchard.Web - - - {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} - Orchard.Framework - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {F112851D-B023-4746-B6B1-8D2E5AD8F7AA} + Library + Properties + Orchard.Web.Tests + Orchard.Web.Tests + v4.5.1 + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + ..\OrchardBasicCorrectness.ruleset + AnyCPU + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + false + + + + False + ..\..\lib\autofac\Autofac.dll + + + False + ..\..\lib\autofac\Autofac.Integration.Web.dll + + + False + ..\..\lib\nunit\nunit.framework.dll + + + + + 3.5 + + + + + False + ..\..\lib\aspnetmvc\System.Web.Mvc.dll + + + + + + + + + + + + + {50B779EA-EC00-4699-84C0-03B395C365D2} + Orchard.Web + + + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} + Orchard.Framework + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Web.Tests/Properties/AssemblyInfo.cs b/src/Orchard.Web.Tests/Properties/AssemblyInfo.cs index 0338f1a5bbc..ef5e5f89b78 100644 --- a/src/Orchard.Web.Tests/Properties/AssemblyInfo.cs +++ b/src/Orchard.Web.Tests/Properties/AssemblyInfo.cs @@ -1,37 +1,37 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. - -[assembly: AssemblyTitle("Orchard.Web.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyProduct("Orchard")] -[assembly: AssemblyCopyright("Copyright © .NET Foundation")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. - -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM - -[assembly: Guid("3a698957-646d-476c-90e8-47553fec9203")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.9.2")] -[assembly: AssemblyFileVersion("1.9.2")] +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. + +[assembly: AssemblyTitle("Orchard.Web.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyProduct("Orchard")] +[assembly: AssemblyCopyright("Copyright © .NET Foundation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. + +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM + +[assembly: Guid("3a698957-646d-476c-90e8-47553fec9203")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.9.2")] +[assembly: AssemblyFileVersion("1.9.2")] diff --git a/src/Orchard.Web.Tests/Routes/RouteTests.cs b/src/Orchard.Web.Tests/Routes/RouteTests.cs index f14bc4a87c1..484feb40114 100644 --- a/src/Orchard.Web.Tests/Routes/RouteTests.cs +++ b/src/Orchard.Web.Tests/Routes/RouteTests.cs @@ -1,37 +1,37 @@ -using System.Web.Routing; -using NUnit.Framework; -using Orchard.Web.Tests.Stubs; - -namespace Orchard.Web.Tests.Routes { - [TestFixture] - public class RouteTests { - [Test] - public void RouteForEmbeddedResource() { - // Arrange - var context = new StubContext("~/foo.axd/bar/baz/biff"); - var routes = new RouteCollection(); - MvcApplication.RegisterRoutes(routes); - - // Act - var routeData = routes.GetRouteData(context); - - // Assert - Assert.That(routeData, Is.Not.Null); - Assert.That(routeData.RouteHandler, Is.TypeOf()); - } - - [Test] - public void RouteWithTooManySegments() { - // Arrange - var context = new StubContext("~/a/b/c/d"); - var routes = new RouteCollection(); - MvcApplication.RegisterRoutes(routes); - - // Act - var routeData = routes.GetRouteData(context); - - // Assert - Assert.That(routeData, Is.Null); - } - } +using System.Web.Routing; +using NUnit.Framework; +using Orchard.Web.Tests.Stubs; + +namespace Orchard.Web.Tests.Routes { + [TestFixture] + public class RouteTests { + [Test] + public void RouteForEmbeddedResource() { + // Arrange + var context = new StubContext("~/foo.axd/bar/baz/biff"); + var routes = new RouteCollection(); + MvcApplication.RegisterRoutes(routes); + + // Act + var routeData = routes.GetRouteData(context); + + // Assert + Assert.That(routeData, Is.Not.Null); + Assert.That(routeData.RouteHandler, Is.TypeOf()); + } + + [Test] + public void RouteWithTooManySegments() { + // Arrange + var context = new StubContext("~/a/b/c/d"); + var routes = new RouteCollection(); + MvcApplication.RegisterRoutes(routes); + + // Act + var routeData = routes.GetRouteData(context); + + // Assert + Assert.That(routeData, Is.Null); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web.Tests/Stubs/StubContext.cs b/src/Orchard.Web.Tests/Stubs/StubContext.cs index fc8241333a9..3a1a869c4c6 100644 --- a/src/Orchard.Web.Tests/Stubs/StubContext.cs +++ b/src/Orchard.Web.Tests/Stubs/StubContext.cs @@ -1,15 +1,15 @@ -using System.Web; - -namespace Orchard.Web.Tests.Stubs { - internal class StubContext : HttpContextBase { - private readonly StubRequest request; - - public StubContext(string relativeUrl) { - request = new StubRequest(relativeUrl); - } - - public override HttpRequestBase Request { - get { return request; } - } - } +using System.Web; + +namespace Orchard.Web.Tests.Stubs { + internal class StubContext : HttpContextBase { + private readonly StubRequest request; + + public StubContext(string relativeUrl) { + request = new StubRequest(relativeUrl); + } + + public override HttpRequestBase Request { + get { return request; } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web.Tests/Stubs/StubRequest.cs b/src/Orchard.Web.Tests/Stubs/StubRequest.cs index 8bd72169bde..f00d3acfbe8 100644 --- a/src/Orchard.Web.Tests/Stubs/StubRequest.cs +++ b/src/Orchard.Web.Tests/Stubs/StubRequest.cs @@ -1,19 +1,19 @@ -using System.Web; - -namespace Orchard.Web.Tests.Stubs { - public class StubRequest : HttpRequestBase { - private readonly string relativeUrl; - - public StubRequest(string relativeUrl) { - this.relativeUrl = relativeUrl; - } - - public override string AppRelativeCurrentExecutionFilePath { - get { return relativeUrl; } - } - - public override string PathInfo { - get { return ""; } - } - } +using System.Web; + +namespace Orchard.Web.Tests.Stubs { + public class StubRequest : HttpRequestBase { + private readonly string relativeUrl; + + public StubRequest(string relativeUrl) { + this.relativeUrl = relativeUrl; + } + + public override string AppRelativeCurrentExecutionFilePath { + get { return relativeUrl; } + } + + public override string PathInfo { + get { return ""; } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Config/Host.config b/src/Orchard.Web/Config/Host.config index 9e6b2d11921..4aa6c2b81b6 100644 --- a/src/Orchard.Web/Config/Host.config +++ b/src/Orchard.Web/Config/Host.config @@ -1,15 +1,15 @@ - - - - -
      - - - - - - - - - + + + + +
      + + + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Web/Config/HostComponents.Debug.config b/src/Orchard.Web/Config/HostComponents.Debug.config index a2c269e14f8..f90930c7796 100644 --- a/src/Orchard.Web/Config/HostComponents.Debug.config +++ b/src/Orchard.Web/Config/HostComponents.Debug.config @@ -1,4 +1,4 @@ - - - + + + \ No newline at end of file diff --git a/src/Orchard.Web/Config/HostComponents.Release.config b/src/Orchard.Web/Config/HostComponents.Release.config index 17dbc5a2798..0d807cd92b7 100644 --- a/src/Orchard.Web/Config/HostComponents.Release.config +++ b/src/Orchard.Web/Config/HostComponents.Release.config @@ -1,12 +1,12 @@ - - - - - - - - - - - + + + + + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Web/Config/HostComponents.config b/src/Orchard.Web/Config/HostComponents.config index dd1a321d656..01038d9c4b3 100644 --- a/src/Orchard.Web/Config/HostComponents.config +++ b/src/Orchard.Web/Config/HostComponents.config @@ -1,110 +1,110 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Config/log4net.Debug.config b/src/Orchard.Web/Config/log4net.Debug.config index 49bc2c5d2c2..080ce9ef2ef 100644 --- a/src/Orchard.Web/Config/log4net.Debug.config +++ b/src/Orchard.Web/Config/log4net.Debug.config @@ -1,4 +1,4 @@ - - - + + + \ No newline at end of file diff --git a/src/Orchard.Web/Config/log4net.Release.config b/src/Orchard.Web/Config/log4net.Release.config index 689a1c5ddd4..e47fbf40c73 100644 --- a/src/Orchard.Web/Config/log4net.Release.config +++ b/src/Orchard.Web/Config/log4net.Release.config @@ -1,21 +1,21 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Web/Config/log4net.config b/src/Orchard.Web/Config/log4net.config index 9f328144e65..35940a131a6 100644 --- a/src/Orchard.Web/Config/log4net.config +++ b/src/Orchard.Web/Config/log4net.config @@ -1,88 +1,88 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Common/Controllers/ErrorController.cs b/src/Orchard.Web/Core/Common/Controllers/ErrorController.cs index 1f98a1c03f2..47d8bc75e71 100644 --- a/src/Orchard.Web/Core/Common/Controllers/ErrorController.cs +++ b/src/Orchard.Web/Core/Common/Controllers/ErrorController.cs @@ -1,12 +1,12 @@ -using System.Web.Mvc; -using Orchard.Themes; - -namespace Orchard.Core.Common.Controllers { - [Themed] - public class ErrorController : Controller { - - public ActionResult NotFound(string url) { - return HttpNotFound(); - } - } +using System.Web.Mvc; +using Orchard.Themes; + +namespace Orchard.Core.Common.Controllers { + [Themed] + public class ErrorController : Controller { + + public ActionResult NotFound(string url) { + return HttpNotFound(); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/DateEditor/DateEditorDriver.cs b/src/Orchard.Web/Core/Common/DateEditor/DateEditorDriver.cs index 946128be58d..494146c761e 100644 --- a/src/Orchard.Web/Core/Common/DateEditor/DateEditorDriver.cs +++ b/src/Orchard.Web/Core/Common/DateEditor/DateEditorDriver.cs @@ -1,96 +1,96 @@ -using System; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Drivers; -using Orchard.Core.Common.Models; -using Orchard.Core.Common.Utilities; -using Orchard.Core.Common.ViewModels; -using Orchard.Localization; -using Orchard.Localization.Services; - -namespace Orchard.Core.Common.DateEditor { - public class DateEditorDriver : ContentPartDriver { - private readonly IDateLocalizationServices _dateLocalizationServices; - - public DateEditorDriver( - IOrchardServices services, - IDateLocalizationServices dateLocalizationServices) { - _dateLocalizationServices = dateLocalizationServices; - T = NullLocalizer.Instance; - Services = services; - } - - public Localizer T { get; set; } - public IOrchardServices Services { get; set; } - - protected override string Prefix { - get { return ""; } - } - - protected override DriverResult Editor(CommonPart part, dynamic shapeHelper) { - return Editor(part, null, shapeHelper); - } - - protected override DriverResult Editor(CommonPart part, IUpdateModel updater, dynamic shapeHelper) { - var settings = part.TypePartDefinition.Settings.GetModel(); - if (!settings.ShowDateEditor) { - return null; - } - - return ContentShape( - "Parts_Common_Date_Edit", - () => { - DateEditorViewModel model = shapeHelper.Parts_Common_Date_Edit(typeof(DateEditorViewModel)); - - model.Editor = new DateTimeEditor() { - ShowDate = true, - ShowTime = true - }; - - if (part.CreatedUtc != null) { - // show CreatedUtc only if is has been "touched", - // i.e. it has been published once, or CreatedUtc has been set - - var itemHasNeverBeenPublished = part.PublishedUtc == null; - var thisIsTheInitialVersionRecord = part.ContentItem.Version < 2; - - // Dates are assumed the same if the millisecond part is the only difference. - // This is because SqlCe doesn't support high precision times (Datetime2) and the infoset does - // implying some discrepancies between values read from different storage mechanism. - var theDatesHaveNotBeenModified = DateUtils.DatesAreEquivalent(part.CreatedUtc, part.VersionCreatedUtc); - - var theEditorShouldBeBlank = - itemHasNeverBeenPublished && - thisIsTheInitialVersionRecord && - theDatesHaveNotBeenModified; - - if (!theEditorShouldBeBlank) { - model.Editor.Date = _dateLocalizationServices.ConvertToLocalizedDateString(part.CreatedUtc); - model.Editor.Time = _dateLocalizationServices.ConvertToLocalizedTimeString(part.CreatedUtc); - } - } - - if (updater != null) { - updater.TryUpdateModel(model, Prefix, null, null); - - if (!String.IsNullOrWhiteSpace(model.Editor.Date) && !String.IsNullOrWhiteSpace(model.Editor.Time)) { - try { - var utcDateTime = _dateLocalizationServices.ConvertFromLocalizedString(model.Editor.Date, model.Editor.Time); - part.CreatedUtc = utcDateTime; - } - catch (FormatException) { - updater.AddModelError(Prefix, T("'{0} {1}' could not be parsed as a valid date and time.", model.Editor.Date, model.Editor.Time)); - } - } - else if (!String.IsNullOrWhiteSpace(model.Editor.Date) || !String.IsNullOrWhiteSpace(model.Editor.Time)) { - updater.AddModelError(Prefix, T("Both the date and time need to be specified.")); - } - - // Neither date/time part is specified => do nothing. - } - - return model; - }); - } - - } +using System; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Drivers; +using Orchard.Core.Common.Models; +using Orchard.Core.Common.Utilities; +using Orchard.Core.Common.ViewModels; +using Orchard.Localization; +using Orchard.Localization.Services; + +namespace Orchard.Core.Common.DateEditor { + public class DateEditorDriver : ContentPartDriver { + private readonly IDateLocalizationServices _dateLocalizationServices; + + public DateEditorDriver( + IOrchardServices services, + IDateLocalizationServices dateLocalizationServices) { + _dateLocalizationServices = dateLocalizationServices; + T = NullLocalizer.Instance; + Services = services; + } + + public Localizer T { get; set; } + public IOrchardServices Services { get; set; } + + protected override string Prefix { + get { return ""; } + } + + protected override DriverResult Editor(CommonPart part, dynamic shapeHelper) { + return Editor(part, null, shapeHelper); + } + + protected override DriverResult Editor(CommonPart part, IUpdateModel updater, dynamic shapeHelper) { + var settings = part.TypePartDefinition.Settings.GetModel(); + if (!settings.ShowDateEditor) { + return null; + } + + return ContentShape( + "Parts_Common_Date_Edit", + () => { + DateEditorViewModel model = shapeHelper.Parts_Common_Date_Edit(typeof(DateEditorViewModel)); + + model.Editor = new DateTimeEditor() { + ShowDate = true, + ShowTime = true + }; + + if (part.CreatedUtc != null) { + // show CreatedUtc only if is has been "touched", + // i.e. it has been published once, or CreatedUtc has been set + + var itemHasNeverBeenPublished = part.PublishedUtc == null; + var thisIsTheInitialVersionRecord = part.ContentItem.Version < 2; + + // Dates are assumed the same if the millisecond part is the only difference. + // This is because SqlCe doesn't support high precision times (Datetime2) and the infoset does + // implying some discrepancies between values read from different storage mechanism. + var theDatesHaveNotBeenModified = DateUtils.DatesAreEquivalent(part.CreatedUtc, part.VersionCreatedUtc); + + var theEditorShouldBeBlank = + itemHasNeverBeenPublished && + thisIsTheInitialVersionRecord && + theDatesHaveNotBeenModified; + + if (!theEditorShouldBeBlank) { + model.Editor.Date = _dateLocalizationServices.ConvertToLocalizedDateString(part.CreatedUtc); + model.Editor.Time = _dateLocalizationServices.ConvertToLocalizedTimeString(part.CreatedUtc); + } + } + + if (updater != null) { + updater.TryUpdateModel(model, Prefix, null, null); + + if (!String.IsNullOrWhiteSpace(model.Editor.Date) && !String.IsNullOrWhiteSpace(model.Editor.Time)) { + try { + var utcDateTime = _dateLocalizationServices.ConvertFromLocalizedString(model.Editor.Date, model.Editor.Time); + part.CreatedUtc = utcDateTime; + } + catch (FormatException) { + updater.AddModelError(Prefix, T("'{0} {1}' could not be parsed as a valid date and time.", model.Editor.Date, model.Editor.Time)); + } + } + else if (!String.IsNullOrWhiteSpace(model.Editor.Date) || !String.IsNullOrWhiteSpace(model.Editor.Time)) { + updater.AddModelError(Prefix, T("Both the date and time need to be specified.")); + } + + // Neither date/time part is specified => do nothing. + } + + return model; + }); + } + + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/DateEditor/DateEditorHandler.cs b/src/Orchard.Web/Core/Common/DateEditor/DateEditorHandler.cs index bc5480fd2b5..cd82e48366a 100644 --- a/src/Orchard.Web/Core/Common/DateEditor/DateEditorHandler.cs +++ b/src/Orchard.Web/Core/Common/DateEditor/DateEditorHandler.cs @@ -1,27 +1,27 @@ -using JetBrains.Annotations; -using Orchard.Core.Common.Models; -using Orchard.ContentManagement.Handlers; -using Orchard.Core.Common.Utilities; - -namespace Orchard.Core.Common.DateEditor { - [UsedImplicitly] - public class DateEditorHandler : ContentHandler { - public DateEditorHandler() { - OnPublished((context, part) => { - var settings = part.TypePartDefinition.Settings.GetModel(); - if (!settings.ShowDateEditor) { - return; - } - - var thisIsTheInitialVersionRecord = part.ContentItem.Version < 2; - var theDatesHaveNotBeenModified = DateUtils.DatesAreEquivalent(part.CreatedUtc, part.VersionCreatedUtc); - var theContentDateShouldBeUpdated = thisIsTheInitialVersionRecord && theDatesHaveNotBeenModified; - - if (theContentDateShouldBeUpdated) { - // "touch" CreatedUtc in ContentItemRecord - part.CreatedUtc = part.PublishedUtc; - } - }); - } - } -} +using JetBrains.Annotations; +using Orchard.Core.Common.Models; +using Orchard.ContentManagement.Handlers; +using Orchard.Core.Common.Utilities; + +namespace Orchard.Core.Common.DateEditor { + [UsedImplicitly] + public class DateEditorHandler : ContentHandler { + public DateEditorHandler() { + OnPublished((context, part) => { + var settings = part.TypePartDefinition.Settings.GetModel(); + if (!settings.ShowDateEditor) { + return; + } + + var thisIsTheInitialVersionRecord = part.ContentItem.Version < 2; + var theDatesHaveNotBeenModified = DateUtils.DatesAreEquivalent(part.CreatedUtc, part.VersionCreatedUtc); + var theContentDateShouldBeUpdated = thisIsTheInitialVersionRecord && theDatesHaveNotBeenModified; + + if (theContentDateShouldBeUpdated) { + // "touch" CreatedUtc in ContentItemRecord + part.CreatedUtc = part.PublishedUtc; + } + }); + } + } +} diff --git a/src/Orchard.Web/Core/Common/DateEditor/DateEditorSettings.cs b/src/Orchard.Web/Core/Common/DateEditor/DateEditorSettings.cs index 156e57fc6db..679a2166db2 100644 --- a/src/Orchard.Web/Core/Common/DateEditor/DateEditorSettings.cs +++ b/src/Orchard.Web/Core/Common/DateEditor/DateEditorSettings.cs @@ -1,31 +1,31 @@ -using System.Collections.Generic; -using Orchard.ContentManagement; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.MetaData.Builders; -using Orchard.ContentManagement.MetaData.Models; -using Orchard.ContentManagement.ViewModels; - -namespace Orchard.Core.Common.DateEditor { - public class DateEditorSettings { - public bool ShowDateEditor { get; set; } - } - - public class DateEditorSettingsEvents : ContentDefinitionEditorEventsBase { - public override IEnumerable TypePartEditor(ContentTypePartDefinition definition) { - if (definition.PartDefinition.Name == "CommonPart") { - var model = definition.Settings.GetModel(); - yield return DefinitionTemplate(model); - } - } - - public override IEnumerable TypePartEditorUpdate(ContentTypePartDefinitionBuilder builder, IUpdateModel updateModel) { - if (builder.Name == "CommonPart") { - var model = new DateEditorSettings(); - if (updateModel.TryUpdateModel(model, "DateEditorSettings", null, null)) { - builder.WithSetting("DateEditorSettings.ShowDateEditor", model.ShowDateEditor.ToString()); - } - yield return DefinitionTemplate(model); - } - } - } +using System.Collections.Generic; +using Orchard.ContentManagement; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Builders; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.ContentManagement.ViewModels; + +namespace Orchard.Core.Common.DateEditor { + public class DateEditorSettings { + public bool ShowDateEditor { get; set; } + } + + public class DateEditorSettingsEvents : ContentDefinitionEditorEventsBase { + public override IEnumerable TypePartEditor(ContentTypePartDefinition definition) { + if (definition.PartDefinition.Name == "CommonPart") { + var model = definition.Settings.GetModel(); + yield return DefinitionTemplate(model); + } + } + + public override IEnumerable TypePartEditorUpdate(ContentTypePartDefinitionBuilder builder, IUpdateModel updateModel) { + if (builder.Name == "CommonPart") { + var model = new DateEditorSettings(); + if (updateModel.TryUpdateModel(model, "DateEditorSettings", null, null)) { + builder.WithSetting("DateEditorSettings.ShowDateEditor", model.ShowDateEditor.ToString()); + } + yield return DefinitionTemplate(model); + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/DateEditor/DateEditorViewModel.cs b/src/Orchard.Web/Core/Common/DateEditor/DateEditorViewModel.cs index 2267ab8b13a..a0a54ca1912 100644 --- a/src/Orchard.Web/Core/Common/DateEditor/DateEditorViewModel.cs +++ b/src/Orchard.Web/Core/Common/DateEditor/DateEditorViewModel.cs @@ -1,8 +1,8 @@ -using Orchard.Core.Common.ViewModels; -using Orchard.DisplayManagement.Shapes; - -namespace Orchard.Core.Common.DateEditor { - public class DateEditorViewModel : Shape { - public virtual DateTimeEditor Editor { get; set; } - } +using Orchard.Core.Common.ViewModels; +using Orchard.DisplayManagement.Shapes; + +namespace Orchard.Core.Common.DateEditor { + public class DateEditorViewModel : Shape { + public virtual DateTimeEditor Editor { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs b/src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs index b5da9a3032f..689a65e5ec6 100644 --- a/src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs +++ b/src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs @@ -1,140 +1,140 @@ -using System.Collections.Generic; -using System.Linq; -using System.Web; -using JetBrains.Annotations; -using Orchard.Mvc.Html; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Aspects; -using Orchard.ContentManagement.Drivers; -using Orchard.Core.Common.Models; -using Orchard.Core.Common.Settings; -using Orchard.Core.Common.ViewModels; -using Orchard.Services; -using System.Web.Mvc; -using System.Web.Routing; - -namespace Orchard.Core.Common.Drivers { - [UsedImplicitly] - public class BodyPartDriver : ContentPartDriver { - private readonly IEnumerable _htmlFilters; - private readonly RequestContext _requestContext; - - private const string TemplateName = "Parts.Common.Body"; - - public BodyPartDriver(IOrchardServices services, IEnumerable htmlFilters, RequestContext requestContext) { - _htmlFilters = htmlFilters; - Services = services; - _requestContext = requestContext; - } - - public IOrchardServices Services { get; set; } - - protected override string Prefix { - get { return "Body"; } - } - - protected override DriverResult Display(BodyPart part, string displayType, dynamic shapeHelper) { - return Combined( - ContentShape("Parts_Common_Body", - () => { - var bodyText = _htmlFilters.Aggregate(part.Text, (text, filter) => filter.ProcessContent(text, GetFlavor(part))); - return shapeHelper.Parts_Common_Body(Html: new HtmlString(bodyText)); - }), - ContentShape("Parts_Common_Body_Summary", - () => { - var bodyText = _htmlFilters.Aggregate(part.Text, (text, filter) => filter.ProcessContent(text, GetFlavor(part))); - return shapeHelper.Parts_Common_Body_Summary(Html: new HtmlString(bodyText)); - }) - ); - } - - protected override DriverResult Editor(BodyPart part, dynamic shapeHelper) { - var model = BuildEditorViewModel(part,_requestContext); - return ContentShape("Parts_Common_Body_Edit", - () => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix)); - } - - protected override DriverResult Editor(BodyPart part, IUpdateModel updater, dynamic shapeHelper) { - var model = BuildEditorViewModel(part, _requestContext); - updater.TryUpdateModel(model, Prefix, null, null); - - return ContentShape("Parts_Common_Body_Edit", - () => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix)); - } - - protected override void Importing(BodyPart part, ContentManagement.Handlers.ImportContentContext context) { - // Don't do anything if the tag is not specified. - if (context.Data.Element(part.PartDefinition.Name) == null) { - return; - } - - context.ImportAttribute(part.PartDefinition.Name, "Text", importedText => - part.Text = importedText - ); - } - - protected override void Exporting(BodyPart part, ContentManagement.Handlers.ExportContentContext context) { - context.Element(part.PartDefinition.Name).SetAttributeValue("Text", part.Text); - } - - private static BodyEditorViewModel BuildEditorViewModel(BodyPart part,RequestContext requestContext) { - return new BodyEditorViewModel { - BodyPart = part, - EditorFlavor = GetFlavor(part), - AddMediaPath = new PathBuilder(part,requestContext).AddContentType().AddContainerSlug().ToString() - }; - } - - private static string GetFlavor(BodyPart part) { - var typePartSettings = part.Settings.GetModel(); - return (typePartSettings != null && !string.IsNullOrWhiteSpace(typePartSettings.Flavor)) - ? typePartSettings.Flavor - : part.PartDefinition.Settings.GetModel().FlavorDefault; - } - - class PathBuilder { - private readonly IContent _content; - private string _path; - private readonly RequestContext _requestContext; - - public PathBuilder(IContent content,RequestContext requestContext) { - _content = content; - _path = ""; - _requestContext = requestContext; - } - - public override string ToString() { - return _path; - } - - public PathBuilder AddContentType() { - Add(_content.ContentItem.ContentType); - return this; - } - - public PathBuilder AddContainerSlug() { - var common = _content.As(); - if (common == null || common.Container==null) - return this; - var helper = new UrlHelper(_requestContext); - Add(helper.ItemDisplayUrl(common.Container)); - return this; - } - - private void Add(string segment) { - if (string.IsNullOrEmpty(segment)) - return; - - if (string.IsNullOrEmpty(_path)) { - _path = segment; - } - else if (segment.StartsWith("/")) { - _path = _path + segment; - } - else { - _path = _path + "/" + segment; - } - } - } - } +using System.Collections.Generic; +using System.Linq; +using System.Web; +using JetBrains.Annotations; +using Orchard.Mvc.Html; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Aspects; +using Orchard.ContentManagement.Drivers; +using Orchard.Core.Common.Models; +using Orchard.Core.Common.Settings; +using Orchard.Core.Common.ViewModels; +using Orchard.Services; +using System.Web.Mvc; +using System.Web.Routing; + +namespace Orchard.Core.Common.Drivers { + [UsedImplicitly] + public class BodyPartDriver : ContentPartDriver { + private readonly IEnumerable _htmlFilters; + private readonly RequestContext _requestContext; + + private const string TemplateName = "Parts.Common.Body"; + + public BodyPartDriver(IOrchardServices services, IEnumerable htmlFilters, RequestContext requestContext) { + _htmlFilters = htmlFilters; + Services = services; + _requestContext = requestContext; + } + + public IOrchardServices Services { get; set; } + + protected override string Prefix { + get { return "Body"; } + } + + protected override DriverResult Display(BodyPart part, string displayType, dynamic shapeHelper) { + return Combined( + ContentShape("Parts_Common_Body", + () => { + var bodyText = _htmlFilters.Aggregate(part.Text, (text, filter) => filter.ProcessContent(text, GetFlavor(part))); + return shapeHelper.Parts_Common_Body(Html: new HtmlString(bodyText)); + }), + ContentShape("Parts_Common_Body_Summary", + () => { + var bodyText = _htmlFilters.Aggregate(part.Text, (text, filter) => filter.ProcessContent(text, GetFlavor(part))); + return shapeHelper.Parts_Common_Body_Summary(Html: new HtmlString(bodyText)); + }) + ); + } + + protected override DriverResult Editor(BodyPart part, dynamic shapeHelper) { + var model = BuildEditorViewModel(part,_requestContext); + return ContentShape("Parts_Common_Body_Edit", + () => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix)); + } + + protected override DriverResult Editor(BodyPart part, IUpdateModel updater, dynamic shapeHelper) { + var model = BuildEditorViewModel(part, _requestContext); + updater.TryUpdateModel(model, Prefix, null, null); + + return ContentShape("Parts_Common_Body_Edit", + () => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix)); + } + + protected override void Importing(BodyPart part, ContentManagement.Handlers.ImportContentContext context) { + // Don't do anything if the tag is not specified. + if (context.Data.Element(part.PartDefinition.Name) == null) { + return; + } + + context.ImportAttribute(part.PartDefinition.Name, "Text", importedText => + part.Text = importedText + ); + } + + protected override void Exporting(BodyPart part, ContentManagement.Handlers.ExportContentContext context) { + context.Element(part.PartDefinition.Name).SetAttributeValue("Text", part.Text); + } + + private static BodyEditorViewModel BuildEditorViewModel(BodyPart part,RequestContext requestContext) { + return new BodyEditorViewModel { + BodyPart = part, + EditorFlavor = GetFlavor(part), + AddMediaPath = new PathBuilder(part,requestContext).AddContentType().AddContainerSlug().ToString() + }; + } + + private static string GetFlavor(BodyPart part) { + var typePartSettings = part.Settings.GetModel(); + return (typePartSettings != null && !string.IsNullOrWhiteSpace(typePartSettings.Flavor)) + ? typePartSettings.Flavor + : part.PartDefinition.Settings.GetModel().FlavorDefault; + } + + class PathBuilder { + private readonly IContent _content; + private string _path; + private readonly RequestContext _requestContext; + + public PathBuilder(IContent content,RequestContext requestContext) { + _content = content; + _path = ""; + _requestContext = requestContext; + } + + public override string ToString() { + return _path; + } + + public PathBuilder AddContentType() { + Add(_content.ContentItem.ContentType); + return this; + } + + public PathBuilder AddContainerSlug() { + var common = _content.As(); + if (common == null || common.Container==null) + return this; + var helper = new UrlHelper(_requestContext); + Add(helper.ItemDisplayUrl(common.Container)); + return this; + } + + private void Add(string segment) { + if (string.IsNullOrEmpty(segment)) + return; + + if (string.IsNullOrEmpty(_path)) { + _path = segment; + } + else if (segment.StartsWith("/")) { + _path = _path + segment; + } + else { + _path = _path + "/" + segment; + } + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Drivers/CommonPartDriver.cs b/src/Orchard.Web/Core/Common/Drivers/CommonPartDriver.cs index 5d9f97a42b1..28bdf78c70a 100644 --- a/src/Orchard.Web/Core/Common/Drivers/CommonPartDriver.cs +++ b/src/Orchard.Web/Core/Common/Drivers/CommonPartDriver.cs @@ -1,127 +1,127 @@ -using System.Xml; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Drivers; -using Orchard.ContentManagement.Handlers; -using Orchard.Core.Common.Models; -using Orchard.Core.Common.ViewModels; -using Orchard.Localization; -using Orchard.Security; - -namespace Orchard.Core.Common.Drivers { - public class CommonPartDriver : ContentPartDriver { - private readonly IContentManager _contentManager; - private readonly IMembershipService _membershipService; - - public CommonPartDriver( - IOrchardServices services, - IContentManager contentManager, - IMembershipService membershipService) { - _contentManager = contentManager; - _membershipService = membershipService; - T = NullLocalizer.Instance; - Services = services; - } - - public Localizer T { get; set; } - public IOrchardServices Services { get; set; } - - protected override string Prefix { - get { return "CommonPart"; } - } - - protected override DriverResult Display(CommonPart part, string displayType, dynamic shapeHelper) { - return Combined( - ContentShape("Parts_Common_Metadata", - () => shapeHelper.Parts_Common_Metadata()), - ContentShape("Parts_Common_Metadata_Summary", - () => shapeHelper.Parts_Common_Metadata_Summary()), - ContentShape("Parts_Common_Metadata_SummaryAdmin", - () => shapeHelper.Parts_Common_Metadata_SummaryAdmin()) - ); - } - - protected override DriverResult Editor(CommonPart part, dynamic shapeHelper) { - return Editor(part, null, shapeHelper); - } - - protected override DriverResult Editor(CommonPart part, IUpdateModel updater, dynamic shapeHelper) { - var model = new ContainerEditorViewModel(); - if (part.Container != null) - model.ContainerId = part.Container.ContentItem.Id; - - if (updater != null) { - var priorContainerId = model.ContainerId; - updater.TryUpdateModel(model, Prefix, null, null); - - if (model.ContainerId != null && model.ContainerId != priorContainerId) { - var newContainer = _contentManager.Get((int)model.ContainerId, VersionOptions.Latest); - if (newContainer == null) { - updater.AddModelError("CommonPart.ContainerId", T("Invalid container")); - } else { - part.Container = newContainer; - } - } - } - - return ContentShape("Parts_Common_Container_Edit", - () => shapeHelper.EditorTemplate(TemplateName: "Parts.Common.Container", Model: model, Prefix: Prefix)); - } - - protected override void Importing(CommonPart part, ImportContentContext context) { - // Don't do anything if the tag is not specified. - if (context.Data.Element(part.PartDefinition.Name) == null) { - return; - } - - context.ImportAttribute(part.PartDefinition.Name, "Owner", owner => { - var contentIdentity = new ContentIdentity(owner); - - // use the super user if the referenced one doesn't exist; - part.Owner = - _membershipService.GetUser(contentIdentity.Get("User.UserName")) - ?? _membershipService.GetUser(Services.WorkContext.CurrentSite.SuperUser); - }); - - context.ImportAttribute(part.PartDefinition.Name, "Container", container => - part.Container = context.GetItemFromSession(container) - ); - - context.ImportAttribute(part.PartDefinition.Name, "CreatedUtc", createdUtc => - part.CreatedUtc = XmlConvert.ToDateTime(createdUtc, XmlDateTimeSerializationMode.Utc) - ); - - context.ImportAttribute(part.PartDefinition.Name, "PublishedUtc", publishedUtc => - part.PublishedUtc = XmlConvert.ToDateTime(publishedUtc, XmlDateTimeSerializationMode.Utc) - ); - - context.ImportAttribute(part.PartDefinition.Name, "ModifiedUtc", modifiedUtc => - part.ModifiedUtc = XmlConvert.ToDateTime(modifiedUtc, XmlDateTimeSerializationMode.Utc) - ); - } - - protected override void Exporting(CommonPart part, ExportContentContext context) { - if (part.Owner != null) { - var ownerIdentity = _contentManager.GetItemMetadata(part.Owner).Identity; - context.Element(part.PartDefinition.Name).SetAttributeValue("Owner", ownerIdentity.ToString()); - } - - if (part.Container != null) { - var containerIdentity = _contentManager.GetItemMetadata(part.Container).Identity; - context.Element(part.PartDefinition.Name).SetAttributeValue("Container", containerIdentity.ToString()); - } - - if (part.CreatedUtc != null) { - context.Element(part.PartDefinition.Name) - .SetAttributeValue("CreatedUtc", XmlConvert.ToString(part.CreatedUtc.Value, XmlDateTimeSerializationMode.Utc)); - } - if (part.PublishedUtc != null) { - context.Element(part.PartDefinition.Name) - .SetAttributeValue("PublishedUtc", XmlConvert.ToString(part.PublishedUtc.Value, XmlDateTimeSerializationMode.Utc)); - } - if (part.ModifiedUtc != null) { - context.Element(part.PartDefinition.Name) - .SetAttributeValue("ModifiedUtc", XmlConvert.ToString(part.ModifiedUtc.Value, XmlDateTimeSerializationMode.Utc)); - } - } - } +using System.Xml; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Drivers; +using Orchard.ContentManagement.Handlers; +using Orchard.Core.Common.Models; +using Orchard.Core.Common.ViewModels; +using Orchard.Localization; +using Orchard.Security; + +namespace Orchard.Core.Common.Drivers { + public class CommonPartDriver : ContentPartDriver { + private readonly IContentManager _contentManager; + private readonly IMembershipService _membershipService; + + public CommonPartDriver( + IOrchardServices services, + IContentManager contentManager, + IMembershipService membershipService) { + _contentManager = contentManager; + _membershipService = membershipService; + T = NullLocalizer.Instance; + Services = services; + } + + public Localizer T { get; set; } + public IOrchardServices Services { get; set; } + + protected override string Prefix { + get { return "CommonPart"; } + } + + protected override DriverResult Display(CommonPart part, string displayType, dynamic shapeHelper) { + return Combined( + ContentShape("Parts_Common_Metadata", + () => shapeHelper.Parts_Common_Metadata()), + ContentShape("Parts_Common_Metadata_Summary", + () => shapeHelper.Parts_Common_Metadata_Summary()), + ContentShape("Parts_Common_Metadata_SummaryAdmin", + () => shapeHelper.Parts_Common_Metadata_SummaryAdmin()) + ); + } + + protected override DriverResult Editor(CommonPart part, dynamic shapeHelper) { + return Editor(part, null, shapeHelper); + } + + protected override DriverResult Editor(CommonPart part, IUpdateModel updater, dynamic shapeHelper) { + var model = new ContainerEditorViewModel(); + if (part.Container != null) + model.ContainerId = part.Container.ContentItem.Id; + + if (updater != null) { + var priorContainerId = model.ContainerId; + updater.TryUpdateModel(model, Prefix, null, null); + + if (model.ContainerId != null && model.ContainerId != priorContainerId) { + var newContainer = _contentManager.Get((int)model.ContainerId, VersionOptions.Latest); + if (newContainer == null) { + updater.AddModelError("CommonPart.ContainerId", T("Invalid container")); + } else { + part.Container = newContainer; + } + } + } + + return ContentShape("Parts_Common_Container_Edit", + () => shapeHelper.EditorTemplate(TemplateName: "Parts.Common.Container", Model: model, Prefix: Prefix)); + } + + protected override void Importing(CommonPart part, ImportContentContext context) { + // Don't do anything if the tag is not specified. + if (context.Data.Element(part.PartDefinition.Name) == null) { + return; + } + + context.ImportAttribute(part.PartDefinition.Name, "Owner", owner => { + var contentIdentity = new ContentIdentity(owner); + + // use the super user if the referenced one doesn't exist; + part.Owner = + _membershipService.GetUser(contentIdentity.Get("User.UserName")) + ?? _membershipService.GetUser(Services.WorkContext.CurrentSite.SuperUser); + }); + + context.ImportAttribute(part.PartDefinition.Name, "Container", container => + part.Container = context.GetItemFromSession(container) + ); + + context.ImportAttribute(part.PartDefinition.Name, "CreatedUtc", createdUtc => + part.CreatedUtc = XmlConvert.ToDateTime(createdUtc, XmlDateTimeSerializationMode.Utc) + ); + + context.ImportAttribute(part.PartDefinition.Name, "PublishedUtc", publishedUtc => + part.PublishedUtc = XmlConvert.ToDateTime(publishedUtc, XmlDateTimeSerializationMode.Utc) + ); + + context.ImportAttribute(part.PartDefinition.Name, "ModifiedUtc", modifiedUtc => + part.ModifiedUtc = XmlConvert.ToDateTime(modifiedUtc, XmlDateTimeSerializationMode.Utc) + ); + } + + protected override void Exporting(CommonPart part, ExportContentContext context) { + if (part.Owner != null) { + var ownerIdentity = _contentManager.GetItemMetadata(part.Owner).Identity; + context.Element(part.PartDefinition.Name).SetAttributeValue("Owner", ownerIdentity.ToString()); + } + + if (part.Container != null) { + var containerIdentity = _contentManager.GetItemMetadata(part.Container).Identity; + context.Element(part.PartDefinition.Name).SetAttributeValue("Container", containerIdentity.ToString()); + } + + if (part.CreatedUtc != null) { + context.Element(part.PartDefinition.Name) + .SetAttributeValue("CreatedUtc", XmlConvert.ToString(part.CreatedUtc.Value, XmlDateTimeSerializationMode.Utc)); + } + if (part.PublishedUtc != null) { + context.Element(part.PartDefinition.Name) + .SetAttributeValue("PublishedUtc", XmlConvert.ToString(part.PublishedUtc.Value, XmlDateTimeSerializationMode.Utc)); + } + if (part.ModifiedUtc != null) { + context.Element(part.PartDefinition.Name) + .SetAttributeValue("ModifiedUtc", XmlConvert.ToString(part.ModifiedUtc.Value, XmlDateTimeSerializationMode.Utc)); + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Drivers/IdentityPartDriver.cs b/src/Orchard.Web/Core/Common/Drivers/IdentityPartDriver.cs index d1940dfade3..ecc1941da8b 100644 --- a/src/Orchard.Web/Core/Common/Drivers/IdentityPartDriver.cs +++ b/src/Orchard.Web/Core/Common/Drivers/IdentityPartDriver.cs @@ -1,34 +1,34 @@ -using JetBrains.Annotations; -using Orchard.ContentManagement.Drivers; -using Orchard.Core.Common.Models; -using Orchard.Localization; - -namespace Orchard.Core.Common.Drivers { - [UsedImplicitly] - public class IdentityPartDriver : ContentPartDriver { - public IdentityPartDriver() { - T = NullLocalizer.Instance; - } - - public Localizer T { get; set; } - - protected override string Prefix { - get { return "Identity"; } - } - - protected override void Importing(IdentityPart part, ContentManagement.Handlers.ImportContentContext context) { - // Don't do anything if the tag is not specified. - if (context.Data.Element(part.PartDefinition.Name) == null) { - return; - } - - context.ImportAttribute(part.PartDefinition.Name, "Identifier", identity => - part.Identifier = identity - ); - } - - protected override void Exporting(IdentityPart part, ContentManagement.Handlers.ExportContentContext context) { - context.Element(part.PartDefinition.Name).SetAttributeValue("Identifier", part.Identifier); - } - } +using JetBrains.Annotations; +using Orchard.ContentManagement.Drivers; +using Orchard.Core.Common.Models; +using Orchard.Localization; + +namespace Orchard.Core.Common.Drivers { + [UsedImplicitly] + public class IdentityPartDriver : ContentPartDriver { + public IdentityPartDriver() { + T = NullLocalizer.Instance; + } + + public Localizer T { get; set; } + + protected override string Prefix { + get { return "Identity"; } + } + + protected override void Importing(IdentityPart part, ContentManagement.Handlers.ImportContentContext context) { + // Don't do anything if the tag is not specified. + if (context.Data.Element(part.PartDefinition.Name) == null) { + return; + } + + context.ImportAttribute(part.PartDefinition.Name, "Identifier", identity => + part.Identifier = identity + ); + } + + protected override void Exporting(IdentityPart part, ContentManagement.Handlers.ExportContentContext context) { + context.Element(part.PartDefinition.Name).SetAttributeValue("Identifier", part.Identifier); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Drivers/TextFieldDriver.cs b/src/Orchard.Web/Core/Common/Drivers/TextFieldDriver.cs index 75257849e6e..2676b277629 100644 --- a/src/Orchard.Web/Core/Common/Drivers/TextFieldDriver.cs +++ b/src/Orchard.Web/Core/Common/Drivers/TextFieldDriver.cs @@ -1,99 +1,99 @@ -using System.Collections.Generic; -using System.Linq; -using System.Web; -using JetBrains.Annotations; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Drivers; -using Orchard.ContentManagement.Handlers; -using Orchard.Core.Common.Fields; -using Orchard.Core.Common.Settings; -using Orchard.Core.Common.ViewModels; -using Orchard.Localization; -using Orchard.Services; - -namespace Orchard.Core.Common.Drivers { - [UsedImplicitly] - public class TextFieldDriver : ContentFieldDriver { - private readonly IEnumerable _htmlFilters; - - public TextFieldDriver(IOrchardServices services, IEnumerable htmlFilters) { - _htmlFilters = htmlFilters; - Services = services; - T = NullLocalizer.Instance; - } - - public Localizer T { get; set; } - public IOrchardServices Services { get; set; } - - private static string GetPrefix(TextField field, ContentPart part) { - return part.PartDefinition.Name + "." + field.Name; - } - - private string GetDifferentiator(TextField field, ContentPart part) { - return field.Name; - } - - protected override DriverResult Display(ContentPart part, TextField field, string displayType, dynamic shapeHelper) { - return ContentShape("Fields_Common_Text", GetDifferentiator(field, part), - () => { - var settings = field.PartFieldDefinition.Settings.GetModel(); - - object fieldValue = new HtmlString(_htmlFilters.Aggregate(field.Value, (text, filter) => filter.ProcessContent(text, settings.Flavor))); - return shapeHelper.Fields_Common_Text(Name: field.Name, Value: fieldValue); - }); - } - - protected override DriverResult Editor(ContentPart part, TextField field, dynamic shapeHelper) { - return ContentShape("Fields_Common_Text_Edit", GetDifferentiator(field, part), - () => { - var viewModel = new TextFieldDriverViewModel { - Field = field, - Text = field.Value, - Settings = field.PartFieldDefinition.Settings.GetModel(), - ContentItem = part.ContentItem - }; - - return shapeHelper.EditorTemplate(TemplateName: "Fields.Common.Text.Edit", Model: viewModel, Prefix: GetPrefix(field, part)); - }); - } - - protected override DriverResult Editor(ContentPart part, TextField field, IUpdateModel updater, dynamic shapeHelper) { - - var viewModel = new TextFieldDriverViewModel { - Field = field, - Text = field.Value, - Settings = field.PartFieldDefinition.Settings.GetModel(), - ContentItem = part.ContentItem - }; - - if(updater.TryUpdateModel(viewModel, GetPrefix(field, part), null, null)) { - if (viewModel.Settings.Required && string.IsNullOrWhiteSpace(viewModel.Text)) { - updater.AddModelError("Text", T("The field {0} is mandatory", T(field.DisplayName))); - return ContentShape("Fields_Common_Text_Edit", GetDifferentiator(field, part), - () => shapeHelper.EditorTemplate(TemplateName: "Fields.Common.Text.Edit", Model: viewModel, Prefix: GetPrefix(field, part))); - } - - field.Value = viewModel.Text; - } - - return Editor(part, field, shapeHelper); - } - - protected override void Importing(ContentPart part, TextField field, ImportContentContext context) { - var importedText = context.Attribute(field.FieldDefinition.Name + "." + field.Name, "Text"); - if (importedText != null) { - field.Value = importedText; - } - } - - protected override void Exporting(ContentPart part, TextField field, ExportContentContext context) { - context.Element(field.FieldDefinition.Name + "." + field.Name).SetAttributeValue("Text", field.Value); - } - - protected override void Describe(DescribeMembersContext context) { - context - .Member(null, typeof(string), T("Value"), T("The text associated with the field.")) - .Enumerate(() => field => new[] { field.Value }); - } - } +using System.Collections.Generic; +using System.Linq; +using System.Web; +using JetBrains.Annotations; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Drivers; +using Orchard.ContentManagement.Handlers; +using Orchard.Core.Common.Fields; +using Orchard.Core.Common.Settings; +using Orchard.Core.Common.ViewModels; +using Orchard.Localization; +using Orchard.Services; + +namespace Orchard.Core.Common.Drivers { + [UsedImplicitly] + public class TextFieldDriver : ContentFieldDriver { + private readonly IEnumerable _htmlFilters; + + public TextFieldDriver(IOrchardServices services, IEnumerable htmlFilters) { + _htmlFilters = htmlFilters; + Services = services; + T = NullLocalizer.Instance; + } + + public Localizer T { get; set; } + public IOrchardServices Services { get; set; } + + private static string GetPrefix(TextField field, ContentPart part) { + return part.PartDefinition.Name + "." + field.Name; + } + + private string GetDifferentiator(TextField field, ContentPart part) { + return field.Name; + } + + protected override DriverResult Display(ContentPart part, TextField field, string displayType, dynamic shapeHelper) { + return ContentShape("Fields_Common_Text", GetDifferentiator(field, part), + () => { + var settings = field.PartFieldDefinition.Settings.GetModel(); + + object fieldValue = new HtmlString(_htmlFilters.Aggregate(field.Value, (text, filter) => filter.ProcessContent(text, settings.Flavor))); + return shapeHelper.Fields_Common_Text(Name: field.Name, Value: fieldValue); + }); + } + + protected override DriverResult Editor(ContentPart part, TextField field, dynamic shapeHelper) { + return ContentShape("Fields_Common_Text_Edit", GetDifferentiator(field, part), + () => { + var viewModel = new TextFieldDriverViewModel { + Field = field, + Text = field.Value, + Settings = field.PartFieldDefinition.Settings.GetModel(), + ContentItem = part.ContentItem + }; + + return shapeHelper.EditorTemplate(TemplateName: "Fields.Common.Text.Edit", Model: viewModel, Prefix: GetPrefix(field, part)); + }); + } + + protected override DriverResult Editor(ContentPart part, TextField field, IUpdateModel updater, dynamic shapeHelper) { + + var viewModel = new TextFieldDriverViewModel { + Field = field, + Text = field.Value, + Settings = field.PartFieldDefinition.Settings.GetModel(), + ContentItem = part.ContentItem + }; + + if(updater.TryUpdateModel(viewModel, GetPrefix(field, part), null, null)) { + if (viewModel.Settings.Required && string.IsNullOrWhiteSpace(viewModel.Text)) { + updater.AddModelError("Text", T("The field {0} is mandatory", T(field.DisplayName))); + return ContentShape("Fields_Common_Text_Edit", GetDifferentiator(field, part), + () => shapeHelper.EditorTemplate(TemplateName: "Fields.Common.Text.Edit", Model: viewModel, Prefix: GetPrefix(field, part))); + } + + field.Value = viewModel.Text; + } + + return Editor(part, field, shapeHelper); + } + + protected override void Importing(ContentPart part, TextField field, ImportContentContext context) { + var importedText = context.Attribute(field.FieldDefinition.Name + "." + field.Name, "Text"); + if (importedText != null) { + field.Value = importedText; + } + } + + protected override void Exporting(ContentPart part, TextField field, ExportContentContext context) { + context.Element(field.FieldDefinition.Name + "." + field.Name).SetAttributeValue("Text", field.Value); + } + + protected override void Describe(DescribeMembersContext context) { + context + .Member(null, typeof(string), T("Value"), T("The text associated with the field.")) + .Enumerate(() => field => new[] { field.Value }); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Fields/TextField.cs b/src/Orchard.Web/Core/Common/Fields/TextField.cs index 1a26a10da11..28d595c01da 100644 --- a/src/Orchard.Web/Core/Common/Fields/TextField.cs +++ b/src/Orchard.Web/Core/Common/Fields/TextField.cs @@ -1,11 +1,11 @@ -using Orchard.ContentManagement; -using Orchard.ContentManagement.FieldStorage; - -namespace Orchard.Core.Common.Fields { - public class TextField : ContentField { - public string Value { - get { return Storage.Get(); } - set { Storage.Set(value); } - } - } -} +using Orchard.ContentManagement; +using Orchard.ContentManagement.FieldStorage; + +namespace Orchard.Core.Common.Fields { + public class TextField : ContentField { + public string Value { + get { return Storage.Get(); } + set { Storage.Set(value); } + } + } +} diff --git a/src/Orchard.Web/Core/Common/Handlers/BodyPartHandler.cs b/src/Orchard.Web/Core/Common/Handlers/BodyPartHandler.cs index 2d8666e06c5..6f199df7fa4 100644 --- a/src/Orchard.Web/Core/Common/Handlers/BodyPartHandler.cs +++ b/src/Orchard.Web/Core/Common/Handlers/BodyPartHandler.cs @@ -1,17 +1,17 @@ -using JetBrains.Annotations; -using Orchard.Core.Common.Models; -using Orchard.Data; -using Orchard.ContentManagement.Handlers; - -namespace Orchard.Core.Common.Handlers { - [UsedImplicitly] - public class BodyPartHandler : ContentHandler { - public BodyPartHandler(IRepository bodyRepository) { - Filters.Add(StorageFilter.For(bodyRepository)); - - OnIndexing((context, bodyPart) => context.DocumentIndex - .Add("body", bodyPart.Record.Text).RemoveTags().Analyze() - .Add("format", bodyPart.Record.Format).Store()); - } - } +using JetBrains.Annotations; +using Orchard.Core.Common.Models; +using Orchard.Data; +using Orchard.ContentManagement.Handlers; + +namespace Orchard.Core.Common.Handlers { + [UsedImplicitly] + public class BodyPartHandler : ContentHandler { + public BodyPartHandler(IRepository bodyRepository) { + Filters.Add(StorageFilter.For(bodyRepository)); + + OnIndexing((context, bodyPart) => context.DocumentIndex + .Add("body", bodyPart.Record.Text).RemoveTags().Analyze() + .Add("format", bodyPart.Record.Format).Store()); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Handlers/CommonPartHandler.cs b/src/Orchard.Web/Core/Common/Handlers/CommonPartHandler.cs index beaa333a47f..bd6d7ba793c 100644 --- a/src/Orchard.Web/Core/Common/Handlers/CommonPartHandler.cs +++ b/src/Orchard.Web/Core/Common/Handlers/CommonPartHandler.cs @@ -1,176 +1,176 @@ -using System; -using System.Linq; -using JetBrains.Annotations; -using Orchard.ContentManagement.MetaData; -using Orchard.Core.Common.Models; -using Orchard.Data; -using Orchard.Localization; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Handlers; -using Orchard.Security; -using Orchard.Services; - -namespace Orchard.Core.Common.Handlers { - [UsedImplicitly] - public class CommonPartHandler : ContentHandler { - private readonly IClock _clock; - private readonly IAuthenticationService _authenticationService; - private readonly IContentManager _contentManager; - private readonly IContentDefinitionManager _contentDefinitionManager; - - public CommonPartHandler( - IRepository commonRepository, - IRepository commonVersionRepository, - IClock clock, - IAuthenticationService authenticationService, - IContentManager contentManager, - IContentDefinitionManager contentDefinitionManager) { - - _clock = clock; - _authenticationService = authenticationService; - _contentManager = contentManager; - _contentDefinitionManager = contentDefinitionManager; - T = NullLocalizer.Instance; - - Filters.Add(StorageFilter.For(commonRepository)); - Filters.Add(StorageFilter.For(commonVersionRepository)); - - OnActivated(PropertySetHandlers); - OnInitializing(AssignCreatingOwner); - OnInitializing(AssignCreatingDates); - - OnLoading((context, part) => LazyLoadHandlers(part)); - OnVersioning((context, part, newVersionPart) => LazyLoadHandlers(newVersionPart)); - - OnUpdateEditorShape(AssignUpdateDates); - OnVersioning(AssignVersioningDates); - OnPublishing(AssignPublishingDates); - OnRemoving(AssignRemovingDates); - - OnIndexing((context, commonPart) => { - var utcNow = _clock.UtcNow; - - context.DocumentIndex - .Add("type", commonPart.ContentItem.ContentType).Store() - .Add("created", commonPart.CreatedUtc ?? utcNow).Store() - .Add("published", commonPart.PublishedUtc ?? utcNow).Store() - .Add("modified", commonPart.ModifiedUtc ?? utcNow).Store(); - - if (commonPart.Container != null) { - context.DocumentIndex.Add("container-id", commonPart.Container.Id).Store(); - } - - if (commonPart.Owner != null) { - context.DocumentIndex.Add("author", commonPart.Owner.UserName).Store(); - } - }); - } - - - public Localizer T { get; set; } - - protected override void Activating(ActivatingContentContext context) { - if (ContentTypeWithACommonPart(context.ContentType)) - context.Builder.Weld>(); - } - - protected bool ContentTypeWithACommonPart(string typeName) { - //Note: What about content type handlers which activate "CommonPart" in code? - var contentTypeDefinition = _contentDefinitionManager.GetTypeDefinition(typeName); - - if (contentTypeDefinition != null) - return contentTypeDefinition.Parts.Any(part => part.PartDefinition.Name == "CommonPart"); - - return false; - } - - protected void AssignCreatingOwner(InitializingContentContext context, CommonPart part) { - // and use the current user as Owner - if (part.Record.OwnerId == 0) { - part.Owner = _authenticationService.GetAuthenticatedUser(); - } - } - - protected void AssignCreatingDates(InitializingContentContext context, CommonPart part) { - // assign default create/modified dates - var utcNow = _clock.UtcNow; - - part.CreatedUtc = utcNow; - part.ModifiedUtc = utcNow; - part.VersionCreatedUtc = utcNow; - part.VersionModifiedUtc = utcNow; - } - - private void AssignUpdateDates(UpdateEditorContext context, CommonPart part) { - var utcNow = _clock.UtcNow; - - part.ModifiedUtc = utcNow; - part.VersionModifiedUtc = utcNow; - } - - private void AssignRemovingDates(RemoveContentContext context, CommonPart part) { - var utcNow = _clock.UtcNow; - - part.ModifiedUtc = utcNow; - part.VersionModifiedUtc = utcNow; - } - - protected void AssignVersioningDates(VersionContentContext context, CommonPart existing, CommonPart building) { - var utcNow = _clock.UtcNow; - - // assign the created date - building.VersionCreatedUtc = utcNow; - // assign modified date for the new version - building.VersionModifiedUtc = utcNow; - // publish date should be null until publish method called - building.VersionPublishedUtc = null; - - // assign the created - building.CreatedUtc = existing.CreatedUtc ?? utcNow; - // persist any published dates - building.PublishedUtc = existing.PublishedUtc; - // assign modified date for the new version - building.ModifiedUtc = utcNow; - } - - - protected void AssignPublishingDates(PublishContentContext context, CommonPart part) { - var utcNow = _clock.UtcNow; - - part.PublishedUtc = utcNow; - part.VersionPublishedUtc = utcNow; - } - - protected void LazyLoadHandlers(CommonPart part) { - // add handlers that will load content for id's just-in-time - part.OwnerField.Loader(() => _contentManager.Get(part.Record.OwnerId)); - part.ContainerField.Loader(() => part.Record.Container == null ? null : _contentManager.Get(part.Record.Container.Id)); - } - - protected static void PropertySetHandlers(ActivatedContentContext context, CommonPart part) { - // add handlers that will update records when part properties are set - - part.OwnerField.Setter(user => { - part.Record.OwnerId = user == null - ? 0 - : user.ContentItem.Id; - return user; - }); - - // Force call to setter if we had already set a value - if (part.OwnerField.Value != null) - part.OwnerField.Value = part.OwnerField.Value; - - part.ContainerField.Setter(container => { - part.Record.Container = container == null - ? null - : container.ContentItem.Record; - return container; - }); - - // Force call to setter if we had already set a value - if (part.ContainerField.Value != null) - part.ContainerField.Value = part.ContainerField.Value; - } - } -} +using System; +using System.Linq; +using JetBrains.Annotations; +using Orchard.ContentManagement.MetaData; +using Orchard.Core.Common.Models; +using Orchard.Data; +using Orchard.Localization; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Handlers; +using Orchard.Security; +using Orchard.Services; + +namespace Orchard.Core.Common.Handlers { + [UsedImplicitly] + public class CommonPartHandler : ContentHandler { + private readonly IClock _clock; + private readonly IAuthenticationService _authenticationService; + private readonly IContentManager _contentManager; + private readonly IContentDefinitionManager _contentDefinitionManager; + + public CommonPartHandler( + IRepository commonRepository, + IRepository commonVersionRepository, + IClock clock, + IAuthenticationService authenticationService, + IContentManager contentManager, + IContentDefinitionManager contentDefinitionManager) { + + _clock = clock; + _authenticationService = authenticationService; + _contentManager = contentManager; + _contentDefinitionManager = contentDefinitionManager; + T = NullLocalizer.Instance; + + Filters.Add(StorageFilter.For(commonRepository)); + Filters.Add(StorageFilter.For(commonVersionRepository)); + + OnActivated(PropertySetHandlers); + OnInitializing(AssignCreatingOwner); + OnInitializing(AssignCreatingDates); + + OnLoading((context, part) => LazyLoadHandlers(part)); + OnVersioning((context, part, newVersionPart) => LazyLoadHandlers(newVersionPart)); + + OnUpdateEditorShape(AssignUpdateDates); + OnVersioning(AssignVersioningDates); + OnPublishing(AssignPublishingDates); + OnRemoving(AssignRemovingDates); + + OnIndexing((context, commonPart) => { + var utcNow = _clock.UtcNow; + + context.DocumentIndex + .Add("type", commonPart.ContentItem.ContentType).Store() + .Add("created", commonPart.CreatedUtc ?? utcNow).Store() + .Add("published", commonPart.PublishedUtc ?? utcNow).Store() + .Add("modified", commonPart.ModifiedUtc ?? utcNow).Store(); + + if (commonPart.Container != null) { + context.DocumentIndex.Add("container-id", commonPart.Container.Id).Store(); + } + + if (commonPart.Owner != null) { + context.DocumentIndex.Add("author", commonPart.Owner.UserName).Store(); + } + }); + } + + + public Localizer T { get; set; } + + protected override void Activating(ActivatingContentContext context) { + if (ContentTypeWithACommonPart(context.ContentType)) + context.Builder.Weld>(); + } + + protected bool ContentTypeWithACommonPart(string typeName) { + //Note: What about content type handlers which activate "CommonPart" in code? + var contentTypeDefinition = _contentDefinitionManager.GetTypeDefinition(typeName); + + if (contentTypeDefinition != null) + return contentTypeDefinition.Parts.Any(part => part.PartDefinition.Name == "CommonPart"); + + return false; + } + + protected void AssignCreatingOwner(InitializingContentContext context, CommonPart part) { + // and use the current user as Owner + if (part.Record.OwnerId == 0) { + part.Owner = _authenticationService.GetAuthenticatedUser(); + } + } + + protected void AssignCreatingDates(InitializingContentContext context, CommonPart part) { + // assign default create/modified dates + var utcNow = _clock.UtcNow; + + part.CreatedUtc = utcNow; + part.ModifiedUtc = utcNow; + part.VersionCreatedUtc = utcNow; + part.VersionModifiedUtc = utcNow; + } + + private void AssignUpdateDates(UpdateEditorContext context, CommonPart part) { + var utcNow = _clock.UtcNow; + + part.ModifiedUtc = utcNow; + part.VersionModifiedUtc = utcNow; + } + + private void AssignRemovingDates(RemoveContentContext context, CommonPart part) { + var utcNow = _clock.UtcNow; + + part.ModifiedUtc = utcNow; + part.VersionModifiedUtc = utcNow; + } + + protected void AssignVersioningDates(VersionContentContext context, CommonPart existing, CommonPart building) { + var utcNow = _clock.UtcNow; + + // assign the created date + building.VersionCreatedUtc = utcNow; + // assign modified date for the new version + building.VersionModifiedUtc = utcNow; + // publish date should be null until publish method called + building.VersionPublishedUtc = null; + + // assign the created + building.CreatedUtc = existing.CreatedUtc ?? utcNow; + // persist any published dates + building.PublishedUtc = existing.PublishedUtc; + // assign modified date for the new version + building.ModifiedUtc = utcNow; + } + + + protected void AssignPublishingDates(PublishContentContext context, CommonPart part) { + var utcNow = _clock.UtcNow; + + part.PublishedUtc = utcNow; + part.VersionPublishedUtc = utcNow; + } + + protected void LazyLoadHandlers(CommonPart part) { + // add handlers that will load content for id's just-in-time + part.OwnerField.Loader(() => _contentManager.Get(part.Record.OwnerId)); + part.ContainerField.Loader(() => part.Record.Container == null ? null : _contentManager.Get(part.Record.Container.Id)); + } + + protected static void PropertySetHandlers(ActivatedContentContext context, CommonPart part) { + // add handlers that will update records when part properties are set + + part.OwnerField.Setter(user => { + part.Record.OwnerId = user == null + ? 0 + : user.ContentItem.Id; + return user; + }); + + // Force call to setter if we had already set a value + if (part.OwnerField.Value != null) + part.OwnerField.Value = part.OwnerField.Value; + + part.ContainerField.Setter(container => { + part.Record.Container = container == null + ? null + : container.ContentItem.Record; + return container; + }); + + // Force call to setter if we had already set a value + if (part.ContainerField.Value != null) + part.ContainerField.Value = part.ContainerField.Value; + } + } +} diff --git a/src/Orchard.Web/Core/Common/Handlers/IdentityPartHandler.cs b/src/Orchard.Web/Core/Common/Handlers/IdentityPartHandler.cs index ae461bdca38..52e9fd87b75 100644 --- a/src/Orchard.Web/Core/Common/Handlers/IdentityPartHandler.cs +++ b/src/Orchard.Web/Core/Common/Handlers/IdentityPartHandler.cs @@ -1,33 +1,33 @@ -using System; -using JetBrains.Annotations; -using Orchard.ContentManagement; -using Orchard.Core.Common.Models; -using Orchard.Data; -using Orchard.ContentManagement.Handlers; - -namespace Orchard.Core.Common.Handlers { - [UsedImplicitly] - public class IdentityPartHandler : ContentHandler { - public IdentityPartHandler(IRepository identityRepository, - IContentManager contentManager) { - Filters.Add(StorageFilter.For(identityRepository)); - OnInitializing(AssignIdentity); - - OnIndexing((context, part) => { - context.DocumentIndex.Add("identifier", part.Identifier).Store(); - }); - } - - protected void AssignIdentity(InitializingContentContext context, IdentityPart part) { - part.Identifier = Guid.NewGuid().ToString("n"); - } - - protected override void GetItemMetadata(GetContentItemMetadataContext context) { - var part = context.ContentItem.As(); - - if (part != null) { - context.Metadata.Identity.Add("Identifier", part.Identifier); - } - } - } +using System; +using JetBrains.Annotations; +using Orchard.ContentManagement; +using Orchard.Core.Common.Models; +using Orchard.Data; +using Orchard.ContentManagement.Handlers; + +namespace Orchard.Core.Common.Handlers { + [UsedImplicitly] + public class IdentityPartHandler : ContentHandler { + public IdentityPartHandler(IRepository identityRepository, + IContentManager contentManager) { + Filters.Add(StorageFilter.For(identityRepository)); + OnInitializing(AssignIdentity); + + OnIndexing((context, part) => { + context.DocumentIndex.Add("identifier", part.Identifier).Store(); + }); + } + + protected void AssignIdentity(InitializingContentContext context, IdentityPart part) { + part.Identifier = Guid.NewGuid().ToString("n"); + } + + protected override void GetItemMetadata(GetContentItemMetadataContext context) { + var part = context.ContentItem.As(); + + if (part != null) { + context.Metadata.Identity.Add("Identifier", part.Identifier); + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Migrations.cs b/src/Orchard.Web/Core/Common/Migrations.cs index b564055caaa..cefecc9031c 100644 --- a/src/Orchard.Web/Core/Common/Migrations.cs +++ b/src/Orchard.Web/Core/Common/Migrations.cs @@ -1,111 +1,111 @@ -using System; -using System.Linq; -using Orchard.ContentManagement.MetaData; -using Orchard.Core.Common.Models; -using Orchard.Core.Contents.Extensions; -using Orchard.Data; -using Orchard.Data.Migration; - -namespace Orchard.Core.Common { - public class Migrations : DataMigrationImpl { - private readonly IRepository _identityPartRepository; - - public Migrations(IRepository identityPartRepository) { - _identityPartRepository = identityPartRepository; - } - - public int Create() { - SchemaBuilder.CreateTable("BodyPartRecord", - table => table - .ContentPartVersionRecord() - .Column("Text", column => column.Unlimited()) - .Column("Format") - ); - - SchemaBuilder.CreateTable("CommonPartRecord", - table => table - .ContentPartRecord() - .Column("OwnerId") - .Column("CreatedUtc") - .Column("PublishedUtc") - .Column("ModifiedUtc") - .Column("Container_id") - ); - - SchemaBuilder.CreateTable("CommonPartVersionRecord", - table => table - .ContentPartVersionRecord() - .Column("CreatedUtc") - .Column("PublishedUtc") - .Column("ModifiedUtc") - ); - - SchemaBuilder.CreateTable("IdentityPartRecord", - table => table - .ContentPartRecord() - .Column("Identifier", column => column.WithLength(255)) - ); - - ContentDefinitionManager.AlterPartDefinition("BodyPart", builder => builder - .Attachable() - .WithDescription("Allows the editing of text using an editor provided by the configured flavor (e.g. html, text, markdown).")); - - ContentDefinitionManager.AlterPartDefinition("CommonPart", builder => builder - .Attachable() - .WithDescription("Provides common information about a content item, such as Owner, Date Created, Date Published and Date Modified.")); - - ContentDefinitionManager.AlterPartDefinition("IdentityPart", builder => builder - .Attachable() - .WithDescription("Automatically generates a unique identity for the content item, which is required in import/export scenarios where one content item references another.")); - - return 4; - } - - public int UpdateFrom1() { - SchemaBuilder.CreateTable("IdentityPartRecord", - table => table - .ContentPartRecord() - .Column("Identifier", column => column.Unlimited()) - ); - ContentDefinitionManager.AlterPartDefinition("IdentityPart", builder => builder.Attachable()); - - return 2; - } - - public int UpdateFrom2() { - ContentDefinitionManager.AlterPartDefinition("BodyPart", builder => builder - .WithDescription("Allows the editing of text using an editor provided by the configured flavor (e.g. html, text, markdown).")); - - ContentDefinitionManager.AlterPartDefinition("CommonPart", builder => builder - .WithDescription("Provides common information about a content item, such as Owner, Date Created, Date Published and Date Modified.")); - - ContentDefinitionManager.AlterPartDefinition("IdentityPart", builder => builder - .WithDescription("Automatically generates a unique identity for the content item, which is required in import/export scenarios where one content item references another.")); - - return 3; - } - - public int UpdateFrom3() { - var existingIdentityParts = _identityPartRepository.Table.ToArray(); - - foreach (var existingIdentityPart in existingIdentityParts) { - if (existingIdentityPart.Identifier.Length > 255) { - throw new ArgumentException("Identifier '" + existingIdentityPart + "' is over 255 characters"); - } - } - - SchemaBuilder.AlterTable("IdentityPartRecord", table => table.DropColumn("Identifier")); - SchemaBuilder.AlterTable("IdentityPartRecord", table => table.AddColumn("Identifier", command => command.WithLength(255))); - - foreach (var existingIdentityPart in existingIdentityParts) { - var updateIdentityPartRecord = _identityPartRepository.Get(existingIdentityPart.Id); - - updateIdentityPartRecord.Identifier = existingIdentityPart.Identifier; - - _identityPartRepository.Update(updateIdentityPartRecord); - } - - return 4; - } - } +using System; +using System.Linq; +using Orchard.ContentManagement.MetaData; +using Orchard.Core.Common.Models; +using Orchard.Core.Contents.Extensions; +using Orchard.Data; +using Orchard.Data.Migration; + +namespace Orchard.Core.Common { + public class Migrations : DataMigrationImpl { + private readonly IRepository _identityPartRepository; + + public Migrations(IRepository identityPartRepository) { + _identityPartRepository = identityPartRepository; + } + + public int Create() { + SchemaBuilder.CreateTable("BodyPartRecord", + table => table + .ContentPartVersionRecord() + .Column("Text", column => column.Unlimited()) + .Column("Format") + ); + + SchemaBuilder.CreateTable("CommonPartRecord", + table => table + .ContentPartRecord() + .Column("OwnerId") + .Column("CreatedUtc") + .Column("PublishedUtc") + .Column("ModifiedUtc") + .Column("Container_id") + ); + + SchemaBuilder.CreateTable("CommonPartVersionRecord", + table => table + .ContentPartVersionRecord() + .Column("CreatedUtc") + .Column("PublishedUtc") + .Column("ModifiedUtc") + ); + + SchemaBuilder.CreateTable("IdentityPartRecord", + table => table + .ContentPartRecord() + .Column("Identifier", column => column.WithLength(255)) + ); + + ContentDefinitionManager.AlterPartDefinition("BodyPart", builder => builder + .Attachable() + .WithDescription("Allows the editing of text using an editor provided by the configured flavor (e.g. html, text, markdown).")); + + ContentDefinitionManager.AlterPartDefinition("CommonPart", builder => builder + .Attachable() + .WithDescription("Provides common information about a content item, such as Owner, Date Created, Date Published and Date Modified.")); + + ContentDefinitionManager.AlterPartDefinition("IdentityPart", builder => builder + .Attachable() + .WithDescription("Automatically generates a unique identity for the content item, which is required in import/export scenarios where one content item references another.")); + + return 4; + } + + public int UpdateFrom1() { + SchemaBuilder.CreateTable("IdentityPartRecord", + table => table + .ContentPartRecord() + .Column("Identifier", column => column.Unlimited()) + ); + ContentDefinitionManager.AlterPartDefinition("IdentityPart", builder => builder.Attachable()); + + return 2; + } + + public int UpdateFrom2() { + ContentDefinitionManager.AlterPartDefinition("BodyPart", builder => builder + .WithDescription("Allows the editing of text using an editor provided by the configured flavor (e.g. html, text, markdown).")); + + ContentDefinitionManager.AlterPartDefinition("CommonPart", builder => builder + .WithDescription("Provides common information about a content item, such as Owner, Date Created, Date Published and Date Modified.")); + + ContentDefinitionManager.AlterPartDefinition("IdentityPart", builder => builder + .WithDescription("Automatically generates a unique identity for the content item, which is required in import/export scenarios where one content item references another.")); + + return 3; + } + + public int UpdateFrom3() { + var existingIdentityParts = _identityPartRepository.Table.ToArray(); + + foreach (var existingIdentityPart in existingIdentityParts) { + if (existingIdentityPart.Identifier.Length > 255) { + throw new ArgumentException("Identifier '" + existingIdentityPart + "' is over 255 characters"); + } + } + + SchemaBuilder.AlterTable("IdentityPartRecord", table => table.DropColumn("Identifier")); + SchemaBuilder.AlterTable("IdentityPartRecord", table => table.AddColumn("Identifier", command => command.WithLength(255))); + + foreach (var existingIdentityPart in existingIdentityParts) { + var updateIdentityPartRecord = _identityPartRepository.Get(existingIdentityPart.Id); + + updateIdentityPartRecord.Identifier = existingIdentityPart.Identifier; + + _identityPartRepository.Update(updateIdentityPartRecord); + } + + return 4; + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Models/BodyPart.cs b/src/Orchard.Web/Core/Common/Models/BodyPart.cs index 63d710fa9b4..7d191cce2c5 100644 --- a/src/Orchard.Web/Core/Common/Models/BodyPart.cs +++ b/src/Orchard.Web/Core/Common/Models/BodyPart.cs @@ -1,15 +1,15 @@ -using Orchard.ContentManagement; - -namespace Orchard.Core.Common.Models { - public class BodyPart : ContentPart { - public string Text { - get { return Retrieve(x => x.Text); } - set { Store(x => x.Text, value); } - } - - public string Format { - get { return Retrieve(x => x.Format); } - set { Store(x => x.Format, value); } - } - } -} +using Orchard.ContentManagement; + +namespace Orchard.Core.Common.Models { + public class BodyPart : ContentPart { + public string Text { + get { return Retrieve(x => x.Text); } + set { Store(x => x.Text, value); } + } + + public string Format { + get { return Retrieve(x => x.Format); } + set { Store(x => x.Format, value); } + } + } +} diff --git a/src/Orchard.Web/Core/Common/Models/BodyPartRecord.cs b/src/Orchard.Web/Core/Common/Models/BodyPartRecord.cs index c71fc37be9c..647da44a5f6 100644 --- a/src/Orchard.Web/Core/Common/Models/BodyPartRecord.cs +++ b/src/Orchard.Web/Core/Common/Models/BodyPartRecord.cs @@ -1,11 +1,11 @@ -using Orchard.ContentManagement.Records; -using Orchard.Data.Conventions; - -namespace Orchard.Core.Common.Models { - public class BodyPartRecord : ContentPartVersionRecord { - [StringLengthMax] - public virtual string Text { get; set; } - - public virtual string Format { get; set; } - } +using Orchard.ContentManagement.Records; +using Orchard.Data.Conventions; + +namespace Orchard.Core.Common.Models { + public class BodyPartRecord : ContentPartVersionRecord { + [StringLengthMax] + public virtual string Text { get; set; } + + public virtual string Format { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Models/CommonPart.cs b/src/Orchard.Web/Core/Common/Models/CommonPart.cs index 23fc22f4e82..4f2f71ed715 100644 --- a/src/Orchard.Web/Core/Common/Models/CommonPart.cs +++ b/src/Orchard.Web/Core/Common/Models/CommonPart.cs @@ -1,78 +1,78 @@ -using System; -using Orchard.Core.Common.Utilities; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Aspects; -using Orchard.Security; - -namespace Orchard.Core.Common.Models { - public class CommonPart : ContentPart, ICommonPart { - private readonly LazyField _owner = new LazyField(); - private readonly LazyField _container = new LazyField(); - - public LazyField OwnerField { get { return _owner; } } - - public LazyField ContainerField { get { return _container; } } - - public IUser Owner { - get { return _owner.Value; } - set { _owner.Value = value; } - } - - public IContent Container { - get { return _container.Value; } - set { _container.Value = value; } - } - - public DateTime? CreatedUtc { - get { return Retrieve(x => x.CreatedUtc); } - set { Store(x => x.CreatedUtc, value); } - } - - public DateTime? PublishedUtc { - get { return Retrieve(x => x.PublishedUtc); } - set { Store(x => x.PublishedUtc, value); } - } - - public DateTime? ModifiedUtc { - get { return Retrieve(x => x.ModifiedUtc); } - set { Store(x => x.ModifiedUtc, value); } - } - - CommonPartVersionRecord PartVersionRecord { - get { - var versionPart = this.As>(); - return versionPart == null ? null : versionPart.Record; - } - } - - public DateTime? VersionCreatedUtc { - get { - return PartVersionRecord == null ? CreatedUtc : PartVersionRecord.CreatedUtc; - } - set { - if (PartVersionRecord != null) - PartVersionRecord.CreatedUtc = value; - } - } - - public DateTime? VersionPublishedUtc { - get { - return PartVersionRecord == null ? PublishedUtc : PartVersionRecord.PublishedUtc; - } - set { - if (PartVersionRecord != null) - PartVersionRecord.PublishedUtc = value; - } - } - - public DateTime? VersionModifiedUtc { - get { - return PartVersionRecord == null ? ModifiedUtc : PartVersionRecord.ModifiedUtc; - } - set { - if (PartVersionRecord != null) - PartVersionRecord.ModifiedUtc = value; - } - } - } -} +using System; +using Orchard.Core.Common.Utilities; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Aspects; +using Orchard.Security; + +namespace Orchard.Core.Common.Models { + public class CommonPart : ContentPart, ICommonPart { + private readonly LazyField _owner = new LazyField(); + private readonly LazyField _container = new LazyField(); + + public LazyField OwnerField { get { return _owner; } } + + public LazyField ContainerField { get { return _container; } } + + public IUser Owner { + get { return _owner.Value; } + set { _owner.Value = value; } + } + + public IContent Container { + get { return _container.Value; } + set { _container.Value = value; } + } + + public DateTime? CreatedUtc { + get { return Retrieve(x => x.CreatedUtc); } + set { Store(x => x.CreatedUtc, value); } + } + + public DateTime? PublishedUtc { + get { return Retrieve(x => x.PublishedUtc); } + set { Store(x => x.PublishedUtc, value); } + } + + public DateTime? ModifiedUtc { + get { return Retrieve(x => x.ModifiedUtc); } + set { Store(x => x.ModifiedUtc, value); } + } + + CommonPartVersionRecord PartVersionRecord { + get { + var versionPart = this.As>(); + return versionPart == null ? null : versionPart.Record; + } + } + + public DateTime? VersionCreatedUtc { + get { + return PartVersionRecord == null ? CreatedUtc : PartVersionRecord.CreatedUtc; + } + set { + if (PartVersionRecord != null) + PartVersionRecord.CreatedUtc = value; + } + } + + public DateTime? VersionPublishedUtc { + get { + return PartVersionRecord == null ? PublishedUtc : PartVersionRecord.PublishedUtc; + } + set { + if (PartVersionRecord != null) + PartVersionRecord.PublishedUtc = value; + } + } + + public DateTime? VersionModifiedUtc { + get { + return PartVersionRecord == null ? ModifiedUtc : PartVersionRecord.ModifiedUtc; + } + set { + if (PartVersionRecord != null) + PartVersionRecord.ModifiedUtc = value; + } + } + } +} diff --git a/src/Orchard.Web/Core/Common/Models/CommonPartRecord.cs b/src/Orchard.Web/Core/Common/Models/CommonPartRecord.cs index 3d02b6c4077..27fc02de8b1 100644 --- a/src/Orchard.Web/Core/Common/Models/CommonPartRecord.cs +++ b/src/Orchard.Web/Core/Common/Models/CommonPartRecord.cs @@ -1,12 +1,12 @@ -using System; -using Orchard.ContentManagement.Records; - -namespace Orchard.Core.Common.Models { - public class CommonPartRecord : ContentPartRecord { - public virtual int OwnerId { get; set; } - public virtual ContentItemRecord Container { get; set; } - public virtual DateTime? CreatedUtc { get; set; } - public virtual DateTime? PublishedUtc { get; set; } - public virtual DateTime? ModifiedUtc { get; set; } - } +using System; +using Orchard.ContentManagement.Records; + +namespace Orchard.Core.Common.Models { + public class CommonPartRecord : ContentPartRecord { + public virtual int OwnerId { get; set; } + public virtual ContentItemRecord Container { get; set; } + public virtual DateTime? CreatedUtc { get; set; } + public virtual DateTime? PublishedUtc { get; set; } + public virtual DateTime? ModifiedUtc { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Models/CommonPartVersionRecord.cs b/src/Orchard.Web/Core/Common/Models/CommonPartVersionRecord.cs index 37939294800..8f43e70deae 100644 --- a/src/Orchard.Web/Core/Common/Models/CommonPartVersionRecord.cs +++ b/src/Orchard.Web/Core/Common/Models/CommonPartVersionRecord.cs @@ -1,10 +1,10 @@ -using System; -using Orchard.ContentManagement.Records; - -namespace Orchard.Core.Common.Models { - public class CommonPartVersionRecord : ContentPartVersionRecord { - public virtual DateTime? CreatedUtc { get; set; } - public virtual DateTime? PublishedUtc { get; set; } - public virtual DateTime? ModifiedUtc { get; set; } - } +using System; +using Orchard.ContentManagement.Records; + +namespace Orchard.Core.Common.Models { + public class CommonPartVersionRecord : ContentPartVersionRecord { + public virtual DateTime? CreatedUtc { get; set; } + public virtual DateTime? PublishedUtc { get; set; } + public virtual DateTime? ModifiedUtc { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Models/IdentityPart.cs b/src/Orchard.Web/Core/Common/Models/IdentityPart.cs index 0642acedc9e..f5d0e55b8cb 100644 --- a/src/Orchard.Web/Core/Common/Models/IdentityPart.cs +++ b/src/Orchard.Web/Core/Common/Models/IdentityPart.cs @@ -1,10 +1,10 @@ -using Orchard.ContentManagement; - -namespace Orchard.Core.Common.Models { - public class IdentityPart : ContentPart { - public string Identifier { - get { return Retrieve(x => x.Identifier); } - set { Store(x => x.Identifier, value); } - } - } -} +using Orchard.ContentManagement; + +namespace Orchard.Core.Common.Models { + public class IdentityPart : ContentPart { + public string Identifier { + get { return Retrieve(x => x.Identifier); } + set { Store(x => x.Identifier, value); } + } + } +} diff --git a/src/Orchard.Web/Core/Common/Models/IdentityPartRecord.cs b/src/Orchard.Web/Core/Common/Models/IdentityPartRecord.cs index 04f36d4572f..440eb10ea8a 100644 --- a/src/Orchard.Web/Core/Common/Models/IdentityPartRecord.cs +++ b/src/Orchard.Web/Core/Common/Models/IdentityPartRecord.cs @@ -1,7 +1,7 @@ -using Orchard.ContentManagement.Records; - -namespace Orchard.Core.Common.Models { - public class IdentityPartRecord : ContentPartRecord { - public virtual string Identifier { get; set; } - } +using Orchard.ContentManagement.Records; + +namespace Orchard.Core.Common.Models { + public class IdentityPartRecord : ContentPartRecord { + public virtual string Identifier { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Module.txt b/src/Orchard.Web/Core/Common/Module.txt index 7203326ef8c..fde135ecb9c 100644 --- a/src/Orchard.Web/Core/Common/Module.txt +++ b/src/Orchard.Web/Core/Common/Module.txt @@ -1,10 +1,10 @@ -Name: Common -AntiForgery: enabled -Author: The Orchard Team -Website: http://orchardproject.net -Version: 1.9.2 -OrchardVersion: 1.9 -Description: The common module introduces content parts that are going to be used by most content types (common, body, identity). -FeatureDescription: Core content parts. -Dependencies: Settings -Category: Core +Name: Common +AntiForgery: enabled +Author: The Orchard Team +Website: http://orchardproject.net +Version: 1.9.2 +OrchardVersion: 1.9 +Description: The common module introduces content parts that are going to be used by most content types (common, body, identity). +FeatureDescription: Core content parts. +Dependencies: Settings +Category: Core diff --git a/src/Orchard.Web/Core/Common/OwnerEditor/OwnerEditorDriver.cs b/src/Orchard.Web/Core/Common/OwnerEditor/OwnerEditorDriver.cs index 13ca214e29f..3707a35a455 100644 --- a/src/Orchard.Web/Core/Common/OwnerEditor/OwnerEditorDriver.cs +++ b/src/Orchard.Web/Core/Common/OwnerEditor/OwnerEditorDriver.cs @@ -1,78 +1,78 @@ -using Orchard.ContentManagement; -using Orchard.ContentManagement.Drivers; -using Orchard.Core.Common.Models; -using Orchard.Localization; -using Orchard.Security; - -namespace Orchard.Core.Common.OwnerEditor { - public class OwnerEditorDriver : ContentPartDriver { - private readonly IAuthenticationService _authenticationService; - private readonly IAuthorizationService _authorizationService; - private readonly IMembershipService _membershipService; - - public OwnerEditorDriver( - IOrchardServices services, - IAuthenticationService authenticationService, - IAuthorizationService authorizationService, - IMembershipService membershipService) { - _authenticationService = authenticationService; - _authorizationService = authorizationService; - _membershipService = membershipService; - T = NullLocalizer.Instance; - Services = services; - } - - public Localizer T { get; set; } - public IOrchardServices Services { get; set; } - - protected override string Prefix { - get { return "OwnerEditor"; } - } - - protected override DriverResult Editor(CommonPart part, dynamic shapeHelper) { - return Editor(part, null, shapeHelper); - } - - protected override DriverResult Editor(CommonPart part, IUpdateModel updater, dynamic shapeHelper) { - var currentUser = _authenticationService.GetAuthenticatedUser(); - if (!_authorizationService.TryCheckAccess(StandardPermissions.SiteOwner, currentUser, part)) { - return null; - } - - - var settings = part.TypePartDefinition.Settings.GetModel(); - if (!settings.ShowOwnerEditor) { - if (part.Owner == null) { - part.Owner = currentUser; - } - return null; - } - - return ContentShape( - "Parts_Common_Owner_Edit", - () => { - OwnerEditorViewModel model = shapeHelper.Parts_Common_Owner_Edit(typeof(OwnerEditorViewModel)); - - if (part.Owner != null) { - model.Owner = part.Owner.UserName; - } - - if (updater != null) { - var priorOwner = model.Owner; - updater.TryUpdateModel(model, Prefix, null, null); - - if (model.Owner != null && model.Owner != priorOwner) { - var newOwner = _membershipService.GetUser(model.Owner); - if (newOwner == null) { - updater.AddModelError("OwnerEditor.Owner", T("Invalid user name")); - } - else { - part.Owner = newOwner; - } - } - } - return model; - }); - } - } +using Orchard.ContentManagement; +using Orchard.ContentManagement.Drivers; +using Orchard.Core.Common.Models; +using Orchard.Localization; +using Orchard.Security; + +namespace Orchard.Core.Common.OwnerEditor { + public class OwnerEditorDriver : ContentPartDriver { + private readonly IAuthenticationService _authenticationService; + private readonly IAuthorizationService _authorizationService; + private readonly IMembershipService _membershipService; + + public OwnerEditorDriver( + IOrchardServices services, + IAuthenticationService authenticationService, + IAuthorizationService authorizationService, + IMembershipService membershipService) { + _authenticationService = authenticationService; + _authorizationService = authorizationService; + _membershipService = membershipService; + T = NullLocalizer.Instance; + Services = services; + } + + public Localizer T { get; set; } + public IOrchardServices Services { get; set; } + + protected override string Prefix { + get { return "OwnerEditor"; } + } + + protected override DriverResult Editor(CommonPart part, dynamic shapeHelper) { + return Editor(part, null, shapeHelper); + } + + protected override DriverResult Editor(CommonPart part, IUpdateModel updater, dynamic shapeHelper) { + var currentUser = _authenticationService.GetAuthenticatedUser(); + if (!_authorizationService.TryCheckAccess(StandardPermissions.SiteOwner, currentUser, part)) { + return null; + } + + + var settings = part.TypePartDefinition.Settings.GetModel(); + if (!settings.ShowOwnerEditor) { + if (part.Owner == null) { + part.Owner = currentUser; + } + return null; + } + + return ContentShape( + "Parts_Common_Owner_Edit", + () => { + OwnerEditorViewModel model = shapeHelper.Parts_Common_Owner_Edit(typeof(OwnerEditorViewModel)); + + if (part.Owner != null) { + model.Owner = part.Owner.UserName; + } + + if (updater != null) { + var priorOwner = model.Owner; + updater.TryUpdateModel(model, Prefix, null, null); + + if (model.Owner != null && model.Owner != priorOwner) { + var newOwner = _membershipService.GetUser(model.Owner); + if (newOwner == null) { + updater.AddModelError("OwnerEditor.Owner", T("Invalid user name")); + } + else { + part.Owner = newOwner; + } + } + } + return model; + }); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/OwnerEditor/OwnerEditorSettings.cs b/src/Orchard.Web/Core/Common/OwnerEditor/OwnerEditorSettings.cs index b9b070e0c8a..092e690be01 100644 --- a/src/Orchard.Web/Core/Common/OwnerEditor/OwnerEditorSettings.cs +++ b/src/Orchard.Web/Core/Common/OwnerEditor/OwnerEditorSettings.cs @@ -1,37 +1,37 @@ -using System.Collections.Generic; -using Orchard.ContentManagement; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.MetaData.Builders; -using Orchard.ContentManagement.MetaData.Models; -using Orchard.ContentManagement.ViewModels; - -namespace Orchard.Core.Common.OwnerEditor { - public class OwnerEditorSettings { - - public OwnerEditorSettings() { - // owner editor should is displayed by default - ShowOwnerEditor = true; - } - - public bool ShowOwnerEditor { get; set; } - } - - public class OwnerEditorSettingsEvents : ContentDefinitionEditorEventsBase { - public override IEnumerable TypePartEditor(ContentTypePartDefinition definition) { - if (definition.PartDefinition.Name == "CommonPart") { - var model = definition.Settings.GetModel(); - yield return DefinitionTemplate(model); - } - } - - public override IEnumerable TypePartEditorUpdate(ContentTypePartDefinitionBuilder builder, IUpdateModel upOwnerModel) { - if (builder.Name == "CommonPart") { - var model = new OwnerEditorSettings(); - if (upOwnerModel.TryUpdateModel(model, "OwnerEditorSettings", null, null)) { - builder.WithSetting("OwnerEditorSettings.ShowOwnerEditor", model.ShowOwnerEditor.ToString()); - } - yield return DefinitionTemplate(model); - } - } - } +using System.Collections.Generic; +using Orchard.ContentManagement; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Builders; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.ContentManagement.ViewModels; + +namespace Orchard.Core.Common.OwnerEditor { + public class OwnerEditorSettings { + + public OwnerEditorSettings() { + // owner editor should is displayed by default + ShowOwnerEditor = true; + } + + public bool ShowOwnerEditor { get; set; } + } + + public class OwnerEditorSettingsEvents : ContentDefinitionEditorEventsBase { + public override IEnumerable TypePartEditor(ContentTypePartDefinition definition) { + if (definition.PartDefinition.Name == "CommonPart") { + var model = definition.Settings.GetModel(); + yield return DefinitionTemplate(model); + } + } + + public override IEnumerable TypePartEditorUpdate(ContentTypePartDefinitionBuilder builder, IUpdateModel upOwnerModel) { + if (builder.Name == "CommonPart") { + var model = new OwnerEditorSettings(); + if (upOwnerModel.TryUpdateModel(model, "OwnerEditorSettings", null, null)) { + builder.WithSetting("OwnerEditorSettings.ShowOwnerEditor", model.ShowOwnerEditor.ToString()); + } + yield return DefinitionTemplate(model); + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/OwnerEditor/OwnerEditorViewModel.cs b/src/Orchard.Web/Core/Common/OwnerEditor/OwnerEditorViewModel.cs index d0e5822f394..e6a2d716302 100644 --- a/src/Orchard.Web/Core/Common/OwnerEditor/OwnerEditorViewModel.cs +++ b/src/Orchard.Web/Core/Common/OwnerEditor/OwnerEditorViewModel.cs @@ -1,9 +1,9 @@ -using System.ComponentModel.DataAnnotations; -using Orchard.DisplayManagement.Shapes; - -namespace Orchard.Core.Common.OwnerEditor { - public class OwnerEditorViewModel : Shape { - [Required] - public string Owner { get; set; } - } +using System.ComponentModel.DataAnnotations; +using Orchard.DisplayManagement.Shapes; + +namespace Orchard.Core.Common.OwnerEditor { + public class OwnerEditorViewModel : Shape { + [Required] + public string Owner { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Placement.info b/src/Orchard.Web/Core/Common/Placement.info index f9a6bf2597e..64c9be152f6 100644 --- a/src/Orchard.Web/Core/Common/Placement.info +++ b/src/Orchard.Web/Core/Common/Placement.info @@ -1,37 +1,37 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Common/ResourceManifest.cs b/src/Orchard.Web/Core/Common/ResourceManifest.cs index b2095f84920..13532d127be 100644 --- a/src/Orchard.Web/Core/Common/ResourceManifest.cs +++ b/src/Orchard.Web/Core/Common/ResourceManifest.cs @@ -1,10 +1,10 @@ -using Orchard.UI.Resources; - -namespace Orchard.Core.Common { - public class ResourceManifest : IResourceManifestProvider { - public void BuildManifests(ResourceManifestBuilder builder) { - var manifest = builder.Add(); - manifest.DefineStyle("DateTimeEditor").SetUrl("datetime-editor.css"); - } - } -} +using Orchard.UI.Resources; + +namespace Orchard.Core.Common { + public class ResourceManifest : IResourceManifestProvider { + public void BuildManifests(ResourceManifestBuilder builder) { + var manifest = builder.Add(); + manifest.DefineStyle("DateTimeEditor").SetUrl("datetime-editor.css"); + } + } +} diff --git a/src/Orchard.Web/Core/Common/Routes.cs b/src/Orchard.Web/Core/Common/Routes.cs index 8f8a94535fe..808eeb4814d 100644 --- a/src/Orchard.Web/Core/Common/Routes.cs +++ b/src/Orchard.Web/Core/Common/Routes.cs @@ -1,36 +1,36 @@ -using System.Collections.Generic; -using System.Web; -using System.Web.Mvc; -using System.Web.Routing; -using Orchard.Mvc.Routes; - -namespace Orchard.Core.Common { - public class Routes : IRouteProvider { - public void GetRoutes(ICollection routes) { - foreach (var routeDescriptor in GetRoutes()) - routes.Add(routeDescriptor); - } - - public IEnumerable GetRoutes() { - return new[] { - new RouteDescriptor { - Priority = -9999, - Route = new Route( - "{*path}", - new RouteValueDictionary { - {"area", "Common"}, - {"controller", "Error"}, - {"action", "NotFound"} - }, - new RouteValueDictionary { - }, - new RouteValueDictionary { - {"area", "Common"} - }, - new MvcRouteHandler()) - } - }; - } - - } +using System.Collections.Generic; +using System.Web; +using System.Web.Mvc; +using System.Web.Routing; +using Orchard.Mvc.Routes; + +namespace Orchard.Core.Common { + public class Routes : IRouteProvider { + public void GetRoutes(ICollection routes) { + foreach (var routeDescriptor in GetRoutes()) + routes.Add(routeDescriptor); + } + + public IEnumerable GetRoutes() { + return new[] { + new RouteDescriptor { + Priority = -9999, + Route = new Route( + "{*path}", + new RouteValueDictionary { + {"area", "Common"}, + {"controller", "Error"}, + {"action", "NotFound"} + }, + new RouteValueDictionary { + }, + new RouteValueDictionary { + {"area", "Common"} + }, + new MvcRouteHandler()) + } + }; + } + + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Services/BbcodeFilter.cs b/src/Orchard.Web/Core/Common/Services/BbcodeFilter.cs index a6c7aea4039..33c406cfded 100644 --- a/src/Orchard.Web/Core/Common/Services/BbcodeFilter.cs +++ b/src/Orchard.Web/Core/Common/Services/BbcodeFilter.cs @@ -1,102 +1,102 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Web; -using Orchard.Services; - -namespace Orchard.Core.Common.Services { - public class BbcodeFilter : IHtmlFilter { - public string ProcessContent(string text, string flavor) { - return BbcodeReplace(text); - } - - // Can be moved somewhere else once we have IoC enabled body text filters. - private static string BbcodeReplace(string text) { - if (string.IsNullOrEmpty(text)) - return string.Empty; - - // optimize code path if nothing to do - if (!text.Contains("[url]") && !text.Contains("[img]") && !text.Contains("[url=")) { - return text; - } - - var sb = new StringBuilder(text); - - var index = -1; - var allIndexes = new List(); - - // process all [url] - while (-1 != (index = text.IndexOf("[url]", index + 1, StringComparison.Ordinal))) { - allIndexes.Add(index); - } - - foreach(var start in allIndexes) { - var end = text.IndexOf("[/url]", start, StringComparison.Ordinal); - - if (end == -1) { - continue; - } - - var url = text.Substring(start + 5 , end - start - 5); - - // substitue [url] by - sb.Remove(start, end - start + 6); - sb.Insert(start, String.Format("{0}", url)); - } - - // [url={url}] - index = -1; - allIndexes.Clear(); - - while (-1 != (index = text.IndexOf("[url=", index + 1, StringComparison.Ordinal))) { - allIndexes.Add(index); - } - - foreach (var start in allIndexes) { - var urlEnd = text.IndexOf("]", start, StringComparison.Ordinal); - var end = text.IndexOf("[/url]", start, StringComparison.Ordinal); - - if (end == -1) { - continue; - } - - var url = text.Substring(start + 5, urlEnd - start - 5); - var title = text.Substring(urlEnd + 1, end - urlEnd - 1); - - // substitue [url] by - sb.Remove(start, end - start + 6); - sb.Insert(start, String.Format("{1}", url, title)); - } - - // [img] - index = -1; - allIndexes.Clear(); - - while (-1 != (index = text.IndexOf("[img]", index + 1, StringComparison.Ordinal))) { - allIndexes.Add(index); - } - - foreach (var start in allIndexes) { - var end = text.IndexOf("[/img]", start, StringComparison.Ordinal); - - if (end == -1) { - continue; - } - - var url = text.Substring(start + 5, end - start - 5); - - // substitue [url] by - sb.Remove(start, end - start + 6); - - if (!string.IsNullOrEmpty(url)) { - if (url[0] == '~') - url = VirtualPathUtility.ToAbsolute(url); - } - - sb.Insert(start, String.Format("", url)); - } - - return sb.ToString(); - } - } +using System; +using System.Collections.Generic; +using System.Text; +using System.Web; +using Orchard.Services; + +namespace Orchard.Core.Common.Services { + public class BbcodeFilter : IHtmlFilter { + public string ProcessContent(string text, string flavor) { + return BbcodeReplace(text); + } + + // Can be moved somewhere else once we have IoC enabled body text filters. + private static string BbcodeReplace(string text) { + if (string.IsNullOrEmpty(text)) + return string.Empty; + + // optimize code path if nothing to do + if (!text.Contains("[url]") && !text.Contains("[img]") && !text.Contains("[url=")) { + return text; + } + + var sb = new StringBuilder(text); + + var index = -1; + var allIndexes = new List(); + + // process all [url] + while (-1 != (index = text.IndexOf("[url]", index + 1, StringComparison.Ordinal))) { + allIndexes.Add(index); + } + + foreach(var start in allIndexes) { + var end = text.IndexOf("[/url]", start, StringComparison.Ordinal); + + if (end == -1) { + continue; + } + + var url = text.Substring(start + 5 , end - start - 5); + + // substitue [url] by + sb.Remove(start, end - start + 6); + sb.Insert(start, String.Format("{0}", url)); + } + + // [url={url}] + index = -1; + allIndexes.Clear(); + + while (-1 != (index = text.IndexOf("[url=", index + 1, StringComparison.Ordinal))) { + allIndexes.Add(index); + } + + foreach (var start in allIndexes) { + var urlEnd = text.IndexOf("]", start, StringComparison.Ordinal); + var end = text.IndexOf("[/url]", start, StringComparison.Ordinal); + + if (end == -1) { + continue; + } + + var url = text.Substring(start + 5, urlEnd - start - 5); + var title = text.Substring(urlEnd + 1, end - urlEnd - 1); + + // substitue [url] by + sb.Remove(start, end - start + 6); + sb.Insert(start, String.Format("{1}", url, title)); + } + + // [img] + index = -1; + allIndexes.Clear(); + + while (-1 != (index = text.IndexOf("[img]", index + 1, StringComparison.Ordinal))) { + allIndexes.Add(index); + } + + foreach (var start in allIndexes) { + var end = text.IndexOf("[/img]", start, StringComparison.Ordinal); + + if (end == -1) { + continue; + } + + var url = text.Substring(start + 5, end - start - 5); + + // substitue [url] by + sb.Remove(start, end - start + 6); + + if (!string.IsNullOrEmpty(url)) { + if (url[0] == '~') + url = VirtualPathUtility.ToAbsolute(url); + } + + sb.Insert(start, String.Format("", url)); + } + + return sb.ToString(); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Services/CommonService.cs b/src/Orchard.Web/Core/Common/Services/CommonService.cs index 72202a7b4f4..87f4538e080 100644 --- a/src/Orchard.Web/Core/Common/Services/CommonService.cs +++ b/src/Orchard.Web/Core/Common/Services/CommonService.cs @@ -1,19 +1,19 @@ -using Orchard.ContentManagement; -using Orchard.Tasks.Scheduling; - -namespace Orchard.Core.Common.Services { - public class CommonService : ICommonService { - private readonly IPublishingTaskManager _publishingTaskManager; - private readonly IContentManager _contentManager; - - public CommonService(IPublishingTaskManager publishingTaskManager, IContentManager contentManager) { - _publishingTaskManager = publishingTaskManager; - _contentManager = contentManager; - } - - void ICommonService.Publish(ContentItem contentItem) { - _publishingTaskManager.DeleteTasks(contentItem); - _contentManager.Publish(contentItem); - } - } +using Orchard.ContentManagement; +using Orchard.Tasks.Scheduling; + +namespace Orchard.Core.Common.Services { + public class CommonService : ICommonService { + private readonly IPublishingTaskManager _publishingTaskManager; + private readonly IContentManager _contentManager; + + public CommonService(IPublishingTaskManager publishingTaskManager, IContentManager contentManager) { + _publishingTaskManager = publishingTaskManager; + _contentManager = contentManager; + } + + void ICommonService.Publish(ContentItem contentItem) { + _publishingTaskManager.DeleteTasks(contentItem); + _contentManager.Publish(contentItem); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Services/ICommonService.cs b/src/Orchard.Web/Core/Common/Services/ICommonService.cs index 6b719df4b4e..c54f67ddece 100644 --- a/src/Orchard.Web/Core/Common/Services/ICommonService.cs +++ b/src/Orchard.Web/Core/Common/Services/ICommonService.cs @@ -1,7 +1,7 @@ -using Orchard.ContentManagement; - -namespace Orchard.Core.Common.Services { - public interface ICommonService : IDependency { - void Publish(ContentItem contentItem); - } +using Orchard.ContentManagement; + +namespace Orchard.Core.Common.Services { + public interface ICommonService : IDependency { + void Publish(ContentItem contentItem); + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Services/IdentifierResolverSelector.cs b/src/Orchard.Web/Core/Common/Services/IdentifierResolverSelector.cs index 1dff609c5fa..40739fbc4c5 100644 --- a/src/Orchard.Web/Core/Common/Services/IdentifierResolverSelector.cs +++ b/src/Orchard.Web/Core/Common/Services/IdentifierResolverSelector.cs @@ -1,40 +1,40 @@ -using System.Collections.Generic; -using System.Linq; -using Orchard.ContentManagement; -using Orchard.Core.Common.Models; - -namespace Orchard.Core.Common.Services { - public class IdentifierResolverSelector : IIdentityResolverSelector { - private readonly IContentManager _contentManager; - - public IdentifierResolverSelector(IContentManager contentManager) { - _contentManager = contentManager; - } - - public IdentityResolverSelectorResult GetResolver(ContentIdentity contentIdentity) { - if (contentIdentity.Has("Identifier")) { - return new IdentityResolverSelectorResult { - Priority = 5, - Resolve = ResolveIdentity - }; - } - - return null; - } - - private IEnumerable ResolveIdentity(ContentIdentity identity) { - var identifier = identity.Get("Identifier"); - - if (identifier == null) { - return null; - } - - return _contentManager - .Query() - .Where(p => p.Identifier == identifier) - .List() - .Where(c => ContentIdentity.ContentIdentityEqualityComparer.AreEquivalent( - identity, _contentManager.GetItemMetadata(c).Identity)); - } - } +using System.Collections.Generic; +using System.Linq; +using Orchard.ContentManagement; +using Orchard.Core.Common.Models; + +namespace Orchard.Core.Common.Services { + public class IdentifierResolverSelector : IIdentityResolverSelector { + private readonly IContentManager _contentManager; + + public IdentifierResolverSelector(IContentManager contentManager) { + _contentManager = contentManager; + } + + public IdentityResolverSelectorResult GetResolver(ContentIdentity contentIdentity) { + if (contentIdentity.Has("Identifier")) { + return new IdentityResolverSelectorResult { + Priority = 5, + Resolve = ResolveIdentity + }; + } + + return null; + } + + private IEnumerable ResolveIdentity(ContentIdentity identity) { + var identifier = identity.Get("Identifier"); + + if (identifier == null) { + return null; + } + + return _contentManager + .Query() + .Where(p => p.Identifier == identifier) + .List() + .Where(c => ContentIdentity.ContentIdentityEqualityComparer.AreEquivalent( + identity, _contentManager.GetItemMetadata(c).Identity)); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Services/TextFieldFilter.cs b/src/Orchard.Web/Core/Common/Services/TextFieldFilter.cs index 666e192441e..263d17af5bd 100644 --- a/src/Orchard.Web/Core/Common/Services/TextFieldFilter.cs +++ b/src/Orchard.Web/Core/Common/Services/TextFieldFilter.cs @@ -1,20 +1,20 @@ -using System; -using System.Web; -using Orchard.Services; -using Orchard.Utility.Extensions; - -namespace Orchard.Core.Common.Services { - public class TextFieldFilter : IHtmlFilter { - public string ProcessContent(string text, string flavor) { - // Flavor is null for a normal input/text field - return flavor == null || string.Equals(flavor, "textarea", StringComparison.OrdinalIgnoreCase) ? ReplaceNewLines(text) : text; - } - - private static string ReplaceNewLines(string text) { - if (string.IsNullOrEmpty(text)) - return string.Empty; - - return HttpUtility.HtmlEncode(text).ReplaceNewLinesWith("
      "); - } - } +using System; +using System.Web; +using Orchard.Services; +using Orchard.Utility.Extensions; + +namespace Orchard.Core.Common.Services { + public class TextFieldFilter : IHtmlFilter { + public string ProcessContent(string text, string flavor) { + // Flavor is null for a normal input/text field + return flavor == null || string.Equals(flavor, "textarea", StringComparison.OrdinalIgnoreCase) ? ReplaceNewLines(text) : text; + } + + private static string ReplaceNewLines(string text) { + if (string.IsNullOrEmpty(text)) + return string.Empty; + + return HttpUtility.HtmlEncode(text).ReplaceNewLinesWith("
      "); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Services/XmlRpcHandler.cs b/src/Orchard.Web/Core/Common/Services/XmlRpcHandler.cs index d2a6fed5596..9e011db3725 100644 --- a/src/Orchard.Web/Core/Common/Services/XmlRpcHandler.cs +++ b/src/Orchard.Web/Core/Common/Services/XmlRpcHandler.cs @@ -1,89 +1,89 @@ -using System; -using System.Collections.Generic; -using System.Xml.Linq; -using Orchard.ContentManagement; -using Orchard.Core.Common.Models; -using Orchard.Core.XmlRpc; -using Orchard.Core.XmlRpc.Models; - -namespace Orchard.Core.Common.Services { - public class XmlRpcHandler : IXmlRpcHandler { - private readonly IContentManager _contentManager; - - public XmlRpcHandler(IContentManager contentManager) { - _contentManager = contentManager; - } - - public void SetCapabilities(XElement options) { - const string manifestUri = "http://schemas.microsoft.com/wlw/manifest/weblog"; - options.SetElementValue(XName.Get("supportsCustomDate", manifestUri), "Yes"); - } - - public void Process(XmlRpcContext context) { - switch (context.Request.MethodName) { - case "metaWeblog.newPost": - MetaWeblogSetCustomCreatedDate( - Convert.ToInt32(context.Request.Params[0].Value), - Convert.ToString(context.Request.Params[1].Value), - Convert.ToString(context.Request.Params[2].Value), - (XRpcStruct) context.Request.Params[3].Value, - Convert.ToBoolean(context.Request.Params[4].Value), - context._drivers); - break; - case "metaWeblog.editPost": - MetaWeblogSetCustomCreatedDate( - Convert.ToInt32(context.Request.Params[0].Value), - Convert.ToString(context.Request.Params[1].Value), - Convert.ToString(context.Request.Params[2].Value), - (XRpcStruct) context.Request.Params[3].Value, - Convert.ToBoolean(context.Request.Params[4].Value), - context._drivers); - break; - } - } - - private void MetaWeblogSetCustomCreatedDate(int contentItemId, string userName, string password, XRpcStruct content, bool publish, ICollection drivers) { - if (!publish) - return; - - var createdUtc = content.Optional("dateCreated"); - if (createdUtc == null || createdUtc > DateTime.UtcNow) - return; - - var driver = new XmlRpcDriver(item => { - if (!(item is int)) - return; - - var id = (int)item; - var contentItem = _contentManager.Get(id, VersionOptions.Latest); - if (contentItem == null || !contentItem.Is()) // only pre-dating of content with the CommonPart (obviously) - return; - - contentItem.As().CreatedUtc = createdUtc; - }); - - if (contentItemId > 0) - driver.Process(contentItemId); - else - drivers.Add(driver); - } - - private static int GetId(XRpcMethodResponse response) { - return response != null && response.Params.Count == 1 && response.Params[0].Value is int - ? Convert.ToInt32(response.Params[0].Value) - : 0; - } - - public class XmlRpcDriver : IXmlRpcDriver { - private readonly Action _process; - - public XmlRpcDriver(Action process) { - _process = process; - } - - public void Process(object item) { - _process(item); - } - } - } +using System; +using System.Collections.Generic; +using System.Xml.Linq; +using Orchard.ContentManagement; +using Orchard.Core.Common.Models; +using Orchard.Core.XmlRpc; +using Orchard.Core.XmlRpc.Models; + +namespace Orchard.Core.Common.Services { + public class XmlRpcHandler : IXmlRpcHandler { + private readonly IContentManager _contentManager; + + public XmlRpcHandler(IContentManager contentManager) { + _contentManager = contentManager; + } + + public void SetCapabilities(XElement options) { + const string manifestUri = "http://schemas.microsoft.com/wlw/manifest/weblog"; + options.SetElementValue(XName.Get("supportsCustomDate", manifestUri), "Yes"); + } + + public void Process(XmlRpcContext context) { + switch (context.Request.MethodName) { + case "metaWeblog.newPost": + MetaWeblogSetCustomCreatedDate( + Convert.ToInt32(context.Request.Params[0].Value), + Convert.ToString(context.Request.Params[1].Value), + Convert.ToString(context.Request.Params[2].Value), + (XRpcStruct) context.Request.Params[3].Value, + Convert.ToBoolean(context.Request.Params[4].Value), + context._drivers); + break; + case "metaWeblog.editPost": + MetaWeblogSetCustomCreatedDate( + Convert.ToInt32(context.Request.Params[0].Value), + Convert.ToString(context.Request.Params[1].Value), + Convert.ToString(context.Request.Params[2].Value), + (XRpcStruct) context.Request.Params[3].Value, + Convert.ToBoolean(context.Request.Params[4].Value), + context._drivers); + break; + } + } + + private void MetaWeblogSetCustomCreatedDate(int contentItemId, string userName, string password, XRpcStruct content, bool publish, ICollection drivers) { + if (!publish) + return; + + var createdUtc = content.Optional("dateCreated"); + if (createdUtc == null || createdUtc > DateTime.UtcNow) + return; + + var driver = new XmlRpcDriver(item => { + if (!(item is int)) + return; + + var id = (int)item; + var contentItem = _contentManager.Get(id, VersionOptions.Latest); + if (contentItem == null || !contentItem.Is()) // only pre-dating of content with the CommonPart (obviously) + return; + + contentItem.As().CreatedUtc = createdUtc; + }); + + if (contentItemId > 0) + driver.Process(contentItemId); + else + drivers.Add(driver); + } + + private static int GetId(XRpcMethodResponse response) { + return response != null && response.Params.Count == 1 && response.Params[0].Value is int + ? Convert.ToInt32(response.Params[0].Value) + : 0; + } + + public class XmlRpcDriver : IXmlRpcDriver { + private readonly Action _process; + + public XmlRpcDriver(Action process) { + _process = process; + } + + public void Process(object item) { + _process(item); + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Settings/BodySettings.cs b/src/Orchard.Web/Core/Common/Settings/BodySettings.cs index 44f47d89fe4..38a7760e924 100644 --- a/src/Orchard.Web/Core/Common/Settings/BodySettings.cs +++ b/src/Orchard.Web/Core/Common/Settings/BodySettings.cs @@ -1,71 +1,71 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using Orchard.ContentManagement; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.MetaData.Builders; -using Orchard.ContentManagement.MetaData.Models; -using Orchard.ContentManagement.ViewModels; - -namespace Orchard.Core.Common.Settings { - public class BodyPartSettings { - public const string FlavorDefaultDefault = "html"; - private string _flavorDefault; - - [DataType("Flavor")] - public string FlavorDefault { - get { return !string.IsNullOrWhiteSpace(_flavorDefault) - ? _flavorDefault - : FlavorDefaultDefault; } - set { _flavorDefault = value; } - } - } - - public class BodyTypePartSettings { - [DataType("Flavor")] - public string Flavor { get; set; } - } - - public class BodySettingsHooks : ContentDefinitionEditorEventsBase { - public override IEnumerable TypePartEditor(ContentTypePartDefinition definition) { - if (definition.PartDefinition.Name != "BodyPart") - yield break; - - var model = definition.Settings.GetModel(); - - if (string.IsNullOrWhiteSpace(model.Flavor)) { - var partModel = definition.PartDefinition.Settings.GetModel(); - model.Flavor = partModel.FlavorDefault; - } - - yield return DefinitionTemplate(model); - } - - public override IEnumerable PartEditor(ContentPartDefinition definition) { - if (definition.Name != "BodyPart") - yield break; - - var model = definition.Settings.GetModel(); - yield return DefinitionTemplate(model); - } - - public override IEnumerable TypePartEditorUpdate(ContentTypePartDefinitionBuilder builder, IUpdateModel updateModel) { - if (builder.Name != "BodyPart") - yield break; - - var model = new BodyTypePartSettings(); - updateModel.TryUpdateModel(model, "BodyTypePartSettings", null, null); - builder.WithSetting("BodyTypePartSettings.Flavor", !string.IsNullOrWhiteSpace(model.Flavor) ? model.Flavor : null); - yield return DefinitionTemplate(model); - } - - public override IEnumerable PartEditorUpdate(ContentPartDefinitionBuilder builder, IUpdateModel updateModel) { - if (builder.Name != "BodyPart") - yield break; - - var model = new BodyPartSettings(); - updateModel.TryUpdateModel(model, "BodyPartSettings", null, null); - builder.WithSetting("BodyPartSettings.FlavorDefault", !string.IsNullOrWhiteSpace(model.FlavorDefault) ? model.FlavorDefault : null); - yield return DefinitionTemplate(model); - } - } -} +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Orchard.ContentManagement; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Builders; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.ContentManagement.ViewModels; + +namespace Orchard.Core.Common.Settings { + public class BodyPartSettings { + public const string FlavorDefaultDefault = "html"; + private string _flavorDefault; + + [DataType("Flavor")] + public string FlavorDefault { + get { return !string.IsNullOrWhiteSpace(_flavorDefault) + ? _flavorDefault + : FlavorDefaultDefault; } + set { _flavorDefault = value; } + } + } + + public class BodyTypePartSettings { + [DataType("Flavor")] + public string Flavor { get; set; } + } + + public class BodySettingsHooks : ContentDefinitionEditorEventsBase { + public override IEnumerable TypePartEditor(ContentTypePartDefinition definition) { + if (definition.PartDefinition.Name != "BodyPart") + yield break; + + var model = definition.Settings.GetModel(); + + if (string.IsNullOrWhiteSpace(model.Flavor)) { + var partModel = definition.PartDefinition.Settings.GetModel(); + model.Flavor = partModel.FlavorDefault; + } + + yield return DefinitionTemplate(model); + } + + public override IEnumerable PartEditor(ContentPartDefinition definition) { + if (definition.Name != "BodyPart") + yield break; + + var model = definition.Settings.GetModel(); + yield return DefinitionTemplate(model); + } + + public override IEnumerable TypePartEditorUpdate(ContentTypePartDefinitionBuilder builder, IUpdateModel updateModel) { + if (builder.Name != "BodyPart") + yield break; + + var model = new BodyTypePartSettings(); + updateModel.TryUpdateModel(model, "BodyTypePartSettings", null, null); + builder.WithSetting("BodyTypePartSettings.Flavor", !string.IsNullOrWhiteSpace(model.Flavor) ? model.Flavor : null); + yield return DefinitionTemplate(model); + } + + public override IEnumerable PartEditorUpdate(ContentPartDefinitionBuilder builder, IUpdateModel updateModel) { + if (builder.Name != "BodyPart") + yield break; + + var model = new BodyPartSettings(); + updateModel.TryUpdateModel(model, "BodyPartSettings", null, null); + builder.WithSetting("BodyPartSettings.FlavorDefault", !string.IsNullOrWhiteSpace(model.FlavorDefault) ? model.FlavorDefault : null); + yield return DefinitionTemplate(model); + } + } +} diff --git a/src/Orchard.Web/Core/Common/Settings/TextFieldSettings.cs b/src/Orchard.Web/Core/Common/Settings/TextFieldSettings.cs index 981f205c8e5..9b0b8d11d64 100644 --- a/src/Orchard.Web/Core/Common/Settings/TextFieldSettings.cs +++ b/src/Orchard.Web/Core/Common/Settings/TextFieldSettings.cs @@ -1,11 +1,11 @@ -using System.ComponentModel.DataAnnotations; - -namespace Orchard.Core.Common.Settings { - - public class TextFieldSettings { - [DataType("Flavor")] - public string Flavor { get; set; } - public bool Required { get; set; } - public string Hint { get; set; } - } -} +using System.ComponentModel.DataAnnotations; + +namespace Orchard.Core.Common.Settings { + + public class TextFieldSettings { + [DataType("Flavor")] + public string Flavor { get; set; } + public bool Required { get; set; } + public string Hint { get; set; } + } +} diff --git a/src/Orchard.Web/Core/Common/Settings/TextFieldSettingsEvents.cs b/src/Orchard.Web/Core/Common/Settings/TextFieldSettingsEvents.cs index c7a97caa4d9..f9a35f5c86e 100644 --- a/src/Orchard.Web/Core/Common/Settings/TextFieldSettingsEvents.cs +++ b/src/Orchard.Web/Core/Common/Settings/TextFieldSettingsEvents.cs @@ -1,41 +1,41 @@ -using System.Collections.Generic; -using System.Globalization; -using Orchard.ContentManagement; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.MetaData.Builders; -using Orchard.ContentManagement.MetaData.Models; -using Orchard.ContentManagement.ViewModels; -using Orchard.Core.Common.ViewModels; - -namespace Orchard.Core.Common.Settings { - public class TextFieldSettingsEvents : ContentDefinitionEditorEventsBase { - - public override IEnumerable PartFieldEditor(ContentPartFieldDefinition definition) { - if (definition.FieldDefinition.Name == "TextField") { - var model = new TextFieldSettingsEventsViewModel { - Settings = definition.Settings.GetModel(), - }; - - yield return DefinitionTemplate(model); - } - } - - public override IEnumerable PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel) { - if (builder.FieldType != "TextField") { - yield break; - } - - var model = new TextFieldSettingsEventsViewModel { - Settings = new TextFieldSettings() - }; - - if (updateModel.TryUpdateModel(model, "TextFieldSettingsEventsViewModel", null, null)) { - builder.WithSetting("TextFieldSettings.Flavor", model.Settings.Flavor); - builder.WithSetting("TextFieldSettings.Hint", model.Settings.Hint); - builder.WithSetting("TextFieldSettings.Required", model.Settings.Required.ToString(CultureInfo.InvariantCulture)); - - yield return DefinitionTemplate(model); - } - } - } +using System.Collections.Generic; +using System.Globalization; +using Orchard.ContentManagement; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Builders; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.ContentManagement.ViewModels; +using Orchard.Core.Common.ViewModels; + +namespace Orchard.Core.Common.Settings { + public class TextFieldSettingsEvents : ContentDefinitionEditorEventsBase { + + public override IEnumerable PartFieldEditor(ContentPartFieldDefinition definition) { + if (definition.FieldDefinition.Name == "TextField") { + var model = new TextFieldSettingsEventsViewModel { + Settings = definition.Settings.GetModel(), + }; + + yield return DefinitionTemplate(model); + } + } + + public override IEnumerable PartFieldEditorUpdate(ContentPartFieldDefinitionBuilder builder, IUpdateModel updateModel) { + if (builder.FieldType != "TextField") { + yield break; + } + + var model = new TextFieldSettingsEventsViewModel { + Settings = new TextFieldSettings() + }; + + if (updateModel.TryUpdateModel(model, "TextFieldSettingsEventsViewModel", null, null)) { + builder.WithSetting("TextFieldSettings.Flavor", model.Settings.Flavor); + builder.WithSetting("TextFieldSettings.Hint", model.Settings.Hint); + builder.WithSetting("TextFieldSettings.Required", model.Settings.Required.ToString(CultureInfo.InvariantCulture)); + + yield return DefinitionTemplate(model); + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Shapes.cs b/src/Orchard.Web/Core/Common/Shapes.cs index 31a9e1ac462..29d2f2fabcb 100644 --- a/src/Orchard.Web/Core/Common/Shapes.cs +++ b/src/Orchard.Web/Core/Common/Shapes.cs @@ -1,42 +1,42 @@ -using System; -using System.Web; -using System.Web.Mvc; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.Localization; -using Orchard.Mvc.Html; - -namespace Orchard.Core.Common { - public class Shapes : IShapeTableProvider { - public Shapes() { - T = NullLocalizer.Instance; - } - - public Localizer T { get; set; } - - public void Discover(ShapeTableBuilder builder) { - builder.Describe("Body_Editor") - .OnDisplaying(displaying => { - string flavor = displaying.Shape.EditorFlavor; - displaying.ShapeMetadata.Alternates.Add("Body_Editor__" + flavor); - }); - } - - [Shape] - public IHtmlString PublishedState(dynamic Display, DateTime createdDateTimeUtc, DateTime? publisheddateTimeUtc) { - if (!publisheddateTimeUtc.HasValue) { - return T("Draft"); - } - - return Display.DateTime(DateTimeUtc: createdDateTimeUtc); - } - - [Shape] - public IHtmlString PublishedWhen(dynamic Display, DateTime? dateTimeUtc) { - if (dateTimeUtc == null) - return T("as a Draft"); - - return Display.DateTimeRelative(DateTimeUtc: dateTimeUtc); - } - } -} +using System; +using System.Web; +using System.Web.Mvc; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.Localization; +using Orchard.Mvc.Html; + +namespace Orchard.Core.Common { + public class Shapes : IShapeTableProvider { + public Shapes() { + T = NullLocalizer.Instance; + } + + public Localizer T { get; set; } + + public void Discover(ShapeTableBuilder builder) { + builder.Describe("Body_Editor") + .OnDisplaying(displaying => { + string flavor = displaying.Shape.EditorFlavor; + displaying.ShapeMetadata.Alternates.Add("Body_Editor__" + flavor); + }); + } + + [Shape] + public IHtmlString PublishedState(dynamic Display, DateTime createdDateTimeUtc, DateTime? publisheddateTimeUtc) { + if (!publisheddateTimeUtc.HasValue) { + return T("Draft"); + } + + return Display.DateTime(DateTimeUtc: createdDateTimeUtc); + } + + [Shape] + public IHtmlString PublishedWhen(dynamic Display, DateTime? dateTimeUtc) { + if (dateTimeUtc == null) + return T("as a Draft"); + + return Display.DateTimeRelative(DateTimeUtc: dateTimeUtc); + } + } +} diff --git a/src/Orchard.Web/Core/Common/Styles/Web.config b/src/Orchard.Web/Core/Common/Styles/Web.config index 74c71f22bd5..11135c33761 100644 --- a/src/Orchard.Web/Core/Common/Styles/Web.config +++ b/src/Orchard.Web/Core/Common/Styles/Web.config @@ -1,16 +1,16 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Common/Utilities/LazyField.cs b/src/Orchard.Web/Core/Common/Utilities/LazyField.cs index d0d879bcc9f..1872db05ed4 100644 --- a/src/Orchard.Web/Core/Common/Utilities/LazyField.cs +++ b/src/Orchard.Web/Core/Common/Utilities/LazyField.cs @@ -1,40 +1,40 @@ -using System; - -namespace Orchard.Core.Common.Utilities { - public class LazyField { - private T _value; - private Func _loader; - private Func _setter; - - public T Value { - get {return GetValue();} - set {SetValue(value);} - } - - public void Loader(Func loader) { - _loader = loader; - } - - public void Setter(Func setter) { - _setter = setter; - } - - private T GetValue() { - if (_loader != null) { - _value = _loader(); - _loader = null; - } - return _value; - } - - private void SetValue(T value) { - _loader = null; - if (_setter != null) { - _value = _setter(value); - } - else { - _value = value; - } - } - } +using System; + +namespace Orchard.Core.Common.Utilities { + public class LazyField { + private T _value; + private Func _loader; + private Func _setter; + + public T Value { + get {return GetValue();} + set {SetValue(value);} + } + + public void Loader(Func loader) { + _loader = loader; + } + + public void Setter(Func setter) { + _setter = setter; + } + + private T GetValue() { + if (_loader != null) { + _value = _loader(); + _loader = null; + } + return _value; + } + + private void SetValue(T value) { + _loader = null; + if (_setter != null) { + _value = _setter(value); + } + else { + _value = value; + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/ViewModels/BodyEditorViewModel.cs b/src/Orchard.Web/Core/Common/ViewModels/BodyEditorViewModel.cs index 383eb7d82f5..8b1a1d2e047 100644 --- a/src/Orchard.Web/Core/Common/ViewModels/BodyEditorViewModel.cs +++ b/src/Orchard.Web/Core/Common/ViewModels/BodyEditorViewModel.cs @@ -1,20 +1,20 @@ -using Orchard.Core.Common.Models; - -namespace Orchard.Core.Common.ViewModels { - public class BodyEditorViewModel { - public BodyPart BodyPart { get; set; } - - public string Text { - get { return BodyPart.Text; } - set { BodyPart.Text = value; } - } - - public string Format { - get { return BodyPart.Format; } - set { BodyPart.Format = value; } - } - - public string EditorFlavor { get; set; } - public string AddMediaPath { get; set; } - } +using Orchard.Core.Common.Models; + +namespace Orchard.Core.Common.ViewModels { + public class BodyEditorViewModel { + public BodyPart BodyPart { get; set; } + + public string Text { + get { return BodyPart.Text; } + set { BodyPart.Text = value; } + } + + public string Format { + get { return BodyPart.Format; } + set { BodyPart.Format = value; } + } + + public string EditorFlavor { get; set; } + public string AddMediaPath { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/ViewModels/ContainerEditorViewModel.cs b/src/Orchard.Web/Core/Common/ViewModels/ContainerEditorViewModel.cs index 38010c2cd7a..92a818080ee 100644 --- a/src/Orchard.Web/Core/Common/ViewModels/ContainerEditorViewModel.cs +++ b/src/Orchard.Web/Core/Common/ViewModels/ContainerEditorViewModel.cs @@ -1,6 +1,6 @@ -namespace Orchard.Core.Common.ViewModels { - public class ContainerEditorViewModel { - - public int? ContainerId { get; set; } - } +namespace Orchard.Core.Common.ViewModels { + public class ContainerEditorViewModel { + + public int? ContainerId { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/ViewModels/TextFieldDriverViewModel.cs b/src/Orchard.Web/Core/Common/ViewModels/TextFieldDriverViewModel.cs index 5ea87f6e455..564e04e19d7 100644 --- a/src/Orchard.Web/Core/Common/ViewModels/TextFieldDriverViewModel.cs +++ b/src/Orchard.Web/Core/Common/ViewModels/TextFieldDriverViewModel.cs @@ -1,12 +1,12 @@ -using Orchard.ContentManagement; -using Orchard.Core.Common.Fields; -using Orchard.Core.Common.Settings; - -namespace Orchard.Core.Common.ViewModels { - public class TextFieldDriverViewModel { - public TextField Field { get; set; } - public string Text { get; set; } - public TextFieldSettings Settings { get; set; } - public IContent ContentItem { get; set; } - } +using Orchard.ContentManagement; +using Orchard.Core.Common.Fields; +using Orchard.Core.Common.Settings; + +namespace Orchard.Core.Common.ViewModels { + public class TextFieldDriverViewModel { + public TextField Field { get; set; } + public string Text { get; set; } + public TextFieldSettings Settings { get; set; } + public IContent ContentItem { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/ViewModels/TextFieldSettingsEventsViewModel.cs b/src/Orchard.Web/Core/Common/ViewModels/TextFieldSettingsEventsViewModel.cs index 55636e0a9fa..1b3781f8763 100644 --- a/src/Orchard.Web/Core/Common/ViewModels/TextFieldSettingsEventsViewModel.cs +++ b/src/Orchard.Web/Core/Common/ViewModels/TextFieldSettingsEventsViewModel.cs @@ -1,7 +1,7 @@ -using Orchard.Core.Common.Settings; - -namespace Orchard.Core.Common.ViewModels { - public class TextFieldSettingsEventsViewModel { - public TextFieldSettings Settings { get; set; } - } +using Orchard.Core.Common.Settings; + +namespace Orchard.Core.Common.ViewModels { + public class TextFieldSettingsEventsViewModel { + public TextFieldSettings Settings { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Views/Body-Textarea.Editor.cshtml b/src/Orchard.Web/Core/Common/Views/Body-Textarea.Editor.cshtml index 92a2d43c47d..98ca9d2364a 100644 --- a/src/Orchard.Web/Core/Common/Views/Body-Textarea.Editor.cshtml +++ b/src/Orchard.Web/Core/Common/Views/Body-Textarea.Editor.cshtml @@ -1,13 +1,13 @@ -@{ - var htmlAttributes = new Dictionary(); - - if (Model.Required == true) { - htmlAttributes["required"] = "required"; - } - - if (Model.AutoFocus == true) { - htmlAttributes["autofocus"] = "autofocus"; - } -} - +@{ + var htmlAttributes = new Dictionary(); + + if (Model.Required == true) { + htmlAttributes["required"] = "required"; + } + + if (Model.AutoFocus == true) { + htmlAttributes["autofocus"] = "autofocus"; + } +} + @Html.TextArea("Text", (string)Model.Text, 25, 80, htmlAttributes) \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Views/Body.Editor.cshtml b/src/Orchard.Web/Core/Common/Views/Body.Editor.cshtml index 57992bb3043..1cddc06badc 100644 --- a/src/Orchard.Web/Core/Common/Views/Body.Editor.cshtml +++ b/src/Orchard.Web/Core/Common/Views/Body.Editor.cshtml @@ -1,18 +1,18 @@ -@using Orchard.Utility.Extensions; -@{ - string editorFlavor = Model.EditorFlavor; - - var htmlAttributes = new Dictionary { - {"class", editorFlavor.HtmlClassify()} - }; - - if (Model.Required == true) { - htmlAttributes["required"] = "required"; - } - - if (Model.AutoFocus == true) { - htmlAttributes["autofocus"] = "autofocus"; - } -} - +@using Orchard.Utility.Extensions; +@{ + string editorFlavor = Model.EditorFlavor; + + var htmlAttributes = new Dictionary { + {"class", editorFlavor.HtmlClassify()} + }; + + if (Model.Required == true) { + htmlAttributes["required"] = "required"; + } + + if (Model.AutoFocus == true) { + htmlAttributes["autofocus"] = "autofocus"; + } +} + @Html.TextArea("Text", (string)Model.Text, 25, 80, htmlAttributes) \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Views/CommonMetadataOwner.cshtml b/src/Orchard.Web/Core/Common/Views/CommonMetadataOwner.cshtml index ba90291727c..d029bffec7d 100644 --- a/src/Orchard.Web/Core/Common/Views/CommonMetadataOwner.cshtml +++ b/src/Orchard.Web/Core/Common/Views/CommonMetadataOwner.cshtml @@ -1,14 +1,14 @@ -@* - Model: - ContentPart -*@ - -@using Orchard.ContentManagement; -@using Orchard.Core.Common.Models; -@using Orchard.Security; -@{ - CommonPart commonPart = Model.ContentPart; - // owner isn't really who last modified this, is it? - IUser owner = commonPart.As() == null ? null : commonPart.As().Owner; -} +@* + Model: + ContentPart +*@ + +@using Orchard.ContentManagement; +@using Orchard.Core.Common.Models; +@using Orchard.Security; +@{ + CommonPart commonPart = Model.ContentPart; + // owner isn't really who last modified this, is it? + IUser owner = commonPart.As() == null ? null : commonPart.As().Owner; +} @T("By {0}", owner == null ? T("unknown").ToString() : Convert.ToString(Html.ItemDisplayText(owner))) \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Views/DefinitionTemplates/BodyPartSettings.cshtml b/src/Orchard.Web/Core/Common/Views/DefinitionTemplates/BodyPartSettings.cshtml index cb8cf1d77dc..20e394aacf3 100644 --- a/src/Orchard.Web/Core/Common/Views/DefinitionTemplates/BodyPartSettings.cshtml +++ b/src/Orchard.Web/Core/Common/Views/DefinitionTemplates/BodyPartSettings.cshtml @@ -1,6 +1,6 @@ -@model Orchard.Core.Common.Settings.BodyPartSettings -
      - - @Html.EditorFor(m => m.FlavorDefault) - @Html.ValidationMessageFor(m => m.FlavorDefault) +@model Orchard.Core.Common.Settings.BodyPartSettings +
      + + @Html.EditorFor(m => m.FlavorDefault) + @Html.ValidationMessageFor(m => m.FlavorDefault)
      \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Views/DefinitionTemplates/BodyTypePartSettings.cshtml b/src/Orchard.Web/Core/Common/Views/DefinitionTemplates/BodyTypePartSettings.cshtml index 28813fbe1ad..c7c3b9c3774 100644 --- a/src/Orchard.Web/Core/Common/Views/DefinitionTemplates/BodyTypePartSettings.cshtml +++ b/src/Orchard.Web/Core/Common/Views/DefinitionTemplates/BodyTypePartSettings.cshtml @@ -1,6 +1,6 @@ -@model Orchard.Core.Common.Settings.BodyTypePartSettings -
      - - @Html.EditorFor(m => m.Flavor) - @Html.ValidationMessageFor(m => m.Flavor) +@model Orchard.Core.Common.Settings.BodyTypePartSettings +
      + + @Html.EditorFor(m => m.Flavor) + @Html.ValidationMessageFor(m => m.Flavor)
      \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Views/DefinitionTemplates/DateEditorSettings.cshtml b/src/Orchard.Web/Core/Common/Views/DefinitionTemplates/DateEditorSettings.cshtml index ea16c5e6db9..eff1f6578a1 100644 --- a/src/Orchard.Web/Core/Common/Views/DefinitionTemplates/DateEditorSettings.cshtml +++ b/src/Orchard.Web/Core/Common/Views/DefinitionTemplates/DateEditorSettings.cshtml @@ -1,8 +1,8 @@ -@model Orchard.Core.Common.DateEditor.DateEditorSettings -
      -
      - @Html.EditorFor(m=>m.ShowDateEditor) - - @Html.ValidationMessageFor(m => m.ShowDateEditor) -
      -
      +@model Orchard.Core.Common.DateEditor.DateEditorSettings +
      +
      + @Html.EditorFor(m=>m.ShowDateEditor) + + @Html.ValidationMessageFor(m => m.ShowDateEditor) +
      +
      diff --git a/src/Orchard.Web/Core/Common/Views/DefinitionTemplates/OwnerEditorSettings.cshtml b/src/Orchard.Web/Core/Common/Views/DefinitionTemplates/OwnerEditorSettings.cshtml index d395d80579a..a1b64f068a6 100644 --- a/src/Orchard.Web/Core/Common/Views/DefinitionTemplates/OwnerEditorSettings.cshtml +++ b/src/Orchard.Web/Core/Common/Views/DefinitionTemplates/OwnerEditorSettings.cshtml @@ -1,9 +1,9 @@ -@model Orchard.Core.Common.OwnerEditor.OwnerEditorSettings - -
      -
      - @Html.EditorFor(m=>m.ShowOwnerEditor) - - @Html.ValidationMessageFor(m => m.ShowOwnerEditor) -
      -
      +@model Orchard.Core.Common.OwnerEditor.OwnerEditorSettings + +
      +
      + @Html.EditorFor(m=>m.ShowOwnerEditor) + + @Html.ValidationMessageFor(m => m.ShowOwnerEditor) +
      +
      diff --git a/src/Orchard.Web/Core/Common/Views/DefinitionTemplates/TextFieldSettingsEventsViewModel.cshtml b/src/Orchard.Web/Core/Common/Views/DefinitionTemplates/TextFieldSettingsEventsViewModel.cshtml index 4078ccb5026..ac37910c3fd 100644 --- a/src/Orchard.Web/Core/Common/Views/DefinitionTemplates/TextFieldSettingsEventsViewModel.cshtml +++ b/src/Orchard.Web/Core/Common/Views/DefinitionTemplates/TextFieldSettingsEventsViewModel.cshtml @@ -1,21 +1,21 @@ -@model Orchard.Core.Common.ViewModels.TextFieldSettingsEventsViewModel - -
      -
      - - @Html.EditorFor(m => m.Settings.Flavor) - @Html.ValidationMessageFor(m => m.Settings.Flavor) -
      -
      -
      -
      - @Html.CheckBoxFor(m => m.Settings.Required) - @T("Check to ensure the user enters a value in this field.") -
      -
      -
      - - @Html.TextAreaFor(m => m.Settings.Hint, new { @class = "text medium", rows = "5" }) - @T("The help text is written under the field when authors are editing the content item.") - @Html.ValidationMessageFor(m => m.Settings.Hint) +@model Orchard.Core.Common.ViewModels.TextFieldSettingsEventsViewModel + +
      +
      + + @Html.EditorFor(m => m.Settings.Flavor) + @Html.ValidationMessageFor(m => m.Settings.Flavor) +
      +
      +
      +
      + @Html.CheckBoxFor(m => m.Settings.Required) + @T("Check to ensure the user enters a value in this field.") +
      +
      +
      + + @Html.TextAreaFor(m => m.Settings.Hint, new { @class = "text medium", rows = "5" }) + @T("The help text is written under the field when authors are editing the content item.") + @Html.ValidationMessageFor(m => m.Settings.Hint)
      \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Views/EditorTemplates/Fields.Common.Text.Edit.cshtml b/src/Orchard.Web/Core/Common/Views/EditorTemplates/Fields.Common.Text.Edit.cshtml index 0d256ab75a9..165e7bc8cd2 100644 --- a/src/Orchard.Web/Core/Common/Views/EditorTemplates/Fields.Common.Text.Edit.cshtml +++ b/src/Orchard.Web/Core/Common/Views/EditorTemplates/Fields.Common.Text.Edit.cshtml @@ -1,15 +1,15 @@ -@model Orchard.Core.Common.ViewModels.TextFieldDriverViewModel - -
      - - @if (String.IsNullOrWhiteSpace(Model.Settings.Flavor)) { - @(Model.Settings.Required ? Html.TextBoxFor(m => m.Text, new {@class = "text", required = "required"}) : Html.TextBoxFor(m => m.Text, new {@class = "text"})) - @Html.ValidationMessageFor(m => m.Text) - } - else { - @Display.Body_Editor(Text: Model.Text, EditorFlavor: Model.Settings.Flavor, Required: Model.Settings.Required, ContentItem: Model.ContentItem) - } - @if (HasText(Model.Settings.Hint)) { - @Model.Settings.Hint - } -
      +@model Orchard.Core.Common.ViewModels.TextFieldDriverViewModel + +
      + + @if (String.IsNullOrWhiteSpace(Model.Settings.Flavor)) { + @(Model.Settings.Required ? Html.TextBoxFor(m => m.Text, new {@class = "text", required = "required"}) : Html.TextBoxFor(m => m.Text, new {@class = "text"})) + @Html.ValidationMessageFor(m => m.Text) + } + else { + @Display.Body_Editor(Text: Model.Text, EditorFlavor: Model.Settings.Flavor, Required: Model.Settings.Required, ContentItem: Model.ContentItem) + } + @if (HasText(Model.Settings.Hint)) { + @Model.Settings.Hint + } +
      diff --git a/src/Orchard.Web/Core/Common/Views/EditorTemplates/Parts.Common.Body.cshtml b/src/Orchard.Web/Core/Common/Views/EditorTemplates/Parts.Common.Body.cshtml index c44c2043dcd..1e3e488a679 100644 --- a/src/Orchard.Web/Core/Common/Views/EditorTemplates/Parts.Common.Body.cshtml +++ b/src/Orchard.Web/Core/Common/Views/EditorTemplates/Parts.Common.Body.cshtml @@ -1,7 +1,7 @@ -@model BodyEditorViewModel -@using Orchard.Core.Common.ViewModels; -
      - - @Display.Body_Editor(Text: Model.Text, EditorFlavor: Model.EditorFlavor, Required: false, AutoFocus: false, ContentItem: Model.BodyPart.ContentItem) - @Html.ValidationMessageFor(m => m.Text) +@model BodyEditorViewModel +@using Orchard.Core.Common.ViewModels; +
      + + @Display.Body_Editor(Text: Model.Text, EditorFlavor: Model.EditorFlavor, Required: false, AutoFocus: false, ContentItem: Model.BodyPart.ContentItem) + @Html.ValidationMessageFor(m => m.Text)
      \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Views/EditorTemplates/Parts.Common.Container.cshtml b/src/Orchard.Web/Core/Common/Views/EditorTemplates/Parts.Common.Container.cshtml index 6afd59c029b..749ad4fa081 100644 --- a/src/Orchard.Web/Core/Common/Views/EditorTemplates/Parts.Common.Container.cshtml +++ b/src/Orchard.Web/Core/Common/Views/EditorTemplates/Parts.Common.Container.cshtml @@ -1,5 +1,5 @@ -@model ContainerEditorViewModel -@using Orchard.Core.Common.ViewModels; -
      - @Html.HiddenFor(m=>m.ContainerId) +@model ContainerEditorViewModel +@using Orchard.Core.Common.ViewModels; +
      + @Html.HiddenFor(m=>m.ContainerId)
      \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Views/Fields.Common.Text.cshtml b/src/Orchard.Web/Core/Common/Views/Fields.Common.Text.cshtml index 1811733f352..8b0f1782bc8 100644 --- a/src/Orchard.Web/Core/Common/Views/Fields.Common.Text.cshtml +++ b/src/Orchard.Web/Core/Common/Views/Fields.Common.Text.cshtml @@ -1,7 +1,7 @@ -@{ - string name = Model.ContentField.DisplayName; -} - -@if (HasText(name) && HasText(Model.Value)) { -

      @name: @Model.Value

      +@{ + string name = Model.ContentField.DisplayName; +} + +@if (HasText(name) && HasText(Model.Value)) { +

      @name: @Model.Value

      } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Views/Parts.Common.Body.Summary.cshtml b/src/Orchard.Web/Core/Common/Views/Parts.Common.Body.Summary.cshtml index df01f3a7e9f..5131c240aa4 100644 --- a/src/Orchard.Web/Core/Common/Views/Parts.Common.Body.Summary.cshtml +++ b/src/Orchard.Web/Core/Common/Views/Parts.Common.Body.Summary.cshtml @@ -1,9 +1,9 @@ -@*doing excerpt generation on the way out for now so we don't stick ourselves with needing to regen excerpts for existing data - also, doing this here, inline, until we have a pluggable processing model (both in and out) - also, ...this is ugly *@ -@{ - Orchard.ContentManagement.ContentItem contentItem = Model.ContentPart.ContentItem; - string bodyHtml = Model.Html.ToString(); - var body = new HtmlString(Html.Excerpt(bodyHtml, 200).ToString().Replace(Environment.NewLine, "

      " + Environment.NewLine + "

      ")); -} +@*doing excerpt generation on the way out for now so we don't stick ourselves with needing to regen excerpts for existing data + also, doing this here, inline, until we have a pluggable processing model (both in and out) + also, ...this is ugly *@ +@{ + Orchard.ContentManagement.ContentItem contentItem = Model.ContentPart.ContentItem; + string bodyHtml = Model.Html.ToString(); + var body = new HtmlString(Html.Excerpt(bodyHtml, 200).ToString().Replace(Environment.NewLine, "

      " + Environment.NewLine + "

      ")); +}

      @body @Html.ItemDisplayLink(T("more").ToString(), contentItem)

      \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Views/Parts.Common.Date.Edit.cshtml b/src/Orchard.Web/Core/Common/Views/Parts.Common.Date.Edit.cshtml index 295faa86028..e59a06601ec 100644 --- a/src/Orchard.Web/Core/Common/Views/Parts.Common.Date.Edit.cshtml +++ b/src/Orchard.Web/Core/Common/Views/Parts.Common.Date.Edit.cshtml @@ -1,5 +1,5 @@ -@model Orchard.Core.Common.DateEditor.DateEditorViewModel -
      - - @Html.EditorFor(m => Model.Editor) -
      +@model Orchard.Core.Common.DateEditor.DateEditorViewModel +
      + + @Html.EditorFor(m => Model.Editor) +
      diff --git a/src/Orchard.Web/Core/Common/Views/Parts.Common.Metadata.SummaryAdmin.cshtml b/src/Orchard.Web/Core/Common/Views/Parts.Common.Metadata.SummaryAdmin.cshtml index 74a76a27d79..b91893d3c2a 100644 --- a/src/Orchard.Web/Core/Common/Views/Parts.Common.Metadata.SummaryAdmin.cshtml +++ b/src/Orchard.Web/Core/Common/Views/Parts.Common.Metadata.SummaryAdmin.cshtml @@ -1,12 +1,12 @@ -@using Orchard.ContentManagement; -@using Orchard.Core.Common.Models; -@{ - CommonPart commonPart = Model.ContentPart; - DateTime? modifiedUtc = commonPart.As() == null ? null : commonPart.As().ModifiedUtc; -} -
        -
      • @if (modifiedUtc.HasValue) { - @T("Last modified: {0}", Display.DateTimeRelative(DateTimeUtc: modifiedUtc.Value))} |  -
      • -
      • @Display.CommonMetadataOwner(ContentPart: Model.ContentPart)
      • +@using Orchard.ContentManagement; +@using Orchard.Core.Common.Models; +@{ + CommonPart commonPart = Model.ContentPart; + DateTime? modifiedUtc = commonPart.As() == null ? null : commonPart.As().ModifiedUtc; +} +
          +
        • @if (modifiedUtc.HasValue) { + @T("Last modified: {0}", Display.DateTimeRelative(DateTimeUtc: modifiedUtc.Value))} |  +
        • +
        • @Display.CommonMetadataOwner(ContentPart: Model.ContentPart)
        \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Views/Parts.Common.Owner.Edit.cshtml b/src/Orchard.Web/Core/Common/Views/Parts.Common.Owner.Edit.cshtml index 94eebc95b2c..476261f83c3 100644 --- a/src/Orchard.Web/Core/Common/Views/Parts.Common.Owner.Edit.cshtml +++ b/src/Orchard.Web/Core/Common/Views/Parts.Common.Owner.Edit.cshtml @@ -1,9 +1,9 @@ -@model Orchard.Core.Common.OwnerEditor.OwnerEditorViewModel -@{ - var OwnerEditor = Model; -} -
        - @Html.LabelFor(m => OwnerEditor.Owner, T("Owner")) - @Html.EditorFor(m => OwnerEditor.Owner) - @Html.ValidationMessageFor(m => OwnerEditor.Owner) -
        +@model Orchard.Core.Common.OwnerEditor.OwnerEditorViewModel +@{ + var OwnerEditor = Model; +} +
        + @Html.LabelFor(m => OwnerEditor.Owner, T("Owner")) + @Html.EditorFor(m => OwnerEditor.Owner) + @Html.ValidationMessageFor(m => OwnerEditor.Owner) +
        diff --git a/src/Orchard.Web/Core/Containers/Controllers/ItemController.cs b/src/Orchard.Web/Core/Containers/Controllers/ItemController.cs index 714686cd69d..3a67992d0ac 100644 --- a/src/Orchard.Web/Core/Containers/Controllers/ItemController.cs +++ b/src/Orchard.Web/Core/Containers/Controllers/ItemController.cs @@ -1,66 +1,66 @@ -using System; -using System.Linq; -using System.Web.Mvc; -using System.Web.Routing; -using Orchard.ContentManagement; -using Orchard.Core.Common.Models; -using Orchard.Core.Containers.Extensions; -using Orchard.Core.Containers.Models; -using Orchard.Core.Contents; -using Orchard.Core.Feeds; -using Orchard.DisplayManagement; -using Orchard.Mvc; -using Orchard.Themes; -using Orchard.UI.Navigation; -using Orchard.Settings; -using Orchard.Localization; - -namespace Orchard.Core.Containers.Controllers { - - public class ItemController : Controller { - private readonly IContentManager _contentManager; - private readonly ISiteService _siteService; - private readonly IFeedManager _feedManager; - - public ItemController( - IContentManager contentManager, - IShapeFactory shapeFactory, - ISiteService siteService, - IFeedManager feedManager, - IOrchardServices services) { - - _contentManager = contentManager; - _siteService = siteService; - _feedManager = feedManager; - Shape = shapeFactory; - Services = services; - T = NullLocalizer.Instance; - } - - dynamic Shape { get; set; } - public IOrchardServices Services { get; private set; } - - public Localizer T { get; set; } - [Themed] - public ActionResult Display(int id, PagerParameters pagerParameters) { - var container = _contentManager - .Get(id, VersionOptions.Published) - .As(); - - if (container == null) { - return HttpNotFound(T("Container not found").Text); - } - - if (!Services.Authorizer.Authorize(Permissions.ViewContent, container, T("Cannot view content"))) { - return new HttpUnauthorizedResult(); - } - - // TODO: (PH) Find a way to apply PagerParameters via a driver so we can lose this controller - container.PagerParameters = pagerParameters; - var model = _contentManager.BuildDisplay(container); - - return new ShapeResult(this, model); - } - - } +using System; +using System.Linq; +using System.Web.Mvc; +using System.Web.Routing; +using Orchard.ContentManagement; +using Orchard.Core.Common.Models; +using Orchard.Core.Containers.Extensions; +using Orchard.Core.Containers.Models; +using Orchard.Core.Contents; +using Orchard.Core.Feeds; +using Orchard.DisplayManagement; +using Orchard.Mvc; +using Orchard.Themes; +using Orchard.UI.Navigation; +using Orchard.Settings; +using Orchard.Localization; + +namespace Orchard.Core.Containers.Controllers { + + public class ItemController : Controller { + private readonly IContentManager _contentManager; + private readonly ISiteService _siteService; + private readonly IFeedManager _feedManager; + + public ItemController( + IContentManager contentManager, + IShapeFactory shapeFactory, + ISiteService siteService, + IFeedManager feedManager, + IOrchardServices services) { + + _contentManager = contentManager; + _siteService = siteService; + _feedManager = feedManager; + Shape = shapeFactory; + Services = services; + T = NullLocalizer.Instance; + } + + dynamic Shape { get; set; } + public IOrchardServices Services { get; private set; } + + public Localizer T { get; set; } + [Themed] + public ActionResult Display(int id, PagerParameters pagerParameters) { + var container = _contentManager + .Get(id, VersionOptions.Published) + .As(); + + if (container == null) { + return HttpNotFound(T("Container not found").Text); + } + + if (!Services.Authorizer.Authorize(Permissions.ViewContent, container, T("Cannot view content"))) { + return new HttpUnauthorizedResult(); + } + + // TODO: (PH) Find a way to apply PagerParameters via a driver so we can lose this controller + container.PagerParameters = pagerParameters; + var model = _contentManager.BuildDisplay(container); + + return new ShapeResult(this, model); + } + + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Containers/Drivers/ContainablePartDriver.cs b/src/Orchard.Web/Core/Containers/Drivers/ContainablePartDriver.cs index ad109333793..144b147cd6c 100644 --- a/src/Orchard.Web/Core/Containers/Drivers/ContainablePartDriver.cs +++ b/src/Orchard.Web/Core/Containers/Drivers/ContainablePartDriver.cs @@ -1,100 +1,100 @@ -using System; -using System.Linq; -using System.Web.Mvc; -using System.Xml; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Drivers; -using Orchard.Core.Common.Models; -using Orchard.Core.Containers.Models; -using Orchard.Core.Containers.Services; -using Orchard.Core.Containers.Settings; -using Orchard.Core.Containers.ViewModels; -using Orchard.Localization; -using Orchard.ContentManagement.Handlers; - -namespace Orchard.Core.Containers.Drivers { - public class ContainablePartDriver : ContentPartDriver { - private readonly IContentManager _contentManager; - private readonly IContainerService _containerService; - - public ContainablePartDriver(IContentManager contentManager, IContainerService containerService) { - _contentManager = contentManager; - _containerService = containerService; - T = NullLocalizer.Instance; - } - - public Localizer T { get; set; } - - protected override DriverResult Editor(ContainablePart part, dynamic shapeHelper) { - return Editor(part, (IUpdateModel)null, shapeHelper); - } - - protected override DriverResult Editor(ContainablePart part, IUpdateModel updater, dynamic shapeHelper) { - return ContentShape( - "Parts_Containable_Edit", - () => { - var settings = part.TypePartDefinition.Settings.GetModel(); - var commonPart = part.As(); - var model = new ContainableViewModel { - ShowContainerPicker = settings.ShowContainerPicker, - ShowPositionEditor = settings.ShowPositionEditor, - Position = part.Position - }; - - if (commonPart != null && commonPart.Container != null) { - model.ContainerId = commonPart.Container.Id; - } - - if (part.Id == 0 && commonPart != null && commonPart.Container != null) { - part.Position = _containerService.GetFirstPosition(commonPart.Container.Id) + 1; - } - - if (updater != null) { - var oldContainerId = model.ContainerId; - updater.TryUpdateModel(model, "Containable", null, new[] { "ShowContainerPicker", "ShowPositionEditor" }); - if (oldContainerId != model.ContainerId && settings.ShowContainerPicker) { - if (commonPart != null) { - var containerItem = _contentManager.Get(model.ContainerId, VersionOptions.Latest); - commonPart.Container = containerItem; - } - } - part.Position = model.Position; - } - - if (settings.ShowContainerPicker) { - var containers = _contentManager - .Query(VersionOptions.Latest) - .List() - .Where(container => container.ItemContentTypes.Any(type => type.Name == part.TypeDefinition.Name)); - - var listItems = new[] { new SelectListItem { Text = T("(None)").Text, Value = "0" } } - .Concat(containers.Select(x => new SelectListItem { - Value = Convert.ToString(x.Id), - Text = x.ContentItem.TypeDefinition.DisplayName + ": " + _contentManager.GetItemMetadata(x.ContentItem).DisplayText, - Selected = x.Id == model.ContainerId, - })) - .ToList(); - - model.AvailableContainers = new SelectList(listItems, "Value", "Text", model.ContainerId); - } - - model.Position = part.Position; - - return shapeHelper.EditorTemplate(TemplateName: "Containable", Model: model, Prefix: "Containable"); - }); - } - - protected override void Importing(ContainablePart part, ImportContentContext context) { - // Don't do anything if the tag is not specified. - if (context.Data.Element(part.PartDefinition.Name) == null) { - return; - } - - context.ImportAttribute(part.PartDefinition.Name, "Position", s => part.Position = XmlConvert.ToInt32(s)); - } - - protected override void Exporting(ContainablePart part, ExportContentContext context) { - context.Element(part.PartDefinition.Name).SetAttributeValue("Position", part.Position); - } - } -} +using System; +using System.Linq; +using System.Web.Mvc; +using System.Xml; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Drivers; +using Orchard.Core.Common.Models; +using Orchard.Core.Containers.Models; +using Orchard.Core.Containers.Services; +using Orchard.Core.Containers.Settings; +using Orchard.Core.Containers.ViewModels; +using Orchard.Localization; +using Orchard.ContentManagement.Handlers; + +namespace Orchard.Core.Containers.Drivers { + public class ContainablePartDriver : ContentPartDriver { + private readonly IContentManager _contentManager; + private readonly IContainerService _containerService; + + public ContainablePartDriver(IContentManager contentManager, IContainerService containerService) { + _contentManager = contentManager; + _containerService = containerService; + T = NullLocalizer.Instance; + } + + public Localizer T { get; set; } + + protected override DriverResult Editor(ContainablePart part, dynamic shapeHelper) { + return Editor(part, (IUpdateModel)null, shapeHelper); + } + + protected override DriverResult Editor(ContainablePart part, IUpdateModel updater, dynamic shapeHelper) { + return ContentShape( + "Parts_Containable_Edit", + () => { + var settings = part.TypePartDefinition.Settings.GetModel(); + var commonPart = part.As(); + var model = new ContainableViewModel { + ShowContainerPicker = settings.ShowContainerPicker, + ShowPositionEditor = settings.ShowPositionEditor, + Position = part.Position + }; + + if (commonPart != null && commonPart.Container != null) { + model.ContainerId = commonPart.Container.Id; + } + + if (part.Id == 0 && commonPart != null && commonPart.Container != null) { + part.Position = _containerService.GetFirstPosition(commonPart.Container.Id) + 1; + } + + if (updater != null) { + var oldContainerId = model.ContainerId; + updater.TryUpdateModel(model, "Containable", null, new[] { "ShowContainerPicker", "ShowPositionEditor" }); + if (oldContainerId != model.ContainerId && settings.ShowContainerPicker) { + if (commonPart != null) { + var containerItem = _contentManager.Get(model.ContainerId, VersionOptions.Latest); + commonPart.Container = containerItem; + } + } + part.Position = model.Position; + } + + if (settings.ShowContainerPicker) { + var containers = _contentManager + .Query(VersionOptions.Latest) + .List() + .Where(container => container.ItemContentTypes.Any(type => type.Name == part.TypeDefinition.Name)); + + var listItems = new[] { new SelectListItem { Text = T("(None)").Text, Value = "0" } } + .Concat(containers.Select(x => new SelectListItem { + Value = Convert.ToString(x.Id), + Text = x.ContentItem.TypeDefinition.DisplayName + ": " + _contentManager.GetItemMetadata(x.ContentItem).DisplayText, + Selected = x.Id == model.ContainerId, + })) + .ToList(); + + model.AvailableContainers = new SelectList(listItems, "Value", "Text", model.ContainerId); + } + + model.Position = part.Position; + + return shapeHelper.EditorTemplate(TemplateName: "Containable", Model: model, Prefix: "Containable"); + }); + } + + protected override void Importing(ContainablePart part, ImportContentContext context) { + // Don't do anything if the tag is not specified. + if (context.Data.Element(part.PartDefinition.Name) == null) { + return; + } + + context.ImportAttribute(part.PartDefinition.Name, "Position", s => part.Position = XmlConvert.ToInt32(s)); + } + + protected override void Exporting(ContainablePart part, ExportContentContext context) { + context.Element(part.PartDefinition.Name).SetAttributeValue("Position", part.Position); + } + } +} diff --git a/src/Orchard.Web/Core/Containers/Drivers/ContainerPartDriver.cs b/src/Orchard.Web/Core/Containers/Drivers/ContainerPartDriver.cs index 2fc421bd669..5682a512a28 100644 --- a/src/Orchard.Web/Core/Containers/Drivers/ContainerPartDriver.cs +++ b/src/Orchard.Web/Core/Containers/Drivers/ContainerPartDriver.cs @@ -1,169 +1,169 @@ -using System.Collections.Generic; -using System.Linq; -using System.Xml; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Drivers; -using Orchard.ContentManagement.Handlers; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.MetaData.Models; -using Orchard.Core.Common.Models; -using Orchard.Core.Containers.Models; -using Orchard.Core.Containers.Services; -using Orchard.Core.Containers.ViewModels; -using Orchard.Localization; -using Orchard.UI.Notify; -using System.Web.Routing; -using Orchard.Settings; -using Orchard.Core.Feeds; -using Orchard.UI.Navigation; - -namespace Orchard.Core.Containers.Drivers { - public class ContainerPartDriver : ContentPartDriver { - private readonly IContentDefinitionManager _contentDefinitionManager; - private readonly IOrchardServices _orchardServices; - private readonly IContentManager _contentManager; - private readonly ISiteService _siteService; - private readonly IFeedManager _feedManager; - private readonly IContainerService _containerService; - - public ContainerPartDriver( - IContentDefinitionManager contentDefinitionManager, - IOrchardServices orchardServices, - ISiteService siteService, - IFeedManager feedManager, IContainerService containerService) { - _contentDefinitionManager = contentDefinitionManager; - _orchardServices = orchardServices; - _contentManager = orchardServices.ContentManager; - _siteService = siteService; - _feedManager = feedManager; - _containerService = containerService; - - T = NullLocalizer.Instance; - } - - public Localizer T { get; set; } - - protected override DriverResult Display(ContainerPart part, string displayType, dynamic shapeHelper) { - if (!part.ItemsShown) - return null; - - return ContentShape("Parts_Container_Contained", () => { - var container = part.ContentItem; - var query = _contentManager - .Query(VersionOptions.Published) - .Join().Where(x => x.Container.Id == container.Id) - .Join().OrderByDescending(x => x.Position); - - var metadata = container.ContentManager.GetItemMetadata(container); - if (metadata!=null) - _feedManager.Register(metadata.DisplayText, "rss", new RouteValueDictionary { { "containerid", container.Id } }); - - var pager = new Pager(_siteService.GetSiteSettings(), part.PagerParameters); - pager.PageSize = part.PagerParameters.PageSize != null && part.Paginated - ? pager.PageSize - : part.PageSize; - - var pagerShape = shapeHelper.Pager(pager).TotalItemCount(query.Count()); - var startIndex = part.Paginated ? pager.GetStartIndex() : 0; - var pageOfItems = query.Slice(startIndex, pager.PageSize).ToList(); - - var listShape = shapeHelper.List(); - listShape.AddRange(pageOfItems.Select(item => _contentManager.BuildDisplay(item, "Summary"))); - listShape.Classes.Add("content-items"); - listShape.Classes.Add("list-items"); - - return shapeHelper.Parts_Container_Contained( - List: listShape, - Pager: part.Paginated ? pagerShape : null - ); - }); - } - - protected override DriverResult Editor(ContainerPart part, dynamic shapeHelper) { - if (!_contentDefinitionManager.ListTypeDefinitions().Any(typeDefinition => typeDefinition.Parts.Any(partDefinition => partDefinition.PartDefinition.Name == "ContainablePart"))) { - _orchardServices.Notifier.Warning(T("There are no content types in the system with a Containable part attached. Consider adding a Containable part to some content type, existing or new, in order to relate items to this (Container enabled) item.")); - } - return Editor(part, (IUpdateModel)null, shapeHelper); - } - - protected override DriverResult Editor(ContainerPart part, IUpdateModel updater, dynamic shapeHelper) { - return ContentShape("Parts_Container_Edit", () => { - if(!part.ContainerSettings.DisplayContainerEditor) { - return null; - } - - var containables = !part.ContainerSettings.RestrictItemContentTypes ? _containerService.GetContainableTypes().ToList() : new List(0); - var model = new ContainerViewModel { - AdminMenuPosition = part.AdminMenuPosition, - AdminMenuText = part.AdminMenuText, - AdminMenuImageSet = part.AdminMenuImageSet, - ItemsShown = part.ItemsShown, - PageSize = part.PageSize, - Paginated = part.Paginated, - SelectedItemContentTypes = part.ItemContentTypes.Select(x => x.Name).ToList(), - ShowOnAdminMenu = part.ShowOnAdminMenu, - AvailableItemContentTypes = containables, - RestrictItemContentTypes = part.ContainerSettings.RestrictItemContentTypes, - EnablePositioning = part.Record.EnablePositioning, - OverrideEnablePositioning = part.ContainerSettings.EnablePositioning == null - }; - - if (updater != null) { - if (updater.TryUpdateModel(model, "Container", null, new[] { "OverrideEnablePositioning" })) { - part.AdminMenuPosition = model.AdminMenuPosition; - part.AdminMenuText = model.AdminMenuText; - part.AdminMenuImageSet = model.AdminMenuImageSet; - part.ItemsShown = model.ItemsShown; - part.PageSize = model.PageSize; - part.Paginated = model.Paginated; - part.ShowOnAdminMenu = model.ShowOnAdminMenu; - - if (!part.ContainerSettings.RestrictItemContentTypes) { - part.ItemContentTypes = _contentDefinitionManager.ListTypeDefinitions().Where(x => model.SelectedItemContentTypes.Contains(x.Name)); - } - - if (model.OverrideEnablePositioning) { - part.Record.EnablePositioning = model.EnablePositioning; - } - } - } - - return shapeHelper.EditorTemplate(TemplateName: "Container", Model: model, Prefix: "Container"); - }); - } - - protected override void Importing(ContainerPart part, ImportContentContext context) { - // Don't do anything if the tag is not specified. - if (context.Data.Element(part.PartDefinition.Name) == null) { - return; - } - - context.ImportAttribute(part.PartDefinition.Name, "ItemContentTypes", itemContentType => { - if (_contentDefinitionManager.GetTypeDefinition(itemContentType) != null) { - part.Record.ItemContentTypes = itemContentType; - } - }); - - context.ImportAttribute(part.PartDefinition.Name, "ItemsShown", s => part.ItemsShown = XmlConvert.ToBoolean(s)); - context.ImportAttribute(part.PartDefinition.Name, "Paginated", s => part.Paginated = XmlConvert.ToBoolean(s)); - context.ImportAttribute(part.PartDefinition.Name, "PageSize", s => part.PageSize = XmlConvert.ToInt32(s)); - context.ImportAttribute(part.PartDefinition.Name, "ShowOnAdminMenu", s => part.ShowOnAdminMenu = XmlConvert.ToBoolean(s)); - context.ImportAttribute(part.PartDefinition.Name, "AdminMenuText", s => part.AdminMenuText = s); - context.ImportAttribute(part.PartDefinition.Name, "AdminMenuPosition", s => part.AdminMenuPosition = s); - context.ImportAttribute(part.PartDefinition.Name, "AdminMenuImageSet", s => part.AdminMenuImageSet = s); - context.ImportAttribute(part.PartDefinition.Name, "ItemCount", s => part.ItemCount = XmlConvert.ToInt32(s)); - } - - protected override void Exporting(ContainerPart part, ExportContentContext context) { - context.Element(part.PartDefinition.Name).SetAttributeValue("ItemContentTypes", part.Record.ItemContentTypes); - context.Element(part.PartDefinition.Name).SetAttributeValue("ItemsShown", part.ItemsShown); - context.Element(part.PartDefinition.Name).SetAttributeValue("Paginated", part.Paginated); - context.Element(part.PartDefinition.Name).SetAttributeValue("PageSize", part.PageSize); - context.Element(part.PartDefinition.Name).SetAttributeValue("ShowOnAdminMenu", part.ShowOnAdminMenu); - context.Element(part.PartDefinition.Name).SetAttributeValue("AdminMenuText", part.AdminMenuText); - context.Element(part.PartDefinition.Name).SetAttributeValue("AdminMenuPosition", part.AdminMenuPosition); - context.Element(part.PartDefinition.Name).SetAttributeValue("AdminMenuImageSet", part.AdminMenuImageSet); - context.Element(part.PartDefinition.Name).SetAttributeValue("ItemCount", part.ItemCount); - } - } -} +using System.Collections.Generic; +using System.Linq; +using System.Xml; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Drivers; +using Orchard.ContentManagement.Handlers; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.Core.Common.Models; +using Orchard.Core.Containers.Models; +using Orchard.Core.Containers.Services; +using Orchard.Core.Containers.ViewModels; +using Orchard.Localization; +using Orchard.UI.Notify; +using System.Web.Routing; +using Orchard.Settings; +using Orchard.Core.Feeds; +using Orchard.UI.Navigation; + +namespace Orchard.Core.Containers.Drivers { + public class ContainerPartDriver : ContentPartDriver { + private readonly IContentDefinitionManager _contentDefinitionManager; + private readonly IOrchardServices _orchardServices; + private readonly IContentManager _contentManager; + private readonly ISiteService _siteService; + private readonly IFeedManager _feedManager; + private readonly IContainerService _containerService; + + public ContainerPartDriver( + IContentDefinitionManager contentDefinitionManager, + IOrchardServices orchardServices, + ISiteService siteService, + IFeedManager feedManager, IContainerService containerService) { + _contentDefinitionManager = contentDefinitionManager; + _orchardServices = orchardServices; + _contentManager = orchardServices.ContentManager; + _siteService = siteService; + _feedManager = feedManager; + _containerService = containerService; + + T = NullLocalizer.Instance; + } + + public Localizer T { get; set; } + + protected override DriverResult Display(ContainerPart part, string displayType, dynamic shapeHelper) { + if (!part.ItemsShown) + return null; + + return ContentShape("Parts_Container_Contained", () => { + var container = part.ContentItem; + var query = _contentManager + .Query(VersionOptions.Published) + .Join().Where(x => x.Container.Id == container.Id) + .Join().OrderByDescending(x => x.Position); + + var metadata = container.ContentManager.GetItemMetadata(container); + if (metadata!=null) + _feedManager.Register(metadata.DisplayText, "rss", new RouteValueDictionary { { "containerid", container.Id } }); + + var pager = new Pager(_siteService.GetSiteSettings(), part.PagerParameters); + pager.PageSize = part.PagerParameters.PageSize != null && part.Paginated + ? pager.PageSize + : part.PageSize; + + var pagerShape = shapeHelper.Pager(pager).TotalItemCount(query.Count()); + var startIndex = part.Paginated ? pager.GetStartIndex() : 0; + var pageOfItems = query.Slice(startIndex, pager.PageSize).ToList(); + + var listShape = shapeHelper.List(); + listShape.AddRange(pageOfItems.Select(item => _contentManager.BuildDisplay(item, "Summary"))); + listShape.Classes.Add("content-items"); + listShape.Classes.Add("list-items"); + + return shapeHelper.Parts_Container_Contained( + List: listShape, + Pager: part.Paginated ? pagerShape : null + ); + }); + } + + protected override DriverResult Editor(ContainerPart part, dynamic shapeHelper) { + if (!_contentDefinitionManager.ListTypeDefinitions().Any(typeDefinition => typeDefinition.Parts.Any(partDefinition => partDefinition.PartDefinition.Name == "ContainablePart"))) { + _orchardServices.Notifier.Warning(T("There are no content types in the system with a Containable part attached. Consider adding a Containable part to some content type, existing or new, in order to relate items to this (Container enabled) item.")); + } + return Editor(part, (IUpdateModel)null, shapeHelper); + } + + protected override DriverResult Editor(ContainerPart part, IUpdateModel updater, dynamic shapeHelper) { + return ContentShape("Parts_Container_Edit", () => { + if(!part.ContainerSettings.DisplayContainerEditor) { + return null; + } + + var containables = !part.ContainerSettings.RestrictItemContentTypes ? _containerService.GetContainableTypes().ToList() : new List(0); + var model = new ContainerViewModel { + AdminMenuPosition = part.AdminMenuPosition, + AdminMenuText = part.AdminMenuText, + AdminMenuImageSet = part.AdminMenuImageSet, + ItemsShown = part.ItemsShown, + PageSize = part.PageSize, + Paginated = part.Paginated, + SelectedItemContentTypes = part.ItemContentTypes.Select(x => x.Name).ToList(), + ShowOnAdminMenu = part.ShowOnAdminMenu, + AvailableItemContentTypes = containables, + RestrictItemContentTypes = part.ContainerSettings.RestrictItemContentTypes, + EnablePositioning = part.Record.EnablePositioning, + OverrideEnablePositioning = part.ContainerSettings.EnablePositioning == null + }; + + if (updater != null) { + if (updater.TryUpdateModel(model, "Container", null, new[] { "OverrideEnablePositioning" })) { + part.AdminMenuPosition = model.AdminMenuPosition; + part.AdminMenuText = model.AdminMenuText; + part.AdminMenuImageSet = model.AdminMenuImageSet; + part.ItemsShown = model.ItemsShown; + part.PageSize = model.PageSize; + part.Paginated = model.Paginated; + part.ShowOnAdminMenu = model.ShowOnAdminMenu; + + if (!part.ContainerSettings.RestrictItemContentTypes) { + part.ItemContentTypes = _contentDefinitionManager.ListTypeDefinitions().Where(x => model.SelectedItemContentTypes.Contains(x.Name)); + } + + if (model.OverrideEnablePositioning) { + part.Record.EnablePositioning = model.EnablePositioning; + } + } + } + + return shapeHelper.EditorTemplate(TemplateName: "Container", Model: model, Prefix: "Container"); + }); + } + + protected override void Importing(ContainerPart part, ImportContentContext context) { + // Don't do anything if the tag is not specified. + if (context.Data.Element(part.PartDefinition.Name) == null) { + return; + } + + context.ImportAttribute(part.PartDefinition.Name, "ItemContentTypes", itemContentType => { + if (_contentDefinitionManager.GetTypeDefinition(itemContentType) != null) { + part.Record.ItemContentTypes = itemContentType; + } + }); + + context.ImportAttribute(part.PartDefinition.Name, "ItemsShown", s => part.ItemsShown = XmlConvert.ToBoolean(s)); + context.ImportAttribute(part.PartDefinition.Name, "Paginated", s => part.Paginated = XmlConvert.ToBoolean(s)); + context.ImportAttribute(part.PartDefinition.Name, "PageSize", s => part.PageSize = XmlConvert.ToInt32(s)); + context.ImportAttribute(part.PartDefinition.Name, "ShowOnAdminMenu", s => part.ShowOnAdminMenu = XmlConvert.ToBoolean(s)); + context.ImportAttribute(part.PartDefinition.Name, "AdminMenuText", s => part.AdminMenuText = s); + context.ImportAttribute(part.PartDefinition.Name, "AdminMenuPosition", s => part.AdminMenuPosition = s); + context.ImportAttribute(part.PartDefinition.Name, "AdminMenuImageSet", s => part.AdminMenuImageSet = s); + context.ImportAttribute(part.PartDefinition.Name, "ItemCount", s => part.ItemCount = XmlConvert.ToInt32(s)); + } + + protected override void Exporting(ContainerPart part, ExportContentContext context) { + context.Element(part.PartDefinition.Name).SetAttributeValue("ItemContentTypes", part.Record.ItemContentTypes); + context.Element(part.PartDefinition.Name).SetAttributeValue("ItemsShown", part.ItemsShown); + context.Element(part.PartDefinition.Name).SetAttributeValue("Paginated", part.Paginated); + context.Element(part.PartDefinition.Name).SetAttributeValue("PageSize", part.PageSize); + context.Element(part.PartDefinition.Name).SetAttributeValue("ShowOnAdminMenu", part.ShowOnAdminMenu); + context.Element(part.PartDefinition.Name).SetAttributeValue("AdminMenuText", part.AdminMenuText); + context.Element(part.PartDefinition.Name).SetAttributeValue("AdminMenuPosition", part.AdminMenuPosition); + context.Element(part.PartDefinition.Name).SetAttributeValue("AdminMenuImageSet", part.AdminMenuImageSet); + context.Element(part.PartDefinition.Name).SetAttributeValue("ItemCount", part.ItemCount); + } + } +} diff --git a/src/Orchard.Web/Core/Containers/Drivers/ContainerWidgetPartDriver.cs b/src/Orchard.Web/Core/Containers/Drivers/ContainerWidgetPartDriver.cs index b8c9018aa63..974743aa359 100644 --- a/src/Orchard.Web/Core/Containers/Drivers/ContainerWidgetPartDriver.cs +++ b/src/Orchard.Web/Core/Containers/Drivers/ContainerWidgetPartDriver.cs @@ -1,115 +1,115 @@ -using System; -using System.Linq; -using System.Web.Mvc; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Drivers; -using Orchard.ContentManagement.Handlers; -using Orchard.Core.Common.Models; -using Orchard.Core.Containers.Extensions; -using Orchard.Core.Containers.Models; -using Orchard.Core.Containers.ViewModels; -using Orchard.Localization; - -namespace Orchard.Core.Containers.Drivers { - public class ContainerWidgetPartDriver : ContentPartDriver { - private readonly IContentManager _contentManager; - - public ContainerWidgetPartDriver(IContentManager contentManager) { - _contentManager = contentManager; - T = NullLocalizer.Instance; - } - - public Localizer T { get; set; } - - protected override DriverResult Display(ContainerWidgetPart part, string displayType, dynamic shapeHelper) { - return ContentShape( - "Parts_ContainerWidget", - () => { - var container = part.Record.ContainerId != 0 ? _contentManager.Get(part.Record.ContainerId) : default(ContentItem); - - if (container == null) - return null; - - IContentQuery query = _contentManager - .Query(VersionOptions.Published) - .Join().Where(cr => cr.Container.Id == container.Id); - - if (part.Record.ApplyFilter) - query = query.Where(part.Record.FilterByProperty, part.Record.FilterByOperator, part.Record.FilterByValue); - - var pageOfItems = query.Slice(0, part.Record.PageSize).ToList(); - - var list = shapeHelper.List(); - list.AddRange(pageOfItems.Select(item => _contentManager.BuildDisplay(item, "Summary"))); - - return shapeHelper.Parts_ContainerWidget(ContentItems: list); - }); - } - - protected override DriverResult Editor(ContainerWidgetPart part, dynamic shapeHelper) { - return Editor(part, (IUpdateModel)null, shapeHelper); - } - - protected override DriverResult Editor(ContainerWidgetPart part, IUpdateModel updater, dynamic shapeHelper) { - return ContentShape( - "Parts_ContainerWidget_Edit", - () => { - var model = new ContainerWidgetViewModel {Part = part}; - var containers = _contentManager.Query(VersionOptions.Latest).List().ToArray(); - - if (updater != null) { - updater.TryUpdateModel(model, "ContainerWidget", null, null); - - if (model.Part.Record.ContainerId == 0) - updater.AddModelError("Part.Record.ContainerId", containers.Any() - ? T("Please select a container to show items from.") - : T("Please create a container so you can select it to show items from.")); - } - - var listItems = !containers.Any() - ? new[] {new SelectListItem {Text = T("(None - create container enabled items first)").Text, Value = "0"}} - : containers.Select(x => new SelectListItem { - Value = Convert.ToString(x.Id), - Text = x.ContentItem.TypeDefinition.DisplayName + ": " + _contentManager.GetItemMetadata(x.ContentItem).DisplayText, - Selected = x.Id == model.Part.Record.ContainerId, - }); - - model.AvailableContainers = new SelectList(listItems, "Value", "Text", model.Part.Record.ContainerId); - - return shapeHelper.EditorTemplate(TemplateName: "ContainerWidget", Model: model, Prefix: "ContainerWidget"); - }); - } - - protected override void Importing(ContainerWidgetPart part, ImportContentContext context) { - // Don't do anything if the tag is not specified. - if (context.Data.Element(part.PartDefinition.Name) == null) { - return; - } - - context.ImportAttribute(part.PartDefinition.Name, "Container", containerIdentity => { - var container = context.GetItemFromSession(containerIdentity); - if (container != null) { - part.Record.ContainerId = container.Id; - } - }); - - context.ImportAttribute(part.PartDefinition.Name, "PageSize", pageSize => - part.Record.PageSize = Convert.ToInt32(pageSize) - ); - - context.ImportAttribute(part.PartDefinition.Name, "FilterByValue", filterByValue => - part.Record.FilterByValue = filterByValue - ); - } - - protected override void Exporting(ContainerWidgetPart part, ExportContentContext context) { - var container = _contentManager.Get(part.Record.ContainerId); - if (container != null) { - var containerIdentity = _contentManager.GetItemMetadata(container).Identity; - context.Element(part.PartDefinition.Name).SetAttributeValue("Container", containerIdentity.ToString()); - } - - context.Element(part.PartDefinition.Name).SetAttributeValue("PageSize", part.Record.PageSize); - } - } -} +using System; +using System.Linq; +using System.Web.Mvc; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Drivers; +using Orchard.ContentManagement.Handlers; +using Orchard.Core.Common.Models; +using Orchard.Core.Containers.Extensions; +using Orchard.Core.Containers.Models; +using Orchard.Core.Containers.ViewModels; +using Orchard.Localization; + +namespace Orchard.Core.Containers.Drivers { + public class ContainerWidgetPartDriver : ContentPartDriver { + private readonly IContentManager _contentManager; + + public ContainerWidgetPartDriver(IContentManager contentManager) { + _contentManager = contentManager; + T = NullLocalizer.Instance; + } + + public Localizer T { get; set; } + + protected override DriverResult Display(ContainerWidgetPart part, string displayType, dynamic shapeHelper) { + return ContentShape( + "Parts_ContainerWidget", + () => { + var container = part.Record.ContainerId != 0 ? _contentManager.Get(part.Record.ContainerId) : default(ContentItem); + + if (container == null) + return null; + + IContentQuery query = _contentManager + .Query(VersionOptions.Published) + .Join().Where(cr => cr.Container.Id == container.Id); + + if (part.Record.ApplyFilter) + query = query.Where(part.Record.FilterByProperty, part.Record.FilterByOperator, part.Record.FilterByValue); + + var pageOfItems = query.Slice(0, part.Record.PageSize).ToList(); + + var list = shapeHelper.List(); + list.AddRange(pageOfItems.Select(item => _contentManager.BuildDisplay(item, "Summary"))); + + return shapeHelper.Parts_ContainerWidget(ContentItems: list); + }); + } + + protected override DriverResult Editor(ContainerWidgetPart part, dynamic shapeHelper) { + return Editor(part, (IUpdateModel)null, shapeHelper); + } + + protected override DriverResult Editor(ContainerWidgetPart part, IUpdateModel updater, dynamic shapeHelper) { + return ContentShape( + "Parts_ContainerWidget_Edit", + () => { + var model = new ContainerWidgetViewModel {Part = part}; + var containers = _contentManager.Query(VersionOptions.Latest).List().ToArray(); + + if (updater != null) { + updater.TryUpdateModel(model, "ContainerWidget", null, null); + + if (model.Part.Record.ContainerId == 0) + updater.AddModelError("Part.Record.ContainerId", containers.Any() + ? T("Please select a container to show items from.") + : T("Please create a container so you can select it to show items from.")); + } + + var listItems = !containers.Any() + ? new[] {new SelectListItem {Text = T("(None - create container enabled items first)").Text, Value = "0"}} + : containers.Select(x => new SelectListItem { + Value = Convert.ToString(x.Id), + Text = x.ContentItem.TypeDefinition.DisplayName + ": " + _contentManager.GetItemMetadata(x.ContentItem).DisplayText, + Selected = x.Id == model.Part.Record.ContainerId, + }); + + model.AvailableContainers = new SelectList(listItems, "Value", "Text", model.Part.Record.ContainerId); + + return shapeHelper.EditorTemplate(TemplateName: "ContainerWidget", Model: model, Prefix: "ContainerWidget"); + }); + } + + protected override void Importing(ContainerWidgetPart part, ImportContentContext context) { + // Don't do anything if the tag is not specified. + if (context.Data.Element(part.PartDefinition.Name) == null) { + return; + } + + context.ImportAttribute(part.PartDefinition.Name, "Container", containerIdentity => { + var container = context.GetItemFromSession(containerIdentity); + if (container != null) { + part.Record.ContainerId = container.Id; + } + }); + + context.ImportAttribute(part.PartDefinition.Name, "PageSize", pageSize => + part.Record.PageSize = Convert.ToInt32(pageSize) + ); + + context.ImportAttribute(part.PartDefinition.Name, "FilterByValue", filterByValue => + part.Record.FilterByValue = filterByValue + ); + } + + protected override void Exporting(ContainerWidgetPart part, ExportContentContext context) { + var container = _contentManager.Get(part.Record.ContainerId); + if (container != null) { + var containerIdentity = _contentManager.GetItemMetadata(container).Identity; + context.Element(part.PartDefinition.Name).SetAttributeValue("Container", containerIdentity.ToString()); + } + + context.Element(part.PartDefinition.Name).SetAttributeValue("PageSize", part.Record.PageSize); + } + } +} diff --git a/src/Orchard.Web/Core/Containers/Drivers/CustomPropertiesDriver.cs b/src/Orchard.Web/Core/Containers/Drivers/CustomPropertiesDriver.cs index a8c82e8c070..015b99c57ff 100644 --- a/src/Orchard.Web/Core/Containers/Drivers/CustomPropertiesDriver.cs +++ b/src/Orchard.Web/Core/Containers/Drivers/CustomPropertiesDriver.cs @@ -1,58 +1,58 @@ -using System; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Drivers; -using Orchard.ContentManagement.Handlers; -using Orchard.Core.Containers.Models; -using Orchard.Data; - -namespace Orchard.Core.Containers.Drivers { - [Obsolete("Use Fields instead.")] - public class CustomPropertiesPartDriver : ContentPartDriver { - protected override DriverResult Editor(CustomPropertiesPart part, dynamic shapeHelper) { - return Editor(part, (IUpdateModel)null, shapeHelper); - } - - protected override DriverResult Editor(CustomPropertiesPart part, IUpdateModel updater, dynamic shapeHelper) { - return ContentShape( - "Parts_CustomProperties_Edit", - () => { - if (updater != null) - updater.TryUpdateModel(part, "CustomProperties", null, null); - - return shapeHelper.EditorTemplate(TemplateName: "CustomProperties", Model: part, Prefix: "CustomProperties"); - }); - } - - protected override void Importing(CustomPropertiesPart part, ImportContentContext context) { - // Don't do anything if the tag is not specified. - if (context.Data.Element(part.PartDefinition.Name) == null) { - return; - } - - context.ImportAttribute(part.PartDefinition.Name, "CustomOne", customOne => - part.Record.CustomOne = customOne - ); - - context.ImportAttribute(part.PartDefinition.Name, "CustomTwo", customTwo => - part.Record.CustomTwo = customTwo - ); - - context.ImportAttribute(part.PartDefinition.Name, "CustomThree", customThree => - part.Record.CustomThree = customThree - ); - } - - protected override void Exporting(CustomPropertiesPart part, ExportContentContext context) { - context.Element(part.PartDefinition.Name).SetAttributeValue("CustomOne", part.Record.CustomOne); - context.Element(part.PartDefinition.Name).SetAttributeValue("CustomTwo", part.Record.CustomTwo); - context.Element(part.PartDefinition.Name).SetAttributeValue("CustomThree", part.Record.CustomThree); - } - } - - [Obsolete("Use Fields instead.")] - public class CustomPropertiesPartHandler : ContentHandler { - public CustomPropertiesPartHandler(IRepository repository) { - Filters.Add(StorageFilter.For(repository)); - } - } +using System; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Drivers; +using Orchard.ContentManagement.Handlers; +using Orchard.Core.Containers.Models; +using Orchard.Data; + +namespace Orchard.Core.Containers.Drivers { + [Obsolete("Use Fields instead.")] + public class CustomPropertiesPartDriver : ContentPartDriver { + protected override DriverResult Editor(CustomPropertiesPart part, dynamic shapeHelper) { + return Editor(part, (IUpdateModel)null, shapeHelper); + } + + protected override DriverResult Editor(CustomPropertiesPart part, IUpdateModel updater, dynamic shapeHelper) { + return ContentShape( + "Parts_CustomProperties_Edit", + () => { + if (updater != null) + updater.TryUpdateModel(part, "CustomProperties", null, null); + + return shapeHelper.EditorTemplate(TemplateName: "CustomProperties", Model: part, Prefix: "CustomProperties"); + }); + } + + protected override void Importing(CustomPropertiesPart part, ImportContentContext context) { + // Don't do anything if the tag is not specified. + if (context.Data.Element(part.PartDefinition.Name) == null) { + return; + } + + context.ImportAttribute(part.PartDefinition.Name, "CustomOne", customOne => + part.Record.CustomOne = customOne + ); + + context.ImportAttribute(part.PartDefinition.Name, "CustomTwo", customTwo => + part.Record.CustomTwo = customTwo + ); + + context.ImportAttribute(part.PartDefinition.Name, "CustomThree", customThree => + part.Record.CustomThree = customThree + ); + } + + protected override void Exporting(CustomPropertiesPart part, ExportContentContext context) { + context.Element(part.PartDefinition.Name).SetAttributeValue("CustomOne", part.Record.CustomOne); + context.Element(part.PartDefinition.Name).SetAttributeValue("CustomTwo", part.Record.CustomTwo); + context.Element(part.PartDefinition.Name).SetAttributeValue("CustomThree", part.Record.CustomThree); + } + } + + [Obsolete("Use Fields instead.")] + public class CustomPropertiesPartHandler : ContentHandler { + public CustomPropertiesPartHandler(IRepository repository) { + Filters.Add(StorageFilter.For(repository)); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Containers/Extensions/ContentQueryExtensions.cs b/src/Orchard.Web/Core/Containers/Extensions/ContentQueryExtensions.cs index 9a5ef0f28b8..2b287b14ad0 100644 --- a/src/Orchard.Web/Core/Containers/Extensions/ContentQueryExtensions.cs +++ b/src/Orchard.Web/Core/Containers/Extensions/ContentQueryExtensions.cs @@ -1,87 +1,87 @@ -using System; -using System.Collections.Generic; -using Orchard.ContentManagement; -using Orchard.Core.Common.Models; -using Orchard.Core.Containers.Models; -using Orchard.Core.Title.Models; - -namespace Orchard.Core.Containers.Extensions { - [Obsolete] - public static class ContentQueryExtensions { - public static IContentQuery OrderBy(this IContentQuery query, string partAndProperty, bool descendingOrder) where T : IContent { - //todo: (heskew) order by custom part properties - switch (partAndProperty) { - case "ContainablePart.Weight": - query = descendingOrder - ? query.OrderByDescending(record => record.Position) - : query.OrderBy(record => record.Position); - break; - case "TitlePart.Title": - query = descendingOrder - ? query.OrderByDescending(record => record.Title) - : query.OrderBy(record => record.Title); - break; - case "CustomPropertiesPart.CustomOne": - query = descendingOrder - ? query.OrderByDescending(record => record.CustomOne) - : query.OrderBy(record => record.CustomOne); - break; - case "CustomPropertiesPart.CustomTwo": - query = descendingOrder - ? query.OrderByDescending(record => record.CustomTwo) - : query.OrderBy(record => record.CustomTwo); - break; - case "CustomPropertiesPart.CustomThree": - query = descendingOrder - ? query.OrderByDescending(record => record.CustomThree) - : query.OrderBy(record => record.CustomThree); - break; - case "CommonPart.CreatedUtc": - query = descendingOrder - ? query.OrderByDescending(record => record.CreatedUtc) - : query.OrderBy(record => record.CreatedUtc); - break; - default: // "CommonPart.PublishedUtc" - query = descendingOrder - ? query.OrderByDescending(record => record.PublishedUtc) - : query.OrderBy(record => record.PublishedUtc); - break; - } - - return query; - } - - public static IContentQuery Where(this IContentQuery query, string partAndProperty, string comparisonOperator, string comparisonValue) { - var filterKey = string.Format("{0}|{1}", partAndProperty, comparisonOperator); - if (!_filters.ContainsKey(filterKey)) - return query; - - return _filters[filterKey](query, comparisonValue); - } - - // convoluted: yes; quick and works for now: yes; technical debt: not much - private static readonly Dictionary, string, IContentQuery>> _filters = new Dictionary, string, IContentQuery>> { - {"TitlePart.Title|<", new Func, string, IContentQuery>((q, s) => q.Where(r => true /* CompareTo is not implemented - r.Title.CompareTo(s) == -1*/))}, - {"TitlePart.Title|>", new Func, string, IContentQuery>((q, s) => q.Where(r => true /* CompareTo is not implemented - r.Title.CompareTo(s) == 1*/))}, - {"TitlePart.Title|=", new Func, string, IContentQuery>((q, s) => q.Where(r => r.Title.Equals(s, StringComparison.OrdinalIgnoreCase)))}, - {"TitlePart.Title|^=", new Func, string, IContentQuery>((q, s) => q.Where(r => r.Title.StartsWith(s, StringComparison.OrdinalIgnoreCase)))}, - {"CommonPart.PublishedUtc|<", new Func, string, IContentQuery>((q, s) => q.Where(r => r.PublishedUtc < DateTime.Parse(s)))}, - {"CommonPart.PublishedUtc|>", new Func, string, IContentQuery>((q, s) => q.Where(r => r.PublishedUtc > DateTime.Parse(s)))}, - {"CommonPart.PublishedUtc|=", new Func, string, IContentQuery>((q, s) => q.Where(r => r.PublishedUtc == DateTime.Parse(s)))}, // todo: (heskew) not practical as is. needs some sense of precision.... - {"CommonPart.PublishedUtc|^=", new Func, string, IContentQuery>((q, s) => q.Where(r => true /* can't modified PublishedUtc for partial comparisons */))}, - // todo: (hesekw) this could benefit from a better filter implementation as this is currently very limited in functionality and I have no idea how the custom parts will be used by folks - {"CustomPropertiesPart.CustomOne|<", new Func, string, IContentQuery>((q, s) => q.Where(r => true /* CompareTo is not implemented - r.CustomOne.CompareTo(s) == -1*/))}, - {"CustomPropertiesPart.CustomOne|>", new Func, string, IContentQuery>((q, s) => q.Where(r => true /* CompareTo is not implemented - r.CustomOne.CompareTo(s) == 1*/))}, - {"CustomPropertiesPart.CustomOne|=", new Func, string, IContentQuery>((q, s) => q.Where(r => r.CustomOne.Equals(s, StringComparison.OrdinalIgnoreCase)))}, - {"CustomPropertiesPart.CustomOne|^=", new Func, string, IContentQuery>((q, s) => q.Where(r => r.CustomOne.StartsWith(s, StringComparison.OrdinalIgnoreCase)))}, - {"CustomPropertiesPart.CustomTwo|<", new Func, string, IContentQuery>((q, s) => q.Where(r => true /* CompareTo is not implemented - r.CustomTwo.CompareTo(s) == -1*/))}, - {"CustomPropertiesPart.CustomTwo|>", new Func, string, IContentQuery>((q, s) => q.Where(r => true /* CompareTo is not implemented - r.CustomTwo.CompareTo(s) == 1*/))}, - {"CustomPropertiesPart.CustomTwo|=", new Func, string, IContentQuery>((q, s) => q.Where(r => r.CustomTwo.Equals(s, StringComparison.OrdinalIgnoreCase)))}, - {"CustomPropertiesPart.CustomTwo|^=", new Func, string, IContentQuery>((q, s) => q.Where(r => r.CustomTwo.StartsWith(s, StringComparison.OrdinalIgnoreCase)))}, - {"CustomPropertiesPart.CustomThree|<", new Func, string, IContentQuery>((q, s) => q.Where(r => true /* CompareTo is not implemented - r.CustomThree.CompareTo(s) == -1*/))}, - {"CustomPropertiesPart.CustomThree|>", new Func, string, IContentQuery>((q, s) => q.Where(r => true /* CompareTo is not implemented - r.CustomThree.CompareTo(s) == 1*/))}, - {"CustomPropertiesPart.CustomThree|=", new Func, string, IContentQuery>((q, s) => q.Where(r => r.CustomThree.Equals(s, StringComparison.OrdinalIgnoreCase)))}, - {"CustomPropertiesPart.CustomThree|^=", new Func, string, IContentQuery>((q, s) => q.Where(r => r.CustomThree.StartsWith(s, StringComparison.OrdinalIgnoreCase)))}, - }; - } +using System; +using System.Collections.Generic; +using Orchard.ContentManagement; +using Orchard.Core.Common.Models; +using Orchard.Core.Containers.Models; +using Orchard.Core.Title.Models; + +namespace Orchard.Core.Containers.Extensions { + [Obsolete] + public static class ContentQueryExtensions { + public static IContentQuery OrderBy(this IContentQuery query, string partAndProperty, bool descendingOrder) where T : IContent { + //todo: (heskew) order by custom part properties + switch (partAndProperty) { + case "ContainablePart.Weight": + query = descendingOrder + ? query.OrderByDescending(record => record.Position) + : query.OrderBy(record => record.Position); + break; + case "TitlePart.Title": + query = descendingOrder + ? query.OrderByDescending(record => record.Title) + : query.OrderBy(record => record.Title); + break; + case "CustomPropertiesPart.CustomOne": + query = descendingOrder + ? query.OrderByDescending(record => record.CustomOne) + : query.OrderBy(record => record.CustomOne); + break; + case "CustomPropertiesPart.CustomTwo": + query = descendingOrder + ? query.OrderByDescending(record => record.CustomTwo) + : query.OrderBy(record => record.CustomTwo); + break; + case "CustomPropertiesPart.CustomThree": + query = descendingOrder + ? query.OrderByDescending(record => record.CustomThree) + : query.OrderBy(record => record.CustomThree); + break; + case "CommonPart.CreatedUtc": + query = descendingOrder + ? query.OrderByDescending(record => record.CreatedUtc) + : query.OrderBy(record => record.CreatedUtc); + break; + default: // "CommonPart.PublishedUtc" + query = descendingOrder + ? query.OrderByDescending(record => record.PublishedUtc) + : query.OrderBy(record => record.PublishedUtc); + break; + } + + return query; + } + + public static IContentQuery Where(this IContentQuery query, string partAndProperty, string comparisonOperator, string comparisonValue) { + var filterKey = string.Format("{0}|{1}", partAndProperty, comparisonOperator); + if (!_filters.ContainsKey(filterKey)) + return query; + + return _filters[filterKey](query, comparisonValue); + } + + // convoluted: yes; quick and works for now: yes; technical debt: not much + private static readonly Dictionary, string, IContentQuery>> _filters = new Dictionary, string, IContentQuery>> { + {"TitlePart.Title|<", new Func, string, IContentQuery>((q, s) => q.Where(r => true /* CompareTo is not implemented - r.Title.CompareTo(s) == -1*/))}, + {"TitlePart.Title|>", new Func, string, IContentQuery>((q, s) => q.Where(r => true /* CompareTo is not implemented - r.Title.CompareTo(s) == 1*/))}, + {"TitlePart.Title|=", new Func, string, IContentQuery>((q, s) => q.Where(r => r.Title.Equals(s, StringComparison.OrdinalIgnoreCase)))}, + {"TitlePart.Title|^=", new Func, string, IContentQuery>((q, s) => q.Where(r => r.Title.StartsWith(s, StringComparison.OrdinalIgnoreCase)))}, + {"CommonPart.PublishedUtc|<", new Func, string, IContentQuery>((q, s) => q.Where(r => r.PublishedUtc < DateTime.Parse(s)))}, + {"CommonPart.PublishedUtc|>", new Func, string, IContentQuery>((q, s) => q.Where(r => r.PublishedUtc > DateTime.Parse(s)))}, + {"CommonPart.PublishedUtc|=", new Func, string, IContentQuery>((q, s) => q.Where(r => r.PublishedUtc == DateTime.Parse(s)))}, // todo: (heskew) not practical as is. needs some sense of precision.... + {"CommonPart.PublishedUtc|^=", new Func, string, IContentQuery>((q, s) => q.Where(r => true /* can't modified PublishedUtc for partial comparisons */))}, + // todo: (hesekw) this could benefit from a better filter implementation as this is currently very limited in functionality and I have no idea how the custom parts will be used by folks + {"CustomPropertiesPart.CustomOne|<", new Func, string, IContentQuery>((q, s) => q.Where(r => true /* CompareTo is not implemented - r.CustomOne.CompareTo(s) == -1*/))}, + {"CustomPropertiesPart.CustomOne|>", new Func, string, IContentQuery>((q, s) => q.Where(r => true /* CompareTo is not implemented - r.CustomOne.CompareTo(s) == 1*/))}, + {"CustomPropertiesPart.CustomOne|=", new Func, string, IContentQuery>((q, s) => q.Where(r => r.CustomOne.Equals(s, StringComparison.OrdinalIgnoreCase)))}, + {"CustomPropertiesPart.CustomOne|^=", new Func, string, IContentQuery>((q, s) => q.Where(r => r.CustomOne.StartsWith(s, StringComparison.OrdinalIgnoreCase)))}, + {"CustomPropertiesPart.CustomTwo|<", new Func, string, IContentQuery>((q, s) => q.Where(r => true /* CompareTo is not implemented - r.CustomTwo.CompareTo(s) == -1*/))}, + {"CustomPropertiesPart.CustomTwo|>", new Func, string, IContentQuery>((q, s) => q.Where(r => true /* CompareTo is not implemented - r.CustomTwo.CompareTo(s) == 1*/))}, + {"CustomPropertiesPart.CustomTwo|=", new Func, string, IContentQuery>((q, s) => q.Where(r => r.CustomTwo.Equals(s, StringComparison.OrdinalIgnoreCase)))}, + {"CustomPropertiesPart.CustomTwo|^=", new Func, string, IContentQuery>((q, s) => q.Where(r => r.CustomTwo.StartsWith(s, StringComparison.OrdinalIgnoreCase)))}, + {"CustomPropertiesPart.CustomThree|<", new Func, string, IContentQuery>((q, s) => q.Where(r => true /* CompareTo is not implemented - r.CustomThree.CompareTo(s) == -1*/))}, + {"CustomPropertiesPart.CustomThree|>", new Func, string, IContentQuery>((q, s) => q.Where(r => true /* CompareTo is not implemented - r.CustomThree.CompareTo(s) == 1*/))}, + {"CustomPropertiesPart.CustomThree|=", new Func, string, IContentQuery>((q, s) => q.Where(r => r.CustomThree.Equals(s, StringComparison.OrdinalIgnoreCase)))}, + {"CustomPropertiesPart.CustomThree|^=", new Func, string, IContentQuery>((q, s) => q.Where(r => r.CustomThree.StartsWith(s, StringComparison.OrdinalIgnoreCase)))}, + }; + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Containers/Handlers/ContainablePartHandler.cs b/src/Orchard.Web/Core/Containers/Handlers/ContainablePartHandler.cs index 142307889d9..4efcabf0306 100644 --- a/src/Orchard.Web/Core/Containers/Handlers/ContainablePartHandler.cs +++ b/src/Orchard.Web/Core/Containers/Handlers/ContainablePartHandler.cs @@ -1,35 +1,35 @@ -using Orchard.ContentManagement; -using Orchard.ContentManagement.Handlers; -using Orchard.Core.Common.Models; -using Orchard.Core.Containers.Services; -using Orchard.Data; -using Orchard.Core.Containers.Models; - -namespace Orchard.Core.Containers.Handlers { - public class ContainablePartHandler : ContentHandler { - private readonly IContainerService _containerService; - - public ContainablePartHandler(IRepository repository, IContainerService containerService) { - _containerService = containerService; - Filters.Add(StorageFilter.For(repository)); - - OnCreated((context, part) => UpdateItemCount(part)); - OnPublished((context, part) => UpdateItemCount(part)); - OnUnpublished((context, part) => UpdateItemCount(part)); - OnVersioned((context, part, newVersionPart) => UpdateItemCount(newVersionPart)); - OnRemoved((context, part) => UpdateItemCount(part)); - } - - private void UpdateItemCount(ContainablePart part) { - var commonPart = part.As(); - if (commonPart == null || commonPart.Container == null) - return; - - var containerPart = commonPart.Container.As(); - if (containerPart == null) - return; - - _containerService.UpdateItemCount(containerPart); - } - } +using Orchard.ContentManagement; +using Orchard.ContentManagement.Handlers; +using Orchard.Core.Common.Models; +using Orchard.Core.Containers.Services; +using Orchard.Data; +using Orchard.Core.Containers.Models; + +namespace Orchard.Core.Containers.Handlers { + public class ContainablePartHandler : ContentHandler { + private readonly IContainerService _containerService; + + public ContainablePartHandler(IRepository repository, IContainerService containerService) { + _containerService = containerService; + Filters.Add(StorageFilter.For(repository)); + + OnCreated((context, part) => UpdateItemCount(part)); + OnPublished((context, part) => UpdateItemCount(part)); + OnUnpublished((context, part) => UpdateItemCount(part)); + OnVersioned((context, part, newVersionPart) => UpdateItemCount(newVersionPart)); + OnRemoved((context, part) => UpdateItemCount(part)); + } + + private void UpdateItemCount(ContainablePart part) { + var commonPart = part.As(); + if (commonPart == null || commonPart.Container == null) + return; + + var containerPart = commonPart.Container.As(); + if (containerPart == null) + return; + + _containerService.UpdateItemCount(containerPart); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Containers/Handlers/ContainerPartHandler.cs b/src/Orchard.Web/Core/Containers/Handlers/ContainerPartHandler.cs index b86bf82369a..5ab7aeb90bc 100644 --- a/src/Orchard.Web/Core/Containers/Handlers/ContainerPartHandler.cs +++ b/src/Orchard.Web/Core/Containers/Handlers/ContainerPartHandler.cs @@ -1,76 +1,76 @@ -using System; -using System.Linq; -using Orchard.ContentManagement.Handlers; -using Orchard.ContentManagement.MetaData; -using Orchard.Core.Containers.Extensions; -using Orchard.Core.Containers.Models; -using Orchard.Core.Containers.Services; -using Orchard.Core.Containers.Settings; -using Orchard.Data; -using System.Web.Routing; - -namespace Orchard.Core.Containers.Handlers { - public class ContainerPartHandler : ContentHandler { - private readonly IContentDefinitionManager _contentDefinitionManager; - private readonly IListViewService _listViewService; - private readonly IContainerService _containerService; - - public ContainerPartHandler( - IRepository repository, - IContentDefinitionManager contentDefinitionManager, - IListViewService listViewService, - IContainerService containerService) { - - _contentDefinitionManager = contentDefinitionManager; - _listViewService = listViewService; - _containerService = containerService; - Filters.Add(StorageFilter.For(repository)); - OnInitializing((context, part) => { - part.Record.ItemsShown = part.Settings.GetModel().ItemsShownDefault - ?? part.PartDefinition.Settings.GetModel().ItemsShownDefault; - part.Record.PageSize = part.Settings.GetModel().PageSizeDefault - ?? part.PartDefinition.Settings.GetModel().PageSizeDefault; - part.Record.Paginated = part.Settings.GetModel().PaginatedDefault - ?? part.PartDefinition.Settings.GetModel().PaginatedDefault; - - }); - - OnGetContentItemMetadata((context, part) => { - context.Metadata.DisplayRouteValues = new RouteValueDictionary { - {"Area", "Containers"}, - {"Controller", "Item"}, - {"Action", "Display"}, - {"id", context.ContentItem.Id} - }; - }); - - OnActivated((context, part) => { - part.ContainerSettingsField.Loader(() => part.Settings.GetModel()); - - part.ItemContentTypesField.Loader(() => { - var settings = part.ContainerSettings; - var types = settings.RestrictItemContentTypes ? settings.RestrictedItemContentTypes : part.Record.ItemContentTypes; - return _contentDefinitionManager.ParseContentTypeDefinitions(types); - }); - - part.ItemContentTypesField.Setter(value => { - part.Record.ItemContentTypes = _contentDefinitionManager.JoinContentTypeDefinitions(value); - return value; - }); - - part.AdminListViewField.Loader(() => { - var providers = _listViewService.Providers.ToList(); - var listViewProviderName = !String.IsNullOrWhiteSpace(part.Record.AdminListViewName) - ? part.Record.AdminListViewName - : !String.IsNullOrWhiteSpace(part.ContainerSettings.AdminListViewName) - ? part.ContainerSettings.AdminListViewName - : providers.Any() ? providers.First().Name : null; - - return _listViewService.GetProvider(listViewProviderName) ?? _listViewService.GetDefaultProvider(); - }); - }); - - OnPublished((context, part) => _containerService.UpdateItemCount(part)); - } - } +using System; +using System.Linq; +using Orchard.ContentManagement.Handlers; +using Orchard.ContentManagement.MetaData; +using Orchard.Core.Containers.Extensions; +using Orchard.Core.Containers.Models; +using Orchard.Core.Containers.Services; +using Orchard.Core.Containers.Settings; +using Orchard.Data; +using System.Web.Routing; + +namespace Orchard.Core.Containers.Handlers { + public class ContainerPartHandler : ContentHandler { + private readonly IContentDefinitionManager _contentDefinitionManager; + private readonly IListViewService _listViewService; + private readonly IContainerService _containerService; + + public ContainerPartHandler( + IRepository repository, + IContentDefinitionManager contentDefinitionManager, + IListViewService listViewService, + IContainerService containerService) { + + _contentDefinitionManager = contentDefinitionManager; + _listViewService = listViewService; + _containerService = containerService; + Filters.Add(StorageFilter.For(repository)); + OnInitializing((context, part) => { + part.Record.ItemsShown = part.Settings.GetModel().ItemsShownDefault + ?? part.PartDefinition.Settings.GetModel().ItemsShownDefault; + part.Record.PageSize = part.Settings.GetModel().PageSizeDefault + ?? part.PartDefinition.Settings.GetModel().PageSizeDefault; + part.Record.Paginated = part.Settings.GetModel().PaginatedDefault + ?? part.PartDefinition.Settings.GetModel().PaginatedDefault; + + }); + + OnGetContentItemMetadata((context, part) => { + context.Metadata.DisplayRouteValues = new RouteValueDictionary { + {"Area", "Containers"}, + {"Controller", "Item"}, + {"Action", "Display"}, + {"id", context.ContentItem.Id} + }; + }); + + OnActivated((context, part) => { + part.ContainerSettingsField.Loader(() => part.Settings.GetModel()); + + part.ItemContentTypesField.Loader(() => { + var settings = part.ContainerSettings; + var types = settings.RestrictItemContentTypes ? settings.RestrictedItemContentTypes : part.Record.ItemContentTypes; + return _contentDefinitionManager.ParseContentTypeDefinitions(types); + }); + + part.ItemContentTypesField.Setter(value => { + part.Record.ItemContentTypes = _contentDefinitionManager.JoinContentTypeDefinitions(value); + return value; + }); + + part.AdminListViewField.Loader(() => { + var providers = _listViewService.Providers.ToList(); + var listViewProviderName = !String.IsNullOrWhiteSpace(part.Record.AdminListViewName) + ? part.Record.AdminListViewName + : !String.IsNullOrWhiteSpace(part.ContainerSettings.AdminListViewName) + ? part.ContainerSettings.AdminListViewName + : providers.Any() ? providers.First().Name : null; + + return _listViewService.GetProvider(listViewProviderName) ?? _listViewService.GetDefaultProvider(); + }); + }); + + OnPublished((context, part) => _containerService.UpdateItemCount(part)); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Containers/Migrations.cs b/src/Orchard.Web/Core/Containers/Migrations.cs index 061ccd66e06..7c8ee057761 100644 --- a/src/Orchard.Web/Core/Containers/Migrations.cs +++ b/src/Orchard.Web/Core/Containers/Migrations.cs @@ -1,127 +1,127 @@ -using Orchard.ContentManagement.MetaData; -using Orchard.Core.Contents.Extensions; -using Orchard.Data.Migration; - -namespace Orchard.Core.Containers { - public class Migrations : DataMigrationImpl { - public int Create() { - SchemaBuilder.CreateTable("ContainerPartRecord", table => table - .ContentPartRecord() - .Column("Paginated") - .Column("PageSize") - .Column("ItemContentTypes") - .Column("ItemsShown", c => c.NotNull()) - .Column("ShowOnAdminMenu", c => c.NotNull()) - .Column("AdminMenuText", c => c.WithLength(50)) - .Column("AdminMenuPosition", c => c.WithLength(50)) - .Column("AdminMenuImageSet", c => c.WithLength(50)) - .Column("EnablePositioning") - .Column("AdminListViewName", c => c.WithLength(50)) - .Column("ItemCount", c => c.NotNull())); - - SchemaBuilder.CreateTable("ContainerWidgetPartRecord", table => table - .ContentPartRecord() - .Column("ContainerId") - .Column("PageSize") - .Column("OrderByProperty", c => c.WithLength(64)) - .Column("OrderByDirection") - .Column("ApplyFilter") - .Column("FilterByProperty", c => c.WithLength(64)) - .Column("FilterByOperator", c => c.WithLength(4)) - .Column("FilterByValue", c => c.WithLength(128))); - - SchemaBuilder.CreateTable("ContainablePartRecord", table => table - .ContentPartRecord() - .Column("Position")); - - ContentDefinitionManager.AlterTypeDefinition("ContainerWidget", type => type - .WithPart("CommonPart") - .WithPart("WidgetPart") - .WithPart("ContainerWidgetPart") - .WithSetting("Stereotype", "Widget")); - - ContentDefinitionManager.AlterPartDefinition("ContainerPart", part => part - .Attachable() - .WithDescription("Turns your content item into a container that is capable of containing content items that have the ContainablePart attached.")); - - ContentDefinitionManager.AlterPartDefinition("ContainablePart", part => part - .Attachable() - .WithDescription("Allows your content item to be contained by a content item that has the ContainerPart attached.")); - - return 6; - } - - public int UpdateFrom1() { - SchemaBuilder.AlterTable("ContainerPartRecord", table => table.AddColumn("ItemContentType")); - return 2; - } - - public int UpdateFrom2() { - SchemaBuilder.AlterTable("ContainerPartRecord", table => table - .AddColumn("ItemsShown", column => column.WithDefault(true))); - - SchemaBuilder.CreateTable("ContainablePartRecord", table => table - .ContentPartRecord() - .Column("Weight")); - - return 3; - } - - public int UpdateFrom3() { - ContentDefinitionManager.AlterPartDefinition("ContainerPart", part => part - .WithDescription("Turns your content item into a container that is capable of containing content items that have the ContainablePart attached.")); - - ContentDefinitionManager.AlterPartDefinition("ContainablePart", part => part - .WithDescription("Allows your content item to be contained by a content item that has the ContainerPart attached.")); - - ContentDefinitionManager.AlterPartDefinition("CustomPropertiesPart", part => part - .WithDescription("Adds 3 custom properties to your content item.")); - return 4; - } - - public int UpdateFrom4() { - ContentDefinitionManager.DeleteTypeDefinition("CustomPropertiesPart"); - SchemaBuilder.DropTable("CustomPropertiesPartRecord"); - SchemaBuilder.AlterTable("ContainerPartRecord", table => { - table.DropColumn("ItemContentType"); - table.AddColumn("ItemContentTypes"); - table.AddColumn("ShowOnAdminMenu"); - table.AddColumn("AdminMenuText", c => c.WithLength(50)); - table.AddColumn("AdminMenuPosition", c => c.WithLength(50)); - table.AddColumn("AdminMenuImageSet", c => c.WithLength(50)); - table.AddColumn("EnablePositioning"); - table.AddColumn("AdminListViewName", c => c.WithLength(50)); - table.AddColumn("ItemCount"); - }); - - SchemaBuilder.AlterTable("ContainablePartRecord", table => { - table.DropColumn("Weight"); - table.AddColumn("Position"); - }); - - return 6; - } - - public int UpdateFrom5() { - SchemaBuilder.AlterTable("ContainerWidgetPartRecord", table => table - .AddColumn("OrderByProperty", c => c.WithLength(64))); - - SchemaBuilder.AlterTable("ContainerWidgetPartRecord", table => table - .AddColumn("OrderByDirection")); - - SchemaBuilder.AlterTable("ContainerWidgetPartRecord", table => table - .AddColumn("ApplyFilter")); - - SchemaBuilder.AlterTable("ContainerWidgetPartRecord", table => table - .AddColumn("FilterByProperty", c => c.WithLength(64))); - - SchemaBuilder.AlterTable("ContainerWidgetPartRecord", table => table - .AddColumn("FilterByOperator", c => c.WithLength(4))); - - SchemaBuilder.AlterTable("ContainerWidgetPartRecord", table => table - .AddColumn("FilterByValue", c => c.WithLength(128))); - - return 6; - } - } +using Orchard.ContentManagement.MetaData; +using Orchard.Core.Contents.Extensions; +using Orchard.Data.Migration; + +namespace Orchard.Core.Containers { + public class Migrations : DataMigrationImpl { + public int Create() { + SchemaBuilder.CreateTable("ContainerPartRecord", table => table + .ContentPartRecord() + .Column("Paginated") + .Column("PageSize") + .Column("ItemContentTypes") + .Column("ItemsShown", c => c.NotNull()) + .Column("ShowOnAdminMenu", c => c.NotNull()) + .Column("AdminMenuText", c => c.WithLength(50)) + .Column("AdminMenuPosition", c => c.WithLength(50)) + .Column("AdminMenuImageSet", c => c.WithLength(50)) + .Column("EnablePositioning") + .Column("AdminListViewName", c => c.WithLength(50)) + .Column("ItemCount", c => c.NotNull())); + + SchemaBuilder.CreateTable("ContainerWidgetPartRecord", table => table + .ContentPartRecord() + .Column("ContainerId") + .Column("PageSize") + .Column("OrderByProperty", c => c.WithLength(64)) + .Column("OrderByDirection") + .Column("ApplyFilter") + .Column("FilterByProperty", c => c.WithLength(64)) + .Column("FilterByOperator", c => c.WithLength(4)) + .Column("FilterByValue", c => c.WithLength(128))); + + SchemaBuilder.CreateTable("ContainablePartRecord", table => table + .ContentPartRecord() + .Column("Position")); + + ContentDefinitionManager.AlterTypeDefinition("ContainerWidget", type => type + .WithPart("CommonPart") + .WithPart("WidgetPart") + .WithPart("ContainerWidgetPart") + .WithSetting("Stereotype", "Widget")); + + ContentDefinitionManager.AlterPartDefinition("ContainerPart", part => part + .Attachable() + .WithDescription("Turns your content item into a container that is capable of containing content items that have the ContainablePart attached.")); + + ContentDefinitionManager.AlterPartDefinition("ContainablePart", part => part + .Attachable() + .WithDescription("Allows your content item to be contained by a content item that has the ContainerPart attached.")); + + return 6; + } + + public int UpdateFrom1() { + SchemaBuilder.AlterTable("ContainerPartRecord", table => table.AddColumn("ItemContentType")); + return 2; + } + + public int UpdateFrom2() { + SchemaBuilder.AlterTable("ContainerPartRecord", table => table + .AddColumn("ItemsShown", column => column.WithDefault(true))); + + SchemaBuilder.CreateTable("ContainablePartRecord", table => table + .ContentPartRecord() + .Column("Weight")); + + return 3; + } + + public int UpdateFrom3() { + ContentDefinitionManager.AlterPartDefinition("ContainerPart", part => part + .WithDescription("Turns your content item into a container that is capable of containing content items that have the ContainablePart attached.")); + + ContentDefinitionManager.AlterPartDefinition("ContainablePart", part => part + .WithDescription("Allows your content item to be contained by a content item that has the ContainerPart attached.")); + + ContentDefinitionManager.AlterPartDefinition("CustomPropertiesPart", part => part + .WithDescription("Adds 3 custom properties to your content item.")); + return 4; + } + + public int UpdateFrom4() { + ContentDefinitionManager.DeleteTypeDefinition("CustomPropertiesPart"); + SchemaBuilder.DropTable("CustomPropertiesPartRecord"); + SchemaBuilder.AlterTable("ContainerPartRecord", table => { + table.DropColumn("ItemContentType"); + table.AddColumn("ItemContentTypes"); + table.AddColumn("ShowOnAdminMenu"); + table.AddColumn("AdminMenuText", c => c.WithLength(50)); + table.AddColumn("AdminMenuPosition", c => c.WithLength(50)); + table.AddColumn("AdminMenuImageSet", c => c.WithLength(50)); + table.AddColumn("EnablePositioning"); + table.AddColumn("AdminListViewName", c => c.WithLength(50)); + table.AddColumn("ItemCount"); + }); + + SchemaBuilder.AlterTable("ContainablePartRecord", table => { + table.DropColumn("Weight"); + table.AddColumn("Position"); + }); + + return 6; + } + + public int UpdateFrom5() { + SchemaBuilder.AlterTable("ContainerWidgetPartRecord", table => table + .AddColumn("OrderByProperty", c => c.WithLength(64))); + + SchemaBuilder.AlterTable("ContainerWidgetPartRecord", table => table + .AddColumn("OrderByDirection")); + + SchemaBuilder.AlterTable("ContainerWidgetPartRecord", table => table + .AddColumn("ApplyFilter")); + + SchemaBuilder.AlterTable("ContainerWidgetPartRecord", table => table + .AddColumn("FilterByProperty", c => c.WithLength(64))); + + SchemaBuilder.AlterTable("ContainerWidgetPartRecord", table => table + .AddColumn("FilterByOperator", c => c.WithLength(4))); + + SchemaBuilder.AlterTable("ContainerWidgetPartRecord", table => table + .AddColumn("FilterByValue", c => c.WithLength(128))); + + return 6; + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Containers/Models/ContainablePart.cs b/src/Orchard.Web/Core/Containers/Models/ContainablePart.cs index 35af2dfde3c..c4ecd4b7946 100644 --- a/src/Orchard.Web/Core/Containers/Models/ContainablePart.cs +++ b/src/Orchard.Web/Core/Containers/Models/ContainablePart.cs @@ -1,15 +1,15 @@ -using Orchard.ContentManagement; -using Orchard.ContentManagement.Records; - -namespace Orchard.Core.Containers.Models { - public class ContainablePart : ContentPart { - public int Position { - get { return Record.Position; } - set { Record.Position = value; } - } - } - - public class ContainablePartRecord : ContentPartRecord { - public virtual int Position { get; set; } - } +using Orchard.ContentManagement; +using Orchard.ContentManagement.Records; + +namespace Orchard.Core.Containers.Models { + public class ContainablePart : ContentPart { + public int Position { + get { return Record.Position; } + set { Record.Position = value; } + } + } + + public class ContainablePartRecord : ContentPartRecord { + public virtual int Position { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Containers/Models/ContainerPart.cs b/src/Orchard.Web/Core/Containers/Models/ContainerPart.cs index b0230123abf..c128e104ff8 100644 --- a/src/Orchard.Web/Core/Containers/Models/ContainerPart.cs +++ b/src/Orchard.Web/Core/Containers/Models/ContainerPart.cs @@ -1,95 +1,95 @@ -using System.Collections.Generic; -using Orchard.ContentManagement; -using Orchard.ContentManagement.MetaData.Models; -using Orchard.ContentManagement.Records; -using Orchard.Core.Common.Utilities; -using Orchard.Core.Containers.Services; -using Orchard.Core.Containers.Settings; -using Orchard.UI.Navigation; - -namespace Orchard.Core.Containers.Models { - public class ContainerPart : ContentPart { - // ReSharper disable InconsistentNaming - internal LazyField> ItemContentTypesField = new LazyField>(); - internal LazyField ContainerSettingsField = new LazyField(); - internal LazyField AdminListViewField = new LazyField(); - // ReSharper restore InconsistentNaming - - public IEnumerable ItemContentTypes { - get { return ItemContentTypesField.Value; } - set { ItemContentTypesField.Value = value; } - } - - public ContainerTypePartSettings ContainerSettings { - get { return ContainerSettingsField.Value; } - } - - public bool EnablePositioning { - get { return ContainerSettings.EnablePositioning != null ? ContainerSettings.EnablePositioning.Value : Record.EnablePositioning; } - } - - public IListViewProvider AdminListView { - get { return AdminListViewField.Value; } - } - - public bool ItemsShown { - get { return Record.ItemsShown; } - set { Record.ItemsShown = value; } - } - - public bool Paginated { - get { return Record.Paginated; } - set { Record.Paginated = value; } - } - - public int PageSize { - get { return Record.PageSize; } - set { Record.PageSize = value; } - } - - public bool ShowOnAdminMenu { - get { return Record.ShowOnAdminMenu; } - set { Record.ShowOnAdminMenu = value; } - } - - public string AdminMenuText { - get { return Record.AdminMenuText; } - set { Record.AdminMenuText = value; } - } - - public string AdminMenuPosition { - get { return Record.AdminMenuPosition; } - set { Record.AdminMenuPosition = value; } - } - - public string AdminMenuImageSet { - get { return Record.AdminMenuImageSet; } - set { Record.AdminMenuImageSet = value; } - } - - public int ItemCount { - get { return Record.ItemCount; } - set { Record.ItemCount = value; } - } - - public PagerParameters PagerParameters { get; set; } - - public ContainerPart() { - PagerParameters = new PagerParameters(); - } - } - - public class ContainerPartRecord : ContentPartRecord { - public virtual string ItemContentTypes { get; set; } - public virtual bool ItemsShown { get; set; } - public virtual bool Paginated { get; set; } - public virtual int PageSize { get; set; } - public virtual bool ShowOnAdminMenu { get; set; } - public virtual string AdminMenuText { get; set; } - public virtual string AdminMenuPosition { get; set; } - public virtual string AdminMenuImageSet { get; set; } - public virtual bool EnablePositioning { get; set; } - public virtual string AdminListViewName { get; set; } - public virtual int ItemCount { get; set; } - } -} +using System.Collections.Generic; +using Orchard.ContentManagement; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.ContentManagement.Records; +using Orchard.Core.Common.Utilities; +using Orchard.Core.Containers.Services; +using Orchard.Core.Containers.Settings; +using Orchard.UI.Navigation; + +namespace Orchard.Core.Containers.Models { + public class ContainerPart : ContentPart { + // ReSharper disable InconsistentNaming + internal LazyField> ItemContentTypesField = new LazyField>(); + internal LazyField ContainerSettingsField = new LazyField(); + internal LazyField AdminListViewField = new LazyField(); + // ReSharper restore InconsistentNaming + + public IEnumerable ItemContentTypes { + get { return ItemContentTypesField.Value; } + set { ItemContentTypesField.Value = value; } + } + + public ContainerTypePartSettings ContainerSettings { + get { return ContainerSettingsField.Value; } + } + + public bool EnablePositioning { + get { return ContainerSettings.EnablePositioning != null ? ContainerSettings.EnablePositioning.Value : Record.EnablePositioning; } + } + + public IListViewProvider AdminListView { + get { return AdminListViewField.Value; } + } + + public bool ItemsShown { + get { return Record.ItemsShown; } + set { Record.ItemsShown = value; } + } + + public bool Paginated { + get { return Record.Paginated; } + set { Record.Paginated = value; } + } + + public int PageSize { + get { return Record.PageSize; } + set { Record.PageSize = value; } + } + + public bool ShowOnAdminMenu { + get { return Record.ShowOnAdminMenu; } + set { Record.ShowOnAdminMenu = value; } + } + + public string AdminMenuText { + get { return Record.AdminMenuText; } + set { Record.AdminMenuText = value; } + } + + public string AdminMenuPosition { + get { return Record.AdminMenuPosition; } + set { Record.AdminMenuPosition = value; } + } + + public string AdminMenuImageSet { + get { return Record.AdminMenuImageSet; } + set { Record.AdminMenuImageSet = value; } + } + + public int ItemCount { + get { return Record.ItemCount; } + set { Record.ItemCount = value; } + } + + public PagerParameters PagerParameters { get; set; } + + public ContainerPart() { + PagerParameters = new PagerParameters(); + } + } + + public class ContainerPartRecord : ContentPartRecord { + public virtual string ItemContentTypes { get; set; } + public virtual bool ItemsShown { get; set; } + public virtual bool Paginated { get; set; } + public virtual int PageSize { get; set; } + public virtual bool ShowOnAdminMenu { get; set; } + public virtual string AdminMenuText { get; set; } + public virtual string AdminMenuPosition { get; set; } + public virtual string AdminMenuImageSet { get; set; } + public virtual bool EnablePositioning { get; set; } + public virtual string AdminListViewName { get; set; } + public virtual int ItemCount { get; set; } + } +} diff --git a/src/Orchard.Web/Core/Containers/Models/ContainerWidgetPart.cs b/src/Orchard.Web/Core/Containers/Models/ContainerWidgetPart.cs index c10b24f8c47..d4fbe47ee84 100644 --- a/src/Orchard.Web/Core/Containers/Models/ContainerWidgetPart.cs +++ b/src/Orchard.Web/Core/Containers/Models/ContainerWidgetPart.cs @@ -1,18 +1,18 @@ -using Orchard.ContentManagement; -using Orchard.ContentManagement.Records; - -namespace Orchard.Core.Containers.Models { - public class ContainerWidgetPart : ContentPart { - } - - public class ContainerWidgetPartRecord : ContentPartRecord { - public virtual int ContainerId { get; set; } - public virtual int PageSize { get; set; } - public virtual string OrderByProperty { get; set; } - public virtual int OrderByDirection { get; set; } - public virtual bool ApplyFilter { get; set; } - public virtual string FilterByProperty { get; set; } - public virtual string FilterByOperator { get; set; } - public virtual string FilterByValue { get; set; } - } +using Orchard.ContentManagement; +using Orchard.ContentManagement.Records; + +namespace Orchard.Core.Containers.Models { + public class ContainerWidgetPart : ContentPart { + } + + public class ContainerWidgetPartRecord : ContentPartRecord { + public virtual int ContainerId { get; set; } + public virtual int PageSize { get; set; } + public virtual string OrderByProperty { get; set; } + public virtual int OrderByDirection { get; set; } + public virtual bool ApplyFilter { get; set; } + public virtual string FilterByProperty { get; set; } + public virtual string FilterByOperator { get; set; } + public virtual string FilterByValue { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Containers/Models/CustomPropertiesPart.cs b/src/Orchard.Web/Core/Containers/Models/CustomPropertiesPart.cs index 7972684934d..0437380ad92 100644 --- a/src/Orchard.Web/Core/Containers/Models/CustomPropertiesPart.cs +++ b/src/Orchard.Web/Core/Containers/Models/CustomPropertiesPart.cs @@ -1,16 +1,16 @@ -using System; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Records; - -namespace Orchard.Core.Containers.Models { - [Obsolete("Use content fields instead.")] - public class CustomPropertiesPart : ContentPart { - } - - [Obsolete("Use content fields instead.")] - public class CustomPropertiesPartRecord : ContentPartRecord { - public virtual string CustomOne { get; set; } - public virtual string CustomTwo { get; set; } - public virtual string CustomThree { get; set; } - } -} +using System; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Records; + +namespace Orchard.Core.Containers.Models { + [Obsolete("Use content fields instead.")] + public class CustomPropertiesPart : ContentPart { + } + + [Obsolete("Use content fields instead.")] + public class CustomPropertiesPartRecord : ContentPartRecord { + public virtual string CustomOne { get; set; } + public virtual string CustomTwo { get; set; } + public virtual string CustomThree { get; set; } + } +} diff --git a/src/Orchard.Web/Core/Containers/Module.txt b/src/Orchard.Web/Core/Containers/Module.txt index 57fe1293fb2..6c5ee860569 100644 --- a/src/Orchard.Web/Core/Containers/Module.txt +++ b/src/Orchard.Web/Core/Containers/Module.txt @@ -1,10 +1,10 @@ -Name: Containers -AntiForgery: enabled -Author: The Orchard Team -Website: http://orchardproject.net -Version: 1.9.2 -OrchardVersion: 1.9 -Description: The containers module introduces container and containable behaviors for content items. -FeatureDescription: Container and containable parts to enable parent-child relationships between content items. -Dependencies: Contents, Feeds -Category: Content +Name: Containers +AntiForgery: enabled +Author: The Orchard Team +Website: http://orchardproject.net +Version: 1.9.2 +OrchardVersion: 1.9 +Description: The containers module introduces container and containable behaviors for content items. +FeatureDescription: Container and containable parts to enable parent-child relationships between content items. +Dependencies: Contents, Feeds +Category: Content diff --git a/src/Orchard.Web/Core/Containers/Placement.info b/src/Orchard.Web/Core/Containers/Placement.info index 70df6295727..dd28a1274dd 100644 --- a/src/Orchard.Web/Core/Containers/Placement.info +++ b/src/Orchard.Web/Core/Containers/Placement.info @@ -1,16 +1,16 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Containers/Settings/ContainerSettings.cs b/src/Orchard.Web/Core/Containers/Settings/ContainerSettings.cs index e2cb6d12137..2d4f5f22dfe 100644 --- a/src/Orchard.Web/Core/Containers/Settings/ContainerSettings.cs +++ b/src/Orchard.Web/Core/Containers/Settings/ContainerSettings.cs @@ -1,147 +1,147 @@ -using System.Collections.Generic; -using System.Linq; -using Orchard.ContentManagement; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.MetaData.Builders; -using Orchard.ContentManagement.MetaData.Models; -using Orchard.ContentManagement.ViewModels; -using Orchard.Core.Containers.Extensions; -using Orchard.Core.Containers.Services; -using Orchard.Core.Containers.ViewModels; - -namespace Orchard.Core.Containers.Settings { - public class ContainerPartSettings { - public const bool ItemsShownDefaultDefault = true; - public const int PageSizeDefaultDefault = 10; - public const bool PaginatedDefaultDefault = true; - - private bool? _itemsShownDefault; - private int? _pageSizeDefault; - private bool? _paginiatedDefault; - - public bool ItemsShownDefault { - get { - return _itemsShownDefault != null - ? (bool)_itemsShownDefault - : ItemsShownDefaultDefault; - } - set { _itemsShownDefault = value; } - } - - public int PageSizeDefault { - get { - return _pageSizeDefault != null - ? (int)_pageSizeDefault - : PageSizeDefaultDefault; - } - set { _pageSizeDefault = value; } - } - - public bool PaginatedDefault { - get { - return _paginiatedDefault != null - ? (bool)_paginiatedDefault - : PaginatedDefaultDefault; - } - set { _paginiatedDefault = value; } - } - } - - public class ContainerTypePartSettings { - public ContainerTypePartSettings() { - DisplayContainerEditor = true; - } - - public bool? ItemsShownDefault { get; set; } - public int? PageSizeDefault { get; set; } - public bool? PaginatedDefault { get; set; } - public string RestrictedItemContentTypes { get; set; } - public bool RestrictItemContentTypes { get; set; } - public bool? EnablePositioning { get; set; } - public string AdminListViewName { get; set; } - public bool DisplayContainerEditor { get; set; } - } - - public class ContainerSettingsHooks : ContentDefinitionEditorEventsBase { - private readonly IContainerService _containerService; - private readonly IContentDefinitionManager _contentDefinitionManager; - private readonly IListViewService _listViewService; - - public ContainerSettingsHooks(IContainerService containerService, IContentDefinitionManager contentDefinitionManager, IListViewService listViewService) { - _containerService = containerService; - _contentDefinitionManager = contentDefinitionManager; - _listViewService = listViewService; - } - - public override IEnumerable TypePartEditor(ContentTypePartDefinition definition) { - if (definition.PartDefinition.Name != "ContainerPart") - yield break; - - var model = definition.Settings.GetModel(); - var partModel = definition.PartDefinition.Settings.GetModel(); - - if (model.ItemsShownDefault == null) - model.ItemsShownDefault = partModel.ItemsShownDefault; - - if (model.PageSizeDefault == null) - model.PageSizeDefault = partModel.PageSizeDefault; - - if (model.PaginatedDefault == null) - model.PaginatedDefault = partModel.PaginatedDefault; - - var viewModel = new ContainerTypePartSettingsViewModel { - ItemsShownDefault = model.ItemsShownDefault, - PageSizeDefault = model.PageSizeDefault, - PaginatedDefault = model.PaginatedDefault, - RestrictedItemContentTypes = _contentDefinitionManager.ParseContentTypeDefinitions(model.RestrictedItemContentTypes).Select(x => x.Name).ToList(), - RestrictItemContentTypes = model.RestrictItemContentTypes, - EnablePositioning = model.EnablePositioning, - AdminListViewName = model.AdminListViewName, - AvailableItemContentTypes = _containerService.GetContainableTypes().ToList(), - ListViewProviders = _listViewService.Providers.ToList(), - DisplayContainerEditor = model.DisplayContainerEditor - }; - - yield return DefinitionTemplate(viewModel); - } - - public override IEnumerable PartEditor(ContentPartDefinition definition) { - if (definition.Name != "ContainerPart") - yield break; - - var model = definition.Settings.GetModel(); - yield return DefinitionTemplate(model); - } - - public override IEnumerable TypePartEditorUpdate(ContentTypePartDefinitionBuilder builder, IUpdateModel updateModel) { - if (builder.Name != "ContainerPart") - yield break; - - var viewModel = new ContainerTypePartSettingsViewModel { - AvailableItemContentTypes = _containerService.GetContainableTypes().ToList() - }; - updateModel.TryUpdateModel(viewModel, "ContainerTypePartSettingsViewModel", null, new[] { "AvailableItemContentTypes" }); - builder.WithSetting("ContainerTypePartSettings.ItemsShownDefault", viewModel.ItemsShownDefault.ToString()); - builder.WithSetting("ContainerTypePartSettings.PageSizeDefault", viewModel.PageSizeDefault.ToString()); - builder.WithSetting("ContainerTypePartSettings.PaginatedDefault", viewModel.PaginatedDefault.ToString()); - builder.WithSetting("ContainerTypePartSettings.RestrictedItemContentTypes", viewModel.RestrictedItemContentTypes != null ? string.Join(",", viewModel.RestrictedItemContentTypes) : ""); - builder.WithSetting("ContainerTypePartSettings.RestrictItemContentTypes", viewModel.RestrictItemContentTypes.ToString()); - builder.WithSetting("ContainerTypePartSettings.EnablePositioning", viewModel.EnablePositioning.ToString()); - builder.WithSetting("ContainerTypePartSettings.AdminListViewName", viewModel.AdminListViewName); - builder.WithSetting("ContainerTypePartSettings.DisplayContainerEditor", viewModel.DisplayContainerEditor.ToString()); - yield return DefinitionTemplate(viewModel); - } - - public override IEnumerable PartEditorUpdate(ContentPartDefinitionBuilder builder, IUpdateModel updateModel) { - if (builder.Name != "ContainerPart") - yield break; - - var model = new ContainerPartSettings(); - updateModel.TryUpdateModel(model, "ContainerPartSettings", null, null); - builder.WithSetting("ContainerPartSettings.ItemsShownDefault", model.ItemsShownDefault.ToString()); - builder.WithSetting("ContainerPartSettings.PageSizeDefault", model.PageSizeDefault.ToString()); - builder.WithSetting("ContainerPartSettings.PaginatedDefault", model.PaginatedDefault.ToString()); - yield return DefinitionTemplate(model); - } - } -} +using System.Collections.Generic; +using System.Linq; +using Orchard.ContentManagement; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Builders; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.ContentManagement.ViewModels; +using Orchard.Core.Containers.Extensions; +using Orchard.Core.Containers.Services; +using Orchard.Core.Containers.ViewModels; + +namespace Orchard.Core.Containers.Settings { + public class ContainerPartSettings { + public const bool ItemsShownDefaultDefault = true; + public const int PageSizeDefaultDefault = 10; + public const bool PaginatedDefaultDefault = true; + + private bool? _itemsShownDefault; + private int? _pageSizeDefault; + private bool? _paginiatedDefault; + + public bool ItemsShownDefault { + get { + return _itemsShownDefault != null + ? (bool)_itemsShownDefault + : ItemsShownDefaultDefault; + } + set { _itemsShownDefault = value; } + } + + public int PageSizeDefault { + get { + return _pageSizeDefault != null + ? (int)_pageSizeDefault + : PageSizeDefaultDefault; + } + set { _pageSizeDefault = value; } + } + + public bool PaginatedDefault { + get { + return _paginiatedDefault != null + ? (bool)_paginiatedDefault + : PaginatedDefaultDefault; + } + set { _paginiatedDefault = value; } + } + } + + public class ContainerTypePartSettings { + public ContainerTypePartSettings() { + DisplayContainerEditor = true; + } + + public bool? ItemsShownDefault { get; set; } + public int? PageSizeDefault { get; set; } + public bool? PaginatedDefault { get; set; } + public string RestrictedItemContentTypes { get; set; } + public bool RestrictItemContentTypes { get; set; } + public bool? EnablePositioning { get; set; } + public string AdminListViewName { get; set; } + public bool DisplayContainerEditor { get; set; } + } + + public class ContainerSettingsHooks : ContentDefinitionEditorEventsBase { + private readonly IContainerService _containerService; + private readonly IContentDefinitionManager _contentDefinitionManager; + private readonly IListViewService _listViewService; + + public ContainerSettingsHooks(IContainerService containerService, IContentDefinitionManager contentDefinitionManager, IListViewService listViewService) { + _containerService = containerService; + _contentDefinitionManager = contentDefinitionManager; + _listViewService = listViewService; + } + + public override IEnumerable TypePartEditor(ContentTypePartDefinition definition) { + if (definition.PartDefinition.Name != "ContainerPart") + yield break; + + var model = definition.Settings.GetModel(); + var partModel = definition.PartDefinition.Settings.GetModel(); + + if (model.ItemsShownDefault == null) + model.ItemsShownDefault = partModel.ItemsShownDefault; + + if (model.PageSizeDefault == null) + model.PageSizeDefault = partModel.PageSizeDefault; + + if (model.PaginatedDefault == null) + model.PaginatedDefault = partModel.PaginatedDefault; + + var viewModel = new ContainerTypePartSettingsViewModel { + ItemsShownDefault = model.ItemsShownDefault, + PageSizeDefault = model.PageSizeDefault, + PaginatedDefault = model.PaginatedDefault, + RestrictedItemContentTypes = _contentDefinitionManager.ParseContentTypeDefinitions(model.RestrictedItemContentTypes).Select(x => x.Name).ToList(), + RestrictItemContentTypes = model.RestrictItemContentTypes, + EnablePositioning = model.EnablePositioning, + AdminListViewName = model.AdminListViewName, + AvailableItemContentTypes = _containerService.GetContainableTypes().ToList(), + ListViewProviders = _listViewService.Providers.ToList(), + DisplayContainerEditor = model.DisplayContainerEditor + }; + + yield return DefinitionTemplate(viewModel); + } + + public override IEnumerable PartEditor(ContentPartDefinition definition) { + if (definition.Name != "ContainerPart") + yield break; + + var model = definition.Settings.GetModel(); + yield return DefinitionTemplate(model); + } + + public override IEnumerable TypePartEditorUpdate(ContentTypePartDefinitionBuilder builder, IUpdateModel updateModel) { + if (builder.Name != "ContainerPart") + yield break; + + var viewModel = new ContainerTypePartSettingsViewModel { + AvailableItemContentTypes = _containerService.GetContainableTypes().ToList() + }; + updateModel.TryUpdateModel(viewModel, "ContainerTypePartSettingsViewModel", null, new[] { "AvailableItemContentTypes" }); + builder.WithSetting("ContainerTypePartSettings.ItemsShownDefault", viewModel.ItemsShownDefault.ToString()); + builder.WithSetting("ContainerTypePartSettings.PageSizeDefault", viewModel.PageSizeDefault.ToString()); + builder.WithSetting("ContainerTypePartSettings.PaginatedDefault", viewModel.PaginatedDefault.ToString()); + builder.WithSetting("ContainerTypePartSettings.RestrictedItemContentTypes", viewModel.RestrictedItemContentTypes != null ? string.Join(",", viewModel.RestrictedItemContentTypes) : ""); + builder.WithSetting("ContainerTypePartSettings.RestrictItemContentTypes", viewModel.RestrictItemContentTypes.ToString()); + builder.WithSetting("ContainerTypePartSettings.EnablePositioning", viewModel.EnablePositioning.ToString()); + builder.WithSetting("ContainerTypePartSettings.AdminListViewName", viewModel.AdminListViewName); + builder.WithSetting("ContainerTypePartSettings.DisplayContainerEditor", viewModel.DisplayContainerEditor.ToString()); + yield return DefinitionTemplate(viewModel); + } + + public override IEnumerable PartEditorUpdate(ContentPartDefinitionBuilder builder, IUpdateModel updateModel) { + if (builder.Name != "ContainerPart") + yield break; + + var model = new ContainerPartSettings(); + updateModel.TryUpdateModel(model, "ContainerPartSettings", null, null); + builder.WithSetting("ContainerPartSettings.ItemsShownDefault", model.ItemsShownDefault.ToString()); + builder.WithSetting("ContainerPartSettings.PageSizeDefault", model.PageSizeDefault.ToString()); + builder.WithSetting("ContainerPartSettings.PaginatedDefault", model.PaginatedDefault.ToString()); + yield return DefinitionTemplate(model); + } + } +} diff --git a/src/Orchard.Web/Core/Containers/ViewModels/ContainableViewModel.cs b/src/Orchard.Web/Core/Containers/ViewModels/ContainableViewModel.cs index 3d63b896fae..2ea096e2d87 100644 --- a/src/Orchard.Web/Core/Containers/ViewModels/ContainableViewModel.cs +++ b/src/Orchard.Web/Core/Containers/ViewModels/ContainableViewModel.cs @@ -1,11 +1,11 @@ -using System.Web.Mvc; - -namespace Orchard.Core.Containers.ViewModels { - public class ContainableViewModel { - public int ContainerId { get; set; } - public SelectList AvailableContainers { get; set; } - public int Position { get; set; } - public bool ShowContainerPicker { get; set; } - public bool ShowPositionEditor { get; set; } - } +using System.Web.Mvc; + +namespace Orchard.Core.Containers.ViewModels { + public class ContainableViewModel { + public int ContainerId { get; set; } + public SelectList AvailableContainers { get; set; } + public int Position { get; set; } + public bool ShowContainerPicker { get; set; } + public bool ShowPositionEditor { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Containers/ViewModels/ContainerViewModel.cs b/src/Orchard.Web/Core/Containers/ViewModels/ContainerViewModel.cs index 65006a4eb82..cd19c6c7490 100644 --- a/src/Orchard.Web/Core/Containers/ViewModels/ContainerViewModel.cs +++ b/src/Orchard.Web/Core/Containers/ViewModels/ContainerViewModel.cs @@ -1,33 +1,33 @@ -using System.Collections.Generic; -using Orchard.ContentManagement.MetaData.Models; - -namespace Orchard.Core.Containers.ViewModels { - public class ContainerViewModel { - public IList SelectedItemContentTypes { get; set; } - public bool ItemsShown { get; set; } - public bool Paginated { get; set; } - public int PageSize { get; set; } - public bool ShowOnAdminMenu { get; set; } - public string AdminMenuText { get; set; } - public string AdminMenuPosition { get; set; } - public string AdminMenuImageSet { get; set; } - public IList AvailableItemContentTypes { get; set; } - public bool RestrictItemContentTypes { get; set; } - public bool EnablePositioning { get; set; } - public bool OverrideEnablePositioning { get; set; } - } - - public enum SortBy { - Modified, - Published, - Created, - DisplayText - } - - public enum SortDirection { - Ascending, - Descending, - Created, - DisplayText - } +using System.Collections.Generic; +using Orchard.ContentManagement.MetaData.Models; + +namespace Orchard.Core.Containers.ViewModels { + public class ContainerViewModel { + public IList SelectedItemContentTypes { get; set; } + public bool ItemsShown { get; set; } + public bool Paginated { get; set; } + public int PageSize { get; set; } + public bool ShowOnAdminMenu { get; set; } + public string AdminMenuText { get; set; } + public string AdminMenuPosition { get; set; } + public string AdminMenuImageSet { get; set; } + public IList AvailableItemContentTypes { get; set; } + public bool RestrictItemContentTypes { get; set; } + public bool EnablePositioning { get; set; } + public bool OverrideEnablePositioning { get; set; } + } + + public enum SortBy { + Modified, + Published, + Created, + DisplayText + } + + public enum SortDirection { + Ascending, + Descending, + Created, + DisplayText + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Containers/ViewModels/ContainerWidgetViewModel.cs b/src/Orchard.Web/Core/Containers/ViewModels/ContainerWidgetViewModel.cs index 0c7750d56b1..8719c977938 100644 --- a/src/Orchard.Web/Core/Containers/ViewModels/ContainerWidgetViewModel.cs +++ b/src/Orchard.Web/Core/Containers/ViewModels/ContainerWidgetViewModel.cs @@ -1,10 +1,10 @@ -using System.Web.Mvc; -using Orchard.Core.Containers.Models; - -namespace Orchard.Core.Containers.ViewModels { - public class ContainerWidgetViewModel { - public bool UseFilter { get; set; } - public SelectList AvailableContainers { get; set; } - public ContainerWidgetPart Part { get; set; } - } +using System.Web.Mvc; +using Orchard.Core.Containers.Models; + +namespace Orchard.Core.Containers.ViewModels { + public class ContainerWidgetViewModel { + public bool UseFilter { get; set; } + public SelectList AvailableContainers { get; set; } + public ContainerWidgetPart Part { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Containers/Views/DefinitionTemplates/ContainerPartSettings.cshtml b/src/Orchard.Web/Core/Containers/Views/DefinitionTemplates/ContainerPartSettings.cshtml index dcb9561c957..4b293ae145f 100644 --- a/src/Orchard.Web/Core/Containers/Views/DefinitionTemplates/ContainerPartSettings.cshtml +++ b/src/Orchard.Web/Core/Containers/Views/DefinitionTemplates/ContainerPartSettings.cshtml @@ -1,9 +1,9 @@ -@model Orchard.Core.Containers.Settings.ContainerPartSettings -
        - - @Html.EditorFor(m => m.PageSizeDefault) -
        -
        - @Html.EditorFor(m => m.PaginatedDefault) - +@model Orchard.Core.Containers.Settings.ContainerPartSettings +
        + + @Html.EditorFor(m => m.PageSizeDefault) +
        +
        + @Html.EditorFor(m => m.PaginatedDefault) +
        \ No newline at end of file diff --git a/src/Orchard.Web/Core/Containers/Views/EditorTemplates/Containable.cshtml b/src/Orchard.Web/Core/Containers/Views/EditorTemplates/Containable.cshtml index b17bbf312c1..faf6caa8d56 100644 --- a/src/Orchard.Web/Core/Containers/Views/EditorTemplates/Containable.cshtml +++ b/src/Orchard.Web/Core/Containers/Views/EditorTemplates/Containable.cshtml @@ -1,15 +1,15 @@ -@model Orchard.Core.Containers.ViewModels.ContainableViewModel -
        - @if (Model.ShowContainerPicker) { - - @Html.LabelFor(m => m.ContainerId, T("Member of")) - @Html.DropDownListFor(m => m.ContainerId, Model.AvailableContainers) - - } - @if (Model.ShowPositionEditor) { - - @Html.LabelFor(m => m.Position, T("Position")) - @Html.TextBoxFor(m => m.Position, new {@class = "text text-small"}) - - } +@model Orchard.Core.Containers.ViewModels.ContainableViewModel +
        + @if (Model.ShowContainerPicker) { + + @Html.LabelFor(m => m.ContainerId, T("Member of")) + @Html.DropDownListFor(m => m.ContainerId, Model.AvailableContainers) + + } + @if (Model.ShowPositionEditor) { + + @Html.LabelFor(m => m.Position, T("Position")) + @Html.TextBoxFor(m => m.Position, new {@class = "text text-small"}) + + }
        \ No newline at end of file diff --git a/src/Orchard.Web/Core/Containers/Views/EditorTemplates/Container.cshtml b/src/Orchard.Web/Core/Containers/Views/EditorTemplates/Container.cshtml index 02cdf1673e4..82a1501ba44 100644 --- a/src/Orchard.Web/Core/Containers/Views/EditorTemplates/Container.cshtml +++ b/src/Orchard.Web/Core/Containers/Views/EditorTemplates/Container.cshtml @@ -1,56 +1,56 @@ -@model Orchard.Core.Containers.ViewModels.ContainerViewModel -@{ - Script.Require("ShapesBase"); -} -
        - - @Html.EditorFor(m => m.ItemsShown) - - @T("Renders the contained items when this list is displayed.") - -
        -@if (Model.OverrideEnablePositioning) { -
        - - @Html.EditorFor(m => m.EnablePositioning) - @Html.LabelFor(m => m.EnablePositioning, @T("Enable positoning").ToString(), new { @class = "forcheckbox" }) - @T("Check this option to enable manual repositioning of items.") - -
        -} -@if (Model.AvailableItemContentTypes.Any()) { -
        - @Html.LabelFor(m => m.SelectedItemContentTypes, T("Contains")) - - @T("Select zero or more content types. Selecting zero content types means the list can contain any content type. Only types with the Containable part can be contained in a list.") -
        -} -
        - - @Html.LabelFor(m => m.PageSize, T("Page size")) - @Html.TextBoxFor(m => m.PageSize, new { @class = "text text-small" }) - - - @Html.CheckBoxFor(m => m.Paginated) - - -
        -
        - @Html.EditorFor(m => m.ShowOnAdminMenu) - @Html.LabelFor(m => m.ShowOnAdminMenu, T("Show on admin menu").ToString(), new { @class = "forcheckbox" }) -
        - @Html.LabelFor(m => m.AdminMenuText, T("Menu text")) - @Html.TextBoxFor(m => m.AdminMenuText, new { @class = "text-box single-line" }) - - @Html.LabelFor(m => m.AdminMenuPosition, T("Position")) - @Html.TextBoxFor(m => m.AdminMenuPosition, new { @class = "text-box single-line" }) - - @Html.LabelFor(m => m.AdminMenuImageSet, T("Image Set")) - @Html.TextBoxFor(m => m.AdminMenuImageSet, new { @class = "text-box single-line" }) -
        +@model Orchard.Core.Containers.ViewModels.ContainerViewModel +@{ + Script.Require("ShapesBase"); +} +
        + + @Html.EditorFor(m => m.ItemsShown) + + @T("Renders the contained items when this list is displayed.") + +
        +@if (Model.OverrideEnablePositioning) { +
        + + @Html.EditorFor(m => m.EnablePositioning) + @Html.LabelFor(m => m.EnablePositioning, @T("Enable positoning").ToString(), new { @class = "forcheckbox" }) + @T("Check this option to enable manual repositioning of items.") + +
        +} +@if (Model.AvailableItemContentTypes.Any()) { +
        + @Html.LabelFor(m => m.SelectedItemContentTypes, T("Contains")) + + @T("Select zero or more content types. Selecting zero content types means the list can contain any content type. Only types with the Containable part can be contained in a list.") +
        +} +
        + + @Html.LabelFor(m => m.PageSize, T("Page size")) + @Html.TextBoxFor(m => m.PageSize, new { @class = "text text-small" }) + + + @Html.CheckBoxFor(m => m.Paginated) + + +
        +
        + @Html.EditorFor(m => m.ShowOnAdminMenu) + @Html.LabelFor(m => m.ShowOnAdminMenu, T("Show on admin menu").ToString(), new { @class = "forcheckbox" }) +
        + @Html.LabelFor(m => m.AdminMenuText, T("Menu text")) + @Html.TextBoxFor(m => m.AdminMenuText, new { @class = "text-box single-line" }) + + @Html.LabelFor(m => m.AdminMenuPosition, T("Position")) + @Html.TextBoxFor(m => m.AdminMenuPosition, new { @class = "text-box single-line" }) + + @Html.LabelFor(m => m.AdminMenuImageSet, T("Image Set")) + @Html.TextBoxFor(m => m.AdminMenuImageSet, new { @class = "text-box single-line" }) +
        \ No newline at end of file diff --git a/src/Orchard.Web/Core/Containers/Views/EditorTemplates/ContainerWidget.cshtml b/src/Orchard.Web/Core/Containers/Views/EditorTemplates/ContainerWidget.cshtml index 9be03b72262..8855bfce26a 100644 --- a/src/Orchard.Web/Core/Containers/Views/EditorTemplates/ContainerWidget.cshtml +++ b/src/Orchard.Web/Core/Containers/Views/EditorTemplates/ContainerWidget.cshtml @@ -1,57 +1,57 @@ -@model Orchard.Core.Containers.ViewModels.ContainerWidgetViewModel -@using Orchard.Core.Containers.Models; -@{ - Script.Require("ShapesBase"); -} -
        - @Html.LabelFor(m => m.Part.Record.ContainerId, T("Show items from")) - @Html.DropDownListFor(m => m.Part.Record.ContainerId, Model.AvailableContainers) -
        -
        - - @Html.LabelFor(m => m.Part.Record.PageSize, T("Maximum number of items to display")) - @Html.TextBoxFor(m => m.Part.Record.PageSize, new { @class = "text small" }) - -
        -
        - @Html.LabelFor(m => m.Part.Record.OrderByProperty, T("Order by")) - - -
        -
        -
        - @Html.EditorFor(m => m.Part.Record.ApplyFilter) - -
        -
        - @Html.LabelFor(m => m.Part.Record.FilterByProperty, T("Filter where")) - - - - @Html.TextBoxFor(m => m.Part.Record.FilterByValue, new { @class = "text", title = T("Filter value") }) - -
        +@model Orchard.Core.Containers.ViewModels.ContainerWidgetViewModel +@using Orchard.Core.Containers.Models; +@{ + Script.Require("ShapesBase"); +} +
        + @Html.LabelFor(m => m.Part.Record.ContainerId, T("Show items from")) + @Html.DropDownListFor(m => m.Part.Record.ContainerId, Model.AvailableContainers) +
        +
        + + @Html.LabelFor(m => m.Part.Record.PageSize, T("Maximum number of items to display")) + @Html.TextBoxFor(m => m.Part.Record.PageSize, new { @class = "text small" }) + +
        +
        + @Html.LabelFor(m => m.Part.Record.OrderByProperty, T("Order by")) + + +
        +
        +
        + @Html.EditorFor(m => m.Part.Record.ApplyFilter) + +
        +
        + @Html.LabelFor(m => m.Part.Record.FilterByProperty, T("Filter where")) + + + + @Html.TextBoxFor(m => m.Part.Record.FilterByValue, new { @class = "text", title = T("Filter value") }) + +
        \ No newline at end of file diff --git a/src/Orchard.Web/Core/Containers/Views/EditorTemplates/CustomProperties.cshtml b/src/Orchard.Web/Core/Containers/Views/EditorTemplates/CustomProperties.cshtml index dc1caa247da..fe200eb318a 100644 --- a/src/Orchard.Web/Core/Containers/Views/EditorTemplates/CustomProperties.cshtml +++ b/src/Orchard.Web/Core/Containers/Views/EditorTemplates/CustomProperties.cshtml @@ -1,13 +1,13 @@ -@model Orchard.Core.Containers.Models.CustomPropertiesPart -
        - @Html.LabelFor(m => m.Record.CustomOne, T("Custom One")) - @Html.EditorFor(m => m.Record.CustomOne) -
        -
        - @Html.LabelFor(m => m.Record.CustomTwo, T("Custom Two")) - @Html.EditorFor(m => m.Record.CustomTwo) -
        -
        - @Html.LabelFor(m => m.Record.CustomThree, T("Custom Three")) - @Html.EditorFor(m => m.Record.CustomThree) +@model Orchard.Core.Containers.Models.CustomPropertiesPart +
        + @Html.LabelFor(m => m.Record.CustomOne, T("Custom One")) + @Html.EditorFor(m => m.Record.CustomOne) +
        +
        + @Html.LabelFor(m => m.Record.CustomTwo, T("Custom Two")) + @Html.EditorFor(m => m.Record.CustomTwo) +
        +
        + @Html.LabelFor(m => m.Record.CustomThree, T("Custom Three")) + @Html.EditorFor(m => m.Record.CustomThree)
        \ No newline at end of file diff --git a/src/Orchard.Web/Core/Containers/Views/Parts.Container.Contained.cshtml b/src/Orchard.Web/Core/Containers/Views/Parts.Container.Contained.cshtml index 31455c080ca..771d9412789 100644 --- a/src/Orchard.Web/Core/Containers/Views/Parts.Container.Contained.cshtml +++ b/src/Orchard.Web/Core/Containers/Views/Parts.Container.Contained.cshtml @@ -1,3 +1,3 @@ -@Display(Model.List) - +@Display(Model.List) + @Display(Model.Pager) \ No newline at end of file diff --git a/src/Orchard.Web/Core/Containers/Views/Parts.ContainerWidget.cshtml b/src/Orchard.Web/Core/Containers/Views/Parts.ContainerWidget.cshtml index 8623f85b8d8..5e77596dcfb 100644 --- a/src/Orchard.Web/Core/Containers/Views/Parts.ContainerWidget.cshtml +++ b/src/Orchard.Web/Core/Containers/Views/Parts.ContainerWidget.cshtml @@ -1,6 +1,6 @@ -@{ - IEnumerable items = Model.ContentItems; - Model.ContentItems.Classes.Add("content-items"); - Model.ContentItems.Classes.Add("list-items"); -} +@{ + IEnumerable items = Model.ContentItems; + Model.ContentItems.Classes.Add("content-items"); + Model.ContentItems.Classes.Add("list-items"); +} @Display(items) \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/AdminMenu.cs b/src/Orchard.Web/Core/Contents/AdminMenu.cs index 7feb18d7f2c..514c049cabb 100644 --- a/src/Orchard.Web/Core/Contents/AdminMenu.cs +++ b/src/Orchard.Web/Core/Contents/AdminMenu.cs @@ -1,45 +1,45 @@ -using System.Linq; -using Orchard.ContentManagement; -using Orchard.ContentManagement.MetaData; -using Orchard.Core.Contents.Settings; -using Orchard.Localization; -using Orchard.UI.Navigation; - -namespace Orchard.Core.Contents { - public class AdminMenu : INavigationProvider { - private readonly IContentDefinitionManager _contentDefinitionManager; - private readonly IContentManager _contentManager; - - public AdminMenu(IContentDefinitionManager contentDefinitionManager, IContentManager contentManager) { - _contentDefinitionManager = contentDefinitionManager; - _contentManager = contentManager; - } - - public Localizer T { get; set; } - public string MenuName { get { return "admin"; } } - - public void GetNavigation(NavigationBuilder builder) { - var contentTypeDefinitions = _contentDefinitionManager.ListTypeDefinitions().OrderBy(d => d.Name); - builder.AddImageSet("content") - .Add(T("Content"), "1.4", menu => menu - .Permission(Permissions.EditOwnContent) - .Add(T("Content Items"), "1", item => item.Action("List", "Admin", new { area = "Contents", id = "" }).LocalNav())); - var contentTypes = contentTypeDefinitions.Where(ctd => ctd.Settings.GetModel().Creatable).OrderBy(ctd => ctd.DisplayName); - if (contentTypes.Any()) { - builder.Add(T("New"), "-1", menu => { - menu.LinkToFirstChild(false); - foreach (var contentTypeDefinition in contentTypes) { - var ci = _contentManager.New(contentTypeDefinition.Name); - var cim = _contentManager.GetItemMetadata(ci); - var createRouteValues = cim.CreateRouteValues; - // review: the display name should be a LocalizedString - if (createRouteValues.Any()) - menu.Add(T(contentTypeDefinition.DisplayName), "5", item => item.Action(cim.CreateRouteValues["Action"] as string, cim.CreateRouteValues["Controller"] as string, cim.CreateRouteValues) - // Apply "PublishOwn" permission for the content type - .Permission(DynamicPermissions.CreateDynamicPermission(DynamicPermissions.PermissionTemplates[Permissions.PublishOwnContent.Name], contentTypeDefinition))); - } - }); - } - } - } +using System.Linq; +using Orchard.ContentManagement; +using Orchard.ContentManagement.MetaData; +using Orchard.Core.Contents.Settings; +using Orchard.Localization; +using Orchard.UI.Navigation; + +namespace Orchard.Core.Contents { + public class AdminMenu : INavigationProvider { + private readonly IContentDefinitionManager _contentDefinitionManager; + private readonly IContentManager _contentManager; + + public AdminMenu(IContentDefinitionManager contentDefinitionManager, IContentManager contentManager) { + _contentDefinitionManager = contentDefinitionManager; + _contentManager = contentManager; + } + + public Localizer T { get; set; } + public string MenuName { get { return "admin"; } } + + public void GetNavigation(NavigationBuilder builder) { + var contentTypeDefinitions = _contentDefinitionManager.ListTypeDefinitions().OrderBy(d => d.Name); + builder.AddImageSet("content") + .Add(T("Content"), "1.4", menu => menu + .Permission(Permissions.EditOwnContent) + .Add(T("Content Items"), "1", item => item.Action("List", "Admin", new { area = "Contents", id = "" }).LocalNav())); + var contentTypes = contentTypeDefinitions.Where(ctd => ctd.Settings.GetModel().Creatable).OrderBy(ctd => ctd.DisplayName); + if (contentTypes.Any()) { + builder.Add(T("New"), "-1", menu => { + menu.LinkToFirstChild(false); + foreach (var contentTypeDefinition in contentTypes) { + var ci = _contentManager.New(contentTypeDefinition.Name); + var cim = _contentManager.GetItemMetadata(ci); + var createRouteValues = cim.CreateRouteValues; + // review: the display name should be a LocalizedString + if (createRouteValues.Any()) + menu.Add(T(contentTypeDefinition.DisplayName), "5", item => item.Action(cim.CreateRouteValues["Action"] as string, cim.CreateRouteValues["Controller"] as string, cim.CreateRouteValues) + // Apply "PublishOwn" permission for the content type + .Permission(DynamicPermissions.CreateDynamicPermission(DynamicPermissions.PermissionTemplates[Permissions.PublishOwnContent.Name], contentTypeDefinition))); + } + }); + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/ControlWrapper.cs b/src/Orchard.Web/Core/Contents/ControlWrapper.cs index b3021e08a2e..b3e4edbc6bb 100644 --- a/src/Orchard.Web/Core/Contents/ControlWrapper.cs +++ b/src/Orchard.Web/Core/Contents/ControlWrapper.cs @@ -1,19 +1,19 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using Orchard.DisplayManagement.Descriptors; -using Orchard.Environment.Extensions; - -namespace Orchard.Core.Contents { - [OrchardFeature("Contents.ControlWrapper")] - public class ControlWrapper : IShapeTableProvider { - public void Discover(ShapeTableBuilder builder) { - builder.Describe("Content").OnDisplaying(displaying => { - if (!displaying.ShapeMetadata.DisplayType.Contains("Admin")) { - displaying.ShapeMetadata.Wrappers.Add("Content_ControlWrapper"); - } - }); - } - } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using Orchard.DisplayManagement.Descriptors; +using Orchard.Environment.Extensions; + +namespace Orchard.Core.Contents { + [OrchardFeature("Contents.ControlWrapper")] + public class ControlWrapper : IShapeTableProvider { + public void Discover(ShapeTableBuilder builder) { + builder.Describe("Content").OnDisplaying(displaying => { + if (!displaying.ShapeMetadata.DisplayType.Contains("Admin")) { + displaying.ShapeMetadata.Wrappers.Add("Content_ControlWrapper"); + } + }); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs b/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs index 2a13a1c554d..495f3eaeb7e 100644 --- a/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs +++ b/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs @@ -1,476 +1,476 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Web.Mvc; -using System.Web.Routing; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Aspects; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.MetaData.Models; -using Orchard.Core.Common.Models; -using Orchard.Core.Containers.Models; -using Orchard.Core.Contents.Settings; -using Orchard.Core.Contents.ViewModels; -using Orchard.Data; -using Orchard.DisplayManagement; -using Orchard.Localization; -using Orchard.Logging; -using Orchard.Mvc.Extensions; -using Orchard.Mvc.Html; -using Orchard.UI.Navigation; -using Orchard.UI.Notify; -using Orchard.Settings; -using Orchard.Utility.Extensions; -using Orchard.Localization.Services; - -namespace Orchard.Core.Contents.Controllers { - [ValidateInput(false)] - public class AdminController : Controller, IUpdateModel { - private readonly IContentManager _contentManager; - private readonly IContentDefinitionManager _contentDefinitionManager; - private readonly ITransactionManager _transactionManager; - private readonly ISiteService _siteService; - private readonly ICultureManager _cultureManager; - private readonly ICultureFilter _cultureFilter; - - public AdminController( - IOrchardServices orchardServices, - IContentManager contentManager, - IContentDefinitionManager contentDefinitionManager, - ITransactionManager transactionManager, - ISiteService siteService, - IShapeFactory shapeFactory, - ICultureManager cultureManager, - ICultureFilter cultureFilter) { - Services = orchardServices; - _contentManager = contentManager; - _contentDefinitionManager = contentDefinitionManager; - _transactionManager = transactionManager; - _siteService = siteService; - _cultureManager = cultureManager; - _cultureFilter = cultureFilter; - - T = NullLocalizer.Instance; - Logger = NullLogger.Instance; - Shape = shapeFactory; - } - - dynamic Shape { get; set; } - public IOrchardServices Services { get; private set; } - public Localizer T { get; set; } - public ILogger Logger { get; set; } - - public ActionResult List(ListContentsViewModel model, PagerParameters pagerParameters) { - Pager pager = new Pager(_siteService.GetSiteSettings(), pagerParameters); - - var versionOptions = VersionOptions.Latest; - switch (model.Options.ContentsStatus) { - case ContentsStatus.Published: - versionOptions = VersionOptions.Published; - break; - case ContentsStatus.Draft: - versionOptions = VersionOptions.Draft; - break; - case ContentsStatus.AllVersions: - versionOptions = VersionOptions.AllVersions; - break; - default: - versionOptions = VersionOptions.Latest; - break; - } - - var query = _contentManager.Query(versionOptions, GetListableTypes(false).Select(ctd => ctd.Name).ToArray()); - - if (!string.IsNullOrEmpty(model.TypeName)) { - var contentTypeDefinition = _contentDefinitionManager.GetTypeDefinition(model.TypeName); - if (contentTypeDefinition == null) - return HttpNotFound(); - - model.TypeDisplayName = !string.IsNullOrWhiteSpace(contentTypeDefinition.DisplayName) - ? contentTypeDefinition.DisplayName - : contentTypeDefinition.Name; - query = query.ForType(model.TypeName); - } - - switch (model.Options.OrderBy) { - case ContentsOrder.Modified: - //query = query.OrderByDescending(ci => ci.ContentItemRecord.Versions.Single(civr => civr.Latest).Id); - query = query.OrderByDescending(cr => cr.ModifiedUtc); - break; - case ContentsOrder.Published: - query = query.OrderByDescending(cr => cr.PublishedUtc); - break; - case ContentsOrder.Created: - //query = query.OrderByDescending(ci => ci.Id); - query = query.OrderByDescending(cr => cr.CreatedUtc); - break; - } - - if(!String.IsNullOrWhiteSpace(model.Options.SelectedCulture)) { - query = _cultureFilter.FilterCulture(query, model.Options.SelectedCulture); - } - - if(model.Options.ContentsStatus == ContentsStatus.Owner) { - query = query.Where(cr => cr.OwnerId == Services.WorkContext.CurrentUser.Id); - } - - model.Options.SelectedFilter = model.TypeName; - model.Options.FilterOptions = GetListableTypes(false) - .Select(ctd => new KeyValuePair(ctd.Name, ctd.DisplayName)) - .ToList().OrderBy(kvp => kvp.Value); - - model.Options.Cultures = _cultureManager.ListCultures(); - - var maxPagedCount = _siteService.GetSiteSettings().MaxPagedCount; - if (maxPagedCount > 0 && pager.PageSize > maxPagedCount) - pager.PageSize = maxPagedCount; - var pagerShape = Shape.Pager(pager).TotalItemCount(maxPagedCount > 0 ? maxPagedCount : query.Count()); - var pageOfContentItems = query.Slice(pager.GetStartIndex(), pager.PageSize).ToList(); - - var list = Shape.List(); - list.AddRange(pageOfContentItems.Select(ci => _contentManager.BuildDisplay(ci, "SummaryAdmin"))); - - var viewModel = Shape.ViewModel() - .ContentItems(list) - .Pager(pagerShape) - .Options(model.Options) - .TypeDisplayName(model.TypeDisplayName ?? ""); - - return View(viewModel); - } - - private IEnumerable GetCreatableTypes(bool andContainable) { - return _contentDefinitionManager.ListTypeDefinitions().Where(ctd => - Services.Authorizer.Authorize(Permissions.EditContent, _contentManager.New(ctd.Name)) && - ctd.Settings.GetModel().Creatable && - (!andContainable || ctd.Parts.Any(p => p.PartDefinition.Name == "ContainablePart"))); - } - - private IEnumerable GetListableTypes(bool andContainable) { - return _contentDefinitionManager.ListTypeDefinitions().Where(ctd => - Services.Authorizer.Authorize(Permissions.EditContent, _contentManager.New(ctd.Name)) && - ctd.Settings.GetModel().Listable && - (!andContainable || ctd.Parts.Any(p => p.PartDefinition.Name == "ContainablePart"))); - } - - [HttpPost, ActionName("List")] - [Mvc.FormValueRequired("submit.Filter")] - public ActionResult ListFilterPOST(ContentOptions options) { - var routeValues = ControllerContext.RouteData.Values; - if (options != null) { - routeValues["Options.SelectedCulture"] = options.SelectedCulture; //todo: don't hard-code the key - routeValues["Options.OrderBy"] = options.OrderBy; //todo: don't hard-code the key - routeValues["Options.ContentsStatus"] = options.ContentsStatus; //todo: don't hard-code the key - if (GetListableTypes(false).Any(ctd => string.Equals(ctd.Name, options.SelectedFilter, StringComparison.OrdinalIgnoreCase))) { - routeValues["id"] = options.SelectedFilter; - } - else { - routeValues.Remove("id"); - } - } - - return RedirectToAction("List", routeValues); - } - - [HttpPost, ActionName("List")] - [Mvc.FormValueRequired("submit.BulkEdit")] - public ActionResult ListPOST(ContentOptions options, IEnumerable itemIds, string returnUrl) { - if (itemIds != null) { - var checkedContentItems = _contentManager.GetMany(itemIds, VersionOptions.Latest, QueryHints.Empty); - switch (options.BulkAction) { - case ContentsBulkAction.None: - break; - case ContentsBulkAction.PublishNow: - foreach (var item in checkedContentItems) { - if (!Services.Authorizer.Authorize(Permissions.PublishContent, item, T("Couldn't publish selected content."))) { - _transactionManager.Cancel(); - return new HttpUnauthorizedResult(); - } - - _contentManager.Publish(item); - } - Services.Notifier.Information(T("Content successfully published.")); - break; - case ContentsBulkAction.Unpublish: - foreach (var item in checkedContentItems) { - if (!Services.Authorizer.Authorize(Permissions.PublishContent, item, T("Couldn't unpublish selected content."))) { - _transactionManager.Cancel(); - return new HttpUnauthorizedResult(); - } - - _contentManager.Unpublish(item); - } - Services.Notifier.Information(T("Content successfully unpublished.")); - break; - case ContentsBulkAction.Remove: - foreach (var item in checkedContentItems) { - if (!Services.Authorizer.Authorize(Permissions.DeleteContent, item, T("Couldn't remove selected content."))) { - _transactionManager.Cancel(); - return new HttpUnauthorizedResult(); - } - - _contentManager.Remove(item); - } - Services.Notifier.Information(T("Content successfully removed.")); - break; - default: - throw new ArgumentOutOfRangeException(); - } - } - - return this.RedirectLocal(returnUrl, () => RedirectToAction("List")); - } - - ActionResult CreatableTypeList(int? containerId) { - var viewModel = Shape.ViewModel(ContentTypes: GetCreatableTypes(containerId.HasValue), ContainerId: containerId); - - return View("CreatableTypeList", viewModel); - } - - ActionResult ListableTypeList(int? containerId) { - var viewModel = Shape.ViewModel(ContentTypes: GetListableTypes(containerId.HasValue), ContainerId: containerId); - - return View("ListableTypeList", viewModel); - } - - public ActionResult Create(string id, int? containerId) { - if (string.IsNullOrEmpty(id)) - return CreatableTypeList(containerId); - - var contentItem = _contentManager.New(id); - - if (!Services.Authorizer.Authorize(Permissions.EditContent, contentItem, T("Cannot create content"))) - return new HttpUnauthorizedResult(); - - if (containerId.HasValue && contentItem.Is()) { - var common = contentItem.As(); - if (common != null) { - common.Container = _contentManager.Get(containerId.Value); - } - } - - var model = _contentManager.BuildEditor(contentItem); - return View(model); - } - - [HttpPost, ActionName("Create")] - [Mvc.FormValueRequired("submit.Save")] - public ActionResult CreatePOST(string id, string returnUrl) { - return CreatePOST(id, returnUrl, contentItem => { - if (!contentItem.Has() && !contentItem.TypeDefinition.Settings.GetModel().Draftable) - _contentManager.Publish(contentItem); - }); - } - - [HttpPost, ActionName("Create")] - [Mvc.FormValueRequired("submit.Publish")] - public ActionResult CreateAndPublishPOST(string id, string returnUrl) { - - // pass a dummy content to the authorization check to check for "own" variations - var dummyContent = _contentManager.New(id); - - if (!Services.Authorizer.Authorize(Permissions.PublishContent, dummyContent, T("Couldn't create content"))) - return new HttpUnauthorizedResult(); - - return CreatePOST(id, returnUrl, contentItem => _contentManager.Publish(contentItem)); - } - - private ActionResult CreatePOST(string id, string returnUrl, Action conditionallyPublish) { - var contentItem = _contentManager.New(id); - - if (!Services.Authorizer.Authorize(Permissions.EditContent, contentItem, T("Couldn't create content"))) - return new HttpUnauthorizedResult(); - - _contentManager.Create(contentItem, VersionOptions.Draft); - - var model = _contentManager.UpdateEditor(contentItem, this); - - if (!ModelState.IsValid) { - _transactionManager.Cancel(); - return View(model); - } - - conditionallyPublish(contentItem); - - Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) - ? T("Your content has been created.") - : T("Your {0} has been created.", contentItem.TypeDefinition.DisplayName)); - if (!string.IsNullOrEmpty(returnUrl)) { - return this.RedirectLocal(returnUrl); - } - var adminRouteValues = _contentManager.GetItemMetadata(contentItem).AdminRouteValues; - return RedirectToRoute(adminRouteValues); - } - - public ActionResult Edit(int id) { - var contentItem = _contentManager.Get(id, VersionOptions.Latest); - - if (contentItem == null) - return HttpNotFound(); - - if (!Services.Authorizer.Authorize(Permissions.EditContent, contentItem, T("Cannot edit content"))) - return new HttpUnauthorizedResult(); - - var model = _contentManager.BuildEditor(contentItem); - return View(model); - } - - [HttpPost, ActionName("Edit")] - [Mvc.FormValueRequired("submit.Save")] - public ActionResult EditPOST(int id, string returnUrl) { - return EditPOST(id, returnUrl, contentItem => { - if (!contentItem.Has() && !contentItem.TypeDefinition.Settings.GetModel().Draftable) - _contentManager.Publish(contentItem); - }); - } - - [HttpPost, ActionName("Edit")] - [Mvc.FormValueRequired("submit.Publish")] - public ActionResult EditAndPublishPOST(int id, string returnUrl) { - var content = _contentManager.Get(id, VersionOptions.Latest); - - if (content == null) - return HttpNotFound(); - - if (!Services.Authorizer.Authorize(Permissions.PublishContent, content, T("Couldn't publish content"))) - return new HttpUnauthorizedResult(); - - return EditPOST(id, returnUrl, contentItem => _contentManager.Publish(contentItem)); - } - - private ActionResult EditPOST(int id, string returnUrl, Action conditionallyPublish) { - var contentItem = _contentManager.Get(id, VersionOptions.DraftRequired); - - if (contentItem == null) - return HttpNotFound(); - - if (!Services.Authorizer.Authorize(Permissions.EditContent, contentItem, T("Couldn't edit content"))) - return new HttpUnauthorizedResult(); - - string previousRoute = null; - if (contentItem.Has() - && !string.IsNullOrWhiteSpace(returnUrl) - && Request.IsLocalUrl(returnUrl) - // only if the original returnUrl is the content itself - && String.Equals(returnUrl, Url.ItemDisplayUrl(contentItem), StringComparison.OrdinalIgnoreCase) - ) { - previousRoute = contentItem.As().Path; - } - - var model = _contentManager.UpdateEditor(contentItem, this); - if (!ModelState.IsValid) { - _transactionManager.Cancel(); - return View("Edit", model); - } - - conditionallyPublish(contentItem); - - if (!string.IsNullOrWhiteSpace(returnUrl) - && previousRoute != null - && !String.Equals(contentItem.As().Path, previousRoute, StringComparison.OrdinalIgnoreCase)) { - returnUrl = Url.ItemDisplayUrl(contentItem); - } - - Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) - ? T("Your content has been saved.") - : T("Your {0} has been saved.", contentItem.TypeDefinition.DisplayName)); - - return this.RedirectLocal(returnUrl, () => RedirectToAction("Edit", new RouteValueDictionary { { "Id", contentItem.Id } })); - } - - [HttpPost] - public ActionResult Clone(int id, string returnUrl) { - var contentItem = _contentManager.GetLatest(id); - - if (contentItem == null) - return HttpNotFound(); - - if (!Services.Authorizer.Authorize(Permissions.EditContent, contentItem, T("Couldn't clone content"))) - return new HttpUnauthorizedResult(); - - try { - Services.ContentManager.Clone(contentItem); - } - catch (InvalidOperationException) { - Services.Notifier.Warning(T("Could not clone the content item.")); - return this.RedirectLocal(returnUrl, () => RedirectToAction("List")); - } - - Services.Notifier.Information(T("Successfully cloned. The clone was saved as a draft.")); - - return this.RedirectLocal(returnUrl, () => RedirectToAction("List")); - } - - [HttpPost] - public ActionResult Remove(int id, string returnUrl) { - var contentItem = _contentManager.Get(id, VersionOptions.Latest); - - if (!Services.Authorizer.Authorize(Permissions.DeleteContent, contentItem, T("Couldn't remove content"))) - return new HttpUnauthorizedResult(); - - if (contentItem != null) { - _contentManager.Remove(contentItem); - Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) - ? T("That content has been removed.") - : T("That {0} has been removed.", contentItem.TypeDefinition.DisplayName)); - } - - return this.RedirectLocal(returnUrl, () => RedirectToAction("List")); - } - - [HttpPost] - public ActionResult Publish(int id, string returnUrl) { - var contentItem = _contentManager.GetLatest(id); - if (contentItem == null) - return HttpNotFound(); - - if (!Services.Authorizer.Authorize(Permissions.PublishContent, contentItem, T("Couldn't publish content"))) - return new HttpUnauthorizedResult(); - - _contentManager.Publish(contentItem); - - Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) ? T("That content has been published.") : T("That {0} has been published.", contentItem.TypeDefinition.DisplayName)); - - return this.RedirectLocal(returnUrl, () => RedirectToAction("List")); - } - - [HttpPost] - public ActionResult Unpublish(int id, string returnUrl) { - var contentItem = _contentManager.GetLatest(id); - if (contentItem == null) - return HttpNotFound(); - - if (!Services.Authorizer.Authorize(Permissions.PublishContent, contentItem, T("Couldn't unpublish content"))) - return new HttpUnauthorizedResult(); - - _contentManager.Unpublish(contentItem); - - Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) ? T("That content has been unpublished.") : T("That {0} has been unpublished.", contentItem.TypeDefinition.DisplayName)); - - return this.RedirectLocal(returnUrl, () => RedirectToAction("List")); - } - - bool IUpdateModel.TryUpdateModel(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) { - return TryUpdateModel(model, prefix, includeProperties, excludeProperties); - } - - void IUpdateModel.AddModelError(string key, LocalizedString errorMessage) { - ModelState.AddModelError(key, errorMessage.ToString()); - } - } - - [Obsolete("Use Orchard.Mvc.FormValueRequiredAttribute instead.")] - public class FormValueRequiredAttribute : ActionMethodSelectorAttribute { - private readonly string _submitButtonName; - - public FormValueRequiredAttribute(string submitButtonName) { - _submitButtonName = submitButtonName; - } - - public override bool IsValidForRequest(ControllerContext controllerContext, MethodInfo methodInfo) { - var value = controllerContext.HttpContext.Request.Form[_submitButtonName]; - return !string.IsNullOrEmpty(value); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Web.Mvc; +using System.Web.Routing; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Aspects; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.Core.Common.Models; +using Orchard.Core.Containers.Models; +using Orchard.Core.Contents.Settings; +using Orchard.Core.Contents.ViewModels; +using Orchard.Data; +using Orchard.DisplayManagement; +using Orchard.Localization; +using Orchard.Logging; +using Orchard.Mvc.Extensions; +using Orchard.Mvc.Html; +using Orchard.UI.Navigation; +using Orchard.UI.Notify; +using Orchard.Settings; +using Orchard.Utility.Extensions; +using Orchard.Localization.Services; + +namespace Orchard.Core.Contents.Controllers { + [ValidateInput(false)] + public class AdminController : Controller, IUpdateModel { + private readonly IContentManager _contentManager; + private readonly IContentDefinitionManager _contentDefinitionManager; + private readonly ITransactionManager _transactionManager; + private readonly ISiteService _siteService; + private readonly ICultureManager _cultureManager; + private readonly ICultureFilter _cultureFilter; + + public AdminController( + IOrchardServices orchardServices, + IContentManager contentManager, + IContentDefinitionManager contentDefinitionManager, + ITransactionManager transactionManager, + ISiteService siteService, + IShapeFactory shapeFactory, + ICultureManager cultureManager, + ICultureFilter cultureFilter) { + Services = orchardServices; + _contentManager = contentManager; + _contentDefinitionManager = contentDefinitionManager; + _transactionManager = transactionManager; + _siteService = siteService; + _cultureManager = cultureManager; + _cultureFilter = cultureFilter; + + T = NullLocalizer.Instance; + Logger = NullLogger.Instance; + Shape = shapeFactory; + } + + dynamic Shape { get; set; } + public IOrchardServices Services { get; private set; } + public Localizer T { get; set; } + public ILogger Logger { get; set; } + + public ActionResult List(ListContentsViewModel model, PagerParameters pagerParameters) { + Pager pager = new Pager(_siteService.GetSiteSettings(), pagerParameters); + + var versionOptions = VersionOptions.Latest; + switch (model.Options.ContentsStatus) { + case ContentsStatus.Published: + versionOptions = VersionOptions.Published; + break; + case ContentsStatus.Draft: + versionOptions = VersionOptions.Draft; + break; + case ContentsStatus.AllVersions: + versionOptions = VersionOptions.AllVersions; + break; + default: + versionOptions = VersionOptions.Latest; + break; + } + + var query = _contentManager.Query(versionOptions, GetListableTypes(false).Select(ctd => ctd.Name).ToArray()); + + if (!string.IsNullOrEmpty(model.TypeName)) { + var contentTypeDefinition = _contentDefinitionManager.GetTypeDefinition(model.TypeName); + if (contentTypeDefinition == null) + return HttpNotFound(); + + model.TypeDisplayName = !string.IsNullOrWhiteSpace(contentTypeDefinition.DisplayName) + ? contentTypeDefinition.DisplayName + : contentTypeDefinition.Name; + query = query.ForType(model.TypeName); + } + + switch (model.Options.OrderBy) { + case ContentsOrder.Modified: + //query = query.OrderByDescending(ci => ci.ContentItemRecord.Versions.Single(civr => civr.Latest).Id); + query = query.OrderByDescending(cr => cr.ModifiedUtc); + break; + case ContentsOrder.Published: + query = query.OrderByDescending(cr => cr.PublishedUtc); + break; + case ContentsOrder.Created: + //query = query.OrderByDescending(ci => ci.Id); + query = query.OrderByDescending(cr => cr.CreatedUtc); + break; + } + + if(!String.IsNullOrWhiteSpace(model.Options.SelectedCulture)) { + query = _cultureFilter.FilterCulture(query, model.Options.SelectedCulture); + } + + if(model.Options.ContentsStatus == ContentsStatus.Owner) { + query = query.Where(cr => cr.OwnerId == Services.WorkContext.CurrentUser.Id); + } + + model.Options.SelectedFilter = model.TypeName; + model.Options.FilterOptions = GetListableTypes(false) + .Select(ctd => new KeyValuePair(ctd.Name, ctd.DisplayName)) + .ToList().OrderBy(kvp => kvp.Value); + + model.Options.Cultures = _cultureManager.ListCultures(); + + var maxPagedCount = _siteService.GetSiteSettings().MaxPagedCount; + if (maxPagedCount > 0 && pager.PageSize > maxPagedCount) + pager.PageSize = maxPagedCount; + var pagerShape = Shape.Pager(pager).TotalItemCount(maxPagedCount > 0 ? maxPagedCount : query.Count()); + var pageOfContentItems = query.Slice(pager.GetStartIndex(), pager.PageSize).ToList(); + + var list = Shape.List(); + list.AddRange(pageOfContentItems.Select(ci => _contentManager.BuildDisplay(ci, "SummaryAdmin"))); + + var viewModel = Shape.ViewModel() + .ContentItems(list) + .Pager(pagerShape) + .Options(model.Options) + .TypeDisplayName(model.TypeDisplayName ?? ""); + + return View(viewModel); + } + + private IEnumerable GetCreatableTypes(bool andContainable) { + return _contentDefinitionManager.ListTypeDefinitions().Where(ctd => + Services.Authorizer.Authorize(Permissions.EditContent, _contentManager.New(ctd.Name)) && + ctd.Settings.GetModel().Creatable && + (!andContainable || ctd.Parts.Any(p => p.PartDefinition.Name == "ContainablePart"))); + } + + private IEnumerable GetListableTypes(bool andContainable) { + return _contentDefinitionManager.ListTypeDefinitions().Where(ctd => + Services.Authorizer.Authorize(Permissions.EditContent, _contentManager.New(ctd.Name)) && + ctd.Settings.GetModel().Listable && + (!andContainable || ctd.Parts.Any(p => p.PartDefinition.Name == "ContainablePart"))); + } + + [HttpPost, ActionName("List")] + [Mvc.FormValueRequired("submit.Filter")] + public ActionResult ListFilterPOST(ContentOptions options) { + var routeValues = ControllerContext.RouteData.Values; + if (options != null) { + routeValues["Options.SelectedCulture"] = options.SelectedCulture; //todo: don't hard-code the key + routeValues["Options.OrderBy"] = options.OrderBy; //todo: don't hard-code the key + routeValues["Options.ContentsStatus"] = options.ContentsStatus; //todo: don't hard-code the key + if (GetListableTypes(false).Any(ctd => string.Equals(ctd.Name, options.SelectedFilter, StringComparison.OrdinalIgnoreCase))) { + routeValues["id"] = options.SelectedFilter; + } + else { + routeValues.Remove("id"); + } + } + + return RedirectToAction("List", routeValues); + } + + [HttpPost, ActionName("List")] + [Mvc.FormValueRequired("submit.BulkEdit")] + public ActionResult ListPOST(ContentOptions options, IEnumerable itemIds, string returnUrl) { + if (itemIds != null) { + var checkedContentItems = _contentManager.GetMany(itemIds, VersionOptions.Latest, QueryHints.Empty); + switch (options.BulkAction) { + case ContentsBulkAction.None: + break; + case ContentsBulkAction.PublishNow: + foreach (var item in checkedContentItems) { + if (!Services.Authorizer.Authorize(Permissions.PublishContent, item, T("Couldn't publish selected content."))) { + _transactionManager.Cancel(); + return new HttpUnauthorizedResult(); + } + + _contentManager.Publish(item); + } + Services.Notifier.Information(T("Content successfully published.")); + break; + case ContentsBulkAction.Unpublish: + foreach (var item in checkedContentItems) { + if (!Services.Authorizer.Authorize(Permissions.PublishContent, item, T("Couldn't unpublish selected content."))) { + _transactionManager.Cancel(); + return new HttpUnauthorizedResult(); + } + + _contentManager.Unpublish(item); + } + Services.Notifier.Information(T("Content successfully unpublished.")); + break; + case ContentsBulkAction.Remove: + foreach (var item in checkedContentItems) { + if (!Services.Authorizer.Authorize(Permissions.DeleteContent, item, T("Couldn't remove selected content."))) { + _transactionManager.Cancel(); + return new HttpUnauthorizedResult(); + } + + _contentManager.Remove(item); + } + Services.Notifier.Information(T("Content successfully removed.")); + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + + return this.RedirectLocal(returnUrl, () => RedirectToAction("List")); + } + + ActionResult CreatableTypeList(int? containerId) { + var viewModel = Shape.ViewModel(ContentTypes: GetCreatableTypes(containerId.HasValue), ContainerId: containerId); + + return View("CreatableTypeList", viewModel); + } + + ActionResult ListableTypeList(int? containerId) { + var viewModel = Shape.ViewModel(ContentTypes: GetListableTypes(containerId.HasValue), ContainerId: containerId); + + return View("ListableTypeList", viewModel); + } + + public ActionResult Create(string id, int? containerId) { + if (string.IsNullOrEmpty(id)) + return CreatableTypeList(containerId); + + var contentItem = _contentManager.New(id); + + if (!Services.Authorizer.Authorize(Permissions.EditContent, contentItem, T("Cannot create content"))) + return new HttpUnauthorizedResult(); + + if (containerId.HasValue && contentItem.Is()) { + var common = contentItem.As(); + if (common != null) { + common.Container = _contentManager.Get(containerId.Value); + } + } + + var model = _contentManager.BuildEditor(contentItem); + return View(model); + } + + [HttpPost, ActionName("Create")] + [Mvc.FormValueRequired("submit.Save")] + public ActionResult CreatePOST(string id, string returnUrl) { + return CreatePOST(id, returnUrl, contentItem => { + if (!contentItem.Has() && !contentItem.TypeDefinition.Settings.GetModel().Draftable) + _contentManager.Publish(contentItem); + }); + } + + [HttpPost, ActionName("Create")] + [Mvc.FormValueRequired("submit.Publish")] + public ActionResult CreateAndPublishPOST(string id, string returnUrl) { + + // pass a dummy content to the authorization check to check for "own" variations + var dummyContent = _contentManager.New(id); + + if (!Services.Authorizer.Authorize(Permissions.PublishContent, dummyContent, T("Couldn't create content"))) + return new HttpUnauthorizedResult(); + + return CreatePOST(id, returnUrl, contentItem => _contentManager.Publish(contentItem)); + } + + private ActionResult CreatePOST(string id, string returnUrl, Action conditionallyPublish) { + var contentItem = _contentManager.New(id); + + if (!Services.Authorizer.Authorize(Permissions.EditContent, contentItem, T("Couldn't create content"))) + return new HttpUnauthorizedResult(); + + _contentManager.Create(contentItem, VersionOptions.Draft); + + var model = _contentManager.UpdateEditor(contentItem, this); + + if (!ModelState.IsValid) { + _transactionManager.Cancel(); + return View(model); + } + + conditionallyPublish(contentItem); + + Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) + ? T("Your content has been created.") + : T("Your {0} has been created.", contentItem.TypeDefinition.DisplayName)); + if (!string.IsNullOrEmpty(returnUrl)) { + return this.RedirectLocal(returnUrl); + } + var adminRouteValues = _contentManager.GetItemMetadata(contentItem).AdminRouteValues; + return RedirectToRoute(adminRouteValues); + } + + public ActionResult Edit(int id) { + var contentItem = _contentManager.Get(id, VersionOptions.Latest); + + if (contentItem == null) + return HttpNotFound(); + + if (!Services.Authorizer.Authorize(Permissions.EditContent, contentItem, T("Cannot edit content"))) + return new HttpUnauthorizedResult(); + + var model = _contentManager.BuildEditor(contentItem); + return View(model); + } + + [HttpPost, ActionName("Edit")] + [Mvc.FormValueRequired("submit.Save")] + public ActionResult EditPOST(int id, string returnUrl) { + return EditPOST(id, returnUrl, contentItem => { + if (!contentItem.Has() && !contentItem.TypeDefinition.Settings.GetModel().Draftable) + _contentManager.Publish(contentItem); + }); + } + + [HttpPost, ActionName("Edit")] + [Mvc.FormValueRequired("submit.Publish")] + public ActionResult EditAndPublishPOST(int id, string returnUrl) { + var content = _contentManager.Get(id, VersionOptions.Latest); + + if (content == null) + return HttpNotFound(); + + if (!Services.Authorizer.Authorize(Permissions.PublishContent, content, T("Couldn't publish content"))) + return new HttpUnauthorizedResult(); + + return EditPOST(id, returnUrl, contentItem => _contentManager.Publish(contentItem)); + } + + private ActionResult EditPOST(int id, string returnUrl, Action conditionallyPublish) { + var contentItem = _contentManager.Get(id, VersionOptions.DraftRequired); + + if (contentItem == null) + return HttpNotFound(); + + if (!Services.Authorizer.Authorize(Permissions.EditContent, contentItem, T("Couldn't edit content"))) + return new HttpUnauthorizedResult(); + + string previousRoute = null; + if (contentItem.Has() + && !string.IsNullOrWhiteSpace(returnUrl) + && Request.IsLocalUrl(returnUrl) + // only if the original returnUrl is the content itself + && String.Equals(returnUrl, Url.ItemDisplayUrl(contentItem), StringComparison.OrdinalIgnoreCase) + ) { + previousRoute = contentItem.As().Path; + } + + var model = _contentManager.UpdateEditor(contentItem, this); + if (!ModelState.IsValid) { + _transactionManager.Cancel(); + return View("Edit", model); + } + + conditionallyPublish(contentItem); + + if (!string.IsNullOrWhiteSpace(returnUrl) + && previousRoute != null + && !String.Equals(contentItem.As().Path, previousRoute, StringComparison.OrdinalIgnoreCase)) { + returnUrl = Url.ItemDisplayUrl(contentItem); + } + + Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) + ? T("Your content has been saved.") + : T("Your {0} has been saved.", contentItem.TypeDefinition.DisplayName)); + + return this.RedirectLocal(returnUrl, () => RedirectToAction("Edit", new RouteValueDictionary { { "Id", contentItem.Id } })); + } + + [HttpPost] + public ActionResult Clone(int id, string returnUrl) { + var contentItem = _contentManager.GetLatest(id); + + if (contentItem == null) + return HttpNotFound(); + + if (!Services.Authorizer.Authorize(Permissions.EditContent, contentItem, T("Couldn't clone content"))) + return new HttpUnauthorizedResult(); + + try { + Services.ContentManager.Clone(contentItem); + } + catch (InvalidOperationException) { + Services.Notifier.Warning(T("Could not clone the content item.")); + return this.RedirectLocal(returnUrl, () => RedirectToAction("List")); + } + + Services.Notifier.Information(T("Successfully cloned. The clone was saved as a draft.")); + + return this.RedirectLocal(returnUrl, () => RedirectToAction("List")); + } + + [HttpPost] + public ActionResult Remove(int id, string returnUrl) { + var contentItem = _contentManager.Get(id, VersionOptions.Latest); + + if (!Services.Authorizer.Authorize(Permissions.DeleteContent, contentItem, T("Couldn't remove content"))) + return new HttpUnauthorizedResult(); + + if (contentItem != null) { + _contentManager.Remove(contentItem); + Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) + ? T("That content has been removed.") + : T("That {0} has been removed.", contentItem.TypeDefinition.DisplayName)); + } + + return this.RedirectLocal(returnUrl, () => RedirectToAction("List")); + } + + [HttpPost] + public ActionResult Publish(int id, string returnUrl) { + var contentItem = _contentManager.GetLatest(id); + if (contentItem == null) + return HttpNotFound(); + + if (!Services.Authorizer.Authorize(Permissions.PublishContent, contentItem, T("Couldn't publish content"))) + return new HttpUnauthorizedResult(); + + _contentManager.Publish(contentItem); + + Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) ? T("That content has been published.") : T("That {0} has been published.", contentItem.TypeDefinition.DisplayName)); + + return this.RedirectLocal(returnUrl, () => RedirectToAction("List")); + } + + [HttpPost] + public ActionResult Unpublish(int id, string returnUrl) { + var contentItem = _contentManager.GetLatest(id); + if (contentItem == null) + return HttpNotFound(); + + if (!Services.Authorizer.Authorize(Permissions.PublishContent, contentItem, T("Couldn't unpublish content"))) + return new HttpUnauthorizedResult(); + + _contentManager.Unpublish(contentItem); + + Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) ? T("That content has been unpublished.") : T("That {0} has been unpublished.", contentItem.TypeDefinition.DisplayName)); + + return this.RedirectLocal(returnUrl, () => RedirectToAction("List")); + } + + bool IUpdateModel.TryUpdateModel(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) { + return TryUpdateModel(model, prefix, includeProperties, excludeProperties); + } + + void IUpdateModel.AddModelError(string key, LocalizedString errorMessage) { + ModelState.AddModelError(key, errorMessage.ToString()); + } + } + + [Obsolete("Use Orchard.Mvc.FormValueRequiredAttribute instead.")] + public class FormValueRequiredAttribute : ActionMethodSelectorAttribute { + private readonly string _submitButtonName; + + public FormValueRequiredAttribute(string submitButtonName) { + _submitButtonName = submitButtonName; + } + + public override bool IsValidForRequest(ControllerContext controllerContext, MethodInfo methodInfo) { + var value = controllerContext.HttpContext.Request.Form[_submitButtonName]; + return !string.IsNullOrEmpty(value); + } + } +} diff --git a/src/Orchard.Web/Core/Contents/Controllers/ItemController.cs b/src/Orchard.Web/Core/Contents/Controllers/ItemController.cs index 38b1c4240cc..f39b38f3dd6 100644 --- a/src/Orchard.Web/Core/Contents/Controllers/ItemController.cs +++ b/src/Orchard.Web/Core/Contents/Controllers/ItemController.cs @@ -1,68 +1,68 @@ -using System.Web.Mvc; -using Orchard.ContentManagement; -using Orchard.DisplayManagement; -using Orchard.Localization; -using Orchard.Mvc; -using Orchard.Themes; - -namespace Orchard.Core.Contents.Controllers { - [Themed] - public class ItemController : Controller { - private readonly IContentManager _contentManager; - - public ItemController(IContentManager contentManager, IShapeFactory shapeFactory, IOrchardServices services) { - _contentManager = contentManager; - Shape = shapeFactory; - Services = services; - T = NullLocalizer.Instance; - } - - dynamic Shape { get; set; } - public IOrchardServices Services { get; private set; } - public Localizer T { get; set; } - - // /Contents/Item/Display/72 - public ActionResult Display(int? id, int? version) { - if (id == null) - return HttpNotFound(); - - if (version.HasValue) - return Preview(id, version); - - var contentItem = _contentManager.Get(id.Value, VersionOptions.Published); - - if (contentItem == null) - return HttpNotFound(); - - if (!Services.Authorizer.Authorize(Permissions.ViewContent, contentItem, T("Cannot view content"))) { - return new HttpUnauthorizedResult(); - } - - var model = _contentManager.BuildDisplay(contentItem); - return View(model); - } - - // /Contents/Item/Preview/72 - // /Contents/Item/Preview/72?version=5 - public ActionResult Preview(int? id, int? version) { - if (id == null) - return HttpNotFound(); - - var versionOptions = VersionOptions.Latest; - - if (version != null) - versionOptions = VersionOptions.Number((int)version); - - var contentItem = _contentManager.Get(id.Value, versionOptions); - if (contentItem == null) - return HttpNotFound(); - - if (!Services.Authorizer.Authorize(Permissions.PreviewContent, contentItem, T("Cannot preview content"))) { - return new HttpUnauthorizedResult(); - } - - var model = _contentManager.BuildDisplay(contentItem); - return View(model); - } - } +using System.Web.Mvc; +using Orchard.ContentManagement; +using Orchard.DisplayManagement; +using Orchard.Localization; +using Orchard.Mvc; +using Orchard.Themes; + +namespace Orchard.Core.Contents.Controllers { + [Themed] + public class ItemController : Controller { + private readonly IContentManager _contentManager; + + public ItemController(IContentManager contentManager, IShapeFactory shapeFactory, IOrchardServices services) { + _contentManager = contentManager; + Shape = shapeFactory; + Services = services; + T = NullLocalizer.Instance; + } + + dynamic Shape { get; set; } + public IOrchardServices Services { get; private set; } + public Localizer T { get; set; } + + // /Contents/Item/Display/72 + public ActionResult Display(int? id, int? version) { + if (id == null) + return HttpNotFound(); + + if (version.HasValue) + return Preview(id, version); + + var contentItem = _contentManager.Get(id.Value, VersionOptions.Published); + + if (contentItem == null) + return HttpNotFound(); + + if (!Services.Authorizer.Authorize(Permissions.ViewContent, contentItem, T("Cannot view content"))) { + return new HttpUnauthorizedResult(); + } + + var model = _contentManager.BuildDisplay(contentItem); + return View(model); + } + + // /Contents/Item/Preview/72 + // /Contents/Item/Preview/72?version=5 + public ActionResult Preview(int? id, int? version) { + if (id == null) + return HttpNotFound(); + + var versionOptions = VersionOptions.Latest; + + if (version != null) + versionOptions = VersionOptions.Number((int)version); + + var contentItem = _contentManager.Get(id.Value, versionOptions); + if (contentItem == null) + return HttpNotFound(); + + if (!Services.Authorizer.Authorize(Permissions.PreviewContent, contentItem, T("Cannot preview content"))) { + return new HttpUnauthorizedResult(); + } + + var model = _contentManager.BuildDisplay(contentItem); + return View(model); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Drivers/ContentsDriver.cs b/src/Orchard.Web/Core/Contents/Drivers/ContentsDriver.cs index 68f2b2e18c0..cb49524f646 100644 --- a/src/Orchard.Web/Core/Contents/Drivers/ContentsDriver.cs +++ b/src/Orchard.Web/Core/Contents/Drivers/ContentsDriver.cs @@ -1,34 +1,34 @@ -using System.Collections.Generic; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Drivers; -using Orchard.Core.Contents.Settings; - -namespace Orchard.Core.Contents.Drivers { - public class ContentsDriver : ContentPartDriver { - protected override DriverResult Display(ContentPart part, string displayType, dynamic shapeHelper) { - return Combined( - ContentShape("Parts_Contents_Publish", - () => shapeHelper.Parts_Contents_Publish()), - ContentShape("Parts_Contents_Publish_Summary", - () => shapeHelper.Parts_Contents_Publish_Summary()), - ContentShape("Parts_Contents_Publish_SummaryAdmin", - () => shapeHelper.Parts_Contents_Publish_SummaryAdmin()), - ContentShape("Parts_Contents_Clone_SummaryAdmin", - () => shapeHelper.Parts_Contents_Clone_SummaryAdmin()) - ); - } - - protected override DriverResult Editor(ContentPart part, dynamic shapeHelper) { - var results = new List { ContentShape("Content_SaveButton", saveButton => saveButton) }; - - if (part.TypeDefinition.Settings.GetModel().Draftable) - results.Add(ContentShape("Content_PublishButton", publishButton => publishButton)); - - return Combined(results.ToArray()); - } - - protected override DriverResult Editor(ContentPart part, IUpdateModel updater, dynamic shapeHelper) { - return Editor(part, updater); - } - } +using System.Collections.Generic; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Drivers; +using Orchard.Core.Contents.Settings; + +namespace Orchard.Core.Contents.Drivers { + public class ContentsDriver : ContentPartDriver { + protected override DriverResult Display(ContentPart part, string displayType, dynamic shapeHelper) { + return Combined( + ContentShape("Parts_Contents_Publish", + () => shapeHelper.Parts_Contents_Publish()), + ContentShape("Parts_Contents_Publish_Summary", + () => shapeHelper.Parts_Contents_Publish_Summary()), + ContentShape("Parts_Contents_Publish_SummaryAdmin", + () => shapeHelper.Parts_Contents_Publish_SummaryAdmin()), + ContentShape("Parts_Contents_Clone_SummaryAdmin", + () => shapeHelper.Parts_Contents_Clone_SummaryAdmin()) + ); + } + + protected override DriverResult Editor(ContentPart part, dynamic shapeHelper) { + var results = new List { ContentShape("Content_SaveButton", saveButton => saveButton) }; + + if (part.TypeDefinition.Settings.GetModel().Draftable) + results.Add(ContentShape("Content_PublishButton", publishButton => publishButton)); + + return Combined(results.ToArray()); + } + + protected override DriverResult Editor(ContentPart part, IUpdateModel updater, dynamic shapeHelper) { + return Editor(part, updater); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/DynamicPermissions.cs b/src/Orchard.Web/Core/Contents/DynamicPermissions.cs index a015e59bdfe..1b111f7b62e 100644 --- a/src/Orchard.Web/Core/Contents/DynamicPermissions.cs +++ b/src/Orchard.Web/Core/Contents/DynamicPermissions.cs @@ -1,83 +1,83 @@ -using System; -using System.Linq; -using System.Collections.Generic; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.MetaData.Models; -using Orchard.Core.Contents.Settings; -using Orchard.Environment.Extensions.Models; -using Orchard.Security.Permissions; - -namespace Orchard.Core.Contents { - public class DynamicPermissions : IPermissionProvider { - private static readonly Permission PublishContent = new Permission { Description = "Publish or unpublish {0} for others", Name = "Publish_{0}", ImpliedBy = new[] { Permissions.PublishContent } }; - private static readonly Permission PublishOwnContent = new Permission { Description = "Publish or unpublish {0}", Name = "PublishOwn_{0}", ImpliedBy = new[] { PublishContent, Permissions.PublishOwnContent } }; - private static readonly Permission EditContent = new Permission { Description = "Edit {0} for others", Name = "Edit_{0}", ImpliedBy = new[] { PublishContent, Permissions.EditContent } }; - private static readonly Permission EditOwnContent = new Permission { Description = "Edit {0}", Name = "EditOwn_{0}", ImpliedBy = new[] { EditContent, PublishOwnContent, Permissions.EditOwnContent } }; - private static readonly Permission DeleteContent = new Permission { Description = "Delete {0} for others", Name = "Delete_{0}", ImpliedBy = new[] { Permissions.DeleteContent } }; - private static readonly Permission DeleteOwnContent = new Permission { Description = "Delete {0}", Name = "DeleteOwn_{0}", ImpliedBy = new[] { DeleteContent, Permissions.DeleteOwnContent } }; - private static readonly Permission ViewContent = new Permission { Description = "View {0} by others", Name = "View_{0}", ImpliedBy = new[] { EditContent, Permissions.ViewContent } }; - private static readonly Permission ViewOwnContent = new Permission { Description = "View own {0}", Name = "ViewOwn_{0}", ImpliedBy = new[] { ViewContent, Permissions.ViewOwnContent } }; - private static readonly Permission PreviewContent = new Permission { Description = "Preview {0} by others", Name = "Preview_{0}", ImpliedBy = new[] { EditContent, Permissions.PreviewContent } }; - private static readonly Permission PreviewOwnContent = new Permission { Description = "Preview own {0}", Name = "PreviewOwn_{0}", ImpliedBy = new[] { PreviewContent, Permissions.PreviewOwnContent } }; - - public static readonly Dictionary PermissionTemplates = new Dictionary { - {Permissions.PublishContent.Name, PublishContent}, - {Permissions.PublishOwnContent.Name, PublishOwnContent}, - {Permissions.EditContent.Name, EditContent}, - {Permissions.EditOwnContent.Name, EditOwnContent}, - {Permissions.DeleteContent.Name, DeleteContent}, - {Permissions.DeleteOwnContent.Name, DeleteOwnContent}, - {Permissions.ViewContent.Name, ViewContent}, - {Permissions.ViewOwnContent.Name, ViewOwnContent}, - {Permissions.PreviewContent.Name, PreviewContent}, - {Permissions.PreviewOwnContent.Name, PreviewOwnContent} - }; - - private readonly IContentDefinitionManager _contentDefinitionManager; - - public virtual Feature Feature { get; set; } - - public DynamicPermissions(IContentDefinitionManager contentDefinitionManager) { - _contentDefinitionManager = contentDefinitionManager; - } - - public IEnumerable GetPermissions() { - // manage rights only for Securable types - var securableTypes = _contentDefinitionManager.ListTypeDefinitions() - .Where(ctd => ctd.Settings.GetModel().Securable); - - foreach (var typeDefinition in securableTypes) { - foreach (var permissionTemplate in PermissionTemplates.Values) { - yield return CreateDynamicPermission(permissionTemplate, typeDefinition); - } - } - } - - public IEnumerable GetDefaultStereotypes() { - return Enumerable.Empty(); - } - - /// - /// Returns a dynamic permission for a content type, based on a global content permission template - /// - public static Permission ConvertToDynamicPermission(Permission permission) { - if (PermissionTemplates.ContainsKey(permission.Name)) { - return PermissionTemplates[permission.Name]; - } - - return null; - } - - /// - /// Generates a permission dynamically for a content type - /// - public static Permission CreateDynamicPermission(Permission template, ContentTypeDefinition typeDefinition) { - return new Permission { - Name = String.Format(template.Name, typeDefinition.Name), - Description = String.Format(template.Description, typeDefinition.DisplayName), - Category = typeDefinition.DisplayName, - ImpliedBy = (template.ImpliedBy ?? new Permission[0]).Select(t => CreateDynamicPermission(t, typeDefinition)) - }; - } - } -} +using System; +using System.Linq; +using System.Collections.Generic; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.Core.Contents.Settings; +using Orchard.Environment.Extensions.Models; +using Orchard.Security.Permissions; + +namespace Orchard.Core.Contents { + public class DynamicPermissions : IPermissionProvider { + private static readonly Permission PublishContent = new Permission { Description = "Publish or unpublish {0} for others", Name = "Publish_{0}", ImpliedBy = new[] { Permissions.PublishContent } }; + private static readonly Permission PublishOwnContent = new Permission { Description = "Publish or unpublish {0}", Name = "PublishOwn_{0}", ImpliedBy = new[] { PublishContent, Permissions.PublishOwnContent } }; + private static readonly Permission EditContent = new Permission { Description = "Edit {0} for others", Name = "Edit_{0}", ImpliedBy = new[] { PublishContent, Permissions.EditContent } }; + private static readonly Permission EditOwnContent = new Permission { Description = "Edit {0}", Name = "EditOwn_{0}", ImpliedBy = new[] { EditContent, PublishOwnContent, Permissions.EditOwnContent } }; + private static readonly Permission DeleteContent = new Permission { Description = "Delete {0} for others", Name = "Delete_{0}", ImpliedBy = new[] { Permissions.DeleteContent } }; + private static readonly Permission DeleteOwnContent = new Permission { Description = "Delete {0}", Name = "DeleteOwn_{0}", ImpliedBy = new[] { DeleteContent, Permissions.DeleteOwnContent } }; + private static readonly Permission ViewContent = new Permission { Description = "View {0} by others", Name = "View_{0}", ImpliedBy = new[] { EditContent, Permissions.ViewContent } }; + private static readonly Permission ViewOwnContent = new Permission { Description = "View own {0}", Name = "ViewOwn_{0}", ImpliedBy = new[] { ViewContent, Permissions.ViewOwnContent } }; + private static readonly Permission PreviewContent = new Permission { Description = "Preview {0} by others", Name = "Preview_{0}", ImpliedBy = new[] { EditContent, Permissions.PreviewContent } }; + private static readonly Permission PreviewOwnContent = new Permission { Description = "Preview own {0}", Name = "PreviewOwn_{0}", ImpliedBy = new[] { PreviewContent, Permissions.PreviewOwnContent } }; + + public static readonly Dictionary PermissionTemplates = new Dictionary { + {Permissions.PublishContent.Name, PublishContent}, + {Permissions.PublishOwnContent.Name, PublishOwnContent}, + {Permissions.EditContent.Name, EditContent}, + {Permissions.EditOwnContent.Name, EditOwnContent}, + {Permissions.DeleteContent.Name, DeleteContent}, + {Permissions.DeleteOwnContent.Name, DeleteOwnContent}, + {Permissions.ViewContent.Name, ViewContent}, + {Permissions.ViewOwnContent.Name, ViewOwnContent}, + {Permissions.PreviewContent.Name, PreviewContent}, + {Permissions.PreviewOwnContent.Name, PreviewOwnContent} + }; + + private readonly IContentDefinitionManager _contentDefinitionManager; + + public virtual Feature Feature { get; set; } + + public DynamicPermissions(IContentDefinitionManager contentDefinitionManager) { + _contentDefinitionManager = contentDefinitionManager; + } + + public IEnumerable GetPermissions() { + // manage rights only for Securable types + var securableTypes = _contentDefinitionManager.ListTypeDefinitions() + .Where(ctd => ctd.Settings.GetModel().Securable); + + foreach (var typeDefinition in securableTypes) { + foreach (var permissionTemplate in PermissionTemplates.Values) { + yield return CreateDynamicPermission(permissionTemplate, typeDefinition); + } + } + } + + public IEnumerable GetDefaultStereotypes() { + return Enumerable.Empty(); + } + + /// + /// Returns a dynamic permission for a content type, based on a global content permission template + /// + public static Permission ConvertToDynamicPermission(Permission permission) { + if (PermissionTemplates.ContainsKey(permission.Name)) { + return PermissionTemplates[permission.Name]; + } + + return null; + } + + /// + /// Generates a permission dynamically for a content type + /// + public static Permission CreateDynamicPermission(Permission template, ContentTypeDefinition typeDefinition) { + return new Permission { + Name = String.Format(template.Name, typeDefinition.Name), + Description = String.Format(template.Description, typeDefinition.DisplayName), + Category = typeDefinition.DisplayName, + ImpliedBy = (template.ImpliedBy ?? new Permission[0]).Select(t => CreateDynamicPermission(t, typeDefinition)) + }; + } + } +} diff --git a/src/Orchard.Web/Core/Contents/Extensions/MetaDataExtensions.cs b/src/Orchard.Web/Core/Contents/Extensions/MetaDataExtensions.cs index 27f49c8e312..b33835c003b 100644 --- a/src/Orchard.Web/Core/Contents/Extensions/MetaDataExtensions.cs +++ b/src/Orchard.Web/Core/Contents/Extensions/MetaDataExtensions.cs @@ -1,30 +1,30 @@ -using Orchard.ContentManagement.MetaData.Builders; - -namespace Orchard.Core.Contents.Extensions { - public static class MetaDataExtensions { - //todo: revisit "creatable" and "attachable", other words by be more fitting - public static ContentTypeDefinitionBuilder Creatable(this ContentTypeDefinitionBuilder builder, bool creatable = true) { - return builder.WithSetting("ContentTypeSettings.Creatable", creatable.ToString()); - } - - public static ContentTypeDefinitionBuilder Listable(this ContentTypeDefinitionBuilder builder, bool listable = true) { - return builder.WithSetting("ContentTypeSettings.Listable", listable.ToString()); - } - - public static ContentTypeDefinitionBuilder Draftable(this ContentTypeDefinitionBuilder builder, bool draftable = true) { - return builder.WithSetting("ContentTypeSettings.Draftable", draftable.ToString()); - } - - public static ContentTypeDefinitionBuilder Securable(this ContentTypeDefinitionBuilder builder, bool securable = true) { - return builder.WithSetting("ContentTypeSettings.Securable", securable.ToString()); - } - - public static ContentPartDefinitionBuilder Attachable(this ContentPartDefinitionBuilder builder, bool attachable = true) { - return builder.WithSetting("ContentPartSettings.Attachable", attachable.ToString()); - } - - public static ContentPartDefinitionBuilder WithDescription(this ContentPartDefinitionBuilder builder, string description) { - return builder.WithSetting("ContentPartSettings.Description", description); - } - } -} +using Orchard.ContentManagement.MetaData.Builders; + +namespace Orchard.Core.Contents.Extensions { + public static class MetaDataExtensions { + //todo: revisit "creatable" and "attachable", other words by be more fitting + public static ContentTypeDefinitionBuilder Creatable(this ContentTypeDefinitionBuilder builder, bool creatable = true) { + return builder.WithSetting("ContentTypeSettings.Creatable", creatable.ToString()); + } + + public static ContentTypeDefinitionBuilder Listable(this ContentTypeDefinitionBuilder builder, bool listable = true) { + return builder.WithSetting("ContentTypeSettings.Listable", listable.ToString()); + } + + public static ContentTypeDefinitionBuilder Draftable(this ContentTypeDefinitionBuilder builder, bool draftable = true) { + return builder.WithSetting("ContentTypeSettings.Draftable", draftable.ToString()); + } + + public static ContentTypeDefinitionBuilder Securable(this ContentTypeDefinitionBuilder builder, bool securable = true) { + return builder.WithSetting("ContentTypeSettings.Securable", securable.ToString()); + } + + public static ContentPartDefinitionBuilder Attachable(this ContentPartDefinitionBuilder builder, bool attachable = true) { + return builder.WithSetting("ContentPartSettings.Attachable", attachable.ToString()); + } + + public static ContentPartDefinitionBuilder WithDescription(this ContentPartDefinitionBuilder builder, string description) { + return builder.WithSetting("ContentPartSettings.Description", description); + } + } +} diff --git a/src/Orchard.Web/Core/Contents/Handlers/ContentsHandler.cs b/src/Orchard.Web/Core/Contents/Handlers/ContentsHandler.cs index d6d056ba830..abd4a7b9d13 100644 --- a/src/Orchard.Web/Core/Contents/Handlers/ContentsHandler.cs +++ b/src/Orchard.Web/Core/Contents/Handlers/ContentsHandler.cs @@ -1,41 +1,41 @@ -using System.Web.Routing; -using Orchard.ContentManagement.Handlers; - -namespace Orchard.Core.Contents.Handlers { - public class ContentsHandler : ContentHandlerBase { - public override void GetContentItemMetadata(GetContentItemMetadataContext context) { - if (context.Metadata.CreateRouteValues == null) { - context.Metadata.CreateRouteValues = new RouteValueDictionary { - {"Area", "Contents"}, - {"Controller", "Admin"}, - {"Action", "Create"}, - {"Id", context.ContentItem.ContentType} - }; - } - if (context.Metadata.EditorRouteValues == null) { - context.Metadata.EditorRouteValues = new RouteValueDictionary { - {"Area", "Contents"}, - {"Controller", "Admin"}, - {"Action", "Edit"}, - {"Id", context.ContentItem.Id} - }; - } - if (context.Metadata.DisplayRouteValues == null) { - context.Metadata.DisplayRouteValues = new RouteValueDictionary { - {"Area", "Contents"}, - {"Controller", "Item"}, - {"Action", "Display"}, - {"Id", context.ContentItem.Id} - }; - } - if (context.Metadata.RemoveRouteValues == null) { - context.Metadata.RemoveRouteValues = new RouteValueDictionary { - {"Area", "Contents"}, - {"Controller", "Admin"}, - {"Action", "Remove"}, - {"Id", context.ContentItem.Id} - }; - } - } - } +using System.Web.Routing; +using Orchard.ContentManagement.Handlers; + +namespace Orchard.Core.Contents.Handlers { + public class ContentsHandler : ContentHandlerBase { + public override void GetContentItemMetadata(GetContentItemMetadataContext context) { + if (context.Metadata.CreateRouteValues == null) { + context.Metadata.CreateRouteValues = new RouteValueDictionary { + {"Area", "Contents"}, + {"Controller", "Admin"}, + {"Action", "Create"}, + {"Id", context.ContentItem.ContentType} + }; + } + if (context.Metadata.EditorRouteValues == null) { + context.Metadata.EditorRouteValues = new RouteValueDictionary { + {"Area", "Contents"}, + {"Controller", "Admin"}, + {"Action", "Edit"}, + {"Id", context.ContentItem.Id} + }; + } + if (context.Metadata.DisplayRouteValues == null) { + context.Metadata.DisplayRouteValues = new RouteValueDictionary { + {"Area", "Contents"}, + {"Controller", "Item"}, + {"Action", "Display"}, + {"Id", context.ContentItem.Id} + }; + } + if (context.Metadata.RemoveRouteValues == null) { + context.Metadata.RemoveRouteValues = new RouteValueDictionary { + {"Area", "Contents"}, + {"Controller", "Admin"}, + {"Action", "Remove"}, + {"Id", context.ContentItem.Id} + }; + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Module.txt b/src/Orchard.Web/Core/Contents/Module.txt index 1f4c42bd404..2f403abd32d 100644 --- a/src/Orchard.Web/Core/Contents/Module.txt +++ b/src/Orchard.Web/Core/Contents/Module.txt @@ -1,17 +1,17 @@ -Name: Contents -AntiForgery: enabled -Author: The Orchard Team -Website: http://orchardproject.net -Version: 1.9.2 -OrchardVersion: 1.9 -Description: The contents module enables the creation of custom content types. -Features: - Contents - Name: Contents - Description: Default custom content type definition, creation and management. - Category: Core - Contents.ControlWrapper: - Name: Content Control Wrapper - Description: Add an Edit button on the front-end for authenticated users - Category: Content - Dependencies: Contents +Name: Contents +AntiForgery: enabled +Author: The Orchard Team +Website: http://orchardproject.net +Version: 1.9.2 +OrchardVersion: 1.9 +Description: The contents module enables the creation of custom content types. +Features: + Contents + Name: Contents + Description: Default custom content type definition, creation and management. + Category: Core + Contents.ControlWrapper: + Name: Content Control Wrapper + Description: Add an Edit button on the front-end for authenticated users + Category: Content + Dependencies: Contents diff --git a/src/Orchard.Web/Core/Contents/Permissions.cs b/src/Orchard.Web/Core/Contents/Permissions.cs index ef8b756bd57..4d0ef4dea37 100644 --- a/src/Orchard.Web/Core/Contents/Permissions.cs +++ b/src/Orchard.Web/Core/Contents/Permissions.cs @@ -1,75 +1,75 @@ -using System.Collections.Generic; -using Orchard.Environment.Extensions.Models; -using Orchard.Security.Permissions; - -namespace Orchard.Core.Contents { - public class Permissions : IPermissionProvider { - - // Note - in code you should demand PublishContent, EditContent, or DeleteContent - // Do not demand the "Own" variations - those are applied automatically when you demand the main ones - - public static readonly Permission PublishContent = new Permission { Description = "Publish or unpublish content for others", Name = "PublishContent" }; - public static readonly Permission PublishOwnContent = new Permission { Description = "Publish or unpublish own content", Name = "PublishOwnContent", ImpliedBy = new[] { PublishContent } }; - public static readonly Permission EditContent = new Permission { Description = "Edit content for others", Name = "EditContent", ImpliedBy = new[] { PublishContent } }; - public static readonly Permission EditOwnContent = new Permission { Description = "Edit own content", Name = "EditOwnContent", ImpliedBy = new[] { EditContent, PublishOwnContent } }; - public static readonly Permission DeleteContent = new Permission { Description = "Delete content for others", Name = "DeleteContent" }; - public static readonly Permission DeleteOwnContent = new Permission { Description = "Delete own content", Name = "DeleteOwnContent", ImpliedBy = new[] { DeleteContent } }; - public static readonly Permission ViewContent = new Permission { Description = "View all content", Name = "ViewContent", ImpliedBy = new[] { EditContent } }; - public static readonly Permission ViewOwnContent = new Permission { Description = "View own content", Name = "ViewOwnContent", ImpliedBy = new[] { ViewContent } }; - public static readonly Permission PreviewContent = new Permission { Description = "Preview content", Name = "PreviewContent", ImpliedBy = new[] { EditContent, PublishContent } }; - public static readonly Permission PreviewOwnContent = new Permission { Description = "Preview own content", Name = "PreviewOwnContent", ImpliedBy = new[] { PreviewContent } }; - - - public static readonly Permission MetaListContent = new Permission { ImpliedBy = new[] { EditOwnContent, PublishOwnContent, DeleteOwnContent } }; - - public virtual Feature Feature { get; set; } - - public IEnumerable GetPermissions() { - return new[] { - EditOwnContent, - EditContent, - PublishOwnContent, - PublishContent, - DeleteOwnContent, - DeleteContent, - ViewContent, - ViewOwnContent, - PreviewOwnContent, - PreviewContent - }; - } - - public IEnumerable GetDefaultStereotypes() { - return new[] { - new PermissionStereotype { - Name = "Administrator", - Permissions = new[] {PublishContent,EditContent,DeleteContent,PreviewContent} - }, - new PermissionStereotype { - Name = "Editor", - Permissions = new[] {PublishContent,EditContent,DeleteContent,PreviewContent} - }, - new PermissionStereotype { - Name = "Moderator" - }, - new PermissionStereotype { - Name = "Author", - Permissions = new[] {PublishOwnContent,EditOwnContent,DeleteOwnContent,PreviewOwnContent} - }, - new PermissionStereotype { - Name = "Contributor", - Permissions = new[] {EditOwnContent,PreviewOwnContent} - }, - new PermissionStereotype { - Name = "Authenticated", - Permissions = new[] {ViewContent} - }, - new PermissionStereotype { - Name = "Anonymous", - Permissions = new[] {ViewContent} - }, - }; - } - - } +using System.Collections.Generic; +using Orchard.Environment.Extensions.Models; +using Orchard.Security.Permissions; + +namespace Orchard.Core.Contents { + public class Permissions : IPermissionProvider { + + // Note - in code you should demand PublishContent, EditContent, or DeleteContent + // Do not demand the "Own" variations - those are applied automatically when you demand the main ones + + public static readonly Permission PublishContent = new Permission { Description = "Publish or unpublish content for others", Name = "PublishContent" }; + public static readonly Permission PublishOwnContent = new Permission { Description = "Publish or unpublish own content", Name = "PublishOwnContent", ImpliedBy = new[] { PublishContent } }; + public static readonly Permission EditContent = new Permission { Description = "Edit content for others", Name = "EditContent", ImpliedBy = new[] { PublishContent } }; + public static readonly Permission EditOwnContent = new Permission { Description = "Edit own content", Name = "EditOwnContent", ImpliedBy = new[] { EditContent, PublishOwnContent } }; + public static readonly Permission DeleteContent = new Permission { Description = "Delete content for others", Name = "DeleteContent" }; + public static readonly Permission DeleteOwnContent = new Permission { Description = "Delete own content", Name = "DeleteOwnContent", ImpliedBy = new[] { DeleteContent } }; + public static readonly Permission ViewContent = new Permission { Description = "View all content", Name = "ViewContent", ImpliedBy = new[] { EditContent } }; + public static readonly Permission ViewOwnContent = new Permission { Description = "View own content", Name = "ViewOwnContent", ImpliedBy = new[] { ViewContent } }; + public static readonly Permission PreviewContent = new Permission { Description = "Preview content", Name = "PreviewContent", ImpliedBy = new[] { EditContent, PublishContent } }; + public static readonly Permission PreviewOwnContent = new Permission { Description = "Preview own content", Name = "PreviewOwnContent", ImpliedBy = new[] { PreviewContent } }; + + + public static readonly Permission MetaListContent = new Permission { ImpliedBy = new[] { EditOwnContent, PublishOwnContent, DeleteOwnContent } }; + + public virtual Feature Feature { get; set; } + + public IEnumerable GetPermissions() { + return new[] { + EditOwnContent, + EditContent, + PublishOwnContent, + PublishContent, + DeleteOwnContent, + DeleteContent, + ViewContent, + ViewOwnContent, + PreviewOwnContent, + PreviewContent + }; + } + + public IEnumerable GetDefaultStereotypes() { + return new[] { + new PermissionStereotype { + Name = "Administrator", + Permissions = new[] {PublishContent,EditContent,DeleteContent,PreviewContent} + }, + new PermissionStereotype { + Name = "Editor", + Permissions = new[] {PublishContent,EditContent,DeleteContent,PreviewContent} + }, + new PermissionStereotype { + Name = "Moderator" + }, + new PermissionStereotype { + Name = "Author", + Permissions = new[] {PublishOwnContent,EditOwnContent,DeleteOwnContent,PreviewOwnContent} + }, + new PermissionStereotype { + Name = "Contributor", + Permissions = new[] {EditOwnContent,PreviewOwnContent} + }, + new PermissionStereotype { + Name = "Authenticated", + Permissions = new[] {ViewContent} + }, + new PermissionStereotype { + Name = "Anonymous", + Permissions = new[] {ViewContent} + }, + }; + } + + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Placement.info b/src/Orchard.Web/Core/Contents/Placement.info index ac8445780ab..cab2f6d7a77 100644 --- a/src/Orchard.Web/Core/Contents/Placement.info +++ b/src/Orchard.Web/Core/Contents/Placement.info @@ -1,18 +1,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Security/AuthorizationEventHandler.cs b/src/Orchard.Web/Core/Contents/Security/AuthorizationEventHandler.cs index 47e34a6d95b..af496aefe36 100644 --- a/src/Orchard.Web/Core/Contents/Security/AuthorizationEventHandler.cs +++ b/src/Orchard.Web/Core/Contents/Security/AuthorizationEventHandler.cs @@ -1,73 +1,73 @@ -using JetBrains.Annotations; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Aspects; -using Orchard.Core.Contents.Settings; -using Orchard.Security; -using Orchard.Security.Permissions; - -namespace Orchard.Core.Contents.Security { - [UsedImplicitly] - public class AuthorizationEventHandler : IAuthorizationServiceEventHandler { - public void Checking(CheckAccessContext context) { } - public void Complete(CheckAccessContext context) { } - - public void Adjust(CheckAccessContext context) { - if (!context.Granted && - context.Content.Is()) { - - if (OwnerVariationExists(context.Permission) && - HasOwnership(context.User, context.Content)) { - - context.Adjusted = true; - context.Permission = GetOwnerVariation(context.Permission); - } - - var typeDefinition = context.Content.ContentItem.TypeDefinition; - - // replace permission if a content type specific version exists - if (typeDefinition.Settings.GetModel().Securable) { - var permission = GetContentTypeVariation(context.Permission); - - if (permission != null) { - context.Adjusted = true; - context.Permission = DynamicPermissions.CreateDynamicPermission(permission, typeDefinition); - } - } - } - } - - private static bool HasOwnership(IUser user, IContent content) { - if (user == null || content == null) - return false; - - var common = content.As(); - if (common == null || common.Owner == null) - return false; - - return user.Id == common.Owner.Id; - } - - private static bool OwnerVariationExists(Permission permission) { - return GetOwnerVariation(permission) != null; - } - - private static Permission GetOwnerVariation(Permission permission) { - if (permission.Name == Permissions.PublishContent.Name) - return Permissions.PublishOwnContent; - if (permission.Name == Permissions.EditContent.Name) - return Permissions.EditOwnContent; - if (permission.Name == Permissions.DeleteContent.Name) - return Permissions.DeleteOwnContent; - if (permission.Name == Permissions.ViewContent.Name) - return Permissions.ViewOwnContent; - if (permission.Name == Permissions.PreviewContent.Name) - return Permissions.PreviewOwnContent; - - return null; - } - - private static Permission GetContentTypeVariation(Permission permission) { - return DynamicPermissions.ConvertToDynamicPermission(permission); - } - } +using JetBrains.Annotations; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Aspects; +using Orchard.Core.Contents.Settings; +using Orchard.Security; +using Orchard.Security.Permissions; + +namespace Orchard.Core.Contents.Security { + [UsedImplicitly] + public class AuthorizationEventHandler : IAuthorizationServiceEventHandler { + public void Checking(CheckAccessContext context) { } + public void Complete(CheckAccessContext context) { } + + public void Adjust(CheckAccessContext context) { + if (!context.Granted && + context.Content.Is()) { + + if (OwnerVariationExists(context.Permission) && + HasOwnership(context.User, context.Content)) { + + context.Adjusted = true; + context.Permission = GetOwnerVariation(context.Permission); + } + + var typeDefinition = context.Content.ContentItem.TypeDefinition; + + // replace permission if a content type specific version exists + if (typeDefinition.Settings.GetModel().Securable) { + var permission = GetContentTypeVariation(context.Permission); + + if (permission != null) { + context.Adjusted = true; + context.Permission = DynamicPermissions.CreateDynamicPermission(permission, typeDefinition); + } + } + } + } + + private static bool HasOwnership(IUser user, IContent content) { + if (user == null || content == null) + return false; + + var common = content.As(); + if (common == null || common.Owner == null) + return false; + + return user.Id == common.Owner.Id; + } + + private static bool OwnerVariationExists(Permission permission) { + return GetOwnerVariation(permission) != null; + } + + private static Permission GetOwnerVariation(Permission permission) { + if (permission.Name == Permissions.PublishContent.Name) + return Permissions.PublishOwnContent; + if (permission.Name == Permissions.EditContent.Name) + return Permissions.EditOwnContent; + if (permission.Name == Permissions.DeleteContent.Name) + return Permissions.DeleteOwnContent; + if (permission.Name == Permissions.ViewContent.Name) + return Permissions.ViewOwnContent; + if (permission.Name == Permissions.PreviewContent.Name) + return Permissions.PreviewOwnContent; + + return null; + } + + private static Permission GetContentTypeVariation(Permission permission) { + return DynamicPermissions.ConvertToDynamicPermission(permission); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Settings/ContentPartSettings.cs b/src/Orchard.Web/Core/Contents/Settings/ContentPartSettings.cs index e444aa88678..6df76f64da0 100644 --- a/src/Orchard.Web/Core/Contents/Settings/ContentPartSettings.cs +++ b/src/Orchard.Web/Core/Contents/Settings/ContentPartSettings.cs @@ -1,10 +1,10 @@ -namespace Orchard.Core.Contents.Settings { - public class ContentPartSettings { - /// - /// This setting is used to display a Content Part in list of Parts to attach to a Content Type - /// - public bool Attachable { get; set; } - - public string Description { get; set; } - } +namespace Orchard.Core.Contents.Settings { + public class ContentPartSettings { + /// + /// This setting is used to display a Content Part in list of Parts to attach to a Content Type + /// + public bool Attachable { get; set; } + + public string Description { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Settings/ContentTypeSettings.cs b/src/Orchard.Web/Core/Contents/Settings/ContentTypeSettings.cs index c4c3b3a83cc..ee71ff297ad 100644 --- a/src/Orchard.Web/Core/Contents/Settings/ContentTypeSettings.cs +++ b/src/Orchard.Web/Core/Contents/Settings/ContentTypeSettings.cs @@ -1,24 +1,24 @@ -namespace Orchard.Core.Contents.Settings { - public class ContentTypeSettings { - /// - /// Used to determine if an instance of this content type can be created through the UI - /// - public bool Creatable { get; set; } - /// - /// Used to determine if an instance of this content type can be listed in the contents page - /// - public bool Listable { get; set; } - /// - /// Used to determine if this content type supports draft versions - /// - public bool Draftable { get; set; } - /// - /// Defines the stereotype of the type - /// - public string Stereotype { get; set; } - /// - /// Used to determine if this content type supports custom permissions - /// - public bool Securable { get; set; } - } +namespace Orchard.Core.Contents.Settings { + public class ContentTypeSettings { + /// + /// Used to determine if an instance of this content type can be created through the UI + /// + public bool Creatable { get; set; } + /// + /// Used to determine if an instance of this content type can be listed in the contents page + /// + public bool Listable { get; set; } + /// + /// Used to determine if this content type supports draft versions + /// + public bool Draftable { get; set; } + /// + /// Defines the stereotype of the type + /// + public string Stereotype { get; set; } + /// + /// Used to determine if this content type supports custom permissions + /// + public bool Securable { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Shapes.cs b/src/Orchard.Web/Core/Contents/Shapes.cs index 94aaa7085a3..8e7215c5b1f 100644 --- a/src/Orchard.Web/Core/Contents/Shapes.cs +++ b/src/Orchard.Web/Core/Contents/Shapes.cs @@ -1,47 +1,47 @@ -using Orchard.ContentManagement; -using Orchard.DisplayManagement.Descriptors; - -namespace Orchard.Core.Contents { - public class Shapes : IShapeTableProvider { - public void Discover(ShapeTableBuilder builder) { - builder.Describe("Content") - .OnCreated(created => { - var content = created.Shape; - content.Child.Add(created.New.PlaceChildContent(Source: content)); - }) - .OnDisplaying(displaying => { - ContentItem contentItem = displaying.Shape.ContentItem; - if (contentItem != null) { - // Alternates in order of specificity. - // Display type > content type > specific content > display type for a content type > display type for specific content - // BasicShapeTemplateHarvester.Adjust will then adjust the template name - - // Content__[DisplayType] e.g. Content-Summary - displaying.ShapeMetadata.Alternates.Add("Content_" + EncodeAlternateElement(displaying.ShapeMetadata.DisplayType)); - - // Content__[ContentType] e.g. Content-BlogPost, - displaying.ShapeMetadata.Alternates.Add("Content__" + EncodeAlternateElement(contentItem.ContentType)); - - // Content__[Id] e.g. Content-42, - displaying.ShapeMetadata.Alternates.Add("Content__" + contentItem.Id); - - // Content_[DisplayType]__[ContentType] e.g. Content-BlogPost.Summary - displaying.ShapeMetadata.Alternates.Add("Content_" + displaying.ShapeMetadata.DisplayType + "__" + EncodeAlternateElement(contentItem.ContentType)); - - // Content_[DisplayType]__[Id] e.g. Content-42.Summary - displaying.ShapeMetadata.Alternates.Add("Content_" + displaying.ShapeMetadata.DisplayType + "__" + contentItem.Id); - } - }); - } - - /// - /// Encodes dashed and dots so that they don't conflict in filenames - /// - /// - /// - private string EncodeAlternateElement(string alternateElement) { - return alternateElement.Replace("-", "__").Replace(".", "_"); - } - - } -} +using Orchard.ContentManagement; +using Orchard.DisplayManagement.Descriptors; + +namespace Orchard.Core.Contents { + public class Shapes : IShapeTableProvider { + public void Discover(ShapeTableBuilder builder) { + builder.Describe("Content") + .OnCreated(created => { + var content = created.Shape; + content.Child.Add(created.New.PlaceChildContent(Source: content)); + }) + .OnDisplaying(displaying => { + ContentItem contentItem = displaying.Shape.ContentItem; + if (contentItem != null) { + // Alternates in order of specificity. + // Display type > content type > specific content > display type for a content type > display type for specific content + // BasicShapeTemplateHarvester.Adjust will then adjust the template name + + // Content__[DisplayType] e.g. Content-Summary + displaying.ShapeMetadata.Alternates.Add("Content_" + EncodeAlternateElement(displaying.ShapeMetadata.DisplayType)); + + // Content__[ContentType] e.g. Content-BlogPost, + displaying.ShapeMetadata.Alternates.Add("Content__" + EncodeAlternateElement(contentItem.ContentType)); + + // Content__[Id] e.g. Content-42, + displaying.ShapeMetadata.Alternates.Add("Content__" + contentItem.Id); + + // Content_[DisplayType]__[ContentType] e.g. Content-BlogPost.Summary + displaying.ShapeMetadata.Alternates.Add("Content_" + displaying.ShapeMetadata.DisplayType + "__" + EncodeAlternateElement(contentItem.ContentType)); + + // Content_[DisplayType]__[Id] e.g. Content-42.Summary + displaying.ShapeMetadata.Alternates.Add("Content_" + displaying.ShapeMetadata.DisplayType + "__" + contentItem.Id); + } + }); + } + + /// + /// Encodes dashed and dots so that they don't conflict in filenames + /// + /// + /// + private string EncodeAlternateElement(string alternateElement) { + return alternateElement.Replace("-", "__").Replace(".", "_"); + } + + } +} diff --git a/src/Orchard.Web/Core/Contents/Styles/Web.config b/src/Orchard.Web/Core/Contents/Styles/Web.config index 74c71f22bd5..11135c33761 100644 --- a/src/Orchard.Web/Core/Contents/Styles/Web.config +++ b/src/Orchard.Web/Core/Contents/Styles/Web.config @@ -1,16 +1,16 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Contents/Styles/menu.content-admin.css b/src/Orchard.Web/Core/Contents/Styles/menu.content-admin.css index 47775e1ad4a..1613950c78a 100644 --- a/src/Orchard.Web/Core/Contents/Styles/menu.content-admin.css +++ b/src/Orchard.Web/Core/Contents/Styles/menu.content-admin.css @@ -1,16 +1,16 @@ -.navicon-content { -background-image:url(images/menu.content.png) !important; -} -.navicon-content:hover { -background-position:0 -30px !important; -} -.section-new .menuItems a { -background-image:url(images/menu.content.png); -} -/* subnav */ -#menu .menu-admin .section-new .menuItems a { -background-position:0 4px; -} -#menu .menu-admin .section-new .menuItems a:hover, #menu .menu-admin .section-new .menuItems .selected a { -background-position:0 -28px; +.navicon-content { +background-image:url(images/menu.content.png) !important; +} +.navicon-content:hover { +background-position:0 -30px !important; +} +.section-new .menuItems a { +background-image:url(images/menu.content.png); +} +/* subnav */ +#menu .menu-admin .section-new .menuItems a { +background-position:0 4px; +} +#menu .menu-admin .section-new .menuItems a:hover, #menu .menu-admin .section-new .menuItems .selected a { +background-position:0 -28px; } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/ViewModels/ListContentTypesViewModel.cs b/src/Orchard.Web/Core/Contents/ViewModels/ListContentTypesViewModel.cs index d66907548c7..f60578bf65c 100644 --- a/src/Orchard.Web/Core/Contents/ViewModels/ListContentTypesViewModel.cs +++ b/src/Orchard.Web/Core/Contents/ViewModels/ListContentTypesViewModel.cs @@ -1,8 +1,8 @@ -using System.Collections.Generic; -using Orchard.ContentManagement.MetaData.Models; - -namespace Orchard.Core.Contents.ViewModels { - public class ListContentTypesViewModel { - public IEnumerable Types { get; set; } - } +using System.Collections.Generic; +using Orchard.ContentManagement.MetaData.Models; + +namespace Orchard.Core.Contents.ViewModels { + public class ListContentTypesViewModel { + public IEnumerable Types { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/ViewModels/ListContentsViewModel.cs b/src/Orchard.Web/Core/Contents/ViewModels/ListContentsViewModel.cs index 0b01280219d..bde549cab90 100644 --- a/src/Orchard.Web/Core/Contents/ViewModels/ListContentsViewModel.cs +++ b/src/Orchard.Web/Core/Contents/ViewModels/ListContentsViewModel.cs @@ -1,66 +1,66 @@ -using System.Collections.Generic; -using Orchard.ContentManagement; - -namespace Orchard.Core.Contents.ViewModels { - public class ListContentsViewModel { - public ListContentsViewModel() { - Options = new ContentOptions(); - } - - public string Id { get; set; } - - public string TypeName { - get { return Id; } - } - - public string TypeDisplayName { get; set; } - public int? Page { get; set; } - public IList Entries { get; set; } - public ContentOptions Options { get; set; } - - #region Nested type: Entry - - public class Entry { - public ContentItem ContentItem { get; set; } - public ContentItemMetadata ContentItemMetadata { get; set; } - } - - #endregion - } - - public class ContentOptions { - public ContentOptions() { - OrderBy = ContentsOrder.Modified; - BulkAction = ContentsBulkAction.None; - ContentsStatus = ContentsStatus.Latest; - } - public string SelectedFilter { get; set; } - public string SelectedCulture { get; set; } - public IEnumerable> FilterOptions { get; set; } - public ContentsOrder OrderBy { get; set; } - public ContentsStatus ContentsStatus { get; set; } - public ContentsBulkAction BulkAction { get; set; } - public IEnumerable Cultures { get; set; } - } - - public enum ContentsOrder { - Modified, - Published, - Created - } - - public enum ContentsStatus { - Draft, - Published, - AllVersions, - Latest, - Owner - } - - public enum ContentsBulkAction { - None, - PublishNow, - Unpublish, - Remove - } +using System.Collections.Generic; +using Orchard.ContentManagement; + +namespace Orchard.Core.Contents.ViewModels { + public class ListContentsViewModel { + public ListContentsViewModel() { + Options = new ContentOptions(); + } + + public string Id { get; set; } + + public string TypeName { + get { return Id; } + } + + public string TypeDisplayName { get; set; } + public int? Page { get; set; } + public IList Entries { get; set; } + public ContentOptions Options { get; set; } + + #region Nested type: Entry + + public class Entry { + public ContentItem ContentItem { get; set; } + public ContentItemMetadata ContentItemMetadata { get; set; } + } + + #endregion + } + + public class ContentOptions { + public ContentOptions() { + OrderBy = ContentsOrder.Modified; + BulkAction = ContentsBulkAction.None; + ContentsStatus = ContentsStatus.Latest; + } + public string SelectedFilter { get; set; } + public string SelectedCulture { get; set; } + public IEnumerable> FilterOptions { get; set; } + public ContentsOrder OrderBy { get; set; } + public ContentsStatus ContentsStatus { get; set; } + public ContentsBulkAction BulkAction { get; set; } + public IEnumerable Cultures { get; set; } + } + + public enum ContentsOrder { + Modified, + Published, + Created + } + + public enum ContentsStatus { + Draft, + Published, + AllVersions, + Latest, + Owner + } + + public enum ContentsBulkAction { + None, + PublishNow, + Unpublish, + Remove + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/ViewModels/PublishContentViewModel.cs b/src/Orchard.Web/Core/Contents/ViewModels/PublishContentViewModel.cs index 0d9fcf87077..0583426f1c4 100644 --- a/src/Orchard.Web/Core/Contents/ViewModels/PublishContentViewModel.cs +++ b/src/Orchard.Web/Core/Contents/ViewModels/PublishContentViewModel.cs @@ -1,28 +1,28 @@ -using Orchard.ContentManagement; - -namespace Orchard.Core.Contents.ViewModels { - public class PublishContentViewModel { - public PublishContentViewModel(ContentItem contentItem) { - ContentItem = contentItem; - } - - public ContentItem ContentItem { get; private set; } - - public bool IsPublished { - get { return ContentItem.VersionRecord != null && ContentItem.VersionRecord.Published; } - } - - public bool HasDraft { - get { - return ( - (ContentItem.VersionRecord != null) - && ((ContentItem.VersionRecord.Published == false) - || (ContentItem.VersionRecord.Published && ContentItem.VersionRecord.Latest == false))); - } - } - - public bool HasPublished { - get { return IsPublished || ContentItem.ContentManager.Get(ContentItem.Id, VersionOptions.Published) != null; } - } - } +using Orchard.ContentManagement; + +namespace Orchard.Core.Contents.ViewModels { + public class PublishContentViewModel { + public PublishContentViewModel(ContentItem contentItem) { + ContentItem = contentItem; + } + + public ContentItem ContentItem { get; private set; } + + public bool IsPublished { + get { return ContentItem.VersionRecord != null && ContentItem.VersionRecord.Published; } + } + + public bool HasDraft { + get { + return ( + (ContentItem.VersionRecord != null) + && ((ContentItem.VersionRecord.Published == false) + || (ContentItem.VersionRecord.Published && ContentItem.VersionRecord.Latest == false))); + } + } + + public bool HasPublished { + get { return IsPublished || ContentItem.ContentManager.Get(ContentItem.Id, VersionOptions.Published) != null; } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Admin/CreatableTypeList.cshtml b/src/Orchard.Web/Core/Contents/Views/Admin/CreatableTypeList.cshtml index 6d7ef8df127..28e908e000f 100644 --- a/src/Orchard.Web/Core/Contents/Views/Admin/CreatableTypeList.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Admin/CreatableTypeList.cshtml @@ -1,5 +1,5 @@ -@{ Layout.Title = T("Create New Content").ToString(); } - -@foreach (var type in Model.ContentTypes) { -

        @Html.ActionLink((string)type.DisplayName, "Create", new { Area = "Contents", Id = (string)type.Name, ContainerId = Model.ContainerId, ReturnUrl = Request.QueryString["ReturnUrl"] })

        +@{ Layout.Title = T("Create New Content").ToString(); } + +@foreach (var type in Model.ContentTypes) { +

        @Html.ActionLink((string)type.DisplayName, "Create", new { Area = "Contents", Id = (string)type.Name, ContainerId = Model.ContainerId, ReturnUrl = Request.QueryString["ReturnUrl"] })

        } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Admin/Create.cshtml b/src/Orchard.Web/Core/Contents/Views/Admin/Create.cshtml index 9bb4def2a54..3a6d0e64ee3 100644 --- a/src/Orchard.Web/Core/Contents/Views/Admin/Create.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Admin/Create.cshtml @@ -1,15 +1,15 @@ -@using Orchard.ContentManagement -@using Orchard.Utility.Extensions - -@{ - ContentItem contentItem = Model.ContentItem; - var typeDisplayName = contentItem.TypeDefinition.DisplayName ?? contentItem.ContentType.CamelFriendly(); - - Layout.Title = T("New {0}", Html.Raw(typeDisplayName)).Text; -} - -@using (Html.BeginFormAntiForgeryPost(Url.Action("Create", new { ReturnUrl = Request.QueryString["ReturnUrl"] }), FormMethod.Post, new { enctype = "multipart/form-data" })) { - @Html.ValidationSummary() - // Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type - @Display(Model) +@using Orchard.ContentManagement +@using Orchard.Utility.Extensions + +@{ + ContentItem contentItem = Model.ContentItem; + var typeDisplayName = contentItem.TypeDefinition.DisplayName ?? contentItem.ContentType.CamelFriendly(); + + Layout.Title = T("New {0}", Html.Raw(typeDisplayName)).Text; +} + +@using (Html.BeginFormAntiForgeryPost(Url.Action("Create", new { ReturnUrl = Request.QueryString["ReturnUrl"] }), FormMethod.Post, new { enctype = "multipart/form-data" })) { + @Html.ValidationSummary() + // Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type + @Display(Model) } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Admin/Edit.cshtml b/src/Orchard.Web/Core/Contents/Views/Admin/Edit.cshtml index 2ce995e83e5..8361060cdee 100644 --- a/src/Orchard.Web/Core/Contents/Views/Admin/Edit.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Admin/Edit.cshtml @@ -1,15 +1,15 @@ -@{ - var typeDisplayName = Model.ContentItem.TypeDefinition.DisplayName; - var pageTitle = T("Edit Content"); - if (!string.IsNullOrWhiteSpace(typeDisplayName)) { - pageTitle = T("Edit {0}", typeDisplayName); - } - - Layout.Title = pageTitle; -} - -@using (Html.BeginFormAntiForgeryPost(Url.Action("Edit"), FormMethod.Post, new { enctype = "multipart/form-data" })) { - @Html.ValidationSummary() - // Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type - @Display(Model) +@{ + var typeDisplayName = Model.ContentItem.TypeDefinition.DisplayName; + var pageTitle = T("Edit Content"); + if (!string.IsNullOrWhiteSpace(typeDisplayName)) { + pageTitle = T("Edit {0}", typeDisplayName); + } + + Layout.Title = pageTitle; +} + +@using (Html.BeginFormAntiForgeryPost(Url.Action("Edit"), FormMethod.Post, new { enctype = "multipart/form-data" })) { + @Html.ValidationSummary() + // Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type + @Display(Model) } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Admin/List.cshtml b/src/Orchard.Web/Core/Contents/Views/Admin/List.cshtml index 42296d436ea..c4df5b42006 100644 --- a/src/Orchard.Web/Core/Contents/Views/Admin/List.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Admin/List.cshtml @@ -1,69 +1,69 @@ -@using Orchard.Core.Contents.ViewModels; -@{ - var typeDisplayName = Model.TypeDisplayName; - var pageTitle = T("Manage Content"); - var createLinkText = T("Create New Content"); - if (!string.IsNullOrWhiteSpace(typeDisplayName)) { - pageTitle = T("Manage {0} Content", Html.Raw(typeDisplayName)); - createLinkText = T("Create New {0}", Html.Raw(typeDisplayName)); - } - - IEnumerable cultures = Model.Options.Cultures; - - Layout.Title = pageTitle.Text; -} - -
        - @Html.ActionLink(createLinkText.Text, "Create", new { Area = "Contents", Id = (string)Model.Options.SelectedFilter }, new { @class = "button primaryAction" }) -
        -@using (Html.BeginFormAntiForgeryPost()) { -
        - - - -
        -
        - - - - @if (cultures.Count() > 1) { - - - } - - - - - - -
        -
        -@Display(Model.ContentItems) -
        -@Display(Model.Pager) +@using Orchard.Core.Contents.ViewModels; +@{ + var typeDisplayName = Model.TypeDisplayName; + var pageTitle = T("Manage Content"); + var createLinkText = T("Create New Content"); + if (!string.IsNullOrWhiteSpace(typeDisplayName)) { + pageTitle = T("Manage {0} Content", Html.Raw(typeDisplayName)); + createLinkText = T("Create New {0}", Html.Raw(typeDisplayName)); + } + + IEnumerable cultures = Model.Options.Cultures; + + Layout.Title = pageTitle.Text; +} + +
        + @Html.ActionLink(createLinkText.Text, "Create", new { Area = "Contents", Id = (string)Model.Options.SelectedFilter }, new { @class = "button primaryAction" }) +
        +@using (Html.BeginFormAntiForgeryPost()) { +
        + + + +
        +
        + + + + @if (cultures.Count() > 1) { + + + } + + + + + + +
        +
        +@Display(Model.ContentItems) +
        +@Display(Model.Pager) } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Content.ControlWrapper.cshtml b/src/Orchard.Web/Core/Contents/Views/Content.ControlWrapper.cshtml index fbe37d8a86a..4dc2a6f31aa 100644 --- a/src/Orchard.Web/Core/Contents/Views/Content.ControlWrapper.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Content.ControlWrapper.cshtml @@ -1,15 +1,15 @@ -@using Orchard.ContentManagement; -@using Orchard.Core.Contents; -@{ - var contentItem = (ContentItem)Model.ContentItem; - var authorizedFor = AuthorizedFor(Permissions.EditContent, contentItem); -} -@if (authorizedFor && Model.ContentItem.Id > 0) { -
        -
        @Html.ItemEditLinkWithReturnUrl(T("Edit").Text, contentItem)
        - @Display(Model.Child) -
        -} -else { - @Display(Model.Child) +@using Orchard.ContentManagement; +@using Orchard.Core.Contents; +@{ + var contentItem = (ContentItem)Model.ContentItem; + var authorizedFor = AuthorizedFor(Permissions.EditContent, contentItem); +} +@if (authorizedFor && Model.ContentItem.Id > 0) { +
        +
        @Html.ItemEditLinkWithReturnUrl(T("Edit").Text, contentItem)
        + @Display(Model.Child) +
        +} +else { + @Display(Model.Child) } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Content.Edit.cshtml b/src/Orchard.Web/Core/Contents/Views/Content.Edit.cshtml index 93016d7f4c5..315e8f757a6 100644 --- a/src/Orchard.Web/Core/Contents/Views/Content.Edit.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Content.Edit.cshtml @@ -1,25 +1,25 @@ -
        -
        - @if (Model.Content != null) { -
        - @Display(Model.Content) -
        - } -
        -
        - @if (Model.Actions != null) { -
        - @Display(Model.Actions) -
        - } - @if (Model.Sidebar != null) { -
        - @Display(Model.Sidebar) -
        - } -
        -
        - -@if (!String.IsNullOrWhiteSpace(Request.QueryString["returnUrl"])) { - @Html.Hidden("returnUrl", Request.QueryString["returnUrl"]) +
        +
        + @if (Model.Content != null) { +
        + @Display(Model.Content) +
        + } +
        +
        + @if (Model.Actions != null) { +
        + @Display(Model.Actions) +
        + } + @if (Model.Sidebar != null) { +
        + @Display(Model.Sidebar) +
        + } +
        +
        + +@if (!String.IsNullOrWhiteSpace(Request.QueryString["returnUrl"])) { + @Html.Hidden("returnUrl", Request.QueryString["returnUrl"]) } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Content.PublishButton.cshtml b/src/Orchard.Web/Core/Contents/Views/Content.PublishButton.cshtml index 00aa39181c3..7590a0c0dee 100644 --- a/src/Orchard.Web/Core/Contents/Views/Content.PublishButton.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Content.PublishButton.cshtml @@ -1,9 +1,9 @@ -@using Orchard.ContentManagement; -@using Orchard.Core.Contents; -@using Orchard.Utility.Extensions; - -@if (Authorizer.Authorize(Permissions.PublishContent, (IContent)Model.ContentItem)) { -
        - -
        +@using Orchard.ContentManagement; +@using Orchard.Core.Contents; +@using Orchard.Utility.Extensions; + +@if (Authorizer.Authorize(Permissions.PublishContent, (IContent)Model.ContentItem)) { +
        + +
        } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Content.SaveButton.cshtml b/src/Orchard.Web/Core/Contents/Views/Content.SaveButton.cshtml index 883198ec639..a9275bcadf6 100644 --- a/src/Orchard.Web/Core/Contents/Views/Content.SaveButton.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Content.SaveButton.cshtml @@ -1,12 +1,12 @@ -@using Orchard.Utility.Extensions -
        - - - @{ - var returnUrl = Request.QueryString["returnUrl"]; - } - - @if (!String.IsNullOrWhiteSpace(returnUrl) && Request.IsLocalUrl(returnUrl)) { - @T("Cancel") - } +@using Orchard.Utility.Extensions +
        + + + @{ + var returnUrl = Request.QueryString["returnUrl"]; + } + + @if (!String.IsNullOrWhiteSpace(returnUrl) && Request.IsLocalUrl(returnUrl)) { + @T("Cancel") + }
        \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Content.Summary.cshtml b/src/Orchard.Web/Core/Contents/Views/Content.Summary.cshtml index 07e622932d7..0c5b8efa924 100644 --- a/src/Orchard.Web/Core/Contents/Views/Content.Summary.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Content.Summary.cshtml @@ -1,20 +1,20 @@ -@using Orchard.Utility.Extensions; -@{ - var contentTypeClassName = ((string)Model.ContentItem.ContentType).HtmlClassify(); -} -
        -
        - @Display(Model.Header) - @if (Model.Meta != null) { - - } -
        - @Display(Model.Content) - @if(Model.Footer != null) { -
        - @Display(Model.Footer) -
        - } +@using Orchard.Utility.Extensions; +@{ + var contentTypeClassName = ((string)Model.ContentItem.ContentType).HtmlClassify(); +} +
        +
        + @Display(Model.Header) + @if (Model.Meta != null) { + + } +
        + @Display(Model.Content) + @if(Model.Footer != null) { +
        + @Display(Model.Footer) +
        + }
        \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Content.SummaryAdmin.cshtml b/src/Orchard.Web/Core/Contents/Views/Content.SummaryAdmin.cshtml index 05e69f0bb20..6ee554571a0 100644 --- a/src/Orchard.Web/Core/Contents/Views/Content.SummaryAdmin.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Content.SummaryAdmin.cshtml @@ -1,31 +1,31 @@ -@using Orchard.ContentManagement; -@using Orchard.Core.Contents -@using Orchard.Utility.Extensions; -@{ - ContentItem contentItem = Model.ContentItem; - var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString(); -} -
        -
        - -

        @Html.ItemAdminLink(contentItem)

        -
        @contentItem.TypeDefinition.DisplayName
        - @if (Model.Header != null) { -
        @Display(Model.Header)
        - } - @if (Model.Meta != null) { - - } -
        - - @if (Model.Content != null) { -
        @Display(Model.Content)
        - } +@using Orchard.ContentManagement; +@using Orchard.Core.Contents +@using Orchard.Utility.Extensions; +@{ + ContentItem contentItem = Model.ContentItem; + var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString(); +} +
        +
        + +

        @Html.ItemAdminLink(contentItem)

        -
        @contentItem.TypeDefinition.DisplayName
        + @if (Model.Header != null) { +
        @Display(Model.Header)
        + } + @if (Model.Meta != null) { + + } +
        + + @if (Model.Content != null) { +
        @Display(Model.Content)
        + }
        \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Content.cshtml b/src/Orchard.Web/Core/Contents/Views/Content.cshtml index 4d2a1142b96..318362f6765 100644 --- a/src/Orchard.Web/Core/Contents/Views/Content.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Content.cshtml @@ -1,29 +1,29 @@ -@using Orchard.Utility.Extensions; -@{ - if (Model.Title != null) { - Layout.Title = Model.Title; - } - - Model.Classes.Add("content-item"); - - var contentTypeClassName = ((string)Model.ContentItem.ContentType).HtmlClassify(); - Model.Classes.Add(contentTypeClassName); - - var tag = Tag(Model, "article"); -} -@tag.StartElement -
        - @Display(Model.Header) - @if (Model.Meta != null) { - - } -
        - @Display(Model.Content) - @if(Model.Footer != null) { -
        - @Display(Model.Footer) -
        - } +@using Orchard.Utility.Extensions; +@{ + if (Model.Title != null) { + Layout.Title = Model.Title; + } + + Model.Classes.Add("content-item"); + + var contentTypeClassName = ((string)Model.ContentItem.ContentType).HtmlClassify(); + Model.Classes.Add(contentTypeClassName); + + var tag = Tag(Model, "article"); +} +@tag.StartElement +
        + @Display(Model.Header) + @if (Model.Meta != null) { + + } +
        + @Display(Model.Content) + @if(Model.Footer != null) { +
        + @Display(Model.Footer) +
        + } @tag.EndElement \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Item/Display.cshtml b/src/Orchard.Web/Core/Contents/Views/Item/Display.cshtml index d654a7e7df5..71be7f8da0d 100644 --- a/src/Orchard.Web/Core/Contents/Views/Item/Display.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Item/Display.cshtml @@ -1,6 +1,6 @@ -@using Orchard.ContentManagement -@using Orchard.Utility.Extensions -@{ - ContentItem contentItem = Model.ContentItem; - Html.AddPageClassNames("detail-" + contentItem.ContentType.HtmlClassify()); +@using Orchard.ContentManagement +@using Orchard.Utility.Extensions +@{ + ContentItem contentItem = Model.ContentItem; + Html.AddPageClassNames("detail-" + contentItem.ContentType.HtmlClassify()); }@Display(Model) \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Item/Preview.cshtml b/src/Orchard.Web/Core/Contents/Views/Item/Preview.cshtml index 1ff18671e09..728620b77ba 100644 --- a/src/Orchard.Web/Core/Contents/Views/Item/Preview.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Item/Preview.cshtml @@ -1,6 +1,6 @@ -@using Orchard.ContentManagement -@using Orchard.Utility.Extensions -@{ - ContentItem contentItem = Model.ContentItem; - Html.AddPageClassNames("preview", "detail-" + contentItem.ContentType.HtmlClassify()); +@using Orchard.ContentManagement +@using Orchard.Utility.Extensions +@{ + ContentItem contentItem = Model.ContentItem; + Html.AddPageClassNames("preview", "detail-" + contentItem.ContentType.HtmlClassify()); }@Display(Model) \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Parts.Contents.Clone.SummaryAdmin.cshtml b/src/Orchard.Web/Core/Contents/Views/Parts.Contents.Clone.SummaryAdmin.cshtml index 72918267621..1894324db8b 100644 --- a/src/Orchard.Web/Core/Contents/Views/Parts.Contents.Clone.SummaryAdmin.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Parts.Contents.Clone.SummaryAdmin.cshtml @@ -1,10 +1,10 @@ -@using Orchard.ContentManagement -@using Orchard.Core.Contents -@using Orchard.Utility.Extensions -@{ - ContentPart contentPart = Model.ContentPart; -} -@if (Authorizer.Authorize(Permissions.EditContent, contentPart)) { - @T("Clone") - @T(" | ") +@using Orchard.ContentManagement +@using Orchard.Core.Contents +@using Orchard.Utility.Extensions +@{ + ContentPart contentPart = Model.ContentPart; +} +@if (Authorizer.Authorize(Permissions.EditContent, contentPart)) { + @T("Clone") + @T(" | ") } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Parts.Contents.Publish.SummaryAdmin.cshtml b/src/Orchard.Web/Core/Contents/Views/Parts.Contents.Publish.SummaryAdmin.cshtml index 219e60c7820..45d50d10483 100644 --- a/src/Orchard.Web/Core/Contents/Views/Parts.Contents.Publish.SummaryAdmin.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Parts.Contents.Publish.SummaryAdmin.cshtml @@ -1,41 +1,41 @@ -@using Orchard.ContentManagement; -@using Orchard.Core.Contents; -@using Orchard.Utility.Extensions; - -@{ - Script.Require("ShapesBase"); - ContentPart contentPart = Model.ContentPart; -} -@if (contentPart.HasPublished()) { - @Html.ItemDisplayLink(T("View").Text, (ContentItem)Model.ContentPart.ContentItem) - @T(" | ") - - if (contentPart.HasDraft()) { - if (Authorizer.Authorize(Permissions.PublishContent, contentPart)) { - @Html.Link(T("Publish Draft").Text, Url.Action("Publish", "Admin", new {area = "Contents", id = contentPart.ContentItem.Id, returnUrl = Request.ToUrlString()}), new {itemprop = "UnsafeUrl"}) - @T(" | ") - } - - if (Authorizer.Authorize(Permissions.PreviewContent, contentPart)) { - @Html.ActionLink(T("Preview").Text, "Display", "Item", new { area = "Contents", id = ((ContentItem)Model.ContentPart.ContentItem).Id, version = ((ContentItem)Model.ContentPart.ContentItem).Version }, new { }) - @T(" | ") - } - } - - if (Authorizer.Authorize(Permissions.PublishContent, contentPart)) { - @Html.Link(T("Unpublish").Text, Url.Action("Unpublish", "Admin", new {area = "Contents", id = contentPart.ContentItem.Id, returnUrl = Request.ToUrlString()}), new {itemprop = "UnsafeUrl"}) - @T(" | ") - } -} else { - if (contentPart.HasDraft()) { - if (Authorizer.Authorize(Permissions.PreviewContent, contentPart)) { - @Html.ActionLink(T("Preview").Text, "Display", "Item", new { area = "Contents", id = ((ContentItem)Model.ContentPart.ContentItem).Id, version = ((ContentItem)Model.ContentPart.ContentItem).Version }, new { }) - @T(" | ") - } - } - - if (Authorizer.Authorize(Permissions.PublishContent, contentPart)) { - @Html.Link(T("Publish").Text, Url.Action("Publish", "Admin", new {area = "Contents", id = contentPart.ContentItem.Id, returnUrl = Request.ToUrlString()}), new {itemprop = "UnsafeUrl"}) - @T(" | ") - } +@using Orchard.ContentManagement; +@using Orchard.Core.Contents; +@using Orchard.Utility.Extensions; + +@{ + Script.Require("ShapesBase"); + ContentPart contentPart = Model.ContentPart; +} +@if (contentPart.HasPublished()) { + @Html.ItemDisplayLink(T("View").Text, (ContentItem)Model.ContentPart.ContentItem) + @T(" | ") + + if (contentPart.HasDraft()) { + if (Authorizer.Authorize(Permissions.PublishContent, contentPart)) { + @Html.Link(T("Publish Draft").Text, Url.Action("Publish", "Admin", new {area = "Contents", id = contentPart.ContentItem.Id, returnUrl = Request.ToUrlString()}), new {itemprop = "UnsafeUrl"}) + @T(" | ") + } + + if (Authorizer.Authorize(Permissions.PreviewContent, contentPart)) { + @Html.ActionLink(T("Preview").Text, "Display", "Item", new { area = "Contents", id = ((ContentItem)Model.ContentPart.ContentItem).Id, version = ((ContentItem)Model.ContentPart.ContentItem).Version }, new { }) + @T(" | ") + } + } + + if (Authorizer.Authorize(Permissions.PublishContent, contentPart)) { + @Html.Link(T("Unpublish").Text, Url.Action("Unpublish", "Admin", new {area = "Contents", id = contentPart.ContentItem.Id, returnUrl = Request.ToUrlString()}), new {itemprop = "UnsafeUrl"}) + @T(" | ") + } +} else { + if (contentPart.HasDraft()) { + if (Authorizer.Authorize(Permissions.PreviewContent, contentPart)) { + @Html.ActionLink(T("Preview").Text, "Display", "Item", new { area = "Contents", id = ((ContentItem)Model.ContentPart.ContentItem).Id, version = ((ContentItem)Model.ContentPart.ContentItem).Version }, new { }) + @T(" | ") + } + } + + if (Authorizer.Authorize(Permissions.PublishContent, contentPart)) { + @Html.Link(T("Publish").Text, Url.Action("Publish", "Admin", new {area = "Contents", id = contentPart.ContentItem.Id, returnUrl = Request.ToUrlString()}), new {itemprop = "UnsafeUrl"}) + @T(" | ") + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Dashboard/AdminMenu.cs b/src/Orchard.Web/Core/Dashboard/AdminMenu.cs index c50e905e046..7a66a111489 100644 --- a/src/Orchard.Web/Core/Dashboard/AdminMenu.cs +++ b/src/Orchard.Web/Core/Dashboard/AdminMenu.cs @@ -1,19 +1,19 @@ -using Orchard.Localization; -using Orchard.Security; -using Orchard.UI.Navigation; - -namespace Orchard.Core.Dashboard { - public class AdminMenu : INavigationProvider { - public Localizer T { get; set; } - public string MenuName { get { return "admin"; } } - - public void GetNavigation(NavigationBuilder builder) { - builder.AddImageSet("dashboard") - .Add(T("Dashboard"), "-5", - menu => menu.Add(T("Orchard"), "-5", - item => item - .Action("Index", "Admin", new { area = "Dashboard" }) - .Permission(StandardPermissions.AccessAdminPanel))); - } - } +using Orchard.Localization; +using Orchard.Security; +using Orchard.UI.Navigation; + +namespace Orchard.Core.Dashboard { + public class AdminMenu : INavigationProvider { + public Localizer T { get; set; } + public string MenuName { get { return "admin"; } } + + public void GetNavigation(NavigationBuilder builder) { + builder.AddImageSet("dashboard") + .Add(T("Dashboard"), "-5", + menu => menu.Add(T("Orchard"), "-5", + item => item + .Action("Index", "Admin", new { area = "Dashboard" }) + .Permission(StandardPermissions.AccessAdminPanel))); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Dashboard/Controllers/AdminController.cs b/src/Orchard.Web/Core/Dashboard/Controllers/AdminController.cs index af460e5235c..dd281603ba5 100644 --- a/src/Orchard.Web/Core/Dashboard/Controllers/AdminController.cs +++ b/src/Orchard.Web/Core/Dashboard/Controllers/AdminController.cs @@ -1,10 +1,10 @@ -using System.Web.Mvc; - -namespace Orchard.Core.Dashboard.Controllers { - public class AdminController : Controller { - - public ActionResult Index() { - return View(); - } - } +using System.Web.Mvc; + +namespace Orchard.Core.Dashboard.Controllers { + public class AdminController : Controller { + + public ActionResult Index() { + return View(); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Dashboard/Module.txt b/src/Orchard.Web/Core/Dashboard/Module.txt index ca5bc897e67..b288b65e5a5 100644 --- a/src/Orchard.Web/Core/Dashboard/Module.txt +++ b/src/Orchard.Web/Core/Dashboard/Module.txt @@ -1,9 +1,9 @@ -Name: Dashboard -AntiForgery: enabled -Author: The Orchard Team -Website: http://orchardproject.net -Version: 1.9.2 -OrchardVersion: 1.9 -Description: The dashboard module is providing the dashboard screen of the admininstration UI of the application. -FeatureDescription: Standard admin dashboard. -Category: Core +Name: Dashboard +AntiForgery: enabled +Author: The Orchard Team +Website: http://orchardproject.net +Version: 1.9.2 +OrchardVersion: 1.9 +Description: The dashboard module is providing the dashboard screen of the admininstration UI of the application. +FeatureDescription: Standard admin dashboard. +Category: Core diff --git a/src/Orchard.Web/Core/Dashboard/Routes.cs b/src/Orchard.Web/Core/Dashboard/Routes.cs index 7662158f19a..d08739c329c 100644 --- a/src/Orchard.Web/Core/Dashboard/Routes.cs +++ b/src/Orchard.Web/Core/Dashboard/Routes.cs @@ -1,33 +1,33 @@ -using System.Collections.Generic; -using System.Web.Mvc; -using System.Web.Routing; -using Orchard.Mvc.Routes; - -namespace Orchard.Core.Dashboard { - public class Routes : IRouteProvider { - public void GetRoutes(ICollection routes) { - foreach (var routeDescriptor in GetRoutes()) - routes.Add(routeDescriptor); - } - - public IEnumerable GetRoutes() { - return new[] { - new RouteDescriptor { - Priority = -5, - Route = new Route( - "Admin", - new RouteValueDictionary { - {"area", "Dashboard"}, - {"controller", "admin"}, - {"action", "index"} - }, - new RouteValueDictionary(), - new RouteValueDictionary { - {"area", "Dashboard"} - }, - new MvcRouteHandler()) - } - }; - } - } +using System.Collections.Generic; +using System.Web.Mvc; +using System.Web.Routing; +using Orchard.Mvc.Routes; + +namespace Orchard.Core.Dashboard { + public class Routes : IRouteProvider { + public void GetRoutes(ICollection routes) { + foreach (var routeDescriptor in GetRoutes()) + routes.Add(routeDescriptor); + } + + public IEnumerable GetRoutes() { + return new[] { + new RouteDescriptor { + Priority = -5, + Route = new Route( + "Admin", + new RouteValueDictionary { + {"area", "Dashboard"}, + {"controller", "admin"}, + {"action", "index"} + }, + new RouteValueDictionary(), + new RouteValueDictionary { + {"area", "Dashboard"} + }, + new MvcRouteHandler()) + } + }; + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Dashboard/Services/CompilationErrorBanner.cs b/src/Orchard.Web/Core/Dashboard/Services/CompilationErrorBanner.cs index 8cf3a5211fa..d58868fe2d7 100644 --- a/src/Orchard.Web/Core/Dashboard/Services/CompilationErrorBanner.cs +++ b/src/Orchard.Web/Core/Dashboard/Services/CompilationErrorBanner.cs @@ -1,24 +1,24 @@ -using System.Linq; -using System.Collections.Generic; -using Orchard.Environment.Extensions; -using Orchard.Localization; -using Orchard.UI.Admin.Notification; -using Orchard.UI.Notify; - -namespace Orchard.Core.Dashboard.Services { - public class CompilationErrorBanner : INotificationProvider { - private readonly ICriticalErrorProvider _errorProvider; - - public CompilationErrorBanner(ICriticalErrorProvider errorProvider) { - _errorProvider = errorProvider; - T = NullLocalizer.Instance; - } - - public Localizer T { get; set; } - - public IEnumerable GetNotifications() { - return _errorProvider.GetErrors() - .Select(message => new NotifyEntry { Message = message, Type = NotifyType.Error }); - } - } -} +using System.Linq; +using System.Collections.Generic; +using Orchard.Environment.Extensions; +using Orchard.Localization; +using Orchard.UI.Admin.Notification; +using Orchard.UI.Notify; + +namespace Orchard.Core.Dashboard.Services { + public class CompilationErrorBanner : INotificationProvider { + private readonly ICriticalErrorProvider _errorProvider; + + public CompilationErrorBanner(ICriticalErrorProvider errorProvider) { + _errorProvider = errorProvider; + T = NullLocalizer.Instance; + } + + public Localizer T { get; set; } + + public IEnumerable GetNotifications() { + return _errorProvider.GetErrors() + .Select(message => new NotifyEntry { Message = message, Type = NotifyType.Error }); + } + } +} diff --git a/src/Orchard.Web/Core/Dashboard/Views/Admin/Index.cshtml b/src/Orchard.Web/Core/Dashboard/Views/Admin/Index.cshtml index 0a1a4b1636f..639f6961d36 100644 --- a/src/Orchard.Web/Core/Dashboard/Views/Admin/Index.cshtml +++ b/src/Orchard.Web/Core/Dashboard/Views/Admin/Index.cshtml @@ -1,38 +1,38 @@ -@model dynamic -@{ Layout.Title = T("Welcome to Orchard").ToString(); } -
        -
        -

        @T("Get up and running")

        -

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

        -
        -
        - -

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

        -
        -
        -

        @T("Read the Docs")

        -

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

        -
        -
        -

        @T("Make friends")

        -

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

        -
        -
        -

        @T("Contribute back")

        -

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

        -
        - -
        -

        @T("Stay up to date")

        - -
        +@model dynamic +@{ Layout.Title = T("Welcome to Orchard").ToString(); } +
        +
        +

        @T("Get up and running")

        +

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

        +
        +
        + +

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

        +
        +
        +

        @T("Read the Docs")

        +

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

        +
        +
        +

        @T("Make friends")

        +

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

        +
        +
        +

        @T("Contribute back")

        +

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

        +
        + +
        +

        @T("Stay up to date")

        + +
        \ No newline at end of file diff --git a/src/Orchard.Web/Core/Dashboard/styles/Web.config b/src/Orchard.Web/Core/Dashboard/styles/Web.config index 74c71f22bd5..11135c33761 100644 --- a/src/Orchard.Web/Core/Dashboard/styles/Web.config +++ b/src/Orchard.Web/Core/Dashboard/styles/Web.config @@ -1,16 +1,16 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Dashboard/styles/menu.dashboard-admin.css b/src/Orchard.Web/Core/Dashboard/styles/menu.dashboard-admin.css index 0b8da58371b..40cb057e9cb 100644 --- a/src/Orchard.Web/Core/Dashboard/styles/menu.dashboard-admin.css +++ b/src/Orchard.Web/Core/Dashboard/styles/menu.dashboard-admin.css @@ -1,6 +1,6 @@ -.navicon-dashboard { -background-image:url(images/menu.dashboard.png) !important; -} -.navicon-dashboard:hover { -background-position:0 -30px !important; +.navicon-dashboard { +background-image:url(images/menu.dashboard.png) !important; +} +.navicon-dashboard:hover { +background-position:0 -30px !important; } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Feeds/Controllers/FeedController.cs b/src/Orchard.Web/Core/Feeds/Controllers/FeedController.cs index c09308e2c66..d186632fde5 100644 --- a/src/Orchard.Web/Core/Feeds/Controllers/FeedController.cs +++ b/src/Orchard.Web/Core/Feeds/Controllers/FeedController.cs @@ -1,60 +1,60 @@ -using System.Collections.Generic; -using System.Linq; -using System.Web.Mvc; -using Orchard.Core.Feeds.Models; -using Orchard.Logging; - -namespace Orchard.Core.Feeds.Controllers { - public class FeedController : Controller { - private readonly IEnumerable _feedFormatProviders; - private readonly IEnumerable _feedQueryProviders; - private readonly IFeedItemBuilder _feedItemBuilder; - - public FeedController( - IEnumerable feedQueryProviders, - IEnumerable feedFormatProviders, - IFeedItemBuilder feedItemBuilder) { - _feedQueryProviders = feedQueryProviders; - _feedFormatProviders = feedFormatProviders; - _feedItemBuilder = feedItemBuilder; - Logger = NullLogger.Instance; - } - - public ILogger Logger { get; set; } - - public ActionResult Index(string format) { - var context = new FeedContext(ValueProvider, format); - - var bestFormatterMatch = _feedFormatProviders - .Select(provider => provider.Match(context)) - .Where(match => match != null && match.FeedBuilder != null) - .OrderByDescending(match => match.Priority) - .FirstOrDefault(); - - if (bestFormatterMatch == null || bestFormatterMatch.FeedBuilder == null) - return HttpNotFound(); - - context.Builder = bestFormatterMatch.FeedBuilder; - - var bestQueryMatch = _feedQueryProviders - .Select(provider => provider.Match(context)) - .Where(match => match != null && match.FeedQuery != null) - .OrderByDescending(match => match.Priority) - .FirstOrDefault(); - - if (bestQueryMatch == null || bestQueryMatch.FeedQuery == null) - return HttpNotFound(); - - return context.Builder.Process(context, () => { - bestQueryMatch.FeedQuery.Execute(context); - _feedItemBuilder.Populate(context); - foreach (var contextualizer in context.Response.Contextualizers) { - if (ControllerContext != null && - ControllerContext.RequestContext != null) { - contextualizer(ControllerContext.RequestContext); - } - } - }); - } - } -} +using System.Collections.Generic; +using System.Linq; +using System.Web.Mvc; +using Orchard.Core.Feeds.Models; +using Orchard.Logging; + +namespace Orchard.Core.Feeds.Controllers { + public class FeedController : Controller { + private readonly IEnumerable _feedFormatProviders; + private readonly IEnumerable _feedQueryProviders; + private readonly IFeedItemBuilder _feedItemBuilder; + + public FeedController( + IEnumerable feedQueryProviders, + IEnumerable feedFormatProviders, + IFeedItemBuilder feedItemBuilder) { + _feedQueryProviders = feedQueryProviders; + _feedFormatProviders = feedFormatProviders; + _feedItemBuilder = feedItemBuilder; + Logger = NullLogger.Instance; + } + + public ILogger Logger { get; set; } + + public ActionResult Index(string format) { + var context = new FeedContext(ValueProvider, format); + + var bestFormatterMatch = _feedFormatProviders + .Select(provider => provider.Match(context)) + .Where(match => match != null && match.FeedBuilder != null) + .OrderByDescending(match => match.Priority) + .FirstOrDefault(); + + if (bestFormatterMatch == null || bestFormatterMatch.FeedBuilder == null) + return HttpNotFound(); + + context.Builder = bestFormatterMatch.FeedBuilder; + + var bestQueryMatch = _feedQueryProviders + .Select(provider => provider.Match(context)) + .Where(match => match != null && match.FeedQuery != null) + .OrderByDescending(match => match.Priority) + .FirstOrDefault(); + + if (bestQueryMatch == null || bestQueryMatch.FeedQuery == null) + return HttpNotFound(); + + return context.Builder.Process(context, () => { + bestQueryMatch.FeedQuery.Execute(context); + _feedItemBuilder.Populate(context); + foreach (var contextualizer in context.Response.Contextualizers) { + if (ControllerContext != null && + ControllerContext.RequestContext != null) { + contextualizer(ControllerContext.RequestContext); + } + } + }); + } + } +} diff --git a/src/Orchard.Web/Core/Feeds/IFeedBuilder.cs b/src/Orchard.Web/Core/Feeds/IFeedBuilder.cs index 94712724021..52fa648a9f9 100644 --- a/src/Orchard.Web/Core/Feeds/IFeedBuilder.cs +++ b/src/Orchard.Web/Core/Feeds/IFeedBuilder.cs @@ -1,12 +1,12 @@ -using System; -using System.Web.Mvc; -using Orchard.Core.Feeds.Models; - -namespace Orchard.Core.Feeds { - public interface IFeedBuilder { - ActionResult Process(FeedContext context, Action populate); - - FeedItem AddItem(FeedContext context, TItem contentItem); - void AddProperty(FeedContext context, FeedItem feedItem, string name, string value); - } +using System; +using System.Web.Mvc; +using Orchard.Core.Feeds.Models; + +namespace Orchard.Core.Feeds { + public interface IFeedBuilder { + ActionResult Process(FeedContext context, Action populate); + + FeedItem AddItem(FeedContext context, TItem contentItem); + void AddProperty(FeedContext context, FeedItem feedItem, string name, string value); + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Feeds/IFeedBuilderProvider.cs b/src/Orchard.Web/Core/Feeds/IFeedBuilderProvider.cs index db889b15185..2d70f9c41f8 100644 --- a/src/Orchard.Web/Core/Feeds/IFeedBuilderProvider.cs +++ b/src/Orchard.Web/Core/Feeds/IFeedBuilderProvider.cs @@ -1,12 +1,12 @@ -using Orchard.Core.Feeds.Models; - -namespace Orchard.Core.Feeds { - public interface IFeedBuilderProvider : IDependency { - FeedBuilderMatch Match(FeedContext context); - } - - public class FeedBuilderMatch { - public int Priority { get; set; } - public IFeedBuilder FeedBuilder { get; set; } - } -} +using Orchard.Core.Feeds.Models; + +namespace Orchard.Core.Feeds { + public interface IFeedBuilderProvider : IDependency { + FeedBuilderMatch Match(FeedContext context); + } + + public class FeedBuilderMatch { + public int Priority { get; set; } + public IFeedBuilder FeedBuilder { get; set; } + } +} diff --git a/src/Orchard.Web/Core/Feeds/IFeedItemBuilder.cs b/src/Orchard.Web/Core/Feeds/IFeedItemBuilder.cs index ea082e49bc2..3760b91e4c8 100644 --- a/src/Orchard.Web/Core/Feeds/IFeedItemBuilder.cs +++ b/src/Orchard.Web/Core/Feeds/IFeedItemBuilder.cs @@ -1,8 +1,8 @@ -using Orchard.Core.Feeds.Models; -using Orchard.Events; - -namespace Orchard.Core.Feeds { - public interface IFeedItemBuilder : IEventHandler { - void Populate(FeedContext context); - } -} +using Orchard.Core.Feeds.Models; +using Orchard.Events; + +namespace Orchard.Core.Feeds { + public interface IFeedItemBuilder : IEventHandler { + void Populate(FeedContext context); + } +} diff --git a/src/Orchard.Web/Core/Feeds/IFeedManager.cs b/src/Orchard.Web/Core/Feeds/IFeedManager.cs index b22e96253de..bea7e0519b0 100644 --- a/src/Orchard.Web/Core/Feeds/IFeedManager.cs +++ b/src/Orchard.Web/Core/Feeds/IFeedManager.cs @@ -1,14 +1,14 @@ -using System; -using System.Web.Mvc; -using System.Web.Routing; - -namespace Orchard.Core.Feeds { - public interface IFeedManager : IDependency { - void Register(string title, string format, RouteValueDictionary values); - void Register(string title, string format, string url); - MvcHtmlString GetRegisteredLinks(HtmlHelper html); - - // Currently implemented in FeedController action... tbd - //ActionResult Execute(string format, IValueProvider values); - } -} +using System; +using System.Web.Mvc; +using System.Web.Routing; + +namespace Orchard.Core.Feeds { + public interface IFeedManager : IDependency { + void Register(string title, string format, RouteValueDictionary values); + void Register(string title, string format, string url); + MvcHtmlString GetRegisteredLinks(HtmlHelper html); + + // Currently implemented in FeedController action... tbd + //ActionResult Execute(string format, IValueProvider values); + } +} diff --git a/src/Orchard.Web/Core/Feeds/IFeedQuery.cs b/src/Orchard.Web/Core/Feeds/IFeedQuery.cs index b434c4e7c9e..9bf1bf77e7a 100644 --- a/src/Orchard.Web/Core/Feeds/IFeedQuery.cs +++ b/src/Orchard.Web/Core/Feeds/IFeedQuery.cs @@ -1,7 +1,7 @@ -using Orchard.Core.Feeds.Models; - -namespace Orchard.Core.Feeds { - public interface IFeedQuery { - void Execute(FeedContext context); - } +using Orchard.Core.Feeds.Models; + +namespace Orchard.Core.Feeds { + public interface IFeedQuery { + void Execute(FeedContext context); + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Feeds/IFeedQueryProvider.cs b/src/Orchard.Web/Core/Feeds/IFeedQueryProvider.cs index cfe813c18aa..814c1aedc07 100644 --- a/src/Orchard.Web/Core/Feeds/IFeedQueryProvider.cs +++ b/src/Orchard.Web/Core/Feeds/IFeedQueryProvider.cs @@ -1,12 +1,12 @@ -using Orchard.Core.Feeds.Models; - -namespace Orchard.Core.Feeds { - public interface IFeedQueryProvider : IDependency { - FeedQueryMatch Match(FeedContext context); - } - - public class FeedQueryMatch { - public int Priority { get; set; } - public IFeedQuery FeedQuery { get; set; } - } -} +using Orchard.Core.Feeds.Models; + +namespace Orchard.Core.Feeds { + public interface IFeedQueryProvider : IDependency { + FeedQueryMatch Match(FeedContext context); + } + + public class FeedQueryMatch { + public int Priority { get; set; } + public IFeedQuery FeedQuery { get; set; } + } +} diff --git a/src/Orchard.Web/Core/Feeds/Models/FeedContext.cs b/src/Orchard.Web/Core/Feeds/Models/FeedContext.cs index ec9a512f182..39ade162729 100644 --- a/src/Orchard.Web/Core/Feeds/Models/FeedContext.cs +++ b/src/Orchard.Web/Core/Feeds/Models/FeedContext.cs @@ -1,17 +1,17 @@ -using System.Web.Mvc; - -namespace Orchard.Core.Feeds.Models { - public class FeedContext { - public FeedContext(IValueProvider valueProvider, string format) { - ValueProvider = valueProvider; - Format = format; - Response = new FeedResponse(); - } - - public IValueProvider ValueProvider { get; set; } - public string Format { get; set; } - public FeedResponse Response { get; set; } - - public IFeedBuilder Builder { get; set; } - } -} +using System.Web.Mvc; + +namespace Orchard.Core.Feeds.Models { + public class FeedContext { + public FeedContext(IValueProvider valueProvider, string format) { + ValueProvider = valueProvider; + Format = format; + Response = new FeedResponse(); + } + + public IValueProvider ValueProvider { get; set; } + public string Format { get; set; } + public FeedResponse Response { get; set; } + + public IFeedBuilder Builder { get; set; } + } +} diff --git a/src/Orchard.Web/Core/Feeds/Models/FeedItem.cs b/src/Orchard.Web/Core/Feeds/Models/FeedItem.cs index 57cdb1deaba..57fe58f7a85 100644 --- a/src/Orchard.Web/Core/Feeds/Models/FeedItem.cs +++ b/src/Orchard.Web/Core/Feeds/Models/FeedItem.cs @@ -1,23 +1,23 @@ -using System.Xml.Linq; - -namespace Orchard.Core.Feeds.Models { - public class FeedItem { - private object _item; - public object Item { get { return _item; } set { SetItem(value); } } - public XElement Element { get; set; } - - protected virtual void SetItem(object item) { - _item = item; - } - } - - public class FeedItem : FeedItem { - private TItem _item; - public new TItem Item { get { return _item; } set { SetItem(value); } } - - protected override void SetItem(object item) { - _item = (TItem) item; - base.SetItem(item); - } - } +using System.Xml.Linq; + +namespace Orchard.Core.Feeds.Models { + public class FeedItem { + private object _item; + public object Item { get { return _item; } set { SetItem(value); } } + public XElement Element { get; set; } + + protected virtual void SetItem(object item) { + _item = item; + } + } + + public class FeedItem : FeedItem { + private TItem _item; + public new TItem Item { get { return _item; } set { SetItem(value); } } + + protected override void SetItem(object item) { + _item = (TItem) item; + base.SetItem(item); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Feeds/Models/FeedResponse.cs b/src/Orchard.Web/Core/Feeds/Models/FeedResponse.cs index aadbb4b022b..2354ec6bbf8 100644 --- a/src/Orchard.Web/Core/Feeds/Models/FeedResponse.cs +++ b/src/Orchard.Web/Core/Feeds/Models/FeedResponse.cs @@ -1,21 +1,21 @@ -using System; -using System.Collections.Generic; -using System.Web.Routing; -using System.Xml.Linq; - -namespace Orchard.Core.Feeds.Models { - public class FeedResponse { - public FeedResponse() { - Items = new List(); - Contextualizers = new List>(); - } - - public IList Items { get; set; } - public XElement Element { get; set; } - public IList> Contextualizers { get; set; } - - public void Contextualize(Action contextualizer) { - Contextualizers.Add(contextualizer); - } - } -} +using System; +using System.Collections.Generic; +using System.Web.Routing; +using System.Xml.Linq; + +namespace Orchard.Core.Feeds.Models { + public class FeedResponse { + public FeedResponse() { + Items = new List(); + Contextualizers = new List>(); + } + + public IList Items { get; set; } + public XElement Element { get; set; } + public IList> Contextualizers { get; set; } + + public void Contextualize(Action contextualizer) { + Contextualizers.Add(contextualizer); + } + } +} diff --git a/src/Orchard.Web/Core/Feeds/Module.txt b/src/Orchard.Web/Core/Feeds/Module.txt index 3ee3a4f86a8..60efb0161f9 100644 --- a/src/Orchard.Web/Core/Feeds/Module.txt +++ b/src/Orchard.Web/Core/Feeds/Module.txt @@ -1,9 +1,9 @@ -Name: Feeds -AntiForgery: enabled -Author: The Orchard Team -Website: http://orchardproject.net -Version: 1.9.2 -OrchardVersion: 1.9 -Description: The Feeds module is providing RSS feeds to content items. -FeatureDescription: RSS feeds for content items. -Category: Syndication +Name: Feeds +AntiForgery: enabled +Author: The Orchard Team +Website: http://orchardproject.net +Version: 1.9.2 +OrchardVersion: 1.9 +Description: The Feeds module is providing RSS feeds to content items. +FeatureDescription: RSS feeds for content items. +Category: Syndication diff --git a/src/Orchard.Web/Core/Feeds/Rss/Routes.cs b/src/Orchard.Web/Core/Feeds/Rss/Routes.cs index 8c6921e9767..0235181ba8d 100644 --- a/src/Orchard.Web/Core/Feeds/Rss/Routes.cs +++ b/src/Orchard.Web/Core/Feeds/Rss/Routes.cs @@ -1,35 +1,35 @@ -using System.Collections.Generic; -using System.Web.Mvc; -using System.Web.Routing; -using Orchard.Mvc.Routes; - -namespace Orchard.Core.Feeds.Rss { - public class Routes : IRouteProvider { - public IEnumerable GetRoutes() { - return new[] { - new RouteDescriptor { - Priority = -5, - Route = new Route( - "rss", - new RouteValueDictionary { - {"area", "Feeds"}, - {"controller", "Feed"}, - {"action", "Index"}, - {"format", "rss"}, - }, - new RouteValueDictionary(), - new RouteValueDictionary { - {"area", "Feeds"} - }, - new MvcRouteHandler()) - } - }; - } - - public void GetRoutes(ICollection routes) { - foreach (RouteDescriptor routeDescriptor in GetRoutes()) { - routes.Add(routeDescriptor); - } - } - } +using System.Collections.Generic; +using System.Web.Mvc; +using System.Web.Routing; +using Orchard.Mvc.Routes; + +namespace Orchard.Core.Feeds.Rss { + public class Routes : IRouteProvider { + public IEnumerable GetRoutes() { + return new[] { + new RouteDescriptor { + Priority = -5, + Route = new Route( + "rss", + new RouteValueDictionary { + {"area", "Feeds"}, + {"controller", "Feed"}, + {"action", "Index"}, + {"format", "rss"}, + }, + new RouteValueDictionary(), + new RouteValueDictionary { + {"area", "Feeds"} + }, + new MvcRouteHandler()) + } + }; + } + + public void GetRoutes(ICollection routes) { + foreach (RouteDescriptor routeDescriptor in GetRoutes()) { + routes.Add(routeDescriptor); + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Feeds/Rss/RssFeedBuilder.cs b/src/Orchard.Web/Core/Feeds/Rss/RssFeedBuilder.cs index 27f9bd28f80..ad0ec8269aa 100644 --- a/src/Orchard.Web/Core/Feeds/Rss/RssFeedBuilder.cs +++ b/src/Orchard.Web/Core/Feeds/Rss/RssFeedBuilder.cs @@ -1,53 +1,53 @@ -using System; -using System.Web.Mvc; -using System.Xml.Linq; -using JetBrains.Annotations; -using Orchard.Core.Feeds.Models; - -namespace Orchard.Core.Feeds.Rss { - [UsedImplicitly] - public class RssFeedBuilder : IFeedBuilderProvider, IFeedBuilder { - public FeedBuilderMatch Match(FeedContext context) { - if (context.Format == "rss") { - return new FeedBuilderMatch { - FeedBuilder = this, - Priority = -5 - }; - } - return null; - } - - public ActionResult Process(FeedContext context, Action populate) { - var rss = new XElement("rss"); - rss.SetAttributeValue("version", "2.0"); - - var channel = new XElement("channel"); - context.Response.Element = channel; - rss.Add(channel); - - populate(); - - return new RssResult(new XDocument(rss)); - } - - public FeedItem AddItem(FeedContext context, TItem item) { - var feedItem = new FeedItem { - Item = item, - Element = new XElement("item"), - }; - context.Response.Items.Add(feedItem); - context.Response.Element.Add(feedItem.Element); - return feedItem; - } - - public void AddProperty(FeedContext context, FeedItem feedItem, string name, string value) { - if (feedItem == null) { - context.Response.Element.Add(new XElement(name, value)); - } - else { - feedItem.Element.Add(new XElement(name, value)); - } - } - } - -} +using System; +using System.Web.Mvc; +using System.Xml.Linq; +using JetBrains.Annotations; +using Orchard.Core.Feeds.Models; + +namespace Orchard.Core.Feeds.Rss { + [UsedImplicitly] + public class RssFeedBuilder : IFeedBuilderProvider, IFeedBuilder { + public FeedBuilderMatch Match(FeedContext context) { + if (context.Format == "rss") { + return new FeedBuilderMatch { + FeedBuilder = this, + Priority = -5 + }; + } + return null; + } + + public ActionResult Process(FeedContext context, Action populate) { + var rss = new XElement("rss"); + rss.SetAttributeValue("version", "2.0"); + + var channel = new XElement("channel"); + context.Response.Element = channel; + rss.Add(channel); + + populate(); + + return new RssResult(new XDocument(rss)); + } + + public FeedItem AddItem(FeedContext context, TItem item) { + var feedItem = new FeedItem { + Item = item, + Element = new XElement("item"), + }; + context.Response.Items.Add(feedItem); + context.Response.Element.Add(feedItem.Element); + return feedItem; + } + + public void AddProperty(FeedContext context, FeedItem feedItem, string name, string value) { + if (feedItem == null) { + context.Response.Element.Add(new XElement(name, value)); + } + else { + feedItem.Element.Add(new XElement(name, value)); + } + } + } + +} diff --git a/src/Orchard.Web/Core/Feeds/Rss/RssResult.cs b/src/Orchard.Web/Core/Feeds/Rss/RssResult.cs index fad330dd5ae..68aa32895e2 100644 --- a/src/Orchard.Web/Core/Feeds/Rss/RssResult.cs +++ b/src/Orchard.Web/Core/Feeds/Rss/RssResult.cs @@ -1,23 +1,23 @@ -using System.Web.Mvc; -using System.Xml; -using System.Xml.Linq; - -namespace Orchard.Core.Feeds.Rss { - public class RssResult : ActionResult { - public XDocument Document { get; private set; } - - public RssResult(XDocument document) { - Document = document; - } - - public override void ExecuteResult(ControllerContext context) { - - // not returning application/rss+xml because of - // https://bugzilla.mozilla.org/show_bug.cgi?id=256379 - context.HttpContext.Response.ContentType = "text/xml"; - - using (var writer = XmlWriter.Create(context.HttpContext.Response.Output)) - Document.WriteTo(writer); - } - } +using System.Web.Mvc; +using System.Xml; +using System.Xml.Linq; + +namespace Orchard.Core.Feeds.Rss { + public class RssResult : ActionResult { + public XDocument Document { get; private set; } + + public RssResult(XDocument document) { + Document = document; + } + + public override void ExecuteResult(ControllerContext context) { + + // not returning application/rss+xml because of + // https://bugzilla.mozilla.org/show_bug.cgi?id=256379 + context.HttpContext.Response.ContentType = "text/xml"; + + using (var writer = XmlWriter.Create(context.HttpContext.Response.Output)) + Document.WriteTo(writer); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Feeds/Services/FeedFilter.cs b/src/Orchard.Web/Core/Feeds/Services/FeedFilter.cs index 0fc6f96218d..f0331bf058e 100644 --- a/src/Orchard.Web/Core/Feeds/Services/FeedFilter.cs +++ b/src/Orchard.Web/Core/Feeds/Services/FeedFilter.cs @@ -1,36 +1,36 @@ -using System.Web.Mvc; -using JetBrains.Annotations; -using Orchard.DisplayManagement; -using Orchard.Mvc.Filters; - -namespace Orchard.Core.Feeds.Services { - [UsedImplicitly] - public class FeedFilter : FilterProvider, IResultFilter { - private readonly IFeedManager _feedManager; - private readonly IWorkContextAccessor _workContextAccessor; - - public FeedFilter( - IFeedManager feedManager, - IWorkContextAccessor workContextAccessor, - IShapeFactory shapeFactory) { - _feedManager = feedManager; - _workContextAccessor = workContextAccessor; - Shape = shapeFactory; - } - - dynamic Shape { get; set; } - - public void OnResultExecuting(ResultExecutingContext filterContext) { - // should only run on a full view rendering result - if (!(filterContext.Result is ViewResult)) - return; - - var layout = _workContextAccessor.GetContext(filterContext).Layout; - var feed = Shape.Feed() - .FeedManager(_feedManager); - layout.Zones.Head.Add(feed, ":after"); - } - - public void OnResultExecuted(ResultExecutedContext filterContext) {} - } +using System.Web.Mvc; +using JetBrains.Annotations; +using Orchard.DisplayManagement; +using Orchard.Mvc.Filters; + +namespace Orchard.Core.Feeds.Services { + [UsedImplicitly] + public class FeedFilter : FilterProvider, IResultFilter { + private readonly IFeedManager _feedManager; + private readonly IWorkContextAccessor _workContextAccessor; + + public FeedFilter( + IFeedManager feedManager, + IWorkContextAccessor workContextAccessor, + IShapeFactory shapeFactory) { + _feedManager = feedManager; + _workContextAccessor = workContextAccessor; + Shape = shapeFactory; + } + + dynamic Shape { get; set; } + + public void OnResultExecuting(ResultExecutingContext filterContext) { + // should only run on a full view rendering result + if (!(filterContext.Result is ViewResult)) + return; + + var layout = _workContextAccessor.GetContext(filterContext).Layout; + var feed = Shape.Feed() + .FeedManager(_feedManager); + layout.Zones.Head.Add(feed, ":after"); + } + + public void OnResultExecuted(ResultExecutedContext filterContext) {} + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Feeds/Services/FeedManager.cs b/src/Orchard.Web/Core/Feeds/Services/FeedManager.cs index d975250ee0a..0dd007078bf 100644 --- a/src/Orchard.Web/Core/Feeds/Services/FeedManager.cs +++ b/src/Orchard.Web/Core/Feeds/Services/FeedManager.cs @@ -1,63 +1,63 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Web.Mvc; -using System.Web.Routing; -using JetBrains.Annotations; - -namespace Orchard.Core.Feeds.Services { - [UsedImplicitly] - public class FeedManager : IFeedManager { - private readonly IList _links = new List(); - - class Link { - public string Title { get; set; } - public RouteValueDictionary RouteValues { get; set; } - public string Url { get; set; } - } - - public void Register(string title, string format, RouteValueDictionary values) { - var link = new RouteValueDictionary(values) { { "format", format } }; - if (!link.ContainsKey("area")) { - link["area"] = "Feeds"; - } - if (!link.ContainsKey("controller")) { - link["controller"] = "Feed"; - } - if (!link.ContainsKey("action")) { - link["action"] = "Index"; - } - _links.Add(new Link { Title = title, RouteValues = link }); - } - - public void Register(string title, string format, string url) { - _links.Add(new Link { Title = title, Url = url }); - } - - public MvcHtmlString GetRegisteredLinks(HtmlHelper html) { - var urlHelper = new UrlHelper(html.ViewContext.RequestContext, html.RouteCollection); - - var sb = new StringBuilder(); - foreach (var link in _links) { - var linkUrl = String.IsNullOrWhiteSpace(link.Url) ? urlHelper.RouteUrl(link.RouteValues) : link.Url; - sb.Append("\r\n"); - sb.Append(@""); - } - - return MvcHtmlString.Create(sb.ToString()); - } - - //public ActionResult Execute(string format, IValueProvider values) { - - //} - } -} +using System; +using System.Collections.Generic; +using System.Text; +using System.Web.Mvc; +using System.Web.Routing; +using JetBrains.Annotations; + +namespace Orchard.Core.Feeds.Services { + [UsedImplicitly] + public class FeedManager : IFeedManager { + private readonly IList _links = new List(); + + class Link { + public string Title { get; set; } + public RouteValueDictionary RouteValues { get; set; } + public string Url { get; set; } + } + + public void Register(string title, string format, RouteValueDictionary values) { + var link = new RouteValueDictionary(values) { { "format", format } }; + if (!link.ContainsKey("area")) { + link["area"] = "Feeds"; + } + if (!link.ContainsKey("controller")) { + link["controller"] = "Feed"; + } + if (!link.ContainsKey("action")) { + link["action"] = "Index"; + } + _links.Add(new Link { Title = title, RouteValues = link }); + } + + public void Register(string title, string format, string url) { + _links.Add(new Link { Title = title, Url = url }); + } + + public MvcHtmlString GetRegisteredLinks(HtmlHelper html) { + var urlHelper = new UrlHelper(html.ViewContext.RequestContext, html.RouteCollection); + + var sb = new StringBuilder(); + foreach (var link in _links) { + var linkUrl = String.IsNullOrWhiteSpace(link.Url) ? urlHelper.RouteUrl(link.RouteValues) : link.Url; + sb.Append("\r\n"); + sb.Append(@""); + } + + return MvcHtmlString.Create(sb.ToString()); + } + + //public ActionResult Execute(string format, IValueProvider values) { + + //} + } +} diff --git a/src/Orchard.Web/Core/Feeds/StandardBuilders/CorePartsFeedItemBuilder.cs b/src/Orchard.Web/Core/Feeds/StandardBuilders/CorePartsFeedItemBuilder.cs index 4ef36c818ea..f14e5c4ea37 100644 --- a/src/Orchard.Web/Core/Feeds/StandardBuilders/CorePartsFeedItemBuilder.cs +++ b/src/Orchard.Web/Core/Feeds/StandardBuilders/CorePartsFeedItemBuilder.cs @@ -1,82 +1,82 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web.Mvc; -using System.Web.Routing; -using System.Xml.Linq; -using JetBrains.Annotations; -using Orchard.ContentManagement; -using Orchard.Core.Feeds.Models; -using Orchard.Mvc.Extensions; -using Orchard.Services; - -namespace Orchard.Core.Feeds.StandardBuilders { - [UsedImplicitly] - public class CorePartsFeedItemBuilder : IFeedItemBuilder { - private readonly IContentManager _contentManager; - private readonly RouteCollection _routes; - private readonly IEnumerable _htmlFilters; - - public CorePartsFeedItemBuilder( - IContentManager contentManager, - RouteCollection routes, - IEnumerable htmlFilters) { - _contentManager = contentManager; - _routes = routes; - _htmlFilters = htmlFilters; - } - - public void Populate(FeedContext context) { - foreach (var feedItem in context.Response.Items.OfType>()) { - - var inspector = new ItemInspector( - feedItem.Item, - _contentManager.GetItemMetadata(feedItem.Item), - _htmlFilters); - - // author is intentionally left empty as it could result in unwanted spam - - // add to known formats - if (context.Format == "rss") { - var link = new XElement("link"); - var guid = new XElement("guid", new XAttribute("isPermaLink", "true")); - - context.Response.Contextualize(requestContext => { - var urlHelper = new UrlHelper(requestContext, _routes); - var uriBuilder = new UriBuilder(urlHelper.MakeAbsolute("/")) { Path = urlHelper.RouteUrl(inspector.Link) }; - link.Add(uriBuilder.Uri.OriginalString); - guid.Add(uriBuilder.Uri.OriginalString); - }); - - feedItem.Element.SetElementValue("title", inspector.Title); - feedItem.Element.Add(link); - feedItem.Element.SetElementValue("description", inspector.Description); - - if ( inspector.PublishedUtc != null ) { - // RFC833 - // The "R" or "r" standard format specifier represents a custom date and time format string that is defined by - // the DateTimeFormatInfo.RFC1123Pattern property. The pattern reflects a defined standard, and the property - // is read-only. Therefore, it is always the same, regardless of the culture used or the format provider supplied. - // The custom format string is "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'". When this standard format specifier is used, - // the formatting or parsing operation always uses the invariant culture. - feedItem.Element.SetElementValue("pubDate", inspector.PublishedUtc.Value.ToString("r")); - } - - feedItem.Element.Add(guid); - } - else { - var feedItem1 = feedItem; - context.Response.Contextualize(requestContext => { - var urlHelper = new UrlHelper(requestContext, _routes); - context.Builder.AddProperty(context, feedItem1, "link", urlHelper.RouteUrl(inspector.Link)); - }); - context.Builder.AddProperty(context, feedItem, "title", inspector.Title); - context.Builder.AddProperty(context, feedItem, "description", inspector.Description); - - if (inspector.PublishedUtc != null) - context.Builder.AddProperty(context, feedItem, "published-date", Convert.ToString(inspector.PublishedUtc)); // format? cvt to generic T? - } - } - } - } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web.Mvc; +using System.Web.Routing; +using System.Xml.Linq; +using JetBrains.Annotations; +using Orchard.ContentManagement; +using Orchard.Core.Feeds.Models; +using Orchard.Mvc.Extensions; +using Orchard.Services; + +namespace Orchard.Core.Feeds.StandardBuilders { + [UsedImplicitly] + public class CorePartsFeedItemBuilder : IFeedItemBuilder { + private readonly IContentManager _contentManager; + private readonly RouteCollection _routes; + private readonly IEnumerable _htmlFilters; + + public CorePartsFeedItemBuilder( + IContentManager contentManager, + RouteCollection routes, + IEnumerable htmlFilters) { + _contentManager = contentManager; + _routes = routes; + _htmlFilters = htmlFilters; + } + + public void Populate(FeedContext context) { + foreach (var feedItem in context.Response.Items.OfType>()) { + + var inspector = new ItemInspector( + feedItem.Item, + _contentManager.GetItemMetadata(feedItem.Item), + _htmlFilters); + + // author is intentionally left empty as it could result in unwanted spam + + // add to known formats + if (context.Format == "rss") { + var link = new XElement("link"); + var guid = new XElement("guid", new XAttribute("isPermaLink", "true")); + + context.Response.Contextualize(requestContext => { + var urlHelper = new UrlHelper(requestContext, _routes); + var uriBuilder = new UriBuilder(urlHelper.MakeAbsolute("/")) { Path = urlHelper.RouteUrl(inspector.Link) }; + link.Add(uriBuilder.Uri.OriginalString); + guid.Add(uriBuilder.Uri.OriginalString); + }); + + feedItem.Element.SetElementValue("title", inspector.Title); + feedItem.Element.Add(link); + feedItem.Element.SetElementValue("description", inspector.Description); + + if ( inspector.PublishedUtc != null ) { + // RFC833 + // The "R" or "r" standard format specifier represents a custom date and time format string that is defined by + // the DateTimeFormatInfo.RFC1123Pattern property. The pattern reflects a defined standard, and the property + // is read-only. Therefore, it is always the same, regardless of the culture used or the format provider supplied. + // The custom format string is "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'". When this standard format specifier is used, + // the formatting or parsing operation always uses the invariant culture. + feedItem.Element.SetElementValue("pubDate", inspector.PublishedUtc.Value.ToString("r")); + } + + feedItem.Element.Add(guid); + } + else { + var feedItem1 = feedItem; + context.Response.Contextualize(requestContext => { + var urlHelper = new UrlHelper(requestContext, _routes); + context.Builder.AddProperty(context, feedItem1, "link", urlHelper.RouteUrl(inspector.Link)); + }); + context.Builder.AddProperty(context, feedItem, "title", inspector.Title); + context.Builder.AddProperty(context, feedItem, "description", inspector.Description); + + if (inspector.PublishedUtc != null) + context.Builder.AddProperty(context, feedItem, "published-date", Convert.ToString(inspector.PublishedUtc)); // format? cvt to generic T? + } + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Feeds/StandardBuilders/ItemInspector.cs b/src/Orchard.Web/Core/Feeds/StandardBuilders/ItemInspector.cs index 71a6bc7d494..a382c0fe849 100644 --- a/src/Orchard.Web/Core/Feeds/StandardBuilders/ItemInspector.cs +++ b/src/Orchard.Web/Core/Feeds/StandardBuilders/ItemInspector.cs @@ -1,74 +1,74 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web.Routing; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Aspects; -using Orchard.Core.Common.Models; -using Orchard.Core.Common.Settings; -using Orchard.Services; - -namespace Orchard.Core.Feeds.StandardBuilders { - public class ItemInspector { - private readonly IContent _item; - private readonly ContentItemMetadata _metadata; - private readonly IEnumerable _htmlFilters; - private readonly ICommonPart _common; - private readonly ITitleAspect _titleAspect; - private readonly BodyPart _body; - - public ItemInspector(IContent item, ContentItemMetadata metadata) : this(item, metadata, Enumerable.Empty()) {} - - public ItemInspector(IContent item, ContentItemMetadata metadata, IEnumerable htmlFilters) { - _item = item; - _metadata = metadata; - _htmlFilters = htmlFilters; - _common = item.Get(); - _titleAspect = item.Get(); - _body = item.Get(); - } - - public string Title { - get { - if (_metadata != null && !string.IsNullOrEmpty(_metadata.DisplayText)) - return _metadata.DisplayText; - if (_titleAspect != null && !string.IsNullOrEmpty(_titleAspect.Title)) - return _titleAspect.Title; - return _item.ContentItem.ContentType + " #" + _item.ContentItem.Id; - } - } - - public RouteValueDictionary Link { - get { - if (_metadata != null) { - return _metadata.DisplayRouteValues; - } - return null; - } - } - - public string Description { - get { - if (_body != null && !string.IsNullOrEmpty(_body.Text)) { - return _htmlFilters.Aggregate(_body.Text, (text, filter) => filter.ProcessContent(text, GetFlavor(_body))); - } - return Title; - } - } - - public DateTime? PublishedUtc { - get { - if (_common != null && _common.CreatedUtc != null) - return _common.CreatedUtc; - return null; - } - } - - private static string GetFlavor(BodyPart part) { - var typePartSettings = part.Settings.GetModel(); - return (typePartSettings != null && !string.IsNullOrWhiteSpace(typePartSettings.Flavor)) - ? typePartSettings.Flavor - : part.PartDefinition.Settings.GetModel().FlavorDefault; - } - } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web.Routing; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Aspects; +using Orchard.Core.Common.Models; +using Orchard.Core.Common.Settings; +using Orchard.Services; + +namespace Orchard.Core.Feeds.StandardBuilders { + public class ItemInspector { + private readonly IContent _item; + private readonly ContentItemMetadata _metadata; + private readonly IEnumerable _htmlFilters; + private readonly ICommonPart _common; + private readonly ITitleAspect _titleAspect; + private readonly BodyPart _body; + + public ItemInspector(IContent item, ContentItemMetadata metadata) : this(item, metadata, Enumerable.Empty()) {} + + public ItemInspector(IContent item, ContentItemMetadata metadata, IEnumerable htmlFilters) { + _item = item; + _metadata = metadata; + _htmlFilters = htmlFilters; + _common = item.Get(); + _titleAspect = item.Get(); + _body = item.Get(); + } + + public string Title { + get { + if (_metadata != null && !string.IsNullOrEmpty(_metadata.DisplayText)) + return _metadata.DisplayText; + if (_titleAspect != null && !string.IsNullOrEmpty(_titleAspect.Title)) + return _titleAspect.Title; + return _item.ContentItem.ContentType + " #" + _item.ContentItem.Id; + } + } + + public RouteValueDictionary Link { + get { + if (_metadata != null) { + return _metadata.DisplayRouteValues; + } + return null; + } + } + + public string Description { + get { + if (_body != null && !string.IsNullOrEmpty(_body.Text)) { + return _htmlFilters.Aggregate(_body.Text, (text, filter) => filter.ProcessContent(text, GetFlavor(_body))); + } + return Title; + } + } + + public DateTime? PublishedUtc { + get { + if (_common != null && _common.CreatedUtc != null) + return _common.CreatedUtc; + return null; + } + } + + private static string GetFlavor(BodyPart part) { + var typePartSettings = part.Settings.GetModel(); + return (typePartSettings != null && !string.IsNullOrWhiteSpace(typePartSettings.Flavor)) + ? typePartSettings.Flavor + : part.PartDefinition.Settings.GetModel().FlavorDefault; + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Feeds/StandardQueries/ContainerFeedQuery.cs b/src/Orchard.Web/Core/Feeds/StandardQueries/ContainerFeedQuery.cs index 6f43a82ca85..356924b31ff 100644 --- a/src/Orchard.Web/Core/Feeds/StandardQueries/ContainerFeedQuery.cs +++ b/src/Orchard.Web/Core/Feeds/StandardQueries/ContainerFeedQuery.cs @@ -1,92 +1,92 @@ -using System; -using System.Collections.Generic; -using System.Web.Mvc; -using System.Xml.Linq; -using JetBrains.Annotations; -using Orchard.ContentManagement; -using Orchard.Core.Common.Models; -using Orchard.Core.Feeds.Models; -using Orchard.Core.Feeds.StandardBuilders; -using Orchard.Mvc.Extensions; -using Orchard.Services; -using Orchard.Utility.Extensions; - -namespace Orchard.Core.Feeds.StandardQueries { - [UsedImplicitly] - public class ContainerFeedQuery : IFeedQueryProvider, IFeedQuery { - private readonly IContentManager _contentManager; - private readonly IEnumerable _htmlFilters; - - public ContainerFeedQuery(IContentManager contentManager, IEnumerable htmlFilters) { - _contentManager = contentManager; - _htmlFilters = htmlFilters; - } - - public FeedQueryMatch Match(FeedContext context) { - var containerIdValue = context.ValueProvider.GetValue("containerid"); - if (containerIdValue == null) - return null; - - var containerId = (int)containerIdValue.ConvertTo(typeof(int)); - var container = _contentManager.Get(containerId); - - if (container == null) { - return null; - } - - return new FeedQueryMatch { FeedQuery = this, Priority = -5 }; - } - - public void Execute(FeedContext context) { - var containerIdValue = context.ValueProvider.GetValue("containerid"); - if (containerIdValue == null) - return; - - var limitValue = context.ValueProvider.GetValue("limit"); - var limit = 20; - if (limitValue != null) { - Int32.TryParse(Convert.ToString(limitValue), out limit); - } - - limit = Math.Min(limit, 100); - - var containerId = (int)containerIdValue.ConvertTo(typeof(int)); - var container = _contentManager.Get(containerId); - - if (container == null) { - return; - } - - var inspector = new ItemInspector(container, _contentManager.GetItemMetadata(container), _htmlFilters); - if (context.Format == "rss") { - var link = new XElement("link"); - context.Response.Element.SetElementValue("title", inspector.Title); - context.Response.Element.Add(link); - context.Response.Element.SetElementValue("description", inspector.Description); - - context.Response.Contextualize(requestContext => { - var urlHelper = new UrlHelper(requestContext); - var uriBuilder = new UriBuilder(urlHelper.MakeAbsolute("/")) { Path = urlHelper.RouteUrl(inspector.Link) }; - link.Add(uriBuilder.Uri.OriginalString); - }); - } - else { - context.Builder.AddProperty(context, null, "title", inspector.Title); - context.Builder.AddProperty(context, null, "description", inspector.Description); - context.Response.Contextualize(requestContext => { - var urlHelper = new UrlHelper(requestContext); - context.Builder.AddProperty(context, null, "link",urlHelper.MakeAbsolute(urlHelper.RouteUrl(inspector.Link))); - }); - } - - var items = _contentManager.Query() - .Where(x => x.Container == container.Record) - .OrderByDescending(x => x.CreatedUtc) - .Slice(0, limit); - - foreach (var item in items) { - context.Builder.AddItem(context, item); - } - } - } +using System; +using System.Collections.Generic; +using System.Web.Mvc; +using System.Xml.Linq; +using JetBrains.Annotations; +using Orchard.ContentManagement; +using Orchard.Core.Common.Models; +using Orchard.Core.Feeds.Models; +using Orchard.Core.Feeds.StandardBuilders; +using Orchard.Mvc.Extensions; +using Orchard.Services; +using Orchard.Utility.Extensions; + +namespace Orchard.Core.Feeds.StandardQueries { + [UsedImplicitly] + public class ContainerFeedQuery : IFeedQueryProvider, IFeedQuery { + private readonly IContentManager _contentManager; + private readonly IEnumerable _htmlFilters; + + public ContainerFeedQuery(IContentManager contentManager, IEnumerable htmlFilters) { + _contentManager = contentManager; + _htmlFilters = htmlFilters; + } + + public FeedQueryMatch Match(FeedContext context) { + var containerIdValue = context.ValueProvider.GetValue("containerid"); + if (containerIdValue == null) + return null; + + var containerId = (int)containerIdValue.ConvertTo(typeof(int)); + var container = _contentManager.Get(containerId); + + if (container == null) { + return null; + } + + return new FeedQueryMatch { FeedQuery = this, Priority = -5 }; + } + + public void Execute(FeedContext context) { + var containerIdValue = context.ValueProvider.GetValue("containerid"); + if (containerIdValue == null) + return; + + var limitValue = context.ValueProvider.GetValue("limit"); + var limit = 20; + if (limitValue != null) { + Int32.TryParse(Convert.ToString(limitValue), out limit); + } + + limit = Math.Min(limit, 100); + + var containerId = (int)containerIdValue.ConvertTo(typeof(int)); + var container = _contentManager.Get(containerId); + + if (container == null) { + return; + } + + var inspector = new ItemInspector(container, _contentManager.GetItemMetadata(container), _htmlFilters); + if (context.Format == "rss") { + var link = new XElement("link"); + context.Response.Element.SetElementValue("title", inspector.Title); + context.Response.Element.Add(link); + context.Response.Element.SetElementValue("description", inspector.Description); + + context.Response.Contextualize(requestContext => { + var urlHelper = new UrlHelper(requestContext); + var uriBuilder = new UriBuilder(urlHelper.MakeAbsolute("/")) { Path = urlHelper.RouteUrl(inspector.Link) }; + link.Add(uriBuilder.Uri.OriginalString); + }); + } + else { + context.Builder.AddProperty(context, null, "title", inspector.Title); + context.Builder.AddProperty(context, null, "description", inspector.Description); + context.Response.Contextualize(requestContext => { + var urlHelper = new UrlHelper(requestContext); + context.Builder.AddProperty(context, null, "link",urlHelper.MakeAbsolute(urlHelper.RouteUrl(inspector.Link))); + }); + } + + var items = _contentManager.Query() + .Where(x => x.Container == container.Record) + .OrderByDescending(x => x.CreatedUtc) + .Slice(0, limit); + + foreach (var item in items) { + context.Builder.AddItem(context, item); + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/AdminMenu.cs b/src/Orchard.Web/Core/Navigation/AdminMenu.cs index d5366f8c1bb..e63c181fbad 100644 --- a/src/Orchard.Web/Core/Navigation/AdminMenu.cs +++ b/src/Orchard.Web/Core/Navigation/AdminMenu.cs @@ -1,36 +1,36 @@ -using Orchard.ContentManagement; -using Orchard.Localization; -using Orchard.UI.Navigation; -using System.Linq; - -namespace Orchard.Core.Navigation { - public class AdminMenu : INavigationProvider { - public Localizer T { get; set; } - public string MenuName { get { return "admin"; } } - - public IOrchardServices Services { get; set; } - - public AdminMenu(IOrchardServices services) { - Services = services; - } - - public void GetNavigation(NavigationBuilder builder) { - var user = Services.WorkContext.CurrentUser; - - // if the current user cannot manage menus, check if they can manage at least one - if (!Services.Authorizer.Authorize(Permissions.ManageMenus)) { - var menus = Services.ContentManager.Query("Menu").List(); - - if (!menus.Any(x => Services.Authorizer.Authorize(Permissions.ManageMenus, x))) { - return; - } - } - - builder.AddImageSet("navigation") - .Add(T("Navigation"), "7", - menu => menu - .Add(T("Main Menu"), "0", item => item.Action("Index", "Admin", new { area = "Navigation" }) - )); - } - } -} +using Orchard.ContentManagement; +using Orchard.Localization; +using Orchard.UI.Navigation; +using System.Linq; + +namespace Orchard.Core.Navigation { + public class AdminMenu : INavigationProvider { + public Localizer T { get; set; } + public string MenuName { get { return "admin"; } } + + public IOrchardServices Services { get; set; } + + public AdminMenu(IOrchardServices services) { + Services = services; + } + + public void GetNavigation(NavigationBuilder builder) { + var user = Services.WorkContext.CurrentUser; + + // if the current user cannot manage menus, check if they can manage at least one + if (!Services.Authorizer.Authorize(Permissions.ManageMenus)) { + var menus = Services.ContentManager.Query("Menu").List(); + + if (!menus.Any(x => Services.Authorizer.Authorize(Permissions.ManageMenus, x))) { + return; + } + } + + builder.AddImageSet("navigation") + .Add(T("Navigation"), "7", + menu => menu + .Add(T("Main Menu"), "0", item => item.Action("Index", "Admin", new { area = "Navigation" }) + )); + } + } +} diff --git a/src/Orchard.Web/Core/Navigation/Commands/MenuCommands.cs b/src/Orchard.Web/Core/Navigation/Commands/MenuCommands.cs index 413543daffa..0da06577229 100644 --- a/src/Orchard.Web/Core/Navigation/Commands/MenuCommands.cs +++ b/src/Orchard.Web/Core/Navigation/Commands/MenuCommands.cs @@ -1,91 +1,91 @@ -using System; -using Orchard.Commands; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Aspects; -using Orchard.Core.Navigation.Models; -using Orchard.Core.Navigation.Services; -using Orchard.Security; -using Orchard.Settings; - -namespace Orchard.Core.Navigation.Commands { - public class MenuCommands : DefaultOrchardCommandHandler { - private readonly IContentManager _contentManager; - private readonly IMenuService _menuService; - private readonly ISiteService _siteService; - private readonly IMembershipService _membershipService; - - public MenuCommands( - IContentManager contentManager, - IMenuService menuService, - ISiteService siteService, - IMembershipService membershipService) { - _contentManager = contentManager; - _menuService = menuService; - _siteService = siteService; - _membershipService = membershipService; - } - - [OrchardSwitch] - public string MenuPosition { get; set; } - - [OrchardSwitch] - public string Owner { get; set; } - - [OrchardSwitch] - public string MenuText { get; set; } - - [OrchardSwitch] - public string Url { get; set; } - - [OrchardSwitch] - public string MenuName { get; set; } - - [CommandName("menuitem create")] - [CommandHelp("menuitem create /MenuPosition: /MenuText: /Url: /MenuName: [/Owner:] \r\n\t" + "Creates a new menu item")] - [OrchardSwitches("MenuPosition,MenuText,Url,MenuName,Owner")] - public void Create() { - // flushes before doing a query in case a previous command created the menu - - var menu = _menuService.GetMenu(MenuName); - - if(menu == null) { - Context.Output.WriteLine(T("Menu not found.").Text); - return; - } - - var menuItem = _contentManager.Create("MenuItem"); - menuItem.As().MenuPosition = MenuPosition; - menuItem.As().MenuText = T(MenuText).ToString(); - menuItem.As().Menu = menu.ContentItem; - menuItem.As().Url = Url; - - if (String.IsNullOrEmpty(Owner)) { - Owner = _siteService.GetSiteSettings().SuperUser; - } - var owner = _membershipService.GetUser(Owner); - - if (owner == null) { - Context.Output.WriteLine(T("Invalid username: {0}", Owner)); - return; - } - - menuItem.As().Owner = owner; - - Context.Output.WriteLine(T("Menu item created successfully.").Text); - } - - [CommandName("menu create")] - [CommandHelp("menu create /MenuName:\r\n\t" + "Creates a new menu")] - [OrchardSwitches("MenuName")] - public void CreateMenu() { - if (string.IsNullOrWhiteSpace(MenuName)) { - Context.Output.WriteLine(T("Menu name can't be empty.").Text); - return; - } - - _menuService.Create(MenuName); - - Context.Output.WriteLine(T("Menu created successfully.").Text); - } - } +using System; +using Orchard.Commands; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Aspects; +using Orchard.Core.Navigation.Models; +using Orchard.Core.Navigation.Services; +using Orchard.Security; +using Orchard.Settings; + +namespace Orchard.Core.Navigation.Commands { + public class MenuCommands : DefaultOrchardCommandHandler { + private readonly IContentManager _contentManager; + private readonly IMenuService _menuService; + private readonly ISiteService _siteService; + private readonly IMembershipService _membershipService; + + public MenuCommands( + IContentManager contentManager, + IMenuService menuService, + ISiteService siteService, + IMembershipService membershipService) { + _contentManager = contentManager; + _menuService = menuService; + _siteService = siteService; + _membershipService = membershipService; + } + + [OrchardSwitch] + public string MenuPosition { get; set; } + + [OrchardSwitch] + public string Owner { get; set; } + + [OrchardSwitch] + public string MenuText { get; set; } + + [OrchardSwitch] + public string Url { get; set; } + + [OrchardSwitch] + public string MenuName { get; set; } + + [CommandName("menuitem create")] + [CommandHelp("menuitem create /MenuPosition: /MenuText: /Url: /MenuName: [/Owner:] \r\n\t" + "Creates a new menu item")] + [OrchardSwitches("MenuPosition,MenuText,Url,MenuName,Owner")] + public void Create() { + // flushes before doing a query in case a previous command created the menu + + var menu = _menuService.GetMenu(MenuName); + + if(menu == null) { + Context.Output.WriteLine(T("Menu not found.").Text); + return; + } + + var menuItem = _contentManager.Create("MenuItem"); + menuItem.As().MenuPosition = MenuPosition; + menuItem.As().MenuText = T(MenuText).ToString(); + menuItem.As().Menu = menu.ContentItem; + menuItem.As().Url = Url; + + if (String.IsNullOrEmpty(Owner)) { + Owner = _siteService.GetSiteSettings().SuperUser; + } + var owner = _membershipService.GetUser(Owner); + + if (owner == null) { + Context.Output.WriteLine(T("Invalid username: {0}", Owner)); + return; + } + + menuItem.As().Owner = owner; + + Context.Output.WriteLine(T("Menu item created successfully.").Text); + } + + [CommandName("menu create")] + [CommandHelp("menu create /MenuName:\r\n\t" + "Creates a new menu")] + [OrchardSwitches("MenuName")] + public void CreateMenu() { + if (string.IsNullOrWhiteSpace(MenuName)) { + Context.Output.WriteLine(T("Menu name can't be empty.").Text); + return; + } + + _menuService.Create(MenuName); + + Context.Output.WriteLine(T("Menu created successfully.").Text); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Controllers/AdminController.cs b/src/Orchard.Web/Core/Navigation/Controllers/AdminController.cs index 6ec840d8578..dd686ea335a 100644 --- a/src/Orchard.Web/Core/Navigation/Controllers/AdminController.cs +++ b/src/Orchard.Web/Core/Navigation/Controllers/AdminController.cs @@ -1,255 +1,255 @@ -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Web.Mvc; -using System.Web.Routing; -using Orchard.ContentManagement; -using Orchard.Core.Common.Models; -using Orchard.Core.Navigation.Models; -using Orchard.Core.Navigation.Services; -using Orchard.Core.Navigation.ViewModels; -using Orchard.Core.Title.Models; -using Orchard.Localization; -using Orchard.Mvc.Extensions; -using Orchard.UI; -using Orchard.UI.Notify; -using Orchard.UI.Navigation; -using Orchard.Utility; -using System; -using Orchard.Logging; -using Orchard.Exceptions; - -namespace Orchard.Core.Navigation.Controllers { - [ValidateInput(false)] - public class AdminController : Controller, IUpdateModel { - private readonly IMenuService _menuService; - private readonly INavigationManager _navigationManager; - private readonly IMenuManager _menuManager; - - public AdminController( - IOrchardServices orchardServices, - IMenuService menuService, - IMenuManager menuManager, - INavigationManager navigationManager) { - _menuService = menuService; - _menuManager = menuManager; - _navigationManager = navigationManager; - Services = orchardServices; - T = NullLocalizer.Instance; - Logger = NullLogger.Instance; - } - - public Localizer T { get; set; } - public ILogger Logger { get; set; } - public IOrchardServices Services { get; set; } - - public ActionResult Index(NavigationManagementViewModel model, int? menuId) { - var menus = Services.ContentManager.Query("Menu").List().ToList() - .OrderBy(x => x.ContentManager.GetItemMetadata(x).DisplayText); - - if (!menus.Any()) { - if (!Services.Authorizer.Authorize(Permissions.ManageMenus, T("Not allowed to manage menus"))) { - return new HttpUnauthorizedResult(); - } - - return RedirectToAction("Create", "Admin", new { area = "Contents", id = "Menu", returnUrl = Request.RawUrl }); - } - - var allowedMenus = menus.Where(menu => Services.Authorizer.Authorize(Permissions.ManageMenus, menu)).ToList(); - - if (!allowedMenus.Any()) { - return new HttpUnauthorizedResult(); - } - - IContent currentMenu = menuId == null - ? allowedMenus.FirstOrDefault() - : allowedMenus.FirstOrDefault(menu => menu.Id == menuId); - - if (currentMenu == null && menuId != null) { // incorrect menu id passed - return RedirectToAction("Index"); - } - - if (model == null) { - model = new NavigationManagementViewModel(); - } - - if (model.MenuItemEntries == null || !model.MenuItemEntries.Any()) { - model.MenuItemEntries = _menuService.GetMenuParts(currentMenu.Id).Select(CreateMenuItemEntries).OrderBy(menuPartEntry => menuPartEntry.Position, new FlatPositionComparer()).ToList(); - } - - model.MenuItemDescriptors = _menuManager.GetMenuItemTypes(); - model.Menus = allowedMenus; - model.CurrentMenu = currentMenu; - - // need action name as this action is referenced from another action - return View(model); - } - - [HttpPost, ActionName("Index")] - public ActionResult IndexPOST(IList menuItemEntries, int? menuId) { - if (!Services.Authorizer.Authorize(Permissions.ManageMenus, T("Couldn't manage the main menu"))) - return new HttpUnauthorizedResult(); - - // See http://orchard.codeplex.com/workitem/17116 - if (menuItemEntries != null) { - foreach (var menuItemEntry in menuItemEntries) { - MenuPart menuPart = _menuService.Get(menuItemEntry.MenuItemId); - menuPart.MenuPosition = menuItemEntry.Position; - } - } - - return RedirectToAction("Index", new { menuId }); - } - - private MenuItemEntry CreateMenuItemEntries(MenuPart menuPart) { - return new MenuItemEntry { - MenuItemId = menuPart.Id, - IsMenuItem = menuPart.Is(), - Text = menuPart.MenuText, - Position = menuPart.MenuPosition, - Url = menuPart.Is() - ? menuPart.As().Url - : _navigationManager.GetUrl(null, Services.ContentManager.GetItemMetadata(menuPart).DisplayRouteValues), - ContentItem = menuPart.ContentItem, - }; - } - - [HttpPost] - public ActionResult Delete(int id) { - if (!Services.Authorizer.Authorize(Permissions.ManageMenus, T("Couldn't manage the main menu"))) - return new HttpUnauthorizedResult(); - - MenuPart menuPart = _menuService.Get(id); - int? menuId = null; - - if (menuPart != null) { - menuId = menuPart.Menu.Id; - - // get all sub-menu items from the same menu - var menuItems = _menuService.GetMenuParts(menuPart.Menu.Id) - .Where(x => x.MenuPosition.StartsWith(menuPart.MenuPosition + ".")) - .Select(x => x.As()) - .ToList(); - - foreach (var menuItem in menuItems.Concat(new [] {menuPart})) { - // if the menu item is a concrete content item, don't delete it, just unreference the menu - if (!menuPart.ContentItem.TypeDefinition.Settings.ContainsKey("Stereotype") || menuPart.ContentItem.TypeDefinition.Settings["Stereotype"] != "MenuItem") { - menuPart.Menu = null; - } - else { - _menuService.Delete(menuItem); - } - } - - } - - return RedirectToAction("Index", new { menuId }); - } - - bool IUpdateModel.TryUpdateModel(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) { - return TryUpdateModel(model, prefix, includeProperties, excludeProperties); - } - - void IUpdateModel.AddModelError(string key, LocalizedString errorMessage) { - ModelState.AddModelError(key, errorMessage.ToString()); - } - - public ActionResult CreateMenuItem(string id, int menuId, string returnUrl, string parentMenuItemPosition = null) { - if (!Services.Authorizer.Authorize(Permissions.ManageMenus, _menuService.GetMenu(menuId), T("Couldn't manage the main menu"))) - return new HttpUnauthorizedResult(); - - // create a new temporary menu item - var menuPart = Services.ContentManager.New(id); - - if (menuPart == null) - return HttpNotFound(); - - // load the menu - var menu = Services.ContentManager.Get(menuId); - - if (menu == null) - return HttpNotFound(); - - try { - if (!String.IsNullOrEmpty(parentMenuItemPosition)) { - var menuEntries = _menuService.GetMenuParts(menuId).Select(CreateMenuItemEntries); - menuPart.MenuPosition = GetNextChildPosition(menuEntries, parentMenuItemPosition); - } - else { - // filter the content items for this specific menu - menuPart.MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu)); - } - - var model = Services.ContentManager.BuildEditor(menuPart); - - return View(model); - } - catch (Exception exception) { - if (exception.IsFatal()) { - throw; - } - - Logger.Error(T("Creating menu item failed: {0}", exception.Message).Text); - Services.Notifier.Error(T("Creating menu item failed: {0}", exception.Message)); - return this.RedirectLocal(returnUrl, () => RedirectToAction("Index")); - } - } - - [HttpPost, ActionName("CreateMenuItem")] - public ActionResult CreateMenuItemPost(string id, int menuId, string returnUrl, string parentMenuItemPosition = null) { - if (!Services.Authorizer.Authorize(Permissions.ManageMenus, _menuService.GetMenu(menuId), T("Couldn't manage the main menu"))) - return new HttpUnauthorizedResult(); - - var menuPart = Services.ContentManager.New(id); - - if (menuPart == null) - return HttpNotFound(); - - // load the menu - var menu = Services.ContentManager.Get(menuId); - - if (menu == null) - return HttpNotFound(); - - var model = Services.ContentManager.UpdateEditor(menuPart, this); - - if (!String.IsNullOrEmpty(parentMenuItemPosition)) { - var menuEntries = _menuService.GetMenuParts(menuId).Select(CreateMenuItemEntries); - menuPart.MenuPosition = GetNextChildPosition(menuEntries, parentMenuItemPosition); - } - else { - menuPart.MenuPosition = Position.GetNext( _navigationManager.BuildMenu(menu)); - } - - menuPart.Menu = menu; - Services.ContentManager.Create(menuPart); - - if (!ModelState.IsValid) { - Services.TransactionManager.Cancel(); - return View(model); - } - - Services.Notifier.Information(T("Your {0} has been added.", menuPart.TypeDefinition.DisplayName)); - - return this.RedirectLocal(returnUrl, () => RedirectToAction("Index")); - } - - private static string GetNextChildPosition(IEnumerable menuItems, string parentMenuItemPosition) { - var parentMenuItemPositionPlusDot = parentMenuItemPosition + "."; - var childElements = menuItems.Where(childElement => childElement.Position.StartsWith(parentMenuItemPositionPlusDot)); - if (childElements.Any()) { - var result = childElements - .Select(childElement => { - var positionParts = childElement.Position.Substring(parentMenuItemPositionPlusDot.Length).Split(new[] { '.' }, 2, StringSplitOptions.RemoveEmptyEntries); - - return positionParts.Any() ? int.Parse(positionParts[0]) : 0; - }) - .Max(); - - return parentMenuItemPositionPlusDot + (result + 1); - } - - return parentMenuItemPositionPlusDot + "1"; - } - } -} +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Web.Mvc; +using System.Web.Routing; +using Orchard.ContentManagement; +using Orchard.Core.Common.Models; +using Orchard.Core.Navigation.Models; +using Orchard.Core.Navigation.Services; +using Orchard.Core.Navigation.ViewModels; +using Orchard.Core.Title.Models; +using Orchard.Localization; +using Orchard.Mvc.Extensions; +using Orchard.UI; +using Orchard.UI.Notify; +using Orchard.UI.Navigation; +using Orchard.Utility; +using System; +using Orchard.Logging; +using Orchard.Exceptions; + +namespace Orchard.Core.Navigation.Controllers { + [ValidateInput(false)] + public class AdminController : Controller, IUpdateModel { + private readonly IMenuService _menuService; + private readonly INavigationManager _navigationManager; + private readonly IMenuManager _menuManager; + + public AdminController( + IOrchardServices orchardServices, + IMenuService menuService, + IMenuManager menuManager, + INavigationManager navigationManager) { + _menuService = menuService; + _menuManager = menuManager; + _navigationManager = navigationManager; + Services = orchardServices; + T = NullLocalizer.Instance; + Logger = NullLogger.Instance; + } + + public Localizer T { get; set; } + public ILogger Logger { get; set; } + public IOrchardServices Services { get; set; } + + public ActionResult Index(NavigationManagementViewModel model, int? menuId) { + var menus = Services.ContentManager.Query("Menu").List().ToList() + .OrderBy(x => x.ContentManager.GetItemMetadata(x).DisplayText); + + if (!menus.Any()) { + if (!Services.Authorizer.Authorize(Permissions.ManageMenus, T("Not allowed to manage menus"))) { + return new HttpUnauthorizedResult(); + } + + return RedirectToAction("Create", "Admin", new { area = "Contents", id = "Menu", returnUrl = Request.RawUrl }); + } + + var allowedMenus = menus.Where(menu => Services.Authorizer.Authorize(Permissions.ManageMenus, menu)).ToList(); + + if (!allowedMenus.Any()) { + return new HttpUnauthorizedResult(); + } + + IContent currentMenu = menuId == null + ? allowedMenus.FirstOrDefault() + : allowedMenus.FirstOrDefault(menu => menu.Id == menuId); + + if (currentMenu == null && menuId != null) { // incorrect menu id passed + return RedirectToAction("Index"); + } + + if (model == null) { + model = new NavigationManagementViewModel(); + } + + if (model.MenuItemEntries == null || !model.MenuItemEntries.Any()) { + model.MenuItemEntries = _menuService.GetMenuParts(currentMenu.Id).Select(CreateMenuItemEntries).OrderBy(menuPartEntry => menuPartEntry.Position, new FlatPositionComparer()).ToList(); + } + + model.MenuItemDescriptors = _menuManager.GetMenuItemTypes(); + model.Menus = allowedMenus; + model.CurrentMenu = currentMenu; + + // need action name as this action is referenced from another action + return View(model); + } + + [HttpPost, ActionName("Index")] + public ActionResult IndexPOST(IList menuItemEntries, int? menuId) { + if (!Services.Authorizer.Authorize(Permissions.ManageMenus, T("Couldn't manage the main menu"))) + return new HttpUnauthorizedResult(); + + // See http://orchard.codeplex.com/workitem/17116 + if (menuItemEntries != null) { + foreach (var menuItemEntry in menuItemEntries) { + MenuPart menuPart = _menuService.Get(menuItemEntry.MenuItemId); + menuPart.MenuPosition = menuItemEntry.Position; + } + } + + return RedirectToAction("Index", new { menuId }); + } + + private MenuItemEntry CreateMenuItemEntries(MenuPart menuPart) { + return new MenuItemEntry { + MenuItemId = menuPart.Id, + IsMenuItem = menuPart.Is(), + Text = menuPart.MenuText, + Position = menuPart.MenuPosition, + Url = menuPart.Is() + ? menuPart.As().Url + : _navigationManager.GetUrl(null, Services.ContentManager.GetItemMetadata(menuPart).DisplayRouteValues), + ContentItem = menuPart.ContentItem, + }; + } + + [HttpPost] + public ActionResult Delete(int id) { + if (!Services.Authorizer.Authorize(Permissions.ManageMenus, T("Couldn't manage the main menu"))) + return new HttpUnauthorizedResult(); + + MenuPart menuPart = _menuService.Get(id); + int? menuId = null; + + if (menuPart != null) { + menuId = menuPart.Menu.Id; + + // get all sub-menu items from the same menu + var menuItems = _menuService.GetMenuParts(menuPart.Menu.Id) + .Where(x => x.MenuPosition.StartsWith(menuPart.MenuPosition + ".")) + .Select(x => x.As()) + .ToList(); + + foreach (var menuItem in menuItems.Concat(new [] {menuPart})) { + // if the menu item is a concrete content item, don't delete it, just unreference the menu + if (!menuPart.ContentItem.TypeDefinition.Settings.ContainsKey("Stereotype") || menuPart.ContentItem.TypeDefinition.Settings["Stereotype"] != "MenuItem") { + menuPart.Menu = null; + } + else { + _menuService.Delete(menuItem); + } + } + + } + + return RedirectToAction("Index", new { menuId }); + } + + bool IUpdateModel.TryUpdateModel(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) { + return TryUpdateModel(model, prefix, includeProperties, excludeProperties); + } + + void IUpdateModel.AddModelError(string key, LocalizedString errorMessage) { + ModelState.AddModelError(key, errorMessage.ToString()); + } + + public ActionResult CreateMenuItem(string id, int menuId, string returnUrl, string parentMenuItemPosition = null) { + if (!Services.Authorizer.Authorize(Permissions.ManageMenus, _menuService.GetMenu(menuId), T("Couldn't manage the main menu"))) + return new HttpUnauthorizedResult(); + + // create a new temporary menu item + var menuPart = Services.ContentManager.New(id); + + if (menuPart == null) + return HttpNotFound(); + + // load the menu + var menu = Services.ContentManager.Get(menuId); + + if (menu == null) + return HttpNotFound(); + + try { + if (!String.IsNullOrEmpty(parentMenuItemPosition)) { + var menuEntries = _menuService.GetMenuParts(menuId).Select(CreateMenuItemEntries); + menuPart.MenuPosition = GetNextChildPosition(menuEntries, parentMenuItemPosition); + } + else { + // filter the content items for this specific menu + menuPart.MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu)); + } + + var model = Services.ContentManager.BuildEditor(menuPart); + + return View(model); + } + catch (Exception exception) { + if (exception.IsFatal()) { + throw; + } + + Logger.Error(T("Creating menu item failed: {0}", exception.Message).Text); + Services.Notifier.Error(T("Creating menu item failed: {0}", exception.Message)); + return this.RedirectLocal(returnUrl, () => RedirectToAction("Index")); + } + } + + [HttpPost, ActionName("CreateMenuItem")] + public ActionResult CreateMenuItemPost(string id, int menuId, string returnUrl, string parentMenuItemPosition = null) { + if (!Services.Authorizer.Authorize(Permissions.ManageMenus, _menuService.GetMenu(menuId), T("Couldn't manage the main menu"))) + return new HttpUnauthorizedResult(); + + var menuPart = Services.ContentManager.New(id); + + if (menuPart == null) + return HttpNotFound(); + + // load the menu + var menu = Services.ContentManager.Get(menuId); + + if (menu == null) + return HttpNotFound(); + + var model = Services.ContentManager.UpdateEditor(menuPart, this); + + if (!String.IsNullOrEmpty(parentMenuItemPosition)) { + var menuEntries = _menuService.GetMenuParts(menuId).Select(CreateMenuItemEntries); + menuPart.MenuPosition = GetNextChildPosition(menuEntries, parentMenuItemPosition); + } + else { + menuPart.MenuPosition = Position.GetNext( _navigationManager.BuildMenu(menu)); + } + + menuPart.Menu = menu; + Services.ContentManager.Create(menuPart); + + if (!ModelState.IsValid) { + Services.TransactionManager.Cancel(); + return View(model); + } + + Services.Notifier.Information(T("Your {0} has been added.", menuPart.TypeDefinition.DisplayName)); + + return this.RedirectLocal(returnUrl, () => RedirectToAction("Index")); + } + + private static string GetNextChildPosition(IEnumerable menuItems, string parentMenuItemPosition) { + var parentMenuItemPositionPlusDot = parentMenuItemPosition + "."; + var childElements = menuItems.Where(childElement => childElement.Position.StartsWith(parentMenuItemPositionPlusDot)); + if (childElements.Any()) { + var result = childElements + .Select(childElement => { + var positionParts = childElement.Position.Substring(parentMenuItemPositionPlusDot.Length).Split(new[] { '.' }, 2, StringSplitOptions.RemoveEmptyEntries); + + return positionParts.Any() ? int.Parse(positionParts[0]) : 0; + }) + .Max(); + + return parentMenuItemPositionPlusDot + (result + 1); + } + + return parentMenuItemPositionPlusDot + "1"; + } + } +} diff --git a/src/Orchard.Web/Core/Navigation/Drivers/AdminMenuPartDriver.cs b/src/Orchard.Web/Core/Navigation/Drivers/AdminMenuPartDriver.cs index 38b824a5b60..fff936b8356 100644 --- a/src/Orchard.Web/Core/Navigation/Drivers/AdminMenuPartDriver.cs +++ b/src/Orchard.Web/Core/Navigation/Drivers/AdminMenuPartDriver.cs @@ -1,100 +1,100 @@ -using System; -using JetBrains.Annotations; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Drivers; -using Orchard.Core.Navigation.Models; -using Orchard.Core.Navigation.Settings; -using Orchard.Localization; -using Orchard.Security; -using Orchard.UI.Navigation; -using Orchard.Utility; - -namespace Orchard.Core.Navigation.Drivers { - [UsedImplicitly] - public class AdminMenuPartDriver : ContentPartDriver { - private readonly IAuthorizationService _authorizationService; - private readonly INavigationManager _navigationManager; - private readonly IOrchardServices _orchardServices; - - public AdminMenuPartDriver(IAuthorizationService authorizationService, INavigationManager navigationManager, IOrchardServices orchardServices) { - _authorizationService = authorizationService; - _navigationManager = navigationManager; - _orchardServices = orchardServices; - T = NullLocalizer.Instance; - } - - public Localizer T { get; set; } - - private string GetDefaultPosition(ContentPart part) { - var settings = part.Settings.GetModel(); - var defaultPosition = settings == null ? "" : settings.DefaultPosition; - var adminMenu = _navigationManager.BuildMenu("admin"); - if (!string.IsNullOrEmpty(defaultPosition)) { - int major; - return int.TryParse(defaultPosition, out major) ? Position.GetNextMinor(major, adminMenu) : defaultPosition; - } - return Position.GetNext(adminMenu); - } - - protected override DriverResult Editor(AdminMenuPart part, dynamic shapeHelper) { - // todo: we need a 'ManageAdminMenu' too? - if (!_authorizationService.TryCheckAccess(Permissions.ManageMenus, _orchardServices.WorkContext.CurrentUser, part)) { - return null; - } - - if (string.IsNullOrEmpty(part.AdminMenuPosition)) { - part.AdminMenuPosition = GetDefaultPosition(part); - } - - return ContentShape("Parts_Navigation_AdminMenu_Edit", - () => shapeHelper.EditorTemplate(TemplateName: "Parts.Navigation.AdminMenu.Edit", Model: part, Prefix: Prefix)); - } - - protected override DriverResult Editor(AdminMenuPart part, IUpdateModel updater, dynamic shapeHelper) { - if (!_authorizationService.TryCheckAccess(Permissions.ManageMenus, _orchardServices.WorkContext.CurrentUser, part)) - return null; - - updater.TryUpdateModel(part, Prefix, null, null); - - if (part.OnAdminMenu) { - if (string.IsNullOrEmpty(part.AdminMenuText)) { - updater.AddModelError("AdminMenuText", T("The AdminMenuText field is required")); - } - - if (string.IsNullOrEmpty(part.AdminMenuPosition)) { - part.AdminMenuPosition = GetDefaultPosition(part); - } - } - else { - part.AdminMenuPosition = ""; - } - - return Editor(part, shapeHelper); - } - - protected override void Importing(AdminMenuPart part, ContentManagement.Handlers.ImportContentContext context) { - // Don't do anything if the tag is not specified. - if (context.Data.Element(part.PartDefinition.Name) == null) { - return; - } - - context.ImportAttribute(part.PartDefinition.Name, "AdminMenuText", adminMenuText => - part.AdminMenuText = adminMenuText - ); - - context.ImportAttribute(part.PartDefinition.Name, "AdminMenuPosition", position => - part.AdminMenuPosition = position - ); - - context.ImportAttribute(part.PartDefinition.Name, "OnAdminMenu", onAdminMenu => - part.OnAdminMenu = Convert.ToBoolean(onAdminMenu) - ); - } - - protected override void Exporting(AdminMenuPart part, ContentManagement.Handlers.ExportContentContext context) { - context.Element(part.PartDefinition.Name).SetAttributeValue("AdminMenuText", part.AdminMenuText); - context.Element(part.PartDefinition.Name).SetAttributeValue("AdminMenuPosition", part.AdminMenuPosition); - context.Element(part.PartDefinition.Name).SetAttributeValue("OnAdminMenu", part.OnAdminMenu); - } - } +using System; +using JetBrains.Annotations; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Drivers; +using Orchard.Core.Navigation.Models; +using Orchard.Core.Navigation.Settings; +using Orchard.Localization; +using Orchard.Security; +using Orchard.UI.Navigation; +using Orchard.Utility; + +namespace Orchard.Core.Navigation.Drivers { + [UsedImplicitly] + public class AdminMenuPartDriver : ContentPartDriver { + private readonly IAuthorizationService _authorizationService; + private readonly INavigationManager _navigationManager; + private readonly IOrchardServices _orchardServices; + + public AdminMenuPartDriver(IAuthorizationService authorizationService, INavigationManager navigationManager, IOrchardServices orchardServices) { + _authorizationService = authorizationService; + _navigationManager = navigationManager; + _orchardServices = orchardServices; + T = NullLocalizer.Instance; + } + + public Localizer T { get; set; } + + private string GetDefaultPosition(ContentPart part) { + var settings = part.Settings.GetModel(); + var defaultPosition = settings == null ? "" : settings.DefaultPosition; + var adminMenu = _navigationManager.BuildMenu("admin"); + if (!string.IsNullOrEmpty(defaultPosition)) { + int major; + return int.TryParse(defaultPosition, out major) ? Position.GetNextMinor(major, adminMenu) : defaultPosition; + } + return Position.GetNext(adminMenu); + } + + protected override DriverResult Editor(AdminMenuPart part, dynamic shapeHelper) { + // todo: we need a 'ManageAdminMenu' too? + if (!_authorizationService.TryCheckAccess(Permissions.ManageMenus, _orchardServices.WorkContext.CurrentUser, part)) { + return null; + } + + if (string.IsNullOrEmpty(part.AdminMenuPosition)) { + part.AdminMenuPosition = GetDefaultPosition(part); + } + + return ContentShape("Parts_Navigation_AdminMenu_Edit", + () => shapeHelper.EditorTemplate(TemplateName: "Parts.Navigation.AdminMenu.Edit", Model: part, Prefix: Prefix)); + } + + protected override DriverResult Editor(AdminMenuPart part, IUpdateModel updater, dynamic shapeHelper) { + if (!_authorizationService.TryCheckAccess(Permissions.ManageMenus, _orchardServices.WorkContext.CurrentUser, part)) + return null; + + updater.TryUpdateModel(part, Prefix, null, null); + + if (part.OnAdminMenu) { + if (string.IsNullOrEmpty(part.AdminMenuText)) { + updater.AddModelError("AdminMenuText", T("The AdminMenuText field is required")); + } + + if (string.IsNullOrEmpty(part.AdminMenuPosition)) { + part.AdminMenuPosition = GetDefaultPosition(part); + } + } + else { + part.AdminMenuPosition = ""; + } + + return Editor(part, shapeHelper); + } + + protected override void Importing(AdminMenuPart part, ContentManagement.Handlers.ImportContentContext context) { + // Don't do anything if the tag is not specified. + if (context.Data.Element(part.PartDefinition.Name) == null) { + return; + } + + context.ImportAttribute(part.PartDefinition.Name, "AdminMenuText", adminMenuText => + part.AdminMenuText = adminMenuText + ); + + context.ImportAttribute(part.PartDefinition.Name, "AdminMenuPosition", position => + part.AdminMenuPosition = position + ); + + context.ImportAttribute(part.PartDefinition.Name, "OnAdminMenu", onAdminMenu => + part.OnAdminMenu = Convert.ToBoolean(onAdminMenu) + ); + } + + protected override void Exporting(AdminMenuPart part, ContentManagement.Handlers.ExportContentContext context) { + context.Element(part.PartDefinition.Name).SetAttributeValue("AdminMenuText", part.AdminMenuText); + context.Element(part.PartDefinition.Name).SetAttributeValue("AdminMenuPosition", part.AdminMenuPosition); + context.Element(part.PartDefinition.Name).SetAttributeValue("OnAdminMenu", part.OnAdminMenu); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Drivers/MenuItemPartDriver.cs b/src/Orchard.Web/Core/Navigation/Drivers/MenuItemPartDriver.cs index c9d846dd6da..966bd459014 100644 --- a/src/Orchard.Web/Core/Navigation/Drivers/MenuItemPartDriver.cs +++ b/src/Orchard.Web/Core/Navigation/Drivers/MenuItemPartDriver.cs @@ -1,54 +1,54 @@ -using JetBrains.Annotations; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Drivers; -using Orchard.Core.Navigation.Models; -using Orchard.Security; - -namespace Orchard.Core.Navigation.Drivers { - [UsedImplicitly] - public class MenuItemPartDriver : ContentPartDriver { - private readonly IAuthorizationService _authorizationService; - private readonly IWorkContextAccessor _workContextAccessor; - - public MenuItemPartDriver(IAuthorizationService authorizationService, IWorkContextAccessor workContextAccessor) { - _authorizationService = authorizationService; - _workContextAccessor = workContextAccessor; - } - - protected override DriverResult Editor(MenuItemPart part, dynamic shapeHelper) { - var currentUser = _workContextAccessor.GetContext().CurrentUser; - if (!_authorizationService.TryCheckAccess(Permissions.ManageMenus, currentUser, part)) - return null; - - return ContentShape("Parts_MenuItem_Edit", - () => shapeHelper.EditorTemplate(TemplateName: "Parts.MenuItem.Edit", Model: part, Prefix: Prefix)); - } - - protected override DriverResult Editor(MenuItemPart part, IUpdateModel updater, dynamic shapeHelper) { - var currentUser = _workContextAccessor.GetContext().CurrentUser; - if (!_authorizationService.TryCheckAccess(Permissions.ManageMenus, currentUser, part)) - return null; - - if (updater != null) { - updater.TryUpdateModel(part, Prefix, null, null); - } - - return Editor(part, shapeHelper); - } - - protected override void Importing(MenuItemPart part, ContentManagement.Handlers.ImportContentContext context) { - // Don't do anything if the tag is not specified. - if (context.Data.Element(part.PartDefinition.Name) == null) { - return; - } - - context.ImportAttribute(part.PartDefinition.Name, "Url", url => - part.Url = url - ); - } - - protected override void Exporting(MenuItemPart part, ContentManagement.Handlers.ExportContentContext context) { - context.Element(part.PartDefinition.Name).SetAttributeValue("Url", part.Url); - } - } +using JetBrains.Annotations; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Drivers; +using Orchard.Core.Navigation.Models; +using Orchard.Security; + +namespace Orchard.Core.Navigation.Drivers { + [UsedImplicitly] + public class MenuItemPartDriver : ContentPartDriver { + private readonly IAuthorizationService _authorizationService; + private readonly IWorkContextAccessor _workContextAccessor; + + public MenuItemPartDriver(IAuthorizationService authorizationService, IWorkContextAccessor workContextAccessor) { + _authorizationService = authorizationService; + _workContextAccessor = workContextAccessor; + } + + protected override DriverResult Editor(MenuItemPart part, dynamic shapeHelper) { + var currentUser = _workContextAccessor.GetContext().CurrentUser; + if (!_authorizationService.TryCheckAccess(Permissions.ManageMenus, currentUser, part)) + return null; + + return ContentShape("Parts_MenuItem_Edit", + () => shapeHelper.EditorTemplate(TemplateName: "Parts.MenuItem.Edit", Model: part, Prefix: Prefix)); + } + + protected override DriverResult Editor(MenuItemPart part, IUpdateModel updater, dynamic shapeHelper) { + var currentUser = _workContextAccessor.GetContext().CurrentUser; + if (!_authorizationService.TryCheckAccess(Permissions.ManageMenus, currentUser, part)) + return null; + + if (updater != null) { + updater.TryUpdateModel(part, Prefix, null, null); + } + + return Editor(part, shapeHelper); + } + + protected override void Importing(MenuItemPart part, ContentManagement.Handlers.ImportContentContext context) { + // Don't do anything if the tag is not specified. + if (context.Data.Element(part.PartDefinition.Name) == null) { + return; + } + + context.ImportAttribute(part.PartDefinition.Name, "Url", url => + part.Url = url + ); + } + + protected override void Exporting(MenuItemPart part, ContentManagement.Handlers.ExportContentContext context) { + context.Element(part.PartDefinition.Name).SetAttributeValue("Url", part.Url); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Drivers/MenuPartDriver.cs b/src/Orchard.Web/Core/Navigation/Drivers/MenuPartDriver.cs index e9d5b48ef00..bad41e9debb 100644 --- a/src/Orchard.Web/Core/Navigation/Drivers/MenuPartDriver.cs +++ b/src/Orchard.Web/Core/Navigation/Drivers/MenuPartDriver.cs @@ -1,120 +1,120 @@ -using System.Linq; -using JetBrains.Annotations; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Drivers; -using Orchard.Core.Navigation.Models; -using Orchard.Core.Navigation.Services; -using Orchard.Core.Navigation.ViewModels; -using Orchard.Localization; -using Orchard.Security; -using Orchard.UI.Navigation; -using Orchard.Utility; - -namespace Orchard.Core.Navigation.Drivers { - [UsedImplicitly] - public class MenuPartDriver : ContentPartDriver { - private readonly IAuthorizationService _authorizationService; - private readonly INavigationManager _navigationManager; - private readonly IOrchardServices _orchardServices; - private readonly IMenuService _menuService; - - public MenuPartDriver( - IAuthorizationService authorizationService, - INavigationManager navigationManager, - IOrchardServices orchardServices, - IMenuService menuService) { - _authorizationService = authorizationService; - _navigationManager = navigationManager; - _orchardServices = orchardServices; - _menuService = menuService; - T = NullLocalizer.Instance; - } - - public Localizer T { get; set; } - - protected override string Prefix { - get { - return "MenuPart"; - } - } - - protected override DriverResult Editor(MenuPart part, dynamic shapeHelper) { - var allowedMenus = _menuService.GetMenus().Where(menu => _authorizationService.TryCheckAccess(Permissions.ManageMenus, _orchardServices.WorkContext.CurrentUser, menu)).ToList(); - - if (!allowedMenus.Any()) - return null; - - return ContentShape("Parts_Navigation_Menu_Edit", () => { - var model = new MenuPartViewModel { - CurrentMenuId = part.Menu == null ? -1 : part.Menu.Id, - ContentItem = part.ContentItem, - Menus = allowedMenus, - OnMenu = part.Menu != null, - MenuText = part.MenuText - }; - - return shapeHelper.EditorTemplate(TemplateName: "Parts.Navigation.Menu.Edit", Model: model, Prefix: Prefix); - }); - } - - protected override DriverResult Editor(MenuPart part, IUpdateModel updater, dynamic shapeHelper) { - var model = new MenuPartViewModel(); - - if(updater.TryUpdateModel(model, Prefix, null, null)) { - var menu = model.OnMenu ? _orchardServices.ContentManager.Get(model.CurrentMenuId) : null; - - if (!_authorizationService.TryCheckAccess(Permissions.ManageMenus, _orchardServices.WorkContext.CurrentUser, menu)) - return null; - - part.MenuText = model.MenuText; - part.Menu = menu; - - if (string.IsNullOrEmpty(part.MenuPosition) && menu != null) { - part.MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu)); - - if (string.IsNullOrEmpty(part.MenuText)) { - updater.AddModelError("MenuText", T("The MenuText field is required")); - } - } - } - - return Editor(part, shapeHelper); - } - - protected override void Importing(MenuPart part, ContentManagement.Handlers.ImportContentContext context) { - // Don't do anything if the tag is not specified. - if (context.Data.Element(part.PartDefinition.Name) == null) { - return; - } - - context.ImportAttribute(part.PartDefinition.Name, "MenuText", menuText => - part.MenuText = menuText - ); - - context.ImportAttribute(part.PartDefinition.Name, "MenuPosition", position => - part.MenuPosition = position - ); - - context.ImportAttribute(part.PartDefinition.Name, "Menu", menuIdentity => { - var menu = context.GetItemFromSession(menuIdentity); - if (menu != null) { - part.Menu = menu; - } - }); - } - - protected override void Exporting(MenuPart part, ContentManagement.Handlers.ExportContentContext context) { - // is it on a menu ? - if(part.Menu == null) { - return; - } - - var menu = _orchardServices.ContentManager.Get(part.Menu.Id); - var menuIdentity = _orchardServices.ContentManager.GetItemMetadata(menu).Identity; - context.Element(part.PartDefinition.Name).SetAttributeValue("Menu", menuIdentity); - - context.Element(part.PartDefinition.Name).SetAttributeValue("MenuText", part.MenuText); - context.Element(part.PartDefinition.Name).SetAttributeValue("MenuPosition", part.MenuPosition); - } - } +using System.Linq; +using JetBrains.Annotations; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Drivers; +using Orchard.Core.Navigation.Models; +using Orchard.Core.Navigation.Services; +using Orchard.Core.Navigation.ViewModels; +using Orchard.Localization; +using Orchard.Security; +using Orchard.UI.Navigation; +using Orchard.Utility; + +namespace Orchard.Core.Navigation.Drivers { + [UsedImplicitly] + public class MenuPartDriver : ContentPartDriver { + private readonly IAuthorizationService _authorizationService; + private readonly INavigationManager _navigationManager; + private readonly IOrchardServices _orchardServices; + private readonly IMenuService _menuService; + + public MenuPartDriver( + IAuthorizationService authorizationService, + INavigationManager navigationManager, + IOrchardServices orchardServices, + IMenuService menuService) { + _authorizationService = authorizationService; + _navigationManager = navigationManager; + _orchardServices = orchardServices; + _menuService = menuService; + T = NullLocalizer.Instance; + } + + public Localizer T { get; set; } + + protected override string Prefix { + get { + return "MenuPart"; + } + } + + protected override DriverResult Editor(MenuPart part, dynamic shapeHelper) { + var allowedMenus = _menuService.GetMenus().Where(menu => _authorizationService.TryCheckAccess(Permissions.ManageMenus, _orchardServices.WorkContext.CurrentUser, menu)).ToList(); + + if (!allowedMenus.Any()) + return null; + + return ContentShape("Parts_Navigation_Menu_Edit", () => { + var model = new MenuPartViewModel { + CurrentMenuId = part.Menu == null ? -1 : part.Menu.Id, + ContentItem = part.ContentItem, + Menus = allowedMenus, + OnMenu = part.Menu != null, + MenuText = part.MenuText + }; + + return shapeHelper.EditorTemplate(TemplateName: "Parts.Navigation.Menu.Edit", Model: model, Prefix: Prefix); + }); + } + + protected override DriverResult Editor(MenuPart part, IUpdateModel updater, dynamic shapeHelper) { + var model = new MenuPartViewModel(); + + if(updater.TryUpdateModel(model, Prefix, null, null)) { + var menu = model.OnMenu ? _orchardServices.ContentManager.Get(model.CurrentMenuId) : null; + + if (!_authorizationService.TryCheckAccess(Permissions.ManageMenus, _orchardServices.WorkContext.CurrentUser, menu)) + return null; + + part.MenuText = model.MenuText; + part.Menu = menu; + + if (string.IsNullOrEmpty(part.MenuPosition) && menu != null) { + part.MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu)); + + if (string.IsNullOrEmpty(part.MenuText)) { + updater.AddModelError("MenuText", T("The MenuText field is required")); + } + } + } + + return Editor(part, shapeHelper); + } + + protected override void Importing(MenuPart part, ContentManagement.Handlers.ImportContentContext context) { + // Don't do anything if the tag is not specified. + if (context.Data.Element(part.PartDefinition.Name) == null) { + return; + } + + context.ImportAttribute(part.PartDefinition.Name, "MenuText", menuText => + part.MenuText = menuText + ); + + context.ImportAttribute(part.PartDefinition.Name, "MenuPosition", position => + part.MenuPosition = position + ); + + context.ImportAttribute(part.PartDefinition.Name, "Menu", menuIdentity => { + var menu = context.GetItemFromSession(menuIdentity); + if (menu != null) { + part.Menu = menu; + } + }); + } + + protected override void Exporting(MenuPart part, ContentManagement.Handlers.ExportContentContext context) { + // is it on a menu ? + if(part.Menu == null) { + return; + } + + var menu = _orchardServices.ContentManager.Get(part.Menu.Id); + var menuIdentity = _orchardServices.ContentManager.GetItemMetadata(menu).Identity; + context.Element(part.PartDefinition.Name).SetAttributeValue("Menu", menuIdentity); + + context.Element(part.PartDefinition.Name).SetAttributeValue("MenuText", part.MenuText); + context.Element(part.PartDefinition.Name).SetAttributeValue("MenuPosition", part.MenuPosition); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Drivers/MenuWidgetPartDriver.cs b/src/Orchard.Web/Core/Navigation/Drivers/MenuWidgetPartDriver.cs index a23114ed7a9..2fc5e399a54 100644 --- a/src/Orchard.Web/Core/Navigation/Drivers/MenuWidgetPartDriver.cs +++ b/src/Orchard.Web/Core/Navigation/Drivers/MenuWidgetPartDriver.cs @@ -1,221 +1,221 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Drivers; -using Orchard.ContentManagement.Handlers; -using Orchard.Core.Navigation.Models; -using Orchard.Core.Navigation.Services; -using Orchard.Core.Navigation.ViewModels; -using Orchard.Core.Title.Models; -using Orchard.Localization; -using Orchard.UI.Navigation; -using Orchard.Utility.Extensions; - -namespace Orchard.Core.Navigation.Drivers { - public class MenuWidgetPartDriver : ContentPartDriver { - private readonly IContentManager _contentManager; - private readonly INavigationManager _navigationManager; - private readonly IWorkContextAccessor _workContextAccessor; - private readonly IMenuService _menuService; - - public MenuWidgetPartDriver( - IContentManager contentManager, - INavigationManager navigationManager, - IWorkContextAccessor workContextAccessor, - IMenuService menuService) { - _contentManager = contentManager; - _navigationManager = navigationManager; - _workContextAccessor = workContextAccessor; - _menuService = menuService; - T = NullLocalizer.Instance; - } - - public Localizer T { get; set; } - - protected override string Prefix { - get { - return "MenuWidget"; - } - } - - protected override DriverResult Display(MenuWidgetPart part, string displayType, dynamic shapeHelper) { - return ContentShape( "Parts_MenuWidget", () => { - var menu = _menuService.GetMenu(part.MenuContentItemId); - - if(menu == null) { - return null; - } - - var menuName = menu.As().Title.HtmlClassify(); - var currentCulture = _workContextAccessor.GetContext().CurrentCulture; - var menuItems = _navigationManager.BuildMenu(menu); - var localized = new List(); - foreach(var menuItem in menuItems) { - // if there is no associated content, it as culture neutral - if(menuItem.Content == null) { - localized.Add(menuItem); - } - - // if the menu item is culture neutral or of the current culture - else if (String.IsNullOrEmpty(menuItem.Culture) || String.Equals(menuItem.Culture, currentCulture, StringComparison.OrdinalIgnoreCase)) { - localized.Add(menuItem); - } - } - - menuItems = localized; - - var request = _workContextAccessor.GetContext().HttpContext.Request; - var routeData = request.RequestContext.RouteData; - var selectedPath = NavigationHelper.SetSelectedPath(menuItems, request, routeData); - var menuShape = shapeHelper.Menu(); - - if (part.Breadcrumb) { - menuItems = selectedPath ?? new Stack(); - foreach (var menuItem in menuItems) { - menuItem.Items = Enumerable.Empty(); - } - - // apply level limits to breadcrumb - menuItems = menuItems.Skip(part.StartLevel - 1); - if (part.Levels > 0) { - menuItems = menuItems.Take(part.Levels); - } - - var result = new List(menuItems); - - // inject the home page - if (part.AddHomePage) { - result.Insert(0, new MenuItem { - Href = _navigationManager.GetUrl("~/", null), - Text = T("Home") - }); - } - - // inject the current page - if (!part.AddCurrentPage && selectedPath != null) { - result.RemoveAt(result.Count - 1); - } - - // prevent the home page to be added as the home page and the current page - if (result.Count == 2 && String.Equals(result[0].Href, result[1].Href, StringComparison.OrdinalIgnoreCase)) { - result.RemoveAt(1); - } - - menuItems = result; - menuShape = shapeHelper.Breadcrumb(); - } - else { - var topLevelItems = menuItems.ToList(); - - // apply start level by pushing children as top level items. When the start level is - // greater than 1 (ie. below the top level), only menu items along the selected path - // will be displayed. - for (var i = 0; topLevelItems.Any() && i < part.StartLevel - 1; i++) { - var temp = new List(); - // should the menu be filtered on the currently displayed page ? - if (part.ShowFullMenu) { - foreach (var menuItem in topLevelItems) { - temp.AddRange(menuItem.Items); - } - } - else if (selectedPath != null) { - topLevelItems = topLevelItems.Intersect(selectedPath.Where(x => x.Selected)).ToList(); - foreach (var menuItem in topLevelItems) { - temp.AddRange(menuItem.Items); - } - } - topLevelItems = temp; - } - - // limit the number of levels to display (down from and including the start level) - if(part.Levels > 0) { - var current = topLevelItems.ToList(); - for (var i = 1; current.Any() && i < part.Levels; i++ ) { - var temp = new List(); - foreach (var menuItem in current) { - temp.AddRange(menuItem.Items); - } - current = temp; - } - // cut the sub-levels beneath any menu items that are at the lowest level being displayed - foreach (var menuItem in current) { - menuItem.Items = Enumerable.Empty(); - } - } - menuItems = topLevelItems; - } - - menuShape.MenuName(menuName); - menuShape.ContentItem(menu); - - NavigationHelper.PopulateMenu(shapeHelper, menuShape, menuShape, menuItems); - - return shapeHelper.Parts_MenuWidget(Menu: menuShape); - }); - } - - protected override DriverResult Editor(MenuWidgetPart part, dynamic shapeHelper) { - return ContentShape("Parts_MenuWidget_Edit", () => { - - var model = new MenuWidgetViewModel { - CurrentMenuId = part.MenuContentItemId, - StartLevel = part.StartLevel, - StopLevel = part.Levels, - Breadcrumb = part.Breadcrumb, - AddCurrentPage = part.AddCurrentPage, - AddHomePage = part.AddHomePage, - ShowFullMenu = part.ShowFullMenu, - Menus = _menuService.GetMenus(), - }; - - return shapeHelper.EditorTemplate(TemplateName: "Parts.MenuWidget.Edit", Model: model, Prefix: Prefix); - }); - } - - protected override DriverResult Editor(MenuWidgetPart part, IUpdateModel updater, dynamic shapeHelper) { - var model = new MenuWidgetViewModel(); - - if(updater.TryUpdateModel(model, Prefix, null, null)) { - part.StartLevel = model.StartLevel; - part.Levels = model.StopLevel; - part.Breadcrumb = model.Breadcrumb; - part.AddHomePage = model.AddHomePage; - part.AddCurrentPage = model.AddCurrentPage; - part.ShowFullMenu = model.ShowFullMenu; - part.MenuContentItemId = model.CurrentMenuId; - } - - return Editor(part, shapeHelper); - } - - protected override void Importing(MenuWidgetPart part, ImportContentContext context) { - // Don't do anything if the tag is not specified. - if (context.Data.Element(part.PartDefinition.Name) == null) { - return; - } - - context.ImportAttribute(part.PartDefinition.Name, "StartLevel", x => part.StartLevel = Convert.ToInt32(x)); - context.ImportAttribute(part.PartDefinition.Name, "Levels", x => part.Levels = Convert.ToInt32(x)); - context.ImportAttribute(part.PartDefinition.Name, "Breadcrumb", x => part.Breadcrumb = Convert.ToBoolean(x)); - context.ImportAttribute(part.PartDefinition.Name, "AddCurrentPage", x => part.AddCurrentPage = Convert.ToBoolean(x)); - context.ImportAttribute(part.PartDefinition.Name, "AddHomePage", x => part.AddHomePage = Convert.ToBoolean(x)); - context.ImportAttribute(part.PartDefinition.Name, "ShowFullMenu", x => part.ShowFullMenu = Convert.ToBoolean(x)); - - context.ImportAttribute(part.PartDefinition.Name, "Menu", x => part.MenuContentItemId = context.GetItemFromSession(x).Id); - } - - protected override void Exporting(MenuWidgetPart part, ExportContentContext context) { - var menuIdentity = _contentManager.GetItemMetadata(_contentManager.Get(part.MenuContentItemId)).Identity; - context.Element(part.PartDefinition.Name).SetAttributeValue("Menu", menuIdentity); - - context.Element(part.PartDefinition.Name).SetAttributeValue("StartLevel", part.StartLevel); - context.Element(part.PartDefinition.Name).SetAttributeValue("Levels", part.Levels); - context.Element(part.PartDefinition.Name).SetAttributeValue("Breadcrumb", part.Breadcrumb); - context.Element(part.PartDefinition.Name).SetAttributeValue("AddCurrentPage", part.AddCurrentPage); - context.Element(part.PartDefinition.Name).SetAttributeValue("AddHomePage", part.AddHomePage); - context.Element(part.PartDefinition.Name).SetAttributeValue("ShowFullMenu", part.ShowFullMenu); - } - - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Drivers; +using Orchard.ContentManagement.Handlers; +using Orchard.Core.Navigation.Models; +using Orchard.Core.Navigation.Services; +using Orchard.Core.Navigation.ViewModels; +using Orchard.Core.Title.Models; +using Orchard.Localization; +using Orchard.UI.Navigation; +using Orchard.Utility.Extensions; + +namespace Orchard.Core.Navigation.Drivers { + public class MenuWidgetPartDriver : ContentPartDriver { + private readonly IContentManager _contentManager; + private readonly INavigationManager _navigationManager; + private readonly IWorkContextAccessor _workContextAccessor; + private readonly IMenuService _menuService; + + public MenuWidgetPartDriver( + IContentManager contentManager, + INavigationManager navigationManager, + IWorkContextAccessor workContextAccessor, + IMenuService menuService) { + _contentManager = contentManager; + _navigationManager = navigationManager; + _workContextAccessor = workContextAccessor; + _menuService = menuService; + T = NullLocalizer.Instance; + } + + public Localizer T { get; set; } + + protected override string Prefix { + get { + return "MenuWidget"; + } + } + + protected override DriverResult Display(MenuWidgetPart part, string displayType, dynamic shapeHelper) { + return ContentShape( "Parts_MenuWidget", () => { + var menu = _menuService.GetMenu(part.MenuContentItemId); + + if(menu == null) { + return null; + } + + var menuName = menu.As().Title.HtmlClassify(); + var currentCulture = _workContextAccessor.GetContext().CurrentCulture; + var menuItems = _navigationManager.BuildMenu(menu); + var localized = new List(); + foreach(var menuItem in menuItems) { + // if there is no associated content, it as culture neutral + if(menuItem.Content == null) { + localized.Add(menuItem); + } + + // if the menu item is culture neutral or of the current culture + else if (String.IsNullOrEmpty(menuItem.Culture) || String.Equals(menuItem.Culture, currentCulture, StringComparison.OrdinalIgnoreCase)) { + localized.Add(menuItem); + } + } + + menuItems = localized; + + var request = _workContextAccessor.GetContext().HttpContext.Request; + var routeData = request.RequestContext.RouteData; + var selectedPath = NavigationHelper.SetSelectedPath(menuItems, request, routeData); + var menuShape = shapeHelper.Menu(); + + if (part.Breadcrumb) { + menuItems = selectedPath ?? new Stack(); + foreach (var menuItem in menuItems) { + menuItem.Items = Enumerable.Empty(); + } + + // apply level limits to breadcrumb + menuItems = menuItems.Skip(part.StartLevel - 1); + if (part.Levels > 0) { + menuItems = menuItems.Take(part.Levels); + } + + var result = new List(menuItems); + + // inject the home page + if (part.AddHomePage) { + result.Insert(0, new MenuItem { + Href = _navigationManager.GetUrl("~/", null), + Text = T("Home") + }); + } + + // inject the current page + if (!part.AddCurrentPage && selectedPath != null) { + result.RemoveAt(result.Count - 1); + } + + // prevent the home page to be added as the home page and the current page + if (result.Count == 2 && String.Equals(result[0].Href, result[1].Href, StringComparison.OrdinalIgnoreCase)) { + result.RemoveAt(1); + } + + menuItems = result; + menuShape = shapeHelper.Breadcrumb(); + } + else { + var topLevelItems = menuItems.ToList(); + + // apply start level by pushing children as top level items. When the start level is + // greater than 1 (ie. below the top level), only menu items along the selected path + // will be displayed. + for (var i = 0; topLevelItems.Any() && i < part.StartLevel - 1; i++) { + var temp = new List(); + // should the menu be filtered on the currently displayed page ? + if (part.ShowFullMenu) { + foreach (var menuItem in topLevelItems) { + temp.AddRange(menuItem.Items); + } + } + else if (selectedPath != null) { + topLevelItems = topLevelItems.Intersect(selectedPath.Where(x => x.Selected)).ToList(); + foreach (var menuItem in topLevelItems) { + temp.AddRange(menuItem.Items); + } + } + topLevelItems = temp; + } + + // limit the number of levels to display (down from and including the start level) + if(part.Levels > 0) { + var current = topLevelItems.ToList(); + for (var i = 1; current.Any() && i < part.Levels; i++ ) { + var temp = new List(); + foreach (var menuItem in current) { + temp.AddRange(menuItem.Items); + } + current = temp; + } + // cut the sub-levels beneath any menu items that are at the lowest level being displayed + foreach (var menuItem in current) { + menuItem.Items = Enumerable.Empty(); + } + } + menuItems = topLevelItems; + } + + menuShape.MenuName(menuName); + menuShape.ContentItem(menu); + + NavigationHelper.PopulateMenu(shapeHelper, menuShape, menuShape, menuItems); + + return shapeHelper.Parts_MenuWidget(Menu: menuShape); + }); + } + + protected override DriverResult Editor(MenuWidgetPart part, dynamic shapeHelper) { + return ContentShape("Parts_MenuWidget_Edit", () => { + + var model = new MenuWidgetViewModel { + CurrentMenuId = part.MenuContentItemId, + StartLevel = part.StartLevel, + StopLevel = part.Levels, + Breadcrumb = part.Breadcrumb, + AddCurrentPage = part.AddCurrentPage, + AddHomePage = part.AddHomePage, + ShowFullMenu = part.ShowFullMenu, + Menus = _menuService.GetMenus(), + }; + + return shapeHelper.EditorTemplate(TemplateName: "Parts.MenuWidget.Edit", Model: model, Prefix: Prefix); + }); + } + + protected override DriverResult Editor(MenuWidgetPart part, IUpdateModel updater, dynamic shapeHelper) { + var model = new MenuWidgetViewModel(); + + if(updater.TryUpdateModel(model, Prefix, null, null)) { + part.StartLevel = model.StartLevel; + part.Levels = model.StopLevel; + part.Breadcrumb = model.Breadcrumb; + part.AddHomePage = model.AddHomePage; + part.AddCurrentPage = model.AddCurrentPage; + part.ShowFullMenu = model.ShowFullMenu; + part.MenuContentItemId = model.CurrentMenuId; + } + + return Editor(part, shapeHelper); + } + + protected override void Importing(MenuWidgetPart part, ImportContentContext context) { + // Don't do anything if the tag is not specified. + if (context.Data.Element(part.PartDefinition.Name) == null) { + return; + } + + context.ImportAttribute(part.PartDefinition.Name, "StartLevel", x => part.StartLevel = Convert.ToInt32(x)); + context.ImportAttribute(part.PartDefinition.Name, "Levels", x => part.Levels = Convert.ToInt32(x)); + context.ImportAttribute(part.PartDefinition.Name, "Breadcrumb", x => part.Breadcrumb = Convert.ToBoolean(x)); + context.ImportAttribute(part.PartDefinition.Name, "AddCurrentPage", x => part.AddCurrentPage = Convert.ToBoolean(x)); + context.ImportAttribute(part.PartDefinition.Name, "AddHomePage", x => part.AddHomePage = Convert.ToBoolean(x)); + context.ImportAttribute(part.PartDefinition.Name, "ShowFullMenu", x => part.ShowFullMenu = Convert.ToBoolean(x)); + + context.ImportAttribute(part.PartDefinition.Name, "Menu", x => part.MenuContentItemId = context.GetItemFromSession(x).Id); + } + + protected override void Exporting(MenuWidgetPart part, ExportContentContext context) { + var menuIdentity = _contentManager.GetItemMetadata(_contentManager.Get(part.MenuContentItemId)).Identity; + context.Element(part.PartDefinition.Name).SetAttributeValue("Menu", menuIdentity); + + context.Element(part.PartDefinition.Name).SetAttributeValue("StartLevel", part.StartLevel); + context.Element(part.PartDefinition.Name).SetAttributeValue("Levels", part.Levels); + context.Element(part.PartDefinition.Name).SetAttributeValue("Breadcrumb", part.Breadcrumb); + context.Element(part.PartDefinition.Name).SetAttributeValue("AddCurrentPage", part.AddCurrentPage); + context.Element(part.PartDefinition.Name).SetAttributeValue("AddHomePage", part.AddHomePage); + context.Element(part.PartDefinition.Name).SetAttributeValue("ShowFullMenu", part.ShowFullMenu); + } + + } +} diff --git a/src/Orchard.Web/Core/Navigation/Drivers/ShapeMenuItemPartDriver.cs b/src/Orchard.Web/Core/Navigation/Drivers/ShapeMenuItemPartDriver.cs index 6ea36fdf515..61dd7cde077 100644 --- a/src/Orchard.Web/Core/Navigation/Drivers/ShapeMenuItemPartDriver.cs +++ b/src/Orchard.Web/Core/Navigation/Drivers/ShapeMenuItemPartDriver.cs @@ -1,52 +1,52 @@ -using System; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Drivers; -using Orchard.ContentManagement.Handlers; -using Orchard.Core.Navigation.Models; -using Orchard.Localization; - -namespace Orchard.Core.Navigation.Drivers { - public class ShapeMenuItemPartDriver : ContentPartDriver { - private const string TemplateName = "Parts.ShapeMenuItemPart.Edit"; - - public ShapeMenuItemPartDriver(IOrchardServices services) { - T = NullLocalizer.Instance; - Services = services; - } - - public Localizer T { get; set; } - public IOrchardServices Services { get; set; } - - protected override string Prefix { get { return "ShapeMenuItemPart"; } } - - protected override DriverResult Editor(ShapeMenuItemPart part, dynamic shapeHelper) { - return ContentShape("Parts_ShapeMenuItemPart_Edit", () => { - - return shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: part, Prefix: Prefix); - }); - } - - protected override DriverResult Editor(ShapeMenuItemPart part, IUpdateModel updater, dynamic shapeHelper) { - if (updater.TryUpdateModel(part, Prefix, null, null)) { - if (String.IsNullOrWhiteSpace(part.ShapeType)) { - updater.AddModelError("ShapeType", T("The Shape Type is mandatory.")); - } - } - - return Editor(part, shapeHelper); - } - - protected override void Importing(ShapeMenuItemPart part, ImportContentContext context) { - // Don't do anything if the tag is not specified. - if (context.Data.Element(part.PartDefinition.Name) == null) { - return; - } - - context.ImportAttribute(part.PartDefinition.Name, "ShapeType", x => part.ShapeType = x); - } - - protected override void Exporting(ShapeMenuItemPart part, ExportContentContext context) { - context.Element(part.PartDefinition.Name).SetAttributeValue("ShapeType", part.ShapeType); - } - } -} +using System; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Drivers; +using Orchard.ContentManagement.Handlers; +using Orchard.Core.Navigation.Models; +using Orchard.Localization; + +namespace Orchard.Core.Navigation.Drivers { + public class ShapeMenuItemPartDriver : ContentPartDriver { + private const string TemplateName = "Parts.ShapeMenuItemPart.Edit"; + + public ShapeMenuItemPartDriver(IOrchardServices services) { + T = NullLocalizer.Instance; + Services = services; + } + + public Localizer T { get; set; } + public IOrchardServices Services { get; set; } + + protected override string Prefix { get { return "ShapeMenuItemPart"; } } + + protected override DriverResult Editor(ShapeMenuItemPart part, dynamic shapeHelper) { + return ContentShape("Parts_ShapeMenuItemPart_Edit", () => { + + return shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: part, Prefix: Prefix); + }); + } + + protected override DriverResult Editor(ShapeMenuItemPart part, IUpdateModel updater, dynamic shapeHelper) { + if (updater.TryUpdateModel(part, Prefix, null, null)) { + if (String.IsNullOrWhiteSpace(part.ShapeType)) { + updater.AddModelError("ShapeType", T("The Shape Type is mandatory.")); + } + } + + return Editor(part, shapeHelper); + } + + protected override void Importing(ShapeMenuItemPart part, ImportContentContext context) { + // Don't do anything if the tag is not specified. + if (context.Data.Element(part.PartDefinition.Name) == null) { + return; + } + + context.ImportAttribute(part.PartDefinition.Name, "ShapeType", x => part.ShapeType = x); + } + + protected override void Exporting(ShapeMenuItemPart part, ExportContentContext context) { + context.Element(part.PartDefinition.Name).SetAttributeValue("ShapeType", part.ShapeType); + } + } +} diff --git a/src/Orchard.Web/Core/Navigation/Handlers/AdminMenuPartHandler.cs b/src/Orchard.Web/Core/Navigation/Handlers/AdminMenuPartHandler.cs index 3d7296da733..43078e6d514 100644 --- a/src/Orchard.Web/Core/Navigation/Handlers/AdminMenuPartHandler.cs +++ b/src/Orchard.Web/Core/Navigation/Handlers/AdminMenuPartHandler.cs @@ -1,19 +1,19 @@ -using System; -using JetBrains.Annotations; -using Orchard.ContentManagement.Handlers; -using Orchard.Core.Navigation.Models; -using Orchard.Data; - -namespace Orchard.Core.Navigation.Handlers { - [UsedImplicitly] - public class AdminMenuPartHandler : ContentHandler { - public AdminMenuPartHandler(IRepository menuPartRepository) { - Filters.Add(StorageFilter.For(menuPartRepository)); - - OnInitializing((ctx, x) => { - x.OnAdminMenu = false; - x.AdminMenuText = String.Empty; - }); - } - } +using System; +using JetBrains.Annotations; +using Orchard.ContentManagement.Handlers; +using Orchard.Core.Navigation.Models; +using Orchard.Data; + +namespace Orchard.Core.Navigation.Handlers { + [UsedImplicitly] + public class AdminMenuPartHandler : ContentHandler { + public AdminMenuPartHandler(IRepository menuPartRepository) { + Filters.Add(StorageFilter.For(menuPartRepository)); + + OnInitializing((ctx, x) => { + x.OnAdminMenu = false; + x.AdminMenuText = String.Empty; + }); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Handlers/MenuHandler.cs b/src/Orchard.Web/Core/Navigation/Handlers/MenuHandler.cs index c190b019b12..c3a876fbdb3 100644 --- a/src/Orchard.Web/Core/Navigation/Handlers/MenuHandler.cs +++ b/src/Orchard.Web/Core/Navigation/Handlers/MenuHandler.cs @@ -1,31 +1,31 @@ -using JetBrains.Annotations; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Handlers; -using Orchard.Core.Navigation.Services; -using Orchard.Core.Title.Models; - -namespace Orchard.Core.Navigation.Handlers { - [UsedImplicitly] - public class MenuHandler : ContentHandler { - private readonly IMenuService _menuService; - private readonly IContentManager _contentManager; - - public MenuHandler(IMenuService menuService, IContentManager contentManager) { - _menuService = menuService; - _contentManager = contentManager; - } - - protected override void Removing(RemoveContentContext context) { - if (context.ContentItem.ContentType != "Menu") { - return; - } - - // remove all menu items - var menuParts = _menuService.GetMenuParts(context.ContentItem.Id); - - foreach(var menuPart in menuParts) { - _contentManager.Remove(menuPart.ContentItem); - } - } - } +using JetBrains.Annotations; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Handlers; +using Orchard.Core.Navigation.Services; +using Orchard.Core.Title.Models; + +namespace Orchard.Core.Navigation.Handlers { + [UsedImplicitly] + public class MenuHandler : ContentHandler { + private readonly IMenuService _menuService; + private readonly IContentManager _contentManager; + + public MenuHandler(IMenuService menuService, IContentManager contentManager) { + _menuService = menuService; + _contentManager = contentManager; + } + + protected override void Removing(RemoveContentContext context) { + if (context.ContentItem.ContentType != "Menu") { + return; + } + + // remove all menu items + var menuParts = _menuService.GetMenuParts(context.ContentItem.Id); + + foreach(var menuPart in menuParts) { + _contentManager.Remove(menuPart.ContentItem); + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Handlers/MenuItemPartHandler.cs b/src/Orchard.Web/Core/Navigation/Handlers/MenuItemPartHandler.cs index 92cc8cffd26..88417e3a8b3 100644 --- a/src/Orchard.Web/Core/Navigation/Handlers/MenuItemPartHandler.cs +++ b/src/Orchard.Web/Core/Navigation/Handlers/MenuItemPartHandler.cs @@ -1,10 +1,10 @@ -using Orchard.Core.Navigation.Models; -using Orchard.ContentManagement.Handlers; - -namespace Orchard.Core.Navigation.Handlers { - public class MenuItemPartHandler : ContentHandler { - public MenuItemPartHandler() { - Filters.Add(new ActivatingFilter("MenuItem")); - } - } +using Orchard.Core.Navigation.Models; +using Orchard.ContentManagement.Handlers; + +namespace Orchard.Core.Navigation.Handlers { + public class MenuItemPartHandler : ContentHandler { + public MenuItemPartHandler() { + Filters.Add(new ActivatingFilter("MenuItem")); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Handlers/MenuPartHandler.cs b/src/Orchard.Web/Core/Navigation/Handlers/MenuPartHandler.cs index 479e0e691cf..e7d79951144 100644 --- a/src/Orchard.Web/Core/Navigation/Handlers/MenuPartHandler.cs +++ b/src/Orchard.Web/Core/Navigation/Handlers/MenuPartHandler.cs @@ -1,57 +1,57 @@ -using System; -using JetBrains.Annotations; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Handlers; -using Orchard.Core.Navigation.Models; -using Orchard.Data; - -namespace Orchard.Core.Navigation.Handlers { - [UsedImplicitly] - public class MenuPartHandler : ContentHandler { - private readonly IContentManager _contentManager; - - public MenuPartHandler( - IRepository menuPartRepository, - IContentManager contentManager - ) { - - _contentManager = contentManager; - Filters.Add(StorageFilter.For(menuPartRepository)); - - OnInitializing((ctx, x) => { - x.MenuText = String.Empty; - }); - - OnActivated(PropertySetHandlers); - } - - protected void PropertySetHandlers(ActivatedContentContext context, MenuPart menuPart) { - menuPart.MenuField.Setter(menu => { - if(menu == null || menu.ContentItem == null) { - menuPart.Record.MenuId = 0; - } - else { - menuPart.Record.MenuId = menu.ContentItem.Id; - } - - return menu; - }); - - menuPart.MenuField.Loader(ctx => - _contentManager.Get(menuPart.Record.MenuId, menuPart.IsPublished() ? VersionOptions.Published : VersionOptions.Latest) - ); - } - - protected override void GetItemMetadata(GetContentItemMetadataContext context) { - var part = context.ContentItem.As(); - - if (part != null) { - string stereotype; - if (context.ContentItem.TypeDefinition.Settings.TryGetValue("Stereotype", out stereotype) && stereotype == "MenuItem") { - context.Metadata.DisplayText = part.MenuText; - } - } - } - - } +using System; +using JetBrains.Annotations; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Handlers; +using Orchard.Core.Navigation.Models; +using Orchard.Data; + +namespace Orchard.Core.Navigation.Handlers { + [UsedImplicitly] + public class MenuPartHandler : ContentHandler { + private readonly IContentManager _contentManager; + + public MenuPartHandler( + IRepository menuPartRepository, + IContentManager contentManager + ) { + + _contentManager = contentManager; + Filters.Add(StorageFilter.For(menuPartRepository)); + + OnInitializing((ctx, x) => { + x.MenuText = String.Empty; + }); + + OnActivated(PropertySetHandlers); + } + + protected void PropertySetHandlers(ActivatedContentContext context, MenuPart menuPart) { + menuPart.MenuField.Setter(menu => { + if(menu == null || menu.ContentItem == null) { + menuPart.Record.MenuId = 0; + } + else { + menuPart.Record.MenuId = menu.ContentItem.Id; + } + + return menu; + }); + + menuPart.MenuField.Loader(ctx => + _contentManager.Get(menuPart.Record.MenuId, menuPart.IsPublished() ? VersionOptions.Published : VersionOptions.Latest) + ); + } + + protected override void GetItemMetadata(GetContentItemMetadataContext context) { + var part = context.ContentItem.As(); + + if (part != null) { + string stereotype; + if (context.ContentItem.TypeDefinition.Settings.TryGetValue("Stereotype", out stereotype) && stereotype == "MenuItem") { + context.Metadata.DisplayText = part.MenuText; + } + } + } + + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Handlers/MenuWidgetPartHandler.cs b/src/Orchard.Web/Core/Navigation/Handlers/MenuWidgetPartHandler.cs index 9cbc034dc2b..fb595469bdb 100644 --- a/src/Orchard.Web/Core/Navigation/Handlers/MenuWidgetPartHandler.cs +++ b/src/Orchard.Web/Core/Navigation/Handlers/MenuWidgetPartHandler.cs @@ -1,10 +1,10 @@ -using Orchard.ContentManagement.Handlers; -using Orchard.Core.Navigation.Models; - -namespace Orchard.Core.Navigation.Handlers { - public class MenuWidgetPartHandler : ContentHandler { - public MenuWidgetPartHandler() { - OnInitializing((context, part) => { part.StartLevel = 1; }); - } - } +using Orchard.ContentManagement.Handlers; +using Orchard.Core.Navigation.Models; + +namespace Orchard.Core.Navigation.Handlers { + public class MenuWidgetPartHandler : ContentHandler { + public MenuWidgetPartHandler() { + OnInitializing((context, part) => { part.StartLevel = 1; }); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Migrations.cs b/src/Orchard.Web/Core/Navigation/Migrations.cs index 7b4715d51c1..48f8918059c 100644 --- a/src/Orchard.Web/Core/Navigation/Migrations.cs +++ b/src/Orchard.Web/Core/Navigation/Migrations.cs @@ -1,181 +1,181 @@ -using Orchard.ContentManagement.MetaData; -using Orchard.Core.Contents.Extensions; -using Orchard.Data.Migration; - -namespace Orchard.Core.Navigation { - public class Migrations : DataMigrationImpl { - - public int Create() { - ContentDefinitionManager.AlterPartDefinition("MenuPart", builder => builder - .Attachable() - .WithDescription("Provides an easy way to create a ContentMenuItem from the content editor.")); - - SchemaBuilder.CreateTable("MenuPartRecord", - table => table - .ContentPartRecord() - .Column("MenuText") - .Column("MenuPosition") - .Column("MenuId") - ); - - ContentDefinitionManager.AlterTypeDefinition("MenuItem", cfg => cfg - .WithPart("MenuPart") - .WithPart("IdentityPart") - .WithPart("CommonPart") - .DisplayedAs("Custom Link") - .WithSetting("Description", "Represents a simple custom link with a text and an url.") - .WithSetting("Stereotype", "MenuItem") // because we declare a new stereotype, the Shape MenuItem_Edit is needed - ); - - ContentDefinitionManager.AlterTypeDefinition("Menu", cfg => cfg - .WithPart("CommonPart", p => p.WithSetting("OwnerEditorSettings.ShowOwnerEditor", "false")) - .WithPart("TitlePart") - ); - - ContentDefinitionManager.AlterTypeDefinition("MenuWidget", cfg => cfg - .WithPart("CommonPart") - .WithPart("IdentityPart") - .WithPart("WidgetPart") - .WithPart("MenuWidgetPart") - .WithSetting("Stereotype", "Widget") - ); - - SchemaBuilder.CreateTable("AdminMenuPartRecord", - table => table - .ContentPartRecord() - .Column("AdminMenuText") - .Column("AdminMenuPosition") - .Column("OnAdminMenu") - ); - - ContentDefinitionManager.AlterTypeDefinition("HtmlMenuItem", cfg => cfg - .WithPart("MenuPart") - .WithPart("BodyPart") - .WithPart("CommonPart") - .WithPart("IdentityPart") - .DisplayedAs("Html Menu Item") - .WithSetting("Description", "Renders some custom HTML in the menu.") - .WithSetting("BodyPartSettings.FlavorDefault", "html") - .WithSetting("Stereotype", "MenuItem") - ); - - ContentDefinitionManager.AlterPartDefinition("AdminMenuPart", builder => builder - .Attachable() - .WithDescription("Adds a menu item to the Admin menu that links to this content item.")); - - ContentDefinitionManager.AlterTypeDefinition("ShapeMenuItem", - cfg => cfg - .WithPart("ShapeMenuItemPart") - .WithPart("MenuPart") - .WithPart("CommonPart") - .DisplayedAs("Shape Link") - .WithSetting("Description", "Injects menu items from a Shape") - .WithSetting("Stereotype", "MenuItem") - ); - - return 4; - } - - public int UpdateFrom1() { - SchemaBuilder.CreateTable("AdminMenuPartRecord", - table => table - .ContentPartRecord() - .Column("AdminMenuText") - .Column("AdminMenuPosition") - .Column("OnAdminMenu") - ); - ContentDefinitionManager.AlterPartDefinition("AdminMenuPart", builder => builder.Attachable()); - return 2; - } - - public int UpdateFrom2() { - ContentDefinitionManager.AlterTypeDefinition("MenuItem", cfg => cfg - .WithPart("MenuPart") - .WithPart("CommonPart") - .WithPart("IdentityPart") - .DisplayedAs("Custom Link") - .WithSetting("Description", "Represents a simple custom link with a text and an url.") - .WithSetting("Stereotype", "MenuItem") // because we declare a new stereotype, the Shape MenuItem_Edit is needed - ); - - ContentDefinitionManager.AlterTypeDefinition("Menu", cfg => cfg - .WithPart("CommonPart") - .WithPart("TitlePart") - ); - - SchemaBuilder.CreateTable("MenuWidgetPartRecord",table => table - .ContentPartRecord() - .Column("StartLevel") - .Column("Levels") - .Column("Breadcrumb") - .Column("AddHomePage") - .Column("AddCurrentPage") - .Column("Menu_id") - ); - - ContentDefinitionManager.AlterTypeDefinition("MenuWidget", cfg => cfg - .WithPart("CommonPart") - .WithPart("IdentityPart") - .WithPart("WidgetPart") - .WithPart("MenuWidgetPart") - .WithSetting("Stereotype", "Widget") - ); - - SchemaBuilder - .AlterTable("MenuPartRecord", table => table.DropColumn("OnMainMenu")) - .AlterTable("MenuPartRecord", table => table.AddColumn("MenuId")) - ; - - ContentDefinitionManager.AlterTypeDefinition("HtmlMenuItem", cfg => cfg - .WithPart("MenuPart") - .WithPart("BodyPart") - .WithPart("CommonPart") - .WithPart("IdentityPart") - .DisplayedAs("Html Menu Item") - .WithSetting("Description", "Renders some custom HTML in the menu.") - .WithSetting("BodyPartSettings.FlavorDefault", "html") - .WithSetting("Stereotype", "MenuItem") - ); - - return 3; - } - - public int UpdateFrom3() { - SchemaBuilder.CreateTable("ShapeMenuItemPartRecord", - table => table.ContentPartRecord() - .Column("ShapeType") - ); - - ContentDefinitionManager.AlterTypeDefinition("ShapeMenuItem", - cfg => cfg - .WithPart("ShapeMenuItemPart") - .WithPart("MenuPart") - .WithPart("CommonPart") - .DisplayedAs("Shape Link") - .WithSetting("Description", "Injects menu items from a Shape") - .WithSetting("Stereotype", "MenuItem") - ); - - return 4; - } - - public int UpdateFrom4() { - ContentDefinitionManager.AlterPartDefinition("MenuPart", builder => builder - .WithDescription("Provides an easy way to create a ContentMenuItem from the content editor.")); - - ContentDefinitionManager.AlterPartDefinition("AdminMenuPart", builder => builder - .Attachable() - .WithDescription("Adds a menu item to the Admin menu that links to this content item.")); - - return 5; - } - - public int UpdateFrom5() { - ContentDefinitionManager.AlterTypeDefinition("Menu", cfg => cfg - .WithPart("IdentityPart") - ); - - return 6; - } - } +using Orchard.ContentManagement.MetaData; +using Orchard.Core.Contents.Extensions; +using Orchard.Data.Migration; + +namespace Orchard.Core.Navigation { + public class Migrations : DataMigrationImpl { + + public int Create() { + ContentDefinitionManager.AlterPartDefinition("MenuPart", builder => builder + .Attachable() + .WithDescription("Provides an easy way to create a ContentMenuItem from the content editor.")); + + SchemaBuilder.CreateTable("MenuPartRecord", + table => table + .ContentPartRecord() + .Column("MenuText") + .Column("MenuPosition") + .Column("MenuId") + ); + + ContentDefinitionManager.AlterTypeDefinition("MenuItem", cfg => cfg + .WithPart("MenuPart") + .WithPart("IdentityPart") + .WithPart("CommonPart") + .DisplayedAs("Custom Link") + .WithSetting("Description", "Represents a simple custom link with a text and an url.") + .WithSetting("Stereotype", "MenuItem") // because we declare a new stereotype, the Shape MenuItem_Edit is needed + ); + + ContentDefinitionManager.AlterTypeDefinition("Menu", cfg => cfg + .WithPart("CommonPart", p => p.WithSetting("OwnerEditorSettings.ShowOwnerEditor", "false")) + .WithPart("TitlePart") + ); + + ContentDefinitionManager.AlterTypeDefinition("MenuWidget", cfg => cfg + .WithPart("CommonPart") + .WithPart("IdentityPart") + .WithPart("WidgetPart") + .WithPart("MenuWidgetPart") + .WithSetting("Stereotype", "Widget") + ); + + SchemaBuilder.CreateTable("AdminMenuPartRecord", + table => table + .ContentPartRecord() + .Column("AdminMenuText") + .Column("AdminMenuPosition") + .Column("OnAdminMenu") + ); + + ContentDefinitionManager.AlterTypeDefinition("HtmlMenuItem", cfg => cfg + .WithPart("MenuPart") + .WithPart("BodyPart") + .WithPart("CommonPart") + .WithPart("IdentityPart") + .DisplayedAs("Html Menu Item") + .WithSetting("Description", "Renders some custom HTML in the menu.") + .WithSetting("BodyPartSettings.FlavorDefault", "html") + .WithSetting("Stereotype", "MenuItem") + ); + + ContentDefinitionManager.AlterPartDefinition("AdminMenuPart", builder => builder + .Attachable() + .WithDescription("Adds a menu item to the Admin menu that links to this content item.")); + + ContentDefinitionManager.AlterTypeDefinition("ShapeMenuItem", + cfg => cfg + .WithPart("ShapeMenuItemPart") + .WithPart("MenuPart") + .WithPart("CommonPart") + .DisplayedAs("Shape Link") + .WithSetting("Description", "Injects menu items from a Shape") + .WithSetting("Stereotype", "MenuItem") + ); + + return 4; + } + + public int UpdateFrom1() { + SchemaBuilder.CreateTable("AdminMenuPartRecord", + table => table + .ContentPartRecord() + .Column("AdminMenuText") + .Column("AdminMenuPosition") + .Column("OnAdminMenu") + ); + ContentDefinitionManager.AlterPartDefinition("AdminMenuPart", builder => builder.Attachable()); + return 2; + } + + public int UpdateFrom2() { + ContentDefinitionManager.AlterTypeDefinition("MenuItem", cfg => cfg + .WithPart("MenuPart") + .WithPart("CommonPart") + .WithPart("IdentityPart") + .DisplayedAs("Custom Link") + .WithSetting("Description", "Represents a simple custom link with a text and an url.") + .WithSetting("Stereotype", "MenuItem") // because we declare a new stereotype, the Shape MenuItem_Edit is needed + ); + + ContentDefinitionManager.AlterTypeDefinition("Menu", cfg => cfg + .WithPart("CommonPart") + .WithPart("TitlePart") + ); + + SchemaBuilder.CreateTable("MenuWidgetPartRecord",table => table + .ContentPartRecord() + .Column("StartLevel") + .Column("Levels") + .Column("Breadcrumb") + .Column("AddHomePage") + .Column("AddCurrentPage") + .Column("Menu_id") + ); + + ContentDefinitionManager.AlterTypeDefinition("MenuWidget", cfg => cfg + .WithPart("CommonPart") + .WithPart("IdentityPart") + .WithPart("WidgetPart") + .WithPart("MenuWidgetPart") + .WithSetting("Stereotype", "Widget") + ); + + SchemaBuilder + .AlterTable("MenuPartRecord", table => table.DropColumn("OnMainMenu")) + .AlterTable("MenuPartRecord", table => table.AddColumn("MenuId")) + ; + + ContentDefinitionManager.AlterTypeDefinition("HtmlMenuItem", cfg => cfg + .WithPart("MenuPart") + .WithPart("BodyPart") + .WithPart("CommonPart") + .WithPart("IdentityPart") + .DisplayedAs("Html Menu Item") + .WithSetting("Description", "Renders some custom HTML in the menu.") + .WithSetting("BodyPartSettings.FlavorDefault", "html") + .WithSetting("Stereotype", "MenuItem") + ); + + return 3; + } + + public int UpdateFrom3() { + SchemaBuilder.CreateTable("ShapeMenuItemPartRecord", + table => table.ContentPartRecord() + .Column("ShapeType") + ); + + ContentDefinitionManager.AlterTypeDefinition("ShapeMenuItem", + cfg => cfg + .WithPart("ShapeMenuItemPart") + .WithPart("MenuPart") + .WithPart("CommonPart") + .DisplayedAs("Shape Link") + .WithSetting("Description", "Injects menu items from a Shape") + .WithSetting("Stereotype", "MenuItem") + ); + + return 4; + } + + public int UpdateFrom4() { + ContentDefinitionManager.AlterPartDefinition("MenuPart", builder => builder + .WithDescription("Provides an easy way to create a ContentMenuItem from the content editor.")); + + ContentDefinitionManager.AlterPartDefinition("AdminMenuPart", builder => builder + .Attachable() + .WithDescription("Adds a menu item to the Admin menu that links to this content item.")); + + return 5; + } + + public int UpdateFrom5() { + ContentDefinitionManager.AlterTypeDefinition("Menu", cfg => cfg + .WithPart("IdentityPart") + ); + + return 6; + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Models/AdminMenuPart.cs b/src/Orchard.Web/Core/Navigation/Models/AdminMenuPart.cs index 1c7bd206168..a25f50ffd80 100644 --- a/src/Orchard.Web/Core/Navigation/Models/AdminMenuPart.cs +++ b/src/Orchard.Web/Core/Navigation/Models/AdminMenuPart.cs @@ -1,23 +1,23 @@ -using System.ComponentModel.DataAnnotations; -using Orchard.ContentManagement; - -namespace Orchard.Core.Navigation.Models { - public class AdminMenuPart : ContentPart { - - public bool OnAdminMenu { - get { return Record.OnAdminMenu; } - set { Record.OnAdminMenu = value; } - } - - [StringLength(AdminMenuPartRecord.DefaultMenuTextLength)] - public string AdminMenuText { - get { return Record.AdminMenuText; } - set { Record.AdminMenuText = value; } - } - - public string AdminMenuPosition { - get { return Record.AdminMenuPosition; } - set { Record.AdminMenuPosition = value; } - } - } +using System.ComponentModel.DataAnnotations; +using Orchard.ContentManagement; + +namespace Orchard.Core.Navigation.Models { + public class AdminMenuPart : ContentPart { + + public bool OnAdminMenu { + get { return Record.OnAdminMenu; } + set { Record.OnAdminMenu = value; } + } + + [StringLength(AdminMenuPartRecord.DefaultMenuTextLength)] + public string AdminMenuText { + get { return Record.AdminMenuText; } + set { Record.AdminMenuText = value; } + } + + public string AdminMenuPosition { + get { return Record.AdminMenuPosition; } + set { Record.AdminMenuPosition = value; } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Models/AdminMenuPartRecord.cs b/src/Orchard.Web/Core/Navigation/Models/AdminMenuPartRecord.cs index 69dec157b8e..60ee88dd4f6 100644 --- a/src/Orchard.Web/Core/Navigation/Models/AdminMenuPartRecord.cs +++ b/src/Orchard.Web/Core/Navigation/Models/AdminMenuPartRecord.cs @@ -1,13 +1,13 @@ -using System.ComponentModel.DataAnnotations; -using Orchard.ContentManagement.Records; - -namespace Orchard.Core.Navigation.Models { - public class AdminMenuPartRecord : ContentPartRecord { - public const ushort DefaultMenuTextLength = 255; - - [StringLength(DefaultMenuTextLength)] - public virtual string AdminMenuText { get; set; } - public virtual string AdminMenuPosition { get; set; } - public virtual bool OnAdminMenu { get; set; } - } +using System.ComponentModel.DataAnnotations; +using Orchard.ContentManagement.Records; + +namespace Orchard.Core.Navigation.Models { + public class AdminMenuPartRecord : ContentPartRecord { + public const ushort DefaultMenuTextLength = 255; + + [StringLength(DefaultMenuTextLength)] + public virtual string AdminMenuText { get; set; } + public virtual string AdminMenuPosition { get; set; } + public virtual bool OnAdminMenu { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Models/MenuItemPart.cs b/src/Orchard.Web/Core/Navigation/Models/MenuItemPart.cs index e26371568df..d5cd952a9ea 100644 --- a/src/Orchard.Web/Core/Navigation/Models/MenuItemPart.cs +++ b/src/Orchard.Web/Core/Navigation/Models/MenuItemPart.cs @@ -1,10 +1,10 @@ -using Orchard.ContentManagement; - -namespace Orchard.Core.Navigation.Models { - public class MenuItemPart : ContentPart { - public string Url { - get { return this.Retrieve(x => x.Url); } - set { this.Store(x => x.Url, value); } - } - } -} +using Orchard.ContentManagement; + +namespace Orchard.Core.Navigation.Models { + public class MenuItemPart : ContentPart { + public string Url { + get { return this.Retrieve(x => x.Url); } + set { this.Store(x => x.Url, value); } + } + } +} diff --git a/src/Orchard.Web/Core/Navigation/Models/MenuPart.cs b/src/Orchard.Web/Core/Navigation/Models/MenuPart.cs index 470edccab3e..68428431ab2 100644 --- a/src/Orchard.Web/Core/Navigation/Models/MenuPart.cs +++ b/src/Orchard.Web/Core/Navigation/Models/MenuPart.cs @@ -1,27 +1,27 @@ -using System.ComponentModel.DataAnnotations; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Utilities; - -namespace Orchard.Core.Navigation.Models { - public class MenuPart : ContentPart { - - private readonly LazyField _menu = new LazyField(); - public LazyField MenuField { get { return _menu; } } - - public IContent Menu { - get { return _menu.Value; } - set { _menu.Value = value; } - } - - [StringLength(MenuPartRecord.DefaultMenuTextLength)] - public string MenuText { - get { return Record.MenuText; } - set { Record.MenuText = value; } - } - - public string MenuPosition { - get { return Record.MenuPosition; } - set { Record.MenuPosition = value; } - } - } +using System.ComponentModel.DataAnnotations; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Utilities; + +namespace Orchard.Core.Navigation.Models { + public class MenuPart : ContentPart { + + private readonly LazyField _menu = new LazyField(); + public LazyField MenuField { get { return _menu; } } + + public IContent Menu { + get { return _menu.Value; } + set { _menu.Value = value; } + } + + [StringLength(MenuPartRecord.DefaultMenuTextLength)] + public string MenuText { + get { return Record.MenuText; } + set { Record.MenuText = value; } + } + + public string MenuPosition { + get { return Record.MenuPosition; } + set { Record.MenuPosition = value; } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Models/MenuPartRecord.cs b/src/Orchard.Web/Core/Navigation/Models/MenuPartRecord.cs index 04a73fac8af..25a2ead927f 100644 --- a/src/Orchard.Web/Core/Navigation/Models/MenuPartRecord.cs +++ b/src/Orchard.Web/Core/Navigation/Models/MenuPartRecord.cs @@ -1,13 +1,13 @@ -using System.ComponentModel.DataAnnotations; -using Orchard.ContentManagement.Records; - -namespace Orchard.Core.Navigation.Models { - public class MenuPartRecord : ContentPartRecord { - public const ushort DefaultMenuTextLength = 255; - - [StringLength(DefaultMenuTextLength)] - public virtual string MenuText { get; set; } - public virtual string MenuPosition { get; set; } - public virtual int MenuId { get; set; } - } +using System.ComponentModel.DataAnnotations; +using Orchard.ContentManagement.Records; + +namespace Orchard.Core.Navigation.Models { + public class MenuPartRecord : ContentPartRecord { + public const ushort DefaultMenuTextLength = 255; + + [StringLength(DefaultMenuTextLength)] + public virtual string MenuText { get; set; } + public virtual string MenuPosition { get; set; } + public virtual int MenuId { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Models/MenuWidgetPart.cs b/src/Orchard.Web/Core/Navigation/Models/MenuWidgetPart.cs index ec31b5ba9b3..c2706dc5896 100644 --- a/src/Orchard.Web/Core/Navigation/Models/MenuWidgetPart.cs +++ b/src/Orchard.Web/Core/Navigation/Models/MenuWidgetPart.cs @@ -1,41 +1,41 @@ -using Orchard.ContentManagement; - -namespace Orchard.Core.Navigation.Models { - public class MenuWidgetPart : ContentPart { - - public int StartLevel { - get { return this.Retrieve(x => x.StartLevel); } - set { this.Store(x => x.StartLevel, value); } - } - - public int Levels { - get { return this.Retrieve(x => x.Levels); } - set { this.Store(x => x.Levels, value); } - } - - public bool Breadcrumb { - get { return this.Retrieve(x => x.Breadcrumb); } - set { this.Store(x => x.Breadcrumb, value); } - } - - public bool AddHomePage { - get { return this.Retrieve(x => x.AddHomePage); } - set { this.Store(x => x.AddHomePage, value); } - } - - public bool AddCurrentPage { - get { return this.Retrieve(x => x.AddCurrentPage); } - set { this.Store(x => x.AddCurrentPage, value); } - } - - public int MenuContentItemId { - get { return this.Retrieve(x => x.MenuContentItemId); } - set { this.Store(x => x.MenuContentItemId, value); } - } - - public bool ShowFullMenu { - get { return this.Retrieve(x => x.ShowFullMenu); } - set { this.Store(x => x.ShowFullMenu, value); } - } - } +using Orchard.ContentManagement; + +namespace Orchard.Core.Navigation.Models { + public class MenuWidgetPart : ContentPart { + + public int StartLevel { + get { return this.Retrieve(x => x.StartLevel); } + set { this.Store(x => x.StartLevel, value); } + } + + public int Levels { + get { return this.Retrieve(x => x.Levels); } + set { this.Store(x => x.Levels, value); } + } + + public bool Breadcrumb { + get { return this.Retrieve(x => x.Breadcrumb); } + set { this.Store(x => x.Breadcrumb, value); } + } + + public bool AddHomePage { + get { return this.Retrieve(x => x.AddHomePage); } + set { this.Store(x => x.AddHomePage, value); } + } + + public bool AddCurrentPage { + get { return this.Retrieve(x => x.AddCurrentPage); } + set { this.Store(x => x.AddCurrentPage, value); } + } + + public int MenuContentItemId { + get { return this.Retrieve(x => x.MenuContentItemId); } + set { this.Store(x => x.MenuContentItemId, value); } + } + + public bool ShowFullMenu { + get { return this.Retrieve(x => x.ShowFullMenu); } + set { this.Store(x => x.ShowFullMenu, value); } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Models/ShapeMenuItemPart.cs b/src/Orchard.Web/Core/Navigation/Models/ShapeMenuItemPart.cs index f26f7e3180a..52b3907d1e1 100644 --- a/src/Orchard.Web/Core/Navigation/Models/ShapeMenuItemPart.cs +++ b/src/Orchard.Web/Core/Navigation/Models/ShapeMenuItemPart.cs @@ -1,13 +1,13 @@ -using Orchard.ContentManagement; - -namespace Orchard.Core.Navigation.Models { - public class ShapeMenuItemPart : ContentPart { - /// - /// Maximum number of items to retrieve from db - /// - public string ShapeType { - get { return this.Retrieve(x => x.ShapeType); } - set { this.Store(x => x.ShapeType, value); } - } - } +using Orchard.ContentManagement; + +namespace Orchard.Core.Navigation.Models { + public class ShapeMenuItemPart : ContentPart { + /// + /// Maximum number of items to retrieve from db + /// + public string ShapeType { + get { return this.Retrieve(x => x.ShapeType); } + set { this.Store(x => x.ShapeType, value); } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Module.txt b/src/Orchard.Web/Core/Navigation/Module.txt index 4c6e277470b..1cbd685f09f 100644 --- a/src/Orchard.Web/Core/Navigation/Module.txt +++ b/src/Orchard.Web/Core/Navigation/Module.txt @@ -1,10 +1,10 @@ -Name: Navigation -AntiForgery: enabled -Author: The Orchard Team -Website: http://orchardproject.net -Version: 1.9.2 -OrchardVersion: 1.9 -Description: The navigation module creates and manages a simple navigation menu for the front-end of the application and allows you to add content items to the admin menu. -FeatureDescription: Menu management. -Category: Core -Dependencies: Title +Name: Navigation +AntiForgery: enabled +Author: The Orchard Team +Website: http://orchardproject.net +Version: 1.9.2 +OrchardVersion: 1.9 +Description: The navigation module creates and manages a simple navigation menu for the front-end of the application and allows you to add content items to the admin menu. +FeatureDescription: Menu management. +Category: Core +Dependencies: Title diff --git a/src/Orchard.Web/Core/Navigation/Permissions.cs b/src/Orchard.Web/Core/Navigation/Permissions.cs index 25cf1d30f5c..b5e0faeb5bc 100644 --- a/src/Orchard.Web/Core/Navigation/Permissions.cs +++ b/src/Orchard.Web/Core/Navigation/Permissions.cs @@ -1,26 +1,26 @@ -using System.Collections.Generic; -using Orchard.Environment.Extensions.Models; -using Orchard.Security.Permissions; - -namespace Orchard.Core.Navigation { - public class Permissions : IPermissionProvider { - public static readonly Permission ManageMenus = new Permission { Name = "ManageMenus", Description = "Manage all menus" }; - - public virtual Feature Feature { get; set; } - - public IEnumerable GetPermissions() { - return new[] { - ManageMenus - }; - } - - public IEnumerable GetDefaultStereotypes() { - return new[] { - new PermissionStereotype { - Name = "Administrator", - Permissions = new[] {ManageMenus} - } - }; - } - } -} +using System.Collections.Generic; +using Orchard.Environment.Extensions.Models; +using Orchard.Security.Permissions; + +namespace Orchard.Core.Navigation { + public class Permissions : IPermissionProvider { + public static readonly Permission ManageMenus = new Permission { Name = "ManageMenus", Description = "Manage all menus" }; + + public virtual Feature Feature { get; set; } + + public IEnumerable GetPermissions() { + return new[] { + ManageMenus + }; + } + + public IEnumerable GetDefaultStereotypes() { + return new[] { + new PermissionStereotype { + Name = "Administrator", + Permissions = new[] {ManageMenus} + } + }; + } + } +} diff --git a/src/Orchard.Web/Core/Navigation/Placement.info b/src/Orchard.Web/Core/Navigation/Placement.info index 6e80ebf01e1..1d3235a62ef 100644 --- a/src/Orchard.Web/Core/Navigation/Placement.info +++ b/src/Orchard.Web/Core/Navigation/Placement.info @@ -1,8 +1,8 @@ - - - - - - - + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Scripts/Web.config b/src/Orchard.Web/Core/Navigation/Scripts/Web.config index 74c71f22bd5..11135c33761 100644 --- a/src/Orchard.Web/Core/Navigation/Scripts/Web.config +++ b/src/Orchard.Web/Core/Navigation/Scripts/Web.config @@ -1,16 +1,16 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Navigation/Scripts/jquery.mjs.nestedSortable.js b/src/Orchard.Web/Core/Navigation/Scripts/jquery.mjs.nestedSortable.js index 36abba32edc..22a481f950f 100644 --- a/src/Orchard.Web/Core/Navigation/Scripts/jquery.mjs.nestedSortable.js +++ b/src/Orchard.Web/Core/Navigation/Scripts/jquery.mjs.nestedSortable.js @@ -1,400 +1,400 @@ -/* -* jQuery UI Nested Sortable -* v 1.4 / 30 dec 2011 -* http://mjsarfatti.com/code/nestedSortable -* -* Depends on: -* jquery.ui.sortable.js 1.8+ -* -* Copyright (c) 2010-2012 Manuele J Sarfatti -* Licensed under the MIT License -* http://www.opensource.org/licenses/mit-license.php -*/ - -(function ($) { - - $.widget("mjs.nestedSortable", $.extend({}, $.ui.sortable.prototype, { - - options: { - tabSize: 20, - disableNesting: 'mjs-nestedSortable-no-nesting', - errorClass: 'mjs-nestedSortable-error', - listType: 'ol', - maxLevels: 0, - protectRoot: false, - rootID: null, - rtl: false, - isAllowed: function (item, parent) { return true; } - }, - - _create: function () { - this.element.data('sortable', this.element.data('nestedSortable')); - - if (!this.element.is(this.options.listType)) - throw new Error('nestedSortable: Please check the listType option is set to your actual list type'); - - return $.ui.sortable.prototype._create.apply(this, arguments); - }, - - destroy: function () { - this.element - .removeData("nestedSortable") - .unbind(".nestedSortable"); - return $.ui.sortable.prototype.destroy.apply(this, arguments); - }, - - _mouseDrag: function (event) { - - //Compute the helpers position - this.position = this._generatePosition(event); - this.positionAbs = this._convertPositionTo("absolute"); - - if (!this.lastPositionAbs) { - this.lastPositionAbs = this.positionAbs; - } - - //Do scrolling - if (this.options.scroll) { - var o = this.options, scrolled = false; - if (this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') { - - if ((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) - this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed; - else if (event.pageY - this.overflowOffset.top < o.scrollSensitivity) - this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed; - - if ((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) - this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed; - else if (event.pageX - this.overflowOffset.left < o.scrollSensitivity) - this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed; - - } else { - - if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) - scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); - else if ($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) - scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); - - if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) - scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); - else if ($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) - scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); - - } - - if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) - $.ui.ddmanager.prepareOffsets(this, event); - } - - //Regenerate the absolute position used for position checks - this.positionAbs = this._convertPositionTo("absolute"); - - //Set the helper position - if (!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left + 'px'; - if (!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top + 'px'; - - //Rearrange - for (var i = this.items.length - 1; i >= 0; i--) { - - //Cache variables and intersection, continue if no intersection - var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item); - if (!intersection) continue; - - if (itemElement != this.currentItem[0] //cannot intersect with itself - && this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before - && !$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked - && (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true) - //&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container - ) { - - $(itemElement).mouseenter(); - - this.direction = intersection == 1 ? "down" : "up"; - - if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) { - $(itemElement).mouseleave(); - this._rearrange(event, item); - } else { - break; - } - - // Clear emtpy ul's/ol's - this._clearEmpty(itemElement); - - this._trigger("change", event, this._uiHash()); - break; - } - } - - var parentItem = (this.placeholder[0].parentNode.parentNode && - $(this.placeholder[0].parentNode.parentNode).closest('.ui-sortable').length) - ? $(this.placeholder[0].parentNode.parentNode) - : null, - level = this._getLevel(this.placeholder), - childLevels = this._getChildLevels(this.helper), - previousItem = this.placeholder[0].previousSibling ? $(this.placeholder[0].previousSibling) : null; - - if (previousItem != null) { - while (previousItem[0].nodeName.toLowerCase() != 'li' || previousItem[0] == this.currentItem[0]) { - if (previousItem[0].previousSibling) { - previousItem = $(previousItem[0].previousSibling); - } else { - previousItem = null; - break; - } - } - } - - var newList = document.createElement(o.listType); - - this.beyondMaxLevels = 0; - - // If the item is moved to the left, send it to its parent level - if (parentItem != null && - (o.rtl && (this.positionAbs.left + this.helper.outerWidth() > parentItem.offset().left + parentItem.outerWidth()) || - !o.rtl && (this.positionAbs.left < parentItem.offset().left))) { - parentItem.after(this.placeholder[0]); - this._clearEmpty(parentItem[0]); - this._trigger("change", event, this._uiHash()); - } - // If the item is below another one and is moved to the right, make it a children of it - else if (previousItem != null && - (o.rtl && (this.positionAbs.left + this.helper.outerWidth() < previousItem.offset().left + previousItem.outerWidth() - o.tabSize) || - !o.rtl && (this.positionAbs.left > previousItem.offset().left + o.tabSize))) { - this._isAllowed(previousItem, level, level + childLevels + 1); - if (!previousItem.children(o.listType).length) { - previousItem[0].appendChild(newList); - } - previousItem.children(o.listType)[0].appendChild(this.placeholder[0]); - this._trigger("change", event, this._uiHash()); - } - else { - this._isAllowed(parentItem, level, level + childLevels); - } - - //Post events to containers - this._contactContainers(event); - - //Interconnect with droppables - if ($.ui.ddmanager) $.ui.ddmanager.drag(this, event); - - //Call callbacks - this._trigger('sort', event, this._uiHash()); - - this.lastPositionAbs = this.positionAbs; - return false; - - }, - - _mouseStop: function (event, noPropagation) { - - // If the item is in a position not allowed, send it back - if (this.beyondMaxLevels) { - - this.placeholder.removeClass(this.options.errorClass); - - if (this.domPosition.prev) { - $(this.domPosition.prev).after(this.placeholder); - } else { - $(this.domPosition.parent).prepend(this.placeholder); - } - - this._trigger("revert", event, this._uiHash()); - - } - - // Clean last empty ul/ol - for (var i = this.items.length - 1; i >= 0; i--) { - var item = this.items[i].item[0]; - this._clearEmpty(item); - } - - $.ui.sortable.prototype._mouseStop.apply(this, arguments); - - }, - - serialize: function (options) { - - var o = $.extend({}, this.options, options), - items = this._getItemsAsjQuery(o && o.connected), - str = []; - - $(items).each(function () { - var res = ($(o.item || this).attr(o.attribute || 'id') || '') - .match(o.expression || (/(.+)[-=_](.+)/)), - pid = ($(o.item || this).parent(o.listType) - .parent(o.items) - .attr(o.attribute || 'id') || '') - .match(o.expression || (/(.+)[-=_](.+)/)); - - if (res) { - str.push(((o.key || res[1]) + '[' + (o.key && o.expression ? res[1] : res[2]) + ']') - + '=' - + (pid ? (o.key && o.expression ? pid[1] : pid[2]) : o.rootID)); - } - }); - - if (!str.length && o.key) { - str.push(o.key + '='); - } - - return str.join('&'); - - }, - - toHierarchy: function (options) { - - var o = $.extend({}, this.options, options), - sDepth = o.startDepthCount || 0, - ret = []; - - $(this.element).children(o.items).each(function () { - var level = _recursiveItems(this); - ret.push(level); - }); - - return ret; - - function _recursiveItems(item) { - var id = ($(item).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/)); - if (id) { - var currentItem = { "id": id[2] }; - if ($(item).children(o.listType).children(o.items).length > 0) { - currentItem.children = []; - $(item).children(o.listType).children(o.items).each(function () { - var level = _recursiveItems(this); - currentItem.children.push(level); - }); - } - return currentItem; - } - } - }, - - toArray: function (options) { - - var o = $.extend({}, this.options, options), - sDepth = o.startDepthCount || 0, - ret = [], - left = 2; - - ret.push({ - "item_id": o.rootID, - "parent_id": 'none', - "depth": sDepth, - "left": '1', - "right": ($(o.items, this.element).length + 1) * 2 - }); - - $(this.element).children(o.items).each(function () { - left = _recursiveArray(this, sDepth + 1, left); - }); - - ret = ret.sort(function (a, b) { return (a.left - b.left); }); - - return ret; - - function _recursiveArray(item, depth, left) { - - var right = left + 1, - id, - pid; - - if ($(item).children(o.listType).children(o.items).length > 0) { - depth++; - $(item).children(o.listType).children(o.items).each(function () { - right = _recursiveArray($(this), depth, right); - }); - depth--; - } - - id = ($(item).attr(o.attribute || 'id')).match(o.expression || (/(.+)[-=_](.+)/)); - - if (depth === sDepth + 1) { - pid = o.rootID; - } else { - var parentItem = ($(item).parent(o.listType) - .parent(o.items) - .attr(o.attribute || 'id')) - .match(o.expression || (/(.+)[-=_](.+)/)); - pid = parentItem[2]; - } - - if (id) { - ret.push({ "item_id": id[2], "parent_id": pid, "depth": depth, "left": left, "right": right }); - } - - left = right + 1; - return left; - } - - }, - - _clearEmpty: function (item) { - - var emptyList = $(item).children(this.options.listType); - if (emptyList.length && !emptyList.children().length) { - emptyList.remove(); - } - - }, - - _getLevel: function (item) { - - var level = 1; - - if (this.options.listType) { - var list = item.closest(this.options.listType); - while (!list.is('.ui-sortable')) { - level++; - list = list.parent().closest(this.options.listType); - } - } - - return level; - }, - - _getChildLevels: function (parent, depth) { - var self = this, - o = this.options, - result = 0; - depth = depth || 0; - - $(parent).children(o.listType).children(o.items).each(function (index, child) { - result = Math.max(self._getChildLevels(child, depth + 1), result); - }); - - return depth ? result + 1 : result; - }, - - _isAllowed: function (parentItem, level, levels) { - var o = this.options, - isRoot = $(this.domPosition.parent).hasClass('ui-sortable') ? true : false; - - // Is the root protected? - // Are we trying to nest under a no-nest? - // Are we nesting too deep? - if (!o.isAllowed(parentItem, this.placeholder) || - parentItem && parentItem.hasClass(o.disableNesting) || - o.protectRoot && (parentItem == null && !isRoot || isRoot && level > 1)) { - this.placeholder.addClass(o.errorClass); - if (o.maxLevels < levels && o.maxLevels != 0) { - this.beyondMaxLevels = levels - o.maxLevels; - } else { - this.beyondMaxLevels = 1; - } - } else { - if (o.maxLevels < levels && o.maxLevels != 0) { - this.placeholder.addClass(o.errorClass); - this.beyondMaxLevels = levels - o.maxLevels; - } else { - this.placeholder.removeClass(o.errorClass); - this.beyondMaxLevels = 0; - } - } - } - - })); - - $.mjs.nestedSortable.prototype.options = $.extend({}, $.ui.sortable.prototype.options, $.mjs.nestedSortable.prototype.options); +/* +* jQuery UI Nested Sortable +* v 1.4 / 30 dec 2011 +* http://mjsarfatti.com/code/nestedSortable +* +* Depends on: +* jquery.ui.sortable.js 1.8+ +* +* Copyright (c) 2010-2012 Manuele J Sarfatti +* Licensed under the MIT License +* http://www.opensource.org/licenses/mit-license.php +*/ + +(function ($) { + + $.widget("mjs.nestedSortable", $.extend({}, $.ui.sortable.prototype, { + + options: { + tabSize: 20, + disableNesting: 'mjs-nestedSortable-no-nesting', + errorClass: 'mjs-nestedSortable-error', + listType: 'ol', + maxLevels: 0, + protectRoot: false, + rootID: null, + rtl: false, + isAllowed: function (item, parent) { return true; } + }, + + _create: function () { + this.element.data('sortable', this.element.data('nestedSortable')); + + if (!this.element.is(this.options.listType)) + throw new Error('nestedSortable: Please check the listType option is set to your actual list type'); + + return $.ui.sortable.prototype._create.apply(this, arguments); + }, + + destroy: function () { + this.element + .removeData("nestedSortable") + .unbind(".nestedSortable"); + return $.ui.sortable.prototype.destroy.apply(this, arguments); + }, + + _mouseDrag: function (event) { + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + if (!this.lastPositionAbs) { + this.lastPositionAbs = this.positionAbs; + } + + //Do scrolling + if (this.options.scroll) { + var o = this.options, scrolled = false; + if (this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') { + + if ((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed; + else if (event.pageY - this.overflowOffset.top < o.scrollSensitivity) + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed; + + if ((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed; + else if (event.pageX - this.overflowOffset.left < o.scrollSensitivity) + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed; + + } else { + + if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + else if ($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + + if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + else if ($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + + } + + if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) + $.ui.ddmanager.prepareOffsets(this, event); + } + + //Regenerate the absolute position used for position checks + this.positionAbs = this._convertPositionTo("absolute"); + + //Set the helper position + if (!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left + 'px'; + if (!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top + 'px'; + + //Rearrange + for (var i = this.items.length - 1; i >= 0; i--) { + + //Cache variables and intersection, continue if no intersection + var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item); + if (!intersection) continue; + + if (itemElement != this.currentItem[0] //cannot intersect with itself + && this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before + && !$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked + && (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true) + //&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container + ) { + + $(itemElement).mouseenter(); + + this.direction = intersection == 1 ? "down" : "up"; + + if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) { + $(itemElement).mouseleave(); + this._rearrange(event, item); + } else { + break; + } + + // Clear emtpy ul's/ol's + this._clearEmpty(itemElement); + + this._trigger("change", event, this._uiHash()); + break; + } + } + + var parentItem = (this.placeholder[0].parentNode.parentNode && + $(this.placeholder[0].parentNode.parentNode).closest('.ui-sortable').length) + ? $(this.placeholder[0].parentNode.parentNode) + : null, + level = this._getLevel(this.placeholder), + childLevels = this._getChildLevels(this.helper), + previousItem = this.placeholder[0].previousSibling ? $(this.placeholder[0].previousSibling) : null; + + if (previousItem != null) { + while (previousItem[0].nodeName.toLowerCase() != 'li' || previousItem[0] == this.currentItem[0]) { + if (previousItem[0].previousSibling) { + previousItem = $(previousItem[0].previousSibling); + } else { + previousItem = null; + break; + } + } + } + + var newList = document.createElement(o.listType); + + this.beyondMaxLevels = 0; + + // If the item is moved to the left, send it to its parent level + if (parentItem != null && + (o.rtl && (this.positionAbs.left + this.helper.outerWidth() > parentItem.offset().left + parentItem.outerWidth()) || + !o.rtl && (this.positionAbs.left < parentItem.offset().left))) { + parentItem.after(this.placeholder[0]); + this._clearEmpty(parentItem[0]); + this._trigger("change", event, this._uiHash()); + } + // If the item is below another one and is moved to the right, make it a children of it + else if (previousItem != null && + (o.rtl && (this.positionAbs.left + this.helper.outerWidth() < previousItem.offset().left + previousItem.outerWidth() - o.tabSize) || + !o.rtl && (this.positionAbs.left > previousItem.offset().left + o.tabSize))) { + this._isAllowed(previousItem, level, level + childLevels + 1); + if (!previousItem.children(o.listType).length) { + previousItem[0].appendChild(newList); + } + previousItem.children(o.listType)[0].appendChild(this.placeholder[0]); + this._trigger("change", event, this._uiHash()); + } + else { + this._isAllowed(parentItem, level, level + childLevels); + } + + //Post events to containers + this._contactContainers(event); + + //Interconnect with droppables + if ($.ui.ddmanager) $.ui.ddmanager.drag(this, event); + + //Call callbacks + this._trigger('sort', event, this._uiHash()); + + this.lastPositionAbs = this.positionAbs; + return false; + + }, + + _mouseStop: function (event, noPropagation) { + + // If the item is in a position not allowed, send it back + if (this.beyondMaxLevels) { + + this.placeholder.removeClass(this.options.errorClass); + + if (this.domPosition.prev) { + $(this.domPosition.prev).after(this.placeholder); + } else { + $(this.domPosition.parent).prepend(this.placeholder); + } + + this._trigger("revert", event, this._uiHash()); + + } + + // Clean last empty ul/ol + for (var i = this.items.length - 1; i >= 0; i--) { + var item = this.items[i].item[0]; + this._clearEmpty(item); + } + + $.ui.sortable.prototype._mouseStop.apply(this, arguments); + + }, + + serialize: function (options) { + + var o = $.extend({}, this.options, options), + items = this._getItemsAsjQuery(o && o.connected), + str = []; + + $(items).each(function () { + var res = ($(o.item || this).attr(o.attribute || 'id') || '') + .match(o.expression || (/(.+)[-=_](.+)/)), + pid = ($(o.item || this).parent(o.listType) + .parent(o.items) + .attr(o.attribute || 'id') || '') + .match(o.expression || (/(.+)[-=_](.+)/)); + + if (res) { + str.push(((o.key || res[1]) + '[' + (o.key && o.expression ? res[1] : res[2]) + ']') + + '=' + + (pid ? (o.key && o.expression ? pid[1] : pid[2]) : o.rootID)); + } + }); + + if (!str.length && o.key) { + str.push(o.key + '='); + } + + return str.join('&'); + + }, + + toHierarchy: function (options) { + + var o = $.extend({}, this.options, options), + sDepth = o.startDepthCount || 0, + ret = []; + + $(this.element).children(o.items).each(function () { + var level = _recursiveItems(this); + ret.push(level); + }); + + return ret; + + function _recursiveItems(item) { + var id = ($(item).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/)); + if (id) { + var currentItem = { "id": id[2] }; + if ($(item).children(o.listType).children(o.items).length > 0) { + currentItem.children = []; + $(item).children(o.listType).children(o.items).each(function () { + var level = _recursiveItems(this); + currentItem.children.push(level); + }); + } + return currentItem; + } + } + }, + + toArray: function (options) { + + var o = $.extend({}, this.options, options), + sDepth = o.startDepthCount || 0, + ret = [], + left = 2; + + ret.push({ + "item_id": o.rootID, + "parent_id": 'none', + "depth": sDepth, + "left": '1', + "right": ($(o.items, this.element).length + 1) * 2 + }); + + $(this.element).children(o.items).each(function () { + left = _recursiveArray(this, sDepth + 1, left); + }); + + ret = ret.sort(function (a, b) { return (a.left - b.left); }); + + return ret; + + function _recursiveArray(item, depth, left) { + + var right = left + 1, + id, + pid; + + if ($(item).children(o.listType).children(o.items).length > 0) { + depth++; + $(item).children(o.listType).children(o.items).each(function () { + right = _recursiveArray($(this), depth, right); + }); + depth--; + } + + id = ($(item).attr(o.attribute || 'id')).match(o.expression || (/(.+)[-=_](.+)/)); + + if (depth === sDepth + 1) { + pid = o.rootID; + } else { + var parentItem = ($(item).parent(o.listType) + .parent(o.items) + .attr(o.attribute || 'id')) + .match(o.expression || (/(.+)[-=_](.+)/)); + pid = parentItem[2]; + } + + if (id) { + ret.push({ "item_id": id[2], "parent_id": pid, "depth": depth, "left": left, "right": right }); + } + + left = right + 1; + return left; + } + + }, + + _clearEmpty: function (item) { + + var emptyList = $(item).children(this.options.listType); + if (emptyList.length && !emptyList.children().length) { + emptyList.remove(); + } + + }, + + _getLevel: function (item) { + + var level = 1; + + if (this.options.listType) { + var list = item.closest(this.options.listType); + while (!list.is('.ui-sortable')) { + level++; + list = list.parent().closest(this.options.listType); + } + } + + return level; + }, + + _getChildLevels: function (parent, depth) { + var self = this, + o = this.options, + result = 0; + depth = depth || 0; + + $(parent).children(o.listType).children(o.items).each(function (index, child) { + result = Math.max(self._getChildLevels(child, depth + 1), result); + }); + + return depth ? result + 1 : result; + }, + + _isAllowed: function (parentItem, level, levels) { + var o = this.options, + isRoot = $(this.domPosition.parent).hasClass('ui-sortable') ? true : false; + + // Is the root protected? + // Are we trying to nest under a no-nest? + // Are we nesting too deep? + if (!o.isAllowed(parentItem, this.placeholder) || + parentItem && parentItem.hasClass(o.disableNesting) || + o.protectRoot && (parentItem == null && !isRoot || isRoot && level > 1)) { + this.placeholder.addClass(o.errorClass); + if (o.maxLevels < levels && o.maxLevels != 0) { + this.beyondMaxLevels = levels - o.maxLevels; + } else { + this.beyondMaxLevels = 1; + } + } else { + if (o.maxLevels < levels && o.maxLevels != 0) { + this.placeholder.addClass(o.errorClass); + this.beyondMaxLevels = levels - o.maxLevels; + } else { + this.placeholder.removeClass(o.errorClass); + this.beyondMaxLevels = 0; + } + } + } + + })); + + $.mjs.nestedSortable.prototype.options = $.extend({}, $.ui.sortable.prototype.options, $.mjs.nestedSortable.prototype.options); })(jQuery); \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Scripts/navigation-admin.js b/src/Orchard.Web/Core/Navigation/Scripts/navigation-admin.js index 46f350c2223..a973dae9d17 100644 --- a/src/Orchard.Web/Core/Navigation/Scripts/navigation-admin.js +++ b/src/Orchard.Web/Core/Navigation/Scripts/navigation-admin.js @@ -1,78 +1,78 @@ - -(function ($) { - - var populate = function (el, prefix) { - var pos = 1; - - // direct children - var children = $(el).children('li').each(function (i, child) { - if (!prefix) prefix = ''; - child = $(child); - - // apply positions to all siblings - child.find('.navigation-position > input').attr('value', prefix + pos); - - // recurse position for children - child.children('ol').each(function (i, item) { populate(item, prefix + pos.toString() + '.') }); - - pos++; - - }); - }; - - $('.navigation-menu > ol').nestedSortable({ - disableNesting: 'no-nest', - forcePlaceholderSize: true, - handle: 'div', - helper: 'clone', - items: 'li', - maxLevels: 6, - opacity: 1, - placeholder: 'navigation-placeholder', - revert: 50, - tabSize: 30, - rtl: window.isRTL, - tolerance: 'pointer', - toleranceElement: '> div', - - stop: function (event, ui) { - // update all positions whenever a menu item was moved - populate(this, ''); - $('#save-message').show(); - - // display a message on leave if changes have been made - window.onbeforeunload = function (e) { - return $("
        ").html(leaveConfirmation).text(); - }; - - // cancel leaving message on save - $('#saveButton').click(function (e) { - window.onbeforeunload = function () { }; - }); - } - }); - - $(function () { - $(".navigation-menu-item > div").on("click", function () { - if ($(".navigation-menu-item > div.menu-item-selected").length) { - if ($(this).hasClass("menu-item-selected")) { - $(this).removeClass("menu-item-selected"); - } - else { - $(".navigation-menu-item > div").removeClass("menu-item-selected"); - $(this).addClass("menu-item-selected") - } - } - else { - $(this).addClass("menu-item-selected"); - } - }); - - $(".menu-item-actions > .button").on("click", function (e) { - if ($(".navigation-menu-item > div.menu-item-selected").length) { - e.originalEvent.currentTarget.href = $(this).attr("href") + "&parentMenuItemPosition=" + $(".navigation-menu-item > div.menu-item-selected > .navigation-position > input").val(); - } - }); - }); - -})(jQuery); + +(function ($) { + + var populate = function (el, prefix) { + var pos = 1; + + // direct children + var children = $(el).children('li').each(function (i, child) { + if (!prefix) prefix = ''; + child = $(child); + + // apply positions to all siblings + child.find('.navigation-position > input').attr('value', prefix + pos); + + // recurse position for children + child.children('ol').each(function (i, item) { populate(item, prefix + pos.toString() + '.') }); + + pos++; + + }); + }; + + $('.navigation-menu > ol').nestedSortable({ + disableNesting: 'no-nest', + forcePlaceholderSize: true, + handle: 'div', + helper: 'clone', + items: 'li', + maxLevels: 6, + opacity: 1, + placeholder: 'navigation-placeholder', + revert: 50, + tabSize: 30, + rtl: window.isRTL, + tolerance: 'pointer', + toleranceElement: '> div', + + stop: function (event, ui) { + // update all positions whenever a menu item was moved + populate(this, ''); + $('#save-message').show(); + + // display a message on leave if changes have been made + window.onbeforeunload = function (e) { + return $("
        ").html(leaveConfirmation).text(); + }; + + // cancel leaving message on save + $('#saveButton').click(function (e) { + window.onbeforeunload = function () { }; + }); + } + }); + + $(function () { + $(".navigation-menu-item > div").on("click", function () { + if ($(".navigation-menu-item > div.menu-item-selected").length) { + if ($(this).hasClass("menu-item-selected")) { + $(this).removeClass("menu-item-selected"); + } + else { + $(".navigation-menu-item > div").removeClass("menu-item-selected"); + $(this).addClass("menu-item-selected") + } + } + else { + $(this).addClass("menu-item-selected"); + } + }); + + $(".menu-item-actions > .button").on("click", function (e) { + if ($(".navigation-menu-item > div.menu-item-selected").length) { + e.originalEvent.currentTarget.href = $(this).attr("href") + "&parentMenuItemPosition=" + $(".navigation-menu-item > div.menu-item-selected > .navigation-position > input").val(); + } + }); + }); + +})(jQuery); diff --git a/src/Orchard.Web/Core/Navigation/Services/AdminMenuNavigationProvider.cs b/src/Orchard.Web/Core/Navigation/Services/AdminMenuNavigationProvider.cs index 12dcd437580..01ca84e36d1 100644 --- a/src/Orchard.Web/Core/Navigation/Services/AdminMenuNavigationProvider.cs +++ b/src/Orchard.Web/Core/Navigation/Services/AdminMenuNavigationProvider.cs @@ -1,37 +1,37 @@ -using System.Web; -using JetBrains.Annotations; -using Orchard.ContentManagement; -using Orchard.ContentManagement.MetaData; -using Orchard.Core.Navigation.Models; -using Orchard.Localization; -using Orchard.UI.Navigation; - -namespace Orchard.Core.Navigation.Services { - [UsedImplicitly] - public class AdminMenuNavigationProvider : INavigationProvider { - private readonly IContentManager _contentManager; - private readonly IContentDefinitionManager _contentDefinitionManager; - - public AdminMenuNavigationProvider(IContentManager contentManager, IContentDefinitionManager contentDefinitionManager) { - _contentManager = contentManager; - _contentDefinitionManager = contentDefinitionManager; - } - - public string MenuName { get { return "admin"; } } - - public void GetNavigation(NavigationBuilder builder) { - var menuParts = _contentManager.Query().Where(x => x.OnAdminMenu).List(); - foreach (var menuPart in menuParts) { - if (menuPart != null) { - var part = menuPart; - - builder.Add(new LocalizedString(part.AdminMenuText), - part.AdminMenuPosition, - item => item.Action(_contentManager.GetItemMetadata(part.ContentItem).AdminRouteValues)); - // todo: somehow determine if they will ultimately have rights to the destination and hide if not. possibly would need to add a Permission to metadata. - // todo: give an iconset somehow (e.g. based on convention, module/content/.adminmenu.png). - } - } - } - } +using System.Web; +using JetBrains.Annotations; +using Orchard.ContentManagement; +using Orchard.ContentManagement.MetaData; +using Orchard.Core.Navigation.Models; +using Orchard.Localization; +using Orchard.UI.Navigation; + +namespace Orchard.Core.Navigation.Services { + [UsedImplicitly] + public class AdminMenuNavigationProvider : INavigationProvider { + private readonly IContentManager _contentManager; + private readonly IContentDefinitionManager _contentDefinitionManager; + + public AdminMenuNavigationProvider(IContentManager contentManager, IContentDefinitionManager contentDefinitionManager) { + _contentManager = contentManager; + _contentDefinitionManager = contentDefinitionManager; + } + + public string MenuName { get { return "admin"; } } + + public void GetNavigation(NavigationBuilder builder) { + var menuParts = _contentManager.Query().Where(x => x.OnAdminMenu).List(); + foreach (var menuPart in menuParts) { + if (menuPart != null) { + var part = menuPart; + + builder.Add(new LocalizedString(part.AdminMenuText), + part.AdminMenuPosition, + item => item.Action(_contentManager.GetItemMetadata(part.ContentItem).AdminRouteValues)); + // todo: somehow determine if they will ultimately have rights to the destination and hide if not. possibly would need to add a Permission to metadata. + // todo: give an iconset somehow (e.g. based on convention, module/content/.adminmenu.png). + } + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Services/DefaultMenuManager.cs b/src/Orchard.Web/Core/Navigation/Services/DefaultMenuManager.cs index 9a4338f1cc3..c8a3070a85e 100644 --- a/src/Orchard.Web/Core/Navigation/Services/DefaultMenuManager.cs +++ b/src/Orchard.Web/Core/Navigation/Services/DefaultMenuManager.cs @@ -1,28 +1,28 @@ -using System.Collections.Generic; -using System.Linq; -using Orchard.ContentManagement; - -namespace Orchard.Core.Navigation.Services { - /// - /// Implements by searching for the MenuItem stereotype in the content type's settings. - /// - public class DefaultMenuManager : IMenuManager { - private readonly IContentManager _contentManager; - - public DefaultMenuManager(IContentManager contentManager) { - _contentManager = contentManager; - } - - public IEnumerable GetMenuItemTypes() { - return _contentManager.GetContentTypeDefinitions() - .Where(contentTypeDefinition => contentTypeDefinition.Settings.ContainsKey("Stereotype") && contentTypeDefinition.Settings["Stereotype"] == "MenuItem") - .Select(contentTypeDefinition => - new MenuItemDescriptor { - Type = contentTypeDefinition.Name, - DisplayName = contentTypeDefinition.DisplayName, - Description = contentTypeDefinition.Settings.ContainsKey("Description") ? contentTypeDefinition.Settings["Description"] : null - }); - } - } - +using System.Collections.Generic; +using System.Linq; +using Orchard.ContentManagement; + +namespace Orchard.Core.Navigation.Services { + /// + /// Implements by searching for the MenuItem stereotype in the content type's settings. + /// + public class DefaultMenuManager : IMenuManager { + private readonly IContentManager _contentManager; + + public DefaultMenuManager(IContentManager contentManager) { + _contentManager = contentManager; + } + + public IEnumerable GetMenuItemTypes() { + return _contentManager.GetContentTypeDefinitions() + .Where(contentTypeDefinition => contentTypeDefinition.Settings.ContainsKey("Stereotype") && contentTypeDefinition.Settings["Stereotype"] == "MenuItem") + .Select(contentTypeDefinition => + new MenuItemDescriptor { + Type = contentTypeDefinition.Name, + DisplayName = contentTypeDefinition.DisplayName, + Description = contentTypeDefinition.Settings.ContainsKey("Description") ? contentTypeDefinition.Settings["Description"] : null + }); + } + } + } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Services/DefaultMenuProvider.cs b/src/Orchard.Web/Core/Navigation/Services/DefaultMenuProvider.cs index d153c4f4159..036801c0512 100644 --- a/src/Orchard.Web/Core/Navigation/Services/DefaultMenuProvider.cs +++ b/src/Orchard.Web/Core/Navigation/Services/DefaultMenuProvider.cs @@ -1,41 +1,41 @@ -using System.Web; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Aspects; -using Orchard.Core.Navigation.Models; -using Orchard.Localization; -using Orchard.UI.Navigation; - -namespace Orchard.Core.Navigation.Services { - public class DefaultMenuProvider : IMenuProvider { - private readonly IContentManager _contentManager; - - public DefaultMenuProvider(IContentManager contentManager) { - _contentManager = contentManager; - } - - public void GetMenu(IContent menu, NavigationBuilder builder) { - var menuParts = _contentManager - .Query() - .Where(x => x.MenuId == menu.Id) - .List(); - - foreach (var menuPart in menuParts) { - if (menuPart != null) { - var part = menuPart; - - string culture = null; - // fetch the culture of the content menu item, if any - var localized = part.As(); - if (localized != null) { - culture = localized.Culture; - } - - if (part.Is()) - builder.Add(new LocalizedString(HttpUtility.HtmlEncode(part.MenuText)), part.MenuPosition, item => item.Url(part.As().Url).Content(part).Culture(culture).Permission(Contents.Permissions.ViewContent)); - else - builder.Add(new LocalizedString(HttpUtility.HtmlEncode(part.MenuText)), part.MenuPosition, item => item.Action(_contentManager.GetItemMetadata(part.ContentItem).DisplayRouteValues).Content(part).Culture(culture).Permission(Contents.Permissions.ViewContent)); - } - } - } - } +using System.Web; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Aspects; +using Orchard.Core.Navigation.Models; +using Orchard.Localization; +using Orchard.UI.Navigation; + +namespace Orchard.Core.Navigation.Services { + public class DefaultMenuProvider : IMenuProvider { + private readonly IContentManager _contentManager; + + public DefaultMenuProvider(IContentManager contentManager) { + _contentManager = contentManager; + } + + public void GetMenu(IContent menu, NavigationBuilder builder) { + var menuParts = _contentManager + .Query() + .Where(x => x.MenuId == menu.Id) + .List(); + + foreach (var menuPart in menuParts) { + if (menuPart != null) { + var part = menuPart; + + string culture = null; + // fetch the culture of the content menu item, if any + var localized = part.As(); + if (localized != null) { + culture = localized.Culture; + } + + if (part.Is()) + builder.Add(new LocalizedString(HttpUtility.HtmlEncode(part.MenuText)), part.MenuPosition, item => item.Url(part.As().Url).Content(part).Culture(culture).Permission(Contents.Permissions.ViewContent)); + else + builder.Add(new LocalizedString(HttpUtility.HtmlEncode(part.MenuText)), part.MenuPosition, item => item.Action(_contentManager.GetItemMetadata(part.ContentItem).DisplayRouteValues).Content(part).Culture(culture).Permission(Contents.Permissions.ViewContent)); + } + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Services/IMenuManager.cs b/src/Orchard.Web/Core/Navigation/Services/IMenuManager.cs index 3fbe3ca35db..e646b13f57c 100644 --- a/src/Orchard.Web/Core/Navigation/Services/IMenuManager.cs +++ b/src/Orchard.Web/Core/Navigation/Services/IMenuManager.cs @@ -1,18 +1,18 @@ -using System.Collections.Generic; - -namespace Orchard.Core.Navigation.Services { - public interface IMenuManager : IDependency { - - /// - /// Gets the list of Menu Item content types - /// - /// An IEnumerable{MenuItemDescriptor} containing the menu items content types. - IEnumerable GetMenuItemTypes(); - } - - public class MenuItemDescriptor { - public string Type { get; set; } - public string DisplayName { get; set; } - public string Description { get; set; } - } -} +using System.Collections.Generic; + +namespace Orchard.Core.Navigation.Services { + public interface IMenuManager : IDependency { + + /// + /// Gets the list of Menu Item content types + /// + /// An IEnumerable{MenuItemDescriptor} containing the menu items content types. + IEnumerable GetMenuItemTypes(); + } + + public class MenuItemDescriptor { + public string Type { get; set; } + public string DisplayName { get; set; } + public string Description { get; set; } + } +} diff --git a/src/Orchard.Web/Core/Navigation/Services/IMenuService.cs b/src/Orchard.Web/Core/Navigation/Services/IMenuService.cs index 19157da9035..7636810df8d 100644 --- a/src/Orchard.Web/Core/Navigation/Services/IMenuService.cs +++ b/src/Orchard.Web/Core/Navigation/Services/IMenuService.cs @@ -1,16 +1,16 @@ -using System.Collections.Generic; -using Orchard.ContentManagement; -using Orchard.Core.Navigation.Models; - -namespace Orchard.Core.Navigation.Services { - public interface IMenuService : IDependency { - IEnumerable Get(); - IEnumerable GetMenuParts(int menuId); - MenuPart Get(int id); - IContent GetMenu(int menuId); - IContent GetMenu(string name); - IEnumerable GetMenus(); - IContent Create(string name); - void Delete(MenuPart menuPart); - } +using System.Collections.Generic; +using Orchard.ContentManagement; +using Orchard.Core.Navigation.Models; + +namespace Orchard.Core.Navigation.Services { + public interface IMenuService : IDependency { + IEnumerable Get(); + IEnumerable GetMenuParts(int menuId); + MenuPart Get(int id); + IContent GetMenu(int menuId); + IContent GetMenu(string name); + IEnumerable GetMenus(); + IContent Create(string name); + void Delete(MenuPart menuPart); + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Services/MainMenuService.cs b/src/Orchard.Web/Core/Navigation/Services/MainMenuService.cs index 187f1224630..06cbc7b6dff 100644 --- a/src/Orchard.Web/Core/Navigation/Services/MainMenuService.cs +++ b/src/Orchard.Web/Core/Navigation/Services/MainMenuService.cs @@ -1,69 +1,69 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using JetBrains.Annotations; -using Orchard.ContentManagement; -using Orchard.Core.Navigation.Models; -using Orchard.Core.Title.Models; - -namespace Orchard.Core.Navigation.Services { - [UsedImplicitly] - public class MainMenuService : IMenuService { - private readonly IContentManager _contentManager; - - public MainMenuService(IContentManager contentManager) { - _contentManager = contentManager; - } - - public IEnumerable Get() { - return _contentManager.Query().List(); - } - - public IEnumerable GetMenuParts(int menuId) { - return _contentManager - .Query() - .Where( x => x.MenuId == menuId) - .List(); - } - - public IContent GetMenu(string menuName) { - if(string.IsNullOrWhiteSpace(menuName)) { - return null; - } - - return _contentManager.Query() - .Where(x => x.Title == menuName) - .ForType("Menu") - .Slice(0, 1) - .FirstOrDefault(); - } - - public IContent GetMenu(int menuId) { - return _contentManager.Get(menuId, VersionOptions.Published); - } - - public MenuPart Get(int menuPartId) { - return _contentManager.Get(menuPartId); - } - - public IContent Create(string name) { - - if(string.IsNullOrWhiteSpace(name)) { - throw new ArgumentNullException(name); - } - - var menu = _contentManager.Create("Menu"); - menu.As().Title = name; - - return menu; - } - - public void Delete(MenuPart menuPart) { - _contentManager.Remove(menuPart.ContentItem); - } - - public IEnumerable GetMenus() { - return _contentManager.Query().ForType("Menu").Join().OrderBy(x => x.Title).List(); - } - } +using System; +using System.Collections.Generic; +using System.Linq; +using JetBrains.Annotations; +using Orchard.ContentManagement; +using Orchard.Core.Navigation.Models; +using Orchard.Core.Title.Models; + +namespace Orchard.Core.Navigation.Services { + [UsedImplicitly] + public class MainMenuService : IMenuService { + private readonly IContentManager _contentManager; + + public MainMenuService(IContentManager contentManager) { + _contentManager = contentManager; + } + + public IEnumerable Get() { + return _contentManager.Query().List(); + } + + public IEnumerable GetMenuParts(int menuId) { + return _contentManager + .Query() + .Where( x => x.MenuId == menuId) + .List(); + } + + public IContent GetMenu(string menuName) { + if(string.IsNullOrWhiteSpace(menuName)) { + return null; + } + + return _contentManager.Query() + .Where(x => x.Title == menuName) + .ForType("Menu") + .Slice(0, 1) + .FirstOrDefault(); + } + + public IContent GetMenu(int menuId) { + return _contentManager.Get(menuId, VersionOptions.Published); + } + + public MenuPart Get(int menuPartId) { + return _contentManager.Get(menuPartId); + } + + public IContent Create(string name) { + + if(string.IsNullOrWhiteSpace(name)) { + throw new ArgumentNullException(name); + } + + var menu = _contentManager.Create("Menu"); + menu.As().Title = name; + + return menu; + } + + public void Delete(MenuPart menuPart) { + _contentManager.Remove(menuPart.ContentItem); + } + + public IEnumerable GetMenus() { + return _contentManager.Query().ForType("Menu").Join().OrderBy(x => x.Title).List(); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Services/NavigationManager.cs b/src/Orchard.Web/Core/Navigation/Services/NavigationManager.cs index a090a1bb28e..93a2a30962a 100644 --- a/src/Orchard.Web/Core/Navigation/Services/NavigationManager.cs +++ b/src/Orchard.Web/Core/Navigation/Services/NavigationManager.cs @@ -1,296 +1,296 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web.Mvc; -using System.Web.Routing; -using Orchard.ContentManagement; -using Orchard.Environment.Configuration; -using Orchard.Logging; -using Orchard.Security; -using Orchard.Security.Permissions; -using Orchard.UI; -using Orchard.UI.Navigation; -using Orchard.Utility; -using Orchard.Exceptions; - -namespace Orchard.Core.Navigation.Services { - public class NavigationManager : INavigationManager { - private readonly IEnumerable _navigationProviders; - private readonly IEnumerable _menuProviders; - private readonly IAuthorizationService _authorizationService; - private readonly IEnumerable _navigationFilters; - private readonly UrlHelper _urlHelper; - private readonly IOrchardServices _orchardServices; - private readonly ShellSettings _shellSettings; - - public NavigationManager( - IEnumerable navigationProviders, - IEnumerable menuProviders, - IAuthorizationService authorizationService, - IEnumerable navigationFilters, - UrlHelper urlHelper, - IOrchardServices orchardServices, - ShellSettings shellSettings) { - _navigationProviders = navigationProviders; - _menuProviders = menuProviders; - _authorizationService = authorizationService; - _navigationFilters = navigationFilters; - _urlHelper = urlHelper; - _orchardServices = orchardServices; - _shellSettings = shellSettings; - Logger = NullLogger.Instance; - } - - public ILogger Logger { get; set; } - - public IEnumerable BuildMenu(string menuName) { - var sources = GetSources(menuName); - var hasDebugShowAllMenuItems = _authorizationService.TryCheckAccess(Permission.Named("DebugShowAllMenuItems"), _orchardServices.WorkContext.CurrentUser, null); - return FinishMenu(Reduce(Merge(sources), menuName == "admin", hasDebugShowAllMenuItems).ToArray()); - } - - public IEnumerable BuildMenu(IContent menu) { - var sources = GetSources(menu); - var hasDebugShowAllMenuItems = _authorizationService.TryCheckAccess(Permission.Named("DebugShowAllMenuItems"), _orchardServices.WorkContext.CurrentUser, null); - return FinishMenu(Reduce(Arrange(Filter(Merge(sources))), false, hasDebugShowAllMenuItems).ToArray()); - } - - public string GetNextPosition(IContent menu) { - var sources = GetSources(menu); - var hasDebugShowAllMenuItems = _authorizationService.TryCheckAccess(Permission.Named("DebugShowAllMenuItems"), _orchardServices.WorkContext.CurrentUser, null); - return Position.GetNext(Reduce(Arrange(Filter(Merge(sources))), false, hasDebugShowAllMenuItems).ToArray()); - } - - public IEnumerable BuildImageSets(string menuName) { - return GetImageSets(menuName).SelectMany(imageSets => imageSets.Distinct()).Distinct(); - } - - private IEnumerable FinishMenu(ICollection menuItems) { - foreach (var menuItem in menuItems) { - menuItem.Href = GetUrl(menuItem.Url, menuItem.RouteValues); - menuItem.Items = FinishMenu(menuItem.Items.ToArray()); - } - - return menuItems; - } - - private IEnumerable Filter(IEnumerable menuItems) { - IEnumerable result = menuItems; - foreach(var filter in _navigationFilters) { - result = filter.Filter(result); - } - - return result; - } - - public string GetUrl(string menuItemUrl, RouteValueDictionary routeValueDictionary) { - var url = string.IsNullOrEmpty(menuItemUrl) && (routeValueDictionary == null || routeValueDictionary.Count == 0) - ? "~/" - : !string.IsNullOrEmpty(menuItemUrl) - ? menuItemUrl - : _urlHelper.RouteUrl(routeValueDictionary); - - var schemes = new[] { "http", "https", "tel", "mailto" }; - if (!string.IsNullOrEmpty(url) && _urlHelper.RequestContext.HttpContext != null && - !(url.StartsWith("/") || schemes.Any(scheme => url.StartsWith(scheme + ":")))) { - if (url.StartsWith("~/")) { - - if (!String.IsNullOrEmpty(_shellSettings.RequestUrlPrefix)) { - url = _shellSettings.RequestUrlPrefix + "/" + url.Substring(2); - } - else { - url = url.Substring(2); - } - } - if (!url.StartsWith("#")) { - var appPath = _urlHelper.RequestContext.HttpContext.Request.ApplicationPath; - if (appPath == "/") - appPath = ""; - url = string.Format("{0}/{1}", appPath, url); - } - } - return url; - } - - /// - /// Updates the items by checking for permissions - /// - private IEnumerable Reduce(IEnumerable items, bool isAdminMenu, bool hasDebugShowAllMenuItems) { - foreach (var item in items.Where(item => - // debug flag is on - hasDebugShowAllMenuItems || - // or item does not have any permissions set - !item.Permissions.Any() || - // or user has permission (either based on the linked item or global, if there's no linked item) - item.Permissions.Any(x => _authorizationService.TryCheckAccess( - x, - _orchardServices.WorkContext.CurrentUser, - item.Content == null || isAdminMenu ? null : item.Content)))) { - var oldItems = item.Items; - - item.Items = Reduce(item.Items, isAdminMenu, hasDebugShowAllMenuItems).ToList(); - - // if all sub items have been filtered out, ensure the main one is not one of them - // e.g., Manage Roles and Manage Users are not granted, the Users item should not show up - if (oldItems.Any() && !item.Items.Any()) { - if (oldItems.Any(x => NavigationHelper.RouteMatches(x.RouteValues, item.RouteValues))) { - continue; - } - } - - // if there are sub items returns the current item, otherwise ensure this item has valid permissions - yield return item; - } - } - - private IEnumerable> GetSources(string menuName) { - foreach (var provider in _navigationProviders) { - if (provider.MenuName == menuName) { - var builder = new NavigationBuilder(); - IEnumerable items = null; - try { - provider.GetNavigation(builder); - items = builder.Build(); - } - catch (Exception ex) { - if (ex.IsFatal()) { - throw; - } - Logger.Error(ex, "Unexpected error while querying a navigation provider. It was ignored. The menu provided by the provider may not be complete."); - } - if (items != null) { - yield return items; - } - } - } - } - - private IEnumerable> GetSources(IContent menu) { - foreach (var provider in _menuProviders) { - var builder = new NavigationBuilder(); - IEnumerable items = null; - try { - provider.GetMenu(menu, builder); - items = builder.Build(); - } - catch (Exception ex) { - if (ex.IsFatal()) { - throw; - } - Logger.Error(ex, "Unexpected error while querying a menu provider. It was ignored. The menu provided by the provider may not be complete."); - } - if (items != null) { - yield return items; - } - } - } - - private IEnumerable> GetImageSets(string menuName) { - foreach (var provider in _navigationProviders) { - if (provider.MenuName == menuName) { - var builder = new NavigationBuilder(); - IEnumerable imageSets = null; - try { - provider.GetNavigation(builder); - imageSets = builder.BuildImageSets(); - } - catch (Exception ex) { - if (ex.IsFatal()) { - throw; - } - Logger.Error(ex, "Unexpected error while querying a navigation provider. It was ignored. The menu provided by the provider may not be complete."); - } - if (imageSets != null) { - yield return imageSets; - } - } - } - } - - private static IEnumerable Merge(IEnumerable> sources) { - var comparer = new MenuItemComparer(); - var orderer = new FlatPositionComparer(); - - return sources.SelectMany(x => x).ToArray() - // group same menus - .GroupBy(key => key, (key, items) => Join(items), comparer) - // group same position - .GroupBy(item => item.Position) - // order position groups by position - .OrderBy(positionGroup => positionGroup.Key, orderer) - // ordered by item text in the postion group - .SelectMany(positionGroup => positionGroup.OrderBy(item => item.Text == null ? "" : item.Text.TextHint)); - } - - /// - /// Organizes a list of into a hierarchy based on their positions - /// - private static IEnumerable Arrange(IEnumerable items) { - - var result = new List(); - var index = new Dictionary(); - - foreach (var item in items) { - MenuItem parent; - var parentPosition = String.Empty; - - var position = item.Position ?? String.Empty; - - var lastSegment = position.LastIndexOf('.'); - if (lastSegment != -1) { - parentPosition = position.Substring(0, lastSegment); - } - - if (index.TryGetValue(parentPosition, out parent)) { - parent.Items = parent.Items.Concat(new [] { item }); - } - else { - result.Add(item); - } - - if (!index.ContainsKey(position)) { - // prevent invalid positions - index.Add(position, item); - } - } - - return result; - } - - static MenuItem Join(IEnumerable items) { - var list = items.ToArray(); - - if (list.Count() < 2) - return list.Single(); - - var joined = new MenuItem { - Text = list.First().Text, - IdHint = list.Select(x => x.IdHint).FirstOrDefault(x => !string.IsNullOrWhiteSpace(x)), - Classes = list.Select(x => x.Classes).FirstOrDefault(x => x != null && x.Count > 0), - Url = list.Select(x => x.Url).FirstOrDefault(x => !string.IsNullOrWhiteSpace(x)), - Href = list.Select(x => x.Href).FirstOrDefault(x => !string.IsNullOrWhiteSpace(x)), - LinkToFirstChild = list.First().LinkToFirstChild, - RouteValues = list.Select(x => x.RouteValues).FirstOrDefault(x => x != null), - LocalNav = list.Any(x => x.LocalNav), - Culture = list.First().Culture, - Items = Merge(list.Select(x => x.Items)).ToArray(), - Position = SelectBestPositionValue(list.Select(x => x.Position)), - Permissions = list.SelectMany(x => x.Permissions).Distinct(), - Content = list.First().Content - }; - - return joined; - } - - private static string SelectBestPositionValue(IEnumerable positions) { - var comparer = new FlatPositionComparer(); - return positions.Aggregate(string.Empty, - (agg, pos) => - string.IsNullOrEmpty(agg) - ? pos - : string.IsNullOrEmpty(pos) - ? agg - : comparer.Compare(agg, pos) < 0 ? agg : pos); - } - } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web.Mvc; +using System.Web.Routing; +using Orchard.ContentManagement; +using Orchard.Environment.Configuration; +using Orchard.Logging; +using Orchard.Security; +using Orchard.Security.Permissions; +using Orchard.UI; +using Orchard.UI.Navigation; +using Orchard.Utility; +using Orchard.Exceptions; + +namespace Orchard.Core.Navigation.Services { + public class NavigationManager : INavigationManager { + private readonly IEnumerable _navigationProviders; + private readonly IEnumerable _menuProviders; + private readonly IAuthorizationService _authorizationService; + private readonly IEnumerable _navigationFilters; + private readonly UrlHelper _urlHelper; + private readonly IOrchardServices _orchardServices; + private readonly ShellSettings _shellSettings; + + public NavigationManager( + IEnumerable navigationProviders, + IEnumerable menuProviders, + IAuthorizationService authorizationService, + IEnumerable navigationFilters, + UrlHelper urlHelper, + IOrchardServices orchardServices, + ShellSettings shellSettings) { + _navigationProviders = navigationProviders; + _menuProviders = menuProviders; + _authorizationService = authorizationService; + _navigationFilters = navigationFilters; + _urlHelper = urlHelper; + _orchardServices = orchardServices; + _shellSettings = shellSettings; + Logger = NullLogger.Instance; + } + + public ILogger Logger { get; set; } + + public IEnumerable BuildMenu(string menuName) { + var sources = GetSources(menuName); + var hasDebugShowAllMenuItems = _authorizationService.TryCheckAccess(Permission.Named("DebugShowAllMenuItems"), _orchardServices.WorkContext.CurrentUser, null); + return FinishMenu(Reduce(Merge(sources), menuName == "admin", hasDebugShowAllMenuItems).ToArray()); + } + + public IEnumerable BuildMenu(IContent menu) { + var sources = GetSources(menu); + var hasDebugShowAllMenuItems = _authorizationService.TryCheckAccess(Permission.Named("DebugShowAllMenuItems"), _orchardServices.WorkContext.CurrentUser, null); + return FinishMenu(Reduce(Arrange(Filter(Merge(sources))), false, hasDebugShowAllMenuItems).ToArray()); + } + + public string GetNextPosition(IContent menu) { + var sources = GetSources(menu); + var hasDebugShowAllMenuItems = _authorizationService.TryCheckAccess(Permission.Named("DebugShowAllMenuItems"), _orchardServices.WorkContext.CurrentUser, null); + return Position.GetNext(Reduce(Arrange(Filter(Merge(sources))), false, hasDebugShowAllMenuItems).ToArray()); + } + + public IEnumerable BuildImageSets(string menuName) { + return GetImageSets(menuName).SelectMany(imageSets => imageSets.Distinct()).Distinct(); + } + + private IEnumerable FinishMenu(ICollection menuItems) { + foreach (var menuItem in menuItems) { + menuItem.Href = GetUrl(menuItem.Url, menuItem.RouteValues); + menuItem.Items = FinishMenu(menuItem.Items.ToArray()); + } + + return menuItems; + } + + private IEnumerable Filter(IEnumerable menuItems) { + IEnumerable result = menuItems; + foreach(var filter in _navigationFilters) { + result = filter.Filter(result); + } + + return result; + } + + public string GetUrl(string menuItemUrl, RouteValueDictionary routeValueDictionary) { + var url = string.IsNullOrEmpty(menuItemUrl) && (routeValueDictionary == null || routeValueDictionary.Count == 0) + ? "~/" + : !string.IsNullOrEmpty(menuItemUrl) + ? menuItemUrl + : _urlHelper.RouteUrl(routeValueDictionary); + + var schemes = new[] { "http", "https", "tel", "mailto" }; + if (!string.IsNullOrEmpty(url) && _urlHelper.RequestContext.HttpContext != null && + !(url.StartsWith("/") || schemes.Any(scheme => url.StartsWith(scheme + ":")))) { + if (url.StartsWith("~/")) { + + if (!String.IsNullOrEmpty(_shellSettings.RequestUrlPrefix)) { + url = _shellSettings.RequestUrlPrefix + "/" + url.Substring(2); + } + else { + url = url.Substring(2); + } + } + if (!url.StartsWith("#")) { + var appPath = _urlHelper.RequestContext.HttpContext.Request.ApplicationPath; + if (appPath == "/") + appPath = ""; + url = string.Format("{0}/{1}", appPath, url); + } + } + return url; + } + + /// + /// Updates the items by checking for permissions + /// + private IEnumerable Reduce(IEnumerable items, bool isAdminMenu, bool hasDebugShowAllMenuItems) { + foreach (var item in items.Where(item => + // debug flag is on + hasDebugShowAllMenuItems || + // or item does not have any permissions set + !item.Permissions.Any() || + // or user has permission (either based on the linked item or global, if there's no linked item) + item.Permissions.Any(x => _authorizationService.TryCheckAccess( + x, + _orchardServices.WorkContext.CurrentUser, + item.Content == null || isAdminMenu ? null : item.Content)))) { + var oldItems = item.Items; + + item.Items = Reduce(item.Items, isAdminMenu, hasDebugShowAllMenuItems).ToList(); + + // if all sub items have been filtered out, ensure the main one is not one of them + // e.g., Manage Roles and Manage Users are not granted, the Users item should not show up + if (oldItems.Any() && !item.Items.Any()) { + if (oldItems.Any(x => NavigationHelper.RouteMatches(x.RouteValues, item.RouteValues))) { + continue; + } + } + + // if there are sub items returns the current item, otherwise ensure this item has valid permissions + yield return item; + } + } + + private IEnumerable> GetSources(string menuName) { + foreach (var provider in _navigationProviders) { + if (provider.MenuName == menuName) { + var builder = new NavigationBuilder(); + IEnumerable items = null; + try { + provider.GetNavigation(builder); + items = builder.Build(); + } + catch (Exception ex) { + if (ex.IsFatal()) { + throw; + } + Logger.Error(ex, "Unexpected error while querying a navigation provider. It was ignored. The menu provided by the provider may not be complete."); + } + if (items != null) { + yield return items; + } + } + } + } + + private IEnumerable> GetSources(IContent menu) { + foreach (var provider in _menuProviders) { + var builder = new NavigationBuilder(); + IEnumerable items = null; + try { + provider.GetMenu(menu, builder); + items = builder.Build(); + } + catch (Exception ex) { + if (ex.IsFatal()) { + throw; + } + Logger.Error(ex, "Unexpected error while querying a menu provider. It was ignored. The menu provided by the provider may not be complete."); + } + if (items != null) { + yield return items; + } + } + } + + private IEnumerable> GetImageSets(string menuName) { + foreach (var provider in _navigationProviders) { + if (provider.MenuName == menuName) { + var builder = new NavigationBuilder(); + IEnumerable imageSets = null; + try { + provider.GetNavigation(builder); + imageSets = builder.BuildImageSets(); + } + catch (Exception ex) { + if (ex.IsFatal()) { + throw; + } + Logger.Error(ex, "Unexpected error while querying a navigation provider. It was ignored. The menu provided by the provider may not be complete."); + } + if (imageSets != null) { + yield return imageSets; + } + } + } + } + + private static IEnumerable Merge(IEnumerable> sources) { + var comparer = new MenuItemComparer(); + var orderer = new FlatPositionComparer(); + + return sources.SelectMany(x => x).ToArray() + // group same menus + .GroupBy(key => key, (key, items) => Join(items), comparer) + // group same position + .GroupBy(item => item.Position) + // order position groups by position + .OrderBy(positionGroup => positionGroup.Key, orderer) + // ordered by item text in the postion group + .SelectMany(positionGroup => positionGroup.OrderBy(item => item.Text == null ? "" : item.Text.TextHint)); + } + + /// + /// Organizes a list of into a hierarchy based on their positions + /// + private static IEnumerable Arrange(IEnumerable items) { + + var result = new List(); + var index = new Dictionary(); + + foreach (var item in items) { + MenuItem parent; + var parentPosition = String.Empty; + + var position = item.Position ?? String.Empty; + + var lastSegment = position.LastIndexOf('.'); + if (lastSegment != -1) { + parentPosition = position.Substring(0, lastSegment); + } + + if (index.TryGetValue(parentPosition, out parent)) { + parent.Items = parent.Items.Concat(new [] { item }); + } + else { + result.Add(item); + } + + if (!index.ContainsKey(position)) { + // prevent invalid positions + index.Add(position, item); + } + } + + return result; + } + + static MenuItem Join(IEnumerable items) { + var list = items.ToArray(); + + if (list.Count() < 2) + return list.Single(); + + var joined = new MenuItem { + Text = list.First().Text, + IdHint = list.Select(x => x.IdHint).FirstOrDefault(x => !string.IsNullOrWhiteSpace(x)), + Classes = list.Select(x => x.Classes).FirstOrDefault(x => x != null && x.Count > 0), + Url = list.Select(x => x.Url).FirstOrDefault(x => !string.IsNullOrWhiteSpace(x)), + Href = list.Select(x => x.Href).FirstOrDefault(x => !string.IsNullOrWhiteSpace(x)), + LinkToFirstChild = list.First().LinkToFirstChild, + RouteValues = list.Select(x => x.RouteValues).FirstOrDefault(x => x != null), + LocalNav = list.Any(x => x.LocalNav), + Culture = list.First().Culture, + Items = Merge(list.Select(x => x.Items)).ToArray(), + Position = SelectBestPositionValue(list.Select(x => x.Position)), + Permissions = list.SelectMany(x => x.Permissions).Distinct(), + Content = list.First().Content + }; + + return joined; + } + + private static string SelectBestPositionValue(IEnumerable positions) { + var comparer = new FlatPositionComparer(); + return positions.Aggregate(string.Empty, + (agg, pos) => + string.IsNullOrEmpty(agg) + ? pos + : string.IsNullOrEmpty(pos) + ? agg + : comparer.Compare(agg, pos) < 0 ? agg : pos); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Settings/AdminMenuPartTypeSettings.cs b/src/Orchard.Web/Core/Navigation/Settings/AdminMenuPartTypeSettings.cs index 2659456fc91..0ca968f665d 100644 --- a/src/Orchard.Web/Core/Navigation/Settings/AdminMenuPartTypeSettings.cs +++ b/src/Orchard.Web/Core/Navigation/Settings/AdminMenuPartTypeSettings.cs @@ -1,35 +1,35 @@ -using System.Collections.Generic; -using Orchard.ContentManagement; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.MetaData.Builders; -using Orchard.ContentManagement.MetaData.Models; -using Orchard.ContentManagement.ViewModels; - -namespace Orchard.Core.Navigation.Settings { - public class AdminMenuPartTypeSettings { - public string DefaultPosition { get; set; } - } - - public class AdminMenuSettingsHooks : ContentDefinitionEditorEventsBase { - public override IEnumerable TypePartEditor(ContentTypePartDefinition definition) { - if (definition.PartDefinition.Name != "AdminMenuPart") { - yield break; - } - - var model = definition.Settings.GetModel(); - - yield return DefinitionTemplate(model); - } - - public override IEnumerable TypePartEditorUpdate(ContentTypePartDefinitionBuilder builder, IUpdateModel updateModel) { - if (builder.Name != "AdminMenuPart") { - yield break; - } - - var model = new AdminMenuPartTypeSettings(); - updateModel.TryUpdateModel(model, "AdminMenuPartTypeSettings", null, null); - builder.WithSetting("AdminMenuPartTypeSettings.DefaultPosition", model.DefaultPosition); - yield return DefinitionTemplate(model); - } - } -} +using System.Collections.Generic; +using Orchard.ContentManagement; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Builders; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.ContentManagement.ViewModels; + +namespace Orchard.Core.Navigation.Settings { + public class AdminMenuPartTypeSettings { + public string DefaultPosition { get; set; } + } + + public class AdminMenuSettingsHooks : ContentDefinitionEditorEventsBase { + public override IEnumerable TypePartEditor(ContentTypePartDefinition definition) { + if (definition.PartDefinition.Name != "AdminMenuPart") { + yield break; + } + + var model = definition.Settings.GetModel(); + + yield return DefinitionTemplate(model); + } + + public override IEnumerable TypePartEditorUpdate(ContentTypePartDefinitionBuilder builder, IUpdateModel updateModel) { + if (builder.Name != "AdminMenuPart") { + yield break; + } + + var model = new AdminMenuPartTypeSettings(); + updateModel.TryUpdateModel(model, "AdminMenuPartTypeSettings", null, null); + builder.WithSetting("AdminMenuPartTypeSettings.DefaultPosition", model.DefaultPosition); + yield return DefinitionTemplate(model); + } + } +} diff --git a/src/Orchard.Web/Core/Navigation/Styles/Web.config b/src/Orchard.Web/Core/Navigation/Styles/Web.config index 74c71f22bd5..11135c33761 100644 --- a/src/Orchard.Web/Core/Navigation/Styles/Web.config +++ b/src/Orchard.Web/Core/Navigation/Styles/Web.config @@ -1,16 +1,16 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Navigation/Styles/menu.navigation-admin.css b/src/Orchard.Web/Core/Navigation/Styles/menu.navigation-admin.css index a4d3da14820..1b0a3de259a 100644 --- a/src/Orchard.Web/Core/Navigation/Styles/menu.navigation-admin.css +++ b/src/Orchard.Web/Core/Navigation/Styles/menu.navigation-admin.css @@ -1,6 +1,6 @@ -.navicon-navigation { -background-image:url(images/menu.navigation.png) !important; -} -.navicon-navigation:hover { -background-position:0 -30px !important; +.navicon-navigation { +background-image:url(images/menu.navigation.png) !important; +} +.navicon-navigation:hover { +background-position:0 -30px !important; } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Styles/navigation-admin.css b/src/Orchard.Web/Core/Navigation/Styles/navigation-admin.css index 74a7d5472ec..1cc20d04f77 100644 --- a/src/Orchard.Web/Core/Navigation/Styles/navigation-admin.css +++ b/src/Orchard.Web/Core/Navigation/Styles/navigation-admin.css @@ -1,184 +1,184 @@ -#save-message { - display: none; -} - -.navigation-menu ol ol { - margin: 0; - padding: 0; - padding-left: 30px; /* gap between each level */ -} - -.navigation-menu ol.sortable, .navigation-menu ol.sortable ol { - margin: 0; - padding: 0; - list-style-type: none; -} - -.navigation-menu ol.sortable { -} - -.navigation-menu li { - margin: 0; - padding: 0; -} - -.navigation-menu li div { - border: 1px solid #ccc; - cursor: move; - padding: 3px 10px 3px 30px; - margin: 2px; - background: #eee; - display: inline-block; - min-width: 200px; - width: 100%; -} - -.navigation-menu li div:hover { - background: #eee url(images/move.gif) no-repeat 9px 7px; - border: 1px solid #999; -} - -.navigation-menu-item h2 -{ - display: inline; - font-size:1.077em; -} - -.navigation-position -{ - display: none; -} - -.navigation-url -{ -} - -.navigation-actions -{ - float: right; -} - -/* style for the dynamically created placeholder */ -.navigation-menu li.navigation-placeholder -{ - background: #dadada; -} - - -/* layout */ - -#display-menu-controls { - display: block; -} - -#display-menu-controls form, #display-menu-controls fieldset { - display: inline; -} - -#navigation-menu-add { - display: inline; - position: relative; -} - -.sections { -} - -.primary -{ - float: left; - width: 100%; -} - -.container -{ - margin-right:350px; -} - -.secondary -{ - padding:0; - margin:0; - margin-top:2px; - float:right; - width:300px; - margin-left: -300px; -} - -.menu-items-zone { - /*background: #F3F4F5;*/ - /*border:1px solid #E4E5E6;*/ - padding:0px; -} - -.menu-items-zone h2 { - font-size:1.077em; - padding:2px 2px; -} - -.menu-items-zone li { - background:#FFF; - border:1px solid #CCC; - margin-bottom: 5px; - padding: 5px; - padding-right:65px; - display: block; - position:relative; -} - - div.menu-item-description { - display: block; - } - - div.menu-item-actions { - display: block; - position:absolute; - right:10px; - top:15px; - } - - .menu-items-zone li a { - border:1px solid #EAEAEA; - } - - .menu-items-zone li a:hover { - border-color:#487328; - } - -.dir-rtl .navigation-menu li div { - padding: 3px 30px 3px 10px; -} -.dir-rtl .navigation-menu li div:hover { - background: #eee url(images/move.gif) no-repeat right 7px; -} -.dir-rtl .navigation-actions { - float: left; -} -.dir-rtl .primary { - float: right; -} -.dir-rtl .secondary { - float: left; - margin: 2px -300px 0 0; -} -.dir-rtl .container { - margin: 0 0 0 350px; -} - -.dir-rtl .menu-items-zone li { - padding-right: 5px; - padding-left: 65px; -} - - .dir-rtl div.menu-item-actions { - left:10px; - right: inherit; - } - -.navigation-menu li div.menu-item-selected { - background-color: #6a7b42; - color: #fff; -} - -.navigation-menu li div.menu-item-selected a { - color: #edf9f5; +#save-message { + display: none; +} + +.navigation-menu ol ol { + margin: 0; + padding: 0; + padding-left: 30px; /* gap between each level */ +} + +.navigation-menu ol.sortable, .navigation-menu ol.sortable ol { + margin: 0; + padding: 0; + list-style-type: none; +} + +.navigation-menu ol.sortable { +} + +.navigation-menu li { + margin: 0; + padding: 0; +} + +.navigation-menu li div { + border: 1px solid #ccc; + cursor: move; + padding: 3px 10px 3px 30px; + margin: 2px; + background: #eee; + display: inline-block; + min-width: 200px; + width: 100%; +} + +.navigation-menu li div:hover { + background: #eee url(images/move.gif) no-repeat 9px 7px; + border: 1px solid #999; +} + +.navigation-menu-item h2 +{ + display: inline; + font-size:1.077em; +} + +.navigation-position +{ + display: none; +} + +.navigation-url +{ +} + +.navigation-actions +{ + float: right; +} + +/* style for the dynamically created placeholder */ +.navigation-menu li.navigation-placeholder +{ + background: #dadada; +} + + +/* layout */ + +#display-menu-controls { + display: block; +} + +#display-menu-controls form, #display-menu-controls fieldset { + display: inline; +} + +#navigation-menu-add { + display: inline; + position: relative; +} + +.sections { +} + +.primary +{ + float: left; + width: 100%; +} + +.container +{ + margin-right:350px; +} + +.secondary +{ + padding:0; + margin:0; + margin-top:2px; + float:right; + width:300px; + margin-left: -300px; +} + +.menu-items-zone { + /*background: #F3F4F5;*/ + /*border:1px solid #E4E5E6;*/ + padding:0px; +} + +.menu-items-zone h2 { + font-size:1.077em; + padding:2px 2px; +} + +.menu-items-zone li { + background:#FFF; + border:1px solid #CCC; + margin-bottom: 5px; + padding: 5px; + padding-right:65px; + display: block; + position:relative; +} + + div.menu-item-description { + display: block; + } + + div.menu-item-actions { + display: block; + position:absolute; + right:10px; + top:15px; + } + + .menu-items-zone li a { + border:1px solid #EAEAEA; + } + + .menu-items-zone li a:hover { + border-color:#487328; + } + +.dir-rtl .navigation-menu li div { + padding: 3px 30px 3px 10px; +} +.dir-rtl .navigation-menu li div:hover { + background: #eee url(images/move.gif) no-repeat right 7px; +} +.dir-rtl .navigation-actions { + float: left; +} +.dir-rtl .primary { + float: right; +} +.dir-rtl .secondary { + float: left; + margin: 2px -300px 0 0; +} +.dir-rtl .container { + margin: 0 0 0 350px; +} + +.dir-rtl .menu-items-zone li { + padding-right: 5px; + padding-left: 65px; +} + + .dir-rtl div.menu-item-actions { + left:10px; + right: inherit; + } + +.navigation-menu li div.menu-item-selected { + background-color: #6a7b42; + color: #fff; +} + +.navigation-menu li div.menu-item-selected a { + color: #edf9f5; } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/ViewModels/CreateMenuItemViewModel.cs b/src/Orchard.Web/Core/Navigation/ViewModels/CreateMenuItemViewModel.cs index c9bd75c4731..a03ddd457ed 100644 --- a/src/Orchard.Web/Core/Navigation/ViewModels/CreateMenuItemViewModel.cs +++ b/src/Orchard.Web/Core/Navigation/ViewModels/CreateMenuItemViewModel.cs @@ -1,7 +1,7 @@ -using Orchard.ContentManagement; - -namespace Orchard.Core.Navigation.ViewModels { - public class CreateMenuItemViewModel { - public MenuItemEntry MenuItem { get; set; } - } +using Orchard.ContentManagement; + +namespace Orchard.Core.Navigation.ViewModels { + public class CreateMenuItemViewModel { + public MenuItemEntry MenuItem { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/ViewModels/MenuItemEntry.cs b/src/Orchard.Web/Core/Navigation/ViewModels/MenuItemEntry.cs index 29e4bb80eb3..0edb82f905b 100644 --- a/src/Orchard.Web/Core/Navigation/ViewModels/MenuItemEntry.cs +++ b/src/Orchard.Web/Core/Navigation/ViewModels/MenuItemEntry.cs @@ -1,15 +1,15 @@ -using Orchard.UI.Navigation; -using Orchard.ContentManagement; - -namespace Orchard.Core.Navigation.ViewModels { - public class MenuItemEntry { - public int MenuItemId { get; set; } - public bool IsMenuItem { get; set; } - - public string Text { get; set; } - public string Url { get; set; } - public string Position { get; set; } - - public ContentItem ContentItem { get; set; } - } +using Orchard.UI.Navigation; +using Orchard.ContentManagement; + +namespace Orchard.Core.Navigation.ViewModels { + public class MenuItemEntry { + public int MenuItemId { get; set; } + public bool IsMenuItem { get; set; } + + public string Text { get; set; } + public string Url { get; set; } + public string Position { get; set; } + + public ContentItem ContentItem { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/ViewModels/MenuPartViewModel.cs b/src/Orchard.Web/Core/Navigation/ViewModels/MenuPartViewModel.cs index c3d35a0ee06..4c4bdb60abf 100644 --- a/src/Orchard.Web/Core/Navigation/ViewModels/MenuPartViewModel.cs +++ b/src/Orchard.Web/Core/Navigation/ViewModels/MenuPartViewModel.cs @@ -1,13 +1,13 @@ -using System.Collections.Generic; -using Orchard.ContentManagement; - -namespace Orchard.Core.Navigation.ViewModels { - public class MenuPartViewModel { - public IEnumerable Menus { get; set; } - public int CurrentMenuId { get; set; } - public bool OnMenu { get; set; } - - public ContentItem ContentItem { get; set; } - public string MenuText { get; set; } - } +using System.Collections.Generic; +using Orchard.ContentManagement; + +namespace Orchard.Core.Navigation.ViewModels { + public class MenuPartViewModel { + public IEnumerable Menus { get; set; } + public int CurrentMenuId { get; set; } + public bool OnMenu { get; set; } + + public ContentItem ContentItem { get; set; } + public string MenuText { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/ViewModels/MenuWidgetViewModel.cs b/src/Orchard.Web/Core/Navigation/ViewModels/MenuWidgetViewModel.cs index 8868381e983..b5b0cb4a92c 100644 --- a/src/Orchard.Web/Core/Navigation/ViewModels/MenuWidgetViewModel.cs +++ b/src/Orchard.Web/Core/Navigation/ViewModels/MenuWidgetViewModel.cs @@ -1,16 +1,16 @@ -using System.Collections.Generic; -using Orchard.ContentManagement; - -namespace Orchard.Core.Navigation.ViewModels { - public class MenuWidgetViewModel { - public IEnumerable Menus { get; set; } - public int CurrentMenuId { get; set; } - - public int StartLevel { get; set; } - public int StopLevel { get; set; } - public bool Breadcrumb { get; set; } - public bool AddHomePage { get; set; } - public bool AddCurrentPage { get; set; } - public bool ShowFullMenu { get; set; } - } +using System.Collections.Generic; +using Orchard.ContentManagement; + +namespace Orchard.Core.Navigation.ViewModels { + public class MenuWidgetViewModel { + public IEnumerable Menus { get; set; } + public int CurrentMenuId { get; set; } + + public int StartLevel { get; set; } + public int StopLevel { get; set; } + public bool Breadcrumb { get; set; } + public bool AddHomePage { get; set; } + public bool AddCurrentPage { get; set; } + public bool ShowFullMenu { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/ViewModels/NavigationManagementViewModel.cs b/src/Orchard.Web/Core/Navigation/ViewModels/NavigationManagementViewModel.cs index e8a427435d0..be1c855a46c 100644 --- a/src/Orchard.Web/Core/Navigation/ViewModels/NavigationManagementViewModel.cs +++ b/src/Orchard.Web/Core/Navigation/ViewModels/NavigationManagementViewModel.cs @@ -1,19 +1,19 @@ -using System.Collections.Generic; -using System.Linq; -using Orchard.ContentManagement; -using Orchard.Core.Navigation.Services; - -namespace Orchard.Core.Navigation.ViewModels { - public class NavigationManagementViewModel { - public NavigationManagementViewModel() { - MenuItemEntries = Enumerable.Empty().ToList(); - } - - public MenuItemEntry NewMenuItem { get; set; } - public IList MenuItemEntries { get; set; } - public IEnumerable MenuItemDescriptors { get; set; } - - public IEnumerable Menus { get; set; } - public IContent CurrentMenu { get; set; } - } -} +using System.Collections.Generic; +using System.Linq; +using Orchard.ContentManagement; +using Orchard.Core.Navigation.Services; + +namespace Orchard.Core.Navigation.ViewModels { + public class NavigationManagementViewModel { + public NavigationManagementViewModel() { + MenuItemEntries = Enumerable.Empty().ToList(); + } + + public MenuItemEntry NewMenuItem { get; set; } + public IList MenuItemEntries { get; set; } + public IEnumerable MenuItemDescriptors { get; set; } + + public IEnumerable Menus { get; set; } + public IContent CurrentMenu { get; set; } + } +} diff --git a/src/Orchard.Web/Core/Navigation/Views/Admin/CreateMenuItem.cshtml b/src/Orchard.Web/Core/Navigation/Views/Admin/CreateMenuItem.cshtml index 041e955d2d0..0a909035cdd 100644 --- a/src/Orchard.Web/Core/Navigation/Views/Admin/CreateMenuItem.cshtml +++ b/src/Orchard.Web/Core/Navigation/Views/Admin/CreateMenuItem.cshtml @@ -1,7 +1,7 @@ -@{ Layout.Title = T("Create Menu Item").ToString(); } - -@using (Html.BeginFormAntiForgeryPost()) { - @Html.ValidationSummary() - // Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type - @Display(Model) +@{ Layout.Title = T("Create Menu Item").ToString(); } + +@using (Html.BeginFormAntiForgeryPost()) { + @Html.ValidationSummary() + // Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type + @Display(Model) } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Views/Admin/Index.cshtml b/src/Orchard.Web/Core/Navigation/Views/Admin/Index.cshtml index 2891f4a3c27..2cb3251c1e2 100644 --- a/src/Orchard.Web/Core/Navigation/Views/Admin/Index.cshtml +++ b/src/Orchard.Web/Core/Navigation/Views/Admin/Index.cshtml @@ -1,147 +1,147 @@ -@model NavigationManagementViewModel -@using Orchard.Core.Navigation.ViewModels; -@using Orchard.Utility.Extensions; - -@{ - Layout.Title = T("Navigation").ToString(); - Style.Include("navigation-admin.css"); - - Script.Require("jQueryUI_Sortable").AtFoot(); - Script.Include("jquery.mjs.nestedSortable.js").AtFoot(); - Script.Include("navigation-admin.js").AtFoot(); - - var hasPermission = Authorizer.Authorize(Orchard.Core.Navigation.Permissions.ManageMenus); -} - -
        @T("You need to hit \"Save All\" in order to save your changes.")
        - -
        - @if (Model.Menus.Any()) { - using (Html.BeginForm("Index", "Admin", FormMethod.Get, new { area = "Navigation" })) { -
        - - - @if (hasPermission) { - @Html.ActionLink(T("Edit").Text, "Edit", "Admin", new { area = "Contents", id = Model.CurrentMenu.Id, returnUrl = Url.Action("Index", "Admin", new { area = "Navigation", menuId = Model.CurrentMenu.Id }) }, new { @class = "button" }) - } -
        - } - } - @if (hasPermission) { - - } -
        - - -@using (Html.BeginFormAntiForgeryPost()) { - @Html.Hidden("menuId", Model.CurrentMenu.Id) -
        -
        -
        - -
        -
        - -
        - -
        -
        - -
        - -
        -} - - -@helper RenderMenuItems(IList menuItems, int index) { - - @:
          - - // store current level to detect lowerb or upper level - int currentLevel = Model.MenuItemEntries[index].Position.Split('.').Length - 1; - bool first = true; - - for (int i = index; i < Model.MenuItemEntries.Count; i++) { - - var menuPartEntry = Model.MenuItemEntries[i]; - var level = menuPartEntry.Position.Split('.').Length - 1; // 0 is for root level - - if (level > currentLevel) { - // render sub level, then continue to next element - @RenderMenuItems(menuItems, i) - - var j = i; - while (j < Model.MenuItemEntries.Count && Model.MenuItemEntries[j].Position.Split('.').Length - 1 > currentLevel) { j++; }; - i = j - 1; - continue; - } - - if (level == currentLevel) { - if (!first) { - @: - } - - first = false; - - @: - break; - } - } - @:
        -} - -@using (Script.Foot()) { - +@model NavigationManagementViewModel +@using Orchard.Core.Navigation.ViewModels; +@using Orchard.Utility.Extensions; + +@{ + Layout.Title = T("Navigation").ToString(); + Style.Include("navigation-admin.css"); + + Script.Require("jQueryUI_Sortable").AtFoot(); + Script.Include("jquery.mjs.nestedSortable.js").AtFoot(); + Script.Include("navigation-admin.js").AtFoot(); + + var hasPermission = Authorizer.Authorize(Orchard.Core.Navigation.Permissions.ManageMenus); +} + +
        @T("You need to hit \"Save All\" in order to save your changes.")
        + +
        + @if (Model.Menus.Any()) { + using (Html.BeginForm("Index", "Admin", FormMethod.Get, new { area = "Navigation" })) { +
        + + + @if (hasPermission) { + @Html.ActionLink(T("Edit").Text, "Edit", "Admin", new { area = "Contents", id = Model.CurrentMenu.Id, returnUrl = Url.Action("Index", "Admin", new { area = "Navigation", menuId = Model.CurrentMenu.Id }) }, new { @class = "button" }) + } +
        + } + } + @if (hasPermission) { + + } +
        + + +@using (Html.BeginFormAntiForgeryPost()) { + @Html.Hidden("menuId", Model.CurrentMenu.Id) +
        +
        +
        + +
        +
        + +
        + +
        +
        + +
        + +
        +} + + +@helper RenderMenuItems(IList menuItems, int index) { + + @:
          + + // store current level to detect lowerb or upper level + int currentLevel = Model.MenuItemEntries[index].Position.Split('.').Length - 1; + bool first = true; + + for (int i = index; i < Model.MenuItemEntries.Count; i++) { + + var menuPartEntry = Model.MenuItemEntries[i]; + var level = menuPartEntry.Position.Split('.').Length - 1; // 0 is for root level + + if (level > currentLevel) { + // render sub level, then continue to next element + @RenderMenuItems(menuItems, i) + + var j = i; + while (j < Model.MenuItemEntries.Count && Model.MenuItemEntries[j].Position.Split('.').Length - 1 > currentLevel) { j++; }; + i = j - 1; + continue; + } + + if (level == currentLevel) { + if (!first) { + @: + } + + first = false; + + @: + break; + } + } + @:
        +} + +@using (Script.Foot()) { + } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Views/Content-Menu.Edit.cshtml b/src/Orchard.Web/Core/Navigation/Views/Content-Menu.Edit.cshtml index 8583b35d8ef..714a81123b6 100644 --- a/src/Orchard.Web/Core/Navigation/Views/Content-Menu.Edit.cshtml +++ b/src/Orchard.Web/Core/Navigation/Views/Content-Menu.Edit.cshtml @@ -1,25 +1,25 @@ -@{ - Model.Sidebar.Add(New.Menu_DeleteButton().ContentItem(Model.ContentItem), "25"); -} - -
        -
        - @if (Model.Content != null) { -
        - @Display(Model.Content) -
        - } -
        -
        - @if (Model.Actions != null) { -
        - @Display(Model.Actions) -
        - } - @if (Model.Sidebar != null) { -
        - @Display(Model.Sidebar) -
        - } -
        +@{ + Model.Sidebar.Add(New.Menu_DeleteButton().ContentItem(Model.ContentItem), "25"); +} + +
        +
        + @if (Model.Content != null) { +
        + @Display(Model.Content) +
        + } +
        +
        + @if (Model.Actions != null) { +
        + @Display(Model.Actions) +
        + } + @if (Model.Sidebar != null) { +
        + @Display(Model.Sidebar) +
        + } +
        \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Views/DefinitionTemplates/AdminMenuPartTypeSettings.cshtml b/src/Orchard.Web/Core/Navigation/Views/DefinitionTemplates/AdminMenuPartTypeSettings.cshtml index 4ff8646947d..c5a9125ecd8 100644 --- a/src/Orchard.Web/Core/Navigation/Views/DefinitionTemplates/AdminMenuPartTypeSettings.cshtml +++ b/src/Orchard.Web/Core/Navigation/Views/DefinitionTemplates/AdminMenuPartTypeSettings.cshtml @@ -1,6 +1,6 @@ -@model Orchard.Core.Navigation.Settings.AdminMenuPartTypeSettings -
        - - @Html.EditorFor(m => m.DefaultPosition) - @Html.ValidationMessageFor(m => m.DefaultPosition) +@model Orchard.Core.Navigation.Settings.AdminMenuPartTypeSettings +
        + + @Html.EditorFor(m => m.DefaultPosition) + @Html.ValidationMessageFor(m => m.DefaultPosition)
        \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.MenuItem.Edit.cshtml b/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.MenuItem.Edit.cshtml index bd0aecf4403..8a96443d9c1 100644 --- a/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.MenuItem.Edit.cshtml +++ b/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.MenuItem.Edit.cshtml @@ -1,8 +1,8 @@ -@model MenuItemPart -@using Orchard.Core.Navigation.Models; - -
        - - @Html.TextBoxFor(m => m.Url, new { @class = "text large" }) - @T("A valid url, i.e. ~/my-page, http://orchardproject.net, /content/file.pdf, ...") -
        +@model MenuItemPart +@using Orchard.Core.Navigation.Models; + +
        + + @Html.TextBoxFor(m => m.Url, new { @class = "text large" }) + @T("A valid url, i.e. ~/my-page, http://orchardproject.net, /content/file.pdf, ...") +
        diff --git a/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.MenuWidget.Edit.cshtml b/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.MenuWidget.Edit.cshtml index cb568e8ffc1..d1b4eaeef21 100644 --- a/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.MenuWidget.Edit.cshtml +++ b/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.MenuWidget.Edit.cshtml @@ -1,51 +1,51 @@ -@model Orchard.Core.Navigation.ViewModels.MenuWidgetViewModel -@using Orchard.ContentManagement -@using Orchard.Core.Navigation.Models; - -
        - @Html.LabelFor(m => m.CurrentMenuId, T("For Menu")) - - @T("Select which menu you want to display") -
        - -
        - - @Html.TextBoxFor(m => m.StartLevel, new { @class = "text small" }) - @T("The level the menu should start at.") -
        - -
        - - @Html.TextBoxFor(m => m.StopLevel, new { @class = "text small" }) - @T("The number of levels to display, \"0\" meaning all levels.") -
        - -
        - @Html.EditorFor(m => m.Breadcrumb) - - @T("Check to render the path to the current content item.") -
        - -
        -
        - @Html.EditorFor(m => m.AddHomePage) - - @T("Check to render the home page as the first element of the breadcrumb.") -
        - -
        - @Html.EditorFor(m => m.AddCurrentPage) - - @T("Check to render the current content item as the last element.") -
        -
        - -
        - @Html.EditorFor(m => m.ShowFullMenu) - - @T("Check for the menu to be display without filtering the selected current page.") +@model Orchard.Core.Navigation.ViewModels.MenuWidgetViewModel +@using Orchard.ContentManagement +@using Orchard.Core.Navigation.Models; + +
        + @Html.LabelFor(m => m.CurrentMenuId, T("For Menu")) + + @T("Select which menu you want to display") +
        + +
        + + @Html.TextBoxFor(m => m.StartLevel, new { @class = "text small" }) + @T("The level the menu should start at.") +
        + +
        + + @Html.TextBoxFor(m => m.StopLevel, new { @class = "text small" }) + @T("The number of levels to display, \"0\" meaning all levels.") +
        + +
        + @Html.EditorFor(m => m.Breadcrumb) + + @T("Check to render the path to the current content item.") +
        + +
        +
        + @Html.EditorFor(m => m.AddHomePage) + + @T("Check to render the home page as the first element of the breadcrumb.") +
        + +
        + @Html.EditorFor(m => m.AddCurrentPage) + + @T("Check to render the current content item as the last element.") +
        +
        + +
        + @Html.EditorFor(m => m.ShowFullMenu) + + @T("Check for the menu to be display without filtering the selected current page.")
        \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.Navigation.AdminMenu.Edit.cshtml b/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.Navigation.AdminMenu.Edit.cshtml index aeb02b44a77..5a7408f77cd 100644 --- a/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.Navigation.AdminMenu.Edit.cshtml +++ b/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.Navigation.AdminMenu.Edit.cshtml @@ -1,18 +1,18 @@ -@model AdminMenuPart -@using Orchard.Core.Navigation.Models; -@{ - Script.Require("ShapesBase"); -} -
        - @Html.EditorFor(m => m.OnAdminMenu) - -
        - - @Html.TextBoxFor(m => m.AdminMenuText, new { @class = "text single-line" }) - @T("The text that should appear in the menu.") - - - @Html.TextBoxFor(m => m.AdminMenuPosition, new { @class = "text small" }) - @T("The position in the menu.") -
        -
        +@model AdminMenuPart +@using Orchard.Core.Navigation.Models; +@{ + Script.Require("ShapesBase"); +} +
        + @Html.EditorFor(m => m.OnAdminMenu) + +
        + + @Html.TextBoxFor(m => m.AdminMenuText, new { @class = "text single-line" }) + @T("The text that should appear in the menu.") + + + @Html.TextBoxFor(m => m.AdminMenuPosition, new { @class = "text small" }) + @T("The position in the menu.") +
        +
        diff --git a/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.Navigation.Menu.Edit.cshtml b/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.Navigation.Menu.Edit.cshtml index a51394ccc4c..30e9881182c 100644 --- a/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.Navigation.Menu.Edit.cshtml +++ b/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.Navigation.Menu.Edit.cshtml @@ -1,36 +1,36 @@ -@model Orchard.Core.Navigation.ViewModels.MenuPartViewModel -@using Orchard.ContentManagement -@using Orchard.Core.Navigation.Models; - -@if (!Model.ContentItem.TypeDefinition.Settings.ContainsKey("Stereotype") || Model.ContentItem.TypeDefinition.Settings["Stereotype"] != "MenuItem") { - -
        - - @Html.EditorFor(m => m.OnMenu) - -
        - - @T("Select which menu you want the content item to be displayed on.") - - - @Html.TextBoxFor(m => m.MenuText, new { @class = "text single-line" }) - @T("The text that should appear in the menu.") -
        -
        - -} -else { - -
        - - @Html.TextBoxFor(m => m.MenuText, new { @class = "text medium", autofocus = "autofocus" }) - @T("The text that should appear in the menu.") - @Html.HiddenFor(m => m.OnMenu, true) - @Html.HiddenFor(m => m.CurrentMenuId, Request["menuId"]) -
        - +@model Orchard.Core.Navigation.ViewModels.MenuPartViewModel +@using Orchard.ContentManagement +@using Orchard.Core.Navigation.Models; + +@if (!Model.ContentItem.TypeDefinition.Settings.ContainsKey("Stereotype") || Model.ContentItem.TypeDefinition.Settings["Stereotype"] != "MenuItem") { + +
        + + @Html.EditorFor(m => m.OnMenu) + +
        + + @T("Select which menu you want the content item to be displayed on.") + + + @Html.TextBoxFor(m => m.MenuText, new { @class = "text single-line" }) + @T("The text that should appear in the menu.") +
        +
        + +} +else { + +
        + + @Html.TextBoxFor(m => m.MenuText, new { @class = "text medium", autofocus = "autofocus" }) + @T("The text that should appear in the menu.") + @Html.HiddenFor(m => m.OnMenu, true) + @Html.HiddenFor(m => m.CurrentMenuId, Request["menuId"]) +
        + } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.ShapeMenuItemPart.Edit.cshtml b/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.ShapeMenuItemPart.Edit.cshtml index 49a0e449bf2..12efa188a8b 100644 --- a/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.ShapeMenuItemPart.Edit.cshtml +++ b/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.ShapeMenuItemPart.Edit.cshtml @@ -1,8 +1,8 @@ -@model Orchard.Core.Navigation.Models.ShapeMenuItemPart - -
        -
        - @Html.LabelFor(m => m.ShapeType, T("Type of the shape to display")) - @Html.TextBoxFor(m => m.ShapeType, new { @class = "text medium" }) -
        -
        +@model Orchard.Core.Navigation.Models.ShapeMenuItemPart + +
        +
        + @Html.LabelFor(m => m.ShapeType, T("Type of the shape to display")) + @Html.TextBoxFor(m => m.ShapeType, new { @class = "text medium" }) +
        +
        diff --git a/src/Orchard.Web/Core/Navigation/Views/Menu.DeleteButton.cshtml b/src/Orchard.Web/Core/Navigation/Views/Menu.DeleteButton.cshtml index f64da5a9f70..c094bd27b7a 100644 --- a/src/Orchard.Web/Core/Navigation/Views/Menu.DeleteButton.cshtml +++ b/src/Orchard.Web/Core/Navigation/Views/Menu.DeleteButton.cshtml @@ -1,14 +1,14 @@ -@using Orchard.ContentManagement; -@using Orchard.Core.Contents -@using Orchard.Utility.Extensions; - -@{ - ContentItem contentItem = Model.ContentItem; - string returnUrl = Request["returnUrl"]; -} - -@if (Authorizer.Authorize(Permissions.DeleteContent, contentItem)) { -
        - @Html.Link(T("Delete").Text, Url.ItemRemoveUrl(contentItem, new {returnUrl}), new { @class = "button", itemprop = "RemoveUrl UnsafeUrl"}) -
        -} +@using Orchard.ContentManagement; +@using Orchard.Core.Contents +@using Orchard.Utility.Extensions; + +@{ + ContentItem contentItem = Model.ContentItem; + string returnUrl = Request["returnUrl"]; +} + +@if (Authorizer.Authorize(Permissions.DeleteContent, contentItem)) { +
        + @Html.Link(T("Delete").Text, Url.ItemRemoveUrl(contentItem, new {returnUrl}), new { @class = "button", itemprop = "RemoveUrl UnsafeUrl"}) +
        +} diff --git a/src/Orchard.Web/Core/Navigation/Views/Menu.Edit.cshtml b/src/Orchard.Web/Core/Navigation/Views/Menu.Edit.cshtml index 6e72147a7a6..6006eb0ee3b 100644 --- a/src/Orchard.Web/Core/Navigation/Views/Menu.Edit.cshtml +++ b/src/Orchard.Web/Core/Navigation/Views/Menu.Edit.cshtml @@ -1,26 +1,26 @@ -@{ - Model.Sidebar.Add("Foo"); -} - -
        -
        - @if (Model.Content != null) { -
        - @Display(Model.Content) -
        - } -
        -
        - @if (Model.Actions != null) { -
        - @Display(Model.Actions) -
        - } - @if (Model.Sidebar != null) { -
        - @Display(Model.Sidebar) - -
        - } -
        +@{ + Model.Sidebar.Add("Foo"); +} + +
        +
        + @if (Model.Content != null) { +
        + @Display(Model.Content) +
        + } +
        +
        + @if (Model.Actions != null) { +
        + @Display(Model.Actions) +
        + } + @if (Model.Sidebar != null) { +
        + @Display(Model.Sidebar) + +
        + } +
        \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Views/MenuItem.Edit.cshtml b/src/Orchard.Web/Core/Navigation/Views/MenuItem.Edit.cshtml index ee08a573d47..42d7c28354e 100644 --- a/src/Orchard.Web/Core/Navigation/Views/MenuItem.Edit.cshtml +++ b/src/Orchard.Web/Core/Navigation/Views/MenuItem.Edit.cshtml @@ -1,8 +1,8 @@ -
        -
        - @Display(Model.Content) -
        -
        - @Display(Model.Sidebar) -
        -
        +
        +
        + @Display(Model.Content) +
        +
        + @Display(Model.Sidebar) +
        +
        diff --git a/src/Orchard.Web/Core/Navigation/Views/MenuItemLink-HtmlMenuItem.cshtml b/src/Orchard.Web/Core/Navigation/Views/MenuItemLink-HtmlMenuItem.cshtml index 2cb18d4ec96..6ac21f40418 100644 --- a/src/Orchard.Web/Core/Navigation/Views/MenuItemLink-HtmlMenuItem.cshtml +++ b/src/Orchard.Web/Core/Navigation/Views/MenuItemLink-HtmlMenuItem.cshtml @@ -1 +1 @@ -@Html.Raw(Model.Content.BodyPart.Text) +@Html.Raw(Model.Content.BodyPart.Text) diff --git a/src/Orchard.Web/Core/Navigation/Views/MenuItemLink-ShapeMenuItem.cshtml b/src/Orchard.Web/Core/Navigation/Views/MenuItemLink-ShapeMenuItem.cshtml index 48c1fb53e6c..ed48ea908fa 100644 --- a/src/Orchard.Web/Core/Navigation/Views/MenuItemLink-ShapeMenuItem.cshtml +++ b/src/Orchard.Web/Core/Navigation/Views/MenuItemLink-ShapeMenuItem.cshtml @@ -1,4 +1,4 @@ -@{ - string type = Model.Content.ShapeMenuItemPart.ShapeType; -} +@{ + string type = Model.Content.ShapeMenuItemPart.ShapeType; +} @Display(New.Create(type).MenuItem(Model)) \ No newline at end of file diff --git a/src/Orchard.Web/Core/Orchard.Core.csproj b/src/Orchard.Web/Core/Orchard.Core.csproj index 3f893b50a6e..a56e76dcf00 100644 --- a/src/Orchard.Web/Core/Orchard.Core.csproj +++ b/src/Orchard.Web/Core/Orchard.Core.csproj @@ -1,617 +1,617 @@ - - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9916839C-39FC-4CEB-A5AF-89CA7E87119F} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Orchard.Core - Orchard.Core - v4.5.1 - false - - - 4.0 - - - - false - - - - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - ..\..\OrchardBasicCorrectness.ruleset - false - false - - - pdbonly - true - bin\ - TRACE - prompt - 4 - AllRules.ruleset - false - - - - - - 3.5 - - - - - - - - - False - ..\..\..\lib\aspnetmvc\System.Web.Mvc.dll - True - - - False - ..\..\..\lib\aspnetmvc\System.Web.WebPages.dll - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} - Orchard.Framework - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Designer - - - - - - - - Designer - - - Designer - - - Designer - - - - - - - - - - - - - - - - - - - - - - - Designer - - - - - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - $(ProjectDir)\..\Manifests - - - - - - - - - - - - False - True - 53609 - / - - - False - True - http://orchard.codeplex.com - False - - - - + + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {9916839C-39FC-4CEB-A5AF-89CA7E87119F} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Orchard.Core + Orchard.Core + v4.5.1 + false + + + 4.0 + + + + false + + + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + ..\..\OrchardBasicCorrectness.ruleset + false + false + + + pdbonly + true + bin\ + TRACE + prompt + 4 + AllRules.ruleset + false + + + + + + 3.5 + + + + + + + + + False + ..\..\..\lib\aspnetmvc\System.Web.Mvc.dll + True + + + False + ..\..\..\lib\aspnetmvc\System.Web.WebPages.dll + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} + Orchard.Framework + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer + + + + + + + + Designer + + + Designer + + + Designer + + + + + + + + + + + + + + + + + + + + + + + Designer + + + + + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + $(ProjectDir)\..\Manifests + + + + + + + + + + + + False + True + 53609 + / + + + False + True + http://orchard.codeplex.com + False + + + + \ No newline at end of file diff --git a/src/Orchard.Web/Core/Properties/AssemblyInfo.cs b/src/Orchard.Web/Core/Properties/AssemblyInfo.cs index d25ebc828d6..642177ef77d 100644 --- a/src/Orchard.Web/Core/Properties/AssemblyInfo.cs +++ b/src/Orchard.Web/Core/Properties/AssemblyInfo.cs @@ -1,35 +1,35 @@ -using System.Reflection; -using System.Runtime.InteropServices; -using System.Security; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Orchard.Core")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyProduct("Orchard")] -[assembly: AssemblyCopyright("Copyright © .NET Foundation")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("ed6d019b-39e6-4978-87ae-78655a99a5c8")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.9.2")] -[assembly: AssemblyFileVersion("1.9.2")] - +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Orchard.Core")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyProduct("Orchard")] +[assembly: AssemblyCopyright("Copyright © .NET Foundation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("ed6d019b-39e6-4978-87ae-78655a99a5c8")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.9.2")] +[assembly: AssemblyFileVersion("1.9.2")] + diff --git a/src/Orchard.Web/Core/Reports/AdminMenu.cs b/src/Orchard.Web/Core/Reports/AdminMenu.cs index 1a48c91f5c1..f912d2f5971 100644 --- a/src/Orchard.Web/Core/Reports/AdminMenu.cs +++ b/src/Orchard.Web/Core/Reports/AdminMenu.cs @@ -1,17 +1,17 @@ -using Orchard.Localization; -using Orchard.Security; -using Orchard.UI.Navigation; - -namespace Orchard.Core.Reports { - public class AdminMenu : INavigationProvider { - public Localizer T { get; set; } - public string MenuName { get { return "admin"; } } - - public void GetNavigation(NavigationBuilder builder) { - builder.AddImageSet("reports") - .Add(T("Reports"), "12", - menu => menu.Add(T("View"), "0", item => item.Action("Index", "Admin", new { area = "Reports" }) - .Permission(StandardPermissions.SiteOwner))); - } - } +using Orchard.Localization; +using Orchard.Security; +using Orchard.UI.Navigation; + +namespace Orchard.Core.Reports { + public class AdminMenu : INavigationProvider { + public Localizer T { get; set; } + public string MenuName { get { return "admin"; } } + + public void GetNavigation(NavigationBuilder builder) { + builder.AddImageSet("reports") + .Add(T("Reports"), "12", + menu => menu.Add(T("View"), "0", item => item.Action("Index", "Admin", new { area = "Reports" }) + .Permission(StandardPermissions.SiteOwner))); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Reports/Controllers/AdminController.cs b/src/Orchard.Web/Core/Reports/Controllers/AdminController.cs index 07008d07877..a1c548d40d3 100644 --- a/src/Orchard.Web/Core/Reports/Controllers/AdminController.cs +++ b/src/Orchard.Web/Core/Reports/Controllers/AdminController.cs @@ -1,42 +1,42 @@ -using System.Linq; -using System.Web.Mvc; -using Orchard.Core.Reports.ViewModels; -using Orchard.Localization; -using Orchard.Reports.Services; -using Orchard.Security; - -namespace Orchard.Core.Reports.Controllers { - public class AdminController : Controller { - private readonly IReportsManager _reportsManager; - - public AdminController( - IOrchardServices services, - IReportsManager reportsManager) { - Services = services; - _reportsManager = reportsManager; - T = NullLocalizer.Instance; - } - - public IOrchardServices Services { get; set; } - public Localizer T { get; set; } - - public ActionResult Index() { - if (!Services.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not authorized to list reports"))) - return new HttpUnauthorizedResult(); - - var model = new ReportsAdminIndexViewModel { Reports = _reportsManager.GetReports().ToList() }; - - return View(model); - } - - public ActionResult Display(int id) { - if (!Services.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not authorized to display report"))) - return new HttpUnauthorizedResult(); - - var model = new DisplayReportViewModel { Report = _reportsManager.Get(id) }; - - return View(model); - } - - } +using System.Linq; +using System.Web.Mvc; +using Orchard.Core.Reports.ViewModels; +using Orchard.Localization; +using Orchard.Reports.Services; +using Orchard.Security; + +namespace Orchard.Core.Reports.Controllers { + public class AdminController : Controller { + private readonly IReportsManager _reportsManager; + + public AdminController( + IOrchardServices services, + IReportsManager reportsManager) { + Services = services; + _reportsManager = reportsManager; + T = NullLocalizer.Instance; + } + + public IOrchardServices Services { get; set; } + public Localizer T { get; set; } + + public ActionResult Index() { + if (!Services.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not authorized to list reports"))) + return new HttpUnauthorizedResult(); + + var model = new ReportsAdminIndexViewModel { Reports = _reportsManager.GetReports().ToList() }; + + return View(model); + } + + public ActionResult Display(int id) { + if (!Services.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not authorized to display report"))) + return new HttpUnauthorizedResult(); + + var model = new DisplayReportViewModel { Report = _reportsManager.Get(id) }; + + return View(model); + } + + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Reports/Module.txt b/src/Orchard.Web/Core/Reports/Module.txt index 7164c8a40ba..66e75473069 100644 --- a/src/Orchard.Web/Core/Reports/Module.txt +++ b/src/Orchard.Web/Core/Reports/Module.txt @@ -1,9 +1,9 @@ -Name: Reports -AntiForgery: enabled -Author: The Orchard Team -Website: http://orchardproject.net -Version: 1.9.2 -OrchardVersion: 1.9 -Description: The dashboard module is providing the reports screen of the application. -FeatureDescription: Reports management. -Category: Core +Name: Reports +AntiForgery: enabled +Author: The Orchard Team +Website: http://orchardproject.net +Version: 1.9.2 +OrchardVersion: 1.9 +Description: The dashboard module is providing the reports screen of the application. +FeatureDescription: Reports management. +Category: Core diff --git a/src/Orchard.Web/Core/Reports/Routes.cs b/src/Orchard.Web/Core/Reports/Routes.cs index c3e286fa865..4f28dc0ad1a 100644 --- a/src/Orchard.Web/Core/Reports/Routes.cs +++ b/src/Orchard.Web/Core/Reports/Routes.cs @@ -1,33 +1,33 @@ -using System.Collections.Generic; -using System.Web.Mvc; -using System.Web.Routing; -using Orchard.Mvc.Routes; - -namespace Orchard.Core.Reports { - public class Routes : IRouteProvider { - public void GetRoutes(ICollection routes) { - foreach (var routeDescriptor in GetRoutes()) - routes.Add(routeDescriptor); - } - - public IEnumerable GetRoutes() { - return new[] { - new RouteDescriptor { - Priority = -5, - Route = new Route( - "Admin/Reports", - new RouteValueDictionary { - {"area", "Reports"}, - {"controller", "Admin"}, - {"action", "Index"} - }, - new RouteValueDictionary(), - new RouteValueDictionary { - {"area", "Reports"} - }, - new MvcRouteHandler()) - } - }; - } - } +using System.Collections.Generic; +using System.Web.Mvc; +using System.Web.Routing; +using Orchard.Mvc.Routes; + +namespace Orchard.Core.Reports { + public class Routes : IRouteProvider { + public void GetRoutes(ICollection routes) { + foreach (var routeDescriptor in GetRoutes()) + routes.Add(routeDescriptor); + } + + public IEnumerable GetRoutes() { + return new[] { + new RouteDescriptor { + Priority = -5, + Route = new Route( + "Admin/Reports", + new RouteValueDictionary { + {"area", "Reports"}, + {"controller", "Admin"}, + {"action", "Index"} + }, + new RouteValueDictionary(), + new RouteValueDictionary { + {"area", "Reports"} + }, + new MvcRouteHandler()) + } + }; + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Reports/Styles/Web.config b/src/Orchard.Web/Core/Reports/Styles/Web.config index 74c71f22bd5..11135c33761 100644 --- a/src/Orchard.Web/Core/Reports/Styles/Web.config +++ b/src/Orchard.Web/Core/Reports/Styles/Web.config @@ -1,16 +1,16 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Reports/Styles/menu.reports-admin.css b/src/Orchard.Web/Core/Reports/Styles/menu.reports-admin.css index 23320f29ea4..549ec1efd5b 100644 --- a/src/Orchard.Web/Core/Reports/Styles/menu.reports-admin.css +++ b/src/Orchard.Web/Core/Reports/Styles/menu.reports-admin.css @@ -1,6 +1,6 @@ -.navicon-reports { -background-image:url(images/menu.reports.png) !important; -} -.navicon-reports:hover { -background-position:0 -30px !important; +.navicon-reports { +background-image:url(images/menu.reports.png) !important; +} +.navicon-reports:hover { +background-position:0 -30px !important; } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Reports/ViewModels/DisplayReportViewModel.cs b/src/Orchard.Web/Core/Reports/ViewModels/DisplayReportViewModel.cs index adb2dd6b4a5..d43eaa022fc 100644 --- a/src/Orchard.Web/Core/Reports/ViewModels/DisplayReportViewModel.cs +++ b/src/Orchard.Web/Core/Reports/ViewModels/DisplayReportViewModel.cs @@ -1,7 +1,7 @@ -using Orchard.Reports; - -namespace Orchard.Core.Reports.ViewModels { - public class DisplayReportViewModel { - public Report Report { get; set; } - } +using Orchard.Reports; + +namespace Orchard.Core.Reports.ViewModels { + public class DisplayReportViewModel { + public Report Report { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Reports/ViewModels/ReportsAdminIndexViewModel.cs b/src/Orchard.Web/Core/Reports/ViewModels/ReportsAdminIndexViewModel.cs index c7bbf9240e1..9ad86086fda 100644 --- a/src/Orchard.Web/Core/Reports/ViewModels/ReportsAdminIndexViewModel.cs +++ b/src/Orchard.Web/Core/Reports/ViewModels/ReportsAdminIndexViewModel.cs @@ -1,8 +1,8 @@ -using System.Collections.Generic; -using Orchard.Reports; - -namespace Orchard.Core.Reports.ViewModels { - public class ReportsAdminIndexViewModel { - public IList Reports { get; set; } - } +using System.Collections.Generic; +using Orchard.Reports; + +namespace Orchard.Core.Reports.ViewModels { + public class ReportsAdminIndexViewModel { + public IList Reports { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Reports/Views/Admin/Display.cshtml b/src/Orchard.Web/Core/Reports/Views/Admin/Display.cshtml index 6eb95e422fd..5dc75da1c3d 100644 --- a/src/Orchard.Web/Core/Reports/Views/Admin/Display.cshtml +++ b/src/Orchard.Web/Core/Reports/Views/Admin/Display.cshtml @@ -1,39 +1,39 @@ -@model DisplayReportViewModel -@using Orchard.Core.Reports.ViewModels; - -@{ Layout.Title = T("Display Report").ToString(); } - -@using(Html.BeginFormAntiForgeryPost()) { - @Html.ValidationSummary() -
        - - - - - - - - - - - - - - - - @foreach (var reportEntry in Model.Report.Entries) { - - - - - - } -
        @T("Type")@T("Message")@T("Date")
        - @reportEntry.Type - - @reportEntry.Message - - @reportEntry.Utc.ToLocalTime().ToShortDateString() @reportEntry.Utc.ToLocalTime().ToShortTimeString() -
        -
        +@model DisplayReportViewModel +@using Orchard.Core.Reports.ViewModels; + +@{ Layout.Title = T("Display Report").ToString(); } + +@using(Html.BeginFormAntiForgeryPost()) { + @Html.ValidationSummary() +
        + + + + + + + + + + + + + + + + @foreach (var reportEntry in Model.Report.Entries) { + + + + + + } +
        @T("Type")@T("Message")@T("Date")
        + @reportEntry.Type + + @reportEntry.Message + + @reportEntry.Utc.ToLocalTime().ToShortDateString() @reportEntry.Utc.ToLocalTime().ToShortTimeString() +
        +
        } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Reports/Views/Admin/Index.cshtml b/src/Orchard.Web/Core/Reports/Views/Admin/Index.cshtml index fbfb66dcaec..699ff0d76f4 100644 --- a/src/Orchard.Web/Core/Reports/Views/Admin/Index.cshtml +++ b/src/Orchard.Web/Core/Reports/Views/Admin/Index.cshtml @@ -1,39 +1,39 @@ -@model ReportsAdminIndexViewModel -@using Orchard.Core.Reports.ViewModels; - -@{ Layout.Title = T("Reports").ToString(); } - -@using(Html.BeginFormAntiForgeryPost()) { - @Html.ValidationSummary() -
        - - - - - - - - - - - - - - - - @foreach (var report in Model.Reports) { - - - - - - } -
        @T("Name")@T("Title")@T("Date")
        - @Html.ActionLink(report.ActivityName, "Display", new {id = report.ReportId}) - - @report.Title - - @report.Utc.ToLocalTime().ToShortDateString() @report.Utc.ToLocalTime().ToShortTimeString() -
        -
        +@model ReportsAdminIndexViewModel +@using Orchard.Core.Reports.ViewModels; + +@{ Layout.Title = T("Reports").ToString(); } + +@using(Html.BeginFormAntiForgeryPost()) { + @Html.ValidationSummary() +
        + + + + + + + + + + + + + + + + @foreach (var report in Model.Reports) { + + + + + + } +
        @T("Name")@T("Title")@T("Date")
        + @Html.ActionLink(report.ActivityName, "Display", new {id = report.ReportId}) + + @report.Title + + @report.Utc.ToLocalTime().ToShortDateString() @report.Utc.ToLocalTime().ToShortTimeString() +
        +
        } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Scheduling/Migrations.cs b/src/Orchard.Web/Core/Scheduling/Migrations.cs index 2c8faab078d..d3239d205f7 100644 --- a/src/Orchard.Web/Core/Scheduling/Migrations.cs +++ b/src/Orchard.Web/Core/Scheduling/Migrations.cs @@ -1,20 +1,20 @@ -using System; -using Orchard.Data.Migration; - -namespace Orchard.Core.Scheduling { - public class Migrations : DataMigrationImpl { - - public int Create() { - - SchemaBuilder.CreateTable("ScheduledTaskRecord", - table => table - .Column("Id", column => column.PrimaryKey().Identity()) - .Column("TaskType") - .Column("ScheduledUtc") - .Column("ContentItemVersionRecord_id") - ); - - return 1; - } - } +using System; +using Orchard.Data.Migration; + +namespace Orchard.Core.Scheduling { + public class Migrations : DataMigrationImpl { + + public int Create() { + + SchemaBuilder.CreateTable("ScheduledTaskRecord", + table => table + .Column("Id", column => column.PrimaryKey().Identity()) + .Column("TaskType") + .Column("ScheduledUtc") + .Column("ContentItemVersionRecord_id") + ); + + return 1; + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Scheduling/Models/ScheduledTaskRecord.cs b/src/Orchard.Web/Core/Scheduling/Models/ScheduledTaskRecord.cs index d8c16757db8..780d93a819f 100644 --- a/src/Orchard.Web/Core/Scheduling/Models/ScheduledTaskRecord.cs +++ b/src/Orchard.Web/Core/Scheduling/Models/ScheduledTaskRecord.cs @@ -1,11 +1,11 @@ -using System; -using Orchard.ContentManagement.Records; - -namespace Orchard.Core.Scheduling.Models { - public class ScheduledTaskRecord { - public virtual int Id { get; set; } - public virtual string TaskType { get; set; } - public virtual DateTime? ScheduledUtc { get; set; } - public virtual ContentItemVersionRecord ContentItemVersionRecord { get; set; } - } +using System; +using Orchard.ContentManagement.Records; + +namespace Orchard.Core.Scheduling.Models { + public class ScheduledTaskRecord { + public virtual int Id { get; set; } + public virtual string TaskType { get; set; } + public virtual DateTime? ScheduledUtc { get; set; } + public virtual ContentItemVersionRecord ContentItemVersionRecord { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Scheduling/Models/Task.cs b/src/Orchard.Web/Core/Scheduling/Models/Task.cs index 475d770db7e..7df15aa3bfe 100644 --- a/src/Orchard.Web/Core/Scheduling/Models/Task.cs +++ b/src/Orchard.Web/Core/Scheduling/Models/Task.cs @@ -1,41 +1,41 @@ -using System; -using Orchard.ContentManagement; -using Orchard.Tasks.Scheduling; - -namespace Orchard.Core.Scheduling.Models { - public class Task : IScheduledTask { - private readonly IContentManager _contentManager; - private readonly ScheduledTaskRecord _record; - private ContentItem _item; - private bool _itemInitialized; - - public Task(IContentManager contentManager, ScheduledTaskRecord record) { - // in spite of appearances, this is actually a created class, not IoC, - // but dependencies are passed in for lazy initialization purposes - _contentManager = contentManager; - _record = record; - } - - public string TaskType { - get { return _record.TaskType; } - } - - public DateTime? ScheduledUtc { - get { return _record.ScheduledUtc; } - } - - public ContentItem ContentItem { - get { - if (!_itemInitialized) { - if (_record.ContentItemVersionRecord != null) { - _item = _contentManager.Get( - _record.ContentItemVersionRecord.ContentItemRecord.Id, - VersionOptions.VersionRecord(_record.ContentItemVersionRecord.Id)); - } - _itemInitialized = true; - } - return _item; - } - } - } +using System; +using Orchard.ContentManagement; +using Orchard.Tasks.Scheduling; + +namespace Orchard.Core.Scheduling.Models { + public class Task : IScheduledTask { + private readonly IContentManager _contentManager; + private readonly ScheduledTaskRecord _record; + private ContentItem _item; + private bool _itemInitialized; + + public Task(IContentManager contentManager, ScheduledTaskRecord record) { + // in spite of appearances, this is actually a created class, not IoC, + // but dependencies are passed in for lazy initialization purposes + _contentManager = contentManager; + _record = record; + } + + public string TaskType { + get { return _record.TaskType; } + } + + public DateTime? ScheduledUtc { + get { return _record.ScheduledUtc; } + } + + public ContentItem ContentItem { + get { + if (!_itemInitialized) { + if (_record.ContentItemVersionRecord != null) { + _item = _contentManager.Get( + _record.ContentItemVersionRecord.ContentItemRecord.Id, + VersionOptions.VersionRecord(_record.ContentItemVersionRecord.Id)); + } + _itemInitialized = true; + } + return _item; + } + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Scheduling/Module.txt b/src/Orchard.Web/Core/Scheduling/Module.txt index 6ca5a06d4e8..417db0409ab 100644 --- a/src/Orchard.Web/Core/Scheduling/Module.txt +++ b/src/Orchard.Web/Core/Scheduling/Module.txt @@ -1,9 +1,9 @@ -Name: Scheduling -AntiForgery: enabled -Author: The Orchard Team -Website: http://orchardproject.net -Version: 1.9.2 -OrchardVersion: 1.9 -Description: The scheduling module enables background task scheduling. -FeatureDescription: Scheduled background tasks. -Category: Core +Name: Scheduling +AntiForgery: enabled +Author: The Orchard Team +Website: http://orchardproject.net +Version: 1.9.2 +OrchardVersion: 1.9 +Description: The scheduling module enables background task scheduling. +FeatureDescription: Scheduled background tasks. +Category: Core diff --git a/src/Orchard.Web/Core/Scheduling/Services/ScheduledTaskExecutor.cs b/src/Orchard.Web/Core/Scheduling/Services/ScheduledTaskExecutor.cs index d4483aaab19..14c297e57b7 100644 --- a/src/Orchard.Web/Core/Scheduling/Services/ScheduledTaskExecutor.cs +++ b/src/Orchard.Web/Core/Scheduling/Services/ScheduledTaskExecutor.cs @@ -1,78 +1,78 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using JetBrains.Annotations; -using Orchard.ContentManagement; -using Orchard.Core.Scheduling.Models; -using Orchard.Data; -using Orchard.Logging; -using Orchard.Services; -using Orchard.Tasks; -using Orchard.Tasks.Scheduling; -using Orchard.Exceptions; - -namespace Orchard.Core.Scheduling.Services { - [UsedImplicitly] - public class ScheduledTaskExecutor : IBackgroundTask { - private readonly IClock _clock; - private readonly IRepository _repository; - private readonly IEnumerable _handlers; - private readonly IContentManager _contentManager; - private readonly ITransactionManager _transactionManager; - - public ScheduledTaskExecutor( - IClock clock, - IRepository repository, - IEnumerable handlers, - IContentManager contentManager, - ITransactionManager transactionManager) { - _clock = clock; - _repository = repository; - _handlers = handlers; - _contentManager = contentManager; - _transactionManager = transactionManager; - Logger = NullLogger.Instance; - } - - public ILogger Logger { get; set; } - - public void Sweep() { - var taskEntries = _repository.Fetch(x => x.ScheduledUtc <= _clock.UtcNow) - .Select(x => new { x.Id, Action = x.TaskType }) - .ToArray(); - - foreach (var taskEntry in taskEntries) { - _transactionManager.RequireNew(); - - try { - // fetch the task - var taskRecord = _repository.Get(taskEntry.Id); - - // another server or thread has performed this work before us - if (taskRecord == null) { - continue; - } - - // removing record first helps avoid concurrent execution - _repository.Delete(taskRecord); - - var context = new ScheduledTaskContext { - Task = new Task(_contentManager, taskRecord) - }; - - // dispatch to standard or custom handlers - foreach (var handler in _handlers) { - handler.Process(context); - } - } - catch (Exception ex) { - if (ex.IsFatal()) { - throw; - } - Logger.Warning(ex, "Unable to process scheduled task #{0} of type {1}", taskEntry.Id, taskEntry.Action); - _transactionManager.Cancel(); - } - } - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using JetBrains.Annotations; +using Orchard.ContentManagement; +using Orchard.Core.Scheduling.Models; +using Orchard.Data; +using Orchard.Logging; +using Orchard.Services; +using Orchard.Tasks; +using Orchard.Tasks.Scheduling; +using Orchard.Exceptions; + +namespace Orchard.Core.Scheduling.Services { + [UsedImplicitly] + public class ScheduledTaskExecutor : IBackgroundTask { + private readonly IClock _clock; + private readonly IRepository _repository; + private readonly IEnumerable _handlers; + private readonly IContentManager _contentManager; + private readonly ITransactionManager _transactionManager; + + public ScheduledTaskExecutor( + IClock clock, + IRepository repository, + IEnumerable handlers, + IContentManager contentManager, + ITransactionManager transactionManager) { + _clock = clock; + _repository = repository; + _handlers = handlers; + _contentManager = contentManager; + _transactionManager = transactionManager; + Logger = NullLogger.Instance; + } + + public ILogger Logger { get; set; } + + public void Sweep() { + var taskEntries = _repository.Fetch(x => x.ScheduledUtc <= _clock.UtcNow) + .Select(x => new { x.Id, Action = x.TaskType }) + .ToArray(); + + foreach (var taskEntry in taskEntries) { + _transactionManager.RequireNew(); + + try { + // fetch the task + var taskRecord = _repository.Get(taskEntry.Id); + + // another server or thread has performed this work before us + if (taskRecord == null) { + continue; + } + + // removing record first helps avoid concurrent execution + _repository.Delete(taskRecord); + + var context = new ScheduledTaskContext { + Task = new Task(_contentManager, taskRecord) + }; + + // dispatch to standard or custom handlers + foreach (var handler in _handlers) { + handler.Process(context); + } + } + catch (Exception ex) { + if (ex.IsFatal()) { + throw; + } + Logger.Warning(ex, "Unable to process scheduled task #{0} of type {1}", taskEntry.Id, taskEntry.Action); + _transactionManager.Cancel(); + } + } + } + } +} diff --git a/src/Orchard.Web/Core/Scheduling/Services/ScheduledTaskManager.cs b/src/Orchard.Web/Core/Scheduling/Services/ScheduledTaskManager.cs index 2f2007c360c..28a3a7cb701 100644 --- a/src/Orchard.Web/Core/Scheduling/Services/ScheduledTaskManager.cs +++ b/src/Orchard.Web/Core/Scheduling/Services/ScheduledTaskManager.cs @@ -1,72 +1,72 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using JetBrains.Annotations; -using Orchard.ContentManagement; -using Orchard.Core.Scheduling.Models; -using Orchard.Data; -using Orchard.Logging; -using Orchard.Tasks.Scheduling; -using Orchard.Utility.Extensions; - -namespace Orchard.Core.Scheduling.Services { - [UsedImplicitly] - public class ScheduledTaskManager : IScheduledTaskManager { - private readonly IContentManager _contentManager; - private readonly IRepository _repository; - - public ScheduledTaskManager( - IContentManager contentManager, - IRepository repository) { - _repository = repository; - _contentManager = contentManager; - Logger = NullLogger.Instance; - } - - public ILogger Logger { get; set; } - - public void CreateTask(string action, DateTime scheduledUtc, ContentItem contentItem) { - var taskRecord = new ScheduledTaskRecord { - TaskType = action, - ScheduledUtc = scheduledUtc, - }; - if (contentItem != null) { - taskRecord.ContentItemVersionRecord = contentItem.VersionRecord; - } - _repository.Create(taskRecord); - } - - public IEnumerable GetTasks(ContentItem contentItem) { - return _repository - .Fetch(x => x.ContentItemVersionRecord.ContentItemRecord == contentItem.Record) - .Select(x => new Task(_contentManager, x)) - .Cast() - .ToReadOnlyCollection(); - } - - public IEnumerable GetTasks(string taskType, DateTime? scheduledBeforeUtc = null) { - var query = scheduledBeforeUtc != null - ? _repository.Fetch(t => t.TaskType == taskType && t.ScheduledUtc <= scheduledBeforeUtc) - : _repository.Fetch(t => t.TaskType == taskType); - - return - query.Select(x => new Task(_contentManager, x)) - .Cast() - .ToReadOnlyCollection(); - } - - public void DeleteTasks(ContentItem contentItem, Func predicate = null ) { - // if contentItem is null, all tasks are used - var tasks = contentItem == null ? _repository.Table : _repository - .Fetch(x => x.ContentItemVersionRecord.ContentItemRecord == contentItem.Record); - - foreach (var task in tasks) { - if (predicate == null || predicate(new Task(_contentManager, task))) { - _repository.Delete(task); - } - } - - _repository.Flush(); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using JetBrains.Annotations; +using Orchard.ContentManagement; +using Orchard.Core.Scheduling.Models; +using Orchard.Data; +using Orchard.Logging; +using Orchard.Tasks.Scheduling; +using Orchard.Utility.Extensions; + +namespace Orchard.Core.Scheduling.Services { + [UsedImplicitly] + public class ScheduledTaskManager : IScheduledTaskManager { + private readonly IContentManager _contentManager; + private readonly IRepository _repository; + + public ScheduledTaskManager( + IContentManager contentManager, + IRepository repository) { + _repository = repository; + _contentManager = contentManager; + Logger = NullLogger.Instance; + } + + public ILogger Logger { get; set; } + + public void CreateTask(string action, DateTime scheduledUtc, ContentItem contentItem) { + var taskRecord = new ScheduledTaskRecord { + TaskType = action, + ScheduledUtc = scheduledUtc, + }; + if (contentItem != null) { + taskRecord.ContentItemVersionRecord = contentItem.VersionRecord; + } + _repository.Create(taskRecord); + } + + public IEnumerable GetTasks(ContentItem contentItem) { + return _repository + .Fetch(x => x.ContentItemVersionRecord.ContentItemRecord == contentItem.Record) + .Select(x => new Task(_contentManager, x)) + .Cast() + .ToReadOnlyCollection(); + } + + public IEnumerable GetTasks(string taskType, DateTime? scheduledBeforeUtc = null) { + var query = scheduledBeforeUtc != null + ? _repository.Fetch(t => t.TaskType == taskType && t.ScheduledUtc <= scheduledBeforeUtc) + : _repository.Fetch(t => t.TaskType == taskType); + + return + query.Select(x => new Task(_contentManager, x)) + .Cast() + .ToReadOnlyCollection(); + } + + public void DeleteTasks(ContentItem contentItem, Func predicate = null ) { + // if contentItem is null, all tasks are used + var tasks = contentItem == null ? _repository.Table : _repository + .Fetch(x => x.ContentItemVersionRecord.ContentItemRecord == contentItem.Record); + + foreach (var task in tasks) { + if (predicate == null || predicate(new Task(_contentManager, task))) { + _repository.Delete(task); + } + } + + _repository.Flush(); + } + } +} diff --git a/src/Orchard.Web/Core/Settings/AdminMenu.cs b/src/Orchard.Web/Core/Settings/AdminMenu.cs index a54f5a5f3c8..ca74c6b666d 100644 --- a/src/Orchard.Web/Core/Settings/AdminMenu.cs +++ b/src/Orchard.Web/Core/Settings/AdminMenu.cs @@ -1,38 +1,38 @@ -using Orchard.ContentManagement; -using Orchard.Localization; -using Orchard.Security; -using Orchard.Settings; -using Orchard.UI.Navigation; - -namespace Orchard.Core.Settings { - public class AdminMenu : INavigationProvider { - private readonly ISiteService _siteService; - - public AdminMenu(ISiteService siteService, IOrchardServices orchardServices) { - _siteService = siteService; - Services = orchardServices; - } - - public Localizer T { get; set; } - public string MenuName { get { return "admin"; } } - public IOrchardServices Services { get; private set; } - - public void GetNavigation(NavigationBuilder builder) { - builder.AddImageSet("settings") - .Add(T("Settings"), "99", - menu => menu.Add(T("General"), "0", item => item.Action("Index", "Admin", new { area = "Settings", groupInfoId = "Index" }) - .Permission(Permissions.ManageSettings)), new [] {"collapsed"}); - - var site = _siteService.GetSiteSettings(); - if (site == null) - return; - - foreach (var groupInfo in Services.ContentManager.GetEditorGroupInfos(site.ContentItem)) { - GroupInfo info = groupInfo; - builder.Add(T("Settings"), - menu => menu.Add(info.Name, info.Position, item => item.Action("Index", "Admin", new { area = "Settings", groupInfoId = info.Id }) - .Permission(Permissions.ManageSettings))); - } - } - } -} +using Orchard.ContentManagement; +using Orchard.Localization; +using Orchard.Security; +using Orchard.Settings; +using Orchard.UI.Navigation; + +namespace Orchard.Core.Settings { + public class AdminMenu : INavigationProvider { + private readonly ISiteService _siteService; + + public AdminMenu(ISiteService siteService, IOrchardServices orchardServices) { + _siteService = siteService; + Services = orchardServices; + } + + public Localizer T { get; set; } + public string MenuName { get { return "admin"; } } + public IOrchardServices Services { get; private set; } + + public void GetNavigation(NavigationBuilder builder) { + builder.AddImageSet("settings") + .Add(T("Settings"), "99", + menu => menu.Add(T("General"), "0", item => item.Action("Index", "Admin", new { area = "Settings", groupInfoId = "Index" }) + .Permission(Permissions.ManageSettings)), new [] {"collapsed"}); + + var site = _siteService.GetSiteSettings(); + if (site == null) + return; + + foreach (var groupInfo in Services.ContentManager.GetEditorGroupInfos(site.ContentItem)) { + GroupInfo info = groupInfo; + builder.Add(T("Settings"), + menu => menu.Add(info.Name, info.Position, item => item.Action("Index", "Admin", new { area = "Settings", groupInfoId = info.Id }) + .Permission(Permissions.ManageSettings))); + } + } + } +} diff --git a/src/Orchard.Web/Core/Settings/Commands/SiteSettingsCommands.cs b/src/Orchard.Web/Core/Settings/Commands/SiteSettingsCommands.cs index 1778d48c3ca..015e144d9f5 100644 --- a/src/Orchard.Web/Core/Settings/Commands/SiteSettingsCommands.cs +++ b/src/Orchard.Web/Core/Settings/Commands/SiteSettingsCommands.cs @@ -1,55 +1,55 @@ -using Orchard.Commands; -using Orchard.ContentManagement; -using Orchard.Core.Settings.Models; -using Orchard.Mvc; -using Orchard.Mvc.Extensions; -using Orchard.Settings; -using Orchard.Utility.Extensions; - -namespace Orchard.Core.Settings.Commands { - public class SiteSettingsCommands : DefaultOrchardCommandHandler { - private readonly IHttpContextAccessor _httpContextAccessor; - private readonly ISiteService _siteService; - - public SiteSettingsCommands(IHttpContextAccessor httpContextAccessor, ISiteService siteService) { - _httpContextAccessor = httpContextAccessor; - _siteService = siteService; - } - - [OrchardSwitch] - public string BaseUrl { get; set; } - - [OrchardSwitch] - public bool Force { get; set; } - - [CommandName("site setting set baseurl")] - [CommandHelp("site setting set baseurl [/BaseUrl:baseUrl] [/Force:true]\r\n\tSet the 'BaseUrl' site settings. If no base url is provided, " + - "use the current request context heuristic to discover the base url. " + - "If 'Force' is true, set the site base url even if it is already set. " + - "The default behavior is to not override the setting.")] - [OrchardSwitches("BaseUrl,Force")] - public void SetBaseUrl() { - // Don't do anything if set and not forcing - if (!string.IsNullOrEmpty(_siteService.GetSiteSettings().BaseUrl)) { - if (!Force) { - Context.Output.WriteLine(T("'BaseUrl' site setting is already set. Use the 'Force' flag to override.")); - return; - } - } - - // Retrieve request URL if BaseUrl not provided as a switch value - if (string.IsNullOrEmpty(BaseUrl)) { - if (_httpContextAccessor.Current().IsBackgroundContext()) { - Context.Output.WriteLine(T("No HTTP request available to determine the base url of the site")); - return; - } - var request = _httpContextAccessor.Current().Request; - BaseUrl = request.ToApplicationRootUrlString(); - } - - // Update base url - _siteService.GetSiteSettings().As().BaseUrl = BaseUrl; - Context.Output.WriteLine(T("'BaseUrl' site setting set to '{0}'", BaseUrl)); - } - } +using Orchard.Commands; +using Orchard.ContentManagement; +using Orchard.Core.Settings.Models; +using Orchard.Mvc; +using Orchard.Mvc.Extensions; +using Orchard.Settings; +using Orchard.Utility.Extensions; + +namespace Orchard.Core.Settings.Commands { + public class SiteSettingsCommands : DefaultOrchardCommandHandler { + private readonly IHttpContextAccessor _httpContextAccessor; + private readonly ISiteService _siteService; + + public SiteSettingsCommands(IHttpContextAccessor httpContextAccessor, ISiteService siteService) { + _httpContextAccessor = httpContextAccessor; + _siteService = siteService; + } + + [OrchardSwitch] + public string BaseUrl { get; set; } + + [OrchardSwitch] + public bool Force { get; set; } + + [CommandName("site setting set baseurl")] + [CommandHelp("site setting set baseurl [/BaseUrl:baseUrl] [/Force:true]\r\n\tSet the 'BaseUrl' site settings. If no base url is provided, " + + "use the current request context heuristic to discover the base url. " + + "If 'Force' is true, set the site base url even if it is already set. " + + "The default behavior is to not override the setting.")] + [OrchardSwitches("BaseUrl,Force")] + public void SetBaseUrl() { + // Don't do anything if set and not forcing + if (!string.IsNullOrEmpty(_siteService.GetSiteSettings().BaseUrl)) { + if (!Force) { + Context.Output.WriteLine(T("'BaseUrl' site setting is already set. Use the 'Force' flag to override.")); + return; + } + } + + // Retrieve request URL if BaseUrl not provided as a switch value + if (string.IsNullOrEmpty(BaseUrl)) { + if (_httpContextAccessor.Current().IsBackgroundContext()) { + Context.Output.WriteLine(T("No HTTP request available to determine the base url of the site")); + return; + } + var request = _httpContextAccessor.Current().Request; + BaseUrl = request.ToApplicationRootUrlString(); + } + + // Update base url + _siteService.GetSiteSettings().As().BaseUrl = BaseUrl; + Context.Output.WriteLine(T("'BaseUrl' site setting set to '{0}'", BaseUrl)); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/Controllers/AdminController.cs b/src/Orchard.Web/Core/Settings/Controllers/AdminController.cs index e42ad63fb19..2fc607a04f6 100644 --- a/src/Orchard.Web/Core/Settings/Controllers/AdminController.cs +++ b/src/Orchard.Web/Core/Settings/Controllers/AdminController.cs @@ -1,135 +1,135 @@ -using System.Globalization; -using System.Linq; -using System.Web.Mvc; -using Orchard.Core.Settings.ViewModels; -using Orchard.Localization; -using Orchard.ContentManagement; -using Orchard.Localization.Services; -using Orchard.Settings; -using Orchard.UI.Notify; - -namespace Orchard.Core.Settings.Controllers { - [ValidateInput(false)] - public class AdminController : Controller, IUpdateModel { - private readonly ISiteService _siteService; - private readonly ICultureManager _cultureManager; - public IOrchardServices Services { get; private set; } - - public AdminController( - ISiteService siteService, - IOrchardServices services, - ICultureManager cultureManager) { - _siteService = siteService; - _cultureManager = cultureManager; - Services = services; - T = NullLocalizer.Instance; - } - - public Localizer T { get; set; } - - public ActionResult Index(string groupInfoId) { - if (!Services.Authorizer.Authorize(Permissions.ManageSettings, T("Not authorized to manage settings"))) - return new HttpUnauthorizedResult(); - - dynamic model; - var site = _siteService.GetSiteSettings(); - if (!string.IsNullOrWhiteSpace(groupInfoId)) { - model = Services.ContentManager.BuildEditor(site, groupInfoId); - - if (model == null) - return HttpNotFound(); - - var groupInfo = Services.ContentManager.GetEditorGroupInfo(site, groupInfoId); - if (groupInfo == null) - return HttpNotFound(); - - model.GroupInfo = groupInfo; - } - else { - model = Services.ContentManager.BuildEditor(site); - } - - return View(model); - } - - [HttpPost, ActionName("Index")] - public ActionResult IndexPOST(string groupInfoId) { - if (!Services.Authorizer.Authorize(Permissions.ManageSettings, T("Not authorized to manage settings"))) - return new HttpUnauthorizedResult(); - - var site = _siteService.GetSiteSettings(); - var model = Services.ContentManager.UpdateEditor(site, this, groupInfoId); - - GroupInfo groupInfo = null; - - if (!string.IsNullOrWhiteSpace(groupInfoId)) { - if (model == null) { - Services.TransactionManager.Cancel(); - return HttpNotFound(); - } - - groupInfo = Services.ContentManager.GetEditorGroupInfo(site, groupInfoId); - if (groupInfo == null) { - Services.TransactionManager.Cancel(); - return HttpNotFound(); - } - } - - if (!ModelState.IsValid) { - Services.TransactionManager.Cancel(); - model.GroupInfo = groupInfo; - - return View(model); - } - - Services.Notifier.Information(T("Settings updated")); - return RedirectToAction("Index"); - } - - public ActionResult Culture() { - //todo: class and/or method attributes for our auth? - if (!Services.Authorizer.Authorize(Permissions.ManageSettings, T("Not authorized to manage settings"))) - return new HttpUnauthorizedResult(); - - var model = new SiteCulturesViewModel { - CurrentCulture = _cultureManager.GetCurrentCulture(HttpContext), - SiteCultures = _cultureManager.ListCultures(), - }; - model.AvailableSystemCultures = CultureInfo.GetCultures(CultureTypes.SpecificCultures) - .Select(ci => ci.Name) - .Where(s => !model.SiteCultures.Contains(s)); - - return View(model); - } - - [HttpPost] - public ActionResult AddCulture(string systemCultureName, string cultureName) { - if (!Services.Authorizer.Authorize(Permissions.ManageSettings, T("Not authorized to manage settings"))) - return new HttpUnauthorizedResult(); - - cultureName = string.IsNullOrWhiteSpace(cultureName) ? systemCultureName : cultureName; - - if (!string.IsNullOrWhiteSpace(cultureName)) { - _cultureManager.AddCulture(cultureName); - } - return RedirectToAction("Culture"); - } - - [HttpPost] - public ActionResult DeleteCulture(string cultureName) { - if (!Services.Authorizer.Authorize(Permissions.ManageSettings, T("Not authorized to manage settings"))) - return new HttpUnauthorizedResult(); - - _cultureManager.DeleteCulture(cultureName); - return RedirectToAction("Culture"); - } - - bool IUpdateModel.TryUpdateModel(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) { - return TryUpdateModel(model, prefix, includeProperties, excludeProperties); - } - - void IUpdateModel.AddModelError(string key, LocalizedString errorMessage) { - ModelState.AddModelError(key, errorMessage.ToString()); - } - } -} +using System.Globalization; +using System.Linq; +using System.Web.Mvc; +using Orchard.Core.Settings.ViewModels; +using Orchard.Localization; +using Orchard.ContentManagement; +using Orchard.Localization.Services; +using Orchard.Settings; +using Orchard.UI.Notify; + +namespace Orchard.Core.Settings.Controllers { + [ValidateInput(false)] + public class AdminController : Controller, IUpdateModel { + private readonly ISiteService _siteService; + private readonly ICultureManager _cultureManager; + public IOrchardServices Services { get; private set; } + + public AdminController( + ISiteService siteService, + IOrchardServices services, + ICultureManager cultureManager) { + _siteService = siteService; + _cultureManager = cultureManager; + Services = services; + T = NullLocalizer.Instance; + } + + public Localizer T { get; set; } + + public ActionResult Index(string groupInfoId) { + if (!Services.Authorizer.Authorize(Permissions.ManageSettings, T("Not authorized to manage settings"))) + return new HttpUnauthorizedResult(); + + dynamic model; + var site = _siteService.GetSiteSettings(); + if (!string.IsNullOrWhiteSpace(groupInfoId)) { + model = Services.ContentManager.BuildEditor(site, groupInfoId); + + if (model == null) + return HttpNotFound(); + + var groupInfo = Services.ContentManager.GetEditorGroupInfo(site, groupInfoId); + if (groupInfo == null) + return HttpNotFound(); + + model.GroupInfo = groupInfo; + } + else { + model = Services.ContentManager.BuildEditor(site); + } + + return View(model); + } + + [HttpPost, ActionName("Index")] + public ActionResult IndexPOST(string groupInfoId) { + if (!Services.Authorizer.Authorize(Permissions.ManageSettings, T("Not authorized to manage settings"))) + return new HttpUnauthorizedResult(); + + var site = _siteService.GetSiteSettings(); + var model = Services.ContentManager.UpdateEditor(site, this, groupInfoId); + + GroupInfo groupInfo = null; + + if (!string.IsNullOrWhiteSpace(groupInfoId)) { + if (model == null) { + Services.TransactionManager.Cancel(); + return HttpNotFound(); + } + + groupInfo = Services.ContentManager.GetEditorGroupInfo(site, groupInfoId); + if (groupInfo == null) { + Services.TransactionManager.Cancel(); + return HttpNotFound(); + } + } + + if (!ModelState.IsValid) { + Services.TransactionManager.Cancel(); + model.GroupInfo = groupInfo; + + return View(model); + } + + Services.Notifier.Information(T("Settings updated")); + return RedirectToAction("Index"); + } + + public ActionResult Culture() { + //todo: class and/or method attributes for our auth? + if (!Services.Authorizer.Authorize(Permissions.ManageSettings, T("Not authorized to manage settings"))) + return new HttpUnauthorizedResult(); + + var model = new SiteCulturesViewModel { + CurrentCulture = _cultureManager.GetCurrentCulture(HttpContext), + SiteCultures = _cultureManager.ListCultures(), + }; + model.AvailableSystemCultures = CultureInfo.GetCultures(CultureTypes.SpecificCultures) + .Select(ci => ci.Name) + .Where(s => !model.SiteCultures.Contains(s)); + + return View(model); + } + + [HttpPost] + public ActionResult AddCulture(string systemCultureName, string cultureName) { + if (!Services.Authorizer.Authorize(Permissions.ManageSettings, T("Not authorized to manage settings"))) + return new HttpUnauthorizedResult(); + + cultureName = string.IsNullOrWhiteSpace(cultureName) ? systemCultureName : cultureName; + + if (!string.IsNullOrWhiteSpace(cultureName)) { + _cultureManager.AddCulture(cultureName); + } + return RedirectToAction("Culture"); + } + + [HttpPost] + public ActionResult DeleteCulture(string cultureName) { + if (!Services.Authorizer.Authorize(Permissions.ManageSettings, T("Not authorized to manage settings"))) + return new HttpUnauthorizedResult(); + + _cultureManager.DeleteCulture(cultureName); + return RedirectToAction("Culture"); + } + + bool IUpdateModel.TryUpdateModel(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) { + return TryUpdateModel(model, prefix, includeProperties, excludeProperties); + } + + void IUpdateModel.AddModelError(string key, LocalizedString errorMessage) { + ModelState.AddModelError(key, errorMessage.ToString()); + } + } +} diff --git a/src/Orchard.Web/Core/Settings/Descriptor/Records/ShellDescriptorRecord.cs b/src/Orchard.Web/Core/Settings/Descriptor/Records/ShellDescriptorRecord.cs index c94376503e3..37c38c6cff6 100644 --- a/src/Orchard.Web/Core/Settings/Descriptor/Records/ShellDescriptorRecord.cs +++ b/src/Orchard.Web/Core/Settings/Descriptor/Records/ShellDescriptorRecord.cs @@ -1,20 +1,20 @@ -using System.Collections.Generic; -using Orchard.Data.Conventions; - -namespace Orchard.Core.Settings.Descriptor.Records { - public class ShellDescriptorRecord { - public ShellDescriptorRecord() { - Features=new List(); - Parameters=new List(); - } - - public virtual int Id { get; set; } - public virtual int SerialNumber { get; set; } - - [CascadeAllDeleteOrphan] - public virtual IList Features { get; set; } - - [CascadeAllDeleteOrphan] - public virtual IList Parameters { get; set; } - } -} +using System.Collections.Generic; +using Orchard.Data.Conventions; + +namespace Orchard.Core.Settings.Descriptor.Records { + public class ShellDescriptorRecord { + public ShellDescriptorRecord() { + Features=new List(); + Parameters=new List(); + } + + public virtual int Id { get; set; } + public virtual int SerialNumber { get; set; } + + [CascadeAllDeleteOrphan] + public virtual IList Features { get; set; } + + [CascadeAllDeleteOrphan] + public virtual IList Parameters { get; set; } + } +} diff --git a/src/Orchard.Web/Core/Settings/Descriptor/Records/ShellFeatureRecord.cs b/src/Orchard.Web/Core/Settings/Descriptor/Records/ShellFeatureRecord.cs index 611a8d79aeb..2849ef0780c 100644 --- a/src/Orchard.Web/Core/Settings/Descriptor/Records/ShellFeatureRecord.cs +++ b/src/Orchard.Web/Core/Settings/Descriptor/Records/ShellFeatureRecord.cs @@ -1,7 +1,7 @@ -namespace Orchard.Core.Settings.Descriptor.Records { - public class ShellFeatureRecord { - public virtual int Id { get; set; } - public virtual ShellDescriptorRecord ShellDescriptorRecord { get; set; } - public virtual string Name { get; set; } - } +namespace Orchard.Core.Settings.Descriptor.Records { + public class ShellFeatureRecord { + public virtual int Id { get; set; } + public virtual ShellDescriptorRecord ShellDescriptorRecord { get; set; } + public virtual string Name { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/Descriptor/Records/ShellParameterRecord.cs b/src/Orchard.Web/Core/Settings/Descriptor/Records/ShellParameterRecord.cs index 56ed6b743f7..ea3ee4b53e5 100644 --- a/src/Orchard.Web/Core/Settings/Descriptor/Records/ShellParameterRecord.cs +++ b/src/Orchard.Web/Core/Settings/Descriptor/Records/ShellParameterRecord.cs @@ -1,9 +1,9 @@ -namespace Orchard.Core.Settings.Descriptor.Records { - public class ShellParameterRecord { - public virtual int Id { get; set; } - public virtual ShellDescriptorRecord ShellDescriptorRecord { get; set; } - public virtual string Component { get; set; } - public virtual string Name { get; set; } - public virtual string Value { get; set; } - } +namespace Orchard.Core.Settings.Descriptor.Records { + public class ShellParameterRecord { + public virtual int Id { get; set; } + public virtual ShellDescriptorRecord ShellDescriptorRecord { get; set; } + public virtual string Component { get; set; } + public virtual string Name { get; set; } + public virtual string Value { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/Descriptor/ShellDescriptorManager.cs b/src/Orchard.Web/Core/Settings/Descriptor/ShellDescriptorManager.cs index a6a179d686e..faf80b3ecde 100644 --- a/src/Orchard.Web/Core/Settings/Descriptor/ShellDescriptorManager.cs +++ b/src/Orchard.Web/Core/Settings/Descriptor/ShellDescriptorManager.cs @@ -1,96 +1,96 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Orchard.Core.Settings.Descriptor.Records; -using Orchard.Data; -using Orchard.Environment.Configuration; -using Orchard.Environment.Descriptor; -using Orchard.Environment.Descriptor.Models; -using Orchard.Logging; - -namespace Orchard.Core.Settings.Descriptor { - public class ShellDescriptorManager : Component, IShellDescriptorManager { - private readonly IRepository _shellDescriptorRepository; - private readonly IShellDescriptorManagerEventHandler _events; - private readonly ShellSettings _shellSettings; - - public ShellDescriptorManager( - IRepository shellDescriptorRepository, - IShellDescriptorManagerEventHandler events, - ShellSettings shellSettings) { - _shellDescriptorRepository = shellDescriptorRepository; - _events = events; - _shellSettings = shellSettings; - } - - public ShellDescriptor GetShellDescriptor() { - ShellDescriptorRecord shellDescriptorRecord = GetDescriptorRecord(); - if (shellDescriptorRecord == null) return null; - return GetShellDescriptorFromRecord(shellDescriptorRecord); - } - - private static ShellDescriptor GetShellDescriptorFromRecord(ShellDescriptorRecord shellDescriptorRecord) { - ShellDescriptor descriptor = new ShellDescriptor { SerialNumber = shellDescriptorRecord.SerialNumber }; - var descriptorFeatures = new List(); - foreach (var descriptorFeatureRecord in shellDescriptorRecord.Features) { - descriptorFeatures.Add(new ShellFeature { Name = descriptorFeatureRecord.Name }); - } - descriptor.Features = descriptorFeatures; - var descriptorParameters = new List(); - foreach (var descriptorParameterRecord in shellDescriptorRecord.Parameters) { - descriptorParameters.Add( - new ShellParameter { - Component = descriptorParameterRecord.Component, - Name = descriptorParameterRecord.Name, - Value = descriptorParameterRecord.Value - }); - } - descriptor.Parameters = descriptorParameters; - - return descriptor; - } - - private ShellDescriptorRecord GetDescriptorRecord() { - return _shellDescriptorRepository.Get(x => x != null); - } - - public void UpdateShellDescriptor(int priorSerialNumber, IEnumerable enabledFeatures, IEnumerable parameters) { - ShellDescriptorRecord shellDescriptorRecord = GetDescriptorRecord(); - var serialNumber = shellDescriptorRecord == null ? 0 : shellDescriptorRecord.SerialNumber; - if (priorSerialNumber != serialNumber) - throw new InvalidOperationException(T("Invalid serial number for shell descriptor").ToString()); - - Logger.Information("Updating shell descriptor for shell '{0}'...", _shellSettings.Name); - - if (shellDescriptorRecord == null) { - shellDescriptorRecord = new ShellDescriptorRecord { SerialNumber = 1 }; - _shellDescriptorRepository.Create(shellDescriptorRecord); - } - else { - shellDescriptorRecord.SerialNumber++; - } - - shellDescriptorRecord.Features.Clear(); - foreach (var feature in enabledFeatures) { - shellDescriptorRecord.Features.Add(new ShellFeatureRecord { Name = feature.Name, ShellDescriptorRecord = shellDescriptorRecord }); - } - Logger.Debug("Enabled features for shell '{0}' set: {1}.", _shellSettings.Name, String.Join(", ", enabledFeatures.Select(feature => feature.Name))); - - - shellDescriptorRecord.Parameters.Clear(); - foreach (var parameter in parameters) { - shellDescriptorRecord.Parameters.Add(new ShellParameterRecord { - Component = parameter.Component, - Name = parameter.Name, - Value = parameter.Value, - ShellDescriptorRecord = shellDescriptorRecord - }); - } - Logger.Debug("Parameters for shell '{0}' set: {1}.", _shellSettings.Name, String.Join(", ", parameters.Select(parameter => parameter.Name + "-" + parameter.Value))); - - Logger.Information("Shell descriptor updated for shell '{0}'.", _shellSettings.Name); - - _events.Changed(GetShellDescriptorFromRecord(shellDescriptorRecord), _shellSettings.Name); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using Orchard.Core.Settings.Descriptor.Records; +using Orchard.Data; +using Orchard.Environment.Configuration; +using Orchard.Environment.Descriptor; +using Orchard.Environment.Descriptor.Models; +using Orchard.Logging; + +namespace Orchard.Core.Settings.Descriptor { + public class ShellDescriptorManager : Component, IShellDescriptorManager { + private readonly IRepository _shellDescriptorRepository; + private readonly IShellDescriptorManagerEventHandler _events; + private readonly ShellSettings _shellSettings; + + public ShellDescriptorManager( + IRepository shellDescriptorRepository, + IShellDescriptorManagerEventHandler events, + ShellSettings shellSettings) { + _shellDescriptorRepository = shellDescriptorRepository; + _events = events; + _shellSettings = shellSettings; + } + + public ShellDescriptor GetShellDescriptor() { + ShellDescriptorRecord shellDescriptorRecord = GetDescriptorRecord(); + if (shellDescriptorRecord == null) return null; + return GetShellDescriptorFromRecord(shellDescriptorRecord); + } + + private static ShellDescriptor GetShellDescriptorFromRecord(ShellDescriptorRecord shellDescriptorRecord) { + ShellDescriptor descriptor = new ShellDescriptor { SerialNumber = shellDescriptorRecord.SerialNumber }; + var descriptorFeatures = new List(); + foreach (var descriptorFeatureRecord in shellDescriptorRecord.Features) { + descriptorFeatures.Add(new ShellFeature { Name = descriptorFeatureRecord.Name }); + } + descriptor.Features = descriptorFeatures; + var descriptorParameters = new List(); + foreach (var descriptorParameterRecord in shellDescriptorRecord.Parameters) { + descriptorParameters.Add( + new ShellParameter { + Component = descriptorParameterRecord.Component, + Name = descriptorParameterRecord.Name, + Value = descriptorParameterRecord.Value + }); + } + descriptor.Parameters = descriptorParameters; + + return descriptor; + } + + private ShellDescriptorRecord GetDescriptorRecord() { + return _shellDescriptorRepository.Get(x => x != null); + } + + public void UpdateShellDescriptor(int priorSerialNumber, IEnumerable enabledFeatures, IEnumerable parameters) { + ShellDescriptorRecord shellDescriptorRecord = GetDescriptorRecord(); + var serialNumber = shellDescriptorRecord == null ? 0 : shellDescriptorRecord.SerialNumber; + if (priorSerialNumber != serialNumber) + throw new InvalidOperationException(T("Invalid serial number for shell descriptor").ToString()); + + Logger.Information("Updating shell descriptor for shell '{0}'...", _shellSettings.Name); + + if (shellDescriptorRecord == null) { + shellDescriptorRecord = new ShellDescriptorRecord { SerialNumber = 1 }; + _shellDescriptorRepository.Create(shellDescriptorRecord); + } + else { + shellDescriptorRecord.SerialNumber++; + } + + shellDescriptorRecord.Features.Clear(); + foreach (var feature in enabledFeatures) { + shellDescriptorRecord.Features.Add(new ShellFeatureRecord { Name = feature.Name, ShellDescriptorRecord = shellDescriptorRecord }); + } + Logger.Debug("Enabled features for shell '{0}' set: {1}.", _shellSettings.Name, String.Join(", ", enabledFeatures.Select(feature => feature.Name))); + + + shellDescriptorRecord.Parameters.Clear(); + foreach (var parameter in parameters) { + shellDescriptorRecord.Parameters.Add(new ShellParameterRecord { + Component = parameter.Component, + Name = parameter.Name, + Value = parameter.Value, + ShellDescriptorRecord = shellDescriptorRecord + }); + } + Logger.Debug("Parameters for shell '{0}' set: {1}.", _shellSettings.Name, String.Join(", ", parameters.Select(parameter => parameter.Name + "-" + parameter.Value))); + + Logger.Information("Shell descriptor updated for shell '{0}'.", _shellSettings.Name); + + _events.Changed(GetShellDescriptorFromRecord(shellDescriptorRecord), _shellSettings.Name); + } + } +} diff --git a/src/Orchard.Web/Core/Settings/Drivers/SiteSettingsPartDriver.cs b/src/Orchard.Web/Core/Settings/Drivers/SiteSettingsPartDriver.cs index ec76f1ebc3a..a3fe1079449 100644 --- a/src/Orchard.Web/Core/Settings/Drivers/SiteSettingsPartDriver.cs +++ b/src/Orchard.Web/Core/Settings/Drivers/SiteSettingsPartDriver.cs @@ -1,138 +1,138 @@ -using System; -using System.Net; -using JetBrains.Annotations; -using Orchard.ContentManagement; -using Orchard.ContentManagement.Drivers; -using Orchard.Core.Settings.Models; -using Orchard.Core.Settings.ViewModels; -using Orchard.Localization; -using Orchard.Localization.Services; -using Orchard.Logging; -using Orchard.Security; -using Orchard.Settings; -using Orchard.UI.Notify; -using Orchard.Exceptions; - -namespace Orchard.Core.Settings.Drivers { - [UsedImplicitly] - public class SiteSettingsPartDriver : ContentPartDriver { - private readonly ISiteService _siteService; - private readonly ICultureManager _cultureManager; - private readonly ICalendarManager _calendarProvider; - private readonly IMembershipService _membershipService; - private readonly INotifier _notifier; - private readonly IAuthorizer _authorizer; - - public SiteSettingsPartDriver( - ISiteService siteService, - ICultureManager cultureManager, - ICalendarManager calendarProvider, - IMembershipService membershipService, - INotifier notifier, - IAuthorizer authorizer) { - _siteService = siteService; - _cultureManager = cultureManager; - _calendarProvider = calendarProvider; - _membershipService = membershipService; - _notifier = notifier; - _authorizer = authorizer; - - T = NullLocalizer.Instance; - Logger = NullLogger.Instance; - } - - public Localizer T { get; set; } - public ILogger Logger { get; set; } - - protected override string Prefix { get { return "SiteSettings"; } } - - protected override DriverResult Editor(SiteSettingsPart part, dynamic shapeHelper) { - var site = _siteService.GetSiteSettings().As(); - - var model = new SiteSettingsPartViewModel { - Site = site, - SiteCultures = _cultureManager.ListCultures(), - SiteCalendars = _calendarProvider.ListCalendars(), - TimeZones = TimeZoneInfo.GetSystemTimeZones() - }; - - return ContentShape("Parts_Settings_SiteSettingsPart", - () => shapeHelper.EditorTemplate(TemplateName: "Parts.Settings.SiteSettingsPart", Model: model, Prefix: Prefix)); - } - - protected override DriverResult Editor(SiteSettingsPart part, IUpdateModel updater, dynamic shapeHelper) { - var site = _siteService.GetSiteSettings().As(); - var model = new SiteSettingsPartViewModel { - Site = site, - SiteCultures = _cultureManager.ListCultures(), - SiteCalendars = _calendarProvider.ListCalendars(), - TimeZones = TimeZoneInfo.GetSystemTimeZones() - }; - - var previousBaseUrl = model.Site.BaseUrl; - - // Update all properties but not SuperUser, MaxPageSize and BaseUrl. - updater.TryUpdateModel(model, Prefix, null, new [] { "Site.SuperUser", "Site.MaxPageSize", "Site.BaseUrl", "Site.MaxPagedCount" }); - - // only a user with SiteOwner permission can change the site owner - if (_authorizer.Authorize(StandardPermissions.SiteOwner)) { - updater.TryUpdateModel(model, Prefix, new[] { "Site.SuperUser", "Site.MaxPageSize", "Site.BaseUrl", "Site.MaxPagedCount" }, null); - - // ensures the super user is fully empty - if (String.IsNullOrEmpty(model.SuperUser)) { - model.SuperUser = String.Empty; - } - // otherwise the super user must be a valid user, to prevent an external account to impersonate as this name - //the user management module ensures the super user can't be deleted, but it can be disabled - else { - if (_membershipService.GetUser(model.SuperUser) == null) { - updater.AddModelError("SuperUser", T("The user {0} was not found", model.SuperUser)); - } - } - - // ensure the base url is absolute if provided - if (!String.IsNullOrWhiteSpace(model.Site.BaseUrl)) { - if (!Uri.IsWellFormedUriString(model.Site.BaseUrl, UriKind.Absolute)) { - updater.AddModelError("BaseUrl", T("The base url must be absolute.")); - } - // if the base url has been modified, try to ping it - else if (!String.Equals(previousBaseUrl, model.Site.BaseUrl, StringComparison.OrdinalIgnoreCase)) { - try { - var request = WebRequest.Create(model.Site.BaseUrl) as HttpWebRequest; - if (request != null) { - using (request.GetResponse() as HttpWebResponse) { } - } - } - catch (Exception ex) { - if (ex.IsFatal()) { - throw; - } - _notifier.Warning(T("The base url you entered could not be requested from current location.")); - Logger.Warning(ex, "Could not query base url: {0}", model.Site.BaseUrl); - } - } - } - } - - return ContentShape("Parts_Settings_SiteSettingsPart", - () => shapeHelper.EditorTemplate(TemplateName: "Parts.Settings.SiteSettingsPart", Model: model, Prefix: Prefix)); - } - - protected override void Exporting(SiteSettingsPart part, ContentManagement.Handlers.ExportContentContext context) { - context.Element(part.PartDefinition.Name).SetAttributeValue("SupportedCultures", string.Join(";", _cultureManager.ListCultures())); - } - - protected override void Importing(SiteSettingsPart part, ContentManagement.Handlers.ImportContentContext context) { - // Don't do anything if the tag is not specified. - if (context.Data.Element(part.PartDefinition.Name) == null) { - return; - } - - context.ImportAttribute(part.PartDefinition.Name, "SupportedCultures", supportedCultures => { - foreach (var culture in supportedCultures.Split(';')) { - _cultureManager.AddCulture(culture); - } - }); - } - } +using System; +using System.Net; +using JetBrains.Annotations; +using Orchard.ContentManagement; +using Orchard.ContentManagement.Drivers; +using Orchard.Core.Settings.Models; +using Orchard.Core.Settings.ViewModels; +using Orchard.Localization; +using Orchard.Localization.Services; +using Orchard.Logging; +using Orchard.Security; +using Orchard.Settings; +using Orchard.UI.Notify; +using Orchard.Exceptions; + +namespace Orchard.Core.Settings.Drivers { + [UsedImplicitly] + public class SiteSettingsPartDriver : ContentPartDriver { + private readonly ISiteService _siteService; + private readonly ICultureManager _cultureManager; + private readonly ICalendarManager _calendarProvider; + private readonly IMembershipService _membershipService; + private readonly INotifier _notifier; + private readonly IAuthorizer _authorizer; + + public SiteSettingsPartDriver( + ISiteService siteService, + ICultureManager cultureManager, + ICalendarManager calendarProvider, + IMembershipService membershipService, + INotifier notifier, + IAuthorizer authorizer) { + _siteService = siteService; + _cultureManager = cultureManager; + _calendarProvider = calendarProvider; + _membershipService = membershipService; + _notifier = notifier; + _authorizer = authorizer; + + T = NullLocalizer.Instance; + Logger = NullLogger.Instance; + } + + public Localizer T { get; set; } + public ILogger Logger { get; set; } + + protected override string Prefix { get { return "SiteSettings"; } } + + protected override DriverResult Editor(SiteSettingsPart part, dynamic shapeHelper) { + var site = _siteService.GetSiteSettings().As(); + + var model = new SiteSettingsPartViewModel { + Site = site, + SiteCultures = _cultureManager.ListCultures(), + SiteCalendars = _calendarProvider.ListCalendars(), + TimeZones = TimeZoneInfo.GetSystemTimeZones() + }; + + return ContentShape("Parts_Settings_SiteSettingsPart", + () => shapeHelper.EditorTemplate(TemplateName: "Parts.Settings.SiteSettingsPart", Model: model, Prefix: Prefix)); + } + + protected override DriverResult Editor(SiteSettingsPart part, IUpdateModel updater, dynamic shapeHelper) { + var site = _siteService.GetSiteSettings().As(); + var model = new SiteSettingsPartViewModel { + Site = site, + SiteCultures = _cultureManager.ListCultures(), + SiteCalendars = _calendarProvider.ListCalendars(), + TimeZones = TimeZoneInfo.GetSystemTimeZones() + }; + + var previousBaseUrl = model.Site.BaseUrl; + + // Update all properties but not SuperUser, MaxPageSize and BaseUrl. + updater.TryUpdateModel(model, Prefix, null, new [] { "Site.SuperUser", "Site.MaxPageSize", "Site.BaseUrl", "Site.MaxPagedCount" }); + + // only a user with SiteOwner permission can change the site owner + if (_authorizer.Authorize(StandardPermissions.SiteOwner)) { + updater.TryUpdateModel(model, Prefix, new[] { "Site.SuperUser", "Site.MaxPageSize", "Site.BaseUrl", "Site.MaxPagedCount" }, null); + + // ensures the super user is fully empty + if (String.IsNullOrEmpty(model.SuperUser)) { + model.SuperUser = String.Empty; + } + // otherwise the super user must be a valid user, to prevent an external account to impersonate as this name + //the user management module ensures the super user can't be deleted, but it can be disabled + else { + if (_membershipService.GetUser(model.SuperUser) == null) { + updater.AddModelError("SuperUser", T("The user {0} was not found", model.SuperUser)); + } + } + + // ensure the base url is absolute if provided + if (!String.IsNullOrWhiteSpace(model.Site.BaseUrl)) { + if (!Uri.IsWellFormedUriString(model.Site.BaseUrl, UriKind.Absolute)) { + updater.AddModelError("BaseUrl", T("The base url must be absolute.")); + } + // if the base url has been modified, try to ping it + else if (!String.Equals(previousBaseUrl, model.Site.BaseUrl, StringComparison.OrdinalIgnoreCase)) { + try { + var request = WebRequest.Create(model.Site.BaseUrl) as HttpWebRequest; + if (request != null) { + using (request.GetResponse() as HttpWebResponse) { } + } + } + catch (Exception ex) { + if (ex.IsFatal()) { + throw; + } + _notifier.Warning(T("The base url you entered could not be requested from current location.")); + Logger.Warning(ex, "Could not query base url: {0}", model.Site.BaseUrl); + } + } + } + } + + return ContentShape("Parts_Settings_SiteSettingsPart", + () => shapeHelper.EditorTemplate(TemplateName: "Parts.Settings.SiteSettingsPart", Model: model, Prefix: Prefix)); + } + + protected override void Exporting(SiteSettingsPart part, ContentManagement.Handlers.ExportContentContext context) { + context.Element(part.PartDefinition.Name).SetAttributeValue("SupportedCultures", string.Join(";", _cultureManager.ListCultures())); + } + + protected override void Importing(SiteSettingsPart part, ContentManagement.Handlers.ImportContentContext context) { + // Don't do anything if the tag is not specified. + if (context.Data.Element(part.PartDefinition.Name) == null) { + return; + } + + context.ImportAttribute(part.PartDefinition.Name, "SupportedCultures", supportedCultures => { + foreach (var culture in supportedCultures.Split(';')) { + _cultureManager.AddCulture(culture); + } + }); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/Handlers/SiteSettingsPartHandler.cs b/src/Orchard.Web/Core/Settings/Handlers/SiteSettingsPartHandler.cs index 8a7bcf2b31d..a463c3b9d65 100644 --- a/src/Orchard.Web/Core/Settings/Handlers/SiteSettingsPartHandler.cs +++ b/src/Orchard.Web/Core/Settings/Handlers/SiteSettingsPartHandler.cs @@ -1,12 +1,12 @@ -using JetBrains.Annotations; -using Orchard.Core.Settings.Models; -using Orchard.ContentManagement.Handlers; - -namespace Orchard.Core.Settings.Handlers { - [UsedImplicitly] - public class SiteSettingsPartHandler : ContentHandler { - public SiteSettingsPartHandler() { - Filters.Add(new ActivatingFilter("Site")); - } - } +using JetBrains.Annotations; +using Orchard.Core.Settings.Models; +using Orchard.ContentManagement.Handlers; + +namespace Orchard.Core.Settings.Handlers { + [UsedImplicitly] + public class SiteSettingsPartHandler : ContentHandler { + public SiteSettingsPartHandler() { + Filters.Add(new ActivatingFilter("Site")); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/Metadata/ContentDefinitionManager.cs b/src/Orchard.Web/Core/Settings/Metadata/ContentDefinitionManager.cs index 3ebb1b4edf8..283d138b34f 100644 --- a/src/Orchard.Web/Core/Settings/Metadata/ContentDefinitionManager.cs +++ b/src/Orchard.Web/Core/Settings/Metadata/ContentDefinitionManager.cs @@ -1,302 +1,302 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Xml.Linq; -using Orchard.Caching; -using Orchard.ContentManagement.MetaData; -using Orchard.ContentManagement.MetaData.Models; -using Orchard.ContentManagement.MetaData.Services; -using Orchard.Core.Settings.Metadata.Records; -using Orchard.Data; -using Orchard.Logging; -using Orchard.Exceptions; - -namespace Orchard.Core.Settings.Metadata { - public class ContentDefinitionManager : Component, IContentDefinitionManager { - private const string ContentDefinitionSignal = "ContentDefinitionManager"; - private readonly ICacheManager _cacheManager; - private readonly ISignals _signals; - private readonly IRepository _typeDefinitionRepository; - private readonly IRepository _partDefinitionRepository; - private readonly IRepository _fieldDefinitionRepository; - private readonly ISettingsFormatter _settingsFormatter; - - public ContentDefinitionManager( - ICacheManager cacheManager, - ISignals signals, - IRepository typeDefinitionRepository, - IRepository partDefinitionRepository, - IRepository fieldDefinitionRepository, - ISettingsFormatter settingsFormatter) { - _cacheManager = cacheManager; - _signals = signals; - _typeDefinitionRepository = typeDefinitionRepository; - _partDefinitionRepository = partDefinitionRepository; - _fieldDefinitionRepository = fieldDefinitionRepository; - _settingsFormatter = settingsFormatter; - } - - public ContentTypeDefinition GetTypeDefinition(string name) { - if (String.IsNullOrWhiteSpace(name)) { - return null; - } - - var contentTypeDefinitions = AcquireContentTypeDefinitions(); - if (contentTypeDefinitions.ContainsKey(name)) { - return contentTypeDefinitions[name]; - } - - return null; - } - - public void DeleteTypeDefinition(string name) { - var record = _typeDefinitionRepository.Table.SingleOrDefault(x => x.Name == name); - - // deletes the content type record associated - if (record != null) { - _typeDefinitionRepository.Delete(record); - } - - // invalidates the cache - TriggerContentDefinitionSignal(); - } - - public void DeletePartDefinition(string name) { - // remove parts from current types - var typesWithPart = ListTypeDefinitions().Where(typeDefinition => typeDefinition.Parts.Any(part => part.PartDefinition.Name == name)); - - foreach (var typeDefinition in typesWithPart) { - this.AlterTypeDefinition(typeDefinition.Name, builder => builder.RemovePart(name)); - } - - // delete part - var record = _partDefinitionRepository.Table.SingleOrDefault(x => x.Name == name); - - if (record != null) { - _partDefinitionRepository.Delete(record); - } - - // invalidates the cache - TriggerContentDefinitionSignal(); - - } - - public ContentPartDefinition GetPartDefinition(string name) { - if (String.IsNullOrWhiteSpace(name)) { - return null; - } - - var contentPartDefinitions = AcquireContentPartDefinitions(); - if (contentPartDefinitions.ContainsKey(name)) { - return contentPartDefinitions[name]; - } - - return null; - } - - public IEnumerable ListTypeDefinitions() { - return AcquireContentTypeDefinitions().Values; - } - - public IEnumerable ListPartDefinitions() { - return AcquireContentPartDefinitions().Values; - } - - public IEnumerable ListFieldDefinitions() { - return AcquireContentFieldDefinitions().Values; - } - - public void StoreTypeDefinition(ContentTypeDefinition contentTypeDefinition) { - Apply(contentTypeDefinition, Acquire(contentTypeDefinition)); - TriggerContentDefinitionSignal(); - } - - public void StorePartDefinition(ContentPartDefinition contentPartDefinition) { - Apply(contentPartDefinition, Acquire(contentPartDefinition)); - TriggerContentDefinitionSignal(); - } - - private void MonitorContentDefinitionSignal(AcquireContext ctx) { - ctx.Monitor(_signals.When(ContentDefinitionSignal)); - } - - private void TriggerContentDefinitionSignal() { - _signals.Trigger(ContentDefinitionSignal); - } - - private IDictionary AcquireContentTypeDefinitions() { - return _cacheManager.Get("ContentTypeDefinitions", true, ctx => { - MonitorContentDefinitionSignal(ctx); - - AcquireContentPartDefinitions(); - - var contentTypeDefinitionRecords = _typeDefinitionRepository.Table - .FetchMany(x => x.ContentTypePartDefinitionRecords) - .ThenFetch(x => x.ContentPartDefinitionRecord) - .Select(Build); - - return contentTypeDefinitionRecords.ToDictionary(x => x.Name, y => y, StringComparer.OrdinalIgnoreCase); - }); - } - - private IDictionary AcquireContentPartDefinitions() { - return _cacheManager.Get("ContentPartDefinitions", true, ctx => { - MonitorContentDefinitionSignal(ctx); - - var contentPartDefinitionRecords = _partDefinitionRepository.Table - .FetchMany(x => x.ContentPartFieldDefinitionRecords) - .ThenFetch(x => x.ContentFieldDefinitionRecord) - .Select(Build); - - return contentPartDefinitionRecords.ToDictionary(x => x.Name, y => y, StringComparer.OrdinalIgnoreCase); - }); - } - - private IDictionary AcquireContentFieldDefinitions() { - return _cacheManager.Get("ContentFieldDefinitions", true, ctx => { - MonitorContentDefinitionSignal(ctx); - - return _fieldDefinitionRepository.Table.Select(Build).ToDictionary(x => x.Name, y => y); - }); - } - - private ContentTypeDefinitionRecord Acquire(ContentTypeDefinition contentTypeDefinition) { - var result = _typeDefinitionRepository.Table.SingleOrDefault(x => x.Name == contentTypeDefinition.Name); - if (result == null) { - result = new ContentTypeDefinitionRecord { Name = contentTypeDefinition.Name, DisplayName = contentTypeDefinition.DisplayName }; - _typeDefinitionRepository.Create(result); - } - return result; - } - - private ContentPartDefinitionRecord Acquire(ContentPartDefinition contentPartDefinition) { - var result = _partDefinitionRepository.Table.SingleOrDefault(x => x.Name == contentPartDefinition.Name); - if (result == null) { - result = new ContentPartDefinitionRecord { Name = contentPartDefinition.Name }; - _partDefinitionRepository.Create(result); - } - return result; - } - - private ContentFieldDefinitionRecord Acquire(ContentFieldDefinition contentFieldDefinition) { - var result = _fieldDefinitionRepository.Table.SingleOrDefault(x => x.Name == contentFieldDefinition.Name); - if (result == null) { - result = new ContentFieldDefinitionRecord { Name = contentFieldDefinition.Name }; - _fieldDefinitionRepository.Create(result); - } - return result; - } - - private void Apply(ContentTypeDefinition model, ContentTypeDefinitionRecord record) { - record.DisplayName = model.DisplayName; - record.Settings = _settingsFormatter.Map(model.Settings).ToString(); - - var toRemove = record.ContentTypePartDefinitionRecords - .Where(partDefinitionRecord => model.Parts.All(part => partDefinitionRecord.ContentPartDefinitionRecord.Name != part.PartDefinition.Name)) - .ToList(); - - foreach (var remove in toRemove) { - record.ContentTypePartDefinitionRecords.Remove(remove); - } - - foreach (var part in model.Parts) { - var partName = part.PartDefinition.Name; - var typePartRecord = record.ContentTypePartDefinitionRecords.SingleOrDefault(r => r.ContentPartDefinitionRecord.Name == partName); - if (typePartRecord == null) { - typePartRecord = new ContentTypePartDefinitionRecord { ContentPartDefinitionRecord = Acquire(part.PartDefinition) }; - record.ContentTypePartDefinitionRecords.Add(typePartRecord); - } - Apply(part, typePartRecord); - } - } - - private void Apply(ContentTypePartDefinition model, ContentTypePartDefinitionRecord record) { - record.Settings = Compose(_settingsFormatter.Map(model.Settings)); - } - - private void Apply(ContentPartDefinition model, ContentPartDefinitionRecord record) { - record.Settings = _settingsFormatter.Map(model.Settings).ToString(); - - var toRemove = record.ContentPartFieldDefinitionRecords - .Where(partFieldDefinitionRecord => model.Fields.All(partField => partFieldDefinitionRecord.Name != partField.Name)) - .ToList(); - - foreach (var remove in toRemove) { - record.ContentPartFieldDefinitionRecords.Remove(remove); - } - - foreach (var field in model.Fields) { - var fieldName = field.Name; - var partFieldRecord = record.ContentPartFieldDefinitionRecords.SingleOrDefault(r => r.Name == fieldName); - if (partFieldRecord == null) { - partFieldRecord = new ContentPartFieldDefinitionRecord { - ContentFieldDefinitionRecord = Acquire(field.FieldDefinition), - Name = field.Name - }; - record.ContentPartFieldDefinitionRecords.Add(partFieldRecord); - } - Apply(field, partFieldRecord); - } - } - - private void Apply(ContentPartFieldDefinition model, ContentPartFieldDefinitionRecord record) { - record.Settings = Compose(_settingsFormatter.Map(model.Settings)); - } - - ContentTypeDefinition Build(ContentTypeDefinitionRecord source) { - return new ContentTypeDefinition( - source.Name, - source.DisplayName, - source.ContentTypePartDefinitionRecords.Select(Build), - _settingsFormatter.Map(Parse(source.Settings))); - } - - ContentTypePartDefinition Build(ContentTypePartDefinitionRecord source) { - return new ContentTypePartDefinition( - Build(source.ContentPartDefinitionRecord), - _settingsFormatter.Map(Parse(source.Settings))); - } - - ContentPartDefinition Build(ContentPartDefinitionRecord source) { - return new ContentPartDefinition( - source.Name, - source.ContentPartFieldDefinitionRecords.Select(Build), - _settingsFormatter.Map(Parse(source.Settings))); - } - - ContentPartFieldDefinition Build(ContentPartFieldDefinitionRecord source) { - return new ContentPartFieldDefinition( - Build(source.ContentFieldDefinitionRecord), - source.Name, - _settingsFormatter.Map(Parse(source.Settings))); - } - - ContentFieldDefinition Build(ContentFieldDefinitionRecord source) { - return new ContentFieldDefinition(source.Name); - } - - XElement Parse(string settings) { - if (string.IsNullOrEmpty(settings)) - return null; - - try { - return XElement.Parse(settings); - } - catch (Exception ex) { - if (ex.IsFatal()) { - throw; - } - Logger.Error(ex, "Unable to parse settings xml"); - return null; - } - } - - static string Compose(XElement map) { - if (map == null) - return null; - - return map.ToString(); - } - } - -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml.Linq; +using Orchard.Caching; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.ContentManagement.MetaData.Services; +using Orchard.Core.Settings.Metadata.Records; +using Orchard.Data; +using Orchard.Logging; +using Orchard.Exceptions; + +namespace Orchard.Core.Settings.Metadata { + public class ContentDefinitionManager : Component, IContentDefinitionManager { + private const string ContentDefinitionSignal = "ContentDefinitionManager"; + private readonly ICacheManager _cacheManager; + private readonly ISignals _signals; + private readonly IRepository _typeDefinitionRepository; + private readonly IRepository _partDefinitionRepository; + private readonly IRepository _fieldDefinitionRepository; + private readonly ISettingsFormatter _settingsFormatter; + + public ContentDefinitionManager( + ICacheManager cacheManager, + ISignals signals, + IRepository typeDefinitionRepository, + IRepository partDefinitionRepository, + IRepository fieldDefinitionRepository, + ISettingsFormatter settingsFormatter) { + _cacheManager = cacheManager; + _signals = signals; + _typeDefinitionRepository = typeDefinitionRepository; + _partDefinitionRepository = partDefinitionRepository; + _fieldDefinitionRepository = fieldDefinitionRepository; + _settingsFormatter = settingsFormatter; + } + + public ContentTypeDefinition GetTypeDefinition(string name) { + if (String.IsNullOrWhiteSpace(name)) { + return null; + } + + var contentTypeDefinitions = AcquireContentTypeDefinitions(); + if (contentTypeDefinitions.ContainsKey(name)) { + return contentTypeDefinitions[name]; + } + + return null; + } + + public void DeleteTypeDefinition(string name) { + var record = _typeDefinitionRepository.Table.SingleOrDefault(x => x.Name == name); + + // deletes the content type record associated + if (record != null) { + _typeDefinitionRepository.Delete(record); + } + + // invalidates the cache + TriggerContentDefinitionSignal(); + } + + public void DeletePartDefinition(string name) { + // remove parts from current types + var typesWithPart = ListTypeDefinitions().Where(typeDefinition => typeDefinition.Parts.Any(part => part.PartDefinition.Name == name)); + + foreach (var typeDefinition in typesWithPart) { + this.AlterTypeDefinition(typeDefinition.Name, builder => builder.RemovePart(name)); + } + + // delete part + var record = _partDefinitionRepository.Table.SingleOrDefault(x => x.Name == name); + + if (record != null) { + _partDefinitionRepository.Delete(record); + } + + // invalidates the cache + TriggerContentDefinitionSignal(); + + } + + public ContentPartDefinition GetPartDefinition(string name) { + if (String.IsNullOrWhiteSpace(name)) { + return null; + } + + var contentPartDefinitions = AcquireContentPartDefinitions(); + if (contentPartDefinitions.ContainsKey(name)) { + return contentPartDefinitions[name]; + } + + return null; + } + + public IEnumerable ListTypeDefinitions() { + return AcquireContentTypeDefinitions().Values; + } + + public IEnumerable ListPartDefinitions() { + return AcquireContentPartDefinitions().Values; + } + + public IEnumerable ListFieldDefinitions() { + return AcquireContentFieldDefinitions().Values; + } + + public void StoreTypeDefinition(ContentTypeDefinition contentTypeDefinition) { + Apply(contentTypeDefinition, Acquire(contentTypeDefinition)); + TriggerContentDefinitionSignal(); + } + + public void StorePartDefinition(ContentPartDefinition contentPartDefinition) { + Apply(contentPartDefinition, Acquire(contentPartDefinition)); + TriggerContentDefinitionSignal(); + } + + private void MonitorContentDefinitionSignal(AcquireContext ctx) { + ctx.Monitor(_signals.When(ContentDefinitionSignal)); + } + + private void TriggerContentDefinitionSignal() { + _signals.Trigger(ContentDefinitionSignal); + } + + private IDictionary AcquireContentTypeDefinitions() { + return _cacheManager.Get("ContentTypeDefinitions", true, ctx => { + MonitorContentDefinitionSignal(ctx); + + AcquireContentPartDefinitions(); + + var contentTypeDefinitionRecords = _typeDefinitionRepository.Table + .FetchMany(x => x.ContentTypePartDefinitionRecords) + .ThenFetch(x => x.ContentPartDefinitionRecord) + .Select(Build); + + return contentTypeDefinitionRecords.ToDictionary(x => x.Name, y => y, StringComparer.OrdinalIgnoreCase); + }); + } + + private IDictionary AcquireContentPartDefinitions() { + return _cacheManager.Get("ContentPartDefinitions", true, ctx => { + MonitorContentDefinitionSignal(ctx); + + var contentPartDefinitionRecords = _partDefinitionRepository.Table + .FetchMany(x => x.ContentPartFieldDefinitionRecords) + .ThenFetch(x => x.ContentFieldDefinitionRecord) + .Select(Build); + + return contentPartDefinitionRecords.ToDictionary(x => x.Name, y => y, StringComparer.OrdinalIgnoreCase); + }); + } + + private IDictionary AcquireContentFieldDefinitions() { + return _cacheManager.Get("ContentFieldDefinitions", true, ctx => { + MonitorContentDefinitionSignal(ctx); + + return _fieldDefinitionRepository.Table.Select(Build).ToDictionary(x => x.Name, y => y); + }); + } + + private ContentTypeDefinitionRecord Acquire(ContentTypeDefinition contentTypeDefinition) { + var result = _typeDefinitionRepository.Table.SingleOrDefault(x => x.Name == contentTypeDefinition.Name); + if (result == null) { + result = new ContentTypeDefinitionRecord { Name = contentTypeDefinition.Name, DisplayName = contentTypeDefinition.DisplayName }; + _typeDefinitionRepository.Create(result); + } + return result; + } + + private ContentPartDefinitionRecord Acquire(ContentPartDefinition contentPartDefinition) { + var result = _partDefinitionRepository.Table.SingleOrDefault(x => x.Name == contentPartDefinition.Name); + if (result == null) { + result = new ContentPartDefinitionRecord { Name = contentPartDefinition.Name }; + _partDefinitionRepository.Create(result); + } + return result; + } + + private ContentFieldDefinitionRecord Acquire(ContentFieldDefinition contentFieldDefinition) { + var result = _fieldDefinitionRepository.Table.SingleOrDefault(x => x.Name == contentFieldDefinition.Name); + if (result == null) { + result = new ContentFieldDefinitionRecord { Name = contentFieldDefinition.Name }; + _fieldDefinitionRepository.Create(result); + } + return result; + } + + private void Apply(ContentTypeDefinition model, ContentTypeDefinitionRecord record) { + record.DisplayName = model.DisplayName; + record.Settings = _settingsFormatter.Map(model.Settings).ToString(); + + var toRemove = record.ContentTypePartDefinitionRecords + .Where(partDefinitionRecord => model.Parts.All(part => partDefinitionRecord.ContentPartDefinitionRecord.Name != part.PartDefinition.Name)) + .ToList(); + + foreach (var remove in toRemove) { + record.ContentTypePartDefinitionRecords.Remove(remove); + } + + foreach (var part in model.Parts) { + var partName = part.PartDefinition.Name; + var typePartRecord = record.ContentTypePartDefinitionRecords.SingleOrDefault(r => r.ContentPartDefinitionRecord.Name == partName); + if (typePartRecord == null) { + typePartRecord = new ContentTypePartDefinitionRecord { ContentPartDefinitionRecord = Acquire(part.PartDefinition) }; + record.ContentTypePartDefinitionRecords.Add(typePartRecord); + } + Apply(part, typePartRecord); + } + } + + private void Apply(ContentTypePartDefinition model, ContentTypePartDefinitionRecord record) { + record.Settings = Compose(_settingsFormatter.Map(model.Settings)); + } + + private void Apply(ContentPartDefinition model, ContentPartDefinitionRecord record) { + record.Settings = _settingsFormatter.Map(model.Settings).ToString(); + + var toRemove = record.ContentPartFieldDefinitionRecords + .Where(partFieldDefinitionRecord => model.Fields.All(partField => partFieldDefinitionRecord.Name != partField.Name)) + .ToList(); + + foreach (var remove in toRemove) { + record.ContentPartFieldDefinitionRecords.Remove(remove); + } + + foreach (var field in model.Fields) { + var fieldName = field.Name; + var partFieldRecord = record.ContentPartFieldDefinitionRecords.SingleOrDefault(r => r.Name == fieldName); + if (partFieldRecord == null) { + partFieldRecord = new ContentPartFieldDefinitionRecord { + ContentFieldDefinitionRecord = Acquire(field.FieldDefinition), + Name = field.Name + }; + record.ContentPartFieldDefinitionRecords.Add(partFieldRecord); + } + Apply(field, partFieldRecord); + } + } + + private void Apply(ContentPartFieldDefinition model, ContentPartFieldDefinitionRecord record) { + record.Settings = Compose(_settingsFormatter.Map(model.Settings)); + } + + ContentTypeDefinition Build(ContentTypeDefinitionRecord source) { + return new ContentTypeDefinition( + source.Name, + source.DisplayName, + source.ContentTypePartDefinitionRecords.Select(Build), + _settingsFormatter.Map(Parse(source.Settings))); + } + + ContentTypePartDefinition Build(ContentTypePartDefinitionRecord source) { + return new ContentTypePartDefinition( + Build(source.ContentPartDefinitionRecord), + _settingsFormatter.Map(Parse(source.Settings))); + } + + ContentPartDefinition Build(ContentPartDefinitionRecord source) { + return new ContentPartDefinition( + source.Name, + source.ContentPartFieldDefinitionRecords.Select(Build), + _settingsFormatter.Map(Parse(source.Settings))); + } + + ContentPartFieldDefinition Build(ContentPartFieldDefinitionRecord source) { + return new ContentPartFieldDefinition( + Build(source.ContentFieldDefinitionRecord), + source.Name, + _settingsFormatter.Map(Parse(source.Settings))); + } + + ContentFieldDefinition Build(ContentFieldDefinitionRecord source) { + return new ContentFieldDefinition(source.Name); + } + + XElement Parse(string settings) { + if (string.IsNullOrEmpty(settings)) + return null; + + try { + return XElement.Parse(settings); + } + catch (Exception ex) { + if (ex.IsFatal()) { + throw; + } + Logger.Error(ex, "Unable to parse settings xml"); + return null; + } + } + + static string Compose(XElement map) { + if (map == null) + return null; + + return map.ToString(); + } + } + +} diff --git a/src/Orchard.Web/Core/Settings/Metadata/Records/ContentFieldDefinitionRecord.cs b/src/Orchard.Web/Core/Settings/Metadata/Records/ContentFieldDefinitionRecord.cs index a8cf97aff56..f4a4ee3e84d 100644 --- a/src/Orchard.Web/Core/Settings/Metadata/Records/ContentFieldDefinitionRecord.cs +++ b/src/Orchard.Web/Core/Settings/Metadata/Records/ContentFieldDefinitionRecord.cs @@ -1,6 +1,6 @@ -namespace Orchard.Core.Settings.Metadata.Records { - public class ContentFieldDefinitionRecord { - public virtual int Id { get; set; } - public virtual string Name { get; set; } - } -} +namespace Orchard.Core.Settings.Metadata.Records { + public class ContentFieldDefinitionRecord { + public virtual int Id { get; set; } + public virtual string Name { get; set; } + } +} diff --git a/src/Orchard.Web/Core/Settings/Metadata/Records/ContentPartDefinitionRecord.cs b/src/Orchard.Web/Core/Settings/Metadata/Records/ContentPartDefinitionRecord.cs index 9092fe5b4e4..9eb56957069 100644 --- a/src/Orchard.Web/Core/Settings/Metadata/Records/ContentPartDefinitionRecord.cs +++ b/src/Orchard.Web/Core/Settings/Metadata/Records/ContentPartDefinitionRecord.cs @@ -1,20 +1,20 @@ -using System.Collections.Generic; -using Orchard.Data.Conventions; - -namespace Orchard.Core.Settings.Metadata.Records { - public class ContentPartDefinitionRecord { - public ContentPartDefinitionRecord() { - ContentPartFieldDefinitionRecords = new List(); - } - - public virtual int Id { get; set; } - public virtual string Name { get; set; } - public virtual bool Hidden { get; set; } - [StringLengthMax] - public virtual string Settings { get; set; } - - [CascadeAllDeleteOrphan] - public virtual IList ContentPartFieldDefinitionRecords { get; set; } - - } -} +using System.Collections.Generic; +using Orchard.Data.Conventions; + +namespace Orchard.Core.Settings.Metadata.Records { + public class ContentPartDefinitionRecord { + public ContentPartDefinitionRecord() { + ContentPartFieldDefinitionRecords = new List(); + } + + public virtual int Id { get; set; } + public virtual string Name { get; set; } + public virtual bool Hidden { get; set; } + [StringLengthMax] + public virtual string Settings { get; set; } + + [CascadeAllDeleteOrphan] + public virtual IList ContentPartFieldDefinitionRecords { get; set; } + + } +} diff --git a/src/Orchard.Web/Core/Settings/Metadata/Records/ContentPartFieldDefinitionRecord.cs b/src/Orchard.Web/Core/Settings/Metadata/Records/ContentPartFieldDefinitionRecord.cs index 7b745053e42..14870aedd22 100644 --- a/src/Orchard.Web/Core/Settings/Metadata/Records/ContentPartFieldDefinitionRecord.cs +++ b/src/Orchard.Web/Core/Settings/Metadata/Records/ContentPartFieldDefinitionRecord.cs @@ -1,11 +1,11 @@ -using Orchard.Data.Conventions; - -namespace Orchard.Core.Settings.Metadata.Records { - public class ContentPartFieldDefinitionRecord { - public virtual int Id { get; set; } - public virtual ContentFieldDefinitionRecord ContentFieldDefinitionRecord { get; set; } - public virtual string Name { get; set; } - [StringLengthMax] - public virtual string Settings { get; set; } - } +using Orchard.Data.Conventions; + +namespace Orchard.Core.Settings.Metadata.Records { + public class ContentPartFieldDefinitionRecord { + public virtual int Id { get; set; } + public virtual ContentFieldDefinitionRecord ContentFieldDefinitionRecord { get; set; } + public virtual string Name { get; set; } + [StringLengthMax] + public virtual string Settings { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/Metadata/Records/ContentTypeDefinitionRecord.cs b/src/Orchard.Web/Core/Settings/Metadata/Records/ContentTypeDefinitionRecord.cs index 46120d7fd3c..1d554ffa208 100644 --- a/src/Orchard.Web/Core/Settings/Metadata/Records/ContentTypeDefinitionRecord.cs +++ b/src/Orchard.Web/Core/Settings/Metadata/Records/ContentTypeDefinitionRecord.cs @@ -1,21 +1,21 @@ -using System.Collections.Generic; -using Orchard.Data.Conventions; - -namespace Orchard.Core.Settings.Metadata.Records { - public class ContentTypeDefinitionRecord { - public ContentTypeDefinitionRecord() { - ContentTypePartDefinitionRecords = new List(); - } - - public virtual int Id { get; set; } - public virtual string Name { get; set; } - public virtual string DisplayName { get; set; } - public virtual bool Hidden { get; set; } - [StringLengthMax] - public virtual string Settings { get; set; } - - [CascadeAllDeleteOrphan] - public virtual IList ContentTypePartDefinitionRecords { get; set; } - } - -} +using System.Collections.Generic; +using Orchard.Data.Conventions; + +namespace Orchard.Core.Settings.Metadata.Records { + public class ContentTypeDefinitionRecord { + public ContentTypeDefinitionRecord() { + ContentTypePartDefinitionRecords = new List(); + } + + public virtual int Id { get; set; } + public virtual string Name { get; set; } + public virtual string DisplayName { get; set; } + public virtual bool Hidden { get; set; } + [StringLengthMax] + public virtual string Settings { get; set; } + + [CascadeAllDeleteOrphan] + public virtual IList ContentTypePartDefinitionRecords { get; set; } + } + +} diff --git a/src/Orchard.Web/Core/Settings/Metadata/Records/ContentTypePartDefinitionRecord.cs b/src/Orchard.Web/Core/Settings/Metadata/Records/ContentTypePartDefinitionRecord.cs index 4345a72c31e..fffe7b43746 100644 --- a/src/Orchard.Web/Core/Settings/Metadata/Records/ContentTypePartDefinitionRecord.cs +++ b/src/Orchard.Web/Core/Settings/Metadata/Records/ContentTypePartDefinitionRecord.cs @@ -1,10 +1,10 @@ -using Orchard.Data.Conventions; - -namespace Orchard.Core.Settings.Metadata.Records { - public class ContentTypePartDefinitionRecord { - public virtual int Id { get; set; } - public virtual ContentPartDefinitionRecord ContentPartDefinitionRecord { get; set; } - [StringLengthMax] - public virtual string Settings { get; set; } - } -} +using Orchard.Data.Conventions; + +namespace Orchard.Core.Settings.Metadata.Records { + public class ContentTypePartDefinitionRecord { + public virtual int Id { get; set; } + public virtual ContentPartDefinitionRecord ContentPartDefinitionRecord { get; set; } + [StringLengthMax] + public virtual string Settings { get; set; } + } +} diff --git a/src/Orchard.Web/Core/Settings/Migrations.cs b/src/Orchard.Web/Core/Settings/Migrations.cs index 408311f67d7..7ab4126d0b4 100644 --- a/src/Orchard.Web/Core/Settings/Migrations.cs +++ b/src/Orchard.Web/Core/Settings/Migrations.cs @@ -1,115 +1,115 @@ -using Orchard.ContentManagement.MetaData; -using Orchard.Data.Migration; - -namespace Orchard.Core.Settings { - public class Migrations : DataMigrationImpl { - - public int Create() { - SchemaBuilder.CreateTable("ContentFieldDefinitionRecord", - table => table - .Column("Id", column => column.PrimaryKey().Identity()) - .Column("Name") - ); - - SchemaBuilder.CreateTable("ContentPartDefinitionRecord", - table => table - .Column("Id", column => column.PrimaryKey().Identity()) - .Column("Name") - .Column("Hidden") - .Column("Settings", column => column.Unlimited()) - ); - - SchemaBuilder.CreateTable("ContentPartFieldDefinitionRecord", - table => table - .Column("Id", column => column.PrimaryKey().Identity()) - .Column("Name") - .Column("Settings", column => column.Unlimited()) - .Column("ContentFieldDefinitionRecord_id") - .Column("ContentPartDefinitionRecord_Id") - ); - - SchemaBuilder.CreateTable("ContentTypeDefinitionRecord", - table => table - .Column("Id", column => column.PrimaryKey().Identity()) - .Column("Name") - .Column("DisplayName") - .Column("Hidden") - .Column("Settings", column => column.Unlimited()) - ); - - SchemaBuilder.CreateTable("ContentTypePartDefinitionRecord", - table => table - .Column("Id", column => column.PrimaryKey().Identity()) - .Column("Settings", column => column.Unlimited()) - .Column("ContentPartDefinitionRecord_id") - .Column("ContentTypeDefinitionRecord_Id") - ); - - SchemaBuilder.CreateTable("ShellDescriptorRecord", - table => table - .Column("Id", column => column.PrimaryKey().Identity()) - .Column("SerialNumber") - ); - - SchemaBuilder.CreateTable("ShellFeatureRecord", - table => table - .Column("Id", column => column.PrimaryKey().Identity()) - .Column("Name") - .Column("ShellDescriptorRecord_id")); - - SchemaBuilder.CreateTable("ShellFeatureStateRecord", - table => table - .Column("Id", column => column.PrimaryKey().Identity()) - .Column("Name") - .Column("InstallState") - .Column("EnableState") - .Column("ShellStateRecord_Id") - ); - - SchemaBuilder.CreateTable("ShellParameterRecord", - table => table - .Column("Id", column => column.PrimaryKey().Identity()) - .Column("Component") - .Column("Name") - .Column("Value") - .Column("ShellDescriptorRecord_id") - ); - - SchemaBuilder.CreateTable("ShellStateRecord", - table => table - .Column("Id", column => column.PrimaryKey().Identity()) - .Column("Unused") - ); - - // declare the Site content type to let users alter it - ContentDefinitionManager.AlterTypeDefinition("Site", cfg => { }); - - return 4; - } - - public int UpdateFrom1() { - SchemaBuilder.CreateTable("SiteSettings2PartRecord", - table => table - .ContentPartRecord() - .Column("BaseUrl", c => c.Unlimited()) - ); - - return 2; - } - - public int UpdateFrom2() { - SchemaBuilder.AlterTable("SiteSettingsPartRecord", - table => table - .AddColumn("SiteTimeZone") - ); - - return 3; - } - - public int UpdateFrom3() { - ContentDefinitionManager.AlterTypeDefinition("Site", cfg => { }); - - return 4; - } - } +using Orchard.ContentManagement.MetaData; +using Orchard.Data.Migration; + +namespace Orchard.Core.Settings { + public class Migrations : DataMigrationImpl { + + public int Create() { + SchemaBuilder.CreateTable("ContentFieldDefinitionRecord", + table => table + .Column("Id", column => column.PrimaryKey().Identity()) + .Column("Name") + ); + + SchemaBuilder.CreateTable("ContentPartDefinitionRecord", + table => table + .Column("Id", column => column.PrimaryKey().Identity()) + .Column("Name") + .Column("Hidden") + .Column("Settings", column => column.Unlimited()) + ); + + SchemaBuilder.CreateTable("ContentPartFieldDefinitionRecord", + table => table + .Column("Id", column => column.PrimaryKey().Identity()) + .Column("Name") + .Column("Settings", column => column.Unlimited()) + .Column("ContentFieldDefinitionRecord_id") + .Column("ContentPartDefinitionRecord_Id") + ); + + SchemaBuilder.CreateTable("ContentTypeDefinitionRecord", + table => table + .Column("Id", column => column.PrimaryKey().Identity()) + .Column("Name") + .Column("DisplayName") + .Column("Hidden") + .Column("Settings", column => column.Unlimited()) + ); + + SchemaBuilder.CreateTable("ContentTypePartDefinitionRecord", + table => table + .Column("Id", column => column.PrimaryKey().Identity()) + .Column("Settings", column => column.Unlimited()) + .Column("ContentPartDefinitionRecord_id") + .Column("ContentTypeDefinitionRecord_Id") + ); + + SchemaBuilder.CreateTable("ShellDescriptorRecord", + table => table + .Column("Id", column => column.PrimaryKey().Identity()) + .Column("SerialNumber") + ); + + SchemaBuilder.CreateTable("ShellFeatureRecord", + table => table + .Column("Id", column => column.PrimaryKey().Identity()) + .Column("Name") + .Column("ShellDescriptorRecord_id")); + + SchemaBuilder.CreateTable("ShellFeatureStateRecord", + table => table + .Column("Id", column => column.PrimaryKey().Identity()) + .Column("Name") + .Column("InstallState") + .Column("EnableState") + .Column("ShellStateRecord_Id") + ); + + SchemaBuilder.CreateTable("ShellParameterRecord", + table => table + .Column("Id", column => column.PrimaryKey().Identity()) + .Column("Component") + .Column("Name") + .Column("Value") + .Column("ShellDescriptorRecord_id") + ); + + SchemaBuilder.CreateTable("ShellStateRecord", + table => table + .Column("Id", column => column.PrimaryKey().Identity()) + .Column("Unused") + ); + + // declare the Site content type to let users alter it + ContentDefinitionManager.AlterTypeDefinition("Site", cfg => { }); + + return 4; + } + + public int UpdateFrom1() { + SchemaBuilder.CreateTable("SiteSettings2PartRecord", + table => table + .ContentPartRecord() + .Column("BaseUrl", c => c.Unlimited()) + ); + + return 2; + } + + public int UpdateFrom2() { + SchemaBuilder.AlterTable("SiteSettingsPartRecord", + table => table + .AddColumn("SiteTimeZone") + ); + + return 3; + } + + public int UpdateFrom3() { + ContentDefinitionManager.AlterTypeDefinition("Site", cfg => { }); + + return 4; + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/Models/SiteSettingsPart.cs b/src/Orchard.Web/Core/Settings/Models/SiteSettingsPart.cs index ee9b02bb982..15b3686c1d2 100644 --- a/src/Orchard.Web/Core/Settings/Models/SiteSettingsPart.cs +++ b/src/Orchard.Web/Core/Settings/Models/SiteSettingsPart.cs @@ -1,78 +1,78 @@ -using Orchard.ContentManagement; -using Orchard.Settings; - -namespace Orchard.Core.Settings.Models { - public sealed class SiteSettingsPart : ContentPart, ISite { - - public const int DefaultPageSize = 10; - - public string PageTitleSeparator { - get { return this.Retrieve(x => x.PageTitleSeparator); } - set { this.Store(x => x.PageTitleSeparator, value); } - } - public string SiteName { - get { return this.Retrieve(x => x.SiteName); } - set { this.Store(x => x.SiteName, value); } - } - - public string SiteSalt { - get { return this.Retrieve(x => x.SiteSalt); } - set { this.Store(x => x.SiteSalt, value); } - } - - public string SuperUser { - get { return this.Retrieve(x => x.SuperUser); } - set { this.Store(x => x.SuperUser, value); } - } - - public string HomePage { - get { return this.Retrieve(x => x.HomePage); } - set { this.Store(x => x.HomePage, value); } - } - - public string SiteCulture { - get { return this.Retrieve(x => x.SiteCulture); } - set { this.Store(x => x.SiteCulture, value); } - } - - public string SiteCalendar { - get { return this.Retrieve(x => x.SiteCalendar); } - set { this.Store(x => x.SiteCalendar, value); } - } - - public ResourceDebugMode ResourceDebugMode { - get { return this.Retrieve(x => x.ResourceDebugMode); } - set { this.Store(x => x.ResourceDebugMode, value); } - } - - public bool UseCdn { - get { return this.Retrieve(x => x.UseCdn); } - set { this.Store(x=> x.UseCdn, value); } - } - - public int PageSize { - get { return this.Retrieve(x => x.PageSize, DefaultPageSize); } - set { this.Store(x => x.PageSize, value); } - } - - public int MaxPageSize { - get { return this.Retrieve(x => x.MaxPageSize); } - set { this.Store(x => x.MaxPageSize, value); } - } - - public int MaxPagedCount { - get { return this.Retrieve(x => x.MaxPagedCount); } - set { this.Store(x => x.MaxPagedCount, value); } - } - - public string SiteTimeZone { - get { return this.Retrieve(x => x.SiteTimeZone); } - set { this.Store(x => x.SiteTimeZone, value); } - } - - public string BaseUrl { - get { return this.Retrieve(x => x.BaseUrl); } - set { this.Store(x => x.BaseUrl, value); } - } - } -} +using Orchard.ContentManagement; +using Orchard.Settings; + +namespace Orchard.Core.Settings.Models { + public sealed class SiteSettingsPart : ContentPart, ISite { + + public const int DefaultPageSize = 10; + + public string PageTitleSeparator { + get { return this.Retrieve(x => x.PageTitleSeparator); } + set { this.Store(x => x.PageTitleSeparator, value); } + } + public string SiteName { + get { return this.Retrieve(x => x.SiteName); } + set { this.Store(x => x.SiteName, value); } + } + + public string SiteSalt { + get { return this.Retrieve(x => x.SiteSalt); } + set { this.Store(x => x.SiteSalt, value); } + } + + public string SuperUser { + get { return this.Retrieve(x => x.SuperUser); } + set { this.Store(x => x.SuperUser, value); } + } + + public string HomePage { + get { return this.Retrieve(x => x.HomePage); } + set { this.Store(x => x.HomePage, value); } + } + + public string SiteCulture { + get { return this.Retrieve(x => x.SiteCulture); } + set { this.Store(x => x.SiteCulture, value); } + } + + public string SiteCalendar { + get { return this.Retrieve(x => x.SiteCalendar); } + set { this.Store(x => x.SiteCalendar, value); } + } + + public ResourceDebugMode ResourceDebugMode { + get { return this.Retrieve(x => x.ResourceDebugMode); } + set { this.Store(x => x.ResourceDebugMode, value); } + } + + public bool UseCdn { + get { return this.Retrieve(x => x.UseCdn); } + set { this.Store(x=> x.UseCdn, value); } + } + + public int PageSize { + get { return this.Retrieve(x => x.PageSize, DefaultPageSize); } + set { this.Store(x => x.PageSize, value); } + } + + public int MaxPageSize { + get { return this.Retrieve(x => x.MaxPageSize); } + set { this.Store(x => x.MaxPageSize, value); } + } + + public int MaxPagedCount { + get { return this.Retrieve(x => x.MaxPagedCount); } + set { this.Store(x => x.MaxPagedCount, value); } + } + + public string SiteTimeZone { + get { return this.Retrieve(x => x.SiteTimeZone); } + set { this.Store(x => x.SiteTimeZone, value); } + } + + public string BaseUrl { + get { return this.Retrieve(x => x.BaseUrl); } + set { this.Store(x => x.BaseUrl, value); } + } + } +} diff --git a/src/Orchard.Web/Core/Settings/Module.txt b/src/Orchard.Web/Core/Settings/Module.txt index 9d24ec00723..06d4a22f0f0 100644 --- a/src/Orchard.Web/Core/Settings/Module.txt +++ b/src/Orchard.Web/Core/Settings/Module.txt @@ -1,9 +1,9 @@ -Name: Settings -AntiForgery: enabled -Author: The Orchard Team -Website: http://orchardproject.net -Version: 1.9.2 -OrchardVersion: 1.9 -Description: The settings module creates site settings that other modules can contribute to. -FeatureDescription: Site settings. -Category: Core +Name: Settings +AntiForgery: enabled +Author: The Orchard Team +Website: http://orchardproject.net +Version: 1.9.2 +OrchardVersion: 1.9 +Description: The settings module creates site settings that other modules can contribute to. +FeatureDescription: Site settings. +Category: Core diff --git a/src/Orchard.Web/Core/Settings/Placement.info b/src/Orchard.Web/Core/Settings/Placement.info index 4e7d3370c88..f4eb1cc5115 100644 --- a/src/Orchard.Web/Core/Settings/Placement.info +++ b/src/Orchard.Web/Core/Settings/Placement.info @@ -1,3 +1,3 @@ - - + + \ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/ResourceManifest.cs b/src/Orchard.Web/Core/Settings/ResourceManifest.cs index 714726308e3..8c60f11b75e 100644 --- a/src/Orchard.Web/Core/Settings/ResourceManifest.cs +++ b/src/Orchard.Web/Core/Settings/ResourceManifest.cs @@ -1,9 +1,9 @@ -using Orchard.UI.Resources; - -namespace Orchard.Core.Settings { - public class ResourceManifest : IResourceManifestProvider { - public void BuildManifests(ResourceManifestBuilder builder) { - builder.Add().DefineStyle("SettingsAdmin").SetUrl("admin.css"); - } - } -} +using Orchard.UI.Resources; + +namespace Orchard.Core.Settings { + public class ResourceManifest : IResourceManifestProvider { + public void BuildManifests(ResourceManifestBuilder builder) { + builder.Add().DefineStyle("SettingsAdmin").SetUrl("admin.css"); + } + } +} diff --git a/src/Orchard.Web/Core/Settings/Routes.cs b/src/Orchard.Web/Core/Settings/Routes.cs index 33d6ddb9c8b..e4b69aa866a 100644 --- a/src/Orchard.Web/Core/Settings/Routes.cs +++ b/src/Orchard.Web/Core/Settings/Routes.cs @@ -1,58 +1,58 @@ -using System; -using System.Collections.Generic; -using System.Web; -using System.Web.Mvc; -using System.Web.Routing; -using Orchard.Core.Settings.Controllers; -using Orchard.Mvc.Routes; - -namespace Orchard.Core.Settings { - public class Routes : IRouteProvider { - public void GetRoutes(ICollection routes) { - foreach (var routeDescriptor in GetRoutes()) - routes.Add(routeDescriptor); - } - - public IEnumerable GetRoutes() { - return new[] { - new RouteDescriptor { - Route = new Route( - "Admin/Settings/{groupInfoId}", - new RouteValueDictionary { - {"area", "Settings"}, - {"controller", "Admin"}, - {"action", "Index"} - }, - new RouteValueDictionary { - {"groupInfoId", new SettingsActionConstraint()} - }, - new RouteValueDictionary { - {"area", "Settings"}, - {"groupInfoId", ""} - }, - new MvcRouteHandler()) - } - }; - } - - } - - public class SettingsActionConstraint : IRouteConstraint { - public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection) { - if (routeDirection == RouteDirection.UrlGeneration) - return true; - - if (!values.ContainsKey(parameterName)) - return false; - - // just hard-coding to know action name strings for now - var potentialActionName = values[parameterName] as string; - return !string.IsNullOrWhiteSpace(potentialActionName) - && !potentialActionName.Equals("Index", StringComparison.OrdinalIgnoreCase) - && !potentialActionName.Equals("Culture", StringComparison.OrdinalIgnoreCase) - && !potentialActionName.Equals("AddCulture", StringComparison.OrdinalIgnoreCase) - && !potentialActionName.Equals("DeleteCulture", StringComparison.OrdinalIgnoreCase) - ; - } - } +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.Mvc; +using System.Web.Routing; +using Orchard.Core.Settings.Controllers; +using Orchard.Mvc.Routes; + +namespace Orchard.Core.Settings { + public class Routes : IRouteProvider { + public void GetRoutes(ICollection routes) { + foreach (var routeDescriptor in GetRoutes()) + routes.Add(routeDescriptor); + } + + public IEnumerable GetRoutes() { + return new[] { + new RouteDescriptor { + Route = new Route( + "Admin/Settings/{groupInfoId}", + new RouteValueDictionary { + {"area", "Settings"}, + {"controller", "Admin"}, + {"action", "Index"} + }, + new RouteValueDictionary { + {"groupInfoId", new SettingsActionConstraint()} + }, + new RouteValueDictionary { + {"area", "Settings"}, + {"groupInfoId", ""} + }, + new MvcRouteHandler()) + } + }; + } + + } + + public class SettingsActionConstraint : IRouteConstraint { + public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection) { + if (routeDirection == RouteDirection.UrlGeneration) + return true; + + if (!values.ContainsKey(parameterName)) + return false; + + // just hard-coding to know action name strings for now + var potentialActionName = values[parameterName] as string; + return !string.IsNullOrWhiteSpace(potentialActionName) + && !potentialActionName.Equals("Index", StringComparison.OrdinalIgnoreCase) + && !potentialActionName.Equals("Culture", StringComparison.OrdinalIgnoreCase) + && !potentialActionName.Equals("AddCulture", StringComparison.OrdinalIgnoreCase) + && !potentialActionName.Equals("DeleteCulture", StringComparison.OrdinalIgnoreCase) + ; + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/Services/SiteService.cs b/src/Orchard.Web/Core/Settings/Services/SiteService.cs index 721a3f61907..04f3fc6647f 100644 --- a/src/Orchard.Web/Core/Settings/Services/SiteService.cs +++ b/src/Orchard.Web/Core/Settings/Services/SiteService.cs @@ -1,47 +1,47 @@ -using System; -using System.Linq; -using JetBrains.Annotations; -using Orchard.Caching; -using Orchard.Core.Settings.Models; -using Orchard.Logging; -using Orchard.ContentManagement; -using Orchard.Settings; - -namespace Orchard.Core.Settings.Services { - [UsedImplicitly] - public class SiteService : ISiteService { - private readonly IContentManager _contentManager; - private readonly ICacheManager _cacheManager; - - public SiteService( - IContentManager contentManager, - ICacheManager cacheManager) { - _contentManager = contentManager; - _cacheManager = cacheManager; - Logger = NullLogger.Instance; - } - - public ILogger Logger { get; set; } - - public ISite GetSiteSettings() { - var siteId = _cacheManager.Get("SiteId", true, ctx => { - var site = _contentManager.Query("Site") - .List() - .FirstOrDefault(); - - if (site == null) { - site = _contentManager.Create("Site", item => { - item.SiteSalt = Guid.NewGuid().ToString("N"); - item.SiteName = "My Orchard Project Application"; - item.PageTitleSeparator = " - "; - item.SiteTimeZone = TimeZoneInfo.Local.Id; - }).ContentItem; - } - - return site.Id; - }); - - return _contentManager.Get(siteId, VersionOptions.Published); - } - } +using System; +using System.Linq; +using JetBrains.Annotations; +using Orchard.Caching; +using Orchard.Core.Settings.Models; +using Orchard.Logging; +using Orchard.ContentManagement; +using Orchard.Settings; + +namespace Orchard.Core.Settings.Services { + [UsedImplicitly] + public class SiteService : ISiteService { + private readonly IContentManager _contentManager; + private readonly ICacheManager _cacheManager; + + public SiteService( + IContentManager contentManager, + ICacheManager cacheManager) { + _contentManager = contentManager; + _cacheManager = cacheManager; + Logger = NullLogger.Instance; + } + + public ILogger Logger { get; set; } + + public ISite GetSiteSettings() { + var siteId = _cacheManager.Get("SiteId", true, ctx => { + var site = _contentManager.Query("Site") + .List() + .FirstOrDefault(); + + if (site == null) { + site = _contentManager.Create("Site", item => { + item.SiteSalt = Guid.NewGuid().ToString("N"); + item.SiteName = "My Orchard Project Application"; + item.PageTitleSeparator = " - "; + item.SiteTimeZone = TimeZoneInfo.Local.Id; + }).ContentItem; + } + + return site.Id; + }); + + return _contentManager.Get(siteId, VersionOptions.Published); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/State/Records/ShellFeatureStateRecord.cs b/src/Orchard.Web/Core/Settings/State/Records/ShellFeatureStateRecord.cs index e945325f034..34df2290549 100644 --- a/src/Orchard.Web/Core/Settings/State/Records/ShellFeatureStateRecord.cs +++ b/src/Orchard.Web/Core/Settings/State/Records/ShellFeatureStateRecord.cs @@ -1,10 +1,10 @@ -using Orchard.Environment.State.Models; - -namespace Orchard.Core.Settings.State.Records { - public class ShellFeatureStateRecord { - public virtual int Id { get; set; } - public virtual string Name { get; set; } - public virtual ShellFeatureState.State InstallState { get; set; } - public virtual ShellFeatureState.State EnableState { get; set; } - } -} +using Orchard.Environment.State.Models; + +namespace Orchard.Core.Settings.State.Records { + public class ShellFeatureStateRecord { + public virtual int Id { get; set; } + public virtual string Name { get; set; } + public virtual ShellFeatureState.State InstallState { get; set; } + public virtual ShellFeatureState.State EnableState { get; set; } + } +} diff --git a/src/Orchard.Web/Core/Settings/State/Records/ShellStateRecord.cs b/src/Orchard.Web/Core/Settings/State/Records/ShellStateRecord.cs index 5860b8d8efa..2918ae38775 100644 --- a/src/Orchard.Web/Core/Settings/State/Records/ShellStateRecord.cs +++ b/src/Orchard.Web/Core/Settings/State/Records/ShellStateRecord.cs @@ -1,22 +1,22 @@ -using System.Collections.Generic; -using Orchard.Data.Conventions; - -namespace Orchard.Core.Settings.State.Records { - public class ShellStateRecord { - public ShellStateRecord() { - Features = new List(); - } - - public virtual int Id { get; set; } - - /// - /// Workaround SqlCe: There is apparently no way to insert a row in a table with a single column IDENTITY ID primary key. - /// See: http://www.sqldev.org/transactsql/insert-only-identity-column-value-in-sql-compact-edition-95267.shtml - /// So we added this "Unused" column. - /// - public virtual string Unused { get; set; } - - [CascadeAllDeleteOrphan] - public virtual IList Features { get; set; } - } +using System.Collections.Generic; +using Orchard.Data.Conventions; + +namespace Orchard.Core.Settings.State.Records { + public class ShellStateRecord { + public ShellStateRecord() { + Features = new List(); + } + + public virtual int Id { get; set; } + + /// + /// Workaround SqlCe: There is apparently no way to insert a row in a table with a single column IDENTITY ID primary key. + /// See: http://www.sqldev.org/transactsql/insert-only-identity-column-value-in-sql-compact-edition-95267.shtml + /// So we added this "Unused" column. + /// + public virtual string Unused { get; set; } + + [CascadeAllDeleteOrphan] + public virtual IList Features { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/State/ShellStateManager.cs b/src/Orchard.Web/Core/Settings/State/ShellStateManager.cs index b1bd059ac34..f86bb5d2b1a 100644 --- a/src/Orchard.Web/Core/Settings/State/ShellStateManager.cs +++ b/src/Orchard.Web/Core/Settings/State/ShellStateManager.cs @@ -1,83 +1,83 @@ -using System.Linq; -using Orchard.Core.Settings.State.Records; -using Orchard.Data; -using Orchard.Environment.State; -using Orchard.Environment.State.Models; -using Orchard.Environment.Descriptor; -using Orchard.Logging; - -namespace Orchard.Core.Settings.State { - public class ShellStateManager : Component, IShellStateManager { - private readonly IRepository _shellStateRepository; - private readonly IShellDescriptorManager _shellDescriptorManager; - - public ShellStateManager( - IRepository shellStateRepository, - IShellDescriptorManager shellDescriptorManager) { - _shellStateRepository = shellStateRepository; - _shellDescriptorManager = shellDescriptorManager; - } - - public ShellState GetShellState() { - var stateRecord = _shellStateRepository.Get(x => x != null) ?? new ShellStateRecord(); - var descriptor = _shellDescriptorManager.GetShellDescriptor(); - var extraFeatures = descriptor == null ? Enumerable.Empty() : descriptor.Features - .Select(r => r.Name) - .Except(stateRecord.Features.Select(r => r.Name)); - - return new ShellState { - Features = stateRecord.Features - .Select(featureStateRecord => new ShellFeatureState { - Name = featureStateRecord.Name, - EnableState = featureStateRecord.EnableState, - InstallState = featureStateRecord.InstallState - }) - .Concat(extraFeatures.Select(name => new ShellFeatureState { - Name = name - })) - .ToArray(), - }; - } - - private ShellFeatureStateRecord FeatureRecord(string name) { - var stateRecord = _shellStateRepository.Get(x => x != null) ?? new ShellStateRecord(); - var record = stateRecord.Features.SingleOrDefault(x => x.Name == name); - if (record == null) { - record = new ShellFeatureStateRecord { Name = name }; - stateRecord.Features.Add(record); - } - if (stateRecord.Id == 0) { - _shellStateRepository.Create(stateRecord); - } - return record; - } - - public void UpdateEnabledState(ShellFeatureState featureState, ShellFeatureState.State value) { - Logger.Debug("Feature {0} EnableState changed from {1} to {2}", - featureState.Name, featureState.EnableState, value); - - var featureStateRecord = FeatureRecord(featureState.Name); - if (featureStateRecord.EnableState != featureState.EnableState) { - Logger.Warning("Feature {0} prior EnableState was {1} when {2} was expected", - featureState.Name, featureStateRecord.EnableState, featureState.EnableState); - } - featureStateRecord.EnableState = value; - featureState.EnableState = value; - } - - - public void UpdateInstalledState(ShellFeatureState featureState, ShellFeatureState.State value) { - Logger.Debug("Feature {0} InstallState changed from {1} to {2}", - featureState.Name, featureState.InstallState, value); - - var featureStateRecord = FeatureRecord(featureState.Name); - if (featureStateRecord.InstallState != featureState.InstallState) { - Logger.Warning("Feature {0} prior InstallState was {1} when {2} was expected", - featureState.Name, featureStateRecord.InstallState, featureState.InstallState); - } - featureStateRecord.InstallState = value; - featureState.InstallState = value; - } - } - +using System.Linq; +using Orchard.Core.Settings.State.Records; +using Orchard.Data; +using Orchard.Environment.State; +using Orchard.Environment.State.Models; +using Orchard.Environment.Descriptor; +using Orchard.Logging; + +namespace Orchard.Core.Settings.State { + public class ShellStateManager : Component, IShellStateManager { + private readonly IRepository _shellStateRepository; + private readonly IShellDescriptorManager _shellDescriptorManager; + + public ShellStateManager( + IRepository shellStateRepository, + IShellDescriptorManager shellDescriptorManager) { + _shellStateRepository = shellStateRepository; + _shellDescriptorManager = shellDescriptorManager; + } + + public ShellState GetShellState() { + var stateRecord = _shellStateRepository.Get(x => x != null) ?? new ShellStateRecord(); + var descriptor = _shellDescriptorManager.GetShellDescriptor(); + var extraFeatures = descriptor == null ? Enumerable.Empty() : descriptor.Features + .Select(r => r.Name) + .Except(stateRecord.Features.Select(r => r.Name)); + + return new ShellState { + Features = stateRecord.Features + .Select(featureStateRecord => new ShellFeatureState { + Name = featureStateRecord.Name, + EnableState = featureStateRecord.EnableState, + InstallState = featureStateRecord.InstallState + }) + .Concat(extraFeatures.Select(name => new ShellFeatureState { + Name = name + })) + .ToArray(), + }; + } + + private ShellFeatureStateRecord FeatureRecord(string name) { + var stateRecord = _shellStateRepository.Get(x => x != null) ?? new ShellStateRecord(); + var record = stateRecord.Features.SingleOrDefault(x => x.Name == name); + if (record == null) { + record = new ShellFeatureStateRecord { Name = name }; + stateRecord.Features.Add(record); + } + if (stateRecord.Id == 0) { + _shellStateRepository.Create(stateRecord); + } + return record; + } + + public void UpdateEnabledState(ShellFeatureState featureState, ShellFeatureState.State value) { + Logger.Debug("Feature {0} EnableState changed from {1} to {2}", + featureState.Name, featureState.EnableState, value); + + var featureStateRecord = FeatureRecord(featureState.Name); + if (featureStateRecord.EnableState != featureState.EnableState) { + Logger.Warning("Feature {0} prior EnableState was {1} when {2} was expected", + featureState.Name, featureStateRecord.EnableState, featureState.EnableState); + } + featureStateRecord.EnableState = value; + featureState.EnableState = value; + } + + + public void UpdateInstalledState(ShellFeatureState featureState, ShellFeatureState.State value) { + Logger.Debug("Feature {0} InstallState changed from {1} to {2}", + featureState.Name, featureState.InstallState, value); + + var featureStateRecord = FeatureRecord(featureState.Name); + if (featureStateRecord.InstallState != featureState.InstallState) { + Logger.Warning("Feature {0} prior InstallState was {1} when {2} was expected", + featureState.Name, featureStateRecord.InstallState, featureState.InstallState); + } + featureStateRecord.InstallState = value; + featureState.InstallState = value; + } + } + } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/Styles/Web.config b/src/Orchard.Web/Core/Settings/Styles/Web.config index 74c71f22bd5..11135c33761 100644 --- a/src/Orchard.Web/Core/Settings/Styles/Web.config +++ b/src/Orchard.Web/Core/Settings/Styles/Web.config @@ -1,16 +1,16 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Settings/Styles/admin.css b/src/Orchard.Web/Core/Settings/Styles/admin.css index 6da6aeff10b..0515a3e2758 100644 --- a/src/Orchard.Web/Core/Settings/Styles/admin.css +++ b/src/Orchard.Web/Core/Settings/Styles/admin.css @@ -1,19 +1,19 @@ -.site-cultures { - font-size:1.4em; - line-height:1.8em; - overflow:auto; -} -.site-cultures li { - clear:left; - float:left; - overflow:auto; - padding:1px 6px; - margin:0 0 0 1em; -} -.site-cultures li:hover { - background:#EAEAEA; -} -.site-cultures div { - float:left; - width:8em; +.site-cultures { + font-size:1.4em; + line-height:1.8em; + overflow:auto; +} +.site-cultures li { + clear:left; + float:left; + overflow:auto; + padding:1px 6px; + margin:0 0 0 1em; +} +.site-cultures li:hover { + background:#EAEAEA; +} +.site-cultures div { + float:left; + width:8em; } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/Styles/menu.settings-admin.css b/src/Orchard.Web/Core/Settings/Styles/menu.settings-admin.css index 742dbc38e5b..1b2199f0603 100644 --- a/src/Orchard.Web/Core/Settings/Styles/menu.settings-admin.css +++ b/src/Orchard.Web/Core/Settings/Styles/menu.settings-admin.css @@ -1,6 +1,6 @@ -.navicon-settings { -background-image:url(images/menu.settings.png) !important; -} -.navicon-settings:hover { -background-position:0 -30px !important; +.navicon-settings { +background-image:url(images/menu.settings.png) !important; +} +.navicon-settings:hover { +background-position:0 -30px !important; } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/Tokens/SettingsTokens.cs b/src/Orchard.Web/Core/Settings/Tokens/SettingsTokens.cs index 65cc76b4e41..593f3fa5e1b 100644 --- a/src/Orchard.Web/Core/Settings/Tokens/SettingsTokens.cs +++ b/src/Orchard.Web/Core/Settings/Tokens/SettingsTokens.cs @@ -1,100 +1,100 @@ -using System; -using System.Linq; -using Orchard.ContentManagement; -using Orchard.ContentManagement.MetaData; -using Orchard.Events; -using Orchard.Localization; -using Orchard.Security; -using Orchard.Settings; -using Orchard.ContentManagement.FieldStorage; - -namespace Orchard.Core.Settings.Tokens { - public interface ITokenProvider : IEventHandler { - void Describe(dynamic context); - void Evaluate(dynamic context); - } - - public class SettingsTokens : ITokenProvider { - private readonly IOrchardServices _orchardServices; - private readonly IContentDefinitionManager _contentDefinitionManager; - private readonly IMembershipService _membershipService; - - public SettingsTokens( - IOrchardServices orchardServices, - IContentDefinitionManager contentDefinitionManager, - IMembershipService membershipService) { - _orchardServices = orchardServices; - _contentDefinitionManager = contentDefinitionManager; - _membershipService = membershipService; - } - - public Localizer T { get; set; } - - public void Describe(dynamic context) { - - context.For("Site", T("Site Settings"), T("Tokens for Site Settings")) - .Token("SiteName", T("Site Name"), T("The name of the site."), "Text") - .Token("SuperUser", T("Super User"), T("The super user of the site."), "Text") - .Token("Culture", T("Site Culture"), T("The current culture of the site."), "Text") - .Token("BaseUrl", T("Base Url"), T("The base url the site."), "Text") - .Token("TimeZone", T("Time Zone"), T("The current time zone of the site."), "Text") - ; - - // Token descriptors for fields - var customSettingsPart = _contentDefinitionManager.GetTypeDefinition("Site"); - if (customSettingsPart != null && customSettingsPart.Parts.SelectMany(x => x.PartDefinition.Fields).Any()) { - var partContext = context.For("Site"); - foreach (var partField in customSettingsPart.Parts.SelectMany(x => x.PartDefinition.Fields)) { - var field = partField; - var tokenName = field.Name; - - // the token is chained with the technical name - partContext.Token(tokenName, T("{0}", field.Name), T("The setting named {0}.", partField.DisplayName), field.Name); - } - } - - } - - public void Evaluate(dynamic context) { - var forContent = context.For("Site", (Func)(() => _orchardServices.WorkContext.CurrentSite)); - - forContent - .Token("SiteName", (Func)(content => content.SiteName)) - .Chain("SiteName", "Text", (Func)(content => content.SiteName)) - .Token("SuperUser", (Func)(content => content.SuperUser)) - .Chain("SuperUser", "User", (Func)(content => _membershipService.GetUser(content.SuperUser))) - .Token("Culture", (Func)(content => content.SiteCulture)) - .Chain("Culture", "Text", (Func)(content => content.SiteCulture)) - .Token("BaseUrl", (Func)(content => content.BaseUrl)) - .Chain("BaseUrl", "Text", (Func)(content => content.BaseUrl)) - .Token("TimeZone", (Func)(content => content.SiteTimeZone)) - .Chain("TimeZone", "Text", (Func)(content => content.SiteTimeZone)) - ; - - if (context.Target == "Site") { - // is there a content available in the context ? - if (forContent.Data != null && forContent.Data.ContentItem != null) { - var customSettingsPart = _contentDefinitionManager.GetTypeDefinition("Site"); - foreach (var partField in customSettingsPart.Parts.SelectMany(x => x.PartDefinition.Fields)) { - var field = partField; - var tokenName = partField.Name; - forContent.Token( - tokenName, - (Func)(content => LookupField(content, field.Name).Storage.Get())); - forContent.Chain( - tokenName, - partField.FieldDefinition.Name, - (Func)(content => LookupField(content, field.Name))); - } - } - } - } - - private static ContentField LookupField(IContent content, string fieldName) { - return content.ContentItem.Parts - .Where(part => part.PartDefinition.Name == "Site") - .SelectMany(part => part.Fields.Where(field => field.Name == fieldName)) - .FirstOrDefault(); - } - } +using System; +using System.Linq; +using Orchard.ContentManagement; +using Orchard.ContentManagement.MetaData; +using Orchard.Events; +using Orchard.Localization; +using Orchard.Security; +using Orchard.Settings; +using Orchard.ContentManagement.FieldStorage; + +namespace Orchard.Core.Settings.Tokens { + public interface ITokenProvider : IEventHandler { + void Describe(dynamic context); + void Evaluate(dynamic context); + } + + public class SettingsTokens : ITokenProvider { + private readonly IOrchardServices _orchardServices; + private readonly IContentDefinitionManager _contentDefinitionManager; + private readonly IMembershipService _membershipService; + + public SettingsTokens( + IOrchardServices orchardServices, + IContentDefinitionManager contentDefinitionManager, + IMembershipService membershipService) { + _orchardServices = orchardServices; + _contentDefinitionManager = contentDefinitionManager; + _membershipService = membershipService; + } + + public Localizer T { get; set; } + + public void Describe(dynamic context) { + + context.For("Site", T("Site Settings"), T("Tokens for Site Settings")) + .Token("SiteName", T("Site Name"), T("The name of the site."), "Text") + .Token("SuperUser", T("Super User"), T("The super user of the site."), "Text") + .Token("Culture", T("Site Culture"), T("The current culture of the site."), "Text") + .Token("BaseUrl", T("Base Url"), T("The base url the site."), "Text") + .Token("TimeZone", T("Time Zone"), T("The current time zone of the site."), "Text") + ; + + // Token descriptors for fields + var customSettingsPart = _contentDefinitionManager.GetTypeDefinition("Site"); + if (customSettingsPart != null && customSettingsPart.Parts.SelectMany(x => x.PartDefinition.Fields).Any()) { + var partContext = context.For("Site"); + foreach (var partField in customSettingsPart.Parts.SelectMany(x => x.PartDefinition.Fields)) { + var field = partField; + var tokenName = field.Name; + + // the token is chained with the technical name + partContext.Token(tokenName, T("{0}", field.Name), T("The setting named {0}.", partField.DisplayName), field.Name); + } + } + + } + + public void Evaluate(dynamic context) { + var forContent = context.For("Site", (Func)(() => _orchardServices.WorkContext.CurrentSite)); + + forContent + .Token("SiteName", (Func)(content => content.SiteName)) + .Chain("SiteName", "Text", (Func)(content => content.SiteName)) + .Token("SuperUser", (Func)(content => content.SuperUser)) + .Chain("SuperUser", "User", (Func)(content => _membershipService.GetUser(content.SuperUser))) + .Token("Culture", (Func)(content => content.SiteCulture)) + .Chain("Culture", "Text", (Func)(content => content.SiteCulture)) + .Token("BaseUrl", (Func)(content => content.BaseUrl)) + .Chain("BaseUrl", "Text", (Func)(content => content.BaseUrl)) + .Token("TimeZone", (Func)(content => content.SiteTimeZone)) + .Chain("TimeZone", "Text", (Func)(content => content.SiteTimeZone)) + ; + + if (context.Target == "Site") { + // is there a content available in the context ? + if (forContent.Data != null && forContent.Data.ContentItem != null) { + var customSettingsPart = _contentDefinitionManager.GetTypeDefinition("Site"); + foreach (var partField in customSettingsPart.Parts.SelectMany(x => x.PartDefinition.Fields)) { + var field = partField; + var tokenName = partField.Name; + forContent.Token( + tokenName, + (Func)(content => LookupField(content, field.Name).Storage.Get())); + forContent.Chain( + tokenName, + partField.FieldDefinition.Name, + (Func)(content => LookupField(content, field.Name))); + } + } + } + } + + private static ContentField LookupField(IContent content, string fieldName) { + return content.ContentItem.Parts + .Where(part => part.PartDefinition.Name == "Site") + .SelectMany(part => part.Fields.Where(field => field.Name == fieldName)) + .FirstOrDefault(); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/ViewModels/SiteCulturesViewModel.cs b/src/Orchard.Web/Core/Settings/ViewModels/SiteCulturesViewModel.cs index 9a0318eccca..9960c7c4472 100644 --- a/src/Orchard.Web/Core/Settings/ViewModels/SiteCulturesViewModel.cs +++ b/src/Orchard.Web/Core/Settings/ViewModels/SiteCulturesViewModel.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; - -namespace Orchard.Core.Settings.ViewModels { - public class SiteCulturesViewModel { - public string CurrentCulture { get; set; } - public IEnumerable SiteCultures { get; set; } - public IEnumerable AvailableSystemCultures { get; set; } - } +using System.Collections.Generic; + +namespace Orchard.Core.Settings.ViewModels { + public class SiteCulturesViewModel { + public string CurrentCulture { get; set; } + public IEnumerable SiteCultures { get; set; } + public IEnumerable AvailableSystemCultures { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/ViewModels/SiteSettingsPartViewModel.cs b/src/Orchard.Web/Core/Settings/ViewModels/SiteSettingsPartViewModel.cs index 456cb5a6dc7..5aa1caae79d 100644 --- a/src/Orchard.Web/Core/Settings/ViewModels/SiteSettingsPartViewModel.cs +++ b/src/Orchard.Web/Core/Settings/ViewModels/SiteSettingsPartViewModel.cs @@ -1,79 +1,79 @@ -using System; -using System.Collections.Generic; -using System.Web.Mvc; -using Orchard.Core.Settings.Models; -using Orchard.Settings; - -namespace Orchard.Core.Settings.ViewModels { - public class SiteSettingsPartViewModel { - public SiteSettingsPart Site { get; set; } - public IEnumerable SiteCultures { get; set; } - public IEnumerable SiteCalendars { get; set; } - public IEnumerable TimeZones { get; set; } - - [HiddenInput(DisplayValue = false)] - public int Id { - get { return Site.ContentItem.Id; } - } - - public string PageTitleSeparator { - get { return Site.PageTitleSeparator; } - set { Site.PageTitleSeparator = value; } - } - - public string SiteName { - get { return Site.SiteName; } - set { Site.SiteName = value; } - } - - public string SiteCulture { - get { return Site.SiteCulture; } - set { Site.SiteCulture = value; } - } - - public string SiteCalendar { - get { return Site.SiteCalendar; } - set { Site.SiteCalendar = value; } - } - - public string SuperUser { - get { return Site.SuperUser; } - set { Site.SuperUser = value; } - } - - public ResourceDebugMode ResourceDebugMode { - get { return Site.ResourceDebugMode; } - set { Site.ResourceDebugMode = value; } - } - - public bool UseCdn { - get { return Site.UseCdn; } - set { Site.UseCdn = value; } - } - - public int PageSize { - get { return Site.PageSize; } - set { Site.PageSize = value; } - } - - public int MaxPageSize { - get { return Site.MaxPageSize; } - set { Site.MaxPageSize = value; } - } - - public int MaxPagedCount { - get { return Site.MaxPagedCount; } - set { Site.MaxPagedCount = value; } - } - - public string BaseUrl { - get { return Site.BaseUrl; } - set { Site.BaseUrl = value; } - } - - public string TimeZone { - get { return Site.SiteTimeZone; } - set { Site.SiteTimeZone = value; } - } - } -} +using System; +using System.Collections.Generic; +using System.Web.Mvc; +using Orchard.Core.Settings.Models; +using Orchard.Settings; + +namespace Orchard.Core.Settings.ViewModels { + public class SiteSettingsPartViewModel { + public SiteSettingsPart Site { get; set; } + public IEnumerable SiteCultures { get; set; } + public IEnumerable SiteCalendars { get; set; } + public IEnumerable TimeZones { get; set; } + + [HiddenInput(DisplayValue = false)] + public int Id { + get { return Site.ContentItem.Id; } + } + + public string PageTitleSeparator { + get { return Site.PageTitleSeparator; } + set { Site.PageTitleSeparator = value; } + } + + public string SiteName { + get { return Site.SiteName; } + set { Site.SiteName = value; } + } + + public string SiteCulture { + get { return Site.SiteCulture; } + set { Site.SiteCulture = value; } + } + + public string SiteCalendar { + get { return Site.SiteCalendar; } + set { Site.SiteCalendar = value; } + } + + public string SuperUser { + get { return Site.SuperUser; } + set { Site.SuperUser = value; } + } + + public ResourceDebugMode ResourceDebugMode { + get { return Site.ResourceDebugMode; } + set { Site.ResourceDebugMode = value; } + } + + public bool UseCdn { + get { return Site.UseCdn; } + set { Site.UseCdn = value; } + } + + public int PageSize { + get { return Site.PageSize; } + set { Site.PageSize = value; } + } + + public int MaxPageSize { + get { return Site.MaxPageSize; } + set { Site.MaxPageSize = value; } + } + + public int MaxPagedCount { + get { return Site.MaxPagedCount; } + set { Site.MaxPagedCount = value; } + } + + public string BaseUrl { + get { return Site.BaseUrl; } + set { Site.BaseUrl = value; } + } + + public string TimeZone { + get { return Site.SiteTimeZone; } + set { Site.SiteTimeZone = value; } + } + } +} diff --git a/src/Orchard.Web/Core/Settings/Views/Admin/Culture.cshtml b/src/Orchard.Web/Core/Settings/Views/Admin/Culture.cshtml index 30edf4847a9..6008713cfa9 100644 --- a/src/Orchard.Web/Core/Settings/Views/Admin/Culture.cshtml +++ b/src/Orchard.Web/Core/Settings/Views/Admin/Culture.cshtml @@ -1,21 +1,21 @@ -@model SiteCulturesViewModel -@using Orchard.Core.Settings.ViewModels; - -@{ Layout.Title = T("Cultures").ToString(); } - - -

        @T("Available Cultures")

        -@using (Html.BeginFormAntiForgeryPost("AddCulture")) { -@Html.ValidationSummary() -
        - - @Html.DropDownList("SystemCultureName", new SelectList(Model.AvailableSystemCultures.OrderBy(s => s), Model.CurrentCulture)) - @T("Other"): @Html.TextBox("CultureName") - -
        -} -

        @T("Cultures this site supports")

        -@Html.UnorderedList( - Model.SiteCultures.OrderBy(s => s), - (s, i) => Html.DisplayFor(scvm => s, s == Model.CurrentCulture ? "CurrentCulture" : "RemovableCulture", ""), +@model SiteCulturesViewModel +@using Orchard.Core.Settings.ViewModels; + +@{ Layout.Title = T("Cultures").ToString(); } + + +

        @T("Available Cultures")

        +@using (Html.BeginFormAntiForgeryPost("AddCulture")) { +@Html.ValidationSummary() +
        + + @Html.DropDownList("SystemCultureName", new SelectList(Model.AvailableSystemCultures.OrderBy(s => s), Model.CurrentCulture)) + @T("Other"): @Html.TextBox("CultureName") + +
        +} +

        @T("Cultures this site supports")

        +@Html.UnorderedList( + Model.SiteCultures.OrderBy(s => s), + (s, i) => Html.DisplayFor(scvm => s, s == Model.CurrentCulture ? "CurrentCulture" : "RemovableCulture", ""), "site-cultures", "culture", "odd") \ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/Views/Admin/Index.cshtml b/src/Orchard.Web/Core/Settings/Views/Admin/Index.cshtml index f20c11a9f2c..4d951920d0a 100644 --- a/src/Orchard.Web/Core/Settings/Views/Admin/Index.cshtml +++ b/src/Orchard.Web/Core/Settings/Views/Admin/Index.cshtml @@ -1,12 +1,12 @@ -@using Orchard.ContentManagement -@{ - Layout.Title = T("Settings").ToString(); -} - -@using (Html.BeginFormAntiForgeryPost()) { - @Html.ValidationSummary() - @Display(Model.Content) -
        - -
        +@using Orchard.ContentManagement +@{ + Layout.Title = T("Settings").ToString(); +} + +@using (Html.BeginFormAntiForgeryPost()) { + @Html.ValidationSummary() + @Display(Model.Content) +
        + +
        } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/Views/DisplayTemplates/RemovableCulture.cshtml b/src/Orchard.Web/Core/Settings/Views/DisplayTemplates/RemovableCulture.cshtml index ab4da03870f..746a38e1474 100644 --- a/src/Orchard.Web/Core/Settings/Views/DisplayTemplates/RemovableCulture.cshtml +++ b/src/Orchard.Web/Core/Settings/Views/DisplayTemplates/RemovableCulture.cshtml @@ -1,7 +1,7 @@ -
        - @Model - @using (Html.BeginFormAntiForgeryPost(Url.Action("DeleteCulture", "Admin", new { area = "Settings" }), FormMethod.Post, new {@class = "inline link"})) { - @Html.Hidden("cultureName", (string)Model, new { id = "" }) - - } +
        + @Model + @using (Html.BeginFormAntiForgeryPost(Url.Action("DeleteCulture", "Admin", new { area = "Settings" }), FormMethod.Post, new {@class = "inline link"})) { + @Html.Hidden("cultureName", (string)Model, new { id = "" }) + + }
        \ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/Views/EditorTemplates/Parts.Settings.SiteSettingsPart.cshtml b/src/Orchard.Web/Core/Settings/Views/EditorTemplates/Parts.Settings.SiteSettingsPart.cshtml index eea869eaf90..b11cb093940 100644 --- a/src/Orchard.Web/Core/Settings/Views/EditorTemplates/Parts.Settings.SiteSettingsPart.cshtml +++ b/src/Orchard.Web/Core/Settings/Views/EditorTemplates/Parts.Settings.SiteSettingsPart.cshtml @@ -1,87 +1,87 @@ -@model Orchard.Core.Settings.ViewModels.SiteSettingsPartViewModel -@using Orchard.Settings; -@{ - var resourceDebugMode = new SelectList(new object[] { - new { Id = ResourceDebugMode.FromAppSetting, Text = T("Use web.config setting").Text }, - new { Id = ResourceDebugMode.Enabled, Text = T("Enabled").Text }, - new { Id = ResourceDebugMode.Disabled, Text = T("Disabled").Text }, - }, "Id", "Text", Model.ResourceDebugMode); -} -
        - @T("General") -
        - - @Html.EditorFor(m => m.SiteName) - @Html.ValidationMessage("SiteName", "*") -
        -
        - - @Html.TextBoxFor(m => m.BaseUrl, - (object)(AuthorizedFor(Orchard.Security.StandardPermissions.SiteOwner) - ? (dynamic)new { @class = "text medium is-url" } - : (dynamic)new { @class = "text medium is-url", @readonly = "readonly" })) - @T("Enter the fully qualified base URL of the web site.") - @T("e.g., http://localhost:30320/orchardlocal, http://www.yourdomain.com") -
        -
        - - @Html.DropDownList("SiteCulture", new SelectList(Model.SiteCultures, Model.SiteCulture)) - @Html.ValidationMessage("SiteCulture", "*") - @T("Determines the default culture used to localize strings and to format and parse numbers, date and times.") -

        @Html.ActionLink(T("Add or remove supported cultures for the site").ToString(), "Culture")

        -
        -
        - - @Html.DropDownList("SiteCalendar", new[] { new SelectListItem { Text = T("Culture calendar").Text, Value = "" } }.Union(new SelectList(Model.SiteCalendars, Model.SiteCalendar))) - @Html.ValidationMessage("SiteCalendar", "*") - @T("Determines the default calendar used when displaying and editing dates and times.") - @T("The 'Culture calendar' option means the default calendar for the culture of the current request will be used (not necessarily the configured default site culture).") -
        -
        - - @Html.DropDownList("TimeZone", new[] { new SelectListItem { Text = T("Local to server").Text, Value = "" } }.Union(new SelectList(Model.TimeZones, "Id", "", Model.TimeZone))) - @Html.ValidationMessage("TimeZone", "*") - @T("Determines the default time zone used when displaying and editing dates and times.") -
        -
        - - @Html.EditorFor(x => x.PageTitleSeparator) - @Html.ValidationMessage("PageTitleSeparator", "*") -
        -
        - - @Html.TextBoxFor(x => x.SuperUser, - (object)(AuthorizedFor(Orchard.Security.StandardPermissions.SiteOwner) - ? (dynamic)new { @class = "text single-line" } - : (dynamic)new { @class = "text single-line", @readonly = "readonly" })) - @Html.ValidationMessage("SuperUser", "*") - @T("Enter an existing account name, or nothing if you don't want a Super user account") -
        -
        - - @Html.DropDownList("ResourceDebugMode", resourceDebugMode) - @T("Determines whether scripts and stylesheets load in their debuggable or minified form.") -
        -
        - @Html.LabelFor(m => m.UseCdn, T("Use CDN")) - @Html.CheckBoxFor(m => m.UseCdn) - @T("Determines whether the defined CDN value is used for scripts and stylesheets, or their local version") -
        -
        - - @Html.TextBoxFor(m => m.PageSize, new { @class = "text small" }) - @T("Determines the default number of items that are shown per page.") -
        -@if (AuthorizedFor(Orchard.Security.StandardPermissions.SiteOwner)) { -
        - - @Html.TextBoxFor(m => m.MaxPageSize, new {@class = "text small"}) - @T("Determines the maximum number of items that are shown per page. Leave 0 for unlimited.") -
        -
        - - @Html.TextBoxFor(m => m.MaxPagedCount, new { @class = "text small" }) - @T("Determines the last element of the database that can be displayed. Leave 0 for unlimited.") -
        -} +@model Orchard.Core.Settings.ViewModels.SiteSettingsPartViewModel +@using Orchard.Settings; +@{ + var resourceDebugMode = new SelectList(new object[] { + new { Id = ResourceDebugMode.FromAppSetting, Text = T("Use web.config setting").Text }, + new { Id = ResourceDebugMode.Enabled, Text = T("Enabled").Text }, + new { Id = ResourceDebugMode.Disabled, Text = T("Disabled").Text }, + }, "Id", "Text", Model.ResourceDebugMode); +} +
        + @T("General") +
        + + @Html.EditorFor(m => m.SiteName) + @Html.ValidationMessage("SiteName", "*") +
        +
        + + @Html.TextBoxFor(m => m.BaseUrl, + (object)(AuthorizedFor(Orchard.Security.StandardPermissions.SiteOwner) + ? (dynamic)new { @class = "text medium is-url" } + : (dynamic)new { @class = "text medium is-url", @readonly = "readonly" })) + @T("Enter the fully qualified base URL of the web site.") + @T("e.g., http://localhost:30320/orchardlocal, http://www.yourdomain.com") +
        +
        + + @Html.DropDownList("SiteCulture", new SelectList(Model.SiteCultures, Model.SiteCulture)) + @Html.ValidationMessage("SiteCulture", "*") + @T("Determines the default culture used to localize strings and to format and parse numbers, date and times.") +

        @Html.ActionLink(T("Add or remove supported cultures for the site").ToString(), "Culture")

        +
        +
        + + @Html.DropDownList("SiteCalendar", new[] { new SelectListItem { Text = T("Culture calendar").Text, Value = "" } }.Union(new SelectList(Model.SiteCalendars, Model.SiteCalendar))) + @Html.ValidationMessage("SiteCalendar", "*") + @T("Determines the default calendar used when displaying and editing dates and times.") + @T("The 'Culture calendar' option means the default calendar for the culture of the current request will be used (not necessarily the configured default site culture).") +
        +
        + + @Html.DropDownList("TimeZone", new[] { new SelectListItem { Text = T("Local to server").Text, Value = "" } }.Union(new SelectList(Model.TimeZones, "Id", "", Model.TimeZone))) + @Html.ValidationMessage("TimeZone", "*") + @T("Determines the default time zone used when displaying and editing dates and times.") +
        +
        + + @Html.EditorFor(x => x.PageTitleSeparator) + @Html.ValidationMessage("PageTitleSeparator", "*") +
        +
        + + @Html.TextBoxFor(x => x.SuperUser, + (object)(AuthorizedFor(Orchard.Security.StandardPermissions.SiteOwner) + ? (dynamic)new { @class = "text single-line" } + : (dynamic)new { @class = "text single-line", @readonly = "readonly" })) + @Html.ValidationMessage("SuperUser", "*") + @T("Enter an existing account name, or nothing if you don't want a Super user account") +
        +
        + + @Html.DropDownList("ResourceDebugMode", resourceDebugMode) + @T("Determines whether scripts and stylesheets load in their debuggable or minified form.") +
        +
        + @Html.LabelFor(m => m.UseCdn, T("Use CDN")) + @Html.CheckBoxFor(m => m.UseCdn) + @T("Determines whether the defined CDN value is used for scripts and stylesheets, or their local version") +
        +
        + + @Html.TextBoxFor(m => m.PageSize, new { @class = "text small" }) + @T("Determines the default number of items that are shown per page.") +
        +@if (AuthorizedFor(Orchard.Security.StandardPermissions.SiteOwner)) { +
        + + @Html.TextBoxFor(m => m.MaxPageSize, new {@class = "text small"}) + @T("Determines the maximum number of items that are shown per page. Leave 0 for unlimited.") +
        +
        + + @Html.TextBoxFor(m => m.MaxPagedCount, new { @class = "text small" }) + @T("Determines the last element of the database that can be displayed. Leave 0 for unlimited.") +
        +}
        \ No newline at end of file diff --git a/src/Orchard.Web/Core/Shapes/CoreShapes.cs b/src/Orchard.Web/Core/Shapes/CoreShapes.cs index c1260411ee8..917e58b7947 100644 --- a/src/Orchard.Web/Core/Shapes/CoreShapes.cs +++ b/src/Orchard.Web/Core/Shapes/CoreShapes.cs @@ -1,813 +1,813 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Web; -using System.Web.Mvc; -using System.Web.Mvc.Html; -using System.Web.Routing; -using Orchard.ContentManagement; -using Orchard.DisplayManagement; -using Orchard.DisplayManagement.Descriptors; -using Orchard.DisplayManagement.Descriptors.ResourceBindingStrategy; -using Orchard.Environment; -using Orchard.Localization; -using Orchard.Mvc; -using Orchard.Settings; -using Orchard.UI; -using Orchard.UI.Resources; -using Orchard.UI.Zones; -using Orchard.Utility.Extensions; - -// ReSharper disable InconsistentNaming - -namespace Orchard.Core.Shapes { - public class CoreShapes : IShapeTableProvider { - private readonly Work _workContext; - private readonly Work _resourceManager; - private readonly Work _httpContextAccessor; - private readonly Work _shapeFactory; - - public CoreShapes( - Work workContext, - Work resourceManager, - Work httpContextAccessor, - Work shapeFactory - ) { - _workContext = workContext; - _resourceManager = resourceManager; - _httpContextAccessor = httpContextAccessor; - _shapeFactory = shapeFactory; - - T = NullLocalizer.Instance; - } - - public Localizer T { get; set; } - public dynamic New { get { return _shapeFactory.Value; } } - - public void Discover(ShapeTableBuilder builder) { - // the root page shape named 'Layout' is wrapped with 'Document' - // and has an automatic zone creating behavior - builder.Describe("Layout") - .Configure(descriptor => descriptor.Wrappers.Add("Document")) - .OnCreating(creating => creating.Create = () => new ZoneHolding(() => creating.New.Zone())) - .OnCreated(created => { - var layout = created.Shape; - - layout.Head = created.New.DocumentZone(ZoneName: "Head"); - layout.Body = created.New.DocumentZone(ZoneName: "Body"); - layout.Tail = created.New.DocumentZone(ZoneName: "Tail"); - - layout.Body.Add(created.New.PlaceChildContent(Source: layout)); - - layout.Content = created.New.Zone(); - layout.Content.ZoneName = "Content"; - layout.Content.Add(created.New.PlaceChildContent(Source: layout)); - - }); - - // 'Zone' shapes are built on the Zone base class - // They have class="zone zone-{name}" - // and the template can be specialized with "Zone-{Name}" base file name - builder.Describe("Zone") - .OnCreating(creating => creating.Create = () => new Zone()) - .OnDisplaying(displaying => { - var zone = displaying.Shape; - string zoneName = zone.ZoneName; - zone.Classes.Add("zone-" + zoneName.HtmlClassify()); - zone.Classes.Add("zone"); - - // Zone__[ZoneName] e.g. Zone-SideBar - zone.Metadata.Alternates.Add("Zone__" + zoneName); - }); - - builder.Describe("Menu") - .OnDisplaying(displaying => { - var menu = displaying.Shape; - string menuName = menu.MenuName; - menu.Classes.Add("menu-" + menuName.HtmlClassify()); - menu.Classes.Add("menu"); - menu.Metadata.Alternates.Add("Menu__" + EncodeAlternateElement(menuName)); - }); - - builder.Describe("MenuItem") - .OnDisplaying(displaying => { - var menuItem = displaying.Shape; - var menu = menuItem.Menu; - int level = menuItem.Level; - - menuItem.Metadata.Alternates.Add("MenuItem__level__" + level); - menuItem.Metadata.Alternates.Add("MenuItem__" + EncodeAlternateElement(menu.MenuName)); - menuItem.Metadata.Alternates.Add("MenuItem__" + EncodeAlternateElement(menu.MenuName) + "__level__" + level); - }); - - builder.Describe("MenuItemLink") - .OnDisplaying(displaying => { - var menuItem = displaying.Shape; - string menuName = menuItem.Menu.MenuName; - string contentType = null; - int level = menuItem.Level; - if (menuItem.Content != null) { - contentType = ((IContent) menuItem.Content).ContentItem.ContentType; - } - - menuItem.Metadata.Alternates.Add("MenuItemLink__level__" + level); - - // MenuItemLink__[ContentType] e.g. MenuItemLink-HtmlMenuItem - // MenuItemLink__[ContentType]__level__[level] e.g. MenuItemLink-HtmlMenuItem-level-2 - if (contentType != null) { - menuItem.Metadata.Alternates.Add("MenuItemLink__" + EncodeAlternateElement(contentType)); - menuItem.Metadata.Alternates.Add("MenuItemLink__" + EncodeAlternateElement(contentType) + "__level__" + level); - } - - // MenuItemLink__[MenuName] e.g. MenuItemLink-Main-Menu - // MenuItemLink__[MenuName]__level__[level] e.g. MenuItemLink-Main-Menu-level-2 - menuItem.Metadata.Alternates.Add("MenuItemLink__" + EncodeAlternateElement(menuName)); - menuItem.Metadata.Alternates.Add("MenuItemLink__" + EncodeAlternateElement(menuName) + "__level__" + level); - - // MenuItemLink__[MenuName]__[ContentType] e.g. MenuItemLink-Main-Menu-HtmlMenuItem - // MenuItemLink__[MenuName]__[ContentType] e.g. MenuItemLink-Main-Menu-HtmlMenuItem-level-2 - if (contentType != null) { - menuItem.Metadata.Alternates.Add("MenuItemLink__" + EncodeAlternateElement(menuName) + "__" + EncodeAlternateElement(contentType)); - menuItem.Metadata.Alternates.Add("MenuItemLink__" + EncodeAlternateElement(menuName) + "__" + EncodeAlternateElement(contentType) + "__level__" + level); - } - }); - - builder.Describe("LocalMenu") - .OnDisplaying(displaying => { - var menu = displaying.Shape; - string menuName = menu.MenuName; - menu.Classes.Add("localmenu-" + menuName.HtmlClassify()); - menu.Classes.Add("localmenu"); - menu.Metadata.Alternates.Add("LocalMenu__" + EncodeAlternateElement(menuName)); - }); - - builder.Describe("LocalMenuItem") - .OnDisplaying(displaying => { - var menuItem = displaying.Shape; - var menu = menuItem.Menu; - menuItem.Metadata.Alternates.Add("LocalMenuItem__" + EncodeAlternateElement(menu.MenuName)); - }); - - #region Pager alternates - builder.Describe("Pager") - .OnDisplaying(displaying => { - var pager = displaying.Shape; - string pagerId = pager.PagerId; - if (!String.IsNullOrWhiteSpace(pagerId)) - displaying.Shape.Metadata.Alternates.Add("Pager__" + EncodeAlternateElement(pagerId)); - }); - - builder.Describe("Pager_Gap") - .OnDisplaying(displaying => { - var pager = displaying.Shape.Pager; - string pagerId = pager.PagerId; - if (!String.IsNullOrWhiteSpace(pagerId)) - pager.Metadata.Alternates.Add("Pager_Gap__" + EncodeAlternateElement(pagerId)); - }); - - builder.Describe("Pager_First") - .OnDisplaying(displaying => { - var pager = displaying.Shape.Pager; - string pagerId = pager.PagerId; - if (!String.IsNullOrWhiteSpace(pagerId)) - displaying.Shape.Metadata.Alternates.Add("Pager_First__" + EncodeAlternateElement(pagerId)); - }); - - builder.Describe("Pager_Previous") - .OnDisplaying(displaying => { - var pager = displaying.Shape.Pager; - string pagerId = pager.PagerId; - if (!String.IsNullOrWhiteSpace(pagerId)) - displaying.Shape.Metadata.Alternates.Add("Pager_Previous__" + EncodeAlternateElement(pagerId)); - }); - - builder.Describe("Pager_Next") - .OnDisplaying(displaying => { - var pager = displaying.Shape.Pager; - string pagerId = pager.PagerId; - if (!String.IsNullOrWhiteSpace(pagerId)) - displaying.Shape.Metadata.Alternates.Add("Pager_Next__" + EncodeAlternateElement(pagerId)); - }); - - builder.Describe("Pager_Last") - .OnDisplaying(displaying => { - var pager = displaying.Shape.Pager; - string pagerId = pager.PagerId; - if (!String.IsNullOrWhiteSpace(pagerId)) - displaying.Shape.Metadata.Alternates.Add("Pager_Last__" + EncodeAlternateElement(pagerId)); - }); - - builder.Describe("Pager_CurrentPage") - .OnDisplaying(displaying => { - var pager = displaying.Shape.Pager; - string pagerId = pager.PagerId; - if (!String.IsNullOrWhiteSpace(pagerId)) - displaying.Shape.Metadata.Alternates.Add("Pager_CurrentPage__" + EncodeAlternateElement(pagerId)); - }); - - builder.Describe("Pager_Links") - .OnDisplaying(displaying => { - var pager = displaying.Shape; - string pagerId = pager.PagerId; - if (!String.IsNullOrWhiteSpace(pagerId)) - displaying.Shape.Metadata.Alternates.Add("Pager_Links__" + EncodeAlternateElement(pagerId)); - }); - - #endregion - - // 'List' shapes start with several empty collections - builder.Describe("List") - .OnCreated(created => { - var list = created.Shape; - list.Tag = "ul"; - list.ItemClasses = new List(); - list.ItemAttributes = new Dictionary(); - }); - - builder.Describe("Style") - .OnDisplaying(displaying => { - var resource = displaying.Shape; - string url = resource.Url; - var fileName = url != null ? StaticFileBindingStrategy.GetAlternateShapeNameFromFileName(url) : default(string); - if (!string.IsNullOrEmpty(fileName)) { - resource.Metadata.Alternates.Add("Style__" + fileName); - } - }); - - builder.Describe("Script") - .OnDisplaying(displaying => { - var resource = displaying.Shape; - string url = resource.Url; - var fileName = url != null ? StaticFileBindingStrategy.GetAlternateShapeNameFromFileName(url) : default(string); - if (!string.IsNullOrEmpty(fileName)) { - resource.Metadata.Alternates.Add("Script__" + fileName); - } - }); - - builder.Describe("Resource") - .OnDisplaying(displaying => { - var resource = displaying.Shape; - string url = resource.Url; - var fileName = url != null ? StaticFileBindingStrategy.GetAlternateShapeNameFromFileName(url) : default(string); - if (!string.IsNullOrEmpty(fileName)) { - resource.Metadata.Alternates.Add("Resource__" + fileName); - } - }); - } - - - static TagBuilder GetTagBuilder(string tagName, string id, IEnumerable classes, IDictionary attributes) { - var tagBuilder = new TagBuilder(tagName); - tagBuilder.MergeAttributes(attributes, false); - foreach (var cssClass in classes ?? Enumerable.Empty()) - tagBuilder.AddCssClass(cssClass); - if (!string.IsNullOrWhiteSpace(id)) - tagBuilder.GenerateId(id); - return tagBuilder; - } - - [Shape] - public void Zone(dynamic Display, dynamic Shape, TextWriter Output) { - string id = Shape.Id; - IEnumerable classes = Shape.Classes; - IDictionary attributes = Shape.Attributes; - var zoneWrapper = GetTagBuilder("div", id, classes, attributes); - Output.Write(zoneWrapper.ToString(TagRenderMode.StartTag)); - foreach (var item in Order(Shape)) - Output.Write(Display(item)); - Output.Write(zoneWrapper.ToString(TagRenderMode.EndTag)); - } - - [Shape] - public void ContentZone(dynamic Display, dynamic Shape, TextWriter Output) { - foreach (var item in Order(Shape)) - Output.Write(Display(item)); - } - - [Shape] - public void DocumentZone(dynamic Display, dynamic Shape, TextWriter Output) { - foreach (var item in Order(Shape)) - Output.Write(Display(item)); - } - - public static IEnumerable Order(dynamic shape) { - IEnumerable unordered = shape; - if (unordered == null || unordered.Count() < 2) - return shape; - - var i = 1; - var progress = 1; - var flatPositionComparer = new FlatPositionComparer(); - var ordering = unordered.Select(item => { - string position = null; - var itemPosition = item as IPositioned; - if (itemPosition != null) { - position = itemPosition.Position; - } - - return new { item, position }; - }).ToList(); - - // since this isn't sticking around (hence, the "hack" in the name), throwing (in) a gnome - while (i < ordering.Count()) { - if (flatPositionComparer.Compare(ordering[i].position, ordering[i - 1].position) > -1) { - if (i == progress) - progress = ++i; - else - i = progress; - } - else { - var higherThanItShouldBe = ordering[i]; - ordering[i] = ordering[i - 1]; - ordering[i - 1] = higherThanItShouldBe; - if (i > 1) - --i; - } - } - - return ordering.Select(ordered => ordered.item).ToList(); - } - - [Shape] - public void HeadScripts(dynamic Display, TextWriter Output) { - WriteResources(Display, Output, "script", ResourceLocation.Head, null); - WriteLiteralScripts(Output, _resourceManager.Value.GetRegisteredHeadScripts()); - } - - [Shape] - public void FootScripts(dynamic Display, TextWriter Output) { - WriteResources(Display, Output, "script", null, ResourceLocation.Head); - WriteLiteralScripts(Output, _resourceManager.Value.GetRegisteredFootScripts()); - } - - [Shape] - public void Metas(TextWriter Output) { - foreach (var meta in _resourceManager.Value.GetRegisteredMetas() ) { - Output.WriteLine(meta.GetTag()); - } - } - - [Shape] - public void HeadLinks(TextWriter Output) { - foreach (var link in _resourceManager.Value.GetRegisteredLinks() ) { - Output.WriteLine(link.GetTag()); - } - } - - [Shape] - public void StylesheetLinks(dynamic Display, TextWriter Output) { - WriteResources(Display, Output, "stylesheet", null, null); - } - - [Shape] - public void Style(dynamic Display, HtmlHelper Html, TextWriter Output, ResourceDefinition Resource, string Url, string Condition, Dictionary TagAttributes) { - // do not write to Output directly as Styles are rendered in Zones - ResourceManager.WriteResource(Html.ViewContext.Writer, Resource, Url, Condition, TagAttributes); - } - - [Shape] - public void Script(HtmlHelper Html, TextWriter Output, ResourceDefinition Resource, string Url, string Condition, Dictionary TagAttributes) { - // do not write to Output directly as Styles are rendered in Zones - ResourceManager.WriteResource(Html.ViewContext.Writer, Resource, Url, Condition, TagAttributes); - } - - [Shape] - public void Resource(TextWriter Output, ResourceDefinition Resource, string Url, string Condition, Dictionary TagAttributes) { - ResourceManager.WriteResource(Output, Resource, Url, Condition, TagAttributes); - } - - private static void WriteLiteralScripts(TextWriter output, IEnumerable scripts) { - if (scripts == null) { - return; - } - foreach (string script in scripts) { - output.WriteLine(script); - } - } - - private void WriteResources(dynamic Display, TextWriter Output, string resourceType, ResourceLocation? includeLocation, ResourceLocation? excludeLocation) { - bool debugMode; - var site = _workContext.Value.CurrentSite; - switch (site.ResourceDebugMode) { - case ResourceDebugMode.Enabled: - debugMode = true; - break; - case ResourceDebugMode.Disabled: - debugMode = false; - break; - default: - Debug.Assert(site.ResourceDebugMode == ResourceDebugMode.FromAppSetting, "Unknown ResourceDebugMode value."); - debugMode = _httpContextAccessor.Value.Current().IsDebuggingEnabled; - break; - } - var defaultSettings = new RequireSettings { - DebugMode = debugMode, - CdnMode = site.UseCdn, - Culture = _workContext.Value.CurrentCulture, - }; - var requiredResources = _resourceManager.Value.BuildRequiredResources(resourceType); - var appPath = _httpContextAccessor.Value.Current().Request.ApplicationPath; - foreach (var context in requiredResources.Where(r => - (includeLocation.HasValue ? r.Settings.Location == includeLocation.Value : true) && - (excludeLocation.HasValue ? r.Settings.Location != excludeLocation.Value : true))) { - - var path = context.GetResourceUrl(defaultSettings, appPath); - var condition = context.Settings.Condition; - var attributes = context.Settings.HasAttributes ? context.Settings.Attributes : null; - IHtmlString result; - if (resourceType == "stylesheet") { - result = Display.Style(Url: path, Condition: condition, Resource: context.Resource, TagAttributes: attributes); - } - else if (resourceType == "script") { - result = Display.Script(Url: path, Condition: condition, Resource: context.Resource, TagAttributes: attributes); - } - else { - result = Display.Resource(Url: path, Condition: condition, Resource: context.Resource, TagAttributes: attributes); - } - Output.Write(result); - } - } - - [Shape] - public IHtmlString Pager_Links(dynamic Shape, dynamic Display, - HtmlHelper Html, - int Page, - int PageSize, - double TotalItemCount, - int? Quantity, - object FirstText, - object PreviousText, - object NextText, - object LastText, - object GapText, - string PagerId - // parameter omitted to workaround an issue where a NullRef is thrown - // when an anonymous object is bound to an object shape parameter - /*object RouteValues*/) { - - var currentPage = Page; - if (currentPage < 1) - currentPage = 1; - - var pageSize = PageSize; - - var numberOfPagesToShow = Quantity ?? 0; - if (Quantity == null || Quantity < 0) - numberOfPagesToShow = 7; - - var totalPageCount = pageSize > 0 ? (int)Math.Ceiling(TotalItemCount / pageSize) : 1; - - var firstText = FirstText ?? T("<<"); - var previousText = PreviousText ?? T("<"); - var nextText = NextText ?? T(">"); - var lastText = LastText ?? T(">>"); - var gapText = GapText ?? T("..."); - - var routeData = new RouteValueDictionary(Html.ViewContext.RouteData.Values); - var queryString = _workContext.Value.HttpContext.Request.QueryString; - if (queryString != null) { - foreach (var key in from string key in queryString.Keys where key != null && !routeData.ContainsKey(key) let value = queryString[key] select key) { - routeData[key] = queryString[key]; - } - } - - // specific cross-requests route data can be passed to the shape directly (e.g., Orchard.Users) - var shapeRoute = (object)Shape.RouteData; - - if (shapeRoute != null) { - var shapeRouteData = shapeRoute as RouteValueDictionary; - if (shapeRouteData == null) { - var route = shapeRoute as RouteData; - if (route != null) { - shapeRouteData = (route).Values; - } - } - - if (shapeRouteData != null) { - foreach (var rd in shapeRouteData) { - routeData[rd.Key] = rd.Value; - } - } - } - - // HACK: MVC 3 is adding a specific value in System.Web.Mvc.Html.ChildActionExtensions.ActionHelper - // when a content item is set as home page, it is rendered by using Html.RenderAction, and the routeData is altered - // This code removes this extra route value - var removedKeys = routeData.Keys.Where(key => routeData[key] is DictionaryValueProvider).ToList(); - foreach (var key in removedKeys) { - routeData.Remove(key); - } - - int firstPage = Math.Max(1, Page - (numberOfPagesToShow / 2)); - int lastPage = Math.Min(totalPageCount, Page + (int)(numberOfPagesToShow / 2)); - - var pageKey = String.IsNullOrEmpty(PagerId) ? "page" : PagerId; - - Shape.Classes.Add("pager"); - Shape.Metadata.Alternates.Clear(); - Shape.Metadata.Type = "List"; - - // first and previous pages - if (Page > 1) { - if (routeData.ContainsKey(pageKey)) { - routeData.Remove(pageKey); // to keep from having "page=1" in the query string - } - // first - Shape.Add(New.Pager_First(Value: firstText, RouteValues: new RouteValueDictionary(routeData), Pager: Shape)); - - // previous - if (currentPage > 2) { // also to keep from having "page=1" in the query string - routeData[pageKey] = currentPage - 1; - } - Shape.Add(New.Pager_Previous(Value: previousText, RouteValues: new RouteValueDictionary(routeData), Pager: Shape)); - } - - // gap at the beginning of the pager - if (firstPage > 1 && numberOfPagesToShow > 0) { - Shape.Add(New.Pager_Gap(Value: gapText, Pager: Shape)); - } - - // page numbers - if (numberOfPagesToShow > 0 && lastPage > 1) { - for (var p = firstPage; p <= lastPage; p++) { - if (p == currentPage) { - Shape.Add(New.Pager_CurrentPage(Value: p, RouteValues: new RouteValueDictionary(routeData), Pager: Shape)); - } - else { - if (p == 1) - routeData.Remove(pageKey); - else - routeData[pageKey] = p; - Shape.Add(New.Pager_Link(Value: p, RouteValues: new RouteValueDictionary(routeData), Pager: Shape)); - } - } - } - - // gap at the end of the pager - if (lastPage < totalPageCount && numberOfPagesToShow > 0) { - Shape.Add(New.Pager_Gap(Value: gapText, Pager: Shape)); - } - - // next and last pages - if (Page < totalPageCount) { - // next - routeData[pageKey] = Page + 1; - Shape.Add(New.Pager_Next(Value: nextText, RouteValues: new RouteValueDictionary(routeData), Pager: Shape)); - // last - routeData[pageKey] = totalPageCount; - Shape.Add(New.Pager_Last(Value: lastText, RouteValues: new RouteValueDictionary(routeData), Pager: Shape)); - } - - return Display(Shape); - } - - [Shape] - public IHtmlString Pager(dynamic Shape, dynamic Display) { - Shape.Metadata.Alternates.Clear(); - Shape.Metadata.Type = "Pager_Links"; - return Display(Shape); - } - - [Shape] - public IHtmlString Pager_First(dynamic Shape, dynamic Display) { - Shape.Metadata.Alternates.Clear(); - Shape.Metadata.Type = "Pager_Link"; - return Display(Shape); - } - - [Shape] - public IHtmlString Pager_Previous(dynamic Shape, dynamic Display) { - Shape.Metadata.Alternates.Clear(); - Shape.Metadata.Type = "Pager_Link"; - return Display(Shape); - } - - [Shape] - public IHtmlString Pager_CurrentPage(HtmlHelper Html, dynamic Display, object Value) { - var tagBuilder = new TagBuilder("span"); - tagBuilder.InnerHtml = EncodeOrDisplay(Value, Display, Html).ToString(); - - return MvcHtmlString.Create(tagBuilder.ToString()); - } - - [Shape] - public IHtmlString Pager_Next(dynamic Shape, dynamic Display) { - Shape.Metadata.Alternates.Clear(); - Shape.Metadata.Type = "Pager_Link"; - return Display(Shape); - } - - [Shape] - public IHtmlString Pager_Last(dynamic Shape, dynamic Display) { - Shape.Metadata.Alternates.Clear(); - Shape.Metadata.Type = "Pager_Link"; - return Display(Shape); - } - - [Shape] - public IHtmlString Pager_Link(HtmlHelper Html, dynamic Shape, dynamic Display, object Value) { - Shape.Metadata.Alternates.Clear(); - Shape.Metadata.Type = "ActionLink"; - return Display(Shape); - } - - [Shape] - public IHtmlString ActionLink(HtmlHelper Html, UrlHelper Url, dynamic Shape, dynamic Display, object Value) { - var RouteValues = (object)Shape.RouteValues; - RouteValueDictionary rvd; - if (RouteValues == null) { - rvd = new RouteValueDictionary(); - } - else { - rvd = RouteValues is RouteValueDictionary ? (RouteValueDictionary)RouteValues : new RouteValueDictionary(RouteValues); - } - - var action = Url.Action((string)rvd["action"], (string)rvd["controller"], rvd); - - IEnumerable classes = Shape.Classes; - IDictionary attributes = Shape.Attributes; - attributes["href"] = action; - string id = Shape.Id; - var tag = GetTagBuilder("a", id, classes, attributes); - tag.InnerHtml = EncodeOrDisplay(Value, Display, Html).ToString(); - - return Html.Raw(tag.ToString()); - } - - [Shape] - public IHtmlString Pager_Gap(HtmlHelper Html, dynamic Display, object Value) { - var tagBuilder = new TagBuilder("span"); - tagBuilder.InnerHtml = EncodeOrDisplay(Value, Display, Html).ToString(); - - return MvcHtmlString.Create(tagBuilder.ToString()); - } - - [Shape] - public void List( - dynamic Display, - TextWriter Output, - IEnumerable Items, - string Tag, - string Id, - IEnumerable Classes, - IDictionary Attributes, - string ItemTag, - IEnumerable ItemClasses, - IDictionary ItemAttributes) { - - if (Items == null) - return; - - // prevent multiple enumerations - var items = Items.ToList(); - - // var itemDisplayOutputs = Items.Select(item => Display(item)).Where(output => !string.IsNullOrWhiteSpace(output.ToHtmlString())).ToList(); - var count = items.Count(); - if (count < 1) - return; - - string listTagName = null; - - if (Tag != "-") { - listTagName = string.IsNullOrEmpty(Tag) ? "ul" : Tag; - } - - var listTag = String.IsNullOrEmpty(listTagName) ? null : GetTagBuilder(listTagName, Id, Classes, Attributes); - - string itemTagName = null; - if (ItemTag != "-") { - itemTagName = string.IsNullOrEmpty(ItemTag) ? "li" : ItemTag; - } - - if (listTag != null) { - Output.Write(listTag.ToString(TagRenderMode.StartTag)); - } - - var itemTags = new List(); - var itemOutputs = new List(); - - // give the item shape the possibility to alter its container tag - var index = 0; - foreach (var item in items) { - - var itemTag = String.IsNullOrEmpty(itemTagName) ? null : GetTagBuilder(itemTagName, null, ItemClasses, ItemAttributes); - - if (item is IShape) { - item.Tag = itemTag; - } - - var itemOutput = Display(item).ToHtmlString(); - - if (!String.IsNullOrWhiteSpace(itemOutput)) { - itemTags.Add(itemTag); - itemOutputs.Add(itemOutput); - } - else { - count--; - } - - ++index; - } - - index = 0; - foreach(var itemOutput in itemOutputs) { - var itemTag = itemTags[index]; - - if (itemTag != null) { - if (index == 0) - itemTag.AddCssClass("first"); - if (index == count - 1) - itemTag.AddCssClass("last"); - Output.Write(itemTag.ToString(TagRenderMode.StartTag)); - } - - Output.Write(itemOutput); - - if (itemTag != null) { - Output.WriteLine(itemTag.ToString(TagRenderMode.EndTag)); - } - - ++index; - } - - if (listTag != null) { - Output.WriteLine(listTag.ToString(TagRenderMode.EndTag)); - } - } - - [Shape] - public IHtmlString PlaceChildContent(dynamic Source) { - return Source.Metadata.ChildContent; - } - - [Shape] - public void Partial(HtmlHelper Html, TextWriter Output, string TemplateName, object Model, string Prefix) { - RenderInternal(Html, Output, TemplateName, Model, Prefix); - } - - [Shape] - public void DisplayTemplate(HtmlHelper Html, TextWriter Output, string TemplateName, object Model, string Prefix) { - RenderInternal(Html, Output, "DisplayTemplates/" + TemplateName, Model, Prefix); - } - - [Shape] - public void EditorTemplate(HtmlHelper Html, TextWriter Output, string TemplateName, object Model, string Prefix) { - RenderInternal(Html, Output, "EditorTemplates/" + TemplateName, Model, Prefix); - } - - static void RenderInternal(HtmlHelper Html, TextWriter Output, string TemplateName, object Model, string Prefix) { - var adjustedViewData = new ViewDataDictionary(Html.ViewDataContainer.ViewData) { - Model = DetermineModel(Html, Model), - TemplateInfo = new TemplateInfo { - HtmlFieldPrefix = DeterminePrefix(Html, Prefix) - } - }; - var adjustedViewContext = new ViewContext(Html.ViewContext, Html.ViewContext.View, adjustedViewData, Html.ViewContext.TempData, Output); - var adjustedHtml = new HtmlHelper(adjustedViewContext, new ViewDataContainer(adjustedViewData)); - adjustedHtml.RenderPartial(TemplateName); - } - - static object DetermineModel(HtmlHelper Html, object Model) { - bool isNull = ((dynamic)Model) == null; - return isNull ? Html.ViewData.Model : Model; - } - - static string DeterminePrefix(HtmlHelper Html, string Prefix) { - var actualPrefix = string.IsNullOrEmpty(Prefix) - ? Html.ViewContext.ViewData.TemplateInfo.HtmlFieldPrefix - : Html.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldName(Prefix); - return actualPrefix; - } - - private class ViewDataContainer : IViewDataContainer { - public ViewDataContainer(ViewDataDictionary viewData) { ViewData = viewData; } - public ViewDataDictionary ViewData { get; set; } - } - - /// - /// Encodes dashed and dots so that they don't conflict in filenames - /// - /// - /// - private string EncodeAlternateElement(string alternateElement) { - return alternateElement.Replace("-", "__").Replace(".", "_"); - } - - /// - /// Encode a value if it's a string, or render it if it's a Shape - /// - private IHtmlString EncodeOrDisplay(dynamic Value, dynamic Display, HtmlHelper Html) { - if (Value is IHtmlString) { - return Value; - } - - if (Value is IShape) { - return Display(Value).ToString(); - } - - return Html.Raw(Html.Encode(Value.ToString())); - } - } -} +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using System.Web.Mvc.Html; +using System.Web.Routing; +using Orchard.ContentManagement; +using Orchard.DisplayManagement; +using Orchard.DisplayManagement.Descriptors; +using Orchard.DisplayManagement.Descriptors.ResourceBindingStrategy; +using Orchard.Environment; +using Orchard.Localization; +using Orchard.Mvc; +using Orchard.Settings; +using Orchard.UI; +using Orchard.UI.Resources; +using Orchard.UI.Zones; +using Orchard.Utility.Extensions; + +// ReSharper disable InconsistentNaming + +namespace Orchard.Core.Shapes { + public class CoreShapes : IShapeTableProvider { + private readonly Work _workContext; + private readonly Work _resourceManager; + private readonly Work _httpContextAccessor; + private readonly Work _shapeFactory; + + public CoreShapes( + Work workContext, + Work resourceManager, + Work httpContextAccessor, + Work shapeFactory + ) { + _workContext = workContext; + _resourceManager = resourceManager; + _httpContextAccessor = httpContextAccessor; + _shapeFactory = shapeFactory; + + T = NullLocalizer.Instance; + } + + public Localizer T { get; set; } + public dynamic New { get { return _shapeFactory.Value; } } + + public void Discover(ShapeTableBuilder builder) { + // the root page shape named 'Layout' is wrapped with 'Document' + // and has an automatic zone creating behavior + builder.Describe("Layout") + .Configure(descriptor => descriptor.Wrappers.Add("Document")) + .OnCreating(creating => creating.Create = () => new ZoneHolding(() => creating.New.Zone())) + .OnCreated(created => { + var layout = created.Shape; + + layout.Head = created.New.DocumentZone(ZoneName: "Head"); + layout.Body = created.New.DocumentZone(ZoneName: "Body"); + layout.Tail = created.New.DocumentZone(ZoneName: "Tail"); + + layout.Body.Add(created.New.PlaceChildContent(Source: layout)); + + layout.Content = created.New.Zone(); + layout.Content.ZoneName = "Content"; + layout.Content.Add(created.New.PlaceChildContent(Source: layout)); + + }); + + // 'Zone' shapes are built on the Zone base class + // They have class="zone zone-{name}" + // and the template can be specialized with "Zone-{Name}" base file name + builder.Describe("Zone") + .OnCreating(creating => creating.Create = () => new Zone()) + .OnDisplaying(displaying => { + var zone = displaying.Shape; + string zoneName = zone.ZoneName; + zone.Classes.Add("zone-" + zoneName.HtmlClassify()); + zone.Classes.Add("zone"); + + // Zone__[ZoneName] e.g. Zone-SideBar + zone.Metadata.Alternates.Add("Zone__" + zoneName); + }); + + builder.Describe("Menu") + .OnDisplaying(displaying => { + var menu = displaying.Shape; + string menuName = menu.MenuName; + menu.Classes.Add("menu-" + menuName.HtmlClassify()); + menu.Classes.Add("menu"); + menu.Metadata.Alternates.Add("Menu__" + EncodeAlternateElement(menuName)); + }); + + builder.Describe("MenuItem") + .OnDisplaying(displaying => { + var menuItem = displaying.Shape; + var menu = menuItem.Menu; + int level = menuItem.Level; + + menuItem.Metadata.Alternates.Add("MenuItem__level__" + level); + menuItem.Metadata.Alternates.Add("MenuItem__" + EncodeAlternateElement(menu.MenuName)); + menuItem.Metadata.Alternates.Add("MenuItem__" + EncodeAlternateElement(menu.MenuName) + "__level__" + level); + }); + + builder.Describe("MenuItemLink") + .OnDisplaying(displaying => { + var menuItem = displaying.Shape; + string menuName = menuItem.Menu.MenuName; + string contentType = null; + int level = menuItem.Level; + if (menuItem.Content != null) { + contentType = ((IContent) menuItem.Content).ContentItem.ContentType; + } + + menuItem.Metadata.Alternates.Add("MenuItemLink__level__" + level); + + // MenuItemLink__[ContentType] e.g. MenuItemLink-HtmlMenuItem + // MenuItemLink__[ContentType]__level__[level] e.g. MenuItemLink-HtmlMenuItem-level-2 + if (contentType != null) { + menuItem.Metadata.Alternates.Add("MenuItemLink__" + EncodeAlternateElement(contentType)); + menuItem.Metadata.Alternates.Add("MenuItemLink__" + EncodeAlternateElement(contentType) + "__level__" + level); + } + + // MenuItemLink__[MenuName] e.g. MenuItemLink-Main-Menu + // MenuItemLink__[MenuName]__level__[level] e.g. MenuItemLink-Main-Menu-level-2 + menuItem.Metadata.Alternates.Add("MenuItemLink__" + EncodeAlternateElement(menuName)); + menuItem.Metadata.Alternates.Add("MenuItemLink__" + EncodeAlternateElement(menuName) + "__level__" + level); + + // MenuItemLink__[MenuName]__[ContentType] e.g. MenuItemLink-Main-Menu-HtmlMenuItem + // MenuItemLink__[MenuName]__[ContentType] e.g. MenuItemLink-Main-Menu-HtmlMenuItem-level-2 + if (contentType != null) { + menuItem.Metadata.Alternates.Add("MenuItemLink__" + EncodeAlternateElement(menuName) + "__" + EncodeAlternateElement(contentType)); + menuItem.Metadata.Alternates.Add("MenuItemLink__" + EncodeAlternateElement(menuName) + "__" + EncodeAlternateElement(contentType) + "__level__" + level); + } + }); + + builder.Describe("LocalMenu") + .OnDisplaying(displaying => { + var menu = displaying.Shape; + string menuName = menu.MenuName; + menu.Classes.Add("localmenu-" + menuName.HtmlClassify()); + menu.Classes.Add("localmenu"); + menu.Metadata.Alternates.Add("LocalMenu__" + EncodeAlternateElement(menuName)); + }); + + builder.Describe("LocalMenuItem") + .OnDisplaying(displaying => { + var menuItem = displaying.Shape; + var menu = menuItem.Menu; + menuItem.Metadata.Alternates.Add("LocalMenuItem__" + EncodeAlternateElement(menu.MenuName)); + }); + + #region Pager alternates + builder.Describe("Pager") + .OnDisplaying(displaying => { + var pager = displaying.Shape; + string pagerId = pager.PagerId; + if (!String.IsNullOrWhiteSpace(pagerId)) + displaying.Shape.Metadata.Alternates.Add("Pager__" + EncodeAlternateElement(pagerId)); + }); + + builder.Describe("Pager_Gap") + .OnDisplaying(displaying => { + var pager = displaying.Shape.Pager; + string pagerId = pager.PagerId; + if (!String.IsNullOrWhiteSpace(pagerId)) + pager.Metadata.Alternates.Add("Pager_Gap__" + EncodeAlternateElement(pagerId)); + }); + + builder.Describe("Pager_First") + .OnDisplaying(displaying => { + var pager = displaying.Shape.Pager; + string pagerId = pager.PagerId; + if (!String.IsNullOrWhiteSpace(pagerId)) + displaying.Shape.Metadata.Alternates.Add("Pager_First__" + EncodeAlternateElement(pagerId)); + }); + + builder.Describe("Pager_Previous") + .OnDisplaying(displaying => { + var pager = displaying.Shape.Pager; + string pagerId = pager.PagerId; + if (!String.IsNullOrWhiteSpace(pagerId)) + displaying.Shape.Metadata.Alternates.Add("Pager_Previous__" + EncodeAlternateElement(pagerId)); + }); + + builder.Describe("Pager_Next") + .OnDisplaying(displaying => { + var pager = displaying.Shape.Pager; + string pagerId = pager.PagerId; + if (!String.IsNullOrWhiteSpace(pagerId)) + displaying.Shape.Metadata.Alternates.Add("Pager_Next__" + EncodeAlternateElement(pagerId)); + }); + + builder.Describe("Pager_Last") + .OnDisplaying(displaying => { + var pager = displaying.Shape.Pager; + string pagerId = pager.PagerId; + if (!String.IsNullOrWhiteSpace(pagerId)) + displaying.Shape.Metadata.Alternates.Add("Pager_Last__" + EncodeAlternateElement(pagerId)); + }); + + builder.Describe("Pager_CurrentPage") + .OnDisplaying(displaying => { + var pager = displaying.Shape.Pager; + string pagerId = pager.PagerId; + if (!String.IsNullOrWhiteSpace(pagerId)) + displaying.Shape.Metadata.Alternates.Add("Pager_CurrentPage__" + EncodeAlternateElement(pagerId)); + }); + + builder.Describe("Pager_Links") + .OnDisplaying(displaying => { + var pager = displaying.Shape; + string pagerId = pager.PagerId; + if (!String.IsNullOrWhiteSpace(pagerId)) + displaying.Shape.Metadata.Alternates.Add("Pager_Links__" + EncodeAlternateElement(pagerId)); + }); + + #endregion + + // 'List' shapes start with several empty collections + builder.Describe("List") + .OnCreated(created => { + var list = created.Shape; + list.Tag = "ul"; + list.ItemClasses = new List(); + list.ItemAttributes = new Dictionary(); + }); + + builder.Describe("Style") + .OnDisplaying(displaying => { + var resource = displaying.Shape; + string url = resource.Url; + var fileName = url != null ? StaticFileBindingStrategy.GetAlternateShapeNameFromFileName(url) : default(string); + if (!string.IsNullOrEmpty(fileName)) { + resource.Metadata.Alternates.Add("Style__" + fileName); + } + }); + + builder.Describe("Script") + .OnDisplaying(displaying => { + var resource = displaying.Shape; + string url = resource.Url; + var fileName = url != null ? StaticFileBindingStrategy.GetAlternateShapeNameFromFileName(url) : default(string); + if (!string.IsNullOrEmpty(fileName)) { + resource.Metadata.Alternates.Add("Script__" + fileName); + } + }); + + builder.Describe("Resource") + .OnDisplaying(displaying => { + var resource = displaying.Shape; + string url = resource.Url; + var fileName = url != null ? StaticFileBindingStrategy.GetAlternateShapeNameFromFileName(url) : default(string); + if (!string.IsNullOrEmpty(fileName)) { + resource.Metadata.Alternates.Add("Resource__" + fileName); + } + }); + } + + + static TagBuilder GetTagBuilder(string tagName, string id, IEnumerable classes, IDictionary attributes) { + var tagBuilder = new TagBuilder(tagName); + tagBuilder.MergeAttributes(attributes, false); + foreach (var cssClass in classes ?? Enumerable.Empty()) + tagBuilder.AddCssClass(cssClass); + if (!string.IsNullOrWhiteSpace(id)) + tagBuilder.GenerateId(id); + return tagBuilder; + } + + [Shape] + public void Zone(dynamic Display, dynamic Shape, TextWriter Output) { + string id = Shape.Id; + IEnumerable classes = Shape.Classes; + IDictionary attributes = Shape.Attributes; + var zoneWrapper = GetTagBuilder("div", id, classes, attributes); + Output.Write(zoneWrapper.ToString(TagRenderMode.StartTag)); + foreach (var item in Order(Shape)) + Output.Write(Display(item)); + Output.Write(zoneWrapper.ToString(TagRenderMode.EndTag)); + } + + [Shape] + public void ContentZone(dynamic Display, dynamic Shape, TextWriter Output) { + foreach (var item in Order(Shape)) + Output.Write(Display(item)); + } + + [Shape] + public void DocumentZone(dynamic Display, dynamic Shape, TextWriter Output) { + foreach (var item in Order(Shape)) + Output.Write(Display(item)); + } + + public static IEnumerable Order(dynamic shape) { + IEnumerable unordered = shape; + if (unordered == null || unordered.Count() < 2) + return shape; + + var i = 1; + var progress = 1; + var flatPositionComparer = new FlatPositionComparer(); + var ordering = unordered.Select(item => { + string position = null; + var itemPosition = item as IPositioned; + if (itemPosition != null) { + position = itemPosition.Position; + } + + return new { item, position }; + }).ToList(); + + // since this isn't sticking around (hence, the "hack" in the name), throwing (in) a gnome + while (i < ordering.Count()) { + if (flatPositionComparer.Compare(ordering[i].position, ordering[i - 1].position) > -1) { + if (i == progress) + progress = ++i; + else + i = progress; + } + else { + var higherThanItShouldBe = ordering[i]; + ordering[i] = ordering[i - 1]; + ordering[i - 1] = higherThanItShouldBe; + if (i > 1) + --i; + } + } + + return ordering.Select(ordered => ordered.item).ToList(); + } + + [Shape] + public void HeadScripts(dynamic Display, TextWriter Output) { + WriteResources(Display, Output, "script", ResourceLocation.Head, null); + WriteLiteralScripts(Output, _resourceManager.Value.GetRegisteredHeadScripts()); + } + + [Shape] + public void FootScripts(dynamic Display, TextWriter Output) { + WriteResources(Display, Output, "script", null, ResourceLocation.Head); + WriteLiteralScripts(Output, _resourceManager.Value.GetRegisteredFootScripts()); + } + + [Shape] + public void Metas(TextWriter Output) { + foreach (var meta in _resourceManager.Value.GetRegisteredMetas() ) { + Output.WriteLine(meta.GetTag()); + } + } + + [Shape] + public void HeadLinks(TextWriter Output) { + foreach (var link in _resourceManager.Value.GetRegisteredLinks() ) { + Output.WriteLine(link.GetTag()); + } + } + + [Shape] + public void StylesheetLinks(dynamic Display, TextWriter Output) { + WriteResources(Display, Output, "stylesheet", null, null); + } + + [Shape] + public void Style(dynamic Display, HtmlHelper Html, TextWriter Output, ResourceDefinition Resource, string Url, string Condition, Dictionary TagAttributes) { + // do not write to Output directly as Styles are rendered in Zones + ResourceManager.WriteResource(Html.ViewContext.Writer, Resource, Url, Condition, TagAttributes); + } + + [Shape] + public void Script(HtmlHelper Html, TextWriter Output, ResourceDefinition Resource, string Url, string Condition, Dictionary TagAttributes) { + // do not write to Output directly as Styles are rendered in Zones + ResourceManager.WriteResource(Html.ViewContext.Writer, Resource, Url, Condition, TagAttributes); + } + + [Shape] + public void Resource(TextWriter Output, ResourceDefinition Resource, string Url, string Condition, Dictionary TagAttributes) { + ResourceManager.WriteResource(Output, Resource, Url, Condition, TagAttributes); + } + + private static void WriteLiteralScripts(TextWriter output, IEnumerable scripts) { + if (scripts == null) { + return; + } + foreach (string script in scripts) { + output.WriteLine(script); + } + } + + private void WriteResources(dynamic Display, TextWriter Output, string resourceType, ResourceLocation? includeLocation, ResourceLocation? excludeLocation) { + bool debugMode; + var site = _workContext.Value.CurrentSite; + switch (site.ResourceDebugMode) { + case ResourceDebugMode.Enabled: + debugMode = true; + break; + case ResourceDebugMode.Disabled: + debugMode = false; + break; + default: + Debug.Assert(site.ResourceDebugMode == ResourceDebugMode.FromAppSetting, "Unknown ResourceDebugMode value."); + debugMode = _httpContextAccessor.Value.Current().IsDebuggingEnabled; + break; + } + var defaultSettings = new RequireSettings { + DebugMode = debugMode, + CdnMode = site.UseCdn, + Culture = _workContext.Value.CurrentCulture, + }; + var requiredResources = _resourceManager.Value.BuildRequiredResources(resourceType); + var appPath = _httpContextAccessor.Value.Current().Request.ApplicationPath; + foreach (var context in requiredResources.Where(r => + (includeLocation.HasValue ? r.Settings.Location == includeLocation.Value : true) && + (excludeLocation.HasValue ? r.Settings.Location != excludeLocation.Value : true))) { + + var path = context.GetResourceUrl(defaultSettings, appPath); + var condition = context.Settings.Condition; + var attributes = context.Settings.HasAttributes ? context.Settings.Attributes : null; + IHtmlString result; + if (resourceType == "stylesheet") { + result = Display.Style(Url: path, Condition: condition, Resource: context.Resource, TagAttributes: attributes); + } + else if (resourceType == "script") { + result = Display.Script(Url: path, Condition: condition, Resource: context.Resource, TagAttributes: attributes); + } + else { + result = Display.Resource(Url: path, Condition: condition, Resource: context.Resource, TagAttributes: attributes); + } + Output.Write(result); + } + } + + [Shape] + public IHtmlString Pager_Links(dynamic Shape, dynamic Display, + HtmlHelper Html, + int Page, + int PageSize, + double TotalItemCount, + int? Quantity, + object FirstText, + object PreviousText, + object NextText, + object LastText, + object GapText, + string PagerId + // parameter omitted to workaround an issue where a NullRef is thrown + // when an anonymous object is bound to an object shape parameter + /*object RouteValues*/) { + + var currentPage = Page; + if (currentPage < 1) + currentPage = 1; + + var pageSize = PageSize; + + var numberOfPagesToShow = Quantity ?? 0; + if (Quantity == null || Quantity < 0) + numberOfPagesToShow = 7; + + var totalPageCount = pageSize > 0 ? (int)Math.Ceiling(TotalItemCount / pageSize) : 1; + + var firstText = FirstText ?? T("<<"); + var previousText = PreviousText ?? T("<"); + var nextText = NextText ?? T(">"); + var lastText = LastText ?? T(">>"); + var gapText = GapText ?? T("..."); + + var routeData = new RouteValueDictionary(Html.ViewContext.RouteData.Values); + var queryString = _workContext.Value.HttpContext.Request.QueryString; + if (queryString != null) { + foreach (var key in from string key in queryString.Keys where key != null && !routeData.ContainsKey(key) let value = queryString[key] select key) { + routeData[key] = queryString[key]; + } + } + + // specific cross-requests route data can be passed to the shape directly (e.g., Orchard.Users) + var shapeRoute = (object)Shape.RouteData; + + if (shapeRoute != null) { + var shapeRouteData = shapeRoute as RouteValueDictionary; + if (shapeRouteData == null) { + var route = shapeRoute as RouteData; + if (route != null) { + shapeRouteData = (route).Values; + } + } + + if (shapeRouteData != null) { + foreach (var rd in shapeRouteData) { + routeData[rd.Key] = rd.Value; + } + } + } + + // HACK: MVC 3 is adding a specific value in System.Web.Mvc.Html.ChildActionExtensions.ActionHelper + // when a content item is set as home page, it is rendered by using Html.RenderAction, and the routeData is altered + // This code removes this extra route value + var removedKeys = routeData.Keys.Where(key => routeData[key] is DictionaryValueProvider).ToList(); + foreach (var key in removedKeys) { + routeData.Remove(key); + } + + int firstPage = Math.Max(1, Page - (numberOfPagesToShow / 2)); + int lastPage = Math.Min(totalPageCount, Page + (int)(numberOfPagesToShow / 2)); + + var pageKey = String.IsNullOrEmpty(PagerId) ? "page" : PagerId; + + Shape.Classes.Add("pager"); + Shape.Metadata.Alternates.Clear(); + Shape.Metadata.Type = "List"; + + // first and previous pages + if (Page > 1) { + if (routeData.ContainsKey(pageKey)) { + routeData.Remove(pageKey); // to keep from having "page=1" in the query string + } + // first + Shape.Add(New.Pager_First(Value: firstText, RouteValues: new RouteValueDictionary(routeData), Pager: Shape)); + + // previous + if (currentPage > 2) { // also to keep from having "page=1" in the query string + routeData[pageKey] = currentPage - 1; + } + Shape.Add(New.Pager_Previous(Value: previousText, RouteValues: new RouteValueDictionary(routeData), Pager: Shape)); + } + + // gap at the beginning of the pager + if (firstPage > 1 && numberOfPagesToShow > 0) { + Shape.Add(New.Pager_Gap(Value: gapText, Pager: Shape)); + } + + // page numbers + if (numberOfPagesToShow > 0 && lastPage > 1) { + for (var p = firstPage; p <= lastPage; p++) { + if (p == currentPage) { + Shape.Add(New.Pager_CurrentPage(Value: p, RouteValues: new RouteValueDictionary(routeData), Pager: Shape)); + } + else { + if (p == 1) + routeData.Remove(pageKey); + else + routeData[pageKey] = p; + Shape.Add(New.Pager_Link(Value: p, RouteValues: new RouteValueDictionary(routeData), Pager: Shape)); + } + } + } + + // gap at the end of the pager + if (lastPage < totalPageCount && numberOfPagesToShow > 0) { + Shape.Add(New.Pager_Gap(Value: gapText, Pager: Shape)); + } + + // next and last pages + if (Page < totalPageCount) { + // next + routeData[pageKey] = Page + 1; + Shape.Add(New.Pager_Next(Value: nextText, RouteValues: new RouteValueDictionary(routeData), Pager: Shape)); + // last + routeData[pageKey] = totalPageCount; + Shape.Add(New.Pager_Last(Value: lastText, RouteValues: new RouteValueDictionary(routeData), Pager: Shape)); + } + + return Display(Shape); + } + + [Shape] + public IHtmlString Pager(dynamic Shape, dynamic Display) { + Shape.Metadata.Alternates.Clear(); + Shape.Metadata.Type = "Pager_Links"; + return Display(Shape); + } + + [Shape] + public IHtmlString Pager_First(dynamic Shape, dynamic Display) { + Shape.Metadata.Alternates.Clear(); + Shape.Metadata.Type = "Pager_Link"; + return Display(Shape); + } + + [Shape] + public IHtmlString Pager_Previous(dynamic Shape, dynamic Display) { + Shape.Metadata.Alternates.Clear(); + Shape.Metadata.Type = "Pager_Link"; + return Display(Shape); + } + + [Shape] + public IHtmlString Pager_CurrentPage(HtmlHelper Html, dynamic Display, object Value) { + var tagBuilder = new TagBuilder("span"); + tagBuilder.InnerHtml = EncodeOrDisplay(Value, Display, Html).ToString(); + + return MvcHtmlString.Create(tagBuilder.ToString()); + } + + [Shape] + public IHtmlString Pager_Next(dynamic Shape, dynamic Display) { + Shape.Metadata.Alternates.Clear(); + Shape.Metadata.Type = "Pager_Link"; + return Display(Shape); + } + + [Shape] + public IHtmlString Pager_Last(dynamic Shape, dynamic Display) { + Shape.Metadata.Alternates.Clear(); + Shape.Metadata.Type = "Pager_Link"; + return Display(Shape); + } + + [Shape] + public IHtmlString Pager_Link(HtmlHelper Html, dynamic Shape, dynamic Display, object Value) { + Shape.Metadata.Alternates.Clear(); + Shape.Metadata.Type = "ActionLink"; + return Display(Shape); + } + + [Shape] + public IHtmlString ActionLink(HtmlHelper Html, UrlHelper Url, dynamic Shape, dynamic Display, object Value) { + var RouteValues = (object)Shape.RouteValues; + RouteValueDictionary rvd; + if (RouteValues == null) { + rvd = new RouteValueDictionary(); + } + else { + rvd = RouteValues is RouteValueDictionary ? (RouteValueDictionary)RouteValues : new RouteValueDictionary(RouteValues); + } + + var action = Url.Action((string)rvd["action"], (string)rvd["controller"], rvd); + + IEnumerable classes = Shape.Classes; + IDictionary attributes = Shape.Attributes; + attributes["href"] = action; + string id = Shape.Id; + var tag = GetTagBuilder("a", id, classes, attributes); + tag.InnerHtml = EncodeOrDisplay(Value, Display, Html).ToString(); + + return Html.Raw(tag.ToString()); + } + + [Shape] + public IHtmlString Pager_Gap(HtmlHelper Html, dynamic Display, object Value) { + var tagBuilder = new TagBuilder("span"); + tagBuilder.InnerHtml = EncodeOrDisplay(Value, Display, Html).ToString(); + + return MvcHtmlString.Create(tagBuilder.ToString()); + } + + [Shape] + public void List( + dynamic Display, + TextWriter Output, + IEnumerable Items, + string Tag, + string Id, + IEnumerable Classes, + IDictionary Attributes, + string ItemTag, + IEnumerable ItemClasses, + IDictionary ItemAttributes) { + + if (Items == null) + return; + + // prevent multiple enumerations + var items = Items.ToList(); + + // var itemDisplayOutputs = Items.Select(item => Display(item)).Where(output => !string.IsNullOrWhiteSpace(output.ToHtmlString())).ToList(); + var count = items.Count(); + if (count < 1) + return; + + string listTagName = null; + + if (Tag != "-") { + listTagName = string.IsNullOrEmpty(Tag) ? "ul" : Tag; + } + + var listTag = String.IsNullOrEmpty(listTagName) ? null : GetTagBuilder(listTagName, Id, Classes, Attributes); + + string itemTagName = null; + if (ItemTag != "-") { + itemTagName = string.IsNullOrEmpty(ItemTag) ? "li" : ItemTag; + } + + if (listTag != null) { + Output.Write(listTag.ToString(TagRenderMode.StartTag)); + } + + var itemTags = new List(); + var itemOutputs = new List(); + + // give the item shape the possibility to alter its container tag + var index = 0; + foreach (var item in items) { + + var itemTag = String.IsNullOrEmpty(itemTagName) ? null : GetTagBuilder(itemTagName, null, ItemClasses, ItemAttributes); + + if (item is IShape) { + item.Tag = itemTag; + } + + var itemOutput = Display(item).ToHtmlString(); + + if (!String.IsNullOrWhiteSpace(itemOutput)) { + itemTags.Add(itemTag); + itemOutputs.Add(itemOutput); + } + else { + count--; + } + + ++index; + } + + index = 0; + foreach(var itemOutput in itemOutputs) { + var itemTag = itemTags[index]; + + if (itemTag != null) { + if (index == 0) + itemTag.AddCssClass("first"); + if (index == count - 1) + itemTag.AddCssClass("last"); + Output.Write(itemTag.ToString(TagRenderMode.StartTag)); + } + + Output.Write(itemOutput); + + if (itemTag != null) { + Output.WriteLine(itemTag.ToString(TagRenderMode.EndTag)); + } + + ++index; + } + + if (listTag != null) { + Output.WriteLine(listTag.ToString(TagRenderMode.EndTag)); + } + } + + [Shape] + public IHtmlString PlaceChildContent(dynamic Source) { + return Source.Metadata.ChildContent; + } + + [Shape] + public void Partial(HtmlHelper Html, TextWriter Output, string TemplateName, object Model, string Prefix) { + RenderInternal(Html, Output, TemplateName, Model, Prefix); + } + + [Shape] + public void DisplayTemplate(HtmlHelper Html, TextWriter Output, string TemplateName, object Model, string Prefix) { + RenderInternal(Html, Output, "DisplayTemplates/" + TemplateName, Model, Prefix); + } + + [Shape] + public void EditorTemplate(HtmlHelper Html, TextWriter Output, string TemplateName, object Model, string Prefix) { + RenderInternal(Html, Output, "EditorTemplates/" + TemplateName, Model, Prefix); + } + + static void RenderInternal(HtmlHelper Html, TextWriter Output, string TemplateName, object Model, string Prefix) { + var adjustedViewData = new ViewDataDictionary(Html.ViewDataContainer.ViewData) { + Model = DetermineModel(Html, Model), + TemplateInfo = new TemplateInfo { + HtmlFieldPrefix = DeterminePrefix(Html, Prefix) + } + }; + var adjustedViewContext = new ViewContext(Html.ViewContext, Html.ViewContext.View, adjustedViewData, Html.ViewContext.TempData, Output); + var adjustedHtml = new HtmlHelper(adjustedViewContext, new ViewDataContainer(adjustedViewData)); + adjustedHtml.RenderPartial(TemplateName); + } + + static object DetermineModel(HtmlHelper Html, object Model) { + bool isNull = ((dynamic)Model) == null; + return isNull ? Html.ViewData.Model : Model; + } + + static string DeterminePrefix(HtmlHelper Html, string Prefix) { + var actualPrefix = string.IsNullOrEmpty(Prefix) + ? Html.ViewContext.ViewData.TemplateInfo.HtmlFieldPrefix + : Html.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldName(Prefix); + return actualPrefix; + } + + private class ViewDataContainer : IViewDataContainer { + public ViewDataContainer(ViewDataDictionary viewData) { ViewData = viewData; } + public ViewDataDictionary ViewData { get; set; } + } + + /// + /// Encodes dashed and dots so that they don't conflict in filenames + /// + /// + /// + private string EncodeAlternateElement(string alternateElement) { + return alternateElement.Replace("-", "__").Replace(".", "_"); + } + + /// + /// Encode a value if it's a string, or render it if it's a Shape + /// + private IHtmlString EncodeOrDisplay(dynamic Value, dynamic Display, HtmlHelper Html) { + if (Value is IHtmlString) { + return Value; + } + + if (Value is IShape) { + return Display(Value).ToString(); + } + + return Html.Raw(Html.Encode(Value.ToString())); + } + } +} diff --git a/src/Orchard.Web/Core/Shapes/DateTimeShapes.cs b/src/Orchard.Web/Core/Shapes/DateTimeShapes.cs index f63f4bedcb8..9c04667471e 100644 --- a/src/Orchard.Web/Core/Shapes/DateTimeShapes.cs +++ b/src/Orchard.Web/Core/Shapes/DateTimeShapes.cs @@ -1,74 +1,74 @@ -using System; -using System.Globalization; -using System.Web; -using System.Web.Mvc; -using Orchard.DisplayManagement; -using Orchard.Localization; -using Orchard.Localization.Services; -using Orchard.Mvc.Html; -using Orchard.Services; - -namespace Orchard.Core.Shapes { - public class DateTimeShapes : IDependency { - private readonly IClock _clock; - private readonly IDateLocalizationServices _dateLocalizationServices; - private readonly IDateTimeFormatProvider _dateTimeLocalization; - - public DateTimeShapes( - IClock clock, - IDateLocalizationServices dateLocalizationServices, - IDateTimeFormatProvider dateTimeLocalization - ) { - _clock = clock; - _dateLocalizationServices = dateLocalizationServices; - _dateTimeLocalization = dateTimeLocalization; - T = NullLocalizer.Instance; - } - - public Localizer T { get; set; } - - [Shape] - public IHtmlString DateTimeRelative(dynamic Display, DateTime DateTimeUtc, DateTime dateTimeUtc) { - DateTimeUtc = DateTimeUtc != System.DateTime.MinValue ? DateTimeUtc : dateTimeUtc; // Both capitalizations retained for compatibility. - var time = _clock.UtcNow - DateTimeUtc; - - if (time.TotalDays > 7 || time.TotalDays < -7) - return Display.DateTime(DateTimeUtc: DateTimeUtc, CustomFormat: null); - - if (time.TotalHours > 24) - return T.Plural("1 day ago", "{0} days ago", time.Days); - if (time.TotalHours < -24) - return T.Plural("in 1 day", "in {0} days", -time.Days); - - if (time.TotalMinutes > 60) - return T.Plural("1 hour ago", "{0} hours ago", time.Hours); - if (time.TotalMinutes < -60) - return T.Plural("in 1 hour", "in {0} hours", -time.Hours); - - if (time.TotalSeconds > 60) - return T.Plural("1 minute ago", "{0} minutes ago", time.Minutes); - if (time.TotalSeconds < -60) - return T.Plural("in 1 minute", "in {0} minutes", -time.Minutes); - - if (time.TotalSeconds > 10) - return T.Plural("1 second ago", "{0} seconds ago", time.Seconds); //aware that the singular won't be used - if (time.TotalSeconds < -10) - return T.Plural("in 1 second", "in {0} seconds", -time.Seconds); - - return time.TotalMilliseconds > 0 - ? T("a moment ago") - : T("in a moment"); - } - - [Shape] - public IHtmlString DateTime(DateTime DateTimeUtc, LocalizedString CustomFormat) { - //using a LocalizedString forces the caller to use a localizable format - - if (CustomFormat == null || String.IsNullOrWhiteSpace(CustomFormat.Text)) { - return new MvcHtmlString(_dateLocalizationServices.ConvertToLocalizedString(DateTimeUtc, _dateTimeLocalization.LongDateTimeFormat)); - } - - return new MvcHtmlString(_dateLocalizationServices.ConvertToLocalizedString(DateTimeUtc, CustomFormat.Text)); - } - } +using System; +using System.Globalization; +using System.Web; +using System.Web.Mvc; +using Orchard.DisplayManagement; +using Orchard.Localization; +using Orchard.Localization.Services; +using Orchard.Mvc.Html; +using Orchard.Services; + +namespace Orchard.Core.Shapes { + public class DateTimeShapes : IDependency { + private readonly IClock _clock; + private readonly IDateLocalizationServices _dateLocalizationServices; + private readonly IDateTimeFormatProvider _dateTimeLocalization; + + public DateTimeShapes( + IClock clock, + IDateLocalizationServices dateLocalizationServices, + IDateTimeFormatProvider dateTimeLocalization + ) { + _clock = clock; + _dateLocalizationServices = dateLocalizationServices; + _dateTimeLocalization = dateTimeLocalization; + T = NullLocalizer.Instance; + } + + public Localizer T { get; set; } + + [Shape] + public IHtmlString DateTimeRelative(dynamic Display, DateTime DateTimeUtc, DateTime dateTimeUtc) { + DateTimeUtc = DateTimeUtc != System.DateTime.MinValue ? DateTimeUtc : dateTimeUtc; // Both capitalizations retained for compatibility. + var time = _clock.UtcNow - DateTimeUtc; + + if (time.TotalDays > 7 || time.TotalDays < -7) + return Display.DateTime(DateTimeUtc: DateTimeUtc, CustomFormat: null); + + if (time.TotalHours > 24) + return T.Plural("1 day ago", "{0} days ago", time.Days); + if (time.TotalHours < -24) + return T.Plural("in 1 day", "in {0} days", -time.Days); + + if (time.TotalMinutes > 60) + return T.Plural("1 hour ago", "{0} hours ago", time.Hours); + if (time.TotalMinutes < -60) + return T.Plural("in 1 hour", "in {0} hours", -time.Hours); + + if (time.TotalSeconds > 60) + return T.Plural("1 minute ago", "{0} minutes ago", time.Minutes); + if (time.TotalSeconds < -60) + return T.Plural("in 1 minute", "in {0} minutes", -time.Minutes); + + if (time.TotalSeconds > 10) + return T.Plural("1 second ago", "{0} seconds ago", time.Seconds); //aware that the singular won't be used + if (time.TotalSeconds < -10) + return T.Plural("in 1 second", "in {0} seconds", -time.Seconds); + + return time.TotalMilliseconds > 0 + ? T("a moment ago") + : T("in a moment"); + } + + [Shape] + public IHtmlString DateTime(DateTime DateTimeUtc, LocalizedString CustomFormat) { + //using a LocalizedString forces the caller to use a localizable format + + if (CustomFormat == null || String.IsNullOrWhiteSpace(CustomFormat.Text)) { + return new MvcHtmlString(_dateLocalizationServices.ConvertToLocalizedString(DateTimeUtc, _dateTimeLocalization.LongDateTimeFormat)); + } + + return new MvcHtmlString(_dateLocalizationServices.ConvertToLocalizedString(DateTimeUtc, CustomFormat.Text)); + } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Shapes/Module.txt b/src/Orchard.Web/Core/Shapes/Module.txt index f6a18a85387..d48d0f49ac1 100644 --- a/src/Orchard.Web/Core/Shapes/Module.txt +++ b/src/Orchard.Web/Core/Shapes/Module.txt @@ -1,9 +1,9 @@ -Name: Shapes -AntiForgery: enabled -Author: The Orchard Team -Website: http://orchardproject.net -Version: 1.9.2 -OrchardVersion: 1.9 -Description: The shapes module contains core shape templates and display hooks. -FeatureDescription: Core shape templates and display hooks. -Category: Core +Name: Shapes +AntiForgery: enabled +Author: The Orchard Team +Website: http://orchardproject.net +Version: 1.9.2 +OrchardVersion: 1.9 +Description: The shapes module contains core shape templates and display hooks. +FeatureDescription: Core shape templates and display hooks. +Category: Core diff --git a/src/Orchard.Web/Core/Shapes/ResourceManifest.cs b/src/Orchard.Web/Core/Shapes/ResourceManifest.cs index 20bc2e965d0..9beb26f8484 100644 --- a/src/Orchard.Web/Core/Shapes/ResourceManifest.cs +++ b/src/Orchard.Web/Core/Shapes/ResourceManifest.cs @@ -1,19 +1,19 @@ -using Orchard.UI.Resources; - -namespace Orchard.Core.Shapes { - public class ResourceManifest : IResourceManifestProvider { - public void BuildManifests(ResourceManifestBuilder builder) { - var manifest = builder.Add(); - manifest.DefineScript("ShapesBase").SetUrl("base.js").SetDependencies("jQuery"); - manifest.DefineStyle("Shapes").SetUrl("site.css"); // todo: missing - manifest.DefineStyle("ShapesSpecial").SetUrl("special.css"); - - manifest.DefineScript("Html5Shiv").SetUrl("html5.js"); - - manifest.DefineScript("Switchable").SetUrl("jquery.switchable.js") - .SetDependencies("jQuery") - .SetDependencies("ShapesBase"); - manifest.DefineStyle("Switchable").SetUrl("jquery.switchable.css"); - } - } -} +using Orchard.UI.Resources; + +namespace Orchard.Core.Shapes { + public class ResourceManifest : IResourceManifestProvider { + public void BuildManifests(ResourceManifestBuilder builder) { + var manifest = builder.Add(); + manifest.DefineScript("ShapesBase").SetUrl("base.js").SetDependencies("jQuery"); + manifest.DefineStyle("Shapes").SetUrl("site.css"); // todo: missing + manifest.DefineStyle("ShapesSpecial").SetUrl("special.css"); + + manifest.DefineScript("Html5Shiv").SetUrl("html5.js"); + + manifest.DefineScript("Switchable").SetUrl("jquery.switchable.js") + .SetDependencies("jQuery") + .SetDependencies("ShapesBase"); + manifest.DefineStyle("Switchable").SetUrl("jquery.switchable.css"); + } + } +} diff --git a/src/Orchard.Web/Core/Shapes/Scripts/Web.config b/src/Orchard.Web/Core/Shapes/Scripts/Web.config index 74c71f22bd5..11135c33761 100644 --- a/src/Orchard.Web/Core/Shapes/Scripts/Web.config +++ b/src/Orchard.Web/Core/Shapes/Scripts/Web.config @@ -1,16 +1,16 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Shapes/Scripts/base.js b/src/Orchard.Web/Core/Shapes/Scripts/base.js index bde72033320..29e30428c57 100644 --- a/src/Orchard.Web/Core/Shapes/Scripts/base.js +++ b/src/Orchard.Web/Core/Shapes/Scripts/base.js @@ -1,355 +1,355 @@ -(function ($) { - // Some simple settings storage/retrieval - $.extend({ - orchard: { - __cookieName: "Orchrd", // Orchard, on a diet - __cookieExpiration: 180, // roughly 6 months - ___doCookiePathHack: null, - __doCookiePathHack: function (path) { - if ($.orchard.___doCookiePathHack != null) { - return $.orchard.___doCookiePathHack; - } - var testCookie = "__orchard__"; - $.cookie(testCookie, "1", { path: path }); - $.orchard.___doCookiePathHack = !$.cookie(testCookie); - $.cookie(testCookie, null); - return $.orchard.___doCookiePathHack; - }, - cookie: function (scope, value, options) { // a light-weight wrapper around $.cookie for an Orchard.* cookie name - // because some browsers are weird about the path - if (options && options.path && $.orchard.__doCookiePathHack(options.path)) { - options.path = options.path.substring(0, options.path.lastIndexOf("/")); - } - return $.cookie($.orchard.__cookieName + (scope ? scope.toLowerCase() : ""), value, options); - }, - cookiesInTheOrchard: function () { - return $.orchard.cookiesLike($.orchard.__cookieName); - }, - cookiesLike: function (name) { - var jar = []; - // taken from the $.cookie plugin to get all of the cookies that begin with the name - if (document.cookie && document.cookie != '') { - var cookies = document.cookie.split(';'); - for (var i = 0; i < cookies.length; i++) { - var cookie = jQuery.trim(cookies[i]); - // Does this cookie string begin with the name we want? - if (cookie.split("=")[0].substring(0, name.length) === (name)) { - jar.push(decodeURIComponent(cookie.substring(cookie.indexOf("=") + 1))); - } - } - } - return jar; - }, - setting: function (name, value, options) { // cookie-stored settings (only, at the moment) - if (value && value.path) { - options = value; - value = undefined; - } - var key = (name + ((options && !!options.key && ("-" + options.key)) || "")).replace(/\W+/g, "-"); - if (typeof value === "undefined") { // try to get the setting value from the default "root" cookie - var cookies = $.orchard.cookiesInTheOrchard(); - for (var i = 0; i < cookies.length; i++) { - var data = $.parseJSON(cookies[i]); - var value = data && data[key]; - if (typeof value !== "undefined") { - return value; - } - } - return undefined; - } - else { // store the setting value - the setting isn't removable by the way, setting to "" might be enough for most cases - var scope = (options && options.path && options.path.replace(/\W+/g, "-")) || ""; // this could become a problem with long paths as it's appended to the cookie name - var cookie = $.orchard.cookie(scope); - var newData = (cookie && $.parseJSON(cookie)) || {}; - newData[key] = value; - var dataString = (function (obj) { //todo: pull out into a seperate function - if (!obj) { return ""; } - var k, str = "{"; - for (k in obj) { // only really simple stringification - str = str + "\"" + k + "\":\"" + obj[k] + "\","; - } - if (str.length > 1) { - str = str.substring(0, str.length - 1); - } - return str + "}"; - })(newData); - $.orchard.cookie(scope, dataString, { expires: $.orchard.__cookieExpiration, path: (options && options.path) || "/" }); // todo: default path should be app path - } - } - } - }); - // Some input (auto)focus and input-controlled toggle - $.fn.extend({ - helpfullyFocus: function () { - var _this = $(this); - var firstError = _this.find(".input-validation-error").first(); - // try to focus the first error on the page - if (firstError.size() === 1) { - firstError.focus(); - return _this; - } - // or, give it up to the browser to autofocus - if ('autofocus' in document.createElement('input')) { - return _this; - } - // otherwise, make the autofocus attribute work - var autofocus = _this.find(":input[autofocus]").first(); - autofocus.focus(); - - return _this; - }, - helpfullyPlacehold: function () { - var _this = $(this); - - // give it up to the browser to handle placeholder text - if ('placeholder' in document.createElement('input')) { - return _this; - } - // otherwise, make the placeholder attribute work - $(":input[placeholder]") - .each(function () { - var _this = $(this); - if (_this.val() === "") { - _this.val(_this.attr("placeholder")).addClass("placeholderd"); - } - }) - .on("focus", function () { - var _this = $(this); - if (_this.val() === _this.attr("placeholder")) { - _this.val("").removeClass("placeholderd"); - } - }) - .on("blur", function () { - var _this = $(this); - if (_this.val() === "") { - _this.val(_this.attr("placeholder")).addClass("placeholderd"); - } - }); - - //make sure the placeholder value is not taken as the input value when submitting forms - $("form").on("submit", function () { - $(":input[placeholder].placeholderd").val(""); - }); - - return _this; - }, - toggleWhatYouControl: function () { - var _this = $(this); - var _controllees = $("[data-controllerid=" + _this.attr("id") + "]"); - - _controllees.each(function () { - var _controllee = $(this); - - var hiddenByDefault = _controllee.attr("data-defaultstate") == "hidden"; - var checkedOrSelected = _this.is(":checked") || _this.is(":selected"); - - if (checkedOrSelected) { - if (!hiddenByDefault) { - _controllee.hide().show(); // <- unhook this when the following comment applies - // _controllees.slideUp(200); // <- hook this back up when chrome behaves, or when I care less...or when chrome behaves - } else { - _controllee.hide(); - } - } else { - if (!hiddenByDefault) { - _controllee.hide(); - } else { - _controllee.show(); - } - } - }); - - _controllees.find("input").first().focus(); // <- aaaand a slideDown there...eventually - - return _this; - } - }); - // collapsable areas - anything with a data-controllerid attribute has its visibility controlled by the id-ed radio/checkbox - $(function () { - $("[data-controllerid]").each(function () { - var controller = $("#" + $(this).attr("data-controllerid")); - if (controller.data("isControlling")) { - return; - } - controller.data("isControlling", 1); - if (controller.is(":checkbox")) { - controller.click($(this).toggleWhatYouControl).each($(this).toggleWhatYouControl); - } else if (controller.is(":radio")) { - $("[name=" + controller.attr("name") + "]").click(function () { $("[name=" + $(this).attr("name") + "]").each($(this).toggleWhatYouControl); }); - } - else if (controller.is("option")) { - controller.parent().change(function() { - controller.toggleWhatYouControl(); - }); - controller.each($(this).toggleWhatYouControl); - } - }); - }); - // inline form link buttons (form.inline.link button) swapped out for a link that submits said form - $(function () { - $("form.inline.link").each(function () { - var _this = $(this); - var link = $(""); - var button = _this.children("button").first(); - link.text(button.text()) - .addClass(button.attr("class")) - .click(function () { _this.submit(); return false; }) - .unload(function () { _this = 0; }); - _this.replaceWith(link); - _this.css({ "position": "absolute", "left": "-9999em" }); - $("body").append(_this); - }); - }); - // some default value add behavior - $(function () { - $("body").helpfullyFocus() // (do) a little better autofocus - .helpfullyPlacehold(); // pick up on placeholders - - }); - // UnsafeUrl links -> form POST - //todo: need some real microdata support eventually (incl. revisiting usage of data-* attributes) - $(function () { - var magicToken = $("input[name=__RequestVerificationToken]").first(); - if (!magicToken) { return; } // no sense in continuing if form POSTS will fail - $("body").on("click", "a[itemprop~=UnsafeUrl], a[data-unsafe-url]", function() { - var _this = $(this); - var hrefParts = _this.attr("href").split("?"); - var form = $(""); - form.append(magicToken.clone()); - if (hrefParts.length > 1) { - var queryParts = hrefParts[1].split("&"); - for (var i = 0; i < queryParts.length; i++) { - var queryPartKVP = queryParts[i].split("="); - //trusting hrefs in the page here - form.append($("")); - } - } - form.css({ "position": "absolute", "left": "-9999em" }); - $("body").append(form); - - var unsafeUrlPrompt = _this.data("unsafe-url"); - - if (unsafeUrlPrompt && unsafeUrlPrompt.length > 0) { - if (!confirm(unsafeUrlPrompt)) { - return false; - } - } - - if (_this.filter("[itemprop~='RemoveUrl']").length == 1) { - // use a custom message if its set in data-message - var dataMessage = _this.data('message'); - if (dataMessage === undefined) { - dataMessage = confirmRemoveMessage; - } - - if (!confirm(dataMessage)) { - return false; - } - } - - form.submit(); - return false; - - }); - }); -})(jQuery); - -/////////////////////////////////////////////////////////////// -// --- some plugins leaned on by core script components // -/////////////////////////////////////////////////////////////// -/** - * Cookie plugin - * - * Copyright (c) 2006 Klaus Hartl (stilbuero.de) - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - * - */ - -/** - * Create a cookie with the given name and value and other optional parameters. - * - * @example $.cookie('the_cookie', 'the_value'); - * @desc Set the value of a cookie. - * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true }); - * @desc Create a cookie with all available options. - * @example $.cookie('the_cookie', 'the_value'); - * @desc Create a session cookie. - * @example $.cookie('the_cookie', null); - * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain - * used when the cookie was set. - * - * @param String name The name of the cookie. - * @param String value The value of the cookie. - * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. - * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. - * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. - * If set to null or omitted, the cookie will be a session cookie and will not be retained - * when the the browser exits. - * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). - * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). - * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will - * require a secure protocol (like HTTPS). - * @type undefined - * - * @name $.cookie - * @cat Plugins/Cookie - * @author Klaus Hartl/klaus.hartl@stilbuero.de - */ - -/** - * Get the value of a cookie with the given name. - * - * @example $.cookie('the_cookie'); - * @desc Get the value of a cookie. - * - * @param String name The name of the cookie. - * @return The value of the cookie. - * @type String - * - * @name $.cookie - * @cat Plugins/Cookie - * @author Klaus Hartl/klaus.hartl@stilbuero.de - */ -jQuery.cookie = function(name, value, options) { - if (typeof value != 'undefined') { // name and value given, set cookie - options = options || {}; - if (value === null) { - value = ''; - options.expires = -1; - } - var expires = ''; - if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { - var date; - if (typeof options.expires == 'number') { - date = new Date(); - date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); - } else { - date = options.expires; - } - expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE - } - // CAUTION: Needed to parenthesize options.path and options.domain - // in the following expressions, otherwise they evaluate to undefined - // in the packed version for some reason... - var path = options.path ? '; path=' + (options.path) : ''; - var domain = options.domain ? '; domain=' + (options.domain) : ''; - var secure = options.secure ? '; secure' : ''; - document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); - } else { // only name given, get cookie - var cookieValue = null; - if (document.cookie && document.cookie != '') { - var cookies = document.cookie.split(';'); - for (var i = 0; i < cookies.length; i++) { - var cookie = jQuery.trim(cookies[i]); - // Does this cookie string begin with the name we want? - if (cookie.substring(0, name.length + 1) == (name + '=')) { - cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); - break; - } - } - } - return cookieValue; - } +(function ($) { + // Some simple settings storage/retrieval + $.extend({ + orchard: { + __cookieName: "Orchrd", // Orchard, on a diet + __cookieExpiration: 180, // roughly 6 months + ___doCookiePathHack: null, + __doCookiePathHack: function (path) { + if ($.orchard.___doCookiePathHack != null) { + return $.orchard.___doCookiePathHack; + } + var testCookie = "__orchard__"; + $.cookie(testCookie, "1", { path: path }); + $.orchard.___doCookiePathHack = !$.cookie(testCookie); + $.cookie(testCookie, null); + return $.orchard.___doCookiePathHack; + }, + cookie: function (scope, value, options) { // a light-weight wrapper around $.cookie for an Orchard.* cookie name + // because some browsers are weird about the path + if (options && options.path && $.orchard.__doCookiePathHack(options.path)) { + options.path = options.path.substring(0, options.path.lastIndexOf("/")); + } + return $.cookie($.orchard.__cookieName + (scope ? scope.toLowerCase() : ""), value, options); + }, + cookiesInTheOrchard: function () { + return $.orchard.cookiesLike($.orchard.__cookieName); + }, + cookiesLike: function (name) { + var jar = []; + // taken from the $.cookie plugin to get all of the cookies that begin with the name + if (document.cookie && document.cookie != '') { + var cookies = document.cookie.split(';'); + for (var i = 0; i < cookies.length; i++) { + var cookie = jQuery.trim(cookies[i]); + // Does this cookie string begin with the name we want? + if (cookie.split("=")[0].substring(0, name.length) === (name)) { + jar.push(decodeURIComponent(cookie.substring(cookie.indexOf("=") + 1))); + } + } + } + return jar; + }, + setting: function (name, value, options) { // cookie-stored settings (only, at the moment) + if (value && value.path) { + options = value; + value = undefined; + } + var key = (name + ((options && !!options.key && ("-" + options.key)) || "")).replace(/\W+/g, "-"); + if (typeof value === "undefined") { // try to get the setting value from the default "root" cookie + var cookies = $.orchard.cookiesInTheOrchard(); + for (var i = 0; i < cookies.length; i++) { + var data = $.parseJSON(cookies[i]); + var value = data && data[key]; + if (typeof value !== "undefined") { + return value; + } + } + return undefined; + } + else { // store the setting value - the setting isn't removable by the way, setting to "" might be enough for most cases + var scope = (options && options.path && options.path.replace(/\W+/g, "-")) || ""; // this could become a problem with long paths as it's appended to the cookie name + var cookie = $.orchard.cookie(scope); + var newData = (cookie && $.parseJSON(cookie)) || {}; + newData[key] = value; + var dataString = (function (obj) { //todo: pull out into a seperate function + if (!obj) { return ""; } + var k, str = "{"; + for (k in obj) { // only really simple stringification + str = str + "\"" + k + "\":\"" + obj[k] + "\","; + } + if (str.length > 1) { + str = str.substring(0, str.length - 1); + } + return str + "}"; + })(newData); + $.orchard.cookie(scope, dataString, { expires: $.orchard.__cookieExpiration, path: (options && options.path) || "/" }); // todo: default path should be app path + } + } + } + }); + // Some input (auto)focus and input-controlled toggle + $.fn.extend({ + helpfullyFocus: function () { + var _this = $(this); + var firstError = _this.find(".input-validation-error").first(); + // try to focus the first error on the page + if (firstError.size() === 1) { + firstError.focus(); + return _this; + } + // or, give it up to the browser to autofocus + if ('autofocus' in document.createElement('input')) { + return _this; + } + // otherwise, make the autofocus attribute work + var autofocus = _this.find(":input[autofocus]").first(); + autofocus.focus(); + + return _this; + }, + helpfullyPlacehold: function () { + var _this = $(this); + + // give it up to the browser to handle placeholder text + if ('placeholder' in document.createElement('input')) { + return _this; + } + // otherwise, make the placeholder attribute work + $(":input[placeholder]") + .each(function () { + var _this = $(this); + if (_this.val() === "") { + _this.val(_this.attr("placeholder")).addClass("placeholderd"); + } + }) + .on("focus", function () { + var _this = $(this); + if (_this.val() === _this.attr("placeholder")) { + _this.val("").removeClass("placeholderd"); + } + }) + .on("blur", function () { + var _this = $(this); + if (_this.val() === "") { + _this.val(_this.attr("placeholder")).addClass("placeholderd"); + } + }); + + //make sure the placeholder value is not taken as the input value when submitting forms + $("form").on("submit", function () { + $(":input[placeholder].placeholderd").val(""); + }); + + return _this; + }, + toggleWhatYouControl: function () { + var _this = $(this); + var _controllees = $("[data-controllerid=" + _this.attr("id") + "]"); + + _controllees.each(function () { + var _controllee = $(this); + + var hiddenByDefault = _controllee.attr("data-defaultstate") == "hidden"; + var checkedOrSelected = _this.is(":checked") || _this.is(":selected"); + + if (checkedOrSelected) { + if (!hiddenByDefault) { + _controllee.hide().show(); // <- unhook this when the following comment applies + // _controllees.slideUp(200); // <- hook this back up when chrome behaves, or when I care less...or when chrome behaves + } else { + _controllee.hide(); + } + } else { + if (!hiddenByDefault) { + _controllee.hide(); + } else { + _controllee.show(); + } + } + }); + + _controllees.find("input").first().focus(); // <- aaaand a slideDown there...eventually + + return _this; + } + }); + // collapsable areas - anything with a data-controllerid attribute has its visibility controlled by the id-ed radio/checkbox + $(function () { + $("[data-controllerid]").each(function () { + var controller = $("#" + $(this).attr("data-controllerid")); + if (controller.data("isControlling")) { + return; + } + controller.data("isControlling", 1); + if (controller.is(":checkbox")) { + controller.click($(this).toggleWhatYouControl).each($(this).toggleWhatYouControl); + } else if (controller.is(":radio")) { + $("[name=" + controller.attr("name") + "]").click(function () { $("[name=" + $(this).attr("name") + "]").each($(this).toggleWhatYouControl); }); + } + else if (controller.is("option")) { + controller.parent().change(function() { + controller.toggleWhatYouControl(); + }); + controller.each($(this).toggleWhatYouControl); + } + }); + }); + // inline form link buttons (form.inline.link button) swapped out for a link that submits said form + $(function () { + $("form.inline.link").each(function () { + var _this = $(this); + var link = $(""); + var button = _this.children("button").first(); + link.text(button.text()) + .addClass(button.attr("class")) + .click(function () { _this.submit(); return false; }) + .unload(function () { _this = 0; }); + _this.replaceWith(link); + _this.css({ "position": "absolute", "left": "-9999em" }); + $("body").append(_this); + }); + }); + // some default value add behavior + $(function () { + $("body").helpfullyFocus() // (do) a little better autofocus + .helpfullyPlacehold(); // pick up on placeholders + + }); + // UnsafeUrl links -> form POST + //todo: need some real microdata support eventually (incl. revisiting usage of data-* attributes) + $(function () { + var magicToken = $("input[name=__RequestVerificationToken]").first(); + if (!magicToken) { return; } // no sense in continuing if form POSTS will fail + $("body").on("click", "a[itemprop~=UnsafeUrl], a[data-unsafe-url]", function() { + var _this = $(this); + var hrefParts = _this.attr("href").split("?"); + var form = $(""); + form.append(magicToken.clone()); + if (hrefParts.length > 1) { + var queryParts = hrefParts[1].split("&"); + for (var i = 0; i < queryParts.length; i++) { + var queryPartKVP = queryParts[i].split("="); + //trusting hrefs in the page here + form.append($("")); + } + } + form.css({ "position": "absolute", "left": "-9999em" }); + $("body").append(form); + + var unsafeUrlPrompt = _this.data("unsafe-url"); + + if (unsafeUrlPrompt && unsafeUrlPrompt.length > 0) { + if (!confirm(unsafeUrlPrompt)) { + return false; + } + } + + if (_this.filter("[itemprop~='RemoveUrl']").length == 1) { + // use a custom message if its set in data-message + var dataMessage = _this.data('message'); + if (dataMessage === undefined) { + dataMessage = confirmRemoveMessage; + } + + if (!confirm(dataMessage)) { + return false; + } + } + + form.submit(); + return false; + + }); + }); +})(jQuery); + +/////////////////////////////////////////////////////////////// +// --- some plugins leaned on by core script components // +/////////////////////////////////////////////////////////////// +/** + * Cookie plugin + * + * Copyright (c) 2006 Klaus Hartl (stilbuero.de) + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + */ + +/** + * Create a cookie with the given name and value and other optional parameters. + * + * @example $.cookie('the_cookie', 'the_value'); + * @desc Set the value of a cookie. + * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true }); + * @desc Create a cookie with all available options. + * @example $.cookie('the_cookie', 'the_value'); + * @desc Create a session cookie. + * @example $.cookie('the_cookie', null); + * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain + * used when the cookie was set. + * + * @param String name The name of the cookie. + * @param String value The value of the cookie. + * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. + * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. + * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. + * If set to null or omitted, the cookie will be a session cookie and will not be retained + * when the the browser exits. + * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). + * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). + * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will + * require a secure protocol (like HTTPS). + * @type undefined + * + * @name $.cookie + * @cat Plugins/Cookie + * @author Klaus Hartl/klaus.hartl@stilbuero.de + */ + +/** + * Get the value of a cookie with the given name. + * + * @example $.cookie('the_cookie'); + * @desc Get the value of a cookie. + * + * @param String name The name of the cookie. + * @return The value of the cookie. + * @type String + * + * @name $.cookie + * @cat Plugins/Cookie + * @author Klaus Hartl/klaus.hartl@stilbuero.de + */ +jQuery.cookie = function(name, value, options) { + if (typeof value != 'undefined') { // name and value given, set cookie + options = options || {}; + if (value === null) { + value = ''; + options.expires = -1; + } + var expires = ''; + if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { + var date; + if (typeof options.expires == 'number') { + date = new Date(); + date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); + } else { + date = options.expires; + } + expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE + } + // CAUTION: Needed to parenthesize options.path and options.domain + // in the following expressions, otherwise they evaluate to undefined + // in the packed version for some reason... + var path = options.path ? '; path=' + (options.path) : ''; + var domain = options.domain ? '; domain=' + (options.domain) : ''; + var secure = options.secure ? '; secure' : ''; + document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); + } else { // only name given, get cookie + var cookieValue = null; + if (document.cookie && document.cookie != '') { + var cookies = document.cookie.split(';'); + for (var i = 0; i < cookies.length; i++) { + var cookie = jQuery.trim(cookies[i]); + // Does this cookie string begin with the name we want? + if (cookie.substring(0, name.length + 1) == (name + '=')) { + cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); + break; + } + } + } + return cookieValue; + } }; \ No newline at end of file diff --git a/src/Orchard.Web/Core/Shapes/Scripts/html5.js b/src/Orchard.Web/Core/Shapes/Scripts/html5.js index ac2b31d6be6..0b8553f80b6 100644 --- a/src/Orchard.Web/Core/Shapes/Scripts/html5.js +++ b/src/Orchard.Web/Core/Shapes/Scripts/html5.js @@ -1,3 +1,3 @@ -// HTML5 Shiv v3 | @jon_neal @afarkas @rem | MIT/GPL2 Licensed -// Uncompressed source: https://github.com/aFarkas/html5shiv +// HTML5 Shiv v3 | @jon_neal @afarkas @rem | MIT/GPL2 Licensed +// Uncompressed source: https://github.com/aFarkas/html5shiv (function (a, b) { function f(a) { var c, d, e, f; b.documentMode > 7 ? (c = b.createElement("font"), c.setAttribute("data-html5shiv", a.nodeName.toLowerCase())) : c = b.createElement("shiv:" + a.nodeName); while (a.firstChild) c.appendChild(a.childNodes[0]); for (d = a.attributes, e = d.length, f = 0; f < e; ++f) d[f].specified && c.setAttribute(d[f].nodeName, d[f].nodeValue); c.style.cssText = a.style.cssText, a.parentNode.replaceChild(c, a), c.originalElement = a } function g(a) { var b = a.originalElement; while (a.childNodes.length) b.appendChild(a.childNodes[0]); a.parentNode.replaceChild(b, a) } function h(a, b) { b = b || "all"; var c = -1, d = [], e = a.length, f, g; while (++c < e) { f = a[c], g = f.media || b; if (f.disabled || !/print|all/.test(g)) continue; d.push(h(f.imports, g), f.cssText) } return d.join("") } function i(c) { var d = new RegExp("(^|[\\s,{}])(" + a.html5.elements.join("|") + ")", "gi"), e = c.split("{"), f = e.length, g = -1; while (++g < f) e[g] = e[g].split("}"), b.documentMode > 7 ? e[g][e[g].length - 1] = e[g][e[g].length - 1].replace(d, '$1font[data-html5shiv="$2"]') : e[g][e[g].length - 1] = e[g][e[g].length - 1].replace(d, "$1shiv\\:$2"), e[g] = e[g].join("}"); return e.join("{") } var c = function (a) { return a.innerHTML = "", a.childNodes.length === 1 } (b.createElement("a")), d = function (a, b, c) { return b.appendChild(a), (c = (c ? c(a) : a.currentStyle).display) && b.removeChild(a) && c === "block" } (b.createElement("nav"), b.documentElement, a.getComputedStyle), e = { elements: "abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "), shivDocument: function (a) { a = a || b; if (a.documentShived) return; a.documentShived = !0; var f = a.createElement, g = a.createDocumentFragment, h = a.getElementsByTagName("head")[0], i = function (a) { f(a) }; c || (e.elements.join(" ").replace(/\w+/g, i), a.createElement = function (a) { var b = f(a); return b.canHaveChildren && e.shivDocument(b.document), b }, a.createDocumentFragment = function () { return e.shivDocument(g()) }); if (!d && h) { var j = f("div"); j.innerHTML = ["x"].join(""), h.insertBefore(j.lastChild, h.firstChild) } return a } }; e.shivDocument(b), a.html5 = e; if (c || !a.attachEvent) return; a.attachEvent("onbeforeprint", function () { if (a.html5.supportsXElement || !b.namespaces) return; b.namespaces.shiv || b.namespaces.add("shiv"); var c = -1, d = new RegExp("^(" + a.html5.elements.join("|") + ")$", "i"), e = b.getElementsByTagName("*"), g = e.length, j, k = i(h(function (a, b) { var c = [], d = a.length; while (d) c.unshift(a[--d]); d = b.length; while (d) c.unshift(b[--d]); c.sort(function (a, b) { return a.sourceIndex - b.sourceIndex }), d = c.length; while (d) c[--d] = c[d].styleSheet; return c } (b.getElementsByTagName("style"), b.getElementsByTagName("link")))); while (++c < g) j = e[c], d.test(j.nodeName) && f(j); b.appendChild(b._shivedStyleSheet = b.createElement("style")).styleSheet.cssText = k }), a.attachEvent("onafterprint", function () { if (a.html5.supportsXElement || !b.namespaces) return; var c = -1, d = b.getElementsByTagName("*"), e = d.length, f; while (++c < e) f = d[c], f.originalElement && g(f); b._shivedStyleSheet && b._shivedStyleSheet.parentNode.removeChild(b._shivedStyleSheet) }) })(this, document) \ No newline at end of file diff --git a/src/Orchard.Web/Core/Shapes/Scripts/jquery.switchable.js b/src/Orchard.Web/Core/Shapes/Scripts/jquery.switchable.js index 5cca7a88377..6d173d459a1 100644 --- a/src/Orchard.Web/Core/Shapes/Scripts/jquery.switchable.js +++ b/src/Orchard.Web/Core/Shapes/Scripts/jquery.switchable.js @@ -1,32 +1,32 @@ -(function ($) { - $.fn.extend({ - powerUpTheSwitch: function () { - var _this = $(this); - var theSwitch = $("
        •  
        "); - - var summarySwitch = theSwitch.find(".summary-view").click(function () { $(this).switchToSummaryView(_this); }); - var detailSwitch = theSwitch.find(".detail-view").click(function () { $(this).switchToDetailView(_this); }); - - var setting = $.orchard.setting("switchable", { path: document.location.pathname }) - || (_this.hasClass("summary-view") ? "summary-view" : "detail-view"); - if (setting === "summary-view") { - summarySwitch.switchToSummaryView(_this); - } else { - detailSwitch.switchToDetailView(_this); - } - - theSwitch.insertBefore(_this); - }, - switchToDetailView: function (switched) { - $.orchard.setting("switchable", "detail-view", { path: document.location.pathname }); - $(this).closest(".switch-for-switchable").addClass("detail-switched").removeClass("summary-switched"); - switched.addClass("detail-view").removeClass("summary-view"); - }, - switchToSummaryView: function (switched) { - $.orchard.setting("switchable", "summary-view", { path: document.location.pathname }); - $(this).closest(".switch-for-switchable").addClass("summary-switched").removeClass("detail-switched"); - switched.addClass("summary-view").removeClass("detail-view"); - } - }); - $(".switchable").powerUpTheSwitch(); +(function ($) { + $.fn.extend({ + powerUpTheSwitch: function () { + var _this = $(this); + var theSwitch = $("
        •  
        "); + + var summarySwitch = theSwitch.find(".summary-view").click(function () { $(this).switchToSummaryView(_this); }); + var detailSwitch = theSwitch.find(".detail-view").click(function () { $(this).switchToDetailView(_this); }); + + var setting = $.orchard.setting("switchable", { path: document.location.pathname }) + || (_this.hasClass("summary-view") ? "summary-view" : "detail-view"); + if (setting === "summary-view") { + summarySwitch.switchToSummaryView(_this); + } else { + detailSwitch.switchToDetailView(_this); + } + + theSwitch.insertBefore(_this); + }, + switchToDetailView: function (switched) { + $.orchard.setting("switchable", "detail-view", { path: document.location.pathname }); + $(this).closest(".switch-for-switchable").addClass("detail-switched").removeClass("summary-switched"); + switched.addClass("detail-view").removeClass("summary-view"); + }, + switchToSummaryView: function (switched) { + $.orchard.setting("switchable", "summary-view", { path: document.location.pathname }); + $(this).closest(".switch-for-switchable").addClass("summary-switched").removeClass("detail-switched"); + switched.addClass("summary-view").removeClass("detail-view"); + } + }); + $(".switchable").powerUpTheSwitch(); })(jQuery); \ No newline at end of file diff --git a/src/Orchard.Web/Core/Shapes/Styles/Web.config b/src/Orchard.Web/Core/Shapes/Styles/Web.config index 74c71f22bd5..11135c33761 100644 --- a/src/Orchard.Web/Core/Shapes/Styles/Web.config +++ b/src/Orchard.Web/Core/Shapes/Styles/Web.config @@ -1,16 +1,16 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Shapes/Styles/jquery.switchable.css b/src/Orchard.Web/Core/Shapes/Styles/jquery.switchable.css index 705c15e459f..50b8b37bd19 100644 --- a/src/Orchard.Web/Core/Shapes/Styles/jquery.switchable.css +++ b/src/Orchard.Web/Core/Shapes/Styles/jquery.switchable.css @@ -1,48 +1,48 @@ -.switch-for-switchable { - margin:0 0; - overflow:auto; -} -.switch-for-switchable .switch-button-group { - float:right; - padding:4px 0; -} -.switch-for-switchable .switch-button { - background: #F5F5F5; - border:1px solid #999999; - color:#2D2F25; - cursor:pointer; - display:block; - float:left; - text-align:center; - height:24px; - width:24px; -} -.switch-for-switchable .summary-view { - background:url("images/summary-view.gif") no-repeat left top; - border-right:1px solid #bcbcbc; - border-radius:2px 0 0 2px; - -moz-border-radius:2px 0 0 2px; - -webkit-border-radius:2px 0 0 2px; -} -.switch-for-switchable.summary-switched .summary-view { - background:url("images/summary-view-on.gif") no-repeat left top; - border-color:#487328; - cursor:default; -} -.switch-for-switchable .detail-view { - background:url("images/detail-view.gif") no-repeat left top; - border-right:1px solid #898989; - border-radius:0 2px 2px 0; - -moz-border-radius:0 2px 2px 0; - -webkit-border-radius:0 2px 2px 0; -} -.switch-for-switchable.detail-switched .detail-view { - background:url("images/detail-view-on.gif") no-repeat left top; - border-color:#487328; - cursor:default; -} - -/* RTL */ -.dir-rtl .switch-for-switchable .switch-button-group { - float: left; +.switch-for-switchable { + margin:0 0; + overflow:auto; +} +.switch-for-switchable .switch-button-group { + float:right; + padding:4px 0; +} +.switch-for-switchable .switch-button { + background: #F5F5F5; + border:1px solid #999999; + color:#2D2F25; + cursor:pointer; + display:block; + float:left; + text-align:center; + height:24px; + width:24px; +} +.switch-for-switchable .summary-view { + background:url("images/summary-view.gif") no-repeat left top; + border-right:1px solid #bcbcbc; + border-radius:2px 0 0 2px; + -moz-border-radius:2px 0 0 2px; + -webkit-border-radius:2px 0 0 2px; +} +.switch-for-switchable.summary-switched .summary-view { + background:url("images/summary-view-on.gif") no-repeat left top; + border-color:#487328; + cursor:default; +} +.switch-for-switchable .detail-view { + background:url("images/detail-view.gif") no-repeat left top; + border-right:1px solid #898989; + border-radius:0 2px 2px 0; + -moz-border-radius:0 2px 2px 0; + -webkit-border-radius:0 2px 2px 0; +} +.switch-for-switchable.detail-switched .detail-view { + background:url("images/detail-view-on.gif") no-repeat left top; + border-color:#487328; + cursor:default; +} + +/* RTL */ +.dir-rtl .switch-for-switchable .switch-button-group { + float: left; } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Shapes/Styles/special.css b/src/Orchard.Web/Core/Shapes/Styles/special.css index aa4033e4303..063a78eabc3 100644 --- a/src/Orchard.Web/Core/Shapes/Styles/special.css +++ b/src/Orchard.Web/Core/Shapes/Styles/special.css @@ -1,39 +1,39 @@ -.managewrapper, -.managewrapper .manage { - border:1px dashed #ccc; - z-index:9999; -} -.managewrapper:hover, -.managewrapper:hover .manage { - border-color:#8f8f8f; -} -.managewrapper { - padding:2px 0; - position:relative; -} -.managewrapper .manage { - border-style:solid; - border-top:0; - border-right:0; - display:none; - margin:0; - overflow:hidden; - position:absolute; - right:0; - top:0; -} -.managewrapper:hover .manage { - display:block; -} -.managewrapper .manage a { - background-color:#4687ad; - color:#fff; - display:block; - font:14px/14px Segoe UI,Trebuchet,Arial,Sans-Serif; - height:16px; - padding:1px 3px; -} -.managewrapper .manage a:hover { - background-color:#ffac40; - color:#fff; +.managewrapper, +.managewrapper .manage { + border:1px dashed #ccc; + z-index:9999; +} +.managewrapper:hover, +.managewrapper:hover .manage { + border-color:#8f8f8f; +} +.managewrapper { + padding:2px 0; + position:relative; +} +.managewrapper .manage { + border-style:solid; + border-top:0; + border-right:0; + display:none; + margin:0; + overflow:hidden; + position:absolute; + right:0; + top:0; +} +.managewrapper:hover .manage { + display:block; +} +.managewrapper .manage a { + background-color:#4687ad; + color:#fff; + display:block; + font:14px/14px Segoe UI,Trebuchet,Arial,Sans-Serif; + height:16px; + padding:1px 3px; +} +.managewrapper .manage a:hover { + background-color:#ffac40; + color:#fff; } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Shapes/Views/Breadcrumb.cshtml b/src/Orchard.Web/Core/Shapes/Views/Breadcrumb.cshtml index 98dc9a662c9..4e5c2a5031c 100644 --- a/src/Orchard.Web/Core/Shapes/Views/Breadcrumb.cshtml +++ b/src/Orchard.Web/Core/Shapes/Views/Breadcrumb.cshtml @@ -1,18 +1,18 @@ -@{ - // Model is Model.Menu from the layout (Layout.Menu) - var tag = Tag(Model, "ul"); - tag.AddCssClass("breadcrumb"); - - var items = (IList)Enumerable.Cast(Model.Items); - - if(items.Any()) { - items[0].Classes.Add("first"); - items[items.Count - 1].Classes.Add("last"); - } -} -